@42-central/ui-react 0.27.0 → 0.29.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 (180) hide show
  1. package/dist/{chunk-5H5YOPCF.js → chunk-2RQLPN4U.js} +6 -6
  2. package/dist/{chunk-5H5YOPCF.js.map → chunk-2RQLPN4U.js.map} +1 -1
  3. package/dist/{chunk-SOUDKESO.js → chunk-37HYN7PC.js} +3 -3
  4. package/dist/{chunk-SOUDKESO.js.map → chunk-37HYN7PC.js.map} +1 -1
  5. package/dist/{chunk-OVT2KZHY.js → chunk-3KARNPW4.js} +3 -3
  6. package/dist/{chunk-OVT2KZHY.js.map → chunk-3KARNPW4.js.map} +1 -1
  7. package/dist/{chunk-Y2G47ARQ.js → chunk-5EOMSWNO.js} +5 -5
  8. package/dist/{chunk-Y2G47ARQ.js.map → chunk-5EOMSWNO.js.map} +1 -1
  9. package/dist/chunk-6B2GNPJP.js +43 -0
  10. package/dist/chunk-6B2GNPJP.js.map +1 -0
  11. package/dist/{chunk-MCRTAUSZ.js → chunk-7FPSQBWB.js} +3 -3
  12. package/dist/{chunk-MCRTAUSZ.js.map → chunk-7FPSQBWB.js.map} +1 -1
  13. package/dist/{chunk-6IRMKF5T.js → chunk-B4GNSSHU.js} +4 -4
  14. package/dist/{chunk-6IRMKF5T.js.map → chunk-B4GNSSHU.js.map} +1 -1
  15. package/dist/{chunk-BMEJBY6H.js → chunk-B5YHYI7E.js} +22 -27
  16. package/dist/chunk-B5YHYI7E.js.map +1 -0
  17. package/dist/{chunk-WERJ44ZN.js → chunk-DTFSCR3U.js} +3 -3
  18. package/dist/{chunk-WERJ44ZN.js.map → chunk-DTFSCR3U.js.map} +1 -1
  19. package/dist/{chunk-PFZMB3US.js → chunk-FQJNQW3G.js} +3 -3
  20. package/dist/{chunk-PFZMB3US.js.map → chunk-FQJNQW3G.js.map} +1 -1
  21. package/dist/{chunk-X3YIHN2U.js → chunk-FSPS7TVD.js} +5 -5
  22. package/dist/{chunk-X3YIHN2U.js.map → chunk-FSPS7TVD.js.map} +1 -1
  23. package/dist/{chunk-7OGZT7U2.js → chunk-G3AD3NJG.js} +3 -3
  24. package/dist/{chunk-7OGZT7U2.js.map → chunk-G3AD3NJG.js.map} +1 -1
  25. package/dist/{chunk-MNYY7UU2.js → chunk-GEZYGBXY.js} +6 -6
  26. package/dist/{chunk-MNYY7UU2.js.map → chunk-GEZYGBXY.js.map} +1 -1
  27. package/dist/{chunk-ULF5LOBS.js → chunk-HMNXNKDA.js} +3 -3
  28. package/dist/{chunk-ULF5LOBS.js.map → chunk-HMNXNKDA.js.map} +1 -1
  29. package/dist/{chunk-NF2PBGD3.js → chunk-IANYMDKH.js} +3 -3
  30. package/dist/{chunk-NF2PBGD3.js.map → chunk-IANYMDKH.js.map} +1 -1
  31. package/dist/{chunk-QEMXXQQO.js → chunk-JKFPRQB2.js} +3 -3
  32. package/dist/{chunk-QEMXXQQO.js.map → chunk-JKFPRQB2.js.map} +1 -1
  33. package/dist/{chunk-ZVECQBGG.js → chunk-KNGSO7A3.js} +41 -13
  34. package/dist/chunk-KNGSO7A3.js.map +1 -0
  35. package/dist/{chunk-L24N5EON.js → chunk-MQHD3EJE.js} +3 -3
  36. package/dist/{chunk-L24N5EON.js.map → chunk-MQHD3EJE.js.map} +1 -1
  37. package/dist/{chunk-IUK7OJXZ.js → chunk-OBSZ4NE2.js} +5 -4
  38. package/dist/chunk-OBSZ4NE2.js.map +1 -0
  39. package/dist/{chunk-DJ72KP32.js → chunk-OXR7BXZA.js} +3 -3
  40. package/dist/{chunk-DJ72KP32.js.map → chunk-OXR7BXZA.js.map} +1 -1
  41. package/dist/{chunk-LIZWCWED.js → chunk-PQZSTI3R.js} +3 -3
  42. package/dist/{chunk-LIZWCWED.js.map → chunk-PQZSTI3R.js.map} +1 -1
  43. package/dist/{chunk-LKFHUDEW.js → chunk-QVOBLRCM.js} +3 -3
  44. package/dist/{chunk-LKFHUDEW.js.map → chunk-QVOBLRCM.js.map} +1 -1
  45. package/dist/{chunk-E52Z2FKU.js → chunk-S5CQRCTF.js} +5 -5
  46. package/dist/{chunk-E52Z2FKU.js.map → chunk-S5CQRCTF.js.map} +1 -1
  47. package/dist/{chunk-SCXXJDKQ.js → chunk-SP6LCCTZ.js} +21 -28
  48. package/dist/chunk-SP6LCCTZ.js.map +1 -0
  49. package/dist/{chunk-BGDVUC3B.js → chunk-TUP7WXQE.js} +3 -3
  50. package/dist/{chunk-BGDVUC3B.js.map → chunk-TUP7WXQE.js.map} +1 -1
  51. package/dist/{chunk-4D2V4JE4.js → chunk-V2QZG4IT.js} +4 -4
  52. package/dist/{chunk-4D2V4JE4.js.map → chunk-V2QZG4IT.js.map} +1 -1
  53. package/dist/{chunk-D2QIPQ74.js → chunk-W3XX7BYT.js} +2 -2
  54. package/dist/chunk-W3XX7BYT.js.map +1 -0
  55. package/dist/{chunk-F374BNL4.js → chunk-YVTM2KRR.js} +12 -8
  56. package/dist/chunk-YVTM2KRR.js.map +1 -0
  57. package/dist/colors.css +328 -0
  58. package/dist/components/action-icon/action-icon.d.ts +6 -5
  59. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  60. package/dist/components/action-icon/index.js +3 -2
  61. package/dist/components/alert/index.js +3 -3
  62. package/dist/components/ambient-background/index.js +1 -1
  63. package/dist/components/app-shell/index.js +6 -5
  64. package/dist/components/app-shell/index.js.map +1 -1
  65. package/dist/components/avatar/index.js +2 -2
  66. package/dist/components/badge/badge.d.ts +1 -1
  67. package/dist/components/badge/badge.d.ts.map +1 -1
  68. package/dist/components/badge/index.js +2 -1
  69. package/dist/components/button/button.d.ts +11 -9
  70. package/dist/components/button/button.d.ts.map +1 -1
  71. package/dist/components/button/index.js +3 -2
  72. package/dist/components/button-multi-select/index.js +4 -3
  73. package/dist/components/button-multi-select/index.js.map +1 -1
  74. package/dist/components/button-select/index.js +4 -3
  75. package/dist/components/button-select/index.js.map +1 -1
  76. package/dist/components/calendar/index.js +6 -5
  77. package/dist/components/calendar-heatmap/index.js +2 -2
  78. package/dist/components/camera/index.js +8 -7
  79. package/dist/components/carousel/index.js +2 -2
  80. package/dist/components/clipboard/index.js +3 -2
  81. package/dist/components/clipboard/index.js.map +1 -1
  82. package/dist/components/code-block/index.js +1 -1
  83. package/dist/components/code-block/static.js.map +1 -1
  84. package/dist/components/compare/index.js +2 -2
  85. package/dist/components/data-table/index.js +16 -15
  86. package/dist/components/data-table/index.js.map +1 -1
  87. package/dist/components/date-picker/index.js +11 -10
  88. package/dist/components/date-picker/index.js.map +1 -1
  89. package/dist/components/download-button/index.js +4 -3
  90. package/dist/components/drawer/index.js +6 -5
  91. package/dist/components/file-item/index.js +7 -6
  92. package/dist/components/file-preview/index.js +7 -6
  93. package/dist/components/file-preview/index.js.map +1 -1
  94. package/dist/components/file-trigger/index.js +4 -3
  95. package/dist/components/file-upload/index.js +7 -6
  96. package/dist/components/file-upload/index.js.map +1 -1
  97. package/dist/components/gallery/index.js +2 -2
  98. package/dist/components/image-cropper/index.js +7 -6
  99. package/dist/components/indicator/index.js +1 -1
  100. package/dist/components/kbd/index.js +3 -3
  101. package/dist/components/lightbox/index.js +9 -8
  102. package/dist/components/lightbox/index.js.map +1 -1
  103. package/dist/components/menu/index.js +2 -2
  104. package/dist/components/modal/index.js +6 -5
  105. package/dist/components/multi-select/index.js +3 -3
  106. package/dist/components/notification/index.js +3 -3
  107. package/dist/components/overlays/index.js +8 -7
  108. package/dist/components/overlays/index.js.map +1 -1
  109. package/dist/components/password-input/index.js +1 -1
  110. package/dist/components/phone-input/flag.d.ts +9 -0
  111. package/dist/components/phone-input/flag.d.ts.map +1 -0
  112. package/dist/components/phone-input/index.d.ts +4 -0
  113. package/dist/components/phone-input/index.d.ts.map +1 -0
  114. package/dist/components/phone-input/index.js +503 -0
  115. package/dist/components/phone-input/index.js.map +1 -0
  116. package/dist/components/phone-input/phone-input.d.ts +125 -0
  117. package/dist/components/phone-input/phone-input.d.ts.map +1 -0
  118. package/dist/components/phone-input/phone.d.ts +117 -0
  119. package/dist/components/phone-input/phone.d.ts.map +1 -0
  120. package/dist/components/photo-capture/index.js +11 -10
  121. package/dist/components/photo-capture/index.js.map +1 -1
  122. package/dist/components/pills-input/index.js +3 -3
  123. package/dist/components/schedule/index.js +7 -6
  124. package/dist/components/schedule/index.js.map +1 -1
  125. package/dist/components/segment-group/index.js +3 -3
  126. package/dist/components/spinner/index.js +1 -1
  127. package/dist/components/spinner/spinner.d.ts +1 -1
  128. package/dist/components/spinner/spinner.d.ts.map +1 -1
  129. package/dist/components/spotlight/index.js +8 -7
  130. package/dist/components/spotlight/index.js.map +1 -1
  131. package/dist/components/tabs/index.js +3 -3
  132. package/dist/components/tags-input/index.js +3 -3
  133. package/dist/components/theme-icon/index.js +1 -1
  134. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  135. package/dist/components/time-input/index.js +4 -4
  136. package/dist/components/timeline/index.d.ts +1 -1
  137. package/dist/components/timeline/index.d.ts.map +1 -1
  138. package/dist/components/timeline/index.js +40 -11
  139. package/dist/components/timeline/index.js.map +1 -1
  140. package/dist/components/timeline/timeline.d.ts +8 -3
  141. package/dist/components/timeline/timeline.d.ts.map +1 -1
  142. package/dist/components/tree-multi-select/index.js +3 -3
  143. package/dist/index.js +4 -4
  144. package/dist/lib/button-colors.d.ts +25 -0
  145. package/dist/lib/button-colors.d.ts.map +1 -0
  146. package/dist/lib/dev-warn.d.ts +1 -0
  147. package/dist/lib/dev-warn.d.ts.map +1 -1
  148. package/dist/lib/intl.d.ts +5 -0
  149. package/dist/lib/intl.d.ts.map +1 -1
  150. package/package.json +3 -1
  151. package/src/as-child.contract.test.tsx +2 -0
  152. package/src/colors.css +328 -0
  153. package/src/components/action-icon/action-icon.test.tsx +22 -0
  154. package/src/components/action-icon/action-icon.tsx +24 -28
  155. package/src/components/badge/badge.test.tsx +53 -10
  156. package/src/components/badge/badge.tsx +64 -11
  157. package/src/components/button/button.test.tsx +41 -5
  158. package/src/components/button/button.tsx +28 -33
  159. package/src/components/phone-input/flag.tsx +86 -0
  160. package/src/components/phone-input/index.ts +14 -0
  161. package/src/components/phone-input/phone-input.test.tsx +285 -0
  162. package/src/components/phone-input/phone-input.tsx +527 -0
  163. package/src/components/phone-input/phone.test.ts +187 -0
  164. package/src/components/phone-input/phone.ts +298 -0
  165. package/src/components/spinner/spinner.tsx +3 -3
  166. package/src/components/theme-icon/theme-icon.test.tsx +7 -0
  167. package/src/components/theme-icon/theme-icon.tsx +10 -6
  168. package/src/components/timeline/index.ts +1 -0
  169. package/src/components/timeline/timeline.test.tsx +105 -4
  170. package/src/components/timeline/timeline.tsx +46 -11
  171. package/src/lib/button-colors.ts +55 -0
  172. package/src/lib/dev-warn.ts +1 -1
  173. package/src/lib/intl-direction.test.tsx +23 -0
  174. package/src/lib/intl.tsx +8 -2
  175. package/dist/chunk-BMEJBY6H.js.map +0 -1
  176. package/dist/chunk-D2QIPQ74.js.map +0 -1
  177. package/dist/chunk-F374BNL4.js.map +0 -1
  178. package/dist/chunk-IUK7OJXZ.js.map +0 -1
  179. package/dist/chunk-SCXXJDKQ.js.map +0 -1
  180. package/dist/chunk-ZVECQBGG.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/drawer/drawer.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAGA,IAAM,sBAAA,GAAyB,cAA+B,KAAK,CAAA;AAEnE,IAAM,iBAAiB,GAAA,CAAI;AAAA,EACzB,8HAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,gBAAA,GAAmB,GAAA;AAAA,EACvB,oFAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,SAAA,EAAW;AAAA,QACT,KAAA,EAAO,6BAAA;A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A;AAAA,SACF,EACF;AAAA,OAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,eAAA,EAAiB;AAAA,EACnD,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,QAAA,EAAU,cAAA;AAAA,EACV,UAAA,EAAY,gBAAA;AAAA,EACZ,OAAA,EAAS,aAAA;AAAA,EACT,KAAA,EAAO,WAAA;AAAA,EACP,WAAA,EAAa,iBAAA;AAAA,EACb,YAAA,EAAc,kBAAA;AAAA,EACd,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAC","file":"chunk-L24N5EON.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"]}
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,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AA;AAAA,oBAC9B,0BAAA;AAAA,oBACA,UAAA,EAAY;AAAA,mBACd;AAAA,kBAEC;AAAA;AAAA;AACH;AAAA;AAAA,SACF,EACF;AAAA,OAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,eAAA,EAAiB;AAAA,EACnD,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,QAAA,EAAU,cAAA;AAAA,EACV,UAAA,EAAY,gBAAA;AAAA,EACZ,OAAA,EAAS,aAAA;AAAA,EACT,KAAA,EAAO,WAAA;AAAA,EACP,WAAA,EAAa,iBAAA;AAAA,EACb,YAAA,EAAc,kBAAA;AAAA,EACd,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAC","file":"chunk-MQHD3EJE.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"]}
@@ -1,4 +1,4 @@
1
- import { devWarn } from './chunk-LIZWCWED.js';
1
+ import { isProduction, devWarn } from './chunk-PQZSTI3R.js';
2
2
  import { useLocaleContext, LocaleProvider } from '@ark-ui/react/locale';
3
3
  import { getLocalTimeZone } from '@internationalized/date';
4
4
  import { createContext, useSyncExternalStore, useContext, useCallback } from 'react';
@@ -54,8 +54,9 @@ var useDirectionCheck = () => {
54
54
  const { dir } = useLocaleContext();
55
55
  return useCallback(
56
56
  (node) => {
57
+ if (isProduction() || warnedDirection) return;
57
58
  const parent = node?.parentElement;
58
- if (warnedDirection || !parent) return;
59
+ if (!parent) return;
59
60
  const inherited = getComputedStyle(parent).direction;
60
61
  if (inherited === dir) return;
61
62
  warnedDirection = true;
@@ -73,5 +74,5 @@ var IntlProvider = ({ locale, timeZone, children }) => {
73
74
  };
74
75
 
75
76
  export { DEFAULT_LOCALE, DEFAULT_TIME_ZONE, IntlProvider, useDirectionCheck, useLocale, useTimeZone };
76
- //# sourceMappingURL=chunk-IUK7OJXZ.js.map
77
- //# sourceMappingURL=chunk-IUK7OJXZ.js.map
77
+ //# sourceMappingURL=chunk-OBSZ4NE2.js.map
78
+ //# sourceMappingURL=chunk-OBSZ4NE2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/intl.tsx"],"names":[],"mappings":";;;;;;AAiCA,IAAM,IAAA,GAAO,MAAA;AAQN,IAAM,cAAA,GAAiB;AAQvB,IAAM,iBAAA,GAAoB;AAcjC,SAAS,oBAAoB,aAAA,EAA2B;AACtD,EAAA,MAAA,CAAO,gBAAA,CAAiB,kBAAkB,aAAa,CAAA;AACvD,EAAA,OAAO,MAAM,MAAA,CAAO,mBAAA,CAAoB,gBAAA,EAAkB,aAAa,CAAA;AACzE;AAEA,SAAS,mBAAA,GAAsB;AAC7B,EAAA,OAAO,UAAU,QAAA,IAAY,cAAA;AAC/B;AAEA,SAAS,yBAAA,GAA4B;AACnC,EAAA,OAAO,cAAA;AACT;AAKA,IAAM,0BAA0B,MAAM;AAAC,CAAA;AAEvC,SAAS,mBAAA,GAAsB;AAC7B,EAAA,OAAO,uBAAA;AACT;AAEA,SAAS,mBAAA,GAAsB;AAI7B,EAAA,OAAO,kBAAiB,IAAK,iBAAA;AAC/B;AAEA,SAAS,yBAAA,GAA4B;AACnC,EAAA,OAAO,iBAAA;AACT;AAEA,IAAM,eAAA,GAAkB,cAAkC,MAAS,CAAA;AAU5D,IAAM,SAAA,GAAY,CAAC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AA,EAAQ,QAAA,EAAU,UAAS,KAAyB;AACjF,EAAA,MAAM,cAAA,GAAiB,UAAU,MAAM,CAAA;AACvC,EAAA,MAAM,gBAAA,GAAmB,YAAY,QAAQ,CAAA;AAE7C,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,MAAA,EAAQ,cAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,eAAA,CAAgB,QAAA,EAAhB,EAAyB,KAAA,EAAO,gBAAA,EAAmB,QAAA,EAAS,CAAA,EAC/D,CAAA;AAEJ","file":"chunk-OBSZ4NE2.js","sourcesContent":["\"use client\"\n\nimport { LocaleProvider, useLocaleContext } from \"@ark-ui/react/locale\"\nimport { getLocalTimeZone } from \"@internationalized/date\"\nimport { createContext, type ReactNode, useCallback, useContext, useSyncExternalStore } from \"react\"\nimport { devWarn, isProduction } from \"./dev-warn\"\n\n/**\n * The one seam where \"which locale\" and \"which time zone\" are decided.\n *\n * Every `Intl` constructor takes a locale as its first argument and a `timeZone` as an option,\n * and both have a runtime default — `Intl.DateTimeFormat()` resolves to Node's `en-US` on a\n * server and to the visitor's locale in a browser; `getLocalTimeZone()` resolves to the server's\n * zone (UTC on most hosts) and to the visitor's. Reading either implicitly therefore makes the\n * rendered output a property of *where the code ran*, which is a hydration mismatch waiting for\n * the first visitor configured differently from the build server. So nothing in this kit reads\n * them implicitly: components resolve both through the hooks below, and the value they get is\n * either something the app stated or a documented constant.\n *\n * Locale and time zone stay **fully independent** — separate prop, separate hook, separate\n * per-instance override, no coupling. They share only this module and `IntlProvider`'s single\n * mount point, because the resolution mechanism is the whole of the fix and writing it twice is\n * how the two would drift apart.\n *\n * Locale deliberately needs no context of its own: `IntlProvider` renders Ark's own\n * `LocaleProvider`, so Ark's state machines (`Calendar`, `DatePicker`, `NumberInput`,\n * `FileUpload`) and this kit's own formatting can only ever read one value — and `dir`/RTL comes\n * along for free for the components already reading `useLocaleContext().dir` (`menu.tsx`,\n * `tooltip.tsx`, `hover-card.tsx`). An app that mounts Ark's `LocaleProvider` directly still\n * works. Only the time zone needs a new context, since Ark has no equivalent.\n */\n\n/** Follow the host runtime. Accepted anywhere a locale or zone is: provider, or a single prop. */\nconst AUTO = \"auto\"\n\n/**\n * The locale used when nothing configures one, and what `\"auto\"` reports during SSR and the\n * hydration render. Pinned to the same tag as Ark's own `useLocaleContext()` default so the two\n * halves of a `Calendar` — Ark's machine and this kit's formatting around it — cannot disagree,\n * the same \"one constant, two readers\" reasoning `lib/theme.ts` uses for the theme storage key.\n */\nexport const DEFAULT_LOCALE = \"en-US\"\n\n/**\n * What `timeZone=\"auto\"` reports during SSR and the hydration render, before the host zone is\n * readable. Note this is *not* the default for the `timeZone` prop itself — that is `\"auto\"`\n * (see `useTimeZone`), because a wrong zone is wrong data rather than merely an unfamiliar\n * format. UTC is the one zone every runtime agrees on.\n */\nexport const DEFAULT_TIME_ZONE = \"UTC\"\n\n// `\"auto\"` is resolved through `useSyncExternalStore` with a fixed `getServerSnapshot`, the same\n// shape (and for the same reason) as `use-media-query.ts`, `use-local-storage.ts` and\n// `use-now.ts`: the server and the first client render are handed a value that cannot differ, so\n// hydration always matches, and React swaps in the real one immediately afterwards. A plain\n// `useEffect` would work too, but this way the fallback is declared once next to the real read\n// instead of living in a `useState` initializer somewhere else.\n//\n// Caveat worth knowing before reaching for `\"auto\"` under SSR, carried over from `use-theme.ts`:\n// React does not specify that the post-hydration correction lands before the browser paints, and\n// empirically it does not reliably, so the default value can be visible for a frame. That is the\n// accepted cost of opting in, and precisely why `locale` does not default to `\"auto\"`.\n\nfunction subscribeToLanguage(onStoreChange: () => void) {\n window.addEventListener(\"languagechange\", onStoreChange)\n return () => window.removeEventListener(\"languagechange\", onStoreChange)\n}\n\nfunction getLanguageSnapshot() {\n return navigator.language || DEFAULT_LOCALE\n}\n\nfunction getLanguageServerSnapshot() {\n return DEFAULT_LOCALE\n}\n\n// The host zone has no change event to listen for — a machine moving zone mid-session re-resolves\n// on the next render at worst. `subscribe` still has to return an unsubscribe function, and it\n// has to be a stable reference or `useSyncExternalStore` resubscribes on every render.\nconst unsubscribeFromTimeZone = () => {}\n\nfunction subscribeToTimeZone() {\n return unsubscribeFromTimeZone\n}\n\nfunction getTimeZoneSnapshot() {\n // `getLocalTimeZone()` is `Intl.DateTimeFormat().resolvedOptions().timeZone` behind a cache.\n // This is the only call to it left in the kit, which is the point: one reader of the ambient\n // zone, wrapped in the hydration-safe store, instead of ~13 scattered prop defaults.\n return getLocalTimeZone() || DEFAULT_TIME_ZONE\n}\n\nfunction getTimeZoneServerSnapshot() {\n return DEFAULT_TIME_ZONE\n}\n\nconst TimeZoneContext = createContext<string | undefined>(undefined)\n\n/**\n * The active locale as a concrete BCP-47 tag, never `\"auto\"` and never `undefined`.\n *\n * `override` is the component's own `locale` prop, so precedence reads\n * **prop → provider → `DEFAULT_LOCALE`** — the same shape as `useLinkComponent`.\n *\n * const locale = useLocale(props.locale)\n */\nexport const useLocale = (override?: \"auto\" | (string & {})): string => {\n const { locale: provided } = useLocaleContext()\n const requested = override ?? provided\n const hostLocale = useSyncExternalStore(\n subscribeToLanguage,\n getLanguageSnapshot,\n getLanguageServerSnapshot,\n )\n return requested === AUTO ? hostLocale : requested\n}\n\n/**\n * The active time zone as a concrete IANA name, never `\"auto\"` and never `undefined`.\n *\n * `override` is the component's own `timeZone` prop, so precedence reads\n * **prop → provider → `\"auto\"`**. The default is `\"auto\"` rather than a fixed zone because a\n * wrong zone shows wrong times, not merely an unfamiliar format — and `\"auto\"` costs a\n * client-only app nothing, since `getServerSnapshot` never runs there and the first render is\n * already the true zone.\n *\n * const timeZone = useTimeZone(props.timeZone)\n */\nexport const useTimeZone = (override?: \"auto\" | (string & {})): string => {\n const provided = useContext(TimeZoneContext)\n const requested = override ?? provided ?? AUTO\n const hostTimeZone = useSyncExternalStore(\n subscribeToTimeZone,\n getTimeZoneSnapshot,\n getTimeZoneServerSnapshot,\n )\n return requested === AUTO ? hostTimeZone : requested\n}\n\n// One warning per page, however many components run the check: the fix is a single provider at\n// the app root, so repeating the message per Tabs would only bury it.\nlet warnedDirection = false\n\n/**\n * Dev-only guard for the one RTL setup that silently breaks: direction stated on the DOM\n * (`<html dir=\"rtl\">`, or an ancestor) while no locale says so. Ark derives `dir` from the\n * locale alone and stamps it on every part, so its parts render `ltr` inside an `rtl` page —\n * and its arrow-key handling runs `ltr` too, which is why the kit can't simply let the parts\n * inherit from the DOM: the direction has to be known in JS, i.e. come from `IntlProvider`.\n *\n * Returns a callback ref for an Ark root. It reads the **parent**'s direction, since the root\n * itself carries Ark's stamped `dir`. Runs on attach, so SSR and hydration never see it.\n *\n * The whole check is dev-only, not just the warning: `getComputedStyle` forces a style recalc\n * while React is committing, and in a correctly set-up app the directions match, so nothing would\n * ever stop it repeating on every Ark root mounted (#462). In a production build the gate reduces\n * to `if (true) return` and the minifier drops the read.\n */\nexport const useDirectionCheck = () => {\n const { dir } = useLocaleContext()\n return useCallback(\n (node: HTMLElement | null) => {\n if (isProduction() || warnedDirection) return\n const parent = node?.parentElement\n if (!parent) return\n // Computed rather than `closest(\"[dir]\")`, so a CSS-only `direction: rtl` counts too.\n const inherited = getComputedStyle(parent).direction\n if (inherited === dir) return\n warnedDirection = true\n devWarn(\n `[@42/ui-react] This page is dir=\"${inherited}\", but the locale resolves to dir=\"${dir}\", so Ark-backed parts (Tabs, SegmentGroup, Menu…) render and navigate ${dir}. Direction comes from the locale: wrap the app in <IntlProvider locale=\"…\"> with a matching locale. See \"Text direction\" in the Internationalization docs.`,\n )\n },\n [dir],\n )\n}\n\nexport type IntlProviderProps = {\n /** A BCP-47 tag (`\"fr-FR\"`), or `\"auto\"` to follow the browser. Inherited from an outer\n * `IntlProvider` when omitted, and `\"en-US\"` when there is none. */\n locale?: \"auto\" | (string & {})\n /** An IANA zone (`\"Europe/Paris\"`), or `\"auto\"` to follow the host. Inherited from an outer\n * `IntlProvider` when omitted, and `\"auto\"` when there is none. @default \"auto\" */\n timeZone?: \"auto\" | (string & {})\n children?: ReactNode\n}\n\n/**\n * Wrap the app once to state how it formats dates, times and numbers:\n * `<IntlProvider locale=\"fr-FR\" timeZone=\"Europe/Paris\"><App /></IntlProvider>`.\n *\n * Both props are optional and independent — setting only `timeZone` leaves the locale alone, and\n * a nested provider inherits whichever value it doesn't set, so a section can override one\n * without restating the other.\n *\n * It resolves both values and publishes the results, so `\"auto\"` is subscribed to once here\n * rather than once per component, and everything downstream — Ark's machines included — reads a\n * concrete tag and zone.\n *\n * Text direction follows the locale: `locale=\"ar\"` makes every Ark part `rtl`. `<html dir=\"rtl\">`\n * alone never reaches Ark, which is what `useDirectionCheck` warns about in development.\n *\n * This provider carries the inputs to `Intl`, and nothing else. Translated microcopy stays on\n * each component's own `translations` prop by design (`code-style.md`); there is deliberately no\n * message context here.\n */\nexport const IntlProvider = ({ locale, timeZone, children }: IntlProviderProps) => {\n const resolvedLocale = useLocale(locale)\n const resolvedTimeZone = useTimeZone(timeZone)\n\n return (\n <LocaleProvider locale={resolvedLocale}>\n <TimeZoneContext.Provider value={resolvedTimeZone}>{children}</TimeZoneContext.Provider>\n </LocaleProvider>\n )\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { useApplePlatform, hotkeyCaps } from './chunk-QEMXXQQO.js';
1
+ import { useApplePlatform, hotkeyCaps } from './chunk-JKFPRQB2.js';
2
2
  import { composeChildren } from './chunk-R5LYFTHA.js';
3
3
  import { props } from './chunk-WYCMIIRR.js';
4
4
  import { focusStyles } from './chunk-C6NVU4F7.js';
@@ -145,5 +145,5 @@ var Kbd = (allProps) => {
145
145
  };
146
146
 
147
147
  export { Kbd };
148
- //# sourceMappingURL=chunk-DJ72KP32.js.map
149
- //# sourceMappingURL=chunk-DJ72KP32.js.map
148
+ //# sourceMappingURL=chunk-OXR7BXZA.js.map
149
+ //# sourceMappingURL=chunk-OXR7BXZA.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/kbd/kbd.tsx"],"names":[],"mappings":";;;;;;;;;AAmDA,IAAM,WAAA,GAAc,GAA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EAAU,CAAA;AAClE,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA;AAAA,IACA,MAAA,EAAQ,OAAA;AAAA,IACR,YAAA,EAAc,aAAA;AAAA,IACd,GAAG;AAAA,GACL,GAAI,QAAA;AACJ,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA,CAAI,GAAA;AAAA,IAAJ;AAAA,MACC,YAAA,EAAY,KAAA;AAAA,MACX,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,GAAG,WAAA,CAAY,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS;AAAA;AAAA,GACzD;AAEJ","file":"chunk-DJ72KP32.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ReactElement } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { hotkeyCaps, type KbdTranslations, useApplePlatform } from \"../../lib/use-hotkey\"\n\n/**\n * Kbd — a keyboard-key / shortcut indicator (`<kbd>`).\n *\n * A client component only for `hotkey`, whose keys depend on the platform\n * (`[⌘] [K]` vs `[Ctrl] [K]`). It borrows Button's (variant × color) system so\n * a shortcut hint speaks the same accent language as the action it labels — but\n * unlike Button it is non-interactive: no hover treatment, no click handling,\n * just a key cap.\n *\n * The shape axis is the exact set Button exposes (filled / light / outline /\n * subtle / default), wired through the same `--c-*` slot vars — `color` routes\n * via a `data-color` attribute resolved in `colors.css`, so the cva matrix\n * enumerates variants only, never (variant × color) pairs. The default\n * treatment is the `default` variant: a neutral, bordered key-cap surface that\n * reads as a physical key regardless of `color` (pairing `default` with a color\n * is a no-op, mirroring Button/Badge).\n *\n * Sizing keeps single-character keys square via a per-size `min-w` equal to the\n * height, while wider labels (`Enter`, `Esc`, `⌘N`) grow horizontally. Padding\n * is symmetric, so a key reads the same in RTL.\n *\n * `asChild` (from `HTMLArkProps`) renders the single child as the root with\n * Kbd's styling merged in — e.g. `<Kbd asChild><a href=\"…\">⌘K</a></Kbd>`. The\n * kit's focus ring (`focusStyles`) comes along with it, so a Kbd composed onto\n * a real control is keyboard-visible without the caller restyling anything; on\n * a plain `<kbd>` those classes never match.\n *\n * `hotkey` draws a key combination the way the HTML spec marks one up: an\n * outer `<kbd>` for the whole combination holding one inner `<kbd>` per key,\n * with no `+` between them. The outer one is an unstyled inline-flex row;\n * each key is a full cap (`variant` / `size` / `color` apply to every cap),\n * so `\"mod+k\"` is two square caps. The rest of the props (`className`,\n * `testId`, `asChild`, `aria-*`, …) land on the outer `<kbd>`, which is the\n * element a layout positions; `color` is set there too and every cap reads\n * its slot vars from it. The words the caps show and speak (\"Ctrl\", \"Esc\",\n * \"Command\", \"Up Arrow\") are English unless `translations` replaces them, per\n * key (`KbdTranslations`); `formatHotkey` takes the same object.\n */\nconst kbdVariants = cva(\n [\n \"inline-flex items-center justify-center gap-1\",\n \"whitespace-nowrap select-none\",\n // Regular weight, not medium: the mono face (Kode Mono) has no ⌘ ⇧ ⌥ ↵\n // glyphs, so they fall back to a system font — and a 500 weight makes that\n // fallback resolve to its *bold* face (Menlo Bold), a heavy blot next to\n // the regular letters around it.\n \"font-mono font-normal leading-none\",\n \"rounded-md border border-transparent\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n // A 1.5px stroke at every size: the icon is sized by CSS, so a stroke in\n // viewBox units would thin out at `size-3`. `non-scaling-stroke` keeps it in\n // screen pixels (lucide's `absoluteStrokeWidth` ignores CSS sizing).\n \"[&_svg]:stroke-[1.5] [&_svg_*]:[vector-effect:non-scaling-stroke]\",\n // A lone icon is narrower than the cap is tall, but the side padding\n // would push it past `min-w`: drop the padding so the cap stays square.\n \"has-[>svg:only-child]:px-0\",\n // Inert on the default non-focusable <kbd>; applies once `asChild`\n // renders Kbd onto a real <button>/<a>. See `focusStyles`.\n focusStyles(),\n ],\n {\n variants: {\n variant: {\n filled: \"bg-(--c-solid) text-(--c-on-solid)\",\n light: \"bg-(--c-soft) text-(--c-text)\",\n // Button's outline edge: the colour at 35%.\n outline: \"bg-transparent text-(--c-text) border-(--c-solid)/35\",\n subtle: \"bg-transparent text-(--c-text)\",\n // The key cap sits on the kit's translucent surface recipe — a 3%/4%\n // overlay plus the hairline `border-brand-900/20 dark:border-white/15`,\n // the same pair `Input`'s default shell, `Card`, `Tabs` and\n // `ChoiceCardGroup` use. An opaque gray step can only ever be right on\n // the one background it was picked against, and a `Kbd` is most often\n // inlined into a Button, a Menu row or a tinted panel. Light mode\n // darkens (`bg-black/3`) because `bg-white/4` on a near-white page is\n // invisible; dark mode lightens. A 1px inset shade along the bottom\n // edge is the key-cap depth cue — the lip of a physical key — without\n // adding height. The label is the kit's secondary text, not full\n // contrast: a shortcut hint annotates the action, it is not the action.\n default: [\n \"bg-black/3 text-brand-900/70 border-brand-900/20\",\n \"shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.08)]\",\n \"dark:bg-white/4 dark:text-white/80 dark:border-white/15\",\n \"dark:shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.35)]\",\n ],\n },\n // Type is one Tailwind step per size (12 / 14 / 16px), the scale of\n // the text a key sits beside — a 10px label left ⌘ and ↵ unreadable.\n //\n // A single character must fit `min-w` (= height) to stay square. Kode\n // Mono advances 0.6em per glyph, so glyph + 2 × padding + 2 × 1px border:\n // sm: 7.2 + 2 × 5 + 2 = 19.2 ≤ 20 (px-1.5 gave 21.2: one px too wide)\n // md: 8.4 + 2 × 6 + 2 = 22.4 ≤ 24\n // lg: 9.6 + 2 × 8 + 2 = 27.6 ≤ 28\n // Re-check these sums after a font, type step or padding change.\n size: {\n sm: \"h-5 min-w-5 px-1.25 text-xs [&_svg]:size-3\",\n md: \"h-6 min-w-6 px-1.5 text-sm [&_svg]:size-3.5\",\n lg: \"h-7 min-w-7 px-2 text-base [&_svg]:size-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n)\n\nexport type KbdVariant = NonNullable<VariantProps<typeof kbdVariants>[\"variant\"]>\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>[\"size\"]>\n\n/** The outer `<kbd>` of a `hotkey` combination: a row of caps, unstyled itself.\n * `align-middle` sits it on the text it annotates the way a lone cap does. */\nconst kbdGroup = \"inline-flex items-center gap-0.5 align-middle\"\n\n/** With `hotkey`: the key words, merged per key onto `KBD_DEFAULT_TRANSLATIONS`. */\ntype KbdHotkeyTranslations = {\n /** The words the caps read as and are spoken by, merged per key onto the English\n * `KBD_DEFAULT_TRANSLATIONS`: `{ ctrl: \"Strg\", enter: \"Eingabe\" }`. Pass the same\n * object to `formatHotkey` / `hotkeyKeys` so plain text reads the same. */\n translations?: Partial<KbdTranslations>\n}\n\ntype KbdHotkeyProps =\n | { hotkey?: undefined; translations?: undefined }\n | (KbdHotkeyTranslations & {\n /** A `useHotkey` string to draw, one cap per key, the way the visitor's\n * platform writes it: `\"mod+k\"` is `[⌘] [K]` on Apple platforms and\n * `[Ctrl] [K]` elsewhere (see `hotkeyKeys`). A key with an icon (Shift,\n * Enter, Tab, the arrows, and ⌘ ⌥ ⌃ ⌫ on Apple) is drawn as one, with a\n * spoken name; Ctrl, Alt, Esc, Space (and Backspace off Apple) stay\n * words. Server-rendered as the non-Apple caps, then corrected on\n * hydration. The caps are the content, so it takes no children. */\n hotkey: string\n asChild?: false\n children?: never\n })\n | (KbdHotkeyTranslations & {\n hotkey: string\n /** With `hotkey`: the single child becomes the outer `<kbd>` of the\n * combination, the caps rendered inside it. */\n asChild: true\n children: ReactElement\n })\n\nexport type KbdProps = HTMLArkProps<\"kbd\"> &\n VariantProps<typeof kbdVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n } & KbdHotkeyProps\n\ntype KbdComboProps = KbdProps & { hotkey: string }\n\n/** `<Kbd hotkey>`: the combination's outer `<kbd>`, one cap per key inside. */\nconst KbdCombo = ({\n className,\n variant,\n size,\n color,\n testId,\n hotkey,\n translations,\n asChild,\n children,\n ...rest\n}: KbdComboProps) => {\n const apple = useApplePlatform()\n const caps = hotkeyCaps(hotkey, apple, translations).map(({ id, label, icon: Icon, name }) => (\n // A symbol is drawn (an icon, or the glyph where there is none) and its\n // name spoken: an svg says nothing, and `⌘` alone reads inconsistently.\n // `relative` holds the absolutely positioned `sr-only` inside the cap.\n // An icon cap drops its side padding to stay square, as a lone icon does\n // (the `sr-only` name beside the svg keeps `:only-child` from matching).\n <kbd\n key={id}\n className={cn(kbdVariants({ variant, size }), name && \"relative\", Icon && \"px-0\")}\n >\n {name ? (\n <>\n {Icon ? <Icon aria-hidden /> : <span aria-hidden>{label}</span>}\n <span className=\"sr-only\">{name}</span>\n </>\n ) : (\n label\n )}\n </kbd>\n ))\n return (\n <ark.kbd\n // A combination reads left to right in either direction, like the\n // single string it replaces.\n dir=\"ltr\"\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n asChild={asChild}\n className={cn(kbdGroup, className)}\n >\n {composeChildren(asChild, children, () => caps)}\n </ark.kbd>\n )\n}\n\nexport const Kbd = (allProps: KbdProps) => {\n if (allProps.hotkey !== undefined) return <KbdCombo {...allProps} />\n const {\n className,\n variant,\n size,\n color,\n testId,\n hotkey: _hotkey,\n translations: _translations,\n ...rest\n } = allProps\n return (\n <ark.kbd\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(kbdVariants({ variant, size }), className)}\n />\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/kbd/kbd.tsx"],"names":[],"mappings":";;;;;;;;;AAmDA,IAAM,WAAA,GAAc,GAAA;AAAA,EAClB;AAAA,I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A,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA;AAAA,IACA,MAAA,EAAQ,OAAA;AAAA,IACR,YAAA,EAAc,aAAA;AAAA,IACd,GAAG;AAAA,GACL,GAAI,QAAA;AACJ,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA,CAAI,GAAA;AAAA,IAAJ;AAAA,MACC,YAAA,EAAY,KAAA;AAAA,MACX,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,GAAG,WAAA,CAAY,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS;AAAA;AAAA,GACzD;AAEJ","file":"chunk-OXR7BXZA.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ReactElement } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { hotkeyCaps, type KbdTranslations, useApplePlatform } from \"../../lib/use-hotkey\"\n\n/**\n * Kbd — a keyboard-key / shortcut indicator (`<kbd>`).\n *\n * A client component only for `hotkey`, whose keys depend on the platform\n * (`[⌘] [K]` vs `[Ctrl] [K]`). It borrows Button's (variant × color) system so\n * a shortcut hint speaks the same accent language as the action it labels — but\n * unlike Button it is non-interactive: no hover treatment, no click handling,\n * just a key cap.\n *\n * The shape axis is the exact set Button exposes (filled / light / outline /\n * subtle / default), wired through the same `--c-*` slot vars — `color` routes\n * via a `data-color` attribute resolved in `colors.css`, so the cva matrix\n * enumerates variants only, never (variant × color) pairs. The default\n * treatment is the `default` variant: a neutral, bordered key-cap surface that\n * reads as a physical key regardless of `color` (pairing `default` with a color\n * is a no-op, mirroring Button/Badge).\n *\n * Sizing keeps single-character keys square via a per-size `min-w` equal to the\n * height, while wider labels (`Enter`, `Esc`, `⌘N`) grow horizontally. Padding\n * is symmetric, so a key reads the same in RTL.\n *\n * `asChild` (from `HTMLArkProps`) renders the single child as the root with\n * Kbd's styling merged in — e.g. `<Kbd asChild><a href=\"…\">⌘K</a></Kbd>`. The\n * kit's focus ring (`focusStyles`) comes along with it, so a Kbd composed onto\n * a real control is keyboard-visible without the caller restyling anything; on\n * a plain `<kbd>` those classes never match.\n *\n * `hotkey` draws a key combination the way the HTML spec marks one up: an\n * outer `<kbd>` for the whole combination holding one inner `<kbd>` per key,\n * with no `+` between them. The outer one is an unstyled inline-flex row;\n * each key is a full cap (`variant` / `size` / `color` apply to every cap),\n * so `\"mod+k\"` is two square caps. The rest of the props (`className`,\n * `testId`, `asChild`, `aria-*`, …) land on the outer `<kbd>`, which is the\n * element a layout positions; `color` is set there too and every cap reads\n * its slot vars from it. The words the caps show and speak (\"Ctrl\", \"Esc\",\n * \"Command\", \"Up Arrow\") are English unless `translations` replaces them, per\n * key (`KbdTranslations`); `formatHotkey` takes the same object.\n */\nconst kbdVariants = cva(\n [\n \"inline-flex items-center justify-center gap-1\",\n \"whitespace-nowrap select-none\",\n // Regular weight, not medium: the mono face (Kode Mono) has no ⌘ ⇧ ⌥ ↵\n // glyphs, so they fall back to a system font — and a 500 weight makes that\n // fallback resolve to its *bold* face (Menlo Bold), a heavy blot next to\n // the regular letters around it.\n \"font-mono font-normal leading-none\",\n \"rounded-md border border-transparent\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n // A 1.5px stroke at every size: the icon is sized by CSS, so a stroke in\n // viewBox units would thin out at `size-3`. `non-scaling-stroke` keeps it in\n // screen pixels (lucide's `absoluteStrokeWidth` ignores CSS sizing).\n \"[&_svg]:stroke-[1.5] [&_svg_*]:[vector-effect:non-scaling-stroke]\",\n // A lone icon is narrower than the cap is tall, but the side padding\n // would push it past `min-w`: drop the padding so the cap stays square.\n \"has-[>svg:only-child]:px-0\",\n // Inert on the default non-focusable <kbd>; applies once `asChild`\n // renders Kbd onto a real <button>/<a>. See `focusStyles`.\n focusStyles(),\n ],\n {\n variants: {\n variant: {\n filled: \"bg-(--c-solid) text-(--c-on-solid)\",\n light: \"bg-(--c-soft) text-(--c-text)\",\n // Button's outline edge: the colour at 35%.\n outline: \"bg-transparent text-(--c-text) border-(--c-solid)/35\",\n subtle: \"bg-transparent text-(--c-text)\",\n // The key cap sits on the kit's translucent surface recipe — a 3%/4%\n // overlay plus the hairline `border-brand-900/20 dark:border-white/15`,\n // the same pair `Input`'s default shell, `Card`, `Tabs` and\n // `ChoiceCardGroup` use. An opaque gray step can only ever be right on\n // the one background it was picked against, and a `Kbd` is most often\n // inlined into a Button, a Menu row or a tinted panel. Light mode\n // darkens (`bg-black/3`) because `bg-white/4` on a near-white page is\n // invisible; dark mode lightens. A 1px inset shade along the bottom\n // edge is the key-cap depth cue — the lip of a physical key — without\n // adding height. The label is the kit's secondary text, not full\n // contrast: a shortcut hint annotates the action, it is not the action.\n default: [\n \"bg-black/3 text-brand-900/70 border-brand-900/20\",\n \"shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.08)]\",\n \"dark:bg-white/4 dark:text-white/80 dark:border-white/15\",\n \"dark:shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.35)]\",\n ],\n },\n // Type is one Tailwind step per size (12 / 14 / 16px), the scale of\n // the text a key sits beside — a 10px label left ⌘ and ↵ unreadable.\n //\n // A single character must fit `min-w` (= height) to stay square. Kode\n // Mono advances 0.6em per glyph, so glyph + 2 × padding + 2 × 1px border:\n // sm: 7.2 + 2 × 5 + 2 = 19.2 ≤ 20 (px-1.5 gave 21.2: one px too wide)\n // md: 8.4 + 2 × 6 + 2 = 22.4 ≤ 24\n // lg: 9.6 + 2 × 8 + 2 = 27.6 ≤ 28\n // Re-check these sums after a font, type step or padding change.\n size: {\n sm: \"h-5 min-w-5 px-1.25 text-xs [&_svg]:size-3\",\n md: \"h-6 min-w-6 px-1.5 text-sm [&_svg]:size-3.5\",\n lg: \"h-7 min-w-7 px-2 text-base [&_svg]:size-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n)\n\nexport type KbdVariant = NonNullable<VariantProps<typeof kbdVariants>[\"variant\"]>\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>[\"size\"]>\n\n/** The outer `<kbd>` of a `hotkey` combination: a row of caps, unstyled itself.\n * `align-middle` sits it on the text it annotates the way a lone cap does. */\nconst kbdGroup = \"inline-flex items-center gap-0.5 align-middle\"\n\n/** With `hotkey`: the key words, merged per key onto `KBD_DEFAULT_TRANSLATIONS`. */\ntype KbdHotkeyTranslations = {\n /** The words the caps read as and are spoken by, merged per key onto the English\n * `KBD_DEFAULT_TRANSLATIONS`: `{ ctrl: \"Strg\", enter: \"Eingabe\" }`. Pass the same\n * object to `formatHotkey` / `hotkeyKeys` so plain text reads the same. */\n translations?: Partial<KbdTranslations>\n}\n\ntype KbdHotkeyProps =\n | { hotkey?: undefined; translations?: undefined }\n | (KbdHotkeyTranslations & {\n /** A `useHotkey` string to draw, one cap per key, the way the visitor's\n * platform writes it: `\"mod+k\"` is `[⌘] [K]` on Apple platforms and\n * `[Ctrl] [K]` elsewhere (see `hotkeyKeys`). A key with an icon (Shift,\n * Enter, Tab, the arrows, and ⌘ ⌥ ⌃ ⌫ on Apple) is drawn as one, with a\n * spoken name; Ctrl, Alt, Esc, Space (and Backspace off Apple) stay\n * words. Server-rendered as the non-Apple caps, then corrected on\n * hydration. The caps are the content, so it takes no children. */\n hotkey: string\n asChild?: false\n children?: never\n })\n | (KbdHotkeyTranslations & {\n hotkey: string\n /** With `hotkey`: the single child becomes the outer `<kbd>` of the\n * combination, the caps rendered inside it. */\n asChild: true\n children: ReactElement\n })\n\nexport type KbdProps = HTMLArkProps<\"kbd\"> &\n VariantProps<typeof kbdVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n } & KbdHotkeyProps\n\ntype KbdComboProps = KbdProps & { hotkey: string }\n\n/** `<Kbd hotkey>`: the combination's outer `<kbd>`, one cap per key inside. */\nconst KbdCombo = ({\n className,\n variant,\n size,\n color,\n testId,\n hotkey,\n translations,\n asChild,\n children,\n ...rest\n}: KbdComboProps) => {\n const apple = useApplePlatform()\n const caps = hotkeyCaps(hotkey, apple, translations).map(({ id, label, icon: Icon, name }) => (\n // A symbol is drawn (an icon, or the glyph where there is none) and its\n // name spoken: an svg says nothing, and `⌘` alone reads inconsistently.\n // `relative` holds the absolutely positioned `sr-only` inside the cap.\n // An icon cap drops its side padding to stay square, as a lone icon does\n // (the `sr-only` name beside the svg keeps `:only-child` from matching).\n <kbd\n key={id}\n className={cn(kbdVariants({ variant, size }), name && \"relative\", Icon && \"px-0\")}\n >\n {name ? (\n <>\n {Icon ? <Icon aria-hidden /> : <span aria-hidden>{label}</span>}\n <span className=\"sr-only\">{name}</span>\n </>\n ) : (\n label\n )}\n </kbd>\n ))\n return (\n <ark.kbd\n // A combination reads left to right in either direction, like the\n // single string it replaces.\n dir=\"ltr\"\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n asChild={asChild}\n className={cn(kbdGroup, className)}\n >\n {composeChildren(asChild, children, () => caps)}\n </ark.kbd>\n )\n}\n\nexport const Kbd = (allProps: KbdProps) => {\n if (allProps.hotkey !== undefined) return <KbdCombo {...allProps} />\n const {\n className,\n variant,\n size,\n color,\n testId,\n hotkey: _hotkey,\n translations: _translations,\n ...rest\n } = allProps\n return (\n <ark.kbd\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(kbdVariants({ variant, size }), className)}\n />\n )\n}\n"]}
@@ -22,6 +22,6 @@ function warnRenamedProp(component, from, to) {
22
22
  );
23
23
  }
24
24
 
25
- export { devWarn, devWarnOnce, warnRenamedProp };
26
- //# sourceMappingURL=chunk-LIZWCWED.js.map
27
- //# sourceMappingURL=chunk-LIZWCWED.js.map
25
+ export { devWarn, devWarnOnce, isProduction, warnRenamedProp };
26
+ //# sourceMappingURL=chunk-PQZSTI3R.js.map
27
+ //# sourceMappingURL=chunk-PQZSTI3R.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/dev-warn.ts"],"names":[],"mappings":";AAgCA,SAAS,YAAA,GAAwB;AAC/B,EAAA,IAAI;AACF,IAAA,OAAO,OAAA,CAAA,GAAA,CAAA,QAAA,KAAyB,YAAA;AAAA,EAClC,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AAEO,SAAS,QAAQ,OAAA,EAAuB;AAC7C,EAAA,IAAI,cAAa,EAAG;AACpB,EAAA,OAAA,CAAQ,KAAK,OAAO,CAAA;AACtB;AAEA,IAAM,MAAA,uBAAa,GAAA,EAAY;AAOxB,SAAS,YAAY,OAAA,EAAuB;AACjD,EAAA,IAAI,YAAA,EAAa,IAAK,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA,EAAG;AAC3C,EAAA,MAAA,CAAO,IAAI,OAAO,CAAA;AAClB,EAAA,OAAA,CAAQ,OAAO,CAAA;AACjB;AAMO,SAAS,eAAA,CAAgB,SAAA,EAAmB,IAAA,EAAc,EAAA,EAAkB;AACjF,EAAA,WAAA;AAAA,IACE,CAAA,EAAG,SAAS,CAAA,IAAA,EAAO,IAAI,2BAA2B,EAAE,CAAA,yCAAA;AAAA,GACtD;AACF","file":"chunk-LIZWCWED.js","sourcesContent":["/**\n * Dev-mode-only warning helpers — the kit's pattern for runtime\n * misconfiguration checks (Schedule's `editable` prop was the first).\n *\n * The production gate lives in `isProduction()` and has three jobs:\n *\n * 1. Contain the LITERAL `process.env.NODE_ENV`. Bundlers (webpack/Next's\n * DefinePlugin, Vite, esbuild, Rollup's replace plugin) substitute only that\n * exact member expression. `process?.env?.NODE_ENV`, `globalThis.process`\n * or a destructured `env` are never replaced, so the warning would survive\n * into every consumer's production build — which is what the old gate did.\n * 2. Not throw without a bundler and without a `process` global (plain ESM in a\n * browser, Deno). Reading the literal inside `try` turns that\n * `ReferenceError` (or a `TypeError` for a `process` with no `env`) into\n * \"not production\", so the warning is logged, which is the right default\n * for code nobody built for production.\n * 3. Still warn in development and test.\n *\n * Why not `typeof process !== \"undefined\" && process.env.NODE_ENV === ...`:\n * the bundler replaces the second half with `\"production\"`, but on the client\n * there is still no `process` global, so the `typeof` half is false, the early\n * return never happens, and the warning logs in production anyway. Inside the\n * `try`, a production build reduces to `\"production\" === \"production\"`, and\n * the minifier drops the `console.warn` behind it.\n *\n * `process` is declared locally rather than pulling in `@types/node`, which\n * this otherwise browser-only package has no other reason to depend on. The\n * kit's own `dist` must keep the literal for consumers to replace; the shared\n * tsup factory (`@42/tsup-config`) defines it to itself for that reason.\n */\ndeclare const process: { env: { NODE_ENV?: string } }\n\nfunction isProduction(): boolean {\n try {\n return process.env.NODE_ENV === \"production\"\n } catch {\n return false\n }\n}\n\nexport function devWarn(message: string): void {\n if (isProduction()) return\n console.warn(message)\n}\n\nconst warned = new Set<string>()\n\n/**\n * `devWarn`, at most once per message for the page's lifetime. For a warning a\n * component would otherwise repeat on every render, such as a deprecated prop\n * that is still being passed.\n */\nexport function devWarnOnce(message: string): void {\n if (isProduction() || warned.has(message)) return\n warned.add(message)\n devWarn(message)\n}\n\n/**\n * Warns, once, that `component`'s `from` prop was renamed `to`. Call it where\n * the deprecated alias is read, guarded by the alias being set.\n */\nexport function warnRenamedProp(component: string, from: string, to: string): void {\n devWarnOnce(\n `${component}: \\`${from}\\` is deprecated, use \\`${to}\\`. It will be removed in the next minor.`,\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/lib/dev-warn.ts"],"names":[],"mappings":";AAgCO,SAAS,YAAA,GAAwB;AACtC,EAAA,IAAI;AACF,IAAA,OAAO,OAAA,CAAA,GAAA,CAAA,QAAA,KAAyB,YAAA;AAAA,EAClC,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AAEO,SAAS,QAAQ,OAAA,EAAuB;AAC7C,EAAA,IAAI,cAAa,EAAG;AACpB,EAAA,OAAA,CAAQ,KAAK,OAAO,CAAA;AACtB;AAEA,IAAM,MAAA,uBAAa,GAAA,EAAY;AAOxB,SAAS,YAAY,OAAA,EAAuB;AACjD,EAAA,IAAI,YAAA,EAAa,IAAK,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA,EAAG;AAC3C,EAAA,MAAA,CAAO,IAAI,OAAO,CAAA;AAClB,EAAA,OAAA,CAAQ,OAAO,CAAA;AACjB;AAMO,SAAS,eAAA,CAAgB,SAAA,EAAmB,IAAA,EAAc,EAAA,EAAkB;AACjF,EAAA,WAAA;AAAA,IACE,CAAA,EAAG,SAAS,CAAA,IAAA,EAAO,IAAI,2BAA2B,EAAE,CAAA,yCAAA;AAAA,GACtD;AACF","file":"chunk-PQZSTI3R.js","sourcesContent":["/**\n * Dev-mode-only warning helpers — the kit's pattern for runtime\n * misconfiguration checks (Schedule's `editable` prop was the first).\n *\n * The production gate lives in `isProduction()` and has three jobs:\n *\n * 1. Contain the LITERAL `process.env.NODE_ENV`. Bundlers (webpack/Next's\n * DefinePlugin, Vite, esbuild, Rollup's replace plugin) substitute only that\n * exact member expression. `process?.env?.NODE_ENV`, `globalThis.process`\n * or a destructured `env` are never replaced, so the warning would survive\n * into every consumer's production build — which is what the old gate did.\n * 2. Not throw without a bundler and without a `process` global (plain ESM in a\n * browser, Deno). Reading the literal inside `try` turns that\n * `ReferenceError` (or a `TypeError` for a `process` with no `env`) into\n * \"not production\", so the warning is logged, which is the right default\n * for code nobody built for production.\n * 3. Still warn in development and test.\n *\n * Why not `typeof process !== \"undefined\" && process.env.NODE_ENV === ...`:\n * the bundler replaces the second half with `\"production\"`, but on the client\n * there is still no `process` global, so the `typeof` half is false, the early\n * return never happens, and the warning logs in production anyway. Inside the\n * `try`, a production build reduces to `\"production\" === \"production\"`, and\n * the minifier drops the `console.warn` behind it.\n *\n * `process` is declared locally rather than pulling in `@types/node`, which\n * this otherwise browser-only package has no other reason to depend on. The\n * kit's own `dist` must keep the literal for consumers to replace; the shared\n * tsup factory (`@42/tsup-config`) defines it to itself for that reason.\n */\ndeclare const process: { env: { NODE_ENV?: string } }\n\nexport function isProduction(): boolean {\n try {\n return process.env.NODE_ENV === \"production\"\n } catch {\n return false\n }\n}\n\nexport function devWarn(message: string): void {\n if (isProduction()) return\n console.warn(message)\n}\n\nconst warned = new Set<string>()\n\n/**\n * `devWarn`, at most once per message for the page's lifetime. For a warning a\n * component would otherwise repeat on every render, such as a deprecated prop\n * that is still being passed.\n */\nexport function devWarnOnce(message: string): void {\n if (isProduction() || warned.has(message)) return\n warned.add(message)\n devWarn(message)\n}\n\n/**\n * Warns, once, that `component`'s `from` prop was renamed `to`. Call it where\n * the deprecated alias is read, guarded by the alias being set.\n */\nexport function warnRenamedProp(component: string, from: string, to: string): void {\n devWarnOnce(\n `${component}: \\`${from}\\` is deprecated, use \\`${to}\\`. It will be removed in the next minor.`,\n )\n}\n"]}
@@ -2,7 +2,7 @@ import { useUncontrolled } from './chunk-PMUCGFY5.js';
2
2
  import { CloseIcon } from './chunk-6YNLRQ25.js';
3
3
  import { Collapse } from './chunk-NKOTA5TM.js';
4
4
  import { mergeIcons, iconStroke } from './chunk-XXOR34T4.js';
5
- import { Spinner } from './chunk-D2QIPQ74.js';
5
+ import { Spinner } from './chunk-W3XX7BYT.js';
6
6
  import { props } from './chunk-WYCMIIRR.js';
7
7
  import { focusStyles } from './chunk-C6NVU4F7.js';
8
8
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
@@ -238,5 +238,5 @@ var Notification = Object.assign(NotificationComponent, {
238
238
  });
239
239
 
240
240
  export { ActionTrigger, CloseTrigger, Description, Icon, NOTIFICATION_DEFAULT_TRANSLATIONS, Notification, TOAST_STATUS, Title, notificationRoot };
241
- //# sourceMappingURL=chunk-LKFHUDEW.js.map
242
- //# sourceMappingURL=chunk-LKFHUDEW.js.map
241
+ //# sourceMappingURL=chunk-QVOBLRCM.js.map
242
+ //# sourceMappingURL=chunk-QVOBLRCM.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/notification/notification.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmDO,IAAM,mBAAA,GAAsB;AAAA,EACjC,qCAAA;AAAA,EACA;AACF,CAAA;AAMO,IAAM,mBAAmB,GAAA,CAAI;AAAA,EAClC,0EAAA;AAAA,EACA,iEAAA;AAAA;AAAA,EAEA,mCAAA;AAAA,EACA,+BAAA;AAAA;AAAA;AAAA,EAGA,oBAAA;AAAA,EACA,WAAA,CAAY,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAA;AAAA,EAC7B,8CAAA;AAAA,EACA,8CAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,YAAA,GAAqE;AAAA,EAChF,OAAA,EAAS,EAAE,KAAA,EAAO,OAAA,EAAS,sBAAM,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAW,UAAA,EAAY,CAAA,EAAG;AAAA,EAC5E,KAAA,EAAO,EAAE,KAAA,EAAO,KAAA,EAAO,sBAAM,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAW,UAAA,EAAY,CAAA,EAAG;AAAA,EACxE,OAAA,EAAS,EAAE,KAAA,EAAO,QAAA,EAAU,sBAAM,GAAA,CAAC,iBAAA,EAAA,EAAkB,SAAA,EAAW,UAAA,EAAY,CAAA,EAAG;AAAA,EAC/E,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,sBAAM,GAAA,CAAC,QAAA,EAAA,EAAS,SAAA,EAAW,UAAA,EAAY,CAAA,EAAG;AAAA,EACpE,OAAA,EAAS,EAAE,KAAA,EAAO,SAAA,EAAW,IAAA,kBAAM,GAAA,CAAC,OAAA,EAAA,EAAQ,IAAA,EAAK,IAAA,EAAK,KAAA,EAAO,IAAA,EAAM,CAAA;AACrE;AAWO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EAAG,MAAM,IAAI,CAAA,CACxC,UAAA;AAAW,KAAA,EAChB,CAAA;AAAA,oBAEA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAM,WAAA,IAAe,IAAA,IAAQ,IAAA,EACrC,QAAA,kBAAA,GAAA,CAAC,WAAA,EAAA,EAAa,QAAA,EAAA,WAAA,IAAe,eAAA,CAAgB,OAAA,EAAQ,CAAA,EACvD,CAAA;AAAA,oBACA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAM,MAAA,IAAU,IAAA,IAAQ,IAAA,EAChC,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,wCAAA,EAA0C,QAAA,EAAA,MAAA,IAAU,UAAA,CAAW,SAAQ,CAAA,EACxF;AAAA,GAAA,EACF,CAAA;AAEJ;AAOO,IAAM,YAAA,GAAe,MAAA,CAAO,MAAA,CAAO,qBAAA,EAAuB;AAAA,EAC/D,IAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAC","file":"chunk-LKFHUDEW.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n AlertCircleIcon,\n CheckCircleIcon,\n ChevronDownIcon,\n InfoIcon,\n TriangleAlertIcon,\n} from \"lucide-react\"\nimport { type ComponentPropsWithoutRef, type ReactNode, type Ref, useRef } from \"react\"\nimport { match } from \"ts-pattern\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\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 { CloseIcon } from \"../popover/icons\"\nimport { Spinner } from \"../spinner/spinner\"\nimport type { ToastFields, ToastHue, ToastType } from \"./types\"\n\n/**\n * Notification — the kit's **toast**: transient, non-blocking feedback spawned\n * imperatively from anywhere (`notify.success(\"Saved\")`) via `createNotifier`.\n *\n * This module holds the *visual* compound (`Notification.Root` / `Icon` /\n * `Title` / `Description` / `ActionTrigger` / `CloseTrigger` /\n * `CollapseTrigger`) and the ready-made `Notification` card composed from a\n * toast-shaped object (`type` → hue + icon, `title` / `description` /\n * `action`). It is deliberately dumb: the toaster behavior that drives it —\n * store, presence, height measurement, swipe-to-dismiss, stacking — lives in\n * `store.ts` / `create-notifier.tsx`, so the card is equally usable on its own\n * (e.g. a page-level alert).\n *\n * The surface is a single outline recipe; `color` (a `data-color` attribute\n * resolved to the `--c-*` slot vars) is the only styling axis. Status presets\n * map a `type` onto a hue + a leading icon.\n * Enter/exit is driven by Ark Presence → `data-state` → the `toast-in/out`\n * keyframes (like modal/drawer/popover).\n */\n\n/** The outline surface. Deliberately opaque and blurred: a toast floats over\n * arbitrary content. `Alert` (the inline sibling) shares the parts but not\n * this surface — it sits on the page and takes a translucent tint instead.\n * `color` tints the border, text and icon through `--c-solid`. */\nexport const notificationSurface = [\n \"bg-brand-50/90 dark:bg-brand-950/85\",\n \"text-(--c-solid) border-(--c-solid) backdrop-blur-lg\",\n]\n\n/** The toast card. Enter/exit via `data-state` keyframes (Ark Presence sets\n * `data-state`); stacking position via the `[data-scope=notifications]` rules\n * in theme.css (driven by the `--index`/`--offset`/`--height` vars the toaster\n * sets on each card — see create-notifier). */\nexport const notificationRoot = cva([\n \"data-[state=open]:animate-toast-in data-[state=closed]:animate-toast-out\",\n \"pointer-events-auto flex flex-col w-88 max-w-[calc(100vw-2rem)]\",\n // Phones (< xs): fill the full-bleed bottom region (see createNotifier).\n \"max-xs:w-full! max-xs:max-w-none!\",\n \"rounded-card border px-3 py-3\",\n // Any-focus outline suppression, matching the other overlay surfaces\n // (Modal, Drawer, Popover, Tooltip) — the card can take programmatic focus.\n \"focus:outline-none\",\n focusStyles({ offset: false }),\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"shadow-2xl shadow-white dark:shadow-black/80\",\n \"overflow-clip\",\n notificationSurface,\n])\n\n/** `type` → hue + default leading icon. There are no status color *tokens* in\n * the kit — status maps onto existing hues, reusing the same `--c-*` slots as\n * Badge/Button. `loading` uses the kit Spinner. Exported so `Alert` (which\n * drops the toast-only `loading` type) resolves the same presets. */\nexport const TOAST_STATUS: Record<ToastType, { color: Color; icon: ReactNode }> = {\n success: { color: \"green\", icon: <CheckCircleIcon className={iconStroke} /> },\n error: { color: \"red\", icon: <AlertCircleIcon className={iconStroke} /> },\n warning: { color: \"orange\", icon: <TriangleAlertIcon className={iconStroke} /> },\n info: { color: \"neutral\", icon: <InfoIcon className={iconStroke} /> },\n loading: { color: \"neutral\", icon: <Spinner size=\"md\" label={null} /> },\n}\n\nexport type NotificationIconSlot = ToastType | \"close\" | \"collapse\"\n/**\n * The card's icons: one per status `type` (`success`, `error`, `warning`,\n * `info`, `loading`), the close ×, and the collapse chevron, which turns half\n * a turn while the card is folded. A toast's own `icon` still wins over its\n * status icon.\n */\nexport type NotificationIcons = IconMap<NotificationIconSlot>\n\nexport const DEFAULT_ICONS: Record<NotificationIconSlot, ReactNode> = {\n success: TOAST_STATUS.success.icon,\n error: TOAST_STATUS.error.icon,\n warning: TOAST_STATUS.warning.icon,\n info: TOAST_STATUS.info.icon,\n loading: TOAST_STATUS.loading.icon,\n close: <CloseIcon />,\n collapse: <ChevronDownIcon className={iconStroke} />,\n}\n\n/** Turns the collapse icon half a turn while the card is folded. */\nconst Turn = ({ open, children }: { open: boolean; children: ReactNode }) => (\n <span\n data-open={open}\n className=\"inline-flex transition-transform data-[open=true]:rotate-0 data-[open=false]:rotate-180\"\n >\n {children}\n </span>\n)\n\nexport type NotificationRootProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** Accent palette. Drives the `--c-*` slot vars for the whole toast. */\n color?: Color\n /** Forwarded to the underlying element (used by Presence for enter/exit). */\n ref?: Ref<HTMLDivElement>\n }\n\nconst Root = ({ className, color, testId, ...rest }: NotificationRootProps) => (\n <ark.div\n data-color={color}\n className={cn(notificationRoot(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** Leading-glyph slot. Inherits the Root's text color (the `color` hue) and\n * sizes any child svg to match the text.\n * Exported (like the parts below) so `Alert` reuses it as-is — these are\n * width-agnostic, so nothing about them is toast-specific. */\nexport const Icon = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"span\"> & WithTestId) => (\n <span\n className={cn(\"inline-flex [&_svg]:size-5\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Title = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\"text-sm font-bold\", TEXT_COLOR_CLASSES.primary, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Description = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\n \"mt-1 text-sm font-normal text-brand-900/70 opacity-90 dark:text-white/80\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const ActionTrigger = ({\n className,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n className={cn(\n \"inline-flex h-7 cursor-pointer items-center rounded-input px-2 text-xs font-medium\",\n \"border border-current/30 hover:bg-current/10\",\n focusStyles({ ring: \"palette\", offset: false }),\n \"transition-colors\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** The card's control names. `closeTriggerLabel` follows Ark's own Toast key. The ready-made\n * card takes them as `translations`; the compound parts (`CloseTrigger`, `CollapseTrigger`)\n * default to the same English names and take a plain `aria-label` to override. */\nexport type NotificationTranslations = {\n /** The close (×) button. Default `\"Dismiss\"`. */\n closeTriggerLabel?: string\n /** The collapse chevron while the card is open. Default `\"Collapse\"`. */\n collapseLabel?: string\n /** The collapse chevron while the card is folded. Default `\"Expand\"`. */\n expandLabel?: string\n}\n\n/** The one source of the card's English names: the compound parts' defaults, and the base the\n * ready-made card (and `Alert`, `<Notifications>`) merge a partial override onto. */\nexport const NOTIFICATION_DEFAULT_TRANSLATIONS = {\n closeTriggerLabel: \"Dismiss\",\n collapseLabel: \"Collapse\",\n expandLabel: \"Expand\",\n} as const satisfies Required<NotificationTranslations>\n\n/** The close and collapse buttons share one look: a small round control resting at 70%. */\nconst triggerClass = [\n \"ms-auto inline-flex size-5 shrink-0 cursor-pointer items-center justify-center\",\n \"rounded-full opacity-70 hover:opacity-100 [&_svg]:size-4\",\n focusStyles({ ring: \"palette\", offset: false }),\n // The button rests at 70% opacity, which would fade its ring with it.\n \"focus-visible:opacity-100\",\n \"transition-colors\",\n]\n\nexport const CloseTrigger = ({\n className,\n children,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n aria-label={NOTIFICATION_DEFAULT_TRANSLATIONS.closeTriggerLabel}\n className={cn(triggerClass, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? DEFAULT_ICONS.close}\n </button>\n)\n\n/**\n * The chevron that folds the card's description and action rows away — the\n * collapse counterpart to `CloseTrigger`, and what the ready-made card renders\n * for `withCollapse`.\n *\n * It is presentational only: `open` drives the label, `aria-expanded` and the\n * chevron's rotation, but the state itself belongs to the caller. The button\n * owns the layout, the opacity and any `className`; the default icon carries\n * nothing but its rotation, so passing a `className` tints or spaces the\n * control once rather than twice.\n */\nexport const CollapseTrigger = ({\n className,\n children,\n type,\n open,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId & { open: boolean }) => (\n <button\n type={type ?? \"button\"}\n aria-label={\n open\n ? NOTIFICATION_DEFAULT_TRANSLATIONS.collapseLabel\n : NOTIFICATION_DEFAULT_TRANSLATIONS.expandLabel\n }\n aria-expanded={open}\n className={cn(triggerClass, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? <Turn open={open}>{DEFAULT_ICONS.collapse}</Turn>}\n </button>\n)\n\n/**\n * Props for the ready-made `Notification` card. The presentational fields it\n * shares with a spawned toast (`type` / `title` / `description` / `action` /\n * `color` / `icon` / `withCloseButton`) plus its own collapse controls;\n * the Notifier-managed plumbing (`id` / `status` / `duration`) is optional, so a\n * standalone card is just `<Notification type=\"success\" title=\"Saved\" />`.\n */\nexport type NotificationProps = Omit<NotificationRootProps, \"title\" | \"color\" | \"asChild\"> &\n ForbidAsChild &\n Omit<ToastFields, \"id\" | \"status\" | \"duration\"> &\n Partial<Pick<ToastFields, \"id\" | \"status\" | \"duration\">> &\n ToastHue & {\n /** Invoked when the close (×) button is pressed. */\n onClose?: () => void\n /** Swap the close (×) button for a chevron that folds the description and\n * action rows away. `withCloseButton` takes precedence over this. */\n withCollapse?: boolean\n /** Uncontrolled initial open state — collapsed by default when `withCollapse`,\n * open otherwise. Pair with `withCollapse`. */\n defaultOpen?: boolean\n /** Controlled open state — pair with `onOpenChange`. */\n open?: boolean\n /** Fired when the collapse toggle is pressed. */\n onOpenChange?: (open: boolean) => void\n /** Overrides the close and collapse buttons' accessible names. A partial override keeps\n * the other defaults. */\n translations?: NotificationTranslations\n /** Replaces the default icons: the status icons by `type`, `close` and `collapse`. A missing\n * key keeps its default; `icon` wins over the status icon, and `null` drops a status icon. */\n icons?: NotificationIcons\n }\n\n/**\n * The ready-made **`Notification` card** — the presentational body composed from\n * a toast-shaped object: resolves `type` → `TOAST_STATUS` (hue + leading icon), lets\n * an explicit `color`/`icon` override (`icon={null}` hides the glyph),\n * and lays out the icon/title/close row plus the independently-collapsing\n * description and action sections.\n *\n * Owns no store, presence or gesture state — the Notifier's render body drives\n * it by forwarding a `ref`, stacking style vars, pointer handlers and `onClose`\n * straight through to the `Root`. Rendered on its own it is just a status card\n * (e.g. a page-level alert). For a bespoke layout, compose the parts directly:\n * `Notification.Root`, `.Icon`, `.Title`, `.Description`, `.ActionTrigger`,\n * `.CloseTrigger`.\n *\n * **Announcements are the toaster's job, not the card's.** A toast spawned\n * through `createNotifier` is its own live region: `role=\"status\"`, or\n * `role=\"alert\"` for an `error`, set by the notifier as it renders the card.\n * A standalone card carries no role: rendered with the page it is content to\n * read, not news, and a live region there would only re-announce whatever it\n * holds on every mount. A card you insert in response to an event *is* news:\n * pass the role yourself (`role=\"status\"`, or `role=\"alert\"` for a failure)\n * and it lands on the `Root`, or mount it into a region that's already live.\n */\nfunction NotificationComponent({\n type,\n title,\n description,\n action,\n color: _color,\n icon: _icon,\n withCloseButton = true,\n withCollapse = false,\n defaultOpen,\n open: _open,\n onOpenChange,\n onClose,\n translations,\n icons: iconsProp,\n // Notifier-managed plumbing — not rendered onto the card.\n status: _status,\n duration: _duration,\n asChild: _asChild,\n ...rest\n}: NotificationProps) {\n const resolvedTranslations = { ...NOTIFICATION_DEFAULT_TRANSLATIONS, ...translations }\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n // `type` and `color` are exclusive (see `ToastHue`), and testing the destructured `type`\n // narrows `color` with it: no cast. The preset wins should a JS caller pass both anyway.\n const color = type === undefined ? _color : TOAST_STATUS[type].color\n // Not `??`: an explicit `icon={null}` (hide the glyph) must not fall\n // through to the preset the way an omitted (`undefined`) icon does.\n const icon = _icon === undefined ? type && icons[type] : _icon\n\n const [open, setOpen] = useUncontrolled({\n defaultValue: defaultOpen,\n value: _open,\n finalValue: match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => true)\n .with({ withCollapse: true }, () => false)\n .with({ withCollapse: false }, () => true)\n .exhaustive(),\n onChange: onOpenChange,\n })\n\n // Keep the last-present description / action mounted through their collapse so\n // each reveal has content to animate *out* (removed content unmounts instantly\n // otherwise). Cached independently so the two sections animate separately.\n const lastDescription = useRef(description)\n if (description != null) lastDescription.current = description\n const lastAction = useRef(action)\n if (action != null) lastAction.current = action\n\n return (\n <Root color={color} {...rest}>\n <div className=\"flex flex-row gap-3\">\n {icon != null && <Icon>{icon}</Icon>}\n {title != null && <Title>{title}</Title>}\n {match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => (\n <CloseTrigger aria-label={resolvedTranslations.closeTriggerLabel} onClick={onClose}>\n {icons.close}\n </CloseTrigger>\n ))\n .with({ withCollapse: true }, () => (\n <CollapseTrigger\n open={open}\n aria-label={\n open ? resolvedTranslations.collapseLabel : resolvedTranslations.expandLabel\n }\n onClick={() => setOpen(!open)}\n >\n <Turn open={open}>{icons.collapse}</Turn>\n </CollapseTrigger>\n ))\n .with({ withCollapse: false }, () => null)\n .exhaustive()}\n </div>\n {/* Description and action are independent Collapse sections. */}\n <Collapse open={description != null && open}>\n <Description>{description ?? lastDescription.current}</Description>\n </Collapse>\n <Collapse open={action != null && open}>\n <div className=\"mt-2 flex flex-wrap items-center gap-2\">{action ?? lastAction.current}</div>\n </Collapse>\n </Root>\n )\n}\n\n/**\n * `Notification` — the ready-made card (batteries-included), with the compound\n * parts attached for bespoke composition. Mirrors `Tooltip`/`Modal`: the bare\n * name is the convenience form; `.Root` and friends are the primitives.\n */\nexport const Notification = Object.assign(NotificationComponent, {\n Root,\n Icon,\n Title,\n Description,\n ActionTrigger,\n CloseTrigger,\n CollapseTrigger,\n})\n"]}
1
+ {"version":3,"sources":["../src/components/notification/notification.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmDO,IAAM,mBAAA,GAAsB;AAAA,EACjC,qCAAA;AAAA,EACA;AACF,CAAA;AAMO,IAAM,mBAAmB,GAAA,CAAI;AAAA,EAClC,0EAAA;AAAA,EACA,iEAAA;AAAA;AAAA,EAEA,mCAAA;AAAA,EACA,+BAAA;AAAA;AAAA;AAAA,E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AAC,KAAA,EAAA,EAAI,SAAA,EAAU,wCAAA,EAA0C,QAAA,EAAA,MAAA,IAAU,UAAA,CAAW,SAAQ,CAAA,EACxF;AAAA,GAAA,EACF,CAAA;AAEJ;AAOO,IAAM,YAAA,GAAe,MAAA,CAAO,MAAA,CAAO,qBAAA,EAAuB;AAAA,EAC/D,IAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAC","file":"chunk-QVOBLRCM.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n AlertCircleIcon,\n CheckCircleIcon,\n ChevronDownIcon,\n InfoIcon,\n TriangleAlertIcon,\n} from \"lucide-react\"\nimport { type ComponentPropsWithoutRef, type ReactNode, type Ref, useRef } from \"react\"\nimport { match } from \"ts-pattern\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\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 { CloseIcon } from \"../popover/icons\"\nimport { Spinner } from \"../spinner/spinner\"\nimport type { ToastFields, ToastHue, ToastType } from \"./types\"\n\n/**\n * Notification — the kit's **toast**: transient, non-blocking feedback spawned\n * imperatively from anywhere (`notify.success(\"Saved\")`) via `createNotifier`.\n *\n * This module holds the *visual* compound (`Notification.Root` / `Icon` /\n * `Title` / `Description` / `ActionTrigger` / `CloseTrigger` /\n * `CollapseTrigger`) and the ready-made `Notification` card composed from a\n * toast-shaped object (`type` → hue + icon, `title` / `description` /\n * `action`). It is deliberately dumb: the toaster behavior that drives it —\n * store, presence, height measurement, swipe-to-dismiss, stacking — lives in\n * `store.ts` / `create-notifier.tsx`, so the card is equally usable on its own\n * (e.g. a page-level alert).\n *\n * The surface is a single outline recipe; `color` (a `data-color` attribute\n * resolved to the `--c-*` slot vars) is the only styling axis. Status presets\n * map a `type` onto a hue + a leading icon.\n * Enter/exit is driven by Ark Presence → `data-state` → the `toast-in/out`\n * keyframes (like modal/drawer/popover).\n */\n\n/** The outline surface. Deliberately opaque and blurred: a toast floats over\n * arbitrary content. `Alert` (the inline sibling) shares the parts but not\n * this surface — it sits on the page and takes a translucent tint instead.\n * `color` tints the border, text and icon through `--c-solid`. */\nexport const notificationSurface = [\n \"bg-brand-50/90 dark:bg-brand-950/85\",\n \"text-(--c-solid) border-(--c-solid) backdrop-blur-lg\",\n]\n\n/** The toast card. Enter/exit via `data-state` keyframes (Ark Presence sets\n * `data-state`); stacking position via the `[data-scope=notifications]` rules\n * in theme.css (driven by the `--index`/`--offset`/`--height` vars the toaster\n * sets on each card — see create-notifier). */\nexport const notificationRoot = cva([\n \"data-[state=open]:animate-toast-in data-[state=closed]:animate-toast-out\",\n \"pointer-events-auto flex flex-col w-88 max-w-[calc(100vw-2rem)]\",\n // Phones (< xs): fill the full-bleed bottom region (see createNotifier).\n \"max-xs:w-full! max-xs:max-w-none!\",\n \"rounded-card border px-3 py-3\",\n // Any-focus outline suppression, matching the other overlay surfaces\n // (Modal, Drawer, Popover, Tooltip) — the card can take programmatic focus.\n \"focus:outline-none\",\n focusStyles({ offset: false }),\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"shadow-2xl shadow-white dark:shadow-black/80\",\n \"overflow-clip\",\n notificationSurface,\n])\n\n/** `type` → hue + default leading icon. There are no status color *tokens* in\n * the kit — status maps onto existing hues, reusing the same `--c-*` slots as\n * Badge/Button. `loading` uses the kit Spinner. Exported so `Alert` (which\n * drops the toast-only `loading` type) resolves the same presets. */\nexport const TOAST_STATUS: Record<ToastType, { color: Color; icon: ReactNode }> = {\n success: { color: \"green\", icon: <CheckCircleIcon className={iconStroke} /> },\n error: { color: \"red\", icon: <AlertCircleIcon className={iconStroke} /> },\n warning: { color: \"orange\", icon: <TriangleAlertIcon className={iconStroke} /> },\n info: { color: \"neutral\", icon: <InfoIcon className={iconStroke} /> },\n loading: { color: \"neutral\", icon: <Spinner size=\"md\" label={null} /> },\n}\n\nexport type NotificationIconSlot = ToastType | \"close\" | \"collapse\"\n/**\n * The card's icons: one per status `type` (`success`, `error`, `warning`,\n * `info`, `loading`), the close ×, and the collapse chevron, which turns half\n * a turn while the card is folded. A toast's own `icon` still wins over its\n * status icon.\n */\nexport type NotificationIcons = IconMap<NotificationIconSlot>\n\nexport const DEFAULT_ICONS: Record<NotificationIconSlot, ReactNode> = {\n success: TOAST_STATUS.success.icon,\n error: TOAST_STATUS.error.icon,\n warning: TOAST_STATUS.warning.icon,\n info: TOAST_STATUS.info.icon,\n loading: TOAST_STATUS.loading.icon,\n close: <CloseIcon />,\n collapse: <ChevronDownIcon className={iconStroke} />,\n}\n\n/** Turns the collapse icon half a turn while the card is folded. */\nconst Turn = ({ open, children }: { open: boolean; children: ReactNode }) => (\n <span\n data-open={open}\n className=\"inline-flex transition-transform data-[open=true]:rotate-0 data-[open=false]:rotate-180\"\n >\n {children}\n </span>\n)\n\nexport type NotificationRootProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** Accent palette. Drives the `--c-*` slot vars for the whole toast. */\n color?: Color\n /** Forwarded to the underlying element (used by Presence for enter/exit). */\n ref?: Ref<HTMLDivElement>\n }\n\nconst Root = ({ className, color, testId, ...rest }: NotificationRootProps) => (\n <ark.div\n data-color={color}\n className={cn(notificationRoot(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** Leading-glyph slot. Inherits the Root's text color (the `color` hue) and\n * sizes any child svg to match the text.\n * Exported (like the parts below) so `Alert` reuses it as-is — these are\n * width-agnostic, so nothing about them is toast-specific. */\nexport const Icon = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"span\"> & WithTestId) => (\n <span\n className={cn(\"inline-flex [&_svg]:size-5\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Title = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\"text-sm font-bold\", TEXT_COLOR_CLASSES.primary, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Description = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\n \"mt-1 text-sm font-normal text-brand-900/70 opacity-90 dark:text-white/80\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const ActionTrigger = ({\n className,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n className={cn(\n \"inline-flex h-7 cursor-pointer items-center rounded-input px-2 text-xs font-medium\",\n \"border border-current/30 hover:bg-current/10\",\n focusStyles({ ring: \"palette\", offset: false }),\n \"transition-colors\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** The card's control names. `closeTriggerLabel` follows Ark's own Toast key. The ready-made\n * card takes them as `translations`; the compound parts (`CloseTrigger`, `CollapseTrigger`)\n * default to the same English names and take a plain `aria-label` to override. */\nexport type NotificationTranslations = {\n /** The close (×) button. Default `\"Dismiss\"`. */\n closeTriggerLabel?: string\n /** The collapse chevron while the card is open. Default `\"Collapse\"`. */\n collapseLabel?: string\n /** The collapse chevron while the card is folded. Default `\"Expand\"`. */\n expandLabel?: string\n}\n\n/** The one source of the card's English names: the compound parts' defaults, and the base the\n * ready-made card (and `Alert`, `<Notifications>`) merge a partial override onto. */\nexport const NOTIFICATION_DEFAULT_TRANSLATIONS = {\n closeTriggerLabel: \"Dismiss\",\n collapseLabel: \"Collapse\",\n expandLabel: \"Expand\",\n} as const satisfies Required<NotificationTranslations>\n\n/** The close and collapse buttons share one look: a small round control resting at 70%. */\nconst triggerClass = [\n \"ms-auto inline-flex size-5 shrink-0 cursor-pointer items-center justify-center\",\n \"rounded-full opacity-70 hover:opacity-100 [&_svg]:size-4\",\n focusStyles({ ring: \"palette\", offset: false }),\n // The button rests at 70% opacity, which would fade its ring with it.\n \"focus-visible:opacity-100\",\n \"transition-colors\",\n]\n\nexport const CloseTrigger = ({\n className,\n children,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n aria-label={NOTIFICATION_DEFAULT_TRANSLATIONS.closeTriggerLabel}\n className={cn(triggerClass, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? DEFAULT_ICONS.close}\n </button>\n)\n\n/**\n * The chevron that folds the card's description and action rows away — the\n * collapse counterpart to `CloseTrigger`, and what the ready-made card renders\n * for `withCollapse`.\n *\n * It is presentational only: `open` drives the label, `aria-expanded` and the\n * chevron's rotation, but the state itself belongs to the caller. The button\n * owns the layout, the opacity and any `className`; the default icon carries\n * nothing but its rotation, so passing a `className` tints or spaces the\n * control once rather than twice.\n */\nexport const CollapseTrigger = ({\n className,\n children,\n type,\n open,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId & { open: boolean }) => (\n <button\n type={type ?? \"button\"}\n aria-label={\n open\n ? NOTIFICATION_DEFAULT_TRANSLATIONS.collapseLabel\n : NOTIFICATION_DEFAULT_TRANSLATIONS.expandLabel\n }\n aria-expanded={open}\n className={cn(triggerClass, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? <Turn open={open}>{DEFAULT_ICONS.collapse}</Turn>}\n </button>\n)\n\n/**\n * Props for the ready-made `Notification` card. The presentational fields it\n * shares with a spawned toast (`type` / `title` / `description` / `action` /\n * `color` / `icon` / `withCloseButton`) plus its own collapse controls;\n * the Notifier-managed plumbing (`id` / `status` / `duration`) is optional, so a\n * standalone card is just `<Notification type=\"success\" title=\"Saved\" />`.\n */\nexport type NotificationProps = Omit<NotificationRootProps, \"title\" | \"color\" | \"asChild\"> &\n ForbidAsChild &\n Omit<ToastFields, \"id\" | \"status\" | \"duration\"> &\n Partial<Pick<ToastFields, \"id\" | \"status\" | \"duration\">> &\n ToastHue & {\n /** Invoked when the close (×) button is pressed. */\n onClose?: () => void\n /** Swap the close (×) button for a chevron that folds the description and\n * action rows away. `withCloseButton` takes precedence over this. */\n withCollapse?: boolean\n /** Uncontrolled initial open state — collapsed by default when `withCollapse`,\n * open otherwise. Pair with `withCollapse`. */\n defaultOpen?: boolean\n /** Controlled open state — pair with `onOpenChange`. */\n open?: boolean\n /** Fired when the collapse toggle is pressed. */\n onOpenChange?: (open: boolean) => void\n /** Overrides the close and collapse buttons' accessible names. A partial override keeps\n * the other defaults. */\n translations?: NotificationTranslations\n /** Replaces the default icons: the status icons by `type`, `close` and `collapse`. A missing\n * key keeps its default; `icon` wins over the status icon, and `null` drops a status icon. */\n icons?: NotificationIcons\n }\n\n/**\n * The ready-made **`Notification` card** — the presentational body composed from\n * a toast-shaped object: resolves `type` → `TOAST_STATUS` (hue + leading icon), lets\n * an explicit `color`/`icon` override (`icon={null}` hides the glyph),\n * and lays out the icon/title/close row plus the independently-collapsing\n * description and action sections.\n *\n * Owns no store, presence or gesture state — the Notifier's render body drives\n * it by forwarding a `ref`, stacking style vars, pointer handlers and `onClose`\n * straight through to the `Root`. Rendered on its own it is just a status card\n * (e.g. a page-level alert). For a bespoke layout, compose the parts directly:\n * `Notification.Root`, `.Icon`, `.Title`, `.Description`, `.ActionTrigger`,\n * `.CloseTrigger`.\n *\n * **Announcements are the toaster's job, not the card's.** A toast spawned\n * through `createNotifier` is its own live region: `role=\"status\"`, or\n * `role=\"alert\"` for an `error`, set by the notifier as it renders the card.\n * A standalone card carries no role: rendered with the page it is content to\n * read, not news, and a live region there would only re-announce whatever it\n * holds on every mount. A card you insert in response to an event *is* news:\n * pass the role yourself (`role=\"status\"`, or `role=\"alert\"` for a failure)\n * and it lands on the `Root`, or mount it into a region that's already live.\n */\nfunction NotificationComponent({\n type,\n title,\n description,\n action,\n color: _color,\n icon: _icon,\n withCloseButton = true,\n withCollapse = false,\n defaultOpen,\n open: _open,\n onOpenChange,\n onClose,\n translations,\n icons: iconsProp,\n // Notifier-managed plumbing — not rendered onto the card.\n status: _status,\n duration: _duration,\n asChild: _asChild,\n ...rest\n}: NotificationProps) {\n const resolvedTranslations = { ...NOTIFICATION_DEFAULT_TRANSLATIONS, ...translations }\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n // `type` and `color` are exclusive (see `ToastHue`), and testing the destructured `type`\n // narrows `color` with it: no cast. The preset wins should a JS caller pass both anyway.\n const color = type === undefined ? _color : TOAST_STATUS[type].color\n // Not `??`: an explicit `icon={null}` (hide the glyph) must not fall\n // through to the preset the way an omitted (`undefined`) icon does.\n const icon = _icon === undefined ? type && icons[type] : _icon\n\n const [open, setOpen] = useUncontrolled({\n defaultValue: defaultOpen,\n value: _open,\n finalValue: match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => true)\n .with({ withCollapse: true }, () => false)\n .with({ withCollapse: false }, () => true)\n .exhaustive(),\n onChange: onOpenChange,\n })\n\n // Keep the last-present description / action mounted through their collapse so\n // each reveal has content to animate *out* (removed content unmounts instantly\n // otherwise). Cached independently so the two sections animate separately.\n const lastDescription = useRef(description)\n if (description != null) lastDescription.current = description\n const lastAction = useRef(action)\n if (action != null) lastAction.current = action\n\n return (\n <Root color={color} {...rest}>\n <div className=\"flex flex-row gap-3\">\n {icon != null && <Icon>{icon}</Icon>}\n {title != null && <Title>{title}</Title>}\n {match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => (\n <CloseTrigger aria-label={resolvedTranslations.closeTriggerLabel} onClick={onClose}>\n {icons.close}\n </CloseTrigger>\n ))\n .with({ withCollapse: true }, () => (\n <CollapseTrigger\n open={open}\n aria-label={\n open ? resolvedTranslations.collapseLabel : resolvedTranslations.expandLabel\n }\n onClick={() => setOpen(!open)}\n >\n <Turn open={open}>{icons.collapse}</Turn>\n </CollapseTrigger>\n ))\n .with({ withCollapse: false }, () => null)\n .exhaustive()}\n </div>\n {/* Description and action are independent Collapse sections. */}\n <Collapse open={description != null && open}>\n <Description>{description ?? lastDescription.current}</Description>\n </Collapse>\n <Collapse open={action != null && open}>\n <div className=\"mt-2 flex flex-wrap items-center gap-2\">{action ?? lastAction.current}</div>\n </Collapse>\n </Root>\n )\n}\n\n/**\n * `Notification` — the ready-made card (batteries-included), with the compound\n * parts attached for bespoke composition. Mirrors `Tooltip`/`Modal`: the bare\n * name is the convenience form; `.Root` and friends are the primitives.\n */\nexport const Notification = Object.assign(NotificationComponent, {\n Root,\n Icon,\n Title,\n Description,\n ActionTrigger,\n CloseTrigger,\n CollapseTrigger,\n})\n"]}
@@ -1,7 +1,7 @@
1
1
  import { calendarValueToDate, dateToArkValue, fromArkValues, toArkValues } from './chunk-ZB5VMGKB.js';
2
- import { useTimeZone } from './chunk-IUK7OJXZ.js';
3
- import { ActionIcon } from './chunk-BMEJBY6H.js';
4
- import { warnRenamedProp } from './chunk-LIZWCWED.js';
2
+ import { useTimeZone } from './chunk-OBSZ4NE2.js';
3
+ import { ActionIcon } from './chunk-B5YHYI7E.js';
4
+ import { warnRenamedProp } from './chunk-PQZSTI3R.js';
5
5
  import { useIsomorphicLayoutEffect } from './chunk-BUIHQJGE.js';
6
6
  import { ChevronRightIcon, ChevronLeftIcon } from './chunk-6YNLRQ25.js';
7
7
  import { mergeIcons } from './chunk-XXOR34T4.js';
@@ -422,5 +422,5 @@ var Calendar = ({
422
422
  };
423
423
 
424
424
  export { Calendar, CalendarBody, CalendarZoneSync, calendarGridWidth, hashArkValues, resolveCalendarTranslations };
425
- //# sourceMappingURL=chunk-E52Z2FKU.js.map
426
- //# sourceMappingURL=chunk-E52Z2FKU.js.map
425
+ //# sourceMappingURL=chunk-S5CQRCTF.js.map
426
+ //# sourceMappingURL=chunk-S5CQRCTF.js.map