@agility/plenum-ui 2.0.0-rc4 → 2.0.0-rc40
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/README.md +104 -31
- package/build.js +30 -25
- package/dist/index.d.ts +278 -89
- package/dist/index.js +1 -5980
- package/dist/index.js.map +4 -4
- package/dist/tailwind.css +63599 -0
- package/dist/types/stories/atoms/buttons/Button/Alternative/Alternative.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Button.d.ts +3 -7
- package/dist/types/stories/atoms/buttons/Button/Danger/Danger.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Primary/Primary.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Secondary/Secondary.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Capsule/Capsule.d.ts +1 -1
- package/dist/types/stories/atoms/icons/DynamicIcon.d.ts +2 -2
- package/dist/types/stories/atoms/icons/TablerIcon.d.ts +1 -1
- package/dist/types/stories/index.d.ts +4 -4
- package/dist/types/stories/molecules/index.d.ts +3 -3
- package/dist/types/stories/molecules/inputs/InputCounter/InputCounter.d.ts +10 -0
- package/dist/types/stories/molecules/inputs/InputCounter/index.d.ts +2 -0
- package/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +6 -4
- package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +39 -0
- package/dist/types/stories/molecules/inputs/TextInput/index.d.ts +4 -0
- package/dist/types/stories/molecules/inputs/index.d.ts +5 -4
- package/dist/types/stories/molecules/inputs/select/Select.d.ts +2 -2
- package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +34 -21
- package/dist/types/stories/molecules/inputs/textArea/TextArea.stories.d.ts +4 -4
- package/dist/types/stories/molecules/inputs/textArea/index.d.ts +3 -3
- package/dist/types/stories/molecules/inputs/toggleSwitch/ToggleSwitch.d.ts +10 -7
- package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +3 -5
- package/dist/types/stories/organisms/AnimatedLabelInput/index.d.ts +1 -1
- package/dist/types/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.d.ts +12 -0
- package/dist/types/stories/organisms/AnimatedLabelTextArea/index.d.ts +3 -0
- package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +21 -12
- package/dist/types/stories/organisms/DropdownComponent/index.d.ts +2 -2
- package/dist/types/stories/organisms/EmptySectionPlaceholder/index.d.ts +1 -1
- package/dist/types/stories/organisms/TextInputSelect/InputSelect.d.ts +16 -0
- package/dist/types/stories/organisms/TextInputSelect/TextInputSelect.d.ts +48 -0
- package/dist/types/stories/organisms/TextInputSelect/index.d.ts +3 -0
- package/dist/types/stories/organisms/index.d.ts +5 -3
- package/local.sh +100 -0
- package/package.json +36 -19
- package/rollup.config.mjs +42 -0
- package/stories/Introduction.mdx +1 -1
- package/stories/atoms/badges/Badge.tsx +1 -1
- package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +10 -0
- package/stories/atoms/buttons/Button/Button.tsx +108 -24
- package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +14 -2
- package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +14 -2
- package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +13 -1
- package/stories/atoms/buttons/Button/defaultArgs.ts +1 -1
- package/stories/atoms/buttons/Capsule/Capsule.tsx +2 -1
- package/stories/atoms/icons/DynamicIcon.stories.ts +1 -1
- package/stories/atoms/icons/DynamicIcon.tsx +7 -7
- package/stories/atoms/icons/IconWithShadow.stories.ts +3 -3
- package/stories/atoms/icons/TablerIcon.tsx +1 -1
- package/stories/atoms/loaders/Loader.tsx +12 -6
- package/stories/index.ts +22 -10
- package/stories/molecules/index.ts +22 -6
- package/stories/molecules/inputs/InputField/InputField.tsx +10 -9
- package/stories/molecules/inputs/TextInput/TextInput.tsx +6 -3
- package/stories/molecules/inputs/TextInput/index.tsx +4 -2
- package/stories/molecules/inputs/checkbox/Checkbox.tsx +1 -2
- package/stories/molecules/inputs/combobox/ComboBox.tsx +126 -135
- package/stories/molecules/inputs/index.ts +18 -4
- package/stories/molecules/inputs/select/Select.tsx +1 -1
- package/stories/molecules/inputs/textArea/TextArea.stories.ts +7 -5
- package/stories/molecules/inputs/textArea/TextArea.tsx +139 -48
- package/stories/molecules/inputs/textArea/index.ts +3 -3
- package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +63 -57
- package/stories/molecules/tabs/index.tsx +2 -3
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +10 -1
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +43 -37
- package/stories/organisms/AnimatedLabelInput/index.tsx +1 -1
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -0
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -0
- package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -0
- package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +65 -58
- package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +26 -21
- package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +2 -2
- package/stories/organisms/DropdownComponent/DropdownComponent.tsx +213 -178
- package/stories/organisms/DropdownComponent/dropdownItems.ts +30 -9
- package/stories/organisms/DropdownComponent/index.ts +2 -2
- package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +3 -3
- package/stories/organisms/EmptySectionPlaceholder/index.tsx +2 -1
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +1 -1
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +7 -2
- 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 +15 -4
- package/tsconfig.lib.json +13 -6
- package/watch.js +49 -0
- package/.yarnrc.yml +0 -1
- package/dist/types/stories/layouts/index.d.ts +0 -0
- package/stories/layouts/CardLayout/CardLayout.stories.tsx +0 -18
- package/stories/layouts/CardLayout/CardLayout.tsx +0 -22
- package/stories/layouts/CardLayout/index.tsx +0 -3
- package/stories/layouts/ModalLayout/ModalLayout.stories.tsx +0 -18
- package/stories/layouts/ModalLayout/ModalLayout.tsx +0 -22
- package/stories/layouts/ModalLayout/index.tsx +0 -3
- package/stories/layouts/index.ts +0 -0
- package/stories/organisms/DropdownComponent/Dropdown.test.tsx +0 -0
|
@@ -2,74 +2,76 @@ import type { Meta, StoryObj } from "@storybook/react"
|
|
|
2
2
|
import ButtonDropdown from "."
|
|
3
3
|
import { IItemProp } from "../DropdownComponent"
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
const meta: Meta<typeof ButtonDropdown> = {
|
|
7
6
|
title: "Design System/Organisms/Button Dropdown",
|
|
8
7
|
component: ButtonDropdown,
|
|
9
8
|
tags: ["autodocs"],
|
|
10
9
|
argTypes: {}
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
const dropdownDataWithIcons: IItemProp[][] = [
|
|
12
|
+
[
|
|
13
|
+
{
|
|
14
|
+
icon: {
|
|
15
|
+
icon: "IconCopy"
|
|
16
|
+
|
|
17
|
+
// className: "h-5 w-5",
|
|
18
|
+
// outline: false
|
|
19
|
+
},
|
|
20
|
+
iconPosition: "leading",
|
|
21
|
+
key: "Copy",
|
|
22
|
+
label: "Copy The Thing",
|
|
23
|
+
onClick: () => {
|
|
24
|
+
console.log("Copy action")
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
key: "Add to Batch",
|
|
37
|
-
label: "Add to Batch",
|
|
38
|
-
onClick: () => {
|
|
39
|
-
console.log("Add to Batch action")
|
|
40
|
-
}
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
icon: {
|
|
31
|
+
icon: "IconFolderPlus"
|
|
32
|
+
// name: "IconFolderPlus",
|
|
33
|
+
// className: "h-5 w-5",
|
|
34
|
+
// outline: false
|
|
41
35
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
}
|
|
36
|
+
key: "Add to Batch",
|
|
37
|
+
label: "Add to Batch",
|
|
38
|
+
onClick: () => {
|
|
39
|
+
console.log("Add to Batch action")
|
|
54
40
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
icon:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
isEmphasized: true
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
icon: {
|
|
44
|
+
icon: "IconEye",
|
|
45
|
+
//pos: "leading",
|
|
46
|
+
className: "h-5 w-5",
|
|
47
|
+
outline: false
|
|
48
|
+
},
|
|
49
|
+
iconPosition: "leading",
|
|
50
|
+
key: "View Batch",
|
|
51
|
+
label: "View Batch",
|
|
52
|
+
onClick: () => {
|
|
53
|
+
console.log("View Batch action")
|
|
70
54
|
}
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
{
|
|
59
|
+
icon: {
|
|
60
|
+
icon: "IconTrash"
|
|
61
|
+
|
|
62
|
+
// pos: "leading",
|
|
63
|
+
// className: "h-5 w-5",
|
|
64
|
+
// outline: false
|
|
65
|
+
},
|
|
66
|
+
key: "Delete",
|
|
67
|
+
label: "Delete",
|
|
68
|
+
onClick: () => {
|
|
69
|
+
console.log("Delete action")
|
|
70
|
+
},
|
|
71
|
+
isEmphasized: true
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
]
|
|
73
75
|
|
|
74
76
|
export default meta
|
|
75
77
|
type Story = StoryObj<typeof ButtonDropdown>
|
|
@@ -85,6 +87,11 @@ export const Primary: Story = {
|
|
|
85
87
|
label: "Dropdown",
|
|
86
88
|
id: "dropdown-primary"
|
|
87
89
|
},
|
|
90
|
+
offsetOptions: {
|
|
91
|
+
crossAxis: 0,
|
|
92
|
+
mainAxis: 4, //up/down
|
|
93
|
+
alignmentAxis: 0 //left/right
|
|
94
|
+
},
|
|
88
95
|
placement: "bottom-end"
|
|
89
96
|
}
|
|
90
97
|
}
|
|
@@ -15,22 +15,7 @@ export interface IButtonDropdownProps {
|
|
|
15
15
|
/**
|
|
16
16
|
* Primary UI component for user interaction
|
|
17
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
|
-
}
|
|
18
|
+
const ButtonDropdown: FC<IButtonDropdownProps> = ({ button, dropDown, placement = "bottom-end", offsetOptions }) => {
|
|
34
19
|
return (
|
|
35
20
|
<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
21
|
<Button
|
|
@@ -45,7 +30,7 @@ const ButtonDropdown: FC<IButtonDropdownProps> = ({ button, dropDown, placement,
|
|
|
45
30
|
<div
|
|
46
31
|
className={cn(
|
|
47
32
|
"w-[1px] rt",
|
|
48
|
-
button.actionType === "primary" ? "bg-purple-700" : "",
|
|
33
|
+
button.actionType === "primary" ? "bg-purple-700 " : "",
|
|
49
34
|
button.actionType === "secondary" ? "bg-purple-200" : "",
|
|
50
35
|
button.actionType === "alternative" ? "bg-gray-300" : ""
|
|
51
36
|
)}
|
|
@@ -56,7 +41,7 @@ const ButtonDropdown: FC<IButtonDropdownProps> = ({ button, dropDown, placement,
|
|
|
56
41
|
CustomDropdownTrigger: (
|
|
57
42
|
<DynamicIcon
|
|
58
43
|
{...{
|
|
59
|
-
icon: "
|
|
44
|
+
icon: "IconChevronDown",
|
|
60
45
|
className: cn("h-5 w-5", {
|
|
61
46
|
"text-white": button.actionType === "primary",
|
|
62
47
|
"text-purple-700": button.actionType === "secondary",
|
|
@@ -65,11 +50,31 @@ const ButtonDropdown: FC<IButtonDropdownProps> = ({ button, dropDown, placement,
|
|
|
65
50
|
}}
|
|
66
51
|
/>
|
|
67
52
|
),
|
|
68
|
-
|
|
53
|
+
buttonClassname: cn(
|
|
54
|
+
"flex items-center justify-center rounded-l-none border !border-l-0 rounded-r px-2 transition-all hover:!border-l-0",
|
|
55
|
+
button.actionType === "primary"
|
|
56
|
+
? cn(
|
|
57
|
+
"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",
|
|
58
|
+
"disabled:bg-purple-400 disabled:text-white disabled:hover:none disabled:active:bg-purple-400 disabled:border-purple-400"
|
|
59
|
+
)
|
|
60
|
+
: "",
|
|
61
|
+
button.actionType === "secondary"
|
|
62
|
+
? cn(
|
|
63
|
+
"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",
|
|
64
|
+
"disabled:bg-purple-50 disabled:text-grey-50 disabled:hover:none disabled:active:bg-purple-50 disabled:border-purple-50"
|
|
65
|
+
)
|
|
66
|
+
: "",
|
|
67
|
+
button.actionType === "alternative"
|
|
68
|
+
? cn(
|
|
69
|
+
"border-gray-300 bg-white text-gray-700 fill-gray-700 hover:border-gray-300 hover:bg-gray-50 active:bg-gray-100",
|
|
70
|
+
"disabled:bg-gray-100 disabled:text-gray-500 disabled:hover:none disabled:active:bg-gray-100 disabled:border-gray-300"
|
|
71
|
+
)
|
|
72
|
+
: ""
|
|
73
|
+
),
|
|
69
74
|
offsetOptions: offsetOptions ?? {
|
|
70
75
|
crossAxis: 0,
|
|
71
|
-
mainAxis:
|
|
72
|
-
alignmentAxis:
|
|
76
|
+
mainAxis: 4, //up/down
|
|
77
|
+
alignmentAxis: 0 //left/right
|
|
73
78
|
},
|
|
74
79
|
placement
|
|
75
80
|
}}
|
|
@@ -13,12 +13,12 @@ const meta: Meta<typeof Dropdown> = {
|
|
|
13
13
|
type Story = StoryObj<typeof Dropdown>
|
|
14
14
|
|
|
15
15
|
const IconElement = () => (
|
|
16
|
-
<DynamicIcon className="h-5 w-5 text-gray-400 hover:text-gray-600" icon={"
|
|
16
|
+
<DynamicIcon className="h-5 w-5 text-gray-400 hover:text-gray-600" icon={"IconDotsVertical"} />
|
|
17
17
|
)
|
|
18
18
|
const defaultArgs: Story["args"] = {
|
|
19
19
|
items: [...dropdownDataBase],
|
|
20
20
|
label: "Dropdown",
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
placement: "bottom-end"
|
|
23
23
|
}
|
|
24
24
|
export const WithLabel: Story = {
|