torch-glare 2.4.0 → 2.4.1

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 (264) hide show
  1. package/README.md +8 -0
  2. package/apps/lib/components/ActionButton.tsx +7 -12
  3. package/apps/lib/components/ActionsGroup.tsx +4 -15
  4. package/apps/lib/components/AlertDialog.tsx +173 -191
  5. package/apps/lib/components/Avatar.tsx +13 -16
  6. package/apps/lib/components/Badge.tsx +1 -3
  7. package/apps/lib/components/BadgeField.tsx +76 -71
  8. package/apps/lib/components/Breadcrumb.tsx +49 -85
  9. package/apps/lib/components/Button.tsx +20 -19
  10. package/apps/lib/components/ButtonGroup.tsx +31 -41
  11. package/apps/lib/components/Calendar.tsx +51 -29
  12. package/apps/lib/components/Card.tsx +2 -13
  13. package/apps/lib/components/ChartBlockTool.ts +17 -52
  14. package/apps/lib/components/Checkbox.tsx +9 -16
  15. package/apps/lib/components/ContextMenu.tsx +97 -96
  16. package/apps/lib/components/CountBadge.tsx +4 -6
  17. package/apps/lib/components/DataTable.tsx +196 -216
  18. package/apps/lib/components/DataViews/DataViewRadio.tsx +1 -6
  19. package/apps/lib/components/DataViews/DataViewsConfigPanel.tsx +13 -47
  20. package/apps/lib/components/DataViews/DataViewsHeader.tsx +1 -3
  21. package/apps/lib/components/DataViews/DataViewsLayout.tsx +5 -12
  22. package/apps/lib/components/DataViews/FilterPanel.tsx +155 -149
  23. package/apps/lib/components/DataViews/HeaderSearch.tsx +1 -5
  24. package/apps/lib/components/DataViews/InboxView.tsx +22 -68
  25. package/apps/lib/components/DataViews/InboxViewCard.tsx +68 -77
  26. package/apps/lib/components/DataViews/KanbanView.tsx +8 -25
  27. package/apps/lib/components/DataViews/PanelControls.tsx +3 -13
  28. package/apps/lib/components/DataViews/SettingsPanel.tsx +83 -89
  29. package/apps/lib/components/DataViews/TableView.tsx +8 -28
  30. package/apps/lib/components/DataViews/TreeView.tsx +12 -40
  31. package/apps/lib/components/DataViews/badgeAdapter.ts +32 -28
  32. package/apps/lib/components/DataViews/fieldRenderers.tsx +106 -141
  33. package/apps/lib/components/DataViews/filters/DatePickerRangeFilter.tsx +30 -23
  34. package/apps/lib/components/DataViews/filters/DateRangePopover.tsx +39 -32
  35. package/apps/lib/components/DataViews/filters/PresetChips.tsx +15 -15
  36. package/apps/lib/components/DataViews/filters/RangeSliderWithInputs.tsx +69 -58
  37. package/apps/lib/components/DataViews/index.ts +26 -26
  38. package/apps/lib/components/DataViews/tree/TreeDrawer.tsx +12 -16
  39. package/apps/lib/components/DataViews/tree/TreeSidebar.tsx +28 -31
  40. package/apps/lib/components/DataViews/types.ts +104 -115
  41. package/apps/lib/components/DatePicker.tsx +198 -196
  42. package/apps/lib/components/Dialog.tsx +92 -105
  43. package/apps/lib/components/Divider.tsx +21 -24
  44. package/apps/lib/components/Drawer.tsx +79 -139
  45. package/apps/lib/components/DropdownMenu.tsx +131 -171
  46. package/apps/lib/components/FieldHint.tsx +4 -11
  47. package/apps/lib/components/Form.tsx +146 -155
  48. package/apps/lib/components/FormStepper.tsx +9 -39
  49. package/apps/lib/components/HeaderBar.tsx +1 -9
  50. package/apps/lib/components/ImageAttachment.tsx +111 -73
  51. package/apps/lib/components/InnerLabelField.tsx +20 -16
  52. package/apps/lib/components/Input.tsx +171 -172
  53. package/apps/lib/components/InputField.tsx +44 -45
  54. package/apps/lib/components/InputOTP.tsx +68 -69
  55. package/apps/lib/components/Label.tsx +31 -35
  56. package/apps/lib/components/LabelField.tsx +4 -5
  57. package/apps/lib/components/LabeledCheckBox.tsx +8 -12
  58. package/apps/lib/components/LabeledRadio.tsx +7 -5
  59. package/apps/lib/components/LinkButton.tsx +2 -9
  60. package/apps/lib/components/LoginButton.tsx +4 -9
  61. package/apps/lib/components/PasswordLevel.tsx +5 -5
  62. package/apps/lib/components/Popover.tsx +15 -33
  63. package/apps/lib/components/ProfileMenu.tsx +67 -72
  64. package/apps/lib/components/Radio.tsx +1 -5
  65. package/apps/lib/components/RadioCard.tsx +9 -28
  66. package/apps/lib/components/ScrollArea.tsx +45 -43
  67. package/apps/lib/components/SearchField.tsx +49 -39
  68. package/apps/lib/components/SearchableSelect.tsx +8 -14
  69. package/apps/lib/components/SearchableTable.tsx +108 -118
  70. package/apps/lib/components/SearchableTree.tsx +469 -0
  71. package/apps/lib/components/SearchableTreeDialog.tsx +493 -0
  72. package/apps/lib/components/SectionBlock.tsx +4 -16
  73. package/apps/lib/components/Select.tsx +53 -80
  74. package/apps/lib/components/SimpleSelect.tsx +196 -187
  75. package/apps/lib/components/Skeleton.tsx +9 -12
  76. package/apps/lib/components/SlideDatePicker.tsx +215 -166
  77. package/apps/lib/components/SpinLoading.tsx +33 -49
  78. package/apps/lib/components/Stepper.tsx +13 -56
  79. package/apps/lib/components/Switch.tsx +8 -10
  80. package/apps/lib/components/TabFormItem.tsx +3 -12
  81. package/apps/lib/components/TabSwitch.tsx +7 -34
  82. package/apps/lib/components/Table.tsx +60 -75
  83. package/apps/lib/components/TableDnDWrapper.ts +15 -48
  84. package/apps/lib/components/TextEditor.tsx +93 -104
  85. package/apps/lib/components/Textarea.tsx +8 -12
  86. package/apps/lib/components/Timeline.tsx +21 -41
  87. package/apps/lib/components/Toast.tsx +83 -83
  88. package/apps/lib/components/Toggle.tsx +112 -114
  89. package/apps/lib/components/ToggleButton.tsx +1 -1
  90. package/apps/lib/components/Tooltip.tsx +24 -19
  91. package/apps/lib/components/TransparentLabel.tsx +61 -62
  92. package/apps/lib/components/TreeDropDown.tsx +86 -52
  93. package/apps/lib/components/TreeFolder/TreeFolder.tsx +15 -48
  94. package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +16 -21
  95. package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +9 -20
  96. package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +3 -3
  97. package/apps/lib/components/TreeFolder/icons.tsx +14 -17
  98. package/apps/lib/components/TreeFolder/index.ts +15 -8
  99. package/apps/lib/components/TreeFolder/treeFolderUtils.ts +47 -52
  100. package/apps/lib/components/TreeFolder/types.ts +32 -32
  101. package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +117 -123
  102. package/apps/lib/hooks/useActiveTreeItem.ts +52 -55
  103. package/apps/lib/hooks/useClickOutside.ts +21 -20
  104. package/apps/lib/hooks/useDataViewsState.ts +86 -80
  105. package/apps/lib/hooks/useIsMobile.ts +12 -12
  106. package/apps/lib/hooks/useResize.ts +54 -65
  107. package/apps/lib/hooks/useTagSelection.ts +201 -201
  108. package/apps/lib/layouts/CNLayout.tsx +181 -140
  109. package/apps/lib/layouts/DataViewCard.tsx +4 -18
  110. package/apps/lib/layouts/FieldSection.tsx +2 -6
  111. package/apps/lib/layouts/TreeSubLayout.tsx +24 -38
  112. package/apps/lib/providers/ThemeProvider.tsx +8 -23
  113. package/apps/lib/registry.json +1004 -0
  114. package/apps/lib/tsconfig.json +9 -0
  115. package/apps/lib/utils/cn.ts +1 -1
  116. package/apps/lib/utils/dataViews/columnUtils.ts +46 -44
  117. package/apps/lib/utils/dataViews/fieldUtils.ts +70 -71
  118. package/apps/lib/utils/dataViews/nestedDataUtils.tsx +129 -122
  119. package/apps/lib/utils/dataViews/pathUtils.ts +74 -67
  120. package/apps/lib/utils/dataViews/rangeUtils.ts +121 -112
  121. package/apps/lib/utils/dataViews/treeUtils.ts +204 -211
  122. package/apps/lib/utils/dateFormat.ts +64 -54
  123. package/apps/lib/utils/markdownParser.ts +2 -7
  124. package/apps/lib/utils/resize.ts +21 -25
  125. package/apps/lib/utils/types.ts +13 -13
  126. package/dist/bin/index.js +8 -2
  127. package/dist/bin/index.js.map +1 -1
  128. package/dist/src/shared/getAvailableFiles.d.ts.map +1 -1
  129. package/dist/src/shared/getAvailableFiles.js +6 -1
  130. package/dist/src/shared/getAvailableFiles.js.map +1 -1
  131. package/dist/src/shared/loadRegistry.d.ts +7 -0
  132. package/dist/src/shared/loadRegistry.d.ts.map +1 -0
  133. package/dist/src/shared/loadRegistry.js +31 -0
  134. package/dist/src/shared/loadRegistry.js.map +1 -0
  135. package/dist/src/shared/resolveInstallPlan.d.ts +12 -0
  136. package/dist/src/shared/resolveInstallPlan.d.ts.map +1 -0
  137. package/dist/src/shared/resolveInstallPlan.js +39 -0
  138. package/dist/src/shared/resolveInstallPlan.js.map +1 -0
  139. package/dist/src/types/main.d.ts +24 -0
  140. package/dist/src/types/main.d.ts.map +1 -1
  141. package/docs/README.md +10 -2
  142. package/docs/components/action-button.md +30 -24
  143. package/docs/components/actions-group.md +26 -20
  144. package/docs/components/alert-dialog.md +45 -45
  145. package/docs/components/avatar.md +6 -2
  146. package/docs/components/badge-field.md +6 -2
  147. package/docs/components/badge.md +7 -1
  148. package/docs/components/breadcrumb.md +15 -40
  149. package/docs/components/button-group.md +13 -10
  150. package/docs/components/button.md +58 -33
  151. package/docs/components/calendar.md +26 -19
  152. package/docs/components/card.md +19 -16
  153. package/docs/components/chart-block-tool.md +128 -0
  154. package/docs/components/checkbox.md +16 -8
  155. package/docs/components/cn-layout.md +7 -1
  156. package/docs/components/context-menu.md +18 -25
  157. package/docs/components/count-badge.md +7 -1
  158. package/docs/components/data-table.md +45 -33
  159. package/docs/components/data-views-config-panel.md +15 -11
  160. package/docs/components/data-views-layout.md +13 -16
  161. package/docs/components/date-picker.md +30 -23
  162. package/docs/components/dialog.md +43 -42
  163. package/docs/components/divider.md +10 -4
  164. package/docs/components/drawer.md +8 -33
  165. package/docs/components/dropdown-menu.md +25 -34
  166. package/docs/components/field-hint.md +37 -25
  167. package/docs/components/field-section.md +9 -3
  168. package/docs/components/form-stepper.md +6 -0
  169. package/docs/components/form.md +17 -20
  170. package/docs/components/header-bar.md +6 -0
  171. package/docs/components/image-attachment.md +33 -41
  172. package/docs/components/inbox-view.md +16 -5
  173. package/docs/components/inner-label-field.md +34 -24
  174. package/docs/components/input-field.md +18 -10
  175. package/docs/components/input-otp.md +14 -11
  176. package/docs/components/input.md +22 -16
  177. package/docs/components/kanban-view.md +15 -5
  178. package/docs/components/label-field.md +32 -22
  179. package/docs/components/label.md +43 -32
  180. package/docs/components/labeled-check-box.md +16 -8
  181. package/docs/components/labeled-radio.md +18 -11
  182. package/docs/components/link-button.md +7 -1
  183. package/docs/components/login-button.md +8 -2
  184. package/docs/components/password-level.md +37 -24
  185. package/docs/components/popover.md +26 -23
  186. package/docs/components/profile-menu.md +38 -27
  187. package/docs/components/radio-card.md +16 -9
  188. package/docs/components/radio.md +16 -8
  189. package/docs/components/scroll-area.md +6 -2
  190. package/docs/components/search-field.md +14 -6
  191. package/docs/components/searchable-select.md +19 -14
  192. package/docs/components/searchable-table.md +18 -13
  193. package/docs/components/searchable-tree-dialog.md +190 -0
  194. package/docs/components/searchable-tree.md +200 -0
  195. package/docs/components/section-block.md +12 -4
  196. package/docs/components/select.md +23 -18
  197. package/docs/components/simple-select.md +14 -10
  198. package/docs/components/skeleton.md +43 -33
  199. package/docs/components/slide-date-picker.md +37 -29
  200. package/docs/components/spin-loading.md +32 -23
  201. package/docs/components/stepper.md +6 -0
  202. package/docs/components/switch.md +14 -6
  203. package/docs/components/tab-form-item.md +7 -1
  204. package/docs/components/tab-switch.md +13 -6
  205. package/docs/components/table-dnd-wrapper.md +105 -0
  206. package/docs/components/table-view.md +15 -5
  207. package/docs/components/table.md +28 -28
  208. package/docs/components/text-editor.md +19 -13
  209. package/docs/components/textarea.md +15 -7
  210. package/docs/components/timeline.md +6 -0
  211. package/docs/components/toast.md +35 -26
  212. package/docs/components/toggle-button.md +24 -21
  213. package/docs/components/toggle.md +23 -15
  214. package/docs/components/tooltip.md +42 -30
  215. package/docs/components/transparent-label.md +29 -20
  216. package/docs/components/tree-drop-down.md +31 -23
  217. package/docs/components/tree-sub-layout.md +6 -2
  218. package/docs/components/tree-view.md +16 -5
  219. package/docs/explanation/architecture.md +54 -0
  220. package/docs/explanation/design-system.md +52 -0
  221. package/docs/how-to/data-views-from-backend-response.md +6 -4
  222. package/docs/how-to/guides.md +24 -18
  223. package/docs/migration/changelog.md +38 -0
  224. package/docs/reference/cli.md +87 -0
  225. package/docs/reference/components.md +11 -12
  226. package/docs/reference/hooks.md +8 -8
  227. package/docs/reference/providers.md +22 -22
  228. package/docs/reference/tailwind-plugins.md +2 -2
  229. package/docs/reference/theme.md +85 -0
  230. package/docs/reference/types.md +4 -4
  231. package/docs/reference/utilities.md +19 -26
  232. package/docs/tutorials/building-first-form.md +20 -13
  233. package/docs/tutorials/component-composition.md +34 -50
  234. package/docs/tutorials/getting-started.md +2 -2
  235. package/docs/tutorials/theming-basics.md +13 -10
  236. package/package.json +31 -3
  237. package/dist/src/commands/block.d.ts +0 -5
  238. package/dist/src/commands/block.d.ts.map +0 -1
  239. package/dist/src/commands/block.js +0 -255
  240. package/dist/src/commands/block.js.map +0 -1
  241. package/dist/src/shared/configureFonts.d.ts +0 -6
  242. package/dist/src/shared/configureFonts.d.ts.map +0 -1
  243. package/dist/src/shared/configureFonts.js +0 -106
  244. package/dist/src/shared/configureFonts.js.map +0 -1
  245. package/dist/src/shared/configureGlobalCss.d.ts +0 -6
  246. package/dist/src/shared/configureGlobalCss.d.ts.map +0 -1
  247. package/dist/src/shared/configureGlobalCss.js +0 -154
  248. package/dist/src/shared/configureGlobalCss.js.map +0 -1
  249. package/dist/src/shared/configureTailwind.d.ts +0 -7
  250. package/dist/src/shared/configureTailwind.d.ts.map +0 -1
  251. package/dist/src/shared/configureTailwind.js +0 -163
  252. package/dist/src/shared/configureTailwind.js.map +0 -1
  253. package/dist/src/shared/detectFramework.d.ts +0 -23
  254. package/dist/src/shared/detectFramework.d.ts.map +0 -1
  255. package/dist/src/shared/detectFramework.js +0 -119
  256. package/dist/src/shared/detectFramework.js.map +0 -1
  257. package/dist/src/shared/installBaseUtils.d.ts +0 -5
  258. package/dist/src/shared/installBaseUtils.d.ts.map +0 -1
  259. package/dist/src/shared/installBaseUtils.js +0 -79
  260. package/dist/src/shared/installBaseUtils.js.map +0 -1
  261. package/dist/src/shared/resolveAliases.d.ts +0 -24
  262. package/dist/src/shared/resolveAliases.d.ts.map +0 -1
  263. package/dist/src/shared/resolveAliases.js +0 -98
  264. package/dist/src/shared/resolveAliases.js.map +0 -1
