@namroodinc/liquid-editorial 0.8.0 → 0.9.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 (267) hide show
  1. package/README.md +13 -7
  2. package/UPGRADING.md +142 -0
  3. package/dist/chunks/{Avatar-6t78C9Np.js → Avatar-BK8IdL5W.js} +2 -2
  4. package/dist/chunks/{Avatar-6t78C9Np.js.map → Avatar-BK8IdL5W.js.map} +1 -1
  5. package/dist/chunks/{Avatar-Cvj_DqG0.cjs → Avatar-DPnrvkwd.cjs} +2 -2
  6. package/dist/chunks/{Avatar-Cvj_DqG0.cjs.map → Avatar-DPnrvkwd.cjs.map} +1 -1
  7. package/dist/chunks/{CollectionView-B18Ihv7X.cjs → CollectionView-BNYx29b1.cjs} +2 -2
  8. package/dist/chunks/{CollectionView-B18Ihv7X.cjs.map → CollectionView-BNYx29b1.cjs.map} +1 -1
  9. package/dist/chunks/{CollectionView-C-SwkPWC.js → CollectionView-Vj84E26b.js} +2 -2
  10. package/dist/chunks/{CollectionView-C-SwkPWC.js.map → CollectionView-Vj84E26b.js.map} +1 -1
  11. package/dist/chunks/{ColourField-Dohdx7eW.cjs → ColourField-C1qjpIfB.cjs} +2 -2
  12. package/dist/chunks/{ColourField-Dohdx7eW.cjs.map → ColourField-C1qjpIfB.cjs.map} +1 -1
  13. package/dist/chunks/{ColourField-DzZ--mQZ.js → ColourField-Ce2oaVcd.js} +2 -2
  14. package/dist/chunks/{ColourField-DzZ--mQZ.js.map → ColourField-Ce2oaVcd.js.map} +1 -1
  15. package/dist/chunks/{DatePicker-Bjc4D8Kg.cjs → DatePicker-BCnzFJFF.cjs} +2 -2
  16. package/dist/chunks/{DatePicker-Bjc4D8Kg.cjs.map → DatePicker-BCnzFJFF.cjs.map} +1 -1
  17. package/dist/chunks/{DatePicker-DZVOtzoU.js → DatePicker-CnVmsCwO.js} +2 -2
  18. package/dist/chunks/{DatePicker-DZVOtzoU.js.map → DatePicker-CnVmsCwO.js.map} +1 -1
  19. package/dist/chunks/{Drawer-CcVF_p4b.cjs → Drawer-BDX9_qHA.cjs} +2 -2
  20. package/dist/chunks/Drawer-BDX9_qHA.cjs.map +1 -0
  21. package/dist/chunks/{Drawer-uhJvy3s9.js → Drawer-DTtgAZO2.js} +3 -3
  22. package/dist/chunks/Drawer-DTtgAZO2.js.map +1 -0
  23. package/dist/chunks/EntryPicker-Baqn0SQM.cjs +2 -0
  24. package/dist/chunks/EntryPicker-Baqn0SQM.cjs.map +1 -0
  25. package/dist/chunks/EntryPicker-DIYjKmBf.js +803 -0
  26. package/dist/chunks/EntryPicker-DIYjKmBf.js.map +1 -0
  27. package/dist/chunks/FormEditor-B7Pm_ZzT.cjs +2 -0
  28. package/dist/chunks/FormEditor-B7Pm_ZzT.cjs.map +1 -0
  29. package/dist/chunks/{FormEditor-D0J3JN-H.js → FormEditor-HqqFmu7s.js} +156 -150
  30. package/dist/chunks/FormEditor-HqqFmu7s.js.map +1 -0
  31. package/dist/chunks/{RichTextEditor-B6H6_3wk.js → RichTextEditor-CuZnjiy2.js} +86 -86
  32. package/dist/chunks/RichTextEditor-CuZnjiy2.js.map +1 -0
  33. package/dist/chunks/RichTextEditor-DcbLho2Q.cjs +2 -0
  34. package/dist/chunks/RichTextEditor-DcbLho2Q.cjs.map +1 -0
  35. package/dist/chunks/{dialogLabel-3EeaH1Zl.cjs → dialogLabel-2HRYMHbF.cjs} +2 -2
  36. package/dist/chunks/{dialogLabel-3EeaH1Zl.cjs.map → dialogLabel-2HRYMHbF.cjs.map} +1 -1
  37. package/dist/chunks/{dialogLabel-BjtTix5C.js → dialogLabel-D18maX-p.js} +2 -2
  38. package/dist/chunks/{dialogLabel-BjtTix5C.js.map → dialogLabel-D18maX-p.js.map} +1 -1
  39. package/dist/chunks/{frame-CycTDnzE.js → frame-CzadNYgy.js} +3 -3
  40. package/dist/chunks/{frame-CycTDnzE.js.map → frame-CzadNYgy.js.map} +1 -1
  41. package/dist/chunks/{frame-BtIh7K-M.cjs → frame-Mh99nmhR.cjs} +2 -2
  42. package/dist/chunks/{frame-BtIh7K-M.cjs.map → frame-Mh99nmhR.cjs.map} +1 -1
  43. package/dist/chunks/group-CJA3-3s5.js +35 -0
  44. package/dist/chunks/group-CJA3-3s5.js.map +1 -0
  45. package/dist/chunks/group-DRSLOsXu.cjs +2 -0
  46. package/dist/chunks/group-DRSLOsXu.cjs.map +1 -0
  47. package/dist/chunks/limit-BNo4dlRj.cjs +2 -0
  48. package/dist/chunks/limit-BNo4dlRj.cjs.map +1 -0
  49. package/dist/chunks/{limit-BHHST_0G.js → limit-s9zfxIMC.js} +5 -4
  50. package/dist/chunks/limit-s9zfxIMC.js.map +1 -0
  51. package/dist/chunks/overlayLayer-IuoPVwTO.js +158 -0
  52. package/dist/chunks/overlayLayer-IuoPVwTO.js.map +1 -0
  53. package/dist/chunks/overlayLayer-seJG-EFn.cjs +2 -0
  54. package/dist/chunks/overlayLayer-seJG-EFn.cjs.map +1 -0
  55. package/dist/chunks/useIsomorphicLayoutEffect-Bc9hxFMc.js +7 -0
  56. package/dist/chunks/useIsomorphicLayoutEffect-Bc9hxFMc.js.map +1 -0
  57. package/dist/chunks/useIsomorphicLayoutEffect-XM4Ot6x5.cjs +2 -0
  58. package/dist/chunks/useIsomorphicLayoutEffect-XM4Ot6x5.cjs.map +1 -0
  59. package/dist/chunks/{useLimit-WWWDacob.cjs → useLimit-CCv6sAUS.cjs} +2 -2
  60. package/dist/chunks/{useLimit-WWWDacob.cjs.map → useLimit-CCv6sAUS.cjs.map} +1 -1
  61. package/dist/chunks/{useLimit-C471qZ4H.js → useLimit-DZOKm4S_.js} +2 -2
  62. package/dist/chunks/{useLimit-C471qZ4H.js.map → useLimit-DZOKm4S_.js.map} +1 -1
  63. package/dist/chunks/{useTooltip-DtrE7QYu.cjs → useTooltip-BXAvQwt4.cjs} +2 -2
  64. package/dist/chunks/{useTooltip-DtrE7QYu.cjs.map → useTooltip-BXAvQwt4.cjs.map} +1 -1
  65. package/dist/chunks/{useTooltip-DajWQyNL.js → useTooltip-BrC7FdeH.js} +2 -2
  66. package/dist/chunks/{useTooltip-DajWQyNL.js.map → useTooltip-BrC7FdeH.js.map} +1 -1
  67. package/dist/components/AppShell/index.cjs +1 -1
  68. package/dist/components/AppShell/index.js +1 -1
  69. package/dist/components/Avatar/index.cjs +1 -1
  70. package/dist/components/Avatar/index.js +1 -1
  71. package/dist/components/Badge/style.css +1 -1
  72. package/dist/components/Choice/index.cjs +1 -1
  73. package/dist/components/Choice/index.cjs.map +1 -1
  74. package/dist/components/Choice/index.d.cts +13 -2
  75. package/dist/components/Choice/index.d.cts.map +1 -1
  76. package/dist/components/Choice/index.d.ts +13 -2
  77. package/dist/components/Choice/index.d.ts.map +1 -1
  78. package/dist/components/Choice/index.js +55 -35
  79. package/dist/components/Choice/index.js.map +1 -1
  80. package/dist/components/Choice/style.css +7 -2
  81. package/dist/components/CollectionView/index.cjs +1 -1
  82. package/dist/components/CollectionView/index.js +1 -1
  83. package/dist/components/ColourField/index.cjs +1 -1
  84. package/dist/components/ColourField/index.js +1 -1
  85. package/dist/components/DatePicker/index.cjs +1 -1
  86. package/dist/components/DatePicker/index.js +1 -1
  87. package/dist/components/Drawer/index.cjs +1 -1
  88. package/dist/components/Drawer/index.d.cts +4 -1
  89. package/dist/components/Drawer/index.d.cts.map +1 -1
  90. package/dist/components/Drawer/index.d.ts +4 -1
  91. package/dist/components/Drawer/index.d.ts.map +1 -1
  92. package/dist/components/Drawer/index.js +1 -1
  93. package/dist/components/Drawer/style.css +4 -1
  94. package/dist/components/EditLayout/index.cjs +1 -1
  95. package/dist/components/EditLayout/index.cjs.map +1 -1
  96. package/dist/components/EditLayout/index.d.cts.map +1 -1
  97. package/dist/components/EditLayout/index.d.ts.map +1 -1
  98. package/dist/components/EditLayout/index.js +62 -61
  99. package/dist/components/EditLayout/index.js.map +1 -1
  100. package/dist/components/EditLayout/style.css +12 -5
  101. package/dist/components/EntryPicker/blocked.d.cts +21 -0
  102. package/dist/components/EntryPicker/blocked.d.cts.map +1 -0
  103. package/dist/components/EntryPicker/blocked.d.ts +21 -0
  104. package/dist/components/EntryPicker/blocked.d.ts.map +1 -0
  105. package/dist/components/EntryPicker/dialog.d.cts +7 -3
  106. package/dist/components/EntryPicker/dialog.d.cts.map +1 -1
  107. package/dist/components/EntryPicker/dialog.d.ts +7 -3
  108. package/dist/components/EntryPicker/dialog.d.ts.map +1 -1
  109. package/dist/components/EntryPicker/index.cjs +1 -1
  110. package/dist/components/EntryPicker/index.d.cts.map +1 -1
  111. package/dist/components/EntryPicker/index.d.ts.map +1 -1
  112. package/dist/components/EntryPicker/index.js +1 -1
  113. package/dist/components/EntryPicker/item.d.cts +25 -1
  114. package/dist/components/EntryPicker/item.d.cts.map +1 -1
  115. package/dist/components/EntryPicker/item.d.ts +25 -1
  116. package/dist/components/EntryPicker/item.d.ts.map +1 -1
  117. package/dist/components/EntryPicker/limit.d.cts +25 -2
  118. package/dist/components/EntryPicker/limit.d.cts.map +1 -1
  119. package/dist/components/EntryPicker/limit.d.ts +25 -2
  120. package/dist/components/EntryPicker/limit.d.ts.map +1 -1
  121. package/dist/components/EntryPicker/results.d.cts +3 -4
  122. package/dist/components/EntryPicker/results.d.cts.map +1 -1
  123. package/dist/components/EntryPicker/results.d.ts +3 -4
  124. package/dist/components/EntryPicker/results.d.ts.map +1 -1
  125. package/dist/components/EntryPicker/selected-items.d.cts.map +1 -1
  126. package/dist/components/EntryPicker/selected-items.d.ts.map +1 -1
  127. package/dist/components/EntryPicker/style.css +79 -12
  128. package/dist/components/EntryPicker/types.d.cts +8 -0
  129. package/dist/components/EntryPicker/types.d.cts.map +1 -1
  130. package/dist/components/EntryPicker/types.d.ts +8 -0
  131. package/dist/components/EntryPicker/types.d.ts.map +1 -1
  132. package/dist/components/EntryPicker/use-picker-scroll.d.cts +14 -0
  133. package/dist/components/EntryPicker/use-picker-scroll.d.cts.map +1 -0
  134. package/dist/components/EntryPicker/use-picker-scroll.d.ts +14 -0
  135. package/dist/components/EntryPicker/use-picker-scroll.d.ts.map +1 -0
  136. package/dist/components/Field/group.d.cts +1 -1
  137. package/dist/components/Field/group.d.cts.map +1 -1
  138. package/dist/components/Field/group.d.ts +1 -1
  139. package/dist/components/Field/group.d.ts.map +1 -1
  140. package/dist/components/Field/index.cjs +1 -1
  141. package/dist/components/Field/index.js +1 -1
  142. package/dist/components/Field/types.d.cts +3 -1
  143. package/dist/components/Field/types.d.cts.map +1 -1
  144. package/dist/components/Field/types.d.ts +3 -1
  145. package/dist/components/Field/types.d.ts.map +1 -1
  146. package/dist/components/FieldAffix/index.cjs +1 -1
  147. package/dist/components/FieldAffix/index.cjs.map +1 -1
  148. package/dist/components/FieldAffix/index.d.cts.map +1 -1
  149. package/dist/components/FieldAffix/index.d.ts.map +1 -1
  150. package/dist/components/FieldAffix/index.js +2 -1
  151. package/dist/components/FieldAffix/index.js.map +1 -1
  152. package/dist/components/FormEditor/README.md +31 -10
  153. package/dist/components/FormEditor/index.cjs +1 -1
  154. package/dist/components/FormEditor/index.d.cts.map +1 -1
  155. package/dist/components/FormEditor/index.d.ts.map +1 -1
  156. package/dist/components/FormEditor/index.js +1 -1
  157. package/dist/components/FormEditor/model.d.cts +9 -2
  158. package/dist/components/FormEditor/model.d.cts.map +1 -1
  159. package/dist/components/FormEditor/model.d.ts +9 -2
  160. package/dist/components/FormEditor/model.d.ts.map +1 -1
  161. package/dist/components/ImageCropper/index.cjs +1 -1
  162. package/dist/components/ImageCropper/index.cjs.map +1 -1
  163. package/dist/components/ImageCropper/index.d.cts.map +1 -1
  164. package/dist/components/ImageCropper/index.d.ts.map +1 -1
  165. package/dist/components/ImageCropper/index.js +30 -29
  166. package/dist/components/ImageCropper/index.js.map +1 -1
  167. package/dist/components/LimitReading/index.cjs +1 -1
  168. package/dist/components/LimitReading/index.cjs.map +1 -1
  169. package/dist/components/LimitReading/index.d.cts +1 -1
  170. package/dist/components/LimitReading/index.d.cts.map +1 -1
  171. package/dist/components/LimitReading/index.d.ts +1 -1
  172. package/dist/components/LimitReading/index.d.ts.map +1 -1
  173. package/dist/components/LimitReading/index.js +19 -14
  174. package/dist/components/LimitReading/index.js.map +1 -1
  175. package/dist/components/LimitReading/limit.d.cts +3 -3
  176. package/dist/components/LimitReading/limit.d.cts.map +1 -1
  177. package/dist/components/LimitReading/limit.d.ts +3 -3
  178. package/dist/components/LimitReading/limit.d.ts.map +1 -1
  179. package/dist/components/LimitReading/types.d.cts +8 -0
  180. package/dist/components/LimitReading/types.d.cts.map +1 -1
  181. package/dist/components/LimitReading/types.d.ts +8 -0
  182. package/dist/components/LimitReading/types.d.ts.map +1 -1
  183. package/dist/components/Menu/index.cjs +1 -1
  184. package/dist/components/Menu/index.js +1 -1
  185. package/dist/components/Modal/index.cjs +1 -1
  186. package/dist/components/Modal/index.cjs.map +1 -1
  187. package/dist/components/Modal/index.d.cts +4 -1
  188. package/dist/components/Modal/index.d.cts.map +1 -1
  189. package/dist/components/Modal/index.d.ts +4 -1
  190. package/dist/components/Modal/index.d.ts.map +1 -1
  191. package/dist/components/Modal/index.js +5 -3
  192. package/dist/components/Modal/index.js.map +1 -1
  193. package/dist/components/Modal/style.css +4 -1
  194. package/dist/components/Popover/index.cjs +1 -1
  195. package/dist/components/Popover/index.js +1 -1
  196. package/dist/components/RichTextEditor/expansion.d.cts.map +1 -1
  197. package/dist/components/RichTextEditor/expansion.d.ts.map +1 -1
  198. package/dist/components/RichTextEditor/index.cjs +1 -1
  199. package/dist/components/RichTextEditor/index.js +1 -1
  200. package/dist/components/SearchField/index.cjs +1 -1
  201. package/dist/components/SearchField/index.js +1 -1
  202. package/dist/components/Select/index.cjs +1 -1
  203. package/dist/components/Select/index.js +1 -1
  204. package/dist/components/SelectionCard/index.cjs +1 -1
  205. package/dist/components/SelectionCard/index.js +1 -1
  206. package/dist/components/SortableList/index.cjs +1 -1
  207. package/dist/components/SortableList/index.cjs.map +1 -1
  208. package/dist/components/SortableList/index.d.cts +2 -0
  209. package/dist/components/SortableList/index.d.cts.map +1 -1
  210. package/dist/components/SortableList/index.d.ts +2 -0
  211. package/dist/components/SortableList/index.d.ts.map +1 -1
  212. package/dist/components/SortableList/index.js +14 -13
  213. package/dist/components/SortableList/index.js.map +1 -1
  214. package/dist/components/SubNav/index.cjs +1 -1
  215. package/dist/components/SubNav/index.cjs.map +1 -1
  216. package/dist/components/SubNav/index.d.cts.map +1 -1
  217. package/dist/components/SubNav/index.d.ts.map +1 -1
  218. package/dist/components/SubNav/index.js +40 -31
  219. package/dist/components/SubNav/index.js.map +1 -1
  220. package/dist/components/SubNav/style.css +0 -14
  221. package/dist/components/TagsInput/index.cjs +1 -1
  222. package/dist/components/TagsInput/index.js +1 -1
  223. package/dist/components/TextField/index.cjs +1 -1
  224. package/dist/components/TextField/index.js +1 -1
  225. package/dist/components/Time/index.cjs +1 -1
  226. package/dist/components/Time/index.js +1 -1
  227. package/dist/index.cjs +1 -1
  228. package/dist/index.d.cts +1 -1
  229. package/dist/index.d.cts.map +1 -1
  230. package/dist/index.d.ts +1 -1
  231. package/dist/index.d.ts.map +1 -1
  232. package/dist/index.js +15 -15
  233. package/dist/internal/portalScope.d.cts.map +1 -1
  234. package/dist/internal/portalScope.d.ts.map +1 -1
  235. package/dist/internal/useIsomorphicLayoutEffect.d.cts +7 -0
  236. package/dist/internal/useIsomorphicLayoutEffect.d.cts.map +1 -0
  237. package/dist/internal/useIsomorphicLayoutEffect.d.ts +7 -0
  238. package/dist/internal/useIsomorphicLayoutEffect.d.ts.map +1 -0
  239. package/dist/internal/useLatest.d.cts.map +1 -1
  240. package/dist/internal/useLatest.d.ts.map +1 -1
  241. package/dist/internal/useModalDialog.d.cts.map +1 -1
  242. package/dist/internal/useModalDialog.d.ts.map +1 -1
  243. package/dist/tokens.css +1 -0
  244. package/package.json +1 -1
  245. package/dist/chunks/Drawer-CcVF_p4b.cjs.map +0 -1
  246. package/dist/chunks/Drawer-uhJvy3s9.js.map +0 -1
  247. package/dist/chunks/EntryPicker-CBquan7o.js +0 -685
  248. package/dist/chunks/EntryPicker-CBquan7o.js.map +0 -1
  249. package/dist/chunks/EntryPicker-Dq72wjTt.cjs +0 -2
  250. package/dist/chunks/EntryPicker-Dq72wjTt.cjs.map +0 -1
  251. package/dist/chunks/FormEditor-CTcnpR51.cjs +0 -2
  252. package/dist/chunks/FormEditor-CTcnpR51.cjs.map +0 -1
  253. package/dist/chunks/FormEditor-D0J3JN-H.js.map +0 -1
  254. package/dist/chunks/RichTextEditor-B6H6_3wk.js.map +0 -1
  255. package/dist/chunks/RichTextEditor-BIopdEDA.cjs +0 -2
  256. package/dist/chunks/RichTextEditor-BIopdEDA.cjs.map +0 -1
  257. package/dist/chunks/group-67F_I1yw.js +0 -34
  258. package/dist/chunks/group-67F_I1yw.js.map +0 -1
  259. package/dist/chunks/group-BSJHLagi.cjs +0 -2
  260. package/dist/chunks/group-BSJHLagi.cjs.map +0 -1
  261. package/dist/chunks/limit-BBnpe9o9.cjs +0 -2
  262. package/dist/chunks/limit-BBnpe9o9.cjs.map +0 -1
  263. package/dist/chunks/limit-BHHST_0G.js.map +0 -1
  264. package/dist/chunks/overlayLayer-BgnMskpk.js +0 -158
  265. package/dist/chunks/overlayLayer-BgnMskpk.js.map +0 -1
  266. package/dist/chunks/overlayLayer-YVudmo27.cjs +0 -2
  267. package/dist/chunks/overlayLayer-YVudmo27.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useLimit-WWWDacob.cjs","names":["useContext","FieldFrameContext","useId","useMemo","usableLimit","require_context","require_limit","react","useLimitReport","frame","key","reportLimit","binding","report","limit","useReportedLimit","count","max","useTextLimit","controlledLength","value","input","inputRef","maxLength","observeText","defaultValue","timer","onReset","event","read","owner","restoreValue","interceptValueWrites","own","accessor","get","set","isActive","wrapper","next","onWrite"],"sources":["../../src/components/Field/useLimit.ts"],"sourcesContent":["import { useContext, useEffect, useId, useMemo, type RefObject } from \"react\";\nimport { FieldFrameContext } from \"./context\";\nimport { usableLimit } from \"./limit\";\nimport type { FieldBinding, FieldLimit } from \"./types\";\n\ntype ReportLimit = (limit: FieldLimit | undefined) => void;\ntype TextControl = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * A control reports only to the Field it is explicitly bound to, and only while\n * that Field has no explicit limit. Each control owns one keyed report, removed\n * on unmount or rebinding without disturbing another control's report.\n */\nfunction useLimitReport(binding: FieldBinding): ReportLimit | undefined {\n const frame = useContext(FieldFrameContext);\n const key = useId();\n const reportLimit =\n frame && binding[\"aria-labelledby\"] === frame.labelId ? frame.reportLimit : undefined;\n const report = useMemo<ReportLimit | undefined>(\n () => reportLimit && ((limit) => reportLimit(key, usableLimit(limit) ? limit : undefined)),\n [reportLimit, key],\n );\n useEffect(() => () => report?.(undefined), [report]);\n return report;\n}\n\n/** Report a limit derived during render, such as committed tags or selected entries. */\nexport function useReportedLimit(binding: FieldBinding, limit: FieldLimit | null | undefined) {\n const report = useLimitReport(binding);\n const count = limit?.count;\n const max = limit?.max;\n useEffect(() => {\n report?.(count === undefined || max === undefined ? undefined : { count, max });\n }, [report, count, max]);\n}\n\ninterface TextLimitProps extends FieldBinding {\n maxLength?: number;\n value?: string | number | readonly string[] | null;\n defaultValue?: string | number | readonly string[] | null;\n}\n\n/**\n * Count a native text control for its bound Field. A controlled value is counted\n * from props; null is uncontrolled, as in React. An uncontrolled control is\n * observed only while a Field can show its count.\n */\nexport function useTextLimit(\n inputRef: RefObject<TextControl | null>,\n { value, defaultValue, maxLength, ...binding }: TextLimitProps,\n) {\n const report = useLimitReport(binding);\n const controlledLength = value == null ? undefined : String(value).length;\n // A new default changes an unedited control's value without any event.\n const defaultText = defaultValue == null ? \"\" : String(defaultValue);\n useEffect(() => {\n const input = inputRef.current;\n if (!report || !input) {\n return;\n }\n if (maxLength === undefined) {\n report(undefined);\n } else if (controlledLength !== undefined) {\n report({ count: controlledLength, max: maxLength });\n } else {\n return observeText(input, () => report({ count: input.value.length, max: maxLength }));\n }\n }, [inputRef, report, maxLength, controlledLength, defaultText]);\n}\n\n/**\n * Follow typing, autofill, programmatic writes and native resets without\n * replacing React's handlers or its value tracker.\n */\nfunction observeText(input: TextControl, read: () => void) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n // The reset event precedes the browser restoring the form's controls, and a\n // later listener may still cancel it, so read once the reset task completes.\n // The form owner is checked at event time so `form` attribute changes apply.\n const onReset = (event: Event) => {\n if (event.target === input.form) {\n clearTimeout(timer);\n timer = setTimeout(read);\n }\n };\n const owner = input.ownerDocument;\n const restoreValue = interceptValueWrites(input, read);\n input.addEventListener(\"input\", read);\n input.addEventListener(\"change\", read);\n owner.addEventListener(\"reset\", onReset, true);\n read();\n return () => {\n clearTimeout(timer);\n restoreValue();\n input.removeEventListener(\"input\", read);\n input.removeEventListener(\"change\", read);\n owner.removeEventListener(\"reset\", onReset, true);\n };\n}\n\n/**\n * Programmatic `value` writes (form libraries' setValue/reset) fire no events.\n * Wrap the instance accessor, chaining to whatever defines it now (React's\n * tracker), and restore that accessor when observation ends.\n */\nfunction interceptValueWrites(input: TextControl, onWrite: () => void) {\n const own = Object.getOwnPropertyDescriptor(input, \"value\");\n const accessor = own ?? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), \"value\");\n const get = accessor?.get;\n const set = accessor?.set;\n if (!get || !set || own?.configurable === false) {\n return () => {};\n }\n let isActive = true;\n const wrapper: PropertyDescriptor = {\n configurable: true,\n enumerable: accessor.enumerable,\n get(this: TextControl) {\n return get.call(this);\n },\n set(this: TextControl, next: string) {\n set.call(this, next);\n if (isActive) {\n onWrite();\n }\n },\n };\n Object.defineProperty(input, \"value\", wrapper);\n return () => {\n isActive = false;\n // Leave a later wrapper in place; it still chains through this inert one.\n if (Object.getOwnPropertyDescriptor(input, \"value\")?.set !== wrapper.set) {\n return;\n }\n if (own) {\n Object.defineProperty(input, \"value\", own);\n } else {\n Reflect.deleteProperty(input, \"value\");\n }\n };\n}\n"],"mappings":"A,mGAaA,SAASQ,EAAe,EAAgD,CACtE,I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useContext","FieldFrameContext","useId","useMemo","usableLimit","require_context","require_limit","react","useLimitReport","frame","key","reportLimit","binding","report","limit","useReportedLimit","count","max","useTextLimit","controlledLength","value","input","inputRef","maxLength","observeText","defaultValue","timer","onReset","event","read","owner","restoreValue","interceptValueWrites","own","accessor","get","set","isActive","wrapper","next","onWrite"],"sources":["../../src/components/Field/useLimit.ts"],"sourcesContent":["import { useContext, useEffect, useId, useMemo, type RefObject } from \"react\";\nimport { FieldFrameContext } from \"./context\";\nimport { usableLimit } from \"./limit\";\nimport type { FieldBinding, FieldLimit } from \"./types\";\n\ntype ReportLimit = (limit: FieldLimit | undefined) => void;\ntype TextControl = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * A control reports only to the Field it is explicitly bound to, and only while\n * that Field has no explicit limit. Each control owns one keyed report, removed\n * on unmount or rebinding without disturbing another control's report.\n */\nfunction useLimitReport(binding: FieldBinding): ReportLimit | undefined {\n const frame = useContext(FieldFrameContext);\n const key = useId();\n const reportLimit =\n frame && binding[\"aria-labelledby\"] === frame.labelId ? frame.reportLimit : undefined;\n const report = useMemo<ReportLimit | undefined>(\n () => reportLimit && ((limit) => reportLimit(key, usableLimit(limit) ? limit : undefined)),\n [reportLimit, key],\n );\n useEffect(() => () => report?.(undefined), [report]);\n return report;\n}\n\n/** Report a limit derived during render, such as committed tags or selected entries. */\nexport function useReportedLimit(binding: FieldBinding, limit: FieldLimit | null | undefined) {\n const report = useLimitReport(binding);\n const count = limit?.count;\n const max = limit?.max;\n useEffect(() => {\n report?.(count === undefined || max === undefined ? undefined : { count, max });\n }, [report, count, max]);\n}\n\ninterface TextLimitProps extends FieldBinding {\n maxLength?: number;\n value?: string | number | readonly string[] | null;\n defaultValue?: string | number | readonly string[] | null;\n}\n\n/**\n * Count a native text control for its bound Field. A controlled value is counted\n * from props; null is uncontrolled, as in React. An uncontrolled control is\n * observed only while a Field can show its count.\n */\nexport function useTextLimit(\n inputRef: RefObject<TextControl | null>,\n { value, defaultValue, maxLength, ...binding }: TextLimitProps,\n) {\n const report = useLimitReport(binding);\n const controlledLength = value == null ? undefined : String(value).length;\n // A new default changes an unedited control's value without any event.\n const defaultText = defaultValue == null ? \"\" : String(defaultValue);\n useEffect(() => {\n const input = inputRef.current;\n if (!report || !input) {\n return;\n }\n if (maxLength === undefined) {\n report(undefined);\n } else if (controlledLength !== undefined) {\n report({ count: controlledLength, max: maxLength });\n } else {\n return observeText(input, () => report({ count: input.value.length, max: maxLength }));\n }\n }, [inputRef, report, maxLength, controlledLength, defaultText]);\n}\n\n/**\n * Follow typing, autofill, programmatic writes and native resets without\n * replacing React's handlers or its value tracker.\n */\nfunction observeText(input: TextControl, read: () => void) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n // The reset event precedes the browser restoring the form's controls, and a\n // later listener may still cancel it, so read once the reset task completes.\n // The form owner is checked at event time so `form` attribute changes apply.\n const onReset = (event: Event) => {\n if (event.target === input.form) {\n clearTimeout(timer);\n timer = setTimeout(read);\n }\n };\n const owner = input.ownerDocument;\n const restoreValue = interceptValueWrites(input, read);\n input.addEventListener(\"input\", read);\n input.addEventListener(\"change\", read);\n owner.addEventListener(\"reset\", onReset, true);\n read();\n return () => {\n clearTimeout(timer);\n restoreValue();\n input.removeEventListener(\"input\", read);\n input.removeEventListener(\"change\", read);\n owner.removeEventListener(\"reset\", onReset, true);\n };\n}\n\n/**\n * Programmatic `value` writes (form libraries' setValue/reset) fire no events.\n * Wrap the instance accessor, chaining to whatever defines it now (React's\n * tracker), and restore that accessor when observation ends.\n */\nfunction interceptValueWrites(input: TextControl, onWrite: () => void) {\n const own = Object.getOwnPropertyDescriptor(input, \"value\");\n const accessor = own ?? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), \"value\");\n const get = accessor?.get;\n const set = accessor?.set;\n if (!get || !set || own?.configurable === false) {\n return () => {};\n }\n let isActive = true;\n const wrapper: PropertyDescriptor = {\n configurable: true,\n enumerable: accessor.enumerable,\n get(this: TextControl) {\n return get.call(this);\n },\n set(this: TextControl, next: string) {\n set.call(this, next);\n if (isActive) {\n onWrite();\n }\n },\n };\n Object.defineProperty(input, \"value\", wrapper);\n return () => {\n isActive = false;\n // Leave a later wrapper in place; it still chains through this inert one.\n if (Object.getOwnPropertyDescriptor(input, \"value\")?.set !== wrapper.set) {\n return;\n }\n if (own) {\n Object.defineProperty(input, \"value\", own);\n } else {\n Reflect.deleteProperty(input, \"value\");\n }\n };\n}\n"],"mappings":"A,mGAaA,SAASQ,EAAe,EAAgD,CACtE,IAAMC,GAAA,EAAQT,EAAAA,WAAAA,CAAWC,EAAAA,CAAiB,EACpCS,GAAA,EAAMR,EAAAA,MAAAA,CAAM,EACZS,EACJF,GAASG,EAAQ,qBAAuBH,EAAM,QAAUA,EAAM,YAAc,IAAA,GACxEI,GAAA,EAASV,EAAAA,QAAAA,KACPQ,IAAiB,GAAUA,EAAYD,EAAKN,EAAAA,EAAYU,CAAK,EAAIA,EAAQ,IAAA,EAAS,GACxF,CAACH,EAAaD,CAAG,CACnB,EAEA,OADA,EAAAH,EAAA,UAAA,SAAsBM,IAAS,IAAA,EAAS,EAAG,CAACA,CAAM,CAAC,EAC5CA,CACT,CAGA,SAAgBE,EAAiB,EAAuB,EAAsC,CAC5F,IAAMF,EAASL,EAAeI,CAAO,EAC/BI,EAAQF,GAAO,MACfG,EAAMH,GAAO,KACnB,EAAAP,EAAA,UAAA,KAAgB,CACdM,IAASG,IAAU,IAAA,IAAaC,IAAQ,IAAA,GAAY,IAAA,GAAY,CAAE,QAAO,KAAI,CAAC,CAChF,EAAG,CAACJ,EAAQG,EAAOC,CAAG,CAAC,CACzB,CAaA,SAAgBC,EACd,EACA,CAAE,QAAO,eAAc,YAAW,GAAGN,GACrC,CACA,IAAMC,EAASL,EAAeI,CAAO,EAC/BO,EAAmBC,GAAS,KAAO,IAAA,GAAY,OAAOA,CAAK,CAAC,CAAC,QAGnE,EAAAb,EAAA,UAAA,KAAgB,CACd,IAAMc,EAAQC,EAAS,QACvB,GAAKT,G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,KAAK,KAAMG,CAAI,EACfF,GACFG,EAAQ,CAEZ,CACF,EAEA,OADA,OAAO,eAAenB,EAAO,QAASiB,CAAO,MAChC,CACX,EAAW,GAEP,OAAO,yBAAyBjB,EAAO,OAAO,CAAC,EAAE,MAAQiB,EAAQ,MAGjEL,EACF,OAAO,eAAeZ,EAAO,QAASY,CAAG,EAEzC,QAAQ,eAAeZ,EAAO,OAAO,EAEzC,CACF,C"}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./context-CXvOl4Kt.js";
