@burtson-labs/ui 0.13.1 → 0.14.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 (460) hide show
  1. package/LICENSES/DEPENDENCIES.txt +2745 -0
  2. package/LICENSES/Radix-MIT.txt +21 -0
  3. package/LICENSES/cmdk-MIT.txt +21 -0
  4. package/LICENSES/overrides/react-remove-scroll-bar.txt +26 -0
  5. package/LICENSES/shadcn-MIT.txt +21 -0
  6. package/README.md +20 -12
  7. package/THIRD_PARTY_NOTICES.md +15 -3
  8. package/dist/components/accordion.d.ts +4 -4
  9. package/dist/components/accordion.js +22 -18
  10. package/dist/components/accordion.js.map +1 -1
  11. package/dist/components/alert-dialog.d.ts +13 -11
  12. package/dist/components/alert-dialog.js +41 -31
  13. package/dist/components/alert-dialog.js.map +1 -1
  14. package/dist/components/alert.d.ts +5 -3
  15. package/dist/components/alert.js +12 -7
  16. package/dist/components/alert.js.map +1 -1
  17. package/dist/components/app-shell.d.ts +7 -6
  18. package/dist/components/app-shell.js +22 -14
  19. package/dist/components/app-shell.js.map +1 -1
  20. package/dist/components/attachment.d.ts +3 -3
  21. package/dist/components/attachment.js +11 -7
  22. package/dist/components/attachment.js.map +1 -1
  23. package/dist/components/audio-player.d.ts +2 -2
  24. package/dist/components/audio-player.js +9 -6
  25. package/dist/components/audio-player.js.map +1 -1
  26. package/dist/components/avatar.d.ts +4 -4
  27. package/dist/components/avatar.js +16 -12
  28. package/dist/components/avatar.js.map +1 -1
  29. package/dist/components/badge.d.ts +1 -1
  30. package/dist/components/badge.js +15 -13
  31. package/dist/components/badge.js.map +1 -1
  32. package/dist/components/breadcrumb.d.ts +8 -8
  33. package/dist/components/breadcrumb.js +27 -20
  34. package/dist/components/breadcrumb.js.map +1 -1
  35. package/dist/components/button.d.ts +9 -2
  36. package/dist/components/button.js +15 -6
  37. package/dist/components/button.js.map +1 -1
  38. package/dist/components/card.d.ts +9 -9
  39. package/dist/components/card.js +33 -23
  40. package/dist/components/card.js.map +1 -1
  41. package/dist/components/chat-history.d.ts +1 -1
  42. package/dist/components/chat-history.js +11 -9
  43. package/dist/components/chat-history.js.map +1 -1
  44. package/dist/components/chat-layout.d.ts +1 -1
  45. package/dist/components/chat-layout.js +8 -3
  46. package/dist/components/chat-layout.js.map +1 -1
  47. package/dist/components/checkbox-card.d.ts +3 -3
  48. package/dist/components/checkbox-card.js +12 -10
  49. package/dist/components/checkbox-card.js.map +1 -1
  50. package/dist/components/checkbox.d.ts +24 -3
  51. package/dist/components/checkbox.js +52 -9
  52. package/dist/components/checkbox.js.map +1 -1
  53. package/dist/components/collapsible.d.ts +3 -3
  54. package/dist/components/collapsible.js +14 -11
  55. package/dist/components/collapsible.js.map +1 -1
  56. package/dist/components/combobox.d.ts +14 -4
  57. package/dist/components/combobox.js +19 -8
  58. package/dist/components/combobox.js.map +1 -1
  59. package/dist/components/command.d.ts +68 -12
  60. package/dist/components/command.js +48 -34
  61. package/dist/components/command.js.map +1 -1
  62. package/dist/components/composer.d.ts +2 -2
  63. package/dist/components/composer.js +10 -7
  64. package/dist/components/composer.js.map +1 -1
  65. package/dist/components/connection-status.d.ts +3 -3
  66. package/dist/components/connection-status.js +19 -14
  67. package/dist/components/connection-status.js.map +1 -1
  68. package/dist/components/context-menu.d.ts +15 -14
  69. package/dist/components/context-menu.js +52 -41
  70. package/dist/components/context-menu.js.map +1 -1
  71. package/dist/components/conversation.d.ts +1 -1
  72. package/dist/components/conversation.js +7 -5
  73. package/dist/components/conversation.js.map +1 -1
  74. package/dist/components/copy-button.d.ts +1 -1
  75. package/dist/components/copy-button.js +4 -2
  76. package/dist/components/copy-button.js.map +1 -1
  77. package/dist/components/data-table.d.ts +7 -2
  78. package/dist/components/data-table.js +17 -42
  79. package/dist/components/data-table.js.map +1 -1
  80. package/dist/components/dialog.d.ts +19 -10
  81. package/dist/components/dialog.js +50 -33
  82. package/dist/components/dialog.js.map +1 -1
  83. package/dist/components/dropdown-menu.d.ts +15 -14
  84. package/dist/components/dropdown-menu.js +52 -41
  85. package/dist/components/dropdown-menu.js.map +1 -1
  86. package/dist/components/editor-tabs.d.ts +1 -1
  87. package/dist/components/editor-tabs.js +7 -5
  88. package/dist/components/editor-tabs.js.map +1 -1
  89. package/dist/components/empty-state.d.ts +5 -5
  90. package/dist/components/empty-state.js +17 -11
  91. package/dist/components/empty-state.js.map +1 -1
  92. package/dist/components/error-summary.d.ts +21 -0
  93. package/dist/components/error-summary.js +62 -0
  94. package/dist/components/error-summary.js.map +1 -0
  95. package/dist/components/field.d.ts +66 -7
  96. package/dist/components/field.js +152 -20
  97. package/dist/components/field.js.map +1 -1
  98. package/dist/components/form-actions.d.ts +18 -0
  99. package/dist/components/form-actions.js +30 -0
  100. package/dist/components/form-actions.js.map +1 -0
  101. package/dist/components/icon-button.d.ts +3 -1
  102. package/dist/components/icon-button.js +6 -3
  103. package/dist/components/icon-button.js.map +1 -1
  104. package/dist/components/input.d.ts +42 -7
  105. package/dist/components/input.js +54 -10
  106. package/dist/components/input.js.map +1 -1
  107. package/dist/components/kbd.d.ts +2 -2
  108. package/dist/components/kbd.js +8 -5
  109. package/dist/components/kbd.js.map +1 -1
  110. package/dist/components/label.d.ts +7 -2
  111. package/dist/components/label.js +14 -7
  112. package/dist/components/label.js.map +1 -1
  113. package/dist/components/markdown.d.ts +4 -3
  114. package/dist/components/markdown.js +8 -6
  115. package/dist/components/markdown.js.map +1 -1
  116. package/dist/components/menubar.d.ts +17 -15
  117. package/dist/components/menubar.js +58 -45
  118. package/dist/components/menubar.js.map +1 -1
  119. package/dist/components/message-actions.d.ts +3 -3
  120. package/dist/components/message-actions.js +16 -12
  121. package/dist/components/message-actions.js.map +1 -1
  122. package/dist/components/message.d.ts +1 -1
  123. package/dist/components/message.js +6 -3
  124. package/dist/components/message.js.map +1 -1
  125. package/dist/components/mobile-nav.d.ts +1 -1
  126. package/dist/components/mobile-nav.js +7 -5
  127. package/dist/components/mobile-nav.js.map +1 -1
  128. package/dist/components/native-select.d.ts +16 -0
  129. package/dist/components/native-select.js +33 -0
  130. package/dist/components/native-select.js.map +1 -0
  131. package/dist/components/navigation-menu.d.ts +13 -12
  132. package/dist/components/navigation-menu.js +43 -33
  133. package/dist/components/navigation-menu.js.map +1 -1
  134. package/dist/components/number-input.d.ts +23 -0
  135. package/dist/components/number-input.js +45 -0
  136. package/dist/components/number-input.js.map +1 -0
  137. package/dist/components/onboarding-checklist.d.ts +1 -1
  138. package/dist/components/onboarding-checklist.js +5 -3
  139. package/dist/components/onboarding-checklist.js.map +1 -1
  140. package/dist/components/page-header.d.ts +7 -6
  141. package/dist/components/page-header.js +23 -15
  142. package/dist/components/page-header.js.map +1 -1
  143. package/dist/components/pagination.d.ts +1 -1
  144. package/dist/components/pagination.js +4 -2
  145. package/dist/components/pagination.js.map +1 -1
  146. package/dist/components/popover.d.ts +14 -11
  147. package/dist/components/popover.js +30 -23
  148. package/dist/components/popover.js.map +1 -1
  149. package/dist/components/progress.d.ts +2 -2
  150. package/dist/components/progress.js +11 -9
  151. package/dist/components/progress.js.map +1 -1
  152. package/dist/components/radio-group.d.ts +23 -4
  153. package/dist/components/radio-group.js +56 -14
  154. package/dist/components/radio-group.js.map +1 -1
  155. package/dist/components/reasoning.d.ts +3 -3
  156. package/dist/components/reasoning.js +14 -11
  157. package/dist/components/reasoning.js.map +1 -1
  158. package/dist/components/resizable.js +1 -0
  159. package/dist/components/resizable.js.map +1 -1
  160. package/dist/components/scroll-area.d.ts +4 -3
  161. package/dist/components/scroll-area.js +18 -14
  162. package/dist/components/scroll-area.js.map +1 -1
  163. package/dist/components/secret-input.d.ts +3 -2
  164. package/dist/components/secret-input.js +7 -4
  165. package/dist/components/secret-input.js.map +1 -1
  166. package/dist/components/select.d.ts +12 -7
  167. package/dist/components/select.js +42 -35
  168. package/dist/components/select.js.map +1 -1
  169. package/dist/components/separator.d.ts +2 -2
  170. package/dist/components/separator.js +8 -6
  171. package/dist/components/separator.js.map +1 -1
  172. package/dist/components/sheet.d.ts +11 -9
  173. package/dist/components/sheet.js +41 -29
  174. package/dist/components/sheet.js.map +1 -1
  175. package/dist/components/skeleton.d.ts +2 -1
  176. package/dist/components/skeleton.js +7 -4
  177. package/dist/components/skeleton.js.map +1 -1
  178. package/dist/components/slider.d.ts +10 -6
  179. package/dist/components/slider.js +16 -7
  180. package/dist/components/slider.js.map +1 -1
  181. package/dist/components/source.d.ts +2 -2
  182. package/dist/components/source.js +10 -7
  183. package/dist/components/source.js.map +1 -1
  184. package/dist/components/spinner.d.ts +4 -2
  185. package/dist/components/spinner.js +5 -3
  186. package/dist/components/spinner.js.map +1 -1
  187. package/dist/components/stat-card.d.ts +27 -2
  188. package/dist/components/stat-card.js +70 -9
  189. package/dist/components/stat-card.js.map +1 -1
  190. package/dist/components/status.d.ts +7 -6
  191. package/dist/components/status.js +12 -5
  192. package/dist/components/status.js.map +1 -1
  193. package/dist/components/steps.d.ts +1 -1
  194. package/dist/components/steps.js +5 -3
  195. package/dist/components/steps.js.map +1 -1
  196. package/dist/components/switch.d.ts +47 -3
  197. package/dist/components/switch.js +89 -11
  198. package/dist/components/switch.js.map +1 -1
  199. package/dist/components/table.d.ts +29 -12
  200. package/dist/components/table.js +80 -34
  201. package/dist/components/table.js.map +1 -1
  202. package/dist/components/tabs.d.ts +10 -5
  203. package/dist/components/tabs.js +29 -19
  204. package/dist/components/tabs.js.map +1 -1
  205. package/dist/components/textarea.d.ts +6 -1
  206. package/dist/components/textarea.js +4 -3
  207. package/dist/components/textarea.js.map +1 -1
  208. package/dist/components/toast.d.ts +11 -7
  209. package/dist/components/toast.js +37 -27
  210. package/dist/components/toast.js.map +1 -1
  211. package/dist/components/toaster.d.ts +4 -2
  212. package/dist/components/toaster.js +7 -2
  213. package/dist/components/toaster.js.map +1 -1
  214. package/dist/components/tool-call.d.ts +2 -2
  215. package/dist/components/tool-call.js +15 -12
  216. package/dist/components/tool-call.js.map +1 -1
  217. package/dist/components/toolbar.d.ts +9 -4
  218. package/dist/components/toolbar.js +15 -9
  219. package/dist/components/toolbar.js.map +1 -1
  220. package/dist/components/tooltip.d.ts +4 -3
  221. package/dist/components/tooltip.js +17 -13
  222. package/dist/components/tooltip.js.map +1 -1
  223. package/dist/components/tour.js +10 -8
  224. package/dist/components/tour.js.map +1 -1
  225. package/dist/components/tree-view.d.ts +1 -1
  226. package/dist/components/tree-view.js +10 -5
  227. package/dist/components/tree-view.js.map +1 -1
  228. package/dist/components/voice-recorder.d.ts +1 -1
  229. package/dist/components/voice-recorder.js +5 -2
  230. package/dist/components/voice-recorder.js.map +1 -1
  231. package/dist/index.d.ts +6 -1
  232. package/dist/index.js +17 -12
  233. package/dist/lib/media.d.ts +18 -0
  234. package/dist/lib/media.js +34 -0
  235. package/dist/lib/media.js.map +1 -0
  236. package/dist/lib/utils.d.ts +32 -0
  237. package/dist/lib/utils.js +33 -1
  238. package/dist/lib/utils.js.map +1 -1
  239. package/dist/mui/index.js +20 -8
  240. package/dist/mui/index.js.map +1 -1
  241. package/dist/primitives/vendor/cmdk/command-score.d.ts +1 -0
  242. package/dist/primitives/vendor/cmdk/command-score.js +64 -0
  243. package/dist/primitives/vendor/cmdk/command-score.js.map +1 -0
  244. package/dist/primitives/vendor/cmdk/index.d.ts +384 -0
  245. package/dist/primitives/vendor/cmdk/index.js +687 -0
  246. package/dist/primitives/vendor/cmdk/index.js.map +1 -0
  247. package/dist/primitives/vendor/radix/number/index.d.ts +1 -0
  248. package/dist/primitives/vendor/radix/number/number.d.ts +2 -0
  249. package/dist/primitives/vendor/radix/number/number.js +9 -0
  250. package/dist/primitives/vendor/radix/number/number.js.map +1 -0
  251. package/dist/primitives/vendor/radix/primitive/index.d.ts +2 -0
  252. package/dist/primitives/vendor/radix/primitive/is-development.d.ts +1 -0
  253. package/dist/primitives/vendor/radix/primitive/is-development.js +7 -0
  254. package/dist/primitives/vendor/radix/primitive/is-development.js.map +1 -0
  255. package/dist/primitives/vendor/radix/primitive/primitive.d.ts +14 -0
  256. package/dist/primitives/vendor/radix/primitive/primitive.js +12 -0
  257. package/dist/primitives/vendor/radix/primitive/primitive.js.map +1 -0
  258. package/dist/primitives/vendor/radix/primitive/types.d.ts +5 -0
  259. package/dist/primitives/vendor/radix/react-accordion/accordion.d.ts +112 -0
  260. package/dist/primitives/vendor/radix/react-accordion/accordion.js +266 -0
  261. package/dist/primitives/vendor/radix/react-accordion/accordion.js.map +1 -0
  262. package/dist/primitives/vendor/radix/react-accordion/index.d.ts +2 -0
  263. package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.d.ts +49 -0
  264. package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.js +122 -0
  265. package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.js.map +1 -0
  266. package/dist/primitives/vendor/radix/react-alert-dialog/index.d.ts +2 -0
  267. package/dist/primitives/vendor/radix/react-arrow/arrow.d.ts +9 -0
  268. package/dist/primitives/vendor/radix/react-arrow/arrow.js +22 -0
  269. package/dist/primitives/vendor/radix/react-arrow/arrow.js.map +1 -0
  270. package/dist/primitives/vendor/radix/react-arrow/index.d.ts +2 -0
  271. package/dist/primitives/vendor/radix/react-avatar/avatar.d.ts +19 -0
  272. package/dist/primitives/vendor/radix/react-avatar/avatar.js +132 -0
  273. package/dist/primitives/vendor/radix/react-avatar/avatar.js.map +1 -0
  274. package/dist/primitives/vendor/radix/react-avatar/index.d.ts +2 -0
  275. package/dist/primitives/vendor/radix/react-checkbox/checkbox.d.ts +47 -0
  276. package/dist/primitives/vendor/radix/react-checkbox/checkbox.js +197 -0
  277. package/dist/primitives/vendor/radix/react-checkbox/checkbox.js.map +1 -0
  278. package/dist/primitives/vendor/radix/react-checkbox/index.d.ts +2 -0
  279. package/dist/primitives/vendor/radix/react-collapsible/collapsible.d.ts +31 -0
  280. package/dist/primitives/vendor/radix/react-collapsible/collapsible.js +133 -0
  281. package/dist/primitives/vendor/radix/react-collapsible/collapsible.js.map +1 -0
  282. package/dist/primitives/vendor/radix/react-collapsible/index.d.ts +2 -0
  283. package/dist/primitives/vendor/radix/react-collection/collection-legacy.d.ts +21 -0
  284. package/dist/primitives/vendor/radix/react-collection/collection-legacy.js +84 -0
  285. package/dist/primitives/vendor/radix/react-collection/collection-legacy.js.map +1 -0
  286. package/dist/primitives/vendor/radix/react-collection/collection.d.ts +32 -0
  287. package/dist/primitives/vendor/radix/react-collection/index.d.ts +4 -0
  288. package/dist/primitives/vendor/radix/react-collection/ordered-dictionary.d.ts +51 -0
  289. package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.d.ts +13 -0
  290. package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.js +43 -0
  291. package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.js.map +1 -0
  292. package/dist/primitives/vendor/radix/react-compose-refs/index.d.ts +1 -0
  293. package/dist/primitives/vendor/radix/react-context/create-context.d.ts +45 -0
  294. package/dist/primitives/vendor/radix/react-context/create-context.js +74 -0
  295. package/dist/primitives/vendor/radix/react-context/create-context.js.map +1 -0
  296. package/dist/primitives/vendor/radix/react-context/index.d.ts +2 -0
  297. package/dist/primitives/vendor/radix/react-context-menu/context-menu.d.ts +95 -0
  298. package/dist/primitives/vendor/radix/react-context-menu/context-menu.js +279 -0
  299. package/dist/primitives/vendor/radix/react-context-menu/context-menu.js.map +1 -0
  300. package/dist/primitives/vendor/radix/react-context-menu/index.d.ts +2 -0
  301. package/dist/primitives/vendor/radix/react-dialog/dialog.d.ts +97 -0
  302. package/dist/primitives/vendor/radix/react-dialog/dialog.js +262 -0
  303. package/dist/primitives/vendor/radix/react-dialog/dialog.js.map +1 -0
  304. package/dist/primitives/vendor/radix/react-dialog/index.d.ts +4 -0
  305. package/dist/primitives/vendor/radix/react-direction/direction.d.ts +10 -0
  306. package/dist/primitives/vendor/radix/react-direction/direction.js +13 -0
  307. package/dist/primitives/vendor/radix/react-direction/direction.js.map +1 -0
  308. package/dist/primitives/vendor/radix/react-direction/index.d.ts +1 -0
  309. package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.d.ts +61 -0
  310. package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.js +336 -0
  311. package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.js.map +1 -0
  312. package/dist/primitives/vendor/radix/react-dismissable-layer/index.d.ts +4 -0
  313. package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.d.ts +95 -0
  314. package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.js +257 -0
  315. package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.js.map +1 -0
  316. package/dist/primitives/vendor/radix/react-dropdown-menu/index.d.ts +2 -0
  317. package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.d.ts +11 -0
  318. package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.js +49 -0
  319. package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.js.map +1 -0
  320. package/dist/primitives/vendor/radix/react-focus-guards/index.d.ts +1 -0
  321. package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.d.ts +31 -0
  322. package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.js +221 -0
  323. package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.js.map +1 -0
  324. package/dist/primitives/vendor/radix/react-focus-scope/index.d.ts +1 -0
  325. package/dist/primitives/vendor/radix/react-id/id.d.ts +2 -0
  326. package/dist/primitives/vendor/radix/react-id/id.js +17 -0
  327. package/dist/primitives/vendor/radix/react-id/id.js.map +1 -0
  328. package/dist/primitives/vendor/radix/react-id/index.d.ts +1 -0
  329. package/dist/primitives/vendor/radix/react-label/index.d.ts +2 -0
  330. package/dist/primitives/vendor/radix/react-label/label.d.ts +9 -0
  331. package/dist/primitives/vendor/radix/react-label/label.js +21 -0
  332. package/dist/primitives/vendor/radix/react-label/label.js.map +1 -0
  333. package/dist/primitives/vendor/radix/react-menu/index.d.ts +2 -0
  334. package/dist/primitives/vendor/radix/react-menu/menu.d.ts +173 -0
  335. package/dist/primitives/vendor/radix/react-menu/menu.js +806 -0
  336. package/dist/primitives/vendor/radix/react-menu/menu.js.map +1 -0
  337. package/dist/primitives/vendor/radix/react-menubar/index.d.ts +2 -0
  338. package/dist/primitives/vendor/radix/react-menubar/menubar.d.ts +106 -0
  339. package/dist/primitives/vendor/radix/react-menubar/menubar.js +377 -0
  340. package/dist/primitives/vendor/radix/react-menubar/menubar.js.map +1 -0
  341. package/dist/primitives/vendor/radix/react-navigation-menu/index.d.ts +2 -0
  342. package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.d.ts +124 -0
  343. package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.js +743 -0
  344. package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.js.map +1 -0
  345. package/dist/primitives/vendor/radix/react-popover/index.d.ts +1 -0
  346. package/dist/primitives/vendor/radix/react-popover/popover.d.ts +83 -0
  347. package/dist/primitives/vendor/radix/react-popover/popover.js +236 -0
  348. package/dist/primitives/vendor/radix/react-popover/popover.js.map +1 -0
  349. package/dist/primitives/vendor/radix/react-popper/index.d.ts +2 -0
  350. package/dist/primitives/vendor/radix/react-popper/popper.d.ts +44 -0
  351. package/dist/primitives/vendor/radix/react-popper/popper.js +276 -0
  352. package/dist/primitives/vendor/radix/react-popper/popper.js.map +1 -0
  353. package/dist/primitives/vendor/radix/react-portal/index.d.ts +2 -0
  354. package/dist/primitives/vendor/radix/react-portal/portal.d.ts +13 -0
  355. package/dist/primitives/vendor/radix/react-portal/portal.js +21 -0
  356. package/dist/primitives/vendor/radix/react-portal/portal.js.map +1 -0
  357. package/dist/primitives/vendor/radix/react-presence/index.d.ts +2 -0
  358. package/dist/primitives/vendor/radix/react-presence/presence.d.ts +11 -0
  359. package/dist/primitives/vendor/radix/react-presence/presence.js +152 -0
  360. package/dist/primitives/vendor/radix/react-presence/presence.js.map +1 -0
  361. package/dist/primitives/vendor/radix/react-presence/use-state-machine.d.ts +10 -0
  362. package/dist/primitives/vendor/radix/react-presence/use-state-machine.js +12 -0
  363. package/dist/primitives/vendor/radix/react-presence/use-state-machine.js.map +1 -0
  364. package/dist/primitives/vendor/radix/react-primitive/index.d.ts +2 -0
  365. package/dist/primitives/vendor/radix/react-primitive/primitive.d.ts +56 -0
  366. package/dist/primitives/vendor/radix/react-primitive/primitive.js +84 -0
  367. package/dist/primitives/vendor/radix/react-primitive/primitive.js.map +1 -0
  368. package/dist/primitives/vendor/radix/react-progress/index.d.ts +2 -0
  369. package/dist/primitives/vendor/radix/react-progress/progress.d.ts +17 -0
  370. package/dist/primitives/vendor/radix/react-progress/progress.js +79 -0
  371. package/dist/primitives/vendor/radix/react-progress/progress.js.map +1 -0
  372. package/dist/primitives/vendor/radix/react-radio-group/index.d.ts +2 -0
  373. package/dist/primitives/vendor/radix/react-radio-group/radio-group.d.ts +55 -0
  374. package/dist/primitives/vendor/radix/react-radio-group/radio-group.js +173 -0
  375. package/dist/primitives/vendor/radix/react-radio-group/radio-group.js.map +1 -0
  376. package/dist/primitives/vendor/radix/react-radio-group/radio.d.ts +62 -0
  377. package/dist/primitives/vendor/radix/react-radio-group/radio.js +150 -0
  378. package/dist/primitives/vendor/radix/react-radio-group/radio.js.map +1 -0
  379. package/dist/primitives/vendor/radix/react-roving-focus/index.d.ts +2 -0
  380. package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.d.ts +47 -0
  381. package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.js +218 -0
  382. package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.js.map +1 -0
  383. package/dist/primitives/vendor/radix/react-scroll-area/index.d.ts +2 -0
  384. package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.d.ts +121 -0
  385. package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.js +713 -0
  386. package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.js.map +1 -0
  387. package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.d.ts +10 -0
  388. package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.js +12 -0
  389. package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.js.map +1 -0
  390. package/dist/primitives/vendor/radix/react-select/index.d.ts +2 -0
  391. package/dist/primitives/vendor/radix/react-select/select.d.ts +163 -0
  392. package/dist/primitives/vendor/radix/react-select/select.js +1040 -0
  393. package/dist/primitives/vendor/radix/react-select/select.js.map +1 -0
  394. package/dist/primitives/vendor/radix/react-separator/index.d.ts +2 -0
  395. package/dist/primitives/vendor/radix/react-separator/separator.d.ts +20 -0
  396. package/dist/primitives/vendor/radix/react-separator/separator.js +29 -0
  397. package/dist/primitives/vendor/radix/react-separator/separator.js.map +1 -0
  398. package/dist/primitives/vendor/radix/react-slot/index.d.ts +1 -0
  399. package/dist/primitives/vendor/radix/react-slot/slot.d.ts +29 -0
  400. package/dist/primitives/vendor/radix/react-slot/slot.js +107 -0
  401. package/dist/primitives/vendor/radix/react-slot/slot.js.map +1 -0
  402. package/dist/primitives/vendor/radix/react-switch/index.d.ts +2 -0
  403. package/dist/primitives/vendor/radix/react-switch/switch.d.ts +41 -0
  404. package/dist/primitives/vendor/radix/react-switch/switch.js +185 -0
  405. package/dist/primitives/vendor/radix/react-switch/switch.js.map +1 -0
  406. package/dist/primitives/vendor/radix/react-tabs/index.d.ts +2 -0
  407. package/dist/primitives/vendor/radix/react-tabs/tabs.d.ts +54 -0
  408. package/dist/primitives/vendor/radix/react-tabs/tabs.js +145 -0
  409. package/dist/primitives/vendor/radix/react-tabs/tabs.js.map +1 -0
  410. package/dist/primitives/vendor/radix/react-toast/index.d.ts +2 -0
  411. package/dist/primitives/vendor/radix/react-toast/toast.d.ts +125 -0
  412. package/dist/primitives/vendor/radix/react-toast/toast.js +557 -0
  413. package/dist/primitives/vendor/radix/react-toast/toast.js.map +1 -0
  414. package/dist/primitives/vendor/radix/react-tooltip/index.d.ts +2 -0
  415. package/dist/primitives/vendor/radix/react-tooltip/tooltip.d.ts +99 -0
  416. package/dist/primitives/vendor/radix/react-tooltip/tooltip.js +503 -0
  417. package/dist/primitives/vendor/radix/react-tooltip/tooltip.js.map +1 -0
  418. package/dist/primitives/vendor/radix/react-use-callback-ref/index.d.ts +1 -0
  419. package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.d.ts +6 -0
  420. package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.js +18 -0
  421. package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.js.map +1 -0
  422. package/dist/primitives/vendor/radix/react-use-controllable-state/index.d.ts +2 -0
  423. package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state-reducer.d.ts +28 -0
  424. package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.d.ts +11 -0
  425. package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.js +59 -0
  426. package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.js.map +1 -0
  427. package/dist/primitives/vendor/radix/react-use-effect-event/index.d.ts +1 -0
  428. package/dist/primitives/vendor/radix/react-use-effect-event/use-effect-event.d.ts +7 -0
  429. package/dist/primitives/vendor/radix/react-use-is-hydrated/index.d.ts +1 -0
  430. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.d.ts +1 -0
  431. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.js +18 -0
  432. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.js.map +1 -0
  433. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.d.ts +6 -0
  434. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.js +19 -0
  435. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.js.map +1 -0
  436. package/dist/primitives/vendor/radix/react-use-layout-effect/index.d.ts +1 -0
  437. package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.d.ts +10 -0
  438. package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.js +15 -0
  439. package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.js.map +1 -0
  440. package/dist/primitives/vendor/radix/react-use-previous/index.d.ts +1 -0
  441. package/dist/primitives/vendor/radix/react-use-previous/use-previous.d.ts +2 -0
  442. package/dist/primitives/vendor/radix/react-use-previous/use-previous.js +20 -0
  443. package/dist/primitives/vendor/radix/react-use-previous/use-previous.js.map +1 -0
  444. package/dist/primitives/vendor/radix/react-use-size/index.d.ts +1 -0
  445. package/dist/primitives/vendor/radix/react-use-size/use-size.d.ts +5 -0
  446. package/dist/primitives/vendor/radix/react-use-size/use-size.js +42 -0
  447. package/dist/primitives/vendor/radix/react-use-size/use-size.js.map +1 -0
  448. package/dist/primitives/vendor/radix/react-visually-hidden/index.d.ts +2 -0
  449. package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.d.ts +21 -0
  450. package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.js +32 -0
  451. package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.js.map +1 -0
  452. package/dist/primitives/vendor/radix/rect/index.d.ts +2 -0
  453. package/dist/primitives/vendor/radix/rect/observe-element-rect.d.ts +16 -0
  454. package/dist/styles.css +1 -1
  455. package/dist/theme.css +36 -17
  456. package/dist/tokens.d.ts +78 -36
  457. package/dist/tokens.js +63 -32
  458. package/dist/tokens.js.map +1 -1
  459. package/package.json +25 -13
  460. package/vendor-manifest.json +1101 -0
