@inshorts/glint-ui 0.5.4 → 0.6.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 (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-5MEOZHJA.js +513 -0
  45. package/dist/chunk-5MEOZHJA.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-A6GRLKOO.js +85 -0
  49. package/dist/chunk-A6GRLKOO.js.map +1 -0
  50. package/dist/chunk-DS3QYIKL.js +90 -0
  51. package/dist/chunk-DS3QYIKL.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-ISPICB4W.js +70 -0
  67. package/dist/chunk-ISPICB4W.js.map +1 -0
  68. package/dist/chunk-JDE5XYPT.js +30 -0
  69. package/dist/chunk-JDE5XYPT.js.map +1 -0
  70. package/dist/chunk-JSJEEKR3.js +59 -0
  71. package/dist/chunk-JSJEEKR3.js.map +1 -0
  72. package/dist/chunk-KR3BCFP7.js +85 -0
  73. package/dist/chunk-KR3BCFP7.js.map +1 -0
  74. package/dist/chunk-MLRSOTFI.js +81 -0
  75. package/dist/chunk-MLRSOTFI.js.map +1 -0
  76. package/dist/chunk-MQT5RAQV.js +202 -0
  77. package/dist/chunk-MQT5RAQV.js.map +1 -0
  78. package/dist/chunk-MUPW2TFJ.js +102 -0
  79. package/dist/chunk-MUPW2TFJ.js.map +1 -0
  80. package/dist/chunk-OUYT6SPU.js +76 -0
  81. package/dist/chunk-OUYT6SPU.js.map +1 -0
  82. package/dist/chunk-PM2VE7DJ.js +100 -0
  83. package/dist/chunk-PM2VE7DJ.js.map +1 -0
  84. package/dist/chunk-PPYR3O3L.js +44 -0
  85. package/dist/chunk-PPYR3O3L.js.map +1 -0
  86. package/dist/chunk-PUTC52SI.js +98 -0
  87. package/dist/chunk-PUTC52SI.js.map +1 -0
  88. package/dist/chunk-PWAKTEXF.js +18 -0
  89. package/dist/chunk-PWAKTEXF.js.map +1 -0
  90. package/dist/chunk-QTFWORA7.js +26 -0
  91. package/dist/chunk-QTFWORA7.js.map +1 -0
  92. package/dist/chunk-RUPL2H6V.js +49 -0
  93. package/dist/chunk-RUPL2H6V.js.map +1 -0
  94. package/dist/chunk-S7PVZAPL.js +28 -0
  95. package/dist/chunk-S7PVZAPL.js.map +1 -0
  96. package/dist/chunk-SQDV2AKJ.js +49 -0
  97. package/dist/chunk-SQDV2AKJ.js.map +1 -0
  98. package/dist/chunk-T2KXVH3O.js +297 -0
  99. package/dist/chunk-T2KXVH3O.js.map +1 -0
  100. package/dist/chunk-T4WCCHJQ.js +29 -0
  101. package/dist/chunk-T4WCCHJQ.js.map +1 -0
  102. package/dist/chunk-UC3ZIQPE.js +93 -0
  103. package/dist/chunk-UC3ZIQPE.js.map +1 -0
  104. package/dist/chunk-UE7JY7VR.js +28 -0
  105. package/dist/chunk-UE7JY7VR.js.map +1 -0
  106. package/dist/chunk-Y5WCT6XN.js +93 -0
  107. package/dist/chunk-Y5WCT6XN.js.map +1 -0
  108. package/dist/chunk-YDICVETX.js +151 -0
  109. package/dist/chunk-YDICVETX.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 +3008 -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 +122 -0
  233. package/dist/segmented-control.cjs.map +1 -0
  234. package/dist/segmented-control.d.cts +58 -0
  235. package/dist/segmented-control.d.ts +58 -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 +391 -14
  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
package/dist/index.js ADDED
@@ -0,0 +1,232 @@
1
+ "use client";
2
+ import {
3
+ Table,
4
+ TableBody,
5
+ TableCaption,
6
+ TableCell,
7
+ TableFooter,
8
+ TableHead,
9
+ TableHeader,
10
+ TableRow
11
+ } from "./chunk-UC3ZIQPE.js";
12
+ import {
13
+ TabPanel,
14
+ Tabs
15
+ } from "./chunk-ZFSQVMLJ.js";
16
+ import {
17
+ Textarea,
18
+ textareaClass
19
+ } from "./chunk-IRCTGJQB.js";
20
+ import {
21
+ DateRangePicker
22
+ } from "./chunk-T2KXVH3O.js";
23
+ import {
24
+ addDays,
25
+ addMonths,
26
+ createdRangeMs,
27
+ endAt2359Ms,
28
+ endOfDayMs,
29
+ formatDisplay,
30
+ fromIsoDate,
31
+ isSameDay,
32
+ monthGrid,
33
+ monthLabel,
34
+ startOfDayMs,
35
+ startOfMonth,
36
+ toIsoDate
37
+ } from "./chunk-MUPW2TFJ.js";
38
+ import {
39
+ SegmentedControl
40
+ } from "./chunk-MLRSOTFI.js";
41
+ import {
42
+ Select
43
+ } from "./chunk-OUYT6SPU.js";
44
+ import {
45
+ Separator
46
+ } from "./chunk-T4WCCHJQ.js";
47
+ import {
48
+ SideDrawer
49
+ } from "./chunk-A6GRLKOO.js";
50
+ import {
51
+ SpreadsheetGrid
52
+ } from "./chunk-MQT5RAQV.js";
53
+ import {
54
+ Switch
55
+ } from "./chunk-ZHATD73Y.js";
56
+ import {
57
+ Label
58
+ } from "./chunk-QTFWORA7.js";
59
+ import {
60
+ PageHeader
61
+ } from "./chunk-RUPL2H6V.js";
62
+ import {
63
+ Pagination
64
+ } from "./chunk-PUTC52SI.js";
65
+ import {
66
+ PanelSignIn,
67
+ PanelSignInSkeleton
68
+ } from "./chunk-PM2VE7DJ.js";
69
+ import {
70
+ PanelBrandMark
71
+ } from "./chunk-JDE5XYPT.js";
72
+ import {
73
+ CollapsibleSection
74
+ } from "./chunk-EWSBFU54.js";
75
+ import {
76
+ ConfirmDialog
77
+ } from "./chunk-ISPICB4W.js";
78
+ import {
79
+ CopyButton
80
+ } from "./chunk-PPYR3O3L.js";
81
+ import {
82
+ DataTable
83
+ } from "./chunk-ZLAA4DGG.js";
84
+ import {
85
+ FeatureAccessGate
86
+ } from "./chunk-S7PVZAPL.js";
87
+ import {
88
+ StatePanel
89
+ } from "./chunk-G4ZQUSAJ.js";
90
+ import {
91
+ Field
92
+ } from "./chunk-67ACNS42.js";
93
+ import {
94
+ ImageUploader
95
+ } from "./chunk-YDICVETX.js";
96
+ import {
97
+ Input,
98
+ inputClass
99
+ } from "./chunk-PWAKTEXF.js";
100
+ import {
101
+ Alert,
102
+ alertVariants
103
+ } from "./chunk-ZP252OJZ.js";
104
+ import {
105
+ Autocomplete
106
+ } from "./chunk-5MEOZHJA.js";
107
+ import {
108
+ Modal,
109
+ useHasMounted
110
+ } from "./chunk-DS3QYIKL.js";
111
+ import {
112
+ useDialogLayer
113
+ } from "./chunk-HBBOR43A.js";
114
+ import {
115
+ Badge,
116
+ badgeVariants
117
+ } from "./chunk-SQDV2AKJ.js";
118
+ import {
119
+ Breadcrumb
120
+ } from "./chunk-JSJEEKR3.js";
121
+ import {
122
+ Button
123
+ } from "./chunk-KR3BCFP7.js";
124
+ import {
125
+ Spinner
126
+ } from "./chunk-UE7JY7VR.js";
127
+ import {
128
+ Card,
129
+ CardContent,
130
+ CardDescription,
131
+ CardFooter,
132
+ CardHeader,
133
+ CardTitle
134
+ } from "./chunk-GMCUXEFI.js";
135
+ import {
136
+ Checkbox,
137
+ checkboxClass
138
+ } from "./chunk-HYRJYUPI.js";
139
+ import {
140
+ cn
141
+ } from "./chunk-HCA5ODCD.js";
142
+ import {
143
+ CSV_DELIMITER,
144
+ TSV_DELIMITER,
145
+ buildRangeText,
146
+ countCells,
147
+ describeRange,
148
+ escapeCell,
149
+ fullRange,
150
+ normalizeRange,
151
+ writeToClipboard
152
+ } from "./chunk-Y5WCT6XN.js";
153
+ export {
154
+ Alert,
155
+ Autocomplete,
156
+ Badge,
157
+ Breadcrumb,
158
+ Button,
159
+ CSV_DELIMITER,
160
+ Card,
161
+ CardContent,
162
+ CardDescription,
163
+ CardFooter,
164
+ CardHeader,
165
+ CardTitle,
166
+ Checkbox,
167
+ CollapsibleSection,
168
+ ConfirmDialog,
169
+ CopyButton,
170
+ DataTable,
171
+ DateRangePicker,
172
+ FeatureAccessGate,
173
+ Field,
174
+ ImageUploader,
175
+ Input,
176
+ Label,
177
+ Modal,
178
+ PageHeader,
179
+ Pagination,
180
+ PanelBrandMark,
181
+ PanelSignIn,
182
+ PanelSignInSkeleton,
183
+ SegmentedControl,
184
+ Select,
185
+ Separator,
186
+ SideDrawer,
187
+ Spinner,
188
+ SpreadsheetGrid,
189
+ StatePanel,
190
+ Switch,
191
+ TSV_DELIMITER,
192
+ TabPanel,
193
+ Table,
194
+ TableBody,
195
+ TableCaption,
196
+ TableCell,
197
+ TableFooter,
198
+ TableHead,
199
+ TableHeader,
200
+ TableRow,
201
+ Tabs,
202
+ Textarea,
203
+ addDays,
204
+ addMonths,
205
+ alertVariants,
206
+ badgeVariants,
207
+ buildRangeText,
208
+ checkboxClass,
209
+ cn,
210
+ countCells,
211
+ createdRangeMs,
212
+ describeRange,
213
+ endAt2359Ms,
214
+ endOfDayMs,
215
+ escapeCell,
216
+ formatDisplay,
217
+ fromIsoDate,
218
+ fullRange,
219
+ inputClass,
220
+ isSameDay,
221
+ monthGrid,
222
+ monthLabel,
223
+ normalizeRange,
224
+ startOfDayMs,
225
+ startOfMonth,
226
+ textareaClass,
227
+ toIsoDate,
228
+ useDialogLayer,
229
+ useHasMounted,
230
+ writeToClipboard
231
+ };
232
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/input.cjs ADDED
@@ -0,0 +1,58 @@
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/input.tsx
31
+ var input_exports = {};
32
+ __export(input_exports, {
33
+ Input: () => Input,
34
+ inputClass: () => inputClass
35
+ });
36
+ module.exports = __toCommonJS(input_exports);
37
+ var React = __toESM(require("react"), 1);
38
+
39
+ // src/utils.ts
40
+ var import_clsx = require("clsx");
41
+ var import_tailwind_merge = require("tailwind-merge");
42
+ function cn(...inputs) {
43
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
44
+ }
45
+
46
+ // src/input.tsx
47
+ var import_jsx_runtime = require("react/jsx-runtime");
48
+ var inputClass = "h-9 w-full rounded-md border border-border bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
49
+ var Input = React.forwardRef(
50
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ref, className: cn(inputClass, className), ...props })
51
+ );
52
+ Input.displayName = "Input";
53
+ // Annotate the CommonJS export names for ESM import in node:
54
+ 0 && (module.exports = {
55
+ Input,
56
+ inputClass
57
+ });
58
+ //# sourceMappingURL=input.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/input.tsx","../src/utils.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\nexport const inputClass =\n \"h-9 w-full rounded-md border border-border bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\";\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, ...props }, ref) => (\n <input ref={ref} className={cn(inputClass, className)} {...props} />\n ),\n);\n\nInput.displayName = \"Input\";\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;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADMI;AAPG,IAAM,aACX;AAIK,IAAM,QAAc;AAAA,EACzB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,4CAAC,WAAM,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OAAO;AAEtE;AAEA,MAAM,cAAc;","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+
3
+ declare const inputClass = "h-9 w-full rounded-md border border-border bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
4
+ type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
5
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
6
+
7
+ export { Input, type InputProps, inputClass };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+
3
+ declare const inputClass = "h-9 w-full rounded-md border border-border bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
4
+ type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
5
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
6
+
7
+ export { Input, type InputProps, inputClass };
package/dist/input.js ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ Input,
3
+ inputClass
4
+ } from "./chunk-PWAKTEXF.js";
5
+ import "./chunk-HCA5ODCD.js";
6
+ export {
7
+ Input,
8
+ inputClass
9
+ };
10
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/label.cjs ADDED
@@ -0,0 +1,67 @@
1
+ "use client";
2
+ "use strict";
3
+ "use client";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
+
32
+ // src/label.tsx
33
+ var label_exports = {};
34
+ __export(label_exports, {
35
+ Label: () => Label
36
+ });
37
+ module.exports = __toCommonJS(label_exports);
38
+ var React = __toESM(require("react"), 1);
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/label.tsx
48
+ var import_jsx_runtime = require("react/jsx-runtime");
49
+ var Label = React.forwardRef(
50
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
+ "label",
52
+ {
53
+ ref,
54
+ className: cn(
55
+ "text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
56
+ className
57
+ ),
58
+ ...props
59
+ }
60
+ )
61
+ );
62
+ Label.displayName = "Label";
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ Label
66
+ });
67
+ //# sourceMappingURL=label.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/label.tsx","../src/utils.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\nexport type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;\n\n/** Form label — pair with a native control via `htmlFor`. */\nexport const Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n ref={ref}\n className={cn(\n \"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nLabel.displayName = \"Label\";\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;AAEA,YAAuB;;;ACFvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADMI;AAFG,IAAM,QAAc;AAAA,EACzB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,MAAM,cAAc;","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+
3
+ type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;
4
+ /** Form label — pair with a native control via `htmlFor`. */
5
+ declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
6
+
7
+ export { Label, type LabelProps };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+
3
+ type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;
4
+ /** Form label — pair with a native control via `htmlFor`. */
5
+ declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
6
+
7
+ export { Label, type LabelProps };
package/dist/label.js ADDED
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import {
3
+ Label
4
+ } from "./chunk-QTFWORA7.js";
5
+ import "./chunk-HCA5ODCD.js";
6
+ export {
7
+ Label
8
+ };
9
+ //# sourceMappingURL=label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/modal.cjs ADDED
@@ -0,0 +1,212 @@
1
+ "use client";
2
+ "use strict";
3
+ "use client";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
+
32
+ // src/modal.tsx
33
+ var modal_exports = {};
34
+ __export(modal_exports, {
35
+ Modal: () => Modal,
36
+ useHasMounted: () => useHasMounted
37
+ });
38
+ module.exports = __toCommonJS(modal_exports);
39
+ var React2 = __toESM(require("react"), 1);
40
+ var import_react_dom = require("react-dom");
41
+
42
+ // src/dialogLayer.ts
43
+ var React = __toESM(require("react"), 1);
44
+ var layers = [];
45
+ var FOCUSABLE = [
46
+ "a[href]",
47
+ "button:not([disabled])",
48
+ "input:not([disabled])",
49
+ "select:not([disabled])",
50
+ "textarea:not([disabled])",
51
+ '[tabindex]:not([tabindex="-1"])'
52
+ ].join(",");
53
+ function isVisible(element) {
54
+ if (element.closest("[hidden]")) return false;
55
+ if (element.getAttribute("aria-hidden") === "true") return false;
56
+ return typeof element.checkVisibility === "function" ? element.checkVisibility() : true;
57
+ }
58
+ function focusableWithin(container) {
59
+ return Array.from(container.querySelectorAll(FOCUSABLE)).filter(
60
+ isVisible
61
+ );
62
+ }
63
+ function useDialogLayer({
64
+ active,
65
+ containerRef,
66
+ onEscape
67
+ }) {
68
+ const escapeRef = React.useRef(onEscape);
69
+ React.useEffect(() => {
70
+ escapeRef.current = onEscape;
71
+ });
72
+ React.useEffect(() => {
73
+ if (!active) return;
74
+ const layer = /* @__PURE__ */ Symbol("dialog-layer");
75
+ layers.push(layer);
76
+ const isTopLayer = () => layers[layers.length - 1] === layer;
77
+ const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
78
+ const container = containerRef.current;
79
+ if (container && !container.contains(document.activeElement)) {
80
+ const [first] = focusableWithin(container);
81
+ (container.hasAttribute("tabindex") ? container : first)?.focus();
82
+ }
83
+ function handleKeyDown(event) {
84
+ if (!isTopLayer()) return;
85
+ if (event.key === "Escape") {
86
+ escapeRef.current?.();
87
+ return;
88
+ }
89
+ if (event.key !== "Tab") return;
90
+ const panel = containerRef.current;
91
+ if (!panel) return;
92
+ const items = focusableWithin(panel);
93
+ if (items.length === 0) {
94
+ event.preventDefault();
95
+ panel.focus();
96
+ return;
97
+ }
98
+ const first = items[0];
99
+ const last = items[items.length - 1];
100
+ const active2 = document.activeElement;
101
+ const outside = !panel.contains(active2);
102
+ if (event.shiftKey && (active2 === first || outside)) {
103
+ event.preventDefault();
104
+ last.focus();
105
+ } else if (!event.shiftKey && (active2 === last || outside)) {
106
+ event.preventDefault();
107
+ first.focus();
108
+ }
109
+ }
110
+ document.addEventListener("keydown", handleKeyDown);
111
+ const previousOverflow = document.body.style.overflow;
112
+ document.body.style.overflow = "hidden";
113
+ return () => {
114
+ document.removeEventListener("keydown", handleKeyDown);
115
+ document.body.style.overflow = previousOverflow;
116
+ const index = layers.indexOf(layer);
117
+ if (index !== -1) layers.splice(index, 1);
118
+ if (previouslyFocused?.isConnected) previouslyFocused.focus();
119
+ };
120
+ }, [active, containerRef]);
121
+ }
122
+
123
+ // src/utils.ts
124
+ var import_clsx = require("clsx");
125
+ var import_tailwind_merge = require("tailwind-merge");
126
+ function cn(...inputs) {
127
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
128
+ }
129
+
130
+ // src/modal.tsx
131
+ var import_jsx_runtime = (
132
+ /*
133
+ `overflow-y-auto` on the overlay, `my-auto` on the panel — not
134
+ `items-center`. A flex item centred with `align-items` overflows equally
135
+ in both directions once it is taller than its container, and the half
136
+ above the top edge cannot be scrolled to: with the page behind it locked,
137
+ an over-tall dialog was simply unreachable at both ends. Auto margins
138
+ centre a short panel the same way and collapse to zero on a tall one,
139
+ which scrolls.
140
+ */
141
+ require("react/jsx-runtime")
142
+ );
143
+ var emptySubscribe = () => () => {
144
+ };
145
+ function useHasMounted() {
146
+ return React2.useSyncExternalStore(
147
+ emptySubscribe,
148
+ () => true,
149
+ () => false
150
+ );
151
+ }
152
+ function Modal({
153
+ isOpen,
154
+ labelledBy,
155
+ describedBy,
156
+ closeLabel,
157
+ onClose,
158
+ children,
159
+ dismissible = true,
160
+ role = "dialog",
161
+ panelClassName
162
+ }) {
163
+ const mounted = useHasMounted();
164
+ const panelRef = React2.useRef(null);
165
+ useDialogLayer({
166
+ // Gated on `mounted` too: before that the panel is not rendered, so there
167
+ // would be nothing to move focus into.
168
+ active: isOpen && mounted,
169
+ containerRef: panelRef,
170
+ onEscape: dismissible ? onClose : void 0
171
+ });
172
+ if (!mounted || !isOpen) return null;
173
+ return (0, import_react_dom.createPortal)(
174
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "fixed inset-0 z-[100] flex justify-center overflow-y-auto p-4", children: [
175
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
176
+ "button",
177
+ {
178
+ type: "button",
179
+ "aria-label": closeLabel,
180
+ tabIndex: -1,
181
+ className: "fixed inset-0 bg-overlay/50",
182
+ onClick: () => {
183
+ if (dismissible) onClose();
184
+ }
185
+ }
186
+ ),
187
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
188
+ "div",
189
+ {
190
+ ref: panelRef,
191
+ role,
192
+ "aria-modal": "true",
193
+ "aria-labelledby": labelledBy,
194
+ "aria-describedby": describedBy,
195
+ tabIndex: -1,
196
+ className: cn(
197
+ "border-border bg-background relative z-10 my-auto w-full rounded-lg border shadow-2xl outline-none",
198
+ panelClassName ?? "max-w-md p-6"
199
+ ),
200
+ children
201
+ }
202
+ )
203
+ ] }),
204
+ document.body
205
+ );
206
+ }
207
+ // Annotate the CommonJS export names for ESM import in node:
208
+ 0 && (module.exports = {
209
+ Modal,
210
+ useHasMounted
211
+ });
212
+ //# sourceMappingURL=modal.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/modal.tsx","../src/dialogLayer.ts","../src/utils.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { useDialogLayer } from \"./dialogLayer\";\nimport { cn } from \"./utils\";\n\nconst emptySubscribe = () => () => {};\n\n/**\n * Returns false during SSR and the first client render, then true once mounted.\n * `useSyncExternalStore` is the React-recommended way to read client-only state\n * without a setState-in-effect (which triggers cascading renders).\n */\nexport function useHasMounted(): boolean {\n return React.useSyncExternalStore(\n emptySubscribe,\n () => true,\n () => false,\n );\n}\n\ninterface ModalProps {\n isOpen: boolean;\n /** id of the element labelling the dialog; wired to aria-labelledby. */\n labelledBy: string;\n /**\n * Optional id(s) of elements describing the dialog (APG alertdialog body).\n * Space-separated when multiple.\n */\n describedBy?: string;\n /** Accessible label for the backdrop dismiss button. */\n closeLabel: string;\n onClose: () => void;\n children: React.ReactNode;\n /**\n * When false, Escape and backdrop clicks do not close the modal (e.g. while a\n * save is in flight). Defaults to true.\n */\n dismissible?: boolean;\n /** Use \"alertdialog\" for destructive confirmations. Defaults to \"dialog\". */\n role?: \"dialog\" | \"alertdialog\";\n /** Tailwind max-width class for the panel. Defaults to \"max-w-md\". */\n panelClassName?: string;\n}\n\n/**\n * Shared modal shell: renders a portal-backed, scroll-locked, Escape-dismissible\n * overlay with a centered panel. Callers provide the panel body (heading, form,\n * footer). Consolidates the boilerplate previously copied across every dialog.\n */\nexport function Modal({\n isOpen,\n labelledBy,\n describedBy,\n closeLabel,\n onClose,\n children,\n dismissible = true,\n role = \"dialog\",\n panelClassName,\n}: ModalProps) {\n const mounted = useHasMounted();\n const panelRef = React.useRef<HTMLDivElement>(null);\n\n useDialogLayer({\n // Gated on `mounted` too: before that the panel is not rendered, so there\n // would be nothing to move focus into.\n active: isOpen && mounted,\n containerRef: panelRef,\n onEscape: dismissible ? onClose : undefined,\n });\n\n if (!mounted || !isOpen) return null;\n\n return createPortal(\n /*\n `overflow-y-auto` on the overlay, `my-auto` on the panel — not\n `items-center`. A flex item centred with `align-items` overflows equally\n in both directions once it is taller than its container, and the half\n above the top edge cannot be scrolled to: with the page behind it locked,\n an over-tall dialog was simply unreachable at both ends. Auto margins\n centre a short panel the same way and collapse to zero on a tall one,\n which scrolls.\n */\n <div className=\"fixed inset-0 z-[100] flex justify-center overflow-y-auto p-4\">\n {/* `fixed`, not `absolute`: inside a scrolling overlay an absolute\n backdrop scrolls away with the content and leaves the rest of a tall\n dialog sitting on an undimmed page. */}\n <button\n type=\"button\"\n aria-label={closeLabel}\n tabIndex={-1}\n className=\"fixed inset-0 bg-overlay/50\"\n onClick={() => {\n if (dismissible) onClose();\n }}\n />\n <div\n ref={panelRef}\n role={role}\n aria-modal=\"true\"\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n tabIndex={-1}\n className={cn(\n \"border-border bg-background relative z-10 my-auto w-full rounded-lg border shadow-2xl outline-none\",\n panelClassName ?? \"max-w-md p-6\",\n )}\n >\n {children}\n </div>\n </div>,\n document.body,\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\n/**\n * The keyboard and focus behaviour every dialog needs, in one place.\n *\n * `Modal` and `SideDrawer` each had a copy of the scroll lock and an Escape\n * handler, and neither did anything about focus: opening a dialog left focus\n * on the button behind it, Tab walked the page underneath — through the\n * full-screen backdrop button, among other things — and closing left focus\n * wherever it had wandered. That is the whole keyboard story for thirty\n * dialogs, so it is fixed once here rather than thirty times.\n */\n\n/**\n * Open dialogs, innermost last.\n *\n * Nesting is real here — \"Create audience group\" opens on top of \"Send\n * notification\" — and without an ordering both would answer the same Escape\n * and fight over the same Tab. Only the top layer acts.\n */\nconst layers: symbol[] = [];\n\nconst FOCUSABLE = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(\",\");\n\n/**\n * Deliberately not `offsetParent` or `getClientRects`: the first is null for\n * anything `position: fixed`, which a dialog panel usually is, and the second\n * is empty for *everything* under a test renderer that does no layout — which\n * would collapse the trap to \"no focusable elements\" in every test.\n */\nfunction isVisible(element: HTMLElement): boolean {\n if (element.closest(\"[hidden]\")) return false;\n if (element.getAttribute(\"aria-hidden\") === \"true\") return false;\n return typeof element.checkVisibility === \"function\"\n ? element.checkVisibility()\n : true;\n}\n\nfunction focusableWithin(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n isVisible,\n );\n}\n\nexport function useDialogLayer({\n active,\n containerRef,\n onEscape,\n}: {\n active: boolean;\n /** The panel. Focus is moved into it and kept inside it. */\n containerRef: React.RefObject<HTMLElement | null>;\n /** Called on Escape, only while this is the top layer. Omit to ignore it. */\n onEscape?: () => void;\n}): void {\n // Read through a ref so a caller passing a fresh closure every render does\n // not tear the listener down and rebuild it on every keystroke.\n const escapeRef = React.useRef(onEscape);\n React.useEffect(() => {\n escapeRef.current = onEscape;\n });\n\n React.useEffect(() => {\n if (!active) return;\n\n const layer = Symbol(\"dialog-layer\");\n layers.push(layer);\n const isTopLayer = () => layers[layers.length - 1] === layer;\n\n const previouslyFocused =\n document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n\n const container = containerRef.current;\n // Something inside may have claimed focus already — an `autoFocus` input —\n // and that choice is better than any this could make.\n if (container && !container.contains(document.activeElement)) {\n const [first] = focusableWithin(container);\n // The panel itself, not its first control: the first control is a Delete\n // button often enough that focusing it would put a destructive action\n // one Enter away from an accidental keypress.\n (container.hasAttribute(\"tabindex\") ? container : first)?.focus();\n }\n\n function handleKeyDown(event: KeyboardEvent) {\n if (!isTopLayer()) return;\n\n if (event.key === \"Escape\") {\n escapeRef.current?.();\n return;\n }\n\n if (event.key !== \"Tab\") return;\n const panel = containerRef.current;\n if (!panel) return;\n\n const items = focusableWithin(panel);\n if (items.length === 0) {\n event.preventDefault();\n panel.focus();\n return;\n }\n\n const first = items[0]!;\n const last = items[items.length - 1]!;\n const active = document.activeElement;\n const outside = !panel.contains(active);\n\n if (event.shiftKey && (active === first || outside)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && (active === last || outside)) {\n event.preventDefault();\n first.focus();\n }\n }\n\n document.addEventListener(\"keydown\", handleKeyDown);\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n document.body.style.overflow = previousOverflow;\n const index = layers.indexOf(layer);\n if (index !== -1) layers.splice(index, 1);\n // Back where it came from, so closing a dialog opened by keyboard does\n // not drop the caret at the top of the document.\n if (previouslyFocused?.isConnected) previouslyFocused.focus();\n };\n }, [active, containerRef]);\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":";;;;;;;;;;;;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