UNPKG

@neo4j-ndl/react

Version:

React implementation of Neo4j Design System

220 lines (219 loc) 6.69 kB
/** * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import { jsx as _jsx } from "react/jsx-runtime"; import isChromatic from 'chromatic/isChromatic'; import { Select } from '../../index'; import { SelectAsync, SelectAsyncSource, SelectClean, SelectCleanSource, SelectControlled, SelectControlledSource, SelectCreatable, SelectCreatableSource, SelectCustomLabel, SelectCustomLabelSource, SelectDefault, SelectDefaultSource, SelectDisabled, SelectDisabledSource, SelectEmpty, SelectEmptySource, SelectErrorState, SelectErrorStateSource, SelectInsideDialog, SelectInsideDialogSource, SelectMenuPositionings, SelectMenuPositioningsSource, SelectMulti, SelectMultiSource, SelectSizes, SelectSizesSource, } from '.'; const centeredContainerDecorator = (Story) => (_jsx("div", { className: "n-flex n-justify-center", children: _jsx(Story, {}) })); const widthDecorator = (Story) => (_jsx("div", { className: "n-w-80", children: _jsx(Story, {}) })); const fullSizeDecorator = (Story) => (_jsx("div", { className: "n-w-full n-h-full", children: _jsx(Story, {}) })); const componentMeta = { component: Select, decorators: [centeredContainerDecorator], id: 'components-select', parameters: { controls: { disable: true }, }, tags: ['docsPage'], title: 'Components/Select', }; export default componentMeta; export const Default = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectDefaultSource, language: 'tsx', type: 'code', }, }, }, render: SelectDefault, }; export const Async = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectAsyncSource, language: 'tsx', type: 'code', }, }, }, render: SelectAsync, }; export const Creatable = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectCreatableSource, language: 'tsx', type: 'code', }, }, }, render: SelectCreatable, }; export const Controlled = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectControlledSource, language: 'tsx', type: 'code', }, }, }, render: SelectControlled, }; export const MultipleSelections = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectMultiSource, language: 'tsx', type: 'code', }, }, }, render: SelectMulti, }; export const Empty = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectEmptySource, language: 'tsx', type: 'code', }, }, }, render: SelectEmpty, }; export const ErrorState = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectErrorStateSource, language: 'tsx', type: 'code', }, }, }, render: SelectErrorState, }; export const Disabled = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectDisabledSource, language: 'tsx', type: 'code', }, }, }, render: SelectDisabled, }; export const Clean = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectCleanSource, language: 'tsx', type: 'code', }, }, }, render: SelectClean, }; export const CustomLabel = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], parameters: { docs: { source: { code: SelectCustomLabelSource, language: 'tsx', type: 'code', }, }, }, render: SelectCustomLabel, }; export const Sizes = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, parameters: { docs: { source: { code: SelectSizesSource, language: 'tsx', type: 'code', }, }, }, render: SelectSizes, }; export const MenuPositionings = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, parameters: { docs: { source: { code: SelectMenuPositioningsSource, language: 'tsx', type: 'code', }, }, }, render: SelectMenuPositionings, }; export const InDialog = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [fullSizeDecorator], parameters: { docs: { source: { code: SelectInsideDialogSource, language: 'tsx', type: 'code', }, }, }, render: SelectInsideDialog, }; //# sourceMappingURL=select.stories.js.map