@@ -1,20 +1,98 @@
1
- import { cn } from "../lib/utils.js";
2
- import { Switch } from "radix-ui";
3
- import "react";
4
- import { jsx } from "react/jsx-runtime";
1
+ "use client";
2
+ import { cn, focusRingClasses, touchTargetClasses } from "../lib/utils.js";
3
+ import { Root as Switch$1, SwitchThumb } from "../primitives/vendor/radix/react-switch/switch.js";
4
+ import * as React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
5
6
  //#region src/components/switch.tsx
6
- function Switch$1({ className, ...props }) {
7
- return /* @__PURE__ */ jsx(Switch.Root, {
7
+ /**
8
+ * A 36×20 toggle with a 44px hit area on touch screens; the off track is the
9
+ * field border tone (`input`, 3:1 on the page), the on track primary in light
10
+ * mode and brand in dark mode (see Checkbox), focus the shared 2px outline.
11
+ */
12
+ var Switch = React.forwardRef(function Switch({ className, ...props }, ref) {
13
+ return /* @__PURE__ */ jsx(Switch$1, {
14
+ ref,
8
15
  "data-slot": "switch",
9
- className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-border-strong", className),
16
+ className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input data-[state=unchecked]:hover:bg-muted-foreground/70 dark:data-[state=checked]:bg-brand", focusRingClasses, touchTargetClasses, className),
10
17
  ...props,
11
- children: /* @__PURE__ */ jsx(Switch.Thumb, {
18
+ children: /* @__PURE__ */ jsx(SwitchThumb, {
12
19
  "data-slot": "switch-thumb",
13
- className: "pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-1px)] data-[state=unchecked]:translate-x-px dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground/80"
20
+ className: "pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-1px)] data-[state=unchecked]:translate-x-px dark:data-[state=checked]:bg-background dark:data-[state=unchecked]:bg-foreground/80"
14
21
  })
15
22
  });
16
- }
23
+ });
24
+ /**
25
+ * A setting that is on or off: what it is (and what it does) on the left,
26
+ * the switch on the right, level with the first line of the label. Several
27
+ * of them stack in a SwitchList.
28
+ */
29
+ var SwitchRow = React.forwardRef(function SwitchRow({ label, description, badge, inset, before, id: idProp, className, rowClassName, children, ...props }, ref) {
30
+ const auto = React.useId();
31
+ const id = idProp ?? auto;
32
+ return /* @__PURE__ */ jsxs("div", {
33
+ "data-slot": "switch-row",
34
+ className: cn("grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-4", before && "gap-y-2 sm:grid-cols-[minmax(0,1fr)_auto_auto]", inset && "px-4 py-3.5 sm:px-5 sm:py-4", rowClassName),
35
+ children: [
36
+ /* @__PURE__ */ jsxs("div", {
37
+ className: "grid min-w-0 gap-1",
38
+ children: [
39
+ /* @__PURE__ */ jsxs("label", {
40
+ htmlFor: id,
41
+ className: "flex min-h-5 flex-wrap items-center gap-x-2 gap-y-1 text-sm leading-5 font-medium",
42
+ children: [label, badge]
43
+ }),
44
+ description && /* @__PURE__ */ jsx("p", {
45
+ id: `${id}-description`,
46
+ className: "text-[13px] leading-5 text-muted-foreground",
47
+ children: description
48
+ }),
49
+ children
50
+ ]
51
+ }),
52
+ before && /* @__PURE__ */ jsx("div", {
53
+ className: "col-start-1 row-start-2 flex items-center sm:col-start-2 sm:row-start-1 sm:-my-2",
54
+ children: before
55
+ }),
56
+ /* @__PURE__ */ jsx(Switch, {
57
+ ref,
58
+ id,
59
+ "aria-describedby": description ? `${id}-description` : void 0,
60
+ className: cn("col-start-2 row-start-1", before && "sm:col-start-3", className),
61
+ ...props
62
+ })
63
+ ]
64
+ });
65
+ });
66
+ /** SwitchRows (with `inset`) divided by rules, in a Card or a bordered box. */
67
+ var SwitchList = React.forwardRef(function SwitchList({ bordered, className, ...props }, ref) {
68
+ return /* @__PURE__ */ jsx("div", {
69
+ ref,
70
+ "data-slot": "switch-list",
71
+ className: cn("grid divide-y divide-border", bordered && "rounded-lg border", className),
72
+ ...props
73
+ });
74
+ });
75
+ /**
76
+ * A filter that is on or off, in a row of filters: the switch first, its
77
+ * label after it, at least 44px tall on touch screens. (Settings put the
78
+ * switch on the right: SwitchRow.)
79
+ */
80
+ var InlineSwitch = React.forwardRef(function InlineSwitch({ label, id: idProp, className, rowClassName, ...props }, ref) {
81
+ const auto = React.useId();
82
+ const id = idProp ?? auto;
83
+ return /* @__PURE__ */ jsxs("label", {
84
+ htmlFor: id,
85
+ "data-slot": "inline-switch",
86
+ className: cn("flex min-h-5 cursor-pointer items-center gap-2.5 text-sm leading-5 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60 pointer-coarse:min-h-11", rowClassName),
87
+ children: [/* @__PURE__ */ jsx(Switch, {
88
+ ref,
89
+ id,
90
+ className,
91
+ ...props
92
+ }), label]
93
+ });
94
+ });
17
95
  //#endregion
18
- export { Switch$1 as Switch };
96
+ export { InlineSwitch, Switch, SwitchList, SwitchRow };
19
97
 
20
98
  //# sourceMappingURL=switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","names":["Switch","SwitchPrimitive"],"sources":["../../src/components/switch.tsx"],"sourcesContent":["import { Switch as SwitchPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nfunction Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-border-strong',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-1px)] data-[state=unchecked]:translate-x-px dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground/80\"\n />\n </SwitchPrimitive.Root>\n );\n}\n\nexport { Switch };\n"],"mappings":";;;;;AAKA,SAASA,SAAO,EAAE,WAAW,GAAG,SAA4D;CAC1F,OACE,oBAACC,OAAgB,MAAjB;EACE,aAAU;EACV,WAAW,GACT,8SACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAACA,OAAgB,OAAjB;GACE,aAAU;GACV,WAAU;EACX,CAAA;CACmB,CAAA;AAE1B"}
1
+ {"version":3,"file":"switch.js","names":["SwitchPrimitive.Root","SwitchPrimitive.Thumb"],"sources":["../../src/components/switch.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn, focusRingClasses, touchTargetClasses } from '../lib/utils';\nimport * as SwitchPrimitive from '../primitives/vendor/radix/react-switch';\n\n/**\n * A 36×20 toggle with a 44px hit area on touch screens; the off track is the\n * field border tone (`input`, 3:1 on the page), the on track primary in light\n * mode and brand in dark mode (see Checkbox), focus the shared 2px outline.\n */\nconst Switch = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof SwitchPrimitive.Root>\n>(function Switch({ className, ...props }, ref) {\n return (\n <SwitchPrimitive.Root\n ref={ref}\n data-slot=\"switch\"\n className={cn(\n 'peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input data-[state=unchecked]:hover:bg-muted-foreground/70 dark:data-[state=checked]:bg-brand',\n focusRingClasses,\n touchTargetClasses,\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-1px)] data-[state=unchecked]:translate-x-px dark:data-[state=checked]:bg-background dark:data-[state=unchecked]:bg-foreground/80\"\n />\n </SwitchPrimitive.Root>\n );\n});\n\nexport interface SwitchRowProps extends Omit<\n React.ComponentProps<typeof SwitchPrimitive.Root>,\n 'children'\n> {\n /** The setting's name. */\n label: React.ReactNode;\n /** What it does, under the name. */\n description?: React.ReactNode;\n /** Beside the label: a Badge such as \"Always on\". */\n badge?: React.ReactNode;\n /** Padding for a row in a SwitchList. */\n inset?: boolean;\n /** A control that belongs to the switch (a minutes field for \"Alert when late\"), beside it on wide screens and under the label on phones. */\n before?: React.ReactNode;\n /** Extra classes for the row; className goes to the switch. */\n rowClassName?: string;\n /** Extra lines under the description. */\n children?: React.ReactNode;\n}\n\n/**\n * A setting that is on or off: what it is (and what it does) on the left,\n * the switch on the right, level with the first line of the label. Several\n * of them stack in a SwitchList.\n */\nconst SwitchRow = React.forwardRef<HTMLButtonElement, SwitchRowProps>(function SwitchRow(\n {\n label,\n description,\n badge,\n inset,\n before,\n id: idProp,\n className,\n rowClassName,\n children,\n ...props\n },\n ref,\n) {\n const auto = React.useId();\n const id = idProp ?? auto;\n return (\n <div\n data-slot=\"switch-row\"\n className={cn(\n 'grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-4',\n before && 'gap-y-2 sm:grid-cols-[minmax(0,1fr)_auto_auto]',\n inset && 'px-4 py-3.5 sm:px-5 sm:py-4',\n rowClassName,\n )}\n >\n <div className=\"grid min-w-0 gap-1\">\n <label\n htmlFor={id}\n className=\"flex min-h-5 flex-wrap items-center gap-x-2 gap-y-1 text-sm leading-5 font-medium\"\n >\n {label}\n {badge}\n </label>\n {description && (\n <p id={`${id}-description`} className=\"text-[13px] leading-5 text-muted-foreground\">\n {description}\n </p>\n )}\n {children}\n </div>\n {before && (\n <div className=\"col-start-1 row-start-2 flex items-center sm:col-start-2 sm:row-start-1 sm:-my-2\">\n {before}\n </div>\n )}\n <Switch\n ref={ref}\n id={id}\n aria-describedby={description ? `${id}-description` : undefined}\n className={cn('col-start-2 row-start-1', before && 'sm:col-start-3', className)}\n {...props}\n />\n </div>\n );\n});\n\nexport interface SwitchListProps extends React.ComponentProps<'div'> {\n /** A rounded border around the list, for a list that is not already in a Card. */\n bordered?: boolean;\n}\n\n/** SwitchRows (with `inset`) divided by rules, in a Card or a bordered box. */\nconst SwitchList = React.forwardRef<HTMLDivElement, SwitchListProps>(function SwitchList(\n { bordered, className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"switch-list\"\n className={cn('grid divide-y divide-border', bordered && 'rounded-lg border', className)}\n {...props}\n />\n );\n});\n\nexport interface InlineSwitchProps extends Omit<\n React.ComponentProps<typeof SwitchPrimitive.Root>,\n 'children'\n> {\n label: React.ReactNode;\n /** Extra classes for the label; className goes to the switch. */\n rowClassName?: string;\n}\n\n/**\n * A filter that is on or off, in a row of filters: the switch first, its\n * label after it, at least 44px tall on touch screens. (Settings put the\n * switch on the right: SwitchRow.)\n */\nconst InlineSwitch = React.forwardRef<HTMLButtonElement, InlineSwitchProps>(function InlineSwitch(\n { label, id: idProp, className, rowClassName, ...props },\n ref,\n) {\n const auto = React.useId();\n const id = idProp ?? auto;\n return (\n <label\n htmlFor={id}\n data-slot=\"inline-switch\"\n className={cn(\n 'flex min-h-5 cursor-pointer items-center gap-2.5 text-sm leading-5 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60 pointer-coarse:min-h-11',\n rowClassName,\n )}\n >\n <Switch ref={ref} id={id} className={className} {...props} />\n {label}\n </label>\n );\n});\n\nexport { InlineSwitch, Switch, SwitchList, SwitchRow };\n"],"mappings":";;;;;;;;;;;AAUA,IAAM,SAAS,MAAM,WAGnB,SAAS,OAAO,EAAE,WAAW,GAAG,SAAS,KAAK;CAC9C,OACE,oBAACA,UAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,4TACA,kBACA,oBACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAACC,aAAD;GACE,aAAU;GACV,WAAU;EACX,CAAA;CACmB,CAAA;AAE1B,CAAC;;;;;;AA2BD,IAAM,YAAY,MAAM,WAA8C,SAAS,UAC7E,EACE,OACA,aACA,OACA,OACA,QACA,IAAI,QACJ,WACA,cACA,UACA,GAAG,SAEL,KACA;CACA,MAAM,OAAO,MAAM,MAAM;CACzB,MAAM,KAAK,UAAU;CACrB,OACE,qBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,2DACA,UAAU,kDACV,SAAS,+BACT,YACF;EAPF,UAAA;GASE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,qBAAC,SAAD;MACE,SAAS;MACT,WAAU;MAFZ,UAAA,CAIG,OACA,KACI;;KACN,eACC,oBAAC,KAAD;MAAG,IAAI,GAAG,GAAG;MAAe,WAAU;MACnC,UAAA;KACA,CAAA;KAEJ;IACE;;GACJ,UACC,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA;GACE,CAAA;GAEP,oBAAC,QAAD;IACO;IACD;IACJ,oBAAkB,cAAc,GAAG,GAAG,gBAAgB,KAAA;IACtD,WAAW,GAAG,2BAA2B,UAAU,kBAAkB,SAAS;IAC9E,GAAI;GACL,CAAA;EACE;;AAET,CAAC;;AAQD,IAAM,aAAa,MAAM,WAA4C,SAAS,WAC5E,EAAE,UAAU,WAAW,GAAG,SAC1B,KACA;CACA,OACE,oBAAC,OAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,+BAA+B,YAAY,qBAAqB,SAAS;EACvF,GAAI;CACL,CAAA;AAEL,CAAC;;;;;;AAgBD,IAAM,eAAe,MAAM,WAAiD,SAAS,aACnF,EAAE,OAAO,IAAI,QAAQ,WAAW,cAAc,GAAG,SACjD,KACA;CACA,MAAM,OAAO,MAAM,MAAM;CACzB,MAAM,KAAK,UAAU;CACrB,OACE,qBAAC,SAAD;EACE,SAAS;EACT,aAAU;EACV,WAAW,GACT,4JACA,YACF;EANF,UAAA,CAQE,oBAAC,QAAD;GAAa;GAAS;GAAe;GAAW,GAAI;EAAQ,CAAA,GAC3D,KACI;;AAEX,CAAC"}
@@ -17,21 +17,38 @@ export interface TableProps extends React.ComponentProps<'table'> {
17
17
  * can scroll it (WCAG 2.1.1, axe scrollable-region-focusable).
18
18
  */
19
19
  scrollLabel?: string;
20
+ /**
21
+ * Keep the first column in view while the table scrolls sideways (a name
22
+ * column beside numbers). The pinned cells take the surface colour.
23
+ */
24
+ pinFirstColumn?: boolean;
25
+ /**
26
+ * The line under a table that scrolls sideways, until it is scrolled to the
27
+ * end. Shown on touch screens only (a mouse has a scrollbar). `false`
28
+ * turns it off.
29
+ */
30
+ overflowHint?: React.ReactNode | false;
20
31
  }
21
- declare function Table({ className, density, stickyHeader, containerClassName, containerProps, scrollLabel, ...props }: TableProps): React.JSX.Element;
22
- declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): React.JSX.Element;
23
- declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): React.JSX.Element;
24
- declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): React.JSX.Element;
25
- /** Set `data-state="selected"` (or `selected`) to mark a chosen row. */
26
- declare function TableRow({ className, selected, ...props }: React.ComponentProps<'tr'> & {
32
+ /** How a box overflows sideways: more to the `end`, more to the `start`, or `both`. */
33
+ export declare function overflowState(el: {
34
+ scrollLeft: number;
35
+ scrollWidth: number;
36
+ clientWidth: number;
37
+ }): 'start' | 'end' | 'both' | undefined;
38
+ declare const Table: React.ForwardRefExoticComponent<Omit<TableProps, "ref"> & React.RefAttributes<HTMLTableElement>>;
39
+ declare const TableHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
40
+ declare const TableBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
41
+ declare const TableFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
42
+ /** Set `selected` to mark a chosen row: a soft fill and a brand bar on its left edge. */
43
+ declare const TableRow: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLTableRowElement> & React.HTMLAttributes<HTMLTableRowElement> & {
27
44
  selected?: boolean;
28
- }): React.JSX.Element;
45
+ }, "ref"> & React.RefAttributes<HTMLTableRowElement>>;
29
46
  /** `numeric` right-aligns with tabular figures, for counts, money and durations. */
30
- declare function TableHead({ className, numeric, ...props }: React.ComponentProps<'th'> & {
47
+ declare const TableHead: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLTableHeaderCellElement> & React.ThHTMLAttributes<HTMLTableHeaderCellElement> & {
31
48
  numeric?: boolean;
32
- }): React.JSX.Element;
33
- declare function TableCell({ className, numeric, ...props }: React.ComponentProps<'td'> & {
49
+ }, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
50
+ declare const TableCell: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLTableDataCellElement> & React.TdHTMLAttributes<HTMLTableDataCellElement> & {
34
51
  numeric?: boolean;
35
- }): React.JSX.Element;
36
- declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): React.JSX.Element;
52
+ }, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
53
+ declare const TableCaption: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLTableCaptionElement>>;
37
54
  export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