@@ -3,9 +3,10 @@ import {
3
3
  forwardRef,
4
4
  InputHTMLAttributes,
5
5
  ReactNode,
6
- useEffect,
7
6
  useRef,
8
7
  useState,
8
+ ChangeEvent,
9
+ FocusEvent,
9
10
  } from "react";
10
11
  import { cn } from "../utils/cn";
11
12
  import { Tooltip, ToolTipSide } from "./Tooltip";
@@ -13,12 +14,11 @@ import { Popover, PopoverContent, PopoverTrigger } from "./Popover";
13
14
  import { Themes } from "../utils/types";
14
15
  import { Icon, Input, Group, Trilling } from "./Input";
15
16
  import { useClickOutside } from "../hooks/useClickOutside";
16
- import { Badge } from "./Badge";
17
+ import { Badge, badgeStyles } from "./Badge";
17
18
  import { Tag, useTagSelection } from "../hooks/useTagSelection";
18
- import { cva } from "class-variance-authority";
19
+ import { cva, type VariantProps } from "class-variance-authority";
19
20
 
20
- interface Props
21
- extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "variant"> {
21
+ interface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "variant"> {
22
22
  size?: "XS" | "S" | "M"; // this is used to change the size style of the component
23
23
  variant?: "SystemStyle" | "PresentationStyle";
24
24
  icon?: ReactNode; // to add left side icon if you pass it
@@ -31,37 +31,37 @@ interface Props
31
31
  actionButton?: ReactNode;
32
32
  tags: Tag[];
33
33
  onValueChange?: (tags: Tag[]) => void;
34
- addLabel?: string
34
+ addLabel?: string;
35
35
  }
36
36
 
37
37
  export const BadgeField = forwardRef<HTMLInputElement, Props>(
38
- (
39
- {
40
- size = "M",
41
- label,
42
- required,
43
- icon,
44
- errorMessage,
45
- onTable,
46
- variant = "PresentationStyle",
47
- toolTipSide,
48
- className,
49
- actionButton,
50
- theme,
51
- tags,
52
- addLabel = "add",
53
- dir,
54
- children,
55
- onValueChange,
56
- ...props
57
- },
58
- forwardedRef
59
- ) => {
38
+ ({
39
+ size = "M",
40
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- excluded from {...props} spread
41
+ label,
42
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- excluded from {...props} spread
43
+ required,
44
+ icon,
45
+ errorMessage,
46
+ onTable,
47
+ variant = "PresentationStyle",
48
+ toolTipSide,
49
+ className,
50
+ actionButton,
51
+ theme,
52
+ tags,
53
+ addLabel = "add",
54
+ dir,
55
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- excluded from {...props} spread
56
+ children,
57
+ onValueChange,
58
+ ...props
59
+ }) => {
60
60
  const [dropDownListWidth, setDropDownListWidth] = useState(0);
61
61
  const popoverContentRef = useRef<HTMLDivElement>(null);
62
62
  const inputRef = useRef<HTMLInputElement | null>(null);
63
63
  // this is used to close the popover when the user clicks outside the input group
64
- const inputGroupRef = useClickOutside((e) => {
64
+ const inputGroupRef = useClickOutside<HTMLDivElement>((e) => {
65
65
  if (
66
66
  !inputGroupRef?.current?.contains(e?.target as Node) &&
67
67
  !popoverContentRef?.current?.contains(e?.target as Node)
@@ -83,7 +83,7 @@ export const BadgeField = forwardRef<HTMLInputElement, Props>(
83
83
  focusedPopoverIndex,
84
84
  isPopoverOpen,
85
85
  setIsPopoverOpen,
86
- searchTags
86
+ searchTags,
87
87
  } = useTagSelection({
88
88
  Tags: tags,
89
89
  onTagsChange: (e) => {
@@ -92,21 +92,17 @@ export const BadgeField = forwardRef<HTMLInputElement, Props>(
92
92
  // callback consumers and the docs use.
93
93
  props.onChange?.({
94
94
  target: {
95
- value: e
96
- }
97
- } as any);
95
+ value: e,
96
+ },
97
+ } as unknown as ChangeEvent<HTMLInputElement>);
98
98
  onValueChange?.(e);
99
99
  },
100
- inputRef
100
+ inputRef,
101
101
  });
102
102
 
103
103
  return (
104
104
  <Popover open={isPopoverOpen}>
105
- <Tooltip
106
- toolTipSide={toolTipSide}
107
- open={errorMessage !== undefined}
108
- text={errorMessage}
109
- >
105
+ <Tooltip toolTipSide={toolTipSide} open={errorMessage !== undefined} text={errorMessage}>
110
106
  <PopoverTrigger asChild>
111
107
  <Group
112
108
  dir={dir}
@@ -117,8 +113,8 @@ export const BadgeField = forwardRef<HTMLInputElement, Props>(
117
113
  tabIndex={isPopoverOpen ? 0 : -1}
118
114
  onKeyDown={handleKeyDown}
119
115
  size={size === "XS" ? "S" : size}
120
- ref={inputGroupRef as any}
121
- onFocus={(e: any) => {
116
+ ref={inputGroupRef}
117
+ onFocus={(e: FocusEvent<HTMLDivElement>) => {
122
118
  setDropDownListWidth(e.currentTarget.offsetWidth);
123
119
  }}
124
120
  className={cn(
@@ -127,7 +123,7 @@ export const BadgeField = forwardRef<HTMLInputElement, Props>(
127
123
  "flex-wrap justify-start": isPopoverOpen,
128
124
  "h-fit": isPopoverOpen,
129
125
  },
130
- className
126
+ className,
131
127
  )}
132
128
  >
133
129
  {icon && <Icon>{icon}</Icon>}
@@ -136,13 +132,11 @@ export const BadgeField = forwardRef<HTMLInputElement, Props>(
136
132
  <Badge
137
133
  key={tag.id}
138
134
  size={size}
139
- color={tag.variant as any}
135
+ color={tag.variant as VariantProps<typeof badgeStyles>["color"]}
140
136
  label={tag.name}
141
137
  isClosable={true}
142
138
  onClose={() => handleUnselectTag(tag.id)}
143
- className={
144
- focusedTagIndex === index ? "ring-2 ring-blue-500" : ""
145
- }
139
+ className={focusedTagIndex === index ? "ring-2 ring-blue-500" : ""}
146
140
  tabIndex={focusedTagIndex === index ? 0 : -1}
147
141
  />
148
142
  ))}
@@ -165,7 +159,7 @@ export const BadgeField = forwardRef<HTMLInputElement, Props>(
165
159
  "!h-[18px]": size === "XS",
166
160
  "!h-[22px]": size === "S",
167
161
  "!h-[24px]": size === "M",
168
- }
162
+ },
169
163
  )}
170
164
  />
171
165
  {actionButton && (
@@ -185,14 +179,14 @@ export const BadgeField = forwardRef<HTMLInputElement, Props>(
185
179
  style={{ width: dropDownListWidth }}
186
180
  variant={variant}
187
181
  onKeyDown={handleKeyDown}
188
- className={cn(menuContentContinerStyles({ variant: "PresentationStyle" }), "p-1 rounded-[17px]")}
182
+ className={cn(
183
+ menuContentContinerStyles({ variant: "PresentationStyle" }),
184
+ "p-1 rounded-[17px]",
185
+ )}
189
186
 
190
- // Reuse the DropdownMenu surface so the list matches the menu design.
187
+ // Reuse the DropdownMenu surface so the list matches the menu design.
191
188
  >
192
- <div
193
- className={cn(menuContentStyles({ variant: "PresentationStyle" }), "p-0")}
194
-
195
- >
189
+ <div className={cn(menuContentStyles({ variant: "PresentationStyle" }), "p-0")}>
196
190
  {filteredTags.length > 0 ? (
197
191
  filteredTags.map((tag, index) => (
198
192
  <button
@@ -203,15 +197,30 @@ export const BadgeField = forwardRef<HTMLInputElement, Props>(
203
197
  tabIndex={focusedPopoverIndex === index ? 0 : -1}
204
198
  className={cn(
205
199
  MenuItemStyles({ variant: "Default", size: "M" }),
206
- "w-full p-1 shrink-0 h-fit"
200
+ "w-full p-1 shrink-0 h-fit",
207
201
  )}
208
202
  >
209
203
  <div className="flex items-center justify-between w-full">
210
- <Badge size={size} badgeStyle={"solid"} color={tag.variant as any} label={tag.name} />
204
+ <Badge
205
+ size={size}
206
+ badgeStyle={"solid"}
207
+ color={tag.variant as VariantProps<typeof badgeStyles>["color"]}
208
+ label={tag.name}
209
+ />
211
210
 
212
211
  <div className="flex group-hover:opacity-100 opacity-0 px-[4px] py-[2px] items-center rounded-[6px] bg-white-50">
213
- <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" className="rtl:rotate-180" fill="none">
214
- <path d="M3.91422 5.49995H10V6.49995H3.91422L6.5962 9.1819L5.8891 9.889L2 5.99995L5.8891 2.11084L6.5962 2.81794L3.91422 5.49995Z" fill="black" />
212
+ <svg
213
+ xmlns="http://www.w3.org/2000/svg"
214
+ width="12"
215
+ height="12"
216
+ viewBox="0 0 12 12"
217
+ className="rtl:rotate-180"
218
+ fill="none"
219
+ >
220
+ <path
221
+ d="M3.91422 5.49995H10V6.49995H3.91422L6.5962 9.1819L5.8891 9.889L2 5.99995L5.8891 2.11084L6.5962 2.81794L3.91422 5.49995Z"
222
+ fill="black"
223
+ />
215
224
  </svg>
216
225
  <p className="text-black-1000 text-right text-[12px] font-[510] leading-[148%]">
217
226
  {addLabel}
@@ -222,15 +231,14 @@ export const BadgeField = forwardRef<HTMLInputElement, Props>(
222
231
  ))
223
232
  ) : (
224
233
  <div className="px-3 py-2 typography-body-small-regular text-white-alpha-75">
225
- {tags.length === 0
226
- ? "All tags selected"
227
- : "No matching tags found"}
234
+ {tags.length === 0 ? "All tags selected" : "No matching tags found"}
228
235
  </div>
229
- )} </div>
236
+ )}{" "}
237
+ </div>
230
238
  </PopoverContent>
231
- </Popover >
239
+ </Popover>
232
240
  );
233
- }
241
+ },
234
242
  );
235
243
  BadgeField.displayName = "BadgeField";
236
244
 
@@ -251,14 +259,13 @@ const menuContentStyles = cva(
251
259
  {
252
260
  variants: {
253
261
  variant: {
254
- PresentationStyle: [
255
- ],
262
+ PresentationStyle: [],
256
263
  },
257
264
  defaultVariants: {
258
265
  variant: "PresentationStyle",
259
266
  },
260
267
  },
261
- }
268
+ },
262
269
  );
263
270
  const menuContentContinerStyles = cva(
264
271
  [
@@ -285,7 +292,7 @@ const menuContentContinerStyles = cva(
285
292
  variant: "PresentationStyle",
286
293
  },
287
294
  },
288
- }
295
+ },
289
296
  );
290
297
 
291
298
  const MenuItemStyles = cva(
@@ -312,9 +319,7 @@ const MenuItemStyles = cva(
312
319
  {
313
320
  variants: {
314
321
  variant: {
315
- Default: [
316
- "hover:bg-[rgba(184,192,204,0.50)] ",
317
- ],
322
+ Default: ["hover:bg-[rgba(184,192,204,0.50)] "],
318
323
  },
319
324
  size: {
320
325
  S: ["typography-body-small-regular", "h-[24px]"],
@@ -325,5 +330,5 @@ const MenuItemStyles = cva(
325
330
  size: "M",
326
331
  },
327
332
  },
328
- }
333
+ },
329
334
  );
@@ -24,7 +24,7 @@ const Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(
24
24
  className={cn("flex", className)}
25
25
  {...props}
26
26
  />
27
- )
27
+ ),
28
28
  );
29
29
  Breadcrumb.displayName = "Breadcrumb";
30
30
 
@@ -32,28 +32,21 @@ Breadcrumb.displayName = "Breadcrumb";
32
32
  // Breadcrumb List
33
33
  // ============================================================================
34
34
 
35
- const breadcrumbListStyles = cva(
36
- [
37
- "flex flex-wrap items-center gap-1.5",
38
- "break-words",
39
- ],
40
- {
41
- variants: {
42
- size: {
43
- S: ["text-[12px]", "gap-1"],
44
- M: ["text-[14px]", "gap-1.5"],
45
- L: ["text-[16px]", "gap-2"],
46
- },
35
+ const breadcrumbListStyles = cva(["flex flex-wrap items-center gap-1.5", "break-words"], {
36
+ variants: {
37
+ size: {
38
+ S: ["text-[12px]", "gap-1"],
39
+ M: ["text-[14px]", "gap-1.5"],
40
+ L: ["text-[16px]", "gap-2"],
47
41
  },
48
- defaultVariants: {
49
- size: "M",
50
- },
51
- }
52
- );
42
+ },
43
+ defaultVariants: {
44
+ size: "M",
45
+ },
46
+ });
53
47
 
54
48
  interface BreadcrumbListProps
55
- extends React.ComponentPropsWithoutRef<"ol">,
56
- VariantProps<typeof breadcrumbListStyles> {
49
+ extends React.ComponentPropsWithoutRef<"ol">, VariantProps<typeof breadcrumbListStyles> {
57
50
  theme?: Themes;
58
51
  }
59
52
 
@@ -65,7 +58,7 @@ const BreadcrumbList = forwardRef<HTMLOListElement, BreadcrumbListProps>(
65
58
  className={cn(breadcrumbListStyles({ size }), className)}
66
59
  {...props}
67
60
  />
68
- )
61
+ ),
69
62
  );
70
63
  BreadcrumbList.displayName = "BreadcrumbList";
71
64
 
@@ -73,16 +66,11 @@ BreadcrumbList.displayName = "BreadcrumbList";
73
66
  // Breadcrumb Item
74
67
  // ============================================================================
75
68
 
76
- const BreadcrumbItem = forwardRef<
77
- HTMLLIElement,
78
- React.ComponentPropsWithoutRef<"li">
79
- >(({ className, ...props }, ref) => (
80
- <li
81
- ref={ref}
82
- className={cn("inline-flex items-center gap-1.5", className)}
83
- {...props}
84
- />
85
- ));
69
+ const BreadcrumbItem = forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<"li">>(
70
+ ({ className, ...props }, ref) => (
71
+ <li ref={ref} className={cn("inline-flex items-center gap-1.5", className)} {...props} />
72
+ ),
73
+ );
86
74
  BreadcrumbItem.displayName = "BreadcrumbItem";
87
75
 
88
76
  // ============================================================================
@@ -116,12 +104,11 @@ const breadcrumbLinkStyles = cva(
116
104
  defaultVariants: {
117
105
  variant: "PresentationStyle",
118
106
  },
119
- }
107
+ },
120
108
  );
