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
@@ -16,11 +16,11 @@ const SelectValue = SelectPrimitive.Value;
16
16
  const SelectTrigger = React.forwardRef<
17
17
  React.ElementRef<typeof SelectPrimitive.Trigger>,
18
18
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &
19
- VariantProps<typeof PopoverTriggerStyles> & {
20
- errors?: string;
21
- icon?: string
22
- theme?: Themes
23
- }
19
+ VariantProps<typeof PopoverTriggerStyles> & {
20
+ errors?: string;
21
+ icon?: string;
22
+ theme?: Themes;
23
+ }
24
24
  >(
25
25
  (
26
26
  {
@@ -33,7 +33,7 @@ const SelectTrigger = React.forwardRef<
33
33
  icon,
34
34
  ...props
35
35
  },
36
- ref
36
+ ref,
37
37
  ) => {
38
38
  return (
39
39
  <Tooltip toolTipSide={"top"} open={errors !== undefined} text={errors}>
@@ -46,23 +46,25 @@ const SelectTrigger = React.forwardRef<
46
46
  variant,
47
47
  error: errors !== undefined,
48
48
  }),
49
- className
49
+ className,
50
50
  )}
51
51
  {...props}
52
52
  >
53
- <p className={cn({
54
- "[&_span]:text-[#A0A0A0]": !props.value
55
- })}>{children}</p>
53
+ <p
54
+ className={cn({
55
+ "[&_span]:text-[#A0A0A0]": !props.value,
56
+ })}
57
+ >
58
+ {children}
59
+ </p>
56
60
 
57
61
  <Button
58
62
  as={"span"}
59
63
  buttonType="icon"
60
- className={cn(
61
- [
62
- "group-aria-expanded:bg-background-presentation-action-hover",
63
- "group-aria-expanded:text-white",
64
- ]
65
- )}
64
+ className={cn([
65
+ "group-aria-expanded:bg-background-presentation-action-hover",
66
+ "group-aria-expanded:text-white",
67
+ ])}
66
68
  >
67
69
  <i
68
70
  className={cn(
@@ -71,14 +73,14 @@ const SelectTrigger = React.forwardRef<
71
73
  { "!text-[16px]": size === "M" },
72
74
  { "!text-[18px]": size === "L" },
73
75
  { "!text-[26px]": size === "XL" },
74
- { icon: icon }
76
+ { icon: icon },
75
77
  )}
76
78
  />
77
79
  </Button>
78
80
  </SelectPrimitive.Trigger>
79
81
  </Tooltip>
80
82
  );
81
- }
83
+ },
82
84
  );
83
85
  SelectTrigger.displayName = "SelectTrigger";
84
86
 