@@ -1,28 +1,58 @@
1
- import { cn } from "../lib/utils.js";
1
+ "use client";
2
+ import { cn, focusRingClasses } from "../lib/utils.js";
2
3
  import * as React from "react";
3
- import { jsx } from "react/jsx-runtime";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
5
  //#region src/components/table.tsx
5
- /** True while the element's content is larger than its box. */
6
- function useOverflows(ref, enabled) {
6
+ /** How a box overflows sideways: more to the `end`, more to the `start`, or `both`. */
7
+ function overflowState(el) {
8
+ const max = el.scrollWidth - el.clientWidth;
9
+ if (max <= 1) return void 0;
10
+ if (el.scrollLeft <= 1) return "end";
11
+ if (el.scrollLeft >= max - 1) return "start";
12
+ return "both";
13
+ }
14
+ /**
15
+ * Tracks whether the element's content is larger than its box, and which way
16
+ * it scrolls sideways. Nothing is measured on the server or in jsdom.
17
+ */
18
+ function useOverflow(ref) {
7
19
  const [overflows, setOverflows] = React.useState(false);
20
+ const [horizontal, setHorizontal] = React.useState();
8
21
  React.useEffect(() => {
9
22
  const el = ref.current;
10
- if (!enabled || !el) return;
11
- const update = () => setOverflows(el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight);
23
+ if (!el) return;
24
+ const update = () => {
25
+ setOverflows(el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight);
26
+ setHorizontal(overflowState(el));
27
+ };
12
28
  update();
13
- if (typeof ResizeObserver === "undefined") return;
29
+ el.addEventListener("scroll", update, { passive: true });
30
+ if (typeof ResizeObserver === "undefined") return () => el.removeEventListener("scroll", update);
14
31
  const ro = new ResizeObserver(update);
15
32
  ro.observe(el);
16
33
  if (el.firstElementChild) ro.observe(el.firstElementChild);
17
- return () => ro.disconnect();
18
- }, [ref, enabled]);
19
- return overflows;
34
+ return () => {
35
+ ro.disconnect();
36
+ el.removeEventListener("scroll", update);
37
+ };
38
+ }, [ref]);
39
+ return {
40
+ overflows,
41
+ horizontal
42
+ };
20
43
  }