2
- import { r as t } from "./limit-BHHST_0G.js";
2
+ import { r as t } from "./limit-s9zfxIMC.js";
3
3
  import { useContext as n, useEffect as r, useId as i, useMemo as a } from "react";
4
4
  //#region src/components/Field/useLimit.ts
5
5
  function o(o) {
@@ -70,4 +70,4 @@ function u(e, t) {
70
70
  //#endregion
71
71
  export { c as n, s as t };
72
72
 
73
- //# sourceMappingURL=useLimit-C471qZ4H.js.map
73
+ //# sourceMappingURL=useLimit-DZOKm4S_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLimit-C471qZ4H.js","names":["FieldFrameContext","usableLimit","useLimitReport","frame","useContext","key","useId","reportLimit","binding","report","useMemo","limit","useEffect","useReportedLimit","count","max","useTextLimit","controlledLength","value","input","inputRef","maxLength","observeText","defaultValue","timer","onReset","event","read","owner","restoreValue","interceptValueWrites","own","accessor","get","set","isActive","wrapper","next","onWrite"],"sources":["../../src/components/Field/useLimit.ts"],"sourcesContent":["import { useContext, useEffect, useId, useMemo, type RefObject } from \"react\";\nimport { FieldFrameContext } from \"./context\";\nimport { usableLimit } from \"./limit\";\nimport type { FieldBinding, FieldLimit } from \"./types\";\n\ntype ReportLimit = (limit: FieldLimit | undefined) => void;\ntype TextControl = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * A control reports only to the Field it is explicitly bound to, and only while\n * that Field has no explicit limit. Each control owns one keyed report, removed\n * on unmount or rebinding without disturbing another control's report.\n */\nfunction useLimitReport(binding: FieldBinding): ReportLimit | undefined {\n const frame = useContext(FieldFrameContext);\n const key = useId();\n const reportLimit =\n frame && binding[\"aria-labelledby\"] === frame.labelId ? frame.reportLimit : undefined;\n const report = useMemo<ReportLimit | undefined>(\n () => reportLimit && ((limit) => reportLimit(key, usableLimit(limit) ? limit : undefined)),\n [reportLimit, key],\n );\n useEffect(() => () => report?.(undefined), [report]);\n return report;\n}\n\n/** Report a limit derived during render, such as committed tags or selected entries. */\nexport function useReportedLimit(binding: FieldBinding, limit: FieldLimit | null | undefined) {\n const report = useLimitReport(binding);\n const count = limit?.count;\n const max = limit?.max;\n useEffect(() => {\n report?.(count === undefined || max === undefined ? undefined : { count, max });\n }, [report, count, max]);\n}\n\ninterface TextLimitProps extends FieldBinding {\n maxLength?: number;\n value?: string | number | readonly string[] | null;\n defaultValue?: string | number | readonly string[] | null;\n}\n\n/**\n * Count a native text control for its bound Field. A controlled value is counted\n * from props; null is uncontrolled, as in React. An uncontrolled control is\n * observed only while a Field can show its count.\n */\nexport function useTextLimit(\n inputRef: RefObject<TextControl | null>,\n { value, defaultValue, maxLength, ...binding }: TextLimitProps,\n) {\n const report = useLimitReport(binding);\n const controlledLength = value == null ? undefined : String(value).length;\n // A new default changes an unedited control's value without any event.\n const defaultText = defaultValue == null ? \"\" : String(defaultValue);\n useEffect(() => {\n const input = inputRef.current;\n if (!report || !input) {\n return;\n }\n if (maxLength === undefined) {\n report(undefined);\n } else if (controlledLength !== undefined) {\n report({ count: controlledLength, max: maxLength });\n } else {\n return observeText(input, () => report({ count: input.value.length, max: maxLength }));\n }\n }, [inputRef, report, maxLength, controlledLength, defaultText]);\n}\n\n/**\n * Follow typing, autofill, programmatic writes and native resets without\n * replacing React's handlers or its value tracker.\n */\nfunction observeText(input: TextControl, read: () => void) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n // The reset event precedes the browser restoring the form's controls, and a\n // later listener may still cancel it, so read once the reset task completes.\n // The form owner is checked at event time so `form` attribute changes apply.\n const onReset = (event: Event) => {\n if (event.target === input.form) {\n clearTimeout(timer);\n timer = setTimeout(read);\n }\n };\n const owner = input.ownerDocument;\n const restoreValue = interceptValueWrites(input, read);\n input.addEventListener(\"input\", read);\n input.addEventListener(\"change\", read);\n owner.addEventListener(\"reset\", onReset, true);\n read();\n return () => {\n clearTimeout(timer);\n restoreValue();\n input.removeEventListener(\"input\", read);\n input.removeEventListener(\"change\", read);\n owner.removeEventListener(\"reset\", onReset, true);\n };\n}\n\n/**\n * Programmatic `value` writes (form libraries' setValue/reset) fire no events.\n * Wrap the instance accessor, chaining to whatever defines it now (React's\n * tracker), and restore that accessor when observation ends.\n */\nfunction interceptValueWrites(input: TextControl, onWrite: () => void) {\n const own = Object.getOwnPropertyDescriptor(input, \"value\");\n const accessor = own ?? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), \"value\");\n const get = accessor?.get;\n const set = accessor?.set;\n if (!get || !set || own?.configurable === false) {\n return () => {};\n }\n let isActive = true;\n const wrapper: PropertyDescriptor = {\n configurable: true,\n enumerable: accessor.enumerable,\n get(this: TextControl) {\n return get.call(this);\n },\n set(this: TextControl, next: string) {\n set.call(this, next);\n if (isActive) {\n onWrite();\n }\n },\n };\n Object.defineProperty(input, \"value\", wrapper);\n return () => {\n isActive = false;\n // Leave a later wrapper in place; it still chains through this inert one.\n if (Object.getOwnPropertyDescriptor(input, \"value\")?.set !== wrapper.set) {\n return;\n }\n if (own) {\n Object.defineProperty(input, \"value\", own);\n } else {\n Reflect.deleteProperty(input, \"value\");\n }\n };\n}\n"],"mappings":";;;;AAaA,SAASE,EAAe,GAAgD;CACtE,IAAMC,IAAQC,EAAWJ,CAAiB,GACpCK,IAAMC,EAAM,GACZC,IACJJ,KAASK,EAAQ,uBAAuBL,EAAM,UAAUA,EAAM,cAAc,KAAA,GACxEM,IAASC,QACPH,OAAiB,MAAUA,EAAYF,GAAKJ,EAAYU,CAAK,IAAIA,IAAQ,KAAA,CAAS,IACxF,CAACJ,GAAaF,CAAG,CACnB;CAEA,OADAO,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AAaH,CAAK,GAClBK,EAAa,GACbV,EAAM,oBAAoB,SAASQ,CAAI,GACvCR,EAAM,oBAAoB,UAAUQ,CAAI,GACxCC,EAAM,oBAAoB,SAASH,GAAS,EAAI;CAClD;AACF;AAOA,SAASK,EAAqB,GAAoB,GAAqB;CACrE,IAAMC,IAAM,OAAO,yBAAyBZ,GAAO,OAAO,GACpDa,IAAWD,KAAO,OAAO,yBAAyB,OAAO,eAAeZ,CAAK,GAAG,OAAO,GACvFc,IAAMD,GAAU,KAChBE,IAAMF,GAAU;CACtB,IAAI,CAACC,KAAO,CAACC,KAAOH,GAAK,iBAAiB,IACxC,aAAa,CAAC;CAEhB,IAAII,IAAW,IACTC,IAA8B;EAClC,cAAc;EACd,YAAYJ,EAAS;EACrB,MAAuB;GACrB,OAAOC,EAAI,KAAK,IAAI;EACtB;EACA,IAAuB,GAAc;GAEnC,AADAC,EAAI,KAAK,MAAMG,CAAI,GACfF,KACFG,EAAQ;EAEZ;CACF;CAEA,OADA,OAAO,eAAenB,GAAO,SAASiB,CAAO,SAChC;EAGX,AAFA,IAAW,IAEP,OAAO,yBAAyBjB,GAAO,OAAO,CAAC,EAAE,QAAQiB,EAAQ,QAGjEL,IACF,OAAO,eAAeZ,GAAO,SAASY,CAAG,IAEzC,QAAQ,eAAeZ,GAAO,OAAO;CAEzC;AACF"}
1
+ {"version":3,"file":"useLimit-DZOKm4S_.js","names":["FieldFrameContext","usableLimit","useLimitReport","frame","useContext","key","useId","reportLimit","binding","report","useMemo","limit","useEffect","useReportedLimit","count","max","useTextLimit","controlledLength","value","input","inputRef","maxLength","observeText","defaultValue","timer","onReset","event","read","owner","restoreValue","interceptValueWrites","own","accessor","get","set","isActive","wrapper","next","onWrite"],"sources":["../../src/components/Field/useLimit.ts"],"sourcesContent":["import { useContext, useEffect, useId, useMemo, type RefObject } from \"react\";\nimport { FieldFrameContext } from \"./context\";\nimport { usableLimit } from \"./limit\";\nimport type { FieldBinding, FieldLimit } from \"./types\";\n\ntype ReportLimit = (limit: FieldLimit | undefined) => void;\ntype TextControl = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * A control reports only to the Field it is explicitly bound to, and only while\n * that Field has no explicit limit. Each control owns one keyed report, removed\n * on unmount or rebinding without disturbing another control's report.\n */\nfunction useLimitReport(binding: FieldBinding): ReportLimit | undefined {\n const frame = useContext(FieldFrameContext);\n const key = useId();\n const reportLimit =\n frame && binding[\"aria-labelledby\"] === frame.labelId ? frame.reportLimit : undefined;\n const report = useMemo<ReportLimit | undefined>(\n () => reportLimit && ((limit) => reportLimit(key, usableLimit(limit) ? limit : undefined)),\n [reportLimit, key],\n );\n useEffect(() => () => report?.(undefined), [report]);\n return report;\n}\n\n/** Report a limit derived during render, such as committed tags or selected entries. */\nexport function useReportedLimit(binding: FieldBinding, limit: FieldLimit | null | undefined) {\n const report = useLimitReport(binding);\n const count = limit?.count;\n const max = limit?.max;\n useEffect(() => {\n report?.(count === undefined || max === undefined ? undefined : { count, max });\n }, [report, count, max]);\n}\n\ninterface TextLimitProps extends FieldBinding {\n maxLength?: number;\n value?: string | number | readonly string[] | null;\n defaultValue?: string | number | readonly string[] | null;\n}\n\n/**\n * Count a native text control for its bound Field. A controlled value is counted\n * from props; null is uncontrolled, as in React. An uncontrolled control is\n * observed only while a Field can show its count.\n */\nexport function useTextLimit(\n inputRef: RefObject<TextControl | null>,\n { value, defaultValue, maxLength, ...binding }: TextLimitProps,\n) {\n const report = useLimitReport(binding);\n const controlledLength = value == null ? undefined : String(value).length;\n // A new default changes an unedited control's value without any event.\n const defaultText = defaultValue == null ? \"\" : String(defaultValue);\n useEffect(() => {\n const input = inputRef.current;\n if (!report || !input) {\n return;\n }\n if (maxLength === undefined) {\n report(undefined);\n } else if (controlledLength !== undefined) {\n report({ count: controlledLength, max: maxLength });\n } else {\n return observeText(input, () => report({ count: input.value.length, max: maxLength }));\n }\n }, [inputRef, report, maxLength, controlledLength, defaultText]);\n}\n\n/**\n * Follow typing, autofill, programmatic writes and native resets without\n * replacing React's handlers or its value tracker.\n */\nfunction observeText(input: TextControl, read: () => void) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n // The reset event precedes the browser restoring the form's controls, and a\n // later listener may still cancel it, so read once the reset task completes.\n // The form owner is checked at event time so `form` attribute changes apply.\n const onReset = (event: Event) => {\n if (event.target === input.form) {\n clearTimeout(timer);\n timer = setTimeout(read);\n }\n };\n const owner = input.ownerDocument;\n const restoreValue = interceptValueWrites(input, read);\n input.addEventListener(\"input\", read);\n input.addEventListener(\"change\", read);\n owner.addEventListener(\"reset\", onReset, true);\n read();\n return () => {\n clearTimeout(timer);\n restoreValue();\n input.removeEventListener(\"input\", read);\n input.removeEventListener(\"change\", read);\n owner.removeEventListener(\"reset\", onReset, true);\n };\n}\n\n/**\n * Programmatic `value` writes (form libraries' setValue/reset) fire no events.\n * Wrap the instance accessor, chaining to whatever defines it now (React's\n * tracker), and restore that accessor when observation ends.\n */\nfunction interceptValueWrites(input: TextControl, onWrite: () => void) {\n const own = Object.getOwnPropertyDescriptor(input, \"value\");\n const accessor = own ?? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), \"value\");\n const get = accessor?.get;\n const set = accessor?.set;\n if (!get || !set || own?.configurable === false) {\n return () => {};\n }\n let isActive = true;\n const wrapper: PropertyDescriptor = {\n configurable: true,\n enumerable: accessor.enumerable,\n get(this: TextControl) {\n return get.call(this);\n },\n set(this: TextControl, next: string) {\n set.call(this, next);\n if (isActive) {\n onWrite();\n }\n },\n };\n Object.defineProperty(input, \"value\", wrapper);\n return () => {\n isActive = false;\n // Leave a later wrapper in place; it still chains through this inert one.\n if (Object.getOwnPropertyDescriptor(input, \"value\")?.set !== wrapper.set) {\n return;\n }\n if (own) {\n Object.defineProperty(input, \"value\", own);\n } else {\n Reflect.deleteProperty(input, \"value\");\n }\n };\n}\n"],"mappings":";;;;AAaA,SAASE,EAAe,GAAgD;CACtE,IAAMC,IAAQC,EAAWJ,CAAiB,GACpCK,IAAMC,EAAM,GACZC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T,EAAM,eACdU,IAAeC,EAAqBX,GAAOQ,CAAI;CAKrD,OAJAR,EAAM,iBAAiB,SAASQ,CAAI,GACpCR,EAAM,iBAAiB,UAAUQ,CAAI,GACrCC,EAAM,iBAAiB,SAASH,GAAS,EAAI,GAC7CE,EAAK,SACQ;EAKX,AAJA,aAAaH,CAAK,GAClBK,EAAa,GACbV,EAAM,oBAAoB,SAASQ,CAAI,GACvCR,EAAM,oBAAoB,UAAUQ,CAAI,GACxCC,EAAM,oBAAoB,SAASH,GAAS,EAAI;CAClD;AACF;AAOA,SAASK,EAAqB,GAAoB,GAAqB;CACrE,IAAMC,IAAM,OAAO,yBAAyBZ,GAAO,OAAO,GACpDa,IAAWD,KAAO,OAAO,yBAAyB,OAAO,eAAeZ,CAAK,GAAG,OAAO,GACvFc,IAAMD,GAAU,KAChBE,IAAMF,GAAU;CACtB,IAAI,CAACC,KAAO,CAACC,KAAOH,GAAK,iBAAiB,IACxC,aAAa,CAAC;CAEhB,IAAII,IAAW,IACTC,IAA8B;EAClC,cAAc;EACd,YAAYJ,EAAS;EACrB,MAAuB;GACrB,OAAOC,EAAI,KAAK,IAAI;EACtB;EACA,IAAuB,GAAc;GAEnC,AADAC,EAAI,KAAK,MAAMG,CAAI,GACfF,KACFG,EAAQ;EAEZ;CACF;CAEA,OADA,OAAO,eAAenB,GAAO,SAASiB,CAAO,SAChC;EAGX,AAFA,IAAW,IAEP,OAAO,yBAAyBjB,GAAO,OAAO,CAAC,EAAE,QAAQiB,EAAQ,QAGjEL,IACF,OAAO,eAAeZ,GAAO,SAASY,CAAG,IAEzC,QAAQ,eAAeZ,GAAO,OAAO;CAEzC;AACF"}
@@ -1,2 +1,2 @@
1
- const e=require("./overlayLayer-YVudmo27.cjs"),t=require("./isComposing-BrBcAANm.cjs"),n=require("../components/Popover/index.cjs");let r=require("react"),i=require("react/jsx-runtime");var a=100;function o(e,t){return n=>{e?.(n),n.defaultPrevented||t(n)}}function s(e){let t=typeof document>`u`?null:document.activeElement;if(!e||!t||!e.contains(t))return!1;try{return t.matches(`:focus-visible`)}catch{return!0}}function c(c,{placement:l,className:u}={}){let d=e.i(),f=c!==!1&&c!=null&&c!==``,p=f&&!d,m=(0,r.useRef)(null),h=(0,r.useId)(),[g,_]=(0,r.useState)(!1),[v,y]=(0,r.useState)(!1),b=(0,r.useRef)(!1),x=(0,r.useRef)(void 0);!p&&g&&_(!1),(0,r.useEffect)(()=>()=>clearTimeout(x.current),[]),(0,r.useEffect)(()=>{if(!g)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||t.t(e)||(e.preventDefault(),_(!1))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[g]);let S=()=>{clearTimeout(x.current),p&&(_(!0),y(!0))},C=()=>{clearTimeout(x.current),x.current=setTimeout(()=>{!b.current&&!s(m.current)&&_(!1)},a)},w=()=>{b.current=!0,S()},T=()=>{b.current=!1,C()};return{anchorRef:m,description:f&&g?h:void 0,triggerProps:(e={})=>({onMouseEnter:o(e.onMouseEnter,w),onMouseLeave:o(e.onMouseLeave,T),onFocus:o(e.onFocus,S),onBlur:o(e.onBlur,C)}),panel:f&&v?(0,i.jsx)(n.Popover,{anchorRef:m,isOpen:g,id:h,role:`tooltip`,placement:l,className:[`ds-surface-raised`,`ds-field-surface`,`ds-tooltip`,u].filter(Boolean).join(` `),children:(0,i.jsx)(`span`,{className:`ds-tooltip__content`,onMouseEnter:w,onMouseLeave:T,children:c})}):null}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
2
- //# sourceMappingURL=useTooltip-DtrE7QYu.cjs.map
1
+ const e=require("./overlayLayer-seJG-EFn.cjs"),t=require("./isComposing-BrBcAANm.cjs"),n=require("../components/Popover/index.cjs");let r=require("react"),i=require("react/jsx-runtime");var a=100;function o(e,t){return n=>{e?.(n),n.defaultPrevented||t(n)}}function s(e){let t=typeof document>`u`?null:document.activeElement;if(!e||!t||!e.contains(t))return!1;try{return t.matches(`:focus-visible`)}catch{return!0}}function c(c,{placement:l,className:u}={}){let d=e.i(),f=c!==!1&&c!=null&&c!==``,p=f&&!d,m=(0,r.useRef)(null),h=(0,r.useId)(),[g,_]=(0,r.useState)(!1),[v,y]=(0,r.useState)(!1),b=(0,r.useRef)(!1),x=(0,r.useRef)(void 0);!p&&g&&_(!1),(0,r.useEffect)(()=>()=>clearTimeout(x.current),[]),(0,r.useEffect)(()=>{if(!g)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||t.t(e)||(e.preventDefault(),_(!1))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[g]);let S=()=>{clearTimeout(x.current),p&&(_(!0),y(!0))},C=()=>{clearTimeout(x.current),x.current=setTimeout(()=>{!b.current&&!s(m.current)&&_(!1)},a)},w=()=>{b.current=!0,S()},T=()=>{b.current=!1,C()};return{anchorRef:m,description:f&&g?h:void 0,triggerProps:(e={})=>({onMouseEnter:o(e.onMouseEnter,w),onMouseLeave:o(e.onMouseLeave,T),onFocus:o(e.onFocus,S),onBlur:o(e.onBlur,C)}),panel:f&&v?(0,i.jsx)(n.Popover,{anchorRef:m,isOpen:g,id:h,role:`tooltip`,placement:l,className:[`ds-surface-raised`,`ds-field-surface`,`ds-tooltip`,u].filter(Boolean).join(` `),children:(0,i.jsx)(`span`,{className:`ds-tooltip__content`,onMouseEnter:w,onMouseLeave:T,children:c})}):null}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
2
+ //# sourceMappingURL=useTooltip-BXAvQwt4.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTooltip-DtrE7QYu.cjs","names":["useOverlayHidden","useRef","useId","useState","isComposing","Popover","require_overlayLayer","require_isComposing","require_components_Popover_index","react","react_jsx_runtime","CLOSE_DELAY","compose","theirs","event","ours","holdsKeyboardFocus","active","anchor","useTooltip","isSuspended","isEnabled","content","canShow","anchorRef","id","isOpen","setIsOpen","hasOpened","setHasOpened","hovered","timer","dismiss","show","hide","enter","leave","handlers","className"],"sources":["../../src/components/Popover/useTooltip.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useRef,\n useState,\n type FocusEventHandler,\n type MouseEventHandler,\n type ReactNode,\n type SyntheticEvent,\n} from \"react\";\nimport { isComposing } from \"../../internal/isComposing\";\nimport { useOverlayHidden } from \"../../internal/overlayLayer\";\nimport { Popover, type PopoverPlacement } from \".\";\n\n/** Grace period for moving the pointer from the anchor onto the tooltip text. */\nconst CLOSE_DELAY = 100;\n\ninterface TooltipTriggerHandlers<T extends Element> {\n onMouseEnter?: MouseEventHandler<T>;\n onMouseLeave?: MouseEventHandler<T>;\n onFocus?: FocusEventHandler<T>;\n onBlur?: FocusEventHandler<T>;\n}\n\ninterface TooltipOptions {\n placement?: PopoverPlacement;\n /** Added beside the shared tooltip surface classes. */\n className?: string;\n}\n\n/** The caller's handler runs first; preventing its default skips the tooltip's response. */\nfunction compose<E extends SyntheticEvent>(\n theirs: ((event: E) => void) | undefined,\n ours: (event: E) => void,\n) {\n return (event: E) => {\n theirs?.(event);\n if (!event.defaultPrevented) {\n ours(event);\n }\n };\n}\n\n/**\n * Keyboard focus inside the anchor holds a tooltip open after the pointer leaves;\n * the focus a pointer press leaves behind does not. Checked when closing, after\n * the focus event has settled.\n */\nfunction holdsKeyboardFocus(anchor: Element | null) {\n const active = typeof document === \"undefined\" ? null : document.activeElement;\n if (!anchor || !active || !anchor.contains(active)) {\n return false;\n }\n try {\n return active.matches(\":focus-visible\");\n } catch {\n // Engines without :focus-visible keep the earlier behaviour: any focus holds it.\n return true;\n }\n}\n\n/**\n * Hover and focus tooltip shared by Avatar and Time. It survives a short pointer\n * move onto its text, stays while keyboard focus remains, and closes on Escape\n * anywhere. `false`, `null` or empty content disables it, and a suspended\n * dialog around it closes it, so its Escape handler never reaches the active one.\n */\nexport function useTooltip<T extends HTMLElement>(\n content: ReactNode,\n { placement, className }: TooltipOptions = {},\n) {\n const isSuspended = useOverlayHidden();\n const isEnabled =\n content !== false && content !== null && content !== undefined && content !== \"\";\n const canShow = isEnabled && !isSuspended;\n const anchorRef = useRef<T | null>(null);\n const id = useId();\n const [isOpen, setIsOpen] = useState(false);\n // Idle anchors, such as avatars in a long table, mount no Popover until first shown.\n const [hasOpened, setHasOpened] = useState(false);\n const hovered = useRef(false);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n if (!canShow && isOpen) {\n // Disabling or suspending closes it, so it never reopens unprompted.\n setIsOpen(false);\n }\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n const dismiss = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || isComposing(event)) {\n return;\n }\n // Claim it as other popups do: a surrounding dialog skips a prevented Escape,\n // while window listeners still receive the event.\n event.preventDefault();\n setIsOpen(false);\n };\n document.addEventListener(\"keydown\", dismiss);\n return () => document.removeEventListener(\"keydown\", dismiss);\n }, [isOpen]);\n\n const show = () => {\n clearTimeout(timer.current);\n if (canShow) {\n setIsOpen(true);\n setHasOpened(true);\n }\n };\n const hide = () => {\n clearTimeout(timer.current);\n timer.current = setTimeout(() => {\n if (!hovered.current && !holdsKeyboardFocus(anchorRef.current)) {\n setIsOpen(false);\n }\n }, CLOSE_DELAY);\n };\n const enter = () => {\n hovered.current = true;\n show();\n };\n const leave = () => {\n hovered.current = false;\n hide();\n };\n\n return {\n anchorRef,\n /** Add to the trigger's `aria-describedby` alongside any caller description. */\n description: isEnabled && isOpen ? id : undefined,\n /** The trigger's hover and focus handlers, composed with the caller's. */\n triggerProps: (handlers: TooltipTriggerHandlers<T> = {}) => ({\n onMouseEnter: compose(handlers.onMouseEnter, enter),\n onMouseLeave: compose(handlers.onMouseLeave, leave),\n onFocus: compose(handlers.onFocus, show),\n onBlur: compose(handlers.onBlur, hide),\n }),\n panel:\n isEnabled && hasOpened ? (\n <Popover\n anchorRef={anchorRef}\n isOpen={isOpen}\n id={id}\n role=\"tooltip\"\n placement={placement}\n className={[\"ds-surface-raised\", \"ds-field-surface\", \"ds-tooltip\", className]\n .filter(Boolean)\n .join(\" \")}\n >\n <span\n className=\"ds-tooltip__content\"\n onMouseEnter={enter}\n onMouseLeave={leave}\n >\n {content}\n </span>\n </Popover>\n ) : null,\n };\n}\n"],"mappings":"A,0LAeA,IAAMW,EAAc,IAgBpB,SAASC,EACP,EACA,EACA,CACA,MAAQ,IAAa,CACnBC,IAASC,CAAK,EACTA,EAAM,kBACTC,EAAKD,CAAK,CAEd,CACF,CAOA,SAASE,EAAmB,EAAwB,CAClD,IAAMC,EAAS,OAAO,SAAa,IAAc,KAAO,SAAS,cACjE,GAAI,CAACC,GAAU,CAACD,GAAU,CAACC,EAAO,SAASD,CAAM,EAC/C,MAAO,GAET,GAAI,CACF,OAAOA,EAAO,QAAQ,gBAAgB,CACxC,MAAQ,CAEN,MAAO,EACT,CACF,CAQA,SAAgBE,EACd,EACA,CAAE,YAAW,aAA8B,CAAC,EAC5C,CACA,IAAMC,EAAcpB,EAAAA,EAAiB,EAC/BqB,EACJC,IAAY,IAASA,GAAY,MAAiCA,IAAY,GAC1EC,EAAUF,GAAa,CAACD,EACxBI,GAAA,EAAYvB,EAAAA,OAAAA,CAAiB,IAAI,EACjCwB,GAAA,EAAKvB,EAAAA,MAAAA,CAAM,EACX,CAACwB,EAAQC,IAAA,EAAaxB,EAAAA,SAAAA,CAAS,EAAK,EAEpC,CAACyB,EAAWC,IAAA,EAAgB1B,EAAAA,SAAAA,CAAS,EAAK,EAC1C2B,GAAA,EAAU7B,EAAAA,OAAAA,CAAO,EAAK,EACtB8B,GAAA,EAAQ9B,EAAAA,OAAAA,CAAkD,IAAA,EAAS,EACrE,CAACsB,GAAWG,GAEdC,EAAU,EAAK,GAGjB,EAAAlB,EAAA,UAAA,SAAsB,aAAasB,EAAM,OAAO,EAAG,CAAC,CAAC,GAErD,EAAAtB,EAAA,UAAA,KAAgB,CACd,GAAI,CAACiB,EACH,OAEF,IAAMM,EAAW,GAAyB,CACpClB,EAAM,MAAQ,UAAYA,EAAM,kBAAoBV,EAAAA,EAAYU,CAAK,IAKzEA,EAAM,eAAe,EACrBa,EAAU,EAAK,EACjB,EAEA,OADA,SAAS,iBAAiB,UAAWK,CAAO,MAC/B,SAAS,oBAAoB,UAAWA,CAAO,CAC9D,EAAG,CAACN,CAAM,CAAC,EAEX,IAAMO,MAAa,CACjB,aAAaF,EAAM,OAAO,EACtBR,IACFI,EAAU,EAAI,EACdE,EAAa,EAAI,EAErB,EACMK,MAAa,CACjB,aAAaH,EAAM,OAAO,EAC1B,EAAM,QAAU,eAAiB,CAC3B,CAACD,EAAQ,SAAW,CAACd,EAAmBQ,EAAU,OAAO,GAC3DG,EAAU,EAAK,CAEnB,EAAGhB,CAAW,CAChB,EACMwB,MAAc,CAClB,EAAQ,QAAU,GAClBF,EAAK,CACP,EACMG,MAAc,CAClB,EAAQ,QAAU,GAClBF,EAAK,CACP,EAEA,MAAO,CACL,YAEA,YAAab,GAAaK,EAASD,EAAK,IAAA,GAExC,cAAe,EAAsC,CAAC,KAAO,CAC3D,aAAcb,EAAQyB,EAAS,aAAcF,CAAK,EAClD,aAAcvB,EAAQyB,EAAS,aAAcD,CAAK,EAClD,QAASxB,EAAQyB,EAAS,QAASJ,CAAI,EACvC,OAAQrB,EAAQyB,EAAS,OAAQH,CAAI,CACvC,GACA,MACEb,GAAaO,GACX,EAAAlB,EAAA,IAAA,CAACL,EAAAA,QAAD,CACa,YACH,SACJ,KACJ,KAAK,UACM,YACX,UAAW,CAAC,oBAAqB,mBAAoB,aAAciC,CAAS,CAAC,CAC1E,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,EAEX,UAAA,EAAA5B,EAAA,IAAA,CAAC,OAAD,CACE,UAAU,sBACV,aAAcyB,EACd,aAAcC,EAEb,SAAAd,CACG,CAAA,CACC,CAAA,EACP,IACR,CACF,C"}
1
+ {"version":3,"file":"useTooltip-BXAvQwt4.cjs","names":["useOverlayHidden","useRef","useId","useState","isComposing","Popover","require_overlayLayer","require_isComposing","require_components_Popover_index","react","react_jsx_runtime","CLOSE_DELAY","compose","theirs","event","ours","holdsKeyboardFocus","active","anchor","useTooltip","isSuspended","isEnabled","content","canShow","anchorRef","id","isOpen","setIsOpen","hasOpened","setHasOpened","hovered","timer","dismiss","show","hide","enter","leave","handlers","className"],"sources":["../../src/components/Popover/useTooltip.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useRef,\n useState,\n type FocusEventHandler,\n type MouseEventHandler,\n type ReactNode,\n type SyntheticEvent,\n} from \"react\";\nimport { isComposing } from \"../../internal/isComposing\";\nimport { useOverlayHidden } from \"../../internal/overlayLayer\";\nimport { Popover, type PopoverPlacement } from \".\";\n\n/** Grace period for moving the pointer from the anchor onto the tooltip text. */\nconst CLOSE_DELAY = 100;\n\ninterface TooltipTriggerHandlers<T extends Element> {\n onMouseEnter?: MouseEventHandler<T>;\n onMouseLeave?: MouseEventHandler<T>;\n onFocus?: FocusEventHandler<T>;\n onBlur?: FocusEventHandler<T>;\n}\n\ninterface TooltipOptions {\n placement?: PopoverPlacement;\n /** Added beside the shared tooltip surface classes. */\n className?: string;\n}\n\n/** The caller's handler runs first; preventing its default skips the tooltip's response. */\nfunction compose<E extends SyntheticEvent>(\n theirs: ((event: E) => void) | undefined,\n ours: (event: E) => void,\n) {\n return (event: E) => {\n theirs?.(event);\n if (!event.defaultPrevented) {\n ours(event);\n }\n };\n}\n\n/**\n * Keyboard focus inside the anchor holds a tooltip open after the pointer leaves;\n * the focus a pointer press leaves behind does not. Checked when closing, after\n * the focus event has settled.\n */\nfunction holdsKeyboardFocus(anchor: Element | null) {\n const active = typeof document === \"undefined\" ? null : document.activeElement;\n if (!anchor || !active || !anchor.contains(active)) {\n return false;\n }\n try {\n return active.matches(\":focus-visible\");\n } catch {\n // Engines without :focus-visible keep the earlier behaviour: any focus holds it.\n return true;\n }\n}\n\n/**\n * Hover and focus tooltip shared by Avatar and Time. It survives a short pointer\n * move onto its text, stays while keyboard focus remains, and closes on Escape\n * anywhere. `false`, `null` or empty content disables it, and a suspended\n * dialog around it closes it, so its Escape handler never reaches the active one.\n */\nexport function useTooltip<T extends HTMLElement>(\n content: ReactNode,\n { placement, className }: TooltipOptions = {},\n) {\n const isSuspended = useOverlayHidden();\n const isEnabled =\n content !== false && content !== null && content !== undefined && content !== \"\";\n const canShow = isEnabled && !isSuspended;\n const anchorRef = useRef<T | null>(null);\n const id = useId();\n const [isOpen, setIsOpen] = useState(false);\n // Idle anchors, such as avatars in a long table, mount no Popover until first shown.\n const [hasOpened, setHasOpened] = useState(false);\n const hovered = useRef(false);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n if (!canShow && isOpen) {\n // Disabling or suspending closes it, so it never reopens unprompted.\n setIsOpen(false);\n }\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n const dismiss = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || isComposing(event)) {\n return;\n }\n // Claim it as other popups do: a surrounding dialog skips a prevented Escape,\n // while window listeners still receive the event.\n event.preventDefault();\n setIsOpen(false);\n };\n document.addEventListener(\"keydown\", dismiss);\n return () => document.removeEventListener(\"keydown\", dismiss);\n }, [isOpen]);\n\n const show = () => {\n clearTimeout(timer.current);\n if (canShow) {\n setIsOpen(true);\n setHasOpened(true);\n }\n };\n const hide = () => {\n clearTimeout(timer.current);\n timer.current = setTimeout(() => {\n if (!hovered.current && !holdsKeyboardFocus(anchorRef.current)) {\n setIsOpen(false);\n }\n }, CLOSE_DELAY);\n };\n const enter = () => {\n hovered.current = true;\n show();\n };\n const leave = () => {\n hovered.current = false;\n hide();\n };\n\n return {\n anchorRef,\n /** Add to the trigger's `aria-describedby` alongside any caller description. */\n description: isEnabled && isOpen ? id : undefined,\n /** The trigger's hover and focus handlers, composed with the caller's. */\n triggerProps: (handlers: TooltipTriggerHandlers<T> = {}) => ({\n onMouseEnter: compose(handlers.onMouseEnter, enter),\n onMouseLeave: compose(handlers.onMouseLeave, leave),\n onFocus: compose(handlers.onFocus, show),\n onBlur: compose(handlers.onBlur, hide),\n }),\n panel:\n isEnabled && hasOpened ? (\n <Popover\n anchorRef={anchorRef}\n isOpen={isOpen}\n id={id}\n role=\"tooltip\"\n placement={placement}\n className={[\"ds-surface-raised\", \"ds-field-surface\", \"ds-tooltip\", className]\n .filter(Boolean)\n .join(\" \")}\n >\n <span\n className=\"ds-tooltip__content\"\n onMouseEnter={enter}\n onMouseLeave={leave}\n >\n {content}\n </span>\n </Popover>\n ) : null,\n };\n}\n"],"mappings":"A,0LAeA,IAAMW,EAAc,IAgBpB,SAASC,EACP,EACA,EACA,CACA,MAAQ,IAAa,CACnBC,IAASC,CAAK,EACTA,EAAM,kBACTC,EAAKD,CAAK,CAEd,CACF,CAOA,SAASE,EAAmB,EAAwB,CAClD,IAAMC,EAAS,OAAO,SAAa,IAAc,KAAO,SAAS,cACjE,GAAI,CAACC,GAAU,CAACD,GAAU,CAACC,EAAO,SAASD,CAAM,EAC/C,MAAO,GAET,GAAI,CACF,OAAOA,EAAO,QAAQ,gBAAgB,CACxC,MAAQ,CAEN,MAAO,EACT,CACF,CAQA,SAAgBE,EACd,EACA,CAAE,YAAW,aAA8B,CAAC,EAC5C,CACA,IAAMC,EAAcpB,EAAAA,EAAiB,EAC/BqB,EACJC,IAAY,IAASA,GAAY,MAAiCA,IAAY,GAC1EC,EAAUF,GAAa,CAACD,EACxBI,GAAA,EAAYvB,EAAAA,OAAAA,CAAiB,IAAI,EACjCwB,GAAA,EAAKvB,EAAAA,MAAAA,CAAM,EACX,CAACwB,EAAQC,IAAA,EAAaxB,EAAAA,SAAAA,CAAS,EAAK,EAEpC,CAACyB,EAAWC,IAAA,EAAgB1B,EAAAA,SAAAA,CAAS,EAAK,EAC1C2B,GAAA,EAAU7B,EAAAA,OAAAA,CAAO,EAAK,EACtB8B,GAAA,EAAQ9B,EAAAA,OAAAA,CAAkD,IAAA,EAAS,EACrE,CAACsB,GAAWG,GAEdC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AD,CACE,UAAU,sBACV,aAAcyB,EACd,aAAcC,EAEb,SAAAd,CACG,CAAA,CACC,CAAA,EACP,IACR,CACF,C"}
@@ -1,4 +1,4 @@
1
- import { i as e } from "./overlayLayer-BgnMskpk.js";
1
+ import { i as e } from "./overlayLayer-IuoPVwTO.js";
2
2
  import { t } from "./isComposing-8bRWyiLF.js";
3
3
  import { Popover as n } from "../components/Popover/index.js";
4
4
  import { useEffect as r, useId as i, useRef as a, useState as o } from "react";
@@ -72,4 +72,4 @@ function d(d, { placement: f, className: p } = {}) {
72
72
  //#endregion
73
73
  export { d as t };
74
74
 
75
- //# sourceMappingURL=useTooltip-DajWQyNL.js.map
75
+ //# sourceMappingURL=useTooltip-BrC7FdeH.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTooltip-DajWQyNL.js","names":["useOverlayHidden","CLOSE_DELAY","compose","theirs","event","ours","holdsKeyboardFocus","active","anchor","useTooltip","isSuspended","isEnabled","content","canShow","anchorRef","useRef","id","useId","isOpen","setIsOpen","useState","hasOpened","setHasOpened","hovered","timer","useEffect","dismiss","isComposing","show","hide","enter","leave","handlers","Popover","className"],"sources":["../../src/components/Popover/useTooltip.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useRef,\n useState,\n type FocusEventHandler,\n type MouseEventHandler,\n type ReactNode,\n type SyntheticEvent,\n} from \"react\";\nimport { isComposing } from \"../../internal/isComposing\";\nimport { useOverlayHidden } from \"../../internal/overlayLayer\";\nimport { Popover, type PopoverPlacement } from \".\";\n\n/** Grace period for moving the pointer from the anchor onto the tooltip text. */\nconst CLOSE_DELAY = 100;\n\ninterface TooltipTriggerHandlers<T extends Element> {\n onMouseEnter?: MouseEventHandler<T>;\n onMouseLeave?: MouseEventHandler<T>;\n onFocus?: FocusEventHandler<T>;\n onBlur?: FocusEventHandler<T>;\n}\n\ninterface TooltipOptions {\n placement?: PopoverPlacement;\n /** Added beside the shared tooltip surface classes. */\n className?: string;\n}\n\n/** The caller's handler runs first; preventing its default skips the tooltip's response. */\nfunction compose<E extends SyntheticEvent>(\n theirs: ((event: E) => void) | undefined,\n ours: (event: E) => void,\n) {\n return (event: E) => {\n theirs?.(event);\n if (!event.defaultPrevented) {\n ours(event);\n }\n };\n}\n\n/**\n * Keyboard focus inside the anchor holds a tooltip open after the pointer leaves;\n * the focus a pointer press leaves behind does not. Checked when closing, after\n * the focus event has settled.\n */\nfunction holdsKeyboardFocus(anchor: Element | null) {\n const active = typeof document === \"undefined\" ? null : document.activeElement;\n if (!anchor || !active || !anchor.contains(active)) {\n return false;\n }\n try {\n return active.matches(\":focus-visible\");\n } catch {\n // Engines without :focus-visible keep the earlier behaviour: any focus holds it.\n return true;\n }\n}\n\n/**\n * Hover and focus tooltip shared by Avatar and Time. It survives a short pointer\n * move onto its text, stays while keyboard focus remains, and closes on Escape\n * anywhere. `false`, `null` or empty content disables it, and a suspended\n * dialog around it closes it, so its Escape handler never reaches the active one.\n */\nexport function useTooltip<T extends HTMLElement>(\n content: ReactNode,\n { placement, className }: TooltipOptions = {},\n) {\n const isSuspended = useOverlayHidden();\n const isEnabled =\n content !== false && content !== null && content !== undefined && content !== \"\";\n const canShow = isEnabled && !isSuspended;\n const anchorRef = useRef<T | null>(null);\n const id = useId();\n const [isOpen, setIsOpen] = useState(false);\n // Idle anchors, such as avatars in a long table, mount no Popover until first shown.\n const [hasOpened, setHasOpened] = useState(false);\n const hovered = useRef(false);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n if (!canShow && isOpen) {\n // Disabling or suspending closes it, so it never reopens unprompted.\n setIsOpen(false);\n }\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n const dismiss = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || isComposing(event)) {\n return;\n }\n // Claim it as other popups do: a surrounding dialog skips a prevented Escape,\n // while window listeners still receive the event.\n event.preventDefault();\n setIsOpen(false);\n };\n document.addEventListener(\"keydown\", dismiss);\n return () => document.removeEventListener(\"keydown\", dismiss);\n }, [isOpen]);\n\n const show = () => {\n clearTimeout(timer.current);\n if (canShow) {\n setIsOpen(true);\n setHasOpened(true);\n }\n };\n const hide = () => {\n clearTimeout(timer.current);\n timer.current = setTimeout(() => {\n if (!hovered.current && !holdsKeyboardFocus(anchorRef.current)) {\n setIsOpen(false);\n }\n }, CLOSE_DELAY);\n };\n const enter = () => {\n hovered.current = true;\n show();\n };\n const leave = () => {\n hovered.current = false;\n hide();\n };\n\n return {\n anchorRef,\n /** Add to the trigger's `aria-describedby` alongside any caller description. */\n description: isEnabled && isOpen ? id : undefined,\n /** The trigger's hover and focus handlers, composed with the caller's. */\n triggerProps: (handlers: TooltipTriggerHandlers<T> = {}) => ({\n onMouseEnter: compose(handlers.onMouseEnter, enter),\n onMouseLeave: compose(handlers.onMouseLeave, leave),\n onFocus: compose(handlers.onFocus, show),\n onBlur: compose(handlers.onBlur, hide),\n }),\n panel:\n isEnabled && hasOpened ? (\n <Popover\n anchorRef={anchorRef}\n isOpen={isOpen}\n id={id}\n role=\"tooltip\"\n placement={placement}\n className={[\"ds-surface-raised\", \"ds-field-surface\", \"ds-tooltip\", className]\n .filter(Boolean)\n .join(\" \")}\n >\n <span\n className=\"ds-tooltip__content\"\n onMouseEnter={enter}\n onMouseLeave={leave}\n >\n {content}\n </span>\n </Popover>\n ) : null,\n };\n}\n"],"mappings":";;;;;;AAeA,IAAMC,IAAc;AAgBpB,SAASC,EACP,GACA,GACA;CACA,QAAQ,MAAa;EAEnB,AADAC,IAASC,CAAK,GACTA,EAAM,oBACTC,EAAKD,CAAK;CAEd;AACF;AAOA,SAASE,EAAmB,GAAwB;CAClD,IAAMC,IAAS,OAAO,WAAa,MAAc,OAAO,SAAS;CACjE,IAAI,CAACC,KAAU,CAACD,KAAU,CAACC,EAAO,SAASD,CAAM,GAC/C,OAAO;CAET,IAAI;EACF,OAAOA,EAAO,QAAQ,gBAAgB;CACxC,QAAQ;EAEN,OAAO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8B,EAAS,cAAcF,CAAK;GAClD,cAAc5B,EAAQ8B,EAAS,cAAcD,CAAK;GAClD,SAAS7B,EAAQ8B,EAAS,SAASJ,CAAI;GACvC,QAAQ1B,EAAQ8B,EAAS,QAAQH,CAAI;EACvC;EACA,OACElB,KAAaU,IACX,kBAACY,GAAD;GACa;GACH;GACJ;GACJ,MAAK;GACM;GACX,WAAW;IAAC;IAAqB;IAAoB;IAAcC;GAAS,CAAC,CAC1E,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;GAEX,UAAA,kBAAC,QAAD;IACE,WAAU;IACV,cAAcJ;IACd,cAAcC;IAEb,UAAAnB;GACG,CAAA;EACC,CAAA,IACP;CACR;AACF"}
1
+ {"version":3,"file":"useTooltip-BrC7FdeH.js","names":["useOverlayHidden","CLOSE_DELAY","compose","theirs","event","ours","holdsKeyboardFocus","active","anchor","useTooltip","isSuspended","isEnabled","content","canShow","anchorRef","useRef","id","useId","isOpen","setIsOpen","useState","hasOpened","setHasOpened","hovered","timer","useEffect","dismiss","isComposing","show","hide","enter","leave","handlers","Popover","className"],"sources":["../../src/components/Popover/useTooltip.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useRef,\n useState,\n type FocusEventHandler,\n type MouseEventHandler,\n type ReactNode,\n type SyntheticEvent,\n} from \"react\";\nimport { isComposing } from \"../../internal/isComposing\";\nimport { useOverlayHidden } from \"../../internal/overlayLayer\";\nimport { Popover, type PopoverPlacement } from \".\";\n\n/** Grace period for moving the pointer from the anchor onto the tooltip text. */\nconst CLOSE_DELAY = 100;\n\ninterface TooltipTriggerHandlers<T extends Element> {\n onMouseEnter?: MouseEventHandler<T>;\n onMouseLeave?: MouseEventHandler<T>;\n onFocus?: FocusEventHandler<T>;\n onBlur?: FocusEventHandler<T>;\n}\n\ninterface TooltipOptions {\n placement?: PopoverPlacement;\n /** Added beside the shared tooltip surface classes. */\n className?: string;\n}\n\n/** The caller's handler runs first; preventing its default skips the tooltip's response. */\nfunction compose<E extends SyntheticEvent>(\n theirs: ((event: E) => void) | undefined,\n ours: (event: E) => void,\n) {\n return (event: E) => {\n theirs?.(event);\n if (!event.defaultPrevented) {\n ours(event);\n }\n };\n}\n\n/**\n * Keyboard focus inside the anchor holds a tooltip open after the pointer leaves;\n * the focus a pointer press leaves behind does not. Checked when closing, after\n * the focus event has settled.\n */\nfunction holdsKeyboardFocus(anchor: Element | null) {\n const active = typeof document === \"undefined\" ? null : document.activeElement;\n if (!anchor || !active || !anchor.contains(active)) {\n return false;\n }\n try {\n return active.matches(\":focus-visible\");\n } catch {\n // Engines without :focus-visible keep the earlier behaviour: any focus holds it.\n return true;\n }\n}\n\n/**\n * Hover and focus tooltip shared by Avatar and Time. It survives a short pointer\n * move onto its text, stays while keyboard focus remains, and closes on Escape\n * anywhere. `false`, `null` or empty content disables it, and a suspended\n * dialog around it closes it, so its Escape handler never reaches the active one.\n */\nexport function useTooltip<T extends HTMLElement>(\n content: ReactNode,\n { placement, className }: TooltipOptions = {},\n) {\n const isSuspended = useOverlayHidden();\n const isEnabled =\n content !== false && content !== null && content !== undefined && content !== \"\";\n const canShow = isEnabled && !isSuspended;\n const anchorRef = useRef<T | null>(null);\n const id = useId();\n const [isOpen, setIsOpen] = useState(false);\n // Idle anchors, such as avatars in a long table, mount no Popover until first shown.\n const [hasOpened, setHasOpened] = useState(false);\n const hovered = useRef(false);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n if (!canShow && isOpen) {\n // Disabling or suspending closes it, so it never reopens unprompted.\n setIsOpen(false);\n }\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n const dismiss = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || isComposing(event)) {\n return;\n }\n // Claim it as other popups do: a surrounding dialog skips a prevented Escape,\n // while window listeners still receive the event.\n event.preventDefault();\n setIsOpen(false);\n };\n document.addEventListener(\"keydown\", dismiss);\n return () => document.removeEventListener(\"keydown\", dismiss);\n }, [isOpen]);\n\n const show = () => {\n clearTimeout(timer.current);\n if (canShow) {\n setIsOpen(true);\n setHasOpened(true);\n }\n };\n const hide = () => {\n clearTimeout(timer.current);\n timer.current = setTimeout(() => {\n if (!hovered.current && !holdsKeyboardFocus(anchorRef.current)) {\n setIsOpen(false);\n }\n }, CLOSE_DELAY);\n };\n const enter = () => {\n hovered.current = true;\n show();\n };\n const leave = () => {\n hovered.current = false;\n hide();\n };\n\n return {\n anchorRef,\n /** Add to the trigger's `aria-describedby` alongside any caller description. */\n description: isEnabled && isOpen ? id : undefined,\n /** The trigger's hover and focus handlers, composed with the caller's. */\n triggerProps: (handlers: TooltipTriggerHandlers<T> = {}) => ({\n onMouseEnter: compose(handlers.onMouseEnter, enter),\n onMouseLeave: compose(handlers.onMouseLeave, leave),\n onFocus: compose(handlers.onFocus, show),\n onBlur: compose(handlers.onBlur, hide),\n }),\n panel:\n isEnabled && hasOpened ? (\n <Popover\n anchorRef={anchorRef}\n isOpen={isOpen}\n id={id}\n role=\"tooltip\"\n placement={placement}\n className={[\"ds-surface-raised\", \"ds-field-surface\", \"ds-tooltip\", className]\n .filter(Boolean)\n .join(\" \")}\n >\n <span\n className=\"ds-tooltip__content\"\n onMouseEnter={enter}\n onMouseLeave={leave}\n >\n {content}\n </span>\n </Popover>\n ) : null,\n };\n}\n"],"mappings":";;;;;;AAeA,IAAMC,IAAc;AAgBpB,SAASC,EACP,GACA,GACA;CACA,QAAQ,MAAa;EAEnB,AADAC,IAASC,CAAK,GACTA,EAAM,oBACTC,EAAKD,CAAK;CAEd;AACF;AAOA,SAASE,EAAmB,GAAwB;CAClD,IAAMC,IAAS,OAAO,WAAa,MAAc,OAAO,SAAS;CACjE,IAAI,CAACC,KAAU,CAACD,KAAU,CAACC,EAAO,SAASD,CAAM,GAC/C,OAAO;CAET,IAAI;EACF,OAAOA,EAAO,QAAQ,gBAAgB;CACxC,QAAQ;EAEN,OAAO;CACT;AACF;AAQA,SAAgBE,EACd,GAC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Ac5B,EAAQ8B,EAAS,cAAcD,CAAK;GAClD,SAAS7B,EAAQ8B,EAAS,SAASJ,CAAI;GACvC,QAAQ1B,EAAQ8B,EAAS,QAAQH,CAAI;EACvC;EACA,OACElB,KAAaU,IACX,kBAACY,GAAD;GACa;GACH;GACJ;GACJ,MAAK;GACM;GACX,WAAW;IAAC;IAAqB;IAAoB;IAAcC;GAAS,CAAC,CAC1E,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;GAEX,UAAA,kBAAC,QAAD;IACE,WAAU;IACV,cAAcJ;IACd,cAAcC;IAEb,UAAAnB;GACG,CAAA;EACC,CAAA,IACP;CACR;AACF"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../../chunks/Drawer-CcVF_p4b.cjs"),n=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),r=require("../SideNav/index.cjs"),i=require("../TopNav/index.cjs"),a=require("../../chunks/observeElementWidth-BCJM2FAw.cjs");let o=require("react"),s=require("react/jsx-runtime");var c=(0,o.forwardRef)(function({brand:c,navigation:l,actions:u,navigationLabel:d=`Main`,scrollMode:f=`container`,contentPadding:p=`default`,className:m,children:h,...g},_){let[v,y]=(0,o.useState)(null),[b,x]=(0,o.useState)(!1),S=(0,o.useRef)(null),C=(0,o.useRef)(null),w=(0,o.useRef)(!1),T=(0,o.useId)(),E=(0,o.useMemo)(()=>n.t(y,_),[_]);(0,o.useEffect)(()=>v?a.t(v,e=>{e<768||(document.getElementById(T)?.contains(document.activeElement)&&(w.current=!0),x(!1))}):void 0,[v,T]),(0,o.useEffect)(()=>{!b&&w.current&&(w.current=!1,(S.current?.querySelector(`[aria-current='page']`)??S.current?.querySelector(`a[href]`)??C.current)?.focus())},[b]);let D=u?.(`drawer`);return(0,s.jsxs)(`div`,{...g,ref:E,"data-scroll-mode":f,"data-content-padding":p,className:[`ds-appshell`,m].filter(Boolean).join(` `),children:[(0,s.jsxs)(`div`,{className:`ds-appshell__frame`,"aria-hidden":b||void 0,ref:e=>{e&&(e.inert=b)},children:[(0,s.jsx)(i.TopNav,{brand:c,actions:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`div`,{className:`ds-appshell__actions`,children:u?.(`topnav`)}),(0,s.jsx)(e.Button,{variant:`simple`,size:`lg`,isIconOnly:!0,iconStart:`menu`,className:`ds-appshell__toggle`,"aria-label":`Open navigation`,"aria-expanded":b,"aria-controls":T,onClick:()=>x(!0)})]})}),(0,s.jsxs)(`div`,{className:`ds-appshell__body`,children:[(0,s.jsx)(r.SideNav,{ref:S,className:`ds-appshell__desktop-nav`,label:d,children:l}),(0,s.jsx)(`main`,{ref:C,className:`ds-appshell__main`,tabIndex:-1,children:h})]})]}),(0,s.jsx)(t.t,{id:T,isOpen:b,onClose:()=>x(!1),variant:`navigation`,side:`end`,portalContainer:f===`document`?void 0:v,dir:g.dir,title:c,"aria-label":`Navigation`,closeLabel:`Close navigation`,footer:D?(0,s.jsx)(r.SideNavFooter,{children:D}):void 0,children:(0,s.jsx)(r.SideNav,{className:`ds-appshell__mobile-nav`,label:d,onClick:e=>{let t=e.target instanceof Element?e.target.closest(`a[href]`):null,n=e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||t?.target===`_blank`;t&&!n&&x(!1)},children:l})})]})});exports.AppShell=c;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../../chunks/Drawer-BDX9_qHA.cjs"),n=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),r=require("../SideNav/index.cjs"),i=require("../TopNav/index.cjs"),a=require("../../chunks/observeElementWidth-BCJM2FAw.cjs");let o=require("react"),s=require("react/jsx-runtime");var c=(0,o.forwardRef)(function({brand:c,navigation:l,actions:u,navigationLabel:d=`Main`,scrollMode:f=`container`,contentPadding:p=`default`,className:m,children:h,...g},_){let[v,y]=(0,o.useState)(null),[b,x]=(0,o.useState)(!1),S=(0,o.useRef)(null),C=(0,o.useRef)(null),w=(0,o.useRef)(!1),T=(0,o.useId)(),E=(0,o.useMemo)(()=>n.t(y,_),[_]);(0,o.useEffect)(()=>v?a.t(v,e=>{e<768||(document.getElementById(T)?.contains(document.activeElement)&&(w.current=!0),x(!1))}):void 0,[v,T]),(0,o.useEffect)(()=>{!b&&w.current&&(w.current=!1,(S.current?.querySelector(`[aria-current='page']`)??S.current?.querySelector(`a[href]`)??C.current)?.focus())},[b]);let D=u?.(`drawer`);return(0,s.jsxs)(`div`,{...g,ref:E,"data-scroll-mode":f,"data-content-padding":p,className:[`ds-appshell`,m].filter(Boolean).join(` `),children:[(0,s.jsxs)(`div`,{className:`ds-appshell__frame`,"aria-hidden":b||void 0,ref:e=>{e&&(e.inert=b)},children:[(0,s.jsx)(i.TopNav,{brand:c,actions:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`div`,{className:`ds-appshell__actions`,children:u?.(`topnav`)}),(0,s.jsx)(e.Button,{variant:`simple`,size:`lg`,isIconOnly:!0,iconStart:`menu`,className:`ds-appshell__toggle`,"aria-label":`Open navigation`,"aria-expanded":b,"aria-controls":T,onClick:()=>x(!0)})]})}),(0,s.jsxs)(`div`,{className:`ds-appshell__body`,children:[(0,s.jsx)(r.SideNav,{ref:S,className:`ds-appshell__desktop-nav`,label:d,children:l}),(0,s.jsx)(`main`,{ref:C,className:`ds-appshell__main`,tabIndex:-1,children:h})]})]}),(0,s.jsx)(t.t,{id:T,isOpen:b,onClose:()=>x(!1),variant:`navigation`,side:`end`,portalContainer:f===`document`?void 0:v,dir:g.dir,title:c,"aria-label":`Navigation`,closeLabel:`Close navigation`,footer:D?(0,s.jsx)(r.SideNavFooter,{children:D}):void 0,children:(0,s.jsx)(r.SideNav,{className:`ds-appshell__mobile-nav`,label:d,onClick:e=>{let t=e.target instanceof Element?e.target.closest(`a[href]`):null,n=e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||t?.target===`_blank`;t&&!n&&x(!1)},children:l})})]})});exports.AppShell=c;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  import { Button as e } from "../Button/index.js";
2
- import { t } from "../../chunks/Drawer-uhJvy3s9.js";
2
+ import { t } from "../../chunks/Drawer-DTtgAZO2.js";
3
3
  import { t as n } from "../../chunks/mergeRefs-C6_5pADN.js";
4
4
  import { SideNav as r, SideNavFooter as i } from "../SideNav/index.js";
5
5
  import { TopNav as a } from "../TopNav/index.js";
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Avatar-Cvj_DqG0.cjs");exports.Avatar=e.t,exports.AvatarGroup=e.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Avatar-DPnrvkwd.cjs");exports.Avatar=e.t,exports.AvatarGroup=e.n;
@@ -1 +1 @@
1
- export { t as Avatar, n as AvatarGroup } from "../../chunks/Avatar-6t78C9Np.js";
1
+ export { t as Avatar, n as AvatarGroup } from "../../chunks/Avatar-BK8IdL5W.js";
@@ -23,7 +23,7 @@
23
23
 
24
24
  /* The base metrics are md; sizes keep the same border, corners and tracking. */
25
25
  .ds-badge[data-size="sm"] {
26
- --badge-pad-block: 1px;
26
+ --badge-pad-block: var(--badge-sm-pad-block, 1px);
27
27
  --badge-pad-inline: var(--space-1);
28
28
  --badge-gap: var(--space-1);
29
29
  --badge-marker-size: var(--space-1);
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/group-BSJHLagi.cjs"),t=require("../Grid/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({isIndeterminate:e=!1,className:t,children:i,...a},o){let s=(0,n.useRef)(null);return(0,n.useEffect)(()=>{s.current&&(s.current.indeterminate=e)},[e]),(0,r.jsxs)(`label`,{className:[`ds-choice`,t].filter(Boolean).join(` `),children:[(0,r.jsx)(`input`,{type:`checkbox`,className:`ds-choice__control`,"data-kind":`checkbox`,ref:e=>{s.current=e,typeof o==`function`?o(e):o&&(o.current=e)},...a}),i&&(0,r.jsx)(`span`,{className:`ds-choice__label`,children:i})]})}),a=(0,n.forwardRef)(function({className:e,children:t,...n},i){return(0,r.jsxs)(`label`,{className:[`ds-choice`,e].filter(Boolean).join(` `),children:[(0,r.jsx)(`input`,{ref:i,type:`radio`,className:`ds-choice__control`,"data-kind":`radio`,...n}),t&&(0,r.jsx)(`span`,{className:`ds-choice__label`,children:t})]})});function o({label:n,columns:i=1,children:a,className:o,...s}){return(0,r.jsx)(e.t,{...s,label:n,className:[`ds-choice-group`,o].filter(Boolean).join(` `),children:i===1?(0,r.jsx)(t.Stack,{gap:`sm`,children:a}):(0,r.jsx)(t.Grid,{columns:i,gap:`sm`,className:`ds-choice-group__grid ds-field-group-grid`,style:{"--field-group-columns":i},children:a})})}exports.Checkbox=i,exports.ChoiceGroup=o,exports.Radio=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),t=require("../../chunks/useIsomorphicLayoutEffect-XM4Ot6x5.cjs"),n=require("../../chunks/group-DRSLOsXu.cjs"),r=require("../Grid/index.cjs");let i=require("react"),a=require("react/jsx-runtime");var o=e=>{e.preventDefault(),e.stopPropagation()};function s(e,{disabled:n,isFocusableWhenDisabled:r,name:i,required:a,...s}){let c=!!(n&&r);return t.t(()=>{let t=e.current;if(t&&c)return t.addEventListener(`click`,o),()=>t.removeEventListener(`click`,o)},[e,c]),c?{...s,"aria-disabled":!0,"data-disabled":``}:{...s,disabled:n,name:i,required:a}}var c=(0,i.forwardRef)(function({isIndeterminate:t=!1,className:n,children:r,...o},c){let l=(0,i.useRef)(null),u=s(l,o);return(0,i.useEffect)(()=>{l.current&&(l.current.indeterminate=t)},[t]),(0,a.jsxs)(`label`,{className:[`ds-choice`,n].filter(Boolean).join(` `),children:[(0,a.jsx)(`input`,{type:`checkbox`,className:`ds-choice__control`,"data-kind":`checkbox`,ref:e.t(l,c),...u}),r&&(0,a.jsx)(`span`,{className:`ds-choice__label`,children:r})]})}),l=(0,i.forwardRef)(function({className:t,children:n,...r},o){let c=(0,i.useRef)(null),l=s(c,r);return(0,a.jsxs)(`label`,{className:[`ds-choice`,t].filter(Boolean).join(` `),children:[(0,a.jsx)(`input`,{ref:e.t(c,o),type:`radio`,className:`ds-choice__control`,"data-kind":`radio`,...l}),n&&(0,a.jsx)(`span`,{className:`ds-choice__label`,children:n})]})});function u({label:e,columns:t=1,children:i,className:o,...s}){return(0,a.jsx)(n.t,{...s,label:e,className:[`ds-choice-group`,o].filter(Boolean).join(` `),children:t===1?(0,a.jsx)(r.Stack,{gap:`sm`,children:i}):(0,a.jsx)(r.Grid,{columns:t,gap:`sm`,className:`ds-choice-group__grid ds-field-group-grid`,style:{"--field-group-columns":t},children:i})})}exports.Checkbox=c,exports.ChoiceGroup=u,exports.Radio=l;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","useRef","FieldGroup","Stack","Grid","require_group","require_components_Grid_index","react","react_jsx_runtime","Checkbox","rest","inner","isIndeterminate","className","node","ref","children","Radio","ChoiceGroup","fieldProps","columns"],"sources":["../../../src/components/Choice/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, Stack } from \"../Grid\";\nimport \"./style.css\";\n\nexport interface CheckboxProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\"\n> {\n /** Display state only — clicking an indeterminate box selects all. */\n isIndeterminate?: boolean;\n children?: ReactNode;\n}\n\n/** An independent yes/no. 20px box at every size, in every context. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { isIndeterminate = false, className, children, ...rest },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n\n useEffect(() => {\n if (inner.current) {\n inner.current.indeterminate = isIndeterminate;\n }\n }, [isIndeterminate]);\n\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n type=\"checkbox\"\n className=\"ds-choice__control\"\n data-kind=\"checkbox\"\n ref={(node) => {\n inner.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n {...rest}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"size\"> {\n children?: ReactNode;\n}\n\n/** One of two or more mutually exclusive choices, all of them visible. */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { className, children, ...rest },\n ref,\n) {\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n ref={ref}\n type=\"radio\"\n className=\"ds-choice__control\"\n data-kind=\"radio\"\n {...rest}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface ChoiceGroupProps extends FieldGroupProps {\n /**\n * Run a long list in columns instead of one stack. Steps down to a single\n * column inside a narrow container.\n */\n columns?: 1 | 2 | 3;\n children: ReactNode;\n}\n\n/** A set of checkboxes or radios under one group label, spaced by Stack or Grid. */\nexport function ChoiceGroup({\n label,\n columns = 1,\n children,\n className,\n ...fieldProps\n}: ChoiceGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-choice-group\", className].filter(Boolean).join(\" \")}\n >\n {columns === 1 ? (\n <Stack gap=\"sm\">{children}</Stack>\n ) : (\n <Grid\n columns={columns}\n gap=\"sm\"\n className=\"ds-choice-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n )}\n </FieldGroup>\n );\n}\n"],"mappings":"A,2MAsBA,IAAaS,GAAA,EA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CAAC,kBAAmBN,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAEjE,SAAAO,IAAY,GACX,EAAAZ,EAAA,IAAA,CAACL,EAAAA,MAAD,CAAO,IAAI,KAAM,UAAgB,CAAA,GAEjC,EAAAK,EAAA,IAAA,CAACJ,EAAAA,KAAD,CACW,UACT,IAAI,KACJ,UAAU,4CACV,MAAO,CAAE,wBAAyBgB,CAAQ,EAEzC,UACG,CAAA,CAEE,CAAA,CAEhB,C"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","useRef","mergeRefs","FieldGroup","Stack","Grid","require_mergeRefs","require_useIsomorphicLayoutEffect","require_group","require_components_Grid_index","react","react_jsx_runtime","refuse","event","useChoiceInput","rest","keepsFocus","disabled","isFocusableWhenDisabled","node","input","Checkbox","inner","inputProps","isIndeterminate","className","ref","children","Radio","ChoiceGroup","fieldProps","columns"],"sources":["../../../src/components/Choice/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { useIsomorphicLayoutEffect } from \"../../internal/useIsomorphicLayoutEffect\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, Stack } from \"../Grid\";\nimport \"./style.css\";\n\ntype ChoiceInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"size\"> & {\n /**\n * With `disabled`, keep the control focusable so it can be reached and\n * described: it is marked `aria-disabled` instead of native `disabled` and\n * keeps the disabled look. As with native `disabled`, presses change nothing\n * and run no click or change handlers, and the control is left out of form\n * submission and validation.\n */\n isFocusableWhenDisabled?: boolean;\n};\n\nconst refuse = (event: Event) => {\n event.preventDefault();\n event.stopPropagation();\n};\n\n/**\n * The native input's props. A focusable disabled choice stops each press on\n * the input itself, before React or an ancestor sees it, and cancels it, so\n * the browser restores the checked and indeterminate states and nothing\n * reports a change. It renders without `name` and `required`, which keeps it\n * out of submission and validation as native `disabled` would; a radio then\n * also leaves its group's arrow-key order. `aria-disabled` set directly is\n * passed through without blocking.\n */\nfunction useChoiceInput(\n input: RefObject<HTMLInputElement | null>,\n { disabled, isFocusableWhenDisabled, name, required, ...rest }: ChoiceInputProps,\n) {\n const keepsFocus = Boolean(disabled && isFocusableWhenDisabled);\n useIsomorphicLayoutEffect(() => {\n const node = input.current;\n if (!node || !keepsFocus) {\n return;\n }\n node.addEventListener(\"click\", refuse);\n return () => node.removeEventListener(\"click\", refuse);\n }, [input, keepsFocus]);\n return keepsFocus\n ? { ...rest, \"aria-disabled\": true, \"data-disabled\": \"\" }\n : { ...rest, disabled, name, required };\n}\n\nexport interface CheckboxProps extends ChoiceInputProps {\n /** Display state only — clicking an indeterminate box selects all. */\n isIndeterminate?: boolean;\n children?: ReactNode;\n}\n\n/** An independent yes/no. 20px box at every size, in every context. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { isIndeterminate = false, className, children, ...rest },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n const inputProps = useChoiceInput(inner, rest);\n\n useEffect(() => {\n if (inner.current) {\n inner.current.indeterminate = isIndeterminate;\n }\n }, [isIndeterminate]);\n\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n type=\"checkbox\"\n className=\"ds-choice__control\"\n data-kind=\"checkbox\"\n ref={mergeRefs(inner, ref)}\n {...inputProps}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface RadioProps extends ChoiceInputProps {\n children?: ReactNode;\n}\n\n/** One of two or more mutually exclusive choices, all of them visible. */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { className, children, ...rest },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n const inputProps = useChoiceInput(inner, rest);\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n ref={mergeRefs(inner, ref)}\n type=\"radio\"\n className=\"ds-choice__control\"\n data-kind=\"radio\"\n {...inputProps}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface ChoiceGroupProps extends FieldGroupProps {\n /**\n * Run a long list in columns instead of one stack. Steps down to a single\n * column inside a narrow container.\n */\n columns?: 1 | 2 | 3;\n children: ReactNode;\n}\n\n/** A set of checkboxes or radios under one group label, spaced by Stack or Grid. */\nexport function ChoiceGroup({\n label,\n columns = 1,\n children,\n className,\n ...fieldProps\n}: ChoiceGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-choice-group\", className].filter(Boolean).join(\" \")}\n >\n {columns === 1 ? (\n <Stack gap=\"sm\">{children}</Stack>\n ) : (\n <Grid\n columns={columns}\n gap=\"sm\"\n className=\"ds-choice-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n )}\n </FieldGroup>\n );\n}\n"],"mappings":"A,6TA0BA,IAAMY,EAAU,GAAiB,CAC/BC,EAAM,eAAe,EACrBA,EAAM,gBAAgB,CACxB,EAWA,SAASC,EACP,EACA,CAAE,WAAU,0BAAyB,OAAM,WAAU,GAAGC,GACxD,CACA,IAAMC,EAAa,GAAQC,GAAYC,GASvC,OARAX,EAAA,MAAgC,CAC9B,IAAMY,EAAOC,EAAM,QACnB,GAAKD,GAASH,EAId,OADAG,EAAK,iBAAiB,QAASP,CAAM,MACxBO,EAAK,oBAAoB,QAASP,CAAM,CACvD,EAAG,CAACQ,EAAOJ,CAAU,CAAC,EACfA,EACH,CAAE,GAAGD,EAAM,gBAAiB,GAAM,gBAAiB,EAAG,EACtD,CAAE,GAAGA,EAAM,WAAU,OAAM,UAAS,CAC1C,CASA,IAAaM,GAAA,EAAWrB,EAAAA,WAAAA,CAA4C,SAClE,CAAE,kBAAkB,GAAO,YAAW,WAAU,GAAGe,GACnD,EACA,CACA,I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,GAAI2B,EACG,QACP,UAAW,CAAC,kBAAmBL,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAEjE,SAAAM,IAAY,GACX,EAAApB,EAAA,IAAA,CAACP,EAAAA,MAAD,CAAO,IAAI,KAAM,UAAgB,CAAA,GAEjC,EAAAO,EAAA,IAAA,CAACN,EAAAA,KAAD,CACW,UACT,IAAI,KACJ,UAAU,4CACV,MAAO,CAAE,wBAAyB0B,CAAQ,EAEzC,UACG,CAAA,CAEE,CAAA,CAEhB,C"}
@@ -1,13 +1,23 @@
1
1
  import { type InputHTMLAttributes, type ReactNode } from "react";
