@42-central/ui-react 0.26.0 → 0.28.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 (220) hide show
  1. package/dist/{chunk-YZJUPYPO.js → chunk-2W7H43WL.js} +3 -3
  2. package/dist/{chunk-YZJUPYPO.js.map → chunk-2W7H43WL.js.map} +1 -1
  3. package/dist/{chunk-OVT2KZHY.js → chunk-3KARNPW4.js} +3 -3
  4. package/dist/{chunk-OVT2KZHY.js.map → chunk-3KARNPW4.js.map} +1 -1
  5. package/dist/chunk-6B2GNPJP.js +43 -0
  6. package/dist/chunk-6B2GNPJP.js.map +1 -0
  7. package/dist/{chunk-E52Z2FKU.js → chunk-7BY5I2RB.js} +3 -3
  8. package/dist/{chunk-E52Z2FKU.js.map → chunk-7BY5I2RB.js.map} +1 -1
  9. package/dist/{chunk-JFB6O7IY.js → chunk-7KFUFAVP.js} +4 -4
  10. package/dist/{chunk-JFB6O7IY.js.map → chunk-7KFUFAVP.js.map} +1 -1
  11. package/dist/{chunk-X3YIHN2U.js → chunk-ASKQ6N5V.js} +3 -3
  12. package/dist/{chunk-X3YIHN2U.js.map → chunk-ASKQ6N5V.js.map} +1 -1
  13. package/dist/{chunk-6IRMKF5T.js → chunk-B4GNSSHU.js} +4 -4
  14. package/dist/{chunk-6IRMKF5T.js.map → chunk-B4GNSSHU.js.map} +1 -1
  15. package/dist/{chunk-BMEJBY6H.js → chunk-B5YHYI7E.js} +22 -27
  16. package/dist/chunk-B5YHYI7E.js.map +1 -0
  17. package/dist/{chunk-PT22KEVD.js → chunk-BGDVUC3B.js} +5 -5
  18. package/dist/{chunk-PT22KEVD.js.map → chunk-BGDVUC3B.js.map} +1 -1
  19. package/dist/{chunk-7247WBTV.js → chunk-DJ72KP32.js} +3 -3
  20. package/dist/{chunk-7247WBTV.js.map → chunk-DJ72KP32.js.map} +1 -1
  21. package/dist/{chunk-7OGZT7U2.js → chunk-G3AD3NJG.js} +3 -3
  22. package/dist/{chunk-7OGZT7U2.js.map → chunk-G3AD3NJG.js.map} +1 -1
  23. package/dist/{chunk-276RL7FX.js → chunk-GJFCIG34.js} +8 -8
  24. package/dist/{chunk-276RL7FX.js.map → chunk-GJFCIG34.js.map} +1 -1
  25. package/dist/{chunk-JDPVD2YE.js → chunk-HCHGERDB.js} +3 -3
  26. package/dist/{chunk-JDPVD2YE.js.map → chunk-HCHGERDB.js.map} +1 -1
  27. package/dist/{chunk-H7WOMZXO.js → chunk-HWBFRDX7.js} +16 -8
  28. package/dist/chunk-HWBFRDX7.js.map +1 -0
  29. package/dist/{chunk-LYGOFMXJ.js → chunk-I4IJOLNA.js} +4 -4
  30. package/dist/{chunk-LYGOFMXJ.js.map → chunk-I4IJOLNA.js.map} +1 -1
  31. package/dist/{chunk-7B44J3CF.js → chunk-I53TMAV2.js} +6 -6
  32. package/dist/{chunk-7B44J3CF.js.map → chunk-I53TMAV2.js.map} +1 -1
  33. package/dist/{chunk-DSZF2TW6.js → chunk-IA6DCC3N.js} +6 -6
  34. package/dist/{chunk-DSZF2TW6.js.map → chunk-IA6DCC3N.js.map} +1 -1
  35. package/dist/{chunk-QEAF57ZQ.js → chunk-ISX3AM32.js} +3 -3
  36. package/dist/{chunk-QEAF57ZQ.js.map → chunk-ISX3AM32.js.map} +1 -1
  37. package/dist/{chunk-N42EFOML.js → chunk-K3FZHYJL.js} +6 -6
  38. package/dist/chunk-K3FZHYJL.js.map +1 -0
  39. package/dist/{chunk-ZVECQBGG.js → chunk-KNGSO7A3.js} +41 -13
  40. package/dist/chunk-KNGSO7A3.js.map +1 -0
  41. package/dist/{chunk-NLSJ6T7V.js → chunk-KYVXPSNW.js} +4 -4
  42. package/dist/{chunk-NLSJ6T7V.js.map → chunk-KYVXPSNW.js.map} +1 -1
  43. package/dist/{chunk-J2NW7JID.js → chunk-L5GH7LLD.js} +3 -3
  44. package/dist/{chunk-J2NW7JID.js.map → chunk-L5GH7LLD.js.map} +1 -1
  45. package/dist/{chunk-THGJLR5S.js → chunk-NNPSBC7O.js} +5 -5
  46. package/dist/{chunk-THGJLR5S.js.map → chunk-NNPSBC7O.js.map} +1 -1
  47. package/dist/{chunk-YMVUQ2L7.js → chunk-P7SH3XWY.js} +6 -6
  48. package/dist/chunk-P7SH3XWY.js.map +1 -0
  49. package/dist/{chunk-2CL3FKEY.js → chunk-QEMXXQQO.js} +3 -3
  50. package/dist/{chunk-2CL3FKEY.js.map → chunk-QEMXXQQO.js.map} +1 -1
  51. package/dist/{chunk-2NTCQIRP.js → chunk-QRNQQIQM.js} +5 -5
  52. package/dist/{chunk-2NTCQIRP.js.map → chunk-QRNQQIQM.js.map} +1 -1
  53. package/dist/{chunk-LKFHUDEW.js → chunk-QVOBLRCM.js} +3 -3
  54. package/dist/{chunk-LKFHUDEW.js.map → chunk-QVOBLRCM.js.map} +1 -1
  55. package/dist/{chunk-E3XLWMEB.js → chunk-RKCUXOU2.js} +4 -4
  56. package/dist/{chunk-E3XLWMEB.js.map → chunk-RKCUXOU2.js.map} +1 -1
  57. package/dist/{chunk-DMI4KS32.js → chunk-SBZJGFZ6.js} +3 -3
  58. package/dist/{chunk-DMI4KS32.js.map → chunk-SBZJGFZ6.js.map} +1 -1
  59. package/dist/{chunk-7P32XCEU.js → chunk-SLUOF7XW.js} +2 -2
  60. package/dist/chunk-SLUOF7XW.js.map +1 -0
  61. package/dist/{chunk-SCXXJDKQ.js → chunk-SP6LCCTZ.js} +21 -28
  62. package/dist/chunk-SP6LCCTZ.js.map +1 -0
  63. package/dist/{chunk-Y2G47ARQ.js → chunk-TGGNSSOJ.js} +3 -3
  64. package/dist/{chunk-Y2G47ARQ.js.map → chunk-TGGNSSOJ.js.map} +1 -1
  65. package/dist/{chunk-2TZU4LSX.js → chunk-ULF5LOBS.js} +3 -3
  66. package/dist/{chunk-2TZU4LSX.js.map → chunk-ULF5LOBS.js.map} +1 -1
  67. package/dist/{chunk-D2QIPQ74.js → chunk-W3XX7BYT.js} +2 -2
  68. package/dist/chunk-W3XX7BYT.js.map +1 -0
  69. package/dist/{chunk-F374BNL4.js → chunk-YVTM2KRR.js} +12 -8
  70. package/dist/chunk-YVTM2KRR.js.map +1 -0
  71. package/dist/colors.css +328 -0
  72. package/dist/components/action-icon/action-icon.d.ts +6 -5
  73. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  74. package/dist/components/action-icon/index.js +3 -2
  75. package/dist/components/alert/index.js +2 -2
  76. package/dist/components/app-shell/index.js +7 -6
  77. package/dist/components/app-shell/index.js.map +1 -1
  78. package/dist/components/autocomplete/index.js +4 -4
  79. package/dist/components/badge/badge.d.ts +1 -1
  80. package/dist/components/badge/badge.d.ts.map +1 -1
  81. package/dist/components/badge/index.js +2 -1
  82. package/dist/components/button/button.d.ts +11 -9
  83. package/dist/components/button/button.d.ts.map +1 -1
  84. package/dist/components/button/index.js +3 -2
  85. package/dist/components/button-multi-select/index.js +4 -3
  86. package/dist/components/button-multi-select/index.js.map +1 -1
  87. package/dist/components/button-select/index.js +4 -3
  88. package/dist/components/button-select/index.js.map +1 -1
  89. package/dist/components/calendar/index.js +4 -3
  90. package/dist/components/calendar-heatmap/index.js +2 -2
  91. package/dist/components/camera/index.js +11 -10
  92. package/dist/components/clipboard/index.js +3 -2
  93. package/dist/components/clipboard/index.js.map +1 -1
  94. package/dist/components/code-block/chrome.js +5 -5
  95. package/dist/components/code-block/index.js +6 -6
  96. package/dist/components/combobox/index.js +4 -4
  97. package/dist/components/combobox-list/index.js +6 -6
  98. package/dist/components/data-table/data-table-features.d.ts +8 -0
  99. package/dist/components/data-table/data-table-features.d.ts.map +1 -1
  100. package/dist/components/data-table/data-table-group.d.ts +128 -0
  101. package/dist/components/data-table/data-table-group.d.ts.map +1 -0
  102. package/dist/components/data-table/data-table-grouping.d.ts +72 -0
  103. package/dist/components/data-table/data-table-grouping.d.ts.map +1 -0
  104. package/dist/components/data-table/data-table-icons.d.ts +4 -2
  105. package/dist/components/data-table/data-table-icons.d.ts.map +1 -1
  106. package/dist/components/data-table/data-table-meta.d.ts +9 -0
  107. package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
  108. package/dist/components/data-table/data-table-pagination.d.ts +4 -1
  109. package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
  110. package/dist/components/data-table/data-table-schema.d.ts +4 -0
  111. package/dist/components/data-table/data-table-schema.d.ts.map +1 -1
  112. package/dist/components/data-table/data-table-stack.d.ts +16 -3
  113. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  114. package/dist/components/data-table/data-table-toolbar.d.ts +33 -2
  115. package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
  116. package/dist/components/data-table/data-table-translations.d.ts +35 -0
  117. package/dist/components/data-table/data-table-translations.d.ts.map +1 -1
  118. package/dist/components/data-table/data-table.d.ts +55 -3
  119. package/dist/components/data-table/data-table.d.ts.map +1 -1
  120. package/dist/components/data-table/index.d.ts +3 -1
  121. package/dist/components/data-table/index.d.ts.map +1 -1
  122. package/dist/components/data-table/index.js +883 -234
  123. package/dist/components/data-table/index.js.map +1 -1
  124. package/dist/components/date-picker/index.js +12 -11
  125. package/dist/components/date-picker/index.js.map +1 -1
  126. package/dist/components/download-button/index.js +4 -3
  127. package/dist/components/drawer/index.js +7 -6
  128. package/dist/components/file-item/index.js +4 -3
  129. package/dist/components/file-preview/index.js +4 -3
  130. package/dist/components/file-preview/index.js.map +1 -1
  131. package/dist/components/file-trigger/index.js +4 -3
  132. package/dist/components/file-upload/index.js +4 -3
  133. package/dist/components/file-upload/index.js.map +1 -1
  134. package/dist/components/hover-card/index.js +3 -3
  135. package/dist/components/image-cropper/index.js +4 -3
  136. package/dist/components/kbd/index.js +3 -3
  137. package/dist/components/lightbox/index.js +9 -8
  138. package/dist/components/lightbox/index.js.map +1 -1
  139. package/dist/components/menu/index.js +4 -4
  140. package/dist/components/modal/index.js +7 -6
  141. package/dist/components/multi-combobox-list/index.js +6 -6
  142. package/dist/components/multi-select/index.js +4 -4
  143. package/dist/components/nav-link/index.js +3 -3
  144. package/dist/components/nav-link/tanstack.js +3 -3
  145. package/dist/components/notification/create-notifier.d.ts.map +1 -1
  146. package/dist/components/notification/index.js +18 -6
  147. package/dist/components/notification/index.js.map +1 -1
  148. package/dist/components/notification/types.d.ts +5 -0
  149. package/dist/components/notification/types.d.ts.map +1 -1
  150. package/dist/components/number-input/index.js +4 -4
  151. package/dist/components/overlays/index.js +9 -8
  152. package/dist/components/overlays/index.js.map +1 -1
  153. package/dist/components/photo-capture/index.js +13 -12
  154. package/dist/components/photo-capture/index.js.map +1 -1
  155. package/dist/components/popover/index.js +3 -3
  156. package/dist/components/schedule/index.js +7 -6
  157. package/dist/components/schedule/index.js.map +1 -1
  158. package/dist/components/select/index.js +5 -5
  159. package/dist/components/spinner/index.js +1 -1
  160. package/dist/components/spinner/spinner.d.ts +1 -1
  161. package/dist/components/spinner/spinner.d.ts.map +1 -1
  162. package/dist/components/spotlight/index.js +11 -10
  163. package/dist/components/spotlight/index.js.map +1 -1
  164. package/dist/components/tags-input/index.js +3 -3
  165. package/dist/components/theme-icon/index.js +1 -1
  166. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  167. package/dist/components/time-input/index.js +5 -5
  168. package/dist/components/tooltip/index.js +2 -2
  169. package/dist/components/tree-multi-select/index.js +4 -4
  170. package/dist/components/tree-select/index.js +4 -4
  171. package/dist/index.js +2 -2
  172. package/dist/lib/button-colors.d.ts +25 -0
  173. package/dist/lib/button-colors.d.ts.map +1 -0
  174. package/dist/lib/overlay-container.d.ts.map +1 -1
  175. package/dist/lib/overlay-layer.d.ts +10 -3
  176. package/dist/lib/overlay-layer.d.ts.map +1 -1
  177. package/dist/theme.css +14 -6
  178. package/package.json +1 -1
  179. package/src/colors.css +328 -0
  180. package/src/components/action-icon/action-icon.test.tsx +22 -0
  181. package/src/components/action-icon/action-icon.tsx +24 -28
  182. package/src/components/badge/badge.test.tsx +53 -10
  183. package/src/components/badge/badge.tsx +64 -11
  184. package/src/components/button/button.test.tsx +41 -5
  185. package/src/components/button/button.tsx +28 -33
  186. package/src/components/data-table/data-table-features.ts +11 -0
  187. package/src/components/data-table/data-table-group.test.tsx +1007 -0
  188. package/src/components/data-table/data-table-group.tsx +474 -0
  189. package/src/components/data-table/data-table-grouping.ts +160 -0
  190. package/src/components/data-table/data-table-icons.tsx +8 -1
  191. package/src/components/data-table/data-table-meta.ts +9 -0
  192. package/src/components/data-table/data-table-pagination.tsx +5 -1
  193. package/src/components/data-table/data-table-stack.tsx +165 -43
  194. package/src/components/data-table/data-table-toolbar.tsx +110 -2
  195. package/src/components/data-table/data-table-translations.ts +44 -0
  196. package/src/components/data-table/data-table.tsx +420 -150
  197. package/src/components/data-table/index.ts +4 -0
  198. package/src/components/drawer/drawer.tsx +1 -1
  199. package/src/components/modal/modal.tsx +1 -1
  200. package/src/components/notification/create-notifier.tsx +18 -2
  201. package/src/components/notification/notify-in-modal.test.tsx +128 -0
  202. package/src/components/notification/types.ts +5 -0
  203. package/src/components/spinner/spinner.tsx +3 -3
  204. package/src/components/theme-icon/theme-icon.test.tsx +7 -0
  205. package/src/components/theme-icon/theme-icon.tsx +10 -6
  206. package/src/lib/button-colors.ts +55 -0
  207. package/src/lib/overlay-container.tsx +2 -1
  208. package/src/lib/overlay-layer.test.tsx +63 -1
  209. package/src/lib/overlay-layer.tsx +29 -6
  210. package/src/theme.css +14 -6
  211. package/src/theme.test.ts +14 -10
  212. package/dist/chunk-7P32XCEU.js.map +0 -1
  213. package/dist/chunk-BMEJBY6H.js.map +0 -1
  214. package/dist/chunk-D2QIPQ74.js.map +0 -1
  215. package/dist/chunk-F374BNL4.js.map +0 -1
  216. package/dist/chunk-H7WOMZXO.js.map +0 -1
  217. package/dist/chunk-N42EFOML.js.map +0 -1
  218. package/dist/chunk-SCXXJDKQ.js.map +0 -1
  219. package/dist/chunk-YMVUQ2L7.js.map +0 -1
  220. package/dist/chunk-ZVECQBGG.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/date-picker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EACtD,MAAMA,YAAA,CAAI,IAAA;AAAA,EACV,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,OAAOA,YAAA,CAAI,KAAA;AAAA,EACX,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,cAAcA,YAAA,CAAI,YAAA;AAAA,EAClB,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,OAAA,EAAS,WAAA;AAAA,EACT,QAAA,EAAU,YAAA;AAAA,EACV,SAAA,EAAW,OAAA;AAAA,EACX,YAAA;AAAA,EACA,QAAQ,OAAA,CAAQ;AAClB,CAAC","file":"chunk-276RL7FX.js","sourcesContent":["import { CalendarDateTime, type DateValue } from \"@internationalized/date\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport {\n dayPeriodLabels,\n fromDisplayHour,\n type HourCycle,\n is12Hour,\n} from \"../time-input/hour-cycle\"\n\n/**\n * The typed text format for `typeable` + `withTime` — all-numeric, in the locale's own field order\n * (`10/20/2026, 02:30 PM` en-US, `20/10/2026 14:30` fr-FR), so what the field shows is exactly\n * what can be typed back. Ark's own `Input` part can't carry a time: it strips every character\n * but digits and the date separator while typing, and re-applies the previous value's time over\n * whatever its `parse` returns (`preserveTime`) — so `DatePicker` renders its own `<input>` on\n * top of these two helpers instead.\n */\n\ntype DateTimeTextOptions = {\n locale: string\n hourCycle: HourCycle\n withSeconds?: boolean\n}\n\nconst formatter = ({ locale, hourCycle, withSeconds }: DateTimeTextOptions, timeZone: string) =>\n new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: withSeconds ? \"2-digit\" : undefined,\n hourCycle,\n // `parseDateTimeText` reads ASCII digits; keep the display in the same digits it can parse.\n numberingSystem: \"latn\",\n timeZone,\n })\n\nexport const formatDateTimeText = (\n value: DateValue,\n options: DateTimeTextOptions,\n timeZone: string,\n): string => formatter(options, timeZone).format(calendarValueToDate(value, timeZone))\n\ntype NumericField = \"year\" | \"month\" | \"day\" | \"hour\" | \"minute\" | \"second\"\nconst NUMERIC_FIELDS = new Set<string>([\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"])\n\n/** The locale's numeric field order, read off the same formatter `formatDateTimeText` uses. */\nconst fieldOrder = (options: DateTimeTextOptions): NumericField[] =>\n formatter(options, \"UTC\")\n .formatToParts(new Date(Date.UTC(2001, 10, 22, 13, 44, 55)))\n .map((part) => part.type)\n .filter((type): type is NumericField => NUMERIC_FIELDS.has(type))\n\n/** \"AM\"/\"PM\" from the locale's own labels (`dayPeriodLabels`), falling back to a Latin `a`/`p`. */\nconst readPeriod = (text: string, locale: string): \"AM\" | \"PM\" | undefined => {\n const lower = text.toLowerCase()\n const labels = dayPeriodLabels(locale)\n if (lower.includes(labels.PM.toLowerCase())) return \"PM\"\n if (lower.includes(labels.AM.toLowerCase())) return \"AM\"\n if (/\\bp\\.?\\s?m?\\.?\\b/.test(lower)) return \"PM\"\n if (/\\ba\\.?\\s?m?\\.?\\b/.test(lower)) return \"AM\"\n return undefined\n}\n\nconst inRange = (n: number, min: number, max: number) => Number.isInteger(n) && n >= min && n <= max\n\n/**\n * Parse typed text back into a `CalendarDateTime`. Reads digit runs in the locale's field order\n * (so any separator works — `20/10/2026 14:30`, `20.10.2026 14h30` — but run-together digits like\n * `1430` read as one number); the\n * date is required, the time is optional — omitted fields keep `fallbackTime` (the current\n * value's), else midnight. In 12h mode a missing period reads AM, and a 13–23 hour is taken as\n * 24h as-typed; under `h24`, `24` is midnight. Returns `undefined` for anything that isn't a\n * real date/time (`02/30/2026`, `25:00`), never a silently constrained one.\n */\nexport const parseDateTimeText = (\n text: string,\n options: DateTimeTextOptions,\n fallbackTime?: { hour: number; minute: number; second: number },\n): CalendarDateTime | undefined => {\n const numbers = text.match(/\\d+/g)?.map(Number) ?? []\n const order = fieldOrder(options)\n const field = (name: NumericField) => {\n const index = order.indexOf(name)\n return index === -1 ? undefined : numbers[index]\n }\n\n const rawYear = field(\"year\")\n const month = field(\"month\")\n const day = field(\"day\")\n if (rawYear === undefined || month === undefined || day === undefined) return undefined\n const year = rawYear < 100 ? 2000 + rawYear : rawYear\n\n const typedHour = field(\"hour\")\n let hour = typedHour ?? fallbackTime?.hour ?? 0\n if (typedHour !== undefined && is12Hour(options.hourCycle) && inRange(typedHour, 0, 12)) {\n hour = fromDisplayHour(typedHour, readPeriod(text, options.locale) ?? \"AM\", options.hourCycle)\n } else if (typedHour === 24 && options.hourCycle === \"h24\") {\n // `h24` shows midnight as `24` (and so formats it that way) — read it back as hour 0.\n hour = 0\n }\n const minute = field(\"minute\") ?? (typedHour === undefined ? fallbackTime?.minute : 0) ?? 0\n const second = field(\"second\") ?? (typedHour === undefined ? fallbackTime?.second : 0) ?? 0\n\n if (!inRange(month, 1, 12) || !inRange(day, 1, 31) || !inRange(year, 1, 9999)) return undefined\n if (!inRange(hour, 0, 23) || !inRange(minute, 0, 59) || !inRange(second, 0, 59)) return undefined\n const value = new CalendarDateTime(year, month, day, hour, minute, second)\n // `CalendarDateTime` constrains out-of-range days (Feb 30 → Feb 28) instead of rejecting them.\n return value.day === day ? value : undefined\n}\n","\"use client\"\n\nimport {\n DatePicker as Ark,\n type DatePickerDateRangePreset as DateRangePreset,\n type DateValue,\n type DatePickerDateView as DateView,\n type UseDatePickerContext,\n} from \"@ark-ui/react/date-picker\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { DateFormatter, toCalendarDateTime, today } from \"@internationalized/date\"\nimport { type FocusEvent, type ReactNode, type Ref, useId, useRef, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\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 { focusStyles } from \"../../lib/focus-styles\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { capitalize } from \"../../lib/graphemes\"\nimport { useLocale, useTimeZone } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { NestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button } from \"../button/button\"\nimport { type CalendarTranslations, resolveCalendarTranslations } from \"../calendar/calendar\"\nimport {\n CalendarBody,\n type CalendarBodyClassNames,\n type CalendarIcons,\n calendarGridWidth,\n} from \"../calendar/calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"../calendar/calendar-zone-sync\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n shellGap,\n} from \"../input/input\"\nimport { CalendarIcon, CloseIcon } from \"../popover/icons\"\nimport { Popover, popoverClearTrigger, popoverPanel } from \"../popover/popover\"\nimport {\n fromDisplayHour,\n type HourCycle,\n resolveHourCycle,\n toDisplayHour,\n} from \"../time-input/hour-cycle\"\nimport { TimeRow, type TimeRowTranslations, timeRowMinWidth } from \"../time-input/time-row\"\nimport { formatDateTimeText, parseDateTimeText } from \"./date-time-text\"\n\n/**\n * DatePicker — a trigger + popover calendar on Ark UI's `date-picker` machine, composing\n * `Calendar`'s shared grid module (`calendar-body.tsx`) and `TimeInput`'s shared time row\n * (`time-row.tsx`). `range` and `withTime` cover all four date combinations; `DateRangePicker`,\n * `DateTimePicker`, and `DateTimeRangePicker` are thin named presets pinning those two flags.\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, exactly as `Calendar` uses it.\n * - `withConfirm` stages the selection in local state; only Apply calls the outer `onChange`,\n * Cancel reverts. Without it, single dates commit + close on pick and ranges commit on the\n * second click (both Ark-native) — except under `withTime`, where a pick commits but keeps\n * the panel open so the time row can still be set (outside click / Escape closes it).\n * - `presets` renders a sidebar of quick-pick shortcuts — range shortcuts (Ark's own\n * `DateRangePreset` union, or a custom `{ range }`) under `range`; single-date shortcuts\n * (a custom `{ date }`) otherwise. `true` resolves to a mode-appropriate default set.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s; pair with `lib/date-predicates.ts`'s\n * helpers (`disablePast()`, `disableWeekends()`, …), re-exported from this same barrel.\n * - `typeable` swaps the plain button trigger for a text input, so a date can be typed (and\n * parsed on blur / Enter) in addition to picked from the calendar — the leading icon becomes a\n * real open-calendar button alongside it. Opt-in (default `false`); single dates only (see\n * the prop's own doc comment). Under `withTime` the input carries the time too\n * (`date-time-text.ts`).\n *\n * <DatePicker label=\"Start date\" value={date} onChange={setDate} clearable />\n * <DateRangePicker withTime presets withConfirm value={range} onChange={setRange} />\n */\n\nconst datePickerPresets = cn(\n \"flex shrink-0 flex-col gap-0.5 border-e p-1\",\n \"border-brand-900/20 dark:border-white/15\",\n)\n\nconst presetTrigger = cn(\n \"w-full cursor-pointer rounded-xs px-2 py-1.5 text-start text-sm whitespace-nowrap transition-colors\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n)\n\nconst timePanelLabel = cn(\"text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\n\n/** `typeable`'s leading calendar icon, promoted from a decorative span (the button-trigger case)\n * to a real open-calendar button — same base look as `inputSlot`, plus the family's interactive-\n * icon treatment (compare `popoverClearTrigger`). `outline-none`: the shell's own `:has()` rule\n * (`shellChrome` in `input.tsx`) already rings the *whole* control on this button's focus-visible\n * state, so its own native outline would just double up. */\nconst datePickerIconTrigger = cn(\n inputSlot,\n \"cursor-pointer rounded-xs outline-none transition-colors hover:text-brand-900/70 dark:hover:text-white/80 disabled:cursor-not-allowed\",\n)\n\n/** The main column (calendar + time row footer) has no explicit width of its own, and neither\n * does the popover above it — deliberately, so the popover sizes to its content. But once the\n * time row's Hour/Minute/(Second) fields are `flex-1` (grow to fill the row), that becomes\n * circular: the row wants to size off \"however much space is available,\" and with nothing\n * concrete above it to measure against, browsers resolve a flex container's own intrinsic width\n * generously when it holds `flex-grow` items — the row (and everything above it) ends up far\n * wider than the calendar actually needs, even for a single time row. Giving the column an\n * explicit width tied to the calendar's own geometry (`calendarGridWidth`, shared with\n * `calendar-body.tsx`'s own month/year grids) breaks that circularity: the row now grows to\n * fill a *real* width instead of an ambiguous one.\n *\n * That width is only ever tied to the *calendar* grid, though — under `withTime`, the column\n * must be at least as wide as the time row itself needs (`timeRowMinWidth`), or the same\n * `flex-1` + `min-w-0` fields that motivated a fixed width in the first place shrink below their\n * content size instead of growing: with the AM/PM toggle present at a single month, the\n * calendar-only width is narrower than Hour+Minute+Period need, and the `<input>`s get starved. */\n\nconst pad = (n: number) => String(n).padStart(2, \"0\")\n\n/** Hidden-input serialization. `DateValue#toString()` isn't safe to call directly here: a\n * `CalendarDateTime` (what our own `dateToArkValue` produces for a `defaultValue`/`value` passed\n * in) stringifies with a time, while a plain `CalendarDate` (what a day-grid click produces)\n * stringifies as a clean date — two different formats for the same picked day depending on\n * provenance. Read the wall-calendar fields directly instead. Whether to append the time portion\n * is driven by the picker's own `withTime` flag, not by whether the value happens to carry an\n * `hour` field — a `CalendarDateTime` always has one (even at local midnight), so that structural\n * check can't tell \"date-only\" from \"with time\" apart. */\nexport const serializeDateValue = (value: DateValue, withTime: boolean): string => {\n const date = `${value.year}-${pad(value.month)}-${pad(value.day)}`\n if (!withTime) return date\n const time = \"hour\" in value ? value : { hour: 0, minute: 0, second: 0 }\n return `${date}T${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}`\n}\n\nexport type DatePickerClassNames = {\n field?: string\n control?: string\n content?: string\n presets?: string\n calendar?: CalendarBodyClassNames\n timePanel?: { hour?: string; minute?: string; second?: string; period?: string }\n footer?: string\n}\n\n/** `value`/`range`-shaped entries are for `range` mode; `date`-shaped entries are for single-date\n * mode. Nothing prevents mixing them for the picker's current mode — the shape you pass is\n * trusted, not validated at runtime (a mismatched entry just doesn't produce useful behavior;\n * `api.setValue`/`getRangePresetValue` are mode-agnostic in the underlying machine). */\nexport type DatePreset =\n | { label: string; value: DateRangePreset }\n | { label: string; range: { start: Date; end: Date } | null }\n | { label: string; date: Date | null }\n\n/** Identifies each entry `getDefaultPresets` builds for `presets={true}`, so a `translations`\n * override can target one label without redefining the whole set. */\nexport type DatePickerPresetId =\n | \"today\"\n | \"yesterday\"\n | \"tomorrow\"\n | \"nextWeek\"\n | \"thisWeek\"\n | \"lastWeek\"\n | \"thisMonth\"\n | \"lastMonth\"\n | \"thisYear\"\n | \"allTime\"\n\n/** One unified `translations` prop rather than one per string source — Ark's own accessible\n * names, the `presets={true}` default labels, and the embedded time row's strings all belong to\n * the same `DatePicker` instance a consumer is localizing. English defaults throughout;\n * unset keys keep their built-in text. */\nexport type DatePickerTranslations = Partial<CalendarTranslations> &\n TimeRowTranslations & {\n /** The `withConfirm` footer's revert button. Default `\"Cancel\"`. */\n cancel?: string\n /** The `withConfirm` footer's commit button. Default `\"Apply\"`. */\n apply?: string\n /** The embedded time row's label under `range` + `withTime` (first row). Default `\"Start time\"`. */\n startTime?: string\n /** The embedded time row's label under `range` + `withTime` (second row). Default `\"End time\"`. */\n endTime?: string\n /** Individual `presets={true}` default-set labels, keyed by id — override just the ones you\n * need without redefining the whole array. Pass your own `DatePreset[]` for full control.\n * Every label but `allTime` (default `\"All time\"`) is already in the locale's words, from\n * `Intl.RelativeTimeFormat` (\"Aujourd’hui\", \"La semaine dernière\"); an override wins. */\n presets?: Partial<Record<DatePickerPresetId, string>>\n }\n\n/** The calendar's icon slots, one prop for the whole picker. */\nexport type DatePickerIcons = CalendarIcons\n\nexport type DatePickerProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n // Widened from `HTMLButtonElement` alone: under `typeable` the focusable element is Ark's\n // `Input` (a real `<input>`), not the button trigger — `ref`/`onBlur` must be able to land on\n // either depending on that prop, since both are the same generic `DatePickerProps`.\n HTMLButtonElement | HTMLInputElement\n> &\n Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Adds an embedded HOUR/MINUTE (+ SECOND) time row; the value carries H/M too. */\n withTime?: boolean\n /** Months shown side by side. Default `1`, regardless of `range` — pass `2` to show a full\n * range without paging (matches `Calendar`'s own plain default). */\n numOfMonths?: number\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 popover's height constant while\n * navigating between months. */\n fixedWeeks?: boolean\n /** Preset sidebar — range shortcuts under `range`, single-date shortcuts otherwise. `true`\n * renders a mode-appropriate default set; an array is fully custom. See `DatePreset`. */\n presets?: DatePreset[] | boolean\n /** Stage the selection; commit only on Apply. Cancel reverts to the last committed value. */\n withConfirm?: boolean\n /** Renders a clear trigger once a value is set; emits `null` (or an all-null range). */\n clearable?: boolean\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 /** Renders a text input (typing, blur-to-parse, `Enter`-to-commit) alongside the\n * calendar-icon trigger, instead of the plain button-only trigger. Opt-in — default `false`\n * keeps the click-to-open button.\n *\n * Without `withTime` this is Ark's own `Input` anatomy part (a numeric date). Under\n * `withTime` it shows and parses a numeric date + time in the locale's own field order\n * (`10/20/2026, 02:30 PM`, `20/10/2026 14:30`) — typing just a date keeps the current time.\n * `range` (cross-field validation across two inputs) is out of scope and falls back to the\n * button trigger. */\n typeable?: boolean\n min?: Date\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"`). */\n minView?: DateView\n maxView?: DateView\n /** Overrides the active locale context. Drives month/day names, first-day-of-week, and the\n * embedded time row's 12h/24h default. */\n locale?: string\n /** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Calendar` and\n * `Schedule` — **not** Ark's own machine default (`\"UTC\"`). Accepts `\"auto\"` to follow the\n * host zone. */\n timeZone?: string\n /** Force 12-hour or 24-hour display for the embedded time row, overriding the locale default. */\n format?: 12 | 24\n /** Force a specific hour cycle, overriding the locale default and `format`. */\n hourCycle?: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the embedded time row's empty Hour/Minute/Second fields — see\n * TimeRow's `placeholder`. Default `\"--\"`. */\n timePlaceholder?: string\n /** Overrides built-in English strings — Ark's own accessible names, the `presets={true}`\n * \"All time\" label, Cancel/Apply, Start/End time, and the embedded time row's Hour/Minute/\n * Second/Period labels. The other preset labels already follow `locale`, and an override\n * here still wins over them. Partial — unset keys keep their default. */\n translations?: DatePickerTranslations\n /** Replaces the calendar's default icons: `prev`, `next`, passed through to its grid like\n * `translations`. The kit's chevrons mirror under RTL; an icon passed here is drawn as given. */\n icons?: DatePickerIcons\n /** Placeholder shown while no date is selected. */\n placeholder?: string\n /** Inline-start adornment. Defaults to a calendar icon. */\n startSlot?: ReactNode\n size?: Size\n variant?: InputVariant\n /** Render the panel in a Portal so it escapes clipping ancestors.\n * Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n className?: string\n classNames?: DatePickerClassNames\n }\n\n/** `DatePicker`'s own English wording, merged once per render (`presets` one level deeper, in\n * `presetLabels`). \"All time\" is the one non-derivable preset label; every other\n * `presets={true}` label comes from `Intl.RelativeTimeFormat`. */\nconst DATE_PICKER_DEFAULT_TRANSLATIONS = {\n cancel: \"Cancel\",\n apply: \"Apply\",\n startTime: \"Start time\",\n endTime: \"End time\",\n presets: { allTime: \"All time\" },\n} as const satisfies DatePickerTranslations\n\n/** The `presets={true}` labels: the locale's own words for each relative period\n * (`Intl.RelativeTimeFormat` with `numeric: \"auto\"` — \"Aujourd’hui\", \"La semaine dernière\"),\n * capitalised for a button, then \"All time\" from the defaults, then the consumer's\n * `translations.presets`, which win over both. */\nconst presetLabels = (\n locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): Record<DatePickerPresetId, string> => {\n const relative = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" })\n const say = (value: number, unit: Intl.RelativeTimeFormatUnit) =>\n capitalize(relative.format(value, unit), locale)\n return {\n today: say(0, \"day\"),\n yesterday: say(-1, \"day\"),\n tomorrow: say(1, \"day\"),\n nextWeek: say(1, \"week\"),\n thisWeek: say(0, \"week\"),\n lastWeek: say(-1, \"week\"),\n thisMonth: say(0, \"month\"),\n lastMonth: say(-1, \"month\"),\n thisYear: say(0, \"year\"),\n ...DATE_PICKER_DEFAULT_TRANSLATIONS.presets,\n ...overrides,\n }\n}\n\n/** Ark's built-in `DateRangePreset` union has no \"today\" / \"yesterday\" / \"all time\" member\n * (confirmed in `@zag-js/date-utils`'s types) — those three are hand-built here from\n * `today(timeZone)`; the rest map straight to Ark's own string presets. The single-date set\n * (non-`range`) is a different shape entirely, not a trimmed-down copy of the range one — \"This\n * week\"/\"This month\"/etc. are inherently range-shaped and don't collapse to one date. */\nconst getDefaultPresets = (\n range: boolean,\n timeZone: string,\n locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): DatePreset[] => {\n const now = today(timeZone)\n const toDate = (value: typeof now) => calendarValueToDate(value, timeZone)\n const label = presetLabels(locale, overrides)\n if (!range) {\n return [\n { label: label.today, date: toDate(now) },\n { label: label.yesterday, date: toDate(now.subtract({ days: 1 })) },\n { label: label.tomorrow, date: toDate(now.add({ days: 1 })) },\n { label: label.nextWeek, date: toDate(now.add({ days: 7 })) },\n ]\n }\n const yesterday = now.subtract({ days: 1 })\n return [\n { label: label.today, range: { start: toDate(now), end: toDate(now) } },\n { label: label.yesterday, range: { start: toDate(yesterday), end: toDate(yesterday) } },\n { label: label.thisWeek, value: \"thisWeek\" },\n { label: label.lastWeek, value: \"lastWeek\" },\n { label: label.thisMonth, value: \"thisMonth\" },\n { label: label.lastMonth, value: \"lastMonth\" },\n { label: label.thisYear, value: \"thisYear\" },\n { label: label.allTime, range: null },\n ]\n}\n\nconst PresetsRail = ({\n presets,\n range,\n timeZone,\n locale,\n withConfirm,\n translations,\n className,\n}: {\n presets: DatePreset[] | boolean\n /** Which default set `presets === true` resolves to — irrelevant once `presets` is a concrete array. */\n range?: boolean\n timeZone: string\n /** Names the `presets === true` periods. Falls back to the `IntlProvider` locale. */\n locale?: string\n withConfirm?: boolean\n /** Overrides individual `presets={true}` default-set labels, keyed by id. No effect on a\n * custom `DatePreset[]`. */\n translations?: Partial<Record<DatePickerPresetId, string>>\n className?: string\n}) => {\n const resolvedLocale = useLocale(locale)\n const resolved =\n presets === true\n ? getDefaultPresets(Boolean(range), timeZone, resolvedLocale, translations)\n : presets === false\n ? []\n : presets\n if (resolved.length === 0) return null\n return (\n <Ark.Context>\n {(api) => (\n <div className={cn(datePickerPresets, className)}>\n {resolved.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n // Not `Ark.PresetTrigger`: its own onClick always sends `PRESET.CLICK`, which the\n // machine transitions unconditionally to \"focused\" (closed) regardless of\n // `closeOnSelect` — there's no way to keep it open under `withConfirm`. Resolve the\n // preset's value ourselves and set it via `api.setValue`, which only sets the value\n // (no state-machine transition), then close explicitly only when not staging.\n onClick={() => {\n const values =\n \"value\" in preset\n ? api.getRangePresetValue(preset.value)\n : \"range\" in preset\n ? (toArkValues(preset.range, timeZone) ?? [])\n : (toArkValues(preset.date, timeZone) ?? [])\n api.setValue(values)\n if (!withConfirm) api.setOpen(false)\n }}\n aria-label={preset.label}\n className={presetTrigger}\n >\n {preset.label}\n </button>\n ))}\n </div>\n )}\n </Ark.Context>\n )\n}\n\ntype DisplayTime = {\n hour: number | null\n minute: number | null\n second: number | null\n period: \"AM\" | \"PM\" | null\n}\n\nconst emptyDisplayTime: DisplayTime = { hour: null, minute: null, second: null, period: null }\n\n/** Derive display-space fields (the cycle's own hours, + period) from the machine's own\n * `DateValue` — a plain `CalendarDate` (no time picked yet) has no `hour`, so it reads as all-null. */\nconst toDisplayTime = (value: DateValue | undefined, cycle: HourCycle): DisplayTime => {\n if (!value || !(\"hour\" in value)) return emptyDisplayTime\n const { hour, period } = toDisplayHour(value.hour, cycle)\n return { hour, minute: value.minute, second: value.second ?? null, period }\n}\n\n/** The inverse of `toDisplayTime` — merges a display-space edit into a `setTime`-ready payload.\n * Missing fields default to midnight, same rule `TimeInput` uses for its own first edit. */\nconst fromDisplayTime = (\n display: DisplayTime,\n cycle: HourCycle,\n): { hour: number; minute: number; second?: number } => {\n const hour = fromDisplayHour(display.hour, display.period, cycle)\n const minute = display.minute ?? 0\n return display.second != null ? { hour, minute, second: display.second } : { hour, minute }\n}\n\n/** `api.setTime`, except that a time edit with no day picked yet lands on *today* instead of being\n * dropped — Ark's own `setTime` silently no-ops without a date at that index, so typing a time\n * first used to do nothing at all. Only the first row can hit that (the second is disabled until\n * a range has both ends). `setValue` keeps today within `min`/`max`, like Ark's `selectToday`;\n * a today that `isDateUnavailable` rules out isn't auto-picked. */\nconst setTimeOrToday = (\n api: UseDatePickerContext,\n time: { hour: number; minute: number; second?: number },\n index: number,\n timeZone: string,\n) => {\n if (api.value[index] || index !== 0) return api.setTime(time, index)\n const day = today(timeZone)\n if (api.isUnavailable(day)) return\n api.setValue([toCalendarDateTime(day).set(time)])\n}\n\nexport type TimePanelRowProps = {\n value: DateValue | undefined\n onSetTime: (time: { hour: number; minute: number; second?: number }) => void\n /** Visible label above the row, which also names its `role=\"group\"` (\"Start time\" / \"End\n * time\" under `range`). Without it the group is named `translations.time` (`\"Time\"`). */\n label?: string\n disabled?: boolean\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the row's empty Hour/Minute/Second fields — see TimeRow's\n * `placeholder`. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n classNames?: DatePickerClassNames[\"timePanel\"] & { root?: string }\n}\n\n/** One HOUR/MINUTE(+SECOND)+AM/PM row, bridging `TimeRow`'s display-space props to a specific\n * `api.value` index via `api.setTime(time, index)` — the same shared `TimeRow` `TimeInput`\n * wraps with its own local state, wrapped here with the machine's state instead. */\nconst TimePanelRow = ({\n value,\n onSetTime,\n label,\n disabled,\n hourCycle,\n minuteStep,\n withSeconds,\n placeholder,\n locale,\n translations,\n size,\n variant,\n classNames,\n}: TimePanelRowProps) => {\n const display = toDisplayTime(value, hourCycle)\n const patch = (partial: Partial<DisplayTime>) =>\n onSetTime(fromDisplayTime({ ...display, ...partial }, hourCycle))\n const labelId = useId()\n\n return (\n <div className={cn(\"flex flex-col gap-1\", classNames?.root)}>\n {label && (\n <span id={labelId} className={timePanelLabel}>\n {label}\n </span>\n )}\n <TimeRow\n aria-labelledby={label ? labelId : undefined}\n hour={display.hour}\n minute={display.minute}\n second={display.second}\n onHourChange={(hour) => patch({ hour })}\n onMinuteChange={(minute) => patch({ minute })}\n onSecondChange={withSeconds ? (second) => patch({ second }) : undefined}\n period={display.period}\n onPeriodChange={(period) => patch({ period })}\n hourCycle={hourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={placeholder}\n locale={locale}\n translations={translations}\n size={size}\n variant={variant}\n disabled={disabled}\n classNames={classNames}\n />\n </div>\n )\n}\n\n/**\n * `typeable` + `withTime`'s own text input, standing in for Ark's `Input` part — which can't carry\n * a time (see `date-time-text.ts`). It still declares `data-part=\"input\"` inside the Control, so\n * the machine treats it as its input: excluded from interact-outside dismissal, focused on close,\n * and kept in sync with every value change (day pick, time row, clear) through the Root's\n * `format`, which is this same numeric text. Left uncontrolled for that reason — the only thing\n * added here is committing typed text: parsed on blur / `Enter`, then set through `api.setValue`;\n * text that doesn't parse (or lands on an unavailable day) reverts to the current value.\n */\nconst DateTimeTextInput = ({\n api,\n options,\n timeZone,\n ref,\n onBlur,\n placeholder,\n disabled,\n readOnly,\n invalid,\n testId,\n}: {\n api: UseDatePickerContext\n options: Parameters<typeof parseDateTimeText>[1]\n timeZone: string\n ref?: Ref<HTMLInputElement>\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n placeholder?: string\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n testId?: string\n}) => {\n const field = useFieldContext()\n const current = api.value[0]\n const show = (input: HTMLInputElement, value: DateValue | undefined) => {\n input.value = value ? formatDateTimeText(value, options, timeZone) : \"\"\n }\n const commit = (input: HTMLInputElement) => {\n const text = input.value.trim()\n if (text === \"\") {\n if (current) api.clearValue({ focus: false })\n return\n }\n const fallback = current && \"hour\" in current ? current : undefined\n const next = parseDateTimeText(text, options, fallback)\n if (!next || api.isUnavailable(next)) return show(input, current)\n api.setValue([next])\n api.setFocusedValue(next)\n // `setValue` is a no-op (and syncs nothing) when the parsed value equals the current one, so\n // normalize the typed text to the canonical format either way.\n show(input, next)\n }\n return (\n <input\n ref={ref}\n type=\"text\"\n data-scope=\"date-picker\"\n data-part=\"input\"\n autoComplete=\"off\"\n defaultValue={current ? formatDateTimeText(current, options, timeZone) : \"\"}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n {...props({ \"aria-invalid\": invalid })}\n // Ark's own input-click handler, not `api.setOpen`: it opens with `src: \"input.click\"`,\n // which is what stops the machine from moving focus into the grid — typing has to keep\n // landing here. It also honours `openOnClick` and disabled/read-only on its own.\n onClick={api.getInputProps().onClick}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\" || event.nativeEvent.isComposing) return\n event.preventDefault()\n commit(event.currentTarget)\n }}\n onBlur={(event) => {\n if (!readOnly) commit(event.currentTarget)\n onBlur?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={inputControlClasses}\n />\n )\n}\n\nconst DatePickerImpl = <Range extends boolean = false>({\n withinPortal = true,\n container,\n range,\n withTime,\n numOfMonths = 1,\n fixedWeeks,\n presets,\n withConfirm,\n clearable,\n value,\n defaultValue,\n onChange,\n onBlur,\n isDateUnavailable,\n typeable,\n min,\n max,\n minView,\n maxView,\n locale,\n timeZone,\n format,\n hourCycle,\n minuteStep,\n withSeconds,\n timePlaceholder,\n translations,\n icons,\n placeholder = \"Pick a date\",\n startSlot,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: DatePickerProps<Range>) => {\n const portalContainer = useOverlayContainer(container)\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = useTimeZone(timeZone)\n const resolvedHourCycle = resolveHourCycle({ locale: resolvedLocale, format, hourCycle })\n const t = { ...DATE_PICKER_DEFAULT_TRANSLATIONS, ...translations }\n const isInvalid = invalid || error != null\n const isRange = Boolean(range)\n // See `typeable`'s own doc comment: single dates only — `range` silently falls back to the\n // button trigger rather than erroring, so `typeable` composes safely with every other prop.\n // Under `withTime` the input is `DateTimeTextInput` instead of Ark's own date-only `Input`.\n const showTypeableInput = Boolean(typeable) && !isRange\n const dateTimeText = { locale: resolvedLocale, hourCycle: resolvedHourCycle, withSeconds }\n const controlRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n\n type Value = Range extends true ? DateRangeValue : Date | null\n const emptyValue = (isRange ? { start: null, end: null } : null) as Value\n\n // Reserved for the `withConfirm` staged layer only — the base value needs no local state,\n // Ark's machine natively supports controlled/uncontrolled `value`/`defaultValue`/`onValueChange`\n // the same way `Calendar` relies on it.\n const [committed, setCommitted] = useUncontrolled<Value>({\n value,\n defaultValue,\n finalValue: emptyValue,\n onChange,\n })\n const [staged, setStaged] = useState<Value>(committed)\n const zoneReseed = useRef<string | null>(null)\n\n const inputMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(inputRef, ref)\n const triggerMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(triggerRef, ref)\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n // Ark's own default (`true`) auto-closes on a completed pick — under `withConfirm`\n // the picker must stay open for review until Apply/Cancel, and under `withTime` the day\n // is only half the value: closing on pick would hide the time row it still needs.\n // Otherwise leave Ark's default (single closes on pick, range on the second click).\n closeOnSelect={withConfirm || withTime ? false : undefined}\n // Ark's own default (`false`) requires the calendar-icon trigger to open the popover —\n // under `typeable` a click into the text field itself should open it too, matching the\n // combined type-or-pick affordance `typeable` is meant to offer. No-op when the Input\n // anatomy part isn't rendered (`!showTypeableInput`).\n openOnClick={showTypeableInput}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n minView={minView}\n maxView={maxView}\n value={toArkValues(withConfirm ? staged : value, resolvedTimeZone)}\n defaultValue={withConfirm ? undefined : 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 const next = fromArkValues(details.value, isRange, resolvedTimeZone) as Value\n if (withConfirm) setStaged(next)\n else onChange?.(next)\n }}\n onOpenChange={(details) => {\n if (withConfirm && details.open) setStaged(committed)\n }}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(\n calendarValueToDate(dateValue, resolvedTimeZone),\n resolvedTimeZone,\n )\n : undefined\n }\n min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}\n // The typed date+time input shows (and Ark syncs into it) the same numeric text it parses.\n format={\n withTime && showTypeableInput\n ? (date) => formatDateTimeText(date, dateTimeText, resolvedTimeZone)\n : withTime\n ? (date, { locale: fmtLocale }) =>\n new DateFormatter(fmtLocale, { dateStyle: \"medium\", timeStyle: \"short\" }).format(\n calendarValueToDate(date, resolvedTimeZone),\n )\n : undefined\n }\n // Anchor to the Control (not `sameWidth`, unlike Select) — the popover hosts a full\n // calendar grid + presets rail, which needs its own intrinsic width, not the trigger's.\n positioning={{ getAnchorRect: () => controlRef.current?.getBoundingClientRect() ?? null }}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={isInvalid}\n className={cn(\"w-full\", className)}\n >\n {/* Keeps the selection, and the typeable input's text, on the same instant when the zone\n * changes, in place rather than by remounting; see `calendar-zone-sync.tsx`. Under\n * `withConfirm` Ark's value is the staged `Date`, so it is controlled either way. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={withConfirm || value !== undefined}\n pendingRef={zoneReseed}\n />\n <Ark.Context>\n {(api) => (\n <>\n <Ark.Control\n ref={controlRef}\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": true,\n \"data-with-end-slot\": true,\n })}\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(\n inputShell({ size, variant }),\n // A real `<input>` sits in the shell under `typeable` — leave the shell's own\n // cursor at the browser default (text-cursor over the input, pointer over the\n // icon trigger / clear button) instead of forcing pointer everywhere, matching\n // `Combobox`'s Control (see `combobox.tsx`) rather than `Select`'s button-only one.\n !showTypeableInput && \"cursor-pointer\",\n classNames?.control,\n )}\n >\n {showTypeableInput ? (\n <div className={cn(\"flex min-w-0 flex-1 items-center\", shellGap[size])}>\n {/* Ark sets its own accessible `aria-label` (\"Open calendar\" / \"Close\n calendar\") on the trigger regardless of children, so an icon-only button\n here is still accessible without a manual override. */}\n <Ark.Trigger className={datePickerIconTrigger}>\n {startSlot ?? <CalendarIcon />}\n </Ark.Trigger>\n {withTime ? (\n <DateTimeTextInput\n api={api}\n options={dateTimeText}\n timeZone={resolvedTimeZone}\n ref={inputMergedRef}\n onBlur={onBlur}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n invalid={isInvalid}\n testId={testId}\n />\n ) : (\n <Ark.Input\n ref={inputMergedRef}\n onBlur={onBlur}\n placeholder={placeholder}\n {...props({ \"data-testid\": testId })}\n className={inputControlClasses}\n />\n )}\n </div>\n ) : (\n <Ark.Trigger\n ref={triggerMergedRef}\n onBlur={onBlur}\n {...props({ \"aria-invalid\": isInvalid, \"data-testid\": testId })}\n className={cn(\n \"flex min-w-0 flex-1 cursor-pointer items-center bg-transparent text-start outline-none disabled:cursor-not-allowed\",\n shellGap[size],\n )}\n >\n <span className={inputSlot} aria-hidden>\n {startSlot ?? <CalendarIcon />}\n </span>\n <span className=\"min-w-0 flex-1 truncate text-start\">\n {isRange ? (\n api.value.length === 0 ? (\n <span className={placeholderColor}>{placeholder}</span>\n ) : (\n // Not `Ark.RangeText`: despite the name, it renders the calendar's\n // *visible* month/year viewport (the same text the header's ViewTrigger\n // shows), not the selected range — `datePicker.visibleRangeText` in Ark's\n // own source. Build the real selected-range text from `valueAsString`\n // instead (the same per-value formatted strings `Ark.ValueText` uses).\n api.valueAsString.join(\" – \")\n )\n ) : (\n <Ark.ValueText placeholder={placeholder} />\n )}\n </span>\n </Ark.Trigger>\n )}\n {clearable && (\n // Ark's own ClearTrigger already self-hides (`hidden`) while empty.\n <Ark.ClearTrigger className={popoverClearTrigger}>\n <CloseIcon />\n </Ark.ClearTrigger>\n )}\n </Ark.Control>\n\n {/* Holds an enclosing Modal/Drawer/Popover open while the calendar is; see `lib/overlay-layer.tsx`. */}\n <NestedLayer open={api.open} />\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content\n // `max-content` sizing (no `sameWidth`, see the positioning comment above)\n // means \"as if nothing below ever wraps\" — a `flex-wrap` time-row footer\n // wider than the calendar (two side-by-side \"Start time\"/\"End time\" rows\n // under `range` + `withTime`) would never actually wrap without a real width\n // constraint to shrink against; it'd just overflow off-screen on a narrow\n // viewport instead. `92vw` is generous enough to be a no-op on any normal\n // desktop width, only kicking in once there's genuinely no room.\n className={cn(\n popoverPanel,\n \"max-w-[92vw] flex-row flex-wrap items-stretch\",\n classNames?.content,\n )}\n >\n {presets && (\n <PresetsRail\n presets={presets}\n range={isRange}\n timeZone={resolvedTimeZone}\n locale={resolvedLocale}\n withConfirm={withConfirm}\n translations={translations?.presets}\n className={classNames?.presets}\n />\n )}\n <div\n className=\"flex min-w-0 flex-1 flex-col\"\n style={{\n width:\n Math.max(\n calendarGridWidth(size, numOfMonths),\n withTime ? timeRowMinWidth(size, resolvedHourCycle, withSeconds) : 0,\n ) + 16, // Take the x padding into account\n }}\n >\n <Popover.Body\n className={cn(\"p-2\", withTime || withConfirm ? \"border-b\" : undefined)}\n >\n <CalendarBody\n numOfMonths={numOfMonths}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames?.calendar}\n icons={icons}\n />\n </Popover.Body>\n {withTime && (\n <Popover.Footer\n className={cn(\n \"flex gap-x-2 gap-y-2 pb-2\",\n // Stacked by default — side by side only widens to match the extra\n // room multiple months already provide; with a single month, sitting\n // two time rows side by side would force the popover wider than the\n // calendar above them for no reason.\n numOfMonths > 1 ? \"flex-row flex-wrap\" : \"flex-col\",\n classNames?.footer,\n )}\n >\n <TimePanelRow\n value={api.value[0]}\n onSetTime={(time) => setTimeOrToday(api, time, 0, resolvedTimeZone)}\n label={isRange ? t.startTime : undefined}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n {isRange && (\n <TimePanelRow\n value={api.value[1]}\n onSetTime={(time) => api.setTime(time, 1)}\n label={t.endTime}\n disabled={api.value.length < 2}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n )}\n </Popover.Footer>\n )}\n {withConfirm && (\n <Popover.Footer className=\"flex justify-end gap-2 pb-2\">\n <Button\n variant=\"subtle\"\n color=\"neutral\"\n size={size}\n onClick={() => {\n setStaged(committed)\n api.setOpen(false)\n }}\n >\n {t.cancel}\n </Button>\n <Button\n size={size}\n onClick={() => {\n setCommitted(staged)\n api.setOpen(false)\n }}\n >\n {t.apply}\n </Button>\n </Popover.Footer>\n )}\n </div>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n\n {name &&\n (isRange ? (\n <>\n <input\n type=\"hidden\"\n name={`${name}Start`}\n value={\n api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"\n }\n />\n <input\n type=\"hidden\"\n name={`${name}End`}\n value={\n api.value[1] ? serializeDateValue(api.value[1], Boolean(withTime)) : \"\"\n }\n />\n </>\n ) : (\n <input\n type=\"hidden\"\n name={name}\n value={api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"}\n />\n ))}\n </>\n )}\n </Ark.Context>\n </Ark.Root>\n </FieldShell>\n )\n}\n\nexport const DatePicker = Object.assign(DatePickerImpl, {\n Root: Ark.Root,\n Context: Ark.Context,\n Control: Ark.Control,\n Input: Ark.Input,\n Trigger: Ark.Trigger,\n ClearTrigger: Ark.ClearTrigger,\n Content: Ark.Content,\n Presets: PresetsRail,\n Calendar: CalendarBody,\n TimePanel: TimeRow,\n TimePanelRow: TimePanelRow,\n Footer: Popover.Footer,\n}) as (<Range extends boolean = false>(props: DatePickerProps<Range>) => ReactNode) & {\n Root: typeof Ark.Root\n Context: typeof Ark.Context\n Control: typeof Ark.Control\n Input: typeof Ark.Input\n Trigger: typeof Ark.Trigger\n ClearTrigger: typeof Ark.ClearTrigger\n Content: typeof Ark.Content\n Presets: typeof PresetsRail\n Calendar: typeof CalendarBody\n TimePanel: typeof TimeRow\n TimePanelRow: typeof TimePanelRow\n Footer: typeof Popover.Footer\n}\n"]}