21
44
  function assignRef(ref, node) {
22
45
  if (typeof ref === "function") ref(node);
23
46
  else if (ref) ref.current = node;
24
47
  }
25
- function Table({ className, density = "default", stickyHeader = false, containerClassName, containerProps, scrollLabel, ...props }) {
48
+ /**
49
+ * The scroll container fades on the side with more to see (never over a
50
+ * pinned column), shows its focus outline inside the box (the frame around
51
+ * it would clip an offset one), and drops the fade while focused so the
52
+ * whole outline shows.
53
+ */
54
+ var containerClasses = cn("group/table relative w-full overflow-auto", "data-[overflow=end]:[mask-image:linear-gradient(to_right,#000_calc(100%-2rem),transparent)]", "data-[overflow=start]:[mask-image:linear-gradient(to_left,#000_calc(100%-2rem),transparent)]", "data-[overflow=both]:[mask-image:linear-gradient(to_right,transparent,#000_2rem,#000_calc(100%-2rem),transparent)]", "data-[pinned]:data-[overflow=start]:[mask-image:none] data-[pinned]:data-[overflow=both]:[mask-image:linear-gradient(to_right,#000_calc(100%-2rem),transparent)]", focusRingClasses, "focus-visible:outline-offset-[-2px] focus-visible:[mask-image:none]");
55
+ var Table = React.forwardRef(function Table({ className, density = "default", stickyHeader = false, containerClassName, containerProps, scrollLabel, pinFirstColumn = false, overflowHint = "Swipe for more", ...props }, ref) {
26
56
  const { className: containerPropsClassName, ref: containerRef, ...wrapperProps } = containerProps ?? {};
27
57
  const local = React.useRef(null);
28
58
  const setRef = React.useCallback((node) => {
@@ -30,78 +60,94 @@ function Table({ className, density = "default", stickyHeader = false, container
30
60
  assignRef(containerRef, node);
31
61
  }, [containerRef]);
32
62
  const named = Boolean(scrollLabel || wrapperProps["aria-label"] || wrapperProps["aria-labelledby"]);
33
- const overflows = useOverflows(local, named);
34
- return /* @__PURE__ */ jsx("div", {
63
+ const { overflows, horizontal } = useOverflow(local);
64
+ const hint = overflowHint !== false && (horizontal === "end" || horizontal === "both");
65
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
35
66
  "data-slot": "table-container",
36
67
  "data-density": density,
37
68
  "data-sticky": stickyHeader || void 0,
69
+ "data-pinned": pinFirstColumn || void 0,
70
+ "data-overflow": horizontal,
38
71
  role: named ? "region" : void 0,
39
72
  "aria-label": scrollLabel,
40
73
  tabIndex: named && overflows ? 0 : void 0,
41
74
  ...wrapperProps,
42
75
  ref: setRef,
43
- className: cn("group/table relative w-full overflow-auto", containerClassName, containerPropsClassName),
76
+ className: cn(containerClasses, containerClassName, containerPropsClassName),
44
77
  children: /* @__PURE__ */ jsx("table", {
78
+ ref,
45
79
  "data-slot": "table",
46
80
  className: cn("w-full caption-bottom text-[13px]", className),
47
81
  ...props
48
82
  })
49
- });
50
- }
51
- function TableHeader({ className, ...props }) {
83
+ }), hint && /* @__PURE__ */ jsxs("p", {
84
+ "data-slot": "table-overflow-hint",
85
+ "aria-hidden": true,
86
+ className: "hidden w-full px-3 py-1.5 text-right text-[11.5px] text-muted-foreground pointer-coarse:block",
87
+ children: [overflowHint, " →"]
88
+ })] });
89
+ });
90
+ var TableHeader = React.forwardRef(function TableHeader({ className, ...props }, ref) {
52
91
  return /* @__PURE__ */ jsx("thead", {
92
+ ref,
53
93
  "data-slot": "table-header",
54
94
  className: cn("bg-surface-muted [&_tr]:border-b group-data-[sticky]/table:sticky group-data-[sticky]/table:top-0 group-data-[sticky]/table:z-10", className),
55
95
  ...props
56
96
  });
57
- }
58
- function TableBody({ className, ...props }) {
97
+ });
98
+ var TableBody = React.forwardRef(function TableBody({ className, ...props }, ref) {
59
99
  return /* @__PURE__ */ jsx("tbody", {
100
+ ref,
60
101
  "data-slot": "table-body",
61
102
  className: cn("[&_tr:last-child]:border-0", className),
62
103
  ...props
63
104
  });
64
- }
65
- function TableFooter({ className, ...props }) {
105
+ });
106
+ var TableFooter = React.forwardRef(function TableFooter({ className, ...props }, ref) {
66
107
  return /* @__PURE__ */ jsx("tfoot", {
108
+ ref,
67
109
  "data-slot": "table-footer",
68
110
  className: cn("border-t bg-surface-muted font-medium [&>tr]:last:border-b-0", className),
69
111
  ...props
70
112
  });
71
- }
72
- /** Set `data-state="selected"` (or `selected`) to mark a chosen row. */
73
- function TableRow({ className, selected, ...props }) {
113
+ });
114
+ /** Set `selected` to mark a chosen row: a soft fill and a brand bar on its left edge. */
115
+ var TableRow = React.forwardRef(function TableRow({ className, selected, ...props }, ref) {
74
116
  return /* @__PURE__ */ jsx("tr", {
117
+ ref,
75
118
  "data-slot": "table-row",
76
119
  "data-state": selected ? "selected" : void 0,
77
120
  "aria-selected": selected || void 0,
78
121
  className: cn("border-b transition-colors hover:bg-muted/60 data-[state=selected]:bg-brand-soft/60 data-[state=selected]:shadow-[inset_2px_0_0_var(--color-brand)]", className),
79
122
  ...props
80
123
  });
81
- }
124
+ });
82
125
  /** `numeric` right-aligns with tabular figures, for counts, money and durations. */
