@g4rcez/components 4.0.1 → 4.1.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 (415) hide show
  1. package/ai/SKILL.md +233 -0
  2. package/ai/docs/Alert.md +166 -0
  3. package/ai/docs/AnimatedList.md +206 -0
  4. package/ai/docs/Autocomplete.md +221 -0
  5. package/ai/docs/Button.md +182 -0
  6. package/ai/docs/Calendar.md +185 -0
  7. package/ai/docs/Card.md +178 -0
  8. package/ai/docs/Checkbox.md +194 -0
  9. package/ai/docs/CommandPalette.md +275 -0
  10. package/ai/docs/DatePicker.md +152 -0
  11. package/ai/docs/Dropdown.md +195 -0
  12. package/{dist/ai → ai}/docs/Empty.md +41 -44
  13. package/{dist/ai → ai}/docs/Expand.md +40 -54
  14. package/ai/docs/FileUpload.md +218 -0
  15. package/{dist/ai → ai}/docs/Form.md +35 -29
  16. package/{dist/ai → ai}/docs/FormReset.md +37 -37
  17. package/{dist/ai → ai}/docs/Heading.md +4 -6
  18. package/ai/docs/Input.md +212 -0
  19. package/ai/docs/InputField.md +170 -0
  20. package/ai/docs/List.md +208 -0
  21. package/ai/docs/Menu.md +168 -0
  22. package/ai/docs/Modal.md +273 -0
  23. package/ai/docs/MultiSelect.md +177 -0
  24. package/ai/docs/Notifications.md +231 -0
  25. package/ai/docs/PageCalendar.md +262 -0
  26. package/{dist/ai → ai}/docs/Polymorph.md +25 -41
  27. package/{dist/ai → ai}/docs/Progress.md +55 -51
  28. package/{dist/ai → ai}/docs/Radiobox.md +49 -41
  29. package/{dist/ai → ai}/docs/RenderOnView.md +26 -32
  30. package/{dist/ai → ai}/docs/Resizable.md +60 -65
  31. package/ai/docs/Select.md +284 -0
  32. package/{dist/ai → ai}/docs/Shortcut.md +14 -14
  33. package/{dist/ai → ai}/docs/Skeleton.md +56 -60
  34. package/{dist/ai → ai}/docs/Slider.md +26 -49
  35. package/{dist/ai → ai}/docs/Slot.md +15 -17
  36. package/{dist/ai → ai}/docs/Spinner.md +17 -15
  37. package/{dist/ai → ai}/docs/Stats.md +44 -42
  38. package/ai/docs/Step.md +159 -0
  39. package/{dist/ai → ai}/docs/Switch.md +44 -54
  40. package/ai/docs/Table.md +286 -0
  41. package/ai/docs/Tabs.md +191 -0
  42. package/ai/docs/Tag.md +222 -0
  43. package/{dist/ai → ai}/docs/TaskList.md +40 -50
  44. package/ai/docs/Textarea.md +144 -0
  45. package/ai/docs/Timeline.md +212 -0
  46. package/{dist/ai → ai}/docs/Toolbar.md +46 -46
  47. package/ai/docs/Tooltip.md +231 -0
  48. package/ai/docs/Typography.md +187 -0
  49. package/ai/docs/Wizard.md +208 -0
  50. package/ai/docs/index.md +183 -0
  51. package/dist/autocomplete-DcTNOwyg.js +393 -0
  52. package/dist/autocomplete-DcTNOwyg.js.map +1 -0
  53. package/dist/{calendar-B5lSd0ID.js → calendar-BJMHRoy2.js} +104 -105
  54. package/dist/calendar-BJMHRoy2.js.map +1 -0
  55. package/dist/components/core/button.js +10 -10
  56. package/dist/components/core/button.js.map +1 -1
  57. package/dist/components/core/tag.js +4 -4
  58. package/dist/components/core/tag.js.map +1 -1
  59. package/dist/components/display/alert.js +48 -46
  60. package/dist/components/display/alert.js.map +1 -1
  61. package/dist/components/display/calendar.js +6 -6
  62. package/dist/components/display/card.js +2 -2
  63. package/dist/components/display/card.js.map +1 -1
  64. package/dist/components/display/list.js +1 -1
  65. package/dist/components/display/list.js.map +1 -1
  66. package/dist/components/display/notifications.js +3 -3
  67. package/dist/components/display/stats.js +1 -1
  68. package/dist/components/display/tabs.js +2 -2
  69. package/dist/components/display/timeline.js +1 -1
  70. package/dist/components/floating/dropdown.js +25 -17
  71. package/dist/components/floating/dropdown.js.map +1 -1
  72. package/dist/components/floating/expand.js +7 -7
  73. package/dist/components/floating/expand.js.map +1 -1
  74. package/dist/components/floating/menu.js +10 -10
  75. package/dist/components/floating/menu.js.map +1 -1
  76. package/dist/components/floating/modal.js +106 -102
  77. package/dist/components/floating/modal.js.map +1 -1
  78. package/dist/components/floating/tooltip.js +14 -14
  79. package/dist/components/floating/tooltip.js.map +1 -1
  80. package/dist/components/form/autocomplete.js +6 -6
  81. package/dist/components/form/checkbox.js +1 -1
  82. package/dist/components/form/date-picker.js +5 -5
  83. package/dist/components/form/file-upload.js +2 -2
  84. package/dist/components/form/form.js.map +1 -1
  85. package/dist/components/form/input.js +1 -1
  86. package/dist/components/form/radiobox.js +1 -1
  87. package/dist/components/form/select.js +3 -3
  88. package/dist/components/form/switch.js +2 -2
  89. package/dist/components/form/switch.js.map +1 -1
  90. package/dist/components/table/table.js +3 -3
  91. package/dist/{date-picker-DwNo22lx.js → date-picker-Bnl07nd8.js} +8 -6
  92. package/dist/date-picker-Bnl07nd8.js.map +1 -0
  93. package/dist/{dom-Dl8XH0CK.js → dom-CyQHY7ID.js} +66 -61
  94. package/dist/dom-CyQHY7ID.js.map +1 -0
  95. package/dist/{file-upload-Brf2NkLr.js → file-upload-93d5DR4q.js} +139 -129
  96. package/dist/file-upload-93d5DR4q.js.map +1 -0
  97. package/dist/{floating-ui.react-QNHG9W4N.js → floating-ui.react-M2PGXLDp.js} +8 -8
  98. package/dist/floating-ui.react-M2PGXLDp.js.map +1 -0
  99. package/dist/{fns-D2eyJKd5.js → fns-C7Dt27Qd.js} +2 -2
  100. package/dist/fns-C7Dt27Qd.js.map +1 -0
  101. package/dist/index-BJ1ayTam.js +126 -0
  102. package/dist/index-BJ1ayTam.js.map +1 -0
  103. package/dist/index-C-PuFUZi.js.map +1 -1
  104. package/dist/{index-BelDtX5M.js → index-DDeQW0JW.js} +399 -404
  105. package/dist/index-DDeQW0JW.js.map +1 -0
  106. package/dist/index-DE4shK8D.js +215 -0
  107. package/dist/index-DE4shK8D.js.map +1 -0
  108. package/dist/{index-DJSMaZR4.js → index-DlJ_2RBL.js} +2 -2
  109. package/dist/index-DlJ_2RBL.js.map +1 -0
  110. package/dist/index.css +1 -1
  111. package/dist/index.esm-BaIwleSE.js.map +1 -1
  112. package/dist/index.js +2826 -2765
  113. package/dist/index.js.map +1 -1
  114. package/dist/{input-CrGrSnUt.js → input-_MVxmIpu.js} +116 -114
  115. package/dist/input-_MVxmIpu.js.map +1 -0
  116. package/dist/{input-field-5vYcz5tT.js → input-field-CDCOODOl.js} +63 -47
  117. package/dist/input-field-CDCOODOl.js.map +1 -0
  118. package/dist/notifications-Dp0ydKJS.js +2576 -0
  119. package/dist/notifications-Dp0ydKJS.js.map +1 -0
  120. package/dist/polymorph-B5n9fs_K.js.map +1 -1
  121. package/dist/preset/plugin.tailwind.d.ts.map +1 -1
  122. package/dist/preset/plugin.tailwind.js +20 -18
  123. package/dist/preset/preset.tailwind.js +24 -25
  124. package/dist/preset/src/styles/common.js +6 -3
  125. package/dist/preset/src/styles/dark.d.ts.map +1 -1
  126. package/dist/preset/src/styles/dark.js +9 -5
  127. package/dist/preset/src/styles/design-tokens.js +68 -89
  128. package/dist/preset/src/styles/light.d.ts.map +1 -1
  129. package/dist/preset/src/styles/light.js +9 -5
  130. package/dist/preset/src/styles/theme.js +7 -4
  131. package/dist/preset/src/styles/theme.types.d.ts +2 -1
  132. package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
  133. package/dist/preset/src/styles/theme.types.js +2 -1
  134. package/dist/skeleton-BjJobYYf.js +24 -0
  135. package/dist/skeleton-BjJobYYf.js.map +1 -0
  136. package/dist/slot-CRyweuj0.js.map +1 -1
  137. package/dist/styles/common.js +6 -3
  138. package/dist/styles/dark.d.ts.map +1 -1
  139. package/dist/styles/dark.js +9 -5
  140. package/dist/styles/design-tokens.js +68 -89
  141. package/dist/styles/light.d.ts.map +1 -1
  142. package/dist/styles/light.js +9 -5
  143. package/dist/styles/theme.js +7 -4
  144. package/dist/styles/theme.types.d.ts +2 -1
  145. package/dist/styles/theme.types.d.ts.map +1 -1
  146. package/dist/styles/theme.types.js +2 -1
  147. package/dist/tabs-B0g7YtQv.js +123 -0
  148. package/dist/tabs-B0g7YtQv.js.map +1 -0
  149. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  150. package/dist/{context-BFXNJVn2.js → use-translations-DSltA7H_.js} +38 -30
  151. package/dist/use-translations-DSltA7H_.js.map +1 -0
  152. package/package.json +101 -88
  153. package/dist/ai/SKILL.md +0 -266
  154. package/dist/ai/docs/Alert.md +0 -167
  155. package/dist/ai/docs/AnimatedList.md +0 -205
  156. package/dist/ai/docs/Autocomplete.md +0 -225
  157. package/dist/ai/docs/Button.md +0 -182
  158. package/dist/ai/docs/Calendar.md +0 -219
  159. package/dist/ai/docs/Card.md +0 -174
  160. package/dist/ai/docs/Checkbox.md +0 -199
  161. package/dist/ai/docs/CommandPalette.md +0 -293
  162. package/dist/ai/docs/DatePicker.md +0 -171
  163. package/dist/ai/docs/Dropdown.md +0 -223
  164. package/dist/ai/docs/FileUpload.md +0 -225
  165. package/dist/ai/docs/Input.md +0 -237
  166. package/dist/ai/docs/InputField.md +0 -170
  167. package/dist/ai/docs/List.md +0 -205
  168. package/dist/ai/docs/Menu.md +0 -166
  169. package/dist/ai/docs/Modal.md +0 -280
  170. package/dist/ai/docs/MultiSelect.md +0 -196
  171. package/dist/ai/docs/Notifications.md +0 -231
  172. package/dist/ai/docs/PageCalendar.md +0 -271
  173. package/dist/ai/docs/Select.md +0 -284
  174. package/dist/ai/docs/Step.md +0 -159
  175. package/dist/ai/docs/Table.md +0 -298
  176. package/dist/ai/docs/Tabs.md +0 -191
  177. package/dist/ai/docs/Tag.md +0 -224
  178. package/dist/ai/docs/Textarea.md +0 -167
  179. package/dist/ai/docs/Timeline.md +0 -210
  180. package/dist/ai/docs/Tooltip.md +0 -231
  181. package/dist/ai/docs/TransferList.md +0 -142
  182. package/dist/ai/docs/Typography.md +0 -187
  183. package/dist/ai/docs/Wizard.md +0 -213
  184. package/dist/ai/docs/index.md +0 -183
  185. package/dist/autocomplete-Cn9Z2hLq.js +0 -375
  186. package/dist/autocomplete-Cn9Z2hLq.js.map +0 -1
  187. package/dist/calendar-B5lSd0ID.js.map +0 -1
  188. package/dist/components/core/button.d.ts +0 -77
  189. package/dist/components/core/button.d.ts.map +0 -1
  190. package/dist/components/core/heading.d.ts +0 -3
  191. package/dist/components/core/heading.d.ts.map +0 -1
  192. package/dist/components/core/polymorph.d.ts +0 -10
  193. package/dist/components/core/polymorph.d.ts.map +0 -1
  194. package/dist/components/core/render-on-view.d.ts +0 -7
  195. package/dist/components/core/render-on-view.d.ts.map +0 -1
  196. package/dist/components/core/resizable.d.ts +0 -3
  197. package/dist/components/core/resizable.d.ts.map +0 -1
  198. package/dist/components/core/slot.d.ts +0 -16
  199. package/dist/components/core/slot.d.ts.map +0 -1
  200. package/dist/components/core/tag.d.ts +0 -35
  201. package/dist/components/core/tag.d.ts.map +0 -1
  202. package/dist/components/core/typography.d.ts +0 -24
  203. package/dist/components/core/typography.d.ts.map +0 -1
  204. package/dist/components/display/alert.d.ts +0 -28
  205. package/dist/components/display/alert.d.ts.map +0 -1
  206. package/dist/components/display/calendar.d.ts +0 -42
  207. package/dist/components/display/calendar.d.ts.map +0 -1
  208. package/dist/components/display/card.d.ts +0 -29
  209. package/dist/components/display/card.d.ts.map +0 -1
  210. package/dist/components/display/empty.d.ts +0 -8
  211. package/dist/components/display/empty.d.ts.map +0 -1
  212. package/dist/components/display/list.d.ts +0 -16
  213. package/dist/components/display/list.d.ts.map +0 -1
  214. package/dist/components/display/notifications.d.ts +0 -27
  215. package/dist/components/display/notifications.d.ts.map +0 -1
  216. package/dist/components/display/progress.d.ts +0 -13
  217. package/dist/components/display/progress.d.ts.map +0 -1
  218. package/dist/components/display/shortcut.d.ts +0 -4
  219. package/dist/components/display/shortcut.d.ts.map +0 -1
  220. package/dist/components/display/skeleton.d.ts +0 -12
  221. package/dist/components/display/skeleton.d.ts.map +0 -1
  222. package/dist/components/display/spinner.d.ts +0 -5
  223. package/dist/components/display/spinner.d.ts.map +0 -1
  224. package/dist/components/display/stats.d.ts +0 -12
  225. package/dist/components/display/stats.d.ts.map +0 -1
  226. package/dist/components/display/step.d.ts +0 -24
  227. package/dist/components/display/step.d.ts.map +0 -1
  228. package/dist/components/display/tabs.d.ts +0 -24
  229. package/dist/components/display/tabs.d.ts.map +0 -1
  230. package/dist/components/display/timeline.d.ts +0 -10
  231. package/dist/components/display/timeline.d.ts.map +0 -1
  232. package/dist/components/floating/command-palette.d.ts +0 -49
  233. package/dist/components/floating/command-palette.d.ts.map +0 -1
  234. package/dist/components/floating/dropdown.d.ts +0 -15
  235. package/dist/components/floating/dropdown.d.ts.map +0 -1
  236. package/dist/components/floating/expand.d.ts +0 -11
  237. package/dist/components/floating/expand.d.ts.map +0 -1
  238. package/dist/components/floating/menu.d.ts +0 -52
  239. package/dist/components/floating/menu.d.ts.map +0 -1
  240. package/dist/components/floating/modal.d.ts +0 -60
  241. package/dist/components/floating/modal.d.ts.map +0 -1
  242. package/dist/components/floating/toolbar.d.ts +0 -6
  243. package/dist/components/floating/toolbar.d.ts.map +0 -1
  244. package/dist/components/floating/tooltip.d.ts +0 -17
  245. package/dist/components/floating/tooltip.d.ts.map +0 -1
  246. package/dist/components/floating/wizard.d.ts +0 -26
  247. package/dist/components/floating/wizard.d.ts.map +0 -1
  248. package/dist/components/form/autocomplete.d.ts +0 -16
  249. package/dist/components/form/autocomplete.d.ts.map +0 -1
  250. package/dist/components/form/checkbox.d.ts +0 -12
  251. package/dist/components/form/checkbox.d.ts.map +0 -1
  252. package/dist/components/form/date-picker.d.ts +0 -10
  253. package/dist/components/form/date-picker.d.ts.map +0 -1
  254. package/dist/components/form/file-upload.d.ts +0 -15
  255. package/dist/components/form/file-upload.d.ts.map +0 -1
  256. package/dist/components/form/form.d.ts +0 -3
  257. package/dist/components/form/form.d.ts.map +0 -1
  258. package/dist/components/form/formReset.d.ts +0 -2
  259. package/dist/components/form/formReset.d.ts.map +0 -1
  260. package/dist/components/form/free-text.d.ts +0 -11
  261. package/dist/components/form/free-text.d.ts.map +0 -1
  262. package/dist/components/form/input-field.d.ts +0 -34
  263. package/dist/components/form/input-field.d.ts.map +0 -1
  264. package/dist/components/form/input.d.ts +0 -52
  265. package/dist/components/form/input.d.ts.map +0 -1
  266. package/dist/components/form/multi-select.d.ts +0 -19
  267. package/dist/components/form/multi-select.d.ts.map +0 -1
  268. package/dist/components/form/radiobox.d.ts +0 -7
  269. package/dist/components/form/radiobox.d.ts.map +0 -1
  270. package/dist/components/form/select.d.ts +0 -13
  271. package/dist/components/form/select.d.ts.map +0 -1
  272. package/dist/components/form/slider.d.ts +0 -7
  273. package/dist/components/form/slider.d.ts.map +0 -1
  274. package/dist/components/form/switch.d.ts +0 -9
  275. package/dist/components/form/switch.d.ts.map +0 -1
  276. package/dist/components/form/task-list.d.ts +0 -3
  277. package/dist/components/form/task-list.d.ts.map +0 -1
  278. package/dist/components/form/textarea.d.ts +0 -6
  279. package/dist/components/form/textarea.d.ts.map +0 -1
  280. package/dist/components/form/transfer-list.d.ts +0 -14
  281. package/dist/components/form/transfer-list.d.ts.map +0 -1
  282. package/dist/components/form/transfer-list.js +0 -55
  283. package/dist/components/form/transfer-list.js.map +0 -1
  284. package/dist/components/index.d.ts +0 -46
  285. package/dist/components/index.d.ts.map +0 -1
  286. package/dist/components/page-calendar/calendar-header.d.ts +0 -16
  287. package/dist/components/page-calendar/calendar-header.d.ts.map +0 -1
  288. package/dist/components/page-calendar/day-view.d.ts +0 -12
  289. package/dist/components/page-calendar/day-view.d.ts.map +0 -1
  290. package/dist/components/page-calendar/event-pill.d.ts +0 -9
  291. package/dist/components/page-calendar/event-pill.d.ts.map +0 -1
  292. package/dist/components/page-calendar/index.d.ts +0 -4
  293. package/dist/components/page-calendar/index.d.ts.map +0 -1
  294. package/dist/components/page-calendar/month-view.d.ts +0 -11
  295. package/dist/components/page-calendar/month-view.d.ts.map +0 -1
  296. package/dist/components/page-calendar/page-calendar.d.ts +0 -18
  297. package/dist/components/page-calendar/page-calendar.d.ts.map +0 -1
  298. package/dist/components/page-calendar/page-calendar.types.d.ts +0 -18
  299. package/dist/components/page-calendar/page-calendar.types.d.ts.map +0 -1
  300. package/dist/components/page-calendar/page-calendar.utils.d.ts +0 -24
  301. package/dist/components/page-calendar/page-calendar.utils.d.ts.map +0 -1
  302. package/dist/components/page-calendar/week-view.d.ts +0 -11
  303. package/dist/components/page-calendar/week-view.d.ts.map +0 -1
  304. package/dist/components/table/filter.d.ts +0 -42
  305. package/dist/components/table/filter.d.ts.map +0 -1
  306. package/dist/components/table/group.d.ts +0 -17
  307. package/dist/components/table/group.d.ts.map +0 -1
  308. package/dist/components/table/index.d.ts +0 -20
  309. package/dist/components/table/index.d.ts.map +0 -1
  310. package/dist/components/table/inner-table.d.ts +0 -29
  311. package/dist/components/table/inner-table.d.ts.map +0 -1
  312. package/dist/components/table/metadata.d.ts +0 -4
  313. package/dist/components/table/metadata.d.ts.map +0 -1
  314. package/dist/components/table/pagination.d.ts +0 -3
  315. package/dist/components/table/pagination.d.ts.map +0 -1
  316. package/dist/components/table/row.d.ts +0 -12
  317. package/dist/components/table/row.d.ts.map +0 -1
  318. package/dist/components/table/sort.d.ts +0 -28
  319. package/dist/components/table/sort.d.ts.map +0 -1
  320. package/dist/components/table/table-lib.d.ts +0 -135
  321. package/dist/components/table/table-lib.d.ts.map +0 -1
  322. package/dist/components/table/table.context.d.ts +0 -10
  323. package/dist/components/table/table.context.d.ts.map +0 -1
  324. package/dist/components/table/thead.d.ts +0 -9
  325. package/dist/components/table/thead.d.ts.map +0 -1
  326. package/dist/config/context.d.ts +0 -21
  327. package/dist/config/context.d.ts.map +0 -1
  328. package/dist/config/default-translations.d.ts +0 -90
  329. package/dist/config/default-translations.d.ts.map +0 -1
  330. package/dist/config/default-tweaks.d.ts +0 -13
  331. package/dist/config/default-tweaks.d.ts.map +0 -1
  332. package/dist/constants.d.ts +0 -3
  333. package/dist/constants.d.ts.map +0 -1
  334. package/dist/context-BFXNJVn2.js.map +0 -1
  335. package/dist/date-picker-DwNo22lx.js.map +0 -1
  336. package/dist/dom-Dl8XH0CK.js.map +0 -1
  337. package/dist/file-upload-Brf2NkLr.js.map +0 -1
  338. package/dist/floating-ui.react-QNHG9W4N.js.map +0 -1
  339. package/dist/fns-D2eyJKd5.js.map +0 -1
  340. package/dist/hooks/use-click-outside.d.ts +0 -3
  341. package/dist/hooks/use-click-outside.d.ts.map +0 -1
  342. package/dist/hooks/use-color-parser.d.ts +0 -2
  343. package/dist/hooks/use-color-parser.d.ts.map +0 -1
  344. package/dist/hooks/use-components-provider.d.ts +0 -15
  345. package/dist/hooks/use-components-provider.d.ts.map +0 -1
  346. package/dist/hooks/use-debounce.d.ts +0 -5
  347. package/dist/hooks/use-debounce.d.ts.map +0 -1
  348. package/dist/hooks/use-floating-ref.d.ts +0 -2
  349. package/dist/hooks/use-floating-ref.d.ts.map +0 -1
  350. package/dist/hooks/use-form.d.ts +0 -394
  351. package/dist/hooks/use-form.d.ts.map +0 -1
  352. package/dist/hooks/use-hover.d.ts +0 -3
  353. package/dist/hooks/use-hover.d.ts.map +0 -1
  354. package/dist/hooks/use-input-id.d.ts +0 -4
  355. package/dist/hooks/use-input-id.d.ts.map +0 -1
  356. package/dist/hooks/use-is-coarse-device.d.ts +0 -2
  357. package/dist/hooks/use-is-coarse-device.d.ts.map +0 -1
  358. package/dist/hooks/use-locale.d.ts +0 -3
  359. package/dist/hooks/use-locale.d.ts.map +0 -1
  360. package/dist/hooks/use-media-query.d.ts +0 -2
  361. package/dist/hooks/use-media-query.d.ts.map +0 -1
  362. package/dist/hooks/use-on-event.d.ts +0 -4
  363. package/dist/hooks/use-on-event.d.ts.map +0 -1
  364. package/dist/hooks/use-parent.d.ts +0 -3
  365. package/dist/hooks/use-parent.d.ts.map +0 -1
  366. package/dist/hooks/use-preferences.d.ts +0 -2
  367. package/dist/hooks/use-preferences.d.ts.map +0 -1
  368. package/dist/hooks/use-previous.d.ts +0 -2
  369. package/dist/hooks/use-previous.d.ts.map +0 -1
  370. package/dist/hooks/use-reactive.d.ts +0 -2
  371. package/dist/hooks/use-reactive.d.ts.map +0 -1
  372. package/dist/hooks/use-remove-scroll.d.ts +0 -4
  373. package/dist/hooks/use-remove-scroll.d.ts.map +0 -1
  374. package/dist/hooks/use-resize-observer.d.ts +0 -2
  375. package/dist/hooks/use-resize-observer.d.ts.map +0 -1
  376. package/dist/hooks/use-stable-ref.d.ts +0 -2
  377. package/dist/hooks/use-stable-ref.d.ts.map +0 -1
  378. package/dist/hooks/use-swipe.d.ts +0 -8
  379. package/dist/hooks/use-swipe.d.ts.map +0 -1
  380. package/dist/hooks/use-translations.d.ts +0 -88
  381. package/dist/hooks/use-translations.d.ts.map +0 -1
  382. package/dist/hooks/use-tweaks.d.ts +0 -3
  383. package/dist/hooks/use-tweaks.d.ts.map +0 -1
  384. package/dist/hooks/use-window-size.d.ts +0 -5
  385. package/dist/hooks/use-window-size.d.ts.map +0 -1
  386. package/dist/index-BelDtX5M.js.map +0 -1
  387. package/dist/index-DJSMaZR4.js.map +0 -1
  388. package/dist/index-Z-fZHxfJ.js +0 -335
  389. package/dist/index-Z-fZHxfJ.js.map +0 -1
  390. package/dist/index.d.ts +0 -22
  391. package/dist/index.d.ts.map +0 -1
  392. package/dist/input-CrGrSnUt.js.map +0 -1
  393. package/dist/input-field-5vYcz5tT.js.map +0 -1
  394. package/dist/lib/combi-keys.d.ts +0 -15
  395. package/dist/lib/combi-keys.d.ts.map +0 -1
  396. package/dist/lib/dict.d.ts +0 -12
  397. package/dist/lib/dict.d.ts.map +0 -1
  398. package/dist/lib/dom.d.ts +0 -19
  399. package/dist/lib/dom.d.ts.map +0 -1
  400. package/dist/lib/fns.d.ts +0 -11
  401. package/dist/lib/fns.d.ts.map +0 -1
  402. package/dist/lib/fzf.d.ts +0 -16
  403. package/dist/lib/fzf.d.ts.map +0 -1
  404. package/dist/lib/keyboard-area.d.ts +0 -16
  405. package/dist/lib/keyboard-area.d.ts.map +0 -1
  406. package/dist/notifications-cUdVPs-B.js +0 -2786
  407. package/dist/notifications-cUdVPs-B.js.map +0 -1
  408. package/dist/skeleton-D75GFBV6.js +0 -10
  409. package/dist/skeleton-D75GFBV6.js.map +0 -1
  410. package/dist/tabs-S00a8qq8.js +0 -106
  411. package/dist/tabs-S00a8qq8.js.map +0 -1
  412. package/dist/types.d.ts +0 -26
  413. package/dist/types.d.ts.map +0 -1
  414. package/dist/use-translations-BwLKTrZv.js +0 -10
  415. package/dist/use-translations-BwLKTrZv.js.map +0 -1
