@42-central/ui-react 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/dist/{chunk-YZJUPYPO.js → chunk-2W7H43WL.js} +3 -3
  2. package/dist/{chunk-YZJUPYPO.js.map → chunk-2W7H43WL.js.map} +1 -1
  3. package/dist/{chunk-NLSJ6T7V.js → chunk-4D2V4JE4.js} +3 -3
  4. package/dist/{chunk-NLSJ6T7V.js.map → chunk-4D2V4JE4.js.map} +1 -1
  5. package/dist/{chunk-QZ4N5LYG.js → chunk-5H5YOPCF.js} +3 -3
  6. package/dist/{chunk-QZ4N5LYG.js.map → chunk-5H5YOPCF.js.map} +1 -1
  7. package/dist/{chunk-6II2DVYR.js → chunk-7KFUFAVP.js} +4 -4
  8. package/dist/{chunk-6II2DVYR.js.map → chunk-7KFUFAVP.js.map} +1 -1
  9. package/dist/{chunk-XUFCI262.js → chunk-7OGZT7U2.js} +12 -4
  10. package/dist/chunk-7OGZT7U2.js.map +1 -0
  11. package/dist/{chunk-PI7X5YFJ.js → chunk-BGDVUC3B.js} +5 -5
  12. package/dist/{chunk-PI7X5YFJ.js.map → chunk-BGDVUC3B.js.map} +1 -1
  13. package/dist/{chunk-7247WBTV.js → chunk-DJ72KP32.js} +3 -3
  14. package/dist/{chunk-7247WBTV.js.map → chunk-DJ72KP32.js.map} +1 -1
  15. package/dist/{chunk-FZSLSUSX.js → chunk-HCHGERDB.js} +3 -3
  16. package/dist/{chunk-FZSLSUSX.js.map → chunk-HCHGERDB.js.map} +1 -1
  17. package/dist/{chunk-H7WOMZXO.js → chunk-HWBFRDX7.js} +16 -8
  18. package/dist/chunk-HWBFRDX7.js.map +1 -0
  19. package/dist/{chunk-HQPU73WV.js → chunk-I4IJOLNA.js} +4 -4
  20. package/dist/{chunk-HQPU73WV.js.map → chunk-I4IJOLNA.js.map} +1 -1
  21. package/dist/{chunk-UDCCOUWR.js → chunk-IA6DCC3N.js} +6 -6
  22. package/dist/{chunk-UDCCOUWR.js.map → chunk-IA6DCC3N.js.map} +1 -1
  23. package/dist/{chunk-36NWC4GV.js → chunk-ISX3AM32.js} +3 -3
  24. package/dist/{chunk-36NWC4GV.js.map → chunk-ISX3AM32.js.map} +1 -1
  25. package/dist/{chunk-LMCUGYHT.js → chunk-L24N5EON.js} +6 -6
  26. package/dist/chunk-L24N5EON.js.map +1 -0
  27. package/dist/{chunk-HRNWWL3Y.js → chunk-L5GH7LLD.js} +61 -29
  28. package/dist/chunk-L5GH7LLD.js.map +1 -0
  29. package/dist/chunk-LJVIZNPE.js +9 -0
  30. package/dist/chunk-LJVIZNPE.js.map +1 -0
  31. package/dist/{chunk-AHKMN3YQ.js → chunk-MCRTAUSZ.js} +6 -6
  32. package/dist/chunk-MCRTAUSZ.js.map +1 -0
  33. package/dist/{chunk-LHUWOA2U.js → chunk-MNYY7UU2.js} +6 -6
  34. package/dist/{chunk-LHUWOA2U.js.map → chunk-MNYY7UU2.js.map} +1 -1
  35. package/dist/{chunk-7HZBD4YZ.js → chunk-NF2PBGD3.js} +36 -23
  36. package/dist/chunk-NF2PBGD3.js.map +1 -0
  37. package/dist/{chunk-54W6VAI3.js → chunk-NNPSBC7O.js} +5 -5
  38. package/dist/{chunk-54W6VAI3.js.map → chunk-NNPSBC7O.js.map} +1 -1
  39. package/dist/{chunk-MW42XVPD.js → chunk-PBSVX5DB.js} +15 -5
  40. package/dist/chunk-PBSVX5DB.js.map +1 -0
  41. package/dist/{chunk-2CL3FKEY.js → chunk-QEMXXQQO.js} +3 -3
  42. package/dist/{chunk-2CL3FKEY.js.map → chunk-QEMXXQQO.js.map} +1 -1
  43. package/dist/{chunk-6UIQJJNJ.js → chunk-QRNQQIQM.js} +5 -5
  44. package/dist/{chunk-6UIQJJNJ.js.map → chunk-QRNQQIQM.js.map} +1 -1
  45. package/dist/{chunk-N66NC6QK.js → chunk-RKCUXOU2.js} +4 -4
  46. package/dist/{chunk-N66NC6QK.js.map → chunk-RKCUXOU2.js.map} +1 -1
  47. package/dist/{chunk-N5M4PDBK.js → chunk-SBZJGFZ6.js} +3 -3
  48. package/dist/{chunk-N5M4PDBK.js.map → chunk-SBZJGFZ6.js.map} +1 -1
  49. package/dist/{chunk-7P32XCEU.js → chunk-SLUOF7XW.js} +2 -2
  50. package/dist/chunk-SLUOF7XW.js.map +1 -0
  51. package/dist/{chunk-SAXWCGWR.js → chunk-SOUDKESO.js} +14 -7
  52. package/dist/chunk-SOUDKESO.js.map +1 -0
  53. package/dist/{chunk-T44RW5DW.js → chunk-ULF5LOBS.js} +4 -4
  54. package/dist/{chunk-T44RW5DW.js.map → chunk-ULF5LOBS.js.map} +1 -1
  55. package/dist/components/ambient-background/index.js +9 -23
  56. package/dist/components/ambient-background/index.js.map +1 -1
  57. package/dist/components/ambient-background/starfield.d.ts.map +1 -1
  58. package/dist/components/app-shell/app-shell.d.ts +55 -10
  59. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  60. package/dist/components/app-shell/index.d.ts +1 -1
  61. package/dist/components/app-shell/index.d.ts.map +1 -1
  62. package/dist/components/app-shell/index.js +299 -38
  63. package/dist/components/app-shell/index.js.map +1 -1
  64. package/dist/components/autocomplete/index.js +4 -4
  65. package/dist/components/avatar/avatar.d.ts +1 -1
  66. package/dist/components/avatar/avatar.d.ts.map +1 -1
  67. package/dist/components/avatar/index.js +10 -1
  68. package/dist/components/avatar/index.js.map +1 -1
  69. package/dist/components/button-group/button-group.d.ts +10 -2
  70. package/dist/components/button-group/button-group.d.ts.map +1 -1
  71. package/dist/components/button-group/index.js +1 -1
  72. package/dist/components/button-multi-select/index.js +2 -2
  73. package/dist/components/button-select/button-select-control.d.ts +4 -1
  74. package/dist/components/button-select/button-select-control.d.ts.map +1 -1
  75. package/dist/components/button-select/button-select.d.ts +4 -1
  76. package/dist/components/button-select/button-select.d.ts.map +1 -1
  77. package/dist/components/button-select/index.js +2 -2
  78. package/dist/components/calendar-heatmap/index.js +2 -2
  79. package/dist/components/camera/index.js +6 -6
  80. package/dist/components/code-block/chrome.js +5 -5
  81. package/dist/components/code-block/index.js +6 -6
  82. package/dist/components/combobox/index.js +4 -4
  83. package/dist/components/combobox-list/index.js +6 -6
  84. package/dist/components/data-table/data-table-features.d.ts +8 -0
  85. package/dist/components/data-table/data-table-features.d.ts.map +1 -1
  86. package/dist/components/data-table/data-table-group.d.ts +128 -0
  87. package/dist/components/data-table/data-table-group.d.ts.map +1 -0
  88. package/dist/components/data-table/data-table-grouping.d.ts +72 -0
  89. package/dist/components/data-table/data-table-grouping.d.ts.map +1 -0
  90. package/dist/components/data-table/data-table-icons.d.ts +4 -2
  91. package/dist/components/data-table/data-table-icons.d.ts.map +1 -1
  92. package/dist/components/data-table/data-table-meta.d.ts +9 -0
  93. package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
  94. package/dist/components/data-table/data-table-pagination.d.ts +4 -1
  95. package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
  96. package/dist/components/data-table/data-table-schema.d.ts +4 -0
  97. package/dist/components/data-table/data-table-schema.d.ts.map +1 -1
  98. package/dist/components/data-table/data-table-stack.d.ts +16 -3
  99. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  100. package/dist/components/data-table/data-table-toolbar.d.ts +33 -2
  101. package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
  102. package/dist/components/data-table/data-table-translations.d.ts +35 -0
  103. package/dist/components/data-table/data-table-translations.d.ts.map +1 -1
  104. package/dist/components/data-table/data-table.d.ts +55 -3
  105. package/dist/components/data-table/data-table.d.ts.map +1 -1
  106. package/dist/components/data-table/index.d.ts +3 -1
  107. package/dist/components/data-table/index.d.ts.map +1 -1
  108. package/dist/components/data-table/index.js +878 -230
  109. package/dist/components/data-table/index.js.map +1 -1
  110. package/dist/components/date-picker/index.js +8 -8
  111. package/dist/components/drawer/index.js +4 -4
  112. package/dist/components/geodesic/a11y.d.ts +3 -3
  113. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  114. package/dist/components/geodesic/badge-frame.d.ts +13 -1
  115. package/dist/components/geodesic/badge-frame.d.ts.map +1 -1
  116. package/dist/components/geodesic/exam-badge.d.ts +4 -1
  117. package/dist/components/geodesic/exam-badge.d.ts.map +1 -1
  118. package/dist/components/geodesic/geometry.d.ts +14 -9
  119. package/dist/components/geodesic/geometry.d.ts.map +1 -1
  120. package/dist/components/geodesic/index.js +62 -23
  121. package/dist/components/geodesic/index.js.map +1 -1
  122. package/dist/components/geodesic/status.d.ts +8 -6
  123. package/dist/components/geodesic/status.d.ts.map +1 -1
  124. package/dist/components/geodesic/styles.css +15 -2
  125. package/dist/components/hover-card/index.js +3 -3
  126. package/dist/components/indicator/index.js +23 -8
  127. package/dist/components/indicator/index.js.map +1 -1
  128. package/dist/components/indicator/indicator.d.ts +15 -6
  129. package/dist/components/indicator/indicator.d.ts.map +1 -1
  130. package/dist/components/kbd/index.js +3 -3
  131. package/dist/components/lightbox/index.js +4 -4
  132. package/dist/components/menu/index.js +4 -4
  133. package/dist/components/modal/index.js +4 -4
  134. package/dist/components/multi-combobox-list/index.js +6 -6
  135. package/dist/components/multi-select/index.js +4 -4
  136. package/dist/components/nav-link/index.js +5 -1
  137. package/dist/components/nav-link/nav-link.d.ts.map +1 -1
  138. package/dist/components/nav-link/tanstack.js +5 -1
  139. package/dist/components/nav-link/tanstack.js.map +1 -1
  140. package/dist/components/notification/create-notifier.d.ts.map +1 -1
  141. package/dist/components/notification/index.js +15 -3
  142. package/dist/components/notification/index.js.map +1 -1
  143. package/dist/components/notification/types.d.ts +5 -0
  144. package/dist/components/notification/types.d.ts.map +1 -1
  145. package/dist/components/number-input/index.js +4 -4
  146. package/dist/components/overlays/index.js +5 -5
  147. package/dist/components/photo-capture/index.js +6 -6
  148. package/dist/components/popover/index.js +3 -3
  149. package/dist/components/schedule/index.js +4 -4
  150. package/dist/components/segment-group/index.js +1 -1
  151. package/dist/components/segment-group/segment-group.d.ts +6 -1
  152. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  153. package/dist/components/select/index.js +5 -5
  154. package/dist/components/spotlight/index.js +8 -8
  155. package/dist/components/tabs/index.js +1 -1
  156. package/dist/components/tabs/tabs-data.d.ts +4 -1
  157. package/dist/components/tabs/tabs-data.d.ts.map +1 -1
  158. package/dist/components/tabs/tabs.d.ts +4 -1
  159. package/dist/components/tabs/tabs.d.ts.map +1 -1
  160. package/dist/components/tags-input/index.js +3 -3
  161. package/dist/components/time-input/index.js +6 -6
  162. package/dist/components/tooltip/index.js +2 -2
  163. package/dist/components/tree-multi-select/index.js +4 -4
  164. package/dist/components/tree-select/index.js +4 -4
  165. package/dist/index.js +2 -2
  166. package/dist/lib/overlay-container.d.ts.map +1 -1
  167. package/dist/lib/overlay-layer.d.ts +10 -3
  168. package/dist/lib/overlay-layer.d.ts.map +1 -1
  169. package/dist/lib/sidebar-rail.d.ts +21 -0
  170. package/dist/lib/sidebar-rail.d.ts.map +1 -0
  171. package/dist/theme.css +21 -18
  172. package/package.json +1 -1
  173. package/src/as-child.contract.test.tsx +6 -0
  174. package/src/components/ambient-background/starfield.tsx +14 -41
  175. package/src/components/app-shell/app-shell.test.tsx +430 -5
  176. package/src/components/app-shell/app-shell.tsx +484 -24
  177. package/src/components/app-shell/index.ts +2 -0
  178. package/src/components/avatar/avatar.test.tsx +12 -0
  179. package/src/components/avatar/avatar.tsx +9 -0
  180. package/src/components/button-group/button-group.test.tsx +24 -0
  181. package/src/components/button-group/button-group.tsx +21 -4
  182. package/src/components/button-multi-select/button-multi-select.test.tsx +15 -0
  183. package/src/components/button-select/button-select-control.tsx +5 -0
  184. package/src/components/button-select/button-select.test.tsx +25 -0
  185. package/src/components/button-select/button-select.tsx +13 -2
  186. package/src/components/data-table/data-table-features.ts +11 -0
  187. package/src/components/data-table/data-table-group.test.tsx +1007 -0
  188. package/src/components/data-table/data-table-group.tsx +474 -0
  189. package/src/components/data-table/data-table-grouping.ts +160 -0
  190. package/src/components/data-table/data-table-icons.tsx +8 -1
  191. package/src/components/data-table/data-table-meta.ts +9 -0
  192. package/src/components/data-table/data-table-pagination.tsx +5 -1
  193. package/src/components/data-table/data-table-stack.tsx +165 -43
  194. package/src/components/data-table/data-table-toolbar.tsx +110 -2
  195. package/src/components/data-table/data-table-translations.ts +44 -0
  196. package/src/components/data-table/data-table.tsx +420 -150
  197. package/src/components/data-table/index.ts +4 -0
  198. package/src/components/drawer/drawer.tsx +1 -1
  199. package/src/components/geodesic/badge-frame.tsx +67 -13
  200. package/src/components/geodesic/exam-badge.tsx +8 -4
  201. package/src/components/geodesic/geometry.ts +8 -6
  202. package/src/components/geodesic/status.test.ts +11 -2
  203. package/src/components/geodesic/status.ts +11 -7
  204. package/src/components/geodesic/styles.css +15 -2
  205. package/src/components/indicator/indicator.test.tsx +45 -0
  206. package/src/components/indicator/indicator.tsx +40 -13
  207. package/src/components/modal/modal.tsx +1 -1
  208. package/src/components/nav-link/nav-link.test.tsx +121 -1
  209. package/src/components/nav-link/nav-link.tsx +78 -29
  210. package/src/components/notification/create-notifier.tsx +18 -2
  211. package/src/components/notification/notify-in-modal.test.tsx +128 -0
  212. package/src/components/notification/types.ts +5 -0
  213. package/src/components/segment-group/segment-group.test.tsx +22 -0
  214. package/src/components/segment-group/segment-group.tsx +35 -19
  215. package/src/components/tabs/tabs-data.tsx +5 -1
  216. package/src/components/tabs/tabs.test.tsx +28 -0
  217. package/src/components/tabs/tabs.tsx +14 -4
  218. package/src/lib/overlay-container.tsx +2 -1
  219. package/src/lib/overlay-layer.test.tsx +63 -1
  220. package/src/lib/overlay-layer.tsx +29 -6
  221. package/src/lib/sidebar-rail.ts +24 -0
  222. package/src/theme.css +21 -18
  223. package/src/theme.test.ts +14 -11
  224. package/dist/chunk-7HZBD4YZ.js.map +0 -1
  225. package/dist/chunk-7P32XCEU.js.map +0 -1
  226. package/dist/chunk-AHKMN3YQ.js.map +0 -1
  227. package/dist/chunk-H7WOMZXO.js.map +0 -1
  228. package/dist/chunk-HRNWWL3Y.js.map +0 -1
  229. package/dist/chunk-LMCUGYHT.js.map +0 -1
  230. package/dist/chunk-MW42XVPD.js.map +0 -1
  231. package/dist/chunk-SAXWCGWR.js.map +0 -1
  232. package/dist/chunk-XUFCI262.js.map +0 -1
