@42-central/ui-react 0.20.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/{chunk-PAFS7TED.js → chunk-2HIX6DKN.js} +3 -3
  2. package/dist/{chunk-PAFS7TED.js.map → chunk-2HIX6DKN.js.map} +1 -1
  3. package/dist/{chunk-Z5WYYDG2.js → chunk-2MXWEIMD.js} +7 -4
  4. package/dist/chunk-2MXWEIMD.js.map +1 -0
  5. package/dist/{chunk-JYK6JVR3.js → chunk-3BXKTWWD.js} +8 -8
  6. package/dist/{chunk-JYK6JVR3.js.map → chunk-3BXKTWWD.js.map} +1 -1
  7. package/dist/{chunk-7R4CDHBK.js → chunk-45QRQKRC.js} +4 -4
  8. package/dist/{chunk-7R4CDHBK.js.map → chunk-45QRQKRC.js.map} +1 -1
  9. package/dist/{chunk-MKJKCBRE.js → chunk-47LEAR6G.js} +6 -6
  10. package/dist/{chunk-MKJKCBRE.js.map → chunk-47LEAR6G.js.map} +1 -1
  11. package/dist/chunk-4ASNIDV7.js +17 -0
  12. package/dist/chunk-4ASNIDV7.js.map +1 -0
  13. package/dist/{chunk-ZN3WYGIQ.js → chunk-5HUEBSIS.js} +3 -3
  14. package/dist/{chunk-ZN3WYGIQ.js.map → chunk-5HUEBSIS.js.map} +1 -1
  15. package/dist/{chunk-2TM7UVM2.js → chunk-6M6YZ3PQ.js} +4 -4
  16. package/dist/{chunk-2TM7UVM2.js.map → chunk-6M6YZ3PQ.js.map} +1 -1
  17. package/dist/{chunk-4BGU2UQB.js → chunk-6VYGK3Q3.js} +6 -6
  18. package/dist/{chunk-4BGU2UQB.js.map → chunk-6VYGK3Q3.js.map} +1 -1
  19. package/dist/{chunk-ZFUTGBJC.js → chunk-6YNLRQ25.js} +3 -3
  20. package/dist/{chunk-ZFUTGBJC.js.map → chunk-6YNLRQ25.js.map} +1 -1
  21. package/dist/{chunk-6OV6EJQ2.js → chunk-7AQ4MN4M.js} +6 -6
  22. package/dist/{chunk-6OV6EJQ2.js.map → chunk-7AQ4MN4M.js.map} +1 -1
  23. package/dist/{chunk-5337N3FE.js → chunk-7BOSX65U.js} +3 -3
  24. package/dist/{chunk-5337N3FE.js.map → chunk-7BOSX65U.js.map} +1 -1
  25. package/dist/{chunk-THLMW5IU.js → chunk-7CNDZZZ6.js} +4 -4
  26. package/dist/{chunk-THLMW5IU.js.map → chunk-7CNDZZZ6.js.map} +1 -1
  27. package/dist/{chunk-LJ3GHC4V.js → chunk-BE2LWUHY.js} +5 -5
  28. package/dist/{chunk-LJ3GHC4V.js.map → chunk-BE2LWUHY.js.map} +1 -1
  29. package/dist/{chunk-LSIX2PVU.js → chunk-BNWQ7IAZ.js} +7 -7
  30. package/dist/{chunk-LSIX2PVU.js.map → chunk-BNWQ7IAZ.js.map} +1 -1
  31. package/dist/{chunk-2KN3MI7I.js → chunk-C4NFRSOR.js} +4 -4
  32. package/dist/{chunk-2KN3MI7I.js.map → chunk-C4NFRSOR.js.map} +1 -1
  33. package/dist/{chunk-3REFDGOM.js → chunk-C6NVU4F7.js} +3 -3
  34. package/dist/{chunk-3REFDGOM.js.map → chunk-C6NVU4F7.js.map} +1 -1
  35. package/dist/{chunk-HVOEVB4E.js → chunk-D2QIPQ74.js} +3 -3
  36. package/dist/{chunk-HVOEVB4E.js.map → chunk-D2QIPQ74.js.map} +1 -1
  37. package/dist/{chunk-4EU6FGGB.js → chunk-DA4QII2N.js} +4 -4
  38. package/dist/{chunk-4EU6FGGB.js.map → chunk-DA4QII2N.js.map} +1 -1
  39. package/dist/{chunk-LZWA7V62.js → chunk-DJLNGWMM.js} +5 -5
  40. package/dist/{chunk-LZWA7V62.js.map → chunk-DJLNGWMM.js.map} +1 -1
  41. package/dist/{chunk-HEQ2H6VO.js → chunk-DT6LKNZF.js} +4 -4
  42. package/dist/{chunk-HEQ2H6VO.js.map → chunk-DT6LKNZF.js.map} +1 -1
  43. package/dist/{chunk-BUFALAEK.js → chunk-E5H3YWZV.js} +4 -4
  44. package/dist/{chunk-BUFALAEK.js.map → chunk-E5H3YWZV.js.map} +1 -1
  45. package/dist/{chunk-WR444JRU.js → chunk-E63VD25L.js} +7 -7
  46. package/dist/{chunk-WR444JRU.js.map → chunk-E63VD25L.js.map} +1 -1
  47. package/dist/{chunk-H7INUXZD.js → chunk-F342ZT7O.js} +4 -4
  48. package/dist/{chunk-H7INUXZD.js.map → chunk-F342ZT7O.js.map} +1 -1
  49. package/dist/{chunk-VALQ2XVA.js → chunk-H3PYSAWN.js} +3 -3
  50. package/dist/{chunk-VALQ2XVA.js.map → chunk-H3PYSAWN.js.map} +1 -1
  51. package/dist/{chunk-Q5ZO2O25.js → chunk-HRNWWL3Y.js} +6 -6
  52. package/dist/{chunk-Q5ZO2O25.js.map → chunk-HRNWWL3Y.js.map} +1 -1
  53. package/dist/{chunk-DHTSVJ4G.js → chunk-IOYZC7SA.js} +9 -9
  54. package/dist/{chunk-DHTSVJ4G.js.map → chunk-IOYZC7SA.js.map} +1 -1
  55. package/dist/{chunk-HBFN5W7Q.js → chunk-JVG5ISPT.js} +4 -4
  56. package/dist/{chunk-HBFN5W7Q.js.map → chunk-JVG5ISPT.js.map} +1 -1
  57. package/dist/{chunk-6KER77RS.js → chunk-KMZENCEP.js} +7 -7
  58. package/dist/{chunk-6KER77RS.js.map → chunk-KMZENCEP.js.map} +1 -1
  59. package/dist/{chunk-VVM7JMZS.js → chunk-LBAE6FP6.js} +8 -8
  60. package/dist/{chunk-VVM7JMZS.js.map → chunk-LBAE6FP6.js.map} +1 -1
  61. package/dist/{chunk-U2PNMMDB.js → chunk-LKFHUDEW.js} +7 -7
  62. package/dist/{chunk-U2PNMMDB.js.map → chunk-LKFHUDEW.js.map} +1 -1
  63. package/dist/{chunk-P276SCCV.js → chunk-MKKQE3TM.js} +6 -6
  64. package/dist/{chunk-P276SCCV.js.map → chunk-MKKQE3TM.js.map} +1 -1
  65. package/dist/{chunk-2SVX3MQQ.js → chunk-MW42XVPD.js} +3 -3
  66. package/dist/{chunk-2SVX3MQQ.js.map → chunk-MW42XVPD.js.map} +1 -1
  67. package/dist/{chunk-S4TRYMCU.js → chunk-MXAACRWE.js} +6 -6
  68. package/dist/{chunk-S4TRYMCU.js.map → chunk-MXAACRWE.js.map} +1 -1
  69. package/dist/{chunk-WFHY6NRQ.js → chunk-NJPHZBLI.js} +11 -11
  70. package/dist/{chunk-WFHY6NRQ.js.map → chunk-NJPHZBLI.js.map} +1 -1
  71. package/dist/{chunk-DUPE2CRU.js → chunk-NKOTA5TM.js} +3 -3
  72. package/dist/{chunk-DUPE2CRU.js.map → chunk-NKOTA5TM.js.map} +1 -1
  73. package/dist/{chunk-RGLNH7A5.js → chunk-NLOBBJAA.js} +3 -3
  74. package/dist/{chunk-RGLNH7A5.js.map → chunk-NLOBBJAA.js.map} +1 -1
  75. package/dist/{chunk-FXDLS23K.js → chunk-NS6RGPWR.js} +3 -3
  76. package/dist/{chunk-FXDLS23K.js.map → chunk-NS6RGPWR.js.map} +1 -1
  77. package/dist/{chunk-ZWOZL4XX.js → chunk-O5W3QWJ6.js} +5 -5
  78. package/dist/{chunk-ZWOZL4XX.js.map → chunk-O5W3QWJ6.js.map} +1 -1
  79. package/dist/{chunk-PD4FX34E.js → chunk-O7LS6OZR.js} +4 -4
  80. package/dist/{chunk-PD4FX34E.js.map → chunk-O7LS6OZR.js.map} +1 -1
  81. package/dist/{chunk-JL4QMM46.js → chunk-POKLPMSB.js} +5 -5
  82. package/dist/{chunk-JL4QMM46.js.map → chunk-POKLPMSB.js.map} +1 -1
  83. package/dist/{chunk-K6BHDFX3.js → chunk-QKSLDQM2.js} +3 -3
  84. package/dist/{chunk-K6BHDFX3.js.map → chunk-QKSLDQM2.js.map} +1 -1
  85. package/dist/{chunk-CDHIF2NV.js → chunk-QNKD2SQM.js} +8 -8
  86. package/dist/{chunk-CDHIF2NV.js.map → chunk-QNKD2SQM.js.map} +1 -1
  87. package/dist/{chunk-KOT4PWGE.js → chunk-RCF7HTG5.js} +5 -5
  88. package/dist/{chunk-KOT4PWGE.js.map → chunk-RCF7HTG5.js.map} +1 -1
  89. package/dist/{chunk-SE3CGQRO.js → chunk-RLOWPCGG.js} +3 -3
  90. package/dist/{chunk-SE3CGQRO.js.map → chunk-RLOWPCGG.js.map} +1 -1
  91. package/dist/{chunk-R57QP43T.js → chunk-SVKN5ZHX.js} +4 -4
  92. package/dist/{chunk-R57QP43T.js.map → chunk-SVKN5ZHX.js.map} +1 -1
  93. package/dist/{chunk-NJ4RO3CT.js → chunk-SWVUXEBT.js} +5 -5
  94. package/dist/{chunk-NJ4RO3CT.js.map → chunk-SWVUXEBT.js.map} +1 -1
  95. package/dist/{chunk-FZNPJAGJ.js → chunk-SXNAUSEB.js} +5 -5
  96. package/dist/{chunk-FZNPJAGJ.js.map → chunk-SXNAUSEB.js.map} +1 -1
  97. package/dist/{chunk-7AWOMWCQ.js → chunk-TWLJQE75.js} +7 -7
  98. package/dist/{chunk-7AWOMWCQ.js.map → chunk-TWLJQE75.js.map} +1 -1
  99. package/dist/{chunk-GGT4GJD6.js → chunk-TWNIAF7K.js} +3 -3
  100. package/dist/{chunk-GGT4GJD6.js.map → chunk-TWNIAF7K.js.map} +1 -1
  101. package/dist/{chunk-4TCTMRR5.js → chunk-UAYENYS2.js} +5 -5
  102. package/dist/{chunk-4TCTMRR5.js.map → chunk-UAYENYS2.js.map} +1 -1
  103. package/dist/{chunk-HDRC6ITF.js → chunk-UT3TOV2Q.js} +3 -3
  104. package/dist/{chunk-HDRC6ITF.js.map → chunk-UT3TOV2Q.js.map} +1 -1
  105. package/dist/{chunk-R52P43LZ.js → chunk-UXPINIDN.js} +3 -3
  106. package/dist/{chunk-R52P43LZ.js.map → chunk-UXPINIDN.js.map} +1 -1
  107. package/dist/{chunk-45DFYIK5.js → chunk-VD6PB3VA.js} +3 -3
  108. package/dist/{chunk-45DFYIK5.js.map → chunk-VD6PB3VA.js.map} +1 -1
  109. package/dist/{chunk-2OQP7UY4.js → chunk-VTDBWU6H.js} +4 -4
  110. package/dist/{chunk-2OQP7UY4.js.map → chunk-VTDBWU6H.js.map} +1 -1
  111. package/dist/{chunk-IMP5VHEN.js → chunk-XKDL4QS6.js} +3 -3
  112. package/dist/{chunk-IMP5VHEN.js.map → chunk-XKDL4QS6.js.map} +1 -1
  113. package/dist/{chunk-H26K66EU.js → chunk-Y57NW6G7.js} +3 -3
  114. package/dist/{chunk-H26K66EU.js.map → chunk-Y57NW6G7.js.map} +1 -1
  115. package/dist/components/accordion/index.js +5 -5
  116. package/dist/components/action-icon/index.js +4 -4
  117. package/dist/components/alert/index.js +6 -6
  118. package/dist/components/ambient-background/index.js +1 -1
  119. package/dist/components/app-shell/index.js +6 -6
  120. package/dist/components/aspect-ratio/index.js +1 -1
  121. package/dist/components/autocomplete/index.js +6 -6
  122. package/dist/components/avatar/index.js +1 -1
  123. package/dist/components/badge/index.js +3 -3
  124. package/dist/components/breadcrumb/index.js +1 -1
  125. package/dist/components/button/index.js +4 -4
  126. package/dist/components/button-group/index.js +2 -2
  127. package/dist/components/button-multi-select/index.js +7 -7
  128. package/dist/components/button-select/index.js +7 -7
  129. package/dist/components/calendar/index.js +6 -6
  130. package/dist/components/camera/index.js +14 -14
  131. package/dist/components/card/card.d.ts.map +1 -1
  132. package/dist/components/card/index.js +2 -2
  133. package/dist/components/carousel/index.js +3 -3
  134. package/dist/components/chart/index.js +1 -1
  135. package/dist/components/checkbox/index.js +6 -6
  136. package/dist/components/choice-card-group/index.js +5 -5
  137. package/dist/components/circular-progress/index.js +1 -1
  138. package/dist/components/clipboard/index.js +6 -6
  139. package/dist/components/code/index.js +2 -2
  140. package/dist/components/code-block/chrome.js +6 -6
  141. package/dist/components/code-block/index.js +7 -7
  142. package/dist/components/code-block/static.js +4 -1
  143. package/dist/components/code-block/static.js.map +1 -1
  144. package/dist/components/collapse/index.js +2 -2
  145. package/dist/components/combobox/index.js +6 -6
  146. package/dist/components/combobox-list/index.js +8 -8
  147. package/dist/components/compare/index.js +2 -2
  148. package/dist/components/container/index.js +1 -1
  149. package/dist/components/data-table/index.js +32 -32
  150. package/dist/components/date-picker/index.js +15 -15
  151. package/dist/components/divider/index.js +2 -2
  152. package/dist/components/download-button/index.js +5 -5
  153. package/dist/components/drawer/index.js +6 -6
  154. package/dist/components/field/index.js +2 -2
  155. package/dist/components/figure/index.js +2 -2
  156. package/dist/components/file-item/index.js +8 -8
  157. package/dist/components/file-preview/index.js +6 -6
  158. package/dist/components/file-queue-summary/index.js +2 -2
  159. package/dist/components/file-trigger/index.js +5 -5
  160. package/dist/components/file-upload/index.js +10 -10
  161. package/dist/components/flex/index.js +2 -2
  162. package/dist/components/gallery/index.js +4 -4
  163. package/dist/components/grid/index.js +1 -1
  164. package/dist/components/hover-card/index.js +2 -2
  165. package/dist/components/image/index.js +2 -2
  166. package/dist/components/image-cropper/index.js +7 -7
  167. package/dist/components/indicator/index.js +1 -1
  168. package/dist/components/input/index.js +3 -3
  169. package/dist/components/kbd/index.js +3 -3
  170. package/dist/components/lightbox/index.js +9 -9
  171. package/dist/components/mark/index.js +2 -2
  172. package/dist/components/menu/index.js +4 -4
  173. package/dist/components/modal/index.js +6 -6
  174. package/dist/components/multi-combobox-list/index.js +10 -10
  175. package/dist/components/multi-select/index.js +9 -9
  176. package/dist/components/nav-link/index.js +5 -5
  177. package/dist/components/nav-link/tanstack.js +5 -5
  178. package/dist/components/notification/index.js +7 -7
  179. package/dist/components/number-input/index.js +6 -6
  180. package/dist/components/overlays/index.js +8 -8
  181. package/dist/components/password-input/index.js +4 -4
  182. package/dist/components/photo-capture/index.js +17 -17
  183. package/dist/components/pill/index.js +3 -3
  184. package/dist/components/pills-input/index.js +6 -6
  185. package/dist/components/pin-input/index.js +3 -3
  186. package/dist/components/popover/index.js +2 -2
  187. package/dist/components/progress/index.js +2 -2
  188. package/dist/components/radio-group/index.js +4 -4
  189. package/dist/components/rating/index.js +3 -3
  190. package/dist/components/schedule/index.js +9 -9
  191. package/dist/components/segment-group/index.js +3 -3
  192. package/dist/components/select/index.js +7 -7
  193. package/dist/components/skeleton/index.js +2 -2
  194. package/dist/components/slider/index.js +4 -4
  195. package/dist/components/spinner/index.js +2 -2
  196. package/dist/components/spotlight/index.js +15 -15
  197. package/dist/components/switch/index.js +3 -3
  198. package/dist/components/table/index.js +3 -3
  199. package/dist/components/tabs/index.js +3 -3
  200. package/dist/components/tags-input/index.js +8 -8
  201. package/dist/components/text/index.js +2 -2
  202. package/dist/components/text-input/index.js +3 -3
  203. package/dist/components/textarea/index.js +3 -3
  204. package/dist/components/theme-icon/index.js +3 -3
  205. package/dist/components/time-input/index.js +8 -8
  206. package/dist/components/timeline/index.js +1 -1
  207. package/dist/components/title/index.js +2 -2
  208. package/dist/components/tooltip/index.js +3 -3
  209. package/dist/components/tree-multi-select/index.js +10 -10
  210. package/dist/components/tree-select/index.js +7 -7
  211. package/dist/index.js +2 -2
  212. package/dist/lib/cn.d.ts.map +1 -1
  213. package/dist/lib/cn.js +1 -1
  214. package/package.json +1 -1
  215. package/src/components/card/card.test.tsx +10 -0
  216. package/src/components/card/card.tsx +4 -1
  217. package/src/lib/cn.test.ts +9 -0
  218. package/src/lib/cn.ts +9 -1
  219. package/dist/chunk-QP4I37PA.js +0 -14
  220. package/dist/chunk-QP4I37PA.js.map +0 -1
  221. package/dist/chunk-Z5WYYDG2.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/pills-input/pills-input.tsx"],"names":[],"mappings":";;;;;;;;;;;AAsDO,IAAM,UAAA,GAAa,GAAG,aAAa;AAMnC,IAAM,YAAA,GAAe,IAAI,2DAAA,EAA6D;AAAA,EAC3F,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,OAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI;AAAA;AACN,GACF;AA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AA,SAAA,GAAY,KAAK,CAAA;AAAA,IACnB,CAAA;AAAA,IACC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAGK,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACtD,KAAA,EAAO;AACT,CAAC","file":"chunk-ZWOZL4XX.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n Children,\n type ComponentPropsWithoutRef,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { useLocale } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useElementSize } from \"../../lib/use-element-size\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { PillGroupContext, type PillSize, pill } from \"../pill/pill\"\n\n/**\n * PillsInput — a multi-line input shell that lays out `Pill`s alongside a search\n * field. Same chrome as `Input` (border, focus ring, invalid / disabled states)\n * but it wraps as values accumulate. It's the visual `MultiSelect` and\n * `TagsInput` mount as their target.\n *\n * - It reuses `Input`'s slot layout: a `startSlot` / `endSlot` flank a\n * `pillsContent` region that holds the `Pill`s + the field and is the only\n * thing that wraps, so a trailing control (chevron, clear) pins to the edge\n * instead of wrapping inline with the pills.\n * - Host `Pill`s + a single `PillsInputField` inside it (pills first, field\n * last). The shell sets the pill `size` / `disabled` through context, so the\n * pills match with no prop drilling.\n * - `maxLines` caps the pills at N rows and collapses the rest into a static\n * \"+N\" counter (measured, since pills have variable widths).\n *\n * Presentational by design: the value state lives with the consumer.\n */\n\n/** The pills *row*: same single-line flex shell as `inputShell`, just text-cursor\n * for the click-to-focus affordance. Layout/wrap live on `pillsContent`. */\nexport const pillsShell = cn(\"cursor-text\")\n\n/** The wrapping region inside a pills shell — holds the pills + field, grows to\n * fill the row (`flex-1`), and is the only element that wraps, so the shell's\n * start/end slots stay pinned as `shrink-0` siblings. Gap tracks `inputShell`'s\n * per-size gap so pill spacing is unchanged from the flat layout. */\nexport const pillsContent = cva(\"flex min-w-0 flex-1 flex-wrap items-center py-1 gap-y-0.5\", {\n variants: {\n size: {\n xs: \"gap-1.5\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-2.5\",\n xl: \"gap-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\n// `useLayoutEffect` measures before paint (no flash); fall back to `useEffect`\n// on the server so SSR doesn't warn. Measurement is client-only anyway — the\n// server render shows every pill, which is the correct no-cap fallback.\nconst useIsoLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect\n\n/**\n * Pure row-grouping math behind `usePillOverflow` (exported for testing).\n *\n * Given each measured pill's `offsetTop` (in document order), count how many\n * fit within `maxLines` wrapped rows. A jump in `offsetTop` (beyond a sub-pixel\n * epsilon) marks a new row. When the pills overflow, reserve one slot on the\n * last visible row for the \"+N\" counter (it's narrower than a typical pill, so\n * dropping one always makes room).\n */\nexport function visiblePillCount(offsetTops: number[], maxLines: number): number {\n let rows = 0\n let lastTop = Number.NEGATIVE_INFINITY\n for (let i = 0; i < offsetTops.length; i++) {\n const top = offsetTops[i] ?? lastTop\n if (top - lastTop > 1) {\n rows += 1\n lastTop = top\n if (rows > maxLines) {\n // `i` begins the row past the cap — keep the rows before it, minus one\n // for the counter.\n return Math.max(0, i - 1)\n }\n }\n }\n return offsetTops.length\n}\n\n/**\n * Like `visiblePillCount`, but also keeps the trailing input field on the last\n * visible row (exported for testing).\n *\n * `visiblePillCount` only reasons about pills, so when the last visible row is\n * packed, the field — which is `min-w-16` and the last flex child — can't claim\n * its minimum width and wraps onto a new line. A flex item wraps exactly when\n * the space left on its row drops below its `min-width`, so we drop pills until\n * the last visible pill leaves room on its row for `gap + fieldMinWidth` (plus\n * the `+N` counter, once anything is hidden). Pills are passed as `{ top, end }`,\n * where `end` is how far the pill's inline-end edge sits from the row's\n * inline-start edge, and `rowEnd` is the row's inline length — logical, so the\n * same math holds in RTL, where the free space is on the pill's left. Removing a\n * trailing pill never reflows the ones before it, so each drop is checked\n * against real geometry.\n */\nexport function pillCountWithField(\n pills: { top: number; end: number }[],\n maxLines: number,\n rowEnd: number,\n trailing: { fieldMinWidth: number; counterWidth: number; gap: number },\n): number {\n const total = pills.length\n const { fieldMinWidth, counterWidth, gap } = trailing\n // Start from the pill-only cap (already reserves one slot for the counter on\n // overflow), then back off until the field's minimum fits on the last row.\n let visible = visiblePillCount(\n pills.map((p) => p.top),\n maxLines,\n )\n while (visible > 0) {\n const last = pills[visible - 1]\n if (last == null) break\n // Hiding any pill surfaces the \"+N\" counter, which shares the last row.\n const needsCounter = visible < total\n const trailingWidth = gap + fieldMinWidth + (needsCounter ? counterWidth + gap : 0)\n if (last.end + trailingWidth <= rowEnd) break\n visible--\n }\n return visible\n}\n\n/**\n * Measure how many pills fit within `maxLines` rows and how many overflow.\n *\n * Line caps are width-dependent (pills vary in width), so this measures the DOM.\n * Pills to be measured must carry `data-overflow-item`; the trailing field and\n * the counter must NOT (they would corrupt row detection) — instead the field\n * carries `data-overflow-field` and the counter `data-overflow-counter` so the\n * hook can locate and measure them without mistaking them for pills. The hook\n * renders the full set during a pre-paint \"measuring\" pass, groups pills into\n * rows, then settles on a `visibleCount` — reserving the last row for the \"+N\"\n * chip and, when a field is present, its `min-width` too, so the field never\n * wraps onto a new line (see `pillCountWithField`). Re-measures on width change\n * only (ignoring the height change our own slicing causes, which would loop).\n *\n * `measuring` is exposed so consumers can render the counter during the\n * measuring pass (it is otherwise hidden when nothing overflows), letting the\n * hook measure its real width for the last-row reservation.\n */\nexport function usePillOverflow({\n maxLines,\n count,\n}: {\n /** Cap the rendered pills at this many rows. Omit to render every pill. */\n maxLines?: number\n /** Total number of pills — drives re-measurement on add / remove. */\n count: number\n}): {\n containerRef: RefObject<HTMLDivElement | null>\n visibleCount: number\n hiddenCount: number\n measuring: boolean\n} {\n const containerRef = useRef<HTMLDivElement>(null)\n const [visibleCount, setVisibleCount] = useState(count)\n // While true, every pill is rendered so the DOM reflects the full set; flipped\n // off (pre-paint) once the cutoff is computed.\n const [measuring, setMeasuring] = useState(true)\n const lastWidth = useRef(0)\n\n // Any change to the inputs re-enters a full-render measuring pass.\n useIsoLayoutEffect(() => {\n setMeasuring(true)\n }, [count, maxLines])\n\n useIsoLayoutEffect(() => {\n if (!measuring) return\n const container = containerRef.current\n if (maxLines == null || container == null) {\n setVisibleCount(count)\n setMeasuring(false)\n return\n }\n const items = Array.from(container.querySelectorAll<HTMLElement>(\"[data-overflow-item]\"))\n lastWidth.current = container.clientWidth\n\n const fieldEl = container.querySelector<HTMLElement>(\"[data-overflow-field]\")\n if (fieldEl == null) {\n // No trailing field (e.g. TreeMultiSelect's read-only trigger) — pills +\n // counter only, the original behavior.\n setVisibleCount(\n visiblePillCount(\n items.map((el) => el.offsetTop),\n maxLines,\n ),\n )\n setMeasuring(false)\n return\n }\n\n // Field-aware: reserve the field's min width (and the counter slot) on the\n // last visible row. Measure in viewport coords via `getBoundingClientRect`\n // so pill edges and the row's edges share one coordinate space regardless\n // of `offsetParent` (the positioned shell, not this container), then turn\n // them into inline offsets from the row's start: under RTL the row fills\n // from the right, and a physical `right` would read every pill as already\n // touching the row's end.\n const style = getComputedStyle(container)\n const gap = Number.parseFloat(style.columnGap || style.gap) || 0\n const row = container.getBoundingClientRect()\n const rtl = style.direction === \"rtl\"\n const inlineEnd = (rect: DOMRect) => (rtl ? row.right - rect.left : rect.right - row.left)\n const fieldMinWidth = Number.parseFloat(getComputedStyle(fieldEl).minWidth) || 0\n const counterEl = container.querySelector<HTMLElement>(\"[data-overflow-counter]\")\n const counterWidth = counterEl?.getBoundingClientRect().width ?? 0\n const pills = items.map((el) => {\n const rect = el.getBoundingClientRect()\n return { top: rect.top, end: inlineEnd(rect) }\n })\n setVisibleCount(\n pillCountWithField(pills, maxLines, row.width, { fieldMinWidth, counterWidth, gap }),\n )\n setMeasuring(false)\n }, [measuring, count, maxLines])\n\n // Re-measure when the field's width changes (a wider field reveals more\n // pills again). Ignore height-only changes — our own slicing shrinks the\n // height and would otherwise feed back into an infinite measure loop.\n const width = useElementSize(containerRef, { enabled: maxLines != null })?.width\n useIsoLayoutEffect(() => {\n if (width === undefined || Math.abs(width - lastWidth.current) < 1) return\n lastWidth.current = width\n setMeasuring(true)\n }, [width])\n\n const resolved = maxLines == null || measuring ? count : Math.min(visibleCount, count)\n return {\n containerRef,\n visibleCount: resolved,\n hiddenCount: Math.max(0, count - resolved),\n measuring,\n }\n}\n\n/** The wording of the pill controls' \"+N\" counter — shared by `PillsInput`, `MultiSelect`,\n * `TagsInput` and `TreeMultiSelect`, each taking it on its own `translations`. */\nexport type PillsInputTranslations = {\n /** What a screen reader hears for the \"+N\" counter, instead of \"plus 3\". Gets the hidden\n * count (for plural rules) and that count formatted for the locale.\n * Default `(count, n) => \\`${n} more items\\`` (\"item\" for one). */\n overflowCount?: (count: number, formatted: string) => string\n}\n\nconst englishPlural = new Intl.PluralRules(\"en-US\")\n\nexport const PILLS_INPUT_DEFAULT_TRANSLATIONS = {\n overflowCount: (count, formatted) =>\n `${formatted} more ${englishPlural.select(count) === \"one\" ? \"item\" : \"items\"}`,\n} as const satisfies Required<PillsInputTranslations>\n\nexport type PillOverflowCounterProps = {\n /** How many pills are hidden. */\n count: number\n size?: PillSize\n className?: string\n /** The owning control's `translations`; only `overflowCount` is read. */\n translations?: PillsInputTranslations\n}\n\n/** Static \"+N\" chip the pill controls render at the end of the visible rows.\n * Non-interactive: the \"+N\" is drawn in the locale's digits and sign (`+٣` in\n * `ar-EG`) and hidden from screen readers, which read `overflowCount` instead.\n * The full set stays reachable via the dropdown (where one exists) or the\n * consumer's own state. */\nexport const PillOverflowCounter = ({\n count,\n size = \"md\",\n className,\n translations,\n}: PillOverflowCounterProps) => {\n const locale = useLocale()\n // The one key it reads; an owner forwarding `{ overflowCount: undefined }` keeps the default.\n const overflowCount =\n translations?.overflowCount ?? PILLS_INPUT_DEFAULT_TRANSLATIONS.overflowCount\n return (\n // `relative`: contains the absolutely positioned `sr-only` text.\n <span data-overflow-counter className={cn(pill({ size }), \"relative tabular-nums\", className)}>\n <span aria-hidden>\n {new Intl.NumberFormat(locale, { signDisplay: \"always\" }).format(count)}\n </span>\n <span className=\"sr-only\">\n {overflowCount(count, new Intl.NumberFormat(locale).format(count))}\n </span>\n </span>\n )\n}\n\ntype PillsInputClassNames = {\n root?: string\n content?: string\n startSlot?: string\n endSlot?: string\n}\n\nexport type PillsInputProps = NoAsChild<Omit<HTMLArkProps<\"div\">, \"color\">> &\n WithTestId & {\n size?: InputSize\n variant?: InputVariant\n color?: Color\n invalid?: boolean\n disabled?: boolean\n pointer?: boolean\n /** Cap the pills at N rows; the rest collapse into a static \"+N\" counter. */\n maxLines?: number\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before any trailing control. */\n endSlot?: ReactNode\n classNames?: PillsInputClassNames\n /** The \"+N\" counter's screen-reader wording — see `PillsInputTranslations`. */\n translations?: PillsInputTranslations\n }\n\n/**\n * PillsInput — the wrapping input shell for multi-value fields. Host `Pill`s\n * and a single `PillsInput.Field` inside; the shell sizes and disables them\n * through context. Presentational by design: it holds no value state.\n *\n * `testId` here lands on the shell `<div>` itself — useful when `PillsInput`\n * is used bare. `PillsInput.Field` has its own `testId`, landing on the real\n * focusable `<input>`; prefer that one when targeting the field.\n */\nconst PillsInputBase = ({\n size = \"md\",\n variant = \"default\",\n color,\n invalid,\n disabled,\n pointer,\n maxLines,\n startSlot,\n endSlot,\n className,\n classNames,\n children,\n testId,\n translations,\n asChild: _asChild,\n ...rest\n}: PillsInputProps) => {\n // Convention: pills first, the field last. Only the pills feed the line cap;\n // the field always stays visible (it is never sliced away).\n const items = Children.toArray(children)\n const field = items.length > 0 ? items[items.length - 1] : null\n const pills = items.length > 0 ? items.slice(0, -1) : []\n\n const { containerRef, visibleCount, hiddenCount, measuring } = usePillOverflow({\n maxLines,\n count: pills.length,\n })\n\n const renderedPills = (maxLines == null ? pills : pills.slice(0, visibleCount)).map((child, i) =>\n isValidElement(child)\n ? cloneElement(child as ReactElement<Record<string, unknown>>, {\n key: child.key ?? i,\n \"data-overflow-item\": true,\n })\n : child,\n )\n\n return (\n <PillGroupContext.Provider value={{ size, disabled }}>\n <ark.div\n data-color={color}\n {...props({\n \"data-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-pointer\": pointer,\n // Slot-aware padding in `inputShell` — see InputBase for the rationale.\n \"data-with-start-slot\": startSlot != null,\n \"data-with-end-slot\": endSlot != null,\n \"data-testid\": testId,\n })}\n className={cn(inputShell({ size, variant }), pillsShell, className, classNames?.root)}\n {...rest}\n >\n {startSlot != null && (\n <span className={cn(inputSlot, classNames?.startSlot)} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={cn(pillsContent({ size }), classNames?.content)}>\n {renderedPills}\n {/* Mounted during the measuring pass so the hook can size the last-row\n reservation off the real counter, but kept `invisible` then (still\n measurable) so it never paints on the SSR HTML before the first\n measure. Only mounts while measuring when a cap is configured. */}\n {(hiddenCount > 0 || (measuring && maxLines != null)) && (\n <PillOverflowCounter\n count={measuring ? pills.length : hiddenCount}\n size={size}\n className={measuring ? \"invisible\" : undefined}\n translations={translations}\n />\n )}\n {field}\n </div>\n {endSlot != null && <span className={cn(inputSlot, classNames?.endSlot)}>{endSlot}</span>}\n </ark.div>\n </PillGroupContext.Provider>\n )\n}\n\nexport type PillsInputFieldProps = ComponentPropsWithoutRef<\"input\"> &\n WithTestId & {\n /** Fired on Backspace when the field is empty — pop the last value. */\n onRemoveLast?: () => void\n }\n\nconst PillsInputField = ({\n className,\n onRemoveLast,\n onKeyDown,\n testId,\n ...rest\n}: PillsInputFieldProps) => (\n <input\n // The trailing field the overflow hook keeps on the last visible row.\n data-overflow-field\n // Grow to fill the line, but keep a clickable minimum when empty. Overrides\n // `inputControlClasses`' `w-full min-w-0` so pills can share the row.\n className={cn(inputControlClasses, \"w-auto min-w-16\", className)}\n onKeyDown={(event) => {\n if (onRemoveLast && event.key === \"Backspace\" && event.currentTarget.value === \"\") {\n onRemoveLast()\n }\n onKeyDown?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const PillsInput = Object.assign(PillsInputBase, {\n Field: PillsInputField,\n})\n"]}