@@ -1,167 +0,0 @@
1
- ---
2
- title: Alert
3
- description: Collapsible, themed alert banner for displaying important messages and status updates.
4
- package: "@g4rcez/components"
5
- export: "{ Alert }"
6
- import: "import { Alert } from '@g4rcez/components/alert'"
7
- category: display
8
- ---
9
-
10
- # Alert
11
-
12
- Collapsible, themed alert banner for displaying important messages and status updates.
13
-
14
- ## Import
15
-
16
- ```tsx
17
- import { Alert } from "@g4rcez/components/alert";
18
- ```
19
-
20
- ## Props
21
-
22
- | Prop | Type | Default | Description |
23
- |------|------|---------|-------------|
24
- | `theme` | `"primary" \| "secondary" \| "info" \| "warn" \| "danger" \| "success" \| "neutral"` | `"neutral"` | Visual theme variant |
25
- | `title` | `string` | — | Alert heading text |
26
- | `Icon` | `React.ReactElement` | — | Custom icon element (overrides default theme icon) |
27
- | `open` | `boolean` | `true` | Controls visibility with collapse animation |
28
- | `onClose` | `(nextState: boolean) => void` | — | Callback when close button is clicked; omit to hide the button |
29
- | `container` | `string` | — | Additional classes for the outer wrapper |
30
- | `as` | `React.ElementType` | `"div"` | Polymorphic root element |
31
- | `className` | `string` | — | Additional classes for the alert element |
32
- | `children` | `React.ReactNode` | — | Alert body content |
33
-
34
- ## Design Tokens
35
-
36
- Tokens this component reads. Customize by overriding these CSS variables in your theme.
37
-
38
- | Token | CSS Variable | Purpose |
39
- |-------|-------------|---------|
40
- | `bg-alert-{theme}-bg` | `--alert-{theme}-bg` | Background per theme |
41
- | `text-alert-{theme}-text` | `--alert-{theme}-text` | Text color per theme |
42
- | `border-alert-{theme}-border` | `--alert-{theme}-border` | Border color per theme |
43
- | `border-card-border` | `--card-border` | Border for `neutral` theme |
44
- | `text-foreground` | `--foreground` | Close button color |
45
- | `text-danger` | `--danger` | Close button hover color |
46
-
47
- Themes: `primary`, `secondary`, `info`, `warn`, `danger`, `success`, `neutral`.
48
-
49
- ## Themes
50
-
51
- Each theme maps to a set of `bg-alert-{theme}-*` tokens and provides default icons for some variants:
52
-
53
- | Theme | Default Icon |
54
- |-------|-------------|
55
- | `success` | `CheckCircleIcon` |
56
- | `info` | `InfoIcon` |
57
- | `danger` | `TriangleAlertIcon` |
58
- | `warn` | — |
59
- | `primary` / `secondary` / `neutral` | — |
60
-
61
- ## Examples
62
-
63
- ### Basic Variants
64
-
65
- ```tsx
66
- <Alert theme="info" title="Information">
67
- This is an informational message.
68
- </Alert>
69
-
70
- <Alert theme="success" title="Success">
71
- Your changes have been saved successfully.
72
- </Alert>
73
-
74
- <Alert theme="warn" title="Warning">
75
- Please review your input before proceeding.
76
- </Alert>
77
-
78
- <Alert theme="danger" title="Error">
79
- Something went wrong. Please try again.
80
- </Alert>
81
- ```
82
-
83
- ### With Custom Icon
84
-
85
- ```tsx
86
- import { BellIcon } from "@phosphor-icons/react";
87
-
88
- <Alert theme="info" title="Notification" Icon={<BellIcon size={20} />}>
89
- You have new messages.
90
- </Alert>
91
- ```
92
-
93
- ### Dismissible Alert
94
-
95
- ```tsx
96
- const [showAlert, setShowAlert] = useState(true);
97
-
98
- <Alert
99
- theme="success"
100
- title="Welcome!"
101
- open={showAlert}
102
- onClose={() => setShowAlert(false)}
103
- >
104
- Thanks for joining our platform.
105
- </Alert>
106
- ```
107
-
108
- ### Rich Content
109
-
110
- ```tsx
111
- import { Button } from "@g4rcez/components/button";
112
-
113
- <Alert theme="info" title="Update Available">
114
- <p>A new version of the application is available.</p>
115
- <div className="mt-3 flex gap-2">
116
- <Button theme="primary" size="small">Update Now</Button>
117
- <Button theme="neutral" size="small">Later</Button>
118
- </div>
119
- </Alert>
120
- ```
121
-
122
- ### Form Validation
123
-
124
- ```tsx
125
- const [errors, setErrors] = useState<string[]>([]);
126
-
127
- <Alert theme="danger" title="Validation Errors" open={errors.length > 0}>
128
- <ul className="list-disc list-inside space-y-1">
129
- {errors.map((error, index) => (
130
- <li key={index}>{error}</li>
131
- ))}
132
- </ul>
133
- </Alert>
134
- ```
135
-
136
- ## Do
137
-
138
- - Use `theme` to match message severity (`danger` for errors, `success` for completions, `warn` for cautions).
139
- - Provide a concise, descriptive `title` so users immediately understand the alert.
140
- - Supply `onClose` when the alert should be user-dismissible.
141
- - Use design-token classes for any wrapper elements (`bg-background`, `border-border`).
142
-
143
- ## Don't
144
-
145
- - Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`, `border-gray-300`) — use `theme` or design tokens instead.
146
- - Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
147
- - Don't use `danger` for non-critical information; use `warn` or `info` instead.
148
- - Don't omit `onClose` if the alert must be dismissible — the close button only renders when the prop is provided.
149
-
150
- ## Accessibility
151
-
152
- - Renders with `role="alert"` for immediate screen reader announcement.
153
- - Title uses a semantic `h4` element for proper heading hierarchy.
154
- - Close button is keyboard accessible and uses a visible icon.
155
- - The `aria-hidden` attribute on the collapse wrapper prevents interaction with hidden content.
156
-
157
- ## Data Attributes
158
-
159
- - `data-component="alert"` — outer wrapper element.
160
- - `data-theme` — current theme variant (e.g. `"danger"`).
161
- - `data-open` — current visibility state (`"true"` / `"false"`).
162
-
163
- ## Notes
164
-
165
- - Animation uses Framer Motion (`motion/react`): 0.7 s collapse/expand with spring easing.
166
- - When `open` becomes `false`, the alert collapses and is removed from the DOM via `AnimatePresence`.
167
- - The component is polymorphic — pass `as="section"` or any other element type via the `as` prop.
@@ -1,205 +0,0 @@
1
- ---
2
- title: AnimatedList
3
- description: Animated list that expands each item into a floating detail overlay on click.
4
- package: "@g4rcez/components"
5
- export: "{ AnimatedList, AnimatedListItem }"
6
- import: "import { AnimatedList, AnimatedListItem } from '@g4rcez/components'"
7
- category: display
8
- ---
9
-
10
- # AnimatedList
11
-
12
- Animated list that expands each item into a floating detail overlay on click.
13
-
14
- ## Import
15
-
16
- ```tsx
17
- import { AnimatedList, AnimatedListItem } from "@g4rcez/components";
18
- ```
19
-
20
- ## Props
21
-
22
- ### AnimatedList
23
-
24
- | Prop | Type | Default | Description |
25
- |------|------|---------|-------------|
26
- | `children` | `React.ReactNode` | — | One or more `AnimatedListItem` elements. |
27
-
28
- ### AnimatedListItem
29
-
30
- | Prop | Type | Default | Description |
31
- |------|------|---------|-------------|
32
- | `title` | `Label` | — | Primary heading shown in the list row and the overlay header. |
33
- | `description` | `Label` | — | Secondary text shown below the title in both the row and overlay header. |
34
- | `children` | `Label` | — | Content rendered inside the expanded overlay below the header. |
35
- | `avatar` | `Label` | — | Optional node (icon, image, or element) shown at the leading edge of the row. |
36
- | `leading` | `React.FC<{ open: () => void }>` | — | Optional render-prop component placed at the trailing edge of the row. Receives an `open` function to trigger the overlay programmatically. |
37
-
38
- `Label` is `string | number | ReactNode`.
39
-
40
- ## Design Tokens
41
-
42
- Tokens this component reads. Customize by overriding these CSS variables in your theme.
43
-
44
- | Token | CSS Variable | Purpose |
45
- |-------|-------------|---------|
46
- | `border-card-border` | `--card-border` | Row separator border and overlay border |
47
- | `bg-card-background` | `--card-background` | Overlay card background |
48
- | `rounded-card` | `--radius-card` | Overlay card border radius |
49
- | `shadow-shadow-card` | `--shadow-card` | Overlay card drop shadow |
50
- | `text-foreground` | `--foreground` | Default row and overlay text color |
51
- | `text-secondary` | `--secondary` | Description text color in rows and overlay |
52
- | `text-primary` | `--primary` | Row title hover color |
53
- | `text-danger` | `--danger` | Close button hover color |
54
- | `bg-floating-overlay` | `--floating-overlay` | Overlay backdrop tint (used at 70% opacity) |
55
- | `z-floating` | `--z-floating` | `z-index` for the overlay (value: 22) |
56
- | `z-overlay` | `--z-overlay` | `z-index` for the backdrop scrim |
57
-
58
- ## Examples
59
-
60
- ### Basic list
61
-
62
- ```tsx
63
- import { AnimatedList, AnimatedListItem } from "@g4rcez/components";
64
-
65
- const items = [
66
- { id: "1", name: "Alice Johnson", role: "Engineering" },
67
- { id: "2", name: "Bob Smith", role: "Design" },
68
- ];
69
-
70
- export function TeamList() {
71
- return (
72
- <AnimatedList>
73
- {items.map((member) => (
74
- <AnimatedListItem
75
- key={member.id}
76
- title={member.name}
77
- description={member.role}
78
- >
79
- <p className="text-foreground">
80
- Full profile details for {member.name}.
81
- </p>
82
- </AnimatedListItem>
83
- ))}
84
- </AnimatedList>
85
- );
86
- }
87
- ```
88
-
89
- ### With avatar
90
-
91
- ```tsx
92
- import { AnimatedList, AnimatedListItem } from "@g4rcez/components";
93
- import { UserCircleIcon } from "@phosphor-icons/react";
94
-
95
- export function UserDirectory() {
96
- return (
97
- <AnimatedList>
98
- <AnimatedListItem
99
- title="Carol White"
100
- description="Product Manager"
101
- avatar={<UserCircleIcon size={40} className="text-muted-foreground" />}
102
- >
103
- <div className="flex flex-col gap-2 text-foreground">
104
- <p>Department: Product</p>
105
- <p>Location: San Francisco</p>
106
- </div>
107
- </AnimatedListItem>
108
- </AnimatedList>
109
- );
110
- }
111
- ```
112
-
113
- ### With trailing action using `leading`
114
-
115
- ```tsx
116
- import { AnimatedList, AnimatedListItem } from "@g4rcez/components";
117
- import { Button } from "@g4rcez/components/button";
118
-
119
- export function OrderList({ orders }: { orders: Order[] }) {
120
- return (
121
- <AnimatedList>
122
- {orders.map((order) => (
123
- <AnimatedListItem
124
- key={order.id}
125
- title={`Order #${order.id}`}
126
- description={`Total: ${order.total}`}
127
- leading={({ open }) => (
128
- <Button size="small" theme="ghost-muted" onClick={open}>
129
- View details
130
- </Button>
131
- )}
132
- >
133
- <OrderDetailContent order={order} />
134
- </AnimatedListItem>
135
- ))}
136
- </AnimatedList>
137
- );
138
- }
139
- ```
140
-
141
- ### Activity feed
142
-
143
- ```tsx
144
- import { AnimatedList, AnimatedListItem } from "@g4rcez/components";
145
- import { BellIcon, CheckCircleIcon, WarningIcon } from "@phosphor-icons/react";
146
-
147
- const activities = [
148
- { id: "a1", icon: <CheckCircleIcon size={20} className="text-success" />, title: "Deployment succeeded", description: "2 minutes ago", detail: "All 3 services started." },
149
- { id: "a2", icon: <WarningIcon size={20} className="text-warn" />, title: "High memory usage", description: "15 minutes ago", detail: "Instance i-0ab2c was at 91%." },
150
- ];
151
-
152
- export function ActivityFeed() {
153
- return (
154
- <AnimatedList>
155
- {activities.map((a) => (
156
- <AnimatedListItem
157
- key={a.id}
158
- title={a.title}
159
- description={a.description}
160
- avatar={a.icon}
161
- >
162
- <p className="text-sm text-muted-foreground">{a.detail}</p>
163
- </AnimatedListItem>
164
- ))}
165
- </AnimatedList>
166
- );
167
- }
168
- ```
169
-
170
- ## Do
171
-
172
- - Keep `title` and `description` concise — they share one row and truncation is not automatic.
173
- - Provide meaningful `children` content in the overlay; it should justify opening the detail view.
174
- - Use `leading` to surface a primary call-to-action without forcing the user to click the title.
175
- - Use design-token classes for any content inside the overlay (`bg-card-background`, `text-foreground`, `border-card-border`).
176
-
177
- ## Don't
178
-
179
- - Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`, `border-gray-300`) — use design tokens instead.
180
- - Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
181
- - Don't use `AnimatedList` for purely informational lists with no actionable detail — use a plain `<ul>` or the `List` component instead.
182
- - Don't embed full sub-applications inside the overlay `children`; keep the detail view focused and lightweight.
183
- - Don't rely on `AnimatedListItem` rendering its `children` directly — it renders nothing on its own; all rendering is managed by the parent `AnimatedList`.
184
-
185
- ## Accessibility
186
-
187
- - The list renders as a semantic `<ul role="list">`.
188
- - Each item's title/description area is a `<button>` that triggers the overlay, making it keyboard accessible.
189
- - The overlay uses `FloatingFocusManager` to trap focus and `FloatingOverlay` with `lockScroll` to prevent background interaction.
190
- - Pressing `Escape` or clicking outside the overlay dismisses it.
191
- - The close button inside the overlay is a focusable `<button>` element.
192
- - `MotionConfig reducedMotion="user"` respects the user's system-level reduced-motion preference.
193
-
194
- ## Data Attributes
195
-
196
- - `data-component="collapse"` — internal animation wrapper (referenced in motion layout animations).
197
- - `layoutId="item-{id}"` — shared between the list row and the overlay card to drive the expand/collapse shared-element animation.
198
- - `layoutId="toast-{id}"` — inner content wrapper used for coordinated layout transitions.
199
-
200
- ## Notes
201
-
202
- - Animations use `motion/react` shared layout (`layoutId`) so the item smoothly expands from its row position into the centered overlay.
203
- - The overlay is rendered in a `FloatingPortal`, outside the normal DOM tree, to avoid stacking-context issues.
204
- - Only one item can be open at a time; opening a new item first closes the current one.
205
- - `AnimatedListItem` is a thin shell component — it returns `Fragment` and holds no state. All logic lives in `AnimatedList`, which reads child `props` via `React.Children.toArray`.
@@ -1,225 +0,0 @@
1
- ---
2
- title: Autocomplete
3
- description: Searchable select with fuzzy matching, virtualized options, keyboard navigation, and dynamic option creation.
4
- package: "@g4rcez/components"
5
- export: "{ Autocomplete }"
6
- import: "import { Autocomplete } from '@g4rcez/components/autocomplete'"
7
- category: form
8
- ---
9
-
10
- # Autocomplete
11
-
12
- Searchable select with fuzzy matching, virtualized options, keyboard navigation, and dynamic option creation.
13
-
14
- ## Import
15
-
16
- ```tsx
17
- import { Autocomplete } from "@g4rcez/components/autocomplete";
18
- ```
19
-
20
- ## Props
21
-
22
- | Prop | Type | Default | Description |
23
- |------|------|---------|-------------|
24
- | `title` | `string` | - | Field label |
25
- | `value` | `string` | - | Controlled selected value |
26
- | `options` | `AutocompleteItemProps[]` | - | List of selectable options |
27
- | `emptyMessage` | `Label` | - | Message displayed when no options match |
28
- | `dynamicOption` | `boolean` | `false` | Allow creating new options from typed text |
29
- | `onChange` | `(e: React.ChangeEvent<HTMLInputElement>) => void` | - | Change handler |
30
- | `error` | `string` | - | Error message displayed below the field |
31
- | `feedback` | `Label` | - | Success/neutral feedback text below the field |
32
- | `left` | `Label` | - | Content rendered on the left inside the field border |
33
- | `right` | `Label` | - | Content rendered on the right inside the field border |
34
- | `required` | `boolean` | `false` | Marks field as required; hides "Optional" text |
35
- | `disabled` | `boolean` | `false` | Disables the field |
36
- | `loading` | `boolean` | `false` | Shows loading state |
37
- | `container` | `string` | - | Extra CSS classes for the outer `fieldset` |
38
- | `labelClassName` | `string` | - | Extra CSS classes for the label/border wrapper |
39
-
40
- ### AutocompleteItemProps
41
-
42
- ```tsx
43
- type AutocompleteItemProps = {
44
- value: string;
45
- label?: string;
46
- hidden?: boolean;
47
- disabled?: boolean;
48
- "data-dynamic"?: string;
49
- Render?: React.FC<OptionProps>;
50
- } & Record<`data-${string}`, string>;
51
- ```
52
-
53
- ## Design Tokens
54
-
55
- Tokens this component reads. Customize by overriding these CSS variables in your theme.
56
-
57
- | Token | CSS Variable | Purpose |
58
- |-------|-------------|---------|
59
- | `h-input-height` | `--input-height` | Input height |
60
- | `px-input-x` | `--input-x` | Horizontal input padding |
61
- | `py-input-y` | `--input-y` | Vertical input padding |
62
- | `border-input-border` | `--input-border` | Default field border color |
63
- | `placeholder-input-mask` | `--input-mask` | Placeholder text color |
64
- | `placeholder-input-mask-error` | `--input-mask-error` | Placeholder color in error state |
65
- | `text-foreground` | `--foreground` | Input text color |
66
- | `text-danger` | `--danger` | Text color in error state |
67
- | `text-primary` | `--primary` | Focus/hover border and ring color |
68
- | `bg-floating-background` | `--floating-background` | Dropdown background |
69
- | `border-floating-border` | `--floating-border` | Dropdown border color |
70
- | `bg-floating-hover` | `--floating-hover` | Option background on hover/keyboard focus |
71
- | `text-disabled` | `--disabled` | Empty message text color |
72
- | `border-tooltip-border` | `--tooltip-border` | Separator inside dropdown |
73
- | `z-floating` | `--z-floating` | Z-index for the floating panel |
74
- | `shadow-floating` | `--shadow-floating` | Drop shadow for the floating panel |
75
-
76
- ## Examples
77
-
78
- ### Basic usage
79
-
80
- ```tsx
81
- import { Autocomplete } from "@g4rcez/components/autocomplete";
82
-
83
- const options = [
84
- { value: "react", label: "React" },
85
- { value: "vue", label: "Vue" },
86
- { value: "svelte", label: "Svelte" },
87
- ];
88
-
89
- function FrameworkPicker() {
90
- const [value, setValue] = useState("");
91
-
92
- return (
93
- <Autocomplete
94
- title="Framework"
95
- placeholder="Search frameworks..."
96
- options={options}
97
- value={value}
98
- onChange={(e) => setValue(e.target.value)}
99
- />
100
- );
101
- }
102
- ```
103
-
104
- ### Dynamic option creation
105
-
106
- ```tsx
107
- function TagPicker() {
108
- const [value, setValue] = useState("");
109
- const [tags, setTags] = useState([
110
- { value: "typescript", label: "TypeScript" },
111
- { value: "javascript", label: "JavaScript" },
112
- ]);
113
-
114
- const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
115
- const next = e.target.value;
116
- setValue(next);
117
- if (next && !tags.find((t) => t.value === next)) {
118
- setTags((prev) => [...prev, { value: next, label: next }]);
119
- }
120
- };
121
-
122
- return (
123
- <Autocomplete
124
- title="Tag"
125
- placeholder="Search or create a tag..."
126
- options={tags}
127
- value={value}
128
- onChange={handleChange}
129
- dynamicOption
130
- emptyMessage="Type to create a new tag"
131
- />
132
- );
133
- }
134
- ```
135
-
136
- ### Custom option renderer
137
-
138
- ```tsx
139
- type UserOption = AutocompleteItemProps & { email: string; role: string };
140
-
141
- const UserRow = ({ value, label, ...props }: UserOption) => (
142
- <div className="flex flex-col gap-0.5 py-1">
143
- <span className="font-medium text-sm text-foreground">{label}</span>
144
- <span className="text-xs text-muted-foreground">{props.email}</span>
145
- </div>
146
- );
147
-
148
- const users: UserOption[] = [
149
- { value: "alice", label: "Alice", email: "alice@example.com", role: "admin", Render: UserRow },
150
- { value: "bob", label: "Bob", email: "bob@example.com", role: "member", Render: UserRow },
151
- ];
152
-
153
- <Autocomplete title="Assign to" options={users} value="" onChange={() => {}} />;
154
- ```
155
-
156
- ### Form integration
157
-
158
- ```tsx
159
- import { Form } from "@g4rcez/components/form";
160
- import { Button } from "@g4rcez/components/button";
161
-
162
- const countries = [
163
- { value: "br", label: "Brazil" },
164
- { value: "us", label: "United States" },
165
- { value: "de", label: "Germany" },
166
- ];
167
-
168
- function ContactForm() {
169
- const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
170
- const data = new FormData(e.currentTarget);
171
- console.log(Object.fromEntries(data));
172
- };
173
-
174
- return (
175
- <Form onSubmit={handleSubmit} className="flex flex-col gap-base">
176
- <Autocomplete
177
- name="country"
178
- title="Country"
179
- options={countries}
180
- required
181
- emptyMessage="No countries found"
182
- />
183
- <Button theme="primary" type="submit">Submit</Button>
184
- </Form>
185
- );
186
- }
187
- ```
188
-
189
- ## Do
190
-
191
- - Provide a meaningful `emptyMessage` so users understand why no results appear.
192
- - Use `dynamicOption` when users should be able to add values not in the list.
193
- - Supply a custom `Render` component when each option needs to show more than its label (e.g., avatars, secondary text).
194
- - Prefer `Autocomplete` over `Select` for lists of more than ~15 items.
195
-
196
- ## Don't
197
-
198
- - Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`, `border-gray-300`) — use theme props or design tokens instead.
199
- - Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
200
- - Don't use `Autocomplete` for small lists where `Select` is simpler and faster.
201
- - Don't forget to handle the unselected case when `dynamicOption` is off and the user types but never picks an option.
202
-
203
- ## Accessibility
204
-
205
- - Renders a `role="listbox"` dropdown managed by `@floating-ui/react`.
206
- - The visible input carries `aria-autocomplete="list"`.
207
- - Each option button has `aria-selected`, `aria-current`, and `aria-checked` set to reflect the active state.
208
- - Full keyboard navigation: Arrow Up/Down to move, Enter to select, Escape to close.
209
- - The caret button includes an `sr-only` label from the translation system.
210
- - Focus is returned to the trigger input when the dropdown closes.
211
-
212
- ## Data Attributes
213
-
214
- - `data-value` — on the hidden `<input>`: the committed option value.
215
- - `data-shadow="true"` — on the visible text input to distinguish it from the real field.
216
- - `data-dynamic="true"` — on options injected by `dynamicOption`.
217
- - `data-initialized` — managed internally; used by `formReset` to track interaction state.
218
- - `data-floating="true"` — on the floating panel element.
219
-
220
- ## Notes
221
-
222
- - The component renders two `<input>` elements: a visible shadow input for display/search and a hidden input with `name` that participates in form submission.
223
- - Option filtering uses a fuzzy-search (`fzf`) algorithm that matches partial text, abbreviations, and out-of-order characters against both `value` and `label`.
224
- - Large option lists are virtualized via `react-virtuoso` — rendering performance is maintained even with thousands of options.
225
- - The dropdown width always matches the width of the triggering fieldset.