torch-glare 2.5.5 → 2.6.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 (359) hide show
  1. package/README.md +4 -3
  2. package/dist/bin/index.js +9 -24
  3. package/dist/bin/index.js.map +1 -1
  4. package/dist/src/commands/add.d.ts +2 -2
  5. package/dist/src/commands/add.d.ts.map +1 -1
  6. package/dist/src/commands/add.js +4 -70
  7. package/dist/src/commands/add.js.map +1 -1
  8. package/dist/src/commands/hook.d.ts +5 -4
  9. package/dist/src/commands/hook.d.ts.map +1 -1
  10. package/dist/src/commands/hook.js +7 -75
  11. package/dist/src/commands/hook.js.map +1 -1
  12. package/dist/src/commands/init.js +1 -1
  13. package/dist/src/commands/init.js.map +1 -1
  14. package/dist/src/commands/layout.d.ts +5 -4
  15. package/dist/src/commands/layout.d.ts.map +1 -1
  16. package/dist/src/commands/layout.js +7 -75
  17. package/dist/src/commands/layout.js.map +1 -1
  18. package/dist/src/commands/provider.d.ts +5 -4
  19. package/dist/src/commands/provider.d.ts.map +1 -1
  20. package/dist/src/commands/provider.js +7 -75
  21. package/dist/src/commands/provider.js.map +1 -1
  22. package/dist/src/commands/update.d.ts.map +1 -1
  23. package/dist/src/commands/update.js +78 -43
  24. package/dist/src/commands/update.js.map +1 -1
  25. package/dist/src/commands/utils.d.ts +5 -4
  26. package/dist/src/commands/utils.d.ts.map +1 -1
  27. package/dist/src/commands/utils.js +7 -80
  28. package/dist/src/commands/utils.js.map +1 -1
  29. package/dist/src/shared/addFromRegistry.d.ts +16 -0
  30. package/dist/src/shared/addFromRegistry.d.ts.map +1 -0
  31. package/dist/src/shared/addFromRegistry.js +88 -0
  32. package/dist/src/shared/addFromRegistry.js.map +1 -0
  33. package/dist/src/shared/getInstallCommand.d.ts.map +1 -1
  34. package/dist/src/shared/getInstallCommand.js +5 -0
  35. package/dist/src/shared/getInstallCommand.js.map +1 -1
  36. package/dist/src/shared/installDependencies.d.ts +0 -10
  37. package/dist/src/shared/installDependencies.d.ts.map +1 -1
  38. package/dist/src/shared/installDependencies.js +0 -17
  39. package/dist/src/shared/installDependencies.js.map +1 -1
  40. package/dist/src/shared/installFromPlan.d.ts +7 -5
  41. package/dist/src/shared/installFromPlan.d.ts.map +1 -1
  42. package/dist/src/shared/installFromPlan.js +103 -36
  43. package/dist/src/shared/installFromPlan.js.map +1 -1
  44. package/dist/src/shared/loadRegistry.d.ts +12 -3
  45. package/dist/src/shared/loadRegistry.d.ts.map +1 -1
  46. package/dist/src/shared/loadRegistry.js +19 -20
  47. package/dist/src/shared/loadRegistry.js.map +1 -1
  48. package/dist/src/shared/registryClient.d.ts +19 -0
  49. package/dist/src/shared/registryClient.d.ts.map +1 -0
  50. package/dist/src/shared/registryClient.js +128 -0
  51. package/dist/src/shared/registryClient.js.map +1 -0
  52. package/dist/src/shared/resolveEntry.d.ts +10 -7
  53. package/dist/src/shared/resolveEntry.d.ts.map +1 -1
  54. package/dist/src/shared/resolveEntry.js +18 -13
  55. package/dist/src/shared/resolveEntry.js.map +1 -1
  56. package/dist/src/shared/suggestOtherCommand.d.ts +7 -1
  57. package/dist/src/shared/suggestOtherCommand.d.ts.map +1 -1
  58. package/dist/src/shared/suggestOtherCommand.js +29 -23
  59. package/dist/src/shared/suggestOtherCommand.js.map +1 -1
  60. package/dist/src/types/main.d.ts +31 -2
  61. package/dist/src/types/main.d.ts.map +1 -1
  62. package/package.json +6 -11
  63. package/apps/lib/components/ActionButton.tsx +0 -93
  64. package/apps/lib/components/ActionsGroup.tsx +0 -27
  65. package/apps/lib/components/AlertDialog.tsx +0 -204
  66. package/apps/lib/components/Avatar.tsx +0 -46
  67. package/apps/lib/components/Badge.tsx +0 -250
  68. package/apps/lib/components/BadgeField.tsx +0 -338
  69. package/apps/lib/components/Breadcrumb.tsx +0 -280
  70. package/apps/lib/components/Button.tsx +0 -317
  71. package/apps/lib/components/ButtonGroup.tsx +0 -190
  72. package/apps/lib/components/Calendar.tsx +0 -115
  73. package/apps/lib/components/Card.tsx +0 -95
  74. package/apps/lib/components/Checkbox.tsx +0 -42
  75. package/apps/lib/components/ColorPicker.tsx +0 -441
  76. package/apps/lib/components/ConclusionHeader.tsx +0 -148
  77. package/apps/lib/components/ContextMenu.tsx +0 -571
  78. package/apps/lib/components/CountBadge.tsx +0 -52
  79. package/apps/lib/components/DataTable.tsx +0 -213
  80. package/apps/lib/components/DataViews/badge.ts +0 -49
  81. package/apps/lib/components/DataViews/cell.tsx +0 -324
  82. package/apps/lib/components/DataViews/context.ts +0 -144
  83. package/apps/lib/components/DataViews/data-views.tsx +0 -383
  84. package/apps/lib/components/DataViews/filters/children.tsx +0 -98
  85. package/apps/lib/components/DataViews/filters/custom.tsx +0 -34
  86. package/apps/lib/components/DataViews/filters/filters.tsx +0 -157
  87. package/apps/lib/components/DataViews/filters/index.ts +0 -4
  88. package/apps/lib/components/DataViews/filters/labelled.tsx +0 -20
  89. package/apps/lib/components/DataViews/filters/presets.tsx +0 -65
  90. package/apps/lib/components/DataViews/filters/sync.tsx +0 -35
  91. package/apps/lib/components/DataViews/filters/values.ts +0 -173
  92. package/apps/lib/components/DataViews/header.tsx +0 -220
  93. package/apps/lib/components/DataViews/hooks/index.ts +0 -5
  94. package/apps/lib/components/DataViews/hooks/useActiveRow.ts +0 -22
  95. package/apps/lib/components/DataViews/hooks/useControllable.ts +0 -52
  96. package/apps/lib/components/DataViews/index.ts +0 -84
  97. package/apps/lib/components/DataViews/panel/columns.tsx +0 -153
  98. package/apps/lib/components/DataViews/panel/controls.tsx +0 -106
  99. package/apps/lib/components/DataViews/panel/index.ts +0 -3
  100. package/apps/lib/components/DataViews/panel/panel.tsx +0 -164
  101. package/apps/lib/components/DataViews/panel/saved-views.tsx +0 -67
  102. package/apps/lib/components/DataViews/panel/section.tsx +0 -81
  103. package/apps/lib/components/DataViews/panel/sort.tsx +0 -42
  104. package/apps/lib/components/DataViews/panel/tab.tsx +0 -31
  105. package/apps/lib/components/DataViews/slots.ts +0 -63
  106. package/apps/lib/components/DataViews/states.tsx +0 -38
  107. package/apps/lib/components/DataViews/types.ts +0 -510
  108. package/apps/lib/components/DataViews/views/board-view.tsx +0 -381
  109. package/apps/lib/components/DataViews/views/card-rows.tsx +0 -36
  110. package/apps/lib/components/DataViews/views/inbox-view.tsx +0 -260
  111. package/apps/lib/components/DataViews/views/pane-views.tsx +0 -196
  112. package/apps/lib/components/DataViews/views/table-view.tsx +0 -493
  113. package/apps/lib/components/DataViews/views/tree-view.tsx +0 -367
  114. package/apps/lib/components/DatePicker.tsx +0 -232
  115. package/apps/lib/components/Dialog.tsx +0 -116
  116. package/apps/lib/components/Divider.tsx +0 -28
  117. package/apps/lib/components/Drawer.tsx +0 -420
  118. package/apps/lib/components/DropdownMenu.tsx +0 -540
  119. package/apps/lib/components/FieldHint.tsx +0 -69
  120. package/apps/lib/components/Form.tsx +0 -182
  121. package/apps/lib/components/FormBuilder/context.ts +0 -73
  122. package/apps/lib/components/FormBuilder/field-kind.ts +0 -28
  123. package/apps/lib/components/FormBuilder/fields/ChoiceFields.tsx +0 -60
  124. package/apps/lib/components/FormBuilder/fields/ColorField.tsx +0 -59
  125. package/apps/lib/components/FormBuilder/fields/CustomField.tsx +0 -11
  126. package/apps/lib/components/FormBuilder/fields/DateField.tsx +0 -32
  127. package/apps/lib/components/FormBuilder/fields/FieldArray.tsx +0 -74
  128. package/apps/lib/components/FormBuilder/fields/FieldShell.tsx +0 -163
  129. package/apps/lib/components/FormBuilder/fields/FileField.tsx +0 -39
  130. package/apps/lib/components/FormBuilder/fields/OptionListFields.tsx +0 -132
  131. package/apps/lib/components/FormBuilder/fields/OtpField.tsx +0 -31
  132. package/apps/lib/components/FormBuilder/fields/PhoneField.tsx +0 -109
  133. package/apps/lib/components/FormBuilder/fields/RichTextEditorField.tsx +0 -31
  134. package/apps/lib/components/FormBuilder/fields/SelectField.tsx +0 -91
  135. package/apps/lib/components/FormBuilder/fields/SignatureField.tsx +0 -157
  136. package/apps/lib/components/FormBuilder/fields/SliderField.tsx +0 -67
  137. package/apps/lib/components/FormBuilder/fields/SwitchBoxField.tsx +0 -41
  138. package/apps/lib/components/FormBuilder/fields/TableField.tsx +0 -336
  139. package/apps/lib/components/FormBuilder/fields/TextField.tsx +0 -213
  140. package/apps/lib/components/FormBuilder/fields/TreeSelectField.tsx +0 -43
  141. package/apps/lib/components/FormBuilder/fields/countries.ts +0 -303
  142. package/apps/lib/components/FormBuilder/fields/index.ts +0 -25
  143. package/apps/lib/components/FormBuilder/form-builder.tsx +0 -198
  144. package/apps/lib/components/FormBuilder/index.ts +0 -31
  145. package/apps/lib/components/FormBuilder/numberFormat.ts +0 -16
  146. package/apps/lib/components/FormBuilder/submit.tsx +0 -47
  147. package/apps/lib/components/FormBuilder/types.ts +0 -311
  148. package/apps/lib/components/FormRenderer/FormDrawer.tsx +0 -128
  149. package/apps/lib/components/FormRenderer/detail.tsx +0 -207
  150. package/apps/lib/components/FormRenderer/form-renderer.tsx +0 -297
  151. package/apps/lib/components/FormRenderer/header.tsx +0 -88
  152. package/apps/lib/components/FormRenderer/index.ts +0 -15
  153. package/apps/lib/components/FormRenderer/section.tsx +0 -39
  154. package/apps/lib/components/FormRenderer/stepper.tsx +0 -339
  155. package/apps/lib/components/FormRenderer/types.ts +0 -78
  156. package/apps/lib/components/FormSummary.tsx +0 -282
  157. package/apps/lib/components/HeaderBar.tsx +0 -117
  158. package/apps/lib/components/ImageAttachment.tsx +0 -209
  159. package/apps/lib/components/InnerLabelField.tsx +0 -154
  160. package/apps/lib/components/Input.tsx +0 -224
  161. package/apps/lib/components/InputField.tsx +0 -147
  162. package/apps/lib/components/InputOTP.tsx +0 -84
  163. package/apps/lib/components/Label.tsx +0 -129
  164. package/apps/lib/components/LabelField.tsx +0 -76
  165. package/apps/lib/components/LabeledCheckBox.tsx +0 -51
  166. package/apps/lib/components/LabeledRadio.tsx +0 -51
  167. package/apps/lib/components/LinkButton.tsx +0 -94
  168. package/apps/lib/components/LoginButton.tsx +0 -51
  169. package/apps/lib/components/PasswordLevel.tsx +0 -58
  170. package/apps/lib/components/Popover.tsx +0 -312
  171. package/apps/lib/components/ProfileMenu.tsx +0 -85
  172. package/apps/lib/components/Radio.tsx +0 -59
  173. package/apps/lib/components/RadioCard.tsx +0 -50
  174. package/apps/lib/components/ScrollArea.tsx +0 -54
  175. package/apps/lib/components/SearchField.tsx +0 -62
  176. package/apps/lib/components/SearchableSelect.tsx +0 -318
  177. package/apps/lib/components/SearchableTable.tsx +0 -344
  178. package/apps/lib/components/SearchableTree.tsx +0 -485
  179. package/apps/lib/components/SearchableTreeDialog.tsx +0 -502
  180. package/apps/lib/components/SectionBlock.tsx +0 -147
  181. package/apps/lib/components/Select.tsx +0 -347
  182. package/apps/lib/components/SimpleSelect.tsx +0 -225
  183. package/apps/lib/components/Skeleton.tsx +0 -12
  184. package/apps/lib/components/SlideDatePicker.tsx +0 -253
  185. package/apps/lib/components/SpinLoading.tsx +0 -174
  186. package/apps/lib/components/Stepper.tsx +0 -480
  187. package/apps/lib/components/Switch.tsx +0 -82
  188. package/apps/lib/components/TabFormItem.tsx +0 -153
  189. package/apps/lib/components/TabSwitch.tsx +0 -172
  190. package/apps/lib/components/Table.tsx +0 -610
  191. package/apps/lib/components/TextEditor/ChartBlockTool.ts +0 -676
  192. package/apps/lib/components/TextEditor/RichTextField.tsx +0 -46
  193. package/apps/lib/components/TextEditor/TableDnDWrapper.ts +0 -462
  194. package/apps/lib/components/TextEditor/TextEditor.tsx +0 -1164
  195. package/apps/lib/components/TextEditor/TextEditorToolbar.tsx +0 -429
  196. package/apps/lib/components/TextEditor/editor-tools/AlignmentTune.ts +0 -70
  197. package/apps/lib/components/TextEditor/editor-tools/ColorInlineTool.ts +0 -50
  198. package/apps/lib/components/TextEditor/editor-tools/StrikethroughInlineTool.ts +0 -48
  199. package/apps/lib/components/TextEditor/editor-tools/inlineFormat.ts +0 -98
  200. package/apps/lib/components/TextEditor/editorjs.d.ts +0 -60
  201. package/apps/lib/components/TextEditor/index.ts +0 -7
  202. package/apps/lib/components/TextEditor/markdownParser.ts +0 -346
  203. package/apps/lib/components/Textarea.tsx +0 -117
  204. package/apps/lib/components/Timeline.tsx +0 -263
  205. package/apps/lib/components/Toast.tsx +0 -87
  206. package/apps/lib/components/Toggle.tsx +0 -125
  207. package/apps/lib/components/ToggleButton.tsx +0 -140
  208. package/apps/lib/components/Tooltip.tsx +0 -116
  209. package/apps/lib/components/TransparentLabel.tsx +0 -71
  210. package/apps/lib/components/TreeDropDown.tsx +0 -115
  211. package/apps/lib/components/TreeFolder/TreeFolder.tsx +0 -380
  212. package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +0 -75
  213. package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +0 -354
  214. package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +0 -60
  215. package/apps/lib/components/TreeFolder/icons.tsx +0 -60
  216. package/apps/lib/components/TreeFolder/index.ts +0 -24
  217. package/apps/lib/components/TreeFolder/treeFolderUtils.ts +0 -109
  218. package/apps/lib/components/TreeFolder/types.ts +0 -77
  219. package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +0 -118
  220. package/apps/lib/hooks/useActiveTreeItem.ts +0 -58
  221. package/apps/lib/hooks/useClickOutside.ts +0 -27
  222. package/apps/lib/hooks/useDragDrop.tsx +0 -365
  223. package/apps/lib/hooks/useInfiniteScroll.ts +0 -108
  224. package/apps/lib/hooks/useIsMobile.ts +0 -21
  225. package/apps/lib/hooks/useResize.ts +0 -67
  226. package/apps/lib/hooks/useTagSelection.ts +0 -214
  227. package/apps/lib/layouts/CNLayout.tsx +0 -372
  228. package/apps/lib/layouts/DataViewCard.tsx +0 -62
  229. package/apps/lib/layouts/FieldSection.tsx +0 -91
  230. package/apps/lib/layouts/TreeSubLayout.tsx +0 -173
  231. package/apps/lib/providers/ThemeProvider.tsx +0 -84
  232. package/apps/lib/registry.json +0 -1201
  233. package/apps/lib/tsconfig.json +0 -9
  234. package/apps/lib/tsconfig.tsbuildinfo +0 -1
  235. package/apps/lib/utils/cn.ts +0 -6
  236. package/apps/lib/utils/color.ts +0 -175
  237. package/apps/lib/utils/dataViews/path.ts +0 -67
  238. package/apps/lib/utils/dataViews/query.ts +0 -73
  239. package/apps/lib/utils/dataViews/types.ts +0 -187
  240. package/apps/lib/utils/dateFormat.ts +0 -108
  241. package/apps/lib/utils/resize.ts +0 -31
  242. package/apps/lib/utils/types.ts +0 -16
  243. package/docs/BLOCKS.md +0 -129
  244. package/docs/CHANGELOG-1.1.16.md +0 -108
  245. package/docs/Cover.png +0 -0
  246. package/docs/README.md +0 -215
  247. package/docs/components/action-button.md +0 -638
  248. package/docs/components/actions-group.md +0 -708
  249. package/docs/components/alert-dialog.md +0 -920
  250. package/docs/components/avatar.md +0 -709
  251. package/docs/components/badge-field.md +0 -712
  252. package/docs/components/badge.md +0 -301
  253. package/docs/components/breadcrumb.md +0 -930
  254. package/docs/components/button-group.md +0 -650
  255. package/docs/components/button.md +0 -639
  256. package/docs/components/calendar.md +0 -555
  257. package/docs/components/card.md +0 -622
  258. package/docs/components/chart-block-tool.md +0 -129
  259. package/docs/components/checkbox.md +0 -699
  260. package/docs/components/cn-layout.md +0 -854
  261. package/docs/components/color-picker.md +0 -101
  262. package/docs/components/conclusion-header.md +0 -80
  263. package/docs/components/context-menu.md +0 -483
  264. package/docs/components/count-badge.md +0 -560
  265. package/docs/components/data-table.md +0 -854
  266. package/docs/components/data-views/backend-response.md +0 -324
  267. package/docs/components/data-views/examples/a11y-rtl.md +0 -250
  268. package/docs/components/data-views/examples/api-orders-route.md +0 -130
  269. package/docs/components/data-views/examples/fields.md +0 -362
  270. package/docs/components/data-views/examples/filters.md +0 -307
  271. package/docs/components/data-views/examples/inbox-routing.md +0 -218
  272. package/docs/components/data-views/examples/index.md +0 -29
  273. package/docs/components/data-views/examples/overview.md +0 -244
  274. package/docs/components/data-views/examples/panel.md +0 -212
  275. package/docs/components/data-views/examples/scale.md +0 -231
  276. package/docs/components/data-views/examples/server-side.md +0 -210
  277. package/docs/components/data-views/examples/state.md +0 -250
  278. package/docs/components/data-views/examples/tree-custom.md +0 -388
  279. package/docs/components/data-views/examples/view-registry.md +0 -313
  280. package/docs/components/data-views/examples/views.md +0 -534
  281. package/docs/components/data-views/guide.md +0 -405
  282. package/docs/components/data-views/index.md +0 -1495
  283. package/docs/components/data-views/migration.md +0 -79
  284. package/docs/components/date-picker.md +0 -857
  285. package/docs/components/dialog.md +0 -929
  286. package/docs/components/divider.md +0 -766
  287. package/docs/components/drawer.md +0 -654
  288. package/docs/components/dropdown-menu.md +0 -668
  289. package/docs/components/field-hint.md +0 -898
  290. package/docs/components/field-section.md +0 -781
  291. package/docs/components/form-builder.md +0 -276
  292. package/docs/components/form-renderer.md +0 -326
  293. package/docs/components/form-summary.md +0 -138
  294. package/docs/components/form.md +0 -785
  295. package/docs/components/header-bar.md +0 -188
  296. package/docs/components/image-attachment.md +0 -906
  297. package/docs/components/inner-label-field.md +0 -819
  298. package/docs/components/input-field.md +0 -623
  299. package/docs/components/input-otp.md +0 -756
  300. package/docs/components/input.md +0 -634
  301. package/docs/components/label-field.md +0 -770
  302. package/docs/components/label.md +0 -761
  303. package/docs/components/labeled-check-box.md +0 -642
  304. package/docs/components/labeled-radio.md +0 -796
  305. package/docs/components/link-button.md +0 -685
  306. package/docs/components/login-button.md +0 -872
  307. package/docs/components/password-level.md +0 -803
  308. package/docs/components/popover.md +0 -649
  309. package/docs/components/profile-menu.md +0 -656
  310. package/docs/components/radio-card.md +0 -801
  311. package/docs/components/radio.md +0 -735
  312. package/docs/components/scroll-area.md +0 -691
  313. package/docs/components/search-field.md +0 -702
  314. package/docs/components/searchable-select.md +0 -368
  315. package/docs/components/searchable-table.md +0 -438
  316. package/docs/components/searchable-tree-dialog.md +0 -190
  317. package/docs/components/searchable-tree.md +0 -200
  318. package/docs/components/section-block.md +0 -477
  319. package/docs/components/select.md +0 -709
  320. package/docs/components/simple-select.md +0 -741
  321. package/docs/components/skeleton.md +0 -706
  322. package/docs/components/slide-date-picker.md +0 -837
  323. package/docs/components/spin-loading.md +0 -696
  324. package/docs/components/stepper.md +0 -316
  325. package/docs/components/switch.md +0 -770
  326. package/docs/components/tab-form-item.md +0 -773
  327. package/docs/components/tab-switch.md +0 -170
  328. package/docs/components/table-dnd-wrapper.md +0 -107
  329. package/docs/components/table.md +0 -1088
  330. package/docs/components/text-editor.md +0 -735
  331. package/docs/components/textarea.md +0 -681
  332. package/docs/components/timeline.md +0 -254
  333. package/docs/components/toast.md +0 -773
  334. package/docs/components/toggle-button.md +0 -643
  335. package/docs/components/toggle.md +0 -882
  336. package/docs/components/tooltip.md +0 -513
  337. package/docs/components/transparent-label.md +0 -721
  338. package/docs/components/tree-drop-down.md +0 -740
  339. package/docs/components/tree-folder.md +0 -110
  340. package/docs/components/tree-sub-layout.md +0 -707
  341. package/docs/explanation/architecture.md +0 -54
  342. package/docs/explanation/design-system.md +0 -52
  343. package/docs/how-to/form-and-list-recipes.md +0 -386
  344. package/docs/how-to/forms-with-form-builder.md +0 -472
  345. package/docs/how-to/guides.md +0 -1027
  346. package/docs/migration/changelog.md +0 -54
  347. package/docs/migration/form-builder-2.5.2.md +0 -113
  348. package/docs/reference/cli.md +0 -112
  349. package/docs/reference/components.md +0 -572
  350. package/docs/reference/hooks.md +0 -1500
  351. package/docs/reference/providers.md +0 -866
  352. package/docs/reference/tailwind-plugins.md +0 -942
  353. package/docs/reference/theme.md +0 -85
  354. package/docs/reference/types.md +0 -1016
  355. package/docs/reference/utilities.md +0 -704
  356. package/docs/tutorials/building-first-form.md +0 -846
  357. package/docs/tutorials/component-composition.md +0 -882
  358. package/docs/tutorials/getting-started.md +0 -302
  359. package/docs/tutorials/theming-basics.md +0 -785
