@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,280 +0,0 @@
1
- ---
2
- title: Modal
3
- description: Animated modal with dialog, drawer, and sheet variants; includes drag-to-resize and a programmatic confirm utility.
4
- package: "@g4rcez/components"
5
- export: "{ Modal, ModalConfirmProvider, useConfirm }"
6
- import: "import { Modal } from '@g4rcez/components/modal'"
7
- category: floating
8
- ---
9
-
10
- # Modal
11
-
12
- Animated modal with dialog, drawer, and sheet variants; includes drag-to-resize and a programmatic confirm utility.
13
-
14
- ## Import
15
-
16
- ```tsx
17
- import { Modal, ModalConfirmProvider, useConfirm } from "@g4rcez/components/modal";
18
- ```
19
-
20
- ## Props
21
-
22
- | Prop | Type | Default | Description |
23
- |------|------|---------|-------------|
24
- | `open` | `boolean` | — | Controls modal visibility |
25
- | `onChange` | `(nextState: boolean) => void` | — | Callback when modal state changes |
26
- | `title` | `React.ReactNode` | — | Modal title; creates a `<h2>` header |
27
- | `ariaTitle` | `string` | — | ARIA label used when no visible `title` is provided |
28
- | `footer` | `React.ReactNode` | — | Footer content |
29
- | `type` | `"dialog" \| "drawer" \| "sheet"` | `"dialog"` | Modal display variant |
30
- | `position` | `"left" \| "right"` | `"right"` | Drawer slide-in side (drawer type only) |
31
- | `animated` | `boolean` | `true` | Enable enter/exit animations |
32
- | `closable` | `boolean` | `true` | Show the close button |
33
- | `resizer` | `boolean` | `true` | Show the drag-to-resize handle (drawer and sheet) |
34
- | `forceType` | `boolean` | `false` | Disable responsive behavior — keep `type` on all screen sizes |
35
- | `overlayClickClose` | `boolean` | `false` | Close when clicking the backdrop |
36
- | `trigger` | `React.ReactNode \| React.FC` | — | Element that toggles the modal when clicked |
37
- | `asChild` | `boolean` | `false` | Merge trigger props onto the child element via `Slot` |
38
- | `className` | `string` | — | Additional classes for the modal surface |
39
- | `bodyClassName` | `string` | — | Additional classes for the scrollable body |
40
- | `overlayClassName` | `string` | — | Additional classes for the backdrop overlay |
41
- | `layoutId` | `string` | — | Framer Motion layout ID for shared-element transitions |
42
- | `role` | `"dialog"` | `"dialog"` | ARIA role |
43
- | `interactions` | `ElementProps[]` | `[]` | Extra Floating UI interaction hooks |
44
-
45
- ## Modal Types
46
-
47
- | Type | Behavior | Best for |
48
- |------|----------|---------|
49
- | `dialog` | Centered overlay with backdrop | Confirmations, forms |
50
- | `drawer` | Slides in from left or right; full height | Navigation, detail panels |
51
- | `sheet` | Slides up from bottom; full width | Mobile action sheets |
52
-
53
- On mobile (`< 64 rem`) drawers automatically become sheets unless `forceType` is set.
54
-
55
- ## Design Tokens
56
-
57
- Tokens this component reads. Customize by overriding these CSS variables in your theme.
58
-
59
- | Token | CSS Variable | Purpose |
60
- |-------|-------------|---------|
61
- | `bg-floating-background` | `--floating-background` | Modal surface background |
62
- | `border-floating-border` | `--floating-border` | Modal border, header/footer dividers, resizer |
63
- | `bg-floating-overlay` | `--floating-overlay` | Backdrop color (with `/70` opacity) |
64
- | `z-overlay` | `--z-overlay` | Z-index of the backdrop |
65
- | `z-floating` | `--z-floating` | Z-index of the modal surface and close button |
66
- | `w-dialog` | `--dialog` | Default max-width for dialog type (`max-w-dialog`) |
67
- | `text-foreground` | `--foreground` | Body text color |
68
- | `text-danger` | `--danger` | Close button hover color |
69
-
70
- ## Examples
71
-
72
- ### Basic Dialog
73
-
74
- ```tsx
75
- import { useState } from "react";
76
- import { Modal } from "@g4rcez/components/modal";
77
- import { Button } from "@g4rcez/components/button";
78
-
79
- function BasicDialog() {
80
- const [open, setOpen] = useState(false);
81
-
82
- return (
83
- <>
84
- <Button onClick={() => setOpen(true)}>Open Dialog</Button>
85
-
86
- <Modal open={open} onChange={setOpen} title="Confirm Action">
87
- <p className="text-foreground">Are you sure you want to proceed?</p>
88
- <div className="flex gap-2 mt-4">
89
- <Button theme="ghost-muted" onClick={() => setOpen(false)}>
90
- Cancel
91
- </Button>
92
- <Button theme="danger" onClick={() => setOpen(false)}>
93
- Confirm
94
- </Button>
95
- </div>
96
- </Modal>
97
- </>
98
- );
99
- }
100
- ```
101
-
102
- ### Modal with Footer
103
-
104
- ```tsx
105
- <Modal
106
- open={open}
107
- onChange={setOpen}
108
- title="User Profile"
109
- footer={
110
- <div className="flex justify-end gap-2">
111
- <Button theme="ghost-muted" onClick={() => setOpen(false)}>
112
- Cancel
113
- </Button>
114
- <Button theme="primary">Save Changes</Button>
115
- </div>
116
- }
117
- >
118
- <form className="space-y-4">
119
- <div>
120
- <label className="text-sm font-medium text-foreground">Name</label>
121
- <input type="text" className="w-full p-2 rounded-button border border-border bg-background text-foreground" />
122
- </div>
123
- </form>
124
- </Modal>
125
- ```
126
-
127
- ### Drawer
128
-
129
- ```tsx
130
- <Modal
131
- open={open}
132
- onChange={setOpen}
133
- type="drawer"
134
- position="right"
135
- title="Navigation"
136
- >
137
- <nav className="space-y-2">
138
- <a href="/dashboard" className="block rounded-button p-2 text-foreground hover:bg-muted">
139
- Dashboard
140
- </a>
141
- <a href="/profile" className="block rounded-button p-2 text-foreground hover:bg-muted">
142
- Profile
143
- </a>
144
- <a href="/settings" className="block rounded-button p-2 text-foreground hover:bg-muted">
145
- Settings
146
- </a>
147
- </nav>
148
- </Modal>
149
- ```
150
-
151
- ### Sheet
152
-
153
- ```tsx
154
- <Modal open={open} onChange={setOpen} type="sheet" title="Quick Actions">
155
- <div className="grid grid-cols-2 gap-4">
156
- <Button theme="ghost-neutral" className="flex-col h-24">
157
- Analytics
158
- </Button>
159
- <Button theme="ghost-neutral" className="flex-col h-24">
160
- Revenue
161
- </Button>
162
- </div>
163
- </Modal>
164
- ```
165
-
166
- ### Modal with Built-in Trigger
167
-
168
- ```tsx
169
- <Modal
170
- open={open}
171
- onChange={setOpen}
172
- title="Settings"
173
- trigger={<Button theme="primary">Open Settings</Button>}
174
- >
175
- <p className="text-foreground">Settings content here.</p>
176
- </Modal>
177
- ```
178
-
179
- ### Non-closable Processing Modal
180
-
181
- ```tsx
182
- <Modal open={open} onChange={setOpen} title="Processing..." closable={false}>
183
- <div className="text-center text-foreground">
184
- <div className="animate-spin w-8 h-8 border-4 border-primary border-t-transparent rounded-full mx-auto mb-4" />
185
- <p>Please wait while we process your request.</p>
186
- </div>
187
- </Modal>
188
- ```
189
-
190
- ### Programmatic Confirm Dialog
191
-
192
- Wrap your app with `ModalConfirmProvider` once:
193
-
194
- ```tsx
195
- import { ModalConfirmProvider } from "@g4rcez/components/modal";
196
-
197
- export default function App({ children }) {
198
- return <ModalConfirmProvider>{children}</ModalConfirmProvider>;
199
- }
200
- ```
201
-
202
- Then call `Modal.confirm` anywhere:
203
-
204
- ```tsx
205
- import { Modal } from "@g4rcez/components/modal";
206
-
207
- async function handleDelete() {
208
- const confirmed = await Modal.confirm({
209
- title: "Delete item",
210
- description: "This action cannot be undone.",
211
- confirm: { text: "Delete", theme: "danger" },
212
- cancel: { text: "Cancel" },
213
- });
214
-
215
- if (confirmed) {
216
- // proceed with deletion
217
- }
218
- }
219
- ```
220
-
221
- Or use the `useConfirm` hook inside a `ModalConfirmProvider` subtree:
222
-
223
- ```tsx
224
- import { useConfirm } from "@g4rcez/components/modal";
225
-
226
- function DeleteButton() {
227
- const confirm = useConfirm();
228
-
229
- const handleClick = async () => {
230
- const ok = await confirm({
231
- title: "Delete item",
232
- description: "Are you sure?",
233
- });
234
- if (ok) {
235
- // delete
236
- }
237
- };
238
-
239
- return <Button theme="danger" onClick={handleClick}>Delete</Button>;
240
- }
241
- ```
242
-
243
- ## Do
244
-
245
- - Choose the correct `type` (`dialog`, `drawer`, `sheet`) for the content and context.
246
- - Use `<Modal type="dialog" />` as the default — only switch to `drawer` or `sheet` when layout demands it.
247
- - Always provide either `title` or `ariaTitle` so screen readers can announce the modal.
248
- - Use `footer` for action buttons to keep them separated from body content.
249
-
250
- ## Don't
251
-
252
- - Don't pass custom `z-*`, `rounded-*`, or `p-*` overrides directly — use `type` to control layout variants.
253
- - Don't use raw Tailwind color classes (`bg-blue-500`, `text-white`, `bg-gray-100`) — use design-token classes.
254
- - Don't use arbitrary Tailwind values (`bg-[#abc]`, `z-[9999]`) — override CSS variables in your `@theme` block.
255
- - Don't use `color-mix()` in `className` or `style` props.
256
- - Don't nest modals inside each other — it creates broken focus and z-index behavior.
257
- - Don't hide a modal's only close affordance (`closable={false}`) without providing another way to close.
258
-
259
- ## Accessibility
260
-
261
- - Focus is automatically trapped inside the modal via `FloatingFocusManager` with `guards` and `modal`.
262
- - `Escape` closes the modal (via `useDismiss` with `escapeKey: true`).
263
- - The modal surface receives `aria-labelledby` (when `title` is set) or `aria-label` (when `ariaTitle` is set).
264
- - `aria-modal="true"` is applied to the floating surface.
265
- - Scroll is locked on the body while the modal is open.
266
-
267
- ## Data Attributes
268
-
269
- | Attribute | Applied to | Description |
270
- |-----------|-----------|-------------|
271
- | `data-component="modal"` | Modal surface `<div>` | Identifies the modal root |
272
- | `data-component="modal-body"` | Scrollable body `<section>` | Identifies the content area |
273
-
274
- ## Notes
275
-
276
- - Drawers auto-switch to sheets on viewports narrower than `64rem` unless `forceType={true}`.
277
- - `resizer` adds a draggable handle: horizontal for drawers, vertical for sheets. Dragging a sheet past 60 % of screen height closes it.
278
- - `layoutId` enables Framer Motion shared-element transitions between a trigger and the modal surface.
279
- - `ModalConfirmProvider` sets a module-level `confirmGlobal` function so `Modal.confirm` works outside React trees (e.g., in event handlers).
280
- - The confirm dialog uses `max-w-dialog` (`w-dialog` token, default `20rem`) and cannot be closed by clicking the overlay.
@@ -1,196 +0,0 @@
1
- ---
2
- title: MultiSelect
3
- description: Dropdown that lets users select multiple options with fuzzy search and tag display.
4
- package: "@g4rcez/components"
5
- export: "{ MultiSelect }"
6
- import: "import { MultiSelect } from '@g4rcez/components'"
7
- category: form
8
- ---
9
-
10
- # MultiSelect
11
-
12
- Dropdown that lets users select multiple options with fuzzy search and tag display.
13
-
14
- ## Import
15
-
16
- ```tsx
17
- import { MultiSelect } from "@g4rcez/components";
18
- ```
19
-
20
- ## Props
21
-
22
- The `MultiSelect` component inherits all props from `InputField`, plus:
23
-
24
- | Prop | Type | Default | Description |
25
- |------|------|---------|-------------|
26
- | `options` | `MultiSelectItemProps[]` | — | Array of `{ value, label, Render? }` option objects. |
27
- | `value` | `string[]` | — | Controlled selected values. |
28
- | `defaultValue` | `string[]` | `[]` | Initial selected values for uncontrolled usage. |
29
- | `onChangeOptions` | `(options: string[]) => void` | — | Called when the selection changes. |
30
- | `dynamicOption` | `boolean` | `false` | Allows users to select their search query as a new option. |
31
- | `emptyMessage` | `Label` | — | Message shown when no options match the search. |
32
- | `selectedLabel` | `string` | — | Text shown in the overflow counter (e.g., "selected"). |
33
-
34
- ### MultiSelectItemProps
35
-
36
- Extends `OptionProps` with an optional custom renderer:
37
-
38
- | Field | Type | Description |
39
- |-------|------|-------------|
40
- | `value` | `string` | Option value. |
41
- | `label` | `string` | Option display text. |
42
- | `Render` | `React.FC<OptionProps>` | Custom render component for the dropdown row. |
43
- | `hidden` | `boolean` | Hides the option from the list. |
44
-
45
- ## Design Tokens
46
-
47
- Tokens this component reads. Customize by overriding these CSS variables in your theme.
48
-
49
- | Token | CSS Variable | Purpose |
50
- |-------|-------------|---------|
51
- | `placeholder-input-mask` | `--input-mask` | Placeholder text color |
52
- | `placeholder-input-mask-error` | `--input-mask-error` | Placeholder color in error state |
53
- | `border-input-border` | `--input-border` | Search input bottom border in dropdown |
54
- | `bg-floating-background` | `--floating-background` | Dropdown panel background |
55
- | `border-floating-border` | `--floating-border` | Dropdown panel border |
56
- | `bg-floating-hover` | `--floating-hover` | Option row hover/active background |
57
- | `text-foreground` | `--foreground` | Option text color |
58
- | `text-input-placeholder` | `--input-placeholder` | Placeholder li color |
59
- | `text-disabled` | `--disabled` | Empty-state text color |
60
- | `focus:ring-primary` | `--primary` | Keyboard focus ring |
61
- | `h-input-height` | `--input-height` | Trigger element height (2.5 rem) |
62
- | `px-input-x` | `--input-x` | Horizontal padding |
63
- | `py-input-y` | `--input-y` | Vertical padding |
64
-
65
- ## Examples
66
-
67
- ### Basic usage
68
-
69
- ```tsx
70
- import { MultiSelect } from "@g4rcez/components";
71
-
72
- const options = [
73
- { value: "react", label: "React" },
74
- { value: "vue", label: "Vue" },
75
- { value: "angular", label: "Angular" },
76
- ];
77
-
78
- export default function FrameworkPicker() {
79
- return (
80
- <MultiSelect
81
- title="Frameworks"
82
- options={options}
83
- onChangeOptions={(values) => console.log(values)}
84
- />
85
- );
86
- }
87
- ```
88
-
89
- ### Controlled selection
90
-
91
- ```tsx
92
- import { useState } from "react";
93
- import { MultiSelect } from "@g4rcez/components";
94
-
95
- export default function ControlledMultiSelect() {
96
- const [selected, setSelected] = useState<string[]>(["react"]);
97
-
98
- return (
99
- <MultiSelect
100
- title="Frameworks"
101
- options={[
102
- { value: "react", label: "React" },
103
- { value: "vue", label: "Vue" },
104
- { value: "angular", label: "Angular" },
105
- ]}
106
- value={selected}
107
- onChangeOptions={setSelected}
108
- />
109
- );
110
- }
111
- ```
112
-
113
- ### Custom option rendering
114
-
115
- ```tsx
116
- import { ShieldIcon } from "@phosphor-icons/react";
117
- import { MultiSelect } from "@g4rcez/components";
118
-
119
- const roleOptions = roles.map((r) => ({
120
- value: r.id,
121
- label: r.name,
122
- Render: () => (
123
- <span className="flex items-center gap-base">
124
- <ShieldIcon size={14} className="text-primary" />
125
- {r.name}
126
- </span>
127
- ),
128
- }));
129
-
130
- export default function RolePicker() {
131
- return (
132
- <MultiSelect
133
- title="Roles"
134
- options={roleOptions}
135
- onChangeOptions={(ids) => console.log(ids)}
136
- />
137
- );
138
- }
139
- ```
140
-
141
- ### Dynamic option creation
142
-
143
- ```tsx
144
- import { MultiSelect } from "@g4rcez/components";
145
-
146
- export default function TagInput() {
147
- return (
148
- <MultiSelect
149
- title="Tags"
150
- dynamicOption
151
- options={existingTags}
152
- onChangeOptions={(tags) => console.log(tags)}
153
- />
154
- );
155
- }
156
- ```
157
-
158
- ## Do
159
-
160
- - Provide a descriptive `title` to label the trigger.
161
- - Use `dynamicOption` when users may need to add items not in the predefined list.
162
- - Use design-token classes for any wrapper elements (`bg-background`, `border-border`, `text-foreground`).
163
- - Use `theme="<value>"` on nested elements — never hardcode colors in `className`.
164
-
165
- ## Don't
166
-
167
- - Don't use `MultiSelect` when only a single selection is needed — use `Select` or `Autocomplete` instead.
168
- - Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`) — use theme props or design tokens instead.
169
- - Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
170
- - Don't use `color-mix()` in className or style props for theming.
171
-
172
- ## Accessibility
173
-
174
- - The trigger uses `aria-autocomplete="list"` and `role="button"`.
175
- - The dropdown list uses `role="listbox"` with individual items carrying `role="option"`, `aria-selected`, `aria-checked`, and `aria-current`.
176
- - `FloatingFocusManager` traps focus inside the open dropdown.
177
- - Arrow keys navigate the virtual list; Escape closes it; Enter selects the focused item.
178
-
179
- ## Data Attributes
180
-
181
- | Attribute | Element | Value | Description |
182
- |-----------|---------|-------|-------------|
183
- | `data-component` | trigger `ul` | `"autocomplete"` | Identifies the component type. |
184
- | `data-shadow` | trigger `ul` | `"true"` | Marks the visual shadow trigger. |
185
- | `data-value` | trigger `ul` | JSON string | Currently selected values as a JSON array. |
186
- | `data-floating` | dropdown root | `"true"` | Marks the floating panel. |
187
- | `data-dynamic` | option button | `"true"` | Marks options injected via `dynamicOption`. |
188
- | `data-error` | trigger `ul` | boolean string | Reflects the error state. |
189
-
190
- ## Notes
191
-
192
- - Uses `react-virtuoso` for virtualized rendering — large option lists perform well.
193
- - The overflow control collapses selected tags into a counter badge when they exceed the trigger width.
194
- - The hidden `<input type="hidden">` stores the comma-separated selected values for native form submission.
195
- - Floating position is computed with `@floating-ui/react` and updates automatically while open (`autoUpdate`).
196
- - The dropdown search uses `fzf` (fuzzy matching) across both `value` and `label` fields.
@@ -1,231 +0,0 @@
1
- ---
2
- title: Notifications
3
- description: Toast notification system with themes, stacking, swipe-to-dismiss, and programmatic control.
4
- package: "@g4rcez/components"
5
- export: "{ Notifications }"
6
- import: "import { Notifications, useNotification } from '@g4rcez/components/notifications'"
7
- category: display
8
- ---
9
-
10
- # Notifications
11
-
12
- Toast notification system with themes, stacking, swipe-to-dismiss, and programmatic control.
13
-
14
- ## Import
15
-
16
- ```tsx
17
- import { Notifications, useNotification } from "@g4rcez/components/notifications";
18
- ```
19
-
20
- ## Setup
21
-
22
- Wrap your app (or the subtree that needs toasts) with `Notifications`:
23
-
24
- ```tsx
25
- import { Notifications } from "@g4rcez/components/notifications";
26
-
27
- function App() {
28
- return (
29
- <Notifications max={5} timeout={5000}>
30
- <YourApp />
31
- </Notifications>
32
- );
33
- }
34
- ```
35
-
36
- ## Props
37
-
38
- ### Notifications (Provider)
39
-
40
- | Prop | Type | Default | Description |
41
- |------|------|---------|-------------|
42
- | `max` | `number` | `5` | Maximum notifications displayed at once |
43
- | `timeout` | `number` | `5000` | Default auto-dismiss duration in milliseconds |
44
- | `children` | `React.ReactNode` | — | Subtree that can use `useNotification` |
45
-
46
- ### useNotification — notify function
47
-
48
- ```tsx
49
- const notify = useNotification();
50
- const subscription = notify(message, options);
51
- ```
52
-
53
- **Parameters**
54
-
55
- | Parameter | Type | Description |
56
- |-----------|------|-------------|
57
- | `message` | `Label` | Notification body text (string or React node) |
58
- | `options` | `NotificationOptions` | Optional configuration (see below) |
59
-
60
- **NotificationOptions**
61
-
62
- | Option | Type | Default | Description |
63
- |--------|------|---------|-------------|
64
- | `id` | `string` | — | Stable ID; if provided and a toast with this ID exists, it will be updated instead of duplicated |
65
- | `title` | `Label` | — | Optional notification title |
66
- | `theme` | `NotificationTheme` | `"default"` | Visual theme variant |
67
- | `timeout` | `number` | Provider default | Override auto-dismiss duration in ms |
68
- | `closable` | `boolean` | `true` | Show close button |
69
- | `loading` | `boolean` | `false` | Replaces icon with spinning `Loader2Icon` |
70
-
71
- **Return value — NotificationSubscriber**
72
-
73
- | Method | Description |
74
- |--------|-------------|
75
- | `close()` | Dismiss this specific notification |
76
- | `clear()` | Dismiss all visible notifications |
77
-
78
- ## Themes
79
-
80
- | Value | Appearance |
81
- |-------|-----------|
82
- | `"default"` | Card background with foreground text |
83
- | `"info"` | `bg-alert-info-bg` / `text-alert-info-text` / `border-alert-info-border` |
84
- | `"success"` | `bg-alert-success-bg` / `text-alert-success-text` / `border-alert-success-border` |
85
- | `"warn"` | `bg-alert-warn-bg` / `text-alert-warn-text` / `border-alert-warn-border` |
86
- | `"danger"` | `bg-alert-danger-bg` / `text-alert-danger-text` / `border-alert-danger-border` |
87
- | `"secondary"` | `bg-alert-secondary-bg` / `text-alert-secondary-text` / `border-alert-secondary-border` |
88
- | `"muted"` | `bg-alert-muted-bg` / `text-alert-muted-text` / `border-alert-muted-border` |
89
-
90
- ## Design Tokens
91
-
92
- Tokens this component reads. Customize by overriding these CSS variables in your theme.
93
-
94
- | Token | CSS Variable | Purpose |
95
- |-------|-------------|---------|
96
- | `bg-card-background` | `--card-background` | Default notification background |
97
- | `border-card-border` | `--card-border` | Default notification border |
98
- | `text-foreground` | `--foreground` | Default notification text |
99
- | `bg-alert-{theme}-bg` | `--alert-{theme}-bg` | Themed background |
100
- | `text-alert-{theme}-text` | `--alert-{theme}-text` | Themed text |
101
- | `border-alert-{theme}-border` | `--alert-{theme}-border` | Themed border |
102
-
103
- ## Examples
104
-
105
- ### Basic Notifications
106
-
107
- ```tsx
108
- function NotificationExamples() {
109
- const notify = useNotification();
110
-
111
- return (
112
- <div className="space-y-2">
113
- <button onClick={() => notify("Default notification")}>Default</button>
114
- <button onClick={() => notify("Info message", { theme: "info" })}>Info</button>
115
- <button onClick={() => notify("Success!", { theme: "success" })}>Success</button>
116
- <button onClick={() => notify("Warning", { theme: "warn" })}>Warning</button>
117
- <button onClick={() => notify("Error occurred", { theme: "danger" })}>Error</button>
118
- </div>
119
- );
120
- }
121
- ```
122
-
123
- ### With Title
124
-
125
- ```tsx
126
- function SaveButton() {
127
- const notify = useNotification();
128
-
129
- const handleSave = () => {
130
- notify("Your changes have been saved to the server.", {
131
- title: "Changes Saved",
132
- theme: "success",
133
- timeout: 3000,
134
- });
135
- };
136
-
137
- return <button onClick={handleSave}>Save</button>;
138
- }
139
- ```
140
-
141
- ### Persistent Notification with Manual Close
142
-
143
- ```tsx
144
- function ProcessButton() {
145
- const notify = useNotification();
146
-
147
- const startProcess = () => {
148
- const subscription = notify("Processing your request…", {
149
- title: "In Progress",
150
- theme: "info",
151
- timeout: Infinity,
152
- closable: false,
153
- loading: true,
154
- });
155
-
156
- doWork().then(() => {
157
- subscription.close();
158
- notify("Process completed successfully!", { theme: "success" });
159
- });
160
- };
161
-
162
- return <button onClick={startProcess}>Start</button>;
163
- }
164
- ```
165
-
166
- ### Form Submission Feedback
167
-
168
- ```tsx
169
- function ContactForm() {
170
- const notify = useNotification();
171
-
172
- const handleSubmit = async (e: React.FormEvent) => {
173
- e.preventDefault();
174
- try {
175
- await submitForm();
176
- notify("Message sent successfully.", { title: "Done", theme: "success" });
177
- } catch {
178
- notify("Failed to send. Please try again.", {
179
- title: "Error",
180
- theme: "danger",
181
- timeout: 7000,
182
- });
183
- }
184
- };
185
-
186
- return <form onSubmit={handleSubmit}>{/* fields */}</form>;
187
- }
188
- ```
189
-
190
- ### Updating an Existing Toast
191
-
192
- ```tsx
193
- const SYNC_ID = "data-sync";
194
- const notify = useNotification();
195
-
196
- // Show initial state
197
- notify("Syncing data…", { id: SYNC_ID, theme: "info", timeout: Infinity });
198
-
199
- // Update in-place when done
200
- notify("Sync complete.", { id: SYNC_ID, theme: "success", timeout: 3000 });
201
- ```
202
-
203
- ## Do
204
-
205
- - Use the correct `theme` to convey message severity (`success`, `danger`, `warn`).
206
- - Keep messages short — toasts are glanced at, not read.
207
- - Use `title` for important notifications that need extra prominence.
208
- - Set a longer `timeout` (or `Infinity`) for critical errors that need user attention.
209
- - Use `loading: true` for in-progress operations to signal activity.
210
-
211
- ## Don't
212
-
213
- - Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`) — use `theme` instead.
214
- - Don't use arbitrary Tailwind values (`bg-[#abc]`) — override CSS variables in your `@theme` block.
215
- - Don't use notifications for information that must be acknowledged before proceeding — use a `Modal` instead.
216
- - Don't show more than 3–5 notifications at a time; configure `max` accordingly.
217
- - Don't use notifications for persistent status indicators — use `Alert` or a status bar.
218
-
219
- ## Accessibility
220
-
221
- - Built on Base UI Toast which manages ARIA live regions for screen reader announcements.
222
- - Close buttons are keyboard accessible with visible focus states.
223
- - Swipe-to-dismiss works on touch devices via the Base UI primitive.
224
- - The viewport is positioned with `role` semantics handled by the underlying primitive.
225
-
226
- ## Notes
227
-
228
- - Up to 3 notifications are visible by default; hovering the stack reveals all (up to `max`).
229
- - Animations use Framer Motion (`motion/react`) with spring physics for enter/exit.
230
- - The viewport is centered horizontally at the top of the viewport (`top-6`, `z-[100]`).
231
- - When `max` is exceeded, a pill showing `+N more` appears below the visible toasts.