@@ -4,12 +4,18 @@ import { jsx } from 'react/jsx-runtime';
4
4
 
5
5
  var PAGE_LAYERS = /* @__PURE__ */ new Set();
6
6
  var OverlayLayerContext = createContext(PAGE_LAYERS);
7
+ var OPEN_MODALS = /* @__PURE__ */ new Set();
8
+ var isModalOpen = () => OPEN_MODALS.size > 0;
9
+ var isToastEvent = (event) => {
10
+ const target = event.detail?.originalEvent?.target;
11
+ return target instanceof Element && target.closest('[data-scope="notifications"]') != null;
12
+ };
7
13
  var useLayerGuard = (onPointerDownOutside) => {
8
14
  const layers = useRef(/* @__PURE__ */ new Set()).current;
9
15
  const guard = useCallback(
10
16
  (event) => {
11
17
  onPointerDownOutside?.(event);
12
- if (layers.size > 0) event.preventDefault();
18
+ if (layers.size > 0 || isToastEvent(event)) event.preventDefault();
13
19
  },
14
20
  [layers, onPointerDownOutside]
15
21
  );
@@ -19,19 +25,21 @@ var OverlayLayerProvider = ({
19
25
  value,
20
26
  children
21
27
  }) => /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value, children });
22
- var useNestedLayer = (open) => {
28
+ var useNestedLayer = (open, { modal = false } = {}) => {
23
29
  const parent = useContext(OverlayLayerContext);
24
30
  useIsomorphicLayoutEffect(() => {
25
31
  if (!open) return;
26
32
  const token = /* @__PURE__ */ Symbol();
27
33
  parent.add(token);
34
+ if (modal) OPEN_MODALS.add(token);
28
35
  return () => {
29
36
  parent.delete(token);
37
+ OPEN_MODALS.delete(token);
30
38
  };
31
- }, [open, parent]);
39
+ }, [open, modal, parent]);
32
40
  };