@@ -88,10 +90,7 @@ const SelectScrollUpButton = React.forwardRef<
88
90
  >(({ className, ...props }, ref) => (
89
91
  <SelectPrimitive.ScrollUpButton
90
92
  ref={ref}
91
- className={cn(
92
- "flex cursor-default items-center justify-center py-1 ",
93
- className
94
- )}
93
+ className={cn("flex cursor-default items-center justify-center py-1 ", className)}
95
94
  {...props}
96
95
  >
97
96
  <i
@@ -108,10 +107,7 @@ const SelectScrollDownButton = React.forwardRef<
108
107
  >(({ className, ...props }, ref) => (
109
108
  <SelectPrimitive.ScrollDownButton
110
109
  ref={ref}
111
- className={cn(
112
- "flex cursor-default items-center justify-center py-1",
113
- className
114
- )}
110
+ className={cn("flex cursor-default items-center justify-center py-1", className)}
115
111
  {...props}
116
112
  >
117
113
  <i
@@ -125,20 +121,13 @@ SelectScrollDownButton.displayName = "SelectScrollDownButton";
125
121
  const SelectContent = React.forwardRef<
126
122
  React.ElementRef<typeof SelectPrimitive.Content>,
127
123
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> &
128
- VariantProps<typeof SelectContentStyles> & {
129
- theme?: Themes
130
- }
124
+ VariantProps<typeof SelectContentStyles> & {
125
+ theme?: Themes;
126
+ }
131
127
  >(
132
128
  (
133
- {
134
- className,
135
- children,
136
- variant = "PresentationStyle",
137
- position = "popper",
138
- theme,
139
- ...props
140
- },
141
- ref
129
+ { className, children, variant = "PresentationStyle", position = "popper", theme, ...props },
130
+ ref,
142
131
  ) => (
143
132
  <SelectPrimitive.Portal>
144
133
  <SelectPrimitive.Content
@@ -151,7 +140,7 @@ const SelectContent = React.forwardRef<
151
140
  <SelectPrimitive.Viewport>{children}</SelectPrimitive.Viewport>
152
141
  </SelectPrimitive.Content>
153
142
  </SelectPrimitive.Portal>
154
- )
143
+ ),
155
144
  );
156
145
  SelectContent.displayName = "SelectContent";
157
146
 
@@ -170,28 +159,23 @@ SelectLabel.displayName = "SelectLabel";
170
159
  const SelectItem = React.forwardRef<
171
160
  React.ElementRef<typeof SelectPrimitive.Item>,
172
161
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> &
173
- VariantProps<typeof SelectItemStyles>
174
- >(
175
- (
176
- { className, children, size = "M", variant = "Default", active, ...props },
177
- ref
178
- ) => (
179
- <SelectPrimitive.Item
180
- ref={ref}
181
- className={cn(
182
- SelectItemStyles({
183
- variant,
184
- active,
185
- size,
186
- }),
187
- className
188
- )}
189
- {...props}
190
- >
191
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
192
- </SelectPrimitive.Item>
193
- )
194
- );
162
+ VariantProps<typeof SelectItemStyles>
163
+ >(({ className, children, size = "M", variant = "Default", active, ...props }, ref) => (
164
+ <SelectPrimitive.Item
165
+ ref={ref}
166
+ className={cn(
167
+ SelectItemStyles({
168
+ variant,
169
+ active,
170
+ size,
171
+ }),
172
+ className,
173
+ )}
174
+ {...props}
175
+ >
176
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
177
+ </SelectPrimitive.Item>
178
+ ));
195
179
 
196
180
  SelectItem.displayName = "SelectItem";
197
181
 
@@ -220,7 +204,6 @@ export {
220
204
  SelectScrollDownButton,
221
205
  };
222
206
 
223
-
224
207
  // NOTE: radix select as DropDownButton
225
208
 
226
209
  const SelectContentStyles = cva(
@@ -257,7 +240,7 @@ const SelectContentStyles = cva(
257
240
  variant: "PresentationStyle",
258
241
  },
259
242
  },
260
- }
243
+ },
261
244
  );
262
245
 
263
246
  const SelectItemStyles = cva(
@@ -277,7 +260,6 @@ const SelectItemStyles = cva(
277
260
  "transition-all",
278
261
  "ease-in-out",
279
262
  "duration-300",
280
-
281
263
  ],
282
264
  {
283
265
  variants: {
@@ -326,10 +308,7 @@ const SelectItemStyles = cva(
326
308
  },
327
309
 
328
310
  disabled: {
329
- true: [
330
- "text-content-presentation-state-disabled",
331
- "bg-white-00",
332
- ],
311
+ true: ["text-content-presentation-state-disabled", "bg-white-00"],
333
312
  },
334
313
 
335
314
  active: {
@@ -353,7 +332,7 @@ const SelectItemStyles = cva(
353
332
  className: ["text-content-presentation-state-negative"],
354
333
  },
355
334
  ],
356
- }
335
+ },
357
336
  );
358
337
 
359
338
  const PopoverTriggerStyles = cva(
@@ -398,15 +377,9 @@ const PopoverTriggerStyles = cva(
398
377
  ],
399
378
  },
400
379
  size: {
401
- S: [
402
- "[&_span]:h-[22px] [&_span]:w-[22px] [&_p]:typography-body-small-medium",
403
- ],
404
- M: [
405
- "[&_span]:h-[26px] [&_span]:w-[26px] [&_p]:typography-body-medium-medium",
406
- ],
407
- L: [
408
- "[&_span]:h-[28px] [&_span]:w-[28px] [&_p]:typography-body-large-medium",
409
- ],
380
+ S: ["[&_span]:h-[22px] [&_span]:w-[22px] [&_p]:typography-body-small-medium"],
381
+ M: ["[&_span]:h-[26px] [&_span]:w-[26px] [&_p]:typography-body-medium-medium"],
382
+ L: ["[&_span]:h-[28px] [&_span]:w-[28px] [&_p]:typography-body-large-medium"],
410
383
  XL: [
411
384
  "h-[40px] p-[4px] rounded-[6px] [&_span]:h-[32px] [&_span]:w-[32px] [&_p]:typography-body-large-regular [&_p]:px-[4px]",
412
385
  ],
@@ -415,5 +388,5 @@ const PopoverTriggerStyles = cva(
415
388
  defaultVariants: {
416
389
  size: "M",
417
390
  },
418
- }
419
- );
391
+ },
392
+ );
@@ -4,213 +4,222 @@ import { cva } from "class-variance-authority";
4
4
  import { HTMLAttributes, InputHTMLAttributes, ReactNode, useEffect, useRef, useState } from "react";