@@ -1,347 +0,0 @@
1
- "use client";
2
- import React from "react";
3
- import * as SelectPrimitive from "@radix-ui/react-select";
4
- import { cn } from "../utils/cn";
5
- import { cva, VariantProps } from "class-variance-authority";
6
- import { ActionButton } from "./ActionButton";
7
- import { MenuItemStyles } from "./DropdownMenu";
8
- import { Themes } from "../utils/types";
9
-
10
- const Select = SelectPrimitive.Root;
11
-
12
- const SelectGroup = SelectPrimitive.Group;
13
-
14
- const SelectValue = SelectPrimitive.Value;
15
-
16
- const SelectTrigger = React.forwardRef<
17
- React.ElementRef<typeof SelectPrimitive.Trigger>,
18
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &
19
- VariantProps<typeof PopoverTriggerStyles> & {
20
- /** Marks the trigger invalid: any non-undefined value turns on the negative border. */
21
- errors?: string;
22
- icon?: string;
23
- theme?: Themes;
24
- }
25
- >(
26
- (
27
- {
28
- className,
29
- children,
30
- size = "M",
31
- variant = "PresentationStyle",
32
- errors,
33
- theme,
34
- icon,
35
- onTable,
36
- ...props
37
- },
38
- ref,
39
- ) => {
40
- return (
41
- <SelectPrimitive.Trigger
42
- data-theme={theme}
43
- ref={ref}
44
- className={cn(
45
- PopoverTriggerStyles({
46
- size,
47
- variant,
48
- error: errors !== undefined,
49
- onTable,
50
- }),
51
- className,
52
- )}
53
- {...props}
54
- >
55
- <p
56
- className={cn({
57
- "[&_span]:text-[#A0A0A0]": !props.value,
58
- })}
59
- >
60
- {children}
61
- </p>
62
-
63
- {/* The shared in-field action button. Its box tracks the trigger height the same way
64
- InputField's does — a 30px field takes the 22px button, a 40px field the 32px one. */}
65
- <ActionButton
66
- as={"span"}
67
- size={size === "XL" ? "M" : size === "S" ? "XS" : "S"}
68
- className={cn([
69
- "group-aria-expanded:bg-background-presentation-action-hover",
70
- "group-aria-expanded:text-white",
71
- ])}
72
- >
73
- <i
74
- className={cn(
75
- "ri-arrow-down-s-line transition-all duration-100 ease-in-out group-aria-expanded:rotate-180",
76
- { "!text-[12px]": size === "S" },
77
- { "!text-[16px]": size === "M" },
78
- { "!text-[18px]": size === "L" },
79
- { "!text-[26px]": size === "XL" },
80
- { icon: icon },
81
- )}
82
- />
83
- </ActionButton>
84
- </SelectPrimitive.Trigger>
85
- );
86
- },
87
- );
88
- SelectTrigger.displayName = "SelectTrigger";
89
-
90
- const SelectScrollUpButton = React.forwardRef<
91
- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
92
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
93
- >(({ className, ...props }, ref) => (
94
- <SelectPrimitive.ScrollUpButton
95
- ref={ref}
96
- className={cn("flex cursor-default items-center justify-center py-1 ", className)}
97
- {...props}
98
- >
99
- <i
100
- className="h-4 w-4 ri-arrow-up-s-line"
101
- color={"var(--content-presentation-action-light-primary)"}
102
- />
103
- </SelectPrimitive.ScrollUpButton>
104
- ));
105
- SelectScrollUpButton.displayName = "SelectScrollUpButton";
106
-
107
- const SelectScrollDownButton = React.forwardRef<
108
- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
109
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
110
- >(({ className, ...props }, ref) => (
111
- <SelectPrimitive.ScrollDownButton
112
- ref={ref}
113
- className={cn("flex cursor-default items-center justify-center py-1", className)}
114
- {...props}
115
- >
116
- <i
117
- color={"var(--content-presentation-action-light-primary)"}
118
- className="h-4 w-4 ri-arrow-down-s-line"
119
- />
120
- </SelectPrimitive.ScrollDownButton>
121
- ));
122
- SelectScrollDownButton.displayName = "SelectScrollDownButton";
123
-
124
- const SelectContent = React.forwardRef<
125
- React.ElementRef<typeof SelectPrimitive.Content>,
126
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> &
127
- VariantProps<typeof SelectContentStyles> & {
128
- theme?: Themes;
129
- }
130
- >(
131
- (
132
- { className, children, variant = "PresentationStyle", position = "popper", theme, ...props },
133
- ref,
134
- ) => (
135
- <SelectPrimitive.Portal>
136
- <SelectPrimitive.Content
137
- data-theme={theme}
138
- ref={ref}
139
- className={cn(SelectContentStyles({ variant }), className)}
140
- position={position}
141
- // Never taller than 368px, and never taller than the space Radix has on screen. Valid because
142
- // `position` defaults to "popper", which is what publishes the variable.
143
- style={{
144
- maxHeight: "min(368px, var(--radix-select-content-available-height, 100vh))",
145
- ...props.style,
146
- }}
147
- {...props}
148
- >
149
- {/* Dedicated scroll viewport + boxed group, matching SearchableSelect's menu surface.
150
- `flex-1 min-h-0` is what makes it scroll: without `min-h-0` a flex item refuses to shrink
151
- below its content, so the list grew past the panel and `overflow-hidden` simply clipped
152
- the rows off with no scrollbar. */}
153
- <SelectPrimitive.Viewport className="flex-1 min-h-0 overflow-y-auto overflow-x-hidden rounded-[10px] scrollbar-hide">
154
- <div className="flex flex-col gap-[1px] overflow-hidden rounded-[10px]">{children}</div>
155
- </SelectPrimitive.Viewport>
156
- </SelectPrimitive.Content>
157
- </SelectPrimitive.Portal>
158
- ),
159
- );
160
- SelectContent.displayName = "SelectContent";
161
-
162
- const SelectLabel = React.forwardRef<
163
- React.ElementRef<typeof SelectPrimitive.Label>,
164
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
165
- >(({ className, ...props }, ref) => (
166
- <SelectPrimitive.Label
167
- ref={ref}
168
- className={cn("px-2 py-1.5 text-sm font-semibold", className)}
169
- {...props}
170
- />
171
- ));
172
- SelectLabel.displayName = "SelectLabel";
173
-
174
- const SelectItem = React.forwardRef<
175
- React.ElementRef<typeof SelectPrimitive.Item>,
176
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & VariantProps<typeof MenuItemStyles>
177
- >(({ className, children, size = "M", variant = "Default", active, ...props }, ref) => (
178
- // Same structure as DropdownMenuItem / SearchableSelect: MenuItemStyles on the element
179
- // + a single inner <div> the styles target via [&>div], and a check on the selected row.
180
- <SelectPrimitive.Item
181
- ref={ref}
182
- className={cn(MenuItemStyles({ variant, active, size }), "shrink-0", className)}
183
- {...props}
184
- >
185
- <div>
186
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
187
- <SelectPrimitive.ItemIndicator className="ms-auto flex shrink-0">
188
- <i className="ri-check-line text-[16px]" />
189
- </SelectPrimitive.ItemIndicator>
190
- </div>
191
- </SelectPrimitive.Item>
192
- ));
193
-
194
- SelectItem.displayName = "SelectItem";
195
-
196
- const SelectSeparator = React.forwardRef<
197
- React.ElementRef<typeof SelectPrimitive.Separator>,
198
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
199
- >(({ className, ...props }, ref) => (
200
- <SelectPrimitive.Separator
201
- ref={ref}
202
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
203
- {...props}
204
- />
205
- ));
206
- SelectSeparator.displayName = "SelectSeparator";
207
-
208
- export {
209
- Select,
210
- SelectGroup,
211
- SelectValue,
212
- SelectTrigger,
213
- SelectContent,
214
- SelectLabel,
215
- SelectItem,
216
- SelectSeparator,
217
- SelectScrollUpButton,
218
- SelectScrollDownButton,
219
- };
220
-
221
- // NOTE: radix select as DropDownButton
222
-
223
- // Panel surface mirrors SearchableSelect's `menuContentStyles` (translucent, backdrop-blurred,
224
- // borderless, rounded-14). `min-w`/`z-index` are kept for the Radix Select portal.
225
- const SelectContentStyles = cva(
226
- [
227
- "p-1",
228
- "rounded-[14px]",
229
- // Match the dropdown to the trigger's width (Radix popper exposes it as a CSS var),
230
- // but never narrower than 240px.
231
- "w-[var(--radix-select-trigger-width)]",
232
- "min-w-[240px]",
233
- "border-0",
234
- "outline-none",
235
- "overflow-hidden",
236
- "backdrop-blur-[21px]",
237
- "flex flex-col gap-1",
238
- "data-[state=open]:animate-in",
239
- "data-[state=open]:fade-in-0",
240
- "z-[1000]",
241
- // Panel height is set inline below from `min(368px, available-height)`; the class is kept off
242
- // deliberately so the inline value governs.
243
- ],
244
- {
245
- variants: {
246
- variant: {
247
- SystemStyle: [
248
- "bg-background-system-body-primary",
249
- "shadow-[0px_0px_18px_0px_rgba(0,0,0,0.75)]",
250
- ],
251
- PresentationStyle: [
252
- "bg-[rgba(61,64,69,0.72)]",
253
- "shadow-[0_0_32px_2px_rgba(0,0,0,0.20),0_0_48px_2px_rgba(0,0,0,0.05)]",
254
- ],
255
- },
256
- defaultVariants: {
257
- variant: "PresentationStyle",
258
- },
259
- },
260
- },
261
- );
262
-
263
- const PopoverTriggerStyles = cva(
264
- [
265
- // No radius here — every `size` variant sets its own. `twMerge` does NOT dedupe the
266
- // `rounded-radius-*` classes (they are custom scale keys, not values it recognises), so a
267
- // radius on the base would survive alongside the variant's and let CSS source order pick the
268
- // winner: `md` is generated before `lg`, so a base `lg` would silently beat size S's `md`.
269
- "flex flex-row justify-between items-center outline-none",
270
- "[&_span]:text-content-presentation-action-light-primary",
271
- "typography-body-small-regular",
272
- "[&_p]:px-[10px] [&_p]:whitespace-nowrap",
273
- "group",
274
- "w-fit",
275
- "border",
276
- "transition-all duration-200 ease-in-out",
277
- "hover:shadow-[0px_1px_6px_0px_rgba(0,0,0,0.30)]",
278
- "focus:shadow-[0px_1px_6px_0px_rgba(0,0,0,0.30)]",
279
- ],
280
- {
281
- variants: {
282
- variant: {
283
- PresentationStyle: [
284
- "bg-background-presentation-form-field-primary",
285
- "border-border-presentation-action-primary",
286
- "hover:bg-background-presentation-form-field-hover",
287
- "hover:border-border-presentation-action-hover",
288
- "focus:bg-background-presentation-form-field-hover",
289
- "focus:border-border-presentation-state-focus",
290
- ],
291
- SystemStyle: [
292
- "bg-black-alpha-20",
293
- "text-white",
294
- "border-[#2C2D2E]",
295
- "hover:border-[#9748FF]",
296
- "hover:bg-purple-alpha-10",
297
- "focus:border-[#9748FF]",
298
- "focus:bg-purple-alpha-10",
299
- ],
300
- },
301
- error: {
302
- true: [
303
- "border-border-presentation-state-negative",
304
- "caret-border-presentation-state-negative",
305
- "hover:border-border-presentation-state-negative",
306
- "hover:caret-border-presentation-state-negative",
307
- ],
308
- },
309
- // Transparent border/background so the trigger blends into a table cell. The hover and
310
- // focus shadows are deliberately left alone — a cell control lifts exactly like any
311
- // other field.
312
- onTable: {
313
- true: ["border-transparent", "bg-transparent"],
314
- },
315
- // No `[&_span]:h-/w-` here: the chevron is an `ActionButton` and sizes itself from its own
316
- // `size` prop. Those descendant rules used to force its box, and being descendant selectors
317
- // they outranked the button's own classes — they also hit the SelectValue text span, which
318
- // only escaped being squashed because an inline element ignores width/height.
319
- size: {
320
- // 24px tall — below the field scale's smallest step (30px), so it keeps its own
321
- // `radius/md` rather than being rounded up to the 8px a real field would use.
322
- // Heights are explicit because the trigger used to be sized by whichever chevron box the
323
- // `[&_span]` rules imposed; now that the chevron sizes itself, the field must state its own.
324
- //
325
- // Every size states its padding so that `2×border + 2×padding + chevron` is exactly the
326
- // trigger height — the chevron then sits an equal distance from all four edges instead of
327
- // being flush to the border horizontally and centred vertically. Only XL had any padding
328
- // before, which is why it was the only size that looked right.
329
- //
330
- // L and XL are the real field heights (30/40) and land on Figma's 4px. S and M have no
331
- // Figma counterpart, so they take 3px — the most that still fits their chevron exactly.
332
- S: ["h-[24px] p-[2px] rounded-radius-md [&_p]:typography-body-small-medium"],
333
- // 28px and 30px — the field scale's S step (30px) is `radius/lg`.
334
- M: ["h-[28px] p-[2px] rounded-radius-lg [&_p]:typography-body-medium-medium"],
335
- L: ["h-[30px] p-[3px] rounded-radius-lg [&_p]:typography-body-large-medium"],
336
- // 40px tall, so it is exactly InputField M and takes that size's `radius/xl` (12px).
337
- // It sat at 8px before — the one place a 40px field in the system rounded like a 30px one.
338
- XL: [
339
- "h-[40px] p-[3px] rounded-radius-xl [&_p]:typography-body-large-regular [&_p]:px-[4px]",
340
- ],
341
- },
342
- },
343
- defaultVariants: {
344
- size: "M",
345
- },
346
- },
347
- );
@@ -1,225 +0,0 @@
1
- import { useClickOutside } from "../hooks/useClickOutside";
2
- import { cn } from "../utils/cn";
3
- import { cva } from "class-variance-authority";
4
- import { HTMLAttributes, InputHTMLAttributes, ReactNode, useEffect, useRef, useState } from "react";
5
-
6
- interface SimpleSelectDropDownProps {
7
- className?: string;
8
- children: ReactNode;
9
- onClick?: () => void;
10
- }
11
-
12
- const SimpleSelectDropDown = ({ className, children, onClick }: SimpleSelectDropDownProps) => {
13
- return (
14
- <div
15
- className={cn(
16
- "absolute min-w-[100px] z-[20] top-[27px] start-0",
17
- dropdownMenuStyles({ variant: "SystemStyle" }),
18
- className,
19
- )}
20
- onClick={onClick}
21
- >
22
- {children}
23
- </div>
24
- );
25
- };
26
-
27
- interface SimpleSelectItemProps extends HTMLAttributes<HTMLLIElement> {
28
- selected?: boolean;
29
- }
30
-
31
- const SimpleSelectItem = ({ selected, ...props }: SimpleSelectItemProps) => {
32
- const ref = useRef<HTMLLIElement>(null);
33
-
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
- };
54
-
55
- interface SimpleSelectValueProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
56
- inputClassName?: string;
57
- onChange?: (value: string) => void;
58
- defaultOpen?: boolean;
59
- className?: string;
60
- }
61
-
62
- const SimpleSelectValue = ({
63
- inputClassName,
64
- children,
65
- onChange,
66
- defaultOpen = false,
67
- className,
68
- ...props
69
- }: SimpleSelectValueProps) => {
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
- "ps-[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
- );
131
- };
132
-
133
- export { SimpleSelectValue, SimpleSelectItem, SimpleSelectDropDown };
134
-
135
- export const MenuItemStyles = cva(
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
- },
194
- );
195
-
196
- export const dropdownMenuStyles = cva(
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
- },
225
- );
@@ -1,12 +0,0 @@
1
- import { cn } from "../utils/cn";
2
-
3
- function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
4
- return (
5
- <div
6
- className={cn("animate-pulse rounded-md bg-border-presentation-global-primary", className)}
7
- {...props}
8
- />
9
- );
10
- }
11
-
12
- export { Skeleton };