@42-central/ui-react 0.24.0 → 0.25.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 (208) hide show
  1. package/dist/{chunk-FUNTJZX7.js → chunk-2CL3FKEY.js} +3 -3
  2. package/dist/{chunk-FUNTJZX7.js.map → chunk-2CL3FKEY.js.map} +1 -1
  3. package/dist/{chunk-OZMSXYBX.js → chunk-36NWC4GV.js} +3 -3
  4. package/dist/{chunk-OZMSXYBX.js.map → chunk-36NWC4GV.js.map} +1 -1
  5. package/dist/{chunk-4FEOMQYR.js → chunk-54W6VAI3.js} +5 -5
  6. package/dist/{chunk-4FEOMQYR.js.map → chunk-54W6VAI3.js.map} +1 -1
  7. package/dist/{chunk-SZEOTXRZ.js → chunk-6II2DVYR.js} +5 -5
  8. package/dist/{chunk-SZEOTXRZ.js.map → chunk-6II2DVYR.js.map} +1 -1
  9. package/dist/{chunk-DJLNGWMM.js → chunk-6IRMKF5T.js} +3 -3
  10. package/dist/{chunk-DJLNGWMM.js.map → chunk-6IRMKF5T.js.map} +1 -1
  11. package/dist/{chunk-YPFSRZ3T.js → chunk-6UIQJJNJ.js} +3 -3
  12. package/dist/{chunk-YPFSRZ3T.js.map → chunk-6UIQJJNJ.js.map} +1 -1
  13. package/dist/{chunk-DT6LKNZF.js → chunk-7247WBTV.js} +5 -4
  14. package/dist/chunk-7247WBTV.js.map +1 -0
  15. package/dist/{chunk-6VYGK3Q3.js → chunk-7E7JNWOC.js} +16 -21
  16. package/dist/chunk-7E7JNWOC.js.map +1 -0
  17. package/dist/{chunk-C4NFRSOR.js → chunk-7HZBD4YZ.js} +4 -4
  18. package/dist/{chunk-C4NFRSOR.js.map → chunk-7HZBD4YZ.js.map} +1 -1
  19. package/dist/{chunk-JVG5ISPT.js → chunk-AHKMN3YQ.js} +3 -3
  20. package/dist/{chunk-JVG5ISPT.js.map → chunk-AHKMN3YQ.js.map} +1 -1
  21. package/dist/{chunk-UAYENYS2.js → chunk-AKXALCUN.js} +3 -3
  22. package/dist/{chunk-UAYENYS2.js.map → chunk-AKXALCUN.js.map} +1 -1
  23. package/dist/{chunk-BE2LWUHY.js → chunk-BMEJBY6H.js} +5 -3
  24. package/dist/chunk-BMEJBY6H.js.map +1 -0
  25. package/dist/{chunk-MXAACRWE.js → chunk-E52Z2FKU.js} +5 -5
  26. package/dist/{chunk-MXAACRWE.js.map → chunk-E52Z2FKU.js.map} +1 -1
  27. package/dist/chunk-F374BNL4.js +129 -0
  28. package/dist/chunk-F374BNL4.js.map +1 -0
  29. package/dist/{chunk-MRAJ45IM.js → chunk-FZSLSUSX.js} +4 -4
  30. package/dist/{chunk-MRAJ45IM.js.map → chunk-FZSLSUSX.js.map} +1 -1
  31. package/dist/{chunk-3L5GLI67.js → chunk-I4B3N3UX.js} +3 -3
  32. package/dist/{chunk-3L5GLI67.js.map → chunk-I4B3N3UX.js.map} +1 -1
  33. package/dist/{chunk-IPYHTCFL.js → chunk-IUK7OJXZ.js} +3 -3
  34. package/dist/{chunk-IPYHTCFL.js.map → chunk-IUK7OJXZ.js.map} +1 -1
  35. package/dist/{chunk-2MXWEIMD.js → chunk-KKLCHLCZ.js} +12 -11
  36. package/dist/chunk-KKLCHLCZ.js.map +1 -0
  37. package/dist/{chunk-YWTOW7PZ.js → chunk-LHUWOA2U.js} +8 -8
  38. package/dist/{chunk-YWTOW7PZ.js.map → chunk-LHUWOA2U.js.map} +1 -1
  39. package/dist/{chunk-6N6J2DOE.js → chunk-LIZWCWED.js} +3 -3
  40. package/dist/{chunk-6N6J2DOE.js.map → chunk-LIZWCWED.js.map} +1 -1
  41. package/dist/{chunk-O7LS6OZR.js → chunk-LMCUGYHT.js} +3 -3
  42. package/dist/{chunk-O7LS6OZR.js.map → chunk-LMCUGYHT.js.map} +1 -1
  43. package/dist/{chunk-DHJB4UJD.js → chunk-N5M4PDBK.js} +4 -4
  44. package/dist/{chunk-DHJB4UJD.js.map → chunk-N5M4PDBK.js.map} +1 -1
  45. package/dist/{chunk-DA4QII2N.js → chunk-NLSJ6T7V.js} +4 -4
  46. package/dist/{chunk-DA4QII2N.js.map → chunk-NLSJ6T7V.js.map} +1 -1
  47. package/dist/{chunk-UT3TOV2Q.js → chunk-OVT2KZHY.js} +3 -3
  48. package/dist/{chunk-UT3TOV2Q.js.map → chunk-OVT2KZHY.js.map} +1 -1
  49. package/dist/{chunk-SVKN5ZHX.js → chunk-PEHFWGTT.js} +16 -13
  50. package/dist/chunk-PEHFWGTT.js.map +1 -0
  51. package/dist/{chunk-J44FJ7PH.js → chunk-PFZMB3US.js} +4 -4
  52. package/dist/{chunk-J44FJ7PH.js.map → chunk-PFZMB3US.js.map} +1 -1
  53. package/dist/{chunk-IRNF274I.js → chunk-PI7X5YFJ.js} +3 -3
  54. package/dist/{chunk-IRNF274I.js.map → chunk-PI7X5YFJ.js.map} +1 -1
  55. package/dist/{chunk-F2FSHVO5.js → chunk-QZ4N5LYG.js} +7 -7
  56. package/dist/{chunk-F2FSHVO5.js.map → chunk-QZ4N5LYG.js.map} +1 -1
  57. package/dist/{chunk-E5H3YWZV.js → chunk-SAXWCGWR.js} +3 -3
  58. package/dist/{chunk-E5H3YWZV.js.map → chunk-SAXWCGWR.js.map} +1 -1
  59. package/dist/{chunk-SWVUXEBT.js → chunk-SCXXJDKQ.js} +3 -3
  60. package/dist/{chunk-SWVUXEBT.js.map → chunk-SCXXJDKQ.js.map} +1 -1
  61. package/dist/{chunk-D3JYDAUZ.js → chunk-T44RW5DW.js} +4 -4
  62. package/dist/{chunk-D3JYDAUZ.js.map → chunk-T44RW5DW.js.map} +1 -1
  63. package/dist/{chunk-FB2G4LNH.js → chunk-UDCCOUWR.js} +5 -5
  64. package/dist/{chunk-FB2G4LNH.js.map → chunk-UDCCOUWR.js.map} +1 -1
  65. package/dist/{chunk-TCFB23JT.js → chunk-WERJ44ZN.js} +3 -3
  66. package/dist/{chunk-TCFB23JT.js.map → chunk-WERJ44ZN.js.map} +1 -1
  67. package/dist/{chunk-QNKD2SQM.js → chunk-X3YIHN2U.js} +5 -5
  68. package/dist/{chunk-QNKD2SQM.js.map → chunk-X3YIHN2U.js.map} +1 -1
  69. package/dist/{chunk-VD6PB3VA.js → chunk-X6DESK37.js} +12 -3
  70. package/dist/chunk-X6DESK37.js.map +1 -0
  71. package/dist/{chunk-7AQ4MN4M.js → chunk-XUFCI262.js} +4 -4
  72. package/dist/{chunk-7AQ4MN4M.js.map → chunk-XUFCI262.js.map} +1 -1
  73. package/dist/{chunk-47LEAR6G.js → chunk-Y2G47ARQ.js} +6 -6
  74. package/dist/{chunk-47LEAR6G.js.map → chunk-Y2G47ARQ.js.map} +1 -1
  75. package/dist/{chunk-F342ZT7O.js → chunk-ZVECQBGG.js} +13 -7
  76. package/dist/chunk-ZVECQBGG.js.map +1 -0
  77. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  78. package/dist/components/action-icon/index.js +1 -1
  79. package/dist/components/alert/index.js +1 -1
  80. package/dist/components/ambient-background/index.js +5 -3
  81. package/dist/components/ambient-background/index.js.map +1 -1
  82. package/dist/components/ambient-background/starfield.d.ts.map +1 -1
  83. package/dist/components/app-shell/index.js +4 -4
  84. package/dist/components/autocomplete/index.js +3 -3
  85. package/dist/components/avatar/index.js +2 -2
  86. package/dist/components/badge/badge.d.ts.map +1 -1
  87. package/dist/components/badge/index.js +1 -1
  88. package/dist/components/button/index.js +1 -1
  89. package/dist/components/button-multi-select/index.js +3 -3
  90. package/dist/components/button-select/index.js +3 -3
  91. package/dist/components/calendar/index.js +4 -4
  92. package/dist/components/calendar-heatmap/index.js +2 -2
  93. package/dist/components/camera/index.js +10 -10
  94. package/dist/components/card/card.d.ts.map +1 -1
  95. package/dist/components/card/index.js +1 -1
  96. package/dist/components/carousel/index.js +2 -2
  97. package/dist/components/checkbox/checkbox.d.ts +3 -2
  98. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  99. package/dist/components/checkbox/index.js +2 -2
  100. package/dist/components/choice-card-group/index.js +2 -2
  101. package/dist/components/choice-card-group/index.js.map +1 -1
  102. package/dist/components/clipboard/index.js +3 -3
  103. package/dist/components/code-block/code-block.d.ts +6 -3
  104. package/dist/components/code-block/code-block.d.ts.map +1 -1
  105. package/dist/components/code-block/highlighter.d.ts +16 -15
  106. package/dist/components/code-block/highlighter.d.ts.map +1 -1
  107. package/dist/components/code-block/index.d.ts +2 -1
  108. package/dist/components/code-block/index.d.ts.map +1 -1
  109. package/dist/components/code-block/index.js +81 -10
  110. package/dist/components/code-block/index.js.map +1 -1
  111. package/dist/components/code-block/languages.d.ts +61 -0
  112. package/dist/components/code-block/languages.d.ts.map +1 -0
  113. package/dist/components/code-block/static.d.ts +2 -1
  114. package/dist/components/code-block/static.d.ts.map +1 -1
  115. package/dist/components/code-block/static.js +99 -10
  116. package/dist/components/code-block/static.js.map +1 -1
  117. package/dist/components/combobox/index.js +3 -3
  118. package/dist/components/combobox-list/index.js +5 -5
  119. package/dist/components/compare/index.js +2 -2
  120. package/dist/components/data-table/index.js +30 -30
  121. package/dist/components/data-table/index.js.map +1 -1
  122. package/dist/components/date-picker/index.js +12 -12
  123. package/dist/components/download-button/index.js +2 -2
  124. package/dist/components/drawer/index.js +4 -4
  125. package/dist/components/field/field.d.ts +3 -0
  126. package/dist/components/field/field.d.ts.map +1 -1
  127. package/dist/components/field/index.js +1 -1
  128. package/dist/components/file-item/index.js +5 -5
  129. package/dist/components/file-preview/index.js +5 -5
  130. package/dist/components/file-trigger/index.js +2 -2
  131. package/dist/components/file-upload/index.js +6 -6
  132. package/dist/components/gallery/index.js +2 -2
  133. package/dist/components/geodesic/a11y.d.ts +3 -3
  134. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  135. package/dist/components/image-cropper/index.js +7 -7
  136. package/dist/components/indicator/index.js +1 -1
  137. package/dist/components/input/index.js +2 -2
  138. package/dist/components/kbd/index.js +3 -3
  139. package/dist/components/kbd/kbd.d.ts.map +1 -1
  140. package/dist/components/lightbox/index.js +7 -7
  141. package/dist/components/menu/index.js +2 -2
  142. package/dist/components/modal/index.js +4 -4
  143. package/dist/components/multi-combobox-list/index.js +5 -5
  144. package/dist/components/multi-select/index.js +6 -6
  145. package/dist/components/number-input/index.js +3 -3
  146. package/dist/components/overlays/index.js +6 -6
  147. package/dist/components/password-input/index.js +3 -3
  148. package/dist/components/photo-capture/index.js +14 -14
  149. package/dist/components/pills-input/index.js +5 -5
  150. package/dist/components/pin-input/index.js +2 -2
  151. package/dist/components/radio-group/index.js +1 -1
  152. package/dist/components/rating/index.js +1 -1
  153. package/dist/components/schedule/index.js +5 -5
  154. package/dist/components/segment-group/index.js +4 -4
  155. package/dist/components/select/index.js +4 -4
  156. package/dist/components/slider/index.js +2 -2
  157. package/dist/components/spotlight/index.js +9 -9
  158. package/dist/components/switch/index.js +14 -19
  159. package/dist/components/switch/index.js.map +1 -1
  160. package/dist/components/switch/switch.d.ts +1 -0
  161. package/dist/components/switch/switch.d.ts.map +1 -1
  162. package/dist/components/table/index.js +1 -1
  163. package/dist/components/table/table.d.ts.map +1 -1
  164. package/dist/components/tabs/index.js +3 -3
  165. package/dist/components/tags-input/index.js +5 -5
  166. package/dist/components/text-input/index.js +2 -2
  167. package/dist/components/textarea/index.js +2 -2
  168. package/dist/components/theme-icon/index.js +1 -1
  169. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  170. package/dist/components/time-input/index.js +7 -7
  171. package/dist/components/tree-multi-select/index.js +6 -6
  172. package/dist/components/tree-select/index.js +3 -3
  173. package/dist/index.js +4 -4
  174. package/dist/theme.css +28 -23
  175. package/package.json +1 -1
  176. package/src/components/action-icon/action-icon.tsx +3 -1
  177. package/src/components/ambient-background/starfield.tsx +4 -2
  178. package/src/components/badge/badge.tsx +11 -6
  179. package/src/components/button/button.tsx +1 -1
  180. package/src/components/card/card.tsx +10 -9
  181. package/src/components/checkbox/checkbox.test.tsx +17 -9
  182. package/src/components/checkbox/checkbox.tsx +26 -27
  183. package/src/components/choice-card-group/choice-card-group.tsx +3 -3
  184. package/src/components/code-block/code-block.tsx +7 -4
  185. package/src/components/code-block/highlighter.test.ts +79 -1
  186. package/src/components/code-block/highlighter.ts +76 -30
  187. package/src/components/code-block/index.ts +2 -0
  188. package/src/components/code-block/languages.ts +63 -0
  189. package/src/components/code-block/static.tsx +2 -1
  190. package/src/components/data-table/data-table-pagination.tsx +5 -5
  191. package/src/components/data-table/data-table-stack.tsx +2 -2
  192. package/src/components/field/field.tsx +14 -0
  193. package/src/components/kbd/kbd.tsx +2 -1
  194. package/src/components/switch/switch.test.tsx +15 -0
  195. package/src/components/switch/switch.tsx +27 -27
  196. package/src/components/table/table.test.tsx +1 -1
  197. package/src/components/table/table.tsx +14 -11
  198. package/src/components/theme-icon/theme-icon.tsx +46 -12
  199. package/src/theme.css +28 -23
  200. package/dist/chunk-2MXWEIMD.js.map +0 -1
  201. package/dist/chunk-6VYGK3Q3.js.map +0 -1
  202. package/dist/chunk-7CNDZZZ6.js +0 -95
  203. package/dist/chunk-7CNDZZZ6.js.map +0 -1
  204. package/dist/chunk-BE2LWUHY.js.map +0 -1
  205. package/dist/chunk-DT6LKNZF.js.map +0 -1
  206. package/dist/chunk-F342ZT7O.js.map +0 -1
  207. package/dist/chunk-SVKN5ZHX.js.map +0 -1
  208. package/dist/chunk-VD6PB3VA.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/slider/slider.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;AA8CA,IAAM,YAAA,GAAe,CAAC,CAAA,KACpB,CAAA,KAAM,MAAA,GAAY,MAAA,GAAY,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA,GAAI,CAAA,GAAI,CAAC,CAAC,CAAA;AAEzD,IAAM,YAAA,GAAe,IAAI,EAAA,EAAI;AAAA,EAC3B,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,QAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,SAAA;A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BACA,SAAA;AAAA,0BACA,wBAAA,CAAyB,KAAA;AAAA,0BACzB,UAAA,EAAY;AAAA,yBACd;AAAA,wBAEC,QAAA,EAAA,CAAA,CAAE;AAAA;AAAA;AACL,mBAAA;AAAA,kBAdG,CAAA,CAAE;AAAA,iBAiBV;AAAA;AAAA,aACH,EACF;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ","file":"chunk-UAYENYS2.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Slider as Ark } from \"@ark-ui/react/slider\"\nimport { cva } from \"class-variance-authority\"\nimport type { ComponentProps, ComponentPropsWithoutRef, FocusEvent, ReactNode, Ref } from \"react\"\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 { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\n\n/**\n * Slider — Range input on top of Ark UI's Slider state\n * machine. Ark owns keyboard nav, RTL flipping, drag math, and ARIA wiring;\n * this wrapper provides the styled parts and a flatter API.\n *\n * - Single or range. Pass a `number` for one thumb, or `[number, number]`\n * for a two-thumb range. The value shape drives everything: the callbacks\n * echo back the same shape, and a thumb (with its own label) is rendered\n * per value. The component is generic over the shape (`V`) so single-value\n * callers keep `number` types — no `number | number[]` leaking into their\n * handlers.\n * - `marks` paints filled dots on the track and an optional label below.\n * Dots between the thumbs (or up to the thumb, for a single value) read\n * as active.\n * - `label` / `description` / `error` / `required` come from the shared `Field`, like the rest\n * of the family: every thumb (`role=\"slider\"`) is named by `label` and described by\n * `description`, or by `error` once invalid.\n * - `thumbLabel` floats above each thumb; visible on hover/focus by default. Its function\n * form also becomes each thumb's `aria-valuetext`, so a screen reader hears \"40%\", not \"40\".\n * - Track/range/thumb parts can be overridden via `classNames`.\n *\n * Palette is delivered through the kit's `data-color` + slot-var system\n * (see `components.md` -> Color system). The root writes `data-color={color}`\n * and the range/thumb reference `--c-solid` — adding a new color in\n * `colors.css` works here for free, no slider edits needed.\n */\n\ntype SliderValue = number | number[]\n\n/** Wrap a scalar into Ark's array contract; pass arrays through untouched. */\nconst toValueArray = (v: SliderValue | undefined): number[] | undefined =>\n v === undefined ? undefined : Array.isArray(v) ? v : [v]\n\nconst marksWrapper = cva(\"\", {\n variants: {\n size: {\n xs: \"px-0.5\",\n sm: \"px-0.75\",\n md: \"px-1.25\",\n lg: \"px-1.5\",\n xl: \"px-1.5\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\nconst sliderTrack = cva(\n // `overflow-x-clip overflow-y-visible` keeps the Range's rounded ends\n // clipped (so the filled bar follows the track's pill shape) while\n // letting mark labels spill below the track without being cut off.\n [\n \"relative w-full overflow-x-clip overflow-y-visible rounded-full bg-black/3 dark:bg-white/4\",\n \"cursor-pointer disabled:cursor-not-allowed data-disabled:cursor-not-allowed\",\n // Red invalid state — Ark stamps `data-invalid` on the root, so the track\n // (a descendant) reads it via `group-data-[invalid]`. Figma has no Slider error\n // variant, so it follows Field's: a `border-error-solid` outline, no red fill.\n \"group-data-[invalid]/slider:ring-1 group-data-[invalid]/slider:ring-red-500\",\n ],\n {\n variants: {\n // Padding matches half the dot width per size: the marker wrapper\n // lives inside the track as `relative`, so it occupies the track's\n // content box (padding-inset). Dot centers land at the inset edges,\n // and `-translate-x-1/2` puts the dot's outer edge flush with the\n // track's visible end. No first/last special-casing needed.\n size: {\n xs: \"h-0.5\",\n sm: \"h-1\",\n md: \"h-1.5\",\n lg: \"h-2\",\n xl: \"h-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst sliderRange = cva(\n \"h-full bg-(--c-solid) data-disabled:bg-(--c-solid-disabled) rounded-full\",\n {\n variants: {\n size: {\n xs: \"\",\n sm: \"\",\n md: \"\",\n lg: \"\",\n xl: \"\",\n },\n },\n },\n)\n\nconst sliderThumb = cva(\n [\n \"block rounded-full border-2 bg-brand-50 dark:bg-brand-950 shadow-sm z-1\",\n \"border-(--c-solid)\",\n \"transition-transform\",\n \"cursor-pointer disabled:cursor-not-allowed data-disabled:cursor-not-allowed data-disabled:border-(--c-solid-disabled)\",\n focusStyles({ ring: \"palette\" }),\n \"data-dragging:scale-110\",\n ],\n {\n variants: {\n size: {\n xs: \"size-2.5 border-2\",\n sm: \"size-3 border-2\",\n md: \"size-4 border-3\",\n lg: \"size-5 border-4\",\n xl: \"size-6 border-4\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst sliderMark = cva(\n [\n \"absolute top-1/2 -translate-y-1/2\",\n \"before:rounded-full\",\n \"before:absolute before:top-full before:-translate-y-1/2 before:-translate-x-1/2\",\n \"before:bg-brand-900/10 dark:before:bg-white/16 state-under-or-at:before:bg-(--c-solid-hover)\",\n ],\n {\n variants: {\n size: {\n xs: \"before:size-px\",\n sm: \"before:size-0.5\",\n md: \"before:size-1\",\n lg: \"before:size-1.5\",\n xl: \"before:size-2\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n// Matches `sliderThumb`'s `size-*` variants above (border-box, so border\n// width doesn't add to the rendered box). Passed to Ark as a static\n// `thumbSize` so it skips its own runtime thumb measurement — that\n// measurement is lost (permanently, `thumbSize` collapses to 0) the first\n// time the value changes, which throws off the `thumbAlignment: \"contain\"`\n// edge-inset math used to position both the thumb and every mark.\nconst THUMB_DIAMETER_PX: Record<Size, number> = {\n xs: 10,\n sm: 12,\n md: 16,\n lg: 20,\n xl: 24,\n}\n\nexport type SliderSize = Size | null | undefined\n\ntype SliderMark = {\n value: number\n label?: ReactNode\n}\n\ntype SliderClassNames = {\n field?: string\n root?: string\n control?: string\n track?: string\n range?: string\n thumb?: string\n thumbLabel?: string\n mark?: string\n markGroup?: string\n markDot?: string\n markLabel?: string\n}\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\ntype ShowThumbLabel = boolean | \"hover\" | \"always\" | \"never\"\n\n/**\n * `V` is the value shape: `number` for a single thumb (the default), or\n * `number[]` (use `[number, number]`) for a two-thumb range. Inferred from\n * `value` / `defaultValue`, so callbacks echo back the same shape.\n */\nexport type SliderProps<V extends SliderValue = number> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n ForbidAsChild &\n Omit<\n ArkRootProps,\n | \"asChild\"\n | \"value\"\n | \"defaultValue\"\n | \"onValueChange\"\n | \"onValueChangeEnd\"\n | \"onChange\"\n | \"onBlur\"\n | \"ref\"\n | \"className\"\n > &\n WithTestId & {\n /** Controlled value. `number` for one thumb, `[number, number]` for a range. */\n value?: V\n /** Uncontrolled initial value. Its shape decides single vs. range. */\n defaultValue?: V\n /** Fires on every value change (drag, keyboard, click). */\n onChange?: (value: V) => void\n /** Fires once the interaction settles (mouseup / keyup). */\n onChangeEnd?: (value: V) => void\n /** Tick marks rendered on the track. */\n marks?: SliderMark[]\n /**\n * Floating bubble above each thumb. Pass a static node, a function that\n * receives a thumb's live value, or `null` to disable. A function returning\n * a string or number also sets each thumb's `aria-valuetext`. In an RSC tree\n * the function form must live in a `\"use client\"` module so the boundary\n * serializes it as a client reference.\n */\n thumbLabel?: ReactNode | ((value: number) => ReactNode) | null\n /**\n * When the `thumbLabel` bubble shows: `hover` (the default) on hover, focus\n * or drag; `true` / `always` all the time; `false` / `never` not at all.\n */\n showThumbLabel?: ShowThumbLabel\n /** @deprecated Renamed `showThumbLabel`, to match `thumbLabel`. */\n showLabel?: ShowThumbLabel\n size?: SliderSize\n color?: Color\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Forwarded to the slider root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLElement>) => void\n /** Lands on the first thumb (the `role=\"slider\"` element) for focus-on-error. */\n ref?: Ref<HTMLDivElement>\n className?: string\n classNames?: SliderClassNames\n }\n\n/** Ark's per-thumb `aria-label` / `aria-labelledby` arrays, as a range slider takes them. */\ntype ThumbNames = Pick<ArkRootProps, \"aria-label\" | \"aria-labelledby\">\n\n/**\n * One `role=\"slider\"` thumb, split out so it reads the `Field` context from *inside*\n * `FieldShell` — `Slider` itself renders that shell. Ark's Slider never reads a Field, so its\n * thumbs point `aria-labelledby` at their own never-rendered `Slider.Label`; this names each\n * thumb by the field's `label` instead and describes it by `description` / `error`. A caller's\n * own per-thumb `aria-label` / `aria-labelledby` (the way to tell a range's two thumbs apart)\n * still wins: Ark already puts it on the thumb, so the field's label is left out.\n */\nconst SliderThumb = ({\n index,\n names,\n ...thumbProps\n}: ComponentProps<typeof Ark.Thumb> & { names: ThumbNames }) => {\n const { \"aria-labelledby\": fieldLabel, ...described } = fieldA11yProps(useFieldContext())\n const ownName = names[\"aria-label\"]?.[index] ?? names[\"aria-labelledby\"]?.[index]\n return (\n <Ark.Thumb\n index={index}\n {...described}\n aria-labelledby={ownName == null ? fieldLabel : undefined}\n {...thumbProps}\n />\n )\n}\n\n/** A function bubble's text, as `aria-valuetext`; a node with no plain text falls back to the number. */\nconst toValueText =\n (format: (value: number) => ReactNode) =>\n ({ value }: { value: number }) => {\n const text = format(value)\n return typeof text === \"string\" || typeof text === \"number\" ? String(text) : String(value)\n }\n\nexport const Slider = <V extends SliderValue = number>({\n value,\n defaultValue,\n onChange,\n onChangeEnd,\n marks,\n label,\n thumbLabel,\n size,\n showLabel,\n showThumbLabel = showLabel ?? \"hover\",\n color,\n min = 0,\n max = 100,\n step,\n disabled,\n invalid,\n onBlur,\n ref,\n description,\n error,\n required,\n className,\n classNames,\n testId,\n asChild: _asChild,\n ...rest\n}: SliderProps<V>) => {\n const withThumbLabel =\n thumbLabel != null && showThumbLabel !== \"never\" && showThumbLabel !== false\n const renderThumbLabel = (val: number): ReactNode =>\n typeof thumbLabel === \"function\" ? thumbLabel(val) : thumbLabel\n const showMarks = marks !== null && marks !== undefined && marks.length > 0\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n // The emitted shape mirrors the controlled/default value: arrays stay\n // arrays (range), scalars stay scalars (single thumb).\n const isRange = Array.isArray(value ?? defaultValue)\n const emit = (next: number[]): V => (isRange ? next : (next[0] ?? 0)) as V\n\n const thumbDiameter = THUMB_DIAMETER_PX[size ?? \"md\"]\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size ?? \"md\"}\n className={classNames?.field}\n // One or two thumbs: nothing carries the label's `for` id; each thumb's `aria-labelledby` names it.\n composite\n >\n <Ark.Root\n value={toValueArray(value)}\n defaultValue={toValueArray(defaultValue)}\n onValueChange={onChange ? ({ value: v }) => onChange(emit(v)) : undefined}\n onValueChangeEnd={onChangeEnd ? ({ value: v }) => onChangeEnd(emit(v)) : undefined}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n onBlur={onBlur}\n thumbSize={{ width: thumbDiameter, height: thumbDiameter }}\n getAriaValueText={typeof thumbLabel === \"function\" ? toValueText(thumbLabel) : undefined}\n data-color={color}\n {...props({ \"data-invalid\": isInvalid, \"data-testid\": testId })}\n className={cn(\n \"group/slider relative flex w-full flex-col gap-2\",\n { \"mb-4\": showMarks },\n className,\n classNames?.root,\n )}\n {...rest}\n >\n <Ark.Control\n className={cn(\n \"relative flex w-full items-center py-2\",\n marksWrapper({ size }),\n classNames?.control,\n )}\n >\n <Ark.Track className={cn(sliderTrack({ size }), classNames?.track)}>\n <Ark.Range className={cn(sliderRange({ size }), classNames?.range)} />\n </Ark.Track>\n\n <Ark.Context>\n {(api) =>\n api.value.map((val, i) => (\n <SliderThumb\n // A thumb *is* its index: keyed by value, every step\n // remounted it and dropped keyboard focus after one key press.\n // biome-ignore lint/suspicious/noArrayIndexKey: the index is the thumb's identity\n key={i}\n index={i}\n names={{\n \"aria-label\": rest[\"aria-label\"],\n \"aria-labelledby\": rest[\"aria-labelledby\"],\n }}\n // The focusable element is the thumb (role=\"slider\"), so the\n // caller's `ref` lands on the first thumb for focus-on-error.\n ref={i === 0 ? ref : undefined}\n {...props({\n \"aria-invalid\": isInvalid,\n \"data-testid\": testId && `${testId}-thumb-${i}`,\n })}\n className={cn(sliderThumb({ size }), classNames?.thumb)}\n >\n <Ark.HiddenInput />\n {withThumbLabel && (\n <span\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute -top-7 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-md px-2 py-0.5 text-xs font-medium transition-opacity\",\n \"bg-brand-950 text-white dark:bg-white dark:text-brand-950\",\n showThumbLabel === \"hover\"\n ? \"opacity-0 group-hover/slider:opacity-100 group-focus-within/slider:opacity-100 group-data-dragging:opacity-100\"\n : \"opacity-100\",\n classNames?.thumbLabel,\n )}\n >\n {renderThumbLabel(val)}\n </span>\n )}\n </SliderThumb>\n ))\n }\n </Ark.Context>\n </Ark.Control>\n\n {showMarks && (\n <div className=\"absolute inset-0 h-full w-full select-none pointer-events-none \">\n <Ark.MarkerGroup\n className={cn(\n marksWrapper({ size }),\n \"w-full h-full relative\",\n classNames?.markGroup,\n )}\n >\n {marks.map((m) => (\n <Ark.Marker\n key={m.value}\n value={m.value}\n className={cn(sliderMark({ size }), classNames?.mark)}\n >\n {m.label !== undefined && (\n <span\n className={cn(\n \"absolute top-3/4 translate-y-3/4 -translate-x-1/2\",\n \"text-xs\",\n TYPOGRAPHY_SHADE_CLASSES.muted,\n classNames?.markLabel,\n )}\n >\n {m.label}\n </span>\n )}\n </Ark.Marker>\n ))}\n </Ark.MarkerGroup>\n </div>\n )}\n </Ark.Root>\n </FieldShell>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/slider/slider.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;AA8CA,IAAM,YAAA,GAAe,CAAC,CAAA,KACpB,CAAA,KAAM,MAAA,GAAY,MAAA,GAAY,KAAA,CAAM,OAAA,CA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AAAA,oBACT,SAAA,EAAW,GAAG,UAAA,CAAW,EAAE,MAAM,CAAA,EAAG,YAAY,IAAI,CAAA;AAAA,oBAEnD,QAAA,EAAA,CAAA,CAAE,UAAU,MAAA,oBACX,GAAA;AAAA,sBAAC,MAAA;AAAA,sBAAA;AAAA,wBACC,SAAA,EAAW,EAAA;AAAA,0BACT,mDAAA;AAAA,0BACA,SAAA;AAAA,0BACA,wBAAA,CAAyB,KAAA;AAAA,0BACzB,UAAA,EAAY;AAAA,yBACd;AAAA,wBAEC,QAAA,EAAA,CAAA,CAAE;AAAA;AAAA;AACL,mBAAA;AAAA,kBAdG,CAAA,CAAE;AAAA,iBAiBV;AAAA;AAAA,aACH,EACF;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ","file":"chunk-AKXALCUN.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Slider as Ark } from \"@ark-ui/react/slider\"\nimport { cva } from \"class-variance-authority\"\nimport type { ComponentProps, ComponentPropsWithoutRef, FocusEvent, ReactNode, Ref } from \"react\"\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 { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TYPOGRAPHY_SHADE_CLASSES } from \"../../lib/typography-size\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\n\n/**\n * Slider — Range input on top of Ark UI's Slider state\n * machine. Ark owns keyboard nav, RTL flipping, drag math, and ARIA wiring;\n * this wrapper provides the styled parts and a flatter API.\n *\n * - Single or range. Pass a `number` for one thumb, or `[number, number]`\n * for a two-thumb range. The value shape drives everything: the callbacks\n * echo back the same shape, and a thumb (with its own label) is rendered\n * per value. The component is generic over the shape (`V`) so single-value\n * callers keep `number` types — no `number | number[]` leaking into their\n * handlers.\n * - `marks` paints filled dots on the track and an optional label below.\n * Dots between the thumbs (or up to the thumb, for a single value) read\n * as active.\n * - `label` / `description` / `error` / `required` come from the shared `Field`, like the rest\n * of the family: every thumb (`role=\"slider\"`) is named by `label` and described by\n * `description`, or by `error` once invalid.\n * - `thumbLabel` floats above each thumb; visible on hover/focus by default. Its function\n * form also becomes each thumb's `aria-valuetext`, so a screen reader hears \"40%\", not \"40\".\n * - Track/range/thumb parts can be overridden via `classNames`.\n *\n * Palette is delivered through the kit's `data-color` + slot-var system\n * (see `components.md` -> Color system). The root writes `data-color={color}`\n * and the range/thumb reference `--c-solid` — adding a new color in\n * `colors.css` works here for free, no slider edits needed.\n */\n\ntype SliderValue = number | number[]\n\n/** Wrap a scalar into Ark's array contract; pass arrays through untouched. */\nconst toValueArray = (v: SliderValue | undefined): number[] | undefined =>\n v === undefined ? undefined : Array.isArray(v) ? v : [v]\n\nconst marksWrapper = cva(\"\", {\n variants: {\n size: {\n xs: \"px-0.5\",\n sm: \"px-0.75\",\n md: \"px-1.25\",\n lg: \"px-1.5\",\n xl: \"px-1.5\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\nconst sliderTrack = cva(\n // `overflow-x-clip overflow-y-visible` keeps the Range's rounded ends\n // clipped (so the filled bar follows the track's pill shape) while\n // letting mark labels spill below the track without being cut off.\n [\n \"relative w-full overflow-x-clip overflow-y-visible rounded-full bg-black/3 dark:bg-white/4\",\n \"cursor-pointer disabled:cursor-not-allowed data-disabled:cursor-not-allowed\",\n // Red invalid state — Ark stamps `data-invalid` on the root, so the track\n // (a descendant) reads it via `group-data-[invalid]`. Figma has no Slider error\n // variant, so it follows Field's: a `border-error-solid` outline, no red fill.\n \"group-data-[invalid]/slider:ring-1 group-data-[invalid]/slider:ring-red-500\",\n ],\n {\n variants: {\n // Padding matches half the dot width per size: the marker wrapper\n // lives inside the track as `relative`, so it occupies the track's\n // content box (padding-inset). Dot centers land at the inset edges,\n // and `-translate-x-1/2` puts the dot's outer edge flush with the\n // track's visible end. No first/last special-casing needed.\n size: {\n xs: \"h-0.5\",\n sm: \"h-1\",\n md: \"h-1.5\",\n lg: \"h-2\",\n xl: \"h-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst sliderRange = cva(\n \"h-full bg-(--c-solid) data-disabled:bg-(--c-solid-disabled) rounded-full\",\n {\n variants: {\n size: {\n xs: \"\",\n sm: \"\",\n md: \"\",\n lg: \"\",\n xl: \"\",\n },\n },\n },\n)\n\nconst sliderThumb = cva(\n [\n \"block rounded-full border-2 bg-brand-50 dark:bg-brand-950 shadow-sm z-1\",\n \"border-(--c-solid)\",\n \"transition-transform\",\n \"cursor-pointer disabled:cursor-not-allowed data-disabled:cursor-not-allowed data-disabled:border-(--c-solid-disabled)\",\n focusStyles({ ring: \"palette\" }),\n \"data-dragging:scale-110\",\n ],\n {\n variants: {\n size: {\n xs: \"size-2.5 border-2\",\n sm: \"size-3 border-2\",\n md: \"size-4 border-3\",\n lg: \"size-5 border-4\",\n xl: \"size-6 border-4\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst sliderMark = cva(\n [\n \"absolute top-1/2 -translate-y-1/2\",\n \"before:rounded-full\",\n \"before:absolute before:top-full before:-translate-y-1/2 before:-translate-x-1/2\",\n \"before:bg-brand-900/10 dark:before:bg-white/16 state-under-or-at:before:bg-(--c-solid-hover)\",\n ],\n {\n variants: {\n size: {\n xs: \"before:size-px\",\n sm: \"before:size-0.5\",\n md: \"before:size-1\",\n lg: \"before:size-1.5\",\n xl: \"before:size-2\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n// Matches `sliderThumb`'s `size-*` variants above (border-box, so border\n// width doesn't add to the rendered box). Passed to Ark as a static\n// `thumbSize` so it skips its own runtime thumb measurement — that\n// measurement is lost (permanently, `thumbSize` collapses to 0) the first\n// time the value changes, which throws off the `thumbAlignment: \"contain\"`\n// edge-inset math used to position both the thumb and every mark.\nconst THUMB_DIAMETER_PX: Record<Size, number> = {\n xs: 10,\n sm: 12,\n md: 16,\n lg: 20,\n xl: 24,\n}\n\nexport type SliderSize = Size | null | undefined\n\ntype SliderMark = {\n value: number\n label?: ReactNode\n}\n\ntype SliderClassNames = {\n field?: string\n root?: string\n control?: string\n track?: string\n range?: string\n thumb?: string\n thumbLabel?: string\n mark?: string\n markGroup?: string\n markDot?: string\n markLabel?: string\n}\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\ntype ShowThumbLabel = boolean | \"hover\" | \"always\" | \"never\"\n\n/**\n * `V` is the value shape: `number` for a single thumb (the default), or\n * `number[]` (use `[number, number]`) for a two-thumb range. Inferred from\n * `value` / `defaultValue`, so callbacks echo back the same shape.\n */\nexport type SliderProps<V extends SliderValue = number> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n ForbidAsChild &\n Omit<\n ArkRootProps,\n | \"asChild\"\n | \"value\"\n | \"defaultValue\"\n | \"onValueChange\"\n | \"onValueChangeEnd\"\n | \"onChange\"\n | \"onBlur\"\n | \"ref\"\n | \"className\"\n > &\n WithTestId & {\n /** Controlled value. `number` for one thumb, `[number, number]` for a range. */\n value?: V\n /** Uncontrolled initial value. Its shape decides single vs. range. */\n defaultValue?: V\n /** Fires on every value change (drag, keyboard, click). */\n onChange?: (value: V) => void\n /** Fires once the interaction settles (mouseup / keyup). */\n onChangeEnd?: (value: V) => void\n /** Tick marks rendered on the track. */\n marks?: SliderMark[]\n /**\n * Floating bubble above each thumb. Pass a static node, a function that\n * receives a thumb's live value, or `null` to disable. A function returning\n * a string or number also sets each thumb's `aria-valuetext`. In an RSC tree\n * the function form must live in a `\"use client\"` module so the boundary\n * serializes it as a client reference.\n */\n thumbLabel?: ReactNode | ((value: number) => ReactNode) | null\n /**\n * When the `thumbLabel` bubble shows: `hover` (the default) on hover, focus\n * or drag; `true` / `always` all the time; `false` / `never` not at all.\n */\n showThumbLabel?: ShowThumbLabel\n /** @deprecated Renamed `showThumbLabel`, to match `thumbLabel`. */\n showLabel?: ShowThumbLabel\n size?: SliderSize\n color?: Color\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Forwarded to the slider root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLElement>) => void\n /** Lands on the first thumb (the `role=\"slider\"` element) for focus-on-error. */\n ref?: Ref<HTMLDivElement>\n className?: string\n classNames?: SliderClassNames\n }\n\n/** Ark's per-thumb `aria-label` / `aria-labelledby` arrays, as a range slider takes them. */\ntype ThumbNames = Pick<ArkRootProps, \"aria-label\" | \"aria-labelledby\">\n\n/**\n * One `role=\"slider\"` thumb, split out so it reads the `Field` context from *inside*\n * `FieldShell` — `Slider` itself renders that shell. Ark's Slider never reads a Field, so its\n * thumbs point `aria-labelledby` at their own never-rendered `Slider.Label`; this names each\n * thumb by the field's `label` instead and describes it by `description` / `error`. A caller's\n * own per-thumb `aria-label` / `aria-labelledby` (the way to tell a range's two thumbs apart)\n * still wins: Ark already puts it on the thumb, so the field's label is left out.\n */\nconst SliderThumb = ({\n index,\n names,\n ...thumbProps\n}: ComponentProps<typeof Ark.Thumb> & { names: ThumbNames }) => {\n const { \"aria-labelledby\": fieldLabel, ...described } = fieldA11yProps(useFieldContext())\n const ownName = names[\"aria-label\"]?.[index] ?? names[\"aria-labelledby\"]?.[index]\n return (\n <Ark.Thumb\n index={index}\n {...described}\n aria-labelledby={ownName == null ? fieldLabel : undefined}\n {...thumbProps}\n />\n )\n}\n\n/** A function bubble's text, as `aria-valuetext`; a node with no plain text falls back to the number. */\nconst toValueText =\n (format: (value: number) => ReactNode) =>\n ({ value }: { value: number }) => {\n const text = format(value)\n return typeof text === \"string\" || typeof text === \"number\" ? String(text) : String(value)\n }\n\nexport const Slider = <V extends SliderValue = number>({\n value,\n defaultValue,\n onChange,\n onChangeEnd,\n marks,\n label,\n thumbLabel,\n size,\n showLabel,\n showThumbLabel = showLabel ?? \"hover\",\n color,\n min = 0,\n max = 100,\n step,\n disabled,\n invalid,\n onBlur,\n ref,\n description,\n error,\n required,\n className,\n classNames,\n testId,\n asChild: _asChild,\n ...rest\n}: SliderProps<V>) => {\n const withThumbLabel =\n thumbLabel != null && showThumbLabel !== \"never\" && showThumbLabel !== false\n const renderThumbLabel = (val: number): ReactNode =>\n typeof thumbLabel === \"function\" ? thumbLabel(val) : thumbLabel\n const showMarks = marks !== null && marks !== undefined && marks.length > 0\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n // The emitted shape mirrors the controlled/default value: arrays stay\n // arrays (range), scalars stay scalars (single thumb).\n const isRange = Array.isArray(value ?? defaultValue)\n const emit = (next: number[]): V => (isRange ? next : (next[0] ?? 0)) as V\n\n const thumbDiameter = THUMB_DIAMETER_PX[size ?? \"md\"]\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size ?? \"md\"}\n className={classNames?.field}\n // One or two thumbs: nothing carries the label's `for` id; each thumb's `aria-labelledby` names it.\n composite\n >\n <Ark.Root\n value={toValueArray(value)}\n defaultValue={toValueArray(defaultValue)}\n onValueChange={onChange ? ({ value: v }) => onChange(emit(v)) : undefined}\n onValueChangeEnd={onChangeEnd ? ({ value: v }) => onChangeEnd(emit(v)) : undefined}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n onBlur={onBlur}\n thumbSize={{ width: thumbDiameter, height: thumbDiameter }}\n getAriaValueText={typeof thumbLabel === \"function\" ? toValueText(thumbLabel) : undefined}\n data-color={color}\n {...props({ \"data-invalid\": isInvalid, \"data-testid\": testId })}\n className={cn(\n \"group/slider relative flex w-full flex-col gap-2\",\n { \"mb-4\": showMarks },\n className,\n classNames?.root,\n )}\n {...rest}\n >\n <Ark.Control\n className={cn(\n \"relative flex w-full items-center py-2\",\n marksWrapper({ size }),\n classNames?.control,\n )}\n >\n <Ark.Track className={cn(sliderTrack({ size }), classNames?.track)}>\n <Ark.Range className={cn(sliderRange({ size }), classNames?.range)} />\n </Ark.Track>\n\n <Ark.Context>\n {(api) =>\n api.value.map((val, i) => (\n <SliderThumb\n // A thumb *is* its index: keyed by value, every step\n // remounted it and dropped keyboard focus after one key press.\n // biome-ignore lint/suspicious/noArrayIndexKey: the index is the thumb's identity\n key={i}\n index={i}\n names={{\n \"aria-label\": rest[\"aria-label\"],\n \"aria-labelledby\": rest[\"aria-labelledby\"],\n }}\n // The focusable element is the thumb (role=\"slider\"), so the\n // caller's `ref` lands on the first thumb for focus-on-error.\n ref={i === 0 ? ref : undefined}\n {...props({\n \"aria-invalid\": isInvalid,\n \"data-testid\": testId && `${testId}-thumb-${i}`,\n })}\n className={cn(sliderThumb({ size }), classNames?.thumb)}\n >\n <Ark.HiddenInput />\n {withThumbLabel && (\n <span\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute -top-7 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-md px-2 py-0.5 text-xs font-medium transition-opacity\",\n \"bg-brand-950 text-white dark:bg-white dark:text-brand-950\",\n showThumbLabel === \"hover\"\n ? \"opacity-0 group-hover/slider:opacity-100 group-focus-within/slider:opacity-100 group-data-dragging:opacity-100\"\n : \"opacity-100\",\n classNames?.thumbLabel,\n )}\n >\n {renderThumbLabel(val)}\n </span>\n )}\n </SliderThumb>\n ))\n }\n </Ark.Context>\n </Ark.Control>\n\n {showMarks && (\n <div className=\"absolute inset-0 h-full w-full select-none pointer-events-none \">\n <Ark.MarkerGroup\n className={cn(\n marksWrapper({ size }),\n \"w-full h-full relative\",\n classNames?.markGroup,\n )}\n >\n {marks.map((m) => (\n <Ark.Marker\n key={m.value}\n value={m.value}\n className={cn(sliderMark({ size }), classNames?.mark)}\n >\n {m.label !== undefined && (\n <span\n className={cn(\n \"absolute top-3/4 translate-y-3/4 -translate-x-1/2\",\n \"text-xs\",\n TYPOGRAPHY_SHADE_CLASSES.muted,\n classNames?.markLabel,\n )}\n >\n {m.label}\n </span>\n )}\n </Ark.Marker>\n ))}\n </Ark.MarkerGroup>\n </div>\n )}\n </Ark.Root>\n </FieldShell>\n )\n}\n"]}
