@agility/plenum-ui 1.3.50 → 2.0.0-rc10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +6 -0
- package/.prettierrc +12 -12
- package/.storybook/Layout.jsx +9 -6
- package/.storybook/head.tsx +4 -0
- package/.storybook/main.ts +18 -0
- package/.storybook/manager-head.html +1 -0
- package/.storybook/manager.ts +25 -0
- package/.storybook/plenumTheme.ts +8 -0
- package/.storybook/preview-head.html +4 -0
- package/.storybook/preview.tsx +28 -0
- package/.vscode/settings.json +4 -0
- package/.yarnrc.yml +1 -0
- package/README.md +165 -53
- package/app/globals.css +99 -0
- package/app/head.tsx +59 -0
- package/app/layout.tsx +28 -0
- package/app/page.tsx +7 -0
- package/build.js +41 -0
- package/dist/index.d.ts +1117 -0
- package/dist/index.js +6296 -0
- package/dist/index.js.map +7 -0
- package/dist/lib/tailwind.css +63535 -0
- package/{lib/components → dist/types/stories/atoms}/Avatar/Avatar.d.ts +28 -27
- package/dist/types/stories/atoms/Avatar/index.d.ts +3 -0
- package/dist/types/stories/atoms/badges/Badge.d.ts +21 -0
- package/dist/types/stories/atoms/badges/index.d.ts +3 -0
- package/dist/types/stories/atoms/buttons/Button/Alternative/Alternative.stories.d.ts +14 -0
- package/dist/types/stories/atoms/buttons/Button/Button.d.ts +35 -0
- package/dist/types/stories/atoms/buttons/Button/Danger/Danger.stories.d.ts +14 -0
- package/dist/types/stories/atoms/buttons/Button/Primary/Primary.stories.d.ts +14 -0
- package/dist/types/stories/atoms/buttons/Button/Secondary/Secondary.stories.d.ts +14 -0
- package/dist/types/stories/atoms/buttons/Button/defaultArgs.d.ts +3 -0
- package/dist/types/stories/atoms/buttons/Button/index.d.ts +3 -0
- package/dist/types/stories/atoms/buttons/Capsule/Alternative/Alternative.stories.d.ts +6 -0
- package/dist/types/stories/atoms/buttons/Capsule/Capsule.d.ts +27 -0
- package/dist/types/stories/atoms/buttons/Capsule/Danger/Danger.stories.d.ts +6 -0
- package/dist/types/stories/atoms/buttons/Capsule/Primary/Primary.stories.d.ts +6 -0
- package/dist/types/stories/atoms/buttons/Capsule/Secondary/Secondary.stories.d.ts +6 -0
- package/dist/types/stories/atoms/buttons/Capsule/index.d.ts +3 -0
- package/dist/types/stories/atoms/buttons/index.d.ts +4 -0
- package/{lib/components/DynamicIcons/DynamicIcons.d.ts → dist/types/stories/atoms/icons/DynamicIcon.d.ts} +20 -18
- package/dist/types/stories/atoms/icons/DynamicIcon.stories.d.ts +10 -0
- package/dist/types/stories/atoms/icons/IconWithShadow.d.ts +6 -0
- package/dist/types/stories/atoms/icons/IconWithShadow.stories.d.ts +10 -0
- package/{lib/components/DynamicIcons → dist/types/stories/atoms/icons}/TablerIcon.d.ts +9 -9
- package/dist/types/stories/atoms/icons/index.d.ts +4 -0
- package/dist/types/stories/atoms/icons/tablerIconNames.d.ts +2 -0
- package/dist/types/stories/atoms/index.d.ts +7 -0
- package/dist/types/stories/atoms/loaders/Loader.d.ts +6 -0
- package/dist/types/stories/atoms/loaders/Loader.stories.d.ts +6 -0
- package/dist/types/stories/atoms/loaders/NProgress/RadialProgress.d.ts +11 -0
- package/dist/types/stories/atoms/loaders/NProgress/index.d.ts +3 -0
- package/dist/types/stories/atoms/loaders/index.d.ts +4 -0
- package/dist/types/stories/index.d.ts +5 -0
- package/dist/types/stories/layouts/index.d.ts +0 -0
- package/dist/types/stories/molecules/index.d.ts +3 -0
- package/{lib/components/Forms → dist/types/stories/molecules/inputs}/InputCounter/InputCounter.d.ts +10 -9
- package/dist/types/stories/molecules/inputs/InputCounter/index.d.ts +2 -0
- package/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +30 -0
- package/dist/types/stories/molecules/inputs/InputField/index.d.ts +3 -0
- package/{lib/components/Forms → dist/types/stories/molecules/inputs}/InputLabel/InputLabel.d.ts +15 -14
- package/dist/types/stories/molecules/inputs/InputLabel/index.d.ts +3 -0
- package/dist/types/stories/molecules/inputs/NestedInputButton/NestedInputButton.d.ts +17 -0
- package/dist/types/stories/molecules/inputs/NestedInputButton/index.d.ts +3 -0
- package/{lib/components/Forms → dist/types/stories/molecules/inputs}/TextInput/TextInput.d.ts +39 -39
- package/dist/types/stories/molecules/inputs/TextInput/index.d.ts +4 -0
- package/{lib/components/Forms/Checkbox → dist/types/stories/molecules/inputs/checkbox}/Checkbox.d.ts +28 -27
- package/dist/types/stories/molecules/inputs/checkbox/Checkbox.stories.d.ts +6 -0
- package/dist/types/stories/molecules/inputs/checkbox/index.d.ts +3 -0
- package/{lib/components/Combobox/Combobox.d.ts → dist/types/stories/molecules/inputs/combobox/ComboBox.d.ts} +34 -34
- package/dist/types/stories/molecules/inputs/combobox/ComboBox.stories.d.ts +6 -0
- package/dist/types/stories/molecules/inputs/combobox/index.d.ts +3 -0
- package/dist/types/stories/molecules/inputs/index.d.ts +12 -0
- package/{lib/components/Forms/Radio → dist/types/stories/molecules/inputs/radio}/Radio.d.ts +27 -27
- package/dist/types/stories/molecules/inputs/radio/Radio.stories.d.ts +6 -0
- package/dist/types/stories/molecules/inputs/radio/index.d.ts +3 -0
- package/{lib/components/Forms/Select → dist/types/stories/molecules/inputs/select}/Select.d.ts +27 -27
- package/dist/types/stories/molecules/inputs/select/Select.stories.d.ts +6 -0
- package/dist/types/stories/molecules/inputs/select/index.d.ts +3 -0
- package/{lib/components/Forms/Textarea/Textarea.d.ts → dist/types/stories/molecules/inputs/textArea/TextArea.d.ts} +35 -32
- package/dist/types/stories/molecules/inputs/textArea/TextArea.stories.d.ts +6 -0
- package/dist/types/stories/molecules/inputs/textArea/index.d.ts +3 -0
- package/dist/types/stories/molecules/inputs/toggleSwitch/ToggleSwitch.d.ts +18 -0
- package/dist/types/stories/molecules/inputs/toggleSwitch/index.d.ts +3 -0
- package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +18 -0
- package/dist/types/stories/organisms/AnimatedLabelInput/index.d.ts +3 -0
- package/dist/types/stories/organisms/ButtonDropdown/ButtonDropdown.d.ts +14 -0
- package/dist/types/stories/organisms/ButtonDropdown/index.d.ts +3 -0
- package/{lib/components/Dropdown/Dropdown.d.ts → dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts} +36 -39
- package/dist/types/stories/organisms/DropdownComponent/dropdownItems.d.ts +3 -0
- package/dist/types/stories/organisms/DropdownComponent/index.d.ts +4 -0
- package/dist/types/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.d.ts +19 -0
- package/dist/types/stories/organisms/EmptySectionPlaceholder/index.d.ts +3 -0
- package/dist/types/stories/organisms/FormInputWithAddons/FormInputWithAddons.d.ts +21 -0
- package/dist/types/stories/organisms/FormInputWithAddons/index.d.ts +3 -0
- package/{lib/components/Forms/TextInputSelect/InputSelect → dist/types/stories/organisms/TextInputSelect}/InputSelect.d.ts +16 -13
- package/{lib/components/Forms → dist/types/stories/organisms}/TextInputSelect/TextInputSelect.d.ts +48 -48
- package/dist/types/stories/organisms/TextInputSelect/index.d.ts +3 -0
- package/dist/types/stories/organisms/index.d.ts +8 -0
- package/dist/types/utils/types.d.ts +2 -0
- package/dist/types/utils/useId.d.ts +1 -0
- package/next.config.js +8 -0
- package/package.json +55 -78
- package/pages/api/hello.ts +13 -0
- package/postcss.config.js +5 -6
- package/public/next.svg +1 -0
- package/public/thirteen.svg +1 -0
- package/public/vercel.svg +1 -0
- package/scripts/create-component.js +97 -0
- package/stories/Introduction.mdx +314 -0
- package/stories/assets/code-brackets.svg +1 -0
- package/stories/assets/colors.svg +1 -0
- package/stories/assets/comments.svg +1 -0
- package/stories/assets/direction.svg +1 -0
- package/stories/assets/flow.svg +1 -0
- package/stories/assets/plugin.svg +1 -0
- package/stories/assets/repo.svg +1 -0
- package/stories/assets/stackalt.svg +1 -0
- package/stories/atoms/Avatar/Avatar.stories.tsx +96 -0
- package/stories/atoms/Avatar/Avatar.tsx +123 -0
- package/stories/atoms/Avatar/index.ts +3 -0
- package/stories/atoms/badges/Badge.tsx +127 -0
- package/stories/atoms/badges/Pill/Pill.stories.tsx +75 -0
- package/stories/atoms/badges/Rounded/Rounded.stories.tsx +75 -0
- package/stories/atoms/badges/index.ts +3 -0
- package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +76 -0
- package/stories/atoms/buttons/Button/Button.tsx +146 -0
- package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +78 -0
- package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +85 -0
- package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +81 -0
- package/stories/atoms/buttons/Button/defaultArgs.ts +9 -0
- package/stories/atoms/buttons/Button/index.ts +3 -0
- package/stories/atoms/buttons/Capsule/Alternative/Alternative.stories.ts +27 -0
- package/stories/atoms/buttons/Capsule/Capsule.tsx +87 -0
- package/stories/atoms/buttons/Capsule/Danger/Danger.stories.ts +27 -0
- package/stories/atoms/buttons/Capsule/Primary/Primary.stories.ts +27 -0
- package/stories/atoms/buttons/Capsule/Secondary/Secondary.stories.ts +27 -0
- package/stories/atoms/buttons/Capsule/index.ts +3 -0
- package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.stories.tsx +15 -0
- package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.tsx +22 -0
- package/stories/atoms/buttons/FloatingActionButton/index.tsx +3 -0
- package/stories/atoms/buttons/index.ts +4 -0
- package/stories/atoms/crumb/Crumb.stories.tsx +18 -0
- package/stories/atoms/crumb/Crumb.tsx +22 -0
- package/stories/atoms/crumb/index.tsx +3 -0
- package/stories/atoms/icons/DynamicIcon.stories.ts +43 -0
- package/stories/atoms/icons/DynamicIcon.tsx +90 -0
- package/stories/atoms/icons/IconWithShadow.stories.ts +43 -0
- package/stories/atoms/icons/IconWithShadow.tsx +16 -0
- package/stories/atoms/icons/TablerIcon.tsx +22 -0
- package/stories/atoms/icons/index.tsx +14 -0
- package/stories/atoms/icons/tablerIconNames.ts +4336 -0
- package/stories/atoms/index.ts +46 -0
- package/stories/atoms/loaders/Loader.stories.ts +15 -0
- package/stories/atoms/loaders/Loader.tsx +15 -0
- package/stories/atoms/loaders/NProgress/RadialProgress.stories.tsx +19 -0
- package/stories/atoms/loaders/NProgress/RadialProgress.tsx +76 -0
- package/stories/atoms/loaders/NProgress/index.ts +3 -0
- package/stories/atoms/loaders/index.ts +4 -0
- package/stories/index.ts +134 -0
- package/stories/layouts/CardLayout/CardLayout.stories.tsx +18 -0
- package/stories/layouts/CardLayout/CardLayout.tsx +22 -0
- package/stories/layouts/CardLayout/index.tsx +3 -0
- package/stories/layouts/ModalLayout/ModalLayout.stories.tsx +18 -0
- package/stories/layouts/ModalLayout/ModalLayout.tsx +22 -0
- package/stories/layouts/ModalLayout/index.tsx +3 -0
- package/stories/layouts/index.ts +0 -0
- package/stories/molecules/index.ts +51 -0
- package/stories/molecules/inputs/InputCounter/InputCounter.stories.tsx +18 -0
- package/stories/molecules/inputs/InputCounter/InputCounter.tsx +24 -0
- package/stories/molecules/inputs/InputCounter/index.tsx +3 -0
- package/stories/molecules/inputs/InputField/InputField.stories.tsx +29 -0
- package/stories/molecules/inputs/InputField/InputField.tsx +94 -0
- package/stories/molecules/inputs/InputField/index.tsx +3 -0
- package/stories/molecules/inputs/InputLabel/InputLabel.stories.tsx +19 -0
- package/stories/molecules/inputs/InputLabel/InputLabel.tsx +45 -0
- package/stories/molecules/inputs/InputLabel/index.tsx +3 -0
- package/stories/molecules/inputs/NestedInputButton/NestedInputButton.stories.tsx +52 -0
- package/stories/molecules/inputs/NestedInputButton/NestedInputButton.tsx +64 -0
- package/stories/molecules/inputs/NestedInputButton/index.tsx +3 -0
- package/stories/molecules/inputs/TextInput/TextInput.stories.tsx +32 -0
- package/stories/molecules/inputs/TextInput/TextInput.tsx +162 -0
- package/stories/molecules/inputs/TextInput/index.tsx +5 -0
- package/stories/molecules/inputs/checkbox/Checkbox.stories.ts +23 -0
- package/stories/molecules/inputs/checkbox/Checkbox.tsx +99 -0
- package/stories/molecules/inputs/checkbox/index.ts +3 -0
- package/stories/molecules/inputs/combobox/ComboBox.stories.ts +41 -0
- package/stories/molecules/inputs/combobox/ComboBox.tsx +194 -0
- package/stories/molecules/inputs/combobox/index.ts +3 -0
- package/stories/molecules/inputs/index.ts +38 -0
- package/stories/molecules/inputs/radio/Radio.stories.ts +27 -0
- package/stories/molecules/inputs/radio/Radio.tsx +92 -0
- package/stories/molecules/inputs/radio/index.ts +3 -0
- package/stories/molecules/inputs/select/Select.stories.ts +23 -0
- package/stories/molecules/inputs/select/Select.tsx +100 -0
- package/stories/molecules/inputs/select/index.ts +3 -0
- package/stories/molecules/inputs/textArea/TextArea.stories.ts +22 -0
- package/stories/molecules/inputs/textArea/TextArea.tsx +128 -0
- package/stories/molecules/inputs/textArea/index.ts +3 -0
- package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.stories.tsx +119 -0
- package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +75 -0
- package/stories/molecules/inputs/toggleSwitch/index.ts +3 -0
- package/stories/molecules/tabs/Tabs.stories.tsx +18 -0
- package/stories/molecules/tabs/Tabs.tsx +22 -0
- package/stories/molecules/tabs/index.tsx +3 -0
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +21 -0
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +60 -0
- package/stories/organisms/AnimatedLabelInput/index.tsx +3 -0
- package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +118 -0
- package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +81 -0
- package/stories/organisms/ButtonDropdown/index.tsx +3 -0
- package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +49 -0
- package/stories/organisms/DropdownComponent/Dropdown.test.tsx +0 -0
- package/stories/organisms/DropdownComponent/DropdownComponent.tsx +300 -0
- package/stories/organisms/DropdownComponent/dropdownItems.ts +101 -0
- package/stories/organisms/DropdownComponent/index.ts +4 -0
- package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +76 -0
- package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.tsx +52 -0
- package/stories/organisms/EmptySectionPlaceholder/index.tsx +3 -0
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +29 -0
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +140 -0
- package/stories/organisms/FormInputWithAddons/index.tsx +3 -0
- package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -0
- package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -0
- package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -0
- package/stories/organisms/TextInputSelect/index.tsx +3 -0
- package/stories/organisms/index.ts +18 -0
- package/tailwind.config.js +165 -36
- package/tsconfig.json +27 -21
- package/tsconfig.lib.json +19 -0
- package/utils/types.d.ts +2 -0
- package/utils/types.ts +3 -0
- package/utils/useId.d.ts +1 -0
- package/utils/useId.tsx +16 -0
- package/.babelrc +0 -14
- package/.editorconfig +0 -9
- package/.eslintrc +0 -13
- package/.github/workflows/test.yml +0 -27
- package/.storybook/main.js +0 -17
- package/.storybook/manager.js +0 -6
- package/.storybook/plenumTheme.js +0 -8
- package/.storybook/preview.js +0 -44
- package/_templates/component/new/component.ejs.t +0 -18
- package/_templates/component/new/component.stories.ejs.t +0 -21
- package/_templates/component/new/component.test.ejs.t +0 -15
- package/_templates/component/new/index.ejs.t +0 -6
- package/_templates/component/new/prompt.js +0 -7
- package/jest.config.js +0 -8
- package/lib/common/brandCfg.d.ts +0 -3
- package/lib/common/index.d.ts +0 -3
- package/lib/common/storyCfg.d.ts +0 -5
- package/lib/components/Avatar/Avatar.stories.d.ts +0 -6
- package/lib/components/Avatar/Avatar.test.d.ts +0 -1
- package/lib/components/Avatar/index.d.ts +0 -1
- package/lib/components/Button/Button.d.ts +0 -55
- package/lib/components/Button/Button.stories.d.ts +0 -12
- package/lib/components/Button/Button.test.d.ts +0 -1
- package/lib/components/Button/index.d.ts +0 -1
- package/lib/components/ButtonDropdown/ButtonDropdown.d.ts +0 -12
- package/lib/components/ButtonDropdown/ButtonDropdown.stories.d.ts +0 -9
- package/lib/components/ButtonDropdown/index.d.ts +0 -1
- package/lib/components/Combobox/Combobox.stories.d.ts +0 -14
- package/lib/components/Combobox/Combobox.test.d.ts +0 -1
- package/lib/components/Combobox/index.d.ts +0 -1
- package/lib/components/Dropdown/Dropdown.stories.d.ts +0 -8
- package/lib/components/Dropdown/Dropdown.test.d.ts +0 -1
- package/lib/components/Dropdown/data.d.ts +0 -3
- package/lib/components/Dropdown/index.d.ts +0 -1
- package/lib/components/DynamicIcons/DynamicIcons.stories.d.ts +0 -9
- package/lib/components/DynamicIcons/index.d.ts +0 -3
- package/lib/components/DynamicIcons/tablerIconNames.d.ts +0 -2
- package/lib/components/Forms/BaseField/BaseField.d.ts +0 -34
- package/lib/components/Forms/BaseField/BaseField.stories.d.ts +0 -6
- package/lib/components/Forms/BaseField/BaseField.test.d.ts +0 -1
- package/lib/components/Forms/BaseField/index.d.ts +0 -1
- package/lib/components/Forms/Checkbox/Checkbox.stories.d.ts +0 -14
- package/lib/components/Forms/Checkbox/Checkbox.test.d.ts +0 -1
- package/lib/components/Forms/Checkbox/index.d.ts +0 -1
- package/lib/components/Forms/InputCounter/InputCounter.stories.d.ts +0 -6
- package/lib/components/Forms/InputCounter/InputCounter.test.d.ts +0 -1
- package/lib/components/Forms/InputCounter/index.d.ts +0 -1
- package/lib/components/Forms/InputLabel/InputLabel.stories.d.ts +0 -6
- package/lib/components/Forms/InputLabel/InputLabel.test.d.ts +0 -1
- package/lib/components/Forms/InputLabel/index.d.ts +0 -1
- package/lib/components/Forms/Radio/Radio.stories.d.ts +0 -12
- package/lib/components/Forms/Radio/Radio.test.d.ts +0 -1
- package/lib/components/Forms/Radio/index.d.ts +0 -1
- package/lib/components/Forms/Select/Select.stories.d.ts +0 -11
- package/lib/components/Forms/Select/Select.test.d.ts +0 -1
- package/lib/components/Forms/Select/index.d.ts +0 -1
- package/lib/components/Forms/TextInput/TextInput.stories.d.ts +0 -12
- package/lib/components/Forms/TextInput/index.d.ts +0 -1
- package/lib/components/Forms/TextInputAddon/InputCta/InputCta.d.ts +0 -16
- package/lib/components/Forms/TextInputAddon/InputCta/InputCta.stories.d.ts +0 -6
- package/lib/components/Forms/TextInputAddon/InputCta/InputCta.test.d.ts +0 -1
- package/lib/components/Forms/TextInputAddon/InputCta/index.d.ts +0 -1
- package/lib/components/Forms/TextInputAddon/TextInputAddon.d.ts +0 -54
- package/lib/components/Forms/TextInputAddon/TextInputAddon.stories.d.ts +0 -13
- package/lib/components/Forms/TextInputAddon/index.d.ts +0 -1
- package/lib/components/Forms/TextInputSelect/InputSelect/InputSelect.stories.d.ts +0 -6
- package/lib/components/Forms/TextInputSelect/InputSelect/InputSelect.test.d.ts +0 -1
- package/lib/components/Forms/TextInputSelect/InputSelect/index.d.ts +0 -1
- package/lib/components/Forms/TextInputSelect/TextInputSelect.stories.d.ts +0 -8
- package/lib/components/Forms/TextInputSelect/index.d.ts +0 -1
- package/lib/components/Forms/Textarea/Textarea.stories.d.ts +0 -12
- package/lib/components/Forms/Textarea/Textarea.test.d.ts +0 -1
- package/lib/components/Forms/Textarea/index.d.ts +0 -1
- package/lib/components/ToggleSwitch/ToggleSwitch.d.ts +0 -28
- package/lib/components/ToggleSwitch/ToggleSwitch.stories.d.ts +0 -21
- package/lib/components/ToggleSwitch/ToggleSwitch.test.d.ts +0 -1
- package/lib/components/ToggleSwitch/index.d.ts +0 -1
- package/lib/components/TreeView/TreeView.d.ts +0 -36
- package/lib/components/TreeView/TreeView.stories.d.ts +0 -6
- package/lib/components/TreeView/TreeView.test.d.ts +0 -1
- package/lib/components/TreeView/index.d.ts +0 -1
- package/lib/components/TreeView V1/TreeItem/TreeItem.d.ts +0 -16
- package/lib/components/TreeView V1/TreeItem/TreeItem.stories.d.ts +0 -9
- package/lib/components/TreeView V1/TreeItem/TreeItem.test.d.ts +0 -1
- package/lib/components/TreeView V1/TreeItem/index.d.ts +0 -1
- package/lib/components/TreeView V1/TreeView.d.ts +0 -6
- package/lib/components/TreeView V1/TreeView.stories.d.ts +0 -6
- package/lib/components/TreeView V1/TreeView.test.d.ts +0 -1
- package/lib/components/TreeView V1/context.d.ts +0 -9
- package/lib/components/TreeView V1/index.d.ts +0 -1
- package/lib/components/TreeView V1/sampleData.d.ts +0 -71
- package/lib/components/TreeView V1/types/tree.types.d.ts +0 -21
- package/lib/index.d.ts +0 -13
- package/lib/index.esm.js +0 -105883
- package/lib/index.esm.js.map +0 -1
- package/lib/index.js +0 -105922
- package/lib/index.js.map +0 -1
- package/lib/page/TreeNavigation/CustomNode/CustomNode.d.ts +0 -3
- package/lib/page/TreeNavigation/CustomNode/CustomNode.test.d.ts +0 -1
- package/lib/page/TreeNavigation/CustomNode/index.d.ts +0 -1
- package/lib/page/TreeNavigation/TreeNavigation.d.ts +0 -8
- package/lib/page/TreeNavigation/TreeNavigation.stories.d.ts +0 -6
- package/lib/page/TreeNavigation/hooks/useFetch.d.ts +0 -14
- package/lib/page/TreeNavigation/index.d.ts +0 -1
- package/lib/tailwind.css +0 -2023
- package/lib/util/DynamicIcons.d.ts +0 -10
- package/lib/util/Loader.d.ts +0 -5
- package/lib/util/types.d.ts +0 -2
- package/lib/util/useID.d.ts +0 -1
- package/rollup.config.js +0 -37
- package/setupTests.js +0 -6
- package/styleMock.js +0 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { FC } from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
|
|
4
|
+
export interface IInputLabelProps {
|
|
5
|
+
/** Prop comment */
|
|
6
|
+
isPlaceholder?: boolean
|
|
7
|
+
id: string
|
|
8
|
+
isRequired?: boolean
|
|
9
|
+
isDisabled?: boolean
|
|
10
|
+
isError?: boolean
|
|
11
|
+
isActive?: boolean
|
|
12
|
+
isFocused?: boolean
|
|
13
|
+
label?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Comment */
|
|
17
|
+
const InputLabel: FC<IInputLabelProps> = ({
|
|
18
|
+
isPlaceholder = false,
|
|
19
|
+
id,
|
|
20
|
+
isRequired,
|
|
21
|
+
isDisabled,
|
|
22
|
+
isActive,
|
|
23
|
+
isError,
|
|
24
|
+
label
|
|
25
|
+
}: IInputLabelProps) => {
|
|
26
|
+
const labelStyles = cn(
|
|
27
|
+
"z-[2]",
|
|
28
|
+
{ "inline-block font-medium transition-all text-sm text-gray-700 mb-1": !isPlaceholder },
|
|
29
|
+
{ "inline-block font-medium ml-2 relative transition-all": isPlaceholder },
|
|
30
|
+
{ "text-sm text-gray-400 px-2 top-8": isPlaceholder && !isActive },
|
|
31
|
+
{ "text-xs text-gray-700 px-1 top-[10px] bg-white": isPlaceholder && isActive },
|
|
32
|
+
{ "text-xs text-red-500 px-1 top-[10px] bg-white": isPlaceholder && isError },
|
|
33
|
+
{ "text-red-500 bg-white": !isPlaceholder && isError },
|
|
34
|
+
{ "text-gray-700/[.5]": isDisabled }
|
|
35
|
+
)
|
|
36
|
+
if (!label) return null
|
|
37
|
+
return (
|
|
38
|
+
<label htmlFor={id} className={labelStyles}>
|
|
39
|
+
{label}
|
|
40
|
+
{isRequired && <span className="text-red-500"> *</span>}
|
|
41
|
+
</label>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default InputLabel
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import NestedInputButton, { INestedInputButtonProps } from "./NestedInputButton"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof NestedInputButton> = {
|
|
5
|
+
title: "Design System/molecules/inputs/Nested Input Button",
|
|
6
|
+
component: NestedInputButton,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {},
|
|
9
|
+
parameters: {
|
|
10
|
+
design: {
|
|
11
|
+
type: "figma",
|
|
12
|
+
url: "https://www.figma.com/file/Rb5fJ8hD3pwvLnidgCaGgB/Agility-UI?type=design&node-id=114-2290&mode=dev&device-scaling=100%25&page-id=0%3A1"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof NestedInputButton>
|
|
19
|
+
|
|
20
|
+
export const RightAligned: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
icon: {
|
|
23
|
+
icon: "IconSearch",
|
|
24
|
+
className: "h-5 w-5 text-gray-400"
|
|
25
|
+
},
|
|
26
|
+
ctaLabel: "Search",
|
|
27
|
+
align: "right",
|
|
28
|
+
isClear: false,
|
|
29
|
+
onClickHandler: () => window.alert("Clicked"),
|
|
30
|
+
buttonProps: {
|
|
31
|
+
type: "button"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const LeftAligned: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
...RightAligned.args,
|
|
38
|
+
align: "left"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export const IsClear: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
...RightAligned.args,
|
|
44
|
+
isClear: true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export const NoIcon: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
...RightAligned.args,
|
|
50
|
+
icon: undefined
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { DynamicIcon, IDynamicIconProps } from "@/stories/atoms/icons"
|
|
3
|
+
import { default as cn } from "classnames"
|
|
4
|
+
export interface INestedInputButtonProps {
|
|
5
|
+
/** Icon to be included*/
|
|
6
|
+
icon?: IDynamicIconProps
|
|
7
|
+
/** CTA label */
|
|
8
|
+
ctaLabel?: string
|
|
9
|
+
/** Alignment */
|
|
10
|
+
align: "left" | "right"
|
|
11
|
+
/** Show the CTA without Background color and a border seperator */
|
|
12
|
+
isClear?: boolean
|
|
13
|
+
/** Onclick callback */
|
|
14
|
+
onClickHandler?(): void
|
|
15
|
+
buttonProps?: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const NestedInputButton: React.FC<INestedInputButtonProps> = ({
|
|
19
|
+
icon,
|
|
20
|
+
ctaLabel,
|
|
21
|
+
align = "right",
|
|
22
|
+
isClear = false,
|
|
23
|
+
onClickHandler,
|
|
24
|
+
buttonProps
|
|
25
|
+
}) => {
|
|
26
|
+
const handleClick = () => {
|
|
27
|
+
onClickHandler && onClickHandler()
|
|
28
|
+
}
|
|
29
|
+
const buttonStyle = cn(
|
|
30
|
+
"relative inline-flex items-center space-x-2 px-4 py-2 border border-gray-300 text-sm font-medium focus:outline-none focus:ring-1 focus:ring-purple-500 focus:border-purple-500",
|
|
31
|
+
{
|
|
32
|
+
"rounded-r text-gray-500 -ml-px": align === "right"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"rounded-l text-gray-500 -mr-px": align === "left"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"cursor-default": !onClickHandler
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"hover:bg-gray-100": onClickHandler && !isClear
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"!border-l-white": isClear && align === "right"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"!border-r-white": isClear && align === "left"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"bg-gray-50": !isClear
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"bg-white": isClear
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
return (
|
|
57
|
+
<button {...{ ...buttonProps, className: buttonStyle, onClick: handleClick }}>
|
|
58
|
+
{icon && <DynamicIcon {...{ ...icon, className: "text-gray-400" }} />}
|
|
59
|
+
{ctaLabel && <span>{ctaLabel}</span>}
|
|
60
|
+
</button>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default NestedInputButton
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import TextInput, { ITextInputProps } from "./TextInput"
|
|
3
|
+
import React from "react"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof TextInput> = {
|
|
6
|
+
title: "Design System/molecules/inputs/TextInput",
|
|
7
|
+
component: TextInput,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default meta
|
|
13
|
+
type Story = StoryObj<typeof TextInput>
|
|
14
|
+
|
|
15
|
+
export const DefaultTextInputStory: Story = {
|
|
16
|
+
args: {
|
|
17
|
+
type: "text",
|
|
18
|
+
label: "Label",
|
|
19
|
+
isFocused: true,
|
|
20
|
+
isError: false,
|
|
21
|
+
id: "id",
|
|
22
|
+
name: "name",
|
|
23
|
+
isRequired: true,
|
|
24
|
+
|
|
25
|
+
isDisabled: false,
|
|
26
|
+
isReadonly: false,
|
|
27
|
+
message: "message",
|
|
28
|
+
isShowCounter: true,
|
|
29
|
+
maxLength: 100,
|
|
30
|
+
placeholder: "placeholder"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import React, { forwardRef, useEffect, useId, useRef, useState } from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
import InputLabel from "../InputLabel"
|
|
4
|
+
import InputField, { AcceptedInputTypes } from "../InputField"
|
|
5
|
+
import InputCounter from "../InputCounter"
|
|
6
|
+
|
|
7
|
+
export interface ITextInputProps {
|
|
8
|
+
/** Input type*/
|
|
9
|
+
type: AcceptedInputTypes
|
|
10
|
+
/** Input ID */
|
|
11
|
+
id?: string
|
|
12
|
+
/** Input Name */
|
|
13
|
+
name?: string
|
|
14
|
+
/** Label for the input */
|
|
15
|
+
label?: string
|
|
16
|
+
/** Force the focus state on the input */
|
|
17
|
+
isFocused?: boolean
|
|
18
|
+
/** Error state */
|
|
19
|
+
isError?: boolean
|
|
20
|
+
/** If field is required */
|
|
21
|
+
isRequired?: boolean
|
|
22
|
+
/** Disabled state */
|
|
23
|
+
isDisabled?: boolean
|
|
24
|
+
/** Readonly state */
|
|
25
|
+
isReadonly?: boolean
|
|
26
|
+
/** Set default value */
|
|
27
|
+
defaultValue?: string
|
|
28
|
+
/** Message shown under the text field */
|
|
29
|
+
message?: string
|
|
30
|
+
/** Input character counter */
|
|
31
|
+
isShowCounter?: boolean
|
|
32
|
+
/** Max length of input character */
|
|
33
|
+
maxLength?: number
|
|
34
|
+
/** Callback on change */
|
|
35
|
+
onChange(value: string): void
|
|
36
|
+
/** input value */
|
|
37
|
+
value: string
|
|
38
|
+
/**Placeholder input text*/
|
|
39
|
+
placeholder?: string
|
|
40
|
+
|
|
41
|
+
className?: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const TextInput = (
|
|
45
|
+
{
|
|
46
|
+
label,
|
|
47
|
+
isFocused,
|
|
48
|
+
isError,
|
|
49
|
+
id,
|
|
50
|
+
name,
|
|
51
|
+
isRequired,
|
|
52
|
+
type,
|
|
53
|
+
defaultValue,
|
|
54
|
+
isDisabled,
|
|
55
|
+
isReadonly,
|
|
56
|
+
message,
|
|
57
|
+
isShowCounter,
|
|
58
|
+
maxLength,
|
|
59
|
+
onChange,
|
|
60
|
+
placeholder,
|
|
61
|
+
value: externalValue,
|
|
62
|
+
className,
|
|
63
|
+
...props
|
|
64
|
+
}: ITextInputProps,
|
|
65
|
+
ref: React.Ref<HTMLInputElement>
|
|
66
|
+
) => {
|
|
67
|
+
const uniqueID = useId()
|
|
68
|
+
const [isFocus, setIsFocus] = useState<boolean>(Boolean(isFocused))
|
|
69
|
+
|
|
70
|
+
const [value, setValue] = useState<string>(externalValue || defaultValue || "")
|
|
71
|
+
const inputRef = useRef<HTMLInputElement>(null)
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
//if the external value is updated by the parent component, reset the value in here...
|
|
75
|
+
if (externalValue !== undefined && externalValue !== null) {
|
|
76
|
+
setValue(externalValue)
|
|
77
|
+
}
|
|
78
|
+
}, [externalValue])
|
|
79
|
+
|
|
80
|
+
// set force focus
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const input = inputRef.current
|
|
83
|
+
if (!input || isFocus === undefined || isDisabled) return
|
|
84
|
+
if (isFocus) {
|
|
85
|
+
input.focus()
|
|
86
|
+
} else {
|
|
87
|
+
input.blur()
|
|
88
|
+
}
|
|
89
|
+
}, [isFocus])
|
|
90
|
+
|
|
91
|
+
// set label as active if default value is set
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
const input = inputRef.current
|
|
94
|
+
if (!input || defaultValue === undefined || defaultValue === "") return
|
|
95
|
+
}, [defaultValue])
|
|
96
|
+
|
|
97
|
+
const handleInputFocus = () => setIsFocus(true)
|
|
98
|
+
// add other focus effects here
|
|
99
|
+
|
|
100
|
+
const handleInputBlur = () => setIsFocus(false)
|
|
101
|
+
|
|
102
|
+
if (!id) id = `input-${uniqueID}`
|
|
103
|
+
if (!name) name = id
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<div className="relative">
|
|
107
|
+
<InputLabel
|
|
108
|
+
isPlaceholder={true}
|
|
109
|
+
label={label}
|
|
110
|
+
isRequired={isRequired}
|
|
111
|
+
id={id}
|
|
112
|
+
isError={isError}
|
|
113
|
+
isActive={true}
|
|
114
|
+
isDisabled={isDisabled}
|
|
115
|
+
/>
|
|
116
|
+
<InputField
|
|
117
|
+
onFocus={handleInputFocus}
|
|
118
|
+
onBlur={handleInputBlur}
|
|
119
|
+
handleChange={(v) => setValue(v)}
|
|
120
|
+
ref={ref}
|
|
121
|
+
type={type}
|
|
122
|
+
name={name}
|
|
123
|
+
id={id}
|
|
124
|
+
className={cn(
|
|
125
|
+
"w-full rounded border py-2 px-3 text-sm font-normal leading-5",
|
|
126
|
+
{ "border-gray-300": !isFocus && !isError },
|
|
127
|
+
{
|
|
128
|
+
"!border-purple-500 shadow-none outline-purple-500 focus:!ring-purple-500": isFocus && !isError
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"!border-red-500 shadow-none focus:ring-red-500": isError
|
|
132
|
+
},
|
|
133
|
+
className
|
|
134
|
+
)}
|
|
135
|
+
isDisabled={isDisabled}
|
|
136
|
+
isReadonly={isReadonly}
|
|
137
|
+
value={value}
|
|
138
|
+
defaultValue={defaultValue}
|
|
139
|
+
maxLength={maxLength}
|
|
140
|
+
placeholder={placeholder}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
<div className="flex flex-row space-x-3">
|
|
144
|
+
<div className="grow">
|
|
145
|
+
{message && (
|
|
146
|
+
<span className={cn("mt-1 block text-sm", isError ? "text-red-500" : "text-gray-500")}>
|
|
147
|
+
{message}
|
|
148
|
+
</span>
|
|
149
|
+
)}
|
|
150
|
+
</div>
|
|
151
|
+
{isShowCounter && (
|
|
152
|
+
<div className="shrink-0">
|
|
153
|
+
<InputCounter current={Number(value?.length)} limit={maxLength} />
|
|
154
|
+
</div>
|
|
155
|
+
)}
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const _TextInput = forwardRef<HTMLInputElement, ITextInputProps>(TextInput)
|
|
162
|
+
export default _TextInput
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import Checkbox from "./Checkbox"
|
|
3
|
+
const meta: Meta<typeof Checkbox> = {
|
|
4
|
+
title: "Design System/Molecules/Inputs/Checkbox",
|
|
5
|
+
component: Checkbox,
|
|
6
|
+
tags: []
|
|
7
|
+
}
|
|
8
|
+
type Story = StoryObj<typeof Checkbox>
|
|
9
|
+
export const DefaultCheckbox: Story = {
|
|
10
|
+
args: {
|
|
11
|
+
label: "Checkbox Label",
|
|
12
|
+
id: "checkboxId",
|
|
13
|
+
isDisabled: false,
|
|
14
|
+
isChecked: false,
|
|
15
|
+
isRequired: false,
|
|
16
|
+
isError: false,
|
|
17
|
+
message: "",
|
|
18
|
+
onChange: (value: string) => {
|
|
19
|
+
console.log(`onChange ${value}`)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export default meta
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { FC } from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
import InputLabel from "@/stories/molecules/inputs/InputLabel"
|
|
4
|
+
import { useId } from "@/utils/useId"
|
|
5
|
+
|
|
6
|
+
export interface ICheckboxProps {
|
|
7
|
+
/** Checkbox label */
|
|
8
|
+
label: string
|
|
9
|
+
/** Checkbox ID */
|
|
10
|
+
id?: string
|
|
11
|
+
/** Disabled state */
|
|
12
|
+
isDisabled?: boolean
|
|
13
|
+
/** value */
|
|
14
|
+
value?: string
|
|
15
|
+
/** Check state */
|
|
16
|
+
isChecked?: boolean
|
|
17
|
+
/** If field is required */
|
|
18
|
+
isRequired?: boolean
|
|
19
|
+
/** Error state */
|
|
20
|
+
isError?: boolean
|
|
21
|
+
/** Message or description */
|
|
22
|
+
message?: string
|
|
23
|
+
/** Callback on input change */
|
|
24
|
+
onChange?(value: string, isChecked: boolean): void
|
|
25
|
+
/** Has a border around the checkbox and label */
|
|
26
|
+
hasBorder?: boolean
|
|
27
|
+
/** any arbitrary classNames to add to the wrapper */
|
|
28
|
+
className?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Comment */
|
|
32
|
+
const Checkbox: FC<ICheckboxProps> = ({
|
|
33
|
+
label,
|
|
34
|
+
id,
|
|
35
|
+
isDisabled,
|
|
36
|
+
isChecked,
|
|
37
|
+
isRequired,
|
|
38
|
+
isError,
|
|
39
|
+
message,
|
|
40
|
+
value,
|
|
41
|
+
onChange,
|
|
42
|
+
hasBorder,
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: ICheckboxProps) => {
|
|
46
|
+
const uniqueID = useId()
|
|
47
|
+
if (!id) id = `cb-${uniqueID}`
|
|
48
|
+
|
|
49
|
+
const checkboxStyles = cn(
|
|
50
|
+
"rounded-sm border-gray-300 text-sm font-normal leading-5 text-purple-600 focus:ring-purple-600",
|
|
51
|
+
{ "border-red-500 shadow-none": isError }
|
|
52
|
+
)
|
|
53
|
+
const wrapperStyles = cn(
|
|
54
|
+
"relative flex items-center min-h-[38px]",
|
|
55
|
+
{ "opacity-50": isDisabled },
|
|
56
|
+
{ "rounded-sm ring-1 px-3 ring-gray-300": hasBorder },
|
|
57
|
+
{ "py-3": hasBorder && message },
|
|
58
|
+
className
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
62
|
+
console.log(e)
|
|
63
|
+
const targetValue = e.target.value
|
|
64
|
+
const targetChecked = e.target.checked
|
|
65
|
+
typeof onChange === "function" && onChange(targetValue, targetChecked)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div className={wrapperStyles}>
|
|
70
|
+
<div className="flex items-center">
|
|
71
|
+
<input
|
|
72
|
+
id={id}
|
|
73
|
+
aria-describedby={`${id}-description`}
|
|
74
|
+
name={id}
|
|
75
|
+
value={value}
|
|
76
|
+
type="checkbox"
|
|
77
|
+
className={checkboxStyles}
|
|
78
|
+
disabled={isDisabled}
|
|
79
|
+
checked={isChecked}
|
|
80
|
+
onChange={(e) => {
|
|
81
|
+
handleChange(e)
|
|
82
|
+
}}
|
|
83
|
+
{...props}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
<div className="ml-3 text-sm ">
|
|
87
|
+
<label htmlFor={id} className="font-medium text-gray-700">
|
|
88
|
+
<InputLabel label={label} isRequired={isRequired} id={id} />
|
|
89
|
+
</label>
|
|
90
|
+
{message && (
|
|
91
|
+
<p id={`${id}-description`} className="text-gray-500">
|
|
92
|
+
{message}
|
|
93
|
+
</p>
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
export default Checkbox
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import Combobox from "./ComboBox"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Combobox> = {
|
|
5
|
+
title: "Design System/Molecules/Inputs/Combobox",
|
|
6
|
+
component: Combobox,
|
|
7
|
+
tags: ["autodocs"]
|
|
8
|
+
}
|
|
9
|
+
type Story = StoryObj<typeof Combobox>
|
|
10
|
+
interface ComboItem {
|
|
11
|
+
[value: string]: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const comboboxlist: ComboItem[] = [
|
|
15
|
+
{ value: "Leslie Alexander" },
|
|
16
|
+
{ value: "Alishba Molloy" },
|
|
17
|
+
{ value: "Raya Oconnell" },
|
|
18
|
+
{ value: "Danica Sweet" },
|
|
19
|
+
{ value: "Ralph Brook" },
|
|
20
|
+
{ value: "Tamar Tapia" },
|
|
21
|
+
{ value: "Cara Avila" },
|
|
22
|
+
{ value: "Jayson Cisneros" },
|
|
23
|
+
{ value: "Tracey Reader" },
|
|
24
|
+
{ value: "Rahima Fritz" },
|
|
25
|
+
{ value: "Vera Pritchard" }
|
|
26
|
+
]
|
|
27
|
+
export const DefaultComboBox: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
label: "",
|
|
30
|
+
items: comboboxlist,
|
|
31
|
+
displayProperty: "value",
|
|
32
|
+
keyProperty: "value",
|
|
33
|
+
placeholder: "Select",
|
|
34
|
+
id: "combobox",
|
|
35
|
+
isRequired: false,
|
|
36
|
+
isError: false,
|
|
37
|
+
isDisabled: false,
|
|
38
|
+
nullable: false
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export default meta
|