1
+ {"version":3,"sources":["../src/components/date-picker/date-time-text.ts","../src/components/date-picker/date-picker.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAM,SAAA,GAAY,CAAC,EAAE,MAAA,EAAQ,SAAA,EAAW,WAAA,EAAY,EAAwB,QAAA,KAC1E,IAAI,IAAA,CAAK,cAAA,CAAe,MAAA,EAAQ;AAAA,EAC9B,IAAA,EAAM,SAAA;AAAA,EACN,KAAA,EAAO,SAAA;AAAA,EACP,GAAA,EAAK,SAAA;AAAA,EACL,IAAA,EAAM,SAAA;AAAA,EACN,MAAA,EAAQ,SAAA;AAAA,EACR,MAAA,EAAQ,cAAc,SAAA,GAAY,MAAA;AAAA,EAClC,SAAA;AAAA;AAAA,EAEA,eAAA,EAAiB,MAAA;AAAA,EACjB;AACF,CAAC,CAAA;AAEI,IAAM,kBAAA,GAAqB,CAChC,KAAA,EACA,OAAA,EACA,QAAA,KACW,SAAA,CAAU,OAAA,EAAS,QAAQ,CAAA,CAAE,MAAA,CAAO,mBAAA,CAAoB,KAAA,EAAO,QAAQ,CAAC,CAAA;AAGrF,IAAM,cAAA,mBAAiB,IAAI,GAAA,CAAY,CAAC,MAAA,EAAQ,SAAS,KAAA,EAAO,MAAA,EAAQ,QAAA,EAAU,QAAQ,CAAC,CAAA;AAG3F,IAAM,UAAA,GAAa,CAAC,OAAA,KAClB,SAAA,CAAU,SAAS,KAAK,C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ACC,IAAA,EAAK,QAAA;AAAA,kBACL,IAAA;AAAA,kBACA,KAAA,EAAO,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,GAAI,kBAAA,CAAmB,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,EAAG,OAAA,CAAQ,QAAQ,CAAC,CAAA,GAAI;AAAA;AAAA,eAC9E;AAAA,aAAA,EAEN,CAAA,EAEJ;AAAA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACtD,MAAMA,YAAA,CAAI,IAAA;AAAA,EACV,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,OAAOA,YAAA,CAAI,KAAA;AAAA,EACX,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,cAAcA,YAAA,CAAI,YAAA;AAAA,EAClB,SAASA,YAAA,CAAI,OAAA;AAAA,EACb,OAAA,EAAS,WAAA;AAAA,EACT,QAAA,EAAU,YAAA;AAAA,EACV,SAAA,EAAW,OAAA;AAAA,EACX,YAAA;AAAA,EACA,QAAQ,OAAA,CAAQ;AAClB,CAAC","file":"chunk-GJFCIG34.js","sourcesContent":["import { CalendarDateTime, type DateValue } from \"@internationalized/date\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport {\n dayPeriodLabels,\n fromDisplayHour,\n type HourCycle,\n is12Hour,\n} from \"../time-input/hour-cycle\"\n\n/**\n * The typed text format for `typeable` + `withTime` — all-numeric, in the locale's own field order\n * (`10/20/2026, 02:30 PM` en-US, `20/10/2026 14:30` fr-FR), so what the field shows is exactly\n * what can be typed back. Ark's own `Input` part can't carry a time: it strips every character\n * but digits and the date separator while typing, and re-applies the previous value's time over\n * whatever its `parse` returns (`preserveTime`) — so `DatePicker` renders its own `<input>` on\n * top of these two helpers instead.\n */\n\ntype DateTimeTextOptions = {\n locale: string\n hourCycle: HourCycle\n withSeconds?: boolean\n}\n\nconst formatter = ({ locale, hourCycle, withSeconds }: DateTimeTextOptions, timeZone: string) =>\n new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: withSeconds ? \"2-digit\" : undefined,\n hourCycle,\n // `parseDateTimeText` reads ASCII digits; keep the display in the same digits it can parse.\n numberingSystem: \"latn\",\n timeZone,\n })\n\nexport const formatDateTimeText = (\n value: DateValue,\n options: DateTimeTextOptions,\n timeZone: string,\n): string => formatter(options, timeZone).format(calendarValueToDate(value, timeZone))\n\ntype NumericField = \"year\" | \"month\" | \"day\" | \"hour\" | \"minute\" | \"second\"\nconst NUMERIC_FIELDS = new Set<string>([\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"])\n\n/** The locale's numeric field order, read off the same formatter `formatDateTimeText` uses. */\nconst fieldOrder = (options: DateTimeTextOptions): NumericField[] =>\n formatter(options, \"UTC\")\n .formatToParts(new Date(Date.UTC(2001, 10, 22, 13, 44, 55)))\n .map((part) => part.type)\n .filter((type): type is NumericField => NUMERIC_FIELDS.has(type))\n\n/** \"AM\"/\"PM\" from the locale's own labels (`dayPeriodLabels`), falling back to a Latin `a`/`p`. */\nconst readPeriod = (text: string, locale: string): \"AM\" | \"PM\" | undefined => {\n const lower = text.toLowerCase()\n const labels = dayPeriodLabels(locale)\n if (lower.includes(labels.PM.toLowerCase())) return \"PM\"\n if (lower.includes(labels.AM.toLowerCase())) return \"AM\"\n if (/\\bp\\.?\\s?m?\\.?\\b/.test(lower)) return \"PM\"\n if (/\\ba\\.?\\s?m?\\.?\\b/.test(lower)) return \"AM\"\n return undefined\n}\n\nconst inRange = (n: number, min: number, max: number) => Number.isInteger(n) && n >= min && n <= max\n\n/**\n * Parse typed text back into a `CalendarDateTime`. Reads digit runs in the locale's field order\n * (so any separator works — `20/10/2026 14:30`, `20.10.2026 14h30` — but run-together digits like\n * `1430` read as one number); the\n * date is required, the time is optional — omitted fields keep `fallbackTime` (the current\n * value's), else midnight. In 12h mode a missing period reads AM, and a 13–23 hour is taken as\n * 24h as-typed; under `h24`, `24` is midnight. Returns `undefined` for anything that isn't a\n * real date/time (`02/30/2026`, `25:00`), never a silently constrained one.\n */\nexport const parseDateTimeText = (\n text: string,\n options: DateTimeTextOptions,\n fallbackTime?: { hour: number; minute: number; second: number },\n): CalendarDateTime | undefined => {\n const numbers = text.match(/\\d+/g)?.map(Number) ?? []\n const order = fieldOrder(options)\n const field = (name: NumericField) => {\n const index = order.indexOf(name)\n return index === -1 ? undefined : numbers[index]\n }\n\n const rawYear = field(\"year\")\n const month = field(\"month\")\n const day = field(\"day\")\n if (rawYear === undefined || month === undefined || day === undefined) return undefined\n const year = rawYear < 100 ? 2000 + rawYear : rawYear\n\n const typedHour = field(\"hour\")\n let hour = typedHour ?? fallbackTime?.hour ?? 0\n if (typedHour !== undefined && is12Hour(options.hourCycle) && inRange(typedHour, 0, 12)) {\n hour = fromDisplayHour(typedHour, readPeriod(text, options.locale) ?? \"AM\", options.hourCycle)\n } else if (typedHour === 24 && options.hourCycle === \"h24\") {\n // `h24` shows midnight as `24` (and so formats it that way) — read it back as hour 0.\n hour = 0\n }\n const minute = field(\"minute\") ?? (typedHour === undefined ? fallbackTime?.minute : 0) ?? 0\n const second = field(\"second\") ?? (typedHour === undefined ? fallbackTime?.second : 0) ?? 0\n\n if (!inRange(month, 1, 12) || !inRange(day, 1, 31) || !inRange(year, 1, 9999)) return undefined\n if (!inRange(hour, 0, 23) || !inRange(minute, 0, 59) || !inRange(second, 0, 59)) return undefined\n const value = new CalendarDateTime(year, month, day, hour, minute, second)\n // `CalendarDateTime` constrains out-of-range days (Feb 30 → Feb 28) instead of rejecting them.\n return value.day === day ? value : undefined\n}\n","\"use client\"\n\nimport {\n DatePicker as Ark,\n type DatePickerDateRangePreset as DateRangePreset,\n type DateValue,\n type DatePickerDateView as DateView,\n type UseDatePickerContext,\n} from \"@ark-ui/react/date-picker\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { DateFormatter, toCalendarDateTime, today } from \"@internationalized/date\"\nimport { type FocusEvent, type ReactNode, type Ref, useId, useRef, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\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 { focusStyles } from \"../../lib/focus-styles\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { capitalize } from \"../../lib/graphemes\"\nimport { useLocale, useTimeZone } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { NestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button } from \"../button/button\"\nimport { type CalendarTranslations, resolveCalendarTranslations } from \"../calendar/calendar\"\nimport {\n CalendarBody,\n type CalendarBodyClassNames,\n type CalendarIcons,\n calendarGridWidth,\n} from \"../calendar/calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"../calendar/calendar-zone-sync\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n shellGap,\n} from \"../input/input\"\nimport { CalendarIcon, CloseIcon } from \"../popover/icons\"\nimport { Popover, popoverClearTrigger, popoverPanel } from \"../popover/popover\"\nimport {\n fromDisplayHour,\n type HourCycle,\n resolveHourCycle,\n toDisplayHour,\n} from \"../time-input/hour-cycle\"\nimport { TimeRow, type TimeRowTranslations, timeRowMinWidth } from \"../time-input/time-row\"\nimport { formatDateTimeText, parseDateTimeText } from \"./date-time-text\"\n\n/**\n * DatePicker — a trigger + popover calendar on Ark UI's `date-picker` machine, composing\n * `Calendar`'s shared grid module (`calendar-body.tsx`) and `TimeInput`'s shared time row\n * (`time-row.tsx`). `range` and `withTime` cover all four date combinations; `DateRangePicker`,\n * `DateTimePicker`, and `DateTimeRangePicker` are thin named presets pinning those two flags.\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, exactly as `Calendar` uses it.\n * - `withConfirm` stages the selection in local state; only Apply calls the outer `onChange`,\n * Cancel reverts. Without it, single dates commit + close on pick and ranges commit on the\n * second click (both Ark-native) — except under `withTime`, where a pick commits but keeps\n * the panel open so the time row can still be set (outside click / Escape closes it).\n * - `presets` renders a sidebar of quick-pick shortcuts — range shortcuts (Ark's own\n * `DateRangePreset` union, or a custom `{ range }`) under `range`; single-date shortcuts\n * (a custom `{ date }`) otherwise. `true` resolves to a mode-appropriate default set.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s; pair with `lib/date-predicates.ts`'s\n * helpers (`disablePast()`, `disableWeekends()`, …), re-exported from this same barrel.\n * - `typeable` swaps the plain button trigger for a text input, so a date can be typed (and\n * parsed on blur / Enter) in addition to picked from the calendar — the leading icon becomes a\n * real open-calendar button alongside it. Opt-in (default `false`); single dates only (see\n * the prop's own doc comment). Under `withTime` the input carries the time too\n * (`date-time-text.ts`).\n *\n * <DatePicker label=\"Start date\" value={date} onChange={setDate} clearable />\n * <DateRangePicker withTime presets withConfirm value={range} onChange={setRange} />\n */\n\nconst datePickerPresets = cn(\n \"flex shrink-0 flex-col gap-0.5 border-e p-1\",\n \"border-brand-900/20 dark:border-white/15\",\n)\n\nconst presetTrigger = cn(\n \"w-full cursor-pointer rounded-xs px-2 py-1.5 text-start text-sm whitespace-nowrap transition-colors\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n)\n\nconst timePanelLabel = cn(\"text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\n\n/** `typeable`'s leading calendar icon, promoted from a decorative span (the button-trigger case)\n * to a real open-calendar button — same base look as `inputSlot`, plus the family's interactive-\n * icon treatment (compare `popoverClearTrigger`). `outline-none`: the shell's own `:has()` rule\n * (`shellChrome` in `input.tsx`) already rings the *whole* control on this button's focus-visible\n * state, so its own native outline would just double up. */\nconst datePickerIconTrigger = cn(\n inputSlot,\n \"cursor-pointer rounded-xs outline-none transition-colors hover:text-brand-900/70 dark:hover:text-white/80 disabled:cursor-not-allowed\",\n)\n\n/** The main column (calendar + time row footer) has no explicit width of its own, and neither\n * does the popover above it — deliberately, so the popover sizes to its content. But once the\n * time row's Hour/Minute/(Second) fields are `flex-1` (grow to fill the row), that becomes\n * circular: the row wants to size off \"however much space is available,\" and with nothing\n * concrete above it to measure against, browsers resolve a flex container's own intrinsic width\n * generously when it holds `flex-grow` items — the row (and everything above it) ends up far\n * wider than the calendar actually needs, even for a single time row. Giving the column an\n * explicit width tied to the calendar's own geometry (`calendarGridWidth`, shared with\n * `calendar-body.tsx`'s own month/year grids) breaks that circularity: the row now grows to\n * fill a *real* width instead of an ambiguous one.\n *\n * That width is only ever tied to the *calendar* grid, though — under `withTime`, the column\n * must be at least as wide as the time row itself needs (`timeRowMinWidth`), or the same\n * `flex-1` + `min-w-0` fields that motivated a fixed width in the first place shrink below their\n * content size instead of growing: with the AM/PM toggle present at a single month, the\n * calendar-only width is narrower than Hour+Minute+Period need, and the `<input>`s get starved. */\n\nconst pad = (n: number) => String(n).padStart(2, \"0\")\n\n/** Hidden-input serialization. `DateValue#toString()` isn't safe to call directly here: a\n * `CalendarDateTime` (what our own `dateToArkValue` produces for a `defaultValue`/`value` passed\n * in) stringifies with a time, while a plain `CalendarDate` (what a day-grid click produces)\n * stringifies as a clean date — two different formats for the same picked day depending on\n * provenance. Read the wall-calendar fields directly instead. Whether to append the time portion\n * is driven by the picker's own `withTime` flag, not by whether the value happens to carry an\n * `hour` field — a `CalendarDateTime` always has one (even at local midnight), so that structural\n * check can't tell \"date-only\" from \"with time\" apart. */\nexport const serializeDateValue = (value: DateValue, withTime: boolean): string => {\n const date = `${value.year}-${pad(value.month)}-${pad(value.day)}`\n if (!withTime) return date\n const time = \"hour\" in value ? value : { hour: 0, minute: 0, second: 0 }\n return `${date}T${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}`\n}\n\nexport type DatePickerClassNames = {\n field?: string\n control?: string\n content?: string\n presets?: string\n calendar?: CalendarBodyClassNames\n timePanel?: { hour?: string; minute?: string; second?: string; period?: string }\n footer?: string\n}\n\n/** `value`/`range`-shaped entries are for `range` mode; `date`-shaped entries are for single-date\n * mode. Nothing prevents mixing them for the picker's current mode — the shape you pass is\n * trusted, not validated at runtime (a mismatched entry just doesn't produce useful behavior;\n * `api.setValue`/`getRangePresetValue` are mode-agnostic in the underlying machine). */\nexport type DatePreset =\n | { label: string; value: DateRangePreset }\n | { label: string; range: { start: Date; end: Date } | null }\n | { label: string; date: Date | null }\n\n/** Identifies each entry `getDefaultPresets` builds for `presets={true}`, so a `translations`\n * override can target one label without redefining the whole set. */\nexport type DatePickerPresetId =\n | \"today\"\n | \"yesterday\"\n | \"tomorrow\"\n | \"nextWeek\"\n | \"thisWeek\"\n | \"lastWeek\"\n | \"thisMonth\"\n | \"lastMonth\"\n | \"thisYear\"\n | \"allTime\"\n\n/** One unified `translations` prop rather than one per string source — Ark's own accessible\n * names, the `presets={true}` default labels, and the embedded time row's strings all belong to\n * the same `DatePicker` instance a consumer is localizing. English defaults throughout;\n * unset keys keep their built-in text. */\nexport type DatePickerTranslations = Partial<CalendarTranslations> &\n TimeRowTranslations & {\n /** The `withConfirm` footer's revert button. Default `\"Cancel\"`. */\n cancel?: string\n /** The `withConfirm` footer's commit button. Default `\"Apply\"`. */\n apply?: string\n /** The embedded time row's label under `range` + `withTime` (first row). Default `\"Start time\"`. */\n startTime?: string\n /** The embedded time row's label under `range` + `withTime` (second row). Default `\"End time\"`. */\n endTime?: string\n /** Individual `presets={true}` default-set labels, keyed by id — override just the ones you\n * need without redefining the whole array. Pass your own `DatePreset[]` for full control.\n * Every label but `allTime` (default `\"All time\"`) is already in the locale's words, from\n * `Intl.RelativeTimeFormat` (\"Aujourd’hui\", \"La semaine dernière\"); an override wins. */\n presets?: Partial<Record<DatePickerPresetId, string>>\n }\n\n/** The calendar's icon slots, one prop for the whole picker. */\nexport type DatePickerIcons = CalendarIcons\n\nexport type DatePickerProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n // Widened from `HTMLButtonElement` alone: under `typeable` the focusable element is Ark's\n // `Input` (a real `<input>`), not the button trigger — `ref`/`onBlur` must be able to land on\n // either depending on that prop, since both are the same generic `DatePickerProps`.\n HTMLButtonElement | HTMLInputElement\n> &\n Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Adds an embedded HOUR/MINUTE (+ SECOND) time row; the value carries H/M too. */\n withTime?: boolean\n /** Months shown side by side. Default `1`, regardless of `range` — pass `2` to show a full\n * range without paging (matches `Calendar`'s own plain default). */\n numOfMonths?: number\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 popover's height constant while\n * navigating between months. */\n fixedWeeks?: boolean\n /** Preset sidebar — range shortcuts under `range`, single-date shortcuts otherwise. `true`\n * renders a mode-appropriate default set; an array is fully custom. See `DatePreset`. */\n presets?: DatePreset[] | boolean\n /** Stage the selection; commit only on Apply. Cancel reverts to the last committed value. */\n withConfirm?: boolean\n /** Renders a clear trigger once a value is set; emits `null` (or an all-null range). */\n clearable?: boolean\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 /** Renders a text input (typing, blur-to-parse, `Enter`-to-commit) alongside the\n * calendar-icon trigger, instead of the plain button-only trigger. Opt-in — default `false`\n * keeps the click-to-open button.\n *\n * Without `withTime` this is Ark's own `Input` anatomy part (a numeric date). Under\n * `withTime` it shows and parses a numeric date + time in the locale's own field order\n * (`10/20/2026, 02:30 PM`, `20/10/2026 14:30`) — typing just a date keeps the current time.\n * `range` (cross-field validation across two inputs) is out of scope and falls back to the\n * button trigger. */\n typeable?: boolean\n min?: Date\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"`). */\n minView?: DateView\n maxView?: DateView\n /** Overrides the active locale context. Drives month/day names, first-day-of-week, and the\n * embedded time row's 12h/24h default. */\n locale?: string\n /** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Calendar` and\n * `Schedule` — **not** Ark's own machine default (`\"UTC\"`). Accepts `\"auto\"` to follow the\n * host zone. */\n timeZone?: string\n /** Force 12-hour or 24-hour display for the embedded time row, overriding the locale default. */\n format?: 12 | 24\n /** Force a specific hour cycle, overriding the locale default and `format`. */\n hourCycle?: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the embedded time row's empty Hour/Minute/Second fields — see\n * TimeRow's `placeholder`. Default `\"--\"`. */\n timePlaceholder?: string\n /** Overrides built-in English strings — Ark's own accessible names, the `presets={true}`\n * \"All time\" label, Cancel/Apply, Start/End time, and the embedded time row's Hour/Minute/\n * Second/Period labels. The other preset labels already follow `locale`, and an override\n * here still wins over them. Partial — unset keys keep their default. */\n translations?: DatePickerTranslations\n /** Replaces the calendar's default icons: `prev`, `next`, passed through to its grid like\n * `translations`. The kit's chevrons mirror under RTL; an icon passed here is drawn as given. */\n icons?: DatePickerIcons\n /** Placeholder shown while no date is selected. */\n placeholder?: string\n /** Inline-start adornment. Defaults to a calendar icon. */\n startSlot?: ReactNode\n size?: Size\n variant?: InputVariant\n /** Render the panel in a Portal so it escapes clipping ancestors.\n * Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n className?: string\n classNames?: DatePickerClassNames\n }\n\n/** `DatePicker`'s own English wording, merged once per render (`presets` one level deeper, in\n * `presetLabels`). \"All time\" is the one non-derivable preset label; every other\n * `presets={true}` label comes from `Intl.RelativeTimeFormat`. */\nconst DATE_PICKER_DEFAULT_TRANSLATIONS = {\n cancel: \"Cancel\",\n apply: \"Apply\",\n startTime: \"Start time\",\n endTime: \"End time\",\n presets: { allTime: \"All time\" },\n} as const satisfies DatePickerTranslations\n\n/** The `presets={true}` labels: the locale's own words for each relative period\n * (`Intl.RelativeTimeFormat` with `numeric: \"auto\"` — \"Aujourd’hui\", \"La semaine dernière\"),\n * capitalised for a button, then \"All time\" from the defaults, then the consumer's\n * `translations.presets`, which win over both. */\nconst presetLabels = (\n locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): Record<DatePickerPresetId, string> => {\n const relative = new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" })\n const say = (value: number, unit: Intl.RelativeTimeFormatUnit) =>\n capitalize(relative.format(value, unit), locale)\n return {\n today: say(0, \"day\"),\n yesterday: say(-1, \"day\"),\n tomorrow: say(1, \"day\"),\n nextWeek: say(1, \"week\"),\n thisWeek: say(0, \"week\"),\n lastWeek: say(-1, \"week\"),\n thisMonth: say(0, \"month\"),\n lastMonth: say(-1, \"month\"),\n thisYear: say(0, \"year\"),\n ...DATE_PICKER_DEFAULT_TRANSLATIONS.presets,\n ...overrides,\n }\n}\n\n/** Ark's built-in `DateRangePreset` union has no \"today\" / \"yesterday\" / \"all time\" member\n * (confirmed in `@zag-js/date-utils`'s types) — those three are hand-built here from\n * `today(timeZone)`; the rest map straight to Ark's own string presets. The single-date set\n * (non-`range`) is a different shape entirely, not a trimmed-down copy of the range one — \"This\n * week\"/\"This month\"/etc. are inherently range-shaped and don't collapse to one date. */\nconst getDefaultPresets = (\n range: boolean,\n timeZone: string,\n locale: string,\n overrides?: Partial<Record<DatePickerPresetId, string>>,\n): DatePreset[] => {\n const now = today(timeZone)\n const toDate = (value: typeof now) => calendarValueToDate(value, timeZone)\n const label = presetLabels(locale, overrides)\n if (!range) {\n return [\n { label: label.today, date: toDate(now) },\n { label: label.yesterday, date: toDate(now.subtract({ days: 1 })) },\n { label: label.tomorrow, date: toDate(now.add({ days: 1 })) },\n { label: label.nextWeek, date: toDate(now.add({ days: 7 })) },\n ]\n }\n const yesterday = now.subtract({ days: 1 })\n return [\n { label: label.today, range: { start: toDate(now), end: toDate(now) } },\n { label: label.yesterday, range: { start: toDate(yesterday), end: toDate(yesterday) } },\n { label: label.thisWeek, value: \"thisWeek\" },\n { label: label.lastWeek, value: \"lastWeek\" },\n { label: label.thisMonth, value: \"thisMonth\" },\n { label: label.lastMonth, value: \"lastMonth\" },\n { label: label.thisYear, value: \"thisYear\" },\n { label: label.allTime, range: null },\n ]\n}\n\nconst PresetsRail = ({\n presets,\n range,\n timeZone,\n locale,\n withConfirm,\n translations,\n className,\n}: {\n presets: DatePreset[] | boolean\n /** Which default set `presets === true` resolves to — irrelevant once `presets` is a concrete array. */\n range?: boolean\n timeZone: string\n /** Names the `presets === true` periods. Falls back to the `IntlProvider` locale. */\n locale?: string\n withConfirm?: boolean\n /** Overrides individual `presets={true}` default-set labels, keyed by id. No effect on a\n * custom `DatePreset[]`. */\n translations?: Partial<Record<DatePickerPresetId, string>>\n className?: string\n}) => {\n const resolvedLocale = useLocale(locale)\n const resolved =\n presets === true\n ? getDefaultPresets(Boolean(range), timeZone, resolvedLocale, translations)\n : presets === false\n ? []\n : presets\n if (resolved.length === 0) return null\n return (\n <Ark.Context>\n {(api) => (\n <div className={cn(datePickerPresets, className)}>\n {resolved.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n // Not `Ark.PresetTrigger`: its own onClick always sends `PRESET.CLICK`, which the\n // machine transitions unconditionally to \"focused\" (closed) regardless of\n // `closeOnSelect` — there's no way to keep it open under `withConfirm`. Resolve the\n // preset's value ourselves and set it via `api.setValue`, which only sets the value\n // (no state-machine transition), then close explicitly only when not staging.\n onClick={() => {\n const values =\n \"value\" in preset\n ? api.getRangePresetValue(preset.value)\n : \"range\" in preset\n ? (toArkValues(preset.range, timeZone) ?? [])\n : (toArkValues(preset.date, timeZone) ?? [])\n api.setValue(values)\n if (!withConfirm) api.setOpen(false)\n }}\n aria-label={preset.label}\n className={presetTrigger}\n >\n {preset.label}\n </button>\n ))}\n </div>\n )}\n </Ark.Context>\n )\n}\n\ntype DisplayTime = {\n hour: number | null\n minute: number | null\n second: number | null\n period: \"AM\" | \"PM\" | null\n}\n\nconst emptyDisplayTime: DisplayTime = { hour: null, minute: null, second: null, period: null }\n\n/** Derive display-space fields (the cycle's own hours, + period) from the machine's own\n * `DateValue` — a plain `CalendarDate` (no time picked yet) has no `hour`, so it reads as all-null. */\nconst toDisplayTime = (value: DateValue | undefined, cycle: HourCycle): DisplayTime => {\n if (!value || !(\"hour\" in value)) return emptyDisplayTime\n const { hour, period } = toDisplayHour(value.hour, cycle)\n return { hour, minute: value.minute, second: value.second ?? null, period }\n}\n\n/** The inverse of `toDisplayTime` — merges a display-space edit into a `setTime`-ready payload.\n * Missing fields default to midnight, same rule `TimeInput` uses for its own first edit. */\nconst fromDisplayTime = (\n display: DisplayTime,\n cycle: HourCycle,\n): { hour: number; minute: number; second?: number } => {\n const hour = fromDisplayHour(display.hour, display.period, cycle)\n const minute = display.minute ?? 0\n return display.second != null ? { hour, minute, second: display.second } : { hour, minute }\n}\n\n/** `api.setTime`, except that a time edit with no day picked yet lands on *today* instead of being\n * dropped — Ark's own `setTime` silently no-ops without a date at that index, so typing a time\n * first used to do nothing at all. Only the first row can hit that (the second is disabled until\n * a range has both ends). `setValue` keeps today within `min`/`max`, like Ark's `selectToday`;\n * a today that `isDateUnavailable` rules out isn't auto-picked. */\nconst setTimeOrToday = (\n api: UseDatePickerContext,\n time: { hour: number; minute: number; second?: number },\n index: number,\n timeZone: string,\n) => {\n if (api.value[index] || index !== 0) return api.setTime(time, index)\n const day = today(timeZone)\n if (api.isUnavailable(day)) return\n api.setValue([toCalendarDateTime(day).set(time)])\n}\n\nexport type TimePanelRowProps = {\n value: DateValue | undefined\n onSetTime: (time: { hour: number; minute: number; second?: number }) => void\n /** Visible label above the row, which also names its `role=\"group\"` (\"Start time\" / \"End\n * time\" under `range`). Without it the group is named `translations.time` (`\"Time\"`). */\n label?: string\n disabled?: boolean\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in the row's empty Hour/Minute/Second fields — see TimeRow's\n * `placeholder`. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n classNames?: DatePickerClassNames[\"timePanel\"] & { root?: string }\n}\n\n/** One HOUR/MINUTE(+SECOND)+AM/PM row, bridging `TimeRow`'s display-space props to a specific\n * `api.value` index via `api.setTime(time, index)` — the same shared `TimeRow` `TimeInput`\n * wraps with its own local state, wrapped here with the machine's state instead. */\nconst TimePanelRow = ({\n value,\n onSetTime,\n label,\n disabled,\n hourCycle,\n minuteStep,\n withSeconds,\n placeholder,\n locale,\n translations,\n size,\n variant,\n classNames,\n}: TimePanelRowProps) => {\n const display = toDisplayTime(value, hourCycle)\n const patch = (partial: Partial<DisplayTime>) =>\n onSetTime(fromDisplayTime({ ...display, ...partial }, hourCycle))\n const labelId = useId()\n\n return (\n <div className={cn(\"flex flex-col gap-1\", classNames?.root)}>\n {label && (\n <span id={labelId} className={timePanelLabel}>\n {label}\n </span>\n )}\n <TimeRow\n aria-labelledby={label ? labelId : undefined}\n hour={display.hour}\n minute={display.minute}\n second={display.second}\n onHourChange={(hour) => patch({ hour })}\n onMinuteChange={(minute) => patch({ minute })}\n onSecondChange={withSeconds ? (second) => patch({ second }) : undefined}\n period={display.period}\n onPeriodChange={(period) => patch({ period })}\n hourCycle={hourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={placeholder}\n locale={locale}\n translations={translations}\n size={size}\n variant={variant}\n disabled={disabled}\n classNames={classNames}\n />\n </div>\n )\n}\n\n/**\n * `typeable` + `withTime`'s own text input, standing in for Ark's `Input` part — which can't carry\n * a time (see `date-time-text.ts`). It still declares `data-part=\"input\"` inside the Control, so\n * the machine treats it as its input: excluded from interact-outside dismissal, focused on close,\n * and kept in sync with every value change (day pick, time row, clear) through the Root's\n * `format`, which is this same numeric text. Left uncontrolled for that reason — the only thing\n * added here is committing typed text: parsed on blur / `Enter`, then set through `api.setValue`;\n * text that doesn't parse (or lands on an unavailable day) reverts to the current value.\n */\nconst DateTimeTextInput = ({\n api,\n options,\n timeZone,\n ref,\n onBlur,\n placeholder,\n disabled,\n readOnly,\n invalid,\n testId,\n}: {\n api: UseDatePickerContext\n options: Parameters<typeof parseDateTimeText>[1]\n timeZone: string\n ref?: Ref<HTMLInputElement>\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n placeholder?: string\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n testId?: string\n}) => {\n const field = useFieldContext()\n const current = api.value[0]\n const show = (input: HTMLInputElement, value: DateValue | undefined) => {\n input.value = value ? formatDateTimeText(value, options, timeZone) : \"\"\n }\n const commit = (input: HTMLInputElement) => {\n const text = input.value.trim()\n if (text === \"\") {\n if (current) api.clearValue({ focus: false })\n return\n }\n const fallback = current && \"hour\" in current ? current : undefined\n const next = parseDateTimeText(text, options, fallback)\n if (!next || api.isUnavailable(next)) return show(input, current)\n api.setValue([next])\n api.setFocusedValue(next)\n // `setValue` is a no-op (and syncs nothing) when the parsed value equals the current one, so\n // normalize the typed text to the canonical format either way.\n show(input, next)\n }\n return (\n <input\n ref={ref}\n type=\"text\"\n data-scope=\"date-picker\"\n data-part=\"input\"\n autoComplete=\"off\"\n defaultValue={current ? formatDateTimeText(current, options, timeZone) : \"\"}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n {...props({ \"aria-invalid\": invalid })}\n // Ark's own input-click handler, not `api.setOpen`: it opens with `src: \"input.click\"`,\n // which is what stops the machine from moving focus into the grid — typing has to keep\n // landing here. It also honours `openOnClick` and disabled/read-only on its own.\n onClick={api.getInputProps().onClick}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\" || event.nativeEvent.isComposing) return\n event.preventDefault()\n commit(event.currentTarget)\n }}\n onBlur={(event) => {\n if (!readOnly) commit(event.currentTarget)\n onBlur?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={inputControlClasses}\n />\n )\n}\n\nconst DatePickerImpl = <Range extends boolean = false>({\n withinPortal = true,\n container,\n range,\n withTime,\n numOfMonths = 1,\n fixedWeeks,\n presets,\n withConfirm,\n clearable,\n value,\n defaultValue,\n onChange,\n onBlur,\n isDateUnavailable,\n typeable,\n min,\n max,\n minView,\n maxView,\n locale,\n timeZone,\n format,\n hourCycle,\n minuteStep,\n withSeconds,\n timePlaceholder,\n translations,\n icons,\n placeholder = \"Pick a date\",\n startSlot,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: DatePickerProps<Range>) => {\n const portalContainer = useOverlayContainer(container)\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = useTimeZone(timeZone)\n const resolvedHourCycle = resolveHourCycle({ locale: resolvedLocale, format, hourCycle })\n const t = { ...DATE_PICKER_DEFAULT_TRANSLATIONS, ...translations }\n const isInvalid = invalid || error != null\n const isRange = Boolean(range)\n // See `typeable`'s own doc comment: single dates only — `range` silently falls back to the\n // button trigger rather than erroring, so `typeable` composes safely with every other prop.\n // Under `withTime` the input is `DateTimeTextInput` instead of Ark's own date-only `Input`.\n const showTypeableInput = Boolean(typeable) && !isRange\n const dateTimeText = { locale: resolvedLocale, hourCycle: resolvedHourCycle, withSeconds }\n const controlRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n\n type Value = Range extends true ? DateRangeValue : Date | null\n const emptyValue = (isRange ? { start: null, end: null } : null) as Value\n\n // Reserved for the `withConfirm` staged layer only — the base value needs no local state,\n // Ark's machine natively supports controlled/uncontrolled `value`/`defaultValue`/`onValueChange`\n // the same way `Calendar` relies on it.\n const [committed, setCommitted] = useUncontrolled<Value>({\n value,\n defaultValue,\n finalValue: emptyValue,\n onChange,\n })\n const [staged, setStaged] = useState<Value>(committed)\n const zoneReseed = useRef<string | null>(null)\n\n const inputMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(inputRef, ref)\n const triggerMergedRef = useMergedRefs<HTMLButtonElement | HTMLInputElement>(triggerRef, ref)\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n // Ark's own default (`true`) auto-closes on a completed pick — under `withConfirm`\n // the picker must stay open for review until Apply/Cancel, and under `withTime` the day\n // is only half the value: closing on pick would hide the time row it still needs.\n // Otherwise leave Ark's default (single closes on pick, range on the second click).\n closeOnSelect={withConfirm || withTime ? false : undefined}\n // Ark's own default (`false`) requires the calendar-icon trigger to open the popover —\n // under `typeable` a click into the text field itself should open it too, matching the\n // combined type-or-pick affordance `typeable` is meant to offer. No-op when the Input\n // anatomy part isn't rendered (`!showTypeableInput`).\n openOnClick={showTypeableInput}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n minView={minView}\n maxView={maxView}\n value={toArkValues(withConfirm ? staged : value, resolvedTimeZone)}\n defaultValue={withConfirm ? undefined : 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 const next = fromArkValues(details.value, isRange, resolvedTimeZone) as Value\n if (withConfirm) setStaged(next)\n else onChange?.(next)\n }}\n onOpenChange={(details) => {\n if (withConfirm && details.open) setStaged(committed)\n }}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(\n calendarValueToDate(dateValue, resolvedTimeZone),\n resolvedTimeZone,\n )\n : undefined\n }\n min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}\n // The typed date+time input shows (and Ark syncs into it) the same numeric text it parses.\n format={\n withTime && showTypeableInput\n ? (date) => formatDateTimeText(date, dateTimeText, resolvedTimeZone)\n : withTime\n ? (date, { locale: fmtLocale }) =>\n new DateFormatter(fmtLocale, { dateStyle: \"medium\", timeStyle: \"short\" }).format(\n calendarValueToDate(date, resolvedTimeZone),\n )\n : undefined\n }\n // Anchor to the Control (not `sameWidth`, unlike Select) — the popover hosts a full\n // calendar grid + presets rail, which needs its own intrinsic width, not the trigger's.\n positioning={{ getAnchorRect: () => controlRef.current?.getBoundingClientRect() ?? null }}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={isInvalid}\n className={cn(\"w-full\", className)}\n >\n {/* Keeps the selection, and the typeable input's text, on the same instant when the zone\n * changes, in place rather than by remounting; see `calendar-zone-sync.tsx`. Under\n * `withConfirm` Ark's value is the staged `Date`, so it is controlled either way. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={withConfirm || value !== undefined}\n pendingRef={zoneReseed}\n />\n <Ark.Context>\n {(api) => (\n <>\n <Ark.Control\n ref={controlRef}\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": true,\n \"data-with-end-slot\": true,\n })}\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(\n inputShell({ size, variant }),\n // A real `<input>` sits in the shell under `typeable` — leave the shell's own\n // cursor at the browser default (text-cursor over the input, pointer over the\n // icon trigger / clear button) instead of forcing pointer everywhere, matching\n // `Combobox`'s Control (see `combobox.tsx`) rather than `Select`'s button-only one.\n !showTypeableInput && \"cursor-pointer\",\n classNames?.control,\n )}\n >\n {showTypeableInput ? (\n <div className={cn(\"flex min-w-0 flex-1 items-center\", shellGap[size])}>\n {/* Ark sets its own accessible `aria-label` (\"Open calendar\" / \"Close\n calendar\") on the trigger regardless of children, so an icon-only button\n here is still accessible without a manual override. */}\n <Ark.Trigger className={datePickerIconTrigger}>\n {startSlot ?? <CalendarIcon />}\n </Ark.Trigger>\n {withTime ? (\n <DateTimeTextInput\n api={api}\n options={dateTimeText}\n timeZone={resolvedTimeZone}\n ref={inputMergedRef}\n onBlur={onBlur}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n invalid={isInvalid}\n testId={testId}\n />\n ) : (\n <Ark.Input\n ref={inputMergedRef}\n onBlur={onBlur}\n placeholder={placeholder}\n {...props({ \"data-testid\": testId })}\n className={inputControlClasses}\n />\n )}\n </div>\n ) : (\n <Ark.Trigger\n ref={triggerMergedRef}\n onBlur={onBlur}\n {...props({ \"aria-invalid\": isInvalid, \"data-testid\": testId })}\n className={cn(\n \"flex min-w-0 flex-1 cursor-pointer items-center bg-transparent text-start outline-none disabled:cursor-not-allowed\",\n shellGap[size],\n )}\n >\n <span className={inputSlot} aria-hidden>\n {startSlot ?? <CalendarIcon />}\n </span>\n <span className=\"min-w-0 flex-1 truncate text-start\">\n {isRange ? (\n api.value.length === 0 ? (\n <span className={placeholderColor}>{placeholder}</span>\n ) : (\n // Not `Ark.RangeText`: despite the name, it renders the calendar's\n // *visible* month/year viewport (the same text the header's ViewTrigger\n // shows), not the selected range — `datePicker.visibleRangeText` in Ark's\n // own source. Build the real selected-range text from `valueAsString`\n // instead (the same per-value formatted strings `Ark.ValueText` uses).\n api.valueAsString.join(\" – \")\n )\n ) : (\n <Ark.ValueText placeholder={placeholder} />\n )}\n </span>\n </Ark.Trigger>\n )}\n {clearable && (\n // Ark's own ClearTrigger already self-hides (`hidden`) while empty.\n <Ark.ClearTrigger className={popoverClearTrigger}>\n <CloseIcon />\n </Ark.ClearTrigger>\n )}\n </Ark.Control>\n\n {/* Holds an enclosing Modal/Drawer/Popover open while the calendar is; see `lib/overlay-layer.tsx`. */}\n <NestedLayer open={api.open} />\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content\n // `max-content` sizing (no `sameWidth`, see the positioning comment above)\n // means \"as if nothing below ever wraps\" — a `flex-wrap` time-row footer\n // wider than the calendar (two side-by-side \"Start time\"/\"End time\" rows\n // under `range` + `withTime`) would never actually wrap without a real width\n // constraint to shrink against; it'd just overflow off-screen on a narrow\n // viewport instead. `92vw` is generous enough to be a no-op on any normal\n // desktop width, only kicking in once there's genuinely no room.\n className={cn(\n popoverPanel,\n \"max-w-[92vw] flex-row flex-wrap items-stretch\",\n classNames?.content,\n )}\n >\n {presets && (\n <PresetsRail\n presets={presets}\n range={isRange}\n timeZone={resolvedTimeZone}\n locale={resolvedLocale}\n withConfirm={withConfirm}\n translations={translations?.presets}\n className={classNames?.presets}\n />\n )}\n <div\n className=\"flex min-w-0 flex-1 flex-col\"\n style={{\n width:\n Math.max(\n calendarGridWidth(size, numOfMonths),\n withTime ? timeRowMinWidth(size, resolvedHourCycle, withSeconds) : 0,\n ) + 16, // Take the x padding into account\n }}\n >\n <Popover.Body\n className={cn(\"p-2\", withTime || withConfirm ? \"border-b\" : undefined)}\n >\n <CalendarBody\n numOfMonths={numOfMonths}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames?.calendar}\n icons={icons}\n />\n </Popover.Body>\n {withTime && (\n <Popover.Footer\n className={cn(\n \"flex gap-x-2 gap-y-2 pb-2\",\n // Stacked by default — side by side only widens to match the extra\n // room multiple months already provide; with a single month, sitting\n // two time rows side by side would force the popover wider than the\n // calendar above them for no reason.\n numOfMonths > 1 ? \"flex-row flex-wrap\" : \"flex-col\",\n classNames?.footer,\n )}\n >\n <TimePanelRow\n value={api.value[0]}\n onSetTime={(time) => setTimeOrToday(api, time, 0, resolvedTimeZone)}\n label={isRange ? t.startTime : undefined}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n {isRange && (\n <TimePanelRow\n value={api.value[1]}\n onSetTime={(time) => api.setTime(time, 1)}\n label={t.endTime}\n disabled={api.value.length < 2}\n hourCycle={resolvedHourCycle}\n minuteStep={minuteStep}\n withSeconds={withSeconds}\n placeholder={timePlaceholder}\n locale={resolvedLocale}\n translations={translations}\n size={size}\n variant={variant}\n classNames={{ root: \"flex-1\", ...classNames?.timePanel }}\n />\n )}\n </Popover.Footer>\n )}\n {withConfirm && (\n <Popover.Footer className=\"flex justify-end gap-2 pb-2\">\n <Button\n variant=\"subtle\"\n color=\"neutral\"\n size={size}\n onClick={() => {\n setStaged(committed)\n api.setOpen(false)\n }}\n >\n {t.cancel}\n </Button>\n <Button\n size={size}\n onClick={() => {\n setCommitted(staged)\n api.setOpen(false)\n }}\n >\n {t.apply}\n </Button>\n </Popover.Footer>\n )}\n </div>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n\n {name &&\n (isRange ? (\n <>\n <input\n type=\"hidden\"\n name={`${name}Start`}\n value={\n api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"\n }\n />\n <input\n type=\"hidden\"\n name={`${name}End`}\n value={\n api.value[1] ? serializeDateValue(api.value[1], Boolean(withTime)) : \"\"\n }\n />\n </>\n ) : (\n <input\n type=\"hidden\"\n name={name}\n value={api.value[0] ? serializeDateValue(api.value[0], Boolean(withTime)) : \"\"}\n />\n ))}\n </>\n )}\n </Ark.Context>\n </Ark.Root>\n </FieldShell>\n )\n}\n\nexport const DatePicker = Object.assign(DatePickerImpl, {\n Root: Ark.Root,\n Context: Ark.Context,\n Control: Ark.Control,\n Input: Ark.Input,\n Trigger: Ark.Trigger,\n ClearTrigger: Ark.ClearTrigger,\n Content: Ark.Content,\n Presets: PresetsRail,\n Calendar: CalendarBody,\n TimePanel: TimeRow,\n TimePanelRow: TimePanelRow,\n Footer: Popover.Footer,\n}) as (<Range extends boolean = false>(props: DatePickerProps<Range>) => ReactNode) & {\n Root: typeof Ark.Root\n Context: typeof Ark.Context\n Control: typeof Ark.Control\n Input: typeof Ark.Input\n Trigger: typeof Ark.Trigger\n ClearTrigger: typeof Ark.ClearTrigger\n Content: typeof Ark.Content\n Presets: typeof PresetsRail\n Calendar: typeof CalendarBody\n TimePanel: typeof TimeRow\n TimePanelRow: typeof TimePanelRow\n Footer: typeof Popover.Footer\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { inputSlot, inputControlClasses } from './chunk-I4B3N3UX.js';
2
2
  import { fieldA11yProps } from './chunk-X6DESK37.js';
3
- import { Popover, popoverClearTrigger, popoverChevron, popoverEmpty } from './chunk-E3XLWMEB.js';
3
+ import { Popover, popoverClearTrigger, popoverChevron, popoverEmpty } from './chunk-RKCUXOU2.js';
4
4
  import { props } from './chunk-WYCMIIRR.js';
5
5
  import { focusStyles } from './chunk-C6NVU4F7.js';
6
6
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
@@ -341,5 +341,5 @@ var useTreeRovingFocus = ({
341
341
  };
342
342
 
343
343
  export { TreeBody, TreeLabel, TreeRails, TreeSearch, TreeTrigger, buildMaps, filterTree, flattenTree, isLeaf, renderTree, treeItemAria, treeRow, useTreeRovingFocus };
344
- //# sourceMappingURL=chunk-JDPVD2YE.js.map
345
- //# sourceMappingURL=chunk-JDPVD2YE.js.map
344
+ //# sourceMappingURL=chunk-HCHGERDB.js.map
345
+ //# sourceMappingURL=chunk-HCHGERDB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/tree-data.ts","../src/components/tree-select/tree-popover.tsx"],"names":["Fragment"],"mappings":";;;;;;;;;;;;;AAyGO,IAAM,MAAA,GAAS,CAAC,IAAA,KAAgC,CAAC,KAAK,QAAA,IAAY,IAAA,CAAK,SAAS,MAAA,KAAW;AAG3F,IAAM,SAAA,GAAY,CAAI,KAAA,KAA0C;AACrE,EAAA,MAAM,QAAA,uBAAe,GAAA,EAAoB;AACzC,EAAA,MAAM,OAAA,uBAAc,GAAA,EAA6B;AACjD,EAAA,MAAM,IAAA,GAAO,CAAC,EAAA,KAAuC;AACnD,IAAA,KAAA,MAAW,KAAK,EAAA,EAAI;AAClB,MAAA,QAAA,CAAS,GAAA,CAAI,CAAA,CAAE,KAAA,EAAO,CAAA,CAAE,KAAK,CAAA;AAC7B,MAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,CAAE,KAAA,EAAO,CAAC,CAAA;AACtB,MAAA,IAAI,CAAA,CAAE,QAAA,EAAU,IAAA,CAAK,CAAA,CAAE,QAAQ,CAAA;AAAA,IACjC;AAAA,EACF,CAAA;AACA,EAAA,IAAA,CAAK,KAAK,CAAA;AACV,EAAA,OAAO,EAAE,UAAU,OAAA,EAAQ;AAC7B;AAGO,IAAM,cAAc,CACzB,KAAA,EACA,iBAAA,EACA,GAAA,GAA8C,EAAC,KACJ;AAC3C,EAAA,KAAA,MAAW,KAAK,KAAA,EAAO;AACrB,IAAA,MAAM,YAAA,GAAe,iBAAA,IAAqB,CAAC,CAAC,CAAA,CAAE,QAAA;AAC9C,IAAA,GAAA,CAAI,KAAK,EAAE,KAAA,EAAO,EAAE,KAAA,EAAO,QAAA,EAAU,cAAc,CAAA;AACnD,IAAA,IAAI,EAAE,QAAA,EA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MAAA,EAAQ;AAC/E,UAAA,KAAA,CAAM,cAAA,EAAe;AACrB,UAAA,WAAA,CAAY,MAAM,GAAG,CAAA;AAAA,QACvB;AAAA;AACJ,EACF,CAAA;AAEA,EAAA,MAAM,eAAA,GAAkB,CAAC,KAAA,KAA2C;AAClE,IAAA,IAAI,KAAA,CAAM,QAAQ,WAAA,EAAa;AAC7B,MAAA,KAAA,CAAM,cAAA,EAAe;AACrB,MAAA,QAAA,CAAS,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,IACpB;AAAA,EACF,CAAA;AAIA,EAAA,MAAM,QAAA,GAAW,CAAC,KAAA,MAAmB;AAAA,IACnC,GAAA,EAAK,CAAC,EAAA,KAA2B;AAC/B,MAAA,IAAI,EAAA,EAAI,OAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,OAAO,EAAE,CAAA;AAAA,WAChC,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,KAAK,CAAA;AAAA,IACnC,CAAA;AAAA,IACA,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,KAAA,KAAU,aAAa;AAAA,GACnD,CAAA;AAEA,EAAA,OAAO,EAAE,WAAA,EAAa,cAAA,EAAgB,SAAA,EAAW,QAAA,EAAU,eAAe,eAAA,EAAgB;AAC5F","file":"chunk-JDPVD2YE.js","sourcesContent":["/**\n * Shared tree model + pure helpers for the hierarchical pickers (TreeSelect,\n * TreeMultiSelect). `data` is a tree of `{ value, label, disabled?, children? }`;\n * a node with `children` is a *branch*, one without is a *leaf*. These helpers\n * are selection-agnostic — the single / multi cascade logic lives in each\n * component (mirrors `lib/select-data.ts` for the flat pickers).\n *\n * A node may carry an arbitrary, optional `payload`. Selection ignores it\n * (value / label / disabled drive everything) but it flows through to a tree\n * picker's `renderItem` as `node.payload`.\n */\n\nimport type { ReactNode } from \"react\"\nimport type { LabelSearch } from \"./select-data\"\n\nexport type TreeNodeData<P = unknown> = {\n value: string\n label: string\n disabled?: boolean\n children?: TreeNodeData<P>[]\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered row. Defaults to `` `item-${value}` `` —\n * set it explicitly when `value` isn't a safe/stable test selector on its\n * own. Unlike the Ark-machine-backed pickers, this tree is hand-rolled, so\n * there's no free `data-part` / `data-value` here — `testId` is the row's\n * only stable selector. */\n testId?: string\n}\n\n/**\n * A tree picker's `data` shape. Not generic over the node payload here (a\n * component generic over both `Data` and `P` independently defeats payload\n * inference — see `TreePayload` below); `TreeNodeData`'s own `P` still drives\n * autocomplete, extracted structurally from `Data` when needed.\n */\nexport type TreeSelectData = ReadonlyArray<TreeNodeData>\n\n/**\n * Extract the literal value union from a tree of `TreeNodeData` — the tree\n * analogue of `lib/select-data.ts`'s `SelectValue`, walking every node's\n * `value` plus its `children` (recursively) so a `const`-typed `data` prop\n * narrows `value` / `onChange` to the tree's actual node values instead of\n * plain `string`.\n */\nexport type TreeValue<Nodes extends ReadonlyArray<TreeNodeData>> = TreeNodeValue<Nodes[number]>\n\ntype TreeNodeValue<N> = N extends TreeNodeData\n ?\n | N[\"value\"]\n | (N[\"children\"] extends ReadonlyArray<TreeNodeData> ? TreeValue<N[\"children\"]> : never)\n : never\n\n/**\n * Extract the `payload` type carried by a tree — read structurally off every\n * node's own `payload` property (robust against generic-instantiation\n * inference, same approach as `lib/select-data.ts`'s `SelectPayload`),\n * recursing into `children`. Payload-less nodes contribute `never`; a\n * homogeneous payload resolves precisely, a mixed one to the union.\n */\nexport type TreePayload<Nodes extends ReadonlyArray<TreeNodeData>> = TreeNodePayload<Nodes[number]>\n\ntype TreeNodePayload<N> = N extends TreeNodeData\n ?\n | (N extends { payload: infer P } ? P : never)\n | (N[\"children\"] extends ReadonlyArray<TreeNodeData> ? TreePayload<N[\"children\"]> : never)\n : never\n\n/**\n * Live node state passed alongside the node to a tree picker's `renderItem`.\n * `depth` is 0-based (the row renders `aria-level={depth + 1}`); `leaf`\n * distinguishes selectable leaves from organizational branches.\n */\nexport type TreeSelectItemState = {\n selected: boolean\n leaf: boolean\n disabled: boolean\n depth: number\n}\n\n/** Tri-state variant for `TreeMultiSelect` — branches cascade to `indeterminate`. */\nexport type TreeMultiSelectItemState = {\n checked: boolean\n indeterminate: boolean\n leaf: boolean\n disabled: boolean\n depth: number\n}\n\n/**\n * Render a node's content yourself. The component keeps owning the row\n * (treeitem role, indent rails, roving focus, click); the callback fills the\n * content after the rails and receives the node (including its typed `payload`).\n * In an RSC tree the function must live in a `\"use client\"` module so the\n * boundary serializes it as a client reference.\n */\nexport type RenderTreeSelectItem<P = unknown> = (\n node: TreeNodeData<P>,\n state: TreeSelectItemState,\n) => ReactNode\nexport type RenderTreeMultiSelectItem<P = unknown> = (\n node: TreeNodeData<P>,\n state: TreeMultiSelectItemState,\n) => ReactNode\n\nexport const isLeaf = (node: TreeNodeData): boolean => !node.children || node.children.length === 0\n\n/** value → label (trigger display) and value → node (toggling from keyboard / filtered rows). */\nexport const buildMaps = <P>(nodes: ReadonlyArray<TreeNodeData<P>>) => {\n const labelMap = new Map<string, string>()\n const nodeMap = new Map<string, TreeNodeData<P>>()\n const walk = (ns: ReadonlyArray<TreeNodeData<P>>) => {\n for (const n of ns) {\n labelMap.set(n.value, n.label)\n nodeMap.set(n.value, n)\n if (n.children) walk(n.children)\n }\n }\n walk(nodes)\n return { labelMap, nodeMap }\n}\n\n/** Pre-order list of node values + inherited-disabled flag — drives roving focus. */\nexport const flattenTree = (\n nodes: ReadonlyArray<TreeNodeData>,\n inheritedDisabled: boolean,\n acc: { value: string; disabled: boolean }[] = [],\n): { value: string; disabled: boolean }[] => {\n for (const n of nodes) {\n const nodeDisabled = inheritedDisabled || !!n.disabled\n acc.push({ value: n.value, disabled: nodeDisabled })\n if (n.children) flattenTree(n.children, nodeDisabled, acc)\n }\n return acc\n}\n\n/**\n * Keep nodes whose label (or a descendant's) matches `query`; preserves ancestors.\n * `matches` is the pickers' shared locale-aware search (`useLabelSearch().matches`), passed in\n * because this is a plain function: accents and case fold away, Turkish keeps its i's apart.\n */\nexport const filterTree = <P>(\n nodes: ReadonlyArray<TreeNodeData<P>>,\n query: string,\n matches: LabelSearch[\"matches\"],\n): TreeNodeData<P>[] => {\n if (!query.trim()) return nodes as TreeNodeData<P>[]\n const recurse = (ns: ReadonlyArray<TreeNodeData<P>>): TreeNodeData<P>[] => {\n const out: TreeNodeData<P>[] = []\n for (const n of ns) {\n const selfMatch = matches(n.label, query)\n if (isLeaf(n)) {\n if (selfMatch) out.push(n)\n } else if (selfMatch) {\n out.push(n) // branch matches → keep its full subtree\n } else if (n.children) {\n const kids = recurse(n.children)\n if (kids.length > 0) out.push({ ...n, children: kids })\n }\n }\n return out\n }\n return recurse(nodes)\n}\n","\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { cva } from \"class-variance-authority\"\nimport {\n type ComponentProps,\n Fragment,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { ClearSectionMode } from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport type { TreeNodeData } from \"../../lib/tree-data\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { fieldA11yProps } from \"../field/field\"\nimport { inputControlClasses, inputSlot } from \"../input/input\"\nimport { Popover, popoverChevron, popoverClearTrigger, popoverEmpty } from \"../popover/popover\"\n\n/**\n * The internals `TreeSelect` and `TreeMultiSelect` share: the row styles, the\n * indent rails, the combobox trigger, the search header, the tree body and the\n * roving focus (arrows, Home / End, type-ahead). Each picker keeps only what\n * differs: what a row shows, and what activating one does.\n */\n\n/** Indent guide / connector colour, shared by rails and the elbow. */\nconst treeLine = \"bg-brand-900/20 dark:bg-white/15\"\n\n/**\n * One tree row. `interactive` rows (every TreeMultiSelect row, TreeSelect's\n * leaves) take roving focus and hover/active surfaces: neutral and\n * transparent, a low-opacity black/white wash rather than an opaque gray,\n * matching the popover surface's own background-dependent tint (no Figma\n * reference for this state yet). The others are TreeSelect's branches:\n * organizational, present for structure and levels, never focused.\n */\nexport const treeRow = cva(\n [\"group/row relative flex w-full items-center rounded-sm ps-1.5 outline-none select-none\"],\n {\n variants: {\n size: {\n xs: \"min-h-7 pe-1.5 text-xs\",\n sm: \"min-h-8 pe-2 text-sm\",\n md: \"min-h-9 pe-2 text-md\",\n lg: \"min-h-10 pe-2.5 text-lg\",\n xl: \"min-h-11 pe-3 text-xl\",\n },\n interactive: {\n true: [\n \"cursor-pointer\",\n TEXT_COLOR_CLASSES.primary,\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n \"data-active:bg-black/5 dark:data-active:bg-white/8\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n // Palette, not brand: the focused row is also the active one, and brand-500\n // measured 2.73:1 against that light fill. `--c-text` (the popover's\n // `data-color`, neutral by default) clears it in both themes.\n focusStyles({ ring: \"palette\", offset: false, inset: true }),\n ],\n false: [\"cursor-default font-medium\", TEXT_COLOR_CLASSES.secondary],\n },\n },\n defaultVariants: { size: \"md\", interactive: true },\n },\n)\n\n/** Where a node sits in the rendered tree: what its rails and set position need. */\nexport type TreePosition = {\n /** 0-based; the row renders `aria-level={depth + 1}`. */\n depth: number\n /** Per ancestor below the top level: whether it has a sibling after it (its rail continues). */\n ancestorHasNextSibling: boolean[]\n /** Last among its siblings: the connector stops at the elbow. */\n isLast: boolean\n /** 1-based index among its siblings. */\n posinset: number\n /** Number of siblings, itself included. */\n setsize: number\n}\n\n/**\n * Walk `nodes` depth-first, rendering each through `row` with its position,\n * its subtree flattened right after it: the tree is one flat list of rows,\n * its hierarchy carried by `aria-level` and the rails.\n */\nexport const renderTree = <P,>(\n nodes: ReadonlyArray<TreeNodeData<P>>,\n row: (node: TreeNodeData<P>, position: TreePosition) => ReactNode,\n depth = 0,\n ancestorHasNextSibling: boolean[] = [],\n): ReactNode =>\n nodes.map((node, i) => {\n const position = {\n depth,\n ancestorHasNextSibling,\n isLast: i === nodes.length - 1,\n posinset: i + 1,\n setsize: nodes.length,\n }\n return (\n <Fragment key={node.value}>\n {row(node, position)}\n {node.children &&\n renderTree(\n node.children,\n row,\n depth + 1,\n depth === 0 ? [] : [...ancestorHasNextSibling, !position.isLast],\n )}\n </Fragment>\n )\n })\n\n/** A row's level and set position. The tree renders flat, so the browser can't derive them. */\nexport const treeItemAria = ({ depth, setsize, posinset }: TreePosition) => ({\n \"aria-level\": depth + 1,\n \"aria-setsize\": setsize,\n \"aria-posinset\": posinset,\n})\n\n/** The indent guides before a row's content. Top-level rows sit flush. */\nexport const TreeRails = ({ depth, ancestorHasNextSibling, isLast }: TreePosition) =>\n depth > 0 && (\n <>\n {/* ancestor rails: a vertical guide where that ancestor has a sibling below */}\n {ancestorHasNextSibling.map((hasNext, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: Indentation is stable inside component, we would want to rerender anyway.\n <span key={i} aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n {hasNext && <span className={cn(\"absolute inset-y-0 inset-s-1/2 w-px\", treeLine)} />}\n </span>\n ))}\n\n {/* connector: vertical (├ continues / └ stops) + horizontal elbow */}\n <span aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n <span\n className={cn(\"absolute inset-s-1/2 top-0 w-px\", treeLine, isLast ? \"h-1/2\" : \"bottom-0\")}\n />\n <span className={cn(\"absolute inset-s-1/2 top-1/2 h-px w-1/2\", treeLine)} />\n </span>\n </>\n )\n\n/** A row's default label, after the rails. */\nexport const TreeLabel = ({ className, children }: { className?: string; children: ReactNode }) => (\n <span className={cn(\"ms-1.5 min-w-0 flex-1 truncate text-start\", className)}>{children}</span>\n)\n\ntype TreeTriggerProps = Omit<ComponentProps<\"div\">, \"role\" | \"tabIndex\" | \"color\"> &\n WithTestId & {\n open: boolean\n disabled?: boolean\n readOnly?: boolean\n invalid: boolean\n color?: Color\n startSlot?: ReactNode\n endSlot?: ReactNode\n /** Clears the value. Omit it to hide the clear button. */\n onClear?: () => void\n clearLabel: string\n clearSectionMode: ClearSectionMode\n icons: { clear: ReactNode; chevron: ReactNode }\n /** Enter, Space or ↓ on the closed trigger. */\n onOpen: () => void\n }\n\n/**\n * The real, focusable `<div role=\"combobox\">`, with its start slot, value\n * (`children`), end slot, clear button and chevron. A component of its own so\n * it reads the `Field` context from *inside* the picker's `FieldShell`: the\n * picker renders that shell, so `useFieldContext()` at its top level would\n * run too early. `Popover.Trigger` stamps its own id on the element, so the\n * `<label for>` never reaches it: the name comes from `aria-labelledby`.\n */\nexport const TreeTrigger = ({\n open,\n disabled,\n readOnly,\n invalid,\n color,\n startSlot,\n endSlot,\n onClear,\n clearLabel,\n clearSectionMode,\n icons,\n onOpen,\n testId,\n children,\n ...rest\n}: TreeTriggerProps) => {\n const field = useFieldContext()\n return (\n <Popover.Trigger asChild>\n <div\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n tabIndex={disabled ? -1 : 0}\n {...fieldA11yProps(field)}\n data-color={color}\n {...props({\n \"aria-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n \"data-invalid\": invalid,\n \"data-with-start-slot\": startSlot != null,\n // The trigger always ends in a chevron (and optional clear).\n \"data-with-end-slot\": true,\n // The shell IS the tabbable/focusable element here (no separate\n // inner control to route to), so `testId` lands directly on it.\n \"data-testid\": testId,\n })}\n onKeyDown={(event) => {\n if (disabled || readOnly) return\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"ArrowDown\") {\n event.preventDefault()\n onOpen()\n }\n }}\n {...rest}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n {children}\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {onClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onPointerDown={(event) => {\n event.preventDefault()\n event.stopPropagation()\n }}\n onClick={(event) => {\n event.stopPropagation()\n onClear()\n }}\n className={popoverClearTrigger}\n >\n {icons.clear}\n </button>\n )}\n {(clearSectionMode === \"both\" || !onClear) && (\n <span aria-hidden data-chevron className={cn(popoverChevron, open && \"rotate-180\")}>\n {icons.chevron}\n </span>\n )}\n </div>\n </Popover.Trigger>\n )\n}\n\n/** The popover's search field, in its fixed header. */\nexport const TreeSearch = ({\n ref,\n value,\n onChange,\n onKeyDown,\n placeholder,\n label,\n className,\n}: {\n ref: Ref<HTMLInputElement>\n value: string\n onChange: (value: string) => void\n onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void\n placeholder: string\n label: string\n className?: string\n}) => (\n <Popover.Header>\n <input\n ref={ref}\n type=\"text\"\n value={value}\n onChange={(event) => onChange(event.target.value)}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n aria-label={label}\n className={cn(inputControlClasses, \"text-sm\", className)}\n />\n </Popover.Header>\n)\n\n/** The scrolling body: the `role=\"tree\"` list, or `empty` when the search matched nothing. */\nexport const TreeBody = ({\n id,\n isEmpty,\n empty,\n multiselectable,\n onKeyDown,\n children,\n}: {\n id: string\n isEmpty: boolean\n empty: ReactNode\n multiselectable?: boolean\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void\n children: ReactNode\n}) => (\n <Popover.Body>\n {isEmpty ? (\n <div className={popoverEmpty}>{empty}</div>\n ) : (\n <div\n id={id}\n role=\"tree\"\n {...props({ \"aria-multiselectable\": multiselectable && \"true\" })}\n aria-orientation=\"vertical\"\n onKeyDown={onKeyDown}\n className=\"flex flex-col\"\n >\n {children}\n </div>\n )}\n </Popover.Body>\n)\n\ntype UseTreeRovingFocusOptions = {\n /** The rows that take focus (enabled, and selectable), in visual order. */\n values: readonly string[]\n /** A row's label, matched by type-ahead. */\n labelOf: (value: string) => string\n open: boolean\n searchable: boolean\n /** Space / Enter on the focused row. */\n onActivate: (value: string) => void\n}\n\n/**\n * Roving focus over a flat-rendered tree. One row is active (`tabIndex=0`,\n * `data-active`); `↑` / `↓` step through `values`, `Home` / `End` jump to\n * either end, `Space` / `Enter` activate, and printable keys type-ahead to the\n * next row whose label starts with what was typed. On open, focus lands in\n * the search field when there is one, on the active row otherwise.\n */\nexport const useTreeRovingFocus = ({\n values,\n labelOf,\n open,\n searchable,\n onActivate,\n}: UseTreeRovingFocusOptions) => {\n const [activeValueState, setActiveValue] = useState<string | null>(null)\n // A row filtered out (or disabled) since it was active falls back to the first.\n const activeValue =\n activeValueState != null && values.includes(activeValueState)\n ? activeValueState\n : (values[0] ?? null)\n\n const searchRef = useRef<HTMLInputElement>(null)\n const rowRefs = useRef(new Map<string, HTMLElement>())\n const focusRow = (next: string | null | undefined) => {\n if (next == null) return\n setActiveValue(next)\n rowRefs.current.get(next)?.focus()\n }\n\n // Type-ahead: typed characters buffer briefly and jump to the next row whose\n // label starts with the buffer. Only fires while the tree itself has focus —\n // when `searchable`, keys land in the search field instead.\n const typeahead = useRef<{ query: string; timer: ReturnType<typeof setTimeout> | null }>({\n query: \"\",\n timer: null,\n })\n useEffect(\n () => () => {\n if (typeahead.current.timer) clearTimeout(typeahead.current.timer)\n },\n [],\n )\n const typeToFocus = (char: string) => {\n const state = typeahead.current\n if (state.timer) clearTimeout(state.timer)\n state.query += char\n state.timer = setTimeout(() => {\n state.query = \"\"\n }, 500)\n\n const n = values.length\n if (n === 0) return\n const q = state.query.toLowerCase()\n // A run of the same key (\"ss\") cycles through same-initial matches.\n const repeated = q.length > 1 && [...q].every((c) => c === q.charAt(0))\n const needle = repeated ? q.charAt(0) : q\n const start = activeValue ? values.indexOf(activeValue) : -1\n const base = start === -1 ? 0 : start\n // Advance past the current row for a fresh/repeated key; keep it for a\n // growing multi-char query so the current match can still satisfy it.\n const advance = start !== -1 && (q.length === 1 || repeated) ? 1 : 0\n const match = Array.from({ length: n }, (_, i) => values[(base + advance + i) % n]).find(\n (value) => value != null && labelOf(value).toLowerCase().startsWith(needle),\n )\n focusRow(match)\n }\n\n // On open, focus the search field (or the active row). Initial focus only.\n // biome-ignore lint/correctness/useExhaustiveDependencies: re-running on activeValue would steal focus while navigating the tree.\n useEffect(() => {\n if (!open) return\n const id = requestAnimationFrame(() => {\n // preventScroll: the content is portaled, so focusing it before the\n // positioner places it would otherwise warp the page to the top.\n if (searchable) searchRef.current?.focus({ preventScroll: true })\n else if (activeValue) rowRefs.current.get(activeValue)?.focus({ preventScroll: true })\n })\n return () => cancelAnimationFrame(id)\n }, [open, searchable])\n\n const moveActive = (dir: 1 | -1) => {\n if (values.length === 0) return\n const idx = activeValue ? values.indexOf(activeValue) : -1\n const next =\n idx === -1\n ? dir === 1\n ? 0\n : values.length - 1\n : Math.min(Math.max(idx + dir, 0), values.length - 1)\n focusRow(values[next])\n }\n\n const onTreeKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault()\n moveActive(1)\n break\n case \"ArrowUp\":\n event.preventDefault()\n moveActive(-1)\n break\n case \"Home\":\n event.preventDefault()\n focusRow(values[0])\n break\n case \"End\":\n event.preventDefault()\n focusRow(values[values.length - 1])\n break\n case \" \":\n case \"Enter\":\n event.preventDefault()\n if (activeValue != null) onActivate(activeValue)\n break\n default:\n // Single printable key (no modifier) drives type-ahead. Space never\n // reaches here — it's handled above as \"activate\".\n if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n event.preventDefault()\n typeToFocus(event.key)\n }\n }\n }\n\n const onSearchKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault()\n focusRow(values[0])\n }\n }\n\n /** Spread on each focusable row: its ref and `data-active`. The row sets its own roving\n * `tabIndex={value === activeValue ? 0 : -1}`, where the a11y lint can see it. */\n const rowProps = (value: string) => ({\n ref: (el: HTMLElement | null) => {\n if (el) rowRefs.current.set(value, el)\n else rowRefs.current.delete(value)\n },\n ...props({ \"data-active\": value === activeValue }),\n })\n\n return { activeValue, setActiveValue, searchRef, rowProps, onTreeKeyDown, onS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AEA,EAAA,MAAM,eAAA,GAAkB,CAAC,KAAA,KAA2C;AAClE,IAAA,IAAI,KAAA,CAAM,QAAQ,WAAA,EAAa;AAC7B,MAAA,KAAA,CAAM,cAAA,EAAe;AACrB,MAAA,QAAA,CAAS,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,IACpB;AAAA,EACF,CAAA;AAIA,EAAA,MAAM,QAAA,GAAW,CAAC,KAAA,MAAmB;AAAA,IACnC,GAAA,EAAK,CAAC,EAAA,KAA2B;AAC/B,MAAA,IAAI,EAAA,EAAI,OAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,OAAO,EAAE,CAAA;AAAA,WAChC,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,KAAK,CAAA;AAAA,IACnC,CAAA;AAAA,IACA,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,KAAA,KAAU,aAAa;AAAA,GACnD,CAAA;AAEA,EAAA,OAAO,EAAE,WAAA,EAAa,cAAA,EAAgB,SAAA,EAAW,QAAA,EAAU,eAAe,eAAA,EAAgB;AAC5F","file":"chunk-HCHGERDB.js","sourcesContent":["/**\n * Shared tree model + pure helpers for the hierarchical pickers (TreeSelect,\n * TreeMultiSelect). `data` is a tree of `{ value, label, disabled?, children? }`;\n * a node with `children` is a *branch*, one without is a *leaf*. These helpers\n * are selection-agnostic — the single / multi cascade logic lives in each\n * component (mirrors `lib/select-data.ts` for the flat pickers).\n *\n * A node may carry an arbitrary, optional `payload`. Selection ignores it\n * (value / label / disabled drive everything) but it flows through to a tree\n * picker's `renderItem` as `node.payload`.\n */\n\nimport type { ReactNode } from \"react\"\nimport type { LabelSearch } from \"./select-data\"\n\nexport type TreeNodeData<P = unknown> = {\n value: string\n label: string\n disabled?: boolean\n children?: TreeNodeData<P>[]\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered row. Defaults to `` `item-${value}` `` —\n * set it explicitly when `value` isn't a safe/stable test selector on its\n * own. Unlike the Ark-machine-backed pickers, this tree is hand-rolled, so\n * there's no free `data-part` / `data-value` here — `testId` is the row's\n * only stable selector. */\n testId?: string\n}\n\n/**\n * A tree picker's `data` shape. Not generic over the node payload here (a\n * component generic over both `Data` and `P` independently defeats payload\n * inference — see `TreePayload` below); `TreeNodeData`'s own `P` still drives\n * autocomplete, extracted structurally from `Data` when needed.\n */\nexport type TreeSelectData = ReadonlyArray<TreeNodeData>\n\n/**\n * Extract the literal value union from a tree of `TreeNodeData` — the tree\n * analogue of `lib/select-data.ts`'s `SelectValue`, walking every node's\n * `value` plus its `children` (recursively) so a `const`-typed `data` prop\n * narrows `value` / `onChange` to the tree's actual node values instead of\n * plain `string`.\n */\nexport type TreeValue<Nodes extends ReadonlyArray<TreeNodeData>> = TreeNodeValue<Nodes[number]>\n\ntype TreeNodeValue<N> = N extends TreeNodeData\n ?\n | N[\"value\"]\n | (N[\"children\"] extends ReadonlyArray<TreeNodeData> ? TreeValue<N[\"children\"]> : never)\n : never\n\n/**\n * Extract the `payload` type carried by a tree — read structurally off every\n * node's own `payload` property (robust against generic-instantiation\n * inference, same approach as `lib/select-data.ts`'s `SelectPayload`),\n * recursing into `children`. Payload-less nodes contribute `never`; a\n * homogeneous payload resolves precisely, a mixed one to the union.\n */\nexport type TreePayload<Nodes extends ReadonlyArray<TreeNodeData>> = TreeNodePayload<Nodes[number]>\n\ntype TreeNodePayload<N> = N extends TreeNodeData\n ?\n | (N extends { payload: infer P } ? P : never)\n | (N[\"children\"] extends ReadonlyArray<TreeNodeData> ? TreePayload<N[\"children\"]> : never)\n : never\n\n/**\n * Live node state passed alongside the node to a tree picker's `renderItem`.\n * `depth` is 0-based (the row renders `aria-level={depth + 1}`); `leaf`\n * distinguishes selectable leaves from organizational branches.\n */\nexport type TreeSelectItemState = {\n selected: boolean\n leaf: boolean\n disabled: boolean\n depth: number\n}\n\n/** Tri-state variant for `TreeMultiSelect` — branches cascade to `indeterminate`. */\nexport type TreeMultiSelectItemState = {\n checked: boolean\n indeterminate: boolean\n leaf: boolean\n disabled: boolean\n depth: number\n}\n\n/**\n * Render a node's content yourself. The component keeps owning the row\n * (treeitem role, indent rails, roving focus, click); the callback fills the\n * content after the rails and receives the node (including its typed `payload`).\n * In an RSC tree the function must live in a `\"use client\"` module so the\n * boundary serializes it as a client reference.\n */\nexport type RenderTreeSelectItem<P = unknown> = (\n node: TreeNodeData<P>,\n state: TreeSelectItemState,\n) => ReactNode\nexport type RenderTreeMultiSelectItem<P = unknown> = (\n node: TreeNodeData<P>,\n state: TreeMultiSelectItemState,\n) => ReactNode\n\nexport const isLeaf = (node: TreeNodeData): boolean => !node.children || node.children.length === 0\n\n/** value → label (trigger display) and value → node (toggling from keyboard / filtered rows). */\nexport const buildMaps = <P>(nodes: ReadonlyArray<TreeNodeData<P>>) => {\n const labelMap = new Map<string, string>()\n const nodeMap = new Map<string, TreeNodeData<P>>()\n const walk = (ns: ReadonlyArray<TreeNodeData<P>>) => {\n for (const n of ns) {\n labelMap.set(n.value, n.label)\n nodeMap.set(n.value, n)\n if (n.children) walk(n.children)\n }\n }\n walk(nodes)\n return { labelMap, nodeMap }\n}\n\n/** Pre-order list of node values + inherited-disabled flag — drives roving focus. */\nexport const flattenTree = (\n nodes: ReadonlyArray<TreeNodeData>,\n inheritedDisabled: boolean,\n acc: { value: string; disabled: boolean }[] = [],\n): { value: string; disabled: boolean }[] => {\n for (const n of nodes) {\n const nodeDisabled = inheritedDisabled || !!n.disabled\n acc.push({ value: n.value, disabled: nodeDisabled })\n if (n.children) flattenTree(n.children, nodeDisabled, acc)\n }\n return acc\n}\n\n/**\n * Keep nodes whose label (or a descendant's) matches `query`; preserves ancestors.\n * `matches` is the pickers' shared locale-aware search (`useLabelSearch().matches`), passed in\n * because this is a plain function: accents and case fold away, Turkish keeps its i's apart.\n */\nexport const filterTree = <P>(\n nodes: ReadonlyArray<TreeNodeData<P>>,\n query: string,\n matches: LabelSearch[\"matches\"],\n): TreeNodeData<P>[] => {\n if (!query.trim()) return nodes as TreeNodeData<P>[]\n const recurse = (ns: ReadonlyArray<TreeNodeData<P>>): TreeNodeData<P>[] => {\n const out: TreeNodeData<P>[] = []\n for (const n of ns) {\n const selfMatch = matches(n.label, query)\n if (isLeaf(n)) {\n if (selfMatch) out.push(n)\n } else if (selfMatch) {\n out.push(n) // branch matches → keep its full subtree\n } else if (n.children) {\n const kids = recurse(n.children)\n if (kids.length > 0) out.push({ ...n, children: kids })\n }\n }\n return out\n }\n return recurse(nodes)\n}\n","\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { cva } from \"class-variance-authority\"\nimport {\n type ComponentProps,\n Fragment,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { ClearSectionMode } from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport type { TreeNodeData } from \"../../lib/tree-data\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { fieldA11yProps } from \"../field/field\"\nimport { inputControlClasses, inputSlot } from \"../input/input\"\nimport { Popover, popoverChevron, popoverClearTrigger, popoverEmpty } from \"../popover/popover\"\n\n/**\n * The internals `TreeSelect` and `TreeMultiSelect` share: the row styles, the\n * indent rails, the combobox trigger, the search header, the tree body and the\n * roving focus (arrows, Home / End, type-ahead). Each picker keeps only what\n * differs: what a row shows, and what activating one does.\n */\n\n/** Indent guide / connector colour, shared by rails and the elbow. */\nconst treeLine = \"bg-brand-900/20 dark:bg-white/15\"\n\n/**\n * One tree row. `interactive` rows (every TreeMultiSelect row, TreeSelect's\n * leaves) take roving focus and hover/active surfaces: neutral and\n * transparent, a low-opacity black/white wash rather than an opaque gray,\n * matching the popover surface's own background-dependent tint (no Figma\n * reference for this state yet). The others are TreeSelect's branches:\n * organizational, present for structure and levels, never focused.\n */\nexport const treeRow = cva(\n [\"group/row relative flex w-full items-center rounded-sm ps-1.5 outline-none select-none\"],\n {\n variants: {\n size: {\n xs: \"min-h-7 pe-1.5 text-xs\",\n sm: \"min-h-8 pe-2 text-sm\",\n md: \"min-h-9 pe-2 text-md\",\n lg: \"min-h-10 pe-2.5 text-lg\",\n xl: \"min-h-11 pe-3 text-xl\",\n },\n interactive: {\n true: [\n \"cursor-pointer\",\n TEXT_COLOR_CLASSES.primary,\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n \"data-active:bg-black/5 dark:data-active:bg-white/8\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n // Palette, not brand: the focused row is also the active one, and brand-500\n // measured 2.73:1 against that light fill. `--c-text` (the popover's\n // `data-color`, neutral by default) clears it in both themes.\n focusStyles({ ring: \"palette\", offset: false, inset: true }),\n ],\n false: [\"cursor-default font-medium\", TEXT_COLOR_CLASSES.secondary],\n },\n },\n defaultVariants: { size: \"md\", interactive: true },\n },\n)\n\n/** Where a node sits in the rendered tree: what its rails and set position need. */\nexport type TreePosition = {\n /** 0-based; the row renders `aria-level={depth + 1}`. */\n depth: number\n /** Per ancestor below the top level: whether it has a sibling after it (its rail continues). */\n ancestorHasNextSibling: boolean[]\n /** Last among its siblings: the connector stops at the elbow. */\n isLast: boolean\n /** 1-based index among its siblings. */\n posinset: number\n /** Number of siblings, itself included. */\n setsize: number\n}\n\n/**\n * Walk `nodes` depth-first, rendering each through `row` with its position,\n * its subtree flattened right after it: the tree is one flat list of rows,\n * its hierarchy carried by `aria-level` and the rails.\n */\nexport const renderTree = <P,>(\n nodes: ReadonlyArray<TreeNodeData<P>>,\n row: (node: TreeNodeData<P>, position: TreePosition) => ReactNode,\n depth = 0,\n ancestorHasNextSibling: boolean[] = [],\n): ReactNode =>\n nodes.map((node, i) => {\n const position = {\n depth,\n ancestorHasNextSibling,\n isLast: i === nodes.length - 1,\n posinset: i + 1,\n setsize: nodes.length,\n }\n return (\n <Fragment key={node.value}>\n {row(node, position)}\n {node.children &&\n renderTree(\n node.children,\n row,\n depth + 1,\n depth === 0 ? [] : [...ancestorHasNextSibling, !position.isLast],\n )}\n </Fragment>\n )\n })\n\n/** A row's level and set position. The tree renders flat, so the browser can't derive them. */\nexport const treeItemAria = ({ depth, setsize, posinset }: TreePosition) => ({\n \"aria-level\": depth + 1,\n \"aria-setsize\": setsize,\n \"aria-posinset\": posinset,\n})\n\n/** The indent guides before a row's content. Top-level rows sit flush. */\nexport const TreeRails = ({ depth, ancestorHasNextSibling, isLast }: TreePosition) =>\n depth > 0 && (\n <>\n {/* ancestor rails: a vertical guide where that ancestor has a sibling below */}\n {ancestorHasNextSibling.map((hasNext, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: Indentation is stable inside component, we would want to rerender anyway.\n <span key={i} aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n {hasNext && <span className={cn(\"absolute inset-y-0 inset-s-1/2 w-px\", treeLine)} />}\n </span>\n ))}\n\n {/* connector: vertical (├ continues / └ stops) + horizontal elbow */}\n <span aria-hidden className=\"relative w-4 shrink-0 self-stretch\">\n <span\n className={cn(\"absolute inset-s-1/2 top-0 w-px\", treeLine, isLast ? \"h-1/2\" : \"bottom-0\")}\n />\n <span className={cn(\"absolute inset-s-1/2 top-1/2 h-px w-1/2\", treeLine)} />\n </span>\n </>\n )\n\n/** A row's default label, after the rails. */\nexport const TreeLabel = ({ className, children }: { className?: string; children: ReactNode }) => (\n <span className={cn(\"ms-1.5 min-w-0 flex-1 truncate text-start\", className)}>{children}</span>\n)\n\ntype TreeTriggerProps = Omit<ComponentProps<\"div\">, \"role\" | \"tabIndex\" | \"color\"> &\n WithTestId & {\n open: boolean\n disabled?: boolean\n readOnly?: boolean\n invalid: boolean\n color?: Color\n startSlot?: ReactNode\n endSlot?: ReactNode\n /** Clears the value. Omit it to hide the clear button. */\n onClear?: () => void\n clearLabel: string\n clearSectionMode: ClearSectionMode\n icons: { clear: ReactNode; chevron: ReactNode }\n /** Enter, Space or ↓ on the closed trigger. */\n onOpen: () => void\n }\n\n/**\n * The real, focusable `<div role=\"combobox\">`, with its start slot, value\n * (`children`), end slot, clear button and chevron. A component of its own so\n * it reads the `Field` context from *inside* the picker's `FieldShell`: the\n * picker renders that shell, so `useFieldContext()` at its top level would\n * run too early. `Popover.Trigger` stamps its own id on the element, so the\n * `<label for>` never reaches it: the name comes from `aria-labelledby`.\n */\nexport const TreeTrigger = ({\n open,\n disabled,\n readOnly,\n invalid,\n color,\n startSlot,\n endSlot,\n onClear,\n clearLabel,\n clearSectionMode,\n icons,\n onOpen,\n testId,\n children,\n ...rest\n}: TreeTriggerProps) => {\n const field = useFieldContext()\n return (\n <Popover.Trigger asChild>\n <div\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n tabIndex={disabled ? -1 : 0}\n {...fieldA11yProps(field)}\n data-color={color}\n {...props({\n \"aria-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n \"data-invalid\": invalid,\n \"data-with-start-slot\": startSlot != null,\n // The trigger always ends in a chevron (and optional clear).\n \"data-with-end-slot\": true,\n // The shell IS the tabbable/focusable element here (no separate\n // inner control to route to), so `testId` lands directly on it.\n \"data-testid\": testId,\n })}\n onKeyDown={(event) => {\n if (disabled || readOnly) return\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"ArrowDown\") {\n event.preventDefault()\n onOpen()\n }\n }}\n {...rest}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n {children}\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {onClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onPointerDown={(event) => {\n event.preventDefault()\n event.stopPropagation()\n }}\n onClick={(event) => {\n event.stopPropagation()\n onClear()\n }}\n className={popoverClearTrigger}\n >\n {icons.clear}\n </button>\n )}\n {(clearSectionMode === \"both\" || !onClear) && (\n <span aria-hidden data-chevron className={cn(popoverChevron, open && \"rotate-180\")}>\n {icons.chevron}\n </span>\n )}\n </div>\n </Popover.Trigger>\n )\n}\n\n/** The popover's search field, in its fixed header. */\nexport const TreeSearch = ({\n ref,\n value,\n onChange,\n onKeyDown,\n placeholder,\n label,\n className,\n}: {\n ref: Ref<HTMLInputElement>\n value: string\n onChange: (value: string) => void\n onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void\n placeholder: string\n label: string\n className?: string\n}) => (\n <Popover.Header>\n <input\n ref={ref}\n type=\"text\"\n value={value}\n onChange={(event) => onChange(event.target.value)}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n aria-label={label}\n className={cn(inputControlClasses, \"text-sm\", className)}\n />\n </Popover.Header>\n)\n\n/** The scrolling body: the `role=\"tree\"` list, or `empty` when the search matched nothing. */\nexport const TreeBody = ({\n id,\n isEmpty,\n empty,\n multiselectable,\n onKeyDown,\n children,\n}: {\n id: string\n isEmpty: boolean\n empty: ReactNode\n multiselectable?: boolean\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void\n children: ReactNode\n}) => (\n <Popover.Body>\n {isEmpty ? (\n <div className={popoverEmpty}>{empty}</div>\n ) : (\n <div\n id={id}\n role=\"tree\"\n {...props({ \"aria-multiselectable\": multiselectable && \"true\" })}\n aria-orientation=\"vertical\"\n onKeyDown={onKeyDown}\n className=\"flex flex-col\"\n >\n {children}\n </div>\n )}\n </Popover.Body>\n)\n\ntype UseTreeRovingFocusOptions = {\n /** The rows that take focus (enabled, and selectable), in visual order. */\n values: readonly string[]\n /** A row's label, matched by type-ahead. */\n labelOf: (value: string) => string\n open: boolean\n searchable: boolean\n /** Space / Enter on the focused row. */\n onActivate: (value: string) => void\n}\n\n/**\n * Roving focus over a flat-rendered tree. One row is active (`tabIndex=0`,\n * `data-active`); `↑` / `↓` step through `values`, `Home` / `End` jump to\n * either end, `Space` / `Enter` activate, and printable keys type-ahead to the\n * next row whose label starts with what was typed. On open, focus lands in\n * the search field when there is one, on the active row otherwise.\n */\nexport const useTreeRovingFocus = ({\n values,\n labelOf,\n open,\n searchable,\n onActivate,\n}: UseTreeRovingFocusOptions) => {\n const [activeValueState, setActiveValue] = useState<string | null>(null)\n // A row filtered out (or disabled) since it was active falls back to the first.\n const activeValue =\n activeValueState != null && values.includes(activeValueState)\n ? activeValueState\n : (values[0] ?? null)\n\n const searchRef = useRef<HTMLInputElement>(null)\n const rowRefs = useRef(new Map<string, HTMLElement>())\n const focusRow = (next: string | null | undefined) => {\n if (next == null) return\n setActiveValue(next)\n rowRefs.current.get(next)?.focus()\n }\n\n // Type-ahead: typed characters buffer briefly and jump to the next row whose\n // label starts with the buffer. Only fires while the tree itself has focus —\n // when `searchable`, keys land in the search field instead.\n const typeahead = useRef<{ query: string; timer: ReturnType<typeof setTimeout> | null }>({\n query: \"\",\n timer: null,\n })\n useEffect(\n () => () => {\n if (typeahead.current.timer) clearTimeout(typeahead.current.timer)\n },\n [],\n )\n const typeToFocus = (char: string) => {\n const state = typeahead.current\n if (state.timer) clearTimeout(state.timer)\n state.query += char\n state.timer = setTimeout(() => {\n state.query = \"\"\n }, 500)\n\n const n = values.length\n if (n === 0) return\n const q = state.query.toLowerCase()\n // A run of the same key (\"ss\") cycles through same-initial matches.\n const repeated = q.length > 1 && [...q].every((c) => c === q.charAt(0))\n const needle = repeated ? q.charAt(0) : q\n const start = activeValue ? values.indexOf(activeValue) : -1\n const base = start === -1 ? 0 : start\n // Advance past the current row for a fresh/repeated key; keep it for a\n // growing multi-char query so the current match can still satisfy it.\n const advance = start !== -1 && (q.length === 1 || repeated) ? 1 : 0\n const match = Array.from({ length: n }, (_, i) => values[(base + advance + i) % n]).find(\n (value) => value != null && labelOf(value).toLowerCase().startsWith(needle),\n )\n focusRow(match)\n }\n\n // On open, focus the search field (or the active row). Initial focus only.\n // biome-ignore lint/correctness/useExhaustiveDependencies: re-running on activeValue would steal focus while navigating the tree.\n useEffect(() => {\n if (!open) return\n const id = requestAnimationFrame(() => {\n // preventScroll: the content is portaled, so focusing it before the\n // positioner places it would otherwise warp the page to the top.\n if (searchable) searchRef.current?.focus({ preventScroll: true })\n else if (activeValue) rowRefs.current.get(activeValue)?.focus({ preventScroll: true })\n })\n return () => cancelAnimationFrame(id)\n }, [open, searchable])\n\n const moveActive = (dir: 1 | -1) => {\n if (values.length === 0) return\n const idx = activeValue ? values.indexOf(activeValue) : -1\n const next =\n idx === -1\n ? dir === 1\n ? 0\n : values.length - 1\n : Math.min(Math.max(idx + dir, 0), values.length - 1)\n focusRow(values[next])\n }\n\n const onTreeKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault()\n moveActive(1)\n break\n case \"ArrowUp\":\n event.preventDefault()\n moveActive(-1)\n break\n case \"Home\":\n event.preventDefault()\n focusRow(values[0])\n break\n case \"End\":\n event.preventDefault()\n focusRow(values[values.length - 1])\n break\n case \" \":\n case \"Enter\":\n event.preventDefault()\n if (activeValue != null) onActivate(activeValue)\n break\n default:\n // Single printable key (no modifier) drives type-ahead. Space never\n // reaches here — it's handled above as \"activate\".\n if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n event.preventDefault()\n typeToFocus(event.key)\n }\n }\n }\n\n const onSearchKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault()\n focusRow(values[0])\n }\n }\n\n /** Spread on each focusable row: its ref and `data-active`. The row sets its own roving\n * `tabIndex={value === activeValue ? 0 : -1}`, where the a11y lint can see it. */\n const rowProps = (value: string) => ({\n ref: (el: HTMLElement | null) => {\n if (el) rowRefs.current.set(value, el)\n else rowRefs.current.delete(value)\n },\n ...props({ \"data-active\": value === activeValue }),\n })\n\n return { activeValue, setActiveValue, searchRef, rowProps, onTreeKeyDown, onSearchKeyDown }\n}\n"]}