@agility/plenum-ui 2.0.0-rc9 → 2.0.0

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 (91) hide show
  1. package/README.md +104 -31
  2. package/build.js +30 -25
  3. package/dist/index.d.ts +101 -61
  4. package/dist/index.js +1 -6295
  5. package/dist/index.js.map +4 -4
  6. package/dist/{lib/tailwind.css → tailwind.css} +3729 -8120
  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/inputs/InputField/InputField.d.ts +7 -7
  17. package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +1 -1
  18. package/dist/types/stories/molecules/inputs/select/Select.d.ts +4 -2
  19. package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +5 -1
  20. package/dist/types/stories/molecules/inputs/toggleSwitch/ToggleSwitch.d.ts +10 -7
  21. package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +5 -5
  22. package/dist/types/stories/organisms/AnimatedLabelInput/index.d.ts +1 -1
  23. package/dist/types/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.d.ts +12 -0
  24. package/dist/types/stories/organisms/AnimatedLabelTextArea/index.d.ts +3 -0
  25. package/dist/types/stories/organisms/ButtonDropdown/ButtonDropdown.d.ts +1 -0
  26. package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +24 -13
  27. package/dist/types/stories/organisms/DropdownComponent/index.d.ts +2 -2
  28. package/dist/types/stories/organisms/EmptySectionPlaceholder/index.d.ts +1 -1
  29. package/dist/types/stories/organisms/index.d.ts +4 -3
  30. package/local.sh +100 -0
  31. package/package.json +36 -19
  32. package/rollup.config.mjs +42 -0
  33. package/stories/atoms/badges/Badge.tsx +1 -1
  34. package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +10 -0
  35. package/stories/atoms/buttons/Button/Button.tsx +111 -25
  36. package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +14 -2
  37. package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +14 -2
  38. package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +13 -1
  39. package/stories/atoms/buttons/Button/defaultArgs.ts +1 -1
  40. package/stories/atoms/buttons/Capsule/Capsule.tsx +2 -1
  41. package/stories/atoms/icons/DynamicIcon.stories.ts +1 -1
  42. package/stories/atoms/icons/DynamicIcon.tsx +7 -7
  43. package/stories/atoms/icons/IconWithShadow.stories.ts +3 -3
  44. package/stories/atoms/icons/TablerIcon.tsx +1 -1
  45. package/stories/atoms/loaders/Loader.tsx +12 -6
  46. package/stories/atoms/loaders/NProgress/RadialProgress.tsx +0 -2
  47. package/stories/index.ts +8 -4
  48. package/stories/molecules/inputs/InputCounter/InputCounter.tsx +2 -2
  49. package/stories/molecules/inputs/InputField/InputField.tsx +31 -29
  50. package/stories/molecules/inputs/InputLabel/InputLabel.tsx +1 -1
  51. package/stories/molecules/inputs/TextInput/TextInput.tsx +12 -6
  52. package/stories/molecules/inputs/checkbox/Checkbox.stories.ts +1 -1
  53. package/stories/molecules/inputs/checkbox/Checkbox.tsx +1 -2
  54. package/stories/molecules/inputs/combobox/ComboBox.tsx +126 -135
  55. package/stories/molecules/inputs/radio/Radio.stories.ts +2 -2
  56. package/stories/molecules/inputs/select/Select.tsx +10 -2
  57. package/stories/molecules/inputs/textArea/TextArea.stories.ts +1 -1
  58. package/stories/molecules/inputs/textArea/TextArea.tsx +57 -27
  59. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.stories.tsx +15 -16
  60. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +63 -57
  61. package/stories/molecules/tabs/index.tsx +2 -3
  62. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +10 -1
  63. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +53 -37
  64. package/stories/organisms/AnimatedLabelInput/index.tsx +1 -1
  65. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -0
  66. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -0
  67. package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -0
  68. package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +59 -59
  69. package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +42 -30
  70. package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +26 -2
  71. package/stories/organisms/DropdownComponent/DropdownComponent.tsx +232 -180
  72. package/stories/organisms/DropdownComponent/dropdownItems.ts +30 -9
  73. package/stories/organisms/DropdownComponent/index.ts +2 -2
  74. package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +3 -3
  75. package/stories/organisms/EmptySectionPlaceholder/index.tsx +2 -1
  76. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +1 -1
  77. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +7 -2
  78. package/stories/organisms/index.ts +12 -3
  79. package/tailwind.config.js +81 -37
  80. package/tsconfig.lib.json +13 -6
  81. package/watch.js +49 -0
  82. package/.yarnrc.yml +0 -1
  83. package/dist/types/stories/layouts/index.d.ts +0 -0
  84. package/stories/layouts/CardLayout/CardLayout.stories.tsx +0 -18
  85. package/stories/layouts/CardLayout/CardLayout.tsx +0 -22
  86. package/stories/layouts/CardLayout/index.tsx +0 -3
  87. package/stories/layouts/ModalLayout/ModalLayout.stories.tsx +0 -18
  88. package/stories/layouts/ModalLayout/ModalLayout.tsx +0 -22
  89. package/stories/layouts/ModalLayout/index.tsx +0 -3
  90. package/stories/layouts/index.ts +0 -0
  91. package/stories/organisms/DropdownComponent/Dropdown.test.tsx +0 -0