2
2
  import { type FieldGroupProps } from "../Field/group.cjs";
3
- export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
3
+ type ChoiceInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
4
+ /**
5
+ * With `disabled`, keep the control focusable so it can be reached and
6
+ * described: it is marked `aria-disabled` instead of native `disabled` and
7
+ * keeps the disabled look. As with native `disabled`, presses change nothing
8
+ * and run no click or change handlers, and the control is left out of form
9
+ * submission and validation.
10
+ */
11
+ isFocusableWhenDisabled?: boolean;
12
+ };
13
+ export interface CheckboxProps extends ChoiceInputProps {
4
14
  /** Display state only — clicking an indeterminate box selects all. */
5
15
  isIndeterminate?: boolean;
6
16
  children?: ReactNode;
7
17
  }
8
18
  /** An independent yes/no. 20px box at every size, in every context. */
9
19
  export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
10
- export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
20
+ export interface RadioProps extends ChoiceInputProps {
11
21
  children?: ReactNode;
12
22
  }
13
23
  /** One of two or more mutually exclusive choices, all of them visible. */
@@ -22,4 +32,5 @@ export interface ChoiceGroupProps extends FieldGroupProps {
22
32
  }
23
33
  /** A set of checkboxes or radios under one group label, spaced by Stack or Grid. */
