@kanso-labs/kanso-ui 0.45.34 → 0.46.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.
- package/dist/button/index.js +13 -9
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/styles.js +12 -7
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/styles.js +1 -0
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/styles.js +1 -1
- package/dist/collection/styles.js.map +1 -1
- package/dist/components/breadcrumbs/index.js +4 -1
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/button-group/index.d.ts +16 -3
- package/dist/components/button-group/index.js +53 -86
- package/dist/components/button-group/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +3 -3
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/card/index.js +5 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/carousel/index.js +162 -105
- package/dist/components/carousel/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +38 -15
- package/dist/components/chip/index.js +104 -8
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/color-area/index.d.ts +5 -3
- package/dist/components/color-area/index.js +5 -3
- package/dist/components/color-area/index.js.map +1 -1
- package/dist/components/color-picker/index.js +6 -3
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.js +24 -9
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/combo-box/index.d.ts +11 -3
- package/dist/components/combo-box/index.js +66 -62
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/copy-field/index.js +1 -0
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/date-picker/index.d.ts +22 -3
- package/dist/components/date-picker/index.js +234 -45
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/date-range-picker/index.d.ts +3 -1
- package/dist/components/date-range-picker/index.js +6 -4
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/disclosure/index.d.ts +4 -3
- package/dist/components/disclosure/index.js +159 -101
- package/dist/components/disclosure/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +3 -1
- package/dist/components/fab/index.js +25 -12
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/fab-menu/index.js +1 -1
- package/dist/components/fab-menu/index.js.map +1 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-rail/index.js +4 -4
- package/dist/components/navigation-rail/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +16 -13
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/popover/index.js +35 -33
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/range-calendar/index.js +41 -7
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +3 -2
- package/dist/components/segmented-button/index.js +46 -95
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/select/index.js +5 -2
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/slider/index.js +42 -10
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/time-picker/index.js +2 -0
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/components/token-field/index.js +89 -66
- package/dist/components/token-field/index.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +4 -0
- package/dist/components/toolbar/index.js +16 -5
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/tree/index.js +1 -1
- package/dist/components/tree/index.js.map +1 -1
- package/dist/fab/styles.js +12 -0
- package/dist/fab/styles.js.map +1 -1
- package/dist/field/styles.js +2 -2
- package/dist/field/styles.js.map +1 -1
- package/dist/hooks/useDockedMonths.js +36 -0
- package/dist/hooks/useDockedMonths.js.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +34 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/navigation/index.js +5 -5
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/styles.js +4 -0
- package/dist/navigation/styles.js.map +1 -1
- package/dist/row/context.js +6 -0
- package/dist/row/context.js.map +1 -0
- package/dist/row/index.js +77 -66
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +15 -0
- package/dist/row/styles.js.map +1 -1
- package/dist/segments/index.js +2 -1
- package/dist/segments/index.js.map +1 -1
- package/dist/segments/styles.js +4 -0
- package/dist/segments/styles.js.map +1 -1
- package/dist/styles/chequer.js +1 -0
- package/dist/styles/chequer.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles.css +158 -35
- package/dist/toggle-group/index.js +133 -0
- package/dist/toggle-group/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -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","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 $$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 $$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;AA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AAwF,MAAAlM,OAAA;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","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,aA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,OAAAyF;CAAA,OAAAA,MAAAzF,EAAA;CAAA,OAlEPyF;AAkEO;;;;;AAnOhB,SAAAwF,MAAAlM,OAAA;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"}
|
|
@@ -4,6 +4,7 @@ import { chipLabel } from "../../chip/index.js";
|
|
|
4
4
|
import { chipStyles } from "../../chip/styles.js";
|
|
5
5
|
import { FieldBox, FieldMessage } from "../../field/index.js";
|
|
6
6
|
import { fieldStyles, invalidFrom } from "../../field/root.js";
|
|
7
|
+
import { fieldChromeStyles } from "../../field/styles.js";
|
|
7
8
|
import { focus } from "../../styles/focus.js";
|
|
8
9
|
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
9
10
|
import { c } from "react/compiler-runtime";
|
|
@@ -11,22 +12,47 @@ import { useId, useLayoutEffect, useRef, useState } from "react";
|
|
|
11
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { Token, TokenField as TokenField$1, TokenInput } from "react-aria-components";
|
|
13
14
|
// src/components/token-field/index.tsx
|
|
14
|
-
const styles = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const styles = {
|
|
16
|
+
input: {
|
|
17
|
+
kB7OPa: "x9f619",
|
|
18
|
+
kMwMTN: "x139gbkf",
|
|
19
|
+
k1xSpc: "x1lliihq",
|
|
20
|
+
kMv6JI: "x16svsjw",
|
|
21
|
+
kGuDYH: "x1848etk",
|
|
22
|
+
k63SB2: "x1c52epr",
|
|
23
|
+
kzqmXN: "xh8yej3",
|
|
24
|
+
kb6lSQ: "x1qn8t5l",
|
|
25
|
+
kLWn49: "xcgk4ki",
|
|
26
|
+
kAzted: "x21xpn4",
|
|
27
|
+
k3XXqK: "x1t137rt",
|
|
28
|
+
khDVqt: "x126k92a",
|
|
29
|
+
$$css: true
|
|
30
|
+
},
|
|
31
|
+
inputUnderLabel: {
|
|
32
|
+
kAzted: "xhm3zzy",
|
|
33
|
+
kLKAdn: "xczxdwi",
|
|
34
|
+
$$css: true
|
|
35
|
+
},
|
|
36
|
+
token: {
|
|
37
|
+
kXLuUW: "xxymvpz",
|
|
38
|
+
$$css: true
|
|
39
|
+
}
|
|
40
|
+
};
|
|
18
41
|
function changeHandler(setHeld, onChange) {
|
|
19
42
|
return (value) => {
|
|
20
43
|
setHeld(value);
|
|
21
44
|
onChange?.(value);
|
|
22
45
|
};
|
|
23
46
|
}
|
|
47
|
+
function inputClassName(variant) {
|
|
48
|
+
return ({ isDisabled }) => props(styles.input, variant === "filled" && styles.inputUnderLabel, isDisabled && fieldChromeStyles.inputDisabled).className ?? "";
|
|
49
|
+
}
|
|
24
50
|
function isPopulated(value) {
|
|
25
51
|
if (value === void 0) return;
|
|
26
52
|
return value.segments.some((segment) => segment.text.length > 0);
|
|
27
53
|
}
|
|
28
|
-
function tokenClassName({ isSelected }) {
|
|
29
|
-
return props(chipStyles.base, focus.ring, isSelected ? chipStyles.selected : chipStyles.unselected, styles.token).className ?? "";
|
|
54
|
+
function tokenClassName({ isDisabled, isSelected }) {
|
|
55
|
+
return props(chipStyles.base, focus.ring, isSelected ? chipStyles.selected : chipStyles.unselected, styles.token, isDisabled && chipStyles.disabled, isDisabled && (isSelected ? chipStyles.disabledSelected : chipStyles.disabledUnselected)).className ?? "";
|
|
30
56
|
}
|
|
31
57
|
function tokenContent(renderToken) {
|
|
32
58
|
return (segment) => /* @__PURE__ */ jsx(Token, {
|
|
@@ -58,7 +84,7 @@ function tokenContent(renderToken) {
|
|
|
58
84
|
* which is the element a layout positions.
|
|
59
85
|
*/
|
|
60
86
|
function TokenField(t0) {
|
|
61
|
-
const $ = c(
|
|
87
|
+
const $ = c(36);
|
|
62
88
|
const { description, error, floatingLabel: t1, label, leadingIcon, renderToken, trailingIcon, variant: t2, ...props$1 } = t0;
|
|
63
89
|
const floatingLabel = t1 === void 0 ? true : t1;
|
|
64
90
|
const variant = t2 === void 0 ? "filled" : t2;
|
|
@@ -101,34 +127,31 @@ function TokenField(t0) {
|
|
|
101
127
|
$[6] = t9;
|
|
102
128
|
} else t9 = $[6];
|
|
103
129
|
let t10;
|
|
104
|
-
if ($[7]
|
|
105
|
-
t10 =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
130
|
+
if ($[7] !== variant) {
|
|
131
|
+
t10 = inputClassName(variant);
|
|
132
|
+
$[7] = variant;
|
|
133
|
+
$[8] = t10;
|
|
134
|
+
} else t10 = $[8];
|
|
135
|
+
let t11;
|
|
136
|
+
if ($[9] !== renderToken) {
|
|
137
|
+
t11 = tokenContent(renderToken);
|
|
138
|
+
$[9] = renderToken;
|
|
139
|
+
$[10] = t11;
|
|
140
|
+
} else t11 = $[10];
|
|
112
141
|
let t12;
|
|
113
|
-
if ($[
|
|
114
|
-
t12 =
|
|
115
|
-
|
|
116
|
-
$[9] = t12;
|
|
117
|
-
} else t12 = $[9];
|
|
118
|
-
let t13;
|
|
119
|
-
if ($[10] !== t11 || $[11] !== t12) {
|
|
120
|
-
t13 = /* @__PURE__ */ jsx(TokenInput, {
|
|
142
|
+
if ($[11] !== t10 || $[12] !== t11) {
|
|
143
|
+
t12 = /* @__PURE__ */ jsx(TokenInput, {
|
|
144
|
+
className: t10,
|
|
121
145
|
ref: area,
|
|
122
|
-
|
|
123
|
-
children: t12
|
|
146
|
+
children: t11
|
|
124
147
|
});
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
} else
|
|
129
|
-
let
|
|
130
|
-
if ($[
|
|
131
|
-
|
|
148
|
+
$[11] = t10;
|
|
149
|
+
$[12] = t11;
|
|
150
|
+
$[13] = t12;
|
|
151
|
+
} else t12 = $[13];
|
|
152
|
+
let t13;
|
|
153
|
+
if ($[14] !== floatingLabel || $[15] !== label || $[16] !== leadingIcon || $[17] !== populated || $[18] !== props$1.isDisabled || $[19] !== t12 || $[20] !== t9 || $[21] !== trailingIcon || $[22] !== variant) {
|
|
154
|
+
t13 = /* @__PURE__ */ jsx(FieldBox, {
|
|
132
155
|
floatingLabel,
|
|
133
156
|
isDisabled: t8,
|
|
134
157
|
isInvalid: t9,
|
|
@@ -138,50 +161,50 @@ function TokenField(t0) {
|
|
|
138
161
|
multiline: true,
|
|
139
162
|
trailing: trailingIcon,
|
|
140
163
|
variant,
|
|
141
|
-
children:
|
|
164
|
+
children: t12
|
|
142
165
|
});
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
} else
|
|
154
|
-
let
|
|
155
|
-
if ($[
|
|
156
|
-
|
|
166
|
+
$[14] = floatingLabel;
|
|
167
|
+
$[15] = label;
|
|
168
|
+
$[16] = leadingIcon;
|
|
169
|
+
$[17] = populated;
|
|
170
|
+
$[18] = props$1.isDisabled;
|
|
171
|
+
$[19] = t12;
|
|
172
|
+
$[20] = t9;
|
|
173
|
+
$[21] = trailingIcon;
|
|
174
|
+
$[22] = variant;
|
|
175
|
+
$[23] = t13;
|
|
176
|
+
} else t13 = $[23];
|
|
177
|
+
let t14;
|
|
178
|
+
if ($[24] !== description || $[25] !== error || $[26] !== errorId) {
|
|
179
|
+
t14 = /* @__PURE__ */ jsx(FieldMessage, {
|
|
157
180
|
description,
|
|
158
181
|
error,
|
|
159
182
|
errorId
|
|
160
183
|
});
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
} else
|
|
166
|
-
let
|
|
167
|
-
if ($[
|
|
168
|
-
|
|
184
|
+
$[24] = description;
|
|
185
|
+
$[25] = error;
|
|
186
|
+
$[26] = errorId;
|
|
187
|
+
$[27] = t14;
|
|
188
|
+
} else t14 = $[27];
|
|
189
|
+
let t15;
|
|
190
|
+
if ($[28] !== T0 || $[29] !== describedBy || $[30] !== props$1 || $[31] !== t13 || $[32] !== t14 || $[33] !== t6 || $[34] !== t7) {
|
|
191
|
+
t15 = /* @__PURE__ */ jsxs(T0, {
|
|
169
192
|
...props$1,
|
|
170
193
|
"aria-describedby": describedBy,
|
|
171
194
|
onChange: t6,
|
|
172
195
|
...t7,
|
|
173
|
-
children: [
|
|
196
|
+
children: [t13, t14]
|
|
174
197
|
});
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
} else
|
|
184
|
-
return
|
|
198
|
+
$[28] = T0;
|
|
199
|
+
$[29] = describedBy;
|
|
200
|
+
$[30] = props$1;
|
|
201
|
+
$[31] = t13;
|
|
202
|
+
$[32] = t14;
|
|
203
|
+
$[33] = t6;
|
|
204
|
+
$[34] = t7;
|
|
205
|
+
$[35] = t15;
|
|
206
|
+
} else t15 = $[35];
|
|
207
|
+
return t15;
|
|
185
208
|
}
|
|
186
209
|
export { TokenField as default };
|
|
187
210
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","useId","useLayoutEffect","useRef","useState","TokenField","RACTokenField","chipLabel","chipStyles","fieldStyles","invalidFrom","focus","mergeStatefulStyles","styles","token","kXLuUW","$$css","className","description","error","floatingLabel","label","leadingIcon","renderToken","segment","trailingIcon","variant","changeHandler","setHeld","value","onChange","isPopulated","undefined","segments","some","text","length","tokenClassName","isSelected","props","base","ring","selected","unselected","tokenContent","t0","$","t1","t2","held","defaultValue","populated","errorId","t3","invalid","describedBy","filter","Boolean","join","area","t4","t5","current","setAttribute","removeAttribute","T0","t6","t7","root","t8","isDisabled","t9","t10","Symbol","for","0","1","t11","t12","t13","t14","t15","t16","RACToken","RACTokenInput"],"sources":["../../../src/components/token-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TokenFieldProps as RACTokenFieldProps, TokenInputProps as RACTokenInputProps, TokenRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useId, useLayoutEffect, useRef, useState } from 'react';\nimport { Token as RACToken, TokenField as RACTokenField, TokenInput as RACTokenInput, TokenFieldValue } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { chipLabel } from '../../chip';\nimport { chipStyles } from '../../chip/styles';\nimport { FieldBox, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom } from '../../field/root';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, typography } from '../../tokens/design.tokens.stylex';\n\n// The chips page's input chips inside a text field: a field whose value is\n// text with pills in it — a tag input, a mention field, a structured search\n// box. The box, label, supporting line and error are the field chrome in\n// `src/field`, shared with every other field; the pill is the chip module's\n// in `src/chip`, shared with Chip and ChipGroup. What is here is React Aria's\n// `TokenField` around them.\n//\n// The value is React Aria's `TokenFieldValue`, a list of text and token\n// segments rather than a string, and this component does not wrap it. What\n// counts as a token is the whole question a token field exists to answer — a\n// hash tag, an @ mention, a chosen contact — and a wrapper would be a second\n// place to decide it. The class is re-exported from the package so a call\n// site can subclass it and override `tokenize`.\n//\n// Three things are worth knowing.\n//\n// **The editable area is not an input.** React Aria draws a contenteditable\n// element, since a token cannot live inside an `<input>`. So the box is drawn\n// `multiline` and grows with what it holds, and the chrome is told whether it\n// is populated rather than reading an input's value — a token field is the\n// third control the chrome cannot ask, after a select and a picker.\n//\n// **The box's whole height is the editable area.** A press anywhere in the\n// box has to put the caret in the text, so the box is not covered by a press\n// target the way Select's is; React Aria's own element fills the control's\n// place and takes the press.\n//\n// **A token is drawn by the call site, or by this.** `renderToken` takes a\n// segment and returns what the pill holds; without it the pill holds the\n// segment's own text. Either way the pill is the page's, so a token here and\n// a chip elsewhere cannot drift.\n\n// A token's pill is 32dp tall inside a body line of 24, so the control's\n// line makes room for it or the pills overlap once the value wraps. Stated\n// once because the control's floor and its line have to agree, and the\n// clearance under the label is measured from it.\nconst TOKEN_LINE = '32px';\nconst styles = {\n token: {\n kXLuUW: \"xxymvpz\",\n $$css: true\n }\n};\ntype TokenFieldProps<T extends TokenFieldValue = TokenFieldValue> = {\n /** A function may compute the class from the field's render state. */\n className?: RACTokenFieldProps<T>['className'];\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message and the red underline both\n * follow from it.\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 sits in the empty box and floats to the top once the\n * field is focused or holds something. `false` keeps it small at the top in\n * every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * What the field is for. Required rather than optional: a field with no\n * label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * What each token holds. Given a segment, return what to draw inside its\n * pill; without it the pill holds the segment's own text.\n */\n renderToken?: (segment: TokenSegment) => ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACTokenFieldProps<T>['style'];\n /**\n * An icon at the end of the box, after the value: the page's 24dp trailing\n * icon, in the muted role and the error role once the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n */\n trailingIcon?: ReactNode;\n /**\n * The filled box, or the outlined one, as the text fields page draws them.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACTokenFieldProps<T>, 'children' | 'className' | 'style'>;\n\n// One token, as React Aria hands it to the editable area's render function.\n// Taken from that prop rather than imported, since the type lives in\n// `react-stately`, which this package does not depend on directly.\ntype TokenSegment = Parameters<RACTokenInputProps['children']>[0];\n\n// Keeps the mirrored copy in step and then hands the change on to the call\n// site. Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its input.\nfunction changeHandler<T extends TokenFieldValue>(setHeld: (value: T) => void, onChange: ((value: T) => void) | undefined) {\n return (value: T) => {\n setHeld(value);\n onChange?.(value);\n };\n}\n\n// Whether the field holds anything, for the floating label. A token field's\n// editable area is a contenteditable element rather than an input, so the\n// chrome cannot read a value off it and is told instead.\nfunction isPopulated(value: TokenFieldValue | undefined) {\n if (value === undefined) {\n return undefined;\n }\n return value.segments.some(segment => segment.text.length > 0);\n}\n\n// What each token draws. Built by a call rather than written inline at the\n// prop, which is what react-perf's no-new-function-as-prop is after; the\n// React Compiler memoises the result on its input.\n// A token is the chip it looks like: unselected at rest, and the selected\n// chip — Material's selected input chip — once the selection covers it. A\n// click selects the whole token, since React Aria gives it\n// `user-select: all`, and so does the keyboard's selection running across\n// it; either way it is the token Backspace removes next, and this is what\n// says so.\nfunction tokenClassName({\n isSelected\n}: TokenRenderProps) {\n return stylex.props(chipStyles.base, focus.ring, isSelected ? chipStyles.selected : chipStyles.unselected, styles.token).className ?? '';\n}\nfunction tokenContent(renderToken: TokenFieldProps['renderToken']) {\n return (segment: TokenSegment) => <RACToken className={tokenClassName}>\n {chipLabel(renderToken === undefined ? segment.text : renderToken(segment))}\n </RACToken>;\n}\n\n/**\n * A labelled field whose value is text with inline tokens — a tag input, a\n * mention field, a structured search box. Its value is React Aria's\n * `TokenFieldValue`: pass `value` with `onChange` to control it, or\n * `defaultValue` to let it keep its own.\n *\n * ```tsx\n * const [value, setValue] = useState(new TokenFieldValue([]))\n *\n * <TokenField label=\"Label\" onChange={setValue} value={value} />\n * ```\n *\n * What counts as a token is the call site's: subclass `TokenFieldValue` and\n * override `tokenize`, which the package re-exports for that. `renderToken`\n * decides what each pill holds; without it, the segment's own text.\n *\n * The box, label, supporting line and error are the field chrome in\n * `src/field`, and the pill is the chip module's, shared with Chip and\n * ChipGroup.\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 TokenField<T extends TokenFieldValue = TokenFieldValue>({\n description,\n error,\n floatingLabel = true,\n label,\n leadingIcon,\n renderToken,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TokenFieldProps<T>) {\n // A copy of what the field holds, kept only so the label can float from\n // it. React Aria's token field reports `isDisabled` and `isReadOnly`\n // through its render props and not its value, and it hands its state down\n // a context of its own that nothing outside the module can read — so an\n // uncontrolled field has no other way to say what it is holding now.\n //\n // This mirrors rather than controls: `defaultValue` still goes through, so\n // React Aria keeps owning the value and the editing it does with it. A\n // controlled field is read straight off the prop, which already moves.\n const [held, setHeld] = useState(props.defaultValue);\n const populated = isPopulated(props.value ?? held);\n\n // The error, said to a screen reader. React Aria's token field wires up a\n // description slot and no error one, so it generates no error id and its\n // editable area is never told the message exists. The field names the\n // message itself and adds it to the area's `aria-describedby`, which React\n // Aria merges with the description's id and with any the call site passed.\n //\n // `aria-invalid` cannot take the same road: the token input filters it out\n // of the props it is given, so it is written onto the area once React Aria\n // has drawn it, and taken off again when the error goes.\n const errorId = useId();\n const invalid = invalidFrom(error) === true;\n const describedBy = [props['aria-describedby'], invalid ? errorId : undefined].filter(Boolean).join(' ') || undefined;\n const area = useRef<HTMLDivElement>(null);\n useLayoutEffect(() => {\n if (invalid) {\n area.current?.setAttribute('aria-invalid', 'true');\n } else {\n area.current?.removeAttribute('aria-invalid');\n }\n }, [invalid]);\n return <RACTokenField<T> {...props} aria-describedby={describedBy} onChange={changeHandler(setHeld, props.onChange)} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // React Aria's `TextField` hands its group the field's disabled and\n // invalid state through context; its `TokenField` does not, so the\n // box is told outright or its label and its underline never turn.\n isDisabled={props.isDisabled} isInvalid={invalidFrom(error)} isPopulated={populated} label={label} leading={leadingIcon} multiline trailing={trailingIcon} variant={variant}>\n <RACTokenInput<T> ref={area} {...{\n 0: {\n className: \"x9f619 x139gbkf x1lliihq x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xcgk4ki x21xpn4 x1t137rt x126k92a\"\n },\n 1: {\n className: \"x9f619 x139gbkf x1lliihq x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xcgk4ki x1t137rt x126k92a xhm3zzy xczxdwi\"\n }\n }[!!(variant === 'filled') << 0]}>\n {tokenContent(renderToken)}\n </RACTokenInput>\n </FieldBox>\n <FieldMessage description={description} error={error} errorId={errorId} />\n </RACTokenField>;\n}\nexport type { TokenFieldProps, TokenSegment };\nexport default TokenField;"],"mappings":";;;;;;;;;;;;;AAsDA,MAAMc,SAAS,EACbC,OAAO;CACLC,QAAQ;CACRC,OAAO;AACT,EACF;AAkEA,SAASW,cAAyCC,SAA6BE,UAA4C;CACzH,QAAQD,UAAa;EACnBD,QAAQC,KAAK;EACbC,WAAWD,KAAK;CAClB;AACF;AAKA,SAASE,YAAYF,OAAoC;CACvD,IAAIA,UAAUG,KAAAA,GACZ;CAEF,OAAOH,MAAMI,SAASC,MAAKV,YAAWA,QAAQW,KAAKC,SAAS,CAAC;AAC/D;AAWA,SAASC,eAAe,EACtBC,cACmB;CACnB,OAAOtC,MAAaQ,WAAWgC,MAAM7B,MAAM8B,MAAMH,aAAa9B,WAAWkC,WAAWl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MAAAP;EAAAO,EAAA,MAAAkC;EAAAlC,EAAA,MAAAmC;EAAAnC,EAAA,MAAAoB;EAAApB,EAAA,MAAAqB;EAAArB,EAAA,MAAAoC;CAAA,OAAAA,MAAApC,EAAA;CAAA,OAlBXoC;AAkBW"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","useId","useLayoutEffect","useRef","useState","TokenField","RACTokenField","chipLabel","chipStyles","fieldStyles","invalidFrom","fieldChromeStyles","focus","mergeStatefulStyles","styles","input","kB7OPa","kMwMTN","k1xSpc","kMv6JI","kGuDYH","k63SB2","kzqmXN","kb6lSQ","kLWn49","kAzted","k3XXqK","khDVqt","$$css","inputUnderLabel","kLKAdn","token","kXLuUW","className","description","error","floatingLabel","label","leadingIcon","renderToken","segment","trailingIcon","variant","changeHandler","setHeld","value","onChange","inputClassName","isDisabled","props","inputDisabled","isPopulated","undefined","segments","some","text","length","tokenClassName","isSelected","base","ring","selected","unselected","disabled","disabledSelected","disabledUnselected","tokenContent","t0","$","t1","t2","held","defaultValue","populated","errorId","t3","invalid","describedBy","filter","Boolean","join","area","t4","t5","current","setAttribute","removeAttribute","T0","t6","t7","root","t8","t9","t10","t11","t12","t13","t14","t15","RACToken","RACTokenInput"],"sources":["../../../src/components/token-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TokenFieldProps as RACTokenFieldProps, TokenInputProps as RACTokenInputProps, TokenInputRenderProps, TokenRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useId, useLayoutEffect, useRef, useState } from 'react';\nimport { Token as RACToken, TokenField as RACTokenField, TokenInput as RACTokenInput, TokenFieldValue } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { chipLabel } from '../../chip';\nimport { chipStyles } from '../../chip/styles';\nimport { FieldBox, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom } from '../../field/root';\nimport { fieldChromeStyles } from '../../field/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, typography } from '../../tokens/design.tokens.stylex';\n\n// The chips page's input chips inside a text field: a field whose value is\n// text with pills in it — a tag input, a mention field, a structured search\n// box. The box, label, supporting line and error are the field chrome in\n// `src/field`, shared with every other field; the pill is the chip module's\n// in `src/chip`, shared with Chip and ChipGroup. What is here is React Aria's\n// `TokenField` around them.\n//\n// The value is React Aria's `TokenFieldValue`, a list of text and token\n// segments rather than a string, and this component does not wrap it. What\n// counts as a token is the whole question a token field exists to answer — a\n// hash tag, an @ mention, a chosen contact — and a wrapper would be a second\n// place to decide it. The class is re-exported from the package so a call\n// site can subclass it and override `tokenize`.\n//\n// Three things are worth knowing.\n//\n// **The editable area is not an input.** React Aria draws a contenteditable\n// element, since a token cannot live inside an `<input>`. So the box is drawn\n// `multiline` and grows with what it holds, and the chrome is told whether it\n// is populated rather than reading an input's value — a token field is the\n// third control the chrome cannot ask, after a select and a picker.\n//\n// **The box's whole height is the editable area.** A press anywhere in the\n// box has to put the caret in the text, so the box is not covered by a press\n// target the way Select's is; React Aria's own element fills the control's\n// place and takes the press.\n//\n// **A token is drawn by the call site, or by this.** `renderToken` takes a\n// segment and returns what the pill holds; without it the pill holds the\n// segment's own text. Either way the pill is the page's, so a token here and\n// a chip elsewhere cannot drift.\n//\n// Disabled, the text takes the colour a disabled TextField's value does,\n// the chrome's `inputDisabled`, and each token the disabled chip's content\n// colour and outline, so the value fades with the label and the box. Both\n// name `GrayText` under forced colours, since the mode greys a native\n// disabled control by itself and neither is one.\n\n// A token's pill is 32dp tall inside a body line of 24, so the control's\n// line makes room for it or the pills overlap once the value wraps. Stated\n// once because the control's floor and its line have to agree, and the\n// clearance under the label is measured from it.\nconst TOKEN_LINE = '32px';\nconst styles = {\n input: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x1lliihq\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kzqmXN: \"xh8yej3\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xcgk4ki\",\n kAzted: \"x21xpn4\",\n k3XXqK: \"x1t137rt\",\n khDVqt: \"x126k92a\",\n $$css: true\n },\n inputUnderLabel: {\n kAzted: \"xhm3zzy\",\n kLKAdn: \"xczxdwi\",\n $$css: true\n },\n token: {\n kXLuUW: \"xxymvpz\",\n $$css: true\n }\n};\ntype TokenFieldProps<T extends TokenFieldValue = TokenFieldValue> = {\n /** A function may compute the class from the field's render state. */\n className?: RACTokenFieldProps<T>['className'];\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message and the red underline both\n * follow from it.\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 sits in the empty box and floats to the top once the\n * field is focused or holds something. `false` keeps it small at the top in\n * every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * What the field is for. Required rather than optional: a field with no\n * label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * What each token holds. Given a segment, return what to draw inside its\n * pill; without it the pill holds the segment's own text.\n */\n renderToken?: (segment: TokenSegment) => ReactNode;\n /** A function may compute the style from the field's render state. */\n style?: RACTokenFieldProps<T>['style'];\n /**\n * An icon at the end of the box, after the value: the page's 24dp trailing\n * icon, in the muted role and the error role once the field has an error.\n * An icon drawn in `em` takes that size from the slot.\n */\n trailingIcon?: ReactNode;\n /**\n * The filled box, or the outlined one, as the text fields page draws them.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACTokenFieldProps<T>, 'children' | 'className' | 'style'>;\n\n// One token, as React Aria hands it to the editable area's render function.\n// Taken from that prop rather than imported, since the type lives in\n// `react-stately`, which this package does not depend on directly.\ntype TokenSegment = Parameters<RACTokenInputProps['children']>[0];\n\n// Keeps the mirrored copy in step and then hands the change on to the call\n// site. Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its input.\nfunction changeHandler<T extends TokenFieldValue>(setHeld: (value: T) => void, onChange: ((value: T) => void) | undefined) {\n return (value: T) => {\n setHeld(value);\n onChange?.(value);\n };\n}\n\n// The editable area's class, from its render state. Built by a call rather\n// than written inline at the prop, for the reason `changeHandler` gives.\nfunction inputClassName(variant: FieldVariant) {\n return ({\n isDisabled\n }: TokenInputRenderProps) => stylex.props(styles.input, variant === 'filled' && styles.inputUnderLabel, isDisabled && fieldChromeStyles.inputDisabled).className ?? '';\n}\n\n// Whether the field holds anything, for the floating label. A token field's\n// editable area is a contenteditable element rather than an input, so the\n// chrome cannot read a value off it and is told instead.\nfunction isPopulated(value: TokenFieldValue | undefined) {\n if (value === undefined) {\n return undefined;\n }\n return value.segments.some(segment => segment.text.length > 0);\n}\n\n// What each token draws. Built by a call rather than written inline at the\n// prop, which is what react-perf's no-new-function-as-prop is after; the\n// React Compiler memoises the result on its input.\n// A token is the chip it looks like: unselected at rest, and the selected\n// chip — Material's selected input chip — once the selection covers it. A\n// click selects the whole token, since React Aria gives it\n// `user-select: all`, and so does the keyboard's selection running across\n// it; either way it is the token Backspace removes next, and this is what\n// says so.\n// Disabled comes last so it wins, since StyleX replaces a property whole.\nfunction tokenClassName({\n isDisabled,\n isSelected\n}: TokenRenderProps) {\n return stylex.props(chipStyles.base, focus.ring, isSelected ? chipStyles.selected : chipStyles.unselected, styles.token, isDisabled && chipStyles.disabled, isDisabled && (isSelected ? chipStyles.disabledSelected : chipStyles.disabledUnselected)).className ?? '';\n}\nfunction tokenContent(renderToken: TokenFieldProps['renderToken']) {\n return (segment: TokenSegment) => <RACToken className={tokenClassName}>\n {chipLabel(renderToken === undefined ? segment.text : renderToken(segment))}\n </RACToken>;\n}\n\n/**\n * A labelled field whose value is text with inline tokens — a tag input, a\n * mention field, a structured search box. Its value is React Aria's\n * `TokenFieldValue`: pass `value` with `onChange` to control it, or\n * `defaultValue` to let it keep its own.\n *\n * ```tsx\n * const [value, setValue] = useState(new TokenFieldValue([]))\n *\n * <TokenField label=\"Label\" onChange={setValue} value={value} />\n * ```\n *\n * What counts as a token is the call site's: subclass `TokenFieldValue` and\n * override `tokenize`, which the package re-exports for that. `renderToken`\n * decides what each pill holds; without it, the segment's own text.\n *\n * The box, label, supporting line and error are the field chrome in\n * `src/field`, and the pill is the chip module's, shared with Chip and\n * ChipGroup.\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 TokenField<T extends TokenFieldValue = TokenFieldValue>({\n description,\n error,\n floatingLabel = true,\n label,\n leadingIcon,\n renderToken,\n trailingIcon,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & TokenFieldProps<T>) {\n // A copy of what the field holds, kept only so the label can float from\n // it. React Aria's token field reports `isDisabled` and `isReadOnly`\n // through its render props and not its value, and it hands its state down\n // a context of its own that nothing outside the module can read — so an\n // uncontrolled field has no other way to say what it is holding now.\n //\n // This mirrors rather than controls: `defaultValue` still goes through, so\n // React Aria keeps owning the value and the editing it does with it. A\n // controlled field is read straight off the prop, which already moves.\n const [held, setHeld] = useState(props.defaultValue);\n const populated = isPopulated(props.value ?? held);\n\n // The error, said to a screen reader. React Aria's token field wires up a\n // description slot and no error one, so it generates no error id and its\n // editable area is never told the message exists. The field names the\n // message itself and adds it to the area's `aria-describedby`, which React\n // Aria merges with the description's id and with any the call site passed.\n //\n // `aria-invalid` cannot take the same road: the token input filters it out\n // of the props it is given, so it is written onto the area once React Aria\n // has drawn it, and taken off again when the error goes.\n const errorId = useId();\n const invalid = invalidFrom(error) === true;\n const describedBy = [props['aria-describedby'], invalid ? errorId : undefined].filter(Boolean).join(' ') || undefined;\n const area = useRef<HTMLDivElement>(null);\n useLayoutEffect(() => {\n if (invalid) {\n area.current?.setAttribute('aria-invalid', 'true');\n } else {\n area.current?.removeAttribute('aria-invalid');\n }\n }, [invalid]);\n return <RACTokenField<T> {...props} aria-describedby={describedBy} onChange={changeHandler(setHeld, props.onChange)} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // React Aria's `TextField` hands its group the field's disabled and\n // invalid state through context; its `TokenField` does not, so the\n // box is told outright or its label and its underline never turn.\n isDisabled={props.isDisabled} isInvalid={invalidFrom(error)} isPopulated={populated} label={label} leading={leadingIcon} multiline trailing={trailingIcon} variant={variant}>\n <RACTokenInput<T> className={inputClassName(variant)} ref={area}>\n {tokenContent(renderToken)}\n </RACTokenInput>\n </FieldBox>\n <FieldMessage description={description} error={error} errorId={errorId} />\n </RACTokenField>;\n}\nexport type { TokenFieldProps, TokenSegment };\nexport default TokenField;"],"mappings":";;;;;;;;;;;;;;AA6DA,MAAMe,SAAS;CACbC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,iBAAiB;EACfJ,QAAQ;EACRK,QAAQ;EACRF,OAAO;CACT;CACAG,OAAO;EACLC,QAAQ;EACRJ,OAAO;CACT;AACF;AAkEA,SAASe,cAAyCC,SAA6BE,UAA4C;CACzH,QAAQD,UAAa;EACnBD,QAAQC,KAAK;EACbC,WAAWD,KAAK;CAClB;AACF;AAIA,SAASE,eAAeL,SAAuB;CAC7C,QAAQ,EACNM,iBAC2BhD,MAAac,OAAOC,OAAO2B,YAAY,YAAY5B,OAAOe,iBAAiBmB,cAAcrC,kBAAkBuC,aAAa,CAAC,CAACjB,aAAa;AACtK;AAKA,SAASkB,YAAYN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QAAAoB,MAAApB,EAAA,QAAAqB,IAAA;EAVvES,MAAA,qBAAC,IAAD;GAAc,GAAQjD;GAAyB4B,oBAAAA;GAAuB,UAAAW;GAAsC,GAAMC;GAAlH,UAAA,CACHO,KASAC,GAViB;;EAWH7B,EAAA,MAAAmB;EAAAnB,EAAA,MAAAS;EAAAT,EAAA,MAAAnB;EAAAmB,EAAA,MAAA4B;EAAA5B,EAAA,MAAA6B;EAAA7B,EAAA,MAAAoB;EAAApB,EAAA,MAAAqB;EAAArB,EAAA,MAAA8B;CAAA,OAAAA,MAAA9B,EAAA;CAAA,OAXX8B;AAWW"}
|
|
@@ -45,6 +45,10 @@ type ToolbarTone = 'neutral' | 'vibrant';
|
|
|
45
45
|
*
|
|
46
46
|
* The call site's `className` and `style` land on the container, which is
|
|
47
47
|
* the element a layout positions.
|
|
48
|
+
*
|
|
49
|
+
* Every control keeps its own width. A bar given less room than its controls
|
|
50
|
+
* need — a phone's width, say — stays inside it and scrolls along its length
|
|
51
|
+
* rather than squeezing a control or overflowing the page.
|
|
48
52
|
*/
|
|
49
53
|
declare function Toolbar({ orientation, tone, ...props }: RefAttributes<HTMLDivElement> & ToolbarProps): import("react").JSX.Element;
|
|
50
54
|
export { type ToolbarProps, type ToolbarTone, Toolbar as default };
|