@kanso-labs/kanso-ui 0.46.0 → 0.47.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 (43) hide show
  1. package/dist/chip/label.js +1 -0
  2. package/dist/chip/label.js.map +1 -1
  3. package/dist/chip/styles.js +1 -0
  4. package/dist/chip/styles.js.map +1 -1
  5. package/dist/components/breadcrumbs/index.js +1 -1
  6. package/dist/components/breadcrumbs/index.js.map +1 -1
  7. package/dist/components/code/index.js +32 -26
  8. package/dist/components/code/index.js.map +1 -1
  9. package/dist/components/color-swatch/index.js +1 -1
  10. package/dist/components/color-swatch/index.js.map +1 -1
  11. package/dist/components/icon-button/index.js +3 -3
  12. package/dist/components/icon-button/index.js.map +1 -1
  13. package/dist/components/index.d.ts +2 -2
  14. package/dist/components/link/index.js +2 -2
  15. package/dist/components/link/index.js.map +1 -1
  16. package/dist/components/menu/index.js +4 -1
  17. package/dist/components/menu/index.js.map +1 -1
  18. package/dist/components/navigation-bar/index.js.map +1 -1
  19. package/dist/components/progress-indicator/index.js +258 -172
  20. package/dist/components/progress-indicator/index.js.map +1 -1
  21. package/dist/components/search-view/index.js +1 -1
  22. package/dist/components/search-view/index.js.map +1 -1
  23. package/dist/components/table/index.d.ts +26 -5
  24. package/dist/components/table/index.js +93 -75
  25. package/dist/components/table/index.js.map +1 -1
  26. package/dist/components/tag/index.js +1 -0
  27. package/dist/components/tag/index.js.map +1 -1
  28. package/dist/components/time-picker/index.js +35 -5
  29. package/dist/components/time-picker/index.js.map +1 -1
  30. package/dist/components/toolbar/index.d.ts +4 -3
  31. package/dist/components/toolbar/index.js +107 -38
  32. package/dist/components/toolbar/index.js.map +1 -1
  33. package/dist/index.d.ts +2 -2
  34. package/dist/navigation/styles.js +1 -1
  35. package/dist/navigation/styles.js.map +1 -1
  36. package/dist/segments/index.js +2 -6
  37. package/dist/segments/index.js.map +1 -1
  38. package/dist/segments/literal.js +66 -0
  39. package/dist/segments/literal.js.map +1 -0
  40. package/dist/segments/styles.js +4 -0
  41. package/dist/segments/styles.js.map +1 -1
  42. package/dist/styles.css +351 -34
  43. package/package.json +3 -3
@@ -9,6 +9,7 @@ import { segmentStyles } from "../../segments/styles.js";
9
9
  import { mergeStatefulStyles } from "../../styles/merge.js";
10
10
  import { overlay } from "../../styles/overlay.js";
11
11
  import { picker, triggerClassName } from "../../styles/picker.js";
12
+ import { toggleGroupRenderer, useRadioItem } from "../../toggle-group/index.js";
12
13
  import Button$1 from "../button/index.js";
13
14
  import IconButton from "../icon-button/index.js";
14
15
  import { c } from "react/compiler-runtime";