5
5
 
6
6
  interface SimpleSelectDropDownProps {
7
- className?: string;
8
- children: ReactNode;
9
- onClick?: () => void;
7
+ className?: string;
8
+ children: ReactNode;
9
+ onClick?: () => void;
10
10
  }
11
11
 
12
12
  const SimpleSelectDropDown = ({ className, children, onClick }: SimpleSelectDropDownProps) => {
13
- return (
14
- <div className={cn("absolute min-w-[100px] z-[20] top-[27px] left-0", dropdownMenuStyles({ variant: "SystemStyle" }), className)} onClick={onClick}>
15
- {children}
16
- </div>
17
- );
13
+ return (
14
+ <div
15
+ className={cn(
16
+ "absolute min-w-[100px] z-[20] top-[27px] left-0",
17
+ dropdownMenuStyles({ variant: "SystemStyle" }),
18
+ className,
19
+ )}
20
+ onClick={onClick}
21
+ >
22
+ {children}
23
+ </div>
24
+ );
18
25
  };
19
26
 
20
- interface SimpleSelectItemProps
21
- extends HTMLAttributes<HTMLLIElement> {
22
- selected?: boolean
27
+ interface SimpleSelectItemProps extends HTMLAttributes<HTMLLIElement> {
28
+ selected?: boolean;
23
29
  }
24
30
 
25
31
  const SimpleSelectItem = ({ selected, ...props }: SimpleSelectItemProps) => {
32
+ const ref = useRef<HTMLLIElement>(null);
26
33
 
27
- const ref = useRef<HTMLLIElement>(null);
28
-
29
- // Scroll to the selected item when the dropdown is opened
30
- useEffect(() => {
31
- if (selected && ref.current) {
32
- ref.current.scrollIntoView({ behavior: "auto", block: "center" });
33
- }
34
- }, [selected]);
35
-
36
- return (
37
- <li {...props} ref={ref} className={cn(" whitespace-nowrap z-[9999]", MenuItemStyles({ variant: "SystemStyle", selected: selected, size: "S" }))}>
38
- {props.children}
39
- </li>
40
- )
41
- }
34
+ // Scroll to the selected item when the dropdown is opened
35
+ useEffect(() => {
36
+ if (selected && ref.current) {
37
+ ref.current.scrollIntoView({ behavior: "auto", block: "center" });
38
+ }
39
+ }, [selected]);
40
+
41
+ return (
42
+ <li
43
+ {...props}
44
+ ref={ref}
45
+ className={cn(
46
+ " whitespace-nowrap z-[9999]",
47
+ MenuItemStyles({ variant: "SystemStyle", selected: selected, size: "S" }),
48
+ )}
49
+ >
50
+ {props.children}
51
+ </li>
52
+ );
53
+ };
42
54
 
43
- interface SimpleSelectValueProps
44
- extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
45
- inputClassName?: string;
46
- onChange?: (value: string) => void;
47
- defaultOpen?: boolean;
48
- className?: string;
55
+ interface SimpleSelectValueProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
56
+ inputClassName?: string;
57
+ onChange?: (value: string) => void;
58
+ defaultOpen?: boolean;
59
+ className?: string;
49
60
  }
50
61
 