83
- function TableHead({ className, numeric, ...props }) {
126
+ var TableHead = React.forwardRef(function TableHead({ className, numeric, ...props }, ref) {
84
127
  return /* @__PURE__ */ jsx("th", {
128
+ ref,
85
129
  "data-slot": "table-head",
86
- className: cn("h-9 px-3 text-left align-middle text-[11px] font-semibold tracking-[0.06em] whitespace-nowrap text-muted-foreground uppercase group-data-[density=compact]/table:h-8 [&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0", numeric && "text-right tabular-nums", className),
130
+ className: cn("h-9 px-3 text-left align-middle text-[11px] font-semibold tracking-[0.06em] whitespace-nowrap text-muted-foreground uppercase group-data-[density=compact]/table:h-8 [&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0", "first:group-data-[pinned]/table:sticky first:group-data-[pinned]/table:left-0 first:group-data-[pinned]/table:z-[2] first:group-data-[pinned]/table:bg-surface-muted first:group-data-[pinned]/table:shadow-[inset_-1px_0_0_var(--border)]", numeric && "text-right tabular-nums", className),
87
131
  ...props
88
132
  });
89
- }
90
- function TableCell({ className, numeric, ...props }) {
133
+ });
134
+ var TableCell = React.forwardRef(function TableCell({ className, numeric, ...props }, ref) {
91
135
  return /* @__PURE__ */ jsx("td", {
136
+ ref,
92
137
  "data-slot": "table-cell",
93
- className: cn("h-10 px-3 align-middle whitespace-nowrap group-data-[density=compact]/table:h-8 [&:has([role=checkbox])]:pr-0", numeric && "text-right font-mono text-[12.5px] tabular-nums", className),
138
+ className: cn("h-10 px-3 align-middle whitespace-nowrap group-data-[density=compact]/table:h-8 pointer-coarse:group-data-[density=default]/table:h-11 [&:has([role=checkbox])]:pr-0", "first:group-data-[pinned]/table:sticky first:group-data-[pinned]/table:left-0 first:group-data-[pinned]/table:z-[1] first:group-data-[pinned]/table:bg-surface first:group-data-[pinned]/table:shadow-[inset_-1px_0_0_var(--border)] first:group-data-[pinned]/table:max-w-[min(11rem,45vw)] first:group-data-[pinned]/table:whitespace-normal", numeric && "text-right font-mono text-[12.5px] tabular-nums", className),
94
139
  ...props
95
140
  });
96
- }
97
- function TableCaption({ className, ...props }) {
141
+ });
142
+ var TableCaption = React.forwardRef(function TableCaption({ className, ...props }, ref) {
98
143
  return /* @__PURE__ */ jsx("caption", {
144
+ ref,
99
145
  "data-slot": "table-caption",
100
146
  className: cn("mt-3 text-xs text-muted-foreground", className),
101
147
  ...props
102
148
  });
103
- }
149
+ });
104
150
  //#endregion