24
34
  export declare function ChoiceGroup({ label, columns, children, className, ...fieldProps }: ChoiceGroupProps): import("react").JSX.Element;
35
+ export {};
25
36
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Choice/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,CAChB;IACC,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,uEAAuE;AACvE,eAAO,MAAM,QAAQ,4GA+BnB,CAAC;AAEH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9F,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,0EAA0E;AAC1E,eAAO,MAAM,KAAK,yGAgBhB,CAAC;AAEH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAW,EACX,QAAQ,EACR,SAAS,EACT,GAAG,UAAU,EACd,EAAE,gBAAgB,+BAqBlB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Choice/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,aAAa,CAAC;AAErB,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG;IACrF;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAkCF,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,uEAAuE;AACvE,eAAO,MAAM,QAAQ,4GAyBnB,CAAC;AAEH,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAClD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,0EAA0E;AAC1E,eAAO,MAAM,KAAK,yGAkBhB,CAAC;AAEH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAW,EACX,QAAQ,EACR,SAAS,EACT,GAAG,UAAU,EACd,EAAE,gBAAgB,+BAqBlB"}
@@ -1,13 +1,23 @@
1
1
  import { type InputHTMLAttributes, type ReactNode } from "react";
2
2
  import { type FieldGroupProps } from "../Field/group.js";
