@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,119 @@
|
|
|
1
|
+
import Button from "stories/atoms/buttons/Button/Button"
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
4
|
+
|
|
5
|
+
import ToggleSwitch from "./ToggleSwitch"
|
|
6
|
+
const meta: Meta<typeof ToggleSwitch> = {
|
|
7
|
+
title: "Design System/Molecules/Inputs/ToggleSwitch",
|
|
8
|
+
component: ToggleSwitch,
|
|
9
|
+
tags: ["autodocs"]
|
|
10
|
+
}
|
|
11
|
+
type Story = StoryObj<typeof ToggleSwitch>
|
|
12
|
+
export const DefaultToggleSwitch: Story = {
|
|
13
|
+
args: {
|
|
14
|
+
isChecked: false,
|
|
15
|
+
onChange: (v: boolean) => {
|
|
16
|
+
console.log(v, "v")
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
text: "label me",
|
|
20
|
+
className: "text-lg text-gray-400",
|
|
21
|
+
xPosition: "left",
|
|
22
|
+
},
|
|
23
|
+
variant: "base",
|
|
24
|
+
id: "toggle-switch-1",
|
|
25
|
+
name: "toggle one",
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
export const ShortToggleSwitch: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
...DefaultToggleSwitch.args,
|
|
31
|
+
label: {
|
|
32
|
+
text: "label me too",
|
|
33
|
+
className: "text-lg text-gray-400",
|
|
34
|
+
xPosition: "left",
|
|
35
|
+
},
|
|
36
|
+
variant: "short",
|
|
37
|
+
id: "toggle-switch-2",
|
|
38
|
+
name: "toggle two",
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
export const Checked: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
...DefaultToggleSwitch.args,
|
|
44
|
+
isChecked: true,
|
|
45
|
+
label: {
|
|
46
|
+
text: "label me too",
|
|
47
|
+
className: "text-lg text-gray-400",
|
|
48
|
+
xPosition: "left",
|
|
49
|
+
},
|
|
50
|
+
variant: "base",
|
|
51
|
+
id: "toggle-switch-3",
|
|
52
|
+
name: "toggle three",
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
export const WithIcon: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
...DefaultToggleSwitch.args,
|
|
58
|
+
label: {
|
|
59
|
+
text: "label me three",
|
|
60
|
+
className: "text-lg text-gray-400",
|
|
61
|
+
xPosition: "left",
|
|
62
|
+
},
|
|
63
|
+
withIcon: {
|
|
64
|
+
name: "IconCheck",
|
|
65
|
+
type: "solid",
|
|
66
|
+
},
|
|
67
|
+
variant: "base",
|
|
68
|
+
id: "toggle-switch-4",
|
|
69
|
+
name: "toggle four",
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
export const NoLabel: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
...DefaultToggleSwitch.args,
|
|
75
|
+
label: undefined,
|
|
76
|
+
variant: "base",
|
|
77
|
+
id: "toggle-switch-5",
|
|
78
|
+
name: "toggle five",
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
export const LabelOnTheRight: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
...DefaultToggleSwitch.args,
|
|
84
|
+
variant: "base",
|
|
85
|
+
id: "toggle-switch-6",
|
|
86
|
+
name: "toggle six",
|
|
87
|
+
label: {
|
|
88
|
+
text: "Right on!",
|
|
89
|
+
className: "text-lg text-gray-400",
|
|
90
|
+
xPosition: "right",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
export const JSXLabel: Story = {
|
|
95
|
+
args: {
|
|
96
|
+
...DefaultToggleSwitch.args,
|
|
97
|
+
variant: "base",
|
|
98
|
+
id: "toggle-switch-6",
|
|
99
|
+
name: "toggle five",
|
|
100
|
+
label: {
|
|
101
|
+
text: (
|
|
102
|
+
<span className={"inline-flex gap-2 items-center "}>
|
|
103
|
+
<Button
|
|
104
|
+
actionType="primary"
|
|
105
|
+
label="Fancy Label"
|
|
106
|
+
onClick={() => {}}
|
|
107
|
+
icon="IconConfetti"
|
|
108
|
+
size="xs"
|
|
109
|
+
className="mr-4"
|
|
110
|
+
/>
|
|
111
|
+
</span>
|
|
112
|
+
),
|
|
113
|
+
className: "text-lg text-gray-400",
|
|
114
|
+
xPosition: "left",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export default meta
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
import { Switch } from "@headlessui/react"
|
|
4
|
+
import { DynamicIcon, IDynamicIconProps } from "@/stories/atoms"
|
|
5
|
+
export interface IToggleSwitchProps {
|
|
6
|
+
isChecked: boolean
|
|
7
|
+
onChange: (isChecked: boolean) => void
|
|
8
|
+
label?: {
|
|
9
|
+
text: string | JSX.Element
|
|
10
|
+
className?: string
|
|
11
|
+
xPosition?: "left" | "right"
|
|
12
|
+
}
|
|
13
|
+
screenReaderLabel: string
|
|
14
|
+
name: string
|
|
15
|
+
id: string
|
|
16
|
+
variant: "base" | "short"
|
|
17
|
+
withIcon?: IDynamicIconProps
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const ToggleSwitch: React.FC<IToggleSwitchProps> = ({
|
|
21
|
+
isChecked,
|
|
22
|
+
onChange,
|
|
23
|
+
label,
|
|
24
|
+
screenReaderLabel,
|
|
25
|
+
name,
|
|
26
|
+
id,
|
|
27
|
+
variant = "base",
|
|
28
|
+
withIcon,
|
|
29
|
+
}) => {
|
|
30
|
+
const [checked, setChecked] = useState<boolean>(isChecked)
|
|
31
|
+
useEffect(() => setChecked(isChecked), [isChecked])
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Switch.Group as={"div"} className={"flex items-center gap-2"}>
|
|
35
|
+
{label && label.xPosition === "left" && (
|
|
36
|
+
<Switch.Label className={label.className}>{label.text}</Switch.Label>
|
|
37
|
+
)}
|
|
38
|
+
<Switch
|
|
39
|
+
name={name}
|
|
40
|
+
id={id}
|
|
41
|
+
checked={checked}
|
|
42
|
+
onChange={(v: boolean) => {
|
|
43
|
+
onChange(v)
|
|
44
|
+
setChecked(v)
|
|
45
|
+
}}
|
|
46
|
+
className={cn(
|
|
47
|
+
{ "w-9 h-4": variant === "short", " h-6 w-11": variant === "base" },
|
|
48
|
+
checked ? "bg-purple-600" : "bg-gray-200",
|
|
49
|
+
"relative inline-flex items-center rounded-full focus-visible:ring-2 focus-visible:ring-purple-600 focus-visible:ring-offset-2 focus-within:ring-2 focus-within:ring-purple-600 focus-within:ring-offset-2 focus:ring-2 focus:ring-purple-600 focus:ring-offset-2 active:ring-2 active:ring-purple-600 active:ring-offset-2"
|
|
50
|
+
)}
|
|
51
|
+
>
|
|
52
|
+
<span className="sr-only">{screenReaderLabel}</span>
|
|
53
|
+
<span
|
|
54
|
+
className={cn(
|
|
55
|
+
checked ? "translate-x-[22px]" : "translate-x-[2px]",
|
|
56
|
+
{
|
|
57
|
+
"border border-gray-200 translate-x-0": variant === "short",
|
|
58
|
+
"!translate-x-[22px]": checked && variant === "short",
|
|
59
|
+
},
|
|
60
|
+
" h-5 w-5 transform rounded-full bg-white transition shadow-sm drop-shadow flex items-center justify-center"
|
|
61
|
+
)}
|
|
62
|
+
>
|
|
63
|
+
{withIcon && (
|
|
64
|
+
<DynamicIcon {...withIcon} className={"text-gray-400 m-[2px]"} />
|
|
65
|
+
)}
|
|
66
|
+
</span>
|
|
67
|
+
</Switch>
|
|
68
|
+
{label && label.xPosition === "right" && (
|
|
69
|
+
<Switch.Label className={label.className}>{label.text}</Switch.Label>
|
|
70
|
+
)}
|
|
71
|
+
</Switch.Group>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default ToggleSwitch
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import Tabs, { ITabsProps } from "./Tabs"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Tabs> = {
|
|
6
|
+
title: "Design System/molecules/Tabs",
|
|
7
|
+
component: Tabs,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default meta
|
|
13
|
+
type Story = StoryObj<typeof Tabs>
|
|
14
|
+
export const DefaultTabsStory: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import React from "react"
|
|
3
|
+
import EmptySectionPlaceholder from "@/stories/organisms/EmptySectionPlaceholder"
|
|
4
|
+
|
|
5
|
+
export interface ITabsProps {}
|
|
6
|
+
|
|
7
|
+
const Tabs: React.FC<ITabsProps> = ({}) => {
|
|
8
|
+
return (
|
|
9
|
+
<EmptySectionPlaceholder
|
|
10
|
+
{...{
|
|
11
|
+
icon: {
|
|
12
|
+
icon: "IconCode"
|
|
13
|
+
},
|
|
14
|
+
mutedText: "Coming Soon! 🚧",
|
|
15
|
+
primaryMessage: "We're working on this component. Be sure to check back soon!",
|
|
16
|
+
actions: []
|
|
17
|
+
}}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default Tabs;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import AnimatedLabelInput, { IAnimatedLabelInputProps } from "./AnimatedLabelInput"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof AnimatedLabelInput> = {
|
|
5
|
+
title: "Design System/organisms/Animated Label Input",
|
|
6
|
+
component: AnimatedLabelInput,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
type Story = StoryObj<typeof AnimatedLabelInput>
|
|
13
|
+
export const DefaultAnimatedLabelInputsStory: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
id: "test",
|
|
16
|
+
label: {
|
|
17
|
+
display: "Label"
|
|
18
|
+
},
|
|
19
|
+
input: {}
|
|
20
|
+
} as IAnimatedLabelInputProps
|
|
21
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
import InputField, { IInputFieldProps } from "@/stories/molecules/inputs/InputField"
|
|
4
|
+
import Textarea, { ITextareaProps } from "@/stories/molecules/inputs/textArea/TextArea"
|
|
5
|
+
|
|
6
|
+
interface ILabelProps extends React.ComponentPropsWithoutRef<"label"> {
|
|
7
|
+
display: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IAnimatedLabelInputProps {
|
|
11
|
+
id: string
|
|
12
|
+
containerStyles?: string
|
|
13
|
+
message?: string
|
|
14
|
+
input?: IInputFieldProps
|
|
15
|
+
textarea?: ITextareaProps
|
|
16
|
+
required?: boolean
|
|
17
|
+
isError?: boolean
|
|
18
|
+
label: ILabelProps
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const AnimatedLabelInput: React.FC<IAnimatedLabelInputProps> = ({
|
|
22
|
+
id,
|
|
23
|
+
label,
|
|
24
|
+
input,
|
|
25
|
+
message,
|
|
26
|
+
textarea,
|
|
27
|
+
required,
|
|
28
|
+
isError,
|
|
29
|
+
containerStyles
|
|
30
|
+
}) => {
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn("group relative", containerStyles ? containerStyles : "")}>
|
|
33
|
+
{input && <InputField isError={isError} {...input} />}
|
|
34
|
+
{textarea && <Textarea isError={isError} {...textarea} />}
|
|
35
|
+
<label
|
|
36
|
+
className={cn(
|
|
37
|
+
"absolute left-1 z-10 ml-[.172rem] inline-block bg-white px-1 text-xs transition-all peer-placeholder-shown:top-2 peer-placeholder-shown:text-sm peer-placeholder-shown:text-gray-600",
|
|
38
|
+
"-top-[9px] group-focus-within:!-top-[12px] group-focus-within:!left-1 group-focus-within:!ml-[.172rem] group-focus-within:!text-xs",
|
|
39
|
+
isError && "!text-red-600"
|
|
40
|
+
)}
|
|
41
|
+
htmlFor={id}
|
|
42
|
+
>
|
|
43
|
+
{label.display}
|
|
44
|
+
{required && <span className="text-red-600">*</span>}
|
|
45
|
+
</label>
|
|
46
|
+
|
|
47
|
+
<div className="flex flex-row space-x-3">
|
|
48
|
+
<div className="grow transition-all">
|
|
49
|
+
{message && (
|
|
50
|
+
<span className={cn("mt-1 block text-sm", isError ? "text-red-500" : "text-gray-500")}>
|
|
51
|
+
{message}
|
|
52
|
+
</span>
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default AnimatedLabelInput
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import ButtonDropdown from "."
|
|
3
|
+
import { IItemProp } from "../DropdownComponent"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof ButtonDropdown> = {
|
|
7
|
+
title: "Design System/Organisms/Button Dropdown",
|
|
8
|
+
component: ButtonDropdown,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {}
|
|
11
|
+
}
|
|
12
|
+
const dropdownDataWithIcons: IItemProp[][] = [
|
|
13
|
+
[
|
|
14
|
+
{
|
|
15
|
+
icon: {
|
|
16
|
+
name: "IconClipboardCopy",
|
|
17
|
+
pos: "leading",
|
|
18
|
+
className: "h-5 w-5",
|
|
19
|
+
outline: false
|
|
20
|
+
},
|
|
21
|
+
key: "Copy",
|
|
22
|
+
label: "Copy",
|
|
23
|
+
onClick: () => {
|
|
24
|
+
console.log("Copy action")
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
icon: {
|
|
31
|
+
name: "IconFolderPlus",
|
|
32
|
+
pos: "leading",
|
|
33
|
+
className: "h-5 w-5",
|
|
34
|
+
outline: false
|
|
35
|
+
},
|
|
36
|
+
key: "Add to Batch",
|
|
37
|
+
label: "Add to Batch",
|
|
38
|
+
onClick: () => {
|
|
39
|
+
console.log("Add to Batch action")
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
icon: {
|
|
44
|
+
name: "IconEye",
|
|
45
|
+
pos: "leading",
|
|
46
|
+
className: "h-5 w-5",
|
|
47
|
+
outline: false
|
|
48
|
+
},
|
|
49
|
+
key: "View Batch",
|
|
50
|
+
label: "View Batch",
|
|
51
|
+
onClick: () => {
|
|
52
|
+
console.log("View Batch action")
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
{
|
|
58
|
+
icon: {
|
|
59
|
+
name: "IconTrash",
|
|
60
|
+
pos: "leading",
|
|
61
|
+
className: "h-5 w-5",
|
|
62
|
+
outline: false
|
|
63
|
+
},
|
|
64
|
+
key: "Delete",
|
|
65
|
+
label: "Delete",
|
|
66
|
+
onClick: () => {
|
|
67
|
+
console.log("Delete action")
|
|
68
|
+
},
|
|
69
|
+
isEmphasized: true
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
export default meta
|
|
75
|
+
type Story = StoryObj<typeof ButtonDropdown>
|
|
76
|
+
|
|
77
|
+
export const Primary: Story = {
|
|
78
|
+
args: {
|
|
79
|
+
button: {
|
|
80
|
+
label: "Primary",
|
|
81
|
+
actionType: "primary"
|
|
82
|
+
},
|
|
83
|
+
dropDown: {
|
|
84
|
+
items: dropdownDataWithIcons,
|
|
85
|
+
label: "Dropdown",
|
|
86
|
+
id: "dropdown-primary"
|
|
87
|
+
},
|
|
88
|
+
placement: "bottom-end"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export const Secondary: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
button: {
|
|
94
|
+
label: "Secondary",
|
|
95
|
+
actionType: "secondary"
|
|
96
|
+
},
|
|
97
|
+
dropDown: {
|
|
98
|
+
label: "Dropdown",
|
|
99
|
+
id: "dropdown-secondary",
|
|
100
|
+
items: dropdownDataWithIcons
|
|
101
|
+
},
|
|
102
|
+
placement: "bottom-end"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export const Alternative: Story = {
|
|
106
|
+
args: {
|
|
107
|
+
button: {
|
|
108
|
+
label: "Alternative",
|
|
109
|
+
actionType: "alternative"
|
|
110
|
+
},
|
|
111
|
+
dropDown: {
|
|
112
|
+
label: "Dropdown",
|
|
113
|
+
id: "dropdown-secondary",
|
|
114
|
+
items: dropdownDataWithIcons
|
|
115
|
+
},
|
|
116
|
+
placement: "bottom-end"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { FC } from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
import Button, { IButtonProps } from "@/stories/atoms/buttons/Button"
|
|
4
|
+
|
|
5
|
+
import { DynamicIcon } from "@/stories/atoms/icons"
|
|
6
|
+
import Dropdown, { IDropdownProps, defaultClassNames } from "../DropdownComponent"
|
|
7
|
+
|
|
8
|
+
export interface IButtonDropdownProps {
|
|
9
|
+
button: IButtonProps
|
|
10
|
+
dropDown: IDropdownProps
|
|
11
|
+
placement?: IDropdownProps["placement"]
|
|
12
|
+
offsetOptions?: IDropdownProps["offsetOptions"]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Primary UI component for user interaction
|
|
17
|
+
*/
|
|
18
|
+
const ButtonDropdown: FC<IButtonDropdownProps> = ({ button, dropDown, placement, offsetOptions }) => {
|
|
19
|
+
const dropDownClasses: IDropdownProps["classNames"] = {
|
|
20
|
+
...defaultClassNames,
|
|
21
|
+
groupClassname: cn(
|
|
22
|
+
"flex items-center justify-center rounded-l-none border !border-l-0 rounded-r px-2 transition-all hover:!border-l-0",
|
|
23
|
+
button.actionType === "primary"
|
|
24
|
+
? "border-purple-600 bg-purple-600 !text-white hover:border-purple-700 hover:bg-purple-700 active:!border-purple-800 active:!bg-purple-800 fill-white"
|
|
25
|
+
: "",
|
|
26
|
+
button.actionType === "secondary"
|
|
27
|
+
? "border-purple-50 bg-purple-50 !text-purple-700 hover:border-purple-100 hover:bg-purple-100 active:!border-purple-300 active:!bg-purple-300 fill-purple-700"
|
|
28
|
+
: "",
|
|
29
|
+
button.actionType === "alternative"
|
|
30
|
+
? "border-gray-300 bg-white !text-gray-700 fill-gray-700 hover:border-gray-300 hover:bg-gray-50 active:bg-gray-100"
|
|
31
|
+
: ""
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
return (
|
|
35
|
+
<div className="flex items-stretch focus-within:ring-purple-600 focus-within:ring-2 focus-within:ring-offset-white focus-within:ring-offset-2 rounded-[3px]">
|
|
36
|
+
<Button
|
|
37
|
+
{...{
|
|
38
|
+
...button,
|
|
39
|
+
className: cn(
|
|
40
|
+
button.className,
|
|
41
|
+
"!rounded-r-none !border-r-0 hover:!border-r-0 !focus:ring-transparent !focus-visible:ring-transparent !focus-within:ring-transparent !focus:ring-0 !focus-within:ring-0 !focus-visible:ring-0 !focus:ring-offset-0 !focus-visible:ring-offset-0 !focus-within:ring-offset-0 !ring-0 outline-none focus:outline-none focus-visible:outline-none focus-within:outline-none !ring-offset-0"
|
|
42
|
+
)
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
<div
|
|
46
|
+
className={cn(
|
|
47
|
+
"w-[1px] rt",
|
|
48
|
+
button.actionType === "primary" ? "bg-purple-700" : "",
|
|
49
|
+
button.actionType === "secondary" ? "bg-purple-200" : "",
|
|
50
|
+
button.actionType === "alternative" ? "bg-gray-300" : ""
|
|
51
|
+
)}
|
|
52
|
+
></div>
|
|
53
|
+
<Dropdown
|
|
54
|
+
{...{
|
|
55
|
+
...(dropDown as IDropdownProps),
|
|
56
|
+
CustomDropdownTrigger: (
|
|
57
|
+
<DynamicIcon
|
|
58
|
+
{...{
|
|
59
|
+
icon: "ChevronDownIcon",
|
|
60
|
+
className: cn("h-5 w-5", {
|
|
61
|
+
"text-white": button.actionType === "primary",
|
|
62
|
+
"text-purple-700": button.actionType === "secondary",
|
|
63
|
+
"text-gray-700": button.actionType === "alternative"
|
|
64
|
+
})
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
),
|
|
68
|
+
classNames: dropDownClasses,
|
|
69
|
+
offsetOptions: offsetOptions ?? {
|
|
70
|
+
crossAxis: 0,
|
|
71
|
+
mainAxis: 5, //up/down
|
|
72
|
+
alignmentAxis: -10 //left/right
|
|
73
|
+
},
|
|
74
|
+
placement
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
<div className="hidden !bg-purple-100 !text-purple-600 transition-all hover:bg-purple-200 focus:bg-purple-300" />
|
|
78
|
+
</div>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
export default ButtonDropdown
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
|
|
3
|
+
import { DynamicIcon } from "@/stories/atoms/icons"
|
|
4
|
+
import { dropdownDataBase, dropdownDataWithIcons } from "./dropdownItems"
|
|
5
|
+
import Dropdown, { defaultClassNames } from "./DropdownComponent"
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Dropdown> = {
|
|
8
|
+
title: "Design System/Organisms/Dropdown",
|
|
9
|
+
component: Dropdown,
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
argTypes: {}
|
|
12
|
+
}
|
|
13
|
+
type Story = StoryObj<typeof Dropdown>
|
|
14
|
+
|
|
15
|
+
const IconElement = () => (
|
|
16
|
+
<DynamicIcon className="h-5 w-5 text-gray-400 hover:text-gray-600" icon={"DotsVerticalIcon"} />
|
|
17
|
+
)
|
|
18
|
+
const defaultArgs: Story["args"] = {
|
|
19
|
+
items: [...dropdownDataBase],
|
|
20
|
+
label: "Dropdown",
|
|
21
|
+
classNames: defaultClassNames,
|
|
22
|
+
placement: "bottom-end"
|
|
23
|
+
}
|
|
24
|
+
export const WithLabel: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
...defaultArgs
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const CustomTrigger: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
...defaultArgs,
|
|
33
|
+
CustomDropdownTrigger: <IconElement />
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export const WithLabelAndIcons: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
...defaultArgs,
|
|
39
|
+
items: [...dropdownDataWithIcons]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export const WithIcons: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
...defaultArgs,
|
|
45
|
+
items: [...dropdownDataWithIcons],
|
|
46
|
+
CustomDropdownTrigger: <IconElement />
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export default meta
|
|
File without changes
|