1
+ {"version":3,"sources":["../src/components/pills-input/pills-input.tsx"],"names":[],"mappings":";;;;;;;;;;;AAsDO,IAAM,UAAA,GAAa,GAAG,aAAa;AAMnC,IAAM,YAAA,GAAe,IAAI,2DAAA,EAA6D;AAAA,EAC3F,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,OAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI;AAAA;AACN,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AAC3B,CAAC;AAKD,IAAM,kBAAA,GAAqB,OAAO,QAAA,KAAa,WAAA,GAAc,eAAA,GAAkB,SAAA;AAWxE,SAAS,gBAAA,CAAiB,YAAsB,QAAA,EAA0B;AAC/E,EAAA,IAAI,IAAA,GAAO,CAAA;AACX,EAAA,IAAI,UAAU,MAAA,CAAO,iBAAA;AACrB,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,UAAA,CAAW,QAAQ,CAAA,EAAA,EAAK;AAC1C,IAAA,MAAM,GAAA,GAAM,UAAA,CAAW,CAAC,CAAA,IAAK,OAAA;AAC7B,IAAA,IAAI,GAAA,GAAM,UA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AAAA,cACA,SAAA,EAAW,YAAY,WAAA,GAAc,MAAA;AAAA,cACrC;AAAA;AAAA,WACF;AAAA,UAED;AAAA,SAAA,EACH,CAAA;AAAA,QACC,OAAA,IAAW,IAAA,oBAAQ,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,GAAG,SAAA,EAAW,UAAA,EAAY,OAAO,CAAA,EAAI,QAAA,EAAA,OAAA,EAAQ;AAAA;AAAA;AAAA,GACpF,EACF,CAAA;AAEJ,CAAA;AAQA,IAAM,kBAAkB,CAAC;AAAA,EACvB,SAAA;AAAA,EACA,YAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA;AAAA,EAAC,OAAA;AAAA,EAAA;AAAA,IAEC,qBAAA,EAAmB,IAAA;AAAA,IAGnB,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,iBAAA,EAAmB,SAAS,CAAA;AAAA,IAC/D,SAAA,EAAW,CAAC,KAAA,KAAU;AACpB,MAAA,IAAI,gBAAgB,KAAA,CAAM,GAAA,KAAQ,eAAe,KAAA,CAAM,aAAA,CAAc,UAAU,EAAA,EAAI;AACjF,QAAA,YAAA,EAAa;AAAA,MACf;AACA,MAAA,SAAA,GAAY,KAAK,CAAA;AAAA,IACnB,CAAA;AAAA,IACC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAGK,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACtD,KAAA,EAAO;AACT,CAAC","file":"chunk-O5W3QWJ6.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n Children,\n type ComponentPropsWithoutRef,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { useLocale } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useElementSize } from \"../../lib/use-element-size\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { PillGroupContext, type PillSize, pill } from \"../pill/pill\"\n\n/**\n * PillsInput — a multi-line input shell that lays out `Pill`s alongside a search\n * field. Same chrome as `Input` (border, focus ring, invalid / disabled states)\n * but it wraps as values accumulate. It's the visual `MultiSelect` and\n * `TagsInput` mount as their target.\n *\n * - It reuses `Input`'s slot layout: a `startSlot` / `endSlot` flank a\n * `pillsContent` region that holds the `Pill`s + the field and is the only\n * thing that wraps, so a trailing control (chevron, clear) pins to the edge\n * instead of wrapping inline with the pills.\n * - Host `Pill`s + a single `PillsInputField` inside it (pills first, field\n * last). The shell sets the pill `size` / `disabled` through context, so the\n * pills match with no prop drilling.\n * - `maxLines` caps the pills at N rows and collapses the rest into a static\n * \"+N\" counter (measured, since pills have variable widths).\n *\n * Presentational by design: the value state lives with the consumer.\n */\n\n/** The pills *row*: same single-line flex shell as `inputShell`, just text-cursor\n * for the click-to-focus affordance. Layout/wrap live on `pillsContent`. */\nexport const pillsShell = cn(\"cursor-text\")\n\n/** The wrapping region inside a pills shell — holds the pills + field, grows to\n * fill the row (`flex-1`), and is the only element that wraps, so the shell's\n * start/end slots stay pinned as `shrink-0` siblings. Gap tracks `inputShell`'s\n * per-size gap so pill spacing is unchanged from the flat layout. */\nexport const pillsContent = cva(\"flex min-w-0 flex-1 flex-wrap items-center py-1 gap-y-0.5\", {\n variants: {\n size: {\n xs: \"gap-1.5\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-2.5\",\n xl: \"gap-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\n// `useLayoutEffect` measures before paint (no flash); fall back to `useEffect`\n// on the server so SSR doesn't warn. Measurement is client-only anyway — the\n// server render shows every pill, which is the correct no-cap fallback.\nconst useIsoLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect\n\n/**\n * Pure row-grouping math behind `usePillOverflow` (exported for testing).\n *\n * Given each measured pill's `offsetTop` (in document order), count how many\n * fit within `maxLines` wrapped rows. A jump in `offsetTop` (beyond a sub-pixel\n * epsilon) marks a new row. When the pills overflow, reserve one slot on the\n * last visible row for the \"+N\" counter (it's narrower than a typical pill, so\n * dropping one always makes room).\n */\nexport function visiblePillCount(offsetTops: number[], maxLines: number): number {\n let rows = 0\n let lastTop = Number.NEGATIVE_INFINITY\n for (let i = 0; i < offsetTops.length; i++) {\n const top = offsetTops[i] ?? lastTop\n if (top - lastTop > 1) {\n rows += 1\n lastTop = top\n if (rows > maxLines) {\n // `i` begins the row past the cap — keep the rows before it, minus one\n // for the counter.\n return Math.max(0, i - 1)\n }\n }\n }\n return offsetTops.length\n}\n\n/**\n * Like `visiblePillCount`, but also keeps the trailing input field on the last\n * visible row (exported for testing).\n *\n * `visiblePillCount` only reasons about pills, so when the last visible row is\n * packed, the field — which is `min-w-16` and the last flex child — can't claim\n * its minimum width and wraps onto a new line. A flex item wraps exactly when\n * the space left on its row drops below its `min-width`, so we drop pills until\n * the last visible pill leaves room on its row for `gap + fieldMinWidth` (plus\n * the `+N` counter, once anything is hidden). Pills are passed as `{ top, end }`,\n * where `end` is how far the pill's inline-end edge sits from the row's\n * inline-start edge, and `rowEnd` is the row's inline length — logical, so the\n * same math holds in RTL, where the free space is on the pill's left. Removing a\n * trailing pill never reflows the ones before it, so each drop is checked\n * against real geometry.\n */\nexport function pillCountWithField(\n pills: { top: number; end: number }[],\n maxLines: number,\n rowEnd: number,\n trailing: { fieldMinWidth: number; counterWidth: number; gap: number },\n): number {\n const total = pills.length\n const { fieldMinWidth, counterWidth, gap } = trailing\n // Start from the pill-only cap (already reserves one slot for the counter on\n // overflow), then back off until the field's minimum fits on the last row.\n let visible = visiblePillCount(\n pills.map((p) => p.top),\n maxLines,\n )\n while (visible > 0) {\n const last = pills[visible - 1]\n if (last == null) break\n // Hiding any pill surfaces the \"+N\" counter, which shares the last row.\n const needsCounter = visible < total\n const trailingWidth = gap + fieldMinWidth + (needsCounter ? counterWidth + gap : 0)\n if (last.end + trailingWidth <= rowEnd) break\n visible--\n }\n return visible\n}\n\n/**\n * Measure how many pills fit within `maxLines` rows and how many overflow.\n *\n * Line caps are width-dependent (pills vary in width), so this measures the DOM.\n * Pills to be measured must carry `data-overflow-item`; the trailing field and\n * the counter must NOT (they would corrupt row detection) — instead the field\n * carries `data-overflow-field` and the counter `data-overflow-counter` so the\n * hook can locate and measure them without mistaking them for pills. The hook\n * renders the full set during a pre-paint \"measuring\" pass, groups pills into\n * rows, then settles on a `visibleCount` — reserving the last row for the \"+N\"\n * chip and, when a field is present, its `min-width` too, so the field never\n * wraps onto a new line (see `pillCountWithField`). Re-measures on width change\n * only (ignoring the height change our own slicing causes, which would loop).\n *\n * `measuring` is exposed so consumers can render the counter during the\n * measuring pass (it is otherwise hidden when nothing overflows), letting the\n * hook measure its real width for the last-row reservation.\n */\nexport function usePillOverflow({\n maxLines,\n count,\n}: {\n /** Cap the rendered pills at this many rows. Omit to render every pill. */\n maxLines?: number\n /** Total number of pills — drives re-measurement on add / remove. */\n count: number\n}): {\n containerRef: RefObject<HTMLDivElement | null>\n visibleCount: number\n hiddenCount: number\n measuring: boolean\n} {\n const containerRef = useRef<HTMLDivElement>(null)\n const [visibleCount, setVisibleCount] = useState(count)\n // While true, every pill is rendered so the DOM reflects the full set; flipped\n // off (pre-paint) once the cutoff is computed.\n const [measuring, setMeasuring] = useState(true)\n const lastWidth = useRef(0)\n\n // Any change to the inputs re-enters a full-render measuring pass.\n useIsoLayoutEffect(() => {\n setMeasuring(true)\n }, [count, maxLines])\n\n useIsoLayoutEffect(() => {\n if (!measuring) return\n const container = containerRef.current\n if (maxLines == null || container == null) {\n setVisibleCount(count)\n setMeasuring(false)\n return\n }\n const items = Array.from(container.querySelectorAll<HTMLElement>(\"[data-overflow-item]\"))\n lastWidth.current = container.clientWidth\n\n const fieldEl = container.querySelector<HTMLElement>(\"[data-overflow-field]\")\n if (fieldEl == null) {\n // No trailing field (e.g. TreeMultiSelect's read-only trigger) — pills +\n // counter only, the original behavior.\n setVisibleCount(\n visiblePillCount(\n items.map((el) => el.offsetTop),\n maxLines,\n ),\n )\n setMeasuring(false)\n return\n }\n\n // Field-aware: reserve the field's min width (and the counter slot) on the\n // last visible row. Measure in viewport coords via `getBoundingClientRect`\n // so pill edges and the row's edges share one coordinate space regardless\n // of `offsetParent` (the positioned shell, not this container), then turn\n // them into inline offsets from the row's start: under RTL the row fills\n // from the right, and a physical `right` would read every pill as already\n // touching the row's end.\n const style = getComputedStyle(container)\n const gap = Number.parseFloat(style.columnGap || style.gap) || 0\n const row = container.getBoundingClientRect()\n const rtl = style.direction === \"rtl\"\n const inlineEnd = (rect: DOMRect) => (rtl ? row.right - rect.left : rect.right - row.left)\n const fieldMinWidth = Number.parseFloat(getComputedStyle(fieldEl).minWidth) || 0\n const counterEl = container.querySelector<HTMLElement>(\"[data-overflow-counter]\")\n const counterWidth = counterEl?.getBoundingClientRect().width ?? 0\n const pills = items.map((el) => {\n const rect = el.getBoundingClientRect()\n return { top: rect.top, end: inlineEnd(rect) }\n })\n setVisibleCount(\n pillCountWithField(pills, maxLines, row.width, { fieldMinWidth, counterWidth, gap }),\n )\n setMeasuring(false)\n }, [measuring, count, maxLines])\n\n // Re-measure when the field's width changes (a wider field reveals more\n // pills again). Ignore height-only changes — our own slicing shrinks the\n // height and would otherwise feed back into an infinite measure loop.\n const width = useElementSize(containerRef, { enabled: maxLines != null })?.width\n useIsoLayoutEffect(() => {\n if (width === undefined || Math.abs(width - lastWidth.current) < 1) return\n lastWidth.current = width\n setMeasuring(true)\n }, [width])\n\n const resolved = maxLines == null || measuring ? count : Math.min(visibleCount, count)\n return {\n containerRef,\n visibleCount: resolved,\n hiddenCount: Math.max(0, count - resolved),\n measuring,\n }\n}\n\n/** The wording of the pill controls' \"+N\" counter — shared by `PillsInput`, `MultiSelect`,\n * `TagsInput` and `TreeMultiSelect`, each taking it on its own `translations`. */\nexport type PillsInputTranslations = {\n /** What a screen reader hears for the \"+N\" counter, instead of \"plus 3\". Gets the hidden\n * count (for plural rules) and that count formatted for the locale.\n * Default `(count, n) => \\`${n} more items\\`` (\"item\" for one). */\n overflowCount?: (count: number, formatted: string) => string\n}\n\nconst englishPlural = new Intl.PluralRules(\"en-US\")\n\nexport const PILLS_INPUT_DEFAULT_TRANSLATIONS = {\n overflowCount: (count, formatted) =>\n `${formatted} more ${englishPlural.select(count) === \"one\" ? \"item\" : \"items\"}`,\n} as const satisfies Required<PillsInputTranslations>\n\nexport type PillOverflowCounterProps = {\n /** How many pills are hidden. */\n count: number\n size?: PillSize\n className?: string\n /** The owning control's `translations`; only `overflowCount` is read. */\n translations?: PillsInputTranslations\n}\n\n/** Static \"+N\" chip the pill controls render at the end of the visible rows.\n * Non-interactive: the \"+N\" is drawn in the locale's digits and sign (`+٣` in\n * `ar-EG`) and hidden from screen readers, which read `overflowCount` instead.\n * The full set stays reachable via the dropdown (where one exists) or the\n * consumer's own state. */\nexport const PillOverflowCounter = ({\n count,\n size = \"md\",\n className,\n translations,\n}: PillOverflowCounterProps) => {\n const locale = useLocale()\n // The one key it reads; an owner forwarding `{ overflowCount: undefined }` keeps the default.\n const overflowCount =\n translations?.overflowCount ?? PILLS_INPUT_DEFAULT_TRANSLATIONS.overflowCount\n return (\n // `relative`: contains the absolutely positioned `sr-only` text.\n <span data-overflow-counter className={cn(pill({ size }), \"relative tabular-nums\", className)}>\n <span aria-hidden>\n {new Intl.NumberFormat(locale, { signDisplay: \"always\" }).format(count)}\n </span>\n <span className=\"sr-only\">\n {overflowCount(count, new Intl.NumberFormat(locale).format(count))}\n </span>\n </span>\n )\n}\n\ntype PillsInputClassNames = {\n root?: string\n content?: string\n startSlot?: string\n endSlot?: string\n}\n\nexport type PillsInputProps = NoAsChild<Omit<HTMLArkProps<\"div\">, \"color\">> &\n WithTestId & {\n size?: InputSize\n variant?: InputVariant\n color?: Color\n invalid?: boolean\n disabled?: boolean\n pointer?: boolean\n /** Cap the pills at N rows; the rest collapse into a static \"+N\" counter. */\n maxLines?: number\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before any trailing control. */\n endSlot?: ReactNode\n classNames?: PillsInputClassNames\n /** The \"+N\" counter's screen-reader wording — see `PillsInputTranslations`. */\n translations?: PillsInputTranslations\n }\n\n/**\n * PillsInput — the wrapping input shell for multi-value fields. Host `Pill`s\n * and a single `PillsInput.Field` inside; the shell sizes and disables them\n * through context. Presentational by design: it holds no value state.\n *\n * `testId` here lands on the shell `<div>` itself — useful when `PillsInput`\n * is used bare. `PillsInput.Field` has its own `testId`, landing on the real\n * focusable `<input>`; prefer that one when targeting the field.\n */\nconst PillsInputBase = ({\n size = \"md\",\n variant = \"default\",\n color,\n invalid,\n disabled,\n pointer,\n maxLines,\n startSlot,\n endSlot,\n className,\n classNames,\n children,\n testId,\n translations,\n asChild: _asChild,\n ...rest\n}: PillsInputProps) => {\n // Convention: pills first, the field last. Only the pills feed the line cap;\n // the field always stays visible (it is never sliced away).\n const items = Children.toArray(children)\n const field = items.length > 0 ? items[items.length - 1] : null\n const pills = items.length > 0 ? items.slice(0, -1) : []\n\n const { containerRef, visibleCount, hiddenCount, measuring } = usePillOverflow({\n maxLines,\n count: pills.length,\n })\n\n const renderedPills = (maxLines == null ? pills : pills.slice(0, visibleCount)).map((child, i) =>\n isValidElement(child)\n ? cloneElement(child as ReactElement<Record<string, unknown>>, {\n key: child.key ?? i,\n \"data-overflow-item\": true,\n })\n : child,\n )\n\n return (\n <PillGroupContext.Provider value={{ size, disabled }}>\n <ark.div\n data-color={color}\n {...props({\n \"data-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-pointer\": pointer,\n // Slot-aware padding in `inputShell` — see InputBase for the rationale.\n \"data-with-start-slot\": startSlot != null,\n \"data-with-end-slot\": endSlot != null,\n \"data-testid\": testId,\n })}\n className={cn(inputShell({ size, variant }), pillsShell, className, classNames?.root)}\n {...rest}\n >\n {startSlot != null && (\n <span className={cn(inputSlot, classNames?.startSlot)} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={cn(pillsContent({ size }), classNames?.content)}>\n {renderedPills}\n {/* Mounted during the measuring pass so the hook can size the last-row\n reservation off the real counter, but kept `invisible` then (still\n measurable) so it never paints on the SSR HTML before the first\n measure. Only mounts while measuring when a cap is configured. */}\n {(hiddenCount > 0 || (measuring && maxLines != null)) && (\n <PillOverflowCounter\n count={measuring ? pills.length : hiddenCount}\n size={size}\n className={measuring ? \"invisible\" : undefined}\n translations={translations}\n />\n )}\n {field}\n </div>\n {endSlot != null && <span className={cn(inputSlot, classNames?.endSlot)}>{endSlot}</span>}\n </ark.div>\n </PillGroupContext.Provider>\n )\n}\n\nexport type PillsInputFieldProps = ComponentPropsWithoutRef<\"input\"> &\n WithTestId & {\n /** Fired on Backspace when the field is empty — pop the last value. */\n onRemoveLast?: () => void\n }\n\nconst PillsInputField = ({\n className,\n onRemoveLast,\n onKeyDown,\n testId,\n ...rest\n}: PillsInputFieldProps) => (\n <input\n // The trailing field the overflow hook keeps on the last visible row.\n data-overflow-field\n // Grow to fill the line, but keep a clickable minimum when empty. Overrides\n // `inputControlClasses`' `w-full min-w-0` so pills can share the row.\n className={cn(inputControlClasses, \"w-auto min-w-16\", className)}\n onKeyDown={(event) => {\n if (onRemoveLast && event.key === \"Backspace\" && event.currentTarget.value === \"\") {\n onRemoveLast()\n }\n onKeyDown?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const PillsInput = Object.assign(PillsInputBase, {\n Field: PillsInputField,\n})\n"]}
@@ -1,9 +1,9 @@
1
- import { createDialogParts, DIALOG_PADDING, useDialogNameCheck, DialogRootProviders } from './chunk-4EU6FGGB.js';
1
+ import { createDialogParts, DIALOG_PADDING, useDialogNameCheck, DialogRootProviders } from './chunk-DA4QII2N.js';
2
2
  import { OverlayContainerProvider } from './chunk-7P32XCEU.js';