51
62
  const SimpleSelectValue = ({
52
- inputClassName,
53
- children,
54
- onChange,
55
- defaultOpen = false,
56
- className,
57
- ...props
63
+ inputClassName,
64
+ children,
65
+ onChange,
66
+ defaultOpen = false,
67
+ className,
68
+ ...props
58
69
  }: SimpleSelectValueProps) => {
59
- const [active, setActive] = useState(defaultOpen);
60
- const sectionRef = useClickOutside(() => setActive(false), () => setActive(true));
61
-
62
- const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
63
- if (onChange) {
64
- onChange(e.target.value);
65
- }
66
- };
67
-
68
- return (
69
- <div
70
- ref={sectionRef as any}
71
- className={cn([
72
- "relative flex justify-between items-center",
73
- "bg-black-alpha-20",
74
- "text-white",
75
- "border-[#2C2D2E]",
76
- active ? "border-[#9748FF] bg-purple-alpha-10" : "",
77
- "hover:border-[#9748FF]",
78
- "hover:bg-purple-alpha-10",
79
- "typography-body-small-regular leading-0",
80
- "border",
81
- "transition-all duration-200 ease-in-out",
82
- "h-[26px]",
83
- "w-fit",
84
- "rounded-[6px]",
85
- "outline-none",
86
- "pl-[8px]",
87
- className,
88
- ])}>
89
- <input
90
- {...props}
91
- onChange={handleInputChange}
92
- className={cn([
93
- "bg-transparent",
94
- "text-content-system-global-primary",
95
- "h-[24px]",
96
- "border-none",
97
- "outline-none",
98
- "typography-body-small-regular leading-0",
99
- ], inputClassName)}
100
- />
101
- <button
102
- type="button"
103
- className="flex items-center"
104
- >
105
- <i className={cn("ri-arrow-down-s-fill text-[12px] text-[#9748FF] px-1", {
106
- "transform rotate-180": active
107
- })}></i>
108
- </button>
109
- {children && active && (
110
- <SimpleSelectDropDown onClick={() => setActive(false)}>
111
- {children}
112
- </SimpleSelectDropDown>
113
- )}
114
- </div>
115
- );
70
+ const [active, setActive] = useState(defaultOpen);
71
+ const sectionRef = useClickOutside<HTMLDivElement>(
72
+ () => setActive(false),
73
+ () => setActive(true),
74
+ );
75
+
76
+ const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
77
+ if (onChange) {
78
+ onChange(e.target.value);
79
+ }
80
+ };
81
+
82
+ return (
83
+ <div
84
+ ref={sectionRef}
85
+ className={cn([
86
+ "relative flex justify-between items-center",
87
+ "bg-black-alpha-20",
88
+ "text-white",
89
+ "border-[#2C2D2E]",
90
+ active ? "border-[#9748FF] bg-purple-alpha-10" : "",
91
+ "hover:border-[#9748FF]",
92
+ "hover:bg-purple-alpha-10",
93
+ "typography-body-small-regular leading-0",
94
+ "border",
95
+ "transition-all duration-200 ease-in-out",
96
+ "h-[26px]",
97
+ "w-fit",
98
+ "rounded-[6px]",
99
+ "outline-none",
100
+ "pl-[8px]",
101
+ className,
102
+ ])}
103
+ >
104
+ <input
105
+ {...props}
106
+ onChange={handleInputChange}
107
+ className={cn(
108
+ [
109
+ "bg-transparent",
110
+ "text-content-system-global-primary",
111
+ "h-[24px]",
112
+ "border-none",
113
+ "outline-none",
114
+ "typography-body-small-regular leading-0",
115
+ ],
116
+ inputClassName,
117
+ )}
118
+ />
119
+ <button type="button" className="flex items-center">
120
+ <i
121
+ className={cn("ri-arrow-down-s-fill text-[12px] text-[#9748FF] px-1", {
122
+ "transform rotate-180": active,
123
+ })}
124
+ ></i>
125
+ </button>
126
+ {children && active && (
127
+ <SimpleSelectDropDown onClick={() => setActive(false)}>{children}</SimpleSelectDropDown>
128
+ )}
129
+ </div>
130
+ );
116
131
  };
117
132
 
118
133
  export { SimpleSelectValue, SimpleSelectItem, SimpleSelectDropDown };
119
134
 