@@ -33,8 +33,10 @@ var actionIconVariants = cva(
33
33
  "bg-(--c-soft) text-(--c-text) border-(--c-soft-hover)",
34
34
  "not-data-loading:hover:bg-(--c-soft-hover) not-data-loading:hover:border-(--c-solid)"
35
35
  ],
36
+ // Button's outline edge (the colour at 35%), so the two read as one
37
+ // stroke weight side by side in a toolbar.
36
38
  outline: [
37
- "bg-transparent text-(--c-text) border-(--c-solid)",
39
+ "bg-transparent text-(--c-text) border-(--c-solid)/35",
38
40
  "not-data-loading:hover:bg-(--c-soft)"
39
41
  ],
40
42
  subtle: ["bg-transparent text-(--c-text)", "not-data-loading:hover:bg-(--c-soft)"],
@@ -111,5 +113,5 @@ var ActionIcon = ({
111
113
  };
112
114
 
113
115
  export { ActionIcon };
114
- //# sourceMappingURL=chunk-BE2LWUHY.js.map
115
- //# sourceMappingURL=chunk-BE2LWUHY.js.map
116
+ //# sourceMappingURL=chunk-BMEJBY6H.js.map
117
+ //# sourceMappingURL=chunk-BMEJBY6H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/action-icon/action-icon.tsx"],"names":[],"mappings":";;;;;;;;;AAuCA,IAAM,kBAAA,GAAqB,GAAA;AAAA,EACzB;AAAA,IACE,yCAAA;AAAA,IACA,oCAAA;AAAA,IACA,qCAAA;AAAA,IACA,cAAA;AAAA,IACA,+CAAA;AAAA,IACA,0BAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ,mEAAA;AAAA,IACA,4DAAA;AAAA,IACA,uCAAA;AAAA,IACA,sDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ;AAAA,UACN,oCAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,KAAA,EAAO;AAAA,UACL,uDAAA;AAAA,UACA;AAAA,SACF;AAAA;AAAA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,GAAA,CAAI,MAAA;AAAA,IAAJ;AAAA,MACC,OAAA;AAAA,MACA,IAAA,EAAM,OAAA,GAAU,IAAA,GAAQ,IAAA,IAAQ,QAAA;AAAA,MAChC,QAAA,EAAU,gBAAA;AAAA,MACV,YAAA,EAAY,KAAA;AAAA,MACZ,gBAAc,OAAA,IAAW,SAAA;AAAA,MACzB,SAAA,EAAW,GAAG,kBAAA,CAAmB,EAAE,SAAS,IAAA,EAAM,MAAA,EAAQ,CAAA,EAAG,SAAS,CAAA;AAAA,MACtE,OAAA,EAAS,eAAA;AAAA,MACR,GAAG,KAAA,CAAM;AAAA,QACR,WAAA,EAAa,OAAA;AAAA,QACb,eAAA,EAAiB,gBAAA;AAAA,QACjB,cAAA,EAAgB,OAAA;AAAA,QAChB,aAAA,EAAe;AAAA,OAChB,CAAA;AAAA,MACA,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA,OAAA,IAAW,UACV,kBAAA,CAAmB,QAAA,EAAU,sBAAM,GAAA,CAAC,OAAA,EAAA,EAAQ,KAAA,EAAO,IAAA,EAAM,CAAA,EAAI;AAAA,QAC3D,OAAA,EAAS;AAAA,OACV,CAAA,GACC,OAAA,uBACD,OAAA,EAAA,EAAQ,KAAA,EAAO,MAAM,CAAA,GAEtB;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-BMEJBY6H.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { MouseEvent } from \"react\"\nimport { withAsChildContent } 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 { Spinner } from \"../spinner/spinner\"\n\n/**\n * ActionIcon — square, icon-only sibling of `Button`.\n *\n * Same (variant × color) model as `Button`:\n * - `variant` picks the shape (filled / light / outline / subtle / default)\n * - `color` picks the palette (brand / gray / red / …)\n * - Color is delivered via `data-color` + the slot vars in `colors.css`,\n * so dark mode shade-shifts happen at the CSS layer.\n *\n * What's specific to ActionIcon:\n * - Forced 1:1 aspect ratio.\n * - Own `radius` scale (incl. `full` for circular FABs / like-buttons).\n * - Wider size scale (xs..xl) than Button — toolbar density matters here.\n *\n * The accessible name MUST come from `aria-label` (or `aria-labelledby`); the\n * icon children are decoration.\n *\n * `asChild` renders the single child with ActionIcon's styling. Ark's\n * factory clones exactly one element, so `loading`'s spinner replaces\n * *that* element's own children (`withAsChildContent`, `lib/as-child.ts`)\n * rather than the element itself. The `onClick` guard (`preventWhileLoading`)\n * goes on the same clone, since `disabled` doesn't do anything on an\n * arbitrary `asChild` element (e.g. an `<a>`) — same reason the `opacity-50`\n * dimming and `pointer-events-none` blocking are keyed off `data-loading`\n * rather than `:disabled` (see `Button`'s note on this).\n */\nconst actionIconVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"aspect-square shrink-0 select-none\",\n \"font-medium uppercase tracking-wide\",\n \"no-underline\",\n \"rounded-action-icon border border-transparent\",\n \"transition-colors-radius\",\n focusStyles(),\n \"disabled:not-data-loading:pointer-events-none disabled:opacity-50\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"not-data-loading:hover:cursor-pointer\",\n \"data-loading:cursor-progress data-loading:opacity-50\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n ],\n {\n variants: {\n variant: {\n filled: [\n \"bg-(--c-solid) text-(--c-on-solid)\",\n \"not-data-loading:hover:bg-(--c-solid-hover)\",\n ],\n light: [\n \"bg-(--c-soft) text-(--c-text) border-(--c-soft-hover)\",\n \"not-data-loading:hover:bg-(--c-soft-hover) not-data-loading:hover:border-(--c-solid)\",\n ],\n // Button's outline edge (the colour at 35%), so the two read as one\n // stroke weight side by side in a toolbar.\n outline: [\n \"bg-transparent text-(--c-text) border-(--c-solid)/35\",\n \"not-data-loading:hover:bg-(--c-soft)\",\n ],\n subtle: [\"bg-transparent text-(--c-text)\", \"not-data-loading:hover:bg-(--c-soft)\"],\n default: [\n \"bg-brand-950 text-white border-brand-800 not-data-loading:hover:bg-brand-800\",\n \"dark:bg-white dark:text-brand-950 dark:border-white/80 dark:not-data-loading:hover:bg-white/80\",\n ],\n },\n size: {\n xs: \"h-7 text-xs [&_svg]:size-5\",\n sm: \"h-8 text-sm [&_svg]:size-5.5\",\n md: \"h-9 text-md [&_svg]:size-6\",\n lg: \"h-10 text-lg [&_svg]:size-7\",\n xl: \"h-12 text-xl [&_svg]:size-8\",\n },\n radius: {\n xs: \"rounded-xs\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n)\n\nexport type ActionIconVariant = NonNullable<VariantProps<typeof actionIconVariants>[\"variant\"]>\nexport type ActionIconSize = NonNullable<VariantProps<typeof actionIconVariants>[\"size\"]>\nexport type ActionIconRadius = NonNullable<VariantProps<typeof actionIconVariants>[\"radius\"]>\n\nexport type ActionIconProps = Omit<HTMLArkProps<\"button\">, \"color\"> &\n VariantProps<typeof actionIconVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /**\n * Replace the icon with a spinner, mark the element as busy, and suppress\n * pointer interactions. Mirrors `Button`'s `loading`.\n */\n loading?: boolean\n }\n\n/** Mirrors `Button`'s `preventWhileLoading` — see the note there. */\nconst preventWhileLoading = (event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n}\n\nexport const ActionIcon = ({\n className,\n variant,\n size,\n radius,\n color,\n loading = false,\n children,\n disabled,\n type,\n asChild,\n testId,\n onClick,\n ...rest\n}: ActionIconProps) => {\n const resolvedDisabled = disabled || loading\n const resolvedOnClick = loading ? preventWhileLoading : onClick\n\n return (\n <ark.button\n asChild={asChild}\n type={asChild ? type : (type ?? \"button\")}\n disabled={resolvedDisabled}\n data-color={color}\n data-variant={variant ?? \"default\"}\n className={cn(actionIconVariants({ variant, size, radius }), className)}\n onClick={resolvedOnClick}\n {...props({\n \"aria-busy\": loading,\n \"aria-disabled\": resolvedDisabled,\n \"data-loading\": loading,\n \"data-testid\": testId,\n })}\n {...rest}\n >\n {asChild && loading ? (\n withAsChildContent(children, () => <Spinner label={null} />, {\n onClick: preventWhileLoading,\n })\n ) : loading ? (\n <Spinner label={null} />\n ) : (\n children\n )}\n </ark.button>\n )\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { calendarValueToDate, dateToArkValue, fromArkValues, toArkValues } from './chunk-ZB5VMGKB.js';
2
- import { useTimeZone } from './chunk-IPYHTCFL.js';
3
- import { ActionIcon } from './chunk-BE2LWUHY.js';
4
- import { warnRenamedProp } from './chunk-6N6J2DOE.js';
2
+ import { useTimeZone } from './chunk-IUK7OJXZ.js';
3
+ import { ActionIcon } from './chunk-BMEJBY6H.js';
4
+ import { warnRenamedProp } from './chunk-LIZWCWED.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-MXAACRWE.js.map
426
- //# sourceMappingURL=chunk-MXAACRWE.js.map
425
+ //# sourceMappingURL=chunk-E52Z2FKU.js.map
426
+ //# sourceMappingURL=chunk-E52Z2FKU.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/calendar/calendar-body.tsx","../src/components/calendar/calendar-zone-sync.tsx","../src/components/calendar/calendar.tsx"],"names":["Ark","useRef","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;AA8CO,IAAM,aAAA,G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AAA;AAAA,MACA,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,sBAAA,EAAwB,SAAA,EAAW,YAAY,IAAI,CAAA;AAAA,MAChE,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAanC,QAAA,EAAA;AAAA,wBAAAG,GAAAA;AAAA,UAAC,gBAAA;AAAA,UAAA;AAAA,YACC,QAAA,EAAU,gBAAA;AAAA,YACV,YAAY,KAAA,KAAU,MAAA;AAAA,YACtB,UAAA,EAAY;AAAA;AAAA,SACd;AAAA,wBACAA,GAAAA,CAACH,UAAAA,CAAI,OAAA,EAAJ,EACC,QAAA,kBAAAG,GAAAA;AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YACC,WAAA;AAAA,YACA,eAAA;AAAA,YACA,SAAA,EAAW,cAAc,CAAC,IAAA,EAAM,QAAQ,SAAA,CAAU,IAAA,EAAM,QAAA,CAAS,GAAG,CAAC,CAAA,CAAA;AAAA,YACrE,IAAA;AAAA,YACA,QAAA,EAAU,gBAAA;AAAA,YACV,UAAA;AAAA,YACA;AAAA;AAAA,SACF,EACF;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-MXAACRWE.js","sourcesContent":["import { DatePicker as Ark } from \"@ark-ui/react/date-picker\"\nimport { cva } from \"class-variance-authority\"\nimport type { ReactNode } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { cn } from \"../../lib/cn\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { ActionIcon } from \"../action-icon/action-icon\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../popover/icons\"\n\n/**\n * CalendarBody — the shared grid module behind both `Calendar` (inline) and, later,\n * `DatePicker` (popover): the RFC §3 \"one implementation, not two\" module. It renders only the\n * grid anatomy (`View` / `ViewControl` / nav triggers / `Table*` / `MonthSelect` / `YearSelect`)\n * — deliberately **not** `Control` / `Content` / `Positioner` / `Trigger` / `ClearTrigger`, the\n * popover-only chrome that belongs to `DatePicker`, not here.\n *\n * Every part below self-connects to the nearest ancestor `Ark.Root` via Ark's own React\n * context, so this module needs no `api` prop threaded in — both `Calendar` and `DatePicker`\n * just mount it as a plain child inside their own differently-configured `Ark.Root`.\n *\n * Not barrel-exported (no export from `calendar/index.ts`) — `DatePicker` reaches it directly\n * via `import { CalendarBody } from \"../calendar/calendar-body\"`, the established cross-folder\n * pattern for a shared internal part (`multi-select.tsx` → `../combobox/combobox`,\n * `drawer.tsx` → `../action-icon/action-icon`).\n */\n\nexport type CalendarBodyClassNames = {\n /** The prev/label/next navigation row. */\n header?: string\n /** Each rendered `<table>` (one per visible month in the day view). */\n table?: string\n /** Each day cell's clickable trigger. */\n day?: string\n}\n\nexport type CalendarIconSlot = \"prev\" | \"next\"\nexport type CalendarIcons = IconMap<CalendarIconSlot>\n\n/** The default icons. The glyphs are physical; prev sits on the inline-start\n * edge, which is the right one under RTL, so both chevrons mirror there to\n * keep pointing outward. A consumer's icon is drawn as given. */\nexport const DEFAULT_ICONS: Record<CalendarIconSlot, ReactNode> = {\n prev: <ChevronLeftIcon className=\"rtl:-scale-x-100\" />,\n next: <ChevronRightIcon className=\"rtl:-scale-x-100\" />,\n}\n\nexport type CalendarBodyProps = {\n /** Months shown side by side in the day view. */\n numOfMonths?: number\n withWeekNumbers?: boolean\n /** Per-day decoration slot (RFC §9's \"event dot\"). Receives a native `Date` — converted from\n * Ark's `DateValue` at the point of the call, via the same `timeZone` the root was configured\n * with — and the day's live selection state. */\n renderDay?: (date: Date, ctx: { isUnavailable: boolean; isSelected: boolean }) => ReactNode\n size?: Size\n /** The time zone the nearest `Ark.Root` was configured with. Required (not read from Ark's\n * own api, which exposes no public `timeZone` getter) so `renderDay`'s Date conversion uses\n * the exact same boundary `Calendar`/`DatePicker` used to build the root's own value —\n * see `lib/date-value.ts`'s module doc on why this one conversion point matters. */\n timeZone: string\n classNames?: CalendarBodyClassNames\n /** Replaces the prev/next icons. Drawn as given, never restroked or mirrored. */\n icons?: CalendarIcons\n}\n\nconst dayCellTrigger = cva(\n [\n \"relative flex size-full items-center justify-center rounded-xs\",\n \"cursor-pointer select-none tabular-nums transition-colors-radius\",\n \"hover:bg-brand-950/20 dark:hover:bg-white/20\",\n \"focus-visible:z-10\",\n focusStyles({ offset: false }),\n \"data-today:font-semibold data-today:text-brand-500\",\n // `!` (important) on bg/text: a day can be `data-today` *and* `data-selected` at once (e.g.\n // the default `new Date()` value), or a range endpoint is simultaneously `data-selected` *and*\n // `data-in-range` (the closed interval includes its own ends) — without `!`, these rules fight\n // over the same `background-color`/`color` and Tailwind's variant ordering (not this class\n // list's order) can win the wrong one, e.g. leaving the selected cell's text the same color\n // as its own solid-fill background, invisible. `data-selected` — the solid highlight — always\n // wins over both.\n \"data-selected:bg-brand-950! dark:data-selected:bg-white! data-selected:text-(--c-on-solid)! data-selected:font-semibold data-selected:hover:bg-brand-800! dark:data-selected:hover:bg-white/80!\",\n \"data-in-range:rounded-none data-in-range:bg-brand-950/10 dark:data-in-range:bg-white/10\",\n // Pill-cap rounding, split into two independently-true conditions rather than reacting to\n // `data-range-start`/`data-range-end` alone: a lone click (before any second day exists)\n // still carries `data-range-start`, and capping on that alone made the first pick look like\n // an already-established range extending rightward.\n //\n // 1. A genuinely *committed* range exists — `data-range-committed` is set from\n // `api.value.length === 2` in JS, not from the DOM. An earlier version checked whether the\n // *other* endpoint's `data-range-start`/`data-range-end` was present anywhere among the\n // visible months instead — that broke as soon as only one endpoint's month was in view\n // (e.g. the range was set, then the calendar paged away from one end): the other endpoint\n // was never rendered at all, so its attribute could never be found, and the cap silently\n // stopped applying to the *visible* endpoint too, even though the range was still fully\n // committed. `api.value` reflects the committed selection regardless of what's currently\n // paged into view, so this doesn't have that failure mode.\n // 2. A genuine *live hover preview* toward a different day — self-contained on this cell's\n // own attributes, no group lookup needed: `hoveredRangeValue` is `[start, hoveredValue]`\n // sorted chronologically, so the anchor cell gets exactly one of `data-hover-range-start` /\n // `data-hover-range-end` when truly hovering elsewhere (direction decides which), but\n // *both* simultaneously when the pointer is merely resting on the same cell it just\n // clicked (a zero-width hover range) — requiring the other one be *absent* rules out that\n // degenerate, \"changes before you've moved anywhere\" case.\n \"data-range-start:data-range-committed:rounded-s-xs\",\n \"data-range-end:data-range-committed:rounded-e-xs\",\n \"data-hover-range-start:not-data-hover-range-end:rounded-s-xs\",\n \"data-hover-range-end:not-data-hover-range-start:rounded-e-xs\",\n // The degenerate case above (pointer resting on the just-clicked day, `data-hover-range-start`\n // and `data-hover-range-end` both present on this same cell) still falls into `data-in-range`\n // (a zero-width range trivially contains itself), which would otherwise render it\n // `rounded-none` — sharp corners, reading as broken rather than \"just this one day, nothing\n // decided yet.\" Round it fully instead, `!` to beat that `data-in-range:rounded-none`\n // regardless of Tailwind's variant ordering.\n \"data-hover-range-start:data-hover-range-end:rounded-xs!\",\n \"data-outside-range:text-brand-900/40 dark:data-outside-range:text-white/35\",\n \"data-in-range:data-outside-range:text-brand-900/70 dark:data-in-range:data-outside-range:text-white/50\",\n \"data-unavailable:pointer-events-none data-unavailable:text-brand-900/20 data-unavailable:line-through dark:data-unavailable:text-white/16\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: {\n xs: \"size-7 text-xs\",\n sm: \"size-8 text-xs\",\n md: \"size-9 text-sm\",\n lg: \"size-10 text-base\",\n xl: \"size-11 text-base\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** Day-cell pixel size per `size`, matching `dayCellTrigger`'s `size-*` variants (`size-7`..\n * `size-11`) — the day view's own total width. The month/year grids below are plain `<table>`s\n * that would otherwise size to their own (longer) text content instead, so at `numOfMonths ===\n * 1` a month grid comes out *wider* than the day view (overflowing a fixed-width ancestor, e.g.\n * `DatePicker`'s popover column, which is sized off this same geometry via `calendarGridWidth`)\n * and a year grid comes out *narrower* (leaving unfilled space instead of stretching to match).\n * Pinning both to this exact width — `table-fixed` divides it evenly across columns — keeps\n * every view the same footprint. */\nconst DAY_CELL_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 44 }\n/** Gap between adjacent months in the day view (`gap-6`). */\nconst MONTH_GAP = 24\n\nexport const calendarGridWidth = (size: Size, numOfMonths: number): number =>\n DAY_CELL_SIZE[size] * 7 * numOfMonths + MONTH_GAP * (numOfMonths - 1)\n\nconst gridCellTrigger = cva(\n [\n \"flex w-full items-center justify-center truncate rounded-sm px-2 py-2.5\",\n \"cursor-pointer transition-colors\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"data-selected:bg-(--c-solid) data-selected:text-(--c-on-solid) data-selected:hover:bg-(--c-solid-hover)\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: { xs: \"text-xs\", sm: \"text-xs\", md: \"text-sm\", lg: \"text-base\", xl: \"text-base\" },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst weekdayHeader = cn(\"pb-1 text-center text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\n\nconst weekNumberCell = cn(\n \"p-1 align-top text-center text-xs font-medium h-full\",\n TEXT_COLOR_CLASSES.muted,\n)\n\n/** A prev/next trigger, as the single element Ark's trigger clones under\n * `asChild`. It sizes the icon (through `ActionIcon`) but never strokes or\n * mirrors it. */\nconst navIcon = (icon: ReactNode, size: Size | undefined, className?: string) => (\n <ActionIcon variant=\"subtle\" color=\"neutral\" size={size} className={className}>\n {icon}\n </ActionIcon>\n)\n\n/** `ActionIcon`'s own rendered height per `size` (its `h-7`..`h-12` variants) — the day view's\n * nav row is pinned to this so the prev/next icons and the view-trigger control are the same\n * height, instead of the icons (overlaid on the control, see below) poking out top and bottom of\n * a shorter, text-sized row. */\nconst NAV_ICON_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 48 }\n\nexport const CalendarBody = ({\n numOfMonths = 1,\n withWeekNumbers,\n renderDay,\n size = \"md\",\n timeZone,\n classNames,\n icons,\n}: CalendarBodyProps) => (\n <Ark.Context>\n {(api) => {\n const { prev, next } = mergeIcons(DEFAULT_ICONS, icons)\n const nav = (\n <Ark.ViewControl\n className={cn(\"mb-2 flex items-stretch justify-between gap-1\", classNames?.header)}\n >\n <Ark.PrevTrigger asChild>{navIcon(prev, size)}</Ark.PrevTrigger>\n <Ark.ViewTrigger\n className={cn(\n \"transition-colors\",\n \"min-w-0 flex-1 cursor-pointer truncate rounded-sm px-2 py-1 text-center text-sm font-medium\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n >\n {api.visibleRange.end.month === api.visibleRange.start.month\n ? api.visibleRangeText.start\n : api.visibleRangeText.formatted}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>{navIcon(next, size)}</Ark.NextTrigger>\n </Ark.ViewControl>\n )\n\n // A real, two-endpoint committed range — read off the machine's own value, not the DOM, so\n // it stays true regardless of whether either endpoint's month is currently paged into view\n // (see the pill-cap rounding comment in `dayCellTrigger` above).\n const isCommittedRange = api.value.length === 2\n\n return match(api.view)\n .with(\"day\", () => (\n <Ark.View view=\"day\">\n <div\n className=\"grid items-center justify-center\"\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, auto)`,\n columnGap: MONTH_GAP,\n rowGap: 8,\n }}\n >\n {/* The prev/next icons are overlaid on the control (`absolute`), not given their\n * own grid columns — this row's total width must stay exactly the width of the\n * day tables below (the columns this grid actually has), because `DatePicker`\n * sizes its popover to that exact figure (`calendarGridWidth`, `date-picker.tsx`).\n * Extra icon columns would push this row wider than that budget and force the\n * popover to scroll. */}\n <div\n className={cn(\"relative\", classNames?.header)}\n style={{\n gridColumn: `1 / span ${numOfMonths}`,\n gridRow: 1,\n height: NAV_ICON_SIZE[size],\n }}\n >\n <Ark.PrevTrigger asChild>\n {navIcon(prev, size, \"absolute start-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.PrevTrigger>\n {/* One button, not one per month — Ark's month/year view is a single shared grid\n * (confirmed below), so every month's label leads to the exact same destination;\n * splitting it into N `Ark.ViewTrigger`s would only duplicate the same generated\n * `id`/`aria-label` across them. Its own `repeat(numOfMonths, 1fr)` columns land\n * on the exact same boundaries as the day-table columns below (both divide the\n * same total width, with the same gap, into the same number of equal shares —\n * true because every month always renders at the same cell size) — so no width\n * formula is duplicated between this row and the tables, and it degenerates to\n * the `numOfMonths === 1` case for free.\n *\n * The button itself stays full width (so its grid tracks — and hence its click\n * target — line up with the tables below), but its *visible* hover pill is a\n * separate, inset layer (`group-hover`) that stops short of the prev/next icons\n * instead of running the full width underneath them. */}\n <Ark.ViewTrigger\n className={cn(\n \"group relative grid size-full cursor-pointer items-center rounded-sm text-sm font-medium transition-colors\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, 1fr)`,\n columnGap: MONTH_GAP,\n }}\n >\n <span\n aria-hidden\n className=\"pointer-events-none absolute inset-y-0 rounded-sm transition-colors group-hover:bg-brand-900/6 dark:group-hover:bg-white/8\"\n style={{\n insetInlineStart: NAV_ICON_SIZE[size],\n insetInlineEnd: NAV_ICON_SIZE[size],\n }}\n />\n {Array.from({ length: numOfMonths }, (_, monthIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n <span key={monthIndex} className=\"relative min-w-0 truncate text-center\">\n {api.getOffset({ months: monthIndex }).visibleRangeText.start}\n </span>\n ))}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>\n {navIcon(next, size, \"absolute end-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.NextTrigger>\n </div>\n\n {Array.from({ length: numOfMonths }, (_, monthIndex) => {\n const offset = api.getOffset({ months: monthIndex })\n return (\n <Ark.Table\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n key={monthIndex}\n style={{ gridColumn: monthIndex + 1, gridRow: 2 }}\n className={cn(\"border-separate border-spacing-0\", classNames?.table)}\n >\n <Ark.TableHead>\n <Ark.TableRow>\n {withWeekNumbers && <Ark.WeekNumberHeaderCell className={weekdayHeader} />}\n {api.weekDays.map((weekDay) => (\n <Ark.TableHeader key={weekDay.long} className={weekdayHeader}>\n {weekDay.narrow}\n </Ark.TableHeader>\n ))}\n </Ark.TableRow>\n </Ark.TableHead>\n <Ark.TableBody>\n {offset.weeks.map((week, weekIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of consecutive weeks, never reordered.\n <Ark.TableRow key={weekIndex}>\n {withWeekNumbers && (\n <Ark.WeekNumberCell weekIndex={weekIndex} week={week}>\n <span className={weekNumberCell}>{api.getWeekNumber(week)}</span>\n </Ark.WeekNumberCell>\n )}\n {week.map((value) => {\n const cellState = renderDay\n ? api.getDayTableCellState({\n value,\n visibleRange: offset.visibleRange,\n })\n : undefined\n return (\n <Ark.TableCell\n key={value.toString()}\n value={value}\n visibleRange={offset.visibleRange}\n >\n <Ark.TableCellTrigger\n {...props({ \"data-range-committed\": isCommittedRange })}\n className={cn(dayCellTrigger({ size }), classNames?.day)}\n >\n {value.day}\n {cellState &&\n renderDay?.(calendarValueToDate(value, timeZone), {\n isUnavailable: cellState.unavailable,\n isSelected: cellState.selected,\n })}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n )\n })}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n )\n })}\n </div>\n </Ark.View>\n ))\n .with(\"month\", () => (\n <Ark.View view=\"month\">\n {nav}\n <Ark.Table\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {/* \"short\" (e.g. \"Jan\"), not the default \"long\" (\"January\") — the grid's width is\n * pinned to the day view's (see `calendarGridWidth` above), which at a single\n * narrow month can be too tight for full month names across 4 columns. */}\n {api.getMonthsGrid({ columns: 4, format: \"short\" }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((month) => (\n <Ark.TableCell key={month.value} value={month.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {month.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .with(\"year\", () => (\n <Ark.View view=\"year\">\n {nav}\n <Ark.Table\n columns={5}\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {api.getYearsGrid({ columns: 5 }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((year) => (\n <Ark.TableCell key={year.value} value={year.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {year.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .exhaustive()\n }}\n </Ark.Context>\n)\n","\"use client\"\n\nimport { type DateValue, useDatePickerContext } from \"@ark-ui/react/date-picker\"\nimport { isSameDay, today } from \"@internationalized/date\"\nimport { type RefObject, useRef } from \"react\"\nimport { calendarValueToDate, dateToArkValue } from \"../../lib/date-value\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\n\n/** A stable fingerprint of Ark's value array, to recognise one specific `setValue` echo. */\nexport const hashArkValues = (values: DateValue[]): string => values.map(String).join(\",\")\n\n/**\n * The value Ark is about to report back from a zone re-seed, or `null`. The root's\n * `onValueChange` swallows the one change whose hash matches it, because re-expressing the\n * selection in a new zone is not a change the user made.\n */\nexport type ZoneReseedRef = RefObject<string | null>\n\n/**\n * Keeps an Ark `date-picker` machine's selection on the same **instant** when its `timeZone`\n * changes, without remounting it. Renders nothing; mount it inside `Ark.Root`.\n *\n * Ark reads `defaultValue` once, at mount, and from then on holds the selection as a wall-calendar\n * `DateValue`. A grid pick is a plain `CalendarDate` with no zone at all, so on its own a zone\n * change would keep the *day* and silently move the instant the app was handed by `onChange`. The\n * one zone change every SSR app sees is `timeZone=\"auto\"` going from the UTC hydration snapshot\n * to the host zone, and there the uncontrolled `defaultValue` would stay on the UTC day.\n *\n * So, in a layout effect after the render that changed the zone:\n *\n * - **Uncontrolled**: each value is read back as an instant in the *old* zone (what `onChange`\n * reported) and handed to Ark again in the new one, through `api.setValue`. That may land on\n * another calendar day near midnight, which is the point. `pendingRef` marks the echo so the\n * root doesn't report it through `onChange`.\n * - **Controlled**: nothing to do. The root re-derives Ark's `value` from the app's `Date`s in\n * the new zone on every render, which is already the same instant.\n * - **Focus**: the machine's focused day (the keyboard's roving cell, and the month on show)\n * follows its anchor, the selection or else today, when it sat on that anchor before the\n * change. A month the user navigated to stays put. `setFocusedValue` never moves DOM focus.\n *\n * A remount would do all of this too, but it also resets everything the user did since mount: a\n * pick goes back to `defaultValue`, typed text is cleared, and DOM focus drops to `<body>`.\n */\nexport const CalendarZoneSync = ({\n timeZone,\n controlled,\n pendingRef,\n}: {\n timeZone: string\n controlled: boolean\n pendingRef: ZoneReseedRef\n}) => {\n const api = useDatePickerContext()\n const previous = useRef({ timeZone, value: api.value })\n\n // No dependency list on purpose: the previous value has to be the one from the last render,\n // which under a controlled `value` is already the new zone's by the time the zone changes.\n useIsomorphicLayoutEffect(() => {\n const { timeZone: from, value: before } = previous.current\n previous.current = { timeZone, value: api.value }\n if (from === timeZone) return\n\n const after = controlled\n ? api.value\n : before.map((value) => dateToArkValue(calendarValueToDate(value, from), timeZone))\n if (!controlled && after.length > 0) {\n pendingRef.current = hashArkValues(after)\n api.setValue(after)\n }\n\n // `setValue` also moves the focused day onto the new value, so this runs either way: it\n // either confirms that move or puts back a month the user had navigated to.\n const anchorBefore = before[0] ?? today(from)\n const focused = api.focusedValue\n api.setFocusedValue(isSameDay(focused, anchorBefore) ? (after[0] ?? today(timeZone)) : focused)\n })\n\n return null\n}\n","\"use client\"\n\nimport { DatePicker as Ark, type DatePickerDateView as DateView } from \"@ark-ui/react/date-picker\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { type ComponentProps, type ReactNode, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { DatePredicate } from \"../../lib/date-predicates\"\nimport {\n calendarValueToDate,\n type DateRangeValue,\n dateToArkValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { useTimeZone } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { CalendarBody, type CalendarBodyClassNames, type CalendarIcons } from \"./calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"./calendar-zone-sync\"\n\n/**\n * Calendar — the inline month grid (RFC §9, `docs/rfcs/date-picker.md`): Ark's `date-picker`\n * machine rendered `inline` (no trigger/popover), wrapping the shared `CalendarBody` grid that\n * `DatePicker` will later reuse verbatim inside its own popover.\n *\n * - Value is a native `Date | null` (or `{ start, end }` under `range`) — the machine's\n * `DateValue` array contract never leaks out; `lib/date-value.ts` is the one conversion\n * boundary both directions go through.\n * - Controlled/uncontrolled `value` / `defaultValue` / `onChange` go straight to Ark's own\n * machine, which supports both natively — no `useUncontrolled` needed here.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s and are adapted to Ark's\n * `DateValue`-based signature at this boundary; pair with the `lib/date-predicates.ts`\n * helpers (`disablePast()`, `disableWeekends()`, …).\n * - No `label` / `description` / `error` / `FieldShell` wrap — `Calendar` is a bare widget\n * (like `Table`), not a form field. A `DatePicker` popover is where a field wrapper belongs.\n *\n * <Calendar value={date} onChange={setDate} isDateUnavailable={disableWeekends()} />\n */\n\nexport type CalendarClassNames = CalendarBodyClassNames & {\n /** The outermost `Ark.Root` element. */\n root?: string\n}\n\n/** Ark's own `translations` prop type, derived structurally rather than imported by name —\n * `IntlTranslations` lives in `@zag-js/date-picker`, a transitive dependency of the\n * `@ark-ui/react` peer dep, not one this package declares itself. */\ntype ArkTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\n/** The subset `CalendarBody`'s rendered anatomy actually exercises — `trigger`/`clearTrigger`\n * only apply when composed under `DatePicker` (a bare `Calendar` never renders a trigger/clear\n * button; harmless no-op keys there). Unset keys fall back to Ark's own English text. */\nexport type CalendarTranslations = Pick<\n ArkTranslations,\n | \"dayCell\"\n | \"trigger\"\n | \"viewTrigger\"\n | \"prevTrigger\"\n | \"nextTrigger\"\n | \"clearTrigger\"\n | \"content\"\n | \"weekColumnHeader\"\n | \"weekNumberCell\"\n>\n\n/** Passes a partial override straight through to `Ark.Root`. Ark's `translations` prop is\n * itself all-optional (since @ark-ui/react 5.38.2), so unset keys fall back to Ark's own\n * English defaults and this kit no longer keeps a copy of them to merge over. That copy was\n * load-bearing when the prop demanded every key at once; keeping it now would only let a\n * stale duplicate override Ark's upstream fixes — which is exactly what happened to\n * `viewTrigger`, whose day-view label named the wrong target view until Ark corrected it. */\nexport const resolveCalendarTranslations = (\n overrides?: Partial<CalendarTranslations>,\n): ArkTranslations | undefined => overrides\n\n/** What `renderDay` is told about the day it decorates. */\nexport type CalendarDayState = {\n /** The day can't be picked: `isDateUnavailable`, or outside `min`/`max`. */\n unavailable: boolean\n /** The day is selected, or is one end of the selected range. */\n selected: boolean\n /** @deprecated Renamed `unavailable`. Removed in the next minor. */\n isUnavailable: boolean\n /** @deprecated Renamed `selected`. Removed in the next minor. */\n isSelected: boolean\n}\n\n/** Builds `renderDay`'s state; reading a deprecated `is*` key warns once in development. */\nconst dayState = (day: { isUnavailable: boolean; isSelected: boolean }): CalendarDayState => ({\n unavailable: day.isUnavailable,\n selected: day.isSelected,\n get isUnavailable() {\n warnRenamedProp(\"Calendar renderDay\", \"isUnavailable\", \"unavailable\")\n return day.isUnavailable\n },\n get isSelected() {\n warnRenamedProp(\"Calendar renderDay\", \"isSelected\", \"selected\")\n return day.isSelected\n },\n})\n\nexport type CalendarProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n HTMLDivElement\n> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Months shown side by side. Default 1. */\n numOfMonths?: number\n /** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.\n * Called with this component's own resolved `timeZone` as its second argument, so a predicate\n * reads the candidate day in the same zone the grid renders it in. */\n isDateUnavailable?: DatePredicate\n /** Earliest selectable day; earlier days render unavailable and navigation stops there. */\n min?: Date\n /** Latest selectable day; later days render unavailable and navigation stops there. */\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"` for a month-only\n * picker that never drills into individual days). */\n minView?: DateView\n /** The widest view the header's view switch can climb to (`\"day\"`, `\"month\"` or `\"year\"`). */\n maxView?: DateView\n /** Per-day decoration slot — the \"event dot\" (RFC §9). `ctx` says whether the day is\n * `unavailable` or `selected`. */\n renderDay?: (date: Date, ctx: CalendarDayState) => ReactNode\n /** Always render 6 week rows (padding with adjacent-month days) instead of however many the\n * visible month(s) actually span (4–6) — keeps the grid's height constant while navigating\n * between months. */\n fixedWeeks?: boolean\n /** Adds a leading column with each row's week number. */\n withWeekNumbers?: boolean\n /** Overrides the active locale context. Drives month/day names and first-day-of-week. */\n locale?: string\n /** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Schedule` — **not** Ark's\n * own machine default (`\"UTC\"`), which is why the resolved zone is forwarded to `Ark.Root`\n * explicitly rather than only used in this component's own conversions (see\n * `lib/date-value.ts`'s module doc). Accepts `\"auto\"` to follow the host zone. */\n timeZone?: string\n /** Overrides Ark's own built-in aria-label/accessible-name strings (day cells, prev/next, the\n * view-cycling header, week numbers) — English by default. Unlike `locale`, nothing here\n * auto-derives; supply your own translated strings. Partial — unset keys keep Ark's default. */\n translations?: Partial<CalendarTranslations>\n /** Replaces the default icons: `prev`, `next`. The kit's chevrons mirror under RTL; an\n * icon passed here is drawn as given. */\n icons?: CalendarIcons\n /** Cell and text size, off the kit's `xs`–`xl` scale. Default `\"md\"`. */\n size?: Size\n className?: string\n classNames?: CalendarClassNames\n }\n\nexport const Calendar = <Range extends boolean = false>({\n range,\n value,\n defaultValue,\n onChange,\n onBlur,\n numOfMonths = 1,\n isDateUnavailable,\n min,\n max,\n minView,\n maxView,\n renderDay,\n fixedWeeks,\n withWeekNumbers,\n locale,\n timeZone,\n translations,\n icons,\n size = \"md\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n className,\n classNames,\n testId,\n}: CalendarProps<Range>) => {\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = useTimeZone(timeZone)\n const isRange = Boolean(range)\n const zoneReseed = useRef<string | null>(null)\n\n return (\n <Ark.Root\n inline\n ref={ref}\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n value={toArkValues(value, resolvedTimeZone)}\n defaultValue={toArkValues(defaultValue, resolvedTimeZone)}\n onValueChange={(details) => {\n // A zone change re-expresses the selection in the new zone; that echo is not a change.\n if (zoneReseed.current === hashArkValues(details.value)) {\n zoneReseed.current = null\n return\n }\n // The machine's value is a plain DateValue[]; `range` is a runtime flag here, so narrow\n // the result back to the caller's declared shape.\n onChange?.(\n fromArkValues(details.value, isRange, resolvedTimeZone) as Range extends true\n ? DateRangeValue\n : Date | null,\n )\n }}\n onBlur={onBlur}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n // Ark's own prop — its name doesn't follow this kit's `withX` convention, so it stays\n // `showWeekNumbers` even though our public prop is `withWeekNumbers`.\n showWeekNumbers={withWeekNumbers}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(calendarValueToDate(dateValue, resolvedTimeZone), resolvedTimeZone)\n : undefined\n }\n min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}\n minView={minView}\n maxView={maxView}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={invalid}\n name={name}\n className={cn(\"inline-flex flex-col\", className, classNames?.root)}\n {...props({ \"data-testid\": testId })}\n >\n {/* The machine looks up the currently-focused cell by querying inside the `Content` part\n * (`getFocusedCell` scopes its DOM query to `getContentEl`) to call `.focus()` on it after\n * every arrow-key/Home/End/PageUp/PageDown press — even though `inline` never opens a real\n * popover, that lookup still runs, and with no `Content` element in the DOM at all it\n * always finds nothing, so keyboard navigation updates the machine's internal focus state\n * (visible via `data-focus`) but never moves real DOM focus. `inline` implies `open` (the\n * machine treats it as permanently open), so `Content`'s `hidden={!open}` never hides this. */}\n {/* Ark reads `defaultValue` once, at mount, so a zone change (`timeZone=\"auto\"` going from\n * the UTC hydration snapshot to the host zone, or the app's provider changing) would leave\n * the selection on the old zone's day. This re-seeds it on the same instant in place;\n * see `calendar-zone-sync.tsx` for why it isn't a remount. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={value !== undefined}\n pendingRef={zoneReseed}\n />\n <Ark.Content>\n <CalendarBody\n numOfMonths={numOfMonths}\n withWeekNumbers={withWeekNumbers}\n renderDay={renderDay && ((date, day) => renderDay(date, dayState(day)))}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames}\n icons={icons}\n />\n </Ark.Content>\n </Ark.Root>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/calendar/calendar-body.tsx","../src/components/calendar/calendar-zone-sync.tsx","../src/components/calendar/calendar.tsx"],"names":["Ark","useRef","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;AA8CO,IAAM,aAAA,GAAqD;AAAA,EAChE,IAAA,kBAAM,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAU,kBAAA,EAAmB,CAAA;AAAA,EACpD,IAAA,kBAAM,GAAA,CAAC,gBAAA,EAAA,EAAiB,SAAA,EAAU,kBAAA,EAAmB;AACvD,CAAA;AAqBA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB;AAAA,IACE,gEAAA;AAAA,IACA,kEAAA;AAAA,IACA,8CAAA;AAAA,IACA,oBAAA;AAAA,IACA,WAAA,CAAY,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAA;AAAA,IAC7B,oDAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,iMAAA;AAAA,IACA,yFAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAsBA,oDAAA;AAAA,IACA,kDAAA;AAAA,IACA,8DAAA;AAAA,IACA,8DAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,yDAAA;AAAA,IACA,4EAAA;AAAA,IACA,wGAAA;AAAA,IACA,2IAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,gBAAA;AAAA,QACJ,EAAA,EAAI,gBAAA;AAAA,QACJ,EAAA,EAAI,gBAAA;AAAA,QACJ,EAAA,EAAI,mBAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACN,K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A,CAAe,GAAA,EAAK,gBAAgB,CAAA,GAAI,MAAA;AAAA,MACnD,GAAA,EAAK,GAAA,GAAM,cAAA,CAAe,GAAA,EAAK,gBAAgB,CAAA,GAAI,MAAA;AAAA,MACnD,OAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,sBAAA,EAAwB,SAAA,EAAW,YAAY,IAAI,CAAA;AAAA,MAChE,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAanC,QAAA,EAAA;AAAA,wBAAAG,GAAAA;AAAA,UAAC,gBAAA;AAAA,UAAA;AAAA,YACC,QAAA,EAAU,gBAAA;AAAA,YACV,YAAY,KAAA,KAAU,MAAA;AAAA,YACtB,UAAA,EAAY;AAAA;AAAA,SACd;AAAA,wBACAA,GAAAA,CAACH,UAAAA,CAAI,OAAA,EAAJ,EACC,QAAA,kBAAAG,GAAAA;AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YACC,WAAA;AAAA,YACA,eAAA;AAAA,YACA,SAAA,EAAW,cAAc,CAAC,IAAA,EAAM,QAAQ,SAAA,CAAU,IAAA,EAAM,QAAA,CAAS,GAAG,CAAC,CAAA,CAAA;AAAA,YACrE,IAAA;AAAA,YACA,QAAA,EAAU,gBAAA;AAAA,YACV,UAAA;AAAA,YACA;AAAA;AAAA,SACF,EACF;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-E52Z2FKU.js","sourcesContent":["import { DatePicker as Ark } from \"@ark-ui/react/date-picker\"\nimport { cva } from \"class-variance-authority\"\nimport type { ReactNode } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { cn } from \"../../lib/cn\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { ActionIcon } from \"../action-icon/action-icon\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../popover/icons\"\n\n/**\n * CalendarBody — the shared grid module behind both `Calendar` (inline) and, later,\n * `DatePicker` (popover): the RFC §3 \"one implementation, not two\" module. It renders only the\n * grid anatomy (`View` / `ViewControl` / nav triggers / `Table*` / `MonthSelect` / `YearSelect`)\n * — deliberately **not** `Control` / `Content` / `Positioner` / `Trigger` / `ClearTrigger`, the\n * popover-only chrome that belongs to `DatePicker`, not here.\n *\n * Every part below self-connects to the nearest ancestor `Ark.Root` via Ark's own React\n * context, so this module needs no `api` prop threaded in — both `Calendar` and `DatePicker`\n * just mount it as a plain child inside their own differently-configured `Ark.Root`.\n *\n * Not barrel-exported (no export from `calendar/index.ts`) — `DatePicker` reaches it directly\n * via `import { CalendarBody } from \"../calendar/calendar-body\"`, the established cross-folder\n * pattern for a shared internal part (`multi-select.tsx` → `../combobox/combobox`,\n * `drawer.tsx` → `../action-icon/action-icon`).\n */\n\nexport type CalendarBodyClassNames = {\n /** The prev/label/next navigation row. */\n header?: string\n /** Each rendered `<table>` (one per visible month in the day view). */\n table?: string\n /** Each day cell's clickable trigger. */\n day?: string\n}\n\nexport type CalendarIconSlot = \"prev\" | \"next\"\nexport type CalendarIcons = IconMap<CalendarIconSlot>\n\n/** The default icons. The glyphs are physical; prev sits on the inline-start\n * edge, which is the right one under RTL, so both chevrons mirror there to\n * keep pointing outward. A consumer's icon is drawn as given. */\nexport const DEFAULT_ICONS: Record<CalendarIconSlot, ReactNode> = {\n prev: <ChevronLeftIcon className=\"rtl:-scale-x-100\" />,\n next: <ChevronRightIcon className=\"rtl:-scale-x-100\" />,\n}\n\nexport type CalendarBodyProps = {\n /** Months shown side by side in the day view. */\n numOfMonths?: number\n withWeekNumbers?: boolean\n /** Per-day decoration slot (RFC §9's \"event dot\"). Receives a native `Date` — converted from\n * Ark's `DateValue` at the point of the call, via the same `timeZone` the root was configured\n * with — and the day's live selection state. */\n renderDay?: (date: Date, ctx: { isUnavailable: boolean; isSelected: boolean }) => ReactNode\n size?: Size\n /** The time zone the nearest `Ark.Root` was configured with. Required (not read from Ark's\n * own api, which exposes no public `timeZone` getter) so `renderDay`'s Date conversion uses\n * the exact same boundary `Calendar`/`DatePicker` used to build the root's own value —\n * see `lib/date-value.ts`'s module doc on why this one conversion point matters. */\n timeZone: string\n classNames?: CalendarBodyClassNames\n /** Replaces the prev/next icons. Drawn as given, never restroked or mirrored. */\n icons?: CalendarIcons\n}\n\nconst dayCellTrigger = cva(\n [\n \"relative flex size-full items-center justify-center rounded-xs\",\n \"cursor-pointer select-none tabular-nums transition-colors-radius\",\n \"hover:bg-brand-950/20 dark:hover:bg-white/20\",\n \"focus-visible:z-10\",\n focusStyles({ offset: false }),\n \"data-today:font-semibold data-today:text-brand-500\",\n // `!` (important) on bg/text: a day can be `data-today` *and* `data-selected` at once (e.g.\n // the default `new Date()` value), or a range endpoint is simultaneously `data-selected` *and*\n // `data-in-range` (the closed interval includes its own ends) — without `!`, these rules fight\n // over the same `background-color`/`color` and Tailwind's variant ordering (not this class\n // list's order) can win the wrong one, e.g. leaving the selected cell's text the same color\n // as its own solid-fill background, invisible. `data-selected` — the solid highlight — always\n // wins over both.\n \"data-selected:bg-brand-950! dark:data-selected:bg-white! data-selected:text-(--c-on-solid)! data-selected:font-semibold data-selected:hover:bg-brand-800! dark:data-selected:hover:bg-white/80!\",\n \"data-in-range:rounded-none data-in-range:bg-brand-950/10 dark:data-in-range:bg-white/10\",\n // Pill-cap rounding, split into two independently-true conditions rather than reacting to\n // `data-range-start`/`data-range-end` alone: a lone click (before any second day exists)\n // still carries `data-range-start`, and capping on that alone made the first pick look like\n // an already-established range extending rightward.\n //\n // 1. A genuinely *committed* range exists — `data-range-committed` is set from\n // `api.value.length === 2` in JS, not from the DOM. An earlier version checked whether the\n // *other* endpoint's `data-range-start`/`data-range-end` was present anywhere among the\n // visible months instead — that broke as soon as only one endpoint's month was in view\n // (e.g. the range was set, then the calendar paged away from one end): the other endpoint\n // was never rendered at all, so its attribute could never be found, and the cap silently\n // stopped applying to the *visible* endpoint too, even though the range was still fully\n // committed. `api.value` reflects the committed selection regardless of what's currently\n // paged into view, so this doesn't have that failure mode.\n // 2. A genuine *live hover preview* toward a different day — self-contained on this cell's\n // own attributes, no group lookup needed: `hoveredRangeValue` is `[start, hoveredValue]`\n // sorted chronologically, so the anchor cell gets exactly one of `data-hover-range-start` /\n // `data-hover-range-end` when truly hovering elsewhere (direction decides which), but\n // *both* simultaneously when the pointer is merely resting on the same cell it just\n // clicked (a zero-width hover range) — requiring the other one be *absent* rules out that\n // degenerate, \"changes before you've moved anywhere\" case.\n \"data-range-start:data-range-committed:rounded-s-xs\",\n \"data-range-end:data-range-committed:rounded-e-xs\",\n \"data-hover-range-start:not-data-hover-range-end:rounded-s-xs\",\n \"data-hover-range-end:not-data-hover-range-start:rounded-e-xs\",\n // The degenerate case above (pointer resting on the just-clicked day, `data-hover-range-start`\n // and `data-hover-range-end` both present on this same cell) still falls into `data-in-range`\n // (a zero-width range trivially contains itself), which would otherwise render it\n // `rounded-none` — sharp corners, reading as broken rather than \"just this one day, nothing\n // decided yet.\" Round it fully instead, `!` to beat that `data-in-range:rounded-none`\n // regardless of Tailwind's variant ordering.\n \"data-hover-range-start:data-hover-range-end:rounded-xs!\",\n \"data-outside-range:text-brand-900/40 dark:data-outside-range:text-white/35\",\n \"data-in-range:data-outside-range:text-brand-900/70 dark:data-in-range:data-outside-range:text-white/50\",\n \"data-unavailable:pointer-events-none data-unavailable:text-brand-900/20 data-unavailable:line-through dark:data-unavailable:text-white/16\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: {\n xs: \"size-7 text-xs\",\n sm: \"size-8 text-xs\",\n md: \"size-9 text-sm\",\n lg: \"size-10 text-base\",\n xl: \"size-11 text-base\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** Day-cell pixel size per `size`, matching `dayCellTrigger`'s `size-*` variants (`size-7`..\n * `size-11`) — the day view's own total width. The month/year grids below are plain `<table>`s\n * that would otherwise size to their own (longer) text content instead, so at `numOfMonths ===\n * 1` a month grid comes out *wider* than the day view (overflowing a fixed-width ancestor, e.g.\n * `DatePicker`'s popover column, which is sized off this same geometry via `calendarGridWidth`)\n * and a year grid comes out *narrower* (leaving unfilled space instead of stretching to match).\n * Pinning both to this exact width — `table-fixed` divides it evenly across columns — keeps\n * every view the same footprint. */\nconst DAY_CELL_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 44 }\n/** Gap between adjacent months in the day view (`gap-6`). */\nconst MONTH_GAP = 24\n\nexport const calendarGridWidth = (size: Size, numOfMonths: number): number =>\n DAY_CELL_SIZE[size] * 7 * numOfMonths + MONTH_GAP * (numOfMonths - 1)\n\nconst gridCellTrigger = cva(\n [\n \"flex w-full items-center justify-center truncate rounded-sm px-2 py-2.5\",\n \"cursor-pointer transition-colors\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"data-selected:bg-(--c-solid) data-selected:text-(--c-on-solid) data-selected:hover:bg-(--c-solid-hover)\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: { xs: \"text-xs\", sm: \"text-xs\", md: \"text-sm\", lg: \"text-base\", xl: \"text-base\" },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst weekdayHeader = cn(\"pb-1 text-center text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\n\nconst weekNumberCell = cn(\n \"p-1 align-top text-center text-xs font-medium h-full\",\n TEXT_COLOR_CLASSES.muted,\n)\n\n/** A prev/next trigger, as the single element Ark's trigger clones under\n * `asChild`. It sizes the icon (through `ActionIcon`) but never strokes or\n * mirrors it. */\nconst navIcon = (icon: ReactNode, size: Size | undefined, className?: string) => (\n <ActionIcon variant=\"subtle\" color=\"neutral\" size={size} className={className}>\n {icon}\n </ActionIcon>\n)\n\n/** `ActionIcon`'s own rendered height per `size` (its `h-7`..`h-12` variants) — the day view's\n * nav row is pinned to this so the prev/next icons and the view-trigger control are the same\n * height, instead of the icons (overlaid on the control, see below) poking out top and bottom of\n * a shorter, text-sized row. */\nconst NAV_ICON_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 48 }\n\nexport const CalendarBody = ({\n numOfMonths = 1,\n withWeekNumbers,\n renderDay,\n size = \"md\",\n timeZone,\n classNames,\n icons,\n}: CalendarBodyProps) => (\n <Ark.Context>\n {(api) => {\n const { prev, next } = mergeIcons(DEFAULT_ICONS, icons)\n const nav = (\n <Ark.ViewControl\n className={cn(\"mb-2 flex items-stretch justify-between gap-1\", classNames?.header)}\n >\n <Ark.PrevTrigger asChild>{navIcon(prev, size)}</Ark.PrevTrigger>\n <Ark.ViewTrigger\n className={cn(\n \"transition-colors\",\n \"min-w-0 flex-1 cursor-pointer truncate rounded-sm px-2 py-1 text-center text-sm font-medium\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n >\n {api.visibleRange.end.month === api.visibleRange.start.month\n ? api.visibleRangeText.start\n : api.visibleRangeText.formatted}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>{navIcon(next, size)}</Ark.NextTrigger>\n </Ark.ViewControl>\n )\n\n // A real, two-endpoint committed range — read off the machine's own value, not the DOM, so\n // it stays true regardless of whether either endpoint's month is currently paged into view\n // (see the pill-cap rounding comment in `dayCellTrigger` above).\n const isCommittedRange = api.value.length === 2\n\n return match(api.view)\n .with(\"day\", () => (\n <Ark.View view=\"day\">\n <div\n className=\"grid items-center justify-center\"\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, auto)`,\n columnGap: MONTH_GAP,\n rowGap: 8,\n }}\n >\n {/* The prev/next icons are overlaid on the control (`absolute`), not given their\n * own grid columns — this row's total width must stay exactly the width of the\n * day tables below (the columns this grid actually has), because `DatePicker`\n * sizes its popover to that exact figure (`calendarGridWidth`, `date-picker.tsx`).\n * Extra icon columns would push this row wider than that budget and force the\n * popover to scroll. */}\n <div\n className={cn(\"relative\", classNames?.header)}\n style={{\n gridColumn: `1 / span ${numOfMonths}`,\n gridRow: 1,\n height: NAV_ICON_SIZE[size],\n }}\n >\n <Ark.PrevTrigger asChild>\n {navIcon(prev, size, \"absolute start-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.PrevTrigger>\n {/* One button, not one per month — Ark's month/year view is a single shared grid\n * (confirmed below), so every month's label leads to the exact same destination;\n * splitting it into N `Ark.ViewTrigger`s would only duplicate the same generated\n * `id`/`aria-label` across them. Its own `repeat(numOfMonths, 1fr)` columns land\n * on the exact same boundaries as the day-table columns below (both divide the\n * same total width, with the same gap, into the same number of equal shares —\n * true because every month always renders at the same cell size) — so no width\n * formula is duplicated between this row and the tables, and it degenerates to\n * the `numOfMonths === 1` case for free.\n *\n * The button itself stays full width (so its grid tracks — and hence its click\n * target — line up with the tables below), but its *visible* hover pill is a\n * separate, inset layer (`group-hover`) that stops short of the prev/next icons\n * instead of running the full width underneath them. */}\n <Ark.ViewTrigger\n className={cn(\n \"group relative grid size-full cursor-pointer items-center rounded-sm text-sm font-medium transition-colors\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, 1fr)`,\n columnGap: MONTH_GAP,\n }}\n >\n <span\n aria-hidden\n className=\"pointer-events-none absolute inset-y-0 rounded-sm transition-colors group-hover:bg-brand-900/6 dark:group-hover:bg-white/8\"\n style={{\n insetInlineStart: NAV_ICON_SIZE[size],\n insetInlineEnd: NAV_ICON_SIZE[size],\n }}\n />\n {Array.from({ length: numOfMonths }, (_, monthIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n <span key={monthIndex} className=\"relative min-w-0 truncate text-center\">\n {api.getOffset({ months: monthIndex }).visibleRangeText.start}\n </span>\n ))}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>\n {navIcon(next, size, \"absolute end-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.NextTrigger>\n </div>\n\n {Array.from({ length: numOfMonths }, (_, monthIndex) => {\n const offset = api.getOffset({ months: monthIndex })\n return (\n <Ark.Table\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n key={monthIndex}\n style={{ gridColumn: monthIndex + 1, gridRow: 2 }}\n className={cn(\"border-separate border-spacing-0\", classNames?.table)}\n >\n <Ark.TableHead>\n <Ark.TableRow>\n {withWeekNumbers && <Ark.WeekNumberHeaderCell className={weekdayHeader} />}\n {api.weekDays.map((weekDay) => (\n <Ark.TableHeader key={weekDay.long} className={weekdayHeader}>\n {weekDay.narrow}\n </Ark.TableHeader>\n ))}\n </Ark.TableRow>\n </Ark.TableHead>\n <Ark.TableBody>\n {offset.weeks.map((week, weekIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of consecutive weeks, never reordered.\n <Ark.TableRow key={weekIndex}>\n {withWeekNumbers && (\n <Ark.WeekNumberCell weekIndex={weekIndex} week={week}>\n <span className={weekNumberCell}>{api.getWeekNumber(week)}</span>\n </Ark.WeekNumberCell>\n )}\n {week.map((value) => {\n const cellState = renderDay\n ? api.getDayTableCellState({\n value,\n visibleRange: offset.visibleRange,\n })\n : undefined\n return (\n <Ark.TableCell\n key={value.toString()}\n value={value}\n visibleRange={offset.visibleRange}\n >\n <Ark.TableCellTrigger\n {...props({ \"data-range-committed\": isCommittedRange })}\n className={cn(dayCellTrigger({ size }), classNames?.day)}\n >\n {value.day}\n {cellState &&\n renderDay?.(calendarValueToDate(value, timeZone), {\n isUnavailable: cellState.unavailable,\n isSelected: cellState.selected,\n })}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n )\n })}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n )\n })}\n </div>\n </Ark.View>\n ))\n .with(\"month\", () => (\n <Ark.View view=\"month\">\n {nav}\n <Ark.Table\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {/* \"short\" (e.g. \"Jan\"), not the default \"long\" (\"January\") — the grid's width is\n * pinned to the day view's (see `calendarGridWidth` above), which at a single\n * narrow month can be too tight for full month names across 4 columns. */}\n {api.getMonthsGrid({ columns: 4, format: \"short\" }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((month) => (\n <Ark.TableCell key={month.value} value={month.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {month.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .with(\"year\", () => (\n <Ark.View view=\"year\">\n {nav}\n <Ark.Table\n columns={5}\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {api.getYearsGrid({ columns: 5 }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((year) => (\n <Ark.TableCell key={year.value} value={year.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {year.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .exhaustive()\n }}\n </Ark.Context>\n)\n","\"use client\"\n\nimport { type DateValue, useDatePickerContext } from \"@ark-ui/react/date-picker\"\nimport { isSameDay, today } from \"@internationalized/date\"\nimport { type RefObject, useRef } from \"react\"\nimport { calendarValueToDate, dateToArkValue } from \"../../lib/date-value\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\n\n/** A stable fingerprint of Ark's value array, to recognise one specific `setValue` echo. */\nexport const hashArkValues = (values: DateValue[]): string => values.map(String).join(\",\")\n\n/**\n * The value Ark is about to report back from a zone re-seed, or `null`. The root's\n * `onValueChange` swallows the one change whose hash matches it, because re-expressing the\n * selection in a new zone is not a change the user made.\n */\nexport type ZoneReseedRef = RefObject<string | null>\n\n/**\n * Keeps an Ark `date-picker` machine's selection on the same **instant** when its `timeZone`\n * changes, without remounting it. Renders nothing; mount it inside `Ark.Root`.\n *\n * Ark reads `defaultValue` once, at mount, and from then on holds the selection as a wall-calendar\n * `DateValue`. A grid pick is a plain `CalendarDate` with no zone at all, so on its own a zone\n * change would keep the *day* and silently move the instant the app was handed by `onChange`. The\n * one zone change every SSR app sees is `timeZone=\"auto\"` going from the UTC hydration snapshot\n * to the host zone, and there the uncontrolled `defaultValue` would stay on the UTC day.\n *\n * So, in a layout effect after the render that changed the zone:\n *\n * - **Uncontrolled**: each value is read back as an instant in the *old* zone (what `onChange`\n * reported) and handed to Ark again in the new one, through `api.setValue`. That may land on\n * another calendar day near midnight, which is the point. `pendingRef` marks the echo so the\n * root doesn't report it through `onChange`.\n * - **Controlled**: nothing to do. The root re-derives Ark's `value` from the app's `Date`s in\n * the new zone on every render, which is already the same instant.\n * - **Focus**: the machine's focused day (the keyboard's roving cell, and the month on show)\n * follows its anchor, the selection or else today, when it sat on that anchor before the\n * change. A month the user navigated to stays put. `setFocusedValue` never moves DOM focus.\n *\n * A remount would do all of this too, but it also resets everything the user did since mount: a\n * pick goes back to `defaultValue`, typed text is cleared, and DOM focus drops to `<body>`.\n */\nexport const CalendarZoneSync = ({\n timeZone,\n controlled,\n pendingRef,\n}: {\n timeZone: string\n controlled: boolean\n pendingRef: ZoneReseedRef\n}) => {\n const api = useDatePickerContext()\n const previous = useRef({ timeZone, value: api.value })\n\n // No dependency list on purpose: the previous value has to be the one from the last render,\n // which under a controlled `value` is already the new zone's by the time the zone changes.\n useIsomorphicLayoutEffect(() => {\n const { timeZone: from, value: before } = previous.current\n previous.current = { timeZone, value: api.value }\n if (from === timeZone) return\n\n const after = controlled\n ? api.value\n : before.map((value) => dateToArkValue(calendarValueToDate(value, from), timeZone))\n if (!controlled && after.length > 0) {\n pendingRef.current = hashArkValues(after)\n api.setValue(after)\n }\n\n // `setValue` also moves the focused day onto the new value, so this runs either way: it\n // either confirms that move or puts back a month the user had navigated to.\n const anchorBefore = before[0] ?? today(from)\n const focused = api.focusedValue\n api.setFocusedValue(isSameDay(focused, anchorBefore) ? (after[0] ?? today(timeZone)) : focused)\n })\n\n return null\n}\n","\"use client\"\n\nimport { DatePicker as Ark, type DatePickerDateView as DateView } from \"@ark-ui/react/date-picker\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { type ComponentProps, type ReactNode, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { DatePredicate } from \"../../lib/date-predicates\"\nimport {\n calendarValueToDate,\n type DateRangeValue,\n dateToArkValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { useTimeZone } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { CalendarBody, type CalendarBodyClassNames, type CalendarIcons } from \"./calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"./calendar-zone-sync\"\n\n/**\n * Calendar — the inline month grid (RFC §9, `docs/rfcs/date-picker.md`): Ark's `date-picker`\n * machine rendered `inline` (no trigger/popover), wrapping the shared `CalendarBody` grid that\n * `DatePicker` will later reuse verbatim inside its own popover.\n *\n * - Value is a native `Date | null` (or `{ start, end }` under `range`) — the machine's\n * `DateValue` array contract never leaks out; `lib/date-value.ts` is the one conversion\n * boundary both directions go through.\n * - Controlled/uncontrolled `value` / `defaultValue` / `onChange` go straight to Ark's own\n * machine, which supports both natively — no `useUncontrolled` needed here.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s and are adapted to Ark's\n * `DateValue`-based signature at this boundary; pair with the `lib/date-predicates.ts`\n * helpers (`disablePast()`, `disableWeekends()`, …).\n * - No `label` / `description` / `error` / `FieldShell` wrap — `Calendar` is a bare widget\n * (like `Table`), not a form field. A `DatePicker` popover is where a field wrapper belongs.\n *\n * <Calendar value={date} onChange={setDate} isDateUnavailable={disableWeekends()} />\n */\n\nexport type CalendarClassNames = CalendarBodyClassNames & {\n /** The outermost `Ark.Root` element. */\n root?: string\n}\n\n/** Ark's own `translations` prop type, derived structurally rather than imported by name —\n * `IntlTranslations` lives in `@zag-js/date-picker`, a transitive dependency of the\n * `@ark-ui/react` peer dep, not one this package declares itself. */\ntype ArkTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\n/** The subset `CalendarBody`'s rendered anatomy actually exercises — `trigger`/`clearTrigger`\n * only apply when composed under `DatePicker` (a bare `Calendar` never renders a trigger/clear\n * button; harmless no-op keys there). Unset keys fall back to Ark's own English text. */\nexport type CalendarTranslations = Pick<\n ArkTranslations,\n | \"dayCell\"\n | \"trigger\"\n | \"viewTrigger\"\n | \"prevTrigger\"\n | \"nextTrigger\"\n | \"clearTrigger\"\n | \"content\"\n | \"weekColumnHeader\"\n | \"weekNumberCell\"\n>\n\n/** Passes a partial override straight through to `Ark.Root`. Ark's `translations` prop is\n * itself all-optional (since @ark-ui/react 5.38.2), so unset keys fall back to Ark's own\n * English defaults and this kit no longer keeps a copy of them to merge over. That copy was\n * load-bearing when the prop demanded every key at once; keeping it now would only let a\n * stale duplicate override Ark's upstream fixes — which is exactly what happened to\n * `viewTrigger`, whose day-view label named the wrong target view until Ark corrected it. */\nexport const resolveCalendarTranslations = (\n overrides?: Partial<CalendarTranslations>,\n): ArkTranslations | undefined => overrides\n\n/** What `renderDay` is told about the day it decorates. */\nexport type CalendarDayState = {\n /** The day can't be picked: `isDateUnavailable`, or outside `min`/`max`. */\n unavailable: boolean\n /** The day is selected, or is one end of the selected range. */\n selected: boolean\n /** @deprecated Renamed `unavailable`. Removed in the next minor. */\n isUnavailable: boolean\n /** @deprecated Renamed `selected`. Removed in the next minor. */\n isSelected: boolean\n}\n\n/** Builds `renderDay`'s state; reading a deprecated `is*` key warns once in development. */\nconst dayState = (day: { isUnavailable: boolean; isSelected: boolean }): CalendarDayState => ({\n unavailable: day.isUnavailable,\n selected: day.isSelected,\n get isUnavailable() {\n warnRenamedProp(\"Calendar renderDay\", \"isUnavailable\", \"unavailable\")\n return day.isUnavailable\n },\n get isSelected() {\n warnRenamedProp(\"Calendar renderDay\", \"isSelected\", \"selected\")\n return day.isSelected\n },\n})\n\nexport type CalendarProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n HTMLDivElement\n> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Months shown side by side. Default 1. */\n numOfMonths?: number\n /** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.\n * Called with this component's own resolved `timeZone` as its second argument, so a predicate\n * reads the candidate day in the same zone the grid renders it in. */\n isDateUnavailable?: DatePredicate\n /** Earliest selectable day; earlier days render unavailable and navigation stops there. */\n min?: Date\n /** Latest selectable day; later days render unavailable and navigation stops there. */\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"` for a month-only\n * picker that never drills into individual days). */\n minView?: DateView\n /** The widest view the header's view switch can climb to (`\"day\"`, `\"month\"` or `\"year\"`). */\n maxView?: DateView\n /** Per-day decoration slot — the \"event dot\" (RFC §9). `ctx` says whether the day is\n * `unavailable` or `selected`. */\n renderDay?: (date: Date, ctx: CalendarDayState) => ReactNode\n /** Always render 6 week rows (padding with adjacent-month days) instead of however many the\n * visible month(s) actually span (4–6) — keeps the grid's height constant while navigating\n * between months. */\n fixedWeeks?: boolean\n /** Adds a leading column with each row's week number. */\n withWeekNumbers?: boolean\n /** Overrides the active locale context. Drives month/day names and first-day-of-week. */\n locale?: string\n /** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Schedule` — **not** Ark's\n * own machine default (`\"UTC\"`), which is why the resolved zone is forwarded to `Ark.Root`\n * explicitly rather than only used in this component's own conversions (see\n * `lib/date-value.ts`'s module doc). Accepts `\"auto\"` to follow the host zone. */\n timeZone?: string\n /** Overrides Ark's own built-in aria-label/accessible-name strings (day cells, prev/next, the\n * view-cycling header, week numbers) — English by default. Unlike `locale`, nothing here\n * auto-derives; supply your own translated strings. Partial — unset keys keep Ark's default. */\n translations?: Partial<CalendarTranslations>\n /** Replaces the default icons: `prev`, `next`. The kit's chevrons mirror under RTL; an\n * icon passed here is drawn as given. */\n icons?: CalendarIcons\n /** Cell and text size, off the kit's `xs`–`xl` scale. Default `\"md\"`. */\n size?: Size\n className?: string\n classNames?: CalendarClassNames\n }\n\nexport const Calendar = <Range extends boolean = false>({\n range,\n value,\n defaultValue,\n onChange,\n onBlur,\n numOfMonths = 1,\n isDateUnavailable,\n min,\n max,\n minView,\n maxView,\n renderDay,\n fixedWeeks,\n withWeekNumbers,\n locale,\n timeZone,\n translations,\n icons,\n size = \"md\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n className,\n classNames,\n testId,\n}: CalendarProps<Range>) => {\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = useTimeZone(timeZone)\n const isRange = Boolean(range)\n const zoneReseed = useRef<string | null>(null)\n\n return (\n <Ark.Root\n inline\n ref={ref}\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n value={toArkValues(value, resolvedTimeZone)}\n defaultValue={toArkValues(defaultValue, resolvedTimeZone)}\n onValueChange={(details) => {\n // A zone change re-expresses the selection in the new zone; that echo is not a change.\n if (zoneReseed.current === hashArkValues(details.value)) {\n zoneReseed.current = null\n return\n }\n // The machine's value is a plain DateValue[]; `range` is a runtime flag here, so narrow\n // the result back to the caller's declared shape.\n onChange?.(\n fromArkValues(details.value, isRange, resolvedTimeZone) as Range extends true\n ? DateRangeValue\n : Date | null,\n )\n }}\n onBlur={onBlur}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n // Ark's own prop — its name doesn't follow this kit's `withX` convention, so it stays\n // `showWeekNumbers` even though our public prop is `withWeekNumbers`.\n showWeekNumbers={withWeekNumbers}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(calendarValueToDate(dateValue, resolvedTimeZone), resolvedTimeZone)\n : undefined\n }\n min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}\n minView={minView}\n maxView={maxView}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={invalid}\n name={name}\n className={cn(\"inline-flex flex-col\", className, classNames?.root)}\n {...props({ \"data-testid\": testId })}\n >\n {/* The machine looks up the currently-focused cell by querying inside the `Content` part\n * (`getFocusedCell` scopes its DOM query to `getContentEl`) to call `.focus()` on it after\n * every arrow-key/Home/End/PageUp/PageDown press — even though `inline` never opens a real\n * popover, that lookup still runs, and with no `Content` element in the DOM at all it\n * always finds nothing, so keyboard navigation updates the machine's internal focus state\n * (visible via `data-focus`) but never moves real DOM focus. `inline` implies `open` (the\n * machine treats it as permanently open), so `Content`'s `hidden={!open}` never hides this. */}\n {/* Ark reads `defaultValue` once, at mount, so a zone change (`timeZone=\"auto\"` going from\n * the UTC hydration snapshot to the host zone, or the app's provider changing) would leave\n * the selection on the old zone's day. This re-seeds it on the same instant in place;\n * see `calendar-zone-sync.tsx` for why it isn't a remount. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={value !== undefined}\n pendingRef={zoneReseed}\n />\n <Ark.Content>\n <CalendarBody\n numOfMonths={numOfMonths}\n withWeekNumbers={withWeekNumbers}\n renderDay={renderDay && ((date, day) => renderDay(date, dayState(day)))}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames}\n icons={icons}\n />\n </Ark.Content>\n </Ark.Root>\n )\n}\n"]}
@@ -0,0 +1,129 @@
1
+ import { props } from './chunk-WYCMIIRR.js';
2
+ import { focusStyles } from './chunk-C6NVU4F7.js';
3
+ import { cn } from './chunk-4ASNIDV7.js';
4
+ import { ark } from '@ark-ui/react';
5
+ import { cva } from 'class-variance-authority';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var themeIconVariants = cva(
9
+ [
10
+ "inline-flex items-center justify-center",
11
+ "aspect-square shrink-0 select-none",
12
+ "rounded-lg border",
13
+ "[&_svg]:shrink-0 [&_svg]:pointer-events-none",
14
+ // Inert on the default non-focusable <div>; applies once `asChild`
15
+ // renders ThemeIcon onto a real <a>/<button>. See `focusStyles`.
16
+ focusStyles()
17
+ ],
18
+ {
19
+ variants: {
20
+ variant: {
21
+ // A translucent wash of `--c-solid` (not the opaque token) so the
22
+ // fill blends with whatever surface it sits on instead of reading
23
+ // as a painted CTA block. The border mixes in black on top of that
24
+ // same var — a fixed darkening, not another opacity step of it —
25
+ // so it reads as a recessed edge in both themes; some colors (neutral
26
+ // in particular) have a dark-mode `--c-solid` that's lighter than
27
+ // its own soft/text steps, which would flip a same-var-opacity
28
+ // border the wrong way. This is the ThemeIcon-specific reading of
29
+ // "filled": raised, not loud. Button/Badge/ActionIcon's `filled`
30
+ // (opaque bg-(--c-solid)) would look like a button here —
31
+ // intentionally not reused.
32
+ filled: "bg-(--c-solid)/15 text-(--c-text) border-[color-mix(in_oklab,var(--c-solid)_35%,black_65%)]",
33
+ // `light`, `outline` and `subtle` paint through two local properties,
34
+ // `--theme-icon-fill` and `--theme-icon-glyph`, and only the
35
+ // properties change per theme and palette. The `bg-*`/`text-*` stay
36
+ // plain utilities, so a caller's `className` colour replaces them
37
+ // through `cn`: a `dark:` or `data-color` text class would outrank it.
38
+ //
39
+ // Figma tints a hued tile with its solid shade at 30%
40
+ // (`bg-<hue>-secondary`), as Badge's `light` does: `--c-soft` is the
41
+ // -50/-950 end of the scale and fades into the page in both themes.
42
+ // The dark glyph is that solid shade (`fg-<hue>-primary`); the light
43
+ // theme draws it in the palette's text step instead, as Badge does,
44
+ // since a -500 glyph on its own tint over white falls under 3:1 for
45
+ // yellow, orange and green. Neutral (also the no-`color` default,
46
+ // which resolves to the neutral mirror on :root) fills with the
47
+ // black/white-16 overlay its own `--c-soft` already is, and draws its
48
+ // glyph in the solid black/white.
49
+ light: [
50
+ "bg-(--theme-icon-fill) text-(--theme-icon-glyph) border-transparent",
51
+ "[--theme-icon-fill:color-mix(in_oklab,var(--c-solid)_30%,transparent)] [--theme-icon-glyph:var(--c-text)] dark:[--theme-icon-glyph:var(--c-solid)]",
52
+ "not-data-color:[--theme-icon-fill:var(--c-soft)] data-[color=neutral]:[--theme-icon-fill:var(--c-soft)] data-[color=gray]:[--theme-icon-fill:var(--c-soft)]",
53
+ "not-data-color:[--theme-icon-glyph:var(--c-solid)] data-[color=neutral]:[--theme-icon-glyph:var(--c-solid)] data-[color=gray]:[--theme-icon-glyph:var(--c-solid)]"
54
+ ],
55
+ // A hued glyph takes the palette's text step (Figma `fg-<hue>-secondary`,
56
+ // the -300). Neutral's text step is the 80% secondary white, but Figma
57
+ // draws its glyph in `fg-primary` — full white, which is neutral's
58
+ // solid shade (black in the light theme).
59
+ outline: [
60
+ "bg-transparent text-(--theme-icon-glyph) border-(--c-solid) [--theme-icon-glyph:var(--c-text)]",
61
+ "not-data-color:[--theme-icon-glyph:var(--c-solid)] data-[color=neutral]:[--theme-icon-glyph:var(--c-solid)] data-[color=gray]:[--theme-icon-glyph:var(--c-solid)]"
62
+ ],
63
+ subtle: [
64
+ "bg-transparent text-(--theme-icon-glyph) border-transparent [--theme-icon-glyph:var(--c-text)]",
65
+ "not-data-color:[--theme-icon-glyph:var(--c-solid)] data-[color=neutral]:[--theme-icon-glyph:var(--c-solid)] data-[color=gray]:[--theme-icon-glyph:var(--c-solid)]"
66
+ ],
67
+ // Palette-independent neutral surface. Unlike ActionIcon's
68
+ // high-contrast inverted `default` (a black/white button look),
69
+ // this stays a muted card in both themes. It sits on the kit's
70
+ // translucent surface (the quiet `bg-black/3 dark:bg-white/4` fill
71
+ // `Kbd` and `Card` share, edged with Figma's `border-secondary`,
72
+ // `dark:border-white/16`) rather than an opaque gray step, so the tile
73
+ // reads on whatever surface hosts it. Light mode darkens because a
74
+ // bare `bg-white/4` vanishes on a near-white page.
75
+ default: [
76
+ "bg-black/3 text-brand-900/70 border-brand-900/20",
77
+ "dark:bg-white/4 dark:text-white/80 dark:border-white/16"
78
+ ]
79
+ },
80
+ // Figma (ThemeIcon, node 17583-16687): the glyph is 12/14/16/18/22px in
81
+ // a 28/32/36/40/48px tile — under half the tile, so the tile reads as a
82
+ // frame around the icon, not as the icon's own padding.
83
+ size: {
84
+ xs: "h-7 [&_svg]:size-3",
85
+ sm: "h-8 [&_svg]:size-3.5",
86
+ md: "h-9 [&_svg]:size-4",
87
+ lg: "h-10 [&_svg]:size-4.5",
88
+ xl: "h-12 [&_svg]:size-5.5"
89
+ },
90
+ radius: {
91
+ xs: "rounded-xs",
92
+ sm: "rounded-sm",
93
+ md: "rounded-md",
94
+ lg: "rounded-lg",
95
+ xl: "rounded-xl",
96
+ full: "rounded-full"
97
+ }
98
+ },
99
+ defaultVariants: {
100
+ variant: "default",
101
+ size: "md",
102
+ radius: "md"
103
+ }
104
+ }
105
+ );
106
+ var ThemeIcon = ({
107
+ className,
108
+ variant,
109
+ size,
110
+ radius,
111
+ color,
112
+ asChild,
113
+ testId,
114
+ ...rest
115
+ }) => /* @__PURE__ */ jsx(
116
+ ark.div,
117
+ {
118
+ asChild,
119
+ "data-color": color,
120
+ "data-variant": variant ?? "default",
121
+ className: cn(themeIconVariants({ variant, size, radius }), className),
122
+ ...props({ "data-testid": testId }),
123
+ ...rest
124
+ }
125
+ );
126
+
127
+ export { ThemeIcon };
128
+ //# sourceMappingURL=chunk-F374BNL4.js.map
129
+ //# sourceMappingURL=chunk-F374BNL4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/theme-icon/theme-icon.tsx"],"names":[],"mappings":";;;;;;;AAuBA,IAAM,iBAAA,GAAoB,GAAA;AAAA,EACxB;AAAA,IACE,yCAAA;AAAA,IACA,oCAAA;AAAA,IACA,mBAAA;AAAA,IACA,8CAAA;AAAA;AAAA;AAAA,IAGA,WAAA;AAAY,GACd;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAYP,MAAA,EACE,6FAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAiBF,KAAA,EAAO;AAAA,UACL,qEAAA;AAAA,UACA,oJAAA;AAAA,UACA,6JAAA;AAAA,UACA;AAAA,SACF;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA,OAAA,EAAS;AAAA,UACP,gGAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,MAAA,EAAQ;AAAA,UACN,gGAAA;AAAA,UACA;AAAA,SACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QASA,OAAA,EAAS;AAAA,UACP,kDAAA;AAAA,UACA;AAAA;AACF,OACF;AAAA;AAAA;AAAA;AAAA,MAIA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,oBAAA;AAAA,QACJ,EAAA,EAAI,sBAAA;AAAA,QACJ,EAAA,EAAI,oBAAA;AAAA,QACJ,EAAA,EAAI,uBAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACN;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM,IAAA;AAAA,MACN,MAAA,EAAQ;AAAA;AACV;AAEJ,CAAA;AAaO,IAAM,YAAY,CAAC;AAAA,EACxB,SAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IACC,OAAA;AAAA,IACA,YAAA,EAAY,KAAA;AAAA,IACZ,gBAAc,OAAA,IAAW,SAAA;AAAA,IACzB,SAAA,EAAW,GAAG,iBAAA,CAAkB,EAAE,SAAS,IAAA,EAAM,MAAA,EAAQ,CAAA,EAAG,SAAS,CAAA;AAAA,IACpE,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN","file":"chunk-F374BNL4.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\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\"\n\n/**\n * ThemeIcon — square, non-interactive icon-display box. Visually related to\n * `ActionIcon` (same size/radius scales) but deliberately **not** its\n * (variant × color) look: every variant here is a muted, low-saturation\n * surface — just enough contrast to read as \"raised above the page,\" never\n * a vivid CTA-style fill. There's no hover state and no cursor affordance,\n * because this is a display, not a control.\n *\n * `asChild` renders the single child as the root, so it composes on top of\n * an interactive element (e.g. wrap a `Link`) when the icon itself needs to\n * be clickable. The kit's focus ring (`focusStyles`) rides along for that\n * case and stays inert on the default `<div>` — but reach for `ActionIcon`\n * when an interactive icon is the common case, since it also supplies the\n * `aria-label`, disabled and loading handling a real trigger needs.\n */\nconst themeIconVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"aspect-square shrink-0 select-none\",\n \"rounded-lg border\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n // Inert on the default non-focusable <div>; applies once `asChild`\n // renders ThemeIcon onto a real <a>/<button>. See `focusStyles`.\n focusStyles(),\n ],\n {\n variants: {\n variant: {\n // A translucent wash of `--c-solid` (not the opaque token) so the\n // fill blends with whatever surface it sits on instead of reading\n // as a painted CTA block. The border mixes in black on top of that\n // same var — a fixed darkening, not another opacity step of it —\n // so it reads as a recessed edge in both themes; some colors (neutral\n // in particular) have a dark-mode `--c-solid` that's lighter than\n // its own soft/text steps, which would flip a same-var-opacity\n // border the wrong way. This is the ThemeIcon-specific reading of\n // \"filled\": raised, not loud. Button/Badge/ActionIcon's `filled`\n // (opaque bg-(--c-solid)) would look like a button here —\n // intentionally not reused.\n filled:\n \"bg-(--c-solid)/15 text-(--c-text) border-[color-mix(in_oklab,var(--c-solid)_35%,black_65%)]\",\n // `light`, `outline` and `subtle` paint through two local properties,\n // `--theme-icon-fill` and `--theme-icon-glyph`, and only the\n // properties change per theme and palette. The `bg-*`/`text-*` stay\n // plain utilities, so a caller's `className` colour replaces them\n // through `cn`: a `dark:` or `data-color` text class would outrank it.\n //\n // Figma tints a hued tile with its solid shade at 30%\n // (`bg-<hue>-secondary`), as Badge's `light` does: `--c-soft` is the\n // -50/-950 end of the scale and fades into the page in both themes.\n // The dark glyph is that solid shade (`fg-<hue>-primary`); the light\n // theme draws it in the palette's text step instead, as Badge does,\n // since a -500 glyph on its own tint over white falls under 3:1 for\n // yellow, orange and green. Neutral (also the no-`color` default,\n // which resolves to the neutral mirror on :root) fills with the\n // black/white-16 overlay its own `--c-soft` already is, and draws its\n // glyph in the solid black/white.\n light: [\n \"bg-(--theme-icon-fill) text-(--theme-icon-glyph) border-transparent\",\n \"[--theme-icon-fill:color-mix(in_oklab,var(--c-solid)_30%,transparent)] [--theme-icon-glyph:var(--c-text)] dark:[--theme-icon-glyph:var(--c-solid)]\",\n \"not-data-color:[--theme-icon-fill:var(--c-soft)] data-[color=neutral]:[--theme-icon-fill:var(--c-soft)] data-[color=gray]:[--theme-icon-fill:var(--c-soft)]\",\n \"not-data-color:[--theme-icon-glyph:var(--c-solid)] data-[color=neutral]:[--theme-icon-glyph:var(--c-solid)] data-[color=gray]:[--theme-icon-glyph:var(--c-solid)]\",\n ],\n // A hued glyph takes the palette's text step (Figma `fg-<hue>-secondary`,\n // the -300). Neutral's text step is the 80% secondary white, but Figma\n // draws its glyph in `fg-primary` — full white, which is neutral's\n // solid shade (black in the light theme).\n outline: [\n \"bg-transparent text-(--theme-icon-glyph) border-(--c-solid) [--theme-icon-glyph:var(--c-text)]\",\n \"not-data-color:[--theme-icon-glyph:var(--c-solid)] data-[color=neutral]:[--theme-icon-glyph:var(--c-solid)] data-[color=gray]:[--theme-icon-glyph:var(--c-solid)]\",\n ],\n subtle: [\n \"bg-transparent text-(--theme-icon-glyph) border-transparent [--theme-icon-glyph:var(--c-text)]\",\n \"not-data-color:[--theme-icon-glyph:var(--c-solid)] data-[color=neutral]:[--theme-icon-glyph:var(--c-solid)] data-[color=gray]:[--theme-icon-glyph:var(--c-solid)]\",\n ],\n // Palette-independent neutral surface. Unlike ActionIcon's\n // high-contrast inverted `default` (a black/white button look),\n // this stays a muted card in both themes. It sits on the kit's\n // translucent surface (the quiet `bg-black/3 dark:bg-white/4` fill\n // `Kbd` and `Card` share, edged with Figma's `border-secondary`,\n // `dark:border-white/16`) rather than an opaque gray step, so the tile\n // reads on whatever surface hosts it. Light mode darkens because a\n // bare `bg-white/4` vanishes on a near-white page.\n default: [\n \"bg-black/3 text-brand-900/70 border-brand-900/20\",\n \"dark:bg-white/4 dark:text-white/80 dark:border-white/16\",\n ],\n },\n // Figma (ThemeIcon, node 17583-16687): the glyph is 12/14/16/18/22px in\n // a 28/32/36/40/48px tile — under half the tile, so the tile reads as a\n // frame around the icon, not as the icon's own padding.\n size: {\n xs: \"h-7 [&_svg]:size-3\",\n sm: \"h-8 [&_svg]:size-3.5\",\n md: \"h-9 [&_svg]:size-4\",\n lg: \"h-10 [&_svg]:size-4.5\",\n xl: \"h-12 [&_svg]:size-5.5\",\n },\n radius: {\n xs: \"rounded-xs\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n radius: \"md\",\n },\n },\n)\n\nexport type ThemeIconVariant = NonNullable<VariantProps<typeof themeIconVariants>[\"variant\"]>\nexport type ThemeIconSize = NonNullable<VariantProps<typeof themeIconVariants>[\"size\"]>\nexport type ThemeIconRadius = NonNullable<VariantProps<typeof themeIconVariants>[\"radius\"]>\n\nexport type ThemeIconProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof themeIconVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n }\n\nexport const ThemeIcon = ({\n className,\n variant,\n size,\n radius,\n color,\n asChild,\n testId,\n ...rest\n}: ThemeIconProps) => (\n <ark.div\n asChild={asChild}\n data-color={color}\n data-variant={variant ?? \"default\"}\n className={cn(themeIconVariants({ variant, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n"]}