@agility/plenum-ui 2.0.0-rc47 → 2.0.0-rc49

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 (141) hide show
  1. package/.eslintrc.json +6 -6
  2. package/.prettierrc +13 -13
  3. package/.storybook/Layout.jsx +12 -12
  4. package/.storybook/head.tsx +4 -4
  5. package/.storybook/main.ts +18 -18
  6. package/.storybook/manager-head.html +1 -1
  7. package/.storybook/manager.ts +25 -25
  8. package/.storybook/plenumTheme.ts +8 -8
  9. package/.storybook/preview-head.html +3 -3
  10. package/.storybook/preview.tsx +28 -28
  11. package/.vscode/settings.json +3 -3
  12. package/README.md +271 -271
  13. package/app/globals.css +99 -99
  14. package/app/head.tsx +59 -59
  15. package/app/layout.tsx +28 -28
  16. package/app/page.tsx +7 -7
  17. package/build.js +45 -45
  18. package/dist/index.d.ts +232 -230
  19. package/dist/index.js +1 -1
  20. package/dist/index.js.map +3 -3
  21. package/dist/types/stories/molecules/inputs/select/Select.d.ts +2 -0
  22. package/local.sh +100 -100
  23. package/next.config.js +8 -8
  24. package/package.json +82 -82
  25. package/pages/api/hello.ts +13 -13
  26. package/postcss.config.js +6 -6
  27. package/rollup.config.mjs +41 -41
  28. package/scripts/create-component.js +97 -97
  29. package/stories/Introduction.mdx +314 -314
  30. package/stories/assets/stackalt.svg +1 -1
  31. package/stories/atoms/Avatar/Avatar.stories.tsx +96 -96
  32. package/stories/atoms/Avatar/Avatar.tsx +123 -123
  33. package/stories/atoms/Avatar/index.ts +3 -3
  34. package/stories/atoms/badges/Badge.tsx +127 -127
  35. package/stories/atoms/badges/Pill/Pill.stories.tsx +75 -75
  36. package/stories/atoms/badges/Rounded/Rounded.stories.tsx +75 -75
  37. package/stories/atoms/badges/index.ts +3 -3
  38. package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +86 -86
  39. package/stories/atoms/buttons/Button/Button.tsx +232 -232
  40. package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +90 -90
  41. package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +97 -97
  42. package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +93 -93
  43. package/stories/atoms/buttons/Button/defaultArgs.ts +9 -9
  44. package/stories/atoms/buttons/Button/index.ts +3 -3
  45. package/stories/atoms/buttons/Capsule/Alternative/Alternative.stories.ts +27 -27
  46. package/stories/atoms/buttons/Capsule/Capsule.tsx +88 -88
  47. package/stories/atoms/buttons/Capsule/Danger/Danger.stories.ts +27 -27
  48. package/stories/atoms/buttons/Capsule/Primary/Primary.stories.ts +27 -27
  49. package/stories/atoms/buttons/Capsule/Secondary/Secondary.stories.ts +27 -27
  50. package/stories/atoms/buttons/Capsule/index.ts +3 -3
  51. package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.stories.tsx +15 -15
  52. package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.tsx +22 -22
  53. package/stories/atoms/buttons/FloatingActionButton/index.tsx +3 -3
  54. package/stories/atoms/buttons/index.ts +4 -4
  55. package/stories/atoms/crumb/Crumb.stories.tsx +18 -18
  56. package/stories/atoms/crumb/Crumb.tsx +22 -22
  57. package/stories/atoms/crumb/index.tsx +3 -3
  58. package/stories/atoms/icons/DynamicIcon.stories.ts +43 -43
  59. package/stories/atoms/icons/DynamicIcon.tsx +90 -90
  60. package/stories/atoms/icons/IconWithShadow.stories.ts +43 -43
  61. package/stories/atoms/icons/IconWithShadow.tsx +16 -16
  62. package/stories/atoms/icons/TablerIcon.tsx +22 -22
  63. package/stories/atoms/icons/index.tsx +14 -14
  64. package/stories/atoms/icons/tablerIconNames.ts +4336 -4336
  65. package/stories/atoms/index.ts +46 -46
  66. package/stories/atoms/loaders/Loader.stories.ts +15 -15
  67. package/stories/atoms/loaders/Loader.tsx +21 -21
  68. package/stories/atoms/loaders/NProgress/RadialProgress.stories.tsx +19 -19
  69. package/stories/atoms/loaders/NProgress/RadialProgress.tsx +74 -74
  70. package/stories/atoms/loaders/NProgress/index.ts +3 -3
  71. package/stories/atoms/loaders/index.ts +4 -4
  72. package/stories/index.ts +136 -136
  73. package/stories/molecules/index.ts +51 -51
  74. package/stories/molecules/inputs/InputCounter/InputCounter.stories.tsx +18 -18
  75. package/stories/molecules/inputs/InputCounter/InputCounter.tsx +24 -24
  76. package/stories/molecules/inputs/InputCounter/index.tsx +3 -3
  77. package/stories/molecules/inputs/InputField/InputField.stories.tsx +29 -29
  78. package/stories/molecules/inputs/InputField/InputField.tsx +96 -96
  79. package/stories/molecules/inputs/InputField/index.tsx +3 -3
  80. package/stories/molecules/inputs/InputLabel/InputLabel.stories.tsx +19 -19
  81. package/stories/molecules/inputs/InputLabel/InputLabel.tsx +45 -45
  82. package/stories/molecules/inputs/InputLabel/index.tsx +3 -3
  83. package/stories/molecules/inputs/NestedInputButton/NestedInputButton.stories.tsx +52 -52
  84. package/stories/molecules/inputs/NestedInputButton/NestedInputButton.tsx +64 -64
  85. package/stories/molecules/inputs/NestedInputButton/index.tsx +3 -3
  86. package/stories/molecules/inputs/TextInput/TextInput.stories.tsx +32 -32
  87. package/stories/molecules/inputs/TextInput/TextInput.tsx +165 -165
  88. package/stories/molecules/inputs/TextInput/index.tsx +5 -5
  89. package/stories/molecules/inputs/checkbox/Checkbox.stories.ts +23 -23
  90. package/stories/molecules/inputs/checkbox/Checkbox.tsx +98 -98
  91. package/stories/molecules/inputs/checkbox/index.ts +3 -3
  92. package/stories/molecules/inputs/combobox/ComboBox.stories.ts +41 -41
  93. package/stories/molecules/inputs/combobox/ComboBox.tsx +185 -185
  94. package/stories/molecules/inputs/combobox/index.ts +3 -3
  95. package/stories/molecules/inputs/index.ts +38 -38
  96. package/stories/molecules/inputs/radio/Radio.stories.ts +27 -27
  97. package/stories/molecules/inputs/radio/Radio.tsx +92 -92
  98. package/stories/molecules/inputs/radio/index.ts +3 -3
  99. package/stories/molecules/inputs/select/Select.stories.ts +23 -23
  100. package/stories/molecules/inputs/select/Select.tsx +108 -100
  101. package/stories/molecules/inputs/select/index.ts +3 -3
  102. package/stories/molecules/inputs/textArea/TextArea.stories.ts +22 -22
  103. package/stories/molecules/inputs/textArea/TextArea.tsx +158 -158
  104. package/stories/molecules/inputs/textArea/index.ts +3 -3
  105. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.stories.tsx +118 -118
  106. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +81 -81
  107. package/stories/molecules/inputs/toggleSwitch/index.ts +3 -3
  108. package/stories/molecules/tabs/Tabs.stories.tsx +18 -18
  109. package/stories/molecules/tabs/Tabs.tsx +22 -22
  110. package/stories/molecules/tabs/index.tsx +2 -2
  111. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +30 -30
  112. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +66 -66
  113. package/stories/organisms/AnimatedLabelInput/index.tsx +3 -3
  114. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -26
  115. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -61
  116. package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -3
  117. package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +125 -125
  118. package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +86 -86
  119. package/stories/organisms/ButtonDropdown/index.tsx +3 -3
  120. package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +73 -73
  121. package/stories/organisms/DropdownComponent/DropdownComponent.tsx +346 -346
  122. package/stories/organisms/DropdownComponent/dropdownItems.ts +122 -122
  123. package/stories/organisms/DropdownComponent/index.ts +4 -4
  124. package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +76 -76
  125. package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.tsx +52 -52
  126. package/stories/organisms/EmptySectionPlaceholder/index.tsx +4 -4
  127. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +29 -29
  128. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +145 -145
  129. package/stories/organisms/FormInputWithAddons/index.tsx +3 -3
  130. package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -59
  131. package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -33
  132. package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -186
  133. package/stories/organisms/TextInputSelect/index.tsx +3 -3
  134. package/stories/organisms/index.ts +27 -27
  135. package/tailwind.config.js +192 -192
  136. package/tsconfig.json +29 -29
  137. package/tsconfig.lib.json +25 -25
  138. package/utils/types.d.ts +2 -2
  139. package/utils/types.ts +3 -3
  140. package/utils/useId.d.ts +1 -1
  141. package/utils/useId.tsx +16 -16