3
3
  import { useLayerGuard, NestedLayer } from './chunk-H7WOMZXO.js';
4
4
  import { props } from './chunk-WYCMIIRR.js';
5
5
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
6
- import { cn } from './chunk-QP4I37PA.js';
6
+ import { cn } from './chunk-4ASNIDV7.js';
7
7
  import { Drawer as Drawer$1 } from '@ark-ui/react/drawer';
8
8
  import { Portal } from '@ark-ui/react/portal';
9
9
  import { cva } from 'class-variance-authority';
@@ -305,5 +305,5 @@ var Drawer = Object.assign(DrawerComponent, {
305
305
  });
306
306
 
307
307
  export { Drawer };
308
- //# sourceMappingURL=chunk-PD4FX34E.js.map
309
- //# sourceMappingURL=chunk-PD4FX34E.js.map
308
+ //# sourceMappingURL=chunk-O7LS6OZR.js.map
309
+ //# sourceMappingURL=chunk-O7LS6OZR.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/drawer/drawer.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAGA,IAAM,sBAAA,GAAyB,cAA+B,KAAK,CAAA;AAEnE,IAAM,iBAAiB,GAAA,CAAI;AAAA,EACzB,8HAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,gBAAA,GAAmB,GAAA;AAAA,EACvB,oFAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,SAAA,EAAW;AAAA,QACT,KAAA,EAAO,6BAAA;AAAA,QACP,GAAA,EAAK,2BAAA;AAAA,QACL,GAAA,EAAK,6BAAA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AAO,MAAA,CAAO,eAAA,EAAiB;AAAA,EACnD,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,QAAA,EAAU,cAAA;AAAA,EACV,UAAA,EAAY,gBAAA;AAAA,EACZ,OAAA,EAAS,aAAA;AAAA,EACT,KAAA,EAAO,WAAA;AAAA,EACP,WAAA,EAAa,iBAAA;AAAA,EACb,YAAA,EAAc,kBAAA;AAAA,EACd,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAC","file":"chunk-PD4FX34E.js","sourcesContent":["\"use client\"\n\nimport { Drawer as Ark } from \"@ark-ui/react/drawer\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n useContext,\n useRef,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { NestedLayer, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport {\n createDialogParts,\n DIALOG_PADDING,\n type DialogCloseTriggerProps,\n type DialogIconSlot,\n type DialogIcons,\n DialogRootProviders,\n type DialogSectionProps,\n useDialogNameCheck,\n} from \"../overlays/dialog-parts\"\n\n/**\n * Drawer — edge-anchored panel on top of Ark UI's Drawer state machine. Ark\n * owns swipe-to-dismiss, snap points, focus-trap, scroll-lock and the\n * `data-state=\"open|closed\"` attribute; this wrapper adds an RTL-aware\n * `placement` (Ark has none). It is set once, on `Drawer.Root`, which derives\n * Ark's logical `swipeDirection` from it and shares it with the parts through\n * context; the positioner and content write it as `data-placement`. The slide\n * animation and the docked border are pure CSS keyed on `[data-placement]`\n * (see `theme.css`), so `start`/`end` flip automatically under `dir=\"rtl\"`.\n *\n * Mirrors `Modal`'s dual API: high-level `<Drawer open placement size … >` plus\n * low-level parts (`Drawer.Root`, `Drawer.Content`, …). Padding flows through\n * the `--drawer-px` CSS var.\n */\n\nexport type DrawerPlacement = \"start\" | \"end\" | \"top\" | \"bottom\"\n\n/** placement → Ark logical swipe axis (RTL handled by Ark for start/end). */\nconst PLACEMENT_TO_SWIPE = {\n start: \"start\",\n end: \"end\",\n top: \"up\",\n bottom: \"down\",\n} as const\n\n/** The root's placement, so the parts dock themselves without repeating it. */\nconst DrawerPlacementContext = createContext<DrawerPlacement>(\"end\")\n\nconst drawerBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst drawerPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex overflow-clip\",\n {\n variants: {\n placement: {\n start: \"items-stretch justify-start\",\n end: \"items-stretch justify-end\",\n top: \"items-start justify-stretch\",\n bottom: \"items-end justify-stretch\",\n },\n },\n defaultVariants: { placement: \"end\" },\n },\n)\n\nexport type DrawerPositionerProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Positioner>> &\n WithTestId\n\n/** Docks itself to the root's `placement`. Publishes itself as the portal\n * target for any overlay opened inside the drawer, so a Menu/Select/DatePicker\n * in a drawer body stays above the panel instead of behind it. See\n * `lib/overlay-container.tsx`. */\nconst DrawerPositioner = ({\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: DrawerPositionerProps) => {\n const placement = useContext(DrawerPlacementContext)\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner\n ref={positioner}\n className={cn(drawerPositioner({ placement }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n >\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nconst drawerContent = cva(\n [\n \"relative flex flex-col overflow-hidden\",\n \"bg-brand-50 text-brand-950 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-white\",\n \"focus:outline-none\",\n // border on the docked edge only — keyed by data-placement in theme.css\n \"data-[placement=start]:border-e data-[placement=end]:border-s\",\n \"data-[placement=top]:border-b data-[placement=bottom]:border-t\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out\",\n ],\n {\n variants: {\n // Internal: Content reads it from the root's context.\n placement: {\n start: \"h-full max-w-[90vw]\",\n end: \"h-full max-w-[90vw]\",\n top: \"w-full max-h-[90dvh]\",\n bottom: \"w-full max-h-[90dvh]\",\n },\n // Width for inline placements, height for block ones: see compoundVariants.\n size: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n // Only the two corners away from the docked edge round: see compoundVariants.\n radius: { none: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n },\n compoundVariants: [\n { placement: [\"start\", \"end\"], size: \"xs\", class: \"w-[18rem]\" },\n { placement: [\"start\", \"end\"], size: \"sm\", class: \"w-[22rem]\" },\n { placement: [\"start\", \"end\"], size: \"md\", class: \"w-[28rem]\" },\n { placement: [\"start\", \"end\"], size: \"lg\", class: \"w-[34rem]\" },\n { placement: [\"start\", \"end\"], size: \"xl\", class: \"w-[42rem]\" },\n { placement: [\"top\", \"bottom\"], size: \"xs\", class: \"h-[30dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"sm\", class: \"h-[40dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"md\", class: \"h-[55dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"lg\", class: \"h-[70dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"xl\", class: \"h-[85dvh]\" },\n // Logical corners, so `start`/`end` mirror under RTL with the panel.\n { placement: \"start\", radius: \"sm\", class: \"rounded-e-sm\" },\n { placement: \"start\", radius: \"md\", class: \"rounded-e-md\" },\n { placement: \"start\", radius: \"lg\", class: \"rounded-e-xl\" },\n { placement: \"start\", radius: \"xl\", class: \"rounded-e-2xl\" },\n { placement: \"end\", radius: \"sm\", class: \"rounded-s-sm\" },\n { placement: \"end\", radius: \"md\", class: \"rounded-s-md\" },\n { placement: \"end\", radius: \"lg\", class: \"rounded-s-xl\" },\n { placement: \"end\", radius: \"xl\", class: \"rounded-s-2xl\" },\n { placement: \"top\", radius: \"sm\", class: \"rounded-b-sm\" },\n { placement: \"top\", radius: \"md\", class: \"rounded-b-md\" },\n { placement: \"top\", radius: \"lg\", class: \"rounded-b-xl\" },\n { placement: \"top\", radius: \"xl\", class: \"rounded-b-2xl\" },\n { placement: \"bottom\", radius: \"sm\", class: \"rounded-t-sm\" },\n { placement: \"bottom\", radius: \"md\", class: \"rounded-t-md\" },\n { placement: \"bottom\", radius: \"lg\", class: \"rounded-t-xl\" },\n { placement: \"bottom\", radius: \"xl\", class: \"rounded-t-2xl\" },\n ],\n defaultVariants: { placement: \"end\", size: \"md\", radius: \"none\" },\n },\n)\n\n// ---------------------------------------------------------------------------\n// Low-level parts\n// ---------------------------------------------------------------------------\n\nexport type DrawerIconSlot = DialogIconSlot\nexport type DrawerIcons = DialogIcons\n\nexport type DrawerRootProps = ComponentPropsWithoutRef<typeof Ark.Root> & {\n /** RTL-aware docking edge, shared with `Drawer.Positioner` and `Drawer.Content`. Also\n * sets Ark's `swipeDirection`, unless you pass one. @default \"end\" */\n placement?: DrawerPlacement\n /** Replaces the default icons: `close`. `Drawer.CloseTrigger`'s `children` win over it. */\n icons?: DrawerIcons\n}\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * drawer is open, an outside click closes the picker only, not the drawer\n * under it. It is also a layer of its own while open, so a hotkey on the page\n * (or in an enclosing overlay) yields to it. See `lib/overlay-layer.tsx`. */\nconst DrawerRoot = ({\n placement = \"end\",\n swipeDirection,\n onPointerDownOutside,\n icons,\n children,\n ...rest\n}: DrawerRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root\n swipeDirection={swipeDirection ?? PLACEMENT_TO_SWIPE[placement]}\n onPointerDownOutside={guard.onPointerDownOutside}\n {...rest}\n >\n {/* A layer itself, registered with whatever it opened from (the page,\n or an enclosing overlay), so what's under it knows it's covered. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>\n <DrawerPlacementContext value={placement}>\n <DialogRootProviders icons={icons} layers={guard.layers}>\n {children}\n </DialogRootProviders>\n </DrawerPlacementContext>\n </Ark.Root>\n )\n}\nconst DrawerTrigger = Ark.Trigger\nconst DrawerContext = Ark.Context\n\nexport type DrawerBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nconst DrawerBackdrop = ({ className, testId, ...rest }: DrawerBackdropProps) => (\n <Ark.Backdrop\n className={cn(drawerBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nconst DrawerTitle = ({ className, testId, ...rest }: DrawerTitleProps) => (\n <Ark.Title\n className={cn(\"text-xl font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nconst DrawerDescription = ({ className, testId, ...rest }: DrawerDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm\", TEXT_COLOR_CLASSES.muted, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerSize = NonNullable<VariantProps<typeof drawerContent>[\"size\"]>\nexport type DrawerRadius = NonNullable<VariantProps<typeof drawerContent>[\"radius\"]>\n\nexport type DrawerContentProps = ComponentPropsWithoutRef<typeof Ark.Content> &\n WithTestId & {\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n }\n\n/** The panel. It sizes and rounds itself for the root's `placement`, and writes\n * it as `data-placement`, which the slide animation and the docked border key on. */\nconst DrawerContent = ({ className, size, radius, testId, ...rest }: DrawerContentProps) => {\n const placement = useContext(DrawerPlacementContext)\n const nameCheck = useDialogNameCheck(\"Drawer\")\n return (\n <Ark.Content\n ref={nameCheck}\n className={cn(drawerContent({ placement, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n />\n )\n}\n\nexport type DrawerCloseTriggerProps = DialogCloseTriggerProps\nexport type DrawerHeaderProps = DialogSectionProps\nexport type DrawerBodyProps = DialogSectionProps\nexport type DrawerFooterProps = DialogSectionProps\n\nconst {\n CloseTrigger: DrawerCloseTrigger,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n} = createDialogParts(\"drawer\", Ark.CloseTrigger)\n\nexport type DrawerGrabberProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Grabber>> &\n WithTestId\n\nconst DrawerGrabber = ({ className, testId, asChild: _asChild, ...rest }: DrawerGrabberProps) => (\n <Ark.Grabber\n className={cn(\n \"flex shrink-0 cursor-grab touch-none items-center justify-center py-2\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <Ark.GrabberIndicator className=\"h-1.5 w-20 rounded-full bg-brand-900/10 dark:bg-white/16\" />\n </Ark.Grabber>\n)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Drawer\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type DrawerClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"grabber\"\n | \"closeButton\",\n string\n >\n>\n\nexport type DrawerProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"swipeDirection\" | \"role\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, backdrop click, swipe, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** RTL-aware docking edge. @default \"end\" */\n placement?: DrawerPlacement\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n /** Header title; also the drawer's accessible name. */\n title?: ReactNode\n description?: ReactNode\n /** Accessible name for a drawer without a `title` (a navigation panel, say). */\n \"aria-label\"?: string\n /** Id of an element inside the drawer that names it, when there is no `title`. */\n \"aria-labelledby\"?: string\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /** Show the drag grabber handle. @default false */\n withGrabber?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--drawer-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n /** Close on a click outside the drawer. @default true, false for an `alertdialog` */\n closeOnInteractOutside?: boolean\n /** Use `alertdialog` semantics (confirm flows). @default \"dialog\" */\n role?: \"dialog\" | \"alertdialog\"\n /** Fires after the exit animation completes — the manager unmounts on this. */\n onExitComplete?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: DrawerClassNames\n /** Overrides the default close button's accessible name (`closeTriggerLabel`, default\n * `\"Close\"`). The compound `DrawerCloseTrigger` part takes a plain `aria-label` instead. */\n translations?: DrawerTranslations\n /** Replaces the default icons: `close`, the header's close button. */\n icons?: DrawerIcons\n }\n\n/** The ready-made drawer's wording — `closeTriggerLabel` follows Ark's naming for the\n * same control. */\nexport type DrawerTranslations = { closeTriggerLabel?: string }\n\nconst DrawerComponent = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n placement = \"end\",\n size,\n radius,\n title,\n description,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n withCloseButton = true,\n withGrabber = false,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n role,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n translations,\n icons,\n ...rest\n}: DrawerProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n\n return (\n <DrawerRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n placement={placement}\n closeOnEscape={closeOnEscape}\n // Spelled out to match Modal, whose Ark dialog derives this default from\n // `modal` (so the overlays manager's `withBackdrop={false}` would stop\n // outside clicks there). Ark's drawer defaults it to `true` for every role\n // instead, so here the one behaviour this changes is the `alertdialog`:\n // it stays sticky, as on Modal, unless the caller opts in explicitly.\n closeOnInteractOutside={closeOnInteractOutside ?? role !== \"alertdialog\"}\n role={role}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n icons={icons}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <DrawerBackdrop className={classNames?.backdrop} />}\n <DrawerPositioner className={classNames?.positioner}>\n <DrawerContent\n size={size}\n radius={radius}\n style={{ [\"--drawer-px\" as string]: DIALOG_PADDING[padding] }}\n className={cn(className, classNames?.content)}\n testId={testId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n {withGrabber && <DrawerGrabber className={classNames?.grabber} />}\n {hasHeader && (\n <DrawerHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && (\n <DrawerTitle className={classNames?.title}>{title}</DrawerTitle>\n )}\n {description != null && (\n <DrawerDescription className={classNames?.description}>\n {description}\n </DrawerDescription>\n )}\n </div>\n {withCloseButton && (\n <DrawerCloseTrigger\n aria-label={translations?.closeTriggerLabel}\n className={classNames?.closeButton}\n />\n )}\n </DrawerHeader>\n )}\n <DrawerBody\n className={cn(\n !hasHeader && !withGrabber && \"pt-(--drawer-px,1.25rem)\",\n \"pb-(--drawer-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </DrawerBody>\n </DrawerContent>\n </DrawerPositioner>\n </Portal>\n </DrawerRoot>\n )\n}\n\nexport const Drawer = Object.assign(DrawerComponent, {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Context: DrawerContext,\n Backdrop: DrawerBackdrop,\n Positioner: DrawerPositioner,\n Content: DrawerContent,\n Title: DrawerTitle,\n Description: DrawerDescription,\n CloseTrigger: DrawerCloseTrigger,\n Grabber: DrawerGrabber,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n})\n"]}
1
+ {"version":3,"sources":["../src/components/drawer/drawer.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAGA,IAAM,sBAAA,GAAyB,cAA+B,KAAK,CAAA;AAEnE,IAAM,iBAAiB,GAAA,CAAI;AAAA,EACzB,8HAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,gBAAA,GAAmB,GAAA;AAAA,EACvB,oFAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,SAAA,EAAW;AAAA,QACT,KAAA,EAAO,6BAAA;AAA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AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,eAAA,EAAiB;AAAA,EACnD,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,QAAA,EAAU,cAAA;AAAA,EACV,UAAA,EAAY,gBAAA;AAAA,EACZ,OAAA,EAAS,aAAA;AAAA,EACT,KAAA,EAAO,WAAA;AAAA,EACP,WAAA,EAAa,iBAAA;AAAA,EACb,YAAA,EAAc,kBAAA;AAAA,EACd,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAC","file":"chunk-O7LS6OZR.js","sourcesContent":["\"use client\"\n\nimport { Drawer as Ark } from \"@ark-ui/react/drawer\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n useContext,\n useRef,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { NestedLayer, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport {\n createDialogParts,\n DIALOG_PADDING,\n type DialogCloseTriggerProps,\n type DialogIconSlot,\n type DialogIcons,\n DialogRootProviders,\n type DialogSectionProps,\n useDialogNameCheck,\n} from \"../overlays/dialog-parts\"\n\n/**\n * Drawer — edge-anchored panel on top of Ark UI's Drawer state machine. Ark\n * owns swipe-to-dismiss, snap points, focus-trap, scroll-lock and the\n * `data-state=\"open|closed\"` attribute; this wrapper adds an RTL-aware\n * `placement` (Ark has none). It is set once, on `Drawer.Root`, which derives\n * Ark's logical `swipeDirection` from it and shares it with the parts through\n * context; the positioner and content write it as `data-placement`. The slide\n * animation and the docked border are pure CSS keyed on `[data-placement]`\n * (see `theme.css`), so `start`/`end` flip automatically under `dir=\"rtl\"`.\n *\n * Mirrors `Modal`'s dual API: high-level `<Drawer open placement size … >` plus\n * low-level parts (`Drawer.Root`, `Drawer.Content`, …). Padding flows through\n * the `--drawer-px` CSS var.\n */\n\nexport type DrawerPlacement = \"start\" | \"end\" | \"top\" | \"bottom\"\n\n/** placement → Ark logical swipe axis (RTL handled by Ark for start/end). */\nconst PLACEMENT_TO_SWIPE = {\n start: \"start\",\n end: \"end\",\n top: \"up\",\n bottom: \"down\",\n} as const\n\n/** The root's placement, so the parts dock themselves without repeating it. */\nconst DrawerPlacementContext = createContext<DrawerPlacement>(\"end\")\n\nconst drawerBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst drawerPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex overflow-clip\",\n {\n variants: {\n placement: {\n start: \"items-stretch justify-start\",\n end: \"items-stretch justify-end\",\n top: \"items-start justify-stretch\",\n bottom: \"items-end justify-stretch\",\n },\n },\n defaultVariants: { placement: \"end\" },\n },\n)\n\nexport type DrawerPositionerProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Positioner>> &\n WithTestId\n\n/** Docks itself to the root's `placement`. Publishes itself as the portal\n * target for any overlay opened inside the drawer, so a Menu/Select/DatePicker\n * in a drawer body stays above the panel instead of behind it. See\n * `lib/overlay-container.tsx`. */\nconst DrawerPositioner = ({\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: DrawerPositionerProps) => {\n const placement = useContext(DrawerPlacementContext)\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner\n ref={positioner}\n className={cn(drawerPositioner({ placement }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n >\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nconst drawerContent = cva(\n [\n \"relative flex flex-col overflow-hidden\",\n \"bg-brand-50 text-brand-950 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-white\",\n \"focus:outline-none\",\n // border on the docked edge only — keyed by data-placement in theme.css\n \"data-[placement=start]:border-e data-[placement=end]:border-s\",\n \"data-[placement=top]:border-b data-[placement=bottom]:border-t\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out\",\n ],\n {\n variants: {\n // Internal: Content reads it from the root's context.\n placement: {\n start: \"h-full max-w-[90vw]\",\n end: \"h-full max-w-[90vw]\",\n top: \"w-full max-h-[90dvh]\",\n bottom: \"w-full max-h-[90dvh]\",\n },\n // Width for inline placements, height for block ones: see compoundVariants.\n size: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n // Only the two corners away from the docked edge round: see compoundVariants.\n radius: { none: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n },\n compoundVariants: [\n { placement: [\"start\", \"end\"], size: \"xs\", class: \"w-[18rem]\" },\n { placement: [\"start\", \"end\"], size: \"sm\", class: \"w-[22rem]\" },\n { placement: [\"start\", \"end\"], size: \"md\", class: \"w-[28rem]\" },\n { placement: [\"start\", \"end\"], size: \"lg\", class: \"w-[34rem]\" },\n { placement: [\"start\", \"end\"], size: \"xl\", class: \"w-[42rem]\" },\n { placement: [\"top\", \"bottom\"], size: \"xs\", class: \"h-[30dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"sm\", class: \"h-[40dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"md\", class: \"h-[55dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"lg\", class: \"h-[70dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"xl\", class: \"h-[85dvh]\" },\n // Logical corners, so `start`/`end` mirror under RTL with the panel.\n { placement: \"start\", radius: \"sm\", class: \"rounded-e-sm\" },\n { placement: \"start\", radius: \"md\", class: \"rounded-e-md\" },\n { placement: \"start\", radius: \"lg\", class: \"rounded-e-xl\" },\n { placement: \"start\", radius: \"xl\", class: \"rounded-e-2xl\" },\n { placement: \"end\", radius: \"sm\", class: \"rounded-s-sm\" },\n { placement: \"end\", radius: \"md\", class: \"rounded-s-md\" },\n { placement: \"end\", radius: \"lg\", class: \"rounded-s-xl\" },\n { placement: \"end\", radius: \"xl\", class: \"rounded-s-2xl\" },\n { placement: \"top\", radius: \"sm\", class: \"rounded-b-sm\" },\n { placement: \"top\", radius: \"md\", class: \"rounded-b-md\" },\n { placement: \"top\", radius: \"lg\", class: \"rounded-b-xl\" },\n { placement: \"top\", radius: \"xl\", class: \"rounded-b-2xl\" },\n { placement: \"bottom\", radius: \"sm\", class: \"rounded-t-sm\" },\n { placement: \"bottom\", radius: \"md\", class: \"rounded-t-md\" },\n { placement: \"bottom\", radius: \"lg\", class: \"rounded-t-xl\" },\n { placement: \"bottom\", radius: \"xl\", class: \"rounded-t-2xl\" },\n ],\n defaultVariants: { placement: \"end\", size: \"md\", radius: \"none\" },\n },\n)\n\n// ---------------------------------------------------------------------------\n// Low-level parts\n// ---------------------------------------------------------------------------\n\nexport type DrawerIconSlot = DialogIconSlot\nexport type DrawerIcons = DialogIcons\n\nexport type DrawerRootProps = ComponentPropsWithoutRef<typeof Ark.Root> & {\n /** RTL-aware docking edge, shared with `Drawer.Positioner` and `Drawer.Content`. Also\n * sets Ark's `swipeDirection`, unless you pass one. @default \"end\" */\n placement?: DrawerPlacement\n /** Replaces the default icons: `close`. `Drawer.CloseTrigger`'s `children` win over it. */\n icons?: DrawerIcons\n}\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * drawer is open, an outside click closes the picker only, not the drawer\n * under it. It is also a layer of its own while open, so a hotkey on the page\n * (or in an enclosing overlay) yields to it. See `lib/overlay-layer.tsx`. */\nconst DrawerRoot = ({\n placement = \"end\",\n swipeDirection,\n onPointerDownOutside,\n icons,\n children,\n ...rest\n}: DrawerRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root\n swipeDirection={swipeDirection ?? PLACEMENT_TO_SWIPE[placement]}\n onPointerDownOutside={guard.onPointerDownOutside}\n {...rest}\n >\n {/* A layer itself, registered with whatever it opened from (the page,\n or an enclosing overlay), so what's under it knows it's covered. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>\n <DrawerPlacementContext value={placement}>\n <DialogRootProviders icons={icons} layers={guard.layers}>\n {children}\n </DialogRootProviders>\n </DrawerPlacementContext>\n </Ark.Root>\n )\n}\nconst DrawerTrigger = Ark.Trigger\nconst DrawerContext = Ark.Context\n\nexport type DrawerBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nconst DrawerBackdrop = ({ className, testId, ...rest }: DrawerBackdropProps) => (\n <Ark.Backdrop\n className={cn(drawerBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nconst DrawerTitle = ({ className, testId, ...rest }: DrawerTitleProps) => (\n <Ark.Title\n className={cn(\"text-xl font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nconst DrawerDescription = ({ className, testId, ...rest }: DrawerDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm\", TEXT_COLOR_CLASSES.muted, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerSize = NonNullable<VariantProps<typeof drawerContent>[\"size\"]>\nexport type DrawerRadius = NonNullable<VariantProps<typeof drawerContent>[\"radius\"]>\n\nexport type DrawerContentProps = ComponentPropsWithoutRef<typeof Ark.Content> &\n WithTestId & {\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n }\n\n/** The panel. It sizes and rounds itself for the root's `placement`, and writes\n * it as `data-placement`, which the slide animation and the docked border key on. */\nconst DrawerContent = ({ className, size, radius, testId, ...rest }: DrawerContentProps) => {\n const placement = useContext(DrawerPlacementContext)\n const nameCheck = useDialogNameCheck(\"Drawer\")\n return (\n <Ark.Content\n ref={nameCheck}\n className={cn(drawerContent({ placement, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n />\n )\n}\n\nexport type DrawerCloseTriggerProps = DialogCloseTriggerProps\nexport type DrawerHeaderProps = DialogSectionProps\nexport type DrawerBodyProps = DialogSectionProps\nexport type DrawerFooterProps = DialogSectionProps\n\nconst {\n CloseTrigger: DrawerCloseTrigger,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n} = createDialogParts(\"drawer\", Ark.CloseTrigger)\n\nexport type DrawerGrabberProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Grabber>> &\n WithTestId\n\nconst DrawerGrabber = ({ className, testId, asChild: _asChild, ...rest }: DrawerGrabberProps) => (\n <Ark.Grabber\n className={cn(\n \"flex shrink-0 cursor-grab touch-none items-center justify-center py-2\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <Ark.GrabberIndicator className=\"h-1.5 w-20 rounded-full bg-brand-900/10 dark:bg-white/16\" />\n </Ark.Grabber>\n)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Drawer\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type DrawerClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"grabber\"\n | \"closeButton\",\n string\n >\n>\n\nexport type DrawerProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"swipeDirection\" | \"role\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, backdrop click, swipe, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** RTL-aware docking edge. @default \"end\" */\n placement?: DrawerPlacement\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n /** Header title; also the drawer's accessible name. */\n title?: ReactNode\n description?: ReactNode\n /** Accessible name for a drawer without a `title` (a navigation panel, say). */\n \"aria-label\"?: string\n /** Id of an element inside the drawer that names it, when there is no `title`. */\n \"aria-labelledby\"?: string\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /** Show the drag grabber handle. @default false */\n withGrabber?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--drawer-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n /** Close on a click outside the drawer. @default true, false for an `alertdialog` */\n closeOnInteractOutside?: boolean\n /** Use `alertdialog` semantics (confirm flows). @default \"dialog\" */\n role?: \"dialog\" | \"alertdialog\"\n /** Fires after the exit animation completes — the manager unmounts on this. */\n onExitComplete?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: DrawerClassNames\n /** Overrides the default close button's accessible name (`closeTriggerLabel`, default\n * `\"Close\"`). The compound `DrawerCloseTrigger` part takes a plain `aria-label` instead. */\n translations?: DrawerTranslations\n /** Replaces the default icons: `close`, the header's close button. */\n icons?: DrawerIcons\n }\n\n/** The ready-made drawer's wording — `closeTriggerLabel` follows Ark's naming for the\n * same control. */\nexport type DrawerTranslations = { closeTriggerLabel?: string }\n\nconst DrawerComponent = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n placement = \"end\",\n size,\n radius,\n title,\n description,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n withCloseButton = true,\n withGrabber = false,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n role,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n translations,\n icons,\n ...rest\n}: DrawerProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n\n return (\n <DrawerRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n placement={placement}\n closeOnEscape={closeOnEscape}\n // Spelled out to match Modal, whose Ark dialog derives this default from\n // `modal` (so the overlays manager's `withBackdrop={false}` would stop\n // outside clicks there). Ark's drawer defaults it to `true` for every role\n // instead, so here the one behaviour this changes is the `alertdialog`:\n // it stays sticky, as on Modal, unless the caller opts in explicitly.\n closeOnInteractOutside={closeOnInteractOutside ?? role !== \"alertdialog\"}\n role={role}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n icons={icons}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <DrawerBackdrop className={classNames?.backdrop} />}\n <DrawerPositioner className={classNames?.positioner}>\n <DrawerContent\n size={size}\n radius={radius}\n style={{ [\"--drawer-px\" as string]: DIALOG_PADDING[padding] }}\n className={cn(className, classNames?.content)}\n testId={testId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n {withGrabber && <DrawerGrabber className={classNames?.grabber} />}\n {hasHeader && (\n <DrawerHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && (\n <DrawerTitle className={classNames?.title}>{title}</DrawerTitle>\n )}\n {description != null && (\n <DrawerDescription className={classNames?.description}>\n {description}\n </DrawerDescription>\n )}\n </div>\n {withCloseButton && (\n <DrawerCloseTrigger\n aria-label={translations?.closeTriggerLabel}\n className={classNames?.closeButton}\n />\n )}\n </DrawerHeader>\n )}\n <DrawerBody\n className={cn(\n !hasHeader && !withGrabber && \"pt-(--drawer-px,1.25rem)\",\n \"pb-(--drawer-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </DrawerBody>\n </DrawerContent>\n </DrawerPositioner>\n </Portal>\n </DrawerRoot>\n )\n}\n\nexport const Drawer = Object.assign(DrawerComponent, {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Context: DrawerContext,\n Backdrop: DrawerBackdrop,\n Positioner: DrawerPositioner,\n Content: DrawerContent,\n Title: DrawerTitle,\n Description: DrawerDescription,\n CloseTrigger: DrawerCloseTrigger,\n Grabber: DrawerGrabber,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n})\n"]}
@@ -1,6 +1,6 @@
1
- import { SegmentGroup } from './chunk-2KN3MI7I.js';
2
- import { NumberInput } from './chunk-6KER77RS.js';
3
- import { cn } from './chunk-QP4I37PA.js';
1
+ import { SegmentGroup } from './chunk-C4NFRSOR.js';
2
+ import { NumberInput } from './chunk-KMZENCEP.js';
3
+ import { cn } from './chunk-4ASNIDV7.js';
4
4
  import { useLocaleContext } from '@ark-ui/react/locale';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
@@ -246,5 +246,5 @@ var TimeRow = ({
246
246
  };
247
247
 
248
248
  export { TimeRow, dayPeriodLabels, fromDisplayHour, is12Hour, resolveHourCycle, timeRowMinWidth, toDisplayHour };
249
- //# sourceMappingURL=chunk-JL4QMM46.js.map
250
- //# sourceMappingURL=chunk-JL4QMM46.js.map
249
+ //# sourceMappingURL=chunk-POKLPMSB.js.map
250
+ //# sourceMappingURL=chunk-POKLPMSB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA,KAAW,KAAK,KAAA,GAAQ,KAAA;AACzD,EAAA,OAAO,IAAA,CAAK,eAAe,MAAA,EAAQ,EAAE,MAAM,SAAA,EAAW,CAAA,CAAE,eAAA,EAAgB,CAAE,SAAA;AAC5E;AAGO,IAAM,QAAA,GAAW,CAAC,KAAA,KAA8B,KAAA,KAAU,SAAS,KAAA,KAAU;AAI7E,IAAM,WAAA,GAA+D;AAAA,EAC1E,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA;AACtB,CAAA;AAKO,IAAM,aAAA,GAAgB,CAC3B,MAAA,EACA,KAAA,KACiD;AACjD,EAAA,MAAM,UAAA,GAAa,SAAS,KAAK,CAAA;AACjC,EAAA,MAAM,IAAA,GAAO,UAAA,GAAa,MAAA,GAAS,EAAA,GAAK,MAAA;AACxC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,IAAA,KAAS,CAAA,IAAK,WAAA,CAAY,KAAK,CAAA,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,cACd,WAAW,UAAA,EAAY,MAAA;AAAA,cACvB,UAAA,EAAY;AAAA,gBACV,KAAA,EAAO,EAAA,CAAG,QAAA,EAAU,cAAA,CAAe,IAAI,CAAC,CAAA;AAAA,gBACxC,KAAA,EAAO,SAAA;AAAA,gBACP,KAAA,EAAO;AAAA;AACT;AAAA,WACF;AAAA,UAED,cAAc,YAAA,oBACb,GAAA;AAAA,YAAC,YAAA;AAAA,YAAA;AAAA,cACC,IAAA,EAAM;AAAA,gBACJ,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,aAAa,EAAA,EAAG;AAAA,gBACtC,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,aAAa,EAAA;AAAG,eACxC;AAAA,cACA,OAAO,CAAA,CAAE,MAAA;AAAA,cACT,KAAA,EAAO,MAAA;AAAA,cACP,QAAA,EAAU,CAAC,KAAA,KAAU,cAAA,CAAe,KAAoB,CAAA;AAAA,cAGxD,IAAA;AAAA,cACA,QAAA;AAAA,cACA,QAAA;AAAA,cACA,OAAA;AAAA,cACA,WAAW,UAAA,EAAY,MAAA;AAAA,cAOvB,UAAA,EAAY,EAAE,KAAA,EAAO,iBAAA,EAAmB,OAAO,SAAA;AAAU;AAAA;AAC3D;AAAA;AAAA;AAEJ;AAEJ","file":"chunk-JL4QMM46.js","sourcesContent":["export type HourCycle = \"h11\" | \"h12\" | \"h23\" | \"h24\"\n\n/**\n * Resolve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 12 hours + AM/PM (`h11`/`h12`) rather than all 24. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** The hours each cycle displays: `h11` 0–11, `h12` 1–12, `h23` 0–23, `h24` 1–24. In the two\n * cycles that start at 1, midnight (and, for `h12`, noon) reads as the top of the range. */\nexport const HOUR_RANGES: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 },\n}\n\n/** Convert a stored 24h hour (`0`–`23`) to the hour `cycle` displays, plus its period in the\n * 12-hour cycles (`null` otherwise) — e.g. midnight is `12` AM in `h12`, `0` AM in `h11`, `0` in\n * `h23` and `24` in `h24`. */\nexport const toDisplayHour = (\n hour24: number,\n cycle: HourCycle,\n): { hour: number; period: \"AM\" | \"PM\" | null } => {\n const twelveHour = is12Hour(cycle)\n const hour = twelveHour ? hour24 % 12 : hour24\n return {\n hour: hour === 0 && HOUR_RANGES[cycle].min === 1 ? HOUR_RANGES[cycle].max : hour,\n period: twelveHour ? (hour24 < 12 ? \"AM\" : \"PM\") : null,\n }\n}\n\n/** The inverse of `toDisplayHour`: a displayed hour (+ period in the 12-hour cycles) back to a\n * stored 24h hour. A missing hour reads as the start of its half of the day — midnight, or noon\n * once PM is picked — and a missing period as AM. */\nexport const fromDisplayHour = (\n hour: number | null,\n period: \"AM\" | \"PM\" | null,\n cycle: HourCycle,\n): number => {\n const offset = is12Hour(cycle) && period === \"PM\" ? 12 : 0\n if (hour === null) return offset\n return is12Hour(cycle) ? (hour % 12) + offset : hour % 24\n}\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `toDisplayHour`/`fromDisplayHour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput, type NumberInputTranslations } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport {\n dayPeriodLabels,\n HOUR_RANGES,\n type HourCycle,\n is12Hour,\n timeUnitLabels,\n} from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (the cycle's own hours — 0–11, 1–12, 0–23 or 1–24) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). `incrementLabel`/`decrementLabel` are `NumberInput`'s own\n * keys, forwarded to each field's steppers (defaults `\"Increment\"` / `\"Decrement\"`). */\nexport type TimeRowTranslations = Pick<\n NumberInputTranslations,\n \"incrementLabel\" | \"decrementLabel\"\n> & {\n /** The whole row's group name when nothing visible labels it. Default `\"Time\"`. */\n time?: string\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** The row's English accessible names, merged once under `translations`. `NumberInput` keeps\n * its own stepper defaults. */\nconst TIME_ROW_DEFAULT_TRANSLATIONS = {\n time: \"Time\",\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n period: \"Period\",\n} as const satisfies TimeRowTranslations\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nexport const TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\n/** The same widths as Tailwind classes, written out in full: Tailwind finds classes by scanning\n * source text (a consumer's build scans the shipped `dist`), so a class assembled from a template\n * literal is never generated. `time-row.test.ts` keeps these in step with `TIME_FIELD_BASIS_PX`. */\nexport const timeFieldBasis: Record<Size, string> = {\n xs: \"basis-[64px] min-w-[64px]\",\n sm: \"basis-[72px] min-w-[72px]\",\n md: \"basis-[78px] min-w-[78px]\",\n lg: \"basis-[86px] min-w-[86px]\",\n xl: \"basis-[100px] min-w-[100px]\",\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Names the row's `role=\"group\"` directly when no visible label points at it. Defaults to\n * `translations.time` (`\"Time\"`), so the group is never anonymous. */\n \"aria-label\"?: string\n /** Names the row's `role=\"group\"` from a visible label, e.g. `TimeInput`'s field label or\n * `DatePicker`'s \"Start time\" / \"End time\". Without a name a screen reader enters the group\n * hearing only \"Hour\". */\n \"aria-labelledby\"?: string\n /** Helper / error text read after the group's name. */\n \"aria-describedby\"?: string\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n const t = { ...TIME_ROW_DEFAULT_TRANSLATIONS, ...translations }\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? t.time)}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={t.hour}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={HOUR_RANGES[hourCycle].min}\n max={HOUR_RANGES[hourCycle].max}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n translations={t}\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={t.minute}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={t.second}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={t.period}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,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A,EAAO,aAAa,EAAA,EAAG;AAAA,gBACtC,EAAE,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,aAAa,EAAA;AAAG,eACxC;AAAA,cACA,OAAO,CAAA,CAAE,MAAA;AAAA,cACT,KAAA,EAAO,MAAA;AAAA,cACP,QAAA,EAAU,CAAC,KAAA,KAAU,cAAA,CAAe,KAAoB,CAAA;AAAA,cAGxD,IAAA;AAAA,cACA,QAAA;AAAA,cACA,QAAA;AAAA,cACA,OAAA;AAAA,cACA,WAAW,UAAA,EAAY,MAAA;AAAA,cAOvB,UAAA,EAAY,EAAE,KAAA,EAAO,iBAAA,EAAmB,OAAO,SAAA;AAAU;AAAA;AAC3D;AAAA;AAAA;AAEJ;AAEJ","file":"chunk-POKLPMSB.js","sourcesContent":["export type HourCycle = \"h11\" | \"h12\" | \"h23\" | \"h24\"\n\n/**\n * Resolve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 12 hours + AM/PM (`h11`/`h12`) rather than all 24. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** The hours each cycle displays: `h11` 0–11, `h12` 1–12, `h23` 0–23, `h24` 1–24. In the two\n * cycles that start at 1, midnight (and, for `h12`, noon) reads as the top of the range. */\nexport const HOUR_RANGES: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 },\n}\n\n/** Convert a stored 24h hour (`0`–`23`) to the hour `cycle` displays, plus its period in the\n * 12-hour cycles (`null` otherwise) — e.g. midnight is `12` AM in `h12`, `0` AM in `h11`, `0` in\n * `h23` and `24` in `h24`. */\nexport const toDisplayHour = (\n hour24: number,\n cycle: HourCycle,\n): { hour: number; period: \"AM\" | \"PM\" | null } => {\n const twelveHour = is12Hour(cycle)\n const hour = twelveHour ? hour24 % 12 : hour24\n return {\n hour: hour === 0 && HOUR_RANGES[cycle].min === 1 ? HOUR_RANGES[cycle].max : hour,\n period: twelveHour ? (hour24 < 12 ? \"AM\" : \"PM\") : null,\n }\n}\n\n/** The inverse of `toDisplayHour`: a displayed hour (+ period in the 12-hour cycles) back to a\n * stored 24h hour. A missing hour reads as the start of its half of the day — midnight, or noon\n * once PM is picked — and a missing period as AM. */\nexport const fromDisplayHour = (\n hour: number | null,\n period: \"AM\" | \"PM\" | null,\n cycle: HourCycle,\n): number => {\n const offset = is12Hour(cycle) && period === \"PM\" ? 12 : 0\n if (hour === null) return offset\n return is12Hour(cycle) ? (hour % 12) + offset : hour % 24\n}\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `toDisplayHour`/`fromDisplayHour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput, type NumberInputTranslations } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport {\n dayPeriodLabels,\n HOUR_RANGES,\n type HourCycle,\n is12Hour,\n timeUnitLabels,\n} from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (the cycle's own hours — 0–11, 1–12, 0–23 or 1–24) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). `incrementLabel`/`decrementLabel` are `NumberInput`'s own\n * keys, forwarded to each field's steppers (defaults `\"Increment\"` / `\"Decrement\"`). */\nexport type TimeRowTranslations = Pick<\n NumberInputTranslations,\n \"incrementLabel\" | \"decrementLabel\"\n> & {\n /** The whole row's group name when nothing visible labels it. Default `\"Time\"`. */\n time?: string\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** The row's English accessible names, merged once under `translations`. `NumberInput` keeps\n * its own stepper defaults. */\nconst TIME_ROW_DEFAULT_TRANSLATIONS = {\n time: \"Time\",\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n period: \"Period\",\n} as const satisfies TimeRowTranslations\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nexport const TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\n/** The same widths as Tailwind classes, written out in full: Tailwind finds classes by scanning\n * source text (a consumer's build scans the shipped `dist`), so a class assembled from a template\n * literal is never generated. `time-row.test.ts` keeps these in step with `TIME_FIELD_BASIS_PX`. */\nexport const timeFieldBasis: Record<Size, string> = {\n xs: \"basis-[64px] min-w-[64px]\",\n sm: \"basis-[72px] min-w-[72px]\",\n md: \"basis-[78px] min-w-[78px]\",\n lg: \"basis-[86px] min-w-[86px]\",\n xl: \"basis-[100px] min-w-[100px]\",\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Names the row's `role=\"group\"` directly when no visible label points at it. Defaults to\n * `translations.time` (`\"Time\"`), so the group is never anonymous. */\n \"aria-label\"?: string\n /** Names the row's `role=\"group\"` from a visible label, e.g. `TimeInput`'s field label or\n * `DatePicker`'s \"Start time\" / \"End time\". Without a name a screen reader enters the group\n * hearing only \"Hour\". */\n \"aria-labelledby\"?: string\n /** Helper / error text read after the group's name. */\n \"aria-describedby\"?: string\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n const t = { ...TIME_ROW_DEFAULT_TRANSLATIONS, ...translations }\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? t.time)}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={t.hour}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={HOUR_RANGES[hourCycle].min}\n max={HOUR_RANGES[hourCycle].max}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n translations={t}\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={t.minute}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={t.second}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={t.period}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { GRADIENT_DIR_CLASS, buildGradientVars } from './chunk-SKPM2FRX.js';
2
2
  import { props } from './chunk-WYCMIIRR.js';
3
- import { cn } from './chunk-QP4I37PA.js';
3
+ import { cn } from './chunk-4ASNIDV7.js';
4
4
  import { Progress as Progress$1 } from '@ark-ui/react/progress';
5
5
  import { cva } from 'class-variance-authority';
6
6
  import { jsx } from 'react/jsx-runtime';
@@ -116,5 +116,5 @@ var Progress = ({
116
116
  };
117
117
 
118
118
  export { Progress };
119
- //# sourceMappingURL=chunk-K6BHDFX3.js.map
120
- //# sourceMappingURL=chunk-K6BHDFX3.js.map
119
+ //# sourceMappingURL=chunk-QKSLDQM2.js.map
120
+ //# sourceMappingURL=chunk-QKSLDQM2.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/progress/progress.tsx"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AACd;AAAA;AACF;AAAA;AACF;AAAA,GACF;AAEJ","file":"chunk-K6BHDFX3.js","sourcesContent":["\"use client\"\n\nimport { Progress as Ark } from \"@ark-ui/react/progress\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ComponentPropsWithoutRef, CSSProperties, Ref } from \"react\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport {\n buildGradientVars,\n GRADIENT_DIR_CLASS,\n type GradientDir,\n type GradientProps,\n} from \"../../lib/gradient\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Progress — linear progress bar on top of Ark UI's Progress state machine.\n * Ark owns `role=\"progressbar\"`, the ARIA value wiring, the percent math, and\n * the indeterminate flag; this wrapper supplies the styled Track + Range and a\n * flatter API.\n *\n * - `value` is a single number in `min..max`. Pass `null` for the\n * indeterminate state — Ark drops the inline width and we drive an animated\n * sweep purely in CSS. Leaving both `value` and `defaultValue` unset makes\n * the bar uncontrolled (Ark's own default).\n * - Two fill `variant`s: `filled` (solid accent, the default) and\n * `gradient` (a Tailwind linear gradient on the Range, mirroring `Badge`).\n *\n * Palette is delivered through the kit's `data-color` + slot-var system\n * (see `colors.ts` / `colors.css`). The root writes `data-color={color}` and\n * the Range references `--c-solid`, so adding a color in\n * `colors.css` works here for free — no progress edits needed. `gradient`\n * sidesteps the slot vars and paints its own stops on the Range instead.\n */\n\nconst progressTrack = cva(\n // `overflow-x-clip` clips the Range's rounded ends to the track's pill shape\n // (mirrors Slider's track); `relative` anchors the indeterminate sweep, whose\n // moving bar is positioned within the track's box.\n \"relative w-full overflow-x-clip rounded-full bg-black/3 dark:bg-white/4\",\n {\n variants: {\n size: {\n xs: \"h-0.5\",\n sm: \"h-1\",\n md: \"h-1.5\",\n lg: \"h-2\",\n xl: \"h-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst progressRange = cva(\"h-full rounded-full\", {\n variants: {\n variant: {\n filled: \"bg-(--c-solid)\",\n // from-*/to-* are the CSS defaults for --tw-gradient-from/to and the\n // --tw-gradient-stops composition chain. A `gradient` prop only overrides\n // the individual vars it provides; the direction class is appended\n // dynamically (mirrors Badge's gradient variant).\n //\n // The gradient is stretched to the full track width and pinned to the\n // start (see the Range `style` below), so the Range reveals only its left\n // slice — the complete from→to shows only at 100%. `bg-no-repeat` keeps\n // the stretched image from tiling.\n gradient: \"bg-linear-to-r from-purple-300 to-pink-400 bg-no-repeat bg-left\",\n },\n },\n defaultVariants: { variant: \"filled\" },\n})\n\nexport type ProgressVariant = NonNullable<VariantProps<typeof progressRange>[\"variant\"]>\nexport type ProgressSize = Size\n\nexport type { GradientDir, GradientProps }\n\ntype ProgressClassNames = {\n root?: string\n track?: string\n range?: string\n}\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type ProgressProps = Omit<\n ArkRootProps,\n \"value\" | \"defaultValue\" | \"onValueChange\" | \"ref\" | \"className\" | \"asChild\"\n> &\n ForbidAsChild &\n VariantProps<typeof progressRange> &\n WithTestId & {\n /**\n * Controlled value in `min..max`. Pass `null` for the indeterminate state.\n * Leave unset (with no `defaultValue`) for an uncontrolled bar.\n */\n value?: number | null\n /** Uncontrolled initial value. Pass `null` to start indeterminate. */\n defaultValue?: number | null\n /** Fires on every value change. */\n onChange?: (value: number | null) => void\n size?: ProgressSize\n /** Accent palette. Ignored when `variant=\"gradient\"`. */\n color?: Color\n /**\n * Gradient config; only applied when `variant=\"gradient\"`. Mirrors Badge:\n * sets the individual `--tw-gradient-*` vars consumed by the gradient\n * utility chain. Unset fields fall back to the CVA defaults\n * (purple-300 → pink-400, to-r).\n */\n gradient?: GradientProps\n /** Lands on the Track — the `role=\"progressbar\"` element. */\n ref?: Ref<HTMLDivElement>\n /** Names the bar. Lands on the Track, the `role=\"progressbar\"` element, like the other\n * `aria-*` naming props below; without one, Ark names it by its value (\"40\"). */\n \"aria-label\"?: string\n /** Names the bar after a visible caption, by id. Wins over `aria-label`. */\n \"aria-labelledby\"?: string\n \"aria-describedby\"?: string\n /** Read instead of the number: \"Processing\", \"3 of 8 files\". */\n \"aria-valuetext\"?: string\n className?: string\n classNames?: ProgressClassNames\n style?: CSSProperties\n }\n\nexport const Progress = ({\n value,\n defaultValue,\n onChange,\n variant,\n size,\n color,\n gradient,\n min = 0,\n max = 100,\n ref,\n className,\n classNames,\n style,\n testId,\n asChild: _asChild,\n // The naming attributes describe the progressbar, which is the Track, not the root.\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-valuetext\": valueText,\n ...rest\n}: ProgressProps) => {\n const isGradient = variant === \"gradient\"\n\n return (\n <Ark.Root\n // `undefined` → uncontrolled (Ark's own default). `null` → indeterminate.\n // The two must NOT be coalesced, so each is forwarded verbatim.\n value={value}\n defaultValue={defaultValue}\n onValueChange={onChange ? ({ value: v }) => onChange(v) : undefined}\n min={min}\n max={max}\n data-color={!isGradient ? color : undefined}\n className={cn(\"group/progress w-full\", className, classNames?.root)}\n style={style}\n {...rest}\n >\n <Ark.Track\n ref={ref}\n className={cn(progressTrack({ size }), classNames?.track)}\n {...props({\n \"data-testid\": testId,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-valuetext\": valueText,\n })}\n >\n <Ark.Range\n // Gradient styling lives on the Range (where the gradient renders),\n // not the root — Ark also sets `style.width` here, but the keys don't\n // overlap and Ark merges the two via mergeProps.\n // - backgroundSize stretches the gradient to the full track width:\n // the Range is `percent%` of the track, so `10000% / percent` of\n // the Range equals the track width (Ark exposes `--percent` on the\n // root; it cascades here). Pinned to the start by `bg-left`, the\n // Range reveals only its left slice — the full from→to shows at\n // 100%. Falls back to 100% when indeterminate (`--percent` unset).\n // - buildGradientVars sets the --tw-gradient-* vars from `gradient`.\n style={\n isGradient\n ? {\n backgroundSize: \"calc(10000% / var(--percent, 100)) 100%\",\n ...(gradient ? buildGradientVars(gradient) : null),\n }\n : undefined\n }\n className={cn(\n progressRange({ variant }),\n isGradient && gradient?.dir && GRADIENT_DIR_CLASS[gradient.dir],\n // Indeterminate: Ark omits the inline width, so the Range would\n // otherwise fill the track. Pin it to a fraction and animate a\n // clipped sweep. `group-data-[state=…]` reads the state Ark stamps\n // on the root.\n \"group-data-[state=indeterminate]/progress:w-2/5\",\n \"group-data-[state=indeterminate]/progress:animate-progress-indeterminate\",\n classNames?.range,\n )}\n />\n </Ark.Track>\n </Ark.Root>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/progress/progress.tsx"],"names":["Ark"],"mappings":";;;;;;;AAsCA,IAAM,aAAA,GAAgB,GAAA;AAAA;AAAA;AAAA;AAAA,EAIpB,yEAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,OAAA;AAAA,QACJ,EAAA,EAAI,KAAA;AAAA,QACJ,EAAA,EAAI,OAAA;AAAA,QACJ,EAAA,EAAI,KAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACN,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AAAK;AAElC,CAAA;AAEA,IAAM,aAAA,GAAgB,IAAI,qBAAA,EAAuB;AAAA,EAC/C,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,gBAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUR,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,OAAA,EAAS,QAAA;AAC9B,CAAC,CAAA;AAwDM,IAAM,WAAW,CAAC;AAAA,EACvB,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;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A;AAAA,YAAJ;AAAA,cAWC,OACE,UAAA,GACI;AAAA,gBACE,cAAA,EAAgB,yCAAA;AAAA,gBAChB,GAAI,QAAA,GAAW,iBAAA,CAAkB,QAAQ,CAAA,GAAI;AAAA,eAC/C,GACA,MAAA;AAAA,cAEN,SAAA,EAAW,EAAA;AAAA,gBACT,aAAA,CAAc,EAAE,OAAA,EAAS,CAAA;AAAA,gBACzB,UAAA,IAAc,QAAA,EAAU,GAAA,IAAO,kBAAA,CAAmB,SAAS,GAAG,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAK9D,iDAAA;AAAA,gBACA,0EAAA;AAAA,gBACA,UAAA,EAAY;AAAA;AACd;AAAA;AACF;AAAA;AACF;AAAA,GACF;AAEJ","file":"chunk-QKSLDQM2.js","sourcesContent":["\"use client\"\n\nimport { Progress as Ark } from \"@ark-ui/react/progress\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ComponentPropsWithoutRef, CSSProperties, Ref } from \"react\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport {\n buildGradientVars,\n GRADIENT_DIR_CLASS,\n type GradientDir,\n type GradientProps,\n} from \"../../lib/gradient\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Progress — linear progress bar on top of Ark UI's Progress state machine.\n * Ark owns `role=\"progressbar\"`, the ARIA value wiring, the percent math, and\n * the indeterminate flag; this wrapper supplies the styled Track + Range and a\n * flatter API.\n *\n * - `value` is a single number in `min..max`. Pass `null` for the\n * indeterminate state — Ark drops the inline width and we drive an animated\n * sweep purely in CSS. Leaving both `value` and `defaultValue` unset makes\n * the bar uncontrolled (Ark's own default).\n * - Two fill `variant`s: `filled` (solid accent, the default) and\n * `gradient` (a Tailwind linear gradient on the Range, mirroring `Badge`).\n *\n * Palette is delivered through the kit's `data-color` + slot-var system\n * (see `colors.ts` / `colors.css`). The root writes `data-color={color}` and\n * the Range references `--c-solid`, so adding a color in\n * `colors.css` works here for free — no progress edits needed. `gradient`\n * sidesteps the slot vars and paints its own stops on the Range instead.\n */\n\nconst progressTrack = cva(\n // `overflow-x-clip` clips the Range's rounded ends to the track's pill shape\n // (mirrors Slider's track); `relative` anchors the indeterminate sweep, whose\n // moving bar is positioned within the track's box.\n \"relative w-full overflow-x-clip rounded-full bg-black/3 dark:bg-white/4\",\n {\n variants: {\n size: {\n xs: \"h-0.5\",\n sm: \"h-1\",\n md: \"h-1.5\",\n lg: \"h-2\",\n xl: \"h-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst progressRange = cva(\"h-full rounded-full\", {\n variants: {\n variant: {\n filled: \"bg-(--c-solid)\",\n // from-*/to-* are the CSS defaults for --tw-gradient-from/to and the\n // --tw-gradient-stops composition chain. A `gradient` prop only overrides\n // the individual vars it provides; the direction class is appended\n // dynamically (mirrors Badge's gradient variant).\n //\n // The gradient is stretched to the full track width and pinned to the\n // start (see the Range `style` below), so the Range reveals only its left\n // slice — the complete from→to shows only at 100%. `bg-no-repeat` keeps\n // the stretched image from tiling.\n gradient: \"bg-linear-to-r from-purple-300 to-pink-400 bg-no-repeat bg-left\",\n },\n },\n defaultVariants: { variant: \"filled\" },\n})\n\nexport type ProgressVariant = NonNullable<VariantProps<typeof progressRange>[\"variant\"]>\nexport type ProgressSize = Size\n\nexport type { GradientDir, GradientProps }\n\ntype ProgressClassNames = {\n root?: string\n track?: string\n range?: string\n}\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type ProgressProps = Omit<\n ArkRootProps,\n \"value\" | \"defaultValue\" | \"onValueChange\" | \"ref\" | \"className\" | \"asChild\"\n> &\n ForbidAsChild &\n VariantProps<typeof progressRange> &\n WithTestId & {\n /**\n * Controlled value in `min..max`. Pass `null` for the indeterminate state.\n * Leave unset (with no `defaultValue`) for an uncontrolled bar.\n */\n value?: number | null\n /** Uncontrolled initial value. Pass `null` to start indeterminate. */\n defaultValue?: number | null\n /** Fires on every value change. */\n onChange?: (value: number | null) => void\n size?: ProgressSize\n /** Accent palette. Ignored when `variant=\"gradient\"`. */\n color?: Color\n /**\n * Gradient config; only applied when `variant=\"gradient\"`. Mirrors Badge:\n * sets the individual `--tw-gradient-*` vars consumed by the gradient\n * utility chain. Unset fields fall back to the CVA defaults\n * (purple-300 → pink-400, to-r).\n */\n gradient?: GradientProps\n /** Lands on the Track — the `role=\"progressbar\"` element. */\n ref?: Ref<HTMLDivElement>\n /** Names the bar. Lands on the Track, the `role=\"progressbar\"` element, like the other\n * `aria-*` naming props below; without one, Ark names it by its value (\"40\"). */\n \"aria-label\"?: string\n /** Names the bar after a visible caption, by id. Wins over `aria-label`. */\n \"aria-labelledby\"?: string\n \"aria-describedby\"?: string\n /** Read instead of the number: \"Processing\", \"3 of 8 files\". */\n \"aria-valuetext\"?: string\n className?: string\n classNames?: ProgressClassNames\n style?: CSSProperties\n }\n\nexport const Progress = ({\n value,\n defaultValue,\n onChange,\n variant,\n size,\n color,\n gradient,\n min = 0,\n max = 100,\n ref,\n className,\n classNames,\n style,\n testId,\n asChild: _asChild,\n // The naming attributes describe the progressbar, which is the Track, not the root.\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-valuetext\": valueText,\n ...rest\n}: ProgressProps) => {\n const isGradient = variant === \"gradient\"\n\n return (\n <Ark.Root\n // `undefined` → uncontrolled (Ark's own default). `null` → indeterminate.\n // The two must NOT be coalesced, so each is forwarded verbatim.\n value={value}\n defaultValue={defaultValue}\n onValueChange={onChange ? ({ value: v }) => onChange(v) : undefined}\n min={min}\n max={max}\n data-color={!isGradient ? color : undefined}\n className={cn(\"group/progress w-full\", className, classNames?.root)}\n style={style}\n {...rest}\n >\n <Ark.Track\n ref={ref}\n className={cn(progressTrack({ size }), classNames?.track)}\n {...props({\n \"data-testid\": testId,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-valuetext\": valueText,\n })}\n >\n <Ark.Range\n // Gradient styling lives on the Range (where the gradient renders),\n // not the root — Ark also sets `style.width` here, but the keys don't\n // overlap and Ark merges the two via mergeProps.\n // - backgroundSize stretches the gradient to the full track width:\n // the Range is `percent%` of the track, so `10000% / percent` of\n // the Range equals the track width (Ark exposes `--percent` on the\n // root; it cascades here). Pinned to the start by `bg-left`, the\n // Range reveals only its left slice — the full from→to shows at\n // 100%. Falls back to 100% when indeterminate (`--percent` unset).\n // - buildGradientVars sets the --tw-gradient-* vars from `gradient`.\n style={\n isGradient\n ? {\n backgroundSize: \"calc(10000% / var(--percent, 100)) 100%\",\n ...(gradient ? buildGradientVars(gradient) : null),\n }\n : undefined\n }\n className={cn(\n progressRange({ variant }),\n isGradient && gradient?.dir && GRADIENT_DIR_CLASS[gradient.dir],\n // Indeterminate: Ark omits the inline width, so the Range would\n // otherwise fill the track. Pin it to a fraction and animate a\n // clipped sweep. `group-data-[state=…]` reads the state Ark stamps\n // on the root.\n \"group-data-[state=indeterminate]/progress:w-2/5\",\n \"group-data-[state=indeterminate]/progress:animate-progress-indeterminate\",\n classNames?.range,\n )}\n />\n </Ark.Track>\n </Ark.Root>\n )\n}\n"]}
@@ -1,16 +1,16 @@
1
- import { Progress } from './chunk-K6BHDFX3.js';
1
+ import { Progress } from './chunk-QKSLDQM2.js';
2
2
  import { FILE_KIND_ICONS } from './chunk-SDVZFXQ2.js';
3
- import { Image } from './chunk-H26K66EU.js';
4
- import { Button } from './chunk-NJ4RO3CT.js';
3
+ import { Image } from './chunk-Y57NW6G7.js';
4
+ import { Button } from './chunk-SWVUXEBT.js';
5
5
  import { formatFileSize, useObjectUrl, fileKind } from './chunk-TCFB23JT.js';
6
6
  import { useLocale, useTimeZone } from './chunk-IPYHTCFL.js';
7
- import { CloseIcon } from './chunk-ZFUTGBJC.js';
7
+ import { CloseIcon } from './chunk-6YNLRQ25.js';
8
8
  import { mergeIcons, iconStroke } from './chunk-XXOR34T4.js';
9
9
  import { withAsChildContent, composeChildren } from './chunk-R5LYFTHA.js';
10
10
  import { props } from './chunk-WYCMIIRR.js';
11
- import { focusStyles } from './chunk-3REFDGOM.js';
11
+ import { focusStyles } from './chunk-C6NVU4F7.js';
12
12
  import { TYPOGRAPHY_SHADE_CLASSES, TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
13
- import { cn } from './chunk-QP4I37PA.js';
13
+ import { cn } from './chunk-4ASNIDV7.js';
14
14
  import { ark } from '@ark-ui/react';
15
15
  import { CircleCheck, RotateCw } from 'lucide-react';
16
16
  import { createContext, Fragment as Fragment$1, useId, useState, useContext } from 'react';
@@ -336,5 +336,5 @@ var FileItem = Object.assign(FileItemComponent, {
336
336
  });
337
337
 
338
338
  export { FileItem, isInFlight };
339
- //# sourceMappingURL=chunk-CDHIF2NV.js.map
340
- //# sourceMappingURL=chunk-CDHIF2NV.js.map
339
+ //# sourceMappingURL=chunk-QNKD2SQM.js.map
340
+ //# sourceMappingURL=chunk-QNKD2SQM.js.map