3
- export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
3
+ type ChoiceInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
4
+ /**
5
+ * With `disabled`, keep the control focusable so it can be reached and
6
+ * described: it is marked `aria-disabled` instead of native `disabled` and
7
+ * keeps the disabled look. As with native `disabled`, presses change nothing
8
+ * and run no click or change handlers, and the control is left out of form
9
+ * submission and validation.
10
+ */
11
+ isFocusableWhenDisabled?: boolean;
12
+ };
13
+ export interface CheckboxProps extends ChoiceInputProps {
4
14
  /** Display state only — clicking an indeterminate box selects all. */
5
15
  isIndeterminate?: boolean;
6
16
  children?: ReactNode;
7
17
  }
8
18
  /** An independent yes/no. 20px box at every size, in every context. */
9
19
  export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
10
- export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
20
+ export interface RadioProps extends ChoiceInputProps {
11
21
  children?: ReactNode;
12
22
  }
13
23
  /** One of two or more mutually exclusive choices, all of them visible. */
@@ -22,4 +32,5 @@ export interface ChoiceGroupProps extends FieldGroupProps {
22
32
  }
23
33
  /** A set of checkboxes or radios under one group label, spaced by Stack or Grid. */
24
34
  export declare function ChoiceGroup({ label, columns, children, className, ...fieldProps }: ChoiceGroupProps): import("react").JSX.Element;