@@ -1,122 +1,122 @@
1
- import { IItemProp } from "./DropdownComponent"
2
-
3
- export const dropdownDataBase: IItemProp[][] = [
4
- [
5
- {
6
- icon: {
7
- icon: "IconCopy"
8
- // pos: "leading",
9
- // className: "h-5 w-5",
10
- // outline: false
11
- },
12
- key: "Copy",
13
- label: "Copy to Clipboard",
14
- onClick: () => {
15
- console.log("Copy action")
16
- }
17
- },
18
-
19
- {
20
- icon: {
21
- icon: "IconPlus"
22
- // pos: "leading",
23
- // className: "h-5 w-5",
24
- // outline: false
25
- },
26
- key: "Add to Batch",
27
- label: "Add to Batch",
28
- onClick: () => {
29
- console.log("Add to Batch action")
30
- }
31
- },
32
- {
33
- icon: {
34
- icon: "IconEye"
35
- // pos: "leading",
36
- // className: "h-5 w-5",
37
- // outline: false
38
- },
39
- key: "View Batch",
40
- label: "View Batch",
41
- onClick: () => {
42
- console.log("View Batch action")
43
- }
44
- },
45
- {
46
- icon: {
47
- icon: "IconTrash"
48
- // pos: "leading",
49
- // className: "h-5 w-5",
50
- // outline: false
51
- },
52
- label: "Delete",
53
- onClick: () => {
54
- console.log("Delete action")
55
- },
56
- isEmphasized: true,
57
- key: "Delete"
58
- }
59
- ]
60
- ]
61
-
62
- export const dropdownDataWithIcons: IItemProp[][] = [
63
- [
64
- {
65
- icon: {
66
- icon: "IconCopy",
67
- className: "h-5 w-5",
68
- outline: false
69
- },
70
- iconPosition: "leading",
71
- key: "Copy",
72
- label: "Copy Item",
73
- onClick: () => {
74
- console.log("Copy action")
75
- }
76
- }
77
- ],
78
- [
79
- {
80
- icon: {
81
- icon: "IconFolderPlus",
82
- className: "h-5 w-5",
83
- outline: false
84
- },
85
- iconPosition: "leading",
86
- key: "Add to Batch",
87
- label: "Add to Batch",
88
- onClick: () => {
89
- console.log("Add to Batch action")
90
- }
91
- },
92
- {
93
- icon: {
94
- icon: "IconEye",
95
- className: "h-5 w-5",
96
- outline: false
97
- },
98
- iconPosition: "leading",
99
- key: "View Batch",
100
- label: "View Batch",
101
- onClick: () => {
102
- console.log("View Batch action")
103
- }
104
- }
105
- ],
106
- [
107
- {
108
- icon: {
109
- icon: "IconTrash",
110
- className: "h-5 w-5",
111
- outline: false
112
- },
113
- iconPosition: "leading",
114
- key: "Delete",
115
- label: "Delete",
116
- onClick: () => {
117
- console.log("Delete action")
118
- },
119
- isEmphasized: true
120
- }
121
- ]
122
- ]
1
+ import { IItemProp } from "./DropdownComponent"
2
+
3
+ export const dropdownDataBase: IItemProp[][] = [
4
+ [
5
+ {
6
+ icon: {
7
+ icon: "IconCopy"
8
+ // pos: "leading",
9
+ // className: "h-5 w-5",
10
+ // outline: false
11
+ },
12
+ key: "Copy",
13
+ label: "Copy to Clipboard",
14
+ onClick: () => {
15
+ console.log("Copy action")
16
+ }
17
+ },
18
+
19
+ {
20
+ icon: {
21
+ icon: "IconPlus"
22
+ // pos: "leading",
23
+ // className: "h-5 w-5",
24
+ // outline: false
25
+ },
26
+ key: "Add to Batch",
27
+ label: "Add to Batch",
28
+ onClick: () => {
29
+ console.log("Add to Batch action")
30
+ }
31
+ },
32
+ {
33
+ icon: {
34
+ icon: "IconEye"
35
+ // pos: "leading",
36
+ // className: "h-5 w-5",
37
+ // outline: false
38
+ },
39
+ key: "View Batch",
40
+ label: "View Batch",
41
+ onClick: () => {
42
+ console.log("View Batch action")
43
+ }
44
+ },
45
+ {
46
+ icon: {
47
+ icon: "IconTrash"
48
+ // pos: "leading",
49
+ // className: "h-5 w-5",
50
+ // outline: false
51
+ },
52
+ label: "Delete",
53
+ onClick: () => {
54
+ console.log("Delete action")
55
+ },
56
+ isEmphasized: true,
57
+ key: "Delete"
58
+ }
59
+ ]
60
+ ]
61
+
62
+ export const dropdownDataWithIcons: IItemProp[][] = [
63
+ [
64
+ {
65
+ icon: {
66
+ icon: "IconCopy",
67
+ className: "h-5 w-5",
68
+ outline: false
69
+ },
70
+ iconPosition: "leading",
71
+ key: "Copy",
72
+ label: "Copy Item",
73
+ onClick: () => {
74
+ console.log("Copy action")
75
+ }
76
+ }
77
+ ],
78
+ [
79
+ {
80
+ icon: {
81
+ icon: "IconFolderPlus",
82
+ className: "h-5 w-5",
83
+ outline: false
84
+ },
85
+ iconPosition: "leading",
86
+ key: "Add to Batch",
87
+ label: "Add to Batch",
88
+ onClick: () => {
89
+ console.log("Add to Batch action")
90
+ }
91
+ },
92
+ {
93
+ icon: {
94
+ icon: "IconEye",
95
+ className: "h-5 w-5",
96
+ outline: false
97
+ },
98
+ iconPosition: "leading",
99
+ key: "View Batch",
100
+ label: "View Batch",
101
+ onClick: () => {
102
+ console.log("View Batch action")
103
+ }
104
+ }
105
+ ],
106
+ [
107
+ {
108
+ icon: {
109
+ icon: "IconTrash",
110
+ className: "h-5 w-5",
111
+ outline: false
112
+ },
113
+ iconPosition: "leading",
114
+ key: "Delete",
115
+ label: "Delete",
116
+ onClick: () => {
117
+ console.log("Delete action")
118
+ },
119
+ isEmphasized: true
120
+ }
121
+ ]
122
+ ]
@@ -1,4 +1,4 @@
1
- import Dropdown, { IItemProp, IDropdownProps, defaultClassNames } from "./DropdownComponent"
2
- export type { IItemProp, IDropdownProps }
3
- export { defaultClassNames }
4
- export default Dropdown
1
+ import Dropdown, { IItemProp, IDropdownProps, defaultClassNames } from "./DropdownComponent"
2
+ export type { IItemProp, IDropdownProps }
3
+ export { defaultClassNames }
4
+ export default Dropdown
@@ -1,76 +1,76 @@
1
- import type { Meta, StoryObj } from "@storybook/react"
2
- import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder"
3
- import { useRef } from "react"
4
-
5
- const meta: Meta<typeof EmptySectionPlaceholder> = {
6
- title: "Design System/Organisms/Empty Section Placeholder",
7
- component: EmptySectionPlaceholder,
8
- tags: ["autodocs"],
9
- argTypes: {}
10
- }
11
-
12
- export default meta
13
- type Story = StoryObj<typeof EmptySectionPlaceholder>
14
-
15
- const MissingAttachmentCTA = () => {
16
- const fileInputRef = useRef<HTMLInputElement>(null)
17
- return (
18
- <div className="mb-2 block text-sm font-medium text-gray-600">
19
- <input type="file" className="hidden" ref={fileInputRef} />
20
- <button
21
- className="hover:underline hover:text-gray-700 transition-all"
22
- onClick={() => {
23
- fileInputRef?.current && fileInputRef.current.click()
24
- }}
25
- >
26
- Upload
27
- </button>{" "}
28
- <span>OR drag and drop a file</span>
29
- </div>
30
- )
31
- }
32
-
33
- export const CallsToAction: Story = {
34
- args: {
35
- icon: { icon: "IconPaperclip" },
36
- mutedText: "No File is attached yet",
37
- CallToActionComponent: <MissingAttachmentCTA />,
38
- actions: [
39
- {
40
- actionType: "alternative",
41
- icon: {
42
- icon: "IconUpload",
43
- outline: true
44
- },
45
- iconPosition: "leading",
46
- label: "Upload",
47
- onClick: () => window.alert("Clicked")
48
- },
49
- {
50
- actionType: "alternative",
51
- icon: {
52
- icon: "IconGridDots",
53
- outline: true
54
- },
55
- size: "lg",
56
- iconPosition: "leading",
57
- label: "Browse",
58
- onClick: () => window.alert("Clicked")
59
- }
60
- ],
61
- isWide: true
62
- }
63
- }
64
- export const NoActions: Story = {
65
- args: {
66
- icon: {
67
- icon: "IconPencil",
68
- className: "h-5 w-5 text-gray-400 ",
69
- outline: true
70
- },
71
- mutedText: "No Recent Changes",
72
- primaryMessage: "There haven't been any recent changes\nto the content in this of this instance.",
73
- actions: [],
74
- isWide: true
75
- }
76
- }
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder"
3
+ import { useRef } from "react"
4
+
5
+ const meta: Meta<typeof EmptySectionPlaceholder> = {
6
+ title: "Design System/Organisms/Empty Section Placeholder",
7
+ component: EmptySectionPlaceholder,
8
+ tags: ["autodocs"],
9
+ argTypes: {}
10
+ }
11
+
12
+ export default meta
13
+ type Story = StoryObj<typeof EmptySectionPlaceholder>
14
+
15
+ const MissingAttachmentCTA = () => {
16
+ const fileInputRef = useRef<HTMLInputElement>(null)
17
+ return (
18
+ <div className="mb-2 block text-sm font-medium text-gray-600">
19
+ <input type="file" className="hidden" ref={fileInputRef} />
20
+ <button
21
+ className="hover:underline hover:text-gray-700 transition-all"
22
+ onClick={() => {
23
+ fileInputRef?.current && fileInputRef.current.click()
24
+ }}
25
+ >
26
+ Upload
27
+ </button>{" "}
28
+ <span>OR drag and drop a file</span>
29
+ </div>
30
+ )
31
+ }
32
+
33
+ export const CallsToAction: Story = {
34
+ args: {
35
+ icon: { icon: "IconPaperclip" },
36
+ mutedText: "No File is attached yet",
37
+ CallToActionComponent: <MissingAttachmentCTA />,
38
+ actions: [
39
+ {
40
+ actionType: "alternative",
41
+ icon: {
42
+ icon: "IconUpload",
43
+ outline: true
44
+ },
45
+ iconPosition: "leading",
46
+ label: "Upload",
47
+ onClick: () => window.alert("Clicked")
48
+ },
49
+ {
50
+ actionType: "alternative",
51
+ icon: {
52
+ icon: "IconGridDots",
53
+ outline: true
54
+ },
55
+ size: "lg",
56
+ iconPosition: "leading",
57
+ label: "Browse",
58
+ onClick: () => window.alert("Clicked")
59
+ }
60
+ ],
61
+ isWide: true
62
+ }
63
+ }
64
+ export const NoActions: Story = {
65
+ args: {
66
+ icon: {
67
+ icon: "IconPencil",
68
+ className: "h-5 w-5 text-gray-400 ",
69
+ outline: true
70
+ },
71
+ mutedText: "No Recent Changes",
72
+ primaryMessage: "There haven't been any recent changes\nto the content in this of this instance.",
73
+ actions: [],
74
+ isWide: true
75
+ }
76
+ }
@@ -1,52 +1,52 @@
1
- import React from "react"
2
- import Button, { IButtonProps } from "@/stories/atoms/buttons/Button"
3
- import { IDynamicIconProps } from "@/stories/atoms/icons"
4
- import IconWithShadow from "@/stories/atoms/icons/IconWithShadow"
5
- import { default as cn } from "classnames"
6
-
7
- export interface IEmptySectionPlaceholderProps {
8
- /** the primary icon to display at top of component */
9
- icon: IDynamicIconProps
10
- /** the muted text to display below the icon */
11
- mutedText?: string
12
- /** the primary message to display below the muted text */
13
- primaryMessage: string
14
- /** the call to action component that if provided will be used instead of primaryMessage */
15
- CallToActionComponent?: React.ReactNode
16
- /** the actions to display below the primary call to action or message */
17
- actions: IButtonProps[]
18
- /** whether to display the component in a wide or narrow format */
19
- isWide?: boolean
20
- }
21
-
22
- const EmptySectionPlaceholder: React.FC<IEmptySectionPlaceholderProps> = ({
23
- icon,
24
- mutedText,
25
- primaryMessage,
26
- CallToActionComponent,
27
- actions,
28
- isWide
29
- }) => {
30
- return (
31
- <div className="flex h-full w-full flex-col items-center justify-center border-2 border-dashed border-gray-300 p-5">
32
- <IconWithShadow {...icon} />
33
- {mutedText && <p className="my-2 block text-xs text-gray-500">{mutedText}</p>}
34
- {CallToActionComponent ? (
35
- CallToActionComponent
36
- ) : (
37
- <p className="mb-2 block text-sm font-medium text-gray-600">{primaryMessage}</p>
38
- )}
39
- {actions.length > 0 ? (
40
- <div className={cn("mt-2 flex gap-2", isWide ? "" : "flex-col items-center")}>
41
- {actions.map((action, index) => (
42
- <Button {...{ ...action }} key={action.label.replaceAll(" ", "-")} />
43
- ))}
44
- </div>
45
- ) : (
46
- <></>
47
- )}
48
- </div>
49
- )
50
- }
51
-
52
- export default EmptySectionPlaceholder
1
+ import React from "react"
2
+ import Button, { IButtonProps } from "@/stories/atoms/buttons/Button"
3
+ import { IDynamicIconProps } from "@/stories/atoms/icons"
4
+ import IconWithShadow from "@/stories/atoms/icons/IconWithShadow"
5
+ import { default as cn } from "classnames"
6
+
7
+ export interface IEmptySectionPlaceholderProps {
8
+ /** the primary icon to display at top of component */
9
+ icon: IDynamicIconProps
10
+ /** the muted text to display below the icon */
11
+ mutedText?: string
12
+ /** the primary message to display below the muted text */
13
+ primaryMessage: string
14
+ /** the call to action component that if provided will be used instead of primaryMessage */
15
+ CallToActionComponent?: React.ReactNode
16
+ /** the actions to display below the primary call to action or message */
17
+ actions: IButtonProps[]
18
+ /** whether to display the component in a wide or narrow format */
19
+ isWide?: boolean
20
+ }
21
+
22
+ const EmptySectionPlaceholder: React.FC<IEmptySectionPlaceholderProps> = ({
23
+ icon,
24
+ mutedText,
25
+ primaryMessage,
26
+ CallToActionComponent,
27
+ actions,
28
+ isWide
29
+ }) => {
30
+ return (
31
+ <div className="flex h-full w-full flex-col items-center justify-center border-2 border-dashed border-gray-300 p-5">
32
+ <IconWithShadow {...icon} />
33
+ {mutedText && <p className="my-2 block text-xs text-gray-500">{mutedText}</p>}
34
+ {CallToActionComponent ? (
35
+ CallToActionComponent
36
+ ) : (
37
+ <p className="mb-2 block text-sm font-medium text-gray-600">{primaryMessage}</p>
38
+ )}
39
+ {actions.length > 0 ? (
40
+ <div className={cn("mt-2 flex gap-2", isWide ? "" : "flex-col items-center")}>
41
+ {actions.map((action, index) => (
42
+ <Button {...{ ...action }} key={action.label.replaceAll(" ", "-")} />
43
+ ))}
44
+ </div>
45
+ ) : (
46
+ <></>
47
+ )}
48
+ </div>
49
+ )
50
+ }
51
+
52
+ export default EmptySectionPlaceholder
@@ -1,4 +1,4 @@
1
- import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder"
2
-
3
- export type { IEmptySectionPlaceholderProps }
4
- export default EmptySectionPlaceholder
1
+ import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder"
2
+
3
+ export type { IEmptySectionPlaceholderProps }
4
+ export default EmptySectionPlaceholder
@@ -1,29 +1,29 @@
1
- import type { Meta, StoryObj } from "@storybook/react"
2
- import FormInputWithAddons, { IFormInputWithAddonsProps } from "./FormInputWithAddons"
3
-
4
- const meta: Meta<typeof FormInputWithAddons> = {
5
- title: "Design System/organisms/Form Input With Addons",
6
- component: FormInputWithAddons,
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=85-1269&mode=design"
13
- }
14
- }
15
- }
16
-
17
- export default meta
18
- type Story = StoryObj<typeof FormInputWithAddons>
19
-
20
- export const DefaultFormInputWithAddons: Story = {
21
- args: {
22
- id: "appSearch",
23
- name: "appSearch",
24
- leadLabel: "Search",
25
- addonOffset: 60,
26
- labelClass: "text-gray-900",
27
- trailIcon: { icon: "IconSearch" }
28
- }
29
- }
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import FormInputWithAddons, { IFormInputWithAddonsProps } from "./FormInputWithAddons"
3
+
4
+ const meta: Meta<typeof FormInputWithAddons> = {
5
+ title: "Design System/organisms/Form Input With Addons",
6
+ component: FormInputWithAddons,
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=85-1269&mode=design"
13
+ }
14
+ }
15
+ }
16
+
17
+ export default meta
18
+ type Story = StoryObj<typeof FormInputWithAddons>
19
+
20
+ export const DefaultFormInputWithAddons: Story = {
21
+ args: {
22
+ id: "appSearch",
23
+ name: "appSearch",
24
+ leadLabel: "Search",
25
+ addonOffset: 60,
26
+ labelClass: "text-gray-900",
27
+ trailIcon: { icon: "IconSearch" }
28
+ }
29
+ }