120
135
  export const MenuItemStyles = cva(
121
- [
122
- "text-content-presentation-action-light-primary",
123
- "outline-none",
124
- "border",
125
- "border-transparent",
126
- "flex",
127
- "gap-[8px]",
128
- "items-center",
129
- "justify-start",
130
- "text-overflow",
131
- "overflow-hidden",
132
- "px-[12px]",
133
- "rounded-[4px]",
134
- "transition-all",
135
- "ease-in-out",
136
- "duration-300",
137
- ],
138
- {
139
- variants: {
140
- variant: {
141
- SystemStyle: [
142
- "bg-background-system-body-primary",
143
- "text-content-system-global-primary",
144
- "hover:!bg-background-system-action-secondary-hover",
145
- "hover:!text-content-system-action-primary-hover",
146
- "hover:!border-border-system-action-primary-hover",
147
- "focus:bg-background-system-action-primary-hover",
148
- "focus:border-transparent",
149
- "active:border-transparent",
150
- "active:bg-background-system-action-primary-hover",
151
- "disabled:bg-background-system-body-secondary",
152
- "disabled:text-content-system-global-disabled",
153
- ],
154
- },
155
- size: {
156
- S: ["typography-body-small-regular", "h-[24px]"],
157
- M: ["typography-body-medium-regular", "h-[32px]"],
158
- },
159
-
160
- disabled: {
161
- true: [
162
- "text-content-presentation-state-disabled",
163
- "bg-white-00",
164
- ],
165
- },
166
-
167
- selected: {
168
- true: [
169
- "bg-background-presentation-action-selected",
170
- "text-content-presentation-action-light-primary",
171
- ],
172
- },
173
-
174
- defaultVariants: {
175
- variant: "Default",
176
- size: "M",
177
- active: false,
178
- disabled: false,
179
- },
180
- }
181
- }
136
+ [
137
+ "text-content-presentation-action-light-primary",
138
+ "outline-none",
139
+ "border",
140
+ "border-transparent",
141
+ "flex",
142
+ "gap-[8px]",
143
+ "items-center",
144
+ "justify-start",
145
+ "text-overflow",
146
+ "overflow-hidden",
147
+ "px-[12px]",
148
+ "rounded-[4px]",
149
+ "transition-all",
150
+ "ease-in-out",
151
+ "duration-300",
152
+ ],
153
+ {
154
+ variants: {
155
+ variant: {
156
+ SystemStyle: [
157
+ "bg-background-system-body-primary",
158
+ "text-content-system-global-primary",
159
+ "hover:!bg-background-system-action-secondary-hover",
160
+ "hover:!text-content-system-action-primary-hover",
161
+ "hover:!border-border-system-action-primary-hover",
162
+ "focus:bg-background-system-action-primary-hover",
163
+ "focus:border-transparent",
164
+ "active:border-transparent",
165
+ "active:bg-background-system-action-primary-hover",
166
+ "disabled:bg-background-system-body-secondary",
167
+ "disabled:text-content-system-global-disabled",
168
+ ],
169
+ },
170
+ size: {
171
+ S: ["typography-body-small-regular", "h-[24px]"],
172
+ M: ["typography-body-medium-regular", "h-[32px]"],
173
+ },
174
+
175
+ disabled: {
176
+ true: ["text-content-presentation-state-disabled", "bg-white-00"],
177
+ },
178
+
179
+ selected: {
180
+ true: [
181
+ "bg-background-presentation-action-selected",
182
+ "text-content-presentation-action-light-primary",
183
+ ],
184
+ },
185
+
186
+ defaultVariants: {
187
+ variant: "Default",
188
+ size: "M",
189
+ active: false,
190
+ disabled: false,
191
+ },
192
+ },
193
+ },
182
194
  );
183
195
 
184
196
  export const dropdownMenuStyles = cva(
185
- [
186
- "p-1",
187
- "rounded-[8px]",
188
- "border",
189
- "max-h-[200px]",
190
- "outline-none",
191
- "overflow-scroll",
192
- "data-[state=open]:animate-in",
193
- "data-[state=closed]:animate-out",
194
- "data-[state=closed]:fade-out-0",
195
- "data-[state=open]:fade-in-0",
196
- "overflow-x-hidden",
197
- "scrollbar-hide",
198
- ],
199
- {
200
- variants: {
201
- variant: {
202
- SystemStyle: [
203
- "border-border-system-global-secondary",
204
- "bg-background-system-body-primary",
205
- "shadow-[0px_0px_18px_0px_rgba(0,0,0,0.75)]",
206
- ]
207
- },
208
- defaultVariants: {
209
- variant: "SystemStyle",
210
- },
211
- },
212
- }
197
+ [
198
+ "p-1",
199
+ "rounded-[8px]",
200
+ "border",
201
+ "max-h-[200px]",
202
+ "outline-none",
203
+ "overflow-scroll",
204
+ "data-[state=open]:animate-in",
205
+ "data-[state=closed]:animate-out",
206
+ "data-[state=closed]:fade-out-0",
207
+ "data-[state=open]:fade-in-0",
208
+ "overflow-x-hidden",
209
+ "scrollbar-hide",
210
+ ],
211
+ {
212
+ variants: {
213
+ variant: {
214
+ SystemStyle: [
215
+ "border-border-system-global-secondary",
216
+ "bg-background-system-body-primary",
217
+ "shadow-[0px_0px_18px_0px_rgba(0,0,0,0.75)]",
218
+ ],
219
+ },
220
+ defaultVariants: {
221
+ variant: "SystemStyle",
222
+ },
223
+ },
224
+ },
213
225
  );
214
-
215
-
216
-