@namroodinc/liquid-editorial 0.2.0 → 0.3.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 (395) hide show
  1. package/README.md +64 -2
  2. package/UPGRADING.md +153 -0
  3. package/dist/chunks/{Board-BLhB5_xx.cjs → Board-BUJ5CinL.cjs} +2 -2
  4. package/dist/chunks/Board-BUJ5CinL.cjs.map +1 -0
  5. package/dist/chunks/{Board-BTFSzn6c.js → Board-Cyrda2qG.js} +2 -2
  6. package/dist/chunks/Board-Cyrda2qG.js.map +1 -0
  7. package/dist/chunks/{FormEditor-DuW8x78Y.js → FormEditor-DRmPFe2E.js} +100 -102
  8. package/dist/chunks/FormEditor-DRmPFe2E.js.map +1 -0
  9. package/dist/chunks/FormEditor-PVkvKep1.cjs +2 -0
  10. package/dist/chunks/FormEditor-PVkvKep1.cjs.map +1 -0
  11. package/dist/chunks/Icon-ByUB0L1a.js +78 -0
  12. package/dist/chunks/Icon-ByUB0L1a.js.map +1 -0
  13. package/dist/chunks/Icon-CW6qJcDy.cjs +2 -0
  14. package/dist/chunks/Icon-CW6qJcDy.cjs.map +1 -0
  15. package/dist/chunks/{RichTextEditor-BxtlbjXj.cjs → RichTextEditor-C7nMfDmE.cjs} +2 -2
  16. package/dist/chunks/RichTextEditor-C7nMfDmE.cjs.map +1 -0
  17. package/dist/chunks/{RichTextEditor-Dnx4i7bQ.js → RichTextEditor-DjR10XJ-.js} +55 -53
  18. package/dist/chunks/RichTextEditor-DjR10XJ-.js.map +1 -0
  19. package/dist/chunks/binding-Bshy43sG.js +33 -0
  20. package/dist/chunks/binding-Bshy43sG.js.map +1 -0
  21. package/dist/chunks/binding-tMjrUzkU.cjs +2 -0
  22. package/dist/chunks/binding-tMjrUzkU.cjs.map +1 -0
  23. package/dist/chunks/context-BONPXF-V.cjs +2 -0
  24. package/dist/chunks/context-BONPXF-V.cjs.map +1 -0
  25. package/dist/chunks/context-CXvOl4Kt.js +7 -0
  26. package/dist/chunks/context-CXvOl4Kt.js.map +1 -0
  27. package/dist/chunks/dialogStack-6yv3NXFD.js +43 -0
  28. package/dist/chunks/dialogStack-6yv3NXFD.js.map +1 -0
  29. package/dist/chunks/dialogStack-C9SLVu6Q.cjs +2 -0
  30. package/dist/chunks/dialogStack-C9SLVu6Q.cjs.map +1 -0
  31. package/dist/chunks/frame-Bs_jaQRw.js +70 -0
  32. package/dist/chunks/frame-Bs_jaQRw.js.map +1 -0
  33. package/dist/chunks/frame-CNxvbg0D.cjs +2 -0
  34. package/dist/chunks/frame-CNxvbg0D.cjs.map +1 -0
  35. package/dist/chunks/group-CzbacuAY.js +29 -0
  36. package/dist/chunks/group-CzbacuAY.js.map +1 -0
  37. package/dist/chunks/group-pKDQtq-9.cjs +2 -0
  38. package/dist/chunks/group-pKDQtq-9.cjs.map +1 -0
  39. package/dist/chunks/observeElementWidth-BCJM2FAw.cjs +2 -0
  40. package/dist/chunks/observeElementWidth-BCJM2FAw.cjs.map +1 -0
  41. package/dist/chunks/observeElementWidth-BlQOlW2t.js +12 -0
  42. package/dist/chunks/observeElementWidth-BlQOlW2t.js.map +1 -0
  43. package/dist/components/AppShell/index.cjs +1 -1
  44. package/dist/components/AppShell/index.cjs.map +1 -1
  45. package/dist/components/AppShell/index.d.cts +5 -1
  46. package/dist/components/AppShell/index.d.cts.map +1 -1
  47. package/dist/components/AppShell/index.d.ts +5 -1
  48. package/dist/components/AppShell/index.d.ts.map +1 -1
  49. package/dist/components/AppShell/index.js +53 -60
  50. package/dist/components/AppShell/index.js.map +1 -1
  51. package/dist/components/AppShell/style.css +48 -6
  52. package/dist/components/AssetCard/index.cjs +1 -1
  53. package/dist/components/AssetCard/index.cjs.map +1 -1
  54. package/dist/components/AssetCard/index.d.cts +1 -1
  55. package/dist/components/AssetCard/index.d.cts.map +1 -1
  56. package/dist/components/AssetCard/index.d.ts +1 -1
  57. package/dist/components/AssetCard/index.d.ts.map +1 -1
  58. package/dist/components/AssetCard/index.js +1 -1
  59. package/dist/components/AssetCard/index.js.map +1 -1
  60. package/dist/components/AssetCard/style.css +20 -9
  61. package/dist/components/AssetGrid/index.cjs +1 -1
  62. package/dist/components/AssetGrid/index.cjs.map +1 -1
  63. package/dist/components/AssetGrid/index.d.cts +1 -1
  64. package/dist/components/AssetGrid/index.d.cts.map +1 -1
  65. package/dist/components/AssetGrid/index.d.ts +1 -1
  66. package/dist/components/AssetGrid/index.d.ts.map +1 -1
  67. package/dist/components/AssetGrid/index.js +1 -1
  68. package/dist/components/AssetGrid/index.js.map +1 -1
  69. package/dist/components/Avatar/index.cjs.map +1 -1
  70. package/dist/components/Avatar/index.d.cts.map +1 -1
  71. package/dist/components/Avatar/index.d.ts.map +1 -1
  72. package/dist/components/Avatar/index.js.map +1 -1
  73. package/dist/components/Badge/index.cjs +1 -1
  74. package/dist/components/Badge/index.cjs.map +1 -1
  75. package/dist/components/Badge/index.d.cts +2 -0
  76. package/dist/components/Badge/index.d.cts.map +1 -1
  77. package/dist/components/Badge/index.d.ts +2 -0
  78. package/dist/components/Badge/index.d.ts.map +1 -1
  79. package/dist/components/Badge/index.js +8 -8
  80. package/dist/components/Badge/index.js.map +1 -1
  81. package/dist/components/Badge/style.css +2 -1
  82. package/dist/components/Board/index.cjs +1 -1
  83. package/dist/components/Board/index.d.cts.map +1 -1
  84. package/dist/components/Board/index.d.ts.map +1 -1
  85. package/dist/components/Board/index.js +1 -1
  86. package/dist/components/Board/keyboard.d.cts.map +1 -1
  87. package/dist/components/Board/keyboard.d.ts.map +1 -1
  88. package/dist/components/Board/moves.d.cts.map +1 -1
  89. package/dist/components/Board/moves.d.ts.map +1 -1
  90. package/dist/components/Board/style.css +12 -7
  91. package/dist/components/Button/index.cjs +1 -1
  92. package/dist/components/Button/index.cjs.map +1 -1
  93. package/dist/components/Button/index.d.cts.map +1 -1
  94. package/dist/components/Button/index.d.ts.map +1 -1
  95. package/dist/components/Button/index.js +1 -1
  96. package/dist/components/Button/index.js.map +1 -1
  97. package/dist/components/Button/style.css +1 -1
  98. package/dist/components/ButtonGroup/index.cjs.map +1 -1
  99. package/dist/components/ButtonGroup/index.d.cts.map +1 -1
  100. package/dist/components/ButtonGroup/index.d.ts.map +1 -1
  101. package/dist/components/ButtonGroup/index.js.map +1 -1
  102. package/dist/components/ButtonGroup/style.css +1 -0
  103. package/dist/components/Choice/index.cjs +1 -1
  104. package/dist/components/Choice/index.cjs.map +1 -1
  105. package/dist/components/Choice/index.d.cts +3 -3
  106. package/dist/components/Choice/index.d.cts.map +1 -1
  107. package/dist/components/Choice/index.d.ts +3 -3
  108. package/dist/components/Choice/index.d.ts.map +1 -1
  109. package/dist/components/Choice/index.js +27 -27
  110. package/dist/components/Choice/index.js.map +1 -1
  111. package/dist/components/Choice/style.css +1 -8
  112. package/dist/components/Container/style.css +1 -0
  113. package/dist/components/DatePicker/index.cjs +1 -1
  114. package/dist/components/DatePicker/index.cjs.map +1 -1
  115. package/dist/components/DatePicker/index.d.cts +5 -9
  116. package/dist/components/DatePicker/index.d.cts.map +1 -1
  117. package/dist/components/DatePicker/index.d.ts +5 -9
  118. package/dist/components/DatePicker/index.d.ts.map +1 -1
  119. package/dist/components/DatePicker/index.js +125 -121
  120. package/dist/components/DatePicker/index.js.map +1 -1
  121. package/dist/components/DatePicker/style.css +18 -2
  122. package/dist/components/Drawer/index.cjs +1 -1
  123. package/dist/components/Drawer/index.cjs.map +1 -1
  124. package/dist/components/Drawer/index.d.cts.map +1 -1
  125. package/dist/components/Drawer/index.d.ts.map +1 -1
  126. package/dist/components/Drawer/index.js +72 -70
  127. package/dist/components/Drawer/index.js.map +1 -1
  128. package/dist/components/Drawer/style.css +7 -2
  129. package/dist/components/EditLayout/index.cjs +2 -0
  130. package/dist/components/EditLayout/index.cjs.map +1 -0
  131. package/dist/components/EditLayout/index.d.cts +25 -0
  132. package/dist/components/EditLayout/index.d.cts.map +1 -0
  133. package/dist/components/EditLayout/index.d.ts +25 -0
  134. package/dist/components/EditLayout/index.d.ts.map +1 -0
  135. package/dist/components/EditLayout/index.js +239 -0
  136. package/dist/components/EditLayout/index.js.map +1 -0
  137. package/dist/components/EditLayout/style.css +226 -0
  138. package/dist/components/EntryPicker/index.cjs +1 -1
  139. package/dist/components/EntryPicker/index.cjs.map +1 -1
  140. package/dist/components/EntryPicker/index.d.cts +3 -2
  141. package/dist/components/EntryPicker/index.d.cts.map +1 -1
  142. package/dist/components/EntryPicker/index.d.ts +3 -2
  143. package/dist/components/EntryPicker/index.d.ts.map +1 -1
  144. package/dist/components/EntryPicker/index.js +40 -47
  145. package/dist/components/EntryPicker/index.js.map +1 -1
  146. package/dist/components/EntryPicker/style.css +0 -11
  147. package/dist/components/Field/binding.d.cts +18 -0
  148. package/dist/components/Field/binding.d.cts.map +1 -0
  149. package/dist/components/Field/binding.d.ts +18 -0
  150. package/dist/components/Field/binding.d.ts.map +1 -0
  151. package/dist/components/Field/context.d.cts +9 -0
  152. package/dist/components/Field/context.d.cts.map +1 -0
  153. package/dist/components/Field/context.d.ts +9 -0
  154. package/dist/components/Field/context.d.ts.map +1 -0
  155. package/dist/components/Field/frame.d.cts +12 -0
  156. package/dist/components/Field/frame.d.cts.map +1 -0
  157. package/dist/components/Field/frame.d.ts +12 -0
  158. package/dist/components/Field/frame.d.ts.map +1 -0
  159. package/dist/components/Field/group.d.cts +12 -0
  160. package/dist/components/Field/group.d.cts.map +1 -0
  161. package/dist/components/Field/group.d.ts +12 -0
  162. package/dist/components/Field/group.d.ts.map +1 -0
  163. package/dist/components/Field/index.cjs +1 -1
  164. package/dist/components/Field/index.cjs.map +1 -1
  165. package/dist/components/Field/index.d.cts +4 -22
  166. package/dist/components/Field/index.d.cts.map +1 -1
  167. package/dist/components/Field/index.d.ts +4 -22
  168. package/dist/components/Field/index.d.ts.map +1 -1
  169. package/dist/components/Field/index.js +5 -42
  170. package/dist/components/Field/index.js.map +1 -1
  171. package/dist/components/Field/style.css +6 -1
  172. package/dist/components/Field/types.d.cts +31 -0
  173. package/dist/components/Field/types.d.cts.map +1 -0
  174. package/dist/components/Field/types.d.ts +31 -0
  175. package/dist/components/Field/types.d.ts.map +1 -0
  176. package/dist/components/FieldAffix/index.cjs.map +1 -1
  177. package/dist/components/FieldAffix/index.d.cts.map +1 -1
  178. package/dist/components/FieldAffix/index.d.ts.map +1 -1
  179. package/dist/components/FieldAffix/index.js.map +1 -1
  180. package/dist/components/FormEditor/control.d.cts +5 -3
  181. package/dist/components/FormEditor/control.d.cts.map +1 -1
  182. package/dist/components/FormEditor/control.d.ts +5 -3
  183. package/dist/components/FormEditor/control.d.ts.map +1 -1
  184. package/dist/components/FormEditor/index.cjs +1 -1
  185. package/dist/components/FormEditor/index.d.cts +1 -1
  186. package/dist/components/FormEditor/index.d.cts.map +1 -1
  187. package/dist/components/FormEditor/index.d.ts +1 -1
  188. package/dist/components/FormEditor/index.d.ts.map +1 -1
  189. package/dist/components/FormEditor/index.js +1 -1
  190. package/dist/components/FormEditor/model.d.cts +8 -5
  191. package/dist/components/FormEditor/model.d.cts.map +1 -1
  192. package/dist/components/FormEditor/model.d.ts +8 -5
  193. package/dist/components/FormEditor/model.d.ts.map +1 -1
  194. package/dist/components/FormEditor/style.css +3 -1
  195. package/dist/components/Icon/icons.d.cts +1 -0
  196. package/dist/components/Icon/icons.d.cts.map +1 -1
  197. package/dist/components/Icon/icons.d.ts +1 -0
  198. package/dist/components/Icon/icons.d.ts.map +1 -1
  199. package/dist/components/Icon/index.cjs +1 -1
  200. package/dist/components/Icon/index.js +1 -1
  201. package/dist/components/Icon/style.css +1 -1
  202. package/dist/components/ImageCropper/index.cjs +1 -1
  203. package/dist/components/ImageCropper/index.cjs.map +1 -1
  204. package/dist/components/ImageCropper/index.d.cts +1 -1
  205. package/dist/components/ImageCropper/index.d.cts.map +1 -1
  206. package/dist/components/ImageCropper/index.d.ts +1 -1
  207. package/dist/components/ImageCropper/index.d.ts.map +1 -1
  208. package/dist/components/ImageCropper/index.js +113 -112
  209. package/dist/components/ImageCropper/index.js.map +1 -1
  210. package/dist/components/ImageCropper/style.css +28 -5
  211. package/dist/components/Menu/index.cjs.map +1 -1
  212. package/dist/components/Menu/index.d.cts.map +1 -1
  213. package/dist/components/Menu/index.d.ts.map +1 -1
  214. package/dist/components/Menu/index.js.map +1 -1
  215. package/dist/components/Menu/style.css +0 -1
  216. package/dist/components/Modal/index.cjs +1 -1
  217. package/dist/components/Modal/index.cjs.map +1 -1
  218. package/dist/components/Modal/index.d.cts.map +1 -1
  219. package/dist/components/Modal/index.d.ts.map +1 -1
  220. package/dist/components/Modal/index.js +47 -46
  221. package/dist/components/Modal/index.js.map +1 -1
  222. package/dist/components/Modal/style.css +2 -2
  223. package/dist/components/NumberField/index.cjs +1 -1
  224. package/dist/components/NumberField/index.cjs.map +1 -1
  225. package/dist/components/NumberField/index.d.cts +4 -3
  226. package/dist/components/NumberField/index.d.cts.map +1 -1
  227. package/dist/components/NumberField/index.d.ts +4 -3
  228. package/dist/components/NumberField/index.d.ts.map +1 -1
  229. package/dist/components/NumberField/index.js +57 -53
  230. package/dist/components/NumberField/index.js.map +1 -1
  231. package/dist/components/NumberField/style.css +20 -7
  232. package/dist/components/Pagination/index.cjs.map +1 -1
  233. package/dist/components/Pagination/index.d.cts.map +1 -1
  234. package/dist/components/Pagination/index.d.ts.map +1 -1
  235. package/dist/components/Pagination/index.js.map +1 -1
  236. package/dist/components/Popover/index.cjs.map +1 -1
  237. package/dist/components/Popover/index.d.cts.map +1 -1
  238. package/dist/components/Popover/index.d.ts.map +1 -1
  239. package/dist/components/Popover/index.js.map +1 -1
  240. package/dist/components/RichTextEditor/document.d.cts.map +1 -1
  241. package/dist/components/RichTextEditor/document.d.ts.map +1 -1
  242. package/dist/components/RichTextEditor/index.cjs +1 -1
  243. package/dist/components/RichTextEditor/index.d.cts +3 -7
  244. package/dist/components/RichTextEditor/index.d.cts.map +1 -1
  245. package/dist/components/RichTextEditor/index.d.ts +3 -7
  246. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  247. package/dist/components/RichTextEditor/index.js +1 -1
  248. package/dist/components/RichTextEditor/style.css +2 -2
  249. package/dist/components/SearchField/index.cjs +1 -1
  250. package/dist/components/SearchField/index.cjs.map +1 -1
  251. package/dist/components/SearchField/index.d.cts.map +1 -1
  252. package/dist/components/SearchField/index.d.ts.map +1 -1
  253. package/dist/components/SearchField/index.js +1 -1
  254. package/dist/components/SearchField/index.js.map +1 -1
  255. package/dist/components/SearchField/style.css +0 -1
  256. package/dist/components/Select/index.cjs +1 -1
  257. package/dist/components/Select/index.cjs.map +1 -1
  258. package/dist/components/Select/index.d.cts +1 -0
  259. package/dist/components/Select/index.d.cts.map +1 -1
  260. package/dist/components/Select/index.d.ts +1 -0
  261. package/dist/components/Select/index.d.ts.map +1 -1
  262. package/dist/components/Select/index.js +54 -53
  263. package/dist/components/Select/index.js.map +1 -1
  264. package/dist/components/SelectionCard/index.cjs +1 -1
  265. package/dist/components/SelectionCard/index.cjs.map +1 -1
  266. package/dist/components/SelectionCard/index.d.cts +3 -2
  267. package/dist/components/SelectionCard/index.d.cts.map +1 -1
  268. package/dist/components/SelectionCard/index.d.ts +3 -2
  269. package/dist/components/SelectionCard/index.d.ts.map +1 -1
  270. package/dist/components/SelectionCard/index.js +28 -28
  271. package/dist/components/SelectionCard/index.js.map +1 -1
  272. package/dist/components/SelectionCard/style.css +2 -13
  273. package/dist/components/SideNav/index.cjs +1 -1
  274. package/dist/components/SideNav/index.cjs.map +1 -1
  275. package/dist/components/SideNav/index.d.cts.map +1 -1
  276. package/dist/components/SideNav/index.d.ts.map +1 -1
  277. package/dist/components/SideNav/index.js +1 -1
  278. package/dist/components/SideNav/index.js.map +1 -1
  279. package/dist/components/SideNav/style.css +7 -2
  280. package/dist/components/Skeleton/index.cjs.map +1 -1
  281. package/dist/components/Skeleton/index.d.cts.map +1 -1
  282. package/dist/components/Skeleton/index.d.ts.map +1 -1
  283. package/dist/components/Skeleton/index.js.map +1 -1
  284. package/dist/components/Skeleton/style.css +2 -2
  285. package/dist/components/Slider/index.cjs +1 -1
  286. package/dist/components/Slider/index.cjs.map +1 -1
  287. package/dist/components/Slider/index.d.cts +3 -2
  288. package/dist/components/Slider/index.d.cts.map +1 -1
  289. package/dist/components/Slider/index.d.ts +3 -2
  290. package/dist/components/Slider/index.d.ts.map +1 -1
  291. package/dist/components/Slider/index.js +60 -56
  292. package/dist/components/Slider/index.js.map +1 -1
  293. package/dist/components/Slider/style.css +19 -16
  294. package/dist/components/SortableList/index.cjs +1 -1
  295. package/dist/components/SortableList/index.cjs.map +1 -1
  296. package/dist/components/SortableList/index.d.cts.map +1 -1
  297. package/dist/components/SortableList/index.d.ts.map +1 -1
  298. package/dist/components/SortableList/index.js +1 -1
  299. package/dist/components/SortableList/index.js.map +1 -1
  300. package/dist/components/SortableList/style.css +1 -1
  301. package/dist/components/Stepper/index.cjs +1 -1
  302. package/dist/components/Stepper/index.cjs.map +1 -1
  303. package/dist/components/Stepper/index.d.cts.map +1 -1
  304. package/dist/components/Stepper/index.d.ts.map +1 -1
  305. package/dist/components/Stepper/index.js +1 -1
  306. package/dist/components/Stepper/index.js.map +1 -1
  307. package/dist/components/Stepper/style.css +2 -2
  308. package/dist/components/SubNav/index.cjs +1 -1
  309. package/dist/components/SubNav/index.cjs.map +1 -1
  310. package/dist/components/SubNav/index.d.cts.map +1 -1
  311. package/dist/components/SubNav/index.d.ts.map +1 -1
  312. package/dist/components/SubNav/index.js +1 -1
  313. package/dist/components/SubNav/index.js.map +1 -1
  314. package/dist/components/Switch/index.cjs +1 -1
  315. package/dist/components/Switch/index.cjs.map +1 -1
  316. package/dist/components/Switch/index.d.cts +2 -0
  317. package/dist/components/Switch/index.d.cts.map +1 -1
  318. package/dist/components/Switch/index.d.ts +2 -0
  319. package/dist/components/Switch/index.d.ts.map +1 -1
  320. package/dist/components/Switch/index.js +13 -12
  321. package/dist/components/Switch/index.js.map +1 -1
  322. package/dist/components/Switch/style.css +6 -1
  323. package/dist/components/Table/index.cjs +1 -1
  324. package/dist/components/Table/index.cjs.map +1 -1
  325. package/dist/components/Table/index.d.cts.map +1 -1
  326. package/dist/components/Table/index.d.ts.map +1 -1
  327. package/dist/components/Table/index.js +1 -1
  328. package/dist/components/Table/index.js.map +1 -1
  329. package/dist/components/Table/style.css +1 -0
  330. package/dist/components/TagsInput/index.cjs +1 -1
  331. package/dist/components/TagsInput/index.cjs.map +1 -1
  332. package/dist/components/TagsInput/index.d.cts +2 -5
  333. package/dist/components/TagsInput/index.d.cts.map +1 -1
  334. package/dist/components/TagsInput/index.d.ts +2 -5
  335. package/dist/components/TagsInput/index.d.ts.map +1 -1
  336. package/dist/components/TagsInput/index.js +19 -17
  337. package/dist/components/TagsInput/index.js.map +1 -1
  338. package/dist/components/TagsInput/style.css +2 -1
  339. package/dist/components/TextField/index.cjs.map +1 -1
  340. package/dist/components/TextField/index.d.cts.map +1 -1
  341. package/dist/components/TextField/index.d.ts.map +1 -1
  342. package/dist/components/TextField/index.js.map +1 -1
  343. package/dist/components/Time/index.cjs.map +1 -1
  344. package/dist/components/Time/index.d.cts.map +1 -1
  345. package/dist/components/Time/index.d.ts.map +1 -1
  346. package/dist/components/Time/index.js.map +1 -1
  347. package/dist/components/Time/style.css +1 -2
  348. package/dist/components/Toast/index.cjs +1 -1
  349. package/dist/components/Toast/index.cjs.map +1 -1
  350. package/dist/components/Toast/index.d.cts.map +1 -1
  351. package/dist/components/Toast/index.d.ts.map +1 -1
  352. package/dist/components/Toast/index.js +1 -1
  353. package/dist/components/Toast/index.js.map +1 -1
  354. package/dist/components/Toast/style.css +1 -1
  355. package/dist/components/TopNav/index.cjs +1 -1
  356. package/dist/components/TopNav/index.cjs.map +1 -1
  357. package/dist/components/TopNav/index.d.cts.map +1 -1
  358. package/dist/components/TopNav/index.d.ts.map +1 -1
  359. package/dist/components/TopNav/index.js +1 -1
  360. package/dist/components/TopNav/index.js.map +1 -1
  361. package/dist/index.cjs +1 -1
  362. package/dist/index.d.cts +10 -8
  363. package/dist/index.d.cts.map +1 -1
  364. package/dist/index.d.ts +10 -8
  365. package/dist/index.d.ts.map +1 -1
  366. package/dist/index.js +10 -9
  367. package/dist/internal/dialogStack.d.cts +9 -0
  368. package/dist/internal/dialogStack.d.cts.map +1 -0
  369. package/dist/internal/dialogStack.d.ts +9 -0
  370. package/dist/internal/dialogStack.d.ts.map +1 -0
  371. package/dist/internal/lockBodyScroll.d.cts +7 -0
  372. package/dist/internal/lockBodyScroll.d.cts.map +1 -0
  373. package/dist/internal/lockBodyScroll.d.ts +7 -0
  374. package/dist/internal/lockBodyScroll.d.ts.map +1 -0
  375. package/dist/internal/observeElementWidth.d.cts +3 -0
  376. package/dist/internal/observeElementWidth.d.cts.map +1 -0
  377. package/dist/internal/observeElementWidth.d.ts +3 -0
  378. package/dist/internal/observeElementWidth.d.ts.map +1 -0
  379. package/dist/reset.css +29 -4
  380. package/dist/styles.css +20 -16
  381. package/dist/test/dragEvent.d.cts.map +1 -1
  382. package/dist/test/dragEvent.d.ts.map +1 -1
  383. package/dist/tokens.css +77 -40
  384. package/package.json +9 -2
  385. package/dist/chunks/Board-BLhB5_xx.cjs.map +0 -1
  386. package/dist/chunks/Board-BTFSzn6c.js.map +0 -1
  387. package/dist/chunks/FormEditor-8bz3pOdP.cjs +0 -2
  388. package/dist/chunks/FormEditor-8bz3pOdP.cjs.map +0 -1
  389. package/dist/chunks/FormEditor-DuW8x78Y.js.map +0 -1
  390. package/dist/chunks/Icon-CGY1FNXT.js +0 -77
  391. package/dist/chunks/Icon-CGY1FNXT.js.map +0 -1
  392. package/dist/chunks/Icon-CWsA1W83.cjs +0 -2
  393. package/dist/chunks/Icon-CWsA1W83.cjs.map +0 -1
  394. package/dist/chunks/RichTextEditor-BxtlbjXj.cjs.map +0 -1
  395. package/dist/chunks/RichTextEditor-Dnx4i7bQ.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Icon","cx","parts","Select","forwardRef","rest","internal","setInternal","useState","defaultValue","current","value","isOpen","setOpen","activeIndex","setActiveIndex","rootRef","useRef","triggerRef","listRef","listId","useId","effectiveDisabled","isDisabled","disabled","isVisible","selected","options","option","enabled","commit","useCallback","next","onValueChange","useEffect","index","onPointerDown","target","event","step","order","o","delta","handleListKeyDown","pick","handleKeyDown","Button","node","ref","isInvalid","className","onClick","open","onKeyDown","placeholder","Popover","menuPlacement"],"sources":["../../../src/components/Select/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Popover, type PopoverPlacement } from \"../Popover\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SelectOption {\n value: string;\n label: string;\n /** Secondary line under the label. */\n description?: string;\n isDisabled?: boolean;\n}\n\nexport interface SelectProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"value\" | \"defaultValue\" | \"onChange\"> {\n options: SelectOption[];\n /** Controlled value. Leave undefined to let the select hold its own. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n placeholder?: string;\n size?: FieldSize;\n isDisabled?: boolean;\n isInvalid?: boolean;\n /** Preferred side of the menu; flips when space requires it. */\n menuPlacement?: PopoverPlacement;\n}\n\n/**\n * One value out of a known list. Wears the field skin, opens a listbox: arrows\n * walk the options, Enter commits, Escape closes without changing anything.\n */\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder = \"Select an option\",\n size = \"md\",\n isDisabled = false,\n isInvalid = false,\n menuPlacement = \"bottom\",\n className,\n disabled,\n onClick,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultValue ?? \"\");\n const current = value ?? internal;\n const [isOpen, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState(0);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const listId = useId();\n const effectiveDisabled = isDisabled || disabled;\n const isVisible = isOpen && !effectiveDisabled;\n\n const selected = options.find((option) => option.value === current);\n const enabled = options.filter((option) => !option.isDisabled);\n\n const commit = useCallback(\n (next: string) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n setOpen(false);\n },\n [onValueChange, value],\n );\n\n useEffect(() => {\n if (!isVisible) return;\n const index = options.findIndex((option) => option.value === current && !option.isDisabled);\n setActiveIndex(index < 0 ? options.indexOf(enabled[0]!) : index);\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!rootRef.current?.contains(target) && !listRef.current?.contains(target)) setOpen(false);\n };\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isVisible]);\n\n useEffect(() => {\n if (!isVisible) return;\n const activeOption = listRef.current?.querySelectorAll<HTMLElement>(\"[role='option']\")[activeIndex];\n activeOption?.scrollIntoView({ block: \"nearest\" });\n }, [activeIndex, isVisible]);\n\n const step = (delta: number) => {\n const order = options.map((option, index) => ({ option, index })).filter((o) => !o.option.isDisabled);\n if (order.length === 0) return;\n const at = order.findIndex((o) => o.index === activeIndex);\n const next = order[(at + delta + order.length) % order.length]!;\n setActiveIndex(next.index);\n };\n\n const handleListKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case \"Escape\":\n // Claims Escape so an enclosing Drawer stays open.\n event.preventDefault();\n setOpen(false);\n triggerRef.current?.focus();\n break;\n case \"Tab\":\n setOpen(false);\n break;\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n step(event.key === \"ArrowDown\" ? 1 : -1);\n break;\n case \"Home\":\n case \"End\": {\n event.preventDefault();\n const pick = event.key === \"Home\" ? enabled[0] : enabled[enabled.length - 1];\n if (pick) setActiveIndex(options.indexOf(pick));\n break;\n }\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n const option = options[activeIndex];\n if (option && !option.isDisabled) commit(option.value);\n break;\n }\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (effectiveDisabled) return;\n if (isVisible) {\n handleListKeyDown(event);\n } else if ([\"ArrowDown\", \"ArrowUp\", \"Enter\", \" \"].includes(event.key)) {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n return (\n <div className=\"ds-select-root\" ref={rootRef}>\n <Button\n ref={(node) => {\n triggerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n size={size}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={isVisible}\n aria-controls={isVisible ? listId : undefined}\n aria-activedescendant={isVisible && options[activeIndex] && !options[activeIndex].isDisabled ? `${listId}-option-${activeIndex}` : undefined}\n aria-invalid={isInvalid || undefined}\n isDisabled={effectiveDisabled}\n data-placeholder={selected ? undefined : \"\"}\n className={cx(\"ds-field-skin\", \"ds-select\", className)}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) setOpen((open) => !open);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) handleKeyDown(event);\n }}\n {...rest}\n >\n <span className=\"ds-select__value\">{selected ? selected.label : placeholder}</span>\n <Icon name=\"chevron-down\" size={16} className=\"ds-select__chevron\" />\n </Button>\n <Popover\n anchorRef={triggerRef}\n isOpen={isVisible}\n placement={menuPlacement}\n matchAnchorWidth\n panelRef={listRef}\n id={listId}\n role=\"listbox\"\n aria-label={rest[\"aria-labelledby\"] ? undefined : rest[\"aria-label\"] ?? placeholder}\n aria-labelledby={rest[\"aria-labelledby\"]}\n className=\"ds-surface-raised ds-select__menu\"\n >\n <div onKeyDown={handleKeyDown} onPointerDown={(event) => event.preventDefault()}>\n {options.map((option, index) => (\n <Button\n key={option.value}\n variant={index === activeIndex ? \"active\" : \"simple\"}\n size=\"sm\"\n isDisabled={option.isDisabled}\n tabIndex={-1}\n id={`${listId}-option-${index}`}\n role=\"option\"\n aria-selected={option.value === current}\n aria-disabled={option.isDisabled || undefined}\n data-active={index === activeIndex || undefined}\n className=\"ds-select__option\"\n onMouseEnter={() => !option.isDisabled && setActiveIndex(index)}\n onClick={() => {\n if (!option.isDisabled) {\n commit(option.value);\n triggerRef.current?.focus();\n }\n }}\n >\n <span className=\"ds-select__option-body\">\n <span className=\"ds-select__option-label\">{option.label}</span>\n {option.description && (\n <span className=\"ds-select__option-description\">{option.description}</span>\n )}\n </span>\n {option.value === current && <Icon name=\"check\" size={16} />}\n </Button>\n ))}\n </div>\n </Popover>\n </div>\n );\n});\n"],"mappings":";;;;;;;AAgBA,SAASC,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AA6BA,IAAaC,IAASC,EAA2C,SAC/D,EACE,YACA,UACA,iBACA,kBACA,iBAAc,oBACd,UAAO,MACP,gBAAa,IACb,eAAY,IACZ,mBAAgB,UAChB,cACA,aACA,YACA,cACA,GAAGC,KAEL,GACA;CACA,IAAM,CAACC,GAAUC,KAAeC,EAASC,KAAgB,EAAE,GACrDC,IAAUC,KAASL,GACnB,CAACM,GAAQC,KAAWL,EAAS,EAAK,GAClC,CAACM,GAAaC,KAAkBP,EAAS,CAAC,GAC1CQ,IAAUC,EAA8B,IAAI,GAC5CC,IAAaD,EAAiC,IAAI,GAClDE,IAAUF,EAA8B,IAAI,GAC5CG,IAASC,EAAM,GACfC,IAAoBC,KAAcC,GAClCC,IAAYb,KAAU,CAACU,GAEvBI,IAAWC,EAAQ,MAAM,MAAWC,EAAO,UAAUlB,CAAO,GAC5DmB,IAAUF,EAAQ,QAAQ,MAAW,CAACC,EAAO,UAAU,GAEvDE,IAASC,GACZ,MAAiB;EAGhB,AAFIpB,MAAU,KAAA,KAAWJ,EAA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EAAO,KA0BN,CACT;GACE,CAAA;EACE,CAAA,CACN;;AAET,CAAC"}