@@ -1,5 +1,4 @@
1
- import React, { Fragment, HTMLAttributes, useState } from "react"
2
- import { Transition } from "@headlessui/react"
1
+ import React, { HTMLAttributes, useEffect, useMemo, useRef, useState } from "react"
3
2
  import { default as cn } from "classnames"
4
3
  import {
5
4
  useFloating,
@@ -13,50 +12,60 @@ import {
13
12
  autoPlacement,
14
13
  shift,
15
14
  FloatingPortal,
15
+ FloatingList,
16
16
  useTransitionStyles,
17
- Placement
17
+ Placement,
18
+ useListNavigation
18
19
  } from "@floating-ui/react"
19
20
 
20
21
  import { ClassNameWithAutocomplete } from "utils/types"
21
22
  import { DynamicIcon, IDynamicIconProps, UnifiedIconName } from "@/stories/atoms/icons"
23
+ import { list } from "postcss"
22
24
 
23
- export interface IItemProp extends HTMLAttributes<HTMLButtonElement> {
24
- icon?: IDynamicIconProps | UnifiedIconName
25
+ export interface IItemProp {
26
+ //Don't think this needs to extend HtmlButton... extends HTMLAttributes<HTMLButtonElement> {
27
+ icon?: IDynamicIconProps
25
28
  iconPosition?: "trailing" | "leading"
26
- label: string
29
+ label: string | JSX.Element
27
30
  onClick?(): void
28
31
  isEmphasized?: boolean
29
32
  key: React.Key
33
+ iconObj?: JSX.Element
30
34
  }
31
- export interface IDropdownClassnames {
32
- groupClassname?: ClassNameWithAutocomplete
33
- itemsClassname?: ClassNameWithAutocomplete
34
- itemClassname?: ClassNameWithAutocomplete
35
- activeItemClassname?: ClassNameWithAutocomplete
36
- buttonClassname?: ClassNameWithAutocomplete
37
- }
35
+
38
36
  export interface IDropdownProps extends HTMLAttributes<HTMLDivElement> {
39
37
  items: IItemProp[][]
40
38
  label: string
41
39
  CustomDropdownTrigger?: React.ReactNode
42
40
  id: string
43
- classNames?: IDropdownClassnames
41
+ groupClassname?: ClassNameWithAutocomplete
42
+ itemsClassname?: ClassNameWithAutocomplete
43
+ itemClassname?: ClassNameWithAutocomplete
44
+ activeItemClassname?: ClassNameWithAutocomplete
45
+ buttonClassname?: ClassNameWithAutocomplete
46
+ iconClassname?: ClassNameWithAutocomplete
47
+ iconSpacingClassname?: ClassNameWithAutocomplete
44
48
  placement?: Placement
45
49
  offsetOptions?: Partial<{
46
50
  mainAxis: number
47
51
  crossAxis: number
48
52
  alignmentAxis: number | null
49
53
  }>
54
+ disabled?: boolean
55
+ onFocus?: () => void
56
+ onBlur?: () => void
50
57
  }
51
- export const defaultClassNames: IDropdownClassnames = {
58
+ export const defaultClassNames = {
52
59
  groupClassname: "flex inline-block text-left",
53
60
  itemsClassname:
54
- "mt-2 origin-bottom-right rounded bg-white shadow-lg z-20 divide-y divide-gray-100 border border-gray-300 ",
61
+ "mt-2 origin-bottom-right rounded bg-white shadow-lg z-[99999] divide-y divide-gray-100 border border-gray-300 ",
55
62
  itemClassname:
56
63
  "group flex font-muli cursor-pointer items-center px-4 py-2 text-sm transition-all hover:bg-gray-100 hover:text-gray-900 justify-between gap-4 ",
57
64
  activeItemClassname: "block px-4 py-2 text-sm text-gray-700 bg-gray-100 hover:bg-gray-200 hover:text-gray-900",
58
65
  buttonClassname:
59
- "py-[2px] z-20 flex items-center rounded outline-purple-500 transition-all text-gray-400 hover:text-gray-600 "
66
+ "py-[2px] flex items-center rounded outline-purple-500 transition-all text-gray-400 hover:text-gray-600 ",
67
+ iconClassname: "ml-1 h-5 w-6",
68
+ iconSpacingClassname: "flex items-center gap-x-4"
60
69
  }
61
70
 
62
71
  /** Comment */
@@ -64,22 +73,44 @@ const Dropdown: React.FC<IDropdownProps> = ({
64
73
  items,
65
74
  id,
66
75
  label,
67
- classNames = defaultClassNames,
76
+ groupClassname,
77
+ itemsClassname,
78
+ itemClassname,
79
+ activeItemClassname,
80
+ buttonClassname,
81
+ iconClassname,
82
+ iconSpacingClassname,
68
83
  CustomDropdownTrigger,
69
84
  placement = "bottom-start",
70
85
  offsetOptions,
86
+ disabled,
87
+ onFocus,
88
+ onBlur,
71
89
  ...props
72
90
  }: IDropdownProps): JSX.Element | null => {
73
91
  const [isOpen, setIsOpen] = useState(false)
74
92
  const [activeItem, setActiveItem] = useState<React.Key | null>(null)
93
+ const [activeIndex, setActiveIndex] = useState<number | null>(null)
94
+
95
+ const listRef = useRef<(HTMLButtonElement | null)[]>([])
75
96
 
76
97
  // Floating UI logic
77
98
  const { refs, floatingStyles, context } = useFloating({
78
99
  open: isOpen,
79
- onOpenChange: setIsOpen,
100
+ onOpenChange: (bool: boolean) => {
101
+ listRef.current = []
102
+ setActiveIndex(null)
103
+ setIsOpen(bool)
104
+ },
80
105
  placement,
81
106
  middleware: [
82
- offset(offsetOptions ?? 10),
107
+ offset(
108
+ offsetOptions ?? {
109
+ crossAxis: 0,
110
+ mainAxis: -4, //up/down
111
+ alignmentAxis: 0 //left/right
112
+ }
113
+ ),
83
114
  autoPlacement({
84
115
  allowedPlacements: [placement, "bottom-start", "bottom-end", "bottom"]
85
116
  }),
@@ -90,26 +121,169 @@ const Dropdown: React.FC<IDropdownProps> = ({
90
121
  const click = useClick(context)
91
122
  const dismiss = useDismiss(context)
92
123
  const role = useRole(context)
93
- const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role])
124
+ const listNavigation = useListNavigation(context, {
125
+ listRef,
126
+ activeIndex,
127
+ onNavigate: (index: number | null) => {
128
+ if (index !== null && listRef.current[index]) {
129
+ setActiveIndex(index)
130
+ listRef.current[index]?.focus()
131
+ }
132
+ }
133
+ })
134
+
135
+ const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions([
136
+ click,
137
+ dismiss,
138
+ role,
139
+ listNavigation
140
+ ])
141
+
142
+ useEffect(() => {
143
+ if (isOpen) {
144
+ onFocus && onFocus()
145
+ } else {
146
+ onBlur && onBlur()
147
+ }
148
+ }, [isOpen, onBlur, onFocus])
149
+
150
+ const ItemComponents = useMemo(
151
+ () =>
152
+ items.map((itemStack, stackIndex) => {
153
+ return itemStack.map((item, itemIndex) => {
154
+ const { key, label, icon, iconObj, iconPosition, isEmphasized, onClick, ...rest } = item
155
+ const active = activeItem && activeItem === key
156
+ const itemClass = cn(
157
+ defaultClassNames.itemClassname,
158
+ itemClassname,
159
+ "group flex cursor-pointer items-center px-4 py-2 text-sm transition-all",
160
+ {
161
+ "text-red-500": isEmphasized
162
+ },
163
+ {
164
+ "text-gray-900": !isEmphasized
165
+ },
166
+ {
167
+ "bg-gray-100 text-gray-900": active
168
+ },
169
+ active ? cn(defaultClassNames.activeItemClassname, activeItemClassname) : "",
170
+ {
171
+ "bg-gray-100 text-red-500 hover:text-red-500": active && isEmphasized
172
+ }
173
+ )
174
+ return (
175
+ <button
176
+ {...{
177
+ key: key,
178
+ id: key.toString(),
179
+ className: cn(itemClass, "w-full"),
180
+ ...rest,
181
+ ...getItemProps(),
182
+ onClick: () => {
183
+ onClick && onClick()
184
+ setTimeout(() => {
185
+ //hide the dropdown after click
186
+ setIsOpen(false)
187
+ }, 150)
188
+ }
189
+ }}
190
+ ref={(node) => {
191
+ //If the list ref already contains a node with the same id do nothing, otherwise add it
192
+ if (listRef.current.some((item) => item?.id === key)) {
193
+ return
194
+ }
195
+ listRef.current.push(node)
196
+ }}
197
+ key={key}
198
+ >
199
+ <div className={cn(defaultClassNames.iconSpacingClassname, iconSpacingClassname)}>
200
+ {iconObj && (iconPosition === "leading" || iconPosition === undefined) && (
201
+ <>{iconObj}</>
202
+ )}
203
+ {icon &&
204
+ (iconPosition === "leading" || iconPosition === undefined) &&
205
+ (typeof icon === "string" ? (
206
+ <DynamicIcon
207
+ {...{
208
+ icon: icon,
209
+ className: cn(
210
+ {
211
+ "text-red-500": isEmphasized
212
+ },
213
+ "opacity-60 group"
214
+ )
215
+ }}
216
+ />
217
+ ) : (
218
+ <DynamicIcon
219
+ {...{
220
+ ...icon,
221
+ className: cn(
222
+ icon.className,
223
+ {
224
+ "text-red-500": isEmphasized
225
+ },
226
+ "opacity-60 group"
227
+ )
228
+ }}
229
+ />
230
+ ))}
231
+ <div className="break-all line-clamp-1">{label}</div>
232
+ {iconObj && iconPosition === "trailing" && <>{iconObj}</>}
233
+ {icon &&
234
+ iconPosition === "trailing" &&
235
+ (typeof icon === "string" ? (
236
+ <DynamicIcon
237
+ {...{
238
+ icon: icon,
239
+ className: cn(
240
+ {
241
+ "text-red-500": isEmphasized
242
+ },
243
+ "opacity-60 group"
244
+ )
245
+ }}
246
+ />
247
+ ) : (
248
+ <DynamicIcon
249
+ {...{
250
+ ...icon,
251
+ className: cn(
252
+ icon.className,
253
+ {
254
+ "text-red-500": isEmphasized
255
+ },
256
+ "opacity-60 group"
257
+ )
258
+ }}
259
+ />
260
+ ))}
261
+ </div>
262
+ </button>
263
+ )
264
+ })
265
+ }),
266
+ [activeItem, activeItemClassname, getItemProps, iconSpacingClassname, itemClassname, items]
267
+ )
268
+
94
269
  const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {
95
270
  duration: {
96
271
  open: 200,
97
272
  close: 200
98
273
  },
99
274
  initial: {
100
- opacity: 0
275
+ opacity: 0,
276
+ scale: 95
101
277
  },
102
278
  open: {
103
- opacity: 1
279
+ opacity: 1,
280
+ scale: 100
104
281
  }
105
282
  })
106
-
107
- const { groupClassname, buttonClassname, itemsClassname, itemClassname, activeItemClassname } = classNames
108
-
109
283
  return (
110
284
  <div
111
285
  {...{
112
- className: groupClassname,
286
+ className: cn(defaultClassNames.groupClassname, groupClassname),
113
287
  role: "combobox",
114
288
  "aria-owns": `${id}-list`,
115
289
  "aria-expanded": isOpen,
@@ -120,10 +294,12 @@ const Dropdown: React.FC<IDropdownProps> = ({
120
294
  <button
121
295
  {...{
122
296
  ref: refs.setReference,
123
- className: buttonClassname,
297
+ className: cn(defaultClassNames.buttonClassname, buttonClassname),
124
298
  onClick: () => {
125
299
  setIsOpen(!isOpen)
126
300
  },
301
+ type: "button",
302
+ disabled: disabled,
127
303
  ...getReferenceProps()
128
304
  }}
129
305
  >
@@ -132,166 +308,42 @@ const Dropdown: React.FC<IDropdownProps> = ({
132
308
  ) : (
133
309
  <>
134
310
  <span className="pl-1">{label}</span>
135
- <DynamicIcon icon="ChevronDownIcon" className="ml-1 h-5 w-6 " />
311
+ <DynamicIcon
312
+ icon="IconChevronDown"
313
+ className={cn(defaultClassNames.iconClassname, iconClassname)}
314
+ />
136
315
  </>
137
316
  )}
138
317
  </button>
139
318
 
140
319
  {isMounted && items.length > 0 && isOpen && (
141
- <FloatingPortal>
142
- <FloatingFocusManager context={context} modal={true}>
143
- <Transition
144
- as={Fragment}
145
- show={isOpen}
146
- enter="transition ease-out duration-100"
147
- enterFrom="transform opacity-0 scale-95"
148
- enterTo="transform opacity-100 scale-100"
149
- leave="transition ease-in duration-75"
150
- leaveFrom="transform opacity-100 scale-100"
151
- leaveTo="transform opacity-0 scale-95"
152
- >
153
- <ul
154
- {...{
155
- ...getFloatingProps(),
156
- className: itemsClassname,
157
- ref: refs.setFloating,
158
- // style: floatingStyles,
159
- "aria-labelledby": label,
160
- id: `${id}-list`,
161
- role: "listbox",
162
- style: {
163
- position: context.strategy,
164
- top: Math.round(context.y ?? 0),
165
- left: Math.round(context.x ?? 0),
166
- width: "max-content",
167
- maxWidth: "min(calc(100vw - 10px), 25rem)",
168
- ...floatingStyles
169
- }
170
- }}
171
- className={itemsClassname}
320
+ <FloatingList
321
+ {...{
322
+ elementsRef: listRef
323
+ }}
324
+ >
325
+ <FloatingPortal>
326
+ <FloatingFocusManager context={context} modal={true}>
327
+ <div
328
+ {...getFloatingProps()}
329
+ className={cn(defaultClassNames.itemsClassname, itemsClassname)}
172
330
  ref={refs.setFloating}
173
331
  aria-labelledby={label}
174
- {...getFloatingProps()}
332
+ style={{
333
+ position: context.strategy,
334
+ top: Math.round(context.y ?? 0),
335
+ left: Math.round(context.x ?? 0),
336
+ width: "max-content",
337
+ maxWidth: "min(calc(100vw - 10px), 25rem)",
338
+ ...floatingStyles,
339
+ ...transitionStyles
340
+ }}
175
341
  >
176
- {items.map((itemStack, idx) => {
177
- return (
178
- <React.Fragment key={`${idx}-list-${id}`}>
179
- {itemStack.map(
180
- ({
181
- onClick,
182
- label,
183
- key,
184
- isEmphasized,
185
- icon,
186
- iconPosition,
187
- ...rest
188
- }) => {
189
- const active = activeItem && activeItem === key
190
- const itemClass = cn(
191
- itemClassname,
192
- "group flex cursor-pointer items-center px-4 py-2 text-sm transition-all",
193
- {
194
- "text-red-500": isEmphasized
195
- },
196
- {
197
- "text-gray-900": !isEmphasized
198
- },
199
- {
200
- "bg-gray-100 text-gray-900": active
201
- },
202
- active ? activeItemClassname : "",
203
- {
204
- "bg-gray-100 text-red-500 hover:text-red-500":
205
- active && isEmphasized
206
- },
207
- itemClassname
208
- )
209
-
210
- return (
211
- <li key={key}>
212
- <button
213
- {...{
214
- onClick: () => {
215
- setActiveItem(key)
216
- onClick && onClick()
217
- },
218
- key,
219
- className: cn(itemClass, "w-full"),
220
- ...rest
221
- }}
222
- >
223
- <div className="flex items-center gap-x-4">
224
- {icon &&
225
- (iconPosition === "leading" ||
226
- iconPosition === undefined) &&
227
- (typeof icon === "string" ? (
228
- <DynamicIcon
229
- {...{
230
- icon: icon,
231
- className: cn(
232
- {
233
- "text-red-500": isEmphasized
234
- },
235
- "opacity-60 group"
236
- )
237
- }}
238
- />
239
- ) : (
240
- <DynamicIcon
241
- {...{
242
- ...icon,
243
- className: cn(
244
- icon.className,
245
- {
246
- "text-red-500": isEmphasized
247
- },
248
- "opacity-60 group"
249
- )
250
- }}
251
- />
252
- ))}
253
- <div className="whitespace-nowrap">{label}</div>
254
- {icon &&
255
- iconPosition === "trailing" &&
256
- (typeof icon === "string" ? (
257
- <DynamicIcon
258
- {...{
259
- icon: icon,
260
- className: cn(
261
- {
262
- "text-red-500": isEmphasized
263
- },
264
- "opacity-60 group"
265
- )
266
- }}
267
- />
268
- ) : (
269
- <DynamicIcon
270
- {...{
271
- ...icon,
272
- className: cn(
273
- icon.className,
274
- {
275
- "text-red-500": isEmphasized
276
- },
277
- "opacity-60 group"
278
- )
279
- }}
280
- />
281
- ))}
282
- </div>
283
- </button>
284
- </li>
285
- )
286
- }
287
- )}
288
- </React.Fragment>
289
- )
290
- })}
291
- </ul>
292
- </Transition>
293
- </FloatingFocusManager>
294
- </FloatingPortal>
342
+ {ItemComponents}
343
+ </div>
344
+ </FloatingFocusManager>
345
+ </FloatingPortal>
346
+ </FloatingList>
295
347
  )}
296
348
  </div>
297
349
  )
@@ -3,15 +3,26 @@ import { IItemProp } from "./DropdownComponent"
3
3
  export const dropdownDataBase: IItemProp[][] = [
4
4
  [
5
5
  {
6
+ icon: {
7
+ icon: "IconCopy"
8
+ // pos: "leading",
9
+ // className: "h-5 w-5",
10
+ // outline: false
11
+ },
6
12
  key: "Copy",
7
- label: "Copy",
13
+ label: "Copy to Clipboard",
8
14
  onClick: () => {
9
15
  console.log("Copy action")
10
16
  }
11
- }
12
- ],
13
- [
17
+ },
18
+
14
19
  {
20
+ icon: {
21
+ icon: "IconPlus"
22
+ // pos: "leading",
23
+ // className: "h-5 w-5",
24
+ // outline: false
25
+ },
15
26
  key: "Add to Batch",
16
27
  label: "Add to Batch",
17
28
  onClick: () => {
@@ -19,15 +30,25 @@ export const dropdownDataBase: IItemProp[][] = [
19
30
  }
20
31
  },
21
32
  {
33
+ icon: {
34
+ icon: "IconEye"
35
+ // pos: "leading",
36
+ // className: "h-5 w-5",
37
+ // outline: false
38
+ },
22
39
  key: "View Batch",
23
40
  label: "View Batch",
24
41
  onClick: () => {
25
42
  console.log("View Batch action")
26
43
  }
27
- }
28
- ],
29
- [
44
+ },
30
45
  {
46
+ icon: {
47
+ icon: "IconTrash"
48
+ // pos: "leading",
49
+ // className: "h-5 w-5",
50
+ // outline: false
51
+ },
31
52
  label: "Delete",
32
53
  onClick: () => {
33
54
  console.log("Delete action")
@@ -42,13 +63,13 @@ export const dropdownDataWithIcons: IItemProp[][] = [
42
63
  [
43
64
  {
44
65
  icon: {
45
- icon: "IconClipboardCopy",
66
+ icon: "IconCopy",
46
67
  className: "h-5 w-5",
47
68
  outline: false
48
69
  },
49
70
  iconPosition: "leading",
50
71
  key: "Copy",
51
- label: "Copy",
72
+ label: "Copy Item",
52
73
  onClick: () => {
53
74
  console.log("Copy action")
54
75
  }
@@ -1,4 +1,4 @@
1
- import Dropdown, { IItemProp, IDropdownClassnames, IDropdownProps, defaultClassNames } from "./DropdownComponent"
2
- export type { IItemProp, IDropdownClassnames, IDropdownProps }
1
+ import Dropdown, { IItemProp, IDropdownProps, defaultClassNames } from "./DropdownComponent"
2
+ export type { IItemProp, IDropdownProps }
3
3
  export { defaultClassNames }
4
4
  export default Dropdown
@@ -39,7 +39,7 @@ export const CallsToAction: Story = {
39
39
  {
40
40
  actionType: "alternative",
41
41
  icon: {
42
- icon: "UploadIcon",
42
+ icon: "IconUpload",
43
43
  outline: true
44
44
  },
45
45
  iconPosition: "leading",
@@ -49,7 +49,7 @@ export const CallsToAction: Story = {
49
49
  {
50
50
  actionType: "alternative",
51
51
  icon: {
52
- icon: "ViewGridIcon",
52
+ icon: "IconGridDots",
53
53
  outline: true
54
54
  },
55
55
  size: "lg",
@@ -64,7 +64,7 @@ export const CallsToAction: Story = {
64
64
  export const NoActions: Story = {
65
65
  args: {
66
66
  icon: {
67
- icon: "PencilAltIcon",
67
+ icon: "IconPencil",
68
68
  className: "h-5 w-5 text-gray-400 ",
69
69
  outline: true
70
70
  },
@@ -1,3 +1,4 @@
1
1
  import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder"
2
- export default EmptySectionPlaceholder
2
+
3
3
  export type { IEmptySectionPlaceholderProps }
4
+ export default EmptySectionPlaceholder
@@ -24,6 +24,6 @@ export const DefaultFormInputWithAddons: Story = {
24
24
  leadLabel: "Search",
25
25
  addonOffset: 60,
26
26
  labelClass: "text-gray-900",
27
- trailIcon: { icon: "SearchIcon" }
27
+ trailIcon: { icon: "IconSearch" }
28
28
  }
29
29
  }
@@ -79,7 +79,12 @@ const FormInputWithAddons: React.FC<IFormInputWithAddonsProps> = ({
79
79
  <DynamicIcon
80
80
  {...{
81
81
  ...leadIcon,
82
- className: cn("h-5 w-5 text-gray-400", leadIconClassNames, customIconClass),
82
+ className: cn(
83
+ "h-5 w-5 text-gray-400",
84
+ leadIconClassNames,
85
+ customIconClass,
86
+ leadIcon.className
87
+ ),
83
88
  outline: iconOutlined
84
89
  }}
85
90
  />
@@ -123,7 +128,7 @@ const FormInputWithAddons: React.FC<IFormInputWithAddonsProps> = ({
123
128
  <DynamicIcon
124
129
  {...{
125
130
  ...trailIcon,
126
- className: cn("h-5 w-5 text-gray-400", customIconClass),
131
+ className: cn("h-5 w-5 text-gray-400", customIconClass, trailIcon.className),
127
132
  outline: iconOutlined
128
133
  }}
129
134
  />
@@ -1,18 +1,27 @@
1
1
  import AnimatedLabelInput, { IAnimatedLabelInputProps } from "./AnimatedLabelInput"
2
+ import AnimatedLabelTextArea, { IAnimatedLabelTextAreaProps } from "./AnimatedLabelTextArea"
2
3
  import ButtonDropdown, { IButtonDropdownProps } from "./ButtonDropdown"
3
- import Dropdown, { IDropdownClassnames, IDropdownProps, IItemProp } from "./DropdownComponent"
4
+ import Dropdown, { IDropdownProps, IItemProp } from "./DropdownComponent"
4
5
  import EmptySectionPlaceholder, { IEmptySectionPlaceholderProps } from "./EmptySectionPlaceholder"
5
6
  import FormInputWithAddons, { IFormInputWithAddonsProps } from "./FormInputWithAddons"
6
7
  import TextInputSelect, { ITextInputSelectProps } from "./TextInputSelect"
7
8
 
8
9
  export type {
9
10
  IAnimatedLabelInputProps,
11
+ IAnimatedLabelTextAreaProps,
10
12
  IButtonDropdownProps,
11
- IDropdownClassnames,
12
13
  IDropdownProps,
13
14
  IEmptySectionPlaceholderProps,
14
15
  IItemProp,
15
16
  IFormInputWithAddonsProps,
16
17
  ITextInputSelectProps
17
18
  }
18
- export { AnimatedLabelInput, ButtonDropdown, Dropdown, EmptySectionPlaceholder, FormInputWithAddons, TextInputSelect }
19
+ export {
20
+ AnimatedLabelInput,
21
+ AnimatedLabelTextArea,
22
+ ButtonDropdown,
23
+ Dropdown,
24
+ EmptySectionPlaceholder,
25
+ FormInputWithAddons,
26
+ TextInputSelect
27
+ }