121
109
 
122
110
  interface BreadcrumbLinkProps
123
- extends React.ComponentPropsWithoutRef<"a">,
124
- VariantProps<typeof breadcrumbLinkStyles> {
111
+ extends React.ComponentPropsWithoutRef<"a">, VariantProps<typeof breadcrumbLinkStyles> {
125
112
  asChild?: boolean;
126
113
  theme?: Themes;
127
114
  }
@@ -138,7 +125,7 @@ const BreadcrumbLink = forwardRef<HTMLAnchorElement, BreadcrumbLinkProps>(
138
125
  {...props}
139
126
  />
140
127
  );
141
- }
128
+ },
142
129
  );
143
130
  BreadcrumbLink.displayName = "BreadcrumbLink";
144
131
 
@@ -146,31 +133,20 @@ BreadcrumbLink.displayName = "BreadcrumbLink";
146
133
  // Breadcrumb Page (Current page - not a link)
147
134
  // ============================================================================
148
135
 
149
- const breadcrumbPageStyles = cva(
150
- [
151
- "inline-flex items-center",
152
- "font-medium",
153
- ],
154
- {
155
- variants: {
156
- variant: {
157
- PresentationStyle: [
158
- "text-content-presentation-global-primary",
159
- ],
160
- SystemStyle: [
161
- "text-content-system-global-primary",
162
- ],
163
- },
136
+ const breadcrumbPageStyles = cva(["inline-flex items-center", "font-medium"], {
137
+ variants: {
138
+ variant: {
139
+ PresentationStyle: ["text-content-presentation-global-primary"],
140
+ SystemStyle: ["text-content-system-global-primary"],
164
141
  },
165
- defaultVariants: {
166
- variant: "PresentationStyle",
167
- },
168
- }
169
- );
142
+ },
143
+ defaultVariants: {
144
+ variant: "PresentationStyle",
145
+ },
146
+ });
170
147
 
171
148
  interface BreadcrumbPageProps
172
- extends React.ComponentPropsWithoutRef<"span">,
173
- VariantProps<typeof breadcrumbPageStyles> {
149
+ extends React.ComponentPropsWithoutRef<"span">, VariantProps<typeof breadcrumbPageStyles> {
174
150
  theme?: Themes;
175
151
  }
176
152
 
@@ -185,7 +161,7 @@ const BreadcrumbPage = forwardRef<HTMLSpanElement, BreadcrumbPageProps>(
185
161
  className={cn(breadcrumbPageStyles({ variant }), className)}
186
162
  {...props}
187
163
  />
188
- )
164
+ ),
189
165
  );