105
- export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
151
+ export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, overflowState };
106
152
 
107
153
  //# sourceMappingURL=table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","names":[],"sources":["../../src/components/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nexport interface TableProps extends React.ComponentProps<'table'> {\n /** `compact` for dense ops screens (32px rows), `default` 40px. */\n density?: 'compact' | 'default';\n /** Keep the header visible while the container scrolls; give it a height. */\n stickyHeader?: boolean;\n containerClassName?: string;\n /**\n * Props for the scrolling wrapper (`tabIndex`, `role`, `aria-*`, `ref`, ...).\n * Anything set here wins over what `scrollLabel` sets.\n */\n containerProps?: React.ComponentProps<'div'>;\n /**\n * Accessible name for the scroll container. With it (or an `aria-label` /\n * `aria-labelledby` in `containerProps`) the wrapper becomes a named region\n * that joins the tab order while its content overflows, so keyboard users\n * can scroll it (WCAG 2.1.1, axe scrollable-region-focusable).\n */\n scrollLabel?: string;\n}\n\n/** True while the element's content is larger than its box. */\nfunction useOverflows(ref: React.RefObject<HTMLElement | null>, enabled: boolean): boolean {\n const [overflows, setOverflows] = React.useState(false);\n React.useEffect(() => {\n const el = ref.current;\n if (!enabled || !el) return;\n const update = () =>\n setOverflows(el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight);\n update();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(update);\n ro.observe(el);\n if (el.firstElementChild) ro.observe(el.firstElementChild);\n return () => ro.disconnect();\n }, [ref, enabled]);\n return overflows;\n}\n\nfunction assignRef<T>(ref: React.Ref<T> | undefined, node: T | null) {\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n}\n\nfunction Table({\n className,\n density = 'default',\n stickyHeader = false,\n containerClassName,\n containerProps,\n scrollLabel,\n ...props\n}: TableProps) {\n const {\n className: containerPropsClassName,\n ref: containerRef,\n ...wrapperProps\n } = containerProps ?? {};\n const local = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n local.current = node;\n assignRef(containerRef, node);\n },\n [containerRef],\n );\n const named = Boolean(\n scrollLabel || wrapperProps['aria-label'] || wrapperProps['aria-labelledby'],\n );\n const overflows = useOverflows(local, named);\n return (\n <div\n data-slot=\"table-container\"\n data-density={density}\n data-sticky={stickyHeader || undefined}\n role={named ? 'region' : undefined}\n aria-label={scrollLabel}\n // A scrollable region must be reachable by keyboard; only while it scrolls.\n tabIndex={named && overflows ? 0 : undefined}\n {...wrapperProps}\n ref={setRef}\n className={cn(\n 'group/table relative w-full overflow-auto',\n containerClassName,\n containerPropsClassName,\n )}\n >\n <table\n data-slot=\"table\"\n className={cn('w-full caption-bottom text-[13px]', className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\n 'bg-surface-muted [&_tr]:border-b group-data-[sticky]/table:sticky group-data-[sticky]/table:top-0 group-data-[sticky]/table:z-10',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n );\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn('border-t bg-surface-muted font-medium [&>tr]:last:border-b-0', className)}\n {...props}\n />\n );\n}\n\n/** Set `data-state=\"selected\"` (or `selected`) to mark a chosen row. */\nfunction TableRow({\n className,\n selected,\n ...props\n}: React.ComponentProps<'tr'> & { selected?: boolean }) {\n return (\n <tr\n data-slot=\"table-row\"\n data-state={selected ? 'selected' : undefined}\n aria-selected={selected || undefined}\n className={cn(\n 'border-b transition-colors hover:bg-muted/60 data-[state=selected]:bg-brand-soft/60 data-[state=selected]:shadow-[inset_2px_0_0_var(--color-brand)]',\n className,\n )}\n {...props}\n />\n );\n}\n\n/** `numeric` right-aligns with tabular figures, for counts, money and durations. */\nfunction TableHead({\n className,\n numeric,\n ...props\n}: React.ComponentProps<'th'> & { numeric?: boolean }) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n 'h-9 px-3 text-left align-middle text-[11px] font-semibold tracking-[0.06em] whitespace-nowrap text-muted-foreground uppercase group-data-[density=compact]/table:h-8 [&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0',\n numeric && 'text-right tabular-nums',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableCell({\n className,\n numeric,\n ...props\n}: React.ComponentProps<'td'> & { numeric?: boolean }) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n 'h-10 px-3 align-middle whitespace-nowrap group-data-[density=compact]/table:h-8 [&:has([role=checkbox])]:pr-0',\n numeric && 'text-right font-mono text-[12.5px] tabular-nums',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn('mt-3 text-xs text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nexport { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };\n"],"mappings":"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"}