35
+ export {};
25
36
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,CAChB;IACC,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,uEAAuE;AACvE,eAAO,MAAM,QAAQ,4GA+BnB,CAAC;AAEH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,C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ACpB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAW,EACX,QAAQ,EACR,SAAS,EACT,GAAG,UAAU,EACd,EAAE,gBAAgB,+BAqBlB"}
@@ -1,60 +1,80 @@
1
- import { t as e } from "../../chunks/group-67F_I1yw.js";
2
- import { Grid as t, Stack as n } from "../Grid/index.js";
3
- import { forwardRef as r, useEffect as i, useRef as a } from "react";
4
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
1
+ import { t as e } from "../../chunks/mergeRefs-C6_5pADN.js";
2
+ import { t } from "../../chunks/useIsomorphicLayoutEffect-Bc9hxFMc.js";
3
+ import { t as n } from "../../chunks/group-CJA3-3s5.js";
4
+ import { Grid as r, Stack as i } from "../Grid/index.js";
5
+ import { forwardRef as a, useEffect as o, useRef as s } from "react";
6
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
7
  //#region src/components/Choice/index.tsx
6
- var c = r(function({ isIndeterminate: e = !1, className: t, children: n, ...r }, c) {
7
- let l = a(null);
8
- return i(() => {
9
- l.current && (l.current.indeterminate = e);
10
- }, [e]), /* @__PURE__ */ s("label", {
11
- className: ["ds-choice", t].filter(Boolean).join(" "),
12
- children: [/* @__PURE__ */ o("input", {
8
+ var u = (e) => {
9
+ e.preventDefault(), e.stopPropagation();
10
+ };
11
+ function d(e, { disabled: n, isFocusableWhenDisabled: r, name: i, required: a, ...o }) {
12
+ let s = !!(n && r);
13
+ return t(() => {
14
+ let t = e.current;
15
+ if (t && s) return t.addEventListener("click", u), () => t.removeEventListener("click", u);
16
+ }, [e, s]), s ? {
17
+ ...o,
18
+ "aria-disabled": !0,
19
+ "data-disabled": ""
20
+ } : {
21
+ ...o,
22
+ disabled: n,
23
+ name: i,
24
+ required: a
25
+ };
26
+ }
27
+ var f = a(function({ isIndeterminate: t = !1, className: n, children: r, ...i }, a) {
28
+ let u = s(null), f = d(u, i);
29
+ return o(() => {
30
+ u.current && (u.current.indeterminate = t);
31
+ }, [t]), /* @__PURE__ */ l("label", {
32
+ className: ["ds-choice", n].filter(Boolean).join(" "),
33
+ children: [/* @__PURE__ */ c("input", {
13
34
  type: "checkbox",
14
35
  className: "ds-choice__control",
15
36
  "data-kind": "checkbox",
16
- ref: (e) => {
17
- l.current = e, typeof c == "function" ? c(e) : c && (c.current = e);
18
- },
19
- ...r
20
- }), n && /* @__PURE__ */ o("span", {
37
+ ref: e(u, a),
38
+ ...f
39
+ }), r && /* @__PURE__ */ c("span", {
21
40
  className: "ds-choice__label",
22
- children: n
41
+ children: r
23
42
  })]
24
43
  });
25
- }), l = r(function({ className: e, children: t, ...n }, r) {
26
- return /* @__PURE__ */ s("label", {
27
- className: ["ds-choice", e].filter(Boolean).join(" "),
28
- children: [/* @__PURE__ */ o("input", {
29
- ref: r,
44
+ }), p = a(function({ className: t, children: n, ...r }, i) {
45
+ let a = s(null), o = d(a, r);
46
+ return /* @__PURE__ */ l("label", {
47
+ className: ["ds-choice", t].filter(Boolean).join(" "),
48
+ children: [/* @__PURE__ */ c("input", {
49
+ ref: e(a, i),
30
50
  type: "radio",
31
51
  className: "ds-choice__control",
32
52
  "data-kind": "radio",
33
- ...n
34
- }), t && /* @__PURE__ */ o("span", {
53
+ ...o
54
+ }), n && /* @__PURE__ */ c("span", {
35
55
  className: "ds-choice__label",
36
- children: t
56
+ children: n
37
57
  })]
38
58
  });
39
59
  });
40
- function u({ label: r, columns: i = 1, children: a, className: s, ...c }) {
41
- return /* @__PURE__ */ o(e, {
42
- ...c,
43
- label: r,
44
- className: ["ds-choice-group", s].filter(Boolean).join(" "),
45
- children: i === 1 ? /* @__PURE__ */ o(n, {
60
+ function m({ label: e, columns: t = 1, children: a, className: o, ...s }) {
61
+ return /* @__PURE__ */ c(n, {
62
+ ...s,
63
+ label: e,
64
+ className: ["ds-choice-group", o].filter(Boolean).join(" "),
65
+ children: t === 1 ? /* @__PURE__ */ c(i, {
46
66
  gap: "sm",
47
67
  children: a
48
- }) : /* @__PURE__ */ o(t, {
49
- columns: i,
68
+ }) : /* @__PURE__ */ c(r, {
69
+ columns: t,
50
70
  gap: "sm",
51
71
  className: "ds-choice-group__grid ds-field-group-grid",
52
- style: { "--field-group-columns": i },
72
+ style: { "--field-group-columns": t },
53
73
  children: a
54
74
  })
55
75
  });
56
76
  }
57
77
  //#endregion
58
- export { c as Checkbox, u as ChoiceGroup, l as Radio };
78
+ export { f as Checkbox, m as ChoiceGroup, p as Radio };
59
79
 
60
80
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FieldGroup","Checkbox","forwardRef","rest","inner","useRef","useEffect","isIndeterminate","className","node","ref","children","Radio","ChoiceGroup","fieldProps","columns","Stack","Grid"],"sources":["../../../src/components/Choice/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, Stack } from \"../Grid\";\nimport \"./style.css\";\n\nexport interface CheckboxProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\"\n> {\n /** Display state only — clicking an indeterminate box selects all. */\n isIndeterminate?: boolean;\n children?: ReactNode;\n}\n\n/** An independent yes/no. 20px box at every size, in every context. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { isIndeterminate = false, className, children, ...rest },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n\n useEffect(() => {\n if (inner.current) {\n inner.current.indeterminate = isIndeterminate;\n }\n }, [isIndeterminate]);\n\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n type=\"checkbox\"\n className=\"ds-choice__control\"\n data-kind=\"checkbox\"\n ref={(node) => {\n inner.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n {...rest}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"size\"> {\n children?: ReactNode;\n}\n\n/** One of two or more mutually exclusive choices, all of them visible. */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { className, children, ...rest },\n ref,\n) {\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n ref={ref}\n type=\"radio\"\n className=\"ds-choice__control\"\n data-kind=\"radio\"\n {...rest}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface ChoiceGroupProps extends FieldGroupProps {\n /**\n * Run a long list in columns instead of one stack. Steps down to a single\n * column inside a narrow container.\n */\n columns?: 1 | 2 | 3;\n children: ReactNode;\n}\n\n/** A set of checkboxes or radios under one group label, spaced by Stack or Grid. */\nexport function ChoiceGroup({\n label,\n columns = 1,\n children,\n className,\n ...fieldProps\n}: ChoiceGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-choice-group\", className].filter(Boolean).join(\" \")}\n >\n {columns === 1 ? (\n <Stack gap=\"sm\">{children}</Stack>\n ) : (\n <Grid\n columns={columns}\n gap=\"sm\"\n className=\"ds-choice-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n )}\n </FieldGroup>\n );\n}\n"],"mappings":";;;;;AAsBA,IAAaC,IAAWC,EAA4C,SAClE,EAAE,qBAAkB,IAAO,cAAW,aAAU,GAAGC,KACnD,GACA;CACA,IAAMC,IAAQC,EAAgC,IAAI;CAQlD,OANAC,QAAgB;EACd,AAAIF,EAAM,YACR,EAAM,QAAQ,gBAAgBG;CAElC,GAAG,CAACA,CAAe,CAAC,GAGlB,kBAAC,SAAD;EAAO,WAAW,CAAC,aAAaC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAnE,UAAA,CACE,kBAAC,SAAD;GACE,MAAK;GACL,WAAU;GACV,aAAU;GACV,MAAM,MAAS;IAEb,AADA,EAAM,UAAUC,GACZ,OAAOC,KAAQ,aACjBA,EAAID,CAAI,IACCC,MACT,EAAI,UAAUD;GAElB;GACA,GAAIN;EACL,CAAA,GACAQ,KAAY,kBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,CAC3D;;AAEX,CAAC,GAOYC,IAAQV,EAAyC,SAC5D,EAAE,cAAW,aAAU,GAAGC,KAC1B,GACA;CACA,OACE,kBAAC,SAAD;EAAO,WAAW,CAAC,aAAaK,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAnE,UAAA,CACE,kBAAC,SAAD;GACO;GACL,MAAK;GACL,WAAU;GACV,aAAU;GACV,GAAIL;EACL,CAAA,GACAQ,KAAY,kBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,CAC3D;;AAEX,CAAC;AAYD,SAAgBE,EAAY,EAC1B,UACA,aAAU,GACV,aACA,cACA,GAAGC,KACgB;CACnB,OACE,kBAACd,GAAD;EACE,GAAIc;EACG;EACP,WAAW,CAAC,mBAAmBN,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAEjE,UAAAO,MAAY,IACX,kBAACC,GAAD;GAAO,KAAI;GAAM;EAAgB,CAAA,IAEjC,kBAACC,GAAD;GACW;GACT,KAAI;GACJ,WAAU;GACV,OAAO,EAAE,yBAAyBF,EAAQ;GAEzC;EACG,CAAA;CAEE,CAAA;AAEhB"}
1
+ {"version":3,"file":"index.js","names":["mergeRefs","FieldGroup","refuse","event","useChoiceInput","rest","keepsFocus","disabled","isFocusableWhenDisabled","useIsomorphicLayoutEffect","node","input","Checkbox","forwardRef","inner","useRef","inputProps","useEffect","isIndeterminate","className","ref","children","Radio","ChoiceGroup","fieldProps","columns","Stack","Grid"],"sources":["../../../src/components/Choice/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { useIsomorphicLayoutEffect } from \"../../internal/useIsomorphicLayoutEffect\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, Stack } from \"../Grid\";\nimport \"./style.css\";\n\ntype ChoiceInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"size\"> & {\n /**\n * With `disabled`, keep the control focusable so it can be reached and\n * described: it is marked `aria-disabled` instead of native `disabled` and\n * keeps the disabled look. As with native `disabled`, presses change nothing\n * and run no click or change handlers, and the control is left out of form\n * submission and validation.\n */\n isFocusableWhenDisabled?: boolean;\n};\n\nconst refuse = (event: Event) => {\n event.preventDefault();\n event.stopPropagation();\n};\n\n/**\n * The native input's props. A focusable disabled choice stops each press on\n * the input itself, before React or an ancestor sees it, and cancels it, so\n * the browser restores the checked and indeterminate states and nothing\n * reports a change. It renders without `name` and `required`, which keeps it\n * out of submission and validation as native `disabled` would; a radio then\n * also leaves its group's arrow-key order. `aria-disabled` set directly is\n * passed through without blocking.\n */\nfunction useChoiceInput(\n input: RefObject<HTMLInputElement | null>,\n { disabled, isFocusableWhenDisabled, name, required, ...rest }: ChoiceInputProps,\n) {\n const keepsFocus = Boolean(disabled && isFocusableWhenDisabled);\n useIsomorphicLayoutEffect(() => {\n const node = input.current;\n if (!node || !keepsFocus) {\n return;\n }\n node.addEventListener(\"click\", refuse);\n return () => node.removeEventListener(\"click\", refuse);\n }, [input, keepsFocus]);\n return keepsFocus\n ? { ...rest, \"aria-disabled\": true, \"data-disabled\": \"\" }\n : { ...rest, disabled, name, required };\n}\n\nexport interface CheckboxProps extends ChoiceInputProps {\n /** Display state only — clicking an indeterminate box selects all. */\n isIndeterminate?: boolean;\n children?: ReactNode;\n}\n\n/** An independent yes/no. 20px box at every size, in every context. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { isIndeterminate = false, className, children, ...rest },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n const inputProps = useChoiceInput(inner, rest);\n\n useEffect(() => {\n if (inner.current) {\n inner.current.indeterminate = isIndeterminate;\n }\n }, [isIndeterminate]);\n\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n type=\"checkbox\"\n className=\"ds-choice__control\"\n data-kind=\"checkbox\"\n ref={mergeRefs(inner, ref)}\n {...inputProps}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface RadioProps extends ChoiceInputProps {\n children?: ReactNode;\n}\n\n/** One of two or more mutually exclusive choices, all of them visible. */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { className, children, ...rest },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n const inputProps = useChoiceInput(inner, rest);\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n ref={mergeRefs(inner, ref)}\n type=\"radio\"\n className=\"ds-choice__control\"\n data-kind=\"radio\"\n {...inputProps}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface ChoiceGroupProps extends FieldGroupProps {\n /**\n * Run a long list in columns instead of one stack. Steps down to a single\n * column inside a narrow container.\n */\n columns?: 1 | 2 | 3;\n children: ReactNode;\n}\n\n/** A set of checkboxes or radios under one group label, spaced by Stack or Grid. */\nexport function ChoiceGroup({\n label,\n columns = 1,\n children,\n className,\n ...fieldProps\n}: ChoiceGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-choice-group\", className].filter(Boolean).join(\" \")}\n >\n {columns === 1 ? (\n <Stack gap=\"sm\">{children}</Stack>\n ) : (\n <Grid\n columns={columns}\n gap=\"sm\"\n className=\"ds-choice-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Gr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W,CAAC,aAAac,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAnE,UAAA,CACE,kBAAC,SAAD;GACE,KAAKnB,EAAUc,GAAOM,CAAG;GACzB,MAAK;GACL,WAAU;GACV,aAAU;GACV,GAAIJ;EACL,CAAA,GACAK,KAAY,kBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,CAC3D;;AAEX,CAAC;AAYD,SAAgBE,EAAY,EAC1B,UACA,aAAU,GACV,aACA,cACA,GAAGC,KACgB;CACnB,OACE,kBAACvB,GAAD;EACE,GAAIuB;EACG;EACP,WAAW,CAAC,mBAAmBL,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAEjE,UAAAM,MAAY,IACX,kBAACC,GAAD;GAAO,KAAI;GAAM;EAAgB,CAAA,IAEjC,kBAACC,GAAD;GACW;GACT,KAAI;GACJ,WAAU;GACV,OAAO,EAAE,yBAAyBF,EAAQ;GAEzC;EACG,CAAA;CAEE,CAAA;AAEhB"}
@@ -31,7 +31,7 @@
31
31
  border-radius: var(--radius-pill);
32
32
  }
33
33
 
34
- .ds-choice__control:hover:not(:disabled) {
34
+ .ds-choice__control:hover:not(:disabled, [data-disabled]) {
35
35
  background: var(--field-hover);
36
36
  }
37
37
 
@@ -74,11 +74,16 @@
74
74
  border-color: var(--color-danger);
75
75
  }
76
76
 
77
- .ds-choice:has(.ds-choice__control:disabled) {
77
+ /* data-disabled marks a focusable disabled choice (isFocusableWhenDisabled). */
78
+ .ds-choice:has(.ds-choice__control:is(:disabled, [data-disabled])) {
78
79
  cursor: not-allowed;
79
80
  opacity: 0.45;
80
81
  }
81
82
 
83
+ .ds-choice__control:is(:disabled, [data-disabled]) {
84
+ cursor: not-allowed;
85
+ }
86
+
82
87
  /* Spacing comes from the Stack or Grid inside. */
83
88
  .ds-choice-group {
84
89
  margin: 0;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("../Pagination/index.cjs");const e=require("../../chunks/CollectionView-B18Ihv7X.cjs");exports.CollectionEmpty=e.n,exports.CollectionView=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("../Pagination/index.cjs");const e=require("../../chunks/CollectionView-BNYx29b1.cjs");exports.CollectionEmpty=e.n,exports.CollectionView=e.t;
@@ -1,2 +1,2 @@
1
1
  import "../Pagination/index.js";
2
- export { n as CollectionEmpty, t as CollectionView } from "../../chunks/CollectionView-C-SwkPWC.js";
2
+ export { n as CollectionEmpty, t as CollectionView } from "../../chunks/CollectionView-Vj84E26b.js";
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/ColourField-Dohdx7eW.cjs");exports.ColourField=e.t,exports.ColourPanel=e.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/ColourField-C1qjpIfB.cjs");exports.ColourField=e.t,exports.ColourPanel=e.n;
@@ -1 +1 @@
1
- export { t as ColourField, n as ColourPanel } from "../../chunks/ColourField-DzZ--mQZ.js";
1
+ export { t as ColourField, n as ColourPanel } from "../../chunks/ColourField-Ce2oaVcd.js";