190
166
  BreadcrumbPage.displayName = "BreadcrumbPage";
191
167
 
@@ -193,31 +169,20 @@ BreadcrumbPage.displayName = "BreadcrumbPage";
193
169
  // Breadcrumb Separator
194
170
  // ============================================================================
195
171
 
196
- const breadcrumbSeparatorStyles = cva(
197
- [
198
- "flex items-center justify-center",
199
- "[&_i]:text-[12px]",
200
- ],
201
- {
202
- variants: {
203
- variant: {
204
- PresentationStyle: [
205
- "text-content-presentation-global-secondary",
206
- ],
207
- SystemStyle: [
208
- "text-content-system-global-secondary",
209
- ],
210
- },
172
+ const breadcrumbSeparatorStyles = cva(["flex items-center justify-center", "[&_i]:text-[12px]"], {
173
+ variants: {
174
+ variant: {
175
+ PresentationStyle: ["text-content-presentation-global-secondary"],
176
+ SystemStyle: ["text-content-system-global-secondary"],
211
177
  },
212
- defaultVariants: {
213
- variant: "PresentationStyle",
214
- },
215
- }
216
- );
178
+ },
179
+ defaultVariants: {
180
+ variant: "PresentationStyle",
181
+ },
182
+ });
217
183
 
218
184
  interface BreadcrumbSeparatorProps
219
- extends React.ComponentPropsWithoutRef<"li">,
220
- VariantProps<typeof breadcrumbSeparatorStyles> {
185
+ extends React.ComponentPropsWithoutRef<"li">, VariantProps<typeof breadcrumbSeparatorStyles> {
221
186
  theme?: Themes;
222
187
  }
223
188
 
@@ -233,7 +198,7 @@ const BreadcrumbSeparator = forwardRef<HTMLLIElement, BreadcrumbSeparatorProps>(
233
198
  >
234
199
  {children ?? <i className="ri-arrow-right-s-line" />}
235
200
  </li>
236
- )
201
+ ),
237
202
  );