1
+ {"version":3,"file":"table.js","names":["_Fragment"],"sources":["../../src/components/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn, focusRingClasses } from '../lib/utils';\n\nexport interface TableProps extends React.ComponentProps<'table'> {\n /** `compact` for dense ops screens (32px rows), `default` 40px. */\n density?: 'compact' | 'default';\n /** Keep the header visible while the container scrolls; give it a height. */\n stickyHeader?: boolean;\n containerClassName?: string;\n /**\n * Props for the scrolling wrapper (`tabIndex`, `role`, `aria-*`, `ref`, ...).\n * Anything set here wins over what `scrollLabel` sets.\n */\n containerProps?: React.ComponentProps<'div'>;\n /**\n * Accessible name for the scroll container. With it (or an `aria-label` /\n * `aria-labelledby` in `containerProps`) the wrapper becomes a named region\n * that joins the tab order while its content overflows, so keyboard users\n * can scroll it (WCAG 2.1.1, axe scrollable-region-focusable).\n */\n scrollLabel?: string;\n /**\n * Keep the first column in view while the table scrolls sideways (a name\n * column beside numbers). The pinned cells take the surface colour.\n */\n pinFirstColumn?: boolean;\n /**\n * The line under a table that scrolls sideways, until it is scrolled to the\n * end. Shown on touch screens only (a mouse has a scrollbar). `false`\n * turns it off.\n */\n overflowHint?: React.ReactNode | false;\n}\n\n/** How a box overflows sideways: more to the `end`, more to the `start`, or `both`. */\nexport function overflowState(el: {\n scrollLeft: number;\n scrollWidth: number;\n clientWidth: number;\n}): 'start' | 'end' | 'both' | undefined {\n const max = el.scrollWidth - el.clientWidth;\n if (max <= 1) return undefined;\n if (el.scrollLeft <= 1) return 'end';\n if (el.scrollLeft >= max - 1) return 'start';\n return 'both';\n}\n\n/**\n * Tracks whether the element's content is larger than its box, and which way\n * it scrolls sideways. Nothing is measured on the server or in jsdom.\n */\nfunction useOverflow(ref: React.RefObject<HTMLElement | null>) {\n const [overflows, setOverflows] = React.useState(false);\n const [horizontal, setHorizontal] = React.useState<ReturnType<typeof overflowState>>();\n React.useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const update = () => {\n setOverflows(el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight);\n setHorizontal(overflowState(el));\n };\n update();\n el.addEventListener('scroll', update, { passive: true });\n if (typeof ResizeObserver === 'undefined')\n return () => el.removeEventListener('scroll', update);\n const ro = new ResizeObserver(update);\n ro.observe(el);\n if (el.firstElementChild) ro.observe(el.firstElementChild);\n return () => {\n ro.disconnect();\n el.removeEventListener('scroll', update);\n };\n }, [ref]);\n return { overflows, horizontal };\n}\n\nfunction assignRef<T>(ref: React.Ref<T> | undefined, node: T | null) {\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n}\n\n/**\n * The scroll container fades on the side with more to see (never over a\n * pinned column), shows its focus outline inside the box (the frame around\n * it would clip an offset one), and drops the fade while focused so the\n * whole outline shows.\n */\nconst containerClasses = cn(\n 'group/table relative w-full overflow-auto',\n 'data-[overflow=end]:[mask-image:linear-gradient(to_right,#000_calc(100%-2rem),transparent)]',\n 'data-[overflow=start]:[mask-image:linear-gradient(to_left,#000_calc(100%-2rem),transparent)]',\n 'data-[overflow=both]:[mask-image:linear-gradient(to_right,transparent,#000_2rem,#000_calc(100%-2rem),transparent)]',\n 'data-[pinned]:data-[overflow=start]:[mask-image:none] data-[pinned]:data-[overflow=both]:[mask-image:linear-gradient(to_right,#000_calc(100%-2rem),transparent)]',\n focusRingClasses,\n 'focus-visible:outline-offset-[-2px] focus-visible:[mask-image:none]',\n);\n\nconst Table = React.forwardRef<HTMLTableElement, TableProps>(function Table(\n {\n className,\n density = 'default',\n stickyHeader = false,\n containerClassName,\n containerProps,\n scrollLabel,\n pinFirstColumn = false,\n overflowHint = 'Swipe for more',\n ...props\n },\n ref,\n) {\n const {\n className: containerPropsClassName,\n ref: containerRef,\n ...wrapperProps\n } = containerProps ?? {};\n const local = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n local.current = node;\n assignRef(containerRef, node);\n },\n [containerRef],\n );\n const named = Boolean(\n scrollLabel || wrapperProps['aria-label'] || wrapperProps['aria-labelledby'],\n );\n const { overflows, horizontal } = useOverflow(local);\n const hint = overflowHint !== false && (horizontal === 'end' || horizontal === 'both');\n return (\n <>\n <div\n data-slot=\"table-container\"\n data-density={density}\n data-sticky={stickyHeader || undefined}\n data-pinned={pinFirstColumn || undefined}\n data-overflow={horizontal}\n role={named ? 'region' : undefined}\n aria-label={scrollLabel}\n // A scrollable region must be reachable by keyboard; only while it scrolls.\n tabIndex={named && overflows ? 0 : undefined}\n {...wrapperProps}\n ref={setRef}\n className={cn(containerClasses, containerClassName, containerPropsClassName)}\n >\n <table\n ref={ref}\n data-slot=\"table\"\n className={cn('w-full caption-bottom text-[13px]', className)}\n {...props}\n />\n </div>\n {hint && (\n <p\n data-slot=\"table-overflow-hint\"\n aria-hidden\n className=\"hidden w-full px-3 py-1.5 text-right text-[11.5px] text-muted-foreground pointer-coarse:block\"\n >\n {overflowHint} →\n </p>\n )}\n </>\n );\n});\n\nconst TableHeader = React.forwardRef<HTMLTableSectionElement, React.ComponentProps<'thead'>>(\n function TableHeader({ className, ...props }, ref) {\n return (\n <thead\n ref={ref}\n data-slot=\"table-header\"\n className={cn(\n 'bg-surface-muted [&_tr]:border-b group-data-[sticky]/table:sticky group-data-[sticky]/table:top-0 group-data-[sticky]/table:z-10',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nconst TableBody = React.forwardRef<HTMLTableSectionElement, React.ComponentProps<'tbody'>>(\n function TableBody({ className, ...props }, ref) {\n return (\n <tbody\n ref={ref}\n data-slot=\"table-body\"\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n );\n },\n);\n\nconst TableFooter = React.forwardRef<HTMLTableSectionElement, React.ComponentProps<'tfoot'>>(\n function TableFooter({ className, ...props }, ref) {\n return (\n <tfoot\n ref={ref}\n data-slot=\"table-footer\"\n className={cn('border-t bg-surface-muted font-medium [&>tr]:last:border-b-0', className)}\n {...props}\n />\n );\n },\n);\n\n/** Set `selected` to mark a chosen row: a soft fill and a brand bar on its left edge. */\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.ComponentProps<'tr'> & { selected?: boolean }\n>(function TableRow({ className, selected, ...props }, ref) {\n return (\n <tr\n ref={ref}\n data-slot=\"table-row\"\n data-state={selected ? 'selected' : undefined}\n aria-selected={selected || undefined}\n className={cn(\n 'border-b transition-colors hover:bg-muted/60 data-[state=selected]:bg-brand-soft/60 data-[state=selected]:shadow-[inset_2px_0_0_var(--color-brand)]',\n className,\n )}\n {...props}\n />\n );\n});\n\n// Pinned first cells (Table `pinFirstColumn`): sticky, with the surface\n// behind them so scrolled columns pass underneath, and a hairline on their\n// right edge.\n\n/** `numeric` right-aligns with tabular figures, for counts, money and durations. */\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ComponentProps<'th'> & { numeric?: boolean }\n>(function TableHead({ className, numeric, ...props }, ref) {\n return (\n <th\n ref={ref}\n data-slot=\"table-head\"\n className={cn(\n 'h-9 px-3 text-left align-middle text-[11px] font-semibold tracking-[0.06em] whitespace-nowrap text-muted-foreground uppercase group-data-[density=compact]/table:h-8 [&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0',\n 'first:group-data-[pinned]/table:sticky first:group-data-[pinned]/table:left-0 first:group-data-[pinned]/table:z-[2] first:group-data-[pinned]/table:bg-surface-muted first:group-data-[pinned]/table:shadow-[inset_-1px_0_0_var(--border)]',\n numeric && 'text-right tabular-nums',\n className,\n )}\n {...props}\n />\n );\n});\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.ComponentProps<'td'> & { numeric?: boolean }\n>(function TableCell({ className, numeric, ...props }, ref) {\n return (\n <td\n ref={ref}\n data-slot=\"table-cell\"\n className={cn(\n 'h-10 px-3 align-middle whitespace-nowrap group-data-[density=compact]/table:h-8 pointer-coarse:group-data-[density=default]/table:h-11 [&:has([role=checkbox])]:pr-0',\n 'first:group-data-[pinned]/table:sticky first:group-data-[pinned]/table:left-0 first:group-data-[pinned]/table:z-[1] first:group-data-[pinned]/table:bg-surface first:group-data-[pinned]/table:shadow-[inset_-1px_0_0_var(--border)] first:group-data-[pinned]/table:max-w-[min(11rem,45vw)] first:group-data-[pinned]/table:whitespace-normal',\n numeric && 'text-right font-mono text-[12.5px] tabular-nums',\n className,\n )}\n {...props}\n />\n );\n});\n\nconst TableCaption = React.forwardRef<HTMLTableCaptionElement, React.ComponentProps<'caption'>>(\n function TableCaption({ className, ...props }, ref) {\n return (\n <caption\n ref={ref}\n data-slot=\"table-caption\"\n className={cn('mt-3 text-xs text-muted-foreground', className)}\n {...props}\n />\n );\n },\n);\n\nexport { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };\n"],"mappings":"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"}
@@ -1,7 +1,12 @@
1
- import { Tabs as TabsPrimitive } from 'radix-ui';
2
1
  import * as React from 'react';
3
- declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
4
- declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): React.JSX.Element;
5
- declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element;
6
- declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
2
+ import * as TabsPrimitive from '../primitives/vendor/radix/react-tabs';
3
+ declare const Tabs: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ /**
5
+ * A 36px strip with a 10px radius; a strip wider than its container scrolls
6
+ * sideways rather than pushing the layout.
7
+ */
8
+ declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ /** A 28px tab with a 6px radius (the strip's 10px less its 4px inset); 44px tall to a touch. */
10
+ declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
11
+ declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
12
  export { Tabs, TabsContent, TabsList, TabsTrigger };
