UNPKG

@neo4j-ndl/react

Version:

React implementation of Neo4j Design System

226 lines (225 loc) 7.04 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/>. */ "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.InsideModal = exports.MenuPositionings = exports.Sizes = exports.CustomLabel = exports.Clean = exports.Disabled = exports.ErrorState = exports.Empty = exports.MultipleSelections = exports.Controlled = exports.Creatable = exports.Async = exports.Default = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const isChromatic_1 = __importDefault(require("chromatic/isChromatic")); const index_1 = require("../../index"); const _1 = require("."); const centeredContainerDecorator = (Story) => ((0, jsx_runtime_1.jsx)("div", { className: "n-flex n-justify-center", children: (0, jsx_runtime_1.jsx)(Story, {}) })); const widthDecorator = (Story) => ((0, jsx_runtime_1.jsx)("div", { className: "n-w-80", children: (0, jsx_runtime_1.jsx)(Story, {}) })); const fullSizeDecorator = (Story) => ((0, jsx_runtime_1.jsx)("div", { className: "n-w-full n-h-full", children: (0, jsx_runtime_1.jsx)(Story, {}) })); const componentMeta = { title: 'Components/Select', id: 'components-select', component: index_1.Select, tags: ['docsPage'], parameters: { controls: { disable: true }, }, decorators: [centeredContainerDecorator], }; exports.default = componentMeta; exports.Default = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectDefault, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectDefaultSource, }, }, }, }; exports.Async = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectAsync, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectAsyncSource, }, }, }, }; exports.Creatable = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectCreatable, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectCreatableSource, }, }, }, }; exports.Controlled = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectControlled, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectControlledSource, }, }, }, }; exports.MultipleSelections = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectMulti, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectMultiSource, }, }, }, }; exports.Empty = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectEmpty, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectEmptySource, }, }, }, }; exports.ErrorState = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectErrorState, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectErrorStateSource, }, }, }, }; exports.Disabled = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectDisabled, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectDisabledSource, }, }, }, }; exports.Clean = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectClean, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectCleanSource, }, }, }, }; exports.CustomLabel = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [widthDecorator], render: _1.SelectCustomLabel, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectCustomLabelSource, }, }, }, }; exports.Sizes = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, render: _1.SelectSizes, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectSizesSource, }, }, }, }; exports.MenuPositionings = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, render: _1.SelectMenuPositionings, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectMenuPositioningsSource, }, }, }, }; exports.InsideModal = { args: { selectProps: { menuIsOpen: (0, isChromatic_1.default)() || undefined } }, decorators: [fullSizeDecorator], render: _1.SelectInsideModal, parameters: { docs: { source: { language: 'tsx', type: 'code', code: _1.SelectInsideModalSource, }, }, }, }; //# sourceMappingURL=select.stories.js.map