@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.
Files changed (102) hide show
  1. package/README.md +104 -31
  2. package/build.js +30 -25
  3. package/dist/index.d.ts +278 -89
  4. package/dist/index.js +1 -5980
  5. package/dist/index.js.map +4 -4
  6. package/dist/tailwind.css +63599 -0
  7. package/dist/types/stories/atoms/buttons/Button/Alternative/Alternative.stories.d.ts +1 -0
  8. package/dist/types/stories/atoms/buttons/Button/Button.d.ts +3 -7
  9. package/dist/types/stories/atoms/buttons/Button/Danger/Danger.stories.d.ts +1 -0
  10. package/dist/types/stories/atoms/buttons/Button/Primary/Primary.stories.d.ts +1 -0
  11. package/dist/types/stories/atoms/buttons/Button/Secondary/Secondary.stories.d.ts +1 -0
  12. package/dist/types/stories/atoms/buttons/Capsule/Capsule.d.ts +1 -1
  13. package/dist/types/stories/atoms/icons/DynamicIcon.d.ts +2 -2
  14. package/dist/types/stories/atoms/icons/TablerIcon.d.ts +1 -1
  15. package/dist/types/stories/index.d.ts +4 -4
  16. package/dist/types/stories/molecules/index.d.ts +3 -3
  17. package/dist/types/stories/molecules/inputs/InputCounter/InputCounter.d.ts +10 -0
  18. package/dist/types/stories/molecules/inputs/InputCounter/index.d.ts +2 -0
  19. package/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +6 -4
  20. package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +39 -0
  21. package/dist/types/stories/molecules/inputs/TextInput/index.d.ts +4 -0
  22. package/dist/types/stories/molecules/inputs/index.d.ts +5 -4
  23. package/dist/types/stories/molecules/inputs/select/Select.d.ts +2 -2
  24. package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +34 -21
  25. package/dist/types/stories/molecules/inputs/textArea/TextArea.stories.d.ts +4 -4
  26. package/dist/types/stories/molecules/inputs/textArea/index.d.ts +3 -3
  27. package/dist/types/stories/molecules/inputs/toggleSwitch/ToggleSwitch.d.ts +10 -7
  28. package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +3 -5
  29. package/dist/types/stories/organisms/AnimatedLabelInput/index.d.ts +1 -1
  30. package/dist/types/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.d.ts +12 -0
  31. package/dist/types/stories/organisms/AnimatedLabelTextArea/index.d.ts +3 -0
  32. package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +21 -12
  33. package/dist/types/stories/organisms/DropdownComponent/index.d.ts +2 -2
  34. package/dist/types/stories/organisms/EmptySectionPlaceholder/index.d.ts +1 -1
  35. package/dist/types/stories/organisms/TextInputSelect/InputSelect.d.ts +16 -0
  36. package/dist/types/stories/organisms/TextInputSelect/TextInputSelect.d.ts +48 -0
  37. package/dist/types/stories/organisms/TextInputSelect/index.d.ts +3 -0
  38. package/dist/types/stories/organisms/index.d.ts +5 -3
  39. package/local.sh +100 -0
  40. package/package.json +36 -19
  41. package/rollup.config.mjs +42 -0
  42. package/stories/Introduction.mdx +1 -1
  43. package/stories/atoms/badges/Badge.tsx +1 -1
  44. package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +10 -0
  45. package/stories/atoms/buttons/Button/Button.tsx +108 -24
  46. package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +14 -2
  47. package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +14 -2
  48. package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +13 -1
  49. package/stories/atoms/buttons/Button/defaultArgs.ts +1 -1
  50. package/stories/atoms/buttons/Capsule/Capsule.tsx +2 -1
  51. package/stories/atoms/icons/DynamicIcon.stories.ts +1 -1
  52. package/stories/atoms/icons/DynamicIcon.tsx +7 -7
  53. package/stories/atoms/icons/IconWithShadow.stories.ts +3 -3
  54. package/stories/atoms/icons/TablerIcon.tsx +1 -1
  55. package/stories/atoms/loaders/Loader.tsx +12 -6
  56. package/stories/index.ts +22 -10
  57. package/stories/molecules/index.ts +22 -6
  58. package/stories/molecules/inputs/InputField/InputField.tsx +10 -9
  59. package/stories/molecules/inputs/TextInput/TextInput.tsx +6 -3
  60. package/stories/molecules/inputs/TextInput/index.tsx +4 -2
  61. package/stories/molecules/inputs/checkbox/Checkbox.tsx +1 -2
  62. package/stories/molecules/inputs/combobox/ComboBox.tsx +126 -135
  63. package/stories/molecules/inputs/index.ts +18 -4
  64. package/stories/molecules/inputs/select/Select.tsx +1 -1
  65. package/stories/molecules/inputs/textArea/TextArea.stories.ts +7 -5
  66. package/stories/molecules/inputs/textArea/TextArea.tsx +139 -48
  67. package/stories/molecules/inputs/textArea/index.ts +3 -3
  68. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +63 -57
  69. package/stories/molecules/tabs/index.tsx +2 -3
  70. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +10 -1
  71. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +43 -37
  72. package/stories/organisms/AnimatedLabelInput/index.tsx +1 -1
  73. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -0
  74. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -0
  75. package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -0
  76. package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +65 -58
  77. package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +26 -21
  78. package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +2 -2
  79. package/stories/organisms/DropdownComponent/DropdownComponent.tsx +213 -178
  80. package/stories/organisms/DropdownComponent/dropdownItems.ts +30 -9
  81. package/stories/organisms/DropdownComponent/index.ts +2 -2
  82. package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +3 -3
  83. package/stories/organisms/EmptySectionPlaceholder/index.tsx +2 -1
  84. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +1 -1
  85. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +7 -2
  86. package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -0
  87. package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -0
  88. package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -0
  89. package/stories/organisms/TextInputSelect/index.tsx +3 -0
  90. package/stories/organisms/index.ts +15 -4
  91. package/tsconfig.lib.json +13 -6
  92. package/watch.js +49 -0
  93. package/.yarnrc.yml +0 -1
  94. package/dist/types/stories/layouts/index.d.ts +0 -0
  95. package/stories/layouts/CardLayout/CardLayout.stories.tsx +0 -18
  96. package/stories/layouts/CardLayout/CardLayout.tsx +0 -22
  97. package/stories/layouts/CardLayout/index.tsx +0 -3
  98. package/stories/layouts/ModalLayout/ModalLayout.stories.tsx +0 -18
  99. package/stories/layouts/ModalLayout/ModalLayout.tsx +0 -22
  100. package/stories/layouts/ModalLayout/index.tsx +0 -3
  101. package/stories/layouts/index.ts +0 -0
  102. 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
- 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
- }
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
- 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
- }
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
- 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
- }
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
- 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
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: "ChevronDownIcon",
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
- classNames: dropDownClasses,
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: 5, //up/down
72
- alignmentAxis: -10 //left/right
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={"DotsVerticalIcon"} />
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
- classNames: defaultClassNames,
21
+
22
22
  placement: "bottom-end"
23
23
  }
24
24
  export const WithLabel: Story = {