@@ -1,37 +1,47 @@
1
- import { cn } from "../lib/utils.js";
2
- import { Tabs } from "radix-ui";
3
- import "react";
1
+ "use client";
2
+ import { cn, focusRingClasses, touchTargetRowClasses } from "../lib/utils.js";
3
+ import { Content, List, Root, Trigger } from "../primitives/vendor/radix/react-tabs/tabs.js";
4
+ import * as React from "react";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  //#region src/components/tabs.tsx
6
- function Tabs$1({ className, ...props }) {
7
- return /* @__PURE__ */ jsx(Tabs.Root, {
7
+ var Tabs = React.forwardRef(function Tabs({ className, ...props }, ref) {
8
+ return /* @__PURE__ */ jsx(Root, {
9
+ ref,
8
10
  "data-slot": "tabs",
9
11
  className: cn("flex flex-col gap-3", className),
10
12
  ...props
11
13
  });
12
- }
13
- function TabsList({ className, ...props }) {
14
- return /* @__PURE__ */ jsx(Tabs.List, {
14
+ });
15
+ /**
16
+ * A 36px strip with a 10px radius; a strip wider than its container scrolls
17
+ * sideways rather than pushing the layout.
18
+ */
19
+ var TabsList = React.forwardRef(function TabsList({ className, ...props }, ref) {
20
+ return /* @__PURE__ */ jsx(List, {
21
+ ref,
15
22
  "data-slot": "tabs-list",
16
- className: cn("inline-flex h-9 w-fit items-center gap-0.5 rounded-md border border-border bg-surface-muted p-1 text-muted-foreground", className),
23
+ className: cn("inline-flex h-9 w-fit max-w-full items-center gap-0.5 overflow-x-auto rounded-md border border-border bg-surface-muted p-1 text-muted-foreground [scrollbar-width:none]", className),
17
24
  ...props
18
25
  });
19
- }
20
- function TabsTrigger({ className, ...props }) {
21
- return /* @__PURE__ */ jsx(Tabs.Trigger, {
26
+ });
27
+ /** A 28px tab with a 6px radius (the strip's 10px less its 4px inset); 44px tall to a touch. */
28
+ var TabsTrigger = React.forwardRef(function TabsTrigger({ className, ...props }, ref) {
29
+ return /* @__PURE__ */ jsx(Trigger, {
30
+ ref,
22
31
  "data-slot": "tabs-trigger",
23
- className: cn("inline-flex h-7 min-w-0 items-center justify-center gap-1.5 rounded-sm px-2.5 text-[13px] font-semibold whitespace-nowrap outline-none transition-[background-color,color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-surface data-[state=active]:text-foreground data-[state=active]:shadow-xs hover:text-foreground [&_svg]:size-3.5", className),
32
+ className: cn("inline-flex h-7 min-w-0 shrink-0 items-center justify-center gap-1.5 rounded-xs px-2.5 text-[13px] font-semibold whitespace-nowrap transition-[background-color,color,box-shadow] disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-surface data-[state=active]:text-foreground data-[state=active]:shadow-xs hover:text-foreground [&_svg]:size-4", focusRingClasses, touchTargetRowClasses, className),
24
33
  ...props
25
34
  });
26
- }
27
- function TabsContent({ className, ...props }) {
28
- return /* @__PURE__ */ jsx(Tabs.Content, {
35
+ });
36
+ var TabsContent = React.forwardRef(function TabsContent({ className, ...props }, ref) {
37
+ return /* @__PURE__ */ jsx(Content, {
38
+ ref,
29
39
  "data-slot": "tabs-content",
30
- className: cn("min-w-0 flex-1 outline-none data-[state=active]:animate-fade-in", className),
40
+ className: cn("min-w-0 flex-1 data-[state=active]:animate-fade-in", focusRingClasses, className),
31
41
  ...props
32
42
  });
33
- }
43
+ });
34
44
  //#endregion
35
- export { Tabs$1 as Tabs, TabsContent, TabsList, TabsTrigger };
45
+ export { Tabs, TabsContent, TabsList, TabsTrigger };
36
46
 
37
47
  //# sourceMappingURL=tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","names":["Tabs","TabsPrimitive"],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["import { Tabs as TabsPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn('flex flex-col gap-3', className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n 'inline-flex h-9 w-fit items-center gap-0.5 rounded-md border border-border bg-surface-muted p-1 text-muted-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n 'inline-flex h-7 min-w-0 items-center justify-center gap-1.5 rounded-sm px-2.5 text-[13px] font-semibold whitespace-nowrap outline-none transition-[background-color,color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-surface data-[state=active]:text-foreground data-[state=active]:shadow-xs hover:text-foreground [&_svg]:size-3.5',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('min-w-0 flex-1 outline-none data-[state=active]:animate-fade-in', className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger };\n"],"mappings":";;;;;AAKA,SAASA,OAAK,EAAE,WAAW,GAAG,SAA0D;CACtF,OACE,oBAACC,KAAc,MAAf;EACE,aAAU;EACV,WAAW,GAAG,uBAAuB,SAAS;EAC9C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAA0D;CAC1F,OACE,oBAACA,KAAc,MAAf;EACE,aAAU;EACV,WAAW,GACT,yHACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAACA,KAAc,SAAf;EACE,aAAU;EACV,WAAW,GACT,saACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAACA,KAAc,SAAf;EACE,aAAU;EACV,WAAW,GAAG,mEAAmE,SAAS;EAC1F,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"tabs.js","names":["TabsPrimitive.Root","TabsPrimitive.List","TabsPrimitive.Trigger","TabsPrimitive.Content"],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn, focusRingClasses, touchTargetRowClasses } from '../lib/utils';\nimport * as TabsPrimitive from '../primitives/vendor/radix/react-tabs';\n\nconst Tabs = React.forwardRef<HTMLDivElement, React.ComponentProps<typeof TabsPrimitive.Root>>(\n function Tabs({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Root\n ref={ref}\n data-slot=\"tabs\"\n className={cn('flex flex-col gap-3', className)}\n {...props}\n />\n );\n },\n);\n\n/**\n * A 36px strip with a 10px radius; a strip wider than its container scrolls\n * sideways rather than pushing the layout.\n */\nconst TabsList = React.forwardRef<HTMLDivElement, React.ComponentProps<typeof TabsPrimitive.List>>(\n function TabsList({ className, ...props }, ref) {\n return (\n <TabsPrimitive.List\n ref={ref}\n data-slot=\"tabs-list\"\n className={cn(\n 'inline-flex h-9 w-fit max-w-full items-center gap-0.5 overflow-x-auto rounded-md border border-border bg-surface-muted p-1 text-muted-foreground [scrollbar-width:none]',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\n/** A 28px tab with a 6px radius (the strip's 10px less its 4px inset); 44px tall to a touch. */\nconst TabsTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof TabsPrimitive.Trigger>\n>(function TabsTrigger({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n data-slot=\"tabs-trigger\"\n className={cn(\n 'inline-flex h-7 min-w-0 shrink-0 items-center justify-center gap-1.5 rounded-xs px-2.5 text-[13px] font-semibold whitespace-nowrap transition-[background-color,color,box-shadow] disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-surface data-[state=active]:text-foreground data-[state=active]:shadow-xs hover:text-foreground [&_svg]:size-4',\n focusRingClasses,\n touchTargetRowClasses,\n className,\n )}\n {...props}\n />\n );\n});\n\nconst TabsContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof TabsPrimitive.Content>\n>(function TabsContent({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Content\n ref={ref}\n data-slot=\"tabs-content\"\n className={cn(\n 'min-w-0 flex-1 data-[state=active]:animate-fade-in',\n focusRingClasses,\n className,\n )}\n {...props}\n />\n );\n});\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger };\n"],"mappings":";;;;;;AAKA,IAAM,OAAO,MAAM,WACjB,SAAS,KAAK,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1C,OACE,oBAACA,MAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,uBAAuB,SAAS;EAC9C,GAAI;CACL,CAAA;AAEL,CACF;;;;;AAMA,IAAM,WAAW,MAAM,WACrB,SAAS,SAAS,EAAE,WAAW,GAAG,SAAS,KAAK;CAC9C,OACE,oBAACC,MAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,2KACA,SACF;EACA,GAAI;CACL,CAAA;AAEL,CACF;;AAGA,IAAM,cAAc,MAAM,WAGxB,SAAS,YAAY,EAAE,WAAW,GAAG,SAAS,KAAK;CACnD,OACE,oBAACC,SAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,4WACA,kBACA,uBACA,SACF;EACA,GAAI;CACL,CAAA;AAEL,CAAC;AAED,IAAM,cAAc,MAAM,WAGxB,SAAS,YAAY,EAAE,WAAW,GAAG,SAAS,KAAK;CACnD,OACE,oBAACC,SAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,sDACA,kBACA,SACF;EACA,GAAI;CACL,CAAA;AAEL,CAAC"}
@@ -1,3 +1,8 @@
1
1
  import * as React from 'react';
2
- declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
2
+ import { type FieldWidth } from './input';
3
+ export interface TextareaProps extends React.ComponentProps<'textarea'> {
4
+ /** How wide the field is from 640px up; full width on phones. */
5
+ width?: FieldWidth;
6
+ }
7
+ declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
3
8
  export { Textarea };
@@ -1,13 +1,14 @@
1
+ "use client";
1
2
  import { cn } from "../lib/utils.js";
2
- import { fieldClasses } from "./input.js";
3
+ import { fieldClasses, fieldWidthClasses } from "./input.js";
3
4
  import * as React from "react";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  //#region src/components/textarea.tsx
6
- var Textarea = React.forwardRef(function Textarea({ className, ...props }, ref) {
7
+ var Textarea = React.forwardRef(function Textarea({ className, width, ...props }, ref) {
7
8
  return /* @__PURE__ */ jsx("textarea", {
8
9
  ref,
9
10
  "data-slot": "textarea",
10
- className: cn(fieldClasses, "min-h-24 resize-y py-2.5 leading-5", className),
11
+ className: cn(fieldClasses, "min-h-24 resize-y py-2.5 leading-5", width && fieldWidthClasses[width], className),
11
12
  ...props
12
13
  });
13
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.js","names":[],"sources":["../../src/components/textarea.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nimport { fieldClasses } from './input';\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<'textarea'>>(\n function Textarea({ className, ...props }: React.ComponentProps<'textarea'>, ref) {\n return (\n <textarea\n ref={ref}\n data-slot=\"textarea\"\n className={cn(fieldClasses, 'min-h-24 resize-y py-2.5 leading-5', className)}\n {...props}\n />\n );\n },\n);\n\nexport { Textarea };\n"],"mappings":";;;;;AAMA,IAAM,WAAW,MAAM,WACrB,SAAS,SAAS,EAAE,WAAW,GAAG,SAA2C,KAAK;CAChF,OACE,oBAAC,YAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,cAAc,sCAAsC,SAAS;EAC3E,GAAI;CACL,CAAA;AAEL,CACF"}
1
+ {"version":3,"file":"textarea.js","names":[],"sources":["../../src/components/textarea.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nimport { fieldClasses, type FieldWidth, fieldWidthClasses } from './input';\n\nexport interface TextareaProps extends React.ComponentProps<'textarea'> {\n /** How wide the field is from 640px up; full width on phones. */\n width?: FieldWidth;\n}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, width, ...props }: TextareaProps,\n ref,\n) {\n return (\n <textarea\n ref={ref}\n data-slot=\"textarea\"\n className={cn(\n fieldClasses,\n 'min-h-24 resize-y py-2.5 leading-5',\n width && fieldWidthClasses[width],\n className,\n )}\n {...props}\n />\n );\n});\n\nexport { Textarea };\n"],"mappings":";;;;;;AAWA,IAAM,WAAW,MAAM,WAA+C,SAAS,SAC7E,EAAE,WAAW,OAAO,GAAG,SACvB,KACA;CACA,OACE,oBAAC,YAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,cACA,sCACA,SAAS,kBAAkB,QAC3B,SACF;EACA,GAAI;CACL,CAAA;AAEL,CAAC"}