1
+ {"version":3,"file":"index.js","names":["Icon","cx","parts","Select","forwardRef","ariaInvalid","rest","internal","setInternal","useState","defaultValue","current","value","isOpen","setOpen","activeIndex","setActiveIndex","rootRef","useRef","triggerRef","listRef","listId","useId","effectiveDisabled","isDisabled","disabled","isVisible","selected","options","option","enabled","commit","useCallback","next","onValueChange","useEffect","index","onPointerDown","target","event","step","order","o","delta","handleListKeyDown","pick","handleKeyDown","Button","node","ref","required","isInvalid","className","onClick","open","onKeyDown","placeholder","Popover","menuPlacement"],"sources":["../../../src/components/Select/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Popover, type PopoverPlacement } from \"../Popover\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SelectOption {\n value: string;\n label: string;\n /** Secondary line under the label. */\n description?: string;\n isDisabled?: boolean;\n}\n\nexport interface SelectProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"value\" | \"defaultValue\" | \"onChange\"\n> {\n required?: boolean;\n options: SelectOption[];\n /** Controlled value. Leave undefined to let the select hold its own. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n placeholder?: string;\n size?: FieldSize;\n isDisabled?: boolean;\n isInvalid?: boolean;\n /** Preferred side of the menu; flips when space requires it. */\n menuPlacement?: PopoverPlacement;\n}\n\n/**\n * One value out of a known list. Wears the field skin, opens a listbox: arrows\n * walk the options, Enter commits, Escape closes without changing anything.\n */\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder = \"Select an option\",\n size = \"md\",\n isDisabled = false,\n isInvalid = false,\n \"aria-invalid\": ariaInvalid,\n required,\n menuPlacement = \"bottom\",\n className,\n disabled,\n onClick,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultValue ?? \"\");\n const current = value ?? internal;\n const [isOpen, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState(0);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const listId = useId();\n const effectiveDisabled = isDisabled || disabled;\n const isVisible = isOpen && !effectiveDisabled;\n\n const selected = options.find((option) => option.value === current);\n const enabled = options.filter((option) => !option.isDisabled);\n\n const commit = useCallback(\n (next: string) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n setOpen(false);\n },\n [onValueChange, value],\n );\n\n useEffect(() => {\n if (!isVisible) return;\n const index = options.findIndex((option) => option.value === current && !option.isDisabled);\n setActiveIndex(index < 0 ? options.indexOf(enabled[0]!) : index);\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!rootRef.current?.contains(target) && !listRef.current?.contains(target)) setOpen(false);\n };\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isVisible]);\n\n useEffect(() => {\n if (!isVisible) return;\n const activeOption =\n listRef.current?.querySelectorAll<HTMLElement>(\"[role='option']\")[activeIndex];\n activeOption?.scrollIntoView({ block: \"nearest\" });\n }, [activeIndex, isVisible]);\n\n const step = (delta: number) => {\n const order = options\n .map((option, index) => ({ option, index }))\n .filter((o) => !o.option.isDisabled);\n if (order.length === 0) return;\n const at = order.findIndex((o) => o.index === activeIndex);\n const next = order[(at + delta + order.length) % order.length]!;\n setActiveIndex(next.index);\n };\n\n const handleListKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case \"Escape\":\n // Claims Escape so an enclosing Drawer stays open.\n event.preventDefault();\n setOpen(false);\n triggerRef.current?.focus();\n break;\n case \"Tab\":\n setOpen(false);\n break;\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n step(event.key === \"ArrowDown\" ? 1 : -1);\n break;\n case \"Home\":\n case \"End\": {\n event.preventDefault();\n const pick = event.key === \"Home\" ? enabled[0] : enabled[enabled.length - 1];\n if (pick) setActiveIndex(options.indexOf(pick));\n break;\n }\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n const option = options[activeIndex];\n if (option && !option.isDisabled) commit(option.value);\n break;\n }\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (effectiveDisabled) return;\n if (isVisible) {\n handleListKeyDown(event);\n } else if ([\"ArrowDown\", \"ArrowUp\", \"Enter\", \" \"].includes(event.key)) {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n return (\n <div\n className=\"ds-select-root\"\n ref={rootRef}\n >\n <Button\n ref={(node) => {\n triggerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n size={size}\n role=\"combobox\"\n aria-required={required || undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isVisible}\n aria-controls={isVisible ? listId : undefined}\n aria-activedescendant={\n isVisible && options[activeIndex] && !options[activeIndex].isDisabled\n ? `${listId}-option-${activeIndex}`\n : undefined\n }\n aria-invalid={isInvalid || ariaInvalid || undefined}\n isDisabled={effectiveDisabled}\n data-placeholder={selected ? undefined : \"\"}\n className={cx(\"ds-field-skin\", \"ds-select\", className)}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) setOpen((open) => !open);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) handleKeyDown(event);\n }}\n {...rest}\n >\n <span className=\"ds-select__value\">{selected ? selected.label : placeholder}</span>\n <Icon\n name=\"chevron-down\"\n size={16}\n className=\"ds-select__chevron\"\n />\n </Button>\n <Popover\n anchorRef={triggerRef}\n isOpen={isVisible}\n placement={menuPlacement}\n matchAnchorWidth\n panelRef={listRef}\n id={listId}\n role=\"listbox\"\n aria-label={rest[\"aria-labelledby\"] ? undefined : (rest[\"aria-label\"] ?? placeholder)}\n aria-labelledby={rest[\"aria-labelledby\"]}\n className=\"ds-surface-raised ds-select__menu\"\n >\n <div\n onKeyDown={handleKeyDown}\n onPointerDown={(event) => event.preventDefault()}\n >\n {options.map((option, index) => (\n <Button\n key={option.value}\n variant={index === activeIndex ? \"active\" : \"simple\"}\n size=\"sm\"\n isDisabled={option.isDisabled}\n tabIndex={-1}\n id={`${listId}-option-${index}`}\n role=\"option\"\n aria-selected={option.value === current}\n aria-disabled={option.isDisabled || undefined}\n data-active={index === activeIndex || undefined}\n className=\"ds-select__option\"\n onMouseEnter={() => !option.isDisabled && setActiveIndex(index)}\n onClick={() => {\n if (!option.isDisabled) {\n commit(option.value);\n triggerRef.current?.focus();\n }\n }}\n >\n <span className=\"ds-select__option-body\">\n <span className=\"ds-select__option-label\">{option.label}</span>\n {option.description && (\n <span className=\"ds-select__option-description\">{option.description}</span>\n )}\n </span>\n {option.value === current && (\n <Icon\n name=\"check\"\n size={16}\n />\n )}\n </Button>\n ))}\n </div>\n </Popover>\n </div>\n );\n});\n"],"mappings":";;;;;;;AAgBA,SAASC,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAgCA,IAAaC,IAASC,EAA2C,SAC/D,EACE,YACA,UACA,iBACA,kBACA,iBAAc,oBACd,UAAO,MACP,gBAAa,IACb,eAAY,IACZ,gBAAgBC,GAChB,aACA,mBAAgB,UAChB,cACA,aACA,YACA,cACA,GAAGC,KAEL,GACA;CACA,IAAM,CAACC,GAAUC,KAAeC,EAASC,KAAgB,EAAE,GACrDC,IAAUC,KAASL,GACnB,CAACM,GAAQC,KAAWL,EAAS,EAAK,GAClC,CAACM,GAAaC,KAAkBP,EAAS,CAAC,GAC1CQ,IAAUC,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SAAS,MAAM;KAE9B;KAlBF,UAAA,CAoBE,kBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,kBAAC,QAAD;OAAM,WAAU;OAA2B,UAAAU,EAAO;MAAY,CAAA,GAC7DA,EAAO,eACN,kBAAC,QAAD;OAAM,WAAU;OAAiC,UAAAA,EAAO;MAAkB,CAAA,CAExE;KACL,CAAA,GAAAA,EAAO,UAAUlB,KAChB,kBAACX,GAAD;MACE,MAAK;MACL,MAAM;KACP,CAAA,CAEG;IA/BD,GAAA6B,EAAO,KA+BN,CACT;GACE,CAAA;EACE,CAAA,CACN;;AAET,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Grid/index.cjs");let t=require("react"),n=require("react/jsx-runtime");function r({kind:e,title:t,description:r,children:i,className:a,inputProps:o,inputRef:s}){return(0,n.jsxs)(`label`,{className:[`ds-selection-card`,a].filter(Boolean).join(` `),children:[(0,n.jsx)(`input`,{ref:s,type:e,"data-kind":e,className:`ds-selection-card__control`,...o}),(0,n.jsxs)(`span`,{className:`ds-selection-card__text`,children:[(0,n.jsx)(`span`,{className:`ds-selection-card__title`,children:t}),r&&(0,n.jsx)(`span`,{className:`ds-selection-card__description`,children:r}),i&&(0,n.jsx)(`span`,{className:`ds-selection-card__extra`,children:i})]})]})}var i=(0,t.forwardRef)(function({title:e,description:t,children:i,className:a,...o},s){return(0,n.jsx)(r,{kind:`checkbox`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:i})}),a=(0,t.forwardRef)(function({title:e,description:t,children:i,className:a,...o},s){return(0,n.jsx)(r,{kind:`radio`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:i})});function o({label:t,columns:r=2,gap:i=`md`,children:a}){return(0,n.jsxs)(`fieldset`,{className:`ds-selection-card-group`,children:[(0,n.jsx)(`legend`,{className:`ds-selection-card-group__label`,children:t}),(0,n.jsx)(e.Grid,{columns:r,gap:i,className:`ds-selection-card-group__grid`,children:a})]})}exports.CheckboxCard=i,exports.RadioCard=a,exports.SelectionCardGroup=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/group-pKDQtq-9.cjs"),t=require("../Grid/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i({kind:e,title:t,description:n,children:i,className:a,inputProps:o,inputRef:s}){return(0,r.jsxs)(`label`,{className:[`ds-selection-card`,a].filter(Boolean).join(` `),children:[(0,r.jsx)(`input`,{ref:s,type:e,"data-kind":e,className:`ds-selection-card__control`,...o}),(0,r.jsxs)(`span`,{className:`ds-selection-card__text`,children:[(0,r.jsx)(`span`,{className:`ds-selection-card__title`,children:t}),n&&(0,r.jsx)(`span`,{className:`ds-selection-card__description`,children:n}),i&&(0,r.jsx)(`span`,{className:`ds-selection-card__extra`,children:i})]})]})}var a=(0,n.forwardRef)(function({title:e,description:t,children:n,className:a,...o},s){return(0,r.jsx)(i,{kind:`checkbox`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:n})}),o=(0,n.forwardRef)(function({title:e,description:t,children:n,className:a,...o},s){return(0,r.jsx)(i,{kind:`radio`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:n})});function s({label:n,columns:i=2,gap:a=`md`,children:o,className:s,...c}){return(0,r.jsx)(e.t,{...c,label:n,className:[`ds-selection-card-group`,s].filter(Boolean).join(` `),children:(0,r.jsx)(t.Grid,{columns:i,gap:a,className:`ds-selection-card-group__grid`,children:o})})}exports.CheckboxCard=a,exports.RadioCard=o,exports.SelectionCardGroup=s;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","Grid","require_components_Grid_index","react","react_jsx_runtime","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","rest","ref","RadioCard","SelectionCardGroup","label"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label className={[\"ds-selection-card\", className].filter(Boolean).join(\" \")}>\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(\n function CheckboxCard({ title, description, children, className, ...rest }, ref) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n },\n);\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({ label, columns = 2, gap = \"md\", children }: SelectionCardGroupProps) {\n return (\n <fieldset className=\"ds-selection-card-group\">\n <legend className=\"ds-selection-card-group__label\">{label}</legend>\n <Grid columns={columns} gap={gap} className=\"ds-selection-card-group__grid\">\n {children}\n </Grid>\n </fieldset>\n );\n}\n"],"mappings":"A,8JAkBA,SAASK,EAAS,CAChB,OACA,QACA,cACA,WACA,YACA,aACA,YAMC,CACD,OACE,EAAAD,EAAA,KAAA,CAAC,QAAD,CAAO,UAAW,CAAC,oBAAqBE,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAA3E,SAAA,EACE,EAAAF,EAAA,IAAA,CAAC,QAAD,CACE,IAAKG,EACL,KAAMC,EACN,YAAWA,EACX,UAAU,6BACV,GAAIC,CACL,CAAA,GACD,EAAAL,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,0BAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAAM,CAAY,CAAA,EACvDC,IAAe,EAAAP,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,iCAAkC,SAAAO,CAAkB,CAAA,EACnFC,IAAY,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,UAAe,CAAA,CACpE,CACD,CAAA,CAAA,C,EAEX,CAQA,IAAaS,GAAA,EAAeb,EAAAA,WAAAA,CAC1B,SAAsB,CAAE,QAAO,cAAa,WAAU,YAAW,GAAGc,GAAQ,EAAK,CAC/E,OACE,EAAAV,EAAA,IAAA,CAACC,EAAD,CACE,KAAK,WACE,QACM,cACF,YACX,WAAYS,EACZ,SAAUC,EAET,UACO,CAAA,CAEd,CACF,EAKaC,GAAA,EAAYhB,EAAAA,WAAAA,CAA6C,SACpE,CAAE,QAAO,cAAa,WAAU,YAAW,GAAGc,GAC9C,EACA,CACA,OACE,EAAAV,EAAA,IAAA,CAACC,EAAD,CACE,KAAK,QACE,QACM,cACF,YACX,WAAYS,EACZ,SAAUC,EAET,UACO,CAAA,CAEd,CAAC,EAaD,SAAgBE,EAAmB,CAAE,QAAO,UAAU,EAAG,MAAM,KAAM,YAAqC,CACxG,OACE,EAAAb,EAAA,KAAA,CAAC,WAAD,CAAU,UAAU,0BAApB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,UAAU,iCAAkC,SAAAc,CAAc,CAAA,GAClE,EAAAd,EAAA,IAAA,CAACH,EAAAA,KAAD,CAAe,UAAc,MAAK,UAAU,gCACzC,UACG,CAAA,CACE,C,EAEd,C"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","FieldGroup","Grid","require_group","require_components_Grid_index","react","react_jsx_runtime","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","rest","ref","RadioCard","SelectionCardGroup","fieldProps"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label className={[\"ds-selection-card\", className].filter(Boolean).join(\" \")}>\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(function CheckboxCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps extends FieldGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({\n label,\n columns = 2,\n gap = \"md\",\n children,\n className,\n ...fieldProps\n}: SelectionCardGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-selection-card-group\", className].filter(Boolean).join(\" \")}\n >\n <Grid\n columns={columns}\n gap={gap}\n className=\"ds-selection-card-group__grid\"\n >\n {children}\n </Grid>\n </FieldGroup>\n );\n}\n"],"mappings":"A,2MAmBA,SAASO,EAAS,CAChB,OACA,QACA,cACA,WACA,YACA,aACA,YAMC,CACD,OACE,EAAAD,EAAA,KAAA,CAAC,QAAD,CAAO,UAAW,CAAC,oBAAqBE,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAA3E,SAAA,EACE,EAAAF,EAAA,IAAA,CAAC,QAAD,CACE,IAAKG,EACL,KAAMC,EACN,YAAWA,EACX,UAAU,6BACV,GAAIC,CACL,CAAA,GACD,EAAAL,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,0BAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAAM,CAAY,CAAA,EACvDC,IAAe,EAAAP,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,iCAAkC,SAAAO,CAAkB,CAAA,EACnFC,IAAY,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,UAAe,CAAA,CACpE,CACD,CAAA,CAAA,C,EAEX,CAQA,IAAaS,GAAA,EAAef,EAAAA,WAAAA,CAAgD,SAC1E,CAAE,QAAO,cAAa,WAAU,YAAW,GAAGgB,GAC9C,EACA,CACA,OACE,EAAAV,EAAA,IAAA,CAACC,EAAD,CACE,KAAK,WACE,QACM,cACF,YACX,WAAYS,EACZ,SAAUC,EAET,UACO,CAAA,CAEd,CAAC,EAKYC,GAAA,EAAYlB,EAAAA,WAAAA,CAA6C,SACpE,CAAE,QAAO,cAAa,WAAU,YAAW,GAAGgB,GAC9C,EACA,CACA,OACE,EAAAV,EAAA,IAAA,CAACC,EAAD,CACE,KAAK,QACE,QACM,cACF,YACX,WAAYS,EACZ,SAAUC,EAET,UACO,CAAA,CAEd,CAAC,EAaD,SAAgBE,EAAmB,CACjC,QACA,UAAU,EACV,MAAM,KACN,WACA,YACA,GAAGC,GACuB,CAC1B,OACE,EAAAd,EAAA,IAAA,CAACL,EAAAA,EAAD,CACE,GAAImB,EACG,QACP,UAAW,CAAC,0BAA2BZ,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAE1E,UAAA,EAAAF,EAAA,IAAA,CAACJ,EAAAA,KAAD,CACW,UACJ,MACL,UAAU,gCAET,UACG,CAAA,CACI,CAAA,CAEhB,C"}
@@ -1,4 +1,5 @@
1
1
  import { type InputHTMLAttributes, type ReactNode } from "react";
