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, SelectInsideModal, SelectInsideModalSource, 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 = { title: 'Components/Select', id: 'components-select', component: Select, tags: ['docsPage'], parameters: { controls: { disable: true }, }, decorators: [centeredContainerDecorator], }; export default componentMeta; export const Default = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectDefault, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectDefaultSource, }, }, }, }; export const Async = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectAsync, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectAsyncSource, }, }, }, }; export const Creatable = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectCreatable, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectCreatableSource, }, }, }, }; export const Controlled = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectControlled, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectControlledSource, }, }, }, }; export const MultipleSelections = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectMulti, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectMultiSource, }, }, }, }; export const Empty = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectEmpty, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectEmptySource, }, }, }, }; export const ErrorState = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectErrorState, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectErrorStateSource, }, }, }, }; export const Disabled = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectDisabled, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectDisabledSource, }, }, }, }; export const Clean = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectClean, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectCleanSource, }, }, }, }; export const CustomLabel = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [widthDecorator], render: SelectCustomLabel, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectCustomLabelSource, }, }, }, }; export const Sizes = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, render: SelectSizes, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectSizesSource, }, }, }, }; export const MenuPositionings = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, render: SelectMenuPositionings, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectMenuPositioningsSource, }, }, }, }; export const InsideModal = { args: { selectProps: { menuIsOpen: isChromatic() || undefined } }, decorators: [fullSizeDecorator], render: SelectInsideModal, parameters: { docs: { source: { language: 'tsx', type: 'code', code: SelectInsideModalSource, }, }, }, }; //# sourceMappingURL=select.stories.js.map