@agility/plenum-ui 1.3.50 → 2.0.0-rc2
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 +959 -0
- package/dist/index.js +5936 -0
- package/dist/index.js.map +7 -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 +13 -0
- package/dist/types/stories/atoms/buttons/Button/Button.d.ts +33 -0
- package/dist/types/stories/atoms/buttons/Button/Danger/Danger.stories.d.ts +13 -0
- package/dist/types/stories/atoms/buttons/Button/Primary/Primary.stories.d.ts +13 -0
- package/dist/types/stories/atoms/buttons/Button/Secondary/Secondary.stories.d.ts +13 -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/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +28 -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/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 +11 -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/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +26 -0
- 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} +40 -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/dist/types/stories/organisms/index.d.ts +7 -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 +69 -0
- package/stories/atoms/buttons/Button/Button.tsx +123 -0
- package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +71 -0
- package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +78 -0
- package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +74 -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 +124 -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 +35 -0
- package/stories/molecules/inputs/InputField/InputField.stories.tsx +29 -0
- package/stories/molecules/inputs/InputField/InputField.tsx +88 -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/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 +24 -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 +20 -0
- package/stories/molecules/inputs/textArea/TextArea.tsx +67 -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 +269 -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/index.ts +16 -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.d.ts +0 -9
- 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.d.ts +0 -39
- 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.d.ts +0 -13
- 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.d.ts +0 -48
- 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.d.ts +0 -32
- 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,46 @@
|
|
|
1
|
+
import Avatar, { IAvatarProps } from "./Avatar"
|
|
2
|
+
import Badge, { IBadgeProps } from "./badges"
|
|
3
|
+
import { Button, Capsule, BTNActionType, IButtonProps, ICapsuleProps } from "./buttons"
|
|
4
|
+
import {
|
|
5
|
+
DynamicIcon,
|
|
6
|
+
FAIconName,
|
|
7
|
+
IDynamicIconProps,
|
|
8
|
+
IIconWithShadowProps,
|
|
9
|
+
IconName,
|
|
10
|
+
IconWithShadow,
|
|
11
|
+
UnifiedIconName,
|
|
12
|
+
isFAIcon,
|
|
13
|
+
isHeroIcon,
|
|
14
|
+
isTablerIcon,
|
|
15
|
+
isUnifiedIconName
|
|
16
|
+
} from "./icons"
|
|
17
|
+
import { ILoaderProps, IRadialProgressProps, Loader, RadialProgress } from "./loaders"
|
|
18
|
+
|
|
19
|
+
export type {
|
|
20
|
+
IAvatarProps,
|
|
21
|
+
IBadgeProps,
|
|
22
|
+
IButtonProps,
|
|
23
|
+
ICapsuleProps,
|
|
24
|
+
IDynamicIconProps,
|
|
25
|
+
IIconWithShadowProps,
|
|
26
|
+
ILoaderProps,
|
|
27
|
+
IRadialProgressProps,
|
|
28
|
+
UnifiedIconName,
|
|
29
|
+
IconName,
|
|
30
|
+
FAIconName,
|
|
31
|
+
BTNActionType
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
Avatar,
|
|
35
|
+
Badge,
|
|
36
|
+
Button,
|
|
37
|
+
Capsule,
|
|
38
|
+
DynamicIcon,
|
|
39
|
+
IconWithShadow,
|
|
40
|
+
Loader,
|
|
41
|
+
RadialProgress,
|
|
42
|
+
isFAIcon,
|
|
43
|
+
isHeroIcon,
|
|
44
|
+
isTablerIcon,
|
|
45
|
+
isUnifiedIconName
|
|
46
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import Loader from "./Loader"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Loader> = {
|
|
5
|
+
title: "Design System/atoms/Loaders/Loader",
|
|
6
|
+
component: Loader
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Loader>
|
|
10
|
+
|
|
11
|
+
export const DefaultLoader: Story = {
|
|
12
|
+
args: { className: "" },
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default meta
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import classNames, { default as cn } from "classnames"
|
|
3
|
+
|
|
4
|
+
export interface ILoaderProps {
|
|
5
|
+
className?: string
|
|
6
|
+
}
|
|
7
|
+
const Loader: React.FC<ILoaderProps> = ({ className }) => {
|
|
8
|
+
const outerLoaderStyles = cn(
|
|
9
|
+
"rounded-full w-16 h-16 inline-block border-8 animate-spin m-auto",
|
|
10
|
+
className ? className : "border-purple-700 border-r-gray-200"
|
|
11
|
+
)
|
|
12
|
+
return <i className={outerLoaderStyles} role="status" />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default Loader
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import RadialProgress from "./RadialProgress"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof RadialProgress> = {
|
|
5
|
+
title: "Design System/atoms/Loaders/NProgress/RadialProgress",
|
|
6
|
+
component: RadialProgress
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof RadialProgress>
|
|
10
|
+
|
|
11
|
+
export const DefaultRadialProgress: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
inputValue: 33,
|
|
14
|
+
radius: 20,
|
|
15
|
+
children: <></>
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { useMemo } from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
export interface IRadialProgressProps extends React.PropsWithChildren {
|
|
4
|
+
/** Percentage value to display */
|
|
5
|
+
inputValue: number
|
|
6
|
+
/** Radius for the circle - Max value of 100 */
|
|
7
|
+
radius: number
|
|
8
|
+
/** Additional classnames */
|
|
9
|
+
className?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const RadialProgress: React.FC<IRadialProgressProps> = ({
|
|
13
|
+
inputValue,
|
|
14
|
+
radius,
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
}) => {
|
|
18
|
+
const r = radius / 2
|
|
19
|
+
|
|
20
|
+
if (inputValue < 0) {
|
|
21
|
+
inputValue = 0
|
|
22
|
+
}
|
|
23
|
+
if (inputValue > 100) {
|
|
24
|
+
inputValue = 100
|
|
25
|
+
}
|
|
26
|
+
if (radius < 0) {
|
|
27
|
+
radius = 0
|
|
28
|
+
}
|
|
29
|
+
if (radius > 100) {
|
|
30
|
+
radius = 100
|
|
31
|
+
}
|
|
32
|
+
const drawPercentage = useMemo(() => {
|
|
33
|
+
const roundCircum = Math.round(2 * r * Math.PI)
|
|
34
|
+
console.log(roundCircum, "circumference")
|
|
35
|
+
console.log(inputValue, "input value")
|
|
36
|
+
return (inputValue * roundCircum) / 50
|
|
37
|
+
}, [inputValue, r])
|
|
38
|
+
|
|
39
|
+
const xyPos = (radius + 2) * -1
|
|
40
|
+
const viewPortXY = (radius + 2) * 2
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
className={cn(`overflow-visible`, className && className)}
|
|
44
|
+
style={{ height: `${viewPortXY}px`, width: `${viewPortXY}px` }}
|
|
45
|
+
>
|
|
46
|
+
<svg
|
|
47
|
+
viewBox={`${xyPos} ${xyPos} ${viewPortXY} ${viewPortXY}`}
|
|
48
|
+
data-percent={drawPercentage}
|
|
49
|
+
fill="none"
|
|
50
|
+
>
|
|
51
|
+
<circle
|
|
52
|
+
className="-rotate-90 stroke-gray-200 stroke-1"
|
|
53
|
+
cx={0}
|
|
54
|
+
cy={0}
|
|
55
|
+
r={radius}
|
|
56
|
+
></circle>
|
|
57
|
+
<circle
|
|
58
|
+
strokeDasharray={`${drawPercentage} 999`}
|
|
59
|
+
className="m-1 -rotate-90 stroke-purple-600 stroke-1 transition-all"
|
|
60
|
+
cx={0}
|
|
61
|
+
cy={0}
|
|
62
|
+
r={radius}
|
|
63
|
+
></circle>
|
|
64
|
+
</svg>
|
|
65
|
+
<div
|
|
66
|
+
className={cn(
|
|
67
|
+
`h-[${viewPortXY}px] w-[${viewPortXY}px] absolute inset-0 flex items-center justify-center overflow-hidden `
|
|
68
|
+
)}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default RadialProgress
|
package/stories/index.ts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
//Atomic Components, props, and type gaurds.
|
|
2
|
+
import {
|
|
3
|
+
IAvatarProps,
|
|
4
|
+
IBadgeProps,
|
|
5
|
+
IButtonProps,
|
|
6
|
+
ICapsuleProps,
|
|
7
|
+
IDynamicIconProps,
|
|
8
|
+
IIconWithShadowProps,
|
|
9
|
+
ILoaderProps,
|
|
10
|
+
IRadialProgressProps,
|
|
11
|
+
UnifiedIconName,
|
|
12
|
+
IconName,
|
|
13
|
+
FAIconName,
|
|
14
|
+
BTNActionType,
|
|
15
|
+
Avatar,
|
|
16
|
+
Badge,
|
|
17
|
+
Button,
|
|
18
|
+
Capsule,
|
|
19
|
+
DynamicIcon,
|
|
20
|
+
IconWithShadow,
|
|
21
|
+
Loader,
|
|
22
|
+
RadialProgress,
|
|
23
|
+
isFAIcon,
|
|
24
|
+
isHeroIcon,
|
|
25
|
+
isTablerIcon,
|
|
26
|
+
isUnifiedIconName
|
|
27
|
+
} from "./atoms"
|
|
28
|
+
// Molecular Components, props, and type gaurds.
|
|
29
|
+
import {
|
|
30
|
+
ICheckboxProps,
|
|
31
|
+
IComboboxProps,
|
|
32
|
+
IInputFieldProps,
|
|
33
|
+
IInputLabelProps,
|
|
34
|
+
INestedInputButtonProps,
|
|
35
|
+
IRadioProps,
|
|
36
|
+
ISelectProps,
|
|
37
|
+
ITextAreaFieldProps,
|
|
38
|
+
IToggleSwitchProps,
|
|
39
|
+
AcceptedInputTypes,
|
|
40
|
+
Checkbox,
|
|
41
|
+
Combobox,
|
|
42
|
+
InputField,
|
|
43
|
+
InputLabel,
|
|
44
|
+
NestedInputButton,
|
|
45
|
+
Radio,
|
|
46
|
+
Select,
|
|
47
|
+
TextAreaField,
|
|
48
|
+
ToggleSwitch
|
|
49
|
+
} from "./molecules"
|
|
50
|
+
// Organism Components, props, and type gaurds.
|
|
51
|
+
import {
|
|
52
|
+
IAnimatedLabelInputProps,
|
|
53
|
+
IButtonDropdownProps,
|
|
54
|
+
IDropdownClassnames,
|
|
55
|
+
IDropdownProps,
|
|
56
|
+
IEmptySectionPlaceholderProps,
|
|
57
|
+
IItemProp,
|
|
58
|
+
IFormInputWithAddonsProps,
|
|
59
|
+
AnimatedLabelInput,
|
|
60
|
+
ButtonDropdown,
|
|
61
|
+
Dropdown,
|
|
62
|
+
EmptySectionPlaceholder,
|
|
63
|
+
FormInputWithAddons
|
|
64
|
+
} from "./organisms"
|
|
65
|
+
|
|
66
|
+
export type {
|
|
67
|
+
IAvatarProps,
|
|
68
|
+
IBadgeProps,
|
|
69
|
+
IButtonProps,
|
|
70
|
+
ICapsuleProps,
|
|
71
|
+
IDynamicIconProps,
|
|
72
|
+
IIconWithShadowProps,
|
|
73
|
+
ILoaderProps,
|
|
74
|
+
IRadialProgressProps,
|
|
75
|
+
ICheckboxProps,
|
|
76
|
+
IComboboxProps,
|
|
77
|
+
IInputFieldProps,
|
|
78
|
+
IInputLabelProps,
|
|
79
|
+
INestedInputButtonProps,
|
|
80
|
+
IRadioProps,
|
|
81
|
+
ISelectProps,
|
|
82
|
+
ITextAreaFieldProps,
|
|
83
|
+
IToggleSwitchProps,
|
|
84
|
+
AcceptedInputTypes,
|
|
85
|
+
IAnimatedLabelInputProps,
|
|
86
|
+
IButtonDropdownProps,
|
|
87
|
+
IDropdownClassnames,
|
|
88
|
+
IDropdownProps,
|
|
89
|
+
IEmptySectionPlaceholderProps,
|
|
90
|
+
IItemProp,
|
|
91
|
+
IFormInputWithAddonsProps,
|
|
92
|
+
UnifiedIconName,
|
|
93
|
+
IconName,
|
|
94
|
+
FAIconName,
|
|
95
|
+
BTNActionType
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
Avatar,
|
|
99
|
+
Checkbox,
|
|
100
|
+
Combobox,
|
|
101
|
+
InputField,
|
|
102
|
+
InputLabel,
|
|
103
|
+
NestedInputButton,
|
|
104
|
+
Radio,
|
|
105
|
+
Select,
|
|
106
|
+
TextAreaField,
|
|
107
|
+
ToggleSwitch,
|
|
108
|
+
AnimatedLabelInput,
|
|
109
|
+
ButtonDropdown,
|
|
110
|
+
Dropdown,
|
|
111
|
+
EmptySectionPlaceholder,
|
|
112
|
+
FormInputWithAddons,
|
|
113
|
+
Badge,
|
|
114
|
+
Button,
|
|
115
|
+
Capsule,
|
|
116
|
+
DynamicIcon,
|
|
117
|
+
IconWithShadow,
|
|
118
|
+
Loader,
|
|
119
|
+
RadialProgress,
|
|
120
|
+
isFAIcon,
|
|
121
|
+
isHeroIcon,
|
|
122
|
+
isTablerIcon,
|
|
123
|
+
isUnifiedIconName
|
|
124
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import CardLayout, { ICardLayoutProps } from "./CardLayout"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof CardLayout> = {
|
|
6
|
+
title: "Design System/layouts/CardLayout",
|
|
7
|
+
component: CardLayout,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default meta
|
|
13
|
+
type Story = StoryObj<typeof CardLayout>
|
|
14
|
+
export const DefaultCardLayoutStory: 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 ICardLayoutProps {}
|
|
6
|
+
|
|
7
|
+
const CardLayout: React.FC<ICardLayoutProps> = ({}) => {
|
|
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 CardLayout;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import ModalLayout, { IModalLayoutProps } from "./ModalLayout"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ModalLayout> = {
|
|
6
|
+
title: "Design System/layouts/ModalLayout",
|
|
7
|
+
component: ModalLayout,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default meta
|
|
13
|
+
type Story = StoryObj<typeof ModalLayout>
|
|
14
|
+
export const DefaultModalLayoutStory: 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 IModalLayoutProps {}
|
|
6
|
+
|
|
7
|
+
const ModalLayout: React.FC<IModalLayoutProps> = ({}) => {
|
|
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 ModalLayout;
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ICheckboxProps,
|
|
3
|
+
IComboboxProps,
|
|
4
|
+
IInputFieldProps,
|
|
5
|
+
IInputLabelProps,
|
|
6
|
+
INestedInputButtonProps,
|
|
7
|
+
IRadioProps,
|
|
8
|
+
ISelectProps,
|
|
9
|
+
ITextAreaFieldProps,
|
|
10
|
+
IToggleSwitchProps,
|
|
11
|
+
AcceptedInputTypes,
|
|
12
|
+
Checkbox,
|
|
13
|
+
Combobox,
|
|
14
|
+
InputField,
|
|
15
|
+
InputLabel,
|
|
16
|
+
NestedInputButton,
|
|
17
|
+
Radio,
|
|
18
|
+
Select,
|
|
19
|
+
TextAreaField,
|
|
20
|
+
ToggleSwitch
|
|
21
|
+
} from "./inputs"
|
|
22
|
+
|
|
23
|
+
export type {
|
|
24
|
+
ICheckboxProps,
|
|
25
|
+
IComboboxProps,
|
|
26
|
+
IInputFieldProps,
|
|
27
|
+
IInputLabelProps,
|
|
28
|
+
INestedInputButtonProps,
|
|
29
|
+
IRadioProps,
|
|
30
|
+
ISelectProps,
|
|
31
|
+
ITextAreaFieldProps,
|
|
32
|
+
IToggleSwitchProps,
|
|
33
|
+
AcceptedInputTypes
|
|
34
|
+
}
|
|
35
|
+
export { Checkbox, Combobox, InputField, InputLabel, NestedInputButton, Radio, Select, TextAreaField, ToggleSwitch }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import InputField from "./InputField"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof InputField> = {
|
|
5
|
+
title: "Design System/molecules/inputs/Input Field",
|
|
6
|
+
component: InputField,
|
|
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-1861&mode=dev&device-scaling=100%25&page-id=0%3A1"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof InputField>
|
|
19
|
+
|
|
20
|
+
export const DefaultInputField: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
id: "input",
|
|
23
|
+
name: "input",
|
|
24
|
+
type: "text",
|
|
25
|
+
placeholder: "Base Input Field",
|
|
26
|
+
defaultValue: "",
|
|
27
|
+
isDisabled: false
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { default as cn } from "classnames"
|
|
3
|
+
|
|
4
|
+
export type AcceptedInputTypes =
|
|
5
|
+
| "date"
|
|
6
|
+
| "datetime-local"
|
|
7
|
+
| "email"
|
|
8
|
+
| "month"
|
|
9
|
+
| "number"
|
|
10
|
+
| "password"
|
|
11
|
+
| "search"
|
|
12
|
+
| "submit"
|
|
13
|
+
| "tel"
|
|
14
|
+
| "text"
|
|
15
|
+
| "url"
|
|
16
|
+
|
|
17
|
+
export interface IInputFieldProps extends React.ComponentPropsWithoutRef<"input"> {
|
|
18
|
+
/** Callback on change */
|
|
19
|
+
handleChange: (value: string) => void
|
|
20
|
+
/** Input ID*/
|
|
21
|
+
id: string
|
|
22
|
+
/** Input Name */
|
|
23
|
+
name: string
|
|
24
|
+
/** Force the focus state on the input */
|
|
25
|
+
isFocused?: boolean
|
|
26
|
+
/** Error condition */
|
|
27
|
+
isError?: boolean
|
|
28
|
+
/** Disabled state */
|
|
29
|
+
isDisabled?: boolean
|
|
30
|
+
/** Readonly state */
|
|
31
|
+
isReadonly?: boolean
|
|
32
|
+
/** Input value */
|
|
33
|
+
value: string
|
|
34
|
+
/** Type of Text Input to Render eg. "text", "email" */
|
|
35
|
+
type: AcceptedInputTypes
|
|
36
|
+
/** If field is required */
|
|
37
|
+
required?: boolean
|
|
38
|
+
/** use input psuedo classes for :valid and :invalid styles. on by default */
|
|
39
|
+
clientSideCheck?: boolean
|
|
40
|
+
/** use placeholder string */
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const InputField: React.FC<IInputFieldProps> = ({
|
|
44
|
+
type,
|
|
45
|
+
id,
|
|
46
|
+
name,
|
|
47
|
+
value,
|
|
48
|
+
isFocused,
|
|
49
|
+
isError,
|
|
50
|
+
isReadonly,
|
|
51
|
+
isDisabled,
|
|
52
|
+
handleChange,
|
|
53
|
+
required,
|
|
54
|
+
clientSideCheck = true,
|
|
55
|
+
placeholder,
|
|
56
|
+
className,
|
|
57
|
+
...rest
|
|
58
|
+
}) => {
|
|
59
|
+
return (
|
|
60
|
+
<input
|
|
61
|
+
{...{
|
|
62
|
+
type,
|
|
63
|
+
id,
|
|
64
|
+
name,
|
|
65
|
+
value,
|
|
66
|
+
onChange: (e) => {
|
|
67
|
+
handleChange(e.target.value)
|
|
68
|
+
},
|
|
69
|
+
autoFocus: isFocused,
|
|
70
|
+
readOnly: isReadonly,
|
|
71
|
+
disabled: isDisabled,
|
|
72
|
+
placeholder: placeholder || " ",
|
|
73
|
+
required,
|
|
74
|
+
"aria-invalid": isError,
|
|
75
|
+
"aria-disabled": isDisabled,
|
|
76
|
+
className: cn(
|
|
77
|
+
"peer w-full rounded border border-gray-200 px-3 text-sm font-normal leading-5 outline-offset-0 ring-offset-0 focus:border-purple-600 focus:ring-purple-600 ",
|
|
78
|
+
isError ? "!border-red-600 !text-red-600 focus:!ring-red-600" : "",
|
|
79
|
+
isReadonly ? "!border-gray-400 !text-gray-500 focus:!ring-gray-400" : "",
|
|
80
|
+
className
|
|
81
|
+
),
|
|
82
|
+
...rest
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export default InputField
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import InputLabel from "./InputLabel"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof InputLabel> = {
|
|
5
|
+
title: "Design System/molecules/inputs/Input Label",
|
|
6
|
+
component: InputLabel,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
type Story = StoryObj<typeof InputLabel>
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
label: "Label",
|
|
17
|
+
id: "input-label"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -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
|
+
}
|