@dowel-ui/react 0.4.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/README.md +9 -5
  2. package/dist/blocks/admin-dashboard/meta.js +31 -0
  3. package/dist/blocks/admin-dashboard/meta.js.map +1 -0
  4. package/dist/blocks/agent-console/meta.js +27 -0
  5. package/dist/blocks/agent-console/meta.js.map +1 -0
  6. package/dist/blocks/ai-dashboard/meta.js +25 -0
  7. package/dist/blocks/ai-dashboard/meta.js.map +1 -0
  8. package/dist/blocks/ai-workspace/meta.js +33 -0
  9. package/dist/blocks/ai-workspace/meta.js.map +1 -0
  10. package/dist/blocks/analytics/meta.js +24 -0
  11. package/dist/blocks/analytics/meta.js.map +1 -0
  12. package/dist/blocks/billing/meta.js +25 -0
  13. package/dist/blocks/billing/meta.js.map +1 -0
  14. package/dist/blocks/command-center/meta.js +28 -0
  15. package/dist/blocks/command-center/meta.js.map +1 -0
  16. package/dist/blocks/crm/meta.js +32 -0
  17. package/dist/blocks/crm/meta.js.map +1 -0
  18. package/dist/blocks/onboarding/meta.js +23 -0
  19. package/dist/blocks/onboarding/meta.js.map +1 -0
  20. package/dist/components/accordion/accordion.js +1 -1
  21. package/dist/components/accordion/accordion.js.map +1 -1
  22. package/dist/components/activity-feed/activity-feed.js +1 -1
  23. package/dist/components/activity-feed/activity-feed.js.map +1 -1
  24. package/dist/components/ai-agent-plan/ai-agent-plan.js +1 -1
  25. package/dist/components/ai-agent-plan/ai-agent-plan.js.map +1 -1
  26. package/dist/components/ai-extraction-review/ai-extraction-review.d.ts +52 -0
  27. package/dist/components/ai-extraction-review/ai-extraction-review.d.ts.map +1 -0
  28. package/dist/components/ai-extraction-review/ai-extraction-review.js +249 -0
  29. package/dist/components/ai-extraction-review/ai-extraction-review.js.map +1 -0
  30. package/dist/components/ai-extraction-review/extraction-model.d.ts +94 -0
  31. package/dist/components/ai-extraction-review/extraction-model.d.ts.map +1 -0
  32. package/dist/components/ai-extraction-review/extraction-model.js +91 -0
  33. package/dist/components/ai-extraction-review/extraction-model.js.map +1 -0
  34. package/dist/components/ai-extraction-review/index.d.ts +3 -0
  35. package/dist/components/ai-extraction-review/index.js +3 -0
  36. package/dist/components/ai-extraction-review/meta.js +17 -0
  37. package/dist/components/ai-extraction-review/meta.js.map +1 -0
  38. package/dist/components/ai-prompt-input/ai-prompt-input.js +1 -1
  39. package/dist/components/ai-prompt-input/ai-prompt-input.js.map +1 -1
  40. package/dist/components/ai-reasoning/ai-reasoning.js +1 -1
  41. package/dist/components/ai-reasoning/ai-reasoning.js.map +1 -1
  42. package/dist/components/ai-response/ai-response.js +2 -2
  43. package/dist/components/ai-response/ai-response.js.map +1 -1
  44. package/dist/components/ai-suggested-value/ai-suggested-value.d.ts +72 -0
  45. package/dist/components/ai-suggested-value/ai-suggested-value.d.ts.map +1 -0
  46. package/dist/components/ai-suggested-value/ai-suggested-value.js +126 -0
  47. package/dist/components/ai-suggested-value/ai-suggested-value.js.map +1 -0
  48. package/dist/components/ai-suggested-value/index.d.ts +2 -0
  49. package/dist/components/ai-suggested-value/index.js +2 -0
  50. package/dist/components/ai-suggested-value/meta.js +17 -0
  51. package/dist/components/ai-suggested-value/meta.js.map +1 -0
  52. package/dist/components/ai-tool/ai-tool.js +2 -2
  53. package/dist/components/ai-tool/ai-tool.js.map +1 -1
  54. package/dist/components/breadcrumb/breadcrumb.d.ts +52 -0
  55. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
  56. package/dist/components/breadcrumb/breadcrumb.js +141 -0
  57. package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
  58. package/dist/components/breadcrumb/index.d.ts +2 -0
  59. package/dist/components/breadcrumb/index.js +2 -0
  60. package/dist/components/breadcrumb/meta.js +17 -0
  61. package/dist/components/breadcrumb/meta.js.map +1 -0
  62. package/dist/components/calendar/calendar.js +2 -2
  63. package/dist/components/calendar/calendar.js.map +1 -1
  64. package/dist/components/code-block/code-block.js +1 -1
  65. package/dist/components/code-block/code-block.js.map +1 -1
  66. package/dist/components/collapsible/collapsible.d.ts +30 -0
  67. package/dist/components/collapsible/collapsible.d.ts.map +1 -0
  68. package/dist/components/collapsible/collapsible.js +38 -0
  69. package/dist/components/collapsible/collapsible.js.map +1 -0
  70. package/dist/components/collapsible/index.d.ts +2 -0
  71. package/dist/components/collapsible/index.js +2 -0
  72. package/dist/components/collapsible/meta.js +17 -0
  73. package/dist/components/collapsible/meta.js.map +1 -0
  74. package/dist/components/combobox/combobox.js +2 -2
  75. package/dist/components/combobox/combobox.js.map +1 -1
  76. package/dist/components/command/command.js +1 -1
  77. package/dist/components/command/command.js.map +1 -1
  78. package/dist/components/confirm-typed/confirm-typed.d.ts +47 -0
  79. package/dist/components/confirm-typed/confirm-typed.d.ts.map +1 -0
  80. package/dist/components/confirm-typed/confirm-typed.js +106 -0
  81. package/dist/components/confirm-typed/confirm-typed.js.map +1 -0
  82. package/dist/components/confirm-typed/index.d.ts +2 -0
  83. package/dist/components/confirm-typed/index.js +2 -0
  84. package/dist/components/confirm-typed/meta.js +17 -0
  85. package/dist/components/confirm-typed/meta.js.map +1 -0
  86. package/dist/components/cron-editor/cron-editor.d.ts +36 -0
  87. package/dist/components/cron-editor/cron-editor.d.ts.map +1 -0
  88. package/dist/components/cron-editor/cron-editor.js +493 -0
  89. package/dist/components/cron-editor/cron-editor.js.map +1 -0
  90. package/dist/components/cron-editor/cron-expression.d.ts +82 -0
  91. package/dist/components/cron-editor/cron-expression.d.ts.map +1 -0
  92. package/dist/components/cron-editor/cron-expression.js +352 -0
  93. package/dist/components/cron-editor/cron-expression.js.map +1 -0
  94. package/dist/components/cron-editor/index.d.ts +3 -0
  95. package/dist/components/cron-editor/index.js +3 -0
  96. package/dist/components/cron-editor/meta.js +17 -0
  97. package/dist/components/cron-editor/meta.js.map +1 -0
  98. package/dist/components/data-table/data-table.d.ts.map +1 -1
  99. package/dist/components/data-table/data-table.js +4 -1
  100. package/dist/components/data-table/data-table.js.map +1 -1
  101. package/dist/components/dialog/dialog.js +2 -2
  102. package/dist/components/dialog/dialog.js.map +1 -1
  103. package/dist/components/diff-viewer/diff-viewer.js +4 -4
  104. package/dist/components/diff-viewer/diff-viewer.js.map +1 -1
  105. package/dist/components/direction/direction.d.ts +35 -0
  106. package/dist/components/direction/direction.d.ts.map +1 -0
  107. package/dist/components/direction/direction.js +14 -0
  108. package/dist/components/direction/direction.js.map +1 -0
  109. package/dist/components/direction/index.d.ts +2 -0
  110. package/dist/components/direction/index.js +2 -0
  111. package/dist/components/direction/meta.js +17 -0
  112. package/dist/components/direction/meta.js.map +1 -0
  113. package/dist/components/dns-record/dns-record.d.ts +61 -0
  114. package/dist/components/dns-record/dns-record.d.ts.map +1 -0
  115. package/dist/components/dns-record/dns-record.js +227 -0
  116. package/dist/components/dns-record/dns-record.js.map +1 -0
  117. package/dist/components/dns-record/index.d.ts +2 -0
  118. package/dist/components/dns-record/index.js +2 -0
  119. package/dist/components/dns-record/meta.js +17 -0
  120. package/dist/components/dns-record/meta.js.map +1 -0
  121. package/dist/components/drawer/drawer.js +1 -1
  122. package/dist/components/drawer/drawer.js.map +1 -1
  123. package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  124. package/dist/components/dropdown-menu/dropdown-menu.js +9 -8
  125. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
  126. package/dist/components/input/input.js +1 -1
  127. package/dist/components/input/input.js.map +1 -1
  128. package/dist/components/log-viewer/log-viewer.js +2 -2
  129. package/dist/components/log-viewer/log-viewer.js.map +1 -1
  130. package/dist/components/meter/meter.js +1 -1
  131. package/dist/components/meter/meter.js.map +1 -1
  132. package/dist/components/pagination/pagination.d.ts.map +1 -1
  133. package/dist/components/pagination/pagination.js +3 -2
  134. package/dist/components/pagination/pagination.js.map +1 -1
  135. package/dist/components/permission-matrix/index.d.ts +3 -0
  136. package/dist/components/permission-matrix/index.js +3 -0
  137. package/dist/components/permission-matrix/meta.js +17 -0
  138. package/dist/components/permission-matrix/meta.js.map +1 -0
  139. package/dist/components/permission-matrix/permission-matrix.d.ts +46 -0
  140. package/dist/components/permission-matrix/permission-matrix.d.ts.map +1 -0
  141. package/dist/components/permission-matrix/permission-matrix.js +199 -0
  142. package/dist/components/permission-matrix/permission-matrix.js.map +1 -0
  143. package/dist/components/permission-matrix/permission-model.d.ts +53 -0
  144. package/dist/components/permission-matrix/permission-model.d.ts.map +1 -0
  145. package/dist/components/permission-matrix/permission-model.js +64 -0
  146. package/dist/components/permission-matrix/permission-model.js.map +1 -0
  147. package/dist/components/record-diff/record-diff.js +4 -4
  148. package/dist/components/record-diff/record-diff.js.map +1 -1
  149. package/dist/components/secret-field/index.d.ts +2 -0
  150. package/dist/components/secret-field/index.js +2 -0
  151. package/dist/components/secret-field/meta.js +17 -0
  152. package/dist/components/secret-field/meta.js.map +1 -0
  153. package/dist/components/secret-field/secret-field.d.ts +58 -0
  154. package/dist/components/secret-field/secret-field.d.ts.map +1 -0
  155. package/dist/components/secret-field/secret-field.js +168 -0
  156. package/dist/components/secret-field/secret-field.js.map +1 -0
  157. package/dist/components/select/select.js +2 -2
  158. package/dist/components/select/select.js.map +1 -1
  159. package/dist/components/session-expiry/index.d.ts +2 -0
  160. package/dist/components/session-expiry/index.js +2 -0
  161. package/dist/components/session-expiry/meta.js +17 -0
  162. package/dist/components/session-expiry/meta.js.map +1 -0
  163. package/dist/components/session-expiry/session-expiry.d.ts +64 -0
  164. package/dist/components/session-expiry/session-expiry.d.ts.map +1 -0
  165. package/dist/components/session-expiry/session-expiry.js +185 -0
  166. package/dist/components/session-expiry/session-expiry.js.map +1 -0
  167. package/dist/components/sheet/sheet.d.ts.map +1 -1
  168. package/dist/components/sheet/sheet.js +2 -2
  169. package/dist/components/sheet/sheet.js.map +1 -1
  170. package/dist/components/shortcut-recorder/index.d.ts +3 -0
  171. package/dist/components/shortcut-recorder/index.js +3 -0
  172. package/dist/components/shortcut-recorder/meta.js +17 -0
  173. package/dist/components/shortcut-recorder/meta.js.map +1 -0
  174. package/dist/components/shortcut-recorder/shortcut-model.d.ts +67 -0
  175. package/dist/components/shortcut-recorder/shortcut-model.d.ts.map +1 -0
  176. package/dist/components/shortcut-recorder/shortcut-model.js +168 -0
  177. package/dist/components/shortcut-recorder/shortcut-model.js.map +1 -0
  178. package/dist/components/shortcut-recorder/shortcut-recorder.d.ts +47 -0
  179. package/dist/components/shortcut-recorder/shortcut-recorder.d.ts.map +1 -0
  180. package/dist/components/shortcut-recorder/shortcut-recorder.js +212 -0
  181. package/dist/components/shortcut-recorder/shortcut-recorder.js.map +1 -0
  182. package/dist/components/sidebar/index.d.ts +2 -0
  183. package/dist/components/sidebar/index.js +2 -0
  184. package/dist/components/sidebar/meta.js +17 -0
  185. package/dist/components/sidebar/meta.js.map +1 -0
  186. package/dist/components/sidebar/sidebar.d.ts +69 -0
  187. package/dist/components/sidebar/sidebar.d.ts.map +1 -0
  188. package/dist/components/sidebar/sidebar.js +256 -0
  189. package/dist/components/sidebar/sidebar.js.map +1 -0
  190. package/dist/components/sync-status/index.d.ts +2 -0
  191. package/dist/components/sync-status/index.js +2 -0
  192. package/dist/components/sync-status/meta.js +17 -0
  193. package/dist/components/sync-status/meta.js.map +1 -0
  194. package/dist/components/sync-status/sync-status.d.ts +65 -0
  195. package/dist/components/sync-status/sync-status.d.ts.map +1 -0
  196. package/dist/components/sync-status/sync-status.js +103 -0
  197. package/dist/components/sync-status/sync-status.js.map +1 -0
  198. package/dist/components/table/table.js +2 -2
  199. package/dist/components/table/table.js.map +1 -1
  200. package/dist/components/tags-input/tags-input.js +1 -1
  201. package/dist/components/tags-input/tags-input.js.map +1 -1
  202. package/dist/components/textarea/index.d.ts +2 -0
  203. package/dist/components/textarea/index.js +2 -0
  204. package/dist/components/textarea/meta.js +17 -0
  205. package/dist/components/textarea/meta.js.map +1 -0
  206. package/dist/components/textarea/textarea.d.ts +43 -0
  207. package/dist/components/textarea/textarea.d.ts.map +1 -0
  208. package/dist/components/textarea/textarea.js +119 -0
  209. package/dist/components/textarea/textarea.js.map +1 -0
  210. package/dist/components/time-range-picker/time-range-picker.js +3 -3
  211. package/dist/components/time-range-picker/time-range-picker.js.map +1 -1
  212. package/dist/components/toast/toast.d.ts.map +1 -1
  213. package/dist/components/toast/toast.js +2 -2
  214. package/dist/components/toast/toast.js.map +1 -1
  215. package/dist/index.d.ts +36 -2
  216. package/dist/index.js +22 -3
  217. package/dist/lib/styles.d.ts +16 -1
  218. package/dist/lib/styles.d.ts.map +1 -1
  219. package/dist/lib/styles.js +16 -1
  220. package/dist/lib/styles.js.map +1 -1
  221. package/dist/registry/blocks.d.ts.map +1 -1
  222. package/dist/registry/blocks.js +27 -9
  223. package/dist/registry/blocks.js.map +1 -1
  224. package/dist/registry/components.d.ts.map +1 -1
  225. package/dist/registry/components.js +84 -54
  226. package/dist/registry/components.js.map +1 -1
  227. package/dist/registry/schema.d.ts +8 -0
  228. package/dist/registry/schema.d.ts.map +1 -1
  229. package/dist/registry/schema.js.map +1 -1
  230. package/package.json +5 -4
  231. package/src/components/accordion/accordion.tsx +1 -1
  232. package/src/components/activity-feed/activity-feed.tsx +1 -1
  233. package/src/components/ai-agent-plan/ai-agent-plan.tsx +0 -0
  234. package/src/components/ai-extraction-review/ai-extraction-review.tsx +492 -0
  235. package/src/components/ai-extraction-review/extraction-model.ts +159 -0
  236. package/src/components/ai-extraction-review/index.ts +13 -0
  237. package/src/components/ai-extraction-review/meta.ts +24 -0
  238. package/src/components/ai-prompt-input/ai-prompt-input.tsx +1 -1
  239. package/src/components/ai-reasoning/ai-reasoning.tsx +1 -1
  240. package/src/components/ai-response/ai-response.tsx +2 -2
  241. package/src/components/ai-suggested-value/ai-suggested-value.tsx +295 -0
  242. package/src/components/ai-suggested-value/index.ts +6 -0
  243. package/src/components/ai-suggested-value/meta.ts +24 -0
  244. package/src/components/ai-tool/ai-tool.tsx +2 -2
  245. package/src/components/breadcrumb/breadcrumb.tsx +157 -0
  246. package/src/components/breadcrumb/index.ts +10 -0
  247. package/src/components/breadcrumb/meta.ts +19 -0
  248. package/src/components/calendar/calendar.tsx +2 -2
  249. package/src/components/code-block/code-block.tsx +1 -1
  250. package/src/components/collapsible/collapsible.tsx +63 -0
  251. package/src/components/collapsible/index.ts +6 -0
  252. package/src/components/collapsible/meta.ts +16 -0
  253. package/src/components/combobox/combobox.tsx +2 -2
  254. package/src/components/command/command.tsx +1 -1
  255. package/src/components/confirm-typed/confirm-typed.tsx +191 -0
  256. package/src/components/confirm-typed/index.ts +1 -0
  257. package/src/components/confirm-typed/meta.ts +22 -0
  258. package/src/components/cron-editor/cron-editor.tsx +676 -0
  259. package/src/components/cron-editor/cron-expression.ts +552 -0
  260. package/src/components/cron-editor/index.ts +23 -0
  261. package/src/components/cron-editor/meta.ts +23 -0
  262. package/src/components/data-table/data-table.tsx +14 -3
  263. package/src/components/dialog/dialog.tsx +2 -2
  264. package/src/components/diff-viewer/diff-viewer.tsx +4 -4
  265. package/src/components/direction/direction.tsx +38 -0
  266. package/src/components/direction/index.ts +1 -0
  267. package/src/components/direction/meta.ts +19 -0
  268. package/src/components/dns-record/dns-record.tsx +315 -0
  269. package/src/components/dns-record/index.ts +7 -0
  270. package/src/components/dns-record/meta.ts +21 -0
  271. package/src/components/drawer/drawer.tsx +1 -1
  272. package/src/components/dropdown-menu/dropdown-menu.tsx +14 -8
  273. package/src/components/input/input.tsx +1 -1
  274. package/src/components/log-viewer/log-viewer.tsx +2 -2
  275. package/src/components/meter/meter.tsx +1 -1
  276. package/src/components/pagination/pagination.tsx +13 -2
  277. package/src/components/permission-matrix/index.ts +14 -0
  278. package/src/components/permission-matrix/meta.ts +23 -0
  279. package/src/components/permission-matrix/permission-matrix.tsx +368 -0
  280. package/src/components/permission-matrix/permission-model.ts +120 -0
  281. package/src/components/record-diff/record-diff.tsx +4 -4
  282. package/src/components/secret-field/index.ts +6 -0
  283. package/src/components/secret-field/meta.ts +21 -0
  284. package/src/components/secret-field/secret-field.tsx +284 -0
  285. package/src/components/select/select.tsx +2 -2
  286. package/src/components/session-expiry/index.ts +9 -0
  287. package/src/components/session-expiry/meta.ts +23 -0
  288. package/src/components/session-expiry/session-expiry.tsx +321 -0
  289. package/src/components/sheet/sheet.tsx +8 -4
  290. package/src/components/shortcut-recorder/index.ts +19 -0
  291. package/src/components/shortcut-recorder/meta.ts +22 -0
  292. package/src/components/shortcut-recorder/shortcut-model.ts +204 -0
  293. package/src/components/shortcut-recorder/shortcut-recorder.tsx +336 -0
  294. package/src/components/sidebar/index.ts +19 -0
  295. package/src/components/sidebar/meta.ts +25 -0
  296. package/src/components/sidebar/sidebar.tsx +374 -0
  297. package/src/components/sync-status/index.ts +9 -0
  298. package/src/components/sync-status/meta.ts +21 -0
  299. package/src/components/sync-status/sync-status.tsx +217 -0
  300. package/src/components/table/table.tsx +3 -3
  301. package/src/components/tags-input/tags-input.tsx +1 -1
  302. package/src/components/textarea/index.ts +1 -0
  303. package/src/components/textarea/meta.ts +21 -0
  304. package/src/components/textarea/textarea.tsx +210 -0
  305. package/src/components/time-range-picker/time-range-picker.tsx +3 -3
  306. package/src/components/toast/toast.tsx +14 -6
  307. package/src/index.ts +15 -0
  308. package/src/lib/styles.ts +16 -0
  309. package/src/registry/blocks.ts +18 -0
  310. package/src/registry/components.ts +30 -0
  311. package/src/registry/schema.ts +8 -0
  312. package/src/blocks/admin-users/admin-users.tsx +0 -251
  313. package/src/blocks/admin-users/index.ts +0 -1
  314. package/src/blocks/admin-users/meta.ts +0 -27
  315. package/src/blocks/ai-chat/ai-chat.tsx +0 -280
  316. package/src/blocks/ai-chat/index.ts +0 -7
  317. package/src/blocks/ai-chat/meta.ts +0 -32
  318. package/src/blocks/dashboard/dashboard.tsx +0 -192
  319. package/src/blocks/dashboard/index.ts +0 -6
  320. package/src/blocks/dashboard/meta.ts +0 -18
  321. package/src/blocks/forgot-password/forgot-password.tsx +0 -158
  322. package/src/blocks/forgot-password/index.ts +0 -1
  323. package/src/blocks/forgot-password/meta.ts +0 -18
  324. package/src/blocks/login/index.ts +0 -1
  325. package/src/blocks/login/login.tsx +0 -178
  326. package/src/blocks/login/meta.ts +0 -18
  327. package/src/blocks/pricing/index.ts +0 -1
  328. package/src/blocks/pricing/meta.ts +0 -18
  329. package/src/blocks/pricing/pricing.tsx +0 -176
  330. package/src/blocks/settings/index.ts +0 -6
  331. package/src/blocks/settings/meta.ts +0 -29
  332. package/src/blocks/settings/settings.tsx +0 -317
  333. package/src/blocks/signup/index.ts +0 -1
  334. package/src/blocks/signup/meta.ts +0 -18
  335. package/src/blocks/signup/signup.tsx +0 -240
