@kanso-labs/kanso-ui 0.44.0 → 0.45.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/README.md +59 -7
- package/dist/chip/index.js +24 -4
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/styles.js +13 -5
- package/dist/chip/styles.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +23 -7
- package/dist/components/app-bar/index.js +428 -169
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +44 -0
- package/dist/components/autocomplete/index.js +44 -0
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/button/index.d.ts +3 -2
- package/dist/components/button/index.js +53 -59
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.d.ts +11 -3
- package/dist/components/card/index.js +23 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.js +66 -58
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +46 -30
- package/dist/components/chip/index.js +38 -17
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +5 -2
- package/dist/components/chip-group/index.js +8 -2
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +27 -0
- package/dist/components/dialog/index.js +107 -69
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +1 -1
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/form/index.d.ts +14 -4
- package/dist/components/form/index.js +6 -3
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +15 -1
- package/dist/components/icon-button/index.js +15 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/link/index.d.ts +4 -0
- package/dist/components/link/index.js +4 -0
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list/index.d.ts +34 -0
- package/dist/components/list/index.js +47 -13
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-detail/index.d.ts +34 -1
- package/dist/components/list-detail/index.js +34 -1
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.d.ts +21 -2
- package/dist/components/list-item/index.js +6 -0
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +6 -3
- package/dist/components/menu/index.js +3 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +4 -0
- package/dist/components/meter/index.js +4 -0
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +14 -2
- package/dist/components/navigation-bar/index.js +14 -2
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +2 -9
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +7 -1
- package/dist/components/number-field/index.js +7 -1
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +15 -1
- package/dist/components/popover/index.js +15 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +8 -1
- package/dist/components/product-icon/index.js +8 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +12 -6
- package/dist/components/progress-indicator/index.js +57 -46
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +7 -0
- package/dist/components/radio-group/index.js +23 -14
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +13 -4
- package/dist/components/search-field/index.js +10 -4
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +2 -0
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +31 -6
- package/dist/components/separator/index.js +30 -6
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +96 -37
- package/dist/components/sheet/index.js +420 -143
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +8 -1
- package/dist/components/snackbar/index.js +7 -0
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/stack/index.d.ts +21 -5
- package/dist/components/stack/index.js +10 -0
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +12 -0
- package/dist/components/switch/index.js +13 -0
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +39 -9
- package/dist/components/text-field/index.js +29 -7
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/time-picker/index.js +37 -41
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/components/tree/index.js +11 -15
- package/dist/components/tree/index.js.map +1 -1
- package/dist/control/index.js +1 -1
- package/dist/control/index.js.map +1 -1
- package/dist/control/styles.js +0 -1
- package/dist/control/styles.js.map +1 -1
- package/dist/field/index.js +148 -139
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +50 -7
- package/dist/field/styles.js.map +1 -1
- package/dist/hooks/useBottomEdge.js +6 -3
- package/dist/hooks/useBottomEdge.js.map +1 -1
- package/dist/hooks/useRipple.js +217 -193
- package/dist/hooks/useRipple.js.map +1 -1
- 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/indicator/styles.js +7 -4
- package/dist/indicator/styles.js.map +1 -1
- package/dist/layout.d.ts +4 -1
- package/dist/layout.js +4 -1
- package/dist/layout.js.map +1 -1
- package/dist/mark/styles.js +11 -5
- package/dist/mark/styles.js.map +1 -1
- package/dist/react-aria.d.ts +2 -2
- package/dist/row/index.js +90 -62
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +8 -2
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/overlay.js +8 -5
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles.css +252 -130
- package/dist/theme-scope.d.ts +14 -2
- package/dist/theme-scope.js +12 -0
- package/dist/theme-scope.js.map +1 -1
- package/package.json +3 -3
- package/dist/overlay/modal.js +0 -7
- package/dist/overlay/modal.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","CalendarDateTime","ZonedDateTime","FocusEvent","PointerEvent","ReactElement","ReactNode","RefAttributes","TimeFieldProps","RACTimeFieldProps","Selection","TimeFieldState","TimeValue","getLocalTimeZone","Time","toCalendarDateTime","today","stylex","useCallback","useContext","useId","useRef","useState","Heading","LabelContext","Modal","ModalOverlay","Button","RACButton","DateInput","RACDateInput","DateSegment","RACDateSegment","Dialog","RACDialog","TimeField","RACTimeField","TimeFieldStateContext","ToggleButton","ToggleButtonGroup","useLocale","useSlottedContext","FieldVariant","FieldBox","FieldMessage","FieldSegments","fieldStyles","invalidFrom","useFieldValidationBehavior","ClockGlyph","KeyboardGlyph","useMessages","InsideModalContext","renderSegment","segmentStyles","mergeStatefulStyles","overlay","picker","triggerClassName","colors","motion","radii","shadows","sizing","spacing","stateLayerOpacity","typography","IconButton","FORCED_COLORS","DIAL","CENTRE","OUTER_RING","INNER_RING","HANDLE","MORNING","AFTERNOON","INVISIBLE","scaleIn","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","DialLabel","isSelected","key","text","x","y","PeriodState","isFocusVisible","isHovered","Segment","Parameters","NonNullable","SegmentState","isFocused","TimePart","TimePickerMode","TimePickerProps","Omit","T","cancelLabel","className","confirmLabel","container","Element","defaultMode","defaultOpen","description","enterTimeLabel","error","floatingLabel","isOpen","label","leadingIcon","onOpenChange","selectTimeLabel","style","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","overModal","ownOpen","setOwnOpen","open","t7","next","changeOpen","t8","openModal","T0","t9","t10","root","t11","isRequired","t12","t13","selectTime","t14","t15","input","t16","t17","t18","scrim","scrimOverModal","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","stylex.props","_c","RACButton","props","RACTimeField","RACDateInput","RACDateSegment","RACDialog","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 { InsideModalContext } from '../../overlay/modal';\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 overModal = useContext(InsideModalContext);\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, overModal && overlay.scrimOverModal, 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 { TimePick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AhH,UAAA;IACHE;IAGAC;IAgCCO;IAiBDc;GArDa;;EAkEHzF,EAAA,MAAAgF;EAAAhF,EAAA,MAAAyF;EAAAzF,EAAA,MAAAS;EAAAT,EAAA,MAAAiE;EAAAjE,EAAA,MAAAmE;EAAAnE,EAAA,OAAAoE;EAAApE,EAAA,OAAA2E;EAAA3E,EAAA,OAAA0F;CAAA,OAAAA,MAAA1F,EAAA;CAAA,OAlEP0F;AAkEO;;;;;AAnOhB,SAAAyF,MAAArM,OAAA;CAAA,OA2M+B,oBAAA,QAAA;EAAuB,kBAAA;EAAqC,YAAA;EAAY,GAAAA,MAAK3B;EAAO,GAAA2B,MAAK1B;EAAE,GAAM;GAAAyN,GACrH,EAAA1M,WACU,sDACb;GAAC2M,GACE,EAAA3M,WACU,uDACb;EACF,EAAE,CAAC,CAACW,MAAK9B,cAAe;EACf8B,UAAAA,MAAK5B;CACD,GATkD4B,MAAK7B,GASvD;AAAA;AAsBnB,SAASuK,gBAAgBrG,QAAgBwF,WAAgC;CACvE,IAAIA,cAAcvG,KAAAA,GAChB,OAAOuG,cAAc;CAEvB,OAAO,IAAI3F,KAAK6B,eAAe1B,QAAQ,EACrC2B,MAAM,UACR,CAAC,CAAC,CAACsI,gBAAgB,CAAC,CAACrI,UAAU;AACjC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","CalendarDateTime","ZonedDateTime","FocusEvent","PointerEvent","ReactElement","ReactNode","RefAttributes","TimeFieldProps","RACTimeFieldProps","Selection","TimeFieldState","TimeValue","getLocalTimeZone","Time","toCalendarDateTime","today","stylex","useCallback","useContext","useId","useRef","useState","Heading","LabelContext","Modal","ModalOverlay","Button","RACButton","DateInput","RACDateInput","DateSegment","RACDateSegment","Dialog","RACDialog","TimeField","RACTimeField","TimeFieldStateContext","ToggleButton","ToggleButtonGroup","useLocale","useSlottedContext","FieldVariant","FieldBox","FieldMessage","FieldSegments","fieldStyles","invalidFrom","useFieldValidationBehavior","ClockGlyph","KeyboardGlyph","useMessages","renderSegment","segmentStyles","mergeStatefulStyles","overlay","picker","triggerClassName","colors","motion","radii","shadows","sizing","spacing","stateLayerOpacity","typography","IconButton","FORCED_COLORS","DIAL","CENTRE","OUTER_RING","INNER_RING","HANDLE","MORNING","AFTERNOON","INVISIBLE","scaleIn","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","DialLabel","isSelected","key","text","x","y","PeriodState","isFocusVisible","isHovered","Segment","Parameters","NonNullable","SegmentState","isFocused","TimePart","TimePickerMode","TimePickerProps","Omit","T","cancelLabel","className","confirmLabel","container","Element","defaultMode","defaultOpen","description","enterTimeLabel","error","floatingLabel","isOpen","label","leadingIcon","onOpenChange","selectTimeLabel","style","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","stylex.props","_c","RACButton","props","RACTimeField","RACDateInput","RACDateSegment","RACDialog","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,MAAMqE,OAAO;AACb,MAAMC,SAASD,OAAO;AACtB,MAAME,aAAa;AACnB,MAAMC,aAAa;AACnB,MAAMC,SAAS;AAIf,MAAMC,UAAU,CAAC,IAAI;AACrB,MAAMC,YAAY,CAAC,IAAI;AAIvB,MAAMC,YAAY;AAElB,MAAME,SAAS;CACbC,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNF,QAAQ;EACRC,OAAO;CACT;CACAE,cAAc;EACZN,QAAQ;EACRO,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRd,QAAQ;EACRe,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRpB,QAAQ;EAC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,CAACnI,UAAU;AACjC"}
|
|
@@ -50,30 +50,26 @@ function chevronFor(state) {
|
|
|
50
50
|
}
|
|
51
51
|
function itemContent(headline, leading, supporting, trailing, selectLabel, ripple) {
|
|
52
52
|
return (state) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(RowContent, {
|
|
53
|
+
chevron: chevronFor(state),
|
|
53
54
|
isDisabled: state.isDisabled,
|
|
54
55
|
isSelected: state.isSelected,
|
|
55
|
-
leading
|
|
56
|
+
leading,
|
|
57
|
+
selection: selectionFor(state, selectLabel),
|
|
56
58
|
supporting,
|
|
57
59
|
trailing,
|
|
58
60
|
children: headline
|
|
59
61
|
}), state.isDisabled ? null : ripple] });
|
|
60
62
|
}
|
|
61
63
|
/**
|
|
62
|
-
* The
|
|
63
|
-
*
|
|
64
|
-
* that includes a promise, and a function inferred as returning one has to
|
|
65
|
-
* be `async`.
|
|
64
|
+
* The selection checkbox, while the tree toggles. The row draws it after the
|
|
65
|
+
* caret and ahead of whatever `leading` holds.
|
|
66
66
|
*/
|
|
67
|
-
function
|
|
68
|
-
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
slot: "selection"
|
|
74
|
-
}) : null,
|
|
75
|
-
leading
|
|
76
|
-
] });
|
|
67
|
+
function selectionFor(state, selectLabel) {
|
|
68
|
+
if (state.selectionBehavior !== "toggle" || state.selectionMode === "none") return null;
|
|
69
|
+
return /* @__PURE__ */ jsx(Checkbox, {
|
|
70
|
+
"aria-label": selectLabel,
|
|
71
|
+
slot: "selection"
|
|
72
|
+
});
|
|
77
73
|
}
|
|
78
74
|
function textValueFor(textValue, headline) {
|
|
79
75
|
if (textValue !== void 0) return textValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","TreeItemProps","RACTreeItemProps","TreeLoadMoreItemProps","RACTreeLoadMoreItemProps","TreeProps","RACTreeProps","TreeItemRenderProps","stylex","createContext","useContext","Button","RACButton","Tree","RACTree","TreeHeader","RACTreeHeader","TreeItem","RACTreeItem","TreeItemContent","RACTreeItemContent","TreeLoadMoreItem","RACTreeLoadMoreItem","TreeSection","RACTreeSection","CollectionLoadMore","collectionStyles","containerClasses","rowItemStyles","ChevronEndGlyph","useRipple","RowContent","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","Checkbox","RACTreeSectionProps","Parameters","T","SelectLabelContext","undefined","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","indent","kZCmMZ","TreeHeaderProps","children","Omit","TreeItemText","className","leading","style","supporting","trailing","headline","textValue","TreeLoadMoreProps","label","selectionBehavior","selectLabel","TreeSectionProps","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","ripple","isDisabled","isSelected","leadingFor","selects","selectionMode","textValueFor","t0","$","T0","T1","t1","t2","t3","t4","t5","t6","Symbol","for","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","handlers","surface","t7","TreeLoadMore","loading","section","Item","LoadMore","Section","stylex.props","RACButton","Tree","_c","RACTree","TreeHeader","RACTreeHeader","TreeItem","RACTreeItem","RACTreeItemContent","props","RACTreeLoadMoreItem","TreeSection","RACTreeSection"],"sources":["../../../src/components/tree/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TreeItemProps as RACTreeItemProps, TreeLoadMoreItemProps as RACTreeLoadMoreItemProps, TreeProps as RACTreeProps, TreeItemRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Button as RACButton, Tree as RACTree, TreeHeader as RACTreeHeader, TreeItem as RACTreeItem, TreeItemContent as RACTreeItemContent, TreeLoadMoreItem as RACTreeLoadMoreItem, TreeSection as RACTreeSection } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles, containerClasses, rowItemStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\n\n// A list whose rows nest. Each row is the row every list here draws —\n// `src/row`, shared with ListItem, ListBox, List and Disclosure — so its\n// 56dp floor, body-large headline, body-medium supporting line, state layers\n// and disabled treatment are that module's, and a tree beside a list cannot\n// drift from it.\n//\n// The lists page gives no nesting: it draws one flat list. So the two things\n// a tree adds beyond that row are the library's own, and both are written\n// here with their reasons. The rest — the row, the selection colours, the\n// checkbox — is the page's, through the shared module.\n//\n// Four things are this component's own.\n//\n// **A level indents by one chevron's width.** React Aria puts the depth on\n// each row as a custom property, so the inset is one `calc` against the\n// row's own inline padding rather than a style per level. 24dp is the size\n// the menus page gives that glyph, which makes a level of nesting exactly as\n// wide as the caret that opens it.\n//\n// **The caret is a button, and React Aria names it.** A `slot=\"chevron\"`\n// button is what expands and collapses; React Aria labels it Expand or\n// Collapse and composes that with the row, so nothing here names it. It is\n// drawn only on a row that has children, since a caret on a leaf says the\n// row opens when it does not.\n//\n// **A selecting tree draws a checkbox, before whatever the row was given.**\n// Same rule as List: React Aria reports the mode on each row, so a tree that\n// toggles draws one without the call site repeating it, and it always sits\n// in the same place so a column of rows reads down.\n//\n// **`TreeItemContent` has no class to style.** React Aria renders it as a\n// `display: contents` gridcell with nothing on it, so the row's own layout\n// is drawn by what goes inside rather than by that wrapper.\n\n// `TreeSection`'s props are not re-exported from the package index, only its\n// component is — so the type is taken off the component rather than imported\n// by a name that is not there to import.\ntype RACTreeSectionProps<T> = Parameters<typeof RACTreeSection<T>>[0];\n\n// What each row's selection checkbox is called. A context rather than a prop\n// on the row, since it is the tree's decision and repeating it per row is\n// how the two drift. Undefined unless the tree is given one, which leaves\n// the name React Aria gives in the reader's locale.\nconst SelectLabelContext = createContext<string | undefined>(undefined);\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype TreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype TreeItemProps<T extends object = object> = Omit<RACTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & TreeItemText & {\n /** The rows nested under this one, as further `Tree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACTreeItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACTreeItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as a count or a control. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a tree row wraps\n// its headline in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string headline is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype TreeItemText = {\n /** The row's headline — the one thing it is mostly about. */\n headline: string;\n /** What typeahead matches the row on. Defaults to the headline. */\n textValue?: string;\n} | {\n /** The row's headline, as something other than a plain string. */\n headline?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype TreeLoadMoreProps = Omit<RACTreeLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype TreeProps<T extends object = object> = {\n /** A function may compute the class from the tree's render state. */\n className?: RACTreeProps<T>['className'];\n /**\n * How a press selects. `toggle` draws a checkbox on every row, and a press\n * adds that row to the selection or takes it out. `replace` draws none, a\n * press makes that row the selection, and the arrow keys carry the\n * selection with the focus; where rows also take an action, a click\n * selects and a double click acts. Left out, a `single` tree replaces and\n * any other toggles, since a single choice drawn as checkboxes unticks one\n * box whenever another is ticked.\n */\n selectionBehavior?: RACTreeProps<T>['selectionBehavior'];\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * Left out, React Aria names it in the reader's locale — \"Select\" in\n * English.\n */\n selectLabel?: string;\n /** A function may compute the style from the tree's render state. */\n style?: RACTreeProps<T>['style'];\n} & Omit<RACTreeProps<T>, 'className' | 'selectionBehavior' | 'style'>;\ntype TreeSectionProps<T extends object = object> = Omit<RACTreeSectionProps<T>, 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its headline lines up with\n// the headline of a sibling that opens.\nfunction chevronFor(state: TreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then the selection checkbox, then whatever the row was given — one order,\n// always, which is what keeps a column of rows reading down.\nfunction itemContent(headline: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, selectLabel: string | undefined, ripple: ReactNode) {\n return (state: TreeItemRenderProps): ReactNode => <>\n <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leadingFor(state, leading, selectLabel)} supporting={supporting} trailing={trailing}>\n {headline}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the selected container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled row, so nothing has to outrank them.\n//\n// A supporting line moves the row from the page's one-line container height\n// to its two-line one, which is a floor rather than something the row's own\n// box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as an\n// argument rather than read from the render state, since React Aria reports\n// what a row is doing and not what it holds; the row is built by a call for\n// the same reason `itemContent` is.\n/**\n * The caret, the selection checkbox, then whatever the row was given. Its\n * return type is written out rather than inferred: `ReactNode` is a union\n * that includes a promise, and a function inferred as returning one has to\n * be `async`.\n */\nfunction leadingFor(state: TreeItemRenderProps, leading: ReactNode, selectLabel: string | undefined): ReactNode {\n const selects = state.selectionBehavior === 'toggle' && state.selectionMode !== 'none';\n return <>\n {chevronFor(state)}\n {selects ? <Checkbox aria-label={selectLabel} slot=\"selection\" /> : null}\n {leading}\n </>;\n}\n\n// What React Aria matches typeahead on, and what names the row. `TreeItemText`\n// makes one of the two a string, so the last branch is unreachable through the\n// public type — it is there because destructuring the two apart is what loses\n// the narrowing, not because a row can arrive without either.\nfunction textValueFor(textValue: string | undefined, headline: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof headline === 'string' ? headline : '';\n}\n\n/**\n * A list whose rows nest. Which rows are open is React Aria's: pass\n * `expandedKeys` with `onExpandedChange` to control it, or\n * `defaultExpandedKeys` to let it keep its own. Selection is React Aria's\n * too — set `selectionMode` to `single` or `multiple`. A `multiple` tree\n * draws a checkbox on every row and a `single` one draws none, as a `List`\n * does; `selectionBehavior` overrides either.\n *\n * ```tsx\n * <Tree aria-label=\"Label\">\n * <Tree.Item headline=\"First item\" id=\"first\">\n * <Tree.Item headline=\"Second item\" id=\"second\" />\n * </Tree.Item>\n * </Tree>\n * ```\n *\n * Each row is the row every list here draws, indented by its depth, with a\n * caret on the rows that have children. Name the tree with `aria-label` or\n * `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction Tree<T extends object>({\n selectionBehavior,\n selectLabel,\n ...props\n}: RefAttributes<HTMLDivElement> & TreeProps<T>) {\n return <SelectLabelContext value={selectLabel}>\n <RACTree<T> {...props} {...mergeStatefulStyles(containerClasses, props)}\n // React Aria's own default is `toggle` in every mode. Read with `??`\n // rather than placed before the spread, so a wrapper forwarding an\n // unset prop still gets the default.\n selectionBehavior={selectionBehavior ?? (props.selectionMode === 'single' ? 'replace' : 'toggle')} />\n </SelectLabelContext>;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction TreeHeader({\n children\n}: TreeHeaderProps) {\n return <RACTreeHeader {...stylex.props(collectionStyles.header)}>\n {children}\n </RACTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Its slots are the row's: `leading`, the\n * `headline`, `supporting` under it, and `trailing`. Give every row an `id`\n * — that is the key selection and expansion are reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret. `textValue` is what typeahead matches on, and is\n * taken from a plain-string headline when it is not given.\n */\nfunction TreeItem<T extends object = object>({\n children,\n headline,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n supporting,\n textValue,\n trailing,\n ...props\n}: RefAttributes<HTMLDivElement> & TreeItemProps<T>) {\n const selectLabel = useContext(SelectLabelContext);\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACTreeItem<T> textValue={textValueFor(textValue, headline)} {...ripple.handlers} {...props} {...mergeStatefulStyles(\n // No overline: a tree row takes the list variant's metrics because it\n // looks like a list row, but it follows its own page, and that page\n // gives a headline and a supporting line. The three-line item belongs\n // to the lists page, which `List.Item` and `ListBox.Item` draw.\n rowItemStyles(supporting, undefined, styles.indent), props)}>\n <RACTreeItemContent>\n {itemContent(headline, leading, supporting, trailing, selectLabel, ripple.surface)}\n </RACTreeItemContent>\n {children}\n </RACTreeItem>;\n}\n\n/**\n * The row the tree shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`.\n */\nfunction TreeLoadMore({\n label,\n ...props\n}: RefAttributes<HTMLDivElement> & TreeLoadMoreProps) {\n return <RACTreeLoadMoreItem {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.loading), props)}>\n <CollectionLoadMore diameter=\"24px\" label={label} />\n </RACTreeLoadMoreItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction TreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: TreeSectionProps<T>) {\n return <RACTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <TreeHeader>{header}</TreeHeader>}\n {children}\n </RACTreeSection>;\n}\nTree.Item = TreeItem;\nTree.LoadMore = TreeLoadMore;\nTree.Section = TreeSection;\nexport type { TreeItemProps, TreeLoadMoreProps, TreeProps, TreeSectionProps };\nexport { TreeItem, TreeLoadMore, TreeSection };\nexport default Tree;"],"mappings":";;;;;;;;;;;;;;;AA6DA,MAAM8C,qBAAqBlC,cAAkCmC,KAAAA,CAAS;AACtE,MAAMC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRF,OAAO;CACT;AACF;AAoFA,SAASoB,mBAAmB;CAC1B,OAAOtE,MAAaqC,OAAOC,SAASd,MAAMgD,IAAI,CAAC,CAACf,aAAa;AAC/D;AASA,SAASgB,WAAWC,OAAuC;CACzD,IAAI,CAACA,MAAMC,eACT,OAAO,oBAAC,QAAD,EAAM,WAAU,0BAAyB,CAAA;CAElD,OAAO,oBAACqC,QAAD;EAAW,WAAW1C;EAAkB,MAAK;EAChD,UAAA,oBAAC,iBAAD,EAAiB,GAAI;GACrB,GAAG,EACDb,WAAW,qEACb;GACA,GAAG,EACDA,WAAW,qEACb;EACF,EAAE,CAAC,CAACiB,MAAME,cAAc,GAAG,CAAA;CAChB,CAAA;AACf;AAKA,SAASC,YAAYf,UAAqBJ,SAAoBE,YAAuBC,UAAqBM,aAAiCW,QAAmB;CAC5J,QAAQJ,UAA0C,qBAAA,YAAA,EAAA,UAAA,CAC9C,oBAAC,YAAD;EAAY,YAAYA,MAAMK;EAAY,YAAYL,MAAMM;EAAY,SAASC,WAAWP,OAAOhB,SAASS,WAAW;EAAeP;EAAsBC;EACzJC,UAAAA;CACS,CAAA,GACXY,MAAMK,aAAa,OAAOD,MAC7B,EAAA,CAAA;AACJ;;;;;;;AAqBA,SAASG,WAAWP,OAA4BhB,SAAoBS,aAA4C;CAC9G,MAAMe,UAAUR,MAAMR,sB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AAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAC,MAAAD,EAAA,OAAAhC,YAAAgC,EAAA,QAAAG,MAAAH,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,IAAA;EAD7DC,KAAA,qBAAC,IAAD;GAAe,GAAQrB;GAAK,GAAMmB;GAAlC,UAAA,CACFC,IACArC,QAFiB;;EAGHgC,EAAA,KAAAC;EAAAD,EAAA,KAAAhC;EAAAgC,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAHZM;AAGY;AAErBvF,OAAKuG,OAAOnG;AACZJ,OAAKwG,WAAWJ;AAChBpG,OAAKyG,UAAU/F"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","TreeItemProps","RACTreeItemProps","TreeLoadMoreItemProps","RACTreeLoadMoreItemProps","TreeProps","RACTreeProps","TreeItemRenderProps","stylex","createContext","useContext","Button","RACButton","Tree","RACTree","TreeHeader","RACTreeHeader","TreeItem","RACTreeItem","TreeItemContent","RACTreeItemContent","TreeLoadMoreItem","RACTreeLoadMoreItem","TreeSection","RACTreeSection","CollectionLoadMore","collectionStyles","containerClasses","rowItemStyles","ChevronEndGlyph","useRipple","RowContent","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","Checkbox","RACTreeSectionProps","Parameters","T","SelectLabelContext","undefined","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","indent","kZCmMZ","TreeHeaderProps","children","Omit","TreeItemText","className","leading","style","supporting","trailing","headline","textValue","TreeLoadMoreProps","label","selectionBehavior","selectLabel","TreeSectionProps","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","ripple","isDisabled","isSelected","selectionFor","selectionMode","textValueFor","t0","$","T0","T1","t1","t2","t3","t4","t5","t6","Symbol","for","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","handlers","surface","t7","TreeLoadMore","loading","section","Item","LoadMore","Section","stylex.props","RACButton","Tree","_c","RACTree","TreeHeader","RACTreeHeader","TreeItem","RACTreeItem","RACTreeItemContent","props","RACTreeLoadMoreItem","TreeSection","RACTreeSection"],"sources":["../../../src/components/tree/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TreeItemProps as RACTreeItemProps, TreeLoadMoreItemProps as RACTreeLoadMoreItemProps, TreeProps as RACTreeProps, TreeItemRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Button as RACButton, Tree as RACTree, TreeHeader as RACTreeHeader, TreeItem as RACTreeItem, TreeItemContent as RACTreeItemContent, TreeLoadMoreItem as RACTreeLoadMoreItem, TreeSection as RACTreeSection } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles, containerClasses, rowItemStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\n\n// A list whose rows nest. Each row is the row every list here draws —\n// `src/row`, shared with ListItem, ListBox, List and Disclosure — so its\n// 56dp floor, body-large headline, body-medium supporting line, state layers\n// and disabled treatment are that module's, and a tree beside a list cannot\n// drift from it.\n//\n// The lists page gives no nesting: it draws one flat list. So the two things\n// a tree adds beyond that row are the library's own, and both are written\n// here with their reasons. The rest — the row, the selection colours, the\n// checkbox — is the page's, through the shared module.\n//\n// Four things are this component's own.\n//\n// **A level indents by one chevron's width.** React Aria puts the depth on\n// each row as a custom property, so the inset is one `calc` against the\n// row's own inline padding rather than a style per level. 24dp is the size\n// the menus page gives that glyph, which makes a level of nesting exactly as\n// wide as the caret that opens it.\n//\n// **The caret is a button, and React Aria names it.** A `slot=\"chevron\"`\n// button is what expands and collapses; React Aria labels it Expand or\n// Collapse and composes that with the row, so nothing here names it. It is\n// drawn only on a row that has children, since a caret on a leaf says the\n// row opens when it does not.\n//\n// **A selecting tree draws a checkbox, before whatever the row was given.**\n// Same rule as List: React Aria reports the mode on each row, so a tree that\n// toggles draws one without the call site repeating it, and it always sits\n// in the same place so a column of rows reads down.\n//\n// **`TreeItemContent` has no class to style.** React Aria renders it as a\n// `display: contents` gridcell with nothing on it, so the row's own layout\n// is drawn by what goes inside rather than by that wrapper.\n\n// `TreeSection`'s props are not re-exported from the package index, only its\n// component is — so the type is taken off the component rather than imported\n// by a name that is not there to import.\ntype RACTreeSectionProps<T> = Parameters<typeof RACTreeSection<T>>[0];\n\n// What each row's selection checkbox is called. A context rather than a prop\n// on the row, since it is the tree's decision and repeating it per row is\n// how the two drift. Undefined unless the tree is given one, which leaves\n// the name React Aria gives in the reader's locale.\nconst SelectLabelContext = createContext<string | undefined>(undefined);\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype TreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype TreeItemProps<T extends object = object> = Omit<RACTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & TreeItemText & {\n /** The rows nested under this one, as further `Tree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACTreeItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACTreeItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as a count or a control. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a tree row wraps\n// its headline in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string headline is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype TreeItemText = {\n /** The row's headline — the one thing it is mostly about. */\n headline: string;\n /** What typeahead matches the row on. Defaults to the headline. */\n textValue?: string;\n} | {\n /** The row's headline, as something other than a plain string. */\n headline?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype TreeLoadMoreProps = Omit<RACTreeLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype TreeProps<T extends object = object> = {\n /** A function may compute the class from the tree's render state. */\n className?: RACTreeProps<T>['className'];\n /**\n * How a press selects. `toggle` draws a checkbox on every row, and a press\n * adds that row to the selection or takes it out. `replace` draws none, a\n * press makes that row the selection, and the arrow keys carry the\n * selection with the focus; where rows also take an action, a click\n * selects and a double click acts. Left out, a `single` tree replaces and\n * any other toggles, since a single choice drawn as checkboxes unticks one\n * box whenever another is ticked.\n */\n selectionBehavior?: RACTreeProps<T>['selectionBehavior'];\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * Left out, React Aria names it in the reader's locale — \"Select\" in\n * English.\n */\n selectLabel?: string;\n /** A function may compute the style from the tree's render state. */\n style?: RACTreeProps<T>['style'];\n} & Omit<RACTreeProps<T>, 'className' | 'selectionBehavior' | 'style'>;\ntype TreeSectionProps<T extends object = object> = Omit<RACTreeSectionProps<T>, 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its headline lines up with\n// the headline of a sibling that opens.\nfunction chevronFor(state: TreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then the selection checkbox, then whatever the row was given — one order,\n// always, which is what keeps a column of rows reading down.\nfunction itemContent(headline: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, selectLabel: string | undefined, ripple: ReactNode) {\n return (state: TreeItemRenderProps): ReactNode => <>\n <RowContent chevron={chevronFor(state)} isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} selection={selectionFor(state, selectLabel)} supporting={supporting} trailing={trailing}>\n {headline}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the selected container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled row, so nothing has to outrank them.\n//\n// A supporting line moves the row from the page's one-line container height\n// to its two-line one, which is a floor rather than something the row's own\n// box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as an\n// argument rather than read from the render state, since React Aria reports\n// what a row is doing and not what it holds; the row is built by a call for\n// the same reason `itemContent` is.\n/**\n * The selection checkbox, while the tree toggles. The row draws it after the\n * caret and ahead of whatever `leading` holds.\n */\nfunction selectionFor(state: TreeItemRenderProps, selectLabel: string | undefined) {\n if (state.selectionBehavior !== 'toggle' || state.selectionMode === 'none') {\n return null;\n }\n return <Checkbox aria-label={selectLabel} slot=\"selection\" />;\n}\n\n// What React Aria matches typeahead on, and what names the row. `TreeItemText`\n// makes one of the two a string, so the last branch is unreachable through the\n// public type — it is there because destructuring the two apart is what loses\n// the narrowing, not because a row can arrive without either.\nfunction textValueFor(textValue: string | undefined, headline: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof headline === 'string' ? headline : '';\n}\n\n/**\n * A list whose rows nest. Which rows are open is React Aria's: pass\n * `expandedKeys` with `onExpandedChange` to control it, or\n * `defaultExpandedKeys` to let it keep its own. Selection is React Aria's\n * too — set `selectionMode` to `single` or `multiple`. A `multiple` tree\n * draws a checkbox on every row and a `single` one draws none, as a `List`\n * does; `selectionBehavior` overrides either.\n *\n * ```tsx\n * <Tree aria-label=\"Label\">\n * <Tree.Item headline=\"First item\" id=\"first\">\n * <Tree.Item headline=\"Second item\" id=\"second\" />\n * </Tree.Item>\n * </Tree>\n * ```\n *\n * Each row is the row every list here draws, indented by its depth, with a\n * caret on the rows that have children. Name the tree with `aria-label` or\n * `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction Tree<T extends object>({\n selectionBehavior,\n selectLabel,\n ...props\n}: RefAttributes<HTMLDivElement> & TreeProps<T>) {\n return <SelectLabelContext value={selectLabel}>\n <RACTree<T> {...props} {...mergeStatefulStyles(containerClasses, props)}\n // React Aria's own default is `toggle` in every mode. Read with `??`\n // rather than placed before the spread, so a wrapper forwarding an\n // unset prop still gets the default.\n selectionBehavior={selectionBehavior ?? (props.selectionMode === 'single' ? 'replace' : 'toggle')} />\n </SelectLabelContext>;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction TreeHeader({\n children\n}: TreeHeaderProps) {\n return <RACTreeHeader {...stylex.props(collectionStyles.header)}>\n {children}\n </RACTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Its slots are the row's: `leading`, the\n * `headline`, `supporting` under it, and `trailing`. Give every row an `id`\n * — that is the key selection and expansion are reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret. `textValue` is what typeahead matches on, and is\n * taken from a plain-string headline when it is not given.\n */\nfunction TreeItem<T extends object = object>({\n children,\n headline,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n supporting,\n textValue,\n trailing,\n ...props\n}: RefAttributes<HTMLDivElement> & TreeItemProps<T>) {\n const selectLabel = useContext(SelectLabelContext);\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACTreeItem<T> textValue={textValueFor(textValue, headline)} {...ripple.handlers} {...props} {...mergeStatefulStyles(\n // No overline: a tree row takes the list variant's metrics because it\n // looks like a list row, but it follows its own page, and that page\n // gives a headline and a supporting line. The three-line item belongs\n // to the lists page, which `List.Item` and `ListBox.Item` draw.\n rowItemStyles(supporting, undefined, styles.indent), props)}>\n <RACTreeItemContent>\n {itemContent(headline, leading, supporting, trailing, selectLabel, ripple.surface)}\n </RACTreeItemContent>\n {children}\n </RACTreeItem>;\n}\n\n/**\n * The row the tree shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`.\n */\nfunction TreeLoadMore({\n label,\n ...props\n}: RefAttributes<HTMLDivElement> & TreeLoadMoreProps) {\n return <RACTreeLoadMoreItem {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.loading), props)}>\n <CollectionLoadMore diameter=\"24px\" label={label} />\n </RACTreeLoadMoreItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction TreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: TreeSectionProps<T>) {\n return <RACTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <TreeHeader>{header}</TreeHeader>}\n {children}\n </RACTreeSection>;\n}\nTree.Item = TreeItem;\nTree.LoadMore = TreeLoadMore;\nTree.Section = TreeSection;\nexport type { TreeItemProps, TreeLoadMoreProps, TreeProps, TreeSectionProps };\nexport { TreeItem, TreeLoadMore, TreeSection };\nexport default Tree;"],"mappings":";;;;;;;;;;;;;;;AA6DA,MAAM8C,qBAAqBlC,cAAkCmC,KAAAA,CAAS;AACtE,MAAMC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRF,OAAO;CACT;AACF;AAoFA,SAASoB,mBAAmB;CAC1B,OAAOtE,MAAaqC,OAAOC,SAASd,MAAMgD,IAAI,CAAC,CAACf,aAAa;AAC/D;AASA,SAASgB,WAAWC,OAAuC;CACzD,IAAI,CAACA,MAAMC,eACT,OAAO,oBAAC,QAAD,EAAM,WAAU,0BAAyB,CAAA;CAElD,OAAO,oBAACoC,QAAD;EAAW,WAAWzC;EAAkB,MAAK;EAChD,UA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B,KAAA/D,YAAY1B,MAAakB,iBAAgBwF,OAAQ,GAAGnC,OAAK;EAACc,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAA/B;EAAA+B,EAAA,KAAAhB;EAAAgB,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAH,KAAAD,EAAA;EAAA/B,WAAA+B,EAAA;EAAAhB,SAAAgB,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAhB,QAAA;EAC9FqB,KAAArB,WAAWjC,KAAAA,IAAX,OAA8B,oBAAC+E,cAAD,EAAA,UAAa9C,OAAF,CAAA;EAAsBgB,EAAA,KAAAhB;EAAAgB,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAC,MAAAD,EAAA,OAAA/B,YAAA+B,EAAA,QAAAG,MAAAH,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,IAAA;EAD7DC,KAAA,qBAAC,IAAD;GAAe,GAAQpB;GAAK,GAAMkB;GAAlC,UAAA,CACFC,IACApC,QAFiB;;EAGH+B,EAAA,KAAAC;EAAAD,EAAA,KAAA/B;EAAA+B,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAHZM;AAGY;AAErBtF,OAAKsG,OAAOlG;AACZJ,OAAKuG,WAAWJ;AAChBnG,OAAKwG,UAAU9F"}
|
package/dist/control/index.js
CHANGED
|
@@ -28,7 +28,7 @@ function ControlDescription(t0) {
|
|
|
28
28
|
let t3;
|
|
29
29
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30
30
|
t2 = props(controlStyles.messages);
|
|
31
|
-
t3 = props(fieldChromeStyles.message, fieldChromeStyles.messageLine);
|
|
31
|
+
t3 = props(fieldChromeStyles.message, fieldChromeStyles.messageLine, fieldChromeStyles.messageIndent);
|
|
32
32
|
$[0] = t2;
|
|
33
33
|
$[1] = t3;
|
|
34
34
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","SyntheticEvent","stylex","Text","RequiredMark","fieldChromeStyles","controlStyles","ControlDescriptionProps","children","isDisabled","ControlLabelProps","isRequired","state","ControlLabelState","isReadOnly","ControlDescription","t0","$","_c","t1","undefined","t2","t3","Symbol","for","props","messages","message","messageLine","t4","messageDisabled","t5","INTERACTIVE","ControlLabel","label","labelReadOnly","labelDisabled","keepToInteractive","event","HTMLSpanElement","currentTarget","target","interactive","Element","closest","contains","stopPropagation","_c","stylex.props"],"sources":["../../src/control/index.tsx"],"sourcesContent":["import type { ReactNode, SyntheticEvent } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Text } from 'react-aria-components';\nimport { RequiredMark } from '../field';\nimport { fieldChromeStyles } from '../field/styles';\nimport { controlStyles } from './styles';\ntype ControlDescriptionProps = {\n /** The hint. Nothing renders when there is none. */\n children: string | undefined;\n /**\n * Whether the option is disabled, by itself or by its group, which fades\n * the hint with the option's label.\n * @default false\n */\n isDisabled?: boolean;\n};\ntype ControlLabelProps = {\n /** The label's text. Nothing renders when there is none. */\n children: ReactNode;\n /**\n * Whether the control must be chosen, which ends the label in the asterisk\n * every required field's label ends in.\n * @default false\n */\n isRequired?: boolean;\n /** The render state React Aria hands the component. */\n state: ControlLabelState;\n};\n\n/**\n * The state a label reads. Each of React Aria's three render states carries\n * more than this, and this is the part all three share.\n */\ntype ControlLabelState = {\n isDisabled: boolean;\n isReadOnly: boolean;\n};\n\n/**\n * The hint under one option of a group, in the second column of its grid and\n * in the option's description slot, so it is read with the option.\n *\n * Not `FieldMessage`, which is the line under a whole field: it reads the\n * validation of the field around it and draws an error, or an empty line for\n * one to arrive in. An option sits inside its group's validation, so through\n * `FieldMessage` it took the group's error for its own — React Aria's\n * `FieldError` then rendered into the option's slots, which hold no error\n * slot, and threw — dropped its own hint whenever the group was invalid, and\n * drew an empty line under every option inside a `Form`. The group's own line\n * is where its error goes, and an option has only its hint to say.\n */\nfunction ControlDescription({\n children,\n isDisabled = false\n}: ControlDescriptionProps) {\n if (children === undefined) {\n return null;\n }\n return <div {...stylex.props(controlStyles.messages)}>\n <div {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageLine)}>\n <Text slot=\"description\" {...stylex.props(fieldChromeStyles.message, isDisabled && fieldChromeStyles.messageDisabled)}>\n {children}\n </Text>\n </div>\n </div>;\n}\n\n// What a press inside a label belongs to rather than the control: anything\n// that acts on its own, where a native `<label>` leaves the press to it too.\nconst INTERACTIVE = 'a[href], button, input, select, textarea, [role=\"button\"], [role=\"link\"]';\n\n/**\n * The label beside a selection control, in the second column of its grid.\n *\n * Renders nothing without children, which is what a control labelled from\n * outside — by a group's legend, or an `aria-label` — needs.\n *\n * A link or a button inside it acts on its own rather than toggling the\n * control — see `keepToInteractive`.\n */\nfunction ControlLabel({\n children,\n isRequired = false,\n state\n}: ControlLabelProps) {\n if (children === undefined) {\n return null;\n }\n return (\n // The handlers only stop events on their way out of the label; they\n // handle nothing themselves, which is what jsx-a11y cannot tell.\n // oxlint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <span onClick={keepToInteractive} onKeyDown={keepToInteractive} onKeyUp={keepToInteractive} onMouseDown={keepToInteractive} onMouseUp={keepToInteractive} onPointerDown={keepToInteractive} onPointerUp={keepToInteractive} onTouchEnd={keepToInteractive} onTouchStart={keepToInteractive} {...stylex.props(controlStyles.label, state.isReadOnly && controlStyles.labelReadOnly, state.isDisabled && controlStyles.labelDisabled)}>\n {children}\n {isRequired ? <RequiredMark /> : null}\n </span>\n );\n}\n\n/**\n * Keeps a press or a key that starts in something interactive inside the\n * label — the link in \"I agree to the terms\" — from reaching the control's\n * own press handling, which sits on the element around the label. React Aria\n * took such a press as a press on the control, toggling it and stopping the\n * link's own default, so a click toggled the box and left the page where it\n * was, and Enter did neither. Stopped here, the event goes no further than\n * the label, and the browser's own default — following the link — is left\n * alone, as a native label leaves it. A press anywhere else in the label\n * still reaches the control and toggles it.\n */\nfunction keepToInteractive(event: SyntheticEvent<HTMLSpanElement>) {\n const {\n currentTarget,\n target\n } = event;\n const interactive = target instanceof Element ? target.closest(INTERACTIVE) : null;\n if (interactive !== null && currentTarget.contains(interactive)) {\n event.stopPropagation();\n }\n}\nexport type { ControlDescriptionProps, ControlLabelProps };\nexport { ControlDescription, ControlLabel };"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmDA,SAAAe,mBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAA4B,MAAA,EAAAV,UAAAC,YAAAU,OAAAH;CAE1B,MAAAP,aAAAU,OAAAC,KAAAA,IAAA,QAAAD;CAEA,IAAIX,aAAaY,KAAAA,GAAS,OACjB;CACR,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EACeH,KAAAnB,MAAaI,cAAaoB,QAAS;EACtCJ,KAAApB,MAAaG,kBAAiBsB,SAAUtB,kBAAiBuB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","SyntheticEvent","stylex","Text","RequiredMark","fieldChromeStyles","controlStyles","ControlDescriptionProps","children","isDisabled","ControlLabelProps","isRequired","state","ControlLabelState","isReadOnly","ControlDescription","t0","$","_c","t1","undefined","t2","t3","Symbol","for","props","messages","message","messageLine","messageIndent","t4","messageDisabled","t5","INTERACTIVE","ControlLabel","label","labelReadOnly","labelDisabled","keepToInteractive","event","HTMLSpanElement","currentTarget","target","interactive","Element","closest","contains","stopPropagation","_c","stylex.props"],"sources":["../../src/control/index.tsx"],"sourcesContent":["import type { ReactNode, SyntheticEvent } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Text } from 'react-aria-components';\nimport { RequiredMark } from '../field';\nimport { fieldChromeStyles } from '../field/styles';\nimport { controlStyles } from './styles';\ntype ControlDescriptionProps = {\n /** The hint. Nothing renders when there is none. */\n children: string | undefined;\n /**\n * Whether the option is disabled, by itself or by its group, which fades\n * the hint with the option's label.\n * @default false\n */\n isDisabled?: boolean;\n};\ntype ControlLabelProps = {\n /** The label's text. Nothing renders when there is none. */\n children: ReactNode;\n /**\n * Whether the control must be chosen, which ends the label in the asterisk\n * every required field's label ends in.\n * @default false\n */\n isRequired?: boolean;\n /** The render state React Aria hands the component. */\n state: ControlLabelState;\n};\n\n/**\n * The state a label reads. Each of React Aria's three render states carries\n * more than this, and this is the part all three share.\n */\ntype ControlLabelState = {\n isDisabled: boolean;\n isReadOnly: boolean;\n};\n\n/**\n * The hint under one option of a group, in the second column of its grid and\n * in the option's description slot, so it is read with the option.\n *\n * Not `FieldMessage`, which is the line under a whole field: it reads the\n * validation of the field around it and draws an error, or an empty line for\n * one to arrive in. An option sits inside its group's validation, so through\n * `FieldMessage` it took the group's error for its own — React Aria's\n * `FieldError` then rendered into the option's slots, which hold no error\n * slot, and threw — dropped its own hint whenever the group was invalid, and\n * drew an empty line under every option inside a `Form`. The group's own line\n * is where its error goes, and an option has only its hint to say.\n */\nfunction ControlDescription({\n children,\n isDisabled = false\n}: ControlDescriptionProps) {\n if (children === undefined) {\n return null;\n }\n return <div {...stylex.props(controlStyles.messages)}>\n <div {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageLine, fieldChromeStyles.messageIndent)}>\n <Text slot=\"description\" {...stylex.props(fieldChromeStyles.message, isDisabled && fieldChromeStyles.messageDisabled)}>\n {children}\n </Text>\n </div>\n </div>;\n}\n\n// What a press inside a label belongs to rather than the control: anything\n// that acts on its own, where a native `<label>` leaves the press to it too.\nconst INTERACTIVE = 'a[href], button, input, select, textarea, [role=\"button\"], [role=\"link\"]';\n\n/**\n * The label beside a selection control, in the second column of its grid.\n *\n * Renders nothing without children, which is what a control labelled from\n * outside — by a group's legend, or an `aria-label` — needs.\n *\n * A link or a button inside it acts on its own rather than toggling the\n * control — see `keepToInteractive`.\n */\nfunction ControlLabel({\n children,\n isRequired = false,\n state\n}: ControlLabelProps) {\n if (children === undefined) {\n return null;\n }\n return (\n // The handlers only stop events on their way out of the label; they\n // handle nothing themselves, which is what jsx-a11y cannot tell.\n // oxlint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <span onClick={keepToInteractive} onKeyDown={keepToInteractive} onKeyUp={keepToInteractive} onMouseDown={keepToInteractive} onMouseUp={keepToInteractive} onPointerDown={keepToInteractive} onPointerUp={keepToInteractive} onTouchEnd={keepToInteractive} onTouchStart={keepToInteractive} {...stylex.props(controlStyles.label, state.isReadOnly && controlStyles.labelReadOnly, state.isDisabled && controlStyles.labelDisabled)}>\n {children}\n {isRequired ? <RequiredMark /> : null}\n </span>\n );\n}\n\n/**\n * Keeps a press or a key that starts in something interactive inside the\n * label — the link in \"I agree to the terms\" — from reaching the control's\n * own press handling, which sits on the element around the label. React Aria\n * took such a press as a press on the control, toggling it and stopping the\n * link's own default, so a click toggled the box and left the page where it\n * was, and Enter did neither. Stopped here, the event goes no further than\n * the label, and the browser's own default — following the link — is left\n * alone, as a native label leaves it. A press anywhere else in the label\n * still reaches the control and toggles it.\n */\nfunction keepToInteractive(event: SyntheticEvent<HTMLSpanElement>) {\n const {\n currentTarget,\n target\n } = event;\n const interactive = target instanceof Element ? target.closest(INTERACTIVE) : null;\n if (interactive !== null && currentTarget.contains(interactive)) {\n event.stopPropagation();\n }\n}\nexport type { ControlDescriptionProps, ControlLabelProps };\nexport { ControlDescription, ControlLabel };"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmDA,SAAAe,mBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAA4B,MAAA,EAAAV,UAAAC,YAAAU,OAAAH;CAE1B,MAAAP,aAAAU,OAAAC,KAAAA,IAAA,QAAAD;CAEA,IAAIX,aAAaY,KAAAA,GAAS,OACjB;CACR,IAAAC;CAAA,IAAAC;CAA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AAH;EAAAQ,EAAA,KAAAL,MAAAE;EAAAG,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAN,YAAA;EAEhaW,KAAAX,aAAa,oBAAC,cAAD,CAAa,CAAA,IAA1B;EAAoCM,EAAA,KAAAN;EAAAM,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAT,YAAAS,EAAA,OAAAI,MAAAJ,EAAA,OAAAK,IAAA;EAFvCQ,KAAA,qBAAA,QAAA;GAAeQ,SAAAA;GAA8BA,WAAAA;GAA4BA,SAAAA;GAAgCA,aAAAA;GAA8BA,WAAAA;GAAkCA,eAAAA;GAAgCA,aAAAA;GAA+BA,YAAAA;GAAiCA,cAAAA;GAAiB,GAAMjB;GAAhS,UAAA,CACGb,UACAc,EACI;;EAAAL,EAAA,KAAAT;EAAAS,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAHPa;AAGO;;;;;;;;;;;;AAeX,SAASQ,kBAAkBC,OAAwC;CACjE,MAAM,EACJE,eACAC,WACEH;CACJ,MAAMI,cAAcD,kBAAkBE,UAAUF,OAAOG,QAAQZ,WAAW,IAAI;CAC9E,IAAIU,gBAAgB,QAAQF,cAAcK,SAASH,WAAW,GAC5DJ,MAAMQ,gBAAgB;AAE1B"}
|
package/dist/control/styles.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["stylex","colors","motion","radii","spacing","stateLayerOpacity","typography","FORCED_COLORS","LAYER_SIZE","TARGET_SIZE","TARGET_REACH","TARGET_GAP","controlStyles","controlDisabled","kkrTdU","$$css","controlReadOnly","disc","kgeoSG","kFcpXp","kEoFBp","k6CgDc","kGNEyG","kWkggS","kZKoxP","kaIpWk","kB7OPa","k1xSpc","kmuXW","kzqmXN","kjj79g","kVAEAm","kIyJzY","k1ekBW","kAMwcw","field","kumcoG","k7Eaqz","label","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kHjlTd","k8WAf4","kZCmMZ","labelDisabled","labelReadOnly","messages","kEXP64","stack","kXwgrk","khm7nJ"],"sources":["../../src/control/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The row a selection control draws, shared by Checkbox, Switch and Radio.\n// Each wrote it out in full: the two-column grid, the body-large label with\n// its disabled and read-only fades, the messages cell under the text, and the\n// cursors the control takes in those two states. Switch's own comment already\n// said it drew \"the two-column grid the checkbox uses\" while keeping a second\n// copy, so the coupling was recorded in prose rather than in code — the same\n// thing src/field and src/row were extracted to stop.\n//\n// The set is closed at three. React Aria Components has no fourth component\n// drawing this row, and CheckboxGroup is a container rather than a control.\n// What this is worth is that the three cannot drift apart, and that the\n// repository's own convention — a style more than one component draws lives\n// beside src/components, not inside it — holds here too.\n//\n// Two things deliberately stay with each component.\n//\n// The state layers are three different shapes rather than one shape with\n// three sets of key names. Checkbox carries an `error` key Radio has no\n// equivalent for, Checkbox's pressed set inverts its own key names, and\n// Switch deliberately does not invert at all. One style keyed on a `marked`\n// boolean would have to encode an error branch one caller uses, an inversion\n// another uses, and a documented non-inversion for the third, which costs a\n// reader more than the three short `stylex.create` calls it would replace.\n//\n// And the disc's colour. Checkbox draws it in `onSurface` and Radio in\n// `onSurfaceVariant`, which is the one declaration their otherwise identical\n// discs disagree on, so `disc` holds the other fourteen and each component\n// composes its own colour after.\n// The two sizes the checkbox, radio button and switch pages each give, and\n// the decision the three of them share.\n//\n// Every one of those pages lists them as separate measurements — a 40dp state\n// layer and a 48dp target — and all three components here recorded the pair in\n// their header comments while drawing only the first. The target is what the\n// pages ask a press to reach, so it is drawn: `disc` carries a transparent\n// `::before` that reaches the 4dp either side, taking the press because a\n// pseudo-element is part of the element it belongs to. A lone control moves\n// nothing, since that box is out of flow — the alternative, a 48dp disc,\n// would have grown every form in every consuming app by 8dp a row.\n//\n// A group's rows are the exception, and `stack` is how. Rows on the 40dp\n// pitch of their layers put each target 8dp into the next row's, and the\n// later row is painted over the earlier, so a press on the bottom of one\n// row's visible layer went to the row below it. The pages ask that a target\n// not overlap its neighbour, so a group spaces its rows by the 8dp the two\n// sizes differ by, and the targets meet edge to edge on a 48dp pitch.\n//\n// Switch composes neither of these. Its track is its own 52 by 40, so it\n// carries the same `::before` in its own file, over the one axis that is\n// short.\n//\n// The layer is also what the label centres its first line on, and the two\n// have to agree: a disc resized without the label following it would put the\n// control off its own label again, which is the drift this row already had\n// once. The target is deliberately not in that sum — a label centred on an\n// invisible box would sit 4dp below the disc a reader can see.\n//\n// Literals rather than `sizing.controlSm` and `controlMd`, which happen to\n// hold the same two numbers. Those are steps of the control scale, spent on\n// button heights; these are one page's state layer and one page's target, and\n// a consumer resizing their buttons should not move either.\nconst LAYER_SIZE = '40px';\nconst TARGET_SIZE = '48px';\n\n/** How far the target reaches past the layer on each side: 4dp. */\nconst TARGET_REACH = `calc((${LAYER_SIZE} - ${TARGET_SIZE}) / 2)`;\n\n/** The room two targets need between their layers to meet without overlap. */\nconst TARGET_GAP = `calc(${TARGET_SIZE} - ${LAYER_SIZE})`;\nconst controlStyles = {\n controlDisabled: {\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n controlReadOnly: {\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n disc: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x100vrsf\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x15406qy\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n field: {\n kGNEyG: \"x7a106z\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"xrvj5dj\",\n kumcoG: \"x1rkzygb\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n },\n label: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n k7Eaqz: \"xeuugli\",\n kHjlTd: \"xj0a0fe\",\n k8WAf4: \"x18r0n19\",\n kZCmMZ: \"xdxifnh\",\n $$css: true\n },\n labelDisabled: {\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n labelReadOnly: {\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n messages: {\n kB7OPa: \"x9f619\",\n kEXP64: \"x1xdureb\",\n k7Eaqz: \"xeuugli\",\n kHjlTd: \"xj0a0fe\",\n
|
|
1
|
+
{"version":3,"file":"styles.js","names":["stylex","colors","motion","radii","spacing","stateLayerOpacity","typography","FORCED_COLORS","LAYER_SIZE","TARGET_SIZE","TARGET_REACH","TARGET_GAP","controlStyles","controlDisabled","kkrTdU","$$css","controlReadOnly","disc","kgeoSG","kFcpXp","kEoFBp","k6CgDc","kGNEyG","kWkggS","kZKoxP","kaIpWk","kB7OPa","k1xSpc","kmuXW","kzqmXN","kjj79g","kVAEAm","kIyJzY","k1ekBW","kAMwcw","field","kumcoG","k7Eaqz","label","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kHjlTd","k8WAf4","kZCmMZ","labelDisabled","labelReadOnly","messages","kEXP64","stack","kXwgrk","khm7nJ"],"sources":["../../src/control/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The row a selection control draws, shared by Checkbox, Switch and Radio.\n// Each wrote it out in full: the two-column grid, the body-large label with\n// its disabled and read-only fades, the messages cell under the text, and the\n// cursors the control takes in those two states. Switch's own comment already\n// said it drew \"the two-column grid the checkbox uses\" while keeping a second\n// copy, so the coupling was recorded in prose rather than in code — the same\n// thing src/field and src/row were extracted to stop.\n//\n// The set is closed at three. React Aria Components has no fourth component\n// drawing this row, and CheckboxGroup is a container rather than a control.\n// What this is worth is that the three cannot drift apart, and that the\n// repository's own convention — a style more than one component draws lives\n// beside src/components, not inside it — holds here too.\n//\n// Two things deliberately stay with each component.\n//\n// The state layers are three different shapes rather than one shape with\n// three sets of key names. Checkbox carries an `error` key Radio has no\n// equivalent for, Checkbox's pressed set inverts its own key names, and\n// Switch deliberately does not invert at all. One style keyed on a `marked`\n// boolean would have to encode an error branch one caller uses, an inversion\n// another uses, and a documented non-inversion for the third, which costs a\n// reader more than the three short `stylex.create` calls it would replace.\n//\n// And the disc's colour. Checkbox draws it in `onSurface` and Radio in\n// `onSurfaceVariant`, which is the one declaration their otherwise identical\n// discs disagree on, so `disc` holds the other fourteen and each component\n// composes its own colour after.\n// The two sizes the checkbox, radio button and switch pages each give, and\n// the decision the three of them share.\n//\n// Every one of those pages lists them as separate measurements — a 40dp state\n// layer and a 48dp target — and all three components here recorded the pair in\n// their header comments while drawing only the first. The target is what the\n// pages ask a press to reach, so it is drawn: `disc` carries a transparent\n// `::before` that reaches the 4dp either side, taking the press because a\n// pseudo-element is part of the element it belongs to. A lone control moves\n// nothing, since that box is out of flow — the alternative, a 48dp disc,\n// would have grown every form in every consuming app by 8dp a row.\n//\n// A group's rows are the exception, and `stack` is how. Rows on the 40dp\n// pitch of their layers put each target 8dp into the next row's, and the\n// later row is painted over the earlier, so a press on the bottom of one\n// row's visible layer went to the row below it. The pages ask that a target\n// not overlap its neighbour, so a group spaces its rows by the 8dp the two\n// sizes differ by, and the targets meet edge to edge on a 48dp pitch.\n//\n// Switch composes neither of these. Its track is its own 52 by 40, so it\n// carries the same `::before` in its own file, over the one axis that is\n// short.\n//\n// The layer is also what the label centres its first line on, and the two\n// have to agree: a disc resized without the label following it would put the\n// control off its own label again, which is the drift this row already had\n// once. The target is deliberately not in that sum — a label centred on an\n// invisible box would sit 4dp below the disc a reader can see.\n//\n// Literals rather than `sizing.controlSm` and `controlMd`, which happen to\n// hold the same two numbers. Those are steps of the control scale, spent on\n// button heights; these are one page's state layer and one page's target, and\n// a consumer resizing their buttons should not move either.\nconst LAYER_SIZE = '40px';\nconst TARGET_SIZE = '48px';\n\n/** How far the target reaches past the layer on each side: 4dp. */\nconst TARGET_REACH = `calc((${LAYER_SIZE} - ${TARGET_SIZE}) / 2)`;\n\n/** The room two targets need between their layers to meet without overlap. */\nconst TARGET_GAP = `calc(${TARGET_SIZE} - ${LAYER_SIZE})`;\nconst controlStyles = {\n controlDisabled: {\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n controlReadOnly: {\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n disc: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x100vrsf\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x1n2onr6\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x15406qy\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n field: {\n kGNEyG: \"x7a106z\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"xrvj5dj\",\n kumcoG: \"x1rkzygb\",\n k7Eaqz: \"xeuugli\",\n $$css: true\n },\n label: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n k7Eaqz: \"xeuugli\",\n kHjlTd: \"xj0a0fe\",\n k8WAf4: \"x18r0n19\",\n kZCmMZ: \"xdxifnh\",\n $$css: true\n },\n labelDisabled: {\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n labelReadOnly: {\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n messages: {\n kB7OPa: \"x9f619\",\n kEXP64: \"x1xdureb\",\n k7Eaqz: \"xeuugli\",\n kHjlTd: \"xj0a0fe\",\n $$css: true\n },\n stack: {\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n khm7nJ: \"xtfsegk\",\n $$css: true\n }\n};\nexport { controlStyles };"],"mappings":";AA+EA,MAAMY,gBAAgB;CACpBC,iBAAiB;EACfC,QAAQ;EACRC,OAAO;CACT;CACAC,iBAAiB;EACfF,QAAQ;EACRC,OAAO;CACT;CACAE,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRZ,QAAQ;EACRa,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;CACAoB,OAAO;EACLb,QAAQ;EACRI,QAAQ;EACRC,QAAQ;EACRS,QAAQ;EACRC,QAAQ;EACRtB,OAAO;CACT;CACAuB,OAAO;EACLZ,QAAQ;EACRa,QAAQ;EACRzB,QAAQ;EACR0B,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRhC,OAAO;CACT;CACAiC,eAAe;EACbT,QAAQ;EACRzB,QAAQ;EACRC,OAAO;CACT;CACAkC,eAAe;EACbnC,QAAQ;EACRC,OAAO;CACT;CACAmC,UAAU;EACRxB,QAAQ;EACRyB,QAAQ;EACRd,QAAQ;EACRQ,QAAQ;EACR9B,OAAO;CACT;CACAqC,OAAO;EACLzB,QAAQ;EACR0B,QAAQ;EACRC,QAAQ;EACRvC,OAAO;CACT;AACF"}
|