33
- var NestedLayer = ({ open }) => {
34
- useNestedLayer(open);
41
+ var NestedLayer = ({ open, modal }) => {
42
+ useNestedLayer(open, { modal });
35
43
  return null;
36
44
  };
37
45
  var useLayerCovered = () => {
@@ -39,6 +47,6 @@ var useLayerCovered = () => {
39
47
  return useCallback(() => layers.size > 0, [layers]);
40
48
  };
41
49
 
42
- export { NestedLayer, OverlayLayerProvider, useLayerCovered, useLayerGuard, useNestedLayer };
43
- //# sourceMappingURL=chunk-H7WOMZXO.js.map
44
- //# sourceMappingURL=chunk-H7WOMZXO.js.map
50
+ export { NestedLayer, OverlayLayerProvider, isModalOpen, useLayerCovered, useLayerGuard, useNestedLayer };
51
+ //# sourceMappingURL=chunk-HWBFRDX7.js.map
52
+ //# sourceMappingURL=chunk-HWBFRDX7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/overlay-layer.tsx"],"names":[],"mappings":";;;;AA0CA,IAAM,WAAA,uBAAiC,GAAA,EAAI;AAE3C,IAAM,mBAAA,GAAsB,cAA6B,WAAW,CAAA;AAOpE,IAAM,WAAA,uBAAkB,GAAA,EAAY;AAI7B,IAAM,WAAA,GAAc,MAAM,WAAA,CAAY,IAAA,GAAO;AAMpD,IAAM,YAAA,GAAe,CAAC,KAAA,KAAiB;AACrC,EAAA,MAAM,MAAA,GAAU,KAAA,CAAiD,MAAA,EAAQ,aAAA,EAAe,MAAA;AACxF,EAAA,OAAO,MAAA,YAAkB,OAAA,IAAW,MAAA,CAAO,OAAA,CAAQ,8BAA8B,CAAA,IAAK,IAAA;AACxF,CAAA;AAMO,IAAM,aAAA,GAAgB,CAAkB,oBAAA,KAA8C;AAC3F,EAAA,MAAM,MAAA,GAAS,MAAA,iBAAsB,IAAI,GAAA,EAAK,CAAA,CAAE,OAAA;AAChD,EAAA,MAAM,KAAA,GAAQ,WAAA;AAAA,IACZ,CAAC,KAAA,KAAa;AACZ,MAAA,oBAAA,GAAuB,KAAK,CAAA;AAC5B,MAAA,IAAI,OAAO,IAAA,GAAO,CAAA,IAAK,aAAa,KAAK,CAAA,QAAS,cAAA,EAAe;AAAA,IACnE,CAAA;AAAA,IACA,CAAC,QAAQ,oBAAoB;AAAA,GAC/B;AACA,EAAA,OAAO,EAAE,MAAA,EAAQ,oBAAA,EAAsB,KAAA,EAAM;AAC/C;AAEO,IAAM,uBAAuB,CAAC;AAAA,EACnC,KAAA;AAAA,EACA;AACF,CAAA,qBAGM,GAAA,CAAC,mBAAA,CAAoB,QAAA,EAApB,EAA6B,OAAe,QAAA,EAAS;AAQrD,IAAM,cAAA,GAAiB,CAAC,IAAA,EAAe,EAAE,QAAQ,KAAA,EAAM,GAAyB,EAAC,KAAM;AAC5F,EAAA,MAAM,MAAA,GAAS,WAAW,mBAAmB,CAAA;AAC7C,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,IAAI,CAAC,IAAA,EAAM;AACX,IAAA,MAAM,wBAAQ,MAAA,EAAO;AACrB,IAAA,MAAA,CAAO,IAAI,KAAK,CAAA;AAChB,IAAA,IAAI,KAAA,EAAO,WAAA,CAAY,GAAA,CAAI,KAAK,CAAA;AAChC,IAAA,OAAO,MAAM;AACX,MAAA,MAAA,CAAO,OAAO,KAAK,CAAA;AACnB,MAAA,WAAA,CAAY,OAAO,KAAK,CAAA;AAAA,IAC1B,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,IAAA,EAAM,KAAA,EAAO,MAAM,CAAC,CAAA;AAC1B;AAIO,IAAM,WAAA,GAAc,CAAC,EAAE,IAAA,EAAM,OAAM,KAA0C;AAClF,EAAA,cAAA,CAAe,IAAA,EAAM,EAAE,KAAA,EAAO,CAAA;AAC9B,EAAA,OAAO,IAAA;AACT;AAOO,IAAM,kBAAkB,MAAuB;AACpD,EAAA,MAAM,MAAA,GAAS,WAAW,mBAAmB,CAAA;AAC7C,EAAA,OAAO,YAAY,MAAM,MAAA,CAAO,OAAO,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AACpD","file":"chunk-HWBFRDX7.js","sourcesContent":["\"use client\"\n\nimport { createContext, type ReactNode, useCallback, useContext, useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-layout-effect\"\n\n/**\n * One outside click dismisses one layer.\n *\n * Every dismissable surface (zag's `trackDismissableElement`) listens for\n * pointerdown on the whole document and closes itself when the target falls\n * outside it. Nested layers don't coordinate: a click on a Modal's backdrop\n * while a DatePicker inside it is open lands outside *both*, so both close —\n * the picker and the dialog the user was filling in. Zag only spares the\n * parent when the child is pointer-blocking (pickers aren't) or was removed a\n * tick earlier (the parent's listener runs first, so it never is), and its\n * `layerStack` isn't exported for us to ask.\n *\n * So the kit tracks it itself. A parent (`Modal`, `Drawer`, `Popover`) owns a\n * set of open children and vetoes its own outside-dismiss while that set is\n * non-empty; every floating panel registers with its nearest parent while\n * open. The click that would have cascaded closes the innermost layer only,\n * and the next one closes the parent.\n *\n * Context rather than DOM queries because context crosses portals: the\n * registration reaches the right parent wherever the panel was portaled to —\n * the parent's positioner, `document.body`, a custom `container`, or nowhere\n * (`withinPortal={false}`).\n *\n * Pointer-down only. Escape is already top-most-only in zag, and focus can't\n * leave a modal for a sibling layer it doesn't own.\n *\n * The same sets answer a second question: is anything open above me? A\n * component reads its nearest set with `useLayerCovered` (that is how\n * `useHotkey` yields to an overlay). Outside every overlay, the nearest set is\n * the page's own: `Modal` and `Drawer` register into it while open just like a\n * picker does, so a page-level reader sees them, and a reader inside a Modal\n * sees only what opened from that Modal.\n */\nexport type OverlayLayers = Set<symbol>\n\n/** The page's set: what a layer registers into when no overlay encloses it.\n * Nothing guards it (the page has no outside to dismiss), it only counts. */\nconst PAGE_LAYERS: OverlayLayers = new Set()\n\nconst OverlayLayerContext = createContext<OverlayLayers>(PAGE_LAYERS)\n\n/** The modal layers open right now, anywhere on the page: every open\n * `Modal`, `Drawer` and `Lightbox`, however deeply nested. Module scope, not\n * context, because its one reader (`notify()`) runs outside React. Not\n * derivable from `PAGE_LAYERS`: a Drawer opened from a page Popover\n * registers into the popover's set, not the page's. */\nconst OPEN_MODALS = new Set<symbol>()\n\n/** Whether a Modal, Drawer or Lightbox is open right now. The notifier asks\n * when a toast is created, to raise it above the modal (`--toast-raised-z`). */\nexport const isModalOpen = () => OPEN_MODALS.size > 0\n\n/** A press on a toast is never \"outside\" a layer. Toasts raised from a modal\n * paint above it, and dismissing one must not take the modal (and the form\n * in it) along. zag dispatches its outside event on the layer's own content\n * node, so the pressed node is the original event's target, in `detail`. */\nconst isToastEvent = (event: Event) => {\n const target = (event as CustomEvent<{ originalEvent?: Event }>).detail?.originalEvent?.target\n return target instanceof Element && target.closest('[data-scope=\"notifications\"]') != null\n}\n\n/** For a parent layer. Spread `onPointerDownOutside` onto the Ark root\n * (composed with the caller's own) and wrap the children that may open nested\n * layers in `OverlayLayerProvider`. A ref'd set, not state: it's read synchronously while\n * zag dispatches the outside event, and changing it must not re-render. */\nexport const useLayerGuard = <E extends Event>(onPointerDownOutside?: (event: E) => void) => {\n const layers = useRef<OverlayLayers>(new Set()).current\n const guard = useCallback(\n (event: E) => {\n onPointerDownOutside?.(event)\n if (layers.size > 0 || isToastEvent(event)) event.preventDefault()\n },\n [layers, onPointerDownOutside],\n )\n return { layers, onPointerDownOutside: guard }\n}\n\nexport const OverlayLayerProvider = ({\n value,\n children,\n}: {\n value: OverlayLayers\n children?: ReactNode\n}) => <OverlayLayerContext.Provider value={value}>{children}</OverlayLayerContext.Provider>\n\n/** For a child layer: registers with the nearest parent (the page's set when\n * none encloses it) while `open`. Keyed on\n * `open`, not presence, so a panel playing its exit animation no longer holds\n * the parent's next click. A layout effect so the registration is in place\n * before the browser can deliver the next pointerdown. `modal` marks a\n * Modal, Drawer or Lightbox, which `isModalOpen` counts. */\nexport const useNestedLayer = (open: boolean, { modal = false }: { modal?: boolean } = {}) => {\n const parent = useContext(OverlayLayerContext)\n useIsomorphicLayoutEffect(() => {\n if (!open) return\n const token = Symbol()\n parent.add(token)\n if (modal) OPEN_MODALS.add(token)\n return () => {\n parent.delete(token)\n OPEN_MODALS.delete(token)\n }\n }, [open, modal, parent])\n}\n\n/** `useNestedLayer` as an element, for call sites that only have the machine's\n * `open` inside a render prop (`<Ark.Context>{(api) => …}</Ark.Context>`). */\nexport const NestedLayer = ({ open, modal }: { open: boolean; modal?: boolean }) => {\n useNestedLayer(open, { modal })\n return null\n}\n\n/** Whether a layer is open above the component calling this, right now: a\n * Modal, Drawer, Popover or picker that opened from the same layer (from the\n * page, for a component outside every overlay). Returns a reader, not a\n * value, so it is checked when it matters (a key press) and opening a layer\n * never re-renders the caller. */\nexport const useLayerCovered = (): (() => boolean) => {\n const layers = useContext(OverlayLayerContext)\n return useCallback(() => layers.size > 0, [layers])\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { Tooltip } from './chunk-YZJUPYPO.js';
2
- import { popoverChrome } from './chunk-N66NC6QK.js';
1
+ import { popoverChrome } from './chunk-RKCUXOU2.js';
2
+ import { Tooltip } from './chunk-2W7H43WL.js';
3
3
  import { useUncontrolled } from './chunk-PMUCGFY5.js';
4
4
  import { Collapse } from './chunk-NKOTA5TM.js';
5
5
  import { iconStroke, mergeIcons } from './chunk-XXOR34T4.js';
@@ -226,5 +226,5 @@ function CodeBlockChrome({
226
226
  }
227
227
 
228
228
  export { CodeBlockButton, CodeBlockChrome, DEFAULT_ICONS };
229
- //# sourceMappingURL=chunk-HQPU73WV.js.map
230
- //# sourceMappingURL=chunk-HQPU73WV.js.map
229
+ //# sourceMappingURL=chunk-I4IJOLNA.js.map
230
+ //# sourceMappingURL=chunk-I4IJOLNA.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/code-block/chrome.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAwBA,IAAM,oBAAA,GAA8C;AAAA,EAClD,IAAA,EAAM,MAAA;AAAA,EACN,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,WAAA;AAAA,EACR,QAAA,EAAU;AACZ,CAAA;AAOO,IAAM,aAAA,GAAsD;AAAA,EACjE,IAAA,kBAAM,GAAA,CAAC,QAAA,EAAA,EAAS,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EACvC,MAAA,kBAAQ,GAAA,CAAC,SAAA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AAAA;AAAA,wBASC,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,aAAA,EAAW,IAAA;AAAA,YACX,SAAA,EAAW,EAAA;AAAA,cACT,oEAAA;AAAA,cACA,iCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAOA,uEAAA;AAAA,cACA,WAAW,WAAA,GAAc;AAAA;AAC3B;AAAA;AACF;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-HQPU73WV.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { useClipboard } from \"@ark-ui/react/clipboard\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon, CopyIcon } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Collapse } from \"../collapse/collapse\"\nimport { popoverChrome } from \"../popover/popover\"\nimport { Tooltip } from \"../tooltip/tooltip\"\n\nexport type CodeBlockTranslations = {\n copy: string\n copied: string\n expand: string\n collapse: string\n}\n\nconst DEFAULT_TRANSLATIONS: CodeBlockTranslations = {\n copy: \"Copy\",\n copied: \"Copied\",\n expand: \"Show more\",\n collapse: \"Show less\",\n}\n\nexport type CodeBlockIconSlot = \"copy\" | \"copied\" | \"expand\" | \"collapse\"\n/** The toolbar's icons: `copy` and `copied` on the copy button, `expand` and\n * `collapse` on the collapse toggle. `null` leaves that button empty. */\nexport type CodeBlockIcons = IconMap<CodeBlockIconSlot>\n\nexport const DEFAULT_ICONS: Record<CodeBlockIconSlot, ReactNode> = {\n copy: <CopyIcon className={iconStroke} />,\n copied: <CheckIcon className={iconStroke} />,\n expand: <ChevronDownIcon className={iconStroke} />,\n collapse: <ChevronUpIcon className={iconStroke} />,\n}\n\nexport type CodeBlockClassNames = {\n root?: string\n title?: string\n pre?: string\n controls?: string\n copyButton?: string\n expandButton?: string\n}\n\nexport type CodeBlockButtonProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * `CodeBlock.Button` — the toolbar's own compact icon-button primitive.\n * `Copy`/expand use it internally, and it's exported so a consumer's own\n * `controls` button matches the exact same size/style instead of hand-\n * rolling one — same composition API as the rest of the kit (`asChild`, via\n * `HTMLArkProps`, so it wraps in a `Tooltip` exactly like the built-in\n * buttons do).\n *\n * A plain hand-rolled button, not an `ActionIcon` wrapper: this toolbar\n * needed something smaller than `ActionIcon`'s own `xs` floor, which is\n * sized for general-purpose use, not a compact floating strip over code.\n */\nexport const CodeBlockButton = ({\n className,\n asChild,\n type,\n testId,\n ...rest\n}: CodeBlockButtonProps) => (\n <ark.button\n asChild={asChild}\n type={asChild ? type : (type ?? \"button\")}\n {...props({ \"data-testid\": testId })}\n className={cn(\n \"inline-flex size-6 shrink-0 items-center justify-center rounded\",\n \"text-(--c-text) [&_svg]:size-3.5 [&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"hover:bg-(--c-soft)\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...rest}\n />\n)\n\ntype CopyTriggerProps = {\n code: string\n onCopy?: () => void\n copyLabel: string\n copiedLabel: string\n icons: Record<CodeBlockIconSlot, ReactNode>\n className?: string\n testId?: string\n}\n\n/**\n * Renaming the focused button (`aria-label` → \"Copied\") isn't re-read by\n * screen readers, so the copy is also announced through a visually hidden\n * `role=\"status\"` beside it: mounted empty, filled while `copied` lasts. It is\n * a sibling of the `Tooltip`-wrapped button (`asChild` needs one element), and\n * `sr-only` takes it out of the toolbar's flex row.\n *\n * Uses Ark's `useClipboard` hook directly rather than the `Clipboard.Root`/\n * `Clipboard.Indicator` components — both render their own wrapping `<div>`\n * (`data-part=\"root\"`/`\"indicator\"`), which, sitting as a direct child of the\n * toolbar's flex row, threw off its sizing/alignment next to the plain\n * `ActionIcon` the `ExpandTrigger` renders. The hook gives the same\n * `copied`/`copy` state machine with no imposed DOM structure at all — this\n * renders as a single real `<button>`, exactly like `ExpandTrigger`.\n */\nfunction CopyTrigger({\n code,\n onCopy,\n copyLabel,\n copiedLabel,\n icons,\n className,\n testId,\n}: CopyTriggerProps) {\n const { copied, copy } = useClipboard({\n value: code,\n timeout: 2000,\n onStatusChange: (details) => details.copied && onCopy?.(),\n })\n const label = copied ? copiedLabel : copyLabel\n return (\n <>\n <Tooltip label={label} asChild>\n <CodeBlockButton aria-label={label} onClick={copy} className={className} testId={testId}>\n {copied ? icons.copied : icons.copy}\n </CodeBlockButton>\n </Tooltip>\n <span role=\"status\" className=\"sr-only\">\n {copied ? copiedLabel : \"\"}\n </span>\n </>\n )\n}\n\ntype ExpandTriggerProps = {\n expanded: boolean\n onToggle: () => void\n expandLabel: string\n collapseLabel: string\n icons: Record<CodeBlockIconSlot, ReactNode>\n className?: string\n testId?: string\n}\n\n/** Toolbar icon button toggling the collapsed \"tail\" seam — an\n * `aria-expanded` `ActionIcon` with a matching `Tooltip`/accessible name,\n * same shape as `CopyTrigger`. Only rendered when `isCollapsible`. */\nfunction ExpandTrigger({\n expanded,\n onToggle,\n expandLabel,\n collapseLabel,\n icons,\n className,\n testId,\n}: ExpandTriggerProps) {\n const label = expanded ? collapseLabel : expandLabel\n return (\n <Tooltip label={label} asChild>\n <CodeBlockButton\n aria-label={label}\n aria-expanded={expanded}\n onClick={onToggle}\n className={className}\n testId={testId}\n >\n {expanded ? icons.collapse : icons.expand}\n </CodeBlockButton>\n </Tooltip>\n )\n}\n\nexport type CodeBlockChromeProps = WithTestId & {\n /** Raw source, used only for the copy button's clipboard value — this\n * component never highlights anything itself. */\n code: string\n /** Whether the tail half exists at all (mirrors the caller's own\n * `collapsedLines`/line-count decision) — controls whether the expand\n * toggle and the `Collapse`-wrapped tail slot render at all. */\n isCollapsible: boolean\n /** The head half's already-rendered content (highlighted HTML, or a\n * loading fallback — this component has no opinion on which). */\n headContent: ReactNode\n /** The tail half's already-rendered content — only read when\n * `isCollapsible`. */\n tailContent?: ReactNode\n\n /** Header row above the code; hosts the toolbar when set. */\n title?: ReactNode\n\n /** @default true */\n withCopyButton?: boolean\n onCopy?: () => void\n\n /** @default false */\n defaultExpanded?: boolean\n expanded?: boolean\n onExpandedChange?: (expanded: boolean) => void\n\n /** Replaces the toolbar's icons: `copy`, `copied`, `expand`, `collapse`. A missing key keeps\n * its default; `null` leaves that button empty. */\n icons?: CodeBlockIcons\n controls?: ReactNode\n translations?: Partial<CodeBlockTranslations>\n className?: string\n classNames?: CodeBlockClassNames\n}\n\n/**\n * The interactive shell shared by `CodeBlock` (client, highlights via\n * `highlightCode` in an effect) and `CodeBlock.Static` (an async Server\n * Component that `await`s `highlightCode` directly during render, for a\n * fully static/SSR'd result with zero client JS spent on Shiki) — this\n * component owns the toolbar/copy/collapse-expand interactivity and\n * nothing about HOW `headContent`/`tailContent` were produced. Kept in its\n * own file specifically so `CodeBlock.Static` (no `\"use client\"`, safe to\n * import from a Server Component) can render it without pulling in\n * `code-block.tsx`'s own client-only highlighting logic.\n */\nexport function CodeBlockChrome({\n code,\n isCollapsible,\n headContent,\n tailContent,\n title,\n withCopyButton = true,\n onCopy,\n defaultExpanded = false,\n expanded: expandedProp,\n onExpandedChange,\n icons: iconsProp,\n controls,\n translations,\n testId,\n className,\n classNames,\n}: CodeBlockChromeProps) {\n const t = { ...DEFAULT_TRANSLATIONS, ...translations }\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n\n const [expanded, setExpanded] = useUncontrolled({\n value: expandedProp,\n defaultValue: defaultExpanded,\n finalValue: false,\n onChange: onExpandedChange,\n })\n\n // A fixed `top-2` reads fine pinned to the corner of a tall, multi-line\n // block, but on a single line there's no \"corner\" to anchor to — it just\n // looks like an arbitrarily offset button. True vertical centering (equal\n // gap above/below) is the correct treatment there instead.\n const isSingleLine = !code.includes(\"\\n\")\n\n const toolbar = (controls != null || withCopyButton || isCollapsible) && (\n <div\n className={cn(\n \"flex items-center gap-1 p-0.5\",\n // In a title header the toolbar sits in-flow at the row's end;\n // otherwise it floats over the code's top-right corner. Physical on\n // purpose, not `inset-e-*`: the code is always `dir=\"ltr\"` (even on an\n // RTL page), so its lines end on the right; a logical inset would put\n // the toolbar over the start of every line under `dir=\"rtl\"`.\n title == null && \"absolute right-2 z-10\",\n title == null && (isSingleLine ? \"top-1/2 -translate-y-1/2\" : \"top-2\"),\n // Same floating-surface chrome every other overlay panel in the\n // kit uses (Popover/Menu/Select's positioner) — border-brand-900/20\n // dark:border-white/15 + bg-brand-50/90 dark:bg-brand-950/85 +\n // backdrop-blur-sm + shadow-lg — rather than an ad-hoc neutral\n // white/gray tint that doesn't match the kit's own convention\n // for \"a small panel floating over content.\" Only while floating —\n // inside the title header it's part of the bar, not over content.\n title == null && popoverChrome,\n classNames?.controls,\n )}\n >\n {controls}\n {isCollapsible && (\n <ExpandTrigger\n expanded={expanded}\n onToggle={() => setExpanded((prev) => !prev)}\n expandLabel={t.expand}\n collapseLabel={t.collapse}\n icons={icons}\n className={classNames?.expandButton}\n testId={testId && `${testId}-expand`}\n />\n )}\n {withCopyButton && (\n <CopyTrigger\n code={code}\n onCopy={onCopy}\n copyLabel={t.copy}\n copiedLabel={t.copied}\n icons={icons}\n className={classNames?.copyButton}\n testId={testId && `${testId}-copy`}\n />\n )}\n </div>\n )\n\n return (\n <div\n className={cn(\n \"relative rounded-card border border-brand-900/30 dark:border-white/10 bg-white/4\",\n className,\n classNames?.root,\n )}\n {...props({ \"data-testid\": testId })}\n >\n {title != null ? (\n <div\n className={cn(\n \"flex min-h-9 items-center gap-2 border-b border-brand-900/30 dark:border-white/10 ps-4 pe-2\",\n \"text-xs font-mono\",\n TEXT_COLOR_CLASSES.muted,\n classNames?.title,\n )}\n >\n <span className=\"min-w-0 flex-1 truncate\">{title}</span>\n {toolbar}\n </div>\n ) : (\n toolbar\n )}\n\n {headContent}\n\n {isCollapsible && <Collapse open={expanded}>{tailContent}</Collapse>}\n\n {isCollapsible && (\n // Pinned to the *outer* card's own bottom edge (that div is the\n // nearest positioned ancestor), not to the code/Collapse content —\n // so it tracks the container's live height as Collapse animates\n // open/closed instead of sitting at a fixed spot relative to the\n // head/tail boundary, which \"teleported\" relative to the visibly\n // growing/shrinking content. Always mounted; only opacity toggles,\n // in sync with Collapse's own 300ms timing, so it fades together\n // with the reveal instead of popping in/out at the instant of click.\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-x-0 bottom-0 h-8 rounded-b-card\",\n \"transition-opacity duration-300\",\n // Same brand-tinted family as this card's own border\n // (border-brand-900/30 dark:border-white/10) and the toolbar's\n // popoverChrome (bg-brand-50/90 dark:bg-brand-950/85) — a plain\n // neutral white/gray-950 fade doesn't match either, and visibly\n // seams against a brand-tinted page background (dark mode's\n // --color-fd-background is brand-950, not a neutral gray).\n \"bg-linear-to-t from-brand-50/95 to-transparent dark:from-brand-950/95\",\n expanded ? \"opacity-0\" : \"opacity-100\",\n )}\n />\n )}\n </div>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/code-block/chrome.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAwBA,IAAM,oBAAA,GAA8C;AAAA,EAClD,IAAA,EAAM,MAAA;AAAA,EACN,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,WAAA;AAAA,EACR,QAAA,EAAU;AACZ,CAAA;AAOO,IAAM,aAAA,GAAsD;AAAA,EACjE,IAAA,kBAAM,GAAA,CAAC,QAAA,EAAA,EAAS,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EACvC,MAAA,kBAAQ,GAAA,CAAC,SAAA,EAAA,EAAU,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAC1C,MAAA,kBAAQ,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAW,UAAA,EAAY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AAA;AAAA,cACA,iCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAOA,uEAAA;AAAA,cACA,WAAW,WAAA,GAAc;AAAA;AAC3B;AAAA;AACF;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-I4IJOLNA.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { useClipboard } from \"@ark-ui/react/clipboard\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon, CopyIcon } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Collapse } from \"../collapse/collapse\"\nimport { popoverChrome } from \"../popover/popover\"\nimport { Tooltip } from \"../tooltip/tooltip\"\n\nexport type CodeBlockTranslations = {\n copy: string\n copied: string\n expand: string\n collapse: string\n}\n\nconst DEFAULT_TRANSLATIONS: CodeBlockTranslations = {\n copy: \"Copy\",\n copied: \"Copied\",\n expand: \"Show more\",\n collapse: \"Show less\",\n}\n\nexport type CodeBlockIconSlot = \"copy\" | \"copied\" | \"expand\" | \"collapse\"\n/** The toolbar's icons: `copy` and `copied` on the copy button, `expand` and\n * `collapse` on the collapse toggle. `null` leaves that button empty. */\nexport type CodeBlockIcons = IconMap<CodeBlockIconSlot>\n\nexport const DEFAULT_ICONS: Record<CodeBlockIconSlot, ReactNode> = {\n copy: <CopyIcon className={iconStroke} />,\n copied: <CheckIcon className={iconStroke} />,\n expand: <ChevronDownIcon className={iconStroke} />,\n collapse: <ChevronUpIcon className={iconStroke} />,\n}\n\nexport type CodeBlockClassNames = {\n root?: string\n title?: string\n pre?: string\n controls?: string\n copyButton?: string\n expandButton?: string\n}\n\nexport type CodeBlockButtonProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * `CodeBlock.Button` — the toolbar's own compact icon-button primitive.\n * `Copy`/expand use it internally, and it's exported so a consumer's own\n * `controls` button matches the exact same size/style instead of hand-\n * rolling one — same composition API as the rest of the kit (`asChild`, via\n * `HTMLArkProps`, so it wraps in a `Tooltip` exactly like the built-in\n * buttons do).\n *\n * A plain hand-rolled button, not an `ActionIcon` wrapper: this toolbar\n * needed something smaller than `ActionIcon`'s own `xs` floor, which is\n * sized for general-purpose use, not a compact floating strip over code.\n */\nexport const CodeBlockButton = ({\n className,\n asChild,\n type,\n testId,\n ...rest\n}: CodeBlockButtonProps) => (\n <ark.button\n asChild={asChild}\n type={asChild ? type : (type ?? \"button\")}\n {...props({ \"data-testid\": testId })}\n className={cn(\n \"inline-flex size-6 shrink-0 items-center justify-center rounded\",\n \"text-(--c-text) [&_svg]:size-3.5 [&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"hover:bg-(--c-soft)\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...rest}\n />\n)\n\ntype CopyTriggerProps = {\n code: string\n onCopy?: () => void\n copyLabel: string\n copiedLabel: string\n icons: Record<CodeBlockIconSlot, ReactNode>\n className?: string\n testId?: string\n}\n\n/**\n * Renaming the focused button (`aria-label` → \"Copied\") isn't re-read by\n * screen readers, so the copy is also announced through a visually hidden\n * `role=\"status\"` beside it: mounted empty, filled while `copied` lasts. It is\n * a sibling of the `Tooltip`-wrapped button (`asChild` needs one element), and\n * `sr-only` takes it out of the toolbar's flex row.\n *\n * Uses Ark's `useClipboard` hook directly rather than the `Clipboard.Root`/\n * `Clipboard.Indicator` components — both render their own wrapping `<div>`\n * (`data-part=\"root\"`/`\"indicator\"`), which, sitting as a direct child of the\n * toolbar's flex row, threw off its sizing/alignment next to the plain\n * `ActionIcon` the `ExpandTrigger` renders. The hook gives the same\n * `copied`/`copy` state machine with no imposed DOM structure at all — this\n * renders as a single real `<button>`, exactly like `ExpandTrigger`.\n */\nfunction CopyTrigger({\n code,\n onCopy,\n copyLabel,\n copiedLabel,\n icons,\n className,\n testId,\n}: CopyTriggerProps) {\n const { copied, copy } = useClipboard({\n value: code,\n timeout: 2000,\n onStatusChange: (details) => details.copied && onCopy?.(),\n })\n const label = copied ? copiedLabel : copyLabel\n return (\n <>\n <Tooltip label={label} asChild>\n <CodeBlockButton aria-label={label} onClick={copy} className={className} testId={testId}>\n {copied ? icons.copied : icons.copy}\n </CodeBlockButton>\n </Tooltip>\n <span role=\"status\" className=\"sr-only\">\n {copied ? copiedLabel : \"\"}\n </span>\n </>\n )\n}\n\ntype ExpandTriggerProps = {\n expanded: boolean\n onToggle: () => void\n expandLabel: string\n collapseLabel: string\n icons: Record<CodeBlockIconSlot, ReactNode>\n className?: string\n testId?: string\n}\n\n/** Toolbar icon button toggling the collapsed \"tail\" seam — an\n * `aria-expanded` `ActionIcon` with a matching `Tooltip`/accessible name,\n * same shape as `CopyTrigger`. Only rendered when `isCollapsible`. */\nfunction ExpandTrigger({\n expanded,\n onToggle,\n expandLabel,\n collapseLabel,\n icons,\n className,\n testId,\n}: ExpandTriggerProps) {\n const label = expanded ? collapseLabel : expandLabel\n return (\n <Tooltip label={label} asChild>\n <CodeBlockButton\n aria-label={label}\n aria-expanded={expanded}\n onClick={onToggle}\n className={className}\n testId={testId}\n >\n {expanded ? icons.collapse : icons.expand}\n </CodeBlockButton>\n </Tooltip>\n )\n}\n\nexport type CodeBlockChromeProps = WithTestId & {\n /** Raw source, used only for the copy button's clipboard value — this\n * component never highlights anything itself. */\n code: string\n /** Whether the tail half exists at all (mirrors the caller's own\n * `collapsedLines`/line-count decision) — controls whether the expand\n * toggle and the `Collapse`-wrapped tail slot render at all. */\n isCollapsible: boolean\n /** The head half's already-rendered content (highlighted HTML, or a\n * loading fallback — this component has no opinion on which). */\n headContent: ReactNode\n /** The tail half's already-rendered content — only read when\n * `isCollapsible`. */\n tailContent?: ReactNode\n\n /** Header row above the code; hosts the toolbar when set. */\n title?: ReactNode\n\n /** @default true */\n withCopyButton?: boolean\n onCopy?: () => void\n\n /** @default false */\n defaultExpanded?: boolean\n expanded?: boolean\n onExpandedChange?: (expanded: boolean) => void\n\n /** Replaces the toolbar's icons: `copy`, `copied`, `expand`, `collapse`. A missing key keeps\n * its default; `null` leaves that button empty. */\n icons?: CodeBlockIcons\n controls?: ReactNode\n translations?: Partial<CodeBlockTranslations>\n className?: string\n classNames?: CodeBlockClassNames\n}\n\n/**\n * The interactive shell shared by `CodeBlock` (client, highlights via\n * `highlightCode` in an effect) and `CodeBlock.Static` (an async Server\n * Component that `await`s `highlightCode` directly during render, for a\n * fully static/SSR'd result with zero client JS spent on Shiki) — this\n * component owns the toolbar/copy/collapse-expand interactivity and\n * nothing about HOW `headContent`/`tailContent` were produced. Kept in its\n * own file specifically so `CodeBlock.Static` (no `\"use client\"`, safe to\n * import from a Server Component) can render it without pulling in\n * `code-block.tsx`'s own client-only highlighting logic.\n */\nexport function CodeBlockChrome({\n code,\n isCollapsible,\n headContent,\n tailContent,\n title,\n withCopyButton = true,\n onCopy,\n defaultExpanded = false,\n expanded: expandedProp,\n onExpandedChange,\n icons: iconsProp,\n controls,\n translations,\n testId,\n className,\n classNames,\n}: CodeBlockChromeProps) {\n const t = { ...DEFAULT_TRANSLATIONS, ...translations }\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n\n const [expanded, setExpanded] = useUncontrolled({\n value: expandedProp,\n defaultValue: defaultExpanded,\n finalValue: false,\n onChange: onExpandedChange,\n })\n\n // A fixed `top-2` reads fine pinned to the corner of a tall, multi-line\n // block, but on a single line there's no \"corner\" to anchor to — it just\n // looks like an arbitrarily offset button. True vertical centering (equal\n // gap above/below) is the correct treatment there instead.\n const isSingleLine = !code.includes(\"\\n\")\n\n const toolbar = (controls != null || withCopyButton || isCollapsible) && (\n <div\n className={cn(\n \"flex items-center gap-1 p-0.5\",\n // In a title header the toolbar sits in-flow at the row's end;\n // otherwise it floats over the code's top-right corner. Physical on\n // purpose, not `inset-e-*`: the code is always `dir=\"ltr\"` (even on an\n // RTL page), so its lines end on the right; a logical inset would put\n // the toolbar over the start of every line under `dir=\"rtl\"`.\n title == null && \"absolute right-2 z-10\",\n title == null && (isSingleLine ? \"top-1/2 -translate-y-1/2\" : \"top-2\"),\n // Same floating-surface chrome every other overlay panel in the\n // kit uses (Popover/Menu/Select's positioner) — border-brand-900/20\n // dark:border-white/15 + bg-brand-50/90 dark:bg-brand-950/85 +\n // backdrop-blur-sm + shadow-lg — rather than an ad-hoc neutral\n // white/gray tint that doesn't match the kit's own convention\n // for \"a small panel floating over content.\" Only while floating —\n // inside the title header it's part of the bar, not over content.\n title == null && popoverChrome,\n classNames?.controls,\n )}\n >\n {controls}\n {isCollapsible && (\n <ExpandTrigger\n expanded={expanded}\n onToggle={() => setExpanded((prev) => !prev)}\n expandLabel={t.expand}\n collapseLabel={t.collapse}\n icons={icons}\n className={classNames?.expandButton}\n testId={testId && `${testId}-expand`}\n />\n )}\n {withCopyButton && (\n <CopyTrigger\n code={code}\n onCopy={onCopy}\n copyLabel={t.copy}\n copiedLabel={t.copied}\n icons={icons}\n className={classNames?.copyButton}\n testId={testId && `${testId}-copy`}\n />\n )}\n </div>\n )\n\n return (\n <div\n className={cn(\n \"relative rounded-card border border-brand-900/30 dark:border-white/10 bg-white/4\",\n className,\n classNames?.root,\n )}\n {...props({ \"data-testid\": testId })}\n >\n {title != null ? (\n <div\n className={cn(\n \"flex min-h-9 items-center gap-2 border-b border-brand-900/30 dark:border-white/10 ps-4 pe-2\",\n \"text-xs font-mono\",\n TEXT_COLOR_CLASSES.muted,\n classNames?.title,\n )}\n >\n <span className=\"min-w-0 flex-1 truncate\">{title}</span>\n {toolbar}\n </div>\n ) : (\n toolbar\n )}\n\n {headContent}\n\n {isCollapsible && <Collapse open={expanded}>{tailContent}</Collapse>}\n\n {isCollapsible && (\n // Pinned to the *outer* card's own bottom edge (that div is the\n // nearest positioned ancestor), not to the code/Collapse content —\n // so it tracks the container's live height as Collapse animates\n // open/closed instead of sitting at a fixed spot relative to the\n // head/tail boundary, which \"teleported\" relative to the visibly\n // growing/shrinking content. Always mounted; only opacity toggles,\n // in sync with Collapse's own 300ms timing, so it fades together\n // with the reveal instead of popping in/out at the instant of click.\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-x-0 bottom-0 h-8 rounded-b-card\",\n \"transition-opacity duration-300\",\n // Same brand-tinted family as this card's own border\n // (border-brand-900/30 dark:border-white/10) and the toolbar's\n // popoverChrome (bg-brand-50/90 dark:bg-brand-950/85) — a plain\n // neutral white/gray-950 fade doesn't match either, and visibly\n // seams against a brand-tinted page background (dark mode's\n // --color-fd-background is brand-950, not a neutral gray).\n \"bg-linear-to-t from-brand-50/95 to-transparent dark:from-brand-950/95\",\n expanded ? \"opacity-0\" : \"opacity-100\",\n )}\n />\n )}\n </div>\n )\n}\n"]}
@@ -1,12 +1,12 @@
1
1
  import { normalizeSelectData } from './chunk-7TDHT3QD.js';
2
- import { COMBOBOX_DEFAULT_TRANSLATIONS } from './chunk-6UIQJJNJ.js';
2
+ import { COMBOBOX_DEFAULT_TRANSLATIONS } from './chunk-QRNQQIQM.js';
3
3
  import { controlOpenProps } from './chunk-5FDOOG4J.js';
4
4
  import { inputSlot, placeholderColor, shellGap, inputShell } from './chunk-I4B3N3UX.js';
5
5
  import { FieldShell, fieldA11yProps } from './chunk-X6DESK37.js';
6
6
  import { useMergedRefs } from './chunk-HBWV5EPU.js';
7
- import { scrollHighlightedIntoView, popoverClearTrigger, popoverChevron, popoverGroupLabel, popoverList, popoverContent, popoverIndicator, popoverOption } from './chunk-N66NC6QK.js';
8
- import { useOverlayContainer } from './chunk-7P32XCEU.js';
9
- import { NestedLayer } from './chunk-H7WOMZXO.js';
7
+ import { scrollHighlightedIntoView, popoverClearTrigger, popoverChevron, popoverGroupLabel, popoverList, popoverContent, popoverIndicator, popoverOption } from './chunk-RKCUXOU2.js';
8
+ import { NestedLayer } from './chunk-HWBFRDX7.js';
9
+ import { useOverlayContainer } from './chunk-SLUOF7XW.js';
10
10
  import { CloseIcon, ChevronIcon, CheckIcon } from './chunk-6YNLRQ25.js';
11
11
  import { props } from './chunk-WYCMIIRR.js';
12
12
  import { cn } from './chunk-4ASNIDV7.js';
@@ -217,5 +217,5 @@ var Select = ({
217
217
  };
218
218
 
219
219
  export { Select };
220
- //# sourceMappingURL=chunk-UDCCOUWR.js.map
221
- //# sourceMappingURL=chunk-UDCCOUWR.js.map
220
+ //# sourceMappingURL=chunk-IA6DCC3N.js.map
221
+ //# sourceMappingURL=chunk-IA6DCC3N.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/select/select.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;;;;AAgJA,IAAM,UAAA,GAAa,CAAC,CAAA,KAClB,CAAA,KAAM,MAAA,GAAY,MAAA,GAAY,CAAA,KAAM,IAAA,GAAO,EAAC,GAAI,CAAC,CAAC,CAAA;AAQpD,IAAM,gBAAgB,CAAC;AAAA,EACrB,GAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,KAMmB;AACjB,EAAA,MAAM,QAAQ,eAAA,EAAgB;AAC9B,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAI,OAAA;AAAA,IAAJ;AAAA,MACC,GAAA;AAAA,MACA,MAAA;AAAA,MACC,GAAG,KAAA,CAAM,EAAE,gBAAgB,OAAA,EAAS,aAAA,EAAe,QAAQ,CAAA;AAAA,MAC3D,GAAG,eAAe,KAAK,CAAA;AAAA,MACxB,SAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAA;AAEO,IAAM,SAAS,CAA6C;AAAA,EACjE,YAAA,GAAe,IAAA;AAAA,EACf,SAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA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EAAJ,EAAkB,GAAG,WAAA,EAAa;AAAA;AAAA;AAAA,GACrC;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MACvB,UAAA,EAAY,EAAE,KAAA,EAAO,UAAA,EAAY,KAAA,EAAM;AAAA,MAEtC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-UDCCOUWR.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { Select as Ark } from \"@ark-ui/react/select\"\nimport {\n type ComponentProps,\n type FocusEvent,\n type ReactNode,\n type Ref,\n useMemo,\n useRef,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { NestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport {\n type ClearSectionMode,\n type NormalizedItem,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { COMBOBOX_DEFAULT_TRANSLATIONS, type ComboboxTranslations } from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n type InputSize,\n type InputVariant,\n inputShell,\n inputSlot,\n placeholderColor,\n shellGap,\n} from \"../input/input\"\nimport { CheckIcon, ChevronIcon, CloseIcon } from \"../popover/icons\"\nimport {\n popoverChevron,\n popoverClearTrigger,\n popoverContent,\n popoverGroupLabel,\n popoverIndicator,\n popoverList,\n popoverOption,\n scrollHighlightedIntoView,\n} from \"../popover/popover\"\n\n/**\n * Select — data-driven single-value picker on Ark UI's Select machine. Pass\n * `data` and it renders: a styled trigger, a popover of options, native form\n * submission (hidden `<select>`), typeahead, and full keyboard / RTL / ARIA from\n * Ark. For a *searchable* picker use `Autocomplete`; for multiple values use\n * `MultiSelect`.\n *\n * - `data` accepts `string[]`, `{ value, label?, disabled? }[]`, or grouped\n * `{ group, items }[]` (see `SelectData`).\n * - Value is a single `string | null`; the machine's array contract is hidden.\n * - Label / description / error come from the built-in `Field` wrapper, so a\n * `Select` is accessible and complete on its own.\n * - `clearable` swaps the chevron for a clear button once a value is set.\n *\n * Palette rides on `data-color`; the trigger reuses the shared input shell and\n * the popover the shared option styling, so Select and Combobox look identical.\n */\n\ntype SelectClassNames = {\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it (pair with a sibling element for a visible label\n * placed elsewhere in the layout). */\n label?: string\n control?: string\n option?: string\n popover?: string\n}\n\nexport type SelectProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled value. */\n value?: SelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: SelectValue<Data> | null\n /** Fires with the selected value (or `null` when cleared). */\n onChange?: (value: SelectValue<Data> | null) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including any check\n * affordance. Omit it to render the label + selected check.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder shown while no value is selected. */\n placeholder?: string\n /** Show a clear button (and allow deselecting) once a value is set. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the chevron / clear button. */\n endSlot?: ReactNode\n size?: InputSize\n variant?: InputVariant\n color?: Color\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Wires the hidden `<select>` into native form submission. */\n name?: string\n /** Forwarded to the trigger; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLButtonElement>) => void\n /** Lands on the trigger `<button>` for focus-on-error. */\n ref?: Ref<HTMLButtonElement>\n /** Render the panel in a Portal so it escapes clipping ancestors.\n * Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n className?: string\n classNames?: SelectClassNames\n /** Overrides the clear button's (`clearTriggerLabel`, default `\"Clear value\"`) and the\n * chevron's (`triggerLabel`, default `\"Show options\"`) accessible names — the same keys as\n * the rest of the combobox family. A partial override keeps the other default. */\n translations?: SelectTranslations\n }\n\n/** Ark's own Select `translations` type (its `clearTriggerLabel`), derived structurally rather\n * than imported from `@zag-js/select`, plus the combobox family's `triggerLabel` for the\n * kit's own chevron button. */\nexport type SelectTranslations = NonNullable<Ark.RootProps<NormalizedItem>[\"translations\"]> &\n Pick<ComboboxTranslations, \"triggerLabel\">\n\n/** Wrap a scalar value into Ark's array contract (or clear with `[]`). */\nconst toArkValue = (v: string | null | undefined): string[] | undefined =>\n v === undefined ? undefined : v === null ? [] : [v]\n\n/**\n * The real, focusable `<button role=\"combobox\">`, split out so it reads the\n * `Field` context from *inside* the wrapping `FieldShell` — `Select` itself\n * renders that shell, so calling `useFieldContext()` at its own top level\n * would run too early.\n */\nconst SelectTrigger = ({\n ref,\n onBlur,\n invalid,\n testId,\n className,\n children,\n}: {\n ref?: Ref<HTMLButtonElement>\n onBlur?: (event: FocusEvent<HTMLButtonElement>) => void\n invalid: boolean\n className?: string\n children: ReactNode\n} & WithTestId) => {\n const field = useFieldContext()\n return (\n <Ark.Trigger\n ref={ref}\n onBlur={onBlur}\n {...props({ \"aria-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={className}\n >\n {children}\n </Ark.Trigger>\n )\n}\n\nexport const Select = <const Data extends SelectData = SelectData>({\n withinPortal = true,\n container,\n data,\n value,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Pick a value\",\n clearable,\n clearSectionMode = \"replace\",\n startSlot,\n endSlot,\n size = \"md\",\n variant = \"default\",\n color,\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n ...selectProps\n}: SelectProps<Data> & Omit<ComponentProps<\"select\">, keyof SelectProps>) => {\n const resolvedTranslations = { ...COMBOBOX_DEFAULT_TRANSLATIONS, ...translations }\n const portalContainer = useOverlayContainer(container)\n const { collection, items, groups } = useMemo(() => normalizeSelectData(data), [data])\n const controlRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const mergedTriggerRef = useMergedRefs(triggerRef, ref)\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n const selected = items.find(({ value: iv }) => value === iv)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Ark.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={cn(popoverOption({ size }), classNames?.option)}\n >\n {renderItem ? (\n <Ark.ItemContext>\n {(ctx) =>\n renderItem(item, {\n selected: ctx.selected,\n highlighted: ctx.highlighted,\n })\n }\n </Ark.ItemContext>\n ) : (\n <>\n <Ark.ItemText>{item.label}</Ark.ItemText>\n <Ark.ItemIndicator className={popoverIndicator}>\n <CheckIcon />\n </Ark.ItemIndicator>\n </>\n )}\n </Ark.Item>\n )\n\n const control = (\n <Ark.Root\n collection={collection}\n value={toArkValue(value)}\n defaultValue={toArkValue(defaultValue)}\n // The machine's collection is typed by value (`string`); the runtime value\n // always originates from `data`, so narrow it back to the caller's value union.\n onValueChange={\n onChange ? (d) => onChange((d.value[0] ?? null) as SelectValue<Data> | null) : undefined\n }\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n deselectable={clearable}\n translations={resolvedTranslations}\n // Ark anchors Select's positioner to the Trigger, which sits inside the\n // padded `inputShell` Control — so `sameWidth` would inset the panel. Anchor\n // to the full Control instead (matching Combobox), so the panel aligns with\n // and matches the trigger's width.\n positioning={{\n sameWidth: true,\n getAnchorRect: () => controlRef.current?.getBoundingClientRect() ?? null,\n }}\n // Content is an `overflow-hidden` clip wrapper, so the machine's native\n // auto-scroll (which needs Content scrollable) no-ops; route scrolling to\n // the inner List scroller instead.\n scrollToIndexFn={scrollHighlightedIntoView}\n data-color={color}\n // `relative` contains the absolutely positioned hidden input, which would\n // otherwise escape any scroller this control sits in.\n className={cn(\"relative w-full\", className)}\n >\n <Ark.Context>\n {(api) => {\n const showClear = Boolean(clearable) && api.hasSelectedItems && !disabled && !readOnly\n const showChevron = clearSectionMode === \"both\" || !showClear\n return (\n <Ark.Control\n ref={controlRef}\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": startSlot != null,\n // The trigger always ends in a chevron / clear control.\n \"data-with-end-slot\": true,\n })}\n // Tablet affordance: a tap on the shell's dead zones (padding) opens\n // the menu too, not just the trigger. The trigger, clear and chevron\n // are all buttons, so the helper skips them and they self-handle.\n // Inert when disabled / readOnly, so it never opens where the trigger won't.\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(inputShell({ size, variant }), \"cursor-pointer\", classNames?.control)}\n >\n <SelectTrigger\n ref={mergedTriggerRef}\n onBlur={onBlur}\n invalid={isInvalid}\n testId={testId}\n className={cn(\n \"flex min-w-0 flex-1 cursor-pointer items-center bg-transparent text-start outline-none disabled:cursor-not-allowed\",\n // Slots live inside the trigger (not the shell), so re-apply the\n // shell's per-size gap here to space the icon from the value.\n shellGap[size],\n )}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n <span className=\"min-w-0 flex-1 truncate text-start\">\n {api.hasSelectedItems ? (\n renderItem && selected ? (\n renderItem(selected, {\n selected: false,\n highlighted: false,\n })\n ) : (\n api.valueAsString\n )\n ) : (\n <span className={placeholderColor}>{placeholder}</span>\n )}\n </span>\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n </SelectTrigger>\n {showClear && (\n <Ark.ClearTrigger className={popoverClearTrigger}>\n <CloseIcon />\n </Ark.ClearTrigger>\n )}\n {showChevron && (\n // A sibling toggle button (the value `Ark.Trigger` can't nest it\n // next to the clear button), so the chevron sits at the far edge\n // like the rest of the family. Focus the trigger first so keyboard\n // nav stays on the combobox; `preventDefault` stops the tap from\n // stealing focus to this button. `tabIndex=-1`: the trigger is the\n // tab stop.\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={resolvedTranslations.triggerLabel}\n data-chevron\n className={cn(\n popoverChevron,\n \"inline-flex cursor-pointer items-center justify-center rounded-sm data-disabled:cursor-not-allowed\",\n api.open && \"rotate-180\",\n )}\n {...props({\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n })}\n onPointerDown={(event) => event.preventDefault()}\n {...(!(disabled || readOnly) && {\n onClick: () => {\n triggerRef.current?.focus()\n api.setOpen(!api.open)\n },\n })}\n >\n <ChevronIcon />\n </button>\n )}\n </Ark.Control>\n )\n }}\n </Ark.Context>\n\n {/* Holds an enclosing Modal/Drawer/Popover open while the list is; see `lib/overlay-layer.tsx`. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content data-color={color} className={cn(popoverContent, classNames?.popover)}>\n <Ark.List className={popoverList({ withPaddingTop: true })}>\n {groups\n ? groups.map((group) => (\n <Ark.ItemGroup key={group.group}>\n <Ark.ItemGroupLabel className={popoverGroupLabel}>\n {group.group}\n </Ark.ItemGroupLabel>\n {group.items.map(renderOption)}\n </Ark.ItemGroup>\n ))\n : items.map(renderOption)}\n </Ark.List>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n\n <Ark.HiddenSelect {...selectProps} />\n </Ark.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n classNames={{ label: classNames?.label }}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/select/select.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;;;;AAgJA,IAAM,UAAA,GAAa,CAAC,CAAA,KAClB,CAAA,KAAM,MAAA,GAAY,MAAA,GAAY,CAAA,KAAM,IAAA,GAAO,EAAC,GAAI,CAAC,CAAC,CAAA;AAQpD,IAAM,gBAAgB,CAAC;AAAA,EACrB,GAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,KAMmB;AACjB,EAAA,MAAM,QAAQ,eAAA,EAAgB;AAC9B,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAI,OAAA;AAAA,IAAJ;AAAA,MACC,GAAA;AAAA,MACA,MAAA;AAAA,MACC,GAAG,KAAA,CAAM,EAAE,gBAAgB,OAAA,EAAS,aAAA,EAAe,QAAQ,CAAA;AAAA,MAC3D,GAAG,eAAe,KAAK,CAAA;AAAA,MACxB,SAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAA;AAEO,IAAM,SAAS,CAA6C;AAAA,EACjE,YAAA,GAAe,IAAA;AAAA,EACf,SAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA,GAAc,cAAA;AAAA,EACd,SAAA;AAAA,EACA,gBAAA,GAAmB,SAAA;AAAA,EACnB,SAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA,GAAO,IAAA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AA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MACvB,UAAA,EAAY,EAAE,KAAA,EAAO,UAAA,EAAY,KAAA,EAAM;AAAA,MAEtC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-IA6DCC3N.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { Select as Ark } from \"@ark-ui/react/select\"\nimport {\n type ComponentProps,\n type FocusEvent,\n type ReactNode,\n type Ref,\n useMemo,\n useRef,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { NestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport {\n type ClearSectionMode,\n type NormalizedItem,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { COMBOBOX_DEFAULT_TRANSLATIONS, type ComboboxTranslations } from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n type InputSize,\n type InputVariant,\n inputShell,\n inputSlot,\n placeholderColor,\n shellGap,\n} from \"../input/input\"\nimport { CheckIcon, ChevronIcon, CloseIcon } from \"../popover/icons\"\nimport {\n popoverChevron,\n popoverClearTrigger,\n popoverContent,\n popoverGroupLabel,\n popoverIndicator,\n popoverList,\n popoverOption,\n scrollHighlightedIntoView,\n} from \"../popover/popover\"\n\n/**\n * Select — data-driven single-value picker on Ark UI's Select machine. Pass\n * `data` and it renders: a styled trigger, a popover of options, native form\n * submission (hidden `<select>`), typeahead, and full keyboard / RTL / ARIA from\n * Ark. For a *searchable* picker use `Autocomplete`; for multiple values use\n * `MultiSelect`.\n *\n * - `data` accepts `string[]`, `{ value, label?, disabled? }[]`, or grouped\n * `{ group, items }[]` (see `SelectData`).\n * - Value is a single `string | null`; the machine's array contract is hidden.\n * - Label / description / error come from the built-in `Field` wrapper, so a\n * `Select` is accessible and complete on its own.\n * - `clearable` swaps the chevron for a clear button once a value is set.\n *\n * Palette rides on `data-color`; the trigger reuses the shared input shell and\n * the popover the shared option styling, so Select and Combobox look identical.\n */\n\ntype SelectClassNames = {\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it (pair with a sibling element for a visible label\n * placed elsewhere in the layout). */\n label?: string\n control?: string\n option?: string\n popover?: string\n}\n\nexport type SelectProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled value. */\n value?: SelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: SelectValue<Data> | null\n /** Fires with the selected value (or `null` when cleared). */\n onChange?: (value: SelectValue<Data> | null) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including any check\n * affordance. Omit it to render the label + selected check.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder shown while no value is selected. */\n placeholder?: string\n /** Show a clear button (and allow deselecting) once a value is set. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the chevron / clear button. */\n endSlot?: ReactNode\n size?: InputSize\n variant?: InputVariant\n color?: Color\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Wires the hidden `<select>` into native form submission. */\n name?: string\n /** Forwarded to the trigger; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLButtonElement>) => void\n /** Lands on the trigger `<button>` for focus-on-error. */\n ref?: Ref<HTMLButtonElement>\n /** Render the panel in a Portal so it escapes clipping ancestors.\n * Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n className?: string\n classNames?: SelectClassNames\n /** Overrides the clear button's (`clearTriggerLabel`, default `\"Clear value\"`) and the\n * chevron's (`triggerLabel`, default `\"Show options\"`) accessible names — the same keys as\n * the rest of the combobox family. A partial override keeps the other default. */\n translations?: SelectTranslations\n }\n\n/** Ark's own Select `translations` type (its `clearTriggerLabel`), derived structurally rather\n * than imported from `@zag-js/select`, plus the combobox family's `triggerLabel` for the\n * kit's own chevron button. */\nexport type SelectTranslations = NonNullable<Ark.RootProps<NormalizedItem>[\"translations\"]> &\n Pick<ComboboxTranslations, \"triggerLabel\">\n\n/** Wrap a scalar value into Ark's array contract (or clear with `[]`). */\nconst toArkValue = (v: string | null | undefined): string[] | undefined =>\n v === undefined ? undefined : v === null ? [] : [v]\n\n/**\n * The real, focusable `<button role=\"combobox\">`, split out so it reads the\n * `Field` context from *inside* the wrapping `FieldShell` — `Select` itself\n * renders that shell, so calling `useFieldContext()` at its own top level\n * would run too early.\n */\nconst SelectTrigger = ({\n ref,\n onBlur,\n invalid,\n testId,\n className,\n children,\n}: {\n ref?: Ref<HTMLButtonElement>\n onBlur?: (event: FocusEvent<HTMLButtonElement>) => void\n invalid: boolean\n className?: string\n children: ReactNode\n} & WithTestId) => {\n const field = useFieldContext()\n return (\n <Ark.Trigger\n ref={ref}\n onBlur={onBlur}\n {...props({ \"aria-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={className}\n >\n {children}\n </Ark.Trigger>\n )\n}\n\nexport const Select = <const Data extends SelectData = SelectData>({\n withinPortal = true,\n container,\n data,\n value,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Pick a value\",\n clearable,\n clearSectionMode = \"replace\",\n startSlot,\n endSlot,\n size = \"md\",\n variant = \"default\",\n color,\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n ...selectProps\n}: SelectProps<Data> & Omit<ComponentProps<\"select\">, keyof SelectProps>) => {\n const resolvedTranslations = { ...COMBOBOX_DEFAULT_TRANSLATIONS, ...translations }\n const portalContainer = useOverlayContainer(container)\n const { collection, items, groups } = useMemo(() => normalizeSelectData(data), [data])\n const controlRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const mergedTriggerRef = useMergedRefs(triggerRef, ref)\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n const selected = items.find(({ value: iv }) => value === iv)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Ark.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={cn(popoverOption({ size }), classNames?.option)}\n >\n {renderItem ? (\n <Ark.ItemContext>\n {(ctx) =>\n renderItem(item, {\n selected: ctx.selected,\n highlighted: ctx.highlighted,\n })\n }\n </Ark.ItemContext>\n ) : (\n <>\n <Ark.ItemText>{item.label}</Ark.ItemText>\n <Ark.ItemIndicator className={popoverIndicator}>\n <CheckIcon />\n </Ark.ItemIndicator>\n </>\n )}\n </Ark.Item>\n )\n\n const control = (\n <Ark.Root\n collection={collection}\n value={toArkValue(value)}\n defaultValue={toArkValue(defaultValue)}\n // The machine's collection is typed by value (`string`); the runtime value\n // always originates from `data`, so narrow it back to the caller's value union.\n onValueChange={\n onChange ? (d) => onChange((d.value[0] ?? null) as SelectValue<Data> | null) : undefined\n }\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n deselectable={clearable}\n translations={resolvedTranslations}\n // Ark anchors Select's positioner to the Trigger, which sits inside the\n // padded `inputShell` Control — so `sameWidth` would inset the panel. Anchor\n // to the full Control instead (matching Combobox), so the panel aligns with\n // and matches the trigger's width.\n positioning={{\n sameWidth: true,\n getAnchorRect: () => controlRef.current?.getBoundingClientRect() ?? null,\n }}\n // Content is an `overflow-hidden` clip wrapper, so the machine's native\n // auto-scroll (which needs Content scrollable) no-ops; route scrolling to\n // the inner List scroller instead.\n scrollToIndexFn={scrollHighlightedIntoView}\n data-color={color}\n // `relative` contains the absolutely positioned hidden input, which would\n // otherwise escape any scroller this control sits in.\n className={cn(\"relative w-full\", className)}\n >\n <Ark.Context>\n {(api) => {\n const showClear = Boolean(clearable) && api.hasSelectedItems && !disabled && !readOnly\n const showChevron = clearSectionMode === \"both\" || !showClear\n return (\n <Ark.Control\n ref={controlRef}\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": startSlot != null,\n // The trigger always ends in a chevron / clear control.\n \"data-with-end-slot\": true,\n })}\n // Tablet affordance: a tap on the shell's dead zones (padding) opens\n // the menu too, not just the trigger. The trigger, clear and chevron\n // are all buttons, so the helper skips them and they self-handle.\n // Inert when disabled / readOnly, so it never opens where the trigger won't.\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(inputShell({ size, variant }), \"cursor-pointer\", classNames?.control)}\n >\n <SelectTrigger\n ref={mergedTriggerRef}\n onBlur={onBlur}\n invalid={isInvalid}\n testId={testId}\n className={cn(\n \"flex min-w-0 flex-1 cursor-pointer items-center bg-transparent text-start outline-none disabled:cursor-not-allowed\",\n // Slots live inside the trigger (not the shell), so re-apply the\n // shell's per-size gap here to space the icon from the value.\n shellGap[size],\n )}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n <span className=\"min-w-0 flex-1 truncate text-start\">\n {api.hasSelectedItems ? (\n renderItem && selected ? (\n renderItem(selected, {\n selected: false,\n highlighted: false,\n })\n ) : (\n api.valueAsString\n )\n ) : (\n <span className={placeholderColor}>{placeholder}</span>\n )}\n </span>\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n </SelectTrigger>\n {showClear && (\n <Ark.ClearTrigger className={popoverClearTrigger}>\n <CloseIcon />\n </Ark.ClearTrigger>\n )}\n {showChevron && (\n // A sibling toggle button (the value `Ark.Trigger` can't nest it\n // next to the clear button), so the chevron sits at the far edge\n // like the rest of the family. Focus the trigger first so keyboard\n // nav stays on the combobox; `preventDefault` stops the tap from\n // stealing focus to this button. `tabIndex=-1`: the trigger is the\n // tab stop.\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={resolvedTranslations.triggerLabel}\n data-chevron\n className={cn(\n popoverChevron,\n \"inline-flex cursor-pointer items-center justify-center rounded-sm data-disabled:cursor-not-allowed\",\n api.open && \"rotate-180\",\n )}\n {...props({\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n })}\n onPointerDown={(event) => event.preventDefault()}\n {...(!(disabled || readOnly) && {\n onClick: () => {\n triggerRef.current?.focus()\n api.setOpen(!api.open)\n },\n })}\n >\n <ChevronIcon />\n </button>\n )}\n </Ark.Control>\n )\n }}\n </Ark.Context>\n\n {/* Holds an enclosing Modal/Drawer/Popover open while the list is; see `lib/overlay-layer.tsx`. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content data-color={color} className={cn(popoverContent, classNames?.popover)}>\n <Ark.List className={popoverList({ withPaddingTop: true })}>\n {groups\n ? groups.map((group) => (\n <Ark.ItemGroup key={group.group}>\n <Ark.ItemGroupLabel className={popoverGroupLabel}>\n {group.group}\n </Ark.ItemGroupLabel>\n {group.items.map(renderOption)}\n </Ark.ItemGroup>\n ))\n : items.map(renderOption)}\n </Ark.List>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n\n <Ark.HiddenSelect {...selectProps} />\n </Ark.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n classNames={{ label: classNames?.label }}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { inputSlot, inputControlClasses, inputShell } from './chunk-I4B3N3UX.js';
2
- import { popoverClearTrigger } from './chunk-N66NC6QK.js';
2
+ import { popoverClearTrigger } from './chunk-RKCUXOU2.js';
3
3
  import { props } from './chunk-WYCMIIRR.js';
4
4
  import { cn } from './chunk-4ASNIDV7.js';
5
5
  import { Combobox } from '@ark-ui/react/combobox';
@@ -58,5 +58,5 @@ var ComboboxSearchRow = ({
58
58
  );
59
59
 
60
60
  export { ComboboxSearchRow };
61
- //# sourceMappingURL=chunk-36NWC4GV.js.map
62
- //# sourceMappingURL=chunk-36NWC4GV.js.map
61
+ //# sourceMappingURL=chunk-ISX3AM32.js.map
62
+ //# sourceMappingURL=chunk-ISX3AM32.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/combobox-list/combobox-search-row.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;AAqCO,IAAM,oBAAoB,CAAC;AAAA,EAChC,IAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,qBACE,IAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACE,GAAG,KAAA,CAAM,EAAE,gBAAgB,OAAA,EAAS,oBAAA,EAAsB,UAAU,CAAA;AAAA,IACrE,SAAA,EAAW,EAAA;AAAA,MACT,UAAA,CAAW,EAAE,IAAA,EAAM,OAAA,EAAS,CAAA;AAAA,MAC5B,iGAAA;AAAA,MACA,UAAA,EAAY;AAAA,KACd;AAAA,IAEC,QAAA,EAAA;AAAA,MAAA,KAAA,CAAM,MAAA,IAAU,wBACf,GAAA,CAAC,MAAA,EAAA,EAAK,WAAW,SAAA,EAAW,aAAA,EAAW,IAAA,EACpC,QAAA,EAAA,KAAA,CAAM,MAAA,EACT,CAAA;AAAA,sBAOF,GAAA;AAAA,QAACA,QAAA,CAAY,KAAA;AAAA,QAAZ;AAAA,UACC,WAAA;AAAA,UACA,MAAA;AAAA,UACA,GAAA;AAAA,UACC,GAAG,KAAA,CAAM,EAAE,gBAAgB,OAAA,EAAS,aAAA,EAAe,QAAQ,CAAA;AAAA,UAC5D,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,UAAA,EAAY,KAAK;AAAA;AAAA,OACtD;AAAA,MACC,QAAA,oBACC,GAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,QAAA;AAAA,UACL,YAAA,EAAY,UAAA;AAAA,UACZ,eAAa,CAAC,SAAA;AAAA,UACd,QAAA,EAAU,YAAY,CAAA,GAAI,EAAA;AAAA,UAC1B,aAAA,EAAe,CAAC,KAAA,KAAU,KAAA,CAAM,cAAA,EAAe;AAAA,UAC/C,OAAA,EAAS,OAAA;AAAA,UACT,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,CAAC,aAAa,WAAW,CAAA;AAAA,UAE3D,QAAA,EAAA,KAAA,CAAM;AAAA;AAAA;AACT;AAAA;AAEJ","file":"chunk-36NWC4GV.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { popoverClearTrigger } from \"../popover/popover\"\n\nexport type ComboboxSearchRowProps = {\n size: InputSize\n variant: InputVariant\n invalid: boolean\n placeholder?: string\n /** Reserves the clear button's box, so its showing never shifts the input's width. */\n canClear: boolean\n /** Shows the reserved clear button and makes it reachable. */\n showClear: boolean\n clearLabel: string\n onClear: () => void\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n ref?: Ref<HTMLInputElement>\n testId?: string\n icons: { search: ReactNode; clear: ReactNode }\n classNames?: { search?: string; input?: string }\n}\n\n/**\n * The always-open lists' search row — `ComboboxList` and `MultiComboboxList` — inside their\n * `Combobox.Root`: the magnifier, the search `<input>`, and the clear button.\n */\nexport const ComboboxSearchRow = ({\n size,\n variant,\n invalid,\n placeholder,\n canClear,\n showClear,\n clearLabel,\n onClear,\n onBlur,\n ref,\n testId,\n icons,\n classNames,\n}: ComboboxSearchRowProps) => (\n <div\n {...props({ \"data-invalid\": invalid, \"data-with-end-slot\": canClear })}\n className={cn(\n inputShell({ size, variant }),\n \"rounded-none border-t-0 border-e-0 border-s-0 border-b border-brand-900/20 dark:border-white/15\",\n classNames?.search,\n )}\n >\n {icons.search != null && (\n <span className={inputSlot} aria-hidden>\n {icons.search}\n </span>\n )}\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on the\n real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`, replicated\n here. `name` is intentionally NOT here — it would submit the typed\n search text, not the selection (the lists render hidden inputs). */}\n <ArkCombobox.Input\n placeholder={placeholder}\n onBlur={onBlur}\n ref={ref}\n {...props({ \"aria-invalid\": invalid, \"data-testid\": testId })}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {canClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n aria-hidden={!showClear}\n tabIndex={showClear ? 0 : -1}\n onPointerDown={(event) => event.preventDefault()}\n onClick={onClear}\n className={cn(popoverClearTrigger, !showClear && \"invisible\")}\n >\n {icons.clear}\n </button>\n )}\n </div>\n)\n"]}
1
+ {"version":3,"sources":["../src/components/combobox-list/combobox-search-row.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;AAqCO,IAAM,oBAAoB,CAAC;AAAA,EAChC,IAAA;AAAA,EACA,OAA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AW,EAAA,CAAG,mBAAA,EAAqB,CAAC,aAAa,WAAW,CAAA;AAAA,UAE3D,QAAA,EAAA,KAAA,CAAM;AAAA;AAAA;AACT;AAAA;AAEJ","file":"chunk-ISX3AM32.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { popoverClearTrigger } from \"../popover/popover\"\n\nexport type ComboboxSearchRowProps = {\n size: InputSize\n variant: InputVariant\n invalid: boolean\n placeholder?: string\n /** Reserves the clear button's box, so its showing never shifts the input's width. */\n canClear: boolean\n /** Shows the reserved clear button and makes it reachable. */\n showClear: boolean\n clearLabel: string\n onClear: () => void\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n ref?: Ref<HTMLInputElement>\n testId?: string\n icons: { search: ReactNode; clear: ReactNode }\n classNames?: { search?: string; input?: string }\n}\n\n/**\n * The always-open lists' search row — `ComboboxList` and `MultiComboboxList` — inside their\n * `Combobox.Root`: the magnifier, the search `<input>`, and the clear button.\n */\nexport const ComboboxSearchRow = ({\n size,\n variant,\n invalid,\n placeholder,\n canClear,\n showClear,\n clearLabel,\n onClear,\n onBlur,\n ref,\n testId,\n icons,\n classNames,\n}: ComboboxSearchRowProps) => (\n <div\n {...props({ \"data-invalid\": invalid, \"data-with-end-slot\": canClear })}\n className={cn(\n inputShell({ size, variant }),\n \"rounded-none border-t-0 border-e-0 border-s-0 border-b border-brand-900/20 dark:border-white/15\",\n classNames?.search,\n )}\n >\n {icons.search != null && (\n <span className={inputSlot} aria-hidden>\n {icons.search}\n </span>\n )}\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on the\n real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`, replicated\n here. `name` is intentionally NOT here — it would submit the typed\n search text, not the selection (the lists render hidden inputs). */}\n <ArkCombobox.Input\n placeholder={placeholder}\n onBlur={onBlur}\n ref={ref}\n {...props({ \"aria-invalid\": invalid, \"data-testid\": testId })}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {canClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n aria-hidden={!showClear}\n tabIndex={showClear ? 0 : -1}\n onPointerDown={(event) => event.preventDefault()}\n onClick={onClear}\n className={cn(popoverClearTrigger, !showClear && \"invisible\")}\n >\n {icons.clear}\n </button>\n )}\n </div>\n)\n"]}
@@ -1,6 +1,6 @@
1
- import { createDialogParts, DIALOG_PADDING, useDialogNameCheck, DialogRootProviders } from './chunk-NLSJ6T7V.js';
2
- import { OverlayContainerProvider } from './chunk-7P32XCEU.js';
3
- import { useLayerGuard, NestedLayer } from './chunk-H7WOMZXO.js';
1
+ import { createDialogParts, DIALOG_PADDING, useDialogNameCheck, DialogRootProviders } from './chunk-4D2V4JE4.js';
2
+ import { useLayerGuard, NestedLayer } from './chunk-HWBFRDX7.js';
3
+ import { OverlayContainerProvider } from './chunk-SLUOF7XW.js';
4
4
  import { props } from './chunk-WYCMIIRR.js';
5
5
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
6
6
  import { cn } from './chunk-4ASNIDV7.js';
@@ -130,7 +130,7 @@ var DrawerRoot = ({
130
130
  onPointerDownOutside: guard.onPointerDownOutside,
131
131
  ...rest,
132
132
  children: [
133
- /* @__PURE__ */ jsx(Drawer$1.Context, { children: (api) => /* @__PURE__ */ jsx(NestedLayer, { open: api.open }) }),
133
+ /* @__PURE__ */ jsx(Drawer$1.Context, { children: (api) => /* @__PURE__ */ jsx(NestedLayer, { open: api.open, modal: true }) }),
134
134
  /* @__PURE__ */ jsx(DrawerPlacementContext, { value: placement, children: /* @__PURE__ */ jsx(DialogRootProviders, { icons, layers: guard.layers, children }) })
135
135
  ]
136
136
  }
@@ -305,5 +305,5 @@ var Drawer = Object.assign(DrawerComponent, {
305
305
  });
306
306
 
307
307
  export { Drawer };
308
- //# sourceMappingURL=chunk-LMCUGYHT.js.map
309
- //# sourceMappingURL=chunk-LMCUGYHT.js.map
308
+ //# sourceMappingURL=chunk-L24N5EON.js.map
309
+ //# sourceMappingURL=chunk-L24N5EON.js.map
@@ -0,0 +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;AAAA,QACL,MAAA,EAAQ;AAAA;AACV,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,SAAA,EAAW,KAAA;AAAM;AAExC,CAAA;AASA,IAAM,mBAAmB,CAAC;AAAA,EACxB,SAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,EAAS,QAAA;AAAA,EACT,GAAG;AACL,CAAA,KAA6B;AAC3B,EAAA,MAAM,SAAA,GAAY,WAAW,sBAAsB,CAAA;AACnD,EAAA,MAAM,UAAA,GAAa,OAAuB,IAAI,CAAA;AAC9C,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAI,UAAA;AAAA,IAAJ;AAAA,MACC,GAAA,EAAK,UAAA;AAAA,MACL,WAAW,EAAA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N5EON.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} modal />}</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"]}