@@ -0,0 +1,374 @@
1
+ "use client";
2
+
3
+ import { Slot } from "radix-ui";
4
+ import {
5
+ createContext,
6
+ useContext,
7
+ useId,
8
+ useMemo,
9
+ useState,
10
+ useSyncExternalStore,
11
+ type ComponentPropsWithRef,
12
+ type ReactNode,
13
+ } from "react";
14
+
15
+ import { Sheet, SheetContent, SheetTitle } from "@/components/sheet";
16
+ import { disabledStyles, focusRing } from "@/lib/styles";
17
+ import { cn } from "@/lib/utils";
18
+
19
+ /**
20
+ * The application's own navigation.
21
+ *
22
+ * Two states, not one. On a wide screen it collapses to a rail of icons and
23
+ * stays in the page; on a narrow one it is an overlay, which needs a focus trap
24
+ * and an Escape key and is therefore a Sheet rather than a div with a
25
+ * transform. Building one behaviour and hiding it at a breakpoint gets the
26
+ * mobile case wrong every time — the page behind stays reachable by Tab while
27
+ * the menu covers it.
28
+ *
29
+ * The collapsed rail is where these usually fail. Hiding the label leaves a
30
+ * button whose only content is an icon, and an icon has no accessible name. The
31
+ * label here is not removed but visually hidden, so the control keeps its name
32
+ * whether or not the text is on screen.
33
+ *
34
+ * The overlay is mounted only on a narrow screen, and it has its own open
35
+ * state. Mounting it always and hiding it with CSS was the first version, and
36
+ * it was wrong in a way no visual check catches: a modal dialog that is
37
+ * `display: none` is still modal. It marks the rest of the page `aria-hidden`,
38
+ * traps focus in an element nothing can focus, and turns pointer events off on
39
+ * the body — so on a desktop the whole application was invisible to a screen
40
+ * reader and unclickable the moment the sidebar was open, which is its default.
41
+ */
42
+
43
+ /** Below Tailwind's `md` breakpoint, which is where the rail gives way to the overlay. */
44
+ const NARROW_QUERY = "(max-width: 767px)";
45
+
46
+ function subscribeToNarrow(callback: () => void): () => void {
47
+ const query = window.matchMedia(NARROW_QUERY);
48
+ query.addEventListener("change", callback);
49
+ return () => {
50
+ query.removeEventListener("change", callback);
51
+ };
52
+ }
53
+
54
+ /**
55
+ * Whether the viewport is narrow enough for the overlay.
56
+ *
57
+ * The server snapshot says "wide": the rail renders in the HTML and CSS hides
58
+ * it below the breakpoint, so a narrow screen shows nothing wrong before
59
+ * hydration and the sheet mounts, closed, straight after.
60
+ */
61
+ function useIsNarrow(): boolean {
62
+ return useSyncExternalStore(
63
+ subscribeToNarrow,
64
+ () => window.matchMedia(NARROW_QUERY).matches,
65
+ () => false,
66
+ );
67
+ }
68
+
69
+ interface SidebarContextValue {
70
+ /** The rail is expanded rather than collapsed. */
71
+ open: boolean;
72
+ setOpen: (open: boolean) => void;
73
+ /** The viewport is narrow, so the navigation is an overlay. */
74
+ narrow: boolean;
75
+ /** The overlay is showing. Only meaningful when `narrow`. */
76
+ overlayOpen: boolean;
77
+ setOverlayOpen: (open: boolean) => void;
78
+ /** Whichever of the two states applies on this viewport. */
79
+ toggle: () => void;
80
+ /** Id of the sidebar element, for the trigger's aria-controls. */
81
+ sidebarId: string;
82
+ }
83
+
84
+ const SidebarContext = createContext<SidebarContextValue | null>(null);
85
+
86
+ function useSidebar(component: string): SidebarContextValue {
87
+ const context = useContext(SidebarContext);
88
+ if (!context) {
89
+ throw new Error(`${component} must be rendered inside <SidebarProvider>.`);
90
+ }
91
+ return context;
92
+ }
93
+
94
+ export interface SidebarProviderProps {
95
+ /** Controlled open state. */
96
+ open?: boolean;
97
+ defaultOpen?: boolean;
98
+ onOpenChange?: (open: boolean) => void;
99
+ children?: ReactNode;
100
+ }
101
+
102
+ export function SidebarProvider({
103
+ open: openProp,
104
+ defaultOpen = true,
105
+ onOpenChange,
106
+ children,
107
+ }: SidebarProviderProps) {
108
+ const [uncontrolled, setUncontrolled] = useState(defaultOpen);
109
+ const open = openProp ?? uncontrolled;
110
+ // Separate from `open`, and never true to begin with: "expanded by default"
111
+ // is a fact about the rail. An overlay that covers the page on first load is
112
+ // a menu nobody asked for.
113
+ const [overlayOpen, setOverlayOpen] = useState(false);
114
+ const narrow = useIsNarrow();
115
+ const sidebarId = useId();
116
+
117
+ const value = useMemo<SidebarContextValue>(() => {
118
+ const setOpen = (next: boolean) => {
119
+ if (openProp === undefined) setUncontrolled(next);
120
+ onOpenChange?.(next);
121
+ };
122
+
123
+ return {
124
+ open,
125
+ setOpen,
126
+ narrow,
127
+ overlayOpen,
128
+ setOverlayOpen,
129
+ toggle: () => {
130
+ if (narrow) setOverlayOpen(!overlayOpen);
131
+ else setOpen(!open);
132
+ },
133
+ sidebarId,
134
+ };
135
+ }, [open, openProp, onOpenChange, narrow, overlayOpen, sidebarId]);
136
+
137
+ return <SidebarContext.Provider value={value}>{children}</SidebarContext.Provider>;
138
+ }
139
+
140
+ export interface SidebarProps extends ComponentPropsWithRef<"aside"> {
141
+ /**
142
+ * Names the navigation landmark.
143
+ *
144
+ * Required, not optional. A page has more than one navigation region — this,
145
+ * a breadcrumb, a footer — and three landmarks all called "navigation" is a
146
+ * list a screen reader user cannot choose from.
147
+ */
148
+ label: string;
149
+ /** Title for the overlay on a narrow screen, where it is a dialog. */
150
+ mobileTitle?: string;
151
+ }
152
+
153
+ export function Sidebar({ className, label, mobileTitle, children, ...props }: SidebarProps) {
154
+ const { open, narrow, overlayOpen, setOverlayOpen, sidebarId } = useSidebar("Sidebar");
155
+
156
+ return (
157
+ <>
158
+ {/*
159
+ The overlay, on a narrow screen. A Sheet rather than a styled div: it
160
+ traps focus, closes on Escape and marks the rest of the page inert,
161
+ none of which a transform does — and without them the page behind stays
162
+ reachable by Tab while the menu covers it.
163
+
164
+ Mounted only when the screen is narrow. Those three behaviours are
165
+ exactly why it must not exist on a wide one: see the note at the top.
166
+ */}
167
+ {narrow ? (
168
+ <Sheet open={overlayOpen} onOpenChange={setOverlayOpen}>
169
+ <SheetContent side="left" className="w-72 p-0">
170
+ <SheetTitle className="sr-only">{mobileTitle ?? label}</SheetTitle>
171
+ <nav aria-label={label} className="flex h-full flex-col gap-2 p-3">
172
+ {children}
173
+ </nav>
174
+ </SheetContent>
175
+ </Sheet>
176
+ ) : null}
177
+
178
+ <aside
179
+ id={sidebarId}
180
+ data-slot="sidebar"
181
+ data-state={open ? "expanded" : "collapsed"}
182
+ className={cn(
183
+ "hidden shrink-0 border-e border-border bg-background md:block",
184
+ "transition-[width] duration-[var(--duration-normal)] ease-[var(--ease-out-quint)]",
185
+ open ? "w-60" : "w-14",
186
+ className,
187
+ )}
188
+ {...props}
189
+ >
190
+ <nav aria-label={label} className="flex h-full flex-col gap-2 p-3">
191
+ {children}
192
+ </nav>
193
+ </aside>
194
+ </>
195
+ );
196
+ }
197
+
198
+ export function SidebarHeader({ className, ...props }: ComponentPropsWithRef<"div">) {
199
+ return (
200
+ <div
201
+ data-slot="sidebar-header"
202
+ className={cn("flex min-h-9 items-center gap-2 px-1", className)}
203
+ {...props}
204
+ />
205
+ );
206
+ }
207
+
208
+ export function SidebarContent({ className, ...props }: ComponentPropsWithRef<"div">) {
209
+ return (
210
+ <div
211
+ data-slot="sidebar-content"
212
+ className={cn("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto", className)}
213
+ {...props}
214
+ />
215
+ );
216
+ }
217
+
218
+ export function SidebarFooter({ className, ...props }: ComponentPropsWithRef<"div">) {
219
+ return <div data-slot="sidebar-footer" className={cn("mt-auto", className)} {...props} />;
220
+ }
221
+
222
+ export function SidebarGroup({ className, ...props }: ComponentPropsWithRef<"div">) {
223
+ return <div data-slot="sidebar-group" className={cn("grid gap-1", className)} {...props} />;
224
+ }
225
+
226
+ /**
227
+ * A heading for a group of links.
228
+ *
229
+ * Hidden rather than removed when the rail is collapsed, so the grouping
230
+ * survives for anyone not reading the layout visually.
231
+ */
232
+ export function SidebarGroupLabel({ className, ...props }: ComponentPropsWithRef<"div">) {
233
+ const { open, narrow } = useSidebar("SidebarGroupLabel");
234
+
235
+ return (
236
+ <div
237
+ data-slot="sidebar-group-label"
238
+ className={cn(
239
+ "px-2 text-xs font-medium tracking-wide text-muted-foreground uppercase",
240
+ // The rail's collapsed state is not the overlay's: a sheet is always
241
+ // wide enough for its labels.
242
+ !open && !narrow && "sr-only",
243
+ className,
244
+ )}
245
+ {...props}
246
+ />
247
+ );
248
+ }
249
+
250
+ export function SidebarMenu({ className, ...props }: ComponentPropsWithRef<"ul">) {
251
+ return <ul data-slot="sidebar-menu" className={cn("grid gap-0.5", className)} {...props} />;
252
+ }
253
+
254
+ export function SidebarMenuItem({ className, ...props }: ComponentPropsWithRef<"li">) {
255
+ return <li data-slot="sidebar-menu-item" className={cn("min-w-0", className)} {...props} />;
256
+ }
257
+
258
+ export interface SidebarMenuButtonProps extends ComponentPropsWithRef<"a"> {
259
+ /** Render the child as the control, for a router's own link or a button. */
260
+ asChild?: boolean;
261
+ /** The page currently being shown. */
262
+ isActive?: boolean;
263
+ }
264
+
265
+ /**
266
+ * One entry in the navigation.
267
+ *
268
+ * `aria-current="page"` when active, not merely a background colour: which page
269
+ * you are on is information, and a highlight conveys it to exactly one kind of
270
+ * reader.
271
+ */
272
+ export function SidebarMenuButton({
273
+ className,
274
+ asChild = false,
275
+ isActive = false,
276
+ children,
277
+ ...props
278
+ }: SidebarMenuButtonProps) {
279
+ const Component = asChild ? Slot.Root : "a";
280
+
281
+ return (
282
+ <Component
283
+ data-slot="sidebar-menu-button"
284
+ data-active={isActive || undefined}
285
+ aria-current={isActive ? "page" : undefined}
286
+ className={cn(
287
+ "flex h-9 w-full items-center gap-2.5 rounded-md px-2 text-sm",
288
+ "transition-colors duration-[var(--duration-fast)]",
289
+ "[&>svg]:size-4 [&>svg]:shrink-0",
290
+ isActive
291
+ ? "bg-accent font-medium text-accent-foreground"
292
+ : "text-muted-foreground hover:bg-accent/60 hover:text-foreground",
293
+ focusRing,
294
+ disabledStyles,
295
+ className,
296
+ )}
297
+ {...props}
298
+ >
299
+ {children}
300
+ </Component>
301
+ );
302
+ }
303
+
304
+ /**
305
+ * The text of a menu entry.
306
+ *
307
+ * Visually hidden rather than removed when the rail is collapsed. Removing it
308
+ * leaves a control whose only content is an icon, and an icon has no accessible
309
+ * name — which is how a collapsed sidebar becomes a column of buttons all
310
+ * announced as "link".
311
+ */
312
+ export function SidebarMenuLabel({ className, ...props }: ComponentPropsWithRef<"span">) {
313
+ const { open, narrow } = useSidebar("SidebarMenuLabel");
314
+
315
+ return (
316
+ <span
317
+ data-slot="sidebar-menu-label"
318
+ className={cn("min-w-0 truncate", !open && !narrow && "sr-only", className)}
319
+ {...props}
320
+ />
321
+ );
322
+ }
323
+
324
+ export interface SidebarTriggerProps extends ComponentPropsWithRef<"button"> {
325
+ /** Overrides the label, which otherwise says what pressing it will do. */
326
+ label?: string;
327
+ }
328
+
329
+ export function SidebarTrigger({ className, label, ...props }: SidebarTriggerProps) {
330
+ const { open, narrow, overlayOpen, toggle, sidebarId } = useSidebar("SidebarTrigger");
331
+
332
+ const expanded = narrow ? overlayOpen : open;
333
+ const fallback = narrow
334
+ ? overlayOpen
335
+ ? "Close navigation"
336
+ : "Open navigation"
337
+ : open
338
+ ? "Collapse navigation"
339
+ : "Expand navigation";
340
+
341
+ return (
342
+ <button
343
+ type="button"
344
+ data-slot="sidebar-trigger"
345
+ aria-expanded={expanded}
346
+ // The rail is what this controls. The overlay is a dialog that names
347
+ // itself, and pointing at an element CSS has hidden helps nobody.
348
+ aria-controls={narrow ? undefined : sidebarId}
349
+ // Says what pressing it does, not what the state currently is. "Collapse
350
+ // navigation" while it is expanded is the useful half.
351
+ aria-label={label ?? fallback}
352
+ onClick={toggle}
353
+ className={cn(
354
+ "grid size-9 shrink-0 place-items-center rounded-md text-muted-foreground",
355
+ "transition-colors duration-[var(--duration-fast)] hover:bg-accent hover:text-foreground",
356
+ focusRing,
357
+ className,
358
+ )}
359
+ {...props}
360
+ >
361
+ <svg viewBox="0 0 24 24" fill="none" aria-hidden className="size-4">
362
+ <rect x="3" y="4" width="18" height="16" rx="2" stroke="currentColor" strokeWidth="2" />
363
+ <path d="M9 4v16" stroke="currentColor" strokeWidth="2" />
364
+ </svg>
365
+ </button>
366
+ );
367
+ }
368
+
369
+ /** The region the sidebar sits beside. */
370
+ export function SidebarInset({ className, ...props }: ComponentPropsWithRef<"main">) {
371
+ return (
372
+ <main data-slot="sidebar-inset" className={cn("min-w-0 flex-1", className)} {...props} />
373
+ );
374
+ }
@@ -0,0 +1,9 @@
1
+ export {
2
+ SyncStatus,
3
+ describeSyncState,
4
+ syncState,
5
+ useOnlineStatus,
6
+ type SyncInput,
7
+ type SyncState,
8
+ type SyncStatusProps,
9
+ } from "./sync-status";
@@ -0,0 +1,21 @@
1
+ import { defineMeta } from "@/registry/schema";
2
+
3
+ export const meta = defineMeta({
4
+ name: "sync-status",
5
+ title: "Sync Status",
6
+ description: "Offline, saving, saved or failed — with the count of changes being held.",
7
+ category: "feedback",
8
+ status: "stable",
9
+ dependencies: [],
10
+ registryDependencies: ["button"],
11
+ files: ["sync-status.tsx"],
12
+ a11y:
13
+ "The word is the status and the coloured dot is decoration, hidden from assistive " +
14
+ "technology. The visible text is not a live region: every save flips it and a region on it " +
15
+ "would narrate the whole session. A separate region, present from the first render, " +
16
+ "announces transitions only — went offline with what will happen to the changes, came back " +
17
+ "with what is being saved, could not save, saved after a failure — and never the churn of " +
18
+ "saving itself. Announcing is on by default because going offline is the one thing a reader " +
19
+ "who is typing has to be told, and it can be turned off. The server render assumes online, " +
20
+ "since a page with no interface to report has no business saying offline.",
21
+ });
@@ -0,0 +1,217 @@
1
+ "use client";
2
+
3
+ import { useState, useSyncExternalStore, type ComponentPropsWithRef } from "react";
4
+
5
+ import { Button } from "@/components/button";
6
+ import { cn } from "@/lib/utils";
7
+
8
+ /**
9
+ * "Offline — 3 changes will sync when you're back."
10
+ *
11
+ * Linear, Notion, Figma and Google Docs each built this, and nothing in a
12
+ * component library touches network state at all. It is small, and it is
13
+ * the difference between an app that loses work and one that says it is
14
+ * holding it: the moment a request fails, the reader needs to know whether
15
+ * to keep typing, and whether what they typed a minute ago is anywhere.
16
+ *
17
+ * Two things this gets right that the obvious version gets wrong.
18
+ *
19
+ * `navigator.onLine` is believed in one direction only. False is reliable —
20
+ * the interface is down. True means only that there is an interface, not
21
+ * that the server is reachable, so an application's own failed request is
22
+ * the real signal and takes precedence. The hook is exported for the rest
23
+ * of the app to share the same reading.
24
+ *
25
+ * Announcements are for transitions, not states. Every save flips
26
+ * "Saving…" to "Saved", and a live region on that text narrates the whole
27
+ * session. So the visible text is not live; a separate region says something
28
+ * only when the situation changes — went offline, came back, could not sync —
29
+ * which is when a reader who is typing needs to be told.
30
+ */
31
+
32
+ export type SyncState = "synced" | "pending" | "syncing" | "offline" | "error";
33
+
34
+ export interface SyncInput {
35
+ /** From `useOnlineStatus`, or your own reading. */
36
+ online: boolean;
37
+ /** Changes waiting to be sent. */
38
+ pending?: number;
39
+ /** A send is in flight. */
40
+ syncing?: boolean;
41
+ /** The last send failed, in the reader's language. Takes precedence over `online`. */
42
+ error?: string | null;
43
+ }
44
+
45
+ /**
46
+ * Which state the inputs amount to. Error beats offline beats syncing beats
47
+ * pending beats synced: each one is the thing the reader most needs to know
48
+ * given the others.
49
+ */
50
+ export function syncState({
51
+ online,
52
+ pending = 0,
53
+ syncing = false,
54
+ error,
55
+ }: SyncInput): SyncState {
56
+ if (error) return "error";
57
+ if (!online) return "offline";
58
+ if (syncing) return "syncing";
59
+ if (pending > 0) return "pending";
60
+ return "synced";
61
+ }
62
+
63
+ const changes = (n: number) => `${String(n)} ${n === 1 ? "change" : "changes"}`;
64
+
65
+ /** The state as a sentence. Used for the visible text and the announcement. */
66
+ export function describeSyncState(
67
+ state: SyncState,
68
+ pending = 0,
69
+ error?: string | null,
70
+ ): string {
71
+ switch (state) {
72
+ case "synced":
73
+ return "All changes saved";
74
+ case "pending":
75
+ return `${changes(pending)} waiting to save`;
76
+ case "syncing":
77
+ return pending > 0 ? `Saving ${changes(pending)}…` : "Saving…";
78
+ case "offline":
79
+ return pending > 0
80
+ ? `Offline. ${changes(pending)} will save when you're back online.`
81
+ : "Offline. Changes will save when you're back online.";
82
+ case "error":
83
+ return pending > 0
84
+ ? `Could not save ${changes(pending)}. ${error ?? ""}`.trim()
85
+ : `Could not save. ${error ?? ""}`.trim();
86
+ }
87
+ }
88
+
89
+ /* The browser's reading of the network, as an external store. The server
90
+ snapshot is "online": a page rendered on the server has no interface to
91
+ report, and rendering "offline" into HTML would be a lie until hydration. */
92
+ function subscribeOnline(callback: () => void) {
93
+ window.addEventListener("online", callback);
94
+ window.addEventListener("offline", callback);
95
+ return () => {
96
+ window.removeEventListener("online", callback);
97
+ window.removeEventListener("offline", callback);
98
+ };
99
+ }
100
+ const readOnline = () => navigator.onLine;
101
+ const readOnlineOnServer = () => true;
102
+
103
+ /** Whether the browser believes it has a network. False is reliable; true is not. */
104
+ export function useOnlineStatus(): boolean {
105
+ return useSyncExternalStore(subscribeOnline, readOnline, readOnlineOnServer);
106
+ }
107
+
108
+ export interface SyncStatusProps
109
+ extends Omit<ComponentPropsWithRef<"div">, "children">, Omit<SyncInput, "online"> {
110
+ /** Omit to read the browser's own status. */
111
+ online?: boolean;
112
+ /** When the last save succeeded. Shown as a time, not a relative phrase, so no clock is needed. */
113
+ lastSyncedAt?: Date;
114
+ locale?: string;
115
+ /** Offered when a save failed. */
116
+ onRetry?: () => void;
117
+ /**
118
+ * Announce transitions. On by default, because going offline is the one
119
+ * thing a reader who is typing has to be told; syncing itself never
120
+ * announces, whichever way this is set.
121
+ */
122
+ announce?: boolean;
123
+ }
124
+
125
+ export function SyncStatus({
126
+ className,
127
+ online: onlineProp,
128
+ pending = 0,
129
+ syncing = false,
130
+ error,
131
+ lastSyncedAt,
132
+ locale,
133
+ onRetry,
134
+ announce = true,
135
+ ...props
136
+ }: SyncStatusProps) {
137
+ const browserOnline = useOnlineStatus();
138
+ const online = onlineProp ?? browserOnline;
139
+ const state = syncState({ online, pending, syncing, error });
140
+ const text = describeSyncState(state, pending, error);
141
+
142
+ // Said once, when the situation changes. Adjusted during render so the
143
+ // announcement lands in the same commit as the state it describes. Syncing
144
+ // and pending are the ordinary churn of saving and are never announced.
145
+ const [seen, setSeen] = useState(state);
146
+ const [announcement, setAnnouncement] = useState("");
147
+ // A failure is over when a save lands, not when the retry starts, so the
148
+ // recovery is remembered across the syncing in between.
149
+ const [recovering, setRecovering] = useState(false);
150
+ if (seen !== state) {
151
+ const from = seen;
152
+ setSeen(state);
153
+ if (state === "offline" || state === "error") {
154
+ setAnnouncement(text);
155
+ setRecovering(false);
156
+ } else if (from === "offline") {
157
+ setAnnouncement(
158
+ pending > 0 ? `Back online. Saving ${changes(pending)}.` : "Back online.",
159
+ );
160
+ } else if ((from === "error" || recovering) && state === "synced") {
161
+ setAnnouncement("Saved.");
162
+ setRecovering(false);
163
+ } else if (from === "error") {
164
+ setRecovering(true);
165
+ }
166
+ }
167
+
168
+ const savedAt =
169
+ lastSyncedAt !== undefined
170
+ ? new Intl.DateTimeFormat(locale, { timeStyle: "short" }).format(lastSyncedAt)
171
+ : null;
172
+
173
+ return (
174
+ <div
175
+ data-slot="sync-status"
176
+ data-state={state}
177
+ className={cn("flex flex-wrap items-center gap-x-2 gap-y-1 text-xs", className)}
178
+ {...props}
179
+ >
180
+ {/* The dot is decoration. The word is the status. */}
181
+ <span
182
+ aria-hidden="true"
183
+ className={cn(
184
+ "size-2 shrink-0 rounded-full",
185
+ state === "synced" && "bg-success",
186
+ state === "pending" && "bg-muted-foreground",
187
+ state === "syncing" && "animate-pulse-soft bg-info",
188
+ state === "offline" && "bg-warning",
189
+ state === "error" && "bg-destructive",
190
+ )}
191
+ />
192
+ <span
193
+ data-slot="sync-status-text"
194
+ className={cn(
195
+ state === "offline" && "text-warning",
196
+ state === "error" && "text-destructive",
197
+ (state === "synced" || state === "pending" || state === "syncing") &&
198
+ "text-muted-foreground",
199
+ )}
200
+ >
201
+ {text}
202
+ {savedAt && state === "synced" ? ` at ${savedAt}` : null}
203
+ </span>
204
+
205
+ {state === "error" && onRetry ? (
206
+ <Button variant="outline" size="sm" className="h-6 px-2 text-xs" onClick={onRetry}>
207
+ Retry
208
+ </Button>
209
+ ) : null}
210
+
211
+ {/* Present from the start, so the first transition is heard. */}
212
+ <span role="status" aria-live={announce ? "polite" : "off"} className="sr-only">
213
+ {announce ? announcement : ""}
214
+ </span>
215
+ </div>
216
+ );
217
+ }
@@ -98,8 +98,8 @@ export function TableHead({ className, ...props }: ComponentPropsWithRef<"th">)
98
98
  <th