238
203
  BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
239
204
 
@@ -267,12 +232,11 @@ const breadcrumbEllipsisStyles = cva(
267
232
  defaultVariants: {
268
233
  variant: "PresentationStyle",
269
234
  },
270
- }
235
+ },
271
236
  );
272
237
 
273
238
  interface BreadcrumbEllipsisProps
274
- extends React.ComponentPropsWithoutRef<"span">,
275
- VariantProps<typeof breadcrumbEllipsisStyles> {
239
+ extends React.ComponentPropsWithoutRef<"span">, VariantProps<typeof breadcrumbEllipsisStyles> {
276
240
  theme?: Themes;
277
241
  }
278
242
 
@@ -289,7 +253,7 @@ const BreadcrumbEllipsis = forwardRef<HTMLSpanElement, BreadcrumbEllipsisProps>(
289
253
  <i className="ri-more-line" />
290
254
  <span className="sr-only">More</span>
291
255
  </span>
292
- )
256
+ ),
293
257
  );
294
258
  BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
295
259
 
@@ -5,9 +5,7 @@ import { cn } from "../utils/cn";
5
5
  import { ButtonVariant, Themes } from "../utils/types";
6
6
 
7
7
  interface Props
8
- extends
9
- ButtonHTMLAttributes<HTMLButtonElement>,
10
- VariantProps<typeof buttonVariants> {
8
+ extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
11
9
  is_loading?: boolean;
12
10
  disabled?: boolean;
13
11
  asChild?: boolean;
@@ -42,6 +40,7 @@ export const Button = forwardRef<HTMLButtonElement, Props>(
42
40
  {...props}
43
41
  data-theme={theme}
44
42
  disabled={disabled || is_loading}
43
+ aria-busy={is_loading || undefined}
45
44
  ref={ref}
46
45
  type={type}
47
46
  className={cn(
@@ -65,7 +64,7 @@ export const Button = forwardRef<HTMLButtonElement, Props>(
65
64
  containerClassName,
66
65
  )}
67
66
  >
68
- {(children as React.ReactElement<any>).props.children}
67
+ {(children as React.ReactElement<{ children?: React.ReactNode }>).props.children}
69
68
  {is_loading && <LoadingIcon size={size} />}
70
69
  </div>,
71
70
  )
@@ -87,6 +86,20 @@ export const Button = forwardRef<HTMLButtonElement, Props>(
87
86
 
88
87
  Button.displayName = "Button";
89
88
 
89
+ const loadingIconVariants = cva("animate-spin ", {
90
+ variants: {
91
+ size: {
92
+ S: "w-[12px] h-[12px]",
93
+ M: "w-[18px] h-[18px]",
94
+ L: "w-[20px] h-[20px]",
95
+ XL: "w-[20px] h-[20px]",
96
+ },
97
+ },
98
+ defaultVariants: {
99
+ size: "M",
100
+ },
101
+ });
102
+
90
103
  export function LoadingIcon({
91
104
  size,
92
105
  className,
@@ -94,26 +107,14 @@ export function LoadingIcon({
94
107
  size?: "S" | "M" | "L" | "XL" | null;
95
108
  className?: string;
96
109
  }) {
97
- const iconVariants = cva("animate-spin ", {
98
- variants: {
99
- size: {
100
- S: "w-[12px] h-[12px]",
101
- M: "w-[18px] h-[18px]",
102
- L: "w-[20px] h-[20px]",
103
- XL: "w-[20px] h-[20px]",
104
- },
105
- },
106
- defaultVariants: {
107
- size: "M",
108
- },
109
- });
110
-
111
110
  return (
112
111
  <svg
113
- className={cn(iconVariants({ size, className }))}
112
+ className={cn(loadingIconVariants({ size, className }))}
114
113
  viewBox="0 0 12 12"
115
114
  fill="none"
116
115
  xmlns="http://www.w3.org/2000/svg"
116
+ role="status"
117
+ aria-label="Loading"
117
118
  >
118
119
  <path
119
120
  d="M11 6C11 8.76142 8.76142 11 6 11C3.23858 11 1 8.76142 1 6C1 3.23858 3.23858 1 6 1C8.76142 1 11 3.23858 11 6ZM2.25 6C2.25 8.07107 3.92893 9.75 6 9.75C8.07107 9.75 9.75 8.07107 9.75 6C9.75 3.92893 8.07107 2.25 6 2.25C3.92893 2.25 2.25 3.92893 2.25 6Z"