@@ -49,6 +50,7 @@ const styles = {
49
50
  kzQI83: "x1iyjqo2",
50
51
  kMv6JI: "x46eyla",
51
52
  kGuDYH: "x5ehqhr",
53
+ kcqcaj: "x1j4x3al",
52
54
  k63SB2: "xrf6cl6",
53
55
  kjj79g: "xl56j7k",
54
56
  kb6lSQ: "x1g135zh",
@@ -100,7 +102,7 @@ const styles = {
100
102
  k1xSpc: "x3nfvp2",
101
103
  kMv6JI: "xjaampf",
102
104
  kGuDYH: "xuyiek4",
103
- kcqcaj: "xss6m8b",
105
+ kcqcaj: "x1j4x3al",
104
106
  k63SB2: "x1n2oj23",
105
107
  kzqmXN: "xszbqgh",
106
108
  kjj79g: "xl56j7k",
@@ -251,6 +253,32 @@ function periodAmClassName(state) {
251
253
  function periodClassName(state, divider) {
252
254
  return props(styles.periodButton, divider && styles.periodDivider, state.isHovered && styles.periodHovered, state.isSelected && styles.periodSelected, state.isSelected && state.isHovered && styles.periodSelectedHovered, state.isFocusVisible && styles.ring).className ?? "";
253
255
  }
256
+ /**
257
+ * A half of the period selector, and a radio of its group: its key written
258
+ * where the group's arrows read it, and out of the Tab order unless it is
259
+ * the chosen half. A component of its own because that is read from the
260
+ * group's state, which only its children reach.
261
+ */
262
+ function PeriodHalf(t0) {
263
+ const $ = c(5);
264
+ const { children, className, id } = t0;
265
+ const radio = useRadioItem(id);
266
+ let t1;
267
+ if ($[0] !== children || $[1] !== className || $[2] !== id || $[3] !== radio) {
268
+ t1 = /* @__PURE__ */ jsx(ToggleButton, {
269
+ ...radio,
270
+ className,
271
+ id,
272
+ children
273
+ });
274
+ $[0] = children;
275
+ $[1] = className;
276
+ $[2] = id;
277
+ $[3] = radio;
278
+ $[4] = t1;
279
+ } else t1 = $[4];
280
+ return t1;
281
+ }
254
282
  function periodPmClassName(state) {
255
283
  return periodClassName(state, true);
256
284
  }
@@ -699,6 +727,7 @@ function TimePickerDialog(t0) {
699
727
  if ($[66] !== draft || $[67] !== fieldLabel || $[68] !== granularity || $[69] !== hourCycle || $[70] !== t21) {
700
728
  t22 = /* @__PURE__ */ jsx(TimeField, {
701
729
  "aria-label": fieldLabel,
730
+ autoFocus: true,
702
731
  granularity,
703
732
  hideTimeZone: true,
704
733
  hourCycle,
@@ -742,17 +771,18 @@ function TimePickerDialog(t0) {
742
771
  disallowEmptySelection: true,
743
772
  onSelectionChange: choosePeriod,
744
773
  orientation: "vertical",
774
+ render: toggleGroupRenderer(void 0, true),
745
775
  selectedKeys: isAfternoon ? AFTERNOON : MORNING,
746
776
  selectionMode: "single",
747
777
  ...{
748
778
  0: { className: "xwzfr38 x1fwvt7v x1xdvaa9 x1y0btm7 xmkeg23 x9f619 x78zum5 xdt5ytf x2lah0s xvni27 xb3r6kr" },
749
779
  1: { className: "x1fwvt7v x1xdvaa9 x1y0btm7 xmkeg23 x9f619 x78zum5 xdt5ytf x2lah0s xvni27 xb3r6kr xfl6q2h" }
750
780
  }[!!!isDial << 0],
751
- children: [/* @__PURE__ */ jsx(ToggleButton, {
781
+ children: [/* @__PURE__ */ jsx(PeriodHalf, {
752
782
  className: periodAmClassName,
753
783
  id: "am",
754
784
  children: partOf(periods, 9, "dayPeriod")
755
- }), /* @__PURE__ */ jsx(ToggleButton, {
785
+ }), /* @__PURE__ */ jsx(PeriodHalf, {
756
786
  className: periodPmClassName,
757
787
  id: "pm",
758
788
  children: partOf(periods, 21, "dayPeriod")
@@ -940,8 +970,8 @@ function _temp(label) {
940
970
  x: label.x,
941
971
  y: label.y,
942
972
  ...{
943
- 0: { className: "xti7fmr xmw301f x16svsjw x1848etk x1c52epr x1qn8t5l" },
944
- 1: { className: "x16svsjw x1848etk x1c52epr x1qn8t5l xvlh3h9 x1bpb6vw" }
973
+ 0: { className: "xti7fmr xmw301f x16svsjw x1848etk x17gc79u x1c52epr x1qn8t5l" },
974
+ 1: { className: "x16svsjw x1848etk x17gc79u x1c52epr x1qn8t5l xvlh3h9 x1bpb6vw" }
945
975
  }[!!label.isSelected << 0],
946
976
  children: label.text
947
977
  }, label.key);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","getLocalTimeZone","Time","toCalendarDateTime","today","stylex","useContext","useId","useRef","useState","LabelContext","RACDialog","RACTimeField","TimeFieldStateContext","useLocale","useSlottedContext","fieldStyles","invalidFrom","useFieldValidationBehavior","useMessages","renderSegment","segmentStyles","mergeStatefulStyles","overlay","picker","triggerClassName","DIAL","CENTRE","OUTER_RING","INNER_RING","HANDLE","MORNING","AFTERNOON","INVISIBLE","styles","centre","kGNEyG","k1xSpc","kjj79g","kmVPX3","$$css","dialog","periodButton","kWkggS","kMzoRj","kB7OPa","kMwMTN","kkrTdU","kCS8Yb","kzQI83","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kogj98","kjBf7l","kInvED","k3XXqK","kMeerF","periodDivider","kLZC3w","kPef9Z","kEafiO","periodHovered","periodSelected","kAXs8y","periodSelectedHovered","ring","selector","kZKoxP","kVAM5u","kaIpWk","ksu8eU","knGrYV","kcqcaj","kzqmXN","selectorHovered","selectorInput","selectorInputFocused","selectorSelected","selectorSelectedHovered","isSelected","key","text","x","y","isFocusVisible","isHovered","isFocused","cancelLabel","className","confirmLabel","container","defaultMode","defaultOpen","description","enterTimeLabel","error","floatingLabel","isOpen","label","leadingIcon","onOpenChange","selectTimeLabel","variant","asDateTime","time","boxClassName","isDial","isFollowed","state","props","clockTrigger","isDisabled","onPress","ClockTrigger","t0","$","id","fieldLabel","t1","undefined","t2","Symbol","for","triggerGlyph","t3","dialLabel","turn","radius","polar","fieldName","names","Intl","DisplayNames","field","locale","name","of","charAt","toLocaleUpperCase","slice","initialTime","placeholderValue","held","value","labelsFor","part","twelveHour","steps","Array","from","length","_","step","digits","NumberFormat","minimumIntegerDigits","map","format","minute","hours","DateTimeFormat","hour","hour12","offset","partOf","type","formatToParts","Date","find","String","periodAmClassName","periodClassName","divider","periodPmClassName","angle","Math","PI","sin","cos","TimePicker","t4","isReadOnly","t5","t6","validationBehavior","messages","ownOpen","setOwnOpen","open","t7","next","changeOpen","t8","openModal","T0","t9","t10","root","t11","isRequired","t12","t13","selectTime","t14","t15","input","t16","t17","t18","scrim","t19","cancel","t20","confirm","t21","enterTime","t22","granularity","t23","t24","hourCycle","t25","t26","TimePickerDialog","draft","setDraft","mode","setMode","setPart","headingId","labelContext","boxes","dragging","usesTwelveHours","switchMode","periods","isAfternoon","showsMinutes","shown","handle","box","current","querySelector","HTMLElement","focus","focusBox","event","type_0","target","getAttribute","followFocus","changeDraft","event_0","box_0","currentTarget","getBoundingClientRect","clientX","left","width","clientY","top","height","atan2","distance","hypot","set","round","inner","pick","event_1","pointerType","button","preventDefault","setPointerCapture","pointerId","startPicking","event_2","continuePicking","stopPicking","keys","afternoon","has","choosePeriod","setValue","segment","replaceAll","0","1","renderBox","labels","between","modalDialog","_temp","resolvedOptions","RACButton","RACTimeField","RACDateInput","RACDateSegment","Button"],"sources":["../../../src/components/time-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CalendarDateTime, ZonedDateTime } from '@internationalized/date';\nimport type { FocusEvent, PointerEvent, ReactElement, ReactNode, RefAttributes } from 'react';\nimport type { TimeFieldProps as RACTimeFieldProps, Selection, TimeFieldState, TimeValue } from 'react-aria-components';\nimport { getLocalTimeZone, Time, toCalendarDateTime, today } from '@internationalized/date';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useContext, useId, useRef, useState } from 'react';\nimport { Heading, LabelContext, Modal, ModalOverlay, Button as RACButton, DateInput as RACDateInput, DateSegment as RACDateSegment, Dialog as RACDialog, TimeField as RACTimeField, TimeFieldStateContext, ToggleButton, ToggleButtonGroup, useLocale, useSlottedContext } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { ClockGlyph, KeyboardGlyph } from '../../glyphs';\nimport { useMessages } from '../../i18n';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker, triggerClassName } from '../../styles/picker';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Button from '../button';\nimport IconButton from '../icon-button';\n\n// The time pickers page's picker: TimeField's segments, with a clock button\n// in the field's trailing slot that opens the page's modal over a scrim. A\n// time is typed into the field or picked in the modal, and the modal's OK is\n// what writes a picked time back.\n//\n// **Modal at every width.** The page has no docked time picker, so unlike\n// DatePicker nothing here changes at a breakpoint: the container is centred\n// over the scrim on a phone and on a desktop alike.\n//\n// **The modal is the page's vertical layout, in both of its variants.** The\n// dial: a label-medium headline on surface variant, then the time selector —\n// an hour and a minute box, 96 by 80dp at the small corner in display-large,\n// on surface container highest and on primary container once selected, with\n// 24dp for the colon between — and beside them the period selector, 52 by\n// 80dp, outlined, its chosen half on tertiary container. Under them, 36dp\n// down, the 256dp dial on surface container highest: labels in body-large,\n// the 48dp handle and 2dp hand in primary, an 8dp centre, and the label under\n// the handle in on primary. The input variant drops the dial and draws the\n// boxes as text fields, 96 by 72dp in display-medium, the focused one on\n// primary container with a 2dp primary outline, each named underneath in\n// body-small, and the period selector at the same 72dp. Both put the\n// keyboard or clock toggle at the actions' start and the text buttons at\n// their end, inside a container on surface container high at the\n// extra-large corner, level 3, with 24dp of padding.\n//\n// **The boxes are a TimeField of their own**, React Aria's, inside the\n// modal: its hour and minute segments drawn as the page's boxes. That makes\n// them spinbuttons with React Aria's arrow keys, typing, digits and names in\n// the reader's locale, and it is the same accessible model in both variants,\n// which differ in how the boxes are drawn rather than in what they are. The\n// day period stays a segment for React Aria's sake but is hidden, and the\n// period selector beside the boxes takes its place, as a radio group of the\n// locale's two words for it. The dial is a pointer affordance over the\n// spinbuttons and is hidden from assistive technology: everything it sets,\n// the boxes set too.\n//\n// **The dial does not mirror.** A clock face is the same in either writing\n// direction, so it is drawn and read in screen coordinates, three o'clock on\n// the right. The row above it follows the field's own order, as TimeField's\n// segments do, so in a right-to-left locale the period selector sits on the\n// left.\n//\n// Twenty-four hours put the day's second half on an inner ring, 12 at its top\n// and 00 at the outer ring's, with no period selector, and whether there is\n// one at all is the reader's locale or `hourCycle`, as it is in TimeField.\n\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The dial's geometry, in the units of its viewBox, which it draws at the\n// page's 256dp: the radius of the outer and inner rings of labels and of the\n// handle that sits on them. The inner ring sits far enough in that a handle on\n// it clears the outer ring's labels.\nconst DIAL = 256;\nconst CENTRE = DIAL / 2;\nconst OUTER_RING = 101;\nconst INNER_RING = 64;\nconst HANDLE = 24;\n\n// The period selector's selection, hoisted so each is one stable array\n// rather than a fresh one per render.\nconst MORNING = ['am'];\nconst AFTERNOON = ['pm'];\n\n// React Aria's literal segments carry the locale's bidirectional marks beside\n// the punctuation, so a literal is drawn only when something else is left.\nconst INVISIBLE = /[\\s؜‎‏‪-‮⁦-⁩]/gu;\nconst scaleIn = \"xnirehn-B\";\nconst styles = {\n centre: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1a7rqcl\",\n $$css: true\n },\n dialog: {\n kmVPX3: \"x1apw6a7\",\n $$css: true\n },\n periodButton: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"x1r8uery\",\n kzQI83: \"x1iyjqo2\",\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n kogj98: \"x1ghz6dp\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n periodDivider: {\n kLZC3w: \"xrre44y\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x178xt8z\",\n $$css: true\n },\n periodHovered: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n periodSelected: {\n kWkggS: \"xs6yvni x1jzqe4\",\n kMwMTN: \"x3cbcwg x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n periodSelectedHovered: {\n kWkggS: \"x5nnyxq x1jzqe4\",\n $$css: true\n },\n ring: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n selector: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x1rrhr5q\",\n kZKoxP: \"xwzfr38\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1xdvaa9\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\n kB7OPa: \"x9f619\",\n knGrYV: \"xbuiw85\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kMv6JI: \"xjaampf\",\n kGuDYH: \"xuyiek4\",\n kcqcaj: \"xss6m8b\",\n k63SB2: \"x1n2oj23\",\n kzqmXN: \"xszbqgh\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x1hxa6v5\",\n kLWn49: \"x1iwmiir\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n selectorHovered: {\n kWkggS: \"xpae8dx\",\n $$css: true\n },\n selectorInput: {\n kZKoxP: \"xfl6q2h\",\n kkrTdU: \"x1ed109x\",\n kMv6JI: \"x1gi70vc\",\n kGuDYH: \"xlzzeuu\",\n k63SB2: \"xh9quta\",\n kb6lSQ: \"x148mp24\",\n kLWn49: \"xs5hucj\",\n $$css: true\n },\n selectorInputFocused: {\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n selectorSelected: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selectorSelectedHovered: {\n kWkggS: \"xq1oky0 x1jzqe4\",\n $$css: true\n }\n};\n\n// One label on the dial, placed on its ring.\ntype DialLabel = {\n isSelected: boolean;\n key: string;\n text: string;\n x: number;\n y: number;\n};\n\n// The state React Aria hands a half of the period selector's className.\ntype PeriodState = {\n isFocusVisible: boolean;\n isHovered: boolean;\n isSelected: boolean;\n};\n\n// What React Aria hands the input for each part of the time. Taken off the\n// component, for the reason src/segments gives.\ntype Segment = Parameters<NonNullable<Parameters<typeof RACDateInput>[0]['children']>>[0];\n\n// The state React Aria hands a segment's className.\ntype SegmentState = {\n isFocused: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n};\n\n// The parts of a time the dial and the boxes set.\ntype TimePart = 'hour' | 'minute';\n\n/** Which of the time pickers page's two variants the modal shows. */\ntype TimePickerMode = 'dial' | 'input';\ntype TimePickerProps<T extends TimeValue = TimeValue> = Omit<RACTimeFieldProps<T>, 'children' | 'className' | 'style'> & {\n /**\n * What the modal's dismissing action says. Left out, it is the word for\n * it in the I18nProvider's locale — \"Cancel\" in English.\n */\n cancelLabel?: string;\n /** A function may compute the class from the field's render state. */\n className?: RACTimeFieldProps<T>['className'];\n /**\n * What the modal's confirming action says. Left out, it is the word for\n * it in the I18nProvider's locale — \"OK\" in English.\n */\n confirmLabel?: string;\n /**\n * Where to portal the modal and its scrim. Defaults to the container of the\n * `ThemeScope` around it, which keeps the modal on that scope's tokens, or to\n * the end of `<body>` where there is none. A subtree themed through the\n * `themeScope` class has no container of its own, so point this inside it, or\n * the modal renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Which variant the modal opens on: the dial, or the boxes as text fields\n * to type into. The button at the modal's start switches between them.\n * @default 'dial'\n */\n defaultMode?: TimePickerMode;\n /** Whether the modal starts open, when it keeps its own state. */\n defaultOpen?: boolean;\n /** Supporting text under the field. */\n description?: string;\n /**\n * The input variant's headline, which also names the button that switches\n * the dial to it. Left out, it is the I18nProvider's locale's — \"Enter\n * time\" in English.\n */\n enterTimeLabel?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** Whether the modal is open, when the call site holds the state. */\n isOpen?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /** Called with the modal's new state when it opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /**\n * The dial's headline, which also names the clock button that opens the\n * modal, followed by the field's label, and the button that switches the\n * input variant back. Left out, it is the I18nProvider's locale's —\n * \"Select time\" in English.\n */\n selectTimeLabel?: string;\n /** A function may compute the style from the field's render state. */\n style?: RACTimeFieldProps<T>['style'];\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A picked time as the field's state takes it, which is always a date and\n * time: React Aria puts a bare time on today and takes the date off again on\n * the way out.\n */\nfunction asDateTime(time: TimeValue): CalendarDateTime | ZonedDateTime {\n return 'day' in time ? time : toCalendarDateTime(today(getLocalTimeZone()), time);\n}\n\n// An hour or a minute box's classes, from React Aria's render state. On the\n// dial the selected box is the one the dial follows; typed into, it is the\n// one with focus, which is what the page's input variant draws as focused.\nfunction boxClassName(isDial: boolean, isFollowed: boolean) {\n return (state: SegmentState) => {\n const isSelected = isDial ? isFollowed : state.isFocused;\n return stylex.props(styles.selector, !isDial && styles.selectorInput, state.isHovered && styles.selectorHovered, isSelected && styles.selectorSelected, isSelected && state.isHovered && styles.selectorSelectedHovered, isDial && state.isFocusVisible && styles.ring, !isDial && state.isFocused && styles.selectorInputFocused).className ?? '';\n };\n}\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-jsx-as-prop is after — the same reason DatePicker builds\n// its trigger this way.\nfunction clockTrigger(isDisabled: boolean, isOpen: boolean, label: string, onPress: () => void) {\n return <ClockTrigger isDisabled={isDisabled} isOpen={isOpen} label={label} onPress={onPress} />;\n}\n\n// The clock button in the field's trailing slot. It is named by its own\n// words followed by the field's label, which is how React Aria names\n// DatePicker's calendar button, so two pickers on a form are told apart.\nfunction ClockTrigger({\n isDisabled,\n isOpen,\n label,\n onPress\n}: {\n isDisabled: boolean;\n isOpen: boolean;\n label: string;\n onPress: () => void;\n}) {\n const id = useId();\n const fieldLabel = useSlottedContext(LabelContext);\n return <RACButton aria-expanded={isOpen} aria-haspopup=\"dialog\" aria-label={label} aria-labelledby={fieldLabel?.id === undefined ? undefined : `${id} ${fieldLabel.id}`} className={triggerClassName} id={id} isDisabled={isDisabled} onPress={onPress}>\n <ClockGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>;\n}\n\n/** One label, placed a fraction of a turn round a ring. */\nfunction dialLabel(key: string, text: string, isSelected: boolean, turn: number, radius: number): DialLabel {\n const {\n x,\n y\n } = polar(turn, radius);\n return {\n isSelected,\n key,\n text,\n x,\n y\n };\n}\n\n/** A field's name as the locale writes it, opening with a capital. */\nfunction fieldName(names: Intl.DisplayNames, field: string, locale: string) {\n const name = names.of(field) ?? field;\n return name.charAt(0).toLocaleUpperCase(locale) + name.slice(1);\n}\n\n/**\n * The time the modal opens on: the field's own, else its placeholder, else\n * midnight. A date and time keeps its date, so the field gets back what it\n * holds.\n */\nfunction initialTime(field: null | TimeFieldState, placeholderValue: TimeValue | undefined): TimeValue {\n const held = field?.value;\n if (held !== null && held !== undefined && 'hour' in held) {\n return held;\n }\n return placeholderValue ?? new Time();\n}\n\n/** The labels the dial draws for one part, in the reader's digits. */\nfunction labelsFor(part: TimePart, time: TimeValue, locale: string, twelveHour: boolean): DialLabel[] {\n const steps = Array.from({\n length: 12\n }, (_, step) => step);\n if (part === 'minute') {\n const digits = new Intl.NumberFormat(locale, {\n minimumIntegerDigits: 2\n });\n return steps.map(step => dialLabel(`m${step}`, digits.format(step * 5), time.minute === step * 5, step / 12, OUTER_RING));\n }\n const hours = new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: twelveHour\n });\n if (twelveHour) {\n const offset = time.hour >= 12 ? 12 : 0;\n return steps.map(step => dialLabel(`h${step}`, partOf(hours, step + offset, 'hour'), time.hour % 12 === step, step / 12, OUTER_RING));\n }\n return [...steps.map(step => dialLabel(`h${step}`, partOf(hours, step, 'hour'), time.hour === step, step / 12, OUTER_RING)), ...steps.map(step => dialLabel(`h${step + 12}`, partOf(hours, step + 12, 'hour'), time.hour === step + 12, step / 12, INNER_RING))];\n}\n\n/** The part of a formatted time a formatter writes for one hour of the day. */\nfunction partOf(format: Intl.DateTimeFormat, hour: number, type: 'dayPeriod' | 'hour') {\n return format.formatToParts(new Date(2000, 0, 1, hour)).find(part => part.type === type)?.value ?? String(hour);\n}\n\n// The period selector's morning half, with no rule above it.\nfunction periodAmClassName(state: PeriodState) {\n return periodClassName(state, false);\n}\n\n// A half of the period selector, from React Aria's render state. The second\n// half draws the rule between the two.\nfunction periodClassName(state: PeriodState, divider: boolean) {\n return stylex.props(styles.periodButton, divider && styles.periodDivider, state.isHovered && styles.periodHovered, state.isSelected && styles.periodSelected, state.isSelected && state.isHovered && styles.periodSelectedHovered, state.isFocusVisible && styles.ring).className ?? '';\n}\n\n// Its afternoon half, under the rule between the two.\nfunction periodPmClassName(state: PeriodState) {\n return periodClassName(state, true);\n}\n\n/** Where a fraction of a turn clockwise from twelve lands on a ring. */\nfunction polar(turn: number, radius: number) {\n const angle = turn * 2 * Math.PI;\n return {\n x: CENTRE + radius * Math.sin(angle),\n y: CENTRE - radius * Math.cos(angle)\n };\n}\n\n/**\n * A time typed into a field, or picked in a modal behind the clock button\n * at the field's end — on a dial, or typed into the modal's larger boxes.\n * The value is React Aria's — pass `value` with `onChange` to control it,\n * or `defaultValue` — as a `Time` from this package's `./date` subpath.\n *\n * ```tsx\n * import { Time } from '@kanso-labs/kanso-ui/date'\n *\n * <TimePicker defaultValue={new Time(9, 30)} label=\"Label\" />\n * ```\n *\n * The field is `TimeField`'s, so `granularity`, `hourCycle`, `minValue` and\n * `maxValue` behave as they do there. The modal sets hours and minutes and\n * keeps the seconds a value already has; a time it writes back is checked\n * against the bounds as a typed one is. Whether it shows a twelve or\n * twenty-four hour clock is the reader's locale, through React Aria's\n * `I18nProvider`, unless `hourCycle` says otherwise.\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions.\n */\nfunction TimePicker<T extends TimeValue>({\n cancelLabel,\n confirmLabel,\n container,\n defaultMode = 'dial',\n defaultOpen = false,\n description,\n enterTimeLabel,\n error,\n floatingLabel = true,\n isDisabled = false,\n isOpen,\n isReadOnly = false,\n label,\n leadingIcon,\n onOpenChange,\n selectTimeLabel,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TimePickerProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n const messages = useMessages();\n const [ownOpen, setOwnOpen] = useState(defaultOpen);\n const open = isOpen ?? ownOpen;\n const changeOpen = useCallback((next: boolean) => {\n if (isOpen === undefined) {\n setOwnOpen(next);\n }\n onOpenChange?.(next);\n }, [isOpen, onOpenChange]);\n const openModal = useCallback(() => {\n changeOpen(true);\n }, [changeOpen]);\n return <RACTimeField<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} isReadOnly={isReadOnly} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, for the reason TimeField's own comment gives.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon}\n // In the chrome's trailing slot, where DatePicker puts its calendar\n // button and for the same reasons.\n trailing={clockTrigger(isDisabled || isReadOnly, open, selectTimeLabel ?? messages.selectTime, openModal)} variant={variant}>\n <FieldSegments>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <ModalOverlay isDismissable isOpen={open} onOpenChange={changeOpen}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.scrim, styles.centre)}>\n <Modal className=\"x1n1nwrg x1u6grsq xbhiib0 x16dv9tl xvkjz1l x1w1tqly x19pkqky xx61lck x13rsnn2 x1udv5rz x9f619 x139gbkf xi55695 xmz0i5r x193iq5w xysyzu8\">\n <TimePickerDialog cancelLabel={cancelLabel ?? messages.cancel} confirmLabel={confirmLabel ?? messages.confirm} defaultMode={defaultMode} enterTimeLabel={enterTimeLabel ?? messages.enterTime} fieldLabel={label} granularity={props.granularity === 'hour' ? 'hour' : 'minute'} hourCycle={props.hourCycle} placeholderValue={props.placeholderValue} selectTimeLabel={selectTimeLabel ?? messages.selectTime} />\n </Modal>\n </ModalOverlay>\n </RACTimeField>;\n}\n\n/**\n * The modal's content, mounted each time it opens: the time it was opened\n * with is its draft until OK writes the draft into the field, or the modal\n * closes without it.\n */\nfunction TimePickerDialog({\n cancelLabel,\n confirmLabel,\n defaultMode,\n enterTimeLabel,\n fieldLabel,\n granularity,\n hourCycle,\n placeholderValue,\n selectTimeLabel\n}: {\n cancelLabel: string;\n confirmLabel: string;\n defaultMode: TimePickerMode;\n enterTimeLabel: string;\n fieldLabel: string;\n granularity: 'hour' | 'minute';\n hourCycle: 12 | 24 | undefined;\n placeholderValue: TimeValue | undefined;\n selectTimeLabel: string;\n}) {\n const {\n locale\n } = useLocale();\n // The outer field's state: the modal reads the time from it and writes the\n // picked one back through it, so the field stays the one owner of its\n // value, controlled or not, and its onChange is React Aria's own.\n const field = useContext(TimeFieldStateContext);\n const [draft, setDraft] = useState(() => initialTime(field, placeholderValue));\n const [mode, setMode] = useState(defaultMode);\n const [part, setPart] = useState<TimePart>('hour');\n const headingId = useId();\n const labelContext = useSlottedContext(LabelContext);\n const boxes = useRef<HTMLDivElement>(null);\n const dragging = useRef(false);\n const twelveHour = usesTwelveHours(locale, hourCycle);\n const names = new Intl.DisplayNames(locale, {\n type: 'dateTimeField'\n });\n const periods = new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: true\n });\n const isAfternoon = draft.hour >= 12;\n const isDial = mode === 'dial';\n const showsMinutes = granularity === 'minute';\n const shown: TimePart = showsMinutes ? part : 'hour';\n const handle = shown === 'minute' ? polar(draft.minute / 60, OUTER_RING) : polar(draft.hour % 12 / 12, !twelveHour && draft.hour >= 12 ? INNER_RING : OUTER_RING);\n const focusBox = useCallback((type: TimePart) => {\n const box = boxes.current?.querySelector(`[data-type=\"${type}\"]`);\n if (box instanceof HTMLElement) {\n box.focus();\n }\n }, []);\n\n // Which box the dial follows, taken from the box that has focus — a press\n // on a box, a Tab into it, or React Aria moving on once an hour is typed.\n const followFocus = useCallback((event: FocusEvent<HTMLDivElement>) => {\n const type = event.target.getAttribute('data-type');\n if (type === 'hour' || type === 'minute') {\n setPart(type);\n }\n }, []);\n const changeDraft = useCallback((next: null | TimeValue) => {\n if (next !== null) {\n setDraft(next);\n }\n }, []);\n const pick = useCallback((event: PointerEvent<SVGSVGElement>) => {\n const box = event.currentTarget.getBoundingClientRect();\n const x = event.clientX - box.left - box.width / 2;\n const y = event.clientY - box.top - box.height / 2;\n const turn = (Math.atan2(x, -y) / (2 * Math.PI) + 1) % 1;\n const distance = Math.hypot(x, y) * DIAL / box.width;\n if (shown === 'minute') {\n setDraft(draft.set({\n minute: Math.round(turn * 60) % 60\n }));\n return;\n }\n const step = Math.round(turn * 12) % 12;\n if (twelveHour) {\n setDraft(draft.set({\n hour: step + (isAfternoon ? 12 : 0)\n }));\n return;\n }\n const inner = distance < (OUTER_RING + INNER_RING) / 2;\n setDraft(draft.set({\n hour: inner ? step + 12 : step\n }));\n }, [draft, isAfternoon, shown, twelveHour]);\n const startPicking = useCallback((event: PointerEvent<SVGSVGElement>) => {\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return;\n }\n // Keeps focus where it is: the dial is not a focus stop, and a press on\n // it would otherwise blur the box it is setting.\n event.preventDefault();\n try {\n event.currentTarget.setPointerCapture(event.pointerId);\n } catch {\n // A pointer the browser is not tracking has no capture to take — a\n // synthetic event in a test, where the moves land on the dial anyway.\n }\n dragging.current = true;\n pick(event);\n }, [pick]);\n const continuePicking = useCallback((event: PointerEvent<SVGSVGElement>) => {\n if (dragging.current) {\n pick(event);\n }\n }, [pick]);\n\n // An hour picked on the dial moves on to the minutes, as the page does.\n const stopPicking = useCallback(() => {\n if (!dragging.current) {\n return;\n }\n dragging.current = false;\n if (shown === 'hour' && showsMinutes) {\n setPart('minute');\n focusBox('minute');\n }\n }, [focusBox, shown, showsMinutes]);\n const switchMode = useCallback(() => {\n setMode(isDial ? 'input' : 'dial');\n focusBox(part);\n }, [focusBox, isDial, part]);\n const choosePeriod = useCallback((keys: Selection) => {\n const afternoon = keys !== 'all' && keys.has('pm');\n if (afternoon !== isAfternoon) {\n setDraft(draft.set({\n hour: draft.hour % 12 + (afternoon ? 12 : 0)\n }));\n }\n }, [draft, isAfternoon]);\n\n // OK writes the draft through the field's state, and its `slot` closes the\n // modal after.\n const confirm = useCallback(() => {\n field?.setValue(asDateTime(draft));\n }, [draft, field]);\n const renderBox = useCallback((segment: Segment): ReactElement => {\n if (segment.type === 'hour' || segment.type === 'minute') {\n return <RACDateSegment className={boxClassName(isDial, shown === segment.type)} segment={segment} />;\n }\n if (segment.type === 'literal' && segment.text.replaceAll(INVISIBLE, '') !== '') {\n return <RACDateSegment {...{\n 0: {\n className: \"x6s0dn4 xwzfr38 x9f619 x139gbkf x3nfvp2 xjaampf xuyiek4 x1n2oj23 xvy4d1p xl56j7k x1iwmiir\"\n },\n 1: {\n className: \"x6s0dn4 x9f619 x139gbkf x3nfvp2 xvy4d1p xl56j7k xfl6q2h x1gi70vc xlzzeuu xh9quta xs5hucj\"\n }\n }[!!!isDial << 0]} segment={segment} />;\n }\n return <RACDateSegment hidden segment={segment} />;\n }, [isDial, shown]);\n const labels = labelsFor(shown, draft, locale, twelveHour);\n const between = shown === 'minute' && draft.minute % 5 !== 0;\n return <RACDialog aria-labelledby={labelContext?.id === undefined ? headingId : `${headingId} ${labelContext.id}`} {...stylex.props(overlay.modalDialog, styles.dialog)}>\n <Heading id={headingId} level={2} className=\"x9f619 x1w5n3ug xp6n8n2 xkucv67 x14hhc5u x12utw95 xvzb9hk x1ghz6dp xieb3on\">\n {isDial ? selectTimeLabel : enterTimeLabel}\n </Heading>\n <div className=\"x1cy8zhl x9f619 x78zum5 x1gka490 xl56j7k\">\n <div onFocus={followFocus} ref={boxes}>\n <RACTimeField aria-label={fieldLabel} granularity={granularity} hideTimeZone hourCycle={hourCycle} onChange={changeDraft} shouldForceLeadingZeros validationBehavior=\"aria\" value={draft}>\n <RACDateInput className=\"x6s0dn4 x9f619 x78zum5 x1t137rt\">\n {renderBox}\n </RACDateInput>\n </RACTimeField>\n {isDial ? null : <div aria-hidden=\"true\" className=\"x9f619 x1w5n3ug x78zum5 x1yicsit x1b35g6e x9d6959 x1665zp3 xwth0xh xybisxh x7suny0\">\n <span className=\"x9f619 xszbqgh\">\n {fieldName(names, 'hour', locale)}\n </span>\n {showsMinutes ? <span className=\"x9f619 xszbqgh\">\n {fieldName(names, 'minute', locale)}\n </span> : null}\n </div>}\n </div>\n {twelveHour ? <ToggleButtonGroup aria-label={names.of('dayPeriod')} disallowEmptySelection onSelectionChange={choosePeriod} orientation=\"vertical\" selectedKeys={isAfternoon ? AFTERNOON : MORNING} selectionMode=\"single\" {...{\n 0: {\n className: \"xwzfr38 x1fwvt7v x1xdvaa9 x1y0btm7 xmkeg23 x9f619 x78zum5 xdt5ytf x2lah0s xvni27 xb3r6kr\"\n },\n 1: {\n className: \"x1fwvt7v x1xdvaa9 x1y0btm7 xmkeg23 x9f619 x78zum5 xdt5ytf x2lah0s xvni27 xb3r6kr xfl6q2h\"\n }\n }[!!!isDial << 0]}>\n <ToggleButton className={periodAmClassName} id=\"am\">\n {partOf(periods, 9, 'dayPeriod')}\n </ToggleButton>\n <ToggleButton className={periodPmClassName} id=\"pm\">\n {partOf(periods, 21, 'dayPeriod')}\n </ToggleButton>\n </ToggleButtonGroup> : null}\n </div>\n {isDial ? <svg aria-hidden=\"true\" data-dial={shown} onPointerCancel={stopPicking} onPointerDown={startPicking} onPointerMove={continuePicking} onPointerUp={stopPicking} viewBox={`0 0 ${DIAL} ${DIAL}`} className=\"xrlp1an x9f619 x1ypdohk x1lliihq x2lah0s x1t9vceh xseo6mj xvueqy4 x5ve5x3 x87ps6o\">\n <circle cx={CENTRE} cy={CENTRE} r={CENTRE - 1} className=\"x1a930ss x1h8bevw xeutv01 x8jos32\" />\n <line x1={CENTRE} x2={handle.x} y1={CENTRE} y2={handle.y} className=\"xrr0osq x1rqz208 x1i9vjva xbabvq0 x8pzrqk\" />\n <circle cx={CENTRE} cy={CENTRE} r={4} className=\"xrr0osq x1rqz208 x1i9vjva xbabvq0 x8pzrqk\" />\n <circle cx={handle.x} cy={handle.y} data-handle=\"\" r={HANDLE} className=\"xrr0osq x1rqz208 x1i9vjva xbabvq0 x8pzrqk\" />\n {between ? <circle cx={handle.x} cy={handle.y} r={2} className=\"xvlh3h9 x1bpb6vw\" /> : null}\n {labels.map(label => <text dominantBaseline=\"central\" key={label.key} textAnchor=\"middle\" x={label.x} y={label.y} {...{\n 0: {\n className: \"xti7fmr xmw301f x16svsjw x1848etk x1c52epr x1qn8t5l\"\n },\n 1: {\n className: \"x16svsjw x1848etk x1c52epr x1qn8t5l xvlh3h9 x1bpb6vw\"\n }\n }[!!label.isSelected << 0]}>\n {label.text}\n </text>)}\n </svg> : null}\n <div className=\"x6s0dn4 x9f619 x78zum5 x126z3so x1qughib x1yhnu8z\">\n <IconButton aria-label={isDial ? enterTimeLabel : selectTimeLabel} onPress={switchMode}>\n {isDial ? <KeyboardGlyph className=\"xlzyvqe x1lliihq x15vhz18\" /> : <ClockGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />}\n </IconButton>\n <div className=\"x78zum5 x126z3so\">\n <Button slot=\"close\" variant=\"text\">\n {cancelLabel}\n </Button>\n <Button onPress={confirm} slot=\"close\" variant=\"text\">\n {confirmLabel}\n </Button>\n </div>\n </div>\n </RACDialog>;\n}\n\n/**\n * Whether the reader's clock has twelve hours. `hourCycle` decides when it\n * is given, as it does for React Aria's segments; otherwise the locale does.\n */\nfunction usesTwelveHours(locale: string, hourCycle: 12 | 24 | undefined) {\n if (hourCycle !== undefined) {\n return hourCycle === 12;\n }\n return new Intl.DateTimeFormat(locale, {\n hour: 'numeric'\n }).resolvedOptions().hour12 ?? false;\n}\nexport type { TimePickerMode, TimePickerProps };\nexport default TimePicker;"],"mappings":";;;;;;;;;;;;;;;;;;;AA4EA,MAAM0B,OAAO;AACb,MAAMC,SAASD,OAAO;AACtB,MAAME,aAAa;AACnB,MAAMC,aAAa;AACnB,MAAMC,SAAS;AAIf,MAAMC,UAAU,CAAC,IAAI;AACrB,MAAMC,YAAY,CA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;CAAA,OA2M+B,oBAAA,QAAA;EAAuB,kBAAA;EAAqC,YAAA;EAAY,GAAAA,MAAKhB;EAAO,GAAAgB,MAAKf;EAAE,GAAM;GAAA2M,GACrH,EAAAtM,WACU,sDACb;GAACuM,GACE,EAAAvM,WACU,uDACb;EACF,EAAE,CAAC,CAACU,MAAKnB,cAAe;EACfmB,UAAAA,MAAKjB;CACD,GATkDiB,MAAKlB,GASvD;AAAA;AAsBnB,SAASyJ,gBAAgBnG,QAAgBsF,WAAgC;CACvE,IAAIA,cAAcrG,KAAAA,GAChB,OAAOqG,cAAc;CAEvB,OAAO,IAAIzF,KAAK6B,eAAe1B,QAAQ,EACrC2B,MAAM,UACR,CAAC,CAAC,CAACoI,gBAAgB,CAAC,CAACnI,UAAU;AACjC"}
1
+ {"version":3,"file":"index.js","names":["_c","getLocalTimeZone","Time","toCalendarDateTime","today","stylex","useContext","useId","useRef","useState","LabelContext","RACDialog","RACTimeField","TimeFieldStateContext","useLocale","useSlottedContext","fieldStyles","invalidFrom","useFieldValidationBehavior","useMessages","renderSegment","segmentStyles","mergeStatefulStyles","overlay","picker","triggerClassName","toggleGroupRenderer","useRadioItem","DIAL","CENTRE","OUTER_RING","INNER_RING","HANDLE","MORNING","AFTERNOON","INVISIBLE","styles","centre","kGNEyG","k1xSpc","kjj79g","kmVPX3","$$css","dialog","periodButton","kWkggS","kMzoRj","kB7OPa","kMwMTN","kkrTdU","kCS8Yb","kzQI83","kMv6JI","kGuDYH","kcqcaj","k63SB2","kb6lSQ","kLWn49","kogj98","kjBf7l","kInvED","k3XXqK","kMeerF","periodDivider","kLZC3w","kPef9Z","kEafiO","periodHovered","periodSelected","kAXs8y","periodSelectedHovered","ring","selector","kZKoxP","kVAM5u","kaIpWk","ksu8eU","knGrYV","kzqmXN","selectorHovered","selectorInput","selectorInputFocused","selectorSelected","selectorSelectedHovered","isSelected","key","text","x","y","isFocusVisible","isHovered","isFocused","cancelLabel","className","confirmLabel","container","defaultMode","defaultOpen","description","enterTimeLabel","error","floatingLabel","isOpen","label","leadingIcon","onOpenChange","selectTimeLabel","variant","asDateTime","time","boxClassName","isDial","isFollowed","state","props","clockTrigger","isDisabled","onPress","ClockTrigger","t0","$","id","fieldLabel","t1","undefined","t2","Symbol","for","triggerGlyph","t3","dialLabel","turn","radius","polar","fieldName","names","Intl","DisplayNames","field","locale","name","of","charAt","toLocaleUpperCase","slice","initialTime","placeholderValue","held","value","labelsFor","part","twelveHour","steps","Array","from","length","_","step","digits","NumberFormat","minimumIntegerDigits","map","format","minute","hours","DateTimeFormat","hour","hour12","offset","partOf","type","formatToParts","Date","find","String","periodAmClassName","periodClassName","divider","PeriodHalf","children","radio","periodPmClassName","angle","Math","PI","sin","cos","TimePicker","t4","isReadOnly","t5","t6","validationBehavior","messages","ownOpen","setOwnOpen","open","t7","next","changeOpen","t8","openModal","T0","t9","t10","root","t11","isRequired","t12","t13","selectTime","t14","t15","input","t16","t17","t18","scrim","t19","cancel","t20","confirm","t21","enterTime","t22","granularity","t23","t24","hourCycle","t25","t26","TimePickerDialog","draft","setDraft","mode","setMode","setPart","headingId","labelContext","boxes","dragging","usesTwelveHours","switchMode","periods","isAfternoon","showsMinutes","shown","handle","box","current","querySelector","HTMLElement","focus","focusBox","event","type_0","target","getAttribute","followFocus","changeDraft","event_0","box_0","currentTarget","getBoundingClientRect","clientX","left","width","clientY","top","height","atan2","distance","hypot","set","round","inner","pick","event_1","pointerType","button","preventDefault","setPointerCapture","pointerId","startPicking","event_2","continuePicking","stopPicking","keys","afternoon","has","choosePeriod","setValue","segment","replaceAll","0","1","renderBox","labels","between","modalDialog","_temp","resolvedOptions","RACButton","RACTimeField","RACDateInput","RACDateSegment","Button"],"sources":["../../../src/components/time-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CalendarDateTime, ZonedDateTime } from '@internationalized/date';\nimport type { FocusEvent, PointerEvent, ReactElement, ReactNode, RefAttributes } from 'react';\nimport type { TimeFieldProps as RACTimeFieldProps, Selection, TimeFieldState, TimeValue } from 'react-aria-components';\nimport { getLocalTimeZone, Time, toCalendarDateTime, today } from '@internationalized/date';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useContext, useId, useRef, useState } from 'react';\nimport { Heading, LabelContext, Modal, ModalOverlay, Button as RACButton, DateInput as RACDateInput, DateSegment as RACDateSegment, Dialog as RACDialog, TimeField as RACTimeField, TimeFieldStateContext, ToggleButton, ToggleButtonGroup, useLocale, useSlottedContext } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { ClockGlyph, KeyboardGlyph } from '../../glyphs';\nimport { useMessages } from '../../i18n';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { picker, triggerClassName } from '../../styles/picker';\nimport { toggleGroupRenderer, useRadioItem } from '../../toggle-group';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Button from '../button';\nimport IconButton from '../icon-button';\n\n// The time pickers page's picker: TimeField's segments, with a clock button\n// in the field's trailing slot that opens the page's modal over a scrim. A\n// time is typed into the field or picked in the modal, and the modal's OK is\n// what writes a picked time back.\n//\n// **Modal at every width.** The page has no docked time picker, so unlike\n// DatePicker nothing here changes at a breakpoint: the container is centred\n// over the scrim on a phone and on a desktop alike.\n//\n// **The modal is the page's vertical layout, in both of its variants.** The\n// dial: a label-medium headline on surface variant, then the time selector —\n// an hour and a minute box, 96 by 80dp at the small corner in display-large,\n// on surface container highest and on primary container once selected, with\n// 24dp for the colon between — and beside them the period selector, 52 by\n// 80dp, outlined, its chosen half on tertiary container. Under them, 36dp\n// down, the 256dp dial on surface container highest: labels in body-large,\n// the 48dp handle and 2dp hand in primary, an 8dp centre, and the label under\n// the handle in on primary. The input variant drops the dial and draws the\n// boxes as text fields, 96 by 72dp in display-medium, the focused one on\n// primary container with a 2dp primary outline, each named underneath in\n// body-small, and the period selector at the same 72dp. Both put the\n// keyboard or clock toggle at the actions' start and the text buttons at\n// their end, inside a container on surface container high at the\n// extra-large corner, level 3, with 24dp of padding.\n//\n// **The boxes are a TimeField of their own**, React Aria's, inside the\n// modal: its hour and minute segments drawn as the page's boxes. That makes\n// them spinbuttons with React Aria's arrow keys, typing, digits and names in\n// the reader's locale, and it is the same accessible model in both variants,\n// which differ in how the boxes are drawn rather than in what they are. The\n// day period stays a segment for React Aria's sake but is hidden, and the\n// period selector beside the boxes takes its place, as a radio group of the\n// locale's two words for it — React Aria's toggle group, with the radio\n// group's keys and single Tab stop SegmentedButton takes from\n// src/toggle-group, so an arrow chooses the period it moves to. The dial is\n// a pointer affordance over the spinbuttons and is hidden from assistive\n// technology: everything it sets, the boxes set too.\n//\n// **The dial does not mirror.** A clock face is the same in either writing\n// direction, so it is drawn and read in screen coordinates, three o'clock on\n// the right. The row above it follows the field's own order, as TimeField's\n// segments do, so in a right-to-left locale the period selector sits on the\n// left.\n//\n// **Every digit is a lining figure.** The boxes' display type is the brand\n// face, which falls back to Georgia where it is not loaded, and Georgia's\n// figures are old-style by default: a zero at x-height and a nine below the\n// baseline, so `09` read as `o9` at 57px. The boxes ask for lining figures,\n// which stand on the baseline at cap height in any face that has both, and\n// so do the dial's labels and the period selector, whose plain family a\n// theme can set to such a face too. The boxes and the selector keep\n// tabular ones, so a digit changing does not shift the rest.\n//\n// Twenty-four hours put the day's second half on an inner ring, 12 at its top\n// and 00 at the outer ring's, with no period selector, and whether there is\n// one at all is the reader's locale or `hourCycle`, as it is in TimeField.\n\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The dial's geometry, in the units of its viewBox, which it draws at the\n// page's 256dp: the radius of the outer and inner rings of labels and of the\n// handle that sits on them. The inner ring sits far enough in that a handle on\n// it clears the outer ring's labels.\nconst DIAL = 256;\nconst CENTRE = DIAL / 2;\nconst OUTER_RING = 101;\nconst INNER_RING = 64;\nconst HANDLE = 24;\n\n// The period selector's selection, hoisted so each is one stable array\n// rather than a fresh one per render.\nconst MORNING = ['am'];\nconst AFTERNOON = ['pm'];\n\n// React Aria's literal segments carry the locale's bidirectional marks beside\n// the punctuation, so a literal is drawn only when something else is left.\nconst INVISIBLE = /[\\s؜‎‏‪-‮⁦-⁩]/gu;\nconst scaleIn = \"xnirehn-B\";\nconst styles = {\n centre: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1a7rqcl\",\n $$css: true\n },\n dialog: {\n kmVPX3: \"x1apw6a7\",\n $$css: true\n },\n periodButton: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"x1r8uery\",\n kzQI83: \"x1iyjqo2\",\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n kcqcaj: \"x1j4x3al\",\n k63SB2: \"xrf6cl6\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n kogj98: \"x1ghz6dp\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n periodDivider: {\n kLZC3w: \"xrre44y\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x178xt8z\",\n $$css: true\n },\n periodHovered: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n periodSelected: {\n kWkggS: \"xs6yvni x1jzqe4\",\n kMwMTN: \"x3cbcwg x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n periodSelectedHovered: {\n kWkggS: \"x5nnyxq x1jzqe4\",\n $$css: true\n },\n ring: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n selector: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x1rrhr5q\",\n kZKoxP: \"xwzfr38\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1xdvaa9\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\n kB7OPa: \"x9f619\",\n knGrYV: \"xbuiw85\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kMv6JI: \"xjaampf\",\n kGuDYH: \"xuyiek4\",\n kcqcaj: \"x1j4x3al\",\n k63SB2: \"x1n2oj23\",\n kzqmXN: \"xszbqgh\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x1hxa6v5\",\n kLWn49: \"x1iwmiir\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n selectorHovered: {\n kWkggS: \"xpae8dx\",\n $$css: true\n },\n selectorInput: {\n kZKoxP: \"xfl6q2h\",\n kkrTdU: \"x1ed109x\",\n kMv6JI: \"x1gi70vc\",\n kGuDYH: \"xlzzeuu\",\n k63SB2: \"xh9quta\",\n kb6lSQ: \"x148mp24\",\n kLWn49: \"xs5hucj\",\n $$css: true\n },\n selectorInputFocused: {\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n selectorSelected: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selectorSelectedHovered: {\n kWkggS: \"xq1oky0 x1jzqe4\",\n $$css: true\n }\n};\n\n// One label on the dial, placed on its ring.\ntype DialLabel = {\n isSelected: boolean;\n key: string;\n text: string;\n x: number;\n y: number;\n};\n\n// The state React Aria hands a half of the period selector's className.\ntype PeriodState = {\n isFocusVisible: boolean;\n isHovered: boolean;\n isSelected: boolean;\n};\n\n// What React Aria hands the input for each part of the time. Taken off the\n// component, for the reason src/segments gives.\ntype Segment = Parameters<NonNullable<Parameters<typeof RACDateInput>[0]['children']>>[0];\n\n// The state React Aria hands a segment's className.\ntype SegmentState = {\n isFocused: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n};\n\n// The parts of a time the dial and the boxes set.\ntype TimePart = 'hour' | 'minute';\n\n/** Which of the time pickers page's two variants the modal shows. */\ntype TimePickerMode = 'dial' | 'input';\ntype TimePickerProps<T extends TimeValue = TimeValue> = Omit<RACTimeFieldProps<T>, 'children' | 'className' | 'style'> & {\n /**\n * What the modal's dismissing action says. Left out, it is the word for\n * it in the I18nProvider's locale — \"Cancel\" in English.\n */\n cancelLabel?: string;\n /** A function may compute the class from the field's render state. */\n className?: RACTimeFieldProps<T>['className'];\n /**\n * What the modal's confirming action says. Left out, it is the word for\n * it in the I18nProvider's locale — \"OK\" in English.\n */\n confirmLabel?: string;\n /**\n * Where to portal the modal and its scrim. Defaults to the container of the\n * `ThemeScope` around it, which keeps the modal on that scope's tokens, or to\n * the end of `<body>` where there is none. A subtree themed through the\n * `themeScope` class has no container of its own, so point this inside it, or\n * the modal renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Which variant the modal opens on: the dial, or the boxes as text fields\n * to type into. The button at the modal's start switches between them.\n * @default 'dial'\n */\n defaultMode?: TimePickerMode;\n /** Whether the modal starts open, when it keeps its own state. */\n defaultOpen?: boolean;\n /** Supporting text under the field. */\n description?: string;\n /**\n * The input variant's headline, which also names the button that switches\n * the dial to it. Left out, it is the I18nProvider's locale's — \"Enter\n * time\" in English.\n */\n enterTimeLabel?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** Whether the modal is open, when the call site holds the state. */\n isOpen?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /** Called with the modal's new state when it opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /**\n * The dial's headline, which also names the clock button that opens the\n * modal, followed by the field's label, and the button that switches the\n * input variant back. Left out, it is the I18nProvider's locale's —\n * \"Select time\" in English.\n */\n selectTimeLabel?: string;\n /** A function may compute the style from the field's render state. */\n style?: RACTimeFieldProps<T>['style'];\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n/**\n * A picked time as the field's state takes it, which is always a date and\n * time: React Aria puts a bare time on today and takes the date off again on\n * the way out.\n */\nfunction asDateTime(time: TimeValue): CalendarDateTime | ZonedDateTime {\n return 'day' in time ? time : toCalendarDateTime(today(getLocalTimeZone()), time);\n}\n\n// An hour or a minute box's classes, from React Aria's render state. On the\n// dial the selected box is the one the dial follows; typed into, it is the\n// one with focus, which is what the page's input variant draws as focused.\nfunction boxClassName(isDial: boolean, isFollowed: boolean) {\n return (state: SegmentState) => {\n const isSelected = isDial ? isFollowed : state.isFocused;\n return stylex.props(styles.selector, !isDial && styles.selectorInput, state.isHovered && styles.selectorHovered, isSelected && styles.selectorSelected, isSelected && state.isHovered && styles.selectorSelectedHovered, isDial && state.isFocusVisible && styles.ring, !isDial && state.isFocused && styles.selectorInputFocused).className ?? '';\n };\n}\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-jsx-as-prop is after — the same reason DatePicker builds\n// its trigger this way.\nfunction clockTrigger(isDisabled: boolean, isOpen: boolean, label: string, onPress: () => void) {\n return <ClockTrigger isDisabled={isDisabled} isOpen={isOpen} label={label} onPress={onPress} />;\n}\n\n// The clock button in the field's trailing slot. It is named by its own\n// words followed by the field's label, which is how React Aria names\n// DatePicker's calendar button, so two pickers on a form are told apart.\nfunction ClockTrigger({\n isDisabled,\n isOpen,\n label,\n onPress\n}: {\n isDisabled: boolean;\n isOpen: boolean;\n label: string;\n onPress: () => void;\n}) {\n const id = useId();\n const fieldLabel = useSlottedContext(LabelContext);\n return <RACButton aria-expanded={isOpen} aria-haspopup=\"dialog\" aria-label={label} aria-labelledby={fieldLabel?.id === undefined ? undefined : `${id} ${fieldLabel.id}`} className={triggerClassName} id={id} isDisabled={isDisabled} onPress={onPress}>\n <ClockGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>;\n}\n\n/** One label, placed a fraction of a turn round a ring. */\nfunction dialLabel(key: string, text: string, isSelected: boolean, turn: number, radius: number): DialLabel {\n const {\n x,\n y\n } = polar(turn, radius);\n return {\n isSelected,\n key,\n text,\n x,\n y\n };\n}\n\n/** A field's name as the locale writes it, opening with a capital. */\nfunction fieldName(names: Intl.DisplayNames, field: string, locale: string) {\n const name = names.of(field) ?? field;\n return name.charAt(0).toLocaleUpperCase(locale) + name.slice(1);\n}\n\n/**\n * The time the modal opens on: the field's own, else its placeholder, else\n * midnight. A date and time keeps its date, so the field gets back what it\n * holds.\n */\nfunction initialTime(field: null | TimeFieldState, placeholderValue: TimeValue | undefined): TimeValue {\n const held = field?.value;\n if (held !== null && held !== undefined && 'hour' in held) {\n return held;\n }\n return placeholderValue ?? new Time();\n}\n\n/** The labels the dial draws for one part, in the reader's digits. */\nfunction labelsFor(part: TimePart, time: TimeValue, locale: string, twelveHour: boolean): DialLabel[] {\n const steps = Array.from({\n length: 12\n }, (_, step) => step);\n if (part === 'minute') {\n const digits = new Intl.NumberFormat(locale, {\n minimumIntegerDigits: 2\n });\n return steps.map(step => dialLabel(`m${step}`, digits.format(step * 5), time.minute === step * 5, step / 12, OUTER_RING));\n }\n const hours = new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: twelveHour\n });\n if (twelveHour) {\n const offset = time.hour >= 12 ? 12 : 0;\n return steps.map(step => dialLabel(`h${step}`, partOf(hours, step + offset, 'hour'), time.hour % 12 === step, step / 12, OUTER_RING));\n }\n return [...steps.map(step => dialLabel(`h${step}`, partOf(hours, step, 'hour'), time.hour === step, step / 12, OUTER_RING)), ...steps.map(step => dialLabel(`h${step + 12}`, partOf(hours, step + 12, 'hour'), time.hour === step + 12, step / 12, INNER_RING))];\n}\n\n/** The part of a formatted time a formatter writes for one hour of the day. */\nfunction partOf(format: Intl.DateTimeFormat, hour: number, type: 'dayPeriod' | 'hour') {\n return format.formatToParts(new Date(2000, 0, 1, hour)).find(part => part.type === type)?.value ?? String(hour);\n}\n\n// The period selector's morning half, with no rule above it.\nfunction periodAmClassName(state: PeriodState) {\n return periodClassName(state, false);\n}\n\n// A half of the period selector, from React Aria's render state. The second\n// half draws the rule between the two.\nfunction periodClassName(state: PeriodState, divider: boolean) {\n return stylex.props(styles.periodButton, divider && styles.periodDivider, state.isHovered && styles.periodHovered, state.isSelected && styles.periodSelected, state.isSelected && state.isHovered && styles.periodSelectedHovered, state.isFocusVisible && styles.ring).className ?? '';\n}\n\n/**\n * A half of the period selector, and a radio of its group: its key written\n * where the group's arrows read it, and out of the Tab order unless it is\n * the chosen half. A component of its own because that is read from the\n * group's state, which only its children reach.\n */\nfunction PeriodHalf({\n children,\n className,\n id\n}: {\n children: string;\n className: (state: PeriodState) => string;\n id: 'am' | 'pm';\n}) {\n const radio = useRadioItem(id);\n return <ToggleButton {...radio} className={className} id={id}>\n {children}\n </ToggleButton>;\n}\n\n// Its afternoon half, under the rule between the two.\nfunction periodPmClassName(state: PeriodState) {\n return periodClassName(state, true);\n}\n\n/** Where a fraction of a turn clockwise from twelve lands on a ring. */\nfunction polar(turn: number, radius: number) {\n const angle = turn * 2 * Math.PI;\n return {\n x: CENTRE + radius * Math.sin(angle),\n y: CENTRE - radius * Math.cos(angle)\n };\n}\n\n/**\n * A time typed into a field, or picked in a modal behind the clock button\n * at the field's end — on a dial, or typed into the modal's larger boxes.\n * The value is React Aria's — pass `value` with `onChange` to control it,\n * or `defaultValue` — as a `Time` from this package's `./date` subpath.\n *\n * ```tsx\n * import { Time } from '@kanso-labs/kanso-ui/date'\n *\n * <TimePicker defaultValue={new Time(9, 30)} label=\"Label\" />\n * ```\n *\n * The field is `TimeField`'s, so `granularity`, `hourCycle`, `minValue` and\n * `maxValue` behave as they do there. The modal sets hours and minutes and\n * keeps the seconds a value already has; a time it writes back is checked\n * against the bounds as a typed one is. Whether it shows a twelve or\n * twenty-four hour clock is the reader's locale, through React Aria's\n * `I18nProvider`, unless `hourCycle` says otherwise.\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions.\n */\nfunction TimePicker<T extends TimeValue>({\n cancelLabel,\n confirmLabel,\n container,\n defaultMode = 'dial',\n defaultOpen = false,\n description,\n enterTimeLabel,\n error,\n floatingLabel = true,\n isDisabled = false,\n isOpen,\n isReadOnly = false,\n label,\n leadingIcon,\n onOpenChange,\n selectTimeLabel,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TimePickerProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n const messages = useMessages();\n const [ownOpen, setOwnOpen] = useState(defaultOpen);\n const open = isOpen ?? ownOpen;\n const changeOpen = useCallback((next: boolean) => {\n if (isOpen === undefined) {\n setOwnOpen(next);\n }\n onOpenChange?.(next);\n }, [isOpen, onOpenChange]);\n const openModal = useCallback(() => {\n changeOpen(true);\n }, [changeOpen]);\n return <RACTimeField<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} isReadOnly={isReadOnly} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, for the reason TimeField's own comment gives.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon}\n // In the chrome's trailing slot, where DatePicker puts its calendar\n // button and for the same reasons.\n trailing={clockTrigger(isDisabled || isReadOnly, open, selectTimeLabel ?? messages.selectTime, openModal)} variant={variant}>\n <FieldSegments>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <ModalOverlay isDismissable isOpen={open} onOpenChange={changeOpen}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.scrim, styles.centre)}>\n <Modal className=\"x1n1nwrg x1u6grsq xbhiib0 x16dv9tl xvkjz1l x1w1tqly x19pkqky xx61lck x13rsnn2 x1udv5rz x9f619 x139gbkf xi55695 xmz0i5r x193iq5w xysyzu8\">\n <TimePickerDialog cancelLabel={cancelLabel ?? messages.cancel} confirmLabel={confirmLabel ?? messages.confirm} defaultMode={defaultMode} enterTimeLabel={enterTimeLabel ?? messages.enterTime} fieldLabel={label} granularity={props.granularity === 'hour' ? 'hour' : 'minute'} hourCycle={props.hourCycle} placeholderValue={props.placeholderValue} selectTimeLabel={selectTimeLabel ?? messages.selectTime} />\n </Modal>\n </ModalOverlay>\n </RACTimeField>;\n}\n\n/**\n * The modal's content, mounted each time it opens: the time it was opened\n * with is its draft until OK writes the draft into the field, or the modal\n * closes without it.\n */\nfunction TimePickerDialog({\n cancelLabel,\n confirmLabel,\n defaultMode,\n enterTimeLabel,\n fieldLabel,\n granularity,\n hourCycle,\n placeholderValue,\n selectTimeLabel\n}: {\n cancelLabel: string;\n confirmLabel: string;\n defaultMode: TimePickerMode;\n enterTimeLabel: string;\n fieldLabel: string;\n granularity: 'hour' | 'minute';\n hourCycle: 12 | 24 | undefined;\n placeholderValue: TimeValue | undefined;\n selectTimeLabel: string;\n}) {\n const {\n locale\n } = useLocale();\n // The outer field's state: the modal reads the time from it and writes the\n // picked one back through it, so the field stays the one owner of its\n // value, controlled or not, and its onChange is React Aria's own.\n const field = useContext(TimeFieldStateContext);\n const [draft, setDraft] = useState(() => initialTime(field, placeholderValue));\n const [mode, setMode] = useState(defaultMode);\n const [part, setPart] = useState<TimePart>('hour');\n const headingId = useId();\n const labelContext = useSlottedContext(LabelContext);\n const boxes = useRef<HTMLDivElement>(null);\n const dragging = useRef(false);\n const twelveHour = usesTwelveHours(locale, hourCycle);\n const names = new Intl.DisplayNames(locale, {\n type: 'dateTimeField'\n });\n const periods = new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n hour12: true\n });\n const isAfternoon = draft.hour >= 12;\n const isDial = mode === 'dial';\n const showsMinutes = granularity === 'minute';\n const shown: TimePart = showsMinutes ? part : 'hour';\n const handle = shown === 'minute' ? polar(draft.minute / 60, OUTER_RING) : polar(draft.hour % 12 / 12, !twelveHour && draft.hour >= 12 ? INNER_RING : OUTER_RING);\n const focusBox = useCallback((type: TimePart) => {\n const box = boxes.current?.querySelector(`[data-type=\"${type}\"]`);\n if (box instanceof HTMLElement) {\n box.focus();\n }\n }, []);\n\n // Which box the dial follows, taken from the box that has focus — a press\n // on a box, a Tab into it, or React Aria moving on once an hour is typed.\n const followFocus = useCallback((event: FocusEvent<HTMLDivElement>) => {\n const type = event.target.getAttribute('data-type');\n if (type === 'hour' || type === 'minute') {\n setPart(type);\n }\n }, []);\n const changeDraft = useCallback((next: null | TimeValue) => {\n if (next !== null) {\n setDraft(next);\n }\n }, []);\n const pick = useCallback((event: PointerEvent<SVGSVGElement>) => {\n const box = event.currentTarget.getBoundingClientRect();\n const x = event.clientX - box.left - box.width / 2;\n const y = event.clientY - box.top - box.height / 2;\n const turn = (Math.atan2(x, -y) / (2 * Math.PI) + 1) % 1;\n const distance = Math.hypot(x, y) * DIAL / box.width;\n if (shown === 'minute') {\n setDraft(draft.set({\n minute: Math.round(turn * 60) % 60\n }));\n return;\n }\n const step = Math.round(turn * 12) % 12;\n if (twelveHour) {\n setDraft(draft.set({\n hour: step + (isAfternoon ? 12 : 0)\n }));\n return;\n }\n const inner = distance < (OUTER_RING + INNER_RING) / 2;\n setDraft(draft.set({\n hour: inner ? step + 12 : step\n }));\n }, [draft, isAfternoon, shown, twelveHour]);\n const startPicking = useCallback((event: PointerEvent<SVGSVGElement>) => {\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return;\n }\n // Keeps focus where it is: the dial is not a focus stop, and a press on\n // it would otherwise blur the box it is setting.\n event.preventDefault();\n try {\n event.currentTarget.setPointerCapture(event.pointerId);\n } catch {\n // A pointer the browser is not tracking has no capture to take — a\n // synthetic event in a test, where the moves land on the dial anyway.\n }\n dragging.current = true;\n pick(event);\n }, [pick]);\n const continuePicking = useCallback((event: PointerEvent<SVGSVGElement>) => {\n if (dragging.current) {\n pick(event);\n }\n }, [pick]);\n\n // An hour picked on the dial moves on to the minutes, as the page does.\n const stopPicking = useCallback(() => {\n if (!dragging.current) {\n return;\n }\n dragging.current = false;\n if (shown === 'hour' && showsMinutes) {\n setPart('minute');\n focusBox('minute');\n }\n }, [focusBox, shown, showsMinutes]);\n const switchMode = useCallback(() => {\n setMode(isDial ? 'input' : 'dial');\n focusBox(part);\n }, [focusBox, isDial, part]);\n const choosePeriod = useCallback((keys: Selection) => {\n const afternoon = keys !== 'all' && keys.has('pm');\n if (afternoon !== isAfternoon) {\n setDraft(draft.set({\n hour: draft.hour % 12 + (afternoon ? 12 : 0)\n }));\n }\n }, [draft, isAfternoon]);\n\n // OK writes the draft through the field's state, and its `slot` closes the\n // modal after.\n const confirm = useCallback(() => {\n field?.setValue(asDateTime(draft));\n }, [draft, field]);\n const renderBox = useCallback((segment: Segment): ReactElement => {\n if (segment.type === 'hour' || segment.type === 'minute') {\n return <RACDateSegment className={boxClassName(isDial, shown === segment.type)} segment={segment} />;\n }\n if (segment.type === 'literal' && segment.text.replaceAll(INVISIBLE, '') !== '') {\n return <RACDateSegment {...{\n 0: {\n className: \"x6s0dn4 xwzfr38 x9f619 x139gbkf x3nfvp2 xjaampf xuyiek4 x1n2oj23 xvy4d1p xl56j7k x1iwmiir\"\n },\n 1: {\n className: \"x6s0dn4 x9f619 x139gbkf x3nfvp2 xvy4d1p xl56j7k xfl6q2h x1gi70vc xlzzeuu xh9quta xs5hucj\"\n }\n }[!!!isDial << 0]} segment={segment} />;\n }\n return <RACDateSegment hidden segment={segment} />;\n }, [isDial, shown]);\n const labels = labelsFor(shown, draft, locale, twelveHour);\n const between = shown === 'minute' && draft.minute % 5 !== 0;\n return <RACDialog aria-labelledby={labelContext?.id === undefined ? headingId : `${headingId} ${labelContext.id}`} {...stylex.props(overlay.modalDialog, styles.dialog)}>\n <Heading id={headingId} level={2} className=\"x9f619 x1w5n3ug xp6n8n2 xkucv67 x14hhc5u x12utw95 xvzb9hk x1ghz6dp xieb3on\">\n {isDial ? selectTimeLabel : enterTimeLabel}\n </Heading>\n <div className=\"x1cy8zhl x9f619 x78zum5 x1gka490 xl56j7k\">\n <div onFocus={followFocus} ref={boxes}>\n <RACTimeField aria-label={fieldLabel}\n // The modal opens on the hour, the box it draws as selected, so\n // the arrows set it straight away. React Aria's dialog focuses\n // itself as it opens unless focus is already inside it, and the\n // field takes focus first: its effect runs before the dialog's,\n // which is its ancestor. The first segment it focuses is the\n // hour in every locale, since the period segment before it in\n // some is hidden.\n // oxlint-disable-next-line jsx-a11y/no-autofocus -- a modal opened to set a time starts on the hour it draws as selected\n autoFocus granularity={granularity} hideTimeZone hourCycle={hourCycle} onChange={changeDraft} shouldForceLeadingZeros validationBehavior=\"aria\" value={draft}>\n <RACDateInput className=\"x6s0dn4 x9f619 x78zum5 x1t137rt\">\n {renderBox}\n </RACDateInput>\n </RACTimeField>\n {isDial ? null : <div aria-hidden=\"true\" className=\"x9f619 x1w5n3ug x78zum5 x1yicsit x1b35g6e x9d6959 x1665zp3 xwth0xh xybisxh x7suny0\">\n <span className=\"x9f619 xszbqgh\">\n {fieldName(names, 'hour', locale)}\n </span>\n {showsMinutes ? <span className=\"x9f619 xszbqgh\">\n {fieldName(names, 'minute', locale)}\n </span> : null}\n </div>}\n </div>\n {twelveHour ? <ToggleButtonGroup aria-label={names.of('dayPeriod')} disallowEmptySelection onSelectionChange={choosePeriod} orientation=\"vertical\" render={toggleGroupRenderer(undefined, true)} selectedKeys={isAfternoon ? AFTERNOON : MORNING} selectionMode=\"single\" {...{\n 0: {\n className: \"xwzfr38 x1fwvt7v x1xdvaa9 x1y0btm7 xmkeg23 x9f619 x78zum5 xdt5ytf x2lah0s xvni27 xb3r6kr\"\n },\n 1: {\n className: \"x1fwvt7v x1xdvaa9 x1y0btm7 xmkeg23 x9f619 x78zum5 xdt5ytf x2lah0s xvni27 xb3r6kr xfl6q2h\"\n }\n }[!!!isDial << 0]}>\n <PeriodHalf className={periodAmClassName} id=\"am\">\n {partOf(periods, 9, 'dayPeriod')}\n </PeriodHalf>\n <PeriodHalf className={periodPmClassName} id=\"pm\">\n {partOf(periods, 21, 'dayPeriod')}\n </PeriodHalf>\n </ToggleButtonGroup> : null}\n </div>\n {isDial ? <svg aria-hidden=\"true\" data-dial={shown} onPointerCancel={stopPicking} onPointerDown={startPicking} onPointerMove={continuePicking} onPointerUp={stopPicking} viewBox={`0 0 ${DIAL} ${DIAL}`} className=\"xrlp1an x9f619 x1ypdohk x1lliihq x2lah0s x1t9vceh xseo6mj xvueqy4 x5ve5x3 x87ps6o\">\n <circle cx={CENTRE} cy={CENTRE} r={CENTRE - 1} className=\"x1a930ss x1h8bevw xeutv01 x8jos32\" />\n <line x1={CENTRE} x2={handle.x} y1={CENTRE} y2={handle.y} className=\"xrr0osq x1rqz208 x1i9vjva xbabvq0 x8pzrqk\" />\n <circle cx={CENTRE} cy={CENTRE} r={4} className=\"xrr0osq x1rqz208 x1i9vjva xbabvq0 x8pzrqk\" />\n <circle cx={handle.x} cy={handle.y} data-handle=\"\" r={HANDLE} className=\"xrr0osq x1rqz208 x1i9vjva xbabvq0 x8pzrqk\" />\n {between ? <circle cx={handle.x} cy={handle.y} r={2} className=\"xvlh3h9 x1bpb6vw\" /> : null}\n {labels.map(label => <text dominantBaseline=\"central\" key={label.key} textAnchor=\"middle\" x={label.x} y={label.y} {...{\n 0: {\n className: \"xti7fmr xmw301f x16svsjw x1848etk x17gc79u x1c52epr x1qn8t5l\"\n },\n 1: {\n className: \"x16svsjw x1848etk x17gc79u x1c52epr x1qn8t5l xvlh3h9 x1bpb6vw\"\n }\n }[!!label.isSelected << 0]}>\n {label.text}\n </text>)}\n </svg> : null}\n <div className=\"x6s0dn4 x9f619 x78zum5 x126z3so x1qughib x1yhnu8z\">\n <IconButton aria-label={isDial ? enterTimeLabel : selectTimeLabel} onPress={switchMode}>\n {isDial ? <KeyboardGlyph className=\"xlzyvqe x1lliihq x15vhz18\" /> : <ClockGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />}\n </IconButton>\n <div className=\"x78zum5 x126z3so\">\n <Button slot=\"close\" variant=\"text\">\n {cancelLabel}\n </Button>\n <Button onPress={confirm} slot=\"close\" variant=\"text\">\n {confirmLabel}\n </Button>\n </div>\n </div>\n </RACDialog>;\n}\n\n/**\n * Whether the reader's clock has twelve hours. `hourCycle` decides when it\n * is given, as it does for React Aria's segments; otherwise the locale does.\n */\nfunction usesTwelveHours(locale: string, hourCycle: 12 | 24 | undefined) {\n if (hourCycle !== undefined) {\n return hourCycle === 12;\n }\n return new Intl.DateTimeFormat(locale, {\n hour: 'numeric'\n }).resolvedOptions().hour12 ?? false;\n}\nexport type { TimePickerMode, TimePickerProps };\nexport default TimePicker;"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwFA,MAAM4B,OAAO;AACb,MAAMC,SAASD,OAAO;AACtB,MAAME,aAAa;AACnB,MAAMC,aAAa;AACnB,MAAMC,SAAS;AAIf,MAAMC,UAAU,CAAC,IAAI;AACrB,MAAMC,YAAY,CAAC,IAAI;AAIvB,MAAMC,YAAY;AAElB,MAAMC,SAAS;CACbC,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNF,QAAQ;EACRC,OAAO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E,MAAAvE,EAAA,SAAA6E,IAAA;EA1EHe,MAAA,qBAAC,IAAD;GAA4B,mBAAAnF;GAA8E,GAAM2D;GAAhH,UAAA;IACHE;IAGAC;IAyCCM;IAiBDc;GA9Da;;EA2EH3F,EAAA,MAAAkF;EAAAlF,EAAA,MAAA2F;EAAA3F,EAAA,MAAAS;EAAAT,EAAA,MAAAoE;EAAApE,EAAA,MAAAsE;EAAAtE,EAAA,OAAAuE;EAAAvE,EAAA,OAAA6E;EAAA7E,EAAA,OAAA4F;CAAA,OAAAA,MAAA5F,EAAA;CAAA,OA3EP4F;AA2EO;;;;;AA5OhB,SAAAwF,MAAArM,OAAA;CAAA,OAoN+B,oBAAA,QAAA;EAAuB,kBAAA;EAAqC,YAAA;EAAY,GAAAA,MAAKhB;EAAO,GAAAgB,MAAKf;EAAE,GAAM;GAAA8M,GACrH,EAAAzM,WACU,+DACb;GAAC0M,GACE,EAAA1M,WACU,gEACb;EACF,EAAE,CAAC,CAACU,MAAKnB,cAAe;EACfmB,UAAAA,MAAKjB;CACD,GATkDiB,MAAKlB,GASvD;AAAA;AAsBnB,SAAS4J,gBAAgBtG,QAAgByF,WAAgC;CACvE,IAAIA,cAAcxG,KAAAA,GAChB,OAAOwG,cAAc;CAEvB,OAAO,IAAI5F,KAAK6B,eAAe1B,QAAQ,EACrC2B,MAAM,UACR,CAAC,CAAC,CAACuI,gBAAgB,CAAC,CAACtI,UAAU;AACjC"}
@@ -19,9 +19,10 @@ type ToolbarProps = Omit<ToolbarProps$1, 'children' | 'className' | 'style'> & {
19
19
  type ToolbarTone = 'neutral' | 'vibrant';
20
20
  /**
21
21
  * A container for a set of controls, announced as a toolbar so a screen
22
- * reader reads them as one group, with the arrow keys moving between them.
23
- * Tab still steps through each control: React Aria's toolbar adds the arrows
24
- * rather than replacing what Tab does.
22
+ * reader reads them as one group, with the arrow keys moving between them
23
+ * and Home and End moving to the first and the last enabled control. The
24
+ * bar is one Tab stop: Tab and Shift+Tab leave it from whichever control has
25
+ * focus, and coming back returns to that control.
25
26
  *
26
27
  * ```tsx
27
28
  * <Toolbar aria-label="Label">
@@ -2,7 +2,7 @@
2
2
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
3
  import { mergeStatefulStyles } from "../../styles/merge.js";
4
4
  import { c } from "react/compiler-runtime";
5
- import "react";
5
+ import { createElement } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { SeparatorContext, Toolbar as Toolbar$1 } from "react-aria-components";
8
8
  // src/components/toolbar/index.tsx
@@ -44,16 +44,64 @@ const styles = {
44
44
  $$css: true
45
45
  },
46
46
  vibrant: {
47
+ "--icon-button-standard-color": "x78l5pw",
47
48
  kWkggS: "xp89om9",
48
49
  kMwMTN: "xscdzaa",
49
50
  $$css: true
50
51
  }
51
52
  };
53
+ const FOCUSABLE = [
54
+ "a[href]",
55
+ "area[href]",
56
+ "button",
57
+ "iframe",
58
+ "input:not([type=\"hidden\"])",
59
+ "select",
60
+ "summary",
61
+ "textarea",
62
+ "[contenteditable]:not([contenteditable=\"false\"])",
63
+ "[tabindex]"
64
+ ].join(",");
65
+ const PRESSABLE_INPUTS = /* @__PURE__ */ new Set([
66
+ "button",
67
+ "checkbox",
68
+ "image",
69
+ "radio",
70
+ "reset",
71
+ "submit"
72
+ ]);
73
+ /**
74
+ * The bar's controls a Tab could land on, in document order: a disabled
75
+ * one, one taken out of the Tab order, and one inert or not drawn are left
76
+ * out, so Home and End never reach a control that cannot take focus.
77
+ */
78
+ function controlsIn(bar) {
79
+ return [...bar.querySelectorAll(FOCUSABLE)].filter((control) => control.tabIndex >= 0 && !control.matches(":disabled") && control.closest("[inert]") === null && control.checkVisibility());
80
+ }
81
+ function homeAndEnd(event) {
82
+ const bar = event.currentTarget;
83
+ const { target } = event;
84
+ if (event.key !== "Home" && event.key !== "End" || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || event.defaultPrevented || !(target instanceof HTMLElement) || !bar.contains(target) || ownsHomeAndEnd(target)) return;
85
+ const controls = controlsIn(bar);
86
+ const control = event.key === "Home" ? controls.at(0) : controls.at(-1);
87
+ if (control === void 0) return;
88
+ event.preventDefault();
89
+ control.focus();
90
+ }
91
+ /**
92
+ * Whether `target` is a control with its own use for Home and End: a field,
93
+ * whose caret they move, a native select or range, or editable text.
94
+ */
95
+ function ownsHomeAndEnd(target) {
96
+ if (target instanceof HTMLInputElement) return !PRESSABLE_INPUTS.has(target.type);
97
+ return target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement || target.isContentEditable;
98
+ }
52
99
  /**
53
100
  * A container for a set of controls, announced as a toolbar so a screen
54
- * reader reads them as one group, with the arrow keys moving between them.
55
- * Tab still steps through each control: React Aria's toolbar adds the arrows
56
- * rather than replacing what Tab does.
101
+ * reader reads them as one group, with the arrow keys moving between them
102
+ * and Home and End moving to the first and the last enabled control. The
103
+ * bar is one Tab stop: Tab and Shift+Tab leave it from whichever control has
104
+ * focus, and coming back returns to that control.
57
105
  *
58
106
  * ```tsx
59
107
  * <Toolbar aria-label="Label">
@@ -83,31 +131,33 @@ const styles = {
83
131
  * rather than squeezing a control or overflowing the page.
84
132
  */
85
133
  function Toolbar(t0) {
86
- const $ = c(18);
134
+ const $ = c(20);
87
135
  let T0;
88
136
  let T1;
89
137
  let t1;
90
138
  let t2;
91
139
  let t3;
92
140
  let t4;
141
+ let t5;
93
142
  if ($[0] !== t0) {
94
- const { orientation: t5, tone: t6, ...props$1 } = t0;
95
- const orientation = t5 === void 0 ? "horizontal" : t5;
96
- const tone = t6 === void 0 ? "neutral" : t6;
97
- const t7 = orientation === "horizontal" ? "vertical" : "horizontal";
98
- let t8;
99
- if ($[7] !== t7) {
100
- t8 = { orientation: t7 };
101
- $[7] = t7;
143
+ const { orientation: t6, tone: t7, ...props$1 } = t0;
144
+ const orientation = t6 === void 0 ? "horizontal" : t6;
145
+ const tone = t7 === void 0 ? "neutral" : t7;
146
+ const t8 = orientation === "horizontal" ? "vertical" : "horizontal";
147
+ let t9;
148
+ if ($[8] !== t8) {
149
+ t9 = { orientation: t8 };
102
150
  $[8] = t8;
103
- } else t8 = $[8];
104
- const separator = t8;
151
+ $[9] = t9;
152
+ } else t9 = $[9];
153
+ const separator = t9;
105
154
  T1 = SeparatorContext;
106
- t4 = separator;
155
+ t5 = separator;
107
156
  T0 = Toolbar$1;
108
157
  t1 = orientation;
109
158
  t2 = props$1;
110
- t3 = mergeStatefulStyles(props(styles.base, styles[orientation], styles[tone]), props$1);
159
+ t3 = toolbarRenderer(props$1.render);
160
+ t4 = mergeStatefulStyles(props(styles.base, styles[orientation], styles[tone]), props$1);
111
161
  $[0] = t0;
112
162
  $[1] = T0;
113
163
  $[2] = T1;
@@ -115,6 +165,7 @@ function Toolbar(t0) {
115
165
  $[4] = t2;
116
166
  $[5] = t3;
117
167
  $[6] = t4;
168
+ $[7] = t5;
118
169
  } else {
119
170
  T0 = $[1];
120
171
  T1 = $[2];
@@ -122,32 +173,50 @@ function Toolbar(t0) {
122
173
  t2 = $[4];
123
174
  t3 = $[5];
124
175
  t4 = $[6];
176
+ t5 = $[7];
125
177
  }
126
- let t5;
127
- if ($[9] !== T0 || $[10] !== t1 || $[11] !== t2 || $[12] !== t3) {
128
- t5 = /* @__PURE__ */ jsx(T0, {
178
+ let t6;
179
+ if ($[10] !== T0 || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4) {
180
+ t6 = /* @__PURE__ */ jsx(T0, {
129
181
  orientation: t1,
130
182
  ...t2,
131
- ...t3
183
+ render: t3,
184
+ ...t4
132
185
  });
133
- $[9] = T0;
134
- $[10] = t1;
135
- $[11] = t2;
136
- $[12] = t3;
137
- $[13] = t5;
138
- } else t5 = $[13];
139
- let t6;
140
- if ($[14] !== T1 || $[15] !== t4 || $[16] !== t5) {
141
- t6 = /* @__PURE__ */ jsx(T1, {
142
- value: t4,
143
- children: t5
186
+ $[10] = T0;
187
+ $[11] = t1;
188
+ $[12] = t2;
189
+ $[13] = t3;
190
+ $[14] = t4;
191
+ $[15] = t6;
192
+ } else t6 = $[15];
193
+ let t7;
194
+ if ($[16] !== T1 || $[17] !== t5 || $[18] !== t6) {
195
+ t7 = /* @__PURE__ */ jsx(T1, {
196
+ value: t5,
197
+ children: t6
144
198
  });
145
- $[14] = T1;
146
- $[15] = t4;
147
- $[16] = t5;
148
- $[17] = t6;
149
- } else t6 = $[17];
150
- return t6;
199
+ $[16] = T1;
200
+ $[17] = t5;
201
+ $[18] = t6;
202
+ $[19] = t7;
203
+ } else t7 = $[19];
204
+ return t7;
205
+ }
206
+ /**
207
+ * The bar's element, with Home and End added to the keys React Aria handles,
208
+ * then handed to the call site's own `render` if it passed one. React Aria's
209
+ * toolbar passes no keyboard handler of the call site's through, so the
210
+ * element it hands over carries none for this to compose with.
211
+ */
212
+ function toolbarRenderer(render) {
213
+ return (domProps, renderProps) => {
214
+ const merged = {
215
+ ...domProps,
216
+ onKeyDown: homeAndEnd
217
+ };
218
+ return render === void 0 ? createElement("div", merged) : render(merged, renderProps);
219
+ };
151
220
  }
152
221
  export { Toolbar as default };
153
222