2
+ import { type FieldGroupProps } from "../Field/group.cjs";
2
3
  import { type GapSize } from "../Grid/index.cjs";
3
4
  interface SelectionCardBase {
4
5
  /** The commitment, in the user's words. */
@@ -20,7 +21,7 @@ export interface RadioCardProps extends SelectionCardBase, NativeInput {
20
21
  }
21
22
  /** One of a set of mutually exclusive options, each with its own explanation. */
22
23
  export declare const RadioCard: import("react").ForwardRefExoticComponent<RadioCardProps & import("react").RefAttributes<HTMLInputElement>>;
23
- export interface SelectionCardGroupProps {
24
+ export interface SelectionCardGroupProps extends FieldGroupProps {
24
25
  /** Group label — the question the cards answer. */
25
26
  label: string;
26
27
  /** Cards per row at full width. Steps down inside a narrow container. */
@@ -30,6 +31,6 @@ export interface SelectionCardGroupProps {
30
31
  children: ReactNode;
31
32
  }
32
33
  /** A grid of selection cards under one legend, spaced by the shared Grid. */
33
- export declare function SelectionCardGroup({ label, columns, gap, children }: SelectionCardGroupProps): import("react").JSX.Element;
34
+ export declare function SelectionCardGroup({ label, columns, gap, children, className, ...fieldProps }: SelectionCardGroupProps): import("react").JSX.Element;
34
35
  export {};
35
36
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SelectionCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MA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SAAS,CAAC;AAC7C,OAAO,aAAa,CAAC;AAErB,UAAU,iBAAiB;IACzB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC;IACjB,4FAA4F;IAC5F,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,KAAK,WAAW,GAAG,IAAI,CACrB,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACvC,CAAC;AAkCF,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAE5E;;;GAGG;AACH,eAAO,MAAM,YAAY,gHAgBvB,CAAC;AAEH,MAAM,WAAW,cAAe,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAEzE,iFAAiF;AACjF,eAAO,MAAM,SAAS,6GAgBpB,CAAC;AAEH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,sFAAsF;IACtF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAW,EACX,GAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,UAAU,EACd,EAAE,uBAAuB,+BAgBzB"}
@@ -1,4 +1,5 @@
1
1
  import { type InputHTMLAttributes, type ReactNode } from "react";
2
+ import { type FieldGroupProps } from "../Field/group.js";
2
3
  import { type GapSize } from "../Grid/index.js";
3
4
  interface SelectionCardBase {
4
5
  /** The commitment, in the user's words. */
@@ -20,7 +21,7 @@ export interface RadioCardProps extends SelectionCardBase, NativeInput {
20
21
  }
21
22
  /** One of a set of mutually exclusive options, each with its own explanation. */
22
23
  export declare const RadioCard: import("react").ForwardRefExoticComponent<RadioCardProps & import("react").RefAttributes<HTMLInputElement>>;
23
- export interface SelectionCardGroupProps {
24
+ export interface SelectionCardGroupProps extends FieldGroupProps {
24
25
  /** Group label — the question the cards answer. */
25
26
  label: string;
26
27
  /** Cards per row at full width. Steps down inside a narrow container. */
@@ -30,6 +31,6 @@ export interface SelectionCardGroupProps {
30
31
  children: ReactNode;
31
32
  }
32
33
  /** A grid of selection cards under one legend, spaced by the shared Grid. */
33
- export declare function SelectionCardGroup({ label, columns, gap, children }: SelectionCardGroupProps): import("react").JSX.Element;
34
+ export declare function SelectionCardGroup({ label, columns, gap, children, className, ...fieldProps }: SelectionCardGroupProps): import("react").JSX.Element;
34
35
  export {};
35
36
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAQ,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,aAAa,CAAC;AAErB,UAAU,iBAAiB;IACzB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC;IACjB,4FAA4F;IAC5F,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,KAAK,WAAW,GAAG,IAAI,CACrB,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACvC,CAAC;AAkCF,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAE5E;;;GAGG;AACH,eAAO,MAAM,YAAY,gHAexB,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAEzE,iFAAiF;AACjF,eAAO,MA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,eAAe;IAC9D,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,sFAAsF;IACtF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAW,EACX,GAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,UAAU,EACd,EAAE,uBAAuB,+BAgBzB"}
@@ -1,28 +1,29 @@
1
- import { Grid as e } from "../Grid/index.js";
2
- import { forwardRef as t } from "react";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
1
+ import { t as e } from "../../chunks/group-CzbacuAY.js";
2
+ import { Grid as t } from "../Grid/index.js";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
5
  //#region src/components/SelectionCard/index.tsx
5
- function i({ kind: e, title: t, description: i, children: a, className: o, inputProps: s, inputRef: c }) {
6
- return /* @__PURE__ */ r("label", {
6
+ function a({ kind: e, title: t, description: n, children: a, className: o, inputProps: s, inputRef: c }) {
7
+ return /* @__PURE__ */ i("label", {
7
8
  className: ["ds-selection-card", o].filter(Boolean).join(" "),
8
- children: [/* @__PURE__ */ n("input", {
9
+ children: [/* @__PURE__ */ r("input", {
9
10
  ref: c,
10
11
  type: e,
11
12
  "data-kind": e,
12
13
  className: "ds-selection-card__control",
13
14
  ...s
14
- }), /* @__PURE__ */ r("span", {
15
+ }), /* @__PURE__ */ i("span", {
15
16
  className: "ds-selection-card__text",
16
17
  children: [
17
- /* @__PURE__ */ n("span", {
18
+ /* @__PURE__ */ r("span", {
18
19
  className: "ds-selection-card__title",
19
20
  children: t
20
21
  }),
21
- i && /* @__PURE__ */ n("span", {
22
+ n && /* @__PURE__ */ r("span", {
22
23
  className: "ds-selection-card__description",
23
- children: i
24
+ children: n
24
25
  }),
25
- a && /* @__PURE__ */ n("span", {
26
+ a && /* @__PURE__ */ r("span", {
26
27
  className: "ds-selection-card__extra",
27
28
  children: a
28
29
  })
@@ -30,42 +31,41 @@ function i({ kind: e, title: t, description: i, children: a, className: o, input
30
31
  })]
31
32
  });
32
33
  }
33
- var a = t(function({ title: e, description: t, children: r, className: a, ...o }, s) {
34
- return /* @__PURE__ */ n(i, {
34
+ var o = n(function({ title: e, description: t, children: n, className: i, ...o }, s) {
35
+ return /* @__PURE__ */ r(a, {
35
36
  kind: "checkbox",
36
37
  title: e,
37
38
  description: t,
38
- className: a,
39
+ className: i,
39
40
  inputProps: o,
40
41
  inputRef: s,
41
- children: r
42
+ children: n
42
43
  });
43
- }), o = t(function({ title: e, description: t, children: r, className: a, ...o }, s) {
44
- return /* @__PURE__ */ n(i, {
44
+ }), s = n(function({ title: e, description: t, children: n, className: i, ...o }, s) {
45
+ return /* @__PURE__ */ r(a, {
45
46
  kind: "radio",
46
47
  title: e,
47
48
  description: t,
48
- className: a,
49
+ className: i,
49
50
  inputProps: o,
50
51
  inputRef: s,
51
- children: r
52
+ children: n
52
53
  });
53
54
  });
54
- function s({ label: t, columns: i = 2, gap: a = "md", children: o }) {
55
- return /* @__PURE__ */ r("fieldset", {
56
- className: "ds-selection-card-group",
57
- children: [/* @__PURE__ */ n("legend", {
58
- className: "ds-selection-card-group__label",
59
- children: t
60
- }), /* @__PURE__ */ n(e, {
55
+ function c({ label: n, columns: i = 2, gap: a = "md", children: o, className: s, ...c }) {
56
+ return /* @__PURE__ */ r(e, {
57
+ ...c,
58
+ label: n,
59
+ className: ["ds-selection-card-group", s].filter(Boolean).join(" "),
60
+ children: /* @__PURE__ */ r(t, {
61
61
  columns: i,
62
62
  gap: a,
63
63
  className: "ds-selection-card-group__grid",
64
64
  children: o
65
- })]
65
+ })
66
66
  });
67
67
  }
68
68
  //#endregion
69
- export { a as CheckboxCard, o as RadioCard, s as SelectionCardGroup };
69
+ export { o as CheckboxCard, s as RadioCard, c as SelectionCardGroup };
70
70
 
71
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","forwardRef","rest","ref","RadioCard","SelectionCardGroup","label","Grid"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label className={[\"ds-selection-card\", className].filter(Boolean).join(\" \")}>\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(\n function CheckboxCard({ title, description, children, className, ...rest }, ref) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n },\n);\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({ label, columns = 2, gap = \"md\", children }: SelectionCardGroupProps) {\n return (\n <fieldset className=\"ds-selection-card-group\">\n <legend className=\"ds-selection-card-group__label\">{label}</legend>\n <Grid columns={columns} gap={gap} className=\"ds-selection-card-group__grid\">\n {children}\n </Grid>\n </fieldset>\n );\n}\n"],"mappings":";;;;AAkBA,SAASA,EAAS,EAChB,SACA,UACA,gBACA,aACA,cACA,eACA,eAMC;CACD,OACE,kBAAC,SAAD;EAAO,WAAW,CAAC,qBAAqBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAA3E,UAAA,CACE,kBAAC,SAAD;GACE,KAAKC;GACL,MAAMC;GACN,aAAWA;GACX,WAAU;GACV,GAAIC;EACL,CAAA,GACD,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA;IACE,kBAAC,QAAD;KAAM,WAAU;KAA4B,UAAAC;IAAY,CAAA;IACvDC,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAkC,UAAAA;IAAkB,CAAA;IACnFC,KAAY,kBAAC,QAAD;KAAM,WAAU;KAA4B;IAAe,CAAA;GACpE;EACD,CAAA,CAAA;;AAEX;AAQA,IAAaC,IAAeC,EAC1B,SAAsB,EAAE,UAAO,gBAAa,aAAU,cAAW,GAAGC,KAAQ,GAAK;CAC/E,OACE,kBAACV,GAAD;EACE,MAAK;EACE;EACM;EACF;EACX,YAAYU;EACZ,UAAUC;EAET;CACO,CAAA;AAEd,CACF,GAKaC,IAAYH,EAA6C,SACpE,EAAE,UAAO,gBAAa,aAAU,cAAW,GAAGC,KAC9C,GACA;CACA,OACE,kBAACV,GAAD;EACE,MAAK;EACE;EACM;EACF;EACX,YAAYU;EACZ,UAAUC;EAET;CACO,CAAA;AAEd,CAAC;AAaD,SAAgBE,EAAmB,EAAE,UAAO,aAAU,GAAG,SAAM,MAAM,eAAqC;CACxG,OACE,kBAAC,YAAD;EAAU,WAAU;EAApB,UAAA,CACE,kBAAC,UAAD;GAAQ,WAAU;GAAkC,UAAAC;EAAc,CAAA,GAClE,kBAACC,GAAD;GAAe;GAAc;GAAK,WAAU;GACzC;EACG,CAAA,CACE;;AAEd"}
1
+ {"version":3,"file":"index.js","names":["FieldGroup","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","forwardRef","rest","ref","RadioCard","SelectionCardGroup","fieldProps","Grid"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label className={[\"ds-selection-card\", className].filter(Boolean).join(\" \")}>\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(function CheckboxCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps extends FieldGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({\n label,\n columns = 2,\n gap = \"md\",\n children,\n className,\n ...fieldProps\n}: SelectionCardGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-selection-card-group\", className].filter(Boolean).join(\" \")}\n >\n <Grid\n columns={columns}\n gap={gap}\n className=\"ds-selection-card-group__grid\"\n >\n {children}\n </Grid>\n </FieldGroup>\n );\n}\n"],"mappings":";;;;;AAmBA,SAASC,EAAS,EAChB,SACA,UACA,gBACA,aACA,cACA,eACA,eAMC;CACD,OACE,kBAAC,SAAD;EAAO,WAAW,CAAC,qBAAqBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAA3E,UAAA,CACE,kBAAC,SAAD;GACE,KAAKC;GACL,MAAMC;GACN,aAAWA;GACX,WAAU;GACV,GAAIC;EACL,CAAA,GACD,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA;IACE,kBAAC,QAAD;KAAM,WAAU;KAA4B,UAAAC;IAAY,CAAA;IACvDC,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAkC,UAAAA;IAAkB,CAAA;IACnFC,KAAY,kBAAC,QAAD;KAAM,WAAU;KAA4B;IAAe,CAAA;GACpE;EACD,CAAA,CAAA;;AAEX;AAQA,IAAaC,IAAeC,EAAgD,SAC1E,EAAE,UAAO,gBAAa,aAAU,cAAW,GAAGC,KAC9C,GACA;CACA,OACE,kBAACV,GAAD;EACE,MAAK;EACE;EACM;EACF;EACX,YAAYU;EACZ,UAAUC;EAET;CACO,CAAA;AAEd,CAAC,GAKYC,IAAYH,EAA6C,SACpE,EAAE,UAAO,gBAAa,aAAU,cAAW,GAAGC,KAC9C,GACA;CACA,OACE,kBAACV,GAAD;EACE,MAAK;EACE;EACM;EACF;EACX,YAAYU;EACZ,UAAUC;EAET;CACO,CAAA;AAEd,CAAC;AAaD,SAAgBE,EAAmB,EACjC,UACA,aAAU,GACV,SAAM,MACN,aACA,cACA,GAAGC,KACuB;CAC1B,OACE,kBAACf,GAAD;EACE,GAAIe;EACG;EACP,WAAW,CAAC,2BAA2Bb,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAE1E,UAAA,kBAACc,GAAD;GACW;GACJ;GACL,WAAU;GAET;EACG,CAAA;CACI,CAAA;AAEhB"}
@@ -4,7 +4,7 @@
4
4
  align-items: start;
5
5
  gap: var(--space-3);
6
6
  padding: var(--space-4);
7
- min-inline-size: var(--choice-card-min-width);
7
+ min-inline-size: min(100%, var(--choice-card-min-width));
8
8
  background: var(--color-surface);
9
9
  border: var(--control-border-width) solid var(--control-border-color);
10
10
  border-radius: var(--field-radius);
@@ -34,7 +34,7 @@
34
34
 
35
35
  .ds-selection-card:has(.ds-selection-card__control:disabled) {
36
36
  cursor: not-allowed;
37
- opacity: 45%;
37
+ opacity: 0.45;
38
38
  }
39
39
 
40
40
  /* Same control geometry as the bare checkbox and radio. */
@@ -80,9 +80,6 @@
80
80
  background: var(--color-primary);
81
81
  }
82
82
 
83
-
84
-
85
-
86
83
  .ds-selection-card__text {
87
84
  display: flex;
88
85
  flex-direction: column;
@@ -117,14 +114,6 @@
117
114
  min-inline-size: 0;
118
115
  }
119
116
 
120
- .ds-selection-card-group__label {
121
- padding: 0;
122
- margin-block-end: var(--space-3);
123
- font-size: var(--font-size-sm);
124
- font-weight: var(--font-weight-bold);
125
- }
126
-
127
-
128
117
  @media (prefers-reduced-motion: reduce) {
129
118
  .ds-selection-card {
130
119
  transition: none;
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CWsA1W83.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.createContext)({isCollapsed:!1});function a(){return(0,n.useContext)(i).isCollapsed}var o=(0,n.forwardRef)(function({isCollapsed:e,defaultCollapsed:t=!1,onCollapsedChange:a,label:o=`Main`,className:c,children:l,...u},d){let[f,p]=(0,n.useState)(t),m=e??f,h=(0,n.useCallback)(()=>{let t=!m;e===void 0&&p(t),a?.(t)},[e,m,a]),g=(0,n.useMemo)(()=>({isCollapsed:m}),[m]);return(0,r.jsx)(i.Provider,{value:g,children:(0,r.jsx)(s.Provider,{value:h,children:(0,r.jsx)(`nav`,{ref:d,"aria-label":o,"data-collapsed":m||void 0,className:[`ds-sidenav`,c].filter(Boolean).join(` `),...u,children:l})})})}),s=(0,n.createContext)(()=>{}),c=(0,n.forwardRef)(function({title:e,mark:a,isCollapsible:o=!0,className:c,children:l,...u},d){let{isCollapsed:f}=(0,n.useContext)(i),p=(0,n.useContext)(s);return(0,r.jsxs)(`div`,{ref:d,className:[`ds-sidenav__header`,c].filter(Boolean).join(` `),...u,children:[a&&(0,r.jsx)(`span`,{className:`ds-sidenav__mark`,children:a}),!f&&(e||l)&&(0,r.jsx)(`span`,{className:`ds-sidenav__title`,children:e??l}),o&&(0,r.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:f?`chevrons-right`:`chevrons-left`,className:`ds-sidenav__toggle`,"aria-label":f?`Expand navigation`:`Collapse navigation`,"aria-expanded":!f,title:f?`Expand navigation`:`Collapse navigation`,onClick:p})]})}),l=(0,n.forwardRef)(function({label:e,className:t,children:a,...o},s){let{isCollapsed:c}=(0,n.useContext)(i);return(0,r.jsxs)(`div`,{ref:s,className:[`ds-sidenav__section`,t].filter(Boolean).join(` `),"aria-label":e,role:e?`group`:void 0,...o,children:[e&&!c&&(0,r.jsx)(`span`,{className:`ds-sidenav__section-label`,children:e}),(0,r.jsx)(`ul`,{className:`ds-sidenav__list`,children:a})]})}),u=(0,n.forwardRef)(function({icon:t,label:a,isActive:o,badge:s,className:c,...l},u){let{isCollapsed:d}=(0,n.useContext)(i);return(0,r.jsx)(`li`,{className:`ds-sidenav__row`,children:(0,r.jsxs)(`a`,{ref:u,className:[`ds-sidenav__item`,c].filter(Boolean).join(` `),"data-active":o||void 0,"aria-current":o?`page`:void 0,title:d?a:void 0,...l,children:[(0,r.jsx)(e.t,{name:t}),!d&&(0,r.jsx)(`span`,{className:`ds-sidenav__label`,children:a}),!d&&s&&(0,r.jsx)(`span`,{className:`ds-sidenav__badge`,children:s}),d&&(0,r.jsx)(`span`,{className:`ds-sidenav__sr`,children:a})]})})}),d=(0,n.forwardRef)(function({className:e,children:t,...n},i){return(0,r.jsx)(`div`,{ref:i,className:[`ds-sidenav__footer`,e].filter(Boolean).join(` `),...n,children:t})});exports.SideNav=o,exports.SideNavFooter=d,exports.SideNavHeader=c,exports.SideNavItem=u,exports.SideNavSection=l,exports.useSideNavCollapsed=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CW6qJcDy.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.createContext)({isCollapsed:!1});function a(){return(0,n.useContext)(i).isCollapsed}var o=(0,n.forwardRef)(function({isCollapsed:e,defaultCollapsed:t=!1,onCollapsedChange:a,label:o=`Main`,className:c,children:l,...u},d){let[f,p]=(0,n.useState)(t),m=e??f,h=(0,n.useCallback)(()=>{let t=!m;e===void 0&&p(t),a?.(t)},[e,m,a]),g=(0,n.useMemo)(()=>({isCollapsed:m}),[m]);return(0,r.jsx)(i.Provider,{value:g,children:(0,r.jsx)(s.Provider,{value:h,children:(0,r.jsx)(`nav`,{ref:d,"aria-label":o,"data-collapsed":m||void 0,className:[`ds-sidenav`,c].filter(Boolean).join(` `),...u,children:l})})})}),s=(0,n.createContext)(()=>{}),c=(0,n.forwardRef)(function({title:e,mark:a,isCollapsible:o=!0,className:c,children:l,...u},d){let{isCollapsed:f}=(0,n.useContext)(i),p=(0,n.useContext)(s);return(0,r.jsxs)(`div`,{ref:d,className:[`ds-sidenav__header`,c].filter(Boolean).join(` `),...u,children:[a&&(0,r.jsx)(`span`,{className:`ds-sidenav__mark`,children:a}),!f&&(e||l)&&(0,r.jsx)(`span`,{className:`ds-sidenav__title`,children:e??l}),o&&(0,r.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:f?`chevrons-right`:`chevrons-left`,className:`ds-sidenav__toggle`,"aria-label":f?`Expand navigation`:`Collapse navigation`,"aria-expanded":!f,title:f?`Expand navigation`:`Collapse navigation`,onClick:p})]})}),l=(0,n.forwardRef)(function({label:e,className:t,children:a,...o},s){let{isCollapsed:c}=(0,n.useContext)(i);return(0,r.jsxs)(`div`,{ref:s,className:[`ds-sidenav__section`,t].filter(Boolean).join(` `),"aria-label":e,role:e?`group`:void 0,...o,children:[e&&!c&&(0,r.jsx)(`span`,{className:`ds-sidenav__section-label`,children:e}),(0,r.jsx)(`ul`,{className:`ds-sidenav__list`,children:a})]})}),u=(0,n.forwardRef)(function({icon:t,label:a,isActive:o,badge:s,className:c,...l},u){let{isCollapsed:d}=(0,n.useContext)(i);return(0,r.jsx)(`li`,{className:`ds-sidenav__row`,children:(0,r.jsxs)(`a`,{ref:u,className:[`ds-sidenav__item`,c].filter(Boolean).join(` `),"data-active":o||void 0,"aria-current":o?`page`:void 0,title:d?a:void 0,...l,children:[(0,r.jsx)(e.t,{name:t}),!d&&(0,r.jsx)(`span`,{className:`ds-sidenav__label`,children:a}),!d&&s&&(0,r.jsx)(`span`,{className:`ds-sidenav__badge`,children:s}),d&&(0,r.jsx)(`span`,{className:`ds-sidenav__sr`,children:a})]})})}),d=(0,n.forwardRef)(function({className:e,children:t,...n},i){return(0,r.jsx)(`div`,{ref:i,className:[`ds-sidenav__footer`,e].filter(Boolean).join(` `),...n,children:t})});exports.SideNav=o,exports.SideNavFooter=d,exports.SideNavHeader=c,exports.SideNavItem=u,exports.SideNavSection=l,exports.useSideNavCollapsed=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["createContext","useContext","forwardRef","useState","useCallback","useMemo","Button","Icon","require_Icon","require_components_Button_index","react","react_jsx_runtime","SideNavContext","useSideNavCollapsed","SideNav","controlled","rest","uncontrolled","setUncontrolled","defaultCollapsed","isCollapsed","toggle","next","onCollapsedChange","value","SideNavToggleContext","label","className","SideNavHeader","mark","title","children","isCollapsible","SideNavSection","SideNavItem","isActive","icon","badge","SideNavFooter"],"sources":["../../../src/components/SideNav/index.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useState,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\ninterface SideNavContextValue {\n isCollapsed: boolean;\n}\n\nconst SideNavContext = createContext<SideNavContextValue>({ isCollapsed: false });\n\n/** Read the rail's collapsed state from anything rendered inside it. */\nexport function useSideNavCollapsed(): boolean {\n return useContext(SideNavContext).isCollapsed;\n}\n\nexport interface SideNavProps extends HTMLAttributes<HTMLElement> {\n /** Controlled collapsed state. Omit to let the rail own it. */\n isCollapsed?: boolean;\n /** Initial state when uncontrolled. */\n defaultCollapsed?: boolean;\n /** Fired by the header's collapse toggle. */\n onCollapsedChange?: (isCollapsed: boolean) => void;\n /** Accessible name for the landmark. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * The primary rail: one heavy edge against the page, hairline rules between\n * sections. Collapsed it keeps the icons and drops the words — the width is a\n * token, so every rail in the product collapses to the same measure.\n */\nexport const SideNav = forwardRef<HTMLElement, SideNavProps>(function SideNav(\n {\n isCollapsed: controlled,\n defaultCollapsed = false,\n onCollapsedChange,\n label = \"Main\",\n className,\n children,\n ...rest\n },\n ref,\n) {\n const [uncontrolled, setUncontrolled] = useState(defaultCollapsed);\n const isCollapsed = controlled ?? uncontrolled;\n\n const toggle = useCallback(() => {\n const next = !isCollapsed;\n if (controlled === undefined) setUncontrolled(next);\n onCollapsedChange?.(next);\n }, [controlled, isCollapsed, onCollapsedChange]);\n\n const value = useMemo(() => ({ isCollapsed }), [isCollapsed]);\n\n return (\n <SideNavContext.Provider value={value}>\n <SideNavToggleContext.Provider value={toggle}>\n <nav\n ref={ref}\n aria-label={label}\n data-collapsed={isCollapsed || undefined}\n className={[\"ds-sidenav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </nav>\n </SideNavToggleContext.Provider>\n </SideNavContext.Provider>\n );\n});\n\nconst SideNavToggleContext = createContext<() => void>(() => {});\n\nexport interface SideNavHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Shown when the rail is open; hidden when it collapses. */\n title?: ReactNode;\n /** A mark that survives the collapse — a logo, a monogram. */\n mark?: ReactNode;\n /** Set false when the rail is permanently open. */\n isCollapsible?: boolean;\n children?: ReactNode;\n}\n\n/** Brand block plus the collapse toggle, above the first hairline rule. */\nexport const SideNavHeader = forwardRef<HTMLDivElement, SideNavHeaderProps>(\n function SideNavHeader({ title, mark, isCollapsible = true, className, children, ...rest }, ref) {\n const { isCollapsed } = useContext(SideNavContext);\n const toggle = useContext(SideNavToggleContext);\n\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__header\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {mark && <span className=\"ds-sidenav__mark\">{mark}</span>}\n {!isCollapsed && (title || children) && (\n <span className=\"ds-sidenav__title\">{title ?? children}</span>\n )}\n {isCollapsible && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart={isCollapsed ? \"chevrons-right\" : \"chevrons-left\"}\n className=\"ds-sidenav__toggle\"\n aria-label={isCollapsed ? \"Expand navigation\" : \"Collapse navigation\"}\n aria-expanded={!isCollapsed}\n title={isCollapsed ? \"Expand navigation\" : \"Collapse navigation\"}\n onClick={toggle}\n />\n )}\n </div>\n );\n },\n);\n\nexport interface SideNavSectionProps extends HTMLAttributes<HTMLDivElement> {\n /** Section label. Hidden — but still announced — when collapsed. */\n label?: string;\n children?: ReactNode;\n}\n\n/** A group of items under one label, separated by a hairline rule. */\nexport const SideNavSection = forwardRef<HTMLDivElement, SideNavSectionProps>(\n function SideNavSection({ label, className, children, ...rest }, ref) {\n const { isCollapsed } = useContext(SideNavContext);\n\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__section\", className].filter(Boolean).join(\" \")}\n aria-label={label}\n role={label ? \"group\" : undefined}\n {...rest}\n >\n {label && !isCollapsed && <span className=\"ds-sidenav__section-label\">{label}</span>}\n <ul className=\"ds-sidenav__list\">{children}</ul>\n </div>\n );\n },\n);\n\nexport interface SideNavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n icon: IconName;\n /** The words. Kept in the accessible name even when the rail is collapsed. */\n label: string;\n isActive?: boolean;\n /** A count or status pill at the end of the row. Hidden when collapsed. */\n badge?: ReactNode;\n}\n\n/**\n * One destination. The active row carries the solid rail on its leading edge —\n * the same rail as a selected table row, so selection reads the same anywhere.\n */\nexport const SideNavItem = forwardRef<HTMLAnchorElement, SideNavItemProps>(\n function SideNavItem({ icon, label, isActive, badge, className, ...rest }, ref) {\n const { isCollapsed } = useContext(SideNavContext);\n\n return (\n <li className=\"ds-sidenav__row\">\n <a\n ref={ref}\n className={[\"ds-sidenav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n title={isCollapsed ? label : undefined}\n {...rest}\n >\n <Icon name={icon} />\n {!isCollapsed && <span className=\"ds-sidenav__label\">{label}</span>}\n {!isCollapsed && badge && <span className=\"ds-sidenav__badge\">{badge}</span>}\n {isCollapsed && <span className=\"ds-sidenav__sr\">{label}</span>}\n </a>\n </li>\n );\n },\n);\n\nexport interface SideNavFooterProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/** The bottom band — account, theme, help. Above the page edge, under a rule. */\nexport const SideNavFooter = forwardRef<HTMLDivElement, SideNavFooterProps>(\n function SideNavFooter({ className, children, ...rest }, ref) {\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__footer\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n"],"mappings":"A,4MAoBA,IAAMY,GAAA,EAAiBZ,EAAAA,cAAAA,CAAmC,CAAE,YAAa,EAAM,CAAC,EAGhF,SAAgBa,GAA+B,CAC7C,OAAA,EAAOZ,EAAA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AAAA,CAAWW,CAAc,EAEjD,OACE,EAAAD,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,kBACZ,UAAA,EAAAA,EAAA,KAAA,CAAC,IAAD,CACO,MACL,UAAW,CAAC,mBAAoBgB,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EACnE,cAAaQ,GAAY,IAAA,GACzB,eAAcA,EAAW,OAAS,IAAA,GAClC,MAAOf,EAAcM,EAAQ,IAAA,GAC7B,GAAIV,EANN,SAAA,EAQE,EAAAL,EAAA,IAAA,CAACJ,EAAAA,EAAD,CAAM,KAAM6B,CAAO,CAAA,EAClB,CAAChB,IAAe,EAAAT,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,oBAAqB,SAAAe,CAAY,CAAA,EACjE,CAACN,GAAeiB,IAAS,EAAA1B,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,oBAAqB,SAAA0B,CAAY,CAAA,EAC1EjB,IAAe,EAAAT,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,iBAAkB,SAAAe,CAAY,CAAA,CAC7D,C,EACD,CAAA,CAER,CACF,EAOaY,GAAA,EAAgBpC,EAAAA,WAAAA,CAC3B,SAAuB,CAAE,YAAW,WAAU,GAAGc,GAAQ,EAAK,CAC5D,OACE,EAAAL,EAAA,IAAA,CAAC,MAAD,CACO,MACL,UAAW,CAAC,qBAAsBgB,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EACrE,GAAIX,EAEH,UACE,CAAA,CAET,CACF,E"}
1
+ {"version":3,"file":"index.cjs","names":["createContext","useContext","forwardRef","useState","useCallback","useMemo","Button","Icon","require_Icon","require_components_Button_index","react","react_jsx_runtime","SideNavContext","useSideNavCollapsed","SideNav","controlled","rest","uncontrolled","setUncontrolled","defaultCollapsed","isCollapsed","toggle","next","onCollapsedChange","value","SideNavToggleContext","label","className","SideNavHeader","mark","title","children","isCollapsible","SideNavSection","SideNavItem","isActive","icon","badge","SideNavFooter"],"sources":["../../../src/components/SideNav/index.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useState,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\ninterface SideNavContextValue {\n isCollapsed: boolean;\n}\n\nconst SideNavContext = createContext<SideNavContextValue>({ isCollapsed: false });\n\n/** Read the rail's collapsed state from anything rendered inside it. */\nexport function useSideNavCollapsed(): boolean {\n return useContext(SideNavContext).isCollapsed;\n}\n\nexport interface SideNavProps extends HTMLAttributes<HTMLElement> {\n /** Controlled collapsed state. Omit to let the rail own it. */\n isCollapsed?: boolean;\n /** Initial state when uncontrolled. */\n defaultCollapsed?: boolean;\n /** Fired by the header's collapse toggle. */\n onCollapsedChange?: (isCollapsed: boolean) => void;\n /** Accessible name for the landmark. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * The primary rail: one heavy edge against the page, hairline rules between\n * sections. Collapsed it keeps the icons and drops the words — the width is a\n * token, so every rail in the product collapses to the same measure.\n */\nexport const SideNav = forwardRef<HTMLElement, SideNavProps>(function SideNav(\n {\n isCollapsed: controlled,\n defaultCollapsed = false,\n onCollapsedChange,\n label = \"Main\",\n className,\n children,\n ...rest\n },\n ref,\n) {\n const [uncontrolled, setUncontrolled] = useState(defaultCollapsed);\n const isCollapsed = controlled ?? uncontrolled;\n\n const toggle = useCallback(() => {\n const next = !isCollapsed;\n if (controlled === undefined) setUncontrolled(next);\n onCollapsedChange?.(next);\n }, [controlled, isCollapsed, onCollapsedChange]);\n\n const value = useMemo(() => ({ isCollapsed }), [isCollapsed]);\n\n return (\n <SideNavContext.Provider value={value}>\n <SideNavToggleContext.Provider value={toggle}>\n <nav\n ref={ref}\n aria-label={label}\n data-collapsed={isCollapsed || undefined}\n className={[\"ds-sidenav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </nav>\n </SideNavToggleContext.Provider>\n </SideNavContext.Provider>\n );\n});\n\nconst SideNavToggleContext = createContext<() => void>(() => {});\n\nexport interface SideNavHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Shown when the rail is open; hidden when it collapses. */\n title?: ReactNode;\n /** A mark that survives the collapse — a logo, a monogram. */\n mark?: ReactNode;\n /** Set false when the rail is permanently open. */\n isCollapsible?: boolean;\n children?: ReactNode;\n}\n\n/** Brand block plus the collapse toggle, above the first hairline rule. */\nexport const SideNavHeader = forwardRef<HTMLDivElement, SideNavHeaderProps>(function SideNavHeader(\n { title, mark, isCollapsible = true, className, children, ...rest },\n ref,\n) {\n const { isCollapsed } = useContext(SideNavContext);\n const toggle = useContext(SideNavToggleContext);\n\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__header\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {mark && <span className=\"ds-sidenav__mark\">{mark}</span>}\n {!isCollapsed && (title || children) && (\n <span className=\"ds-sidenav__title\">{title ?? children}</span>\n )}\n {isCollapsible && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart={isCollapsed ? \"chevrons-right\" : \"chevrons-left\"}\n className=\"ds-sidenav__toggle\"\n aria-label={isCollapsed ? \"Expand navigation\" : \"Collapse navigation\"}\n aria-expanded={!isCollapsed}\n title={isCollapsed ? \"Expand navigation\" : \"Collapse navigation\"}\n onClick={toggle}\n />\n )}\n </div>\n );\n});\n\nexport interface SideNavSectionProps extends HTMLAttributes<HTMLDivElement> {\n /** Section label. Hidden — but still announced — when collapsed. */\n label?: string;\n children?: ReactNode;\n}\n\n/** A group of items under one label, separated by a hairline rule. */\nexport const SideNavSection = forwardRef<HTMLDivElement, SideNavSectionProps>(\n function SideNavSection({ label, className, children, ...rest }, ref) {\n const { isCollapsed } = useContext(SideNavContext);\n\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__section\", className].filter(Boolean).join(\" \")}\n aria-label={label}\n role={label ? \"group\" : undefined}\n {...rest}\n >\n {label && !isCollapsed && <span className=\"ds-sidenav__section-label\">{label}</span>}\n <ul className=\"ds-sidenav__list\">{children}</ul>\n </div>\n );\n },\n);\n\nexport interface SideNavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n icon: IconName;\n /** The words. Kept in the accessible name even when the rail is collapsed. */\n label: string;\n isActive?: boolean;\n /** A count or status pill at the end of the row. Hidden when collapsed. */\n badge?: ReactNode;\n}\n\n/**\n * One destination. The active row carries the solid rail on its leading edge —\n * the same rail as a selected table row, so selection reads the same anywhere.\n */\nexport const SideNavItem = forwardRef<HTMLAnchorElement, SideNavItemProps>(function SideNavItem(\n { icon, label, isActive, badge, className, ...rest },\n ref,\n) {\n const { isCollapsed } = useContext(SideNavContext);\n\n return (\n <li className=\"ds-sidenav__row\">\n <a\n ref={ref}\n className={[\"ds-sidenav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n title={isCollapsed ? label : undefined}\n {...rest}\n >\n <Icon name={icon} />\n {!isCollapsed && <span className=\"ds-sidenav__label\">{label}</span>}\n {!isCollapsed && badge && <span className=\"ds-sidenav__badge\">{badge}</span>}\n {isCollapsed && <span className=\"ds-sidenav__sr\">{label}</span>}\n </a>\n </li>\n );\n});\n\nexport interface SideNavFooterProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/** The bottom band — account, theme, help. Above the page edge, under a rule. */\nexport const SideNavFooter = forwardRef<HTMLDivElement, SideNavFooterProps>(function SideNavFooter(\n { className, children, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__footer\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </div>\n );\n});\n"],"mappings":"A,4MAoBA,IAAMY,GAAA,EAAiBZ,EAAAA,cAAAA,CAAmC,CAAE,YAAa,EAAM,CAAC,EAGhF,SAAgBa,GAA+B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EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,gHAuBtB,CAAC;AAEH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iFAAiF;AACjF,eAAO,MAAM,aAAa,+GAaxB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-CGY1FNXT.js";
1
+ import { t as e } from "../../chunks/Icon-ByUB0L1a.js";
2
2
  import { Button as t } from "../Button/index.js";
3
3
  import { createContext as n, forwardRef as r, useCallback as i, useContext as a, useMemo as o, useState as s } from "react";
4
4
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Icon","SideNavContext","createContext","useSideNavCollapsed","useContext","SideNav","forwardRef","controlled","rest","uncontrolled","setUncontrolled","useState","defaultCollapsed","isCollapsed","toggle","useCallback","next","onCollapsedChange","value","useMemo","SideNavToggleContext","label","className","SideNavHeader","mark","title","children","isCollapsible","Button","SideNavSection","SideNavItem","isActive","icon","badge","SideNavFooter"],"sources":["../../../src/components/SideNav/index.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useState,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\ninterface SideNavContextValue {\n isCollapsed: boolean;\n}\n\nconst SideNavContext = createContext<SideNavContextValue>({ isCollapsed: false });\n\n/** Read the rail's collapsed state from anything rendered inside it. */\nexport function useSideNavCollapsed(): boolean {\n return useContext(SideNavContext).isCollapsed;\n}\n\nexport interface SideNavProps extends HTMLAttributes<HTMLElement> {\n /** Controlled collapsed state. Omit to let the rail own it. */\n isCollapsed?: boolean;\n /** Initial state when uncontrolled. */\n defaultCollapsed?: boolean;\n /** Fired by the header's collapse toggle. */\n onCollapsedChange?: (isCollapsed: boolean) => void;\n /** Accessible name for the landmark. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * The primary rail: one heavy edge against the page, hairline rules between\n * sections. Collapsed it keeps the icons and drops the words — the width is a\n * token, so every rail in the product collapses to the same measure.\n */\nexport const SideNav = forwardRef<HTMLElement, SideNavProps>(function SideNav(\n {\n isCollapsed: controlled,\n defaultCollapsed = false,\n onCollapsedChange,\n label = \"Main\",\n className,\n children,\n ...rest\n },\n ref,\n) {\n const [uncontrolled, setUncontrolled] = useState(defaultCollapsed);\n const isCollapsed = controlled ?? uncontrolled;\n\n const toggle = useCallback(() => {\n const next = !isCollapsed;\n if (controlled === undefined) setUncontrolled(next);\n onCollapsedChange?.(next);\n }, [controlled, isCollapsed, onCollapsedChange]);\n\n const value = useMemo(() => ({ isCollapsed }), [isCollapsed]);\n\n return (\n <SideNavContext.Provider value={value}>\n <SideNavToggleContext.Provider value={toggle}>\n <nav\n ref={ref}\n aria-label={label}\n data-collapsed={isCollapsed || undefined}\n className={[\"ds-sidenav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </nav>\n </SideNavToggleContext.Provider>\n </SideNavContext.Provider>\n );\n});\n\nconst SideNavToggleContext = createContext<() => void>(() => {});\n\nexport interface SideNavHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Shown when the rail is open; hidden when it collapses. */\n title?: ReactNode;\n /** A mark that survives the collapse — a logo, a monogram. */\n mark?: ReactNode;\n /** Set false when the rail is permanently open. */\n isCollapsible?: boolean;\n children?: ReactNode;\n}\n\n/** Brand block plus the collapse toggle, above the first hairline rule. */\nexport const SideNavHeader = forwardRef<HTMLDivElement, SideNavHeaderProps>(\n function SideNavHeader({ title, mark, isCollapsible = true, className, children, ...rest }, ref) {\n const { isCollapsed } = useContext(SideNavContext);\n const toggle = useContext(SideNavToggleContext);\n\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__header\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {mark && <span className=\"ds-sidenav__mark\">{mark}</span>}\n {!isCollapsed && (title || children) && (\n <span className=\"ds-sidenav__title\">{title ?? children}</span>\n )}\n {isCollapsible && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart={isCollapsed ? \"chevrons-right\" : \"chevrons-left\"}\n className=\"ds-sidenav__toggle\"\n aria-label={isCollapsed ? \"Expand navigation\" : \"Collapse navigation\"}\n aria-expanded={!isCollapsed}\n title={isCollapsed ? \"Expand navigation\" : \"Collapse navigation\"}\n onClick={toggle}\n />\n )}\n </div>\n );\n },\n);\n\nexport interface SideNavSectionProps extends HTMLAttributes<HTMLDivElement> {\n /** Section label. Hidden — but still announced — when collapsed. */\n label?: string;\n children?: ReactNode;\n}\n\n/** A group of items under one label, separated by a hairline rule. */\nexport const SideNavSection = forwardRef<HTMLDivElement, SideNavSectionProps>(\n function SideNavSection({ label, className, children, ...rest }, ref) {\n const { isCollapsed } = useContext(SideNavContext);\n\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__section\", className].filter(Boolean).join(\" \")}\n aria-label={label}\n role={label ? \"group\" : undefined}\n {...rest}\n >\n {label && !isCollapsed && <span className=\"ds-sidenav__section-label\">{label}</span>}\n <ul className=\"ds-sidenav__list\">{children}</ul>\n </div>\n );\n },\n);\n\nexport interface SideNavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n icon: IconName;\n /** The words. Kept in the accessible name even when the rail is collapsed. */\n label: string;\n isActive?: boolean;\n /** A count or status pill at the end of the row. Hidden when collapsed. */\n badge?: ReactNode;\n}\n\n/**\n * One destination. The active row carries the solid rail on its leading edge —\n * the same rail as a selected table row, so selection reads the same anywhere.\n */\nexport const SideNavItem = forwardRef<HTMLAnchorElement, SideNavItemProps>(\n function SideNavItem({ icon, label, isActive, badge, className, ...rest }, ref) {\n const { isCollapsed } = useContext(SideNavContext);\n\n return (\n <li className=\"ds-sidenav__row\">\n <a\n ref={ref}\n className={[\"ds-sidenav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n title={isCollapsed ? label : undefined}\n {...rest}\n >\n <Icon name={icon} />\n {!isCollapsed && <span className=\"ds-sidenav__label\">{label}</span>}\n {!isCollapsed && badge && <span className=\"ds-sidenav__badge\">{badge}</span>}\n {isCollapsed && <span className=\"ds-sidenav__sr\">{label}</span>}\n </a>\n </li>\n );\n },\n);\n\nexport interface SideNavFooterProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/** The bottom band — account, theme, help. Above the page edge, under a rule. */\nexport const SideNavFooter = forwardRef<HTMLDivElement, SideNavFooterProps>(\n function SideNavFooter({ className, children, ...rest }, ref) {\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__footer\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n"],"mappings":";;;;;AAoBA,IAAMC,IAAiBC,EAAmC,EAAE,aAAa,GAAM,CAAC;AAGhF,SAAgBC,IAA+B;CAC7C,OAAOC,EAAWH,CAAc,CAAC,CAAC;AACpC;AAmBA,IAAaI,IAAUC,EAAsC,SAC3D,EACE,aAAaC,GACb,sBAAmB,IACnB,sBACA,WAAQ,QACR,cACA,aACA,GAAGC,KAEL,GACA;CACA,IAAM,CAACC,GAAcC,KAAmBC,EAASC,CAAgB,GAC3DC,IAAcN,KAAcE,GAE5BK,IAASC,QAAkB;EAC/B,IAAMC,IAAO,CAACH;EAEd,AADIN,MAAe,KAAA,KAAWG,EAAgBM,CAAI,GAClDC,IAAoBD,CAAI;CAC1B,GAAG;EAACT;EAAYM;EAAaI;CAAiB,CAAC,GAEzCC,IAAQC,SAAe,EAAE,eAAY,IAAI,CAACN,CAAW,C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AC,CAAC,KAAK,GAAG;EACtE,cAAYD;EACZ,MAAMA,IAAQ,UAAU,KAAA;EACxB,GAAIb;EALN,UAAA,CAOGa,KAAS,CAACR,KAAe,kBAAC,QAAD;GAAM,WAAU;GAA6B,UAAAQ;EAAY,CAAA,GACnF,kBAAC,MAAD;GAAI,WAAU;GAAoB;EAAa,CAAA,CAC5C;;AAET,CACF,GAeaS,IAAcxB,EACzB,SAAqB,EAAE,SAAM,UAAO,aAAU,UAAO,cAAW,GAAGE,KAAQ,GAAK;CAC9E,IAAM,EAAE,mBAAgBJ,EAAWH,CAAc;CAEjD,OACE,kBAAC,MAAD;EAAI,WAAU;EACZ,UAAA,kBAAC,KAAD;GACO;GACL,WAAW,CAAC,oBAAoBqB,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GACnE,eAAaS,KAAY,KAAA;GACzB,gBAAcA,IAAW,SAAS,KAAA;GAClC,OAAOlB,IAAcQ,IAAQ,KAAA;GAC7B,GAAIb;GANN,UAAA;IAQE,kBAACR,GAAD,EAAM,MAAMgC,EAAO,CAAA;IAClB,CAACnB,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAqB,UAAAQ;IAAY,CAAA;IACjE,CAACR,KAAeoB,KAAS,kBAAC,QAAD;KAAM,WAAU;KAAqB,UAAAA;IAAY,CAAA;IAC1EpB,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAkB,UAAAQ;IAAY,CAAA;GAC7D;;CACD,CAAA;AAER,CACF,GAOaa,IAAgB5B,EAC3B,SAAuB,EAAE,cAAW,aAAU,GAAGE,KAAQ,GAAK;CAC5D,OACE,kBAAC,OAAD;EACO;EACL,WAAW,CAAC,sBAAsBc,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACrE,GAAId;EAEH;CACE,CAAA;AAET,CACF"}
1
+ {"version":3,"file":"index.js","names":["Icon","SideNavContext","createContext","useSideNavCollapsed","useContext","SideNav","forwardRef","controlled","rest","uncontrolled","setUncontrolled","useState","defaultCollapsed","isCollapsed","toggle","useCallback","next","onCollapsedChange","value","useMemo","SideNavToggleContext","label","className","SideNavHeader","mark","title","children","isCollapsible","Button","SideNavSection","SideNavItem","isActive","icon","badge","SideNavFooter"],"sources":["../../../src/components/SideNav/index.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useState,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\ninterface SideNavContextValue {\n isCollapsed: boolean;\n}\n\nconst SideNavContext = createContext<SideNavContextValue>({ isCollapsed: false });\n\n/** Read the rail's collapsed state from anything rendered inside it. */\nexport function useSideNavCollapsed(): boolean {\n return useContext(SideNavContext).isCollapsed;\n}\n\nexport interface SideNavProps extends HTMLAttributes<HTMLElement> {\n /** Controlled collapsed state. Omit to let the rail own it. */\n isCollapsed?: boolean;\n /** Initial state when uncontrolled. */\n defaultCollapsed?: boolean;\n /** Fired by the header's collapse toggle. */\n onCollapsedChange?: (isCollapsed: boolean) => void;\n /** Accessible name for the landmark. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * The primary rail: one heavy edge against the page, hairline rules between\n * sections. Collapsed it keeps the icons and drops the words — the width is a\n * token, so every rail in the product collapses to the same measure.\n */\nexport const SideNav = forwardRef<HTMLElement, SideNavProps>(function SideNav(\n {\n isCollapsed: controlled,\n defaultCollapsed = false,\n onCollapsedChange,\n label = \"Main\",\n className,\n children,\n ...rest\n },\n ref,\n) {\n const [uncontrolled, setUncontrolled] = useState(defaultCollapsed);\n const isCollapsed = controlled ?? uncontrolled;\n\n const toggle = useCallback(() => {\n const next = !isCollapsed;\n if (controlled === undefined) setUncontrolled(next);\n onCollapsedChange?.(next);\n }, [controlled, isCollapsed, onCollapsedChange]);\n\n const value = useMemo(() => ({ isCollapsed }), [isCollapsed]);\n\n return (\n <SideNavContext.Provider value={value}>\n <SideNavToggleContext.Provider value={toggle}>\n <nav\n ref={ref}\n aria-label={label}\n data-collapsed={isCollapsed || undefined}\n className={[\"ds-sidenav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </nav>\n </SideNavToggleContext.Provider>\n </SideNavContext.Provider>\n );\n});\n\nconst SideNavToggleContext = createContext<() => void>(() => {});\n\nexport interface SideNavHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Shown when the rail is open; hidden when it collapses. */\n title?: ReactNode;\n /** A mark that survives the collapse — a logo, a monogram. */\n mark?: ReactNode;\n /** Set false when the rail is permanently open. */\n isCollapsible?: boolean;\n children?: ReactNode;\n}\n\n/** Brand block plus the collapse toggle, above the first hairline rule. */\nexport const SideNavHeader = forwardRef<HTMLDivElement, SideNavHeaderProps>(function SideNavHeader(\n { title, mark, isCollapsible = true, className, children, ...rest },\n ref,\n) {\n const { isCollapsed } = useContext(SideNavContext);\n const toggle = useContext(SideNavToggleContext);\n\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__header\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {mark && <span className=\"ds-sidenav__mark\">{mark}</span>}\n {!isCollapsed && (title || children) && (\n <span className=\"ds-sidenav__title\">{title ?? children}</span>\n )}\n {isCollapsible && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart={isCollapsed ? \"chevrons-right\" : \"chevrons-left\"}\n className=\"ds-sidenav__toggle\"\n aria-label={isCollapsed ? \"Expand navigation\" : \"Collapse navigation\"}\n aria-expanded={!isCollapsed}\n title={isCollapsed ? \"Expand navigation\" : \"Collapse navigation\"}\n onClick={toggle}\n />\n )}\n </div>\n );\n});\n\nexport interface SideNavSectionProps extends HTMLAttributes<HTMLDivElement> {\n /** Section label. Hidden — but still announced — when collapsed. */\n label?: string;\n children?: ReactNode;\n}\n\n/** A group of items under one label, separated by a hairline rule. */\nexport const SideNavSection = forwardRef<HTMLDivElement, SideNavSectionProps>(\n function SideNavSection({ label, className, children, ...rest }, ref) {\n const { isCollapsed } = useContext(SideNavContext);\n\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__section\", className].filter(Boolean).join(\" \")}\n aria-label={label}\n role={label ? \"group\" : undefined}\n {...rest}\n >\n {label && !isCollapsed && <span className=\"ds-sidenav__section-label\">{label}</span>}\n <ul className=\"ds-sidenav__list\">{children}</ul>\n </div>\n );\n },\n);\n\nexport interface SideNavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n icon: IconName;\n /** The words. Kept in the accessible name even when the rail is collapsed. */\n label: string;\n isActive?: boolean;\n /** A count or status pill at the end of the row. Hidden when collapsed. */\n badge?: ReactNode;\n}\n\n/**\n * One destination. The active row carries the solid rail on its leading edge —\n * the same rail as a selected table row, so selection reads the same anywhere.\n */\nexport const SideNavItem = forwardRef<HTMLAnchorElement, SideNavItemProps>(function SideNavItem(\n { icon, label, isActive, badge, className, ...rest },\n ref,\n) {\n const { isCollapsed } = useContext(SideNavContext);\n\n return (\n <li className=\"ds-sidenav__row\">\n <a\n ref={ref}\n className={[\"ds-sidenav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n title={isCollapsed ? label : undefined}\n {...rest}\n >\n <Icon name={icon} />\n {!isCollapsed && <span className=\"ds-sidenav__label\">{label}</span>}\n {!isCollapsed && badge && <span className=\"ds-sidenav__badge\">{badge}</span>}\n {isCollapsed && <span className=\"ds-sidenav__sr\">{label}</span>}\n </a>\n </li>\n );\n});\n\nexport interface SideNavFooterProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/** The bottom band — account, theme, help. Above the page edge, under a rule. */\nexport const SideNavFooter = forwardRef<HTMLDivElement, SideNavFooterProps>(function SideNavFooter(\n { className, children, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={[\"ds-sidenav__footer\", className].filter(Boolean).join(\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MgC,EAAO,CAAA;IAClB,CAACnB,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAqB,UAAAQ;IAAY,CAAA;IACjE,CAACR,KAAeoB,KAAS,kBAAC,QAAD;KAAM,WAAU;KAAqB,UAAAA;IAAY,CAAA;IAC1EpB,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAkB,UAAAQ;IAAY,CAAA;GAC7D;;CACD,CAAA;AAER,CAAC,GAOYa,IAAgB5B,EAA+C,SAC1E,EAAE,cAAW,aAAU,GAAGE,KAC1B,GACA;CACA,OACE,kBAAC,OAAD;EACO;EACL,WAAW,CAAC,sBAAsBc,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACrE,GAAId;EAEH;CACE,CAAA;AAET,CAAC"}
@@ -42,8 +42,13 @@
42
42
  text-overflow: ellipsis;
43
43
  }
44
44
 
45
- .ds-sidenav__toggle { margin-inline-start: auto; }
46
- .ds-sidenav[data-collapsed] .ds-sidenav__toggle { margin-inline-start: 0; }
45
+ .ds-sidenav__toggle {
46
+ margin-inline-start: auto;
47
+ }
48
+
49
+ .ds-sidenav[data-collapsed] .ds-sidenav__toggle {
50
+ margin-inline-start: 0;
51
+ }
47
52
 
48
53
  .ds-sidenav__section {
49
54
  padding-block: var(--space-3);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","react","react_jsx_runtime","Skeleton","rest","shape","className","size","width","style","SkeletonText","lines","i"],"sources":["../../../src/components/Skeleton/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport \"./style.css\";\n\nexport type SkeletonShape = \"text\" | \"heading\" | \"block\" | \"circle\";\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {\n shape?: SkeletonShape;\n /** Any CSS length or percentage. Defaults to filling its container. */\n width?: string;\n /** Only for `circle`, where width and height are the same value. */\n size?: string;\n}\n\n/**\n * A placeholder with the shape of the thing that is loading. Never a spinner\n * over a blank panel — the layout must not move when the content arrives.\n */\nexport const Skeleton = forwardRef<HTMLSpanElement, SkeletonProps>(function Skeleton(\n { shape = \"text\", width, size, className, style, ...rest },\n ref,\n) {\n return (\n <span\n ref={ref}\n aria-hidden=\"true\"\n data-shape={shape}\n className={[\"ds-skeleton\", className].filter(Boolean).join(\" \")}\n style={{\n inlineSize: shape === \"circle\" ? size : (width ?? \"100%\"),\n blockSize: shape === \"circle\" ? size : undefined,\n ...style,\n }}\n {...rest}\n />\n );\n});\n\nexport interface SkeletonTextProps extends HTMLAttributes<HTMLDivElement> {\n /** Number of lines; the last one renders short. */\n lines?: number;\n}\n\n/** A paragraph-shaped placeholder. Announced once, as busy, to screen readers. */\nexport const SkeletonText = forwardRef<HTMLDivElement, SkeletonTextProps>(\n function SkeletonText({ lines = 3, className, ...rest }, ref) {\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-busy=\"true\"\n aria-label=\"Loading\"\n className={[\"ds-skeleton-lines\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {Array.from({ length: lines }, (_, i) => (\n <Skeleton\n key={i}\n style={{ animationDelay: `calc(var(--skeleton-stagger) * ${i})` }}\n />\n ))}\n </div>\n );\n },\n);\n"],"mappings":"A,yHAiBA,IAAaG,GAAA,EAAWH,EAAAA,WAAAA,CAA2C,SACjE,CAAE,QAAQ,OAAQ,QAAO,OAAM,YAAW,QAAO,GAAGI,GACpD,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,OAAD,CACO,MACL,cAAY,OACZ,aAAYG,EACZ,UAAW,CAAC,cAAeC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC9D,MAAO,CACL,WAAYD,IAAU,SAAWE,EAAQC,GAAS,OAClD,UAAWH,IAAU,SAAWE,EAAO,IAAA,GACvC,GAAGE,CACL,EACA,GAAIL,CACL,CAAA,CAEL,CAAC,EAQYM,GAAA,EAAeV,EAAAA,WAAAA,CAC1B,SAAsB,CAAE,QAAQ,EAAG,YAAW,GAAGI,GAAQ,EAAK,CAC5D,OACE,EAAAF,EAAA,IAAA,CAAC,MAAD,CACO,MACL,KAAK,SACL,YAAU,OACV,aAAW,UACX,UAAW,CAAC,oBAAqBI,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EACpE,GAAIF,EAEH,SAAA,MAAM,KAAK,CAAE,OAAQO,CAAM,GAAI,EAAG,KACjC,EAAAT,EAAA,IAAA,CAACC,EAAD,CAEE,MAAO,CAAE,eAAgB,kCAAkCS,EAAE,EAAG,CACjE,EAFMA,CAEN,CACF,CACE,CAAA,CAET,CACF,E"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","react","react_jsx_runtime","Skeleton","rest","shape","className","size","width","style","SkeletonText","lines","i"],"sources":["../../../src/components/Skeleton/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport \"./style.css\";\n\nexport type SkeletonShape = \"text\" | \"heading\" | \"block\" | \"circle\";\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {\n shape?: SkeletonShape;\n /** Any CSS length or percentage. Defaults to filling its container. */\n width?: string;\n /** Only for `circle`, where width and height are the same value. */\n size?: string;\n}\n\n/**\n * A placeholder with the shape of the thing that is loading. Never a spinner\n * over a blank panel — the layout must not move when the content arrives.\n */\nexport const Skeleton = forwardRef<HTMLSpanElement, SkeletonProps>(function Skeleton(\n { shape = \"text\", width, size, className, style, ...rest },\n ref,\n) {\n return (\n <span\n ref={ref}\n aria-hidden=\"true\"\n data-shape={shape}\n className={[\"ds-skeleton\", className].filter(Boolean).join(\" \")}\n style={{\n inlineSize: shape === \"circle\" ? size : (width ?? \"100%\"),\n blockSize: shape === \"circle\" ? size : undefined,\n ...style,\n }}\n {...rest}\n />\n );\n});\n\nexport interface SkeletonTextProps extends HTMLAttributes<HTMLDivElement> {\n /** Number of lines; the last one renders short. */\n lines?: number;\n}\n\n/** A paragraph-shaped placeholder. Announced once, as busy, to screen readers. */\nexport const SkeletonText = forwardRef<HTMLDivElement, SkeletonTextProps>(function SkeletonText(\n { lines = 3, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-busy=\"true\"\n aria-label=\"Loading\"\n className={[\"ds-skeleton-lines\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {Array.from({ length: lines }, (_, i) => (\n <Skeleton\n key={i}\n style={{ animationDelay: `calc(var(--skeleton-stagger) * ${i})` }}\n />\n ))}\n </div>\n );\n});\n"],"mappings":"A,yHAiBA,IAAaG,GAAA,EAAWH,EAAAA,WAAAA,CAA2C,SACjE,CAAE,QAAQ,OAAQ,QAAO,OAAM,YAAW,QAAO,GAAGI,GACpD,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,OAAD,CACO,MACL,cAAY,OACZ,aAAYG,EACZ,UAAW,CAAC,cAAeC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC9D,MAAO,CACL,WAAYD,IAAU,SAAWE,EAAQC,GAAS,OAClD,UAAWH,IAAU,SAAWE,EAAO,IAAA,GACvC,GAAGE,CACL,EACA,GAAIL,CACL,CAAA,CAEL,CAAC,EAQYM,GAAA,EAAeV,EAAAA,WAAAA,CAA8C,SACxE,CAAE,QAAQ,EAAG,YAAW,GAAGI,GAC3B,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,MAAD,CACO,MACL,KAAK,SACL,YAAU,OACV,aAAW,UACX,UAAW,CAAC,oBAAqBI,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EACpE,GAAIF,EAEH,SAAA,MAAM,KAAK,CAAE,OAAQO,CAAM,GAAI,EAAG,KACjC,EAAAT,EAAA,IAAA,CAACC,EAAD,CAEE,MAAO,CAAE,eAAgB,kCAAkCS,EAAE,EAAG,CACjE,EAFMA,CAEN,CACF,CACE,CAAA,CAET,CAAC,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Skeleton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,eAAe,CAAC;IACpE,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,2GAkBnB,CAAC;AAEH,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kFAAkF;AAClF,eAAO,MAAM,YAAY,8GAoBxB,CAAC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Skeleton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,eAAe,CAAC;IACpE,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,2GAkBnB,CAAC;AAEH,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kFAAkF;AAClF,eAAO,MAAM,YAAY,8GAqBvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Skeleton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,eAAe,CAAC;IACpE,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,2GAkBnB,CAAC;AAEH,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kFAAkF;AAClF,eAAO,MAAM,YAAY,8GAoBxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Skeleton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,eAAe,CAAC;IACpE,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,2GAkBnB,CAAC;AAEH,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kFAAkF;AAClF,eAAO,MAAM,YAAY,8GAqBvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Skeleton","forwardRef","rest","shape","className","size","width","style","SkeletonText","lines","i"],"sources":["../../../src/components/Skeleton/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport \"./style.css\";\n\nexport type SkeletonShape = \"text\" | \"heading\" | \"block\" | \"circle\";\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {\n shape?: SkeletonShape;\n /** Any CSS length or percentage. Defaults to filling its container. */\n width?: string;\n /** Only for `circle`, where width and height are the same value. */\n size?: string;\n}\n\n/**\n * A placeholder with the shape of the thing that is loading. Never a spinner\n * over a blank panel — the layout must not move when the content arrives.\n */\nexport const Skeleton = forwardRef<HTMLSpanElement, SkeletonProps>(function Skeleton(\n { shape = \"text\", width, size, className, style, ...rest },\n ref,\n) {\n return (\n <span\n ref={ref}\n aria-hidden=\"true\"\n data-shape={shape}\n className={[\"ds-skeleton\", className].filter(Boolean).join(\" \")}\n style={{\n inlineSize: shape === \"circle\" ? size : (width ?? \"100%\"),\n blockSize: shape === \"circle\" ? size : undefined,\n ...style,\n }}\n {...rest}\n />\n );\n});\n\nexport interface SkeletonTextProps extends HTMLAttributes<HTMLDivElement> {\n /** Number of lines; the last one renders short. */\n lines?: number;\n}\n\n/** A paragraph-shaped placeholder. Announced once, as busy, to screen readers. */\nexport const SkeletonText = forwardRef<HTMLDivElement, SkeletonTextProps>(\n function SkeletonText({ lines = 3, className, ...rest }, ref) {\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-busy=\"true\"\n aria-label=\"Loading\"\n className={[\"ds-skeleton-lines\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {Array.from({ length: lines }, (_, i) => (\n <Skeleton\n key={i}\n style={{ animationDelay: `calc(var(--skeleton-stagger) * ${i})` }}\n />\n ))}\n </div>\n );\n },\n);\n"],"mappings":";;;AAiBA,IAAaA,IAAWC,EAA2C,SACjE,EAAE,WAAQ,QAAQ,UAAO,SAAM,cAAW,UAAO,GAAGC,KACpD,GACA;CACA,OACE,kBAAC,QAAD;EACO;EACL,eAAY;EACZ,cAAYC;EACZ,WAAW,CAAC,eAAeC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC9D,OAAO;GACL,YAAYD,MAAU,WAAWE,IAAQC,KAAS;GAClD,WAAWH,MAAU,WAAWE,IAAO,KAAA;GACvC,GAAGE;EACL;EACA,GAAIL;CACL,CAAA;AAEL,CAAC,GAQYM,IAAeP,EAC1B,SAAsB,EAAE,WAAQ,GAAG,cAAW,GAAGC,KAAQ,GAAK;CAC5D,OACE,kBAAC,OAAD;EACO;EACL,MAAK;EACL,aAAU;EACV,cAAW;EACX,WAAW,CAAC,qBAAqBE,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACpE,GAAIF;EAEH,UAAA,MAAM,KAAK,EAAE,QAAQO,EAAM,IAAI,GAAG,MACjC,kBAACT,GAAD,EAEE,OAAO,EAAE,gBAAgB,kCAAkCU,EAAE,GAAG,EACjE,GAFMA,CAEN,CACF;CACE,CAAA;AAET,CACF"}
1
+ {"version":3,"file":"index.js","names":["Skeleton","forwardRef","rest","shape","className","size","width","style","SkeletonText","lines","i"],"sources":["../../../src/components/Skeleton/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport \"./style.css\";\n\nexport type SkeletonShape = \"text\" | \"heading\" | \"block\" | \"circle\";\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {\n shape?: SkeletonShape;\n /** Any CSS length or percentage. Defaults to filling its container. */\n width?: string;\n /** Only for `circle`, where width and height are the same value. */\n size?: string;\n}\n\n/**\n * A placeholder with the shape of the thing that is loading. Never a spinner\n * over a blank panel — the layout must not move when the content arrives.\n */\nexport const Skeleton = forwardRef<HTMLSpanElement, SkeletonProps>(function Skeleton(\n { shape = \"text\", width, size, className, style, ...rest },\n ref,\n) {\n return (\n <span\n ref={ref}\n aria-hidden=\"true\"\n data-shape={shape}\n className={[\"ds-skeleton\", className].filter(Boolean).join(\" \")}\n style={{\n inlineSize: shape === \"circle\" ? size : (width ?? \"100%\"),\n blockSize: shape === \"circle\" ? size : undefined,\n ...style,\n }}\n {...rest}\n />\n );\n});\n\nexport interface SkeletonTextProps extends HTMLAttributes<HTMLDivElement> {\n /** Number of lines; the last one renders short. */\n lines?: number;\n}\n\n/** A paragraph-shaped placeholder. Announced once, as busy, to screen readers. */\nexport const SkeletonText = forwardRef<HTMLDivElement, SkeletonTextProps>(function SkeletonText(\n { lines = 3, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-busy=\"true\"\n aria-label=\"Loading\"\n className={[\"ds-skeleton-lines\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {Array.from({ length: lines }, (_, i) => (\n <Skeleton\n key={i}\n style={{ animationDelay: `calc(var(--skeleton-stagger) * ${i})` }}\n />\n ))}\n </div>\n );\n});\n"],"mappings":";;;AAiBA,IAAaA,IAAWC,EAA2C,SACjE,EAAE,WAAQ,QAAQ,UAAO,SAAM,cAAW,UAAO,GAAGC,KACpD,GACA;CACA,OACE,kBAAC,QAAD;EACO;EACL,eAAY;EACZ,cAAYC;EACZ,WAAW,CAAC,eAAeC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC9D,OAAO;GACL,YAAYD,MAAU,WAAWE,IAAQC,KAAS;GAClD,WAAWH,MAAU,WAAWE,IAAO,KAAA;GACvC,GAAGE;EACL;EACA,GAAIL;CACL,CAAA;AAEL,CAAC,GAQYM,IAAeP,EAA8C,SACxE,EAAE,WAAQ,GAAG,cAAW,GAAGC,KAC3B,GACA;CACA,OACE,kBAAC,OAAD;EACO;EACL,MAAK;EACL,aAAU;EACV,cAAW;EACX,WAAW,CAAC,qBAAqBE,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACpE,GAAIF;EAEH,UAAA,MAAM,KAAK,EAAE,QAAQO,EAAM,IAAI,GAAG,MACjC,kBAACT,GAAD,EAEE,OAAO,EAAE,gBAAgB,kCAAkCU,EAAE,GAAG,EACjE,GAFMA,CAEN,CACF;CACE,CAAA;AAET,CAAC"}