99
99
  data-slot="table-head"
100
100
  className={cn(
101
- "h-10 px-3 text-left align-middle text-xs font-medium whitespace-nowrap text-muted-foreground",
102
- "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pr-0",
101
+ "h-10 px-3 text-start align-middle text-xs font-medium whitespace-nowrap text-muted-foreground",
102
+ "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pe-0",
103
103
  className,
104
104
  )}
105
105
  {...props}
@@ -113,7 +113,7 @@ export function TableCell({ className, ...props }: ComponentPropsWithRef<"td">)
113
113
  data-slot="table-cell"
114
114
  className={cn(
115
115
  "px-3 py-2.5 align-middle",
116
- "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pr-0",
116
+ "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pe-0",
117
117
  className,
118
118
  )}
119
119
  {...props}
@@ -232,7 +232,7 @@ export function TagsInput({
232
232
  removeAt(index);
233
233
  }}
234
234
  className={cn(
235
- "-mr-0.5 grid size-4 place-items-center rounded-full",
235
+ "-me-0.5 grid size-4 place-items-center rounded-full",
236
236
  "transition-colors hover:bg-foreground/10",
237
237
  focusRing,
238
238
  disabledStyles,
@@ -0,0 +1 @@
1
+ export { Textarea, textareaVariants, type TextareaProps } from "./textarea";
@@ -0,0 +1,21 @@
1
+ import { defineMeta } from "@/registry/schema";
2
+
3
+ export const meta = defineMeta({
4
+ name: "textarea",
5
+ title: "Textarea",
6
+ description:
7
+ "A multi-line text field, with optional auto-resize and a character count that knows when to stay quiet.",
8
+ category: "form",
9
+ status: "stable",
10
+ dependencies: ["class-variance-authority"],
11
+ registryDependencies: [],
12
+ files: ["textarea.tsx"],
13
+ a11y:
14
+ "Pair with a Label via htmlFor/id. The error state is driven by aria-invalid, so assistive " +
15
+ "technology and styling stay in sync. The character count is described by the field rather " +
16
+ "than announced on every keystroke — a permanently live counter reads the remaining number " +
17
+ "between every letter typed, which is unusable — so it goes live only once the limit is " +
18
+ "close, and states the remainder in words rather than as a bare ratio that is read aloud as " +
19
+ "two unlabelled numbers. Horizontal resizing is off by default, because a field dragged " +
20
+ "wider than its container is a broken layout.",
21
+ });