@inshorts/glint-ui 0.5.4 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/README.md +3 -1
  2. package/dist/alert.cjs +96 -0
  3. package/dist/alert.cjs.map +1 -0
  4. package/dist/alert.d.cts +29 -0
  5. package/dist/alert.d.ts +29 -0
  6. package/dist/alert.js +10 -0
  7. package/dist/alert.js.map +1 -0
  8. package/dist/autocomplete.cjs +578 -0
  9. package/dist/autocomplete.cjs.map +1 -0
  10. package/dist/autocomplete.d.cts +56 -0
  11. package/dist/autocomplete.d.ts +56 -0
  12. package/dist/autocomplete.js +11 -0
  13. package/dist/autocomplete.js.map +1 -0
  14. package/dist/badge.cjs +89 -0
  15. package/dist/badge.cjs.map +1 -0
  16. package/dist/badge.d.cts +25 -0
  17. package/dist/badge.d.ts +25 -0
  18. package/dist/badge.js +10 -0
  19. package/dist/badge.js.map +1 -0
  20. package/dist/breadcrumb.cjs +88 -0
  21. package/dist/breadcrumb.cjs.map +1 -0
  22. package/dist/breadcrumb.d.cts +14 -0
  23. package/dist/breadcrumb.d.ts +14 -0
  24. package/dist/breadcrumb.js +8 -0
  25. package/dist/breadcrumb.js.map +1 -0
  26. package/dist/button.cjs +143 -0
  27. package/dist/button.cjs.map +1 -0
  28. package/dist/button.d.cts +34 -0
  29. package/dist/button.d.ts +34 -0
  30. package/dist/button.js +9 -0
  31. package/dist/button.js.map +1 -0
  32. package/dist/card.cjs +111 -0
  33. package/dist/card.cjs.map +1 -0
  34. package/dist/card.d.cts +15 -0
  35. package/dist/card.d.ts +15 -0
  36. package/dist/card.js +18 -0
  37. package/dist/card.js.map +1 -0
  38. package/dist/checkbox.cjs +66 -0
  39. package/dist/checkbox.cjs.map +1 -0
  40. package/{src/checkbox.tsx → dist/checkbox.d.cts} +5 -22
  41. package/dist/checkbox.d.ts +25 -0
  42. package/dist/checkbox.js +10 -0
  43. package/dist/checkbox.js.map +1 -0
  44. package/dist/chunk-43ZUFY63.js +85 -0
  45. package/dist/chunk-43ZUFY63.js.map +1 -0
  46. package/dist/chunk-67ACNS42.js +29 -0
  47. package/dist/chunk-67ACNS42.js.map +1 -0
  48. package/dist/chunk-6URKHMCF.js +76 -0
  49. package/dist/chunk-6URKHMCF.js.map +1 -0
  50. package/dist/chunk-ASU6CUTZ.js +85 -0
  51. package/dist/chunk-ASU6CUTZ.js.map +1 -0
  52. package/dist/chunk-EWSBFU54.js +53 -0
  53. package/dist/chunk-EWSBFU54.js.map +1 -0
  54. package/dist/chunk-G4ZQUSAJ.js +38 -0
  55. package/dist/chunk-G4ZQUSAJ.js.map +1 -0
  56. package/dist/chunk-GMCUXEFI.js +67 -0
  57. package/dist/chunk-GMCUXEFI.js.map +1 -0
  58. package/dist/chunk-HBBOR43A.js +85 -0
  59. package/dist/chunk-HBBOR43A.js.map +1 -0
  60. package/dist/chunk-HCA5ODCD.js +11 -0
  61. package/dist/chunk-HCA5ODCD.js.map +1 -0
  62. package/dist/chunk-HYRJYUPI.js +26 -0
  63. package/dist/chunk-HYRJYUPI.js.map +1 -0
  64. package/dist/chunk-IRCTGJQB.js +26 -0
  65. package/dist/chunk-IRCTGJQB.js.map +1 -0
  66. package/dist/chunk-JDE5XYPT.js +30 -0
  67. package/dist/chunk-JDE5XYPT.js.map +1 -0
  68. package/dist/chunk-JSJEEKR3.js +59 -0
  69. package/dist/chunk-JSJEEKR3.js.map +1 -0
  70. package/dist/chunk-KR3BCFP7.js +85 -0
  71. package/dist/chunk-KR3BCFP7.js.map +1 -0
  72. package/dist/chunk-MQT5RAQV.js +202 -0
  73. package/dist/chunk-MQT5RAQV.js.map +1 -0
  74. package/dist/chunk-MUPW2TFJ.js +102 -0
  75. package/dist/chunk-MUPW2TFJ.js.map +1 -0
  76. package/dist/chunk-PM2VE7DJ.js +100 -0
  77. package/dist/chunk-PM2VE7DJ.js.map +1 -0
  78. package/dist/chunk-PPYR3O3L.js +44 -0
  79. package/dist/chunk-PPYR3O3L.js.map +1 -0
  80. package/dist/chunk-PUTC52SI.js +98 -0
  81. package/dist/chunk-PUTC52SI.js.map +1 -0
  82. package/dist/chunk-PVK4WQJZ.js +513 -0
  83. package/dist/chunk-PVK4WQJZ.js.map +1 -0
  84. package/dist/chunk-PWAKTEXF.js +18 -0
  85. package/dist/chunk-PWAKTEXF.js.map +1 -0
  86. package/dist/chunk-QTFWORA7.js +26 -0
  87. package/dist/chunk-QTFWORA7.js.map +1 -0
  88. package/dist/chunk-RUPL2H6V.js +49 -0
  89. package/dist/chunk-RUPL2H6V.js.map +1 -0
  90. package/dist/chunk-S7PVZAPL.js +28 -0
  91. package/dist/chunk-S7PVZAPL.js.map +1 -0
  92. package/dist/chunk-SQDV2AKJ.js +49 -0
  93. package/dist/chunk-SQDV2AKJ.js.map +1 -0
  94. package/dist/chunk-T2KXVH3O.js +297 -0
  95. package/dist/chunk-T2KXVH3O.js.map +1 -0
  96. package/dist/chunk-T4WCCHJQ.js +29 -0
  97. package/dist/chunk-T4WCCHJQ.js.map +1 -0
  98. package/dist/chunk-UC3ZIQPE.js +93 -0
  99. package/dist/chunk-UC3ZIQPE.js.map +1 -0
  100. package/dist/chunk-UE7JY7VR.js +28 -0
  101. package/dist/chunk-UE7JY7VR.js.map +1 -0
  102. package/dist/chunk-WVNRFO5F.js +70 -0
  103. package/dist/chunk-WVNRFO5F.js.map +1 -0
  104. package/dist/chunk-Y5WCT6XN.js +93 -0
  105. package/dist/chunk-Y5WCT6XN.js.map +1 -0
  106. package/dist/chunk-YDICVETX.js +151 -0
  107. package/dist/chunk-YDICVETX.js.map +1 -0
  108. package/dist/chunk-YSU4VWRD.js +90 -0
  109. package/dist/chunk-YSU4VWRD.js.map +1 -0
  110. package/dist/chunk-ZFSQVMLJ.js +126 -0
  111. package/dist/chunk-ZFSQVMLJ.js.map +1 -0
  112. package/dist/chunk-ZHATD73Y.js +46 -0
  113. package/dist/chunk-ZHATD73Y.js.map +1 -0
  114. package/dist/chunk-ZLAA4DGG.js +111 -0
  115. package/dist/chunk-ZLAA4DGG.js.map +1 -0
  116. package/dist/chunk-ZP252OJZ.js +56 -0
  117. package/dist/chunk-ZP252OJZ.js.map +1 -0
  118. package/dist/clipboard.cjs +125 -0
  119. package/dist/clipboard.cjs.map +1 -0
  120. package/dist/clipboard.d.cts +52 -0
  121. package/dist/clipboard.d.ts +52 -0
  122. package/dist/clipboard.js +23 -0
  123. package/dist/clipboard.js.map +1 -0
  124. package/dist/collapsible.cjs +94 -0
  125. package/dist/collapsible.cjs.map +1 -0
  126. package/dist/collapsible.d.cts +21 -0
  127. package/dist/collapsible.d.ts +21 -0
  128. package/dist/collapsible.js +9 -0
  129. package/dist/collapsible.js.map +1 -0
  130. package/dist/confirm-dialog.cjs +369 -0
  131. package/dist/confirm-dialog.cjs.map +1 -0
  132. package/dist/confirm-dialog.d.cts +16 -0
  133. package/dist/confirm-dialog.d.ts +16 -0
  134. package/dist/confirm-dialog.js +13 -0
  135. package/dist/confirm-dialog.js.map +1 -0
  136. package/dist/copy-button.cjs +102 -0
  137. package/dist/copy-button.cjs.map +1 -0
  138. package/dist/copy-button.d.cts +18 -0
  139. package/dist/copy-button.d.ts +18 -0
  140. package/dist/copy-button.js +10 -0
  141. package/dist/copy-button.js.map +1 -0
  142. package/dist/data-table.cjs +140 -0
  143. package/dist/data-table.cjs.map +1 -0
  144. package/dist/data-table.d.cts +81 -0
  145. package/dist/data-table.d.ts +81 -0
  146. package/dist/data-table.js +8 -0
  147. package/dist/data-table.js.map +1 -0
  148. package/dist/date-range-picker/dateRange.cjs +138 -0
  149. package/dist/date-range-picker/dateRange.cjs.map +1 -0
  150. package/dist/date-range-picker/dateRange.d.cts +57 -0
  151. package/dist/date-range-picker/dateRange.d.ts +57 -0
  152. package/dist/date-range-picker/dateRange.js +31 -0
  153. package/dist/date-range-picker/dateRange.js.map +1 -0
  154. package/dist/date-range-picker/index.cjs +375 -0
  155. package/dist/date-range-picker/index.cjs.map +1 -0
  156. package/dist/date-range-picker/index.d.cts +18 -0
  157. package/dist/date-range-picker/index.d.ts +18 -0
  158. package/dist/date-range-picker/index.js +10 -0
  159. package/dist/date-range-picker/index.js.map +1 -0
  160. package/dist/dialogLayer.cjs +121 -0
  161. package/dist/dialogLayer.cjs.map +1 -0
  162. package/dist/dialogLayer.d.cts +11 -0
  163. package/dist/dialogLayer.d.ts +11 -0
  164. package/dist/dialogLayer.js +8 -0
  165. package/dist/dialogLayer.js.map +1 -0
  166. package/dist/feature-access-gate.cjs +160 -0
  167. package/dist/feature-access-gate.cjs.map +1 -0
  168. package/dist/feature-access-gate.d.cts +14 -0
  169. package/dist/feature-access-gate.d.ts +14 -0
  170. package/dist/feature-access-gate.js +11 -0
  171. package/dist/feature-access-gate.js.map +1 -0
  172. package/dist/field.cjs +58 -0
  173. package/dist/field.cjs.map +1 -0
  174. package/dist/field.d.cts +23 -0
  175. package/dist/field.d.ts +23 -0
  176. package/dist/field.js +8 -0
  177. package/dist/field.js.map +1 -0
  178. package/dist/image-uploader.cjs +293 -0
  179. package/dist/image-uploader.cjs.map +1 -0
  180. package/dist/image-uploader.d.cts +34 -0
  181. package/dist/image-uploader.d.ts +34 -0
  182. package/dist/image-uploader.js +12 -0
  183. package/dist/image-uploader.js.map +1 -0
  184. package/dist/index.cjs +3012 -0
  185. package/dist/index.cjs.map +1 -0
  186. package/dist/index.d.cts +41 -0
  187. package/dist/index.d.ts +41 -0
  188. package/dist/index.js +232 -0
  189. package/dist/index.js.map +1 -0
  190. package/dist/input.cjs +58 -0
  191. package/dist/input.cjs.map +1 -0
  192. package/dist/input.d.cts +7 -0
  193. package/dist/input.d.ts +7 -0
  194. package/dist/input.js +10 -0
  195. package/dist/input.js.map +1 -0
  196. package/dist/label.cjs +67 -0
  197. package/dist/label.cjs.map +1 -0
  198. package/dist/label.d.cts +7 -0
  199. package/dist/label.d.ts +7 -0
  200. package/dist/label.js +9 -0
  201. package/dist/label.js.map +1 -0
  202. package/dist/modal.cjs +212 -0
  203. package/dist/modal.cjs.map +1 -0
  204. package/dist/modal.d.cts +39 -0
  205. package/dist/modal.d.ts +39 -0
  206. package/dist/modal.js +12 -0
  207. package/dist/modal.js.map +1 -0
  208. package/dist/page-header.cjs +78 -0
  209. package/dist/page-header.cjs.map +1 -0
  210. package/dist/page-header.d.cts +35 -0
  211. package/dist/page-header.d.ts +35 -0
  212. package/dist/page-header.js +8 -0
  213. package/dist/page-header.js.map +1 -0
  214. package/dist/pagination.cjs +237 -0
  215. package/dist/pagination.cjs.map +1 -0
  216. package/dist/pagination.d.cts +15 -0
  217. package/dist/pagination.d.ts +15 -0
  218. package/dist/pagination.js +11 -0
  219. package/dist/pagination.js.map +1 -0
  220. package/dist/panel-brand-mark.cjs +59 -0
  221. package/dist/panel-brand-mark.cjs.map +1 -0
  222. package/dist/panel-brand-mark.d.cts +13 -0
  223. package/dist/panel-brand-mark.d.ts +13 -0
  224. package/dist/panel-brand-mark.js +8 -0
  225. package/dist/panel-brand-mark.js.map +1 -0
  226. package/dist/panel-sign-in.cjs +256 -0
  227. package/dist/panel-sign-in.cjs.map +1 -0
  228. package/dist/panel-sign-in.d.cts +31 -0
  229. package/dist/panel-sign-in.d.ts +31 -0
  230. package/dist/panel-sign-in.js +14 -0
  231. package/dist/panel-sign-in.js.map +1 -0
  232. package/dist/segmented-control.cjs +126 -0
  233. package/dist/segmented-control.cjs.map +1 -0
  234. package/dist/segmented-control.d.cts +60 -0
  235. package/dist/segmented-control.d.ts +60 -0
  236. package/dist/segmented-control.js +9 -0
  237. package/dist/segmented-control.js.map +1 -0
  238. package/dist/select.cjs +648 -0
  239. package/dist/select.cjs.map +1 -0
  240. package/dist/select.d.cts +30 -0
  241. package/dist/select.d.ts +30 -0
  242. package/dist/select.js +12 -0
  243. package/dist/select.js.map +1 -0
  244. package/dist/separator.cjs +70 -0
  245. package/dist/separator.cjs.map +1 -0
  246. package/dist/separator.d.cts +13 -0
  247. package/dist/separator.d.ts +13 -0
  248. package/dist/separator.js +9 -0
  249. package/dist/separator.js.map +1 -0
  250. package/dist/side-drawer.cjs +321 -0
  251. package/dist/side-drawer.cjs.map +1 -0
  252. package/dist/side-drawer.d.cts +21 -0
  253. package/dist/side-drawer.d.ts +21 -0
  254. package/dist/side-drawer.js +13 -0
  255. package/dist/side-drawer.js.map +1 -0
  256. package/dist/spinner.cjs +57 -0
  257. package/dist/spinner.cjs.map +1 -0
  258. package/{src/spinner.tsx → dist/spinner.d.cts} +11 -22
  259. package/dist/spinner.d.ts +27 -0
  260. package/dist/spinner.js +8 -0
  261. package/dist/spinner.js.map +1 -0
  262. package/dist/spreadsheet-grid.cjs +238 -0
  263. package/dist/spreadsheet-grid.cjs.map +1 -0
  264. package/dist/spreadsheet-grid.d.cts +48 -0
  265. package/dist/spreadsheet-grid.d.ts +48 -0
  266. package/dist/spreadsheet-grid.js +8 -0
  267. package/dist/spreadsheet-grid.js.map +1 -0
  268. package/dist/state-panel.cjs +86 -0
  269. package/dist/state-panel.cjs.map +1 -0
  270. package/dist/state-panel.d.cts +23 -0
  271. package/dist/state-panel.d.ts +23 -0
  272. package/dist/state-panel.js +9 -0
  273. package/dist/state-panel.js.map +1 -0
  274. package/dist/switch.cjs +87 -0
  275. package/dist/switch.cjs.map +1 -0
  276. package/dist/switch.d.cts +13 -0
  277. package/dist/switch.d.ts +13 -0
  278. package/dist/switch.js +9 -0
  279. package/dist/switch.js.map +1 -0
  280. package/dist/table.cjs +139 -0
  281. package/dist/table.cjs.map +1 -0
  282. package/dist/table.d.cts +16 -0
  283. package/dist/table.d.ts +16 -0
  284. package/dist/table.js +22 -0
  285. package/dist/table.js.map +1 -0
  286. package/dist/tabs.cjs +168 -0
  287. package/dist/tabs.cjs.map +1 -0
  288. package/dist/tabs.d.cts +59 -0
  289. package/dist/tabs.d.ts +59 -0
  290. package/dist/tabs.js +11 -0
  291. package/dist/tabs.js.map +1 -0
  292. package/dist/textarea.cjs +66 -0
  293. package/dist/textarea.cjs.map +1 -0
  294. package/dist/textarea.d.cts +18 -0
  295. package/dist/textarea.d.ts +18 -0
  296. package/dist/textarea.js +10 -0
  297. package/dist/textarea.js.map +1 -0
  298. package/dist/utils.cjs +35 -0
  299. package/dist/utils.cjs.map +1 -0
  300. package/dist/utils.d.cts +5 -0
  301. package/dist/utils.d.ts +5 -0
  302. package/dist/utils.js +7 -0
  303. package/dist/utils.js.map +1 -0
  304. package/package.json +390 -13
  305. package/src/alert.tsx +0 -74
  306. package/src/autocomplete.tsx +0 -666
  307. package/src/badge.tsx +0 -60
  308. package/src/breadcrumb.tsx +0 -71
  309. package/src/button.tsx +0 -113
  310. package/src/card.tsx +0 -79
  311. package/src/clipboard.ts +0 -144
  312. package/src/collapsible.tsx +0 -63
  313. package/src/confirm-dialog.tsx +0 -84
  314. package/src/copy-button.tsx +0 -58
  315. package/src/data-table.tsx +0 -190
  316. package/src/date-range-picker/dateRange.ts +0 -142
  317. package/src/date-range-picker/index.tsx +0 -366
  318. package/src/dialogLayer.ts +0 -142
  319. package/src/feature-access-gate.tsx +0 -38
  320. package/src/field.tsx +0 -56
  321. package/src/image-uploader.tsx +0 -181
  322. package/src/index.ts +0 -37
  323. package/src/input.tsx +0 -16
  324. package/src/label.tsx +0 -23
  325. package/src/modal.tsx +0 -117
  326. package/src/page-header.tsx +0 -75
  327. package/src/pagination.tsx +0 -116
  328. package/src/panel-brand-mark.tsx +0 -32
  329. package/src/panel-sign-in.tsx +0 -134
  330. package/src/segmented-control.tsx +0 -155
  331. package/src/select.tsx +0 -105
  332. package/src/separator.tsx +0 -32
  333. package/src/side-drawer.tsx +0 -87
  334. package/src/spreadsheet-grid.tsx +0 -264
  335. package/src/state-panel.tsx +0 -46
  336. package/src/switch.tsx +0 -47
  337. package/src/table.tsx +0 -110
  338. package/src/tabs.tsx +0 -201
  339. package/src/textarea.tsx +0 -32
  340. package/src/utils.ts +0 -6
@@ -0,0 +1,56 @@
1
+ import * as React from 'react';
2
+
3
+ type AutocompleteOption = {
4
+ value: string;
5
+ label: string;
6
+ disabled?: boolean;
7
+ };
8
+ type BaseAutocompleteProps = {
9
+ options: AutocompleteOption[];
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ className?: string;
13
+ emptyMessage?: string;
14
+ id?: string;
15
+ /**
16
+ * Accessible name for the combobox.
17
+ *
18
+ * `Field` renders its label as a `<span>`, so without this the control is
19
+ * announced as an unnamed combobox and cannot be queried by name — the
20
+ * filter toolbars work around it by counting comboboxes on the page.
21
+ */
22
+ ariaLabel?: string;
23
+ /**
24
+ * `compact` is the spreadsheet cell: no search icon, no min height, and a
25
+ * list wide enough to read a name. The closed control still shows the
26
+ * chosen label, and typing filters the list.
27
+ */
28
+ size?: "default" | "compact";
29
+ /**
30
+ * Type a value and press Enter (or paste a list) to add it, like antd
31
+ * `Select mode="tags"`. With `multiple` a pasted list is split into several
32
+ * values; on a single-value control it accepts one typed value the options
33
+ * do not offer — an id for a record the list has not loaded, say.
34
+ */
35
+ creatable?: boolean;
36
+ /**
37
+ * Shows the clear button once a value is chosen. Off for dropdowns that
38
+ * always keep one of their options, where clearing would blank a required
39
+ * field.
40
+ */
41
+ clearable?: boolean;
42
+ };
43
+ type SingleAutocompleteProps = BaseAutocompleteProps & {
44
+ multiple?: false;
45
+ value: string;
46
+ onChange: (value: string) => void;
47
+ };
48
+ type MultipleAutocompleteProps = BaseAutocompleteProps & {
49
+ multiple: true;
50
+ value: string[];
51
+ onChange: (value: string[]) => void;
52
+ };
53
+ type AutocompleteProps = SingleAutocompleteProps | MultipleAutocompleteProps;
54
+ declare function Autocomplete(props: AutocompleteProps): React.JSX.Element;
55
+
56
+ export { Autocomplete, type AutocompleteOption, type AutocompleteProps };
@@ -0,0 +1,56 @@
1
+ import * as React from 'react';
2
+
3
+ type AutocompleteOption = {
4
+ value: string;
5
+ label: string;
6
+ disabled?: boolean;
7
+ };
8
+ type BaseAutocompleteProps = {
9
+ options: AutocompleteOption[];
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ className?: string;
13
+ emptyMessage?: string;
14
+ id?: string;
15
+ /**
16
+ * Accessible name for the combobox.
17
+ *
18
+ * `Field` renders its label as a `<span>`, so without this the control is
19
+ * announced as an unnamed combobox and cannot be queried by name — the
20
+ * filter toolbars work around it by counting comboboxes on the page.
21
+ */
22
+ ariaLabel?: string;
23
+ /**
24
+ * `compact` is the spreadsheet cell: no search icon, no min height, and a
25
+ * list wide enough to read a name. The closed control still shows the
26
+ * chosen label, and typing filters the list.
27
+ */
28
+ size?: "default" | "compact";
29
+ /**
30
+ * Type a value and press Enter (or paste a list) to add it, like antd
31
+ * `Select mode="tags"`. With `multiple` a pasted list is split into several
32
+ * values; on a single-value control it accepts one typed value the options
33
+ * do not offer — an id for a record the list has not loaded, say.
34
+ */
35
+ creatable?: boolean;
36
+ /**
37
+ * Shows the clear button once a value is chosen. Off for dropdowns that
38
+ * always keep one of their options, where clearing would blank a required
39
+ * field.
40
+ */
41
+ clearable?: boolean;
42
+ };
43
+ type SingleAutocompleteProps = BaseAutocompleteProps & {
44
+ multiple?: false;
45
+ value: string;
46
+ onChange: (value: string) => void;
47
+ };
48
+ type MultipleAutocompleteProps = BaseAutocompleteProps & {
49
+ multiple: true;
50
+ value: string[];
51
+ onChange: (value: string[]) => void;
52
+ };
53
+ type AutocompleteProps = SingleAutocompleteProps | MultipleAutocompleteProps;
54
+ declare function Autocomplete(props: AutocompleteProps): React.JSX.Element;
55
+
56
+ export { Autocomplete, type AutocompleteOption, type AutocompleteProps };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import {
3
+ Autocomplete
4
+ } from "./chunk-PVK4WQJZ.js";
5
+ import "./chunk-YSU4VWRD.js";
6
+ import "./chunk-HBBOR43A.js";
7
+ import "./chunk-HCA5ODCD.js";
8
+ export {
9
+ Autocomplete
10
+ };
11
+ //# sourceMappingURL=autocomplete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/badge.cjs ADDED
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/badge.tsx
31
+ var badge_exports = {};
32
+ __export(badge_exports, {
33
+ Badge: () => Badge,
34
+ badgeVariants: () => badgeVariants
35
+ });
36
+ module.exports = __toCommonJS(badge_exports);
37
+ var React = __toESM(require("react"), 1);
38
+ var import_class_variance_authority = require("class-variance-authority");
39
+
40
+ // src/utils.ts
41
+ var import_clsx = require("clsx");
42
+ var import_tailwind_merge = require("tailwind-merge");
43
+ function cn(...inputs) {
44
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
45
+ }
46
+
47
+ // src/badge.tsx
48
+ var import_jsx_runtime = require("react/jsx-runtime");
49
+ var badgeVariants = (0, import_class_variance_authority.cva)(
50
+ "inline-flex items-center gap-1 rounded font-medium whitespace-nowrap",
51
+ {
52
+ variants: {
53
+ variant: {
54
+ neutral: "bg-muted text-muted-foreground",
55
+ success: "bg-success/15 text-success",
56
+ warning: "bg-warning/15 text-warning",
57
+ danger: "bg-destructive/15 text-destructive",
58
+ info: "bg-info/15 text-info"
59
+ },
60
+ size: {
61
+ /** Inline chips — a category, a tenant, a permission. */
62
+ sm: "px-1.5 py-0.5 text-xs",
63
+ /** A row's status. */
64
+ md: "px-2 py-0.5 text-xs"
65
+ }
66
+ },
67
+ defaultVariants: {
68
+ variant: "neutral",
69
+ size: "md"
70
+ }
71
+ }
72
+ );
73
+ var Badge = React.forwardRef(
74
+ ({ className, variant, size, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
+ "span",
76
+ {
77
+ ref,
78
+ className: cn(badgeVariants({ variant, size }), className),
79
+ ...props
80
+ }
81
+ )
82
+ );
83
+ Badge.displayName = "Badge";
84
+ // Annotate the CommonJS export names for ESM import in node:
85
+ 0 && (module.exports = {
86
+ Badge,
87
+ badgeVariants
88
+ });
89
+ //# sourceMappingURL=badge.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/badge.tsx","../src/utils.ts"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"./utils\";\n\n/**\n * The status pill every list panel was spelling out by hand.\n *\n * Variants are semantic rather than named after a colour, because the same\n * status means the same thing on every panel and should not have to be\n * re-decided per table — Deleted was `bg-rose-100 text-rose-800` in one place\n * and `text-rose-900` two files away.\n *\n * These stay light-on-dark-text in both themes on purpose. A pill is a small\n * block of colour whose whole job is to be picked out of a row of text, and\n * inverting it per theme made the same status read as two different states.\n */\nconst badgeVariants = cva(\n \"inline-flex items-center gap-1 rounded font-medium whitespace-nowrap\",\n {\n variants: {\n variant: {\n neutral: \"bg-muted text-muted-foreground\",\n success: \"bg-success/15 text-success\",\n warning: \"bg-warning/15 text-warning\",\n danger: \"bg-destructive/15 text-destructive\",\n info: \"bg-info/15 text-info\",\n },\n size: {\n /** Inline chips — a category, a tenant, a permission. */\n sm: \"px-1.5 py-0.5 text-xs\",\n /** A row's status. */\n md: \"px-2 py-0.5 text-xs\",\n },\n },\n defaultVariants: {\n variant: \"neutral\",\n size: \"md\",\n },\n },\n);\n\nexport interface BadgeProps\n extends\n React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof badgeVariants> {}\n\nexport const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, variant, size, ...props }, ref) => (\n <span\n ref={ref}\n className={cn(badgeVariants({ variant, size }), className)}\n {...props}\n />\n ),\n);\n\nBadge.displayName = \"Badge\";\n\nexport { badgeVariants };\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AACvB,sCAAuC;;;ACDvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD4CI;AAhCJ,IAAM,oBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA;AAAA,QAEJ,IAAI;AAAA;AAAA,QAEJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAOO,IAAM,QAAc;AAAA,EACzB,CAAC,EAAE,WAAW,SAAS,MAAM,GAAG,MAAM,GAAG,QACvC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,cAAc,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS;AAAA,MACxD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,MAAM,cAAc;","names":[]}
@@ -0,0 +1,25 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ /**
6
+ * The status pill every list panel was spelling out by hand.
7
+ *
8
+ * Variants are semantic rather than named after a colour, because the same
9
+ * status means the same thing on every panel and should not have to be
10
+ * re-decided per table — Deleted was `bg-rose-100 text-rose-800` in one place
11
+ * and `text-rose-900` two files away.
12
+ *
13
+ * These stay light-on-dark-text in both themes on purpose. A pill is a small
14
+ * block of colour whose whole job is to be picked out of a row of text, and
15
+ * inverting it per theme made the same status read as two different states.
16
+ */
17
+ declare const badgeVariants: (props?: ({
18
+ variant?: "neutral" | "success" | "warning" | "danger" | "info" | null | undefined;
19
+ size?: "sm" | "md" | null | undefined;
20
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
21
+ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
22
+ }
23
+ declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
24
+
25
+ export { Badge, type BadgeProps, badgeVariants };
@@ -0,0 +1,25 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ /**
6
+ * The status pill every list panel was spelling out by hand.
7
+ *
8
+ * Variants are semantic rather than named after a colour, because the same
9
+ * status means the same thing on every panel and should not have to be
10
+ * re-decided per table — Deleted was `bg-rose-100 text-rose-800` in one place
11
+ * and `text-rose-900` two files away.
12
+ *
13
+ * These stay light-on-dark-text in both themes on purpose. A pill is a small
14
+ * block of colour whose whole job is to be picked out of a row of text, and
15
+ * inverting it per theme made the same status read as two different states.
16
+ */
17
+ declare const badgeVariants: (props?: ({
18
+ variant?: "neutral" | "success" | "warning" | "danger" | "info" | null | undefined;
19
+ size?: "sm" | "md" | null | undefined;
20
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
21
+ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
22
+ }
23
+ declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
24
+
25
+ export { Badge, type BadgeProps, badgeVariants };
package/dist/badge.js ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ Badge,
3
+ badgeVariants
4
+ } from "./chunk-SQDV2AKJ.js";
5
+ import "./chunk-HCA5ODCD.js";
6
+ export {
7
+ Badge,
8
+ badgeVariants
9
+ };
10
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/breadcrumb.tsx
21
+ var breadcrumb_exports = {};
22
+ __export(breadcrumb_exports, {
23
+ Breadcrumb: () => Breadcrumb
24
+ });
25
+ module.exports = __toCommonJS(breadcrumb_exports);
26
+ var import_lucide_react = require("lucide-react");
27
+
28
+ // src/utils.ts
29
+ var import_clsx = require("clsx");
30
+ var import_tailwind_merge = require("tailwind-merge");
31
+ function cn(...inputs) {
32
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
33
+ }
34
+
35
+ // src/breadcrumb.tsx
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ function Breadcrumb({ items, className }) {
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { "aria-label": "Breadcrumb", className: cn("text-sm", className), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "flex flex-wrap items-center gap-1.5", children: items.map((item, index) => {
39
+ const isLast = index === items.length - 1;
40
+ const isInteractive = !isLast && (item.href || item.onClick);
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
42
+ "li",
43
+ {
44
+ className: "flex items-center gap-1.5",
45
+ children: [
46
+ index > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ import_lucide_react.ChevronRight,
48
+ {
49
+ className: "text-muted-foreground/70 size-3.5 shrink-0",
50
+ "aria-hidden": true
51
+ }
52
+ ),
53
+ isInteractive ? item.href ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
+ "a",
55
+ {
56
+ href: item.href,
57
+ className: "text-muted-foreground hover:text-foreground transition",
58
+ children: item.label
59
+ }
60
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
61
+ "button",
62
+ {
63
+ type: "button",
64
+ onClick: item.onClick,
65
+ className: "text-muted-foreground hover:text-foreground transition",
66
+ children: item.label
67
+ }
68
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
+ "span",
70
+ {
71
+ className: cn(
72
+ isLast ? "text-foreground font-medium" : "text-muted-foreground"
73
+ ),
74
+ "aria-current": isLast ? "page" : void 0,
75
+ children: item.label
76
+ }
77
+ )
78
+ ]
79
+ },
80
+ `${item.label}-${index}`
81
+ );
82
+ }) }) });
83
+ }
84
+ // Annotate the CommonJS export names for ESM import in node:
85
+ 0 && (module.exports = {
86
+ Breadcrumb
87
+ });
88
+ //# sourceMappingURL=breadcrumb.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/breadcrumb.tsx","../src/utils.ts"],"sourcesContent":["import { ChevronRight } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\nexport type BreadcrumbItem = {\n label: string;\n href?: string;\n onClick?: () => void;\n};\n\ninterface BreadcrumbProps {\n items: BreadcrumbItem[];\n className?: string;\n}\n\nexport function Breadcrumb({ items, className }: BreadcrumbProps) {\n return (\n <nav aria-label=\"Breadcrumb\" className={cn(\"text-sm\", className)}>\n <ol className=\"flex flex-wrap items-center gap-1.5\">\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const isInteractive = !isLast && (item.href || item.onClick);\n\n return (\n <li\n key={`${item.label}-${index}`}\n className=\"flex items-center gap-1.5\"\n >\n {index > 0 && (\n <ChevronRight\n className=\"text-muted-foreground/70 size-3.5 shrink-0\"\n aria-hidden\n />\n )}\n {isInteractive ? (\n item.href ? (\n <a\n href={item.href}\n className=\"text-muted-foreground hover:text-foreground transition\"\n >\n {item.label}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={item.onClick}\n className=\"text-muted-foreground hover:text-foreground transition\"\n >\n {item.label}\n </button>\n )\n ) : (\n <span\n className={cn(\n isLast\n ? \"text-foreground font-medium\"\n : \"text-muted-foreground\",\n )}\n aria-current={isLast ? \"page\" : undefined}\n >\n {item.label}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;;;ACA7B,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADoBY;AATL,SAAS,WAAW,EAAE,OAAO,UAAU,GAAoB;AAChE,SACE,4CAAC,SAAI,cAAW,cAAa,WAAW,GAAG,WAAW,SAAS,GAC7D,sDAAC,QAAG,WAAU,uCACX,gBAAM,IAAI,CAAC,MAAM,UAAU;AAC1B,UAAM,SAAS,UAAU,MAAM,SAAS;AACxC,UAAM,gBAAgB,CAAC,WAAW,KAAK,QAAQ,KAAK;AAEpD,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,WAAU;AAAA,QAET;AAAA,kBAAQ,KACP;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,eAAW;AAAA;AAAA,UACb;AAAA,UAED,gBACC,KAAK,OACH;AAAA,YAAC;AAAA;AAAA,cACC,MAAM,KAAK;AAAA,cACX,WAAU;AAAA,cAET,eAAK;AAAA;AAAA,UACR,IAEA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAS,KAAK;AAAA,cACd,WAAU;AAAA,cAET,eAAK;AAAA;AAAA,UACR,IAGF;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT,SACI,gCACA;AAAA,cACN;AAAA,cACA,gBAAc,SAAS,SAAS;AAAA,cAE/B,eAAK;AAAA;AAAA,UACR;AAAA;AAAA;AAAA,MApCG,GAAG,KAAK,KAAK,IAAI,KAAK;AAAA,IAsC7B;AAAA,EAEJ,CAAC,GACH,GACF;AAEJ;","names":[]}
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+
3
+ type BreadcrumbItem = {
4
+ label: string;
5
+ href?: string;
6
+ onClick?: () => void;
7
+ };
8
+ interface BreadcrumbProps {
9
+ items: BreadcrumbItem[];
10
+ className?: string;
11
+ }
12
+ declare function Breadcrumb({ items, className }: BreadcrumbProps): React.JSX.Element;
13
+
14
+ export { Breadcrumb, type BreadcrumbItem };
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+
3
+ type BreadcrumbItem = {
4
+ label: string;
5
+ href?: string;
6
+ onClick?: () => void;
7
+ };
8
+ interface BreadcrumbProps {
9
+ items: BreadcrumbItem[];
10
+ className?: string;
11
+ }
12
+ declare function Breadcrumb({ items, className }: BreadcrumbProps): React.JSX.Element;
13
+
14
+ export { Breadcrumb, type BreadcrumbItem };
@@ -0,0 +1,8 @@
1
+ import {
2
+ Breadcrumb
3
+ } from "./chunk-JSJEEKR3.js";
4
+ import "./chunk-HCA5ODCD.js";
5
+ export {
6
+ Breadcrumb
7
+ };
8
+ //# sourceMappingURL=breadcrumb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/button.tsx
31
+ var button_exports = {};
32
+ __export(button_exports, {
33
+ Button: () => Button
34
+ });
35
+ module.exports = __toCommonJS(button_exports);
36
+ var React = __toESM(require("react"), 1);
37
+ var import_class_variance_authority = require("class-variance-authority");
38
+ var import_react_slot = require("@radix-ui/react-slot");
39
+
40
+ // src/spinner.tsx
41
+ var import_lucide_react = require("lucide-react");
42
+
43
+ // src/utils.ts
44
+ var import_clsx = require("clsx");
45
+ var import_tailwind_merge = require("tailwind-merge");
46
+ function cn(...inputs) {
47
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
48
+ }
49
+
50
+ // src/spinner.tsx
51
+ var import_jsx_runtime = require("react/jsx-runtime");
52
+ var SIZES = {
53
+ sm: "size-3.5",
54
+ md: "size-4",
55
+ lg: "size-5",
56
+ xl: "size-10 border-2"
57
+ };
58
+ function Spinner({ size = "md", className, ...props }) {
59
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
+ import_lucide_react.Loader2,
61
+ {
62
+ "aria-hidden": true,
63
+ className: cn("animate-spin", SIZES[size], className),
64
+ ...props
65
+ }
66
+ );
67
+ }
68
+
69
+ // src/button.tsx
70
+ var import_jsx_runtime2 = require("react/jsx-runtime");
71
+ var buttonVariants = (0, import_class_variance_authority.cva)(
72
+ "inline-flex h-9 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium transition duration-200 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
73
+ {
74
+ variants: {
75
+ variant: {
76
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
77
+ secondary: "bg-muted text-foreground hover:bg-muted/80",
78
+ ghost: "hover:bg-muted",
79
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
80
+ outline: "border border-border bg-background hover:bg-muted"
81
+ },
82
+ size: {
83
+ sm: "h-8 px-2.5",
84
+ md: "h-9 px-3",
85
+ lg: "h-10 px-4",
86
+ icon: "h-9 w-9 px-0",
87
+ // Square, matching `sm`'s height — for an icon-only control sitting in
88
+ // a table row or beside `sm` buttons, where `icon` is a row taller.
89
+ "icon-sm": "h-8 w-8 px-0"
90
+ }
91
+ },
92
+ defaultVariants: {
93
+ variant: "default",
94
+ size: "md"
95
+ }
96
+ }
97
+ );
98
+ var ICON_SIZES = /* @__PURE__ */ new Set(["icon", "icon-sm"]);
99
+ var Button = React.forwardRef(
100
+ ({
101
+ className,
102
+ variant,
103
+ size,
104
+ asChild = false,
105
+ loading,
106
+ disabled,
107
+ children,
108
+ ...props
109
+ }, ref) => {
110
+ const Comp = asChild ? import_react_slot.Slot : "button";
111
+ if (asChild) {
112
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
113
+ Comp,
114
+ {
115
+ ref,
116
+ className: cn(buttonVariants({ variant, size }), className),
117
+ ...props,
118
+ children
119
+ }
120
+ );
121
+ }
122
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
123
+ "button",
124
+ {
125
+ ref,
126
+ disabled: disabled || loading,
127
+ "aria-busy": loading || void 0,
128
+ className: cn(buttonVariants({ variant, size }), className),
129
+ ...props,
130
+ children: [
131
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Spinner, { size: "sm" }) : null,
132
+ loading && size != null && ICON_SIZES.has(size) ? null : children
133
+ ]
134
+ }
135
+ );
136
+ }
137
+ );
138
+ Button.displayName = "Button";
139
+ // Annotate the CommonJS export names for ESM import in node:
140
+ 0 && (module.exports = {
141
+ Button
142
+ });
143
+ //# sourceMappingURL=button.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/button.tsx","../src/spinner.tsx","../src/utils.ts"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nimport { Spinner } from \"./spinner\";\nimport { cn } from \"./utils\";\n\nconst buttonVariants = cva(\n \"inline-flex h-9 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium transition duration-200 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n secondary: \"bg-muted text-foreground hover:bg-muted/80\",\n ghost: \"hover:bg-muted\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-border bg-background hover:bg-muted\",\n },\n size: {\n sm: \"h-8 px-2.5\",\n md: \"h-9 px-3\",\n lg: \"h-10 px-4\",\n icon: \"h-9 w-9 px-0\",\n // Square, matching `sm`'s height — for an icon-only control sitting in\n // a table row or beside `sm` buttons, where `icon` is a row taller.\n \"icon-sm\": \"h-8 w-8 px-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * Work is in flight: shows a spinner, disables the button, and sets\n * `aria-busy`.\n *\n * This exists because the panel had 272 disabled buttons and only 22 that\n * said anything about why — the rest went dead on click with no spinner and\n * no label change, which reads as a broken button rather than a busy one.\n * Making the feedback part of `disabled` rather than something each caller\n * remembers separately is the only way that ratio stays fixed.\n *\n * The label is kept rather than swapped. \"Saving…\" loses which button you\n * pressed, and the spinner already says it is working. An icon-only button\n * is the exception — there is no room beside the glyph, so the spinner takes\n * its place; the `aria-label` is what names the button either way.\n *\n * \"Icon-only\" means an icon `size`. A square button that grew a spinner\n * beside its glyph would not just look wrong, it would resize mid-request\n * and shove whatever sits next to it sideways.\n */\n loading?: boolean;\n}\n\n/** Sizes with no room for a spinner beside the glyph. */\nconst ICON_SIZES = new Set<string>([\"icon\", \"icon-sm\"]);\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n loading,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n\n // `asChild` renders someone else's element, which may not take a spinner or\n // a disabled attribute — so the busy treatment is only applied to a real\n // button, and passing both is a mistake worth not papering over.\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <button\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {loading ? <Spinner size=\"sm\" /> : null}\n {loading && size != null && ICON_SIZES.has(size) ? null : children}\n </button>\n );\n },\n);\n\nButton.displayName = \"Button\";\n","import * as React from \"react\";\nimport { Loader2 } from \"lucide-react\";\n\nimport { cn } from \"./utils\";\n\n/**\n * The one spinner.\n *\n * There were five spellings of `animate-spin` across twelve files — `h-4 w-4`,\n * `h-5 w-5`, `size-4`, bare, and a hand-drawn ring in `ProtectedRoute` — so the\n * same \"working\" signal came out a different size depending on which panel you\n * were on.\n *\n * It is `aria-hidden` on purpose. A spinner is decoration; what a screen reader\n * needs is the surrounding control's `aria-busy` or the panel's status text,\n * and announcing \"loading\" twice is worse than once. `Button` and `StatePanel`\n * both supply that.\n */\nconst SIZES = {\n sm: \"size-3.5\",\n md: \"size-4\",\n lg: \"size-5\",\n xl: \"size-10 border-2\",\n} as const;\n\nexport interface SpinnerProps extends React.SVGProps<SVGSVGElement> {\n size?: keyof typeof SIZES;\n}\n\nexport function Spinner({ size = \"md\", className, ...props }: SpinnerProps) {\n return (\n <Loader2\n aria-hidden\n className={cn(\"animate-spin\", SIZES[size], className)}\n {...props}\n />\n );\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AACvB,sCAAuC;AACvC,wBAAqB;;;ACDrB,0BAAwB;;;ACDxB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD0BI;AAbJ,IAAM,QAAQ;AAAA,EACZ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAMO,SAAS,QAAQ,EAAE,OAAO,MAAM,WAAW,GAAG,MAAM,GAAiB;AAC1E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,MACX,WAAW,GAAG,gBAAgB,MAAM,IAAI,GAAG,SAAS;AAAA,MACnD,GAAG;AAAA;AAAA,EACN;AAEJ;;;ADkDQ,IAAAA,sBAAA;AAhFR,IAAM,qBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WAAW;AAAA,QACX,OAAO;AAAA,QACP,aACE;AAAA,QACF,SAAS;AAAA,MACX;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA;AAAA;AAAA,QAGN,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AA8BA,IAAM,aAAa,oBAAI,IAAY,CAAC,QAAQ,SAAS,CAAC;AAE/C,IAAM,SAAe;AAAA,EAC1B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,OAAO,UAAU,yBAAO;AAK9B,QAAI,SAAS;AACX,aACE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,WAAW,GAAG,eAAe,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS;AAAA,UACzD,GAAG;AAAA,UAEH;AAAA;AAAA,MACH;AAAA,IAEJ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,UAAU,YAAY;AAAA,QACtB,aAAW,WAAW;AAAA,QACtB,WAAW,GAAG,eAAe,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS;AAAA,QACzD,GAAG;AAAA,QAEH;AAAA,oBAAU,6CAAC,WAAQ,MAAK,MAAK,IAAK;AAAA,UAClC,WAAW,QAAQ,QAAQ,WAAW,IAAI,IAAI,IAAI,OAAO;AAAA;AAAA;AAAA,IAC5D;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;","names":["import_jsx_runtime"]}
@@ -0,0 +1,34 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const buttonVariants: (props?: ({
6
+ variant?: "default" | "secondary" | "ghost" | "destructive" | "outline" | null | undefined;
7
+ size?: "sm" | "md" | "lg" | "icon" | "icon-sm" | null | undefined;
8
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
9
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
+ asChild?: boolean;
11
+ /**
12
+ * Work is in flight: shows a spinner, disables the button, and sets
13
+ * `aria-busy`.
14
+ *
15
+ * This exists because the panel had 272 disabled buttons and only 22 that
16
+ * said anything about why — the rest went dead on click with no spinner and
17
+ * no label change, which reads as a broken button rather than a busy one.
18
+ * Making the feedback part of `disabled` rather than something each caller
19
+ * remembers separately is the only way that ratio stays fixed.
20
+ *
21
+ * The label is kept rather than swapped. "Saving…" loses which button you
22
+ * pressed, and the spinner already says it is working. An icon-only button
23
+ * is the exception — there is no room beside the glyph, so the spinner takes
24
+ * its place; the `aria-label` is what names the button either way.
25
+ *
26
+ * "Icon-only" means an icon `size`. A square button that grew a spinner
27
+ * beside its glyph would not just look wrong, it would resize mid-request
28
+ * and shove whatever sits next to it sideways.
29
+ */
30
+ loading?: boolean;
31
+ }
32
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
33
+
34
+ export { Button, type ButtonProps };