@kanso-labs/kanso-ui 0.45.34 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button/index.js +13 -9
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/styles.js +12 -7
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/label.js +1 -0
- package/dist/chip/label.js.map +1 -1
- package/dist/chip/styles.js +2 -0
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/styles.js +1 -1
- package/dist/collection/styles.js.map +1 -1
- package/dist/components/breadcrumbs/index.js +4 -1
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/button-group/index.d.ts +16 -3
- package/dist/components/button-group/index.js +53 -86
- package/dist/components/button-group/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +3 -3
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/card/index.js +5 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/carousel/index.js +162 -105
- package/dist/components/carousel/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +38 -15
- package/dist/components/chip/index.js +104 -8
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/code/index.js +32 -26
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/color-area/index.d.ts +5 -3
- package/dist/components/color-area/index.js +5 -3
- package/dist/components/color-area/index.js.map +1 -1
- package/dist/components/color-picker/index.js +6 -3
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-swatch/index.js +1 -1
- package/dist/components/color-swatch/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.js +24 -9
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/combo-box/index.d.ts +11 -3
- package/dist/components/combo-box/index.js +66 -62
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/copy-field/index.js +1 -0
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/date-picker/index.d.ts +22 -3
- package/dist/components/date-picker/index.js +234 -45
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/date-range-picker/index.d.ts +3 -1
- package/dist/components/date-range-picker/index.js +6 -4
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/disclosure/index.d.ts +4 -3
- package/dist/components/disclosure/index.js +159 -101
- package/dist/components/disclosure/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +3 -1
- package/dist/components/fab/index.js +25 -12
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/fab-menu/index.js +1 -1
- package/dist/components/fab-menu/index.js.map +1 -1
- package/dist/components/icon-button/index.js +3 -3
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/index.d.ts +3 -3
- package/dist/components/link/index.js +2 -2
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/menu/index.js +5 -2
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-rail/index.js +4 -4
- package/dist/components/navigation-rail/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +16 -13
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/popover/index.js +35 -33
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/progress-indicator/index.js +258 -172
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/range-calendar/index.js +41 -7
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/search-view/index.js +1 -1
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +3 -2
- package/dist/components/segmented-button/index.js +46 -95
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/select/index.js +5 -2
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/slider/index.js +42 -10
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/table/index.d.ts +26 -5
- package/dist/components/table/index.js +93 -75
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tag/index.js +1 -0
- package/dist/components/tag/index.js.map +1 -1
- package/dist/components/time-picker/index.js +37 -5
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/components/token-field/index.js +89 -66
- package/dist/components/token-field/index.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +8 -3
- package/dist/components/toolbar/index.js +123 -43
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/tree/index.js +1 -1
- package/dist/components/tree/index.js.map +1 -1
- package/dist/fab/styles.js +12 -0
- package/dist/fab/styles.js.map +1 -1
- package/dist/field/styles.js +2 -2
- package/dist/field/styles.js.map +1 -1
- package/dist/hooks/useDockedMonths.js +36 -0
- package/dist/hooks/useDockedMonths.js.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +34 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/navigation/index.js +5 -5
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/styles.js +5 -1
- package/dist/navigation/styles.js.map +1 -1
- package/dist/row/context.js +6 -0
- package/dist/row/context.js.map +1 -0
- package/dist/row/index.js +77 -66
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +15 -0
- package/dist/row/styles.js.map +1 -1
- package/dist/segments/index.js +2 -5
- package/dist/segments/index.js.map +1 -1
- package/dist/segments/literal.js +66 -0
- package/dist/segments/literal.js.map +1 -0
- package/dist/segments/styles.js +8 -0
- package/dist/segments/styles.js.map +1 -1
- package/dist/styles/chequer.js +1 -0
- package/dist/styles/chequer.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles.css +509 -69
- package/dist/toggle-group/index.js +133 -0
- package/dist/toggle-group/index.js.map +1 -0
- package/package.json +3 -3
package/dist/button/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { useToggleGroupDisabled } from "../hooks/useToggleGroupDisabled.js";
|
|
|
4
4
|
import { useMessages } from "../i18n/index.js";
|
|
5
5
|
import { buttonRenderer, linkRenderer, toggleButtonRenderer } from "../render/aria.js";
|
|
6
6
|
import { mergeStatefulStyles } from "../styles/merge.js";
|
|
7
|
+
import { useRadioItem } from "../toggle-group/index.js";
|
|
7
8
|
import { useButtonBase } from "./hooks.js";
|
|
8
9
|
import { buttonBaseStyles } from "./styles.js";
|
|
9
10
|
import { c } from "react/compiler-runtime";
|
|
@@ -230,7 +231,7 @@ function selectedRender(render, isSelected) {
|
|
|
230
231
|
* ripple off.
|
|
231
232
|
*/
|
|
232
233
|
function ToggleButtonBase(t0) {
|
|
233
|
-
const $ = c(
|
|
234
|
+
const $ = c(33);
|
|
234
235
|
let children;
|
|
235
236
|
let classes;
|
|
236
237
|
let defaultSelected;
|
|
@@ -273,6 +274,7 @@ function ToggleButtonBase(t0) {
|
|
|
273
274
|
$[11] = t2;
|
|
274
275
|
} else t2 = $[11];
|
|
275
276
|
const { disabled, element, props, ref, ripple } = useButtonBase(t2, isPending);
|
|
277
|
+
const radio = useRadioItem(input.id);
|
|
276
278
|
let t3;
|
|
277
279
|
if ($[12] !== element || $[13] !== render) {
|
|
278
280
|
t3 = toggleButtonRenderer(element, toggleRender(render));
|
|
@@ -296,8 +298,9 @@ function ToggleButtonBase(t0) {
|
|
|
296
298
|
$[20] = t6;
|
|
297
299
|
} else t6 = $[20];
|
|
298
300
|
let t7;
|
|
299
|
-
if ($[21] !== defaultSelected || $[22] !== disabled || $[23] !== isSelected || $[24] !== onChange || $[25] !== props || $[26] !==
|
|
301
|
+
if ($[21] !== defaultSelected || $[22] !== disabled || $[23] !== isSelected || $[24] !== onChange || $[25] !== props || $[26] !== radio || $[27] !== ref || $[28] !== ripple.handlers || $[29] !== t3 || $[30] !== t5 || $[31] !== t6) {
|
|
300
302
|
t7 = /* @__PURE__ */ jsx(ToggleButton, {
|
|
303
|
+
...radio,
|
|
301
304
|
defaultSelected,
|
|
302
305
|
isDisabled: disabled,
|
|
303
306
|
isSelected,
|
|
@@ -314,13 +317,14 @@ function ToggleButtonBase(t0) {
|
|
|
314
317
|
$[23] = isSelected;
|
|
315
318
|
$[24] = onChange;
|
|
316
319
|
$[25] = props;
|
|
317
|
-
$[26] =
|
|
318
|
-
$[27] =
|
|
319
|
-
$[28] =
|
|
320
|
-
$[29] =
|
|
321
|
-
$[30] =
|
|
322
|
-
$[31] =
|
|
323
|
-
|
|
320
|
+
$[26] = radio;
|
|
321
|
+
$[27] = ref;
|
|
322
|
+
$[28] = ripple.handlers;
|
|
323
|
+
$[29] = t3;
|
|
324
|
+
$[30] = t5;
|
|
325
|
+
$[31] = t6;
|
|
326
|
+
$[32] = t7;
|
|
327
|
+
} else t7 = $[32];
|
|
324
328
|
return t7;
|
|
325
329
|
}
|
|
326
330
|
function toggleContent(children, surface) {
|
package/dist/button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["stylex","RACButton","useToggleGroupDisabled","useMessages","buttonRenderer","linkRenderer","toggleButtonRenderer","mergeStatefulStyles","useButtonBase","buttonBaseStyles","children","classes","state","props","className","href","isSelected","pendingLabel","rel","style","target","isPending","defaultSelected","onChange","busyElement","element","aria","ButtonBase","t0","$","_c","input","render","t1","undefined","messages","base","disabled","ref","ripple","t2","merged","T0","styleProps","t3","t4","t5","t6","t7","handlers","surface","Symbol","for","bb0","t8","state_0","selectedRender","t9","loading","t10","buttonContent","t11","label","labelPending","pending","selected","ToggleButtonBase","disabledByGroup","id","isDisabled","toggleRender","toggleContent","RACLink","RACToggleButton"],"sources":["../../src/button/index.tsx"],"sourcesContent":["import type { DOMAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ButtonRenderProps, ClassNameOrFunction, ButtonProps as RACButtonProps, ToggleButtonProps as RACToggleButtonProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, Link as RACLink, ToggleButton as RACToggleButton } from 'react-aria-components';\nimport type { ElementProps } from '../render/aria';\nimport ProgressIndicator from '../components/progress-indicator';\nimport { useToggleGroupDisabled } from '../hooks/useToggleGroupDisabled';\nimport { useMessages } from '../i18n';\nimport { buttonRenderer, linkRenderer, toggleButtonRenderer } from '../render/aria';\nimport { mergeStatefulStyles } from '../styles/merge';\nimport { useButtonBase } from './hooks';\nimport { buttonBaseStyles } from './styles';\n\n// The press-button core Button and IconButton both render through. A button\n// is React Aria's `Button`, its `Link` once given `href`, or its\n// `ToggleButton` inside a selecting group, and around each this adds what\n// React Aria leaves out: the ripple, the disabled state a parent's context\n// sets, the `aria-*` props and keyboard handlers it would drop or wrap, and\n// the ring drawn over the label while the button is pending, with the\n// `aria-busy` that says so. Each component\n// brings its own classes, as a function of the render state, and the call\n// site's `className` and `style` are merged over them.\n//\n// One module rather than a copy in each, since the copies had already drifted\n// once: IconButton read `ButtonContext` for a parent's disabled state and\n// Button did not. Not a component of the library's own and not exported from\n// the package; see `src/row` for the same arrangement around a list's row.\n\ntype ButtonBaseProps = {\n children?: ReactNode;\n /**\n * The component's own classes, from the render state. The call site's\n * `className` and `style` are merged over them.\n */\n classes: (state: ButtonClassesState) => ReturnType<typeof stylex.props>;\n className?: ClassNameOrFunction<ButtonState>;\n disableRipple?: boolean;\n href?: string;\n /**\n * A toggle's state, for a button that reports one through `aria-pressed`.\n * Left undefined, the button reports none. Handed to every function of the\n * render state, so the classes can draw it.\n */\n isSelected?: boolean;\n pendingLabel?: string;\n rel?: string;\n style?: StyleOrFunction<ButtonState>;\n target?: string;\n} & ButtonDOMProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>;\n\n// The state a component's own classes are handed: the render state above,\n// and whether the button is pending, so the classes can draw it. React\n// Aria's `Button` reports that and its `Link` and `ToggleButton` do not, so\n// it is optional — a link, and a toggle in a selecting group, are never\n// pending — and it stays out of ButtonState, which a call site's own\n// `className` and `style` are written against.\ntype ButtonClassesState = ButtonState & {\n isPending?: boolean;\n};\n\n// The props a button hands React Aria. React Aria types the global DOM events\n// — pointer, mouse, touch, wheel and the rest — against the element each\n// component renders, and a handler written for a <button> does not type-check\n// against an <a>. The keys are retyped against HTMLElement here so one set of\n// props serves both forms; the events React Aria defines itself (press,\n// focus, keyboard) keep its types, since it hands those its own event objects.\ntype ButtonDOMProps = Omit<RACButtonProps, 'children' | 'className' | 'style' | GlobalEventKey> & Pick<DOMAttributes<HTMLElement>, GlobalEventKey>;\n\n/**\n * The three forms a button takes, of which a call site writes exactly one:\n * a plain button, a link, or a toggle. Each names the props of the other two\n * as `never`, so a combination the rendered form would ignore — a toggle\n * given `href`, a link given `isPending` — is a compile error rather than a\n * prop that silently does nothing.\n */\ntype ButtonForm = ButtonLinkForm | ButtonPressForm | ButtonToggleForm;\ntype ButtonLinkForm = {\n defaultSelected?: never;\n /**\n * Where the button leads. Given one, the button is rendered as a link —\n * an `<a>`, announced as the link it is — with the same styles and ripple.\n * A link is never a toggle and never pending, and `render`, `type` and the\n * form props apply to the other two forms only.\n */\n href: string;\n isPending?: never;\n isSelected?: never;\n onChange?: never;\n pendingLabel?: never;\n /** The link's `rel`. */\n rel?: string;\n /** The link's `target`. */\n target?: string;\n};\ntype ButtonPressForm = {\n defaultSelected?: never;\n href?: never;\n isSelected?: never;\n onChange?: never;\n rel?: never;\n target?: never;\n};\n\n// The render state React Aria's three elements share. A className or style\n// function written against it serves the button, the link and the toggle\n// alike; `isPending` belongs to the button alone, and `isCurrent` to the\n// link, so neither is here. What the button draws while pending is decided\n// in `buttonContent`, which sees React Aria's own state rather than this one.\n//\n// `isSelected` is optional because only the toggle has one: React Aria hands\n// the button and the link a state without it and the toggle a state with\n// it, and a parameter type this wide accepts either.\ntype ButtonState = Pick<ButtonRenderProps, 'isDisabled' | 'isFocused' | 'isFocusVisible' | 'isHovered' | 'isPressed'> & {\n isSelected?: boolean;\n};\ntype ButtonToggleForm = {\n /**\n * Whether a toggle starts selected, when it keeps its own state. Passing\n * this, `isSelected` or `onChange` is what makes the button a toggle.\n */\n defaultSelected?: boolean;\n href?: never;\n /**\n * Whether a toggle is selected, when the call site holds the state. Pass\n * it with `onChange`; passing this, `defaultSelected` or `onChange` is what\n * makes the button a toggle. A value still loading may be `undefined` for a\n * while: the button stays the same element when it arrives.\n */\n isSelected?: boolean;\n /**\n * Called with the new state when a toggle is pressed. Passing this,\n * `isSelected` or `defaultSelected` is what makes the button a toggle.\n */\n onChange?: (isSelected: boolean) => void;\n rel?: never;\n target?: never;\n};\ntype GlobalEventKey = Exclude<keyof DOMAttributes<HTMLElement> & keyof RACButtonProps, 'onBlur' | 'onClick' | 'onFocus'>;\ntype ToggleButtonBaseProps = {\n children?: ReactNode;\n /** As for ButtonBase, handed `isSelected` as well. */\n classes: (state: ButtonState) => ReturnType<typeof stylex.props>;\n className?: ClassNameOrFunction<ButtonState>;\n defaultSelected?: boolean;\n disableRipple?: boolean;\n isSelected?: boolean;\n onChange?: (isSelected: boolean) => void;\n style?: StyleOrFunction<ButtonState>;\n} & ButtonDOMProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>;\n\n// A pending button says it is busy on the element itself. React Aria marks\n// it disabled and nests the ring's progress bar inside it, but a button's\n// children are presentational, and assistive technology that flattens them\n// never announces the bar. Only the button takes it, since a link is never\n// pending, and a call site's own `aria-busy` still wins.\nfunction busyElement(element: ElementProps, isPending: boolean) {\n return isPending ? {\n ...element,\n aria: {\n 'aria-busy': true,\n ...element.aria\n }\n } : element;\n}\n\n/**\n * A button drawn with the classes a component hands it: React Aria's\n * `Button`, or its `Link` given `href`. See the header.\n */\nfunction ButtonBase({\n children,\n classes,\n href,\n isPending = false,\n isSelected,\n pendingLabel,\n rel,\n render,\n target,\n ...input\n}: ButtonBaseProps) {\n const messages = useMessages();\n const base = useButtonBase(input, isPending);\n const {\n disabled,\n props,\n ref,\n ripple\n } = base;\n const merged = mergeStatefulStyles(classes, props);\n\n // A toggle is still React Aria's `Button`, which knows nothing of a\n // selected state, so the state goes onto the element as `aria-pressed` and\n // into every function of the render state from here. Being the same\n // component as the plain button is what keeps a button the same element\n // when it becomes a toggle — `isSelected` arriving once its data loads.\n const element = isSelected === undefined ? base.element : {\n ...base.element,\n aria: {\n ...base.element.aria,\n 'aria-pressed': isSelected\n }\n };\n const styleProps = isSelected === undefined ? merged : {\n className: (state: Parameters<typeof merged.className>[0]) => merged.className({\n ...state,\n isSelected\n }),\n style: (state: Parameters<typeof merged.style>[0]) => merged.style({\n ...state,\n isSelected\n })\n };\n if (href !== undefined) {\n return <RACLink href={href} isDisabled={disabled} ref={ref} rel={rel} render={linkRenderer(element)} target={target} {...ripple.handlers} {...props} {...styleProps}>\n {children}\n {ripple.surface}\n </RACLink>;\n }\n return <RACButton isDisabled={disabled} isPending={isPending} ref={ref} render={buttonRenderer(busyElement(element, isPending), selectedRender(render, isSelected))} {...ripple.handlers} {...props} {...styleProps}>\n {buttonContent(children, pendingLabel ?? messages.loading, ripple.surface)}\n </RACButton>;\n}\n\n// What the button draws: its label, hidden while the button is pending, with\n// the ring over it. The ring takes the button's own content colour rather\n// than the progress page's primary, which on a filled button is the fill\n// itself and so invisible. The label stays in the flow so the button keeps its\n// width, which is what stops a form jumping the moment it is submitted.\n// React Aria wants the progress bar in the accessibility tree as soon as the\n// button goes pending, so it is rendered from the render state rather than\n// after a delay.\n//\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler\n// memoises the result on its inputs.\nfunction buttonContent(children: ReactNode, pendingLabel: string, surface: ReactNode) {\n return (state: ButtonRenderProps) => <>\n <span {...stylex.props(buttonBaseStyles.label, state.isPending && buttonBaseStyles.labelPending)}>\n {children}\n </span>\n {state.isPending ? <span {...stylex.props(buttonBaseStyles.pending)}>\n <ProgressIndicator aria-label={pendingLabel} diameter=\"1em\" isIndeterminate tone=\"inherit\" variant=\"circular\" />\n </span> : null}\n {surface}\n </>;\n}\n\n// A toggle drawn through ButtonBase hands a call site's `render` the state of\n// React Aria's plain button, which has no `isSelected`; this fills it in.\nfunction selectedRender(render: RACButtonProps['render'], isSelected: boolean | undefined): RACButtonProps['render'] {\n if (render === undefined || isSelected === undefined) {\n return render;\n }\n // Through a binding rather than as a literal at the call: React Aria types\n // the state as its plain button's, and a call site's `render` is written\n // against ButtonState, which is that plus `isSelected`.\n return (props, state) => {\n const selected = {\n ...state,\n isSelected\n };\n return render(props, selected);\n };\n}\n\n/**\n * A toggle in a selecting group, drawn with the classes a component hands\n * it: React Aria's `ToggleButton`, which is what takes part in the group's\n * selection and reports its state through `aria-pressed`. A toggle on its\n * own is ButtonBase given `isSelected` instead — see there. React Aria's\n * toggle takes no pending state, so `isPending` reaches it only to keep the\n * ripple off.\n */\nfunction ToggleButtonBase({\n children,\n classes,\n defaultSelected,\n isPending = false,\n isSelected,\n onChange,\n render,\n ...input\n}: ToggleButtonBaseProps) {\n // A selecting ButtonGroup disables its toggles through React Aria's group\n // state, which no prop here carries, so the ripple would stay on in a\n // disabled group and answer a press with an animation. Handed on as the\n // toggle's own `isDisabled`, which is what React Aria makes of it anyway.\n const disabledByGroup = useToggleGroupDisabled(input.id);\n const {\n disabled,\n element,\n props,\n ref,\n ripple\n } = useButtonBase(disabledByGroup ? {\n ...input,\n isDisabled: true\n } : input, isPending);\n return <RACToggleButton defaultSelected={defaultSelected} isDisabled={disabled} isSelected={isSelected} onChange={onChange} ref={ref} render={toggleButtonRenderer(element, toggleRender(render))} {...ripple.handlers} {...props} {...mergeStatefulStyles(classes, props)}>\n {toggleContent(children, ripple.surface)}\n </RACToggleButton>;\n}\n\n// What a toggle draws: its label and the ripple. No pending ring — see\n// ToggleButtonBase. Built by a call for the reason `buttonContent` is.\nfunction toggleContent(children: ReactNode, surface: ReactNode) {\n return () => <>\n {children}\n {surface}\n </>;\n}\n\n// A call site's `render` is written for React Aria's button, whose render\n// state says whether it is pending; a toggle's says nothing of it, and a\n// toggle never is. So the toggle hands that function its own state with\n// `isPending` filled in, which is what lets one `render` prop serve a button\n// whichever element it turns out to be.\nfunction toggleRender(render: RACButtonProps['render']): RACToggleButtonProps['render'] {\n if (render === undefined) {\n return undefined;\n }\n return (props, state) => render(props, {\n ...state,\n isPending: false\n });\n}\nexport type { ButtonClassesState, ButtonDOMProps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b;EAAAa,EAAA,MAAAN;EAAAM,EAAA,MAAAhB;EAAAgB,EAAA,MAAAS;EAAAT,EAAA,MAAAU,OAAAU;EAAApB,EAAA,MAAAe;EAAAf,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAFbmB;AAEa;AAKtB,SAASuB,cAAc7D,UAAqBwC,SAAoB;CAC9D,aAAa,qBAAA,UAAA,EAAA,UAAA,CACRxC,UACAwC,OACH,EAAA,CAAA;AACJ;AAOA,SAASoB,aAAatC,QAAkE;CACtF,IAAIA,WAAWE,KAAAA,GACb;CAEF,QAAQrB,OAAOD,UAAUoB,OAAOnB,OAAO;EACrC,GAAGD;EACHS,WAAW;CACb,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["stylex","RACButton","useToggleGroupDisabled","useMessages","buttonRenderer","linkRenderer","toggleButtonRenderer","mergeStatefulStyles","useRadioItem","useButtonBase","buttonBaseStyles","children","classes","state","props","className","href","isSelected","pendingLabel","rel","style","target","isPending","defaultSelected","onChange","busyElement","element","aria","ButtonBase","t0","$","_c","input","render","t1","undefined","messages","base","disabled","ref","ripple","t2","merged","T0","styleProps","t3","t4","t5","t6","t7","handlers","surface","Symbol","for","bb0","t8","state_0","selectedRender","t9","loading","t10","buttonContent","t11","label","labelPending","pending","selected","ToggleButtonBase","disabledByGroup","id","isDisabled","radio","toggleRender","toggleContent","RACLink","RACToggleButton"],"sources":["../../src/button/index.tsx"],"sourcesContent":["import type { DOMAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ButtonRenderProps, ClassNameOrFunction, ButtonProps as RACButtonProps, ToggleButtonProps as RACToggleButtonProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, Link as RACLink, ToggleButton as RACToggleButton } from 'react-aria-components';\nimport type { ElementProps } from '../render/aria';\nimport ProgressIndicator from '../components/progress-indicator';\nimport { useToggleGroupDisabled } from '../hooks/useToggleGroupDisabled';\nimport { useMessages } from '../i18n';\nimport { buttonRenderer, linkRenderer, toggleButtonRenderer } from '../render/aria';\nimport { mergeStatefulStyles } from '../styles/merge';\nimport { useRadioItem } from '../toggle-group';\nimport { useButtonBase } from './hooks';\nimport { buttonBaseStyles } from './styles';\n\n// The press-button core Button and IconButton both render through. A button\n// is React Aria's `Button`, its `Link` once given `href`, or its\n// `ToggleButton` inside a selecting group, and around each this adds what\n// React Aria leaves out: the ripple, the disabled state a parent's context\n// sets, the `aria-*` props and keyboard handlers it would drop or wrap, and\n// the ring drawn over the label while the button is pending, with the\n// `aria-busy` that says so. Each component\n// brings its own classes, as a function of the render state, and the call\n// site's `className` and `style` are merged over them.\n//\n// One module rather than a copy in each, since the copies had already drifted\n// once: IconButton read `ButtonContext` for a parent's disabled state and\n// Button did not. Not a component of the library's own and not exported from\n// the package; see `src/row` for the same arrangement around a list's row.\n\ntype ButtonBaseProps = {\n children?: ReactNode;\n /**\n * The component's own classes, from the render state. The call site's\n * `className` and `style` are merged over them.\n */\n classes: (state: ButtonClassesState) => ReturnType<typeof stylex.props>;\n className?: ClassNameOrFunction<ButtonState>;\n disableRipple?: boolean;\n href?: string;\n /**\n * A toggle's state, for a button that reports one through `aria-pressed`.\n * Left undefined, the button reports none. Handed to every function of the\n * render state, so the classes can draw it.\n */\n isSelected?: boolean;\n pendingLabel?: string;\n rel?: string;\n style?: StyleOrFunction<ButtonState>;\n target?: string;\n} & ButtonDOMProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>;\n\n// The state a component's own classes are handed: the render state above,\n// and whether the button is pending, so the classes can draw it. React\n// Aria's `Button` reports that and its `Link` and `ToggleButton` do not, so\n// it is optional — a link, and a toggle in a selecting group, are never\n// pending — and it stays out of ButtonState, which a call site's own\n// `className` and `style` are written against.\ntype ButtonClassesState = ButtonState & {\n isPending?: boolean;\n};\n\n// The props a button hands React Aria. React Aria types the global DOM events\n// — pointer, mouse, touch, wheel and the rest — against the element each\n// component renders, and a handler written for a <button> does not type-check\n// against an <a>. The keys are retyped against HTMLElement here so one set of\n// props serves both forms; the events React Aria defines itself (press,\n// focus, keyboard) keep its types, since it hands those its own event objects.\ntype ButtonDOMProps = Omit<RACButtonProps, 'children' | 'className' | 'style' | GlobalEventKey> & Pick<DOMAttributes<HTMLElement>, GlobalEventKey>;\n\n/**\n * The three forms a button takes, of which a call site writes exactly one:\n * a plain button, a link, or a toggle. Each names the props of the other two\n * as `never`, so a combination the rendered form would ignore — a toggle\n * given `href`, a link given `isPending` — is a compile error rather than a\n * prop that silently does nothing.\n */\ntype ButtonForm = ButtonLinkForm | ButtonPressForm | ButtonToggleForm;\ntype ButtonLinkForm = {\n defaultSelected?: never;\n /**\n * Where the button leads. Given one, the button is rendered as a link —\n * an `<a>`, announced as the link it is — with the same styles and ripple.\n * A link is never a toggle and never pending, and `render`, `type` and the\n * form props apply to the other two forms only.\n */\n href: string;\n isPending?: never;\n isSelected?: never;\n onChange?: never;\n pendingLabel?: never;\n /** The link's `rel`. */\n rel?: string;\n /** The link's `target`. */\n target?: string;\n};\ntype ButtonPressForm = {\n defaultSelected?: never;\n href?: never;\n isSelected?: never;\n onChange?: never;\n rel?: never;\n target?: never;\n};\n\n// The render state React Aria's three elements share. A className or style\n// function written against it serves the button, the link and the toggle\n// alike; `isPending` belongs to the button alone, and `isCurrent` to the\n// link, so neither is here. What the button draws while pending is decided\n// in `buttonContent`, which sees React Aria's own state rather than this one.\n//\n// `isSelected` is optional because only the toggle has one: React Aria hands\n// the button and the link a state without it and the toggle a state with\n// it, and a parameter type this wide accepts either.\ntype ButtonState = Pick<ButtonRenderProps, 'isDisabled' | 'isFocused' | 'isFocusVisible' | 'isHovered' | 'isPressed'> & {\n isSelected?: boolean;\n};\ntype ButtonToggleForm = {\n /**\n * Whether a toggle starts selected, when it keeps its own state. Passing\n * this, `isSelected` or `onChange` is what makes the button a toggle.\n */\n defaultSelected?: boolean;\n href?: never;\n /**\n * Whether a toggle is selected, when the call site holds the state. Pass\n * it with `onChange`; passing this, `defaultSelected` or `onChange` is what\n * makes the button a toggle. A value still loading may be `undefined` for a\n * while: the button stays the same element when it arrives.\n */\n isSelected?: boolean;\n /**\n * Called with the new state when a toggle is pressed. Passing this,\n * `isSelected` or `defaultSelected` is what makes the button a toggle.\n */\n onChange?: (isSelected: boolean) => void;\n rel?: never;\n target?: never;\n};\ntype GlobalEventKey = Exclude<keyof DOMAttributes<HTMLElement> & keyof RACButtonProps, 'onBlur' | 'onClick' | 'onFocus'>;\ntype ToggleButtonBaseProps = {\n children?: ReactNode;\n /** As for ButtonBase, handed `isSelected` as well. */\n classes: (state: ButtonState) => ReturnType<typeof stylex.props>;\n className?: ClassNameOrFunction<ButtonState>;\n defaultSelected?: boolean;\n disableRipple?: boolean;\n isSelected?: boolean;\n onChange?: (isSelected: boolean) => void;\n style?: StyleOrFunction<ButtonState>;\n} & ButtonDOMProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>;\n\n// A pending button says it is busy on the element itself. React Aria marks\n// it disabled and nests the ring's progress bar inside it, but a button's\n// children are presentational, and assistive technology that flattens them\n// never announces the bar. Only the button takes it, since a link is never\n// pending, and a call site's own `aria-busy` still wins.\nfunction busyElement(element: ElementProps, isPending: boolean) {\n return isPending ? {\n ...element,\n aria: {\n 'aria-busy': true,\n ...element.aria\n }\n } : element;\n}\n\n/**\n * A button drawn with the classes a component hands it: React Aria's\n * `Button`, or its `Link` given `href`. See the header.\n */\nfunction ButtonBase({\n children,\n classes,\n href,\n isPending = false,\n isSelected,\n pendingLabel,\n rel,\n render,\n target,\n ...input\n}: ButtonBaseProps) {\n const messages = useMessages();\n const base = useButtonBase(input, isPending);\n const {\n disabled,\n props,\n ref,\n ripple\n } = base;\n const merged = mergeStatefulStyles(classes, props);\n\n // A toggle is still React Aria's `Button`, which knows nothing of a\n // selected state, so the state goes onto the element as `aria-pressed` and\n // into every function of the render state from here. Being the same\n // component as the plain button is what keeps a button the same element\n // when it becomes a toggle — `isSelected` arriving once its data loads.\n const element = isSelected === undefined ? base.element : {\n ...base.element,\n aria: {\n ...base.element.aria,\n 'aria-pressed': isSelected\n }\n };\n const styleProps = isSelected === undefined ? merged : {\n className: (state: Parameters<typeof merged.className>[0]) => merged.className({\n ...state,\n isSelected\n }),\n style: (state: Parameters<typeof merged.style>[0]) => merged.style({\n ...state,\n isSelected\n })\n };\n if (href !== undefined) {\n return <RACLink href={href} isDisabled={disabled} ref={ref} rel={rel} render={linkRenderer(element)} target={target} {...ripple.handlers} {...props} {...styleProps}>\n {children}\n {ripple.surface}\n </RACLink>;\n }\n return <RACButton isDisabled={disabled} isPending={isPending} ref={ref} render={buttonRenderer(busyElement(element, isPending), selectedRender(render, isSelected))} {...ripple.handlers} {...props} {...styleProps}>\n {buttonContent(children, pendingLabel ?? messages.loading, ripple.surface)}\n </RACButton>;\n}\n\n// What the button draws: its label, hidden while the button is pending, with\n// the ring over it. The ring takes the button's own content colour rather\n// than the progress page's primary, which on a filled button is the fill\n// itself and so invisible. The label stays in the flow so the button keeps its\n// width, which is what stops a form jumping the moment it is submitted.\n// React Aria wants the progress bar in the accessibility tree as soon as the\n// button goes pending, so it is rendered from the render state rather than\n// after a delay.\n//\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler\n// memoises the result on its inputs.\nfunction buttonContent(children: ReactNode, pendingLabel: string, surface: ReactNode) {\n return (state: ButtonRenderProps) => <>\n <span {...stylex.props(buttonBaseStyles.label, state.isPending && buttonBaseStyles.labelPending)}>\n {children}\n </span>\n {state.isPending ? <span {...stylex.props(buttonBaseStyles.pending)}>\n <ProgressIndicator aria-label={pendingLabel} diameter=\"1em\" isIndeterminate tone=\"inherit\" variant=\"circular\" />\n </span> : null}\n {surface}\n </>;\n}\n\n// A toggle drawn through ButtonBase hands a call site's `render` the state of\n// React Aria's plain button, which has no `isSelected`; this fills it in.\nfunction selectedRender(render: RACButtonProps['render'], isSelected: boolean | undefined): RACButtonProps['render'] {\n if (render === undefined || isSelected === undefined) {\n return render;\n }\n // Through a binding rather than as a literal at the call: React Aria types\n // the state as its plain button's, and a call site's `render` is written\n // against ButtonState, which is that plus `isSelected`.\n return (props, state) => {\n const selected = {\n ...state,\n isSelected\n };\n return render(props, selected);\n };\n}\n\n/**\n * A toggle in a selecting group, drawn with the classes a component hands\n * it: React Aria's `ToggleButton`, which is what takes part in the group's\n * selection and reports its state through `aria-pressed`. A toggle on its\n * own is ButtonBase given `isSelected` instead — see there. React Aria's\n * toggle takes no pending state, so `isPending` reaches it only to keep the\n * ripple off.\n */\nfunction ToggleButtonBase({\n children,\n classes,\n defaultSelected,\n isPending = false,\n isSelected,\n onChange,\n render,\n ...input\n}: ToggleButtonBaseProps) {\n // A selecting ButtonGroup disables its toggles through React Aria's group\n // state, which no prop here carries, so the ripple would stay on in a\n // disabled group and answer a press with an animation. Handed on as the\n // toggle's own `isDisabled`, which is what React Aria makes of it anyway.\n const disabledByGroup = useToggleGroupDisabled(input.id);\n const {\n disabled,\n element,\n props,\n ref,\n ripple\n } = useButtonBase(disabledByGroup ? {\n ...input,\n isDisabled: true\n } : input, isPending);\n // A ButtonGroup choosing one button at a time is a radio group, and this\n // is each button's part in it; see src/toggle-group.\n const radio = useRadioItem(input.id);\n return <RACToggleButton {...radio} defaultSelected={defaultSelected} isDisabled={disabled} isSelected={isSelected} onChange={onChange} ref={ref} render={toggleButtonRenderer(element, toggleRender(render))} {...ripple.handlers} {...props} {...mergeStatefulStyles(classes, props)}>\n {toggleContent(children, ripple.surface)}\n </RACToggleButton>;\n}\n\n// What a toggle draws: its label and the ripple. No pending ring — see\n// ToggleButtonBase. Built by a call for the reason `buttonContent` is.\nfunction toggleContent(children: ReactNode, surface: ReactNode) {\n return () => <>\n {children}\n {surface}\n </>;\n}\n\n// A call site's `render` is written for React Aria's button, whose render\n// state says whether it is pending; a toggle's says nothing of it, and a\n// toggle never is. So the toggle hands that function its own state with\n// `isPending` filled in, which is what lets one `render` prop serve a button\n// whichever element it turns out to be.\nfunction toggleRender(render: RACButtonProps['render']): RACToggleButtonProps['render'] {\n if (render === undefined) {\n return undefined;\n }\n return (props, state) => render(props, {\n ...state,\n isPending: false\n });\n}\nexport type { ButtonClassesState, ButtonDOMProps, ButtonForm, ButtonLinkForm, ButtonPressForm, ButtonState, ButtonToggleForm };\nexport { ButtonBase, ToggleButtonBase };"],"mappings":";;;;;;;;;;;;;AA4JA,SAASyB,YAAYC,SAAuBJ,WAAoB;CAC9D,OAAOA,YAAY;EACjB,GAAGI;EACHC,MAAM;GACJ,aAAa;GACb,GAAGD,QAAQC;EACb;CACF,IAAID;AACN;;;;;AAMA,SAAAE,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAApB;CAAA,IAAAC;CAAA,IAAAI;CAAA,IAAAgB;CAAA,IAAAf;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAc;CAAA,IAAAC;CAAA,IAAAb;CAAA,IAAAS,EAAA,OAAAD,IAAA;EAAoB,CAAA,CAAAlB,UAAAC,SAAAI,MAAAM,WAAAY,IAAAjB,YAAAC,cAAAC,KAAAc,QAAAZ,QAAA,GAAAW,SAAAH;EAWFC,EAAA,KAAAD;EAAAC,EAAA,KAAAnB;EAAAmB,EAAA,KAAAlB;EAAAkB,EAAA,KAAAd;EAAAc,EAAA,KAAAE;EAAAF,EAAA,KAAAb;EAAAa,EAAA,KAAAZ;EAAAY,EAAA,KAAAX;EAAAW,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,MAAAT;CAAA,OAAA;EAAAV,WAAAmB,EAAA;EAAAlB,UAAAkB,EAAA;EAAAd,OAAAc,EAAA;EAAAE,QAAAF,EAAA;EAAAb,aAAAa,EAAA;EAAAZ,eAAAY,EAAA;EAAAX,MAAAW,EAAA;EAAAG,SAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAT,SAAAS,EAAA;CAAA;CAPhB,MAAAR,YAAAY,OAAAC,KAA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B,IAAA;EADrCC,KAAA,oBAAC0B,cAAD;GAAgB,GAAKJ;GAAwBhD;GAA6Be,YAAAA;GAAsBrB;GAAsBO;GAAee;GAAa,QAAAM;GAAmD,GAAMC;GAAe,GAAMhC;GAAK,GAAMiC;GAC7OC,UAAAA;EADkB,CAAA;EAEHlB,EAAA,MAAAP;EAAAO,EAAA,MAAAQ;EAAAR,EAAA,MAAAb;EAAAa,EAAA,MAAAN;EAAAM,EAAA,MAAAhB;EAAAgB,EAAA,MAAAyC;EAAAzC,EAAA,MAAAS;EAAAT,EAAA,MAAAU,OAAAU;EAAApB,EAAA,MAAAe;EAAAf,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAFbmB;AAEa;AAKtB,SAASwB,cAAc9D,UAAqBwC,SAAoB;CAC9D,aAAa,qBAAA,UAAA,EAAA,UAAA,CACRxC,UACAwC,OACH,EAAA,CAAA;AACJ;AAOA,SAASqB,aAAavC,QAAkE;CACtF,IAAIA,WAAWE,KAAAA,GACb;CAEF,QAAQrB,OAAOD,UAAUoB,OAAOnB,OAAO;EACrC,GAAGD;EACHS,WAAW;CACb,CAAC;AACH"}
|
package/dist/calendar/styles.js
CHANGED
|
@@ -26,8 +26,8 @@ const calendarStyles = {
|
|
|
26
26
|
},
|
|
27
27
|
cellDisabled: {
|
|
28
28
|
kWkggS: "xjbqb8w",
|
|
29
|
-
kVAM5u: "x1pojj9x",
|
|
30
|
-
kMwMTN: "x9w6zvh",
|
|
29
|
+
kVAM5u: "x1pojj9x xmnqt3w",
|
|
30
|
+
kMwMTN: "x9w6zvh x1bhcspo",
|
|
31
31
|
kkrTdU: "x1h6gzvc",
|
|
32
32
|
kAXs8y: "xr5dkdi",
|
|
33
33
|
$$css: true
|
|
@@ -44,9 +44,9 @@ const calendarStyles = {
|
|
|
44
44
|
$$css: true
|
|
45
45
|
},
|
|
46
46
|
cellInvalid: {
|
|
47
|
-
kWkggS: "
|
|
48
|
-
kVAM5u: "
|
|
49
|
-
kMwMTN: "
|
|
47
|
+
kWkggS: "xwi4nbo x1jzqe4",
|
|
48
|
+
kVAM5u: "xx78ee7 x1n2ykn",
|
|
49
|
+
kMwMTN: "x1l7c2jh x1k5gbb1",
|
|
50
50
|
$$css: true
|
|
51
51
|
},
|
|
52
52
|
cellRangeEnd: {
|
|
@@ -92,6 +92,11 @@ const calendarStyles = {
|
|
|
92
92
|
kMnn75: "x5lhwog",
|
|
93
93
|
$$css: true
|
|
94
94
|
},
|
|
95
|
+
cellUnavailableInRange: {
|
|
96
|
+
kkrTdU: "x1h6gzvc",
|
|
97
|
+
kMnn75: "x5lhwog",
|
|
98
|
+
$$css: true
|
|
99
|
+
},
|
|
95
100
|
chevron: {
|
|
96
101
|
kgeoSG: "x1cpjm7i",
|
|
97
102
|
kFcpXp: "x15kbrqr",
|
|
@@ -305,11 +310,11 @@ const dateLayers = {
|
|
|
305
310
|
$$css: true
|
|
306
311
|
},
|
|
307
312
|
invalidHovered: {
|
|
308
|
-
kWkggS: "
|
|
313
|
+
kWkggS: "x19qr8s6 x1jzqe4",
|
|
309
314
|
$$css: true
|
|
310
315
|
},
|
|
311
316
|
invalidPressed: {
|
|
312
|
-
kWkggS: "
|
|
317
|
+
kWkggS: "x14smkth x1jzqe4",
|
|
313
318
|
$$css: true
|
|
314
319
|
},
|
|
315
320
|
plainHovered: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["calendarStyles","cell","kgeoSG","kFcpXp","kEoFBp","kGNEyG","kWkggS","kZKoxP","kaIpWk","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kzqmXN","kjj79g","kb6lSQ","kLWn49","kqGvvJ","kUOVxO","kVAEAm","$$css","cellDisabled","kVAM5u","kAXs8y","cellInRange","kjBf7l","cellInvalid","cellRangeEnd","kT0f0o","kfmiAY","cellRangeStart","kVL7Gh","krdFHd","cellReadOnly","cellSelected","cellSelectedDisabled","cellToday","ksu8eU","kMzoRj","cellUnavailable","kMnn75","chevron","chevronGlyph","k3aq6I","chevronGlyphPrevious","chevronHidden","k33iCy","grid","kLvRdT","kheTzg","kPzzVL","header","kOIVth","kAzted","headerCell","headerCellDisabled","headerGroup","heading","kogj98","k9WMMc","menuArrow","kmuXW","menuArrowExpanded","menuButton","kGOzcv","kpsdNU","kg3NbH","menuCheck","menuItem","k3XXqK","menuItemDisabled","menuItemFocused","kInvED","kMeerF","menuItemSelected","menuList","kLZC3w","kPef9Z","kEafiO","kORKVm","month","ks0D6T","monthCaption","kGO01o","months","kumcoG","monthsStacked","root","kXwgrk","k7Eaqz","kmVPX3","dateLayers","inRangeHovered","inRangePressed","invalidHovered","invalidPressed","plainHovered","plainPressed","selectedHovered","selectedPressed","menuLayers"],"sources":["../../src/calendar/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, radii, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The styles Calendar and RangeCalendar both draw. Apart from either\n// component so the two cannot drift, and outside `src/components` because a\n// directory there is a public component with stories, a barrel entry and a\n// `styling.test.tsx` case — which shared styles are none of.\n//\n// The values are the date pickers page's docked calendar, named in\n// `src/components/calendar/index.tsx` along with the departures from it. What\n// is only a range's — the band between the two ends — takes its colours from\n// the modal date picker's range-selection tokens instead, since the docked\n// token set stops at the selected date; see `cellInRange`.\n//\n// Under forced colours a selected date and a range's band are fills, which\n// that mode paints in a system colour, so a calendar showed no selection and\n// no range there, only today's outline. Both take `Highlight` with\n// `HighlightText` over it, the pair the mode gives whatever is chosen, which\n// draws a range as one run from its first day to its last.\n//\n// They take the pair with `forced-color-adjust: none`. Left to adjust, the\n// mode lays a `Canvas` backplate behind every run of text, and a date in\n// `HighlightText` on that backplate is a blank box. With it off nothing is\n// forced on those cells, so they name a system colour for everything they\n// draw — the fill, the date, today's outline and the focus ring. A day ruled\n// out or disabled names none, so it hands itself back to the mode, apart from\n// the date a disabled calendar holds, which takes `GrayText` as its fill in\n// the same way; see `cellSelectedDisabled`.\n\n// One row of the grid. The weekday row and every week of dates are the same\n// 48dp, the page's date container and Compose's own row, so `headerCell`, the\n// room around each date and the room `months` reserves all follow this one\n// number — a row resized without the reservation following it would put the\n// calendar's height back on its month.\nconst ROW_BLOCK_SIZE = '48px';\n\n// The date's state layer: the 40dp circle a selected date fills and a hover\n// tints, inside the 48dp row and column it sits in.\nconst DATE_SIZE = '40px';\n\n// The room either side of a date's circle, which is the difference between\n// the two: the circle sits in the middle of its 48dp square.\nconst DATE_ROOM = `calc((${ROW_BLOCK_SIZE} - ${DATE_SIZE}) / 2)`;\n\n// A whole column: the page's 48dp date container, seven to a week. The grid\n// is at most seven of them and narrows with its container below that.\nconst WEEK_INLINE_SIZE = `calc(${ROW_BLOCK_SIZE} * 7)`;\n\n// What every press target in the calendar reaches to: the page's 48dp, for\n// controls drawn at 40.\nconst TARGET_REACH = `calc((${DATE_SIZE} - ${ROW_BLOCK_SIZE}) / 2)`;\n\n// The weeks the grid holds room for, which is the most any month occupies: a\n// 31-day month beginning on the last day of a week runs one day, then four\n// whole weeks, then two days. February 2026 is the other end at four. Holding\n// six draws every month in the box the longest one fills.\nconst WEEKS_HELD = 6;\n\n// The room one month is held at, the weekday row and the six weeks, which\n// the open month or year list takes too.\nconst MONTH_BLOCK_SIZE = `calc(${ROW_BLOCK_SIZE} * ${WEEKS_HELD} + ${ROW_BLOCK_SIZE})`;\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)';\nconst calendarStyles = {\n cell: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kzqmXN: \"x100vrsf\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n kqGvvJ: \"x8yh5r3\",\n kUOVxO: \"xvueqy4\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n cellDisabled: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x1pojj9x\",\n kMwMTN: \"x9w6zvh\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n cellInRange: {\n kWkggS: \"x15dekr4 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n kaIpWk: \"x2u8bby\",\n kMwMTN: \"x1sawysd x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xrxpjvj\",\n kjBf7l: \"xrgy624 x3teovq\",\n $$css: true\n },\n cellInvalid: {\n kWkggS: \"x1skwi6t x1jzqe4\",\n kVAM5u: \"xpdgbdc x1n2ykn\",\n kMwMTN: \"x16elhoc x1k5gbb1\",\n $$css: true\n },\n cellRangeEnd: {\n kT0f0o: \"x187kppt\",\n kfmiAY: \"x1fpsnkq\",\n $$css: true\n },\n cellRangeStart: {\n kVL7Gh: \"x17kgqx\",\n krdFHd: \"x1uni95s\",\n $$css: true\n },\n cellReadOnly: {\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n cellSelected: {\n kWkggS: \"xnety89 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n kjBf7l: \"xrgy624 x3teovq\",\n $$css: true\n },\n cellSelectedDisabled: {\n kWkggS: \"x19v6zzp x1o55y2u\",\n kVAM5u: \"x9r1u3d xmnqt3w\",\n kMwMTN: \"x9w6zvh x1a46atw\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n cellToday: {\n kVAM5u: \"x1uajy3w\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n cellUnavailable: {\n kWkggS: \"xjbqb8w\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n kMnn75: \"x5lhwog\",\n $$css: true\n },\n chevron: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n kUOVxO: \"x34s64n\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n chevronGlyph: {\n kZKoxP: \"xxk0z11\",\n kzqmXN: \"xvy4d1p\",\n k3aq6I: \"x19axjrm x1c071of\",\n $$css: true\n },\n chevronGlyphPrevious: {\n k3aq6I: \"xdg80k9 xpk2tj9\",\n $$css: true\n },\n chevronHidden: {\n k33iCy: \"xlshs6z\",\n $$css: true\n },\n grid: {\n kLvRdT: \"x1vathgz\",\n kheTzg: \"x1gukg7c\",\n kzqmXN: \"xh8yej3\",\n kPzzVL: \"x140o2bo\",\n $$css: true\n },\n header: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"x126z3so\",\n kjj79g: \"x1qughib\",\n kAzted: \"x1ba4aug\",\n $$css: true\n },\n headerCell: {\n kZKoxP: \"xsdox4t\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n $$css: true\n },\n headerCellDisabled: {\n kMwMTN: \"x9w6zvh\",\n $$css: true\n },\n headerGroup: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n $$css: true\n },\n heading: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kogj98: \"x1ghz6dp\",\n k9WMMc: \"x2b8uid\",\n $$css: true\n },\n menuArrow: {\n kZKoxP: \"xmix8c7\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1xp8n7a\",\n $$css: true\n },\n menuArrowExpanded: {\n k3aq6I: \"x19jd1h0\",\n $$css: true\n },\n menuButton: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1sk10ar\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1rv7mn0\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"xzoy561\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kg3NbH: \"xn60lsn\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n menuCheck: {\n kZKoxP: \"xxk0z11\",\n kMwMTN: \"x139gbkf\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n menuItem: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"xbg5kjn\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n k3XXqK: \"x1t137rt\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n menuItemDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x9w6zvh\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n menuItemFocused: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n menuItemSelected: {\n kWkggS: \"xkrgufg\",\n $$css: true\n },\n menuList: {\n kZKoxP: \"xmmrubu\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x178xt8z\",\n kB7OPa: \"x9f619\",\n kUOVxO: \"xnx04jz\",\n k3XXqK: \"x1t137rt\",\n kORKVm: \"x1odjw0f\",\n $$css: true\n },\n month: {\n kB7OPa: \"x9f619\",\n kzqmXN: \"x1url4ad\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n monthCaption: {\n kGNEyG: \"xpqajaz\",\n kZKoxP: \"xsdox4t\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"x1s85apg x1dstske\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kGO01o: \"xqf7pud\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n months: {\n kGNEyG: \"x7a106z\",\n k1xSpc: \"x78zum5 x1yrkhk\",\n kOIVth: \"xj2l1yv\",\n kumcoG: \"x1kji8p3\",\n kAzted: \"x8chfrn\",\n $$css: true\n },\n monthsStacked: {\n kAzted: \"x8chfrn x1e8x83n\",\n $$css: true\n },\n root: {\n kWkggS: \"xvkjz1l\",\n kaIpWk: \"xhpdng0\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x1gka490\",\n kzqmXN: \"xeq5yr9\",\n ks0D6T: \"x193iq5w\",\n k7Eaqz: \"xjrddbv\",\n kmVPX3: \"xa36j16\",\n $$css: true\n }\n};\n\n// A date's hover and pressed layers, one pair per ground it sits on: nothing,\n// the range band, the selected circle, and the invalid one. From React Aria's\n// render state rather than `:hover` and `:active`, for Button's reasons — see\n// its header: a hover layer stayed on after a tap, and no pressed layer\n// showed for a press made from the keyboard.\n// Each layer is written whole for its ground because StyleX replaces a\n// property whole, and the band and the circles keep their forced-colours\n// `Highlight` under the layer.\nconst dateLayers = {\n inRangeHovered: {\n kWkggS: \"x3zumxv x1jzqe4\",\n $$css: true\n },\n inRangePressed: {\n kWkggS: \"x1as5h4c x1jzqe4\",\n $$css: true\n },\n invalidHovered: {\n kWkggS: \"xbw18ef x1jzqe4\",\n $$css: true\n },\n invalidPressed: {\n kWkggS: \"xld5jmv x1jzqe4\",\n $$css: true\n },\n plainHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n plainPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n selectedHovered: {\n kWkggS: \"xo1ct44 x1jzqe4\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"x7b25lv x1jzqe4\",\n $$css: true\n }\n};\n\n// A list row's hover and pressed layers over the checked row's surface\n// variant. Over nothing a row takes a date's own pair, `dateLayers.plain*`,\n// since the page gives both the same on-surface layer.\nconst menuLayers = {\n selectedHovered: {\n kWkggS: \"xgw93rf\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"x113d7pk\",\n $$css: true\n }\n};\nexport { calendarStyles, dateLayers, menuLayers };"],"mappings":";AAoEA,MAAMA,iBAAiB;CACrBC,MAAM;EACJC,QAAQ;EACRC,QA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EACdzF,QAAQ;EACRiB,OAAO;CACT;CACAyE,gBAAgB;EACd1F,QAAQ;EACRiB,OAAO;CACT;CACA0E,gBAAgB;EACd3F,QAAQ;EACRiB,OAAO;CACT;CACA2E,gBAAgB;EACd5F,QAAQ;EACRiB,OAAO;CACT;CACA4E,cAAc;EACZ7F,QAAQ;EACRiB,OAAO;CACT;CACA6E,cAAc;EACZ9F,QAAQ;EACRiB,OAAO;CACT;CACA8E,iBAAiB;EACf/F,QAAQ;EACRiB,OAAO;CACT;CACA+E,iBAAiB;EACfhG,QAAQ;EACRiB,OAAO;CACT;AACF;AAKA,MAAMgF,aAAa;CACjBF,iBAAiB;EACf/F,QAAQ;EACRiB,OAAO;CACT;CACA+E,iBAAiB;EACfhG,QAAQ;EACRiB,OAAO;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"styles.js","names":["calendarStyles","cell","kgeoSG","kFcpXp","kEoFBp","kGNEyG","kWkggS","kZKoxP","kaIpWk","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kzqmXN","kjj79g","kb6lSQ","kLWn49","kqGvvJ","kUOVxO","kVAEAm","$$css","cellDisabled","kVAM5u","kAXs8y","cellInRange","kjBf7l","cellInvalid","cellRangeEnd","kT0f0o","kfmiAY","cellRangeStart","kVL7Gh","krdFHd","cellReadOnly","cellSelected","cellSelectedDisabled","cellToday","ksu8eU","kMzoRj","cellUnavailable","kMnn75","cellUnavailableInRange","chevron","chevronGlyph","k3aq6I","chevronGlyphPrevious","chevronHidden","k33iCy","grid","kLvRdT","kheTzg","kPzzVL","header","kOIVth","kAzted","headerCell","headerCellDisabled","headerGroup","heading","kogj98","k9WMMc","menuArrow","kmuXW","menuArrowExpanded","menuButton","kGOzcv","kpsdNU","kg3NbH","menuCheck","menuItem","k3XXqK","menuItemDisabled","menuItemFocused","kInvED","kMeerF","menuItemSelected","menuList","kLZC3w","kPef9Z","kEafiO","kORKVm","month","ks0D6T","monthCaption","kGO01o","months","kumcoG","monthsStacked","root","kXwgrk","k7Eaqz","kmVPX3","dateLayers","inRangeHovered","inRangePressed","invalidHovered","invalidPressed","plainHovered","plainPressed","selectedHovered","selectedPressed","menuLayers"],"sources":["../../src/calendar/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, radii, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The styles Calendar and RangeCalendar both draw. Apart from either\n// component so the two cannot drift, and outside `src/components` because a\n// directory there is a public component with stories, a barrel entry and a\n// `styling.test.tsx` case — which shared styles are none of.\n//\n// The values are the date pickers page's docked calendar, named in\n// `src/components/calendar/index.tsx` along with the departures from it. What\n// is only a range's — the band between the two ends — takes its colours from\n// the modal date picker's range-selection tokens instead, since the docked\n// token set stops at the selected date; see `cellInRange`.\n//\n// Under forced colours a selected date and a range's band are fills, which\n// that mode paints in a system colour, so a calendar showed no selection and\n// no range there, only today's outline. Both take `Highlight` with\n// `HighlightText` over it, the pair the mode gives whatever is chosen, which\n// draws a range as one run from its first day to its last.\n//\n// They take the pair with `forced-color-adjust: none`. Left to adjust, the\n// mode lays a `Canvas` backplate behind every run of text, and a date in\n// `HighlightText` on that backplate is a blank box. With it off nothing is\n// forced on those cells, so they name a system colour for everything they\n// draw — the fill, the date, today's outline and the focus ring. A day ruled\n// out or disabled stays adjusted, which keeps the backplate behind its text.\n// A ruled-out day names nothing and keeps the mode's colours, its\n// strikethrough being the cue — apart from one inside a range, which keeps\n// the band's pair under its strikethrough, so the run does not break around\n// it; see `cellUnavailableInRange`. A disabled day names `GrayText` for its\n// date and outline, since the mode gives an `aria-disabled` cell no colour of its\n// own; see `cellDisabled`. The date a disabled calendar holds takes\n// `GrayText` as its fill instead; see `cellSelectedDisabled`.\n\n// One row of the grid. The weekday row and every week of dates are the same\n// 48dp, the page's date container and Compose's own row, so `headerCell`, the\n// room around each date and the room `months` reserves all follow this one\n// number — a row resized without the reservation following it would put the\n// calendar's height back on its month.\nconst ROW_BLOCK_SIZE = '48px';\n\n// The date's state layer: the 40dp circle a selected date fills and a hover\n// tints, inside the 48dp row and column it sits in.\nconst DATE_SIZE = '40px';\n\n// The room either side of a date's circle, which is the difference between\n// the two: the circle sits in the middle of its 48dp square.\nconst DATE_ROOM = `calc((${ROW_BLOCK_SIZE} - ${DATE_SIZE}) / 2)`;\n\n// A whole column: the page's 48dp date container, seven to a week. The grid\n// is at most seven of them and narrows with its container below that.\nconst WEEK_INLINE_SIZE = `calc(${ROW_BLOCK_SIZE} * 7)`;\n\n// What every press target in the calendar reaches to: the page's 48dp, for\n// controls drawn at 40.\nconst TARGET_REACH = `calc((${DATE_SIZE} - ${ROW_BLOCK_SIZE}) / 2)`;\n\n// The weeks the grid holds room for, which is the most any month occupies: a\n// 31-day month beginning on the last day of a week runs one day, then four\n// whole weeks, then two days. February 2026 is the other end at four. Holding\n// six draws every month in the box the longest one fills.\nconst WEEKS_HELD = 6;\n\n// The room one month is held at, the weekday row and the six weeks, which\n// the open month or year list takes too.\nconst MONTH_BLOCK_SIZE = `calc(${ROW_BLOCK_SIZE} * ${WEEKS_HELD} + ${ROW_BLOCK_SIZE})`;\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)';\nconst calendarStyles = {\n cell: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kzqmXN: \"x100vrsf\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n kqGvvJ: \"x8yh5r3\",\n kUOVxO: \"xvueqy4\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n cellDisabled: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x1pojj9x xmnqt3w\",\n kMwMTN: \"x9w6zvh x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n cellInRange: {\n kWkggS: \"x15dekr4 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n kaIpWk: \"x2u8bby\",\n kMwMTN: \"x1sawysd x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xrxpjvj\",\n kjBf7l: \"xrgy624 x3teovq\",\n $$css: true\n },\n cellInvalid: {\n kWkggS: \"xwi4nbo x1jzqe4\",\n kVAM5u: \"xx78ee7 x1n2ykn\",\n kMwMTN: \"x1l7c2jh x1k5gbb1\",\n $$css: true\n },\n cellRangeEnd: {\n kT0f0o: \"x187kppt\",\n kfmiAY: \"x1fpsnkq\",\n $$css: true\n },\n cellRangeStart: {\n kVL7Gh: \"x17kgqx\",\n krdFHd: \"x1uni95s\",\n $$css: true\n },\n cellReadOnly: {\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n cellSelected: {\n kWkggS: \"xnety89 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n kjBf7l: \"xrgy624 x3teovq\",\n $$css: true\n },\n cellSelectedDisabled: {\n kWkggS: \"x19v6zzp x1o55y2u\",\n kVAM5u: \"x9r1u3d xmnqt3w\",\n kMwMTN: \"x9w6zvh x1a46atw\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n cellToday: {\n kVAM5u: \"x1uajy3w\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n cellUnavailable: {\n kWkggS: \"xjbqb8w\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n kMnn75: \"x5lhwog\",\n $$css: true\n },\n cellUnavailableInRange: {\n kkrTdU: \"x1h6gzvc\",\n kMnn75: \"x5lhwog\",\n $$css: true\n },\n chevron: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n kUOVxO: \"x34s64n\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n chevronGlyph: {\n kZKoxP: \"xxk0z11\",\n kzqmXN: \"xvy4d1p\",\n k3aq6I: \"x19axjrm x1c071of\",\n $$css: true\n },\n chevronGlyphPrevious: {\n k3aq6I: \"xdg80k9 xpk2tj9\",\n $$css: true\n },\n chevronHidden: {\n k33iCy: \"xlshs6z\",\n $$css: true\n },\n grid: {\n kLvRdT: \"x1vathgz\",\n kheTzg: \"x1gukg7c\",\n kzqmXN: \"xh8yej3\",\n kPzzVL: \"x140o2bo\",\n $$css: true\n },\n header: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"x126z3so\",\n kjj79g: \"x1qughib\",\n kAzted: \"x1ba4aug\",\n $$css: true\n },\n headerCell: {\n kZKoxP: \"xsdox4t\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n $$css: true\n },\n headerCellDisabled: {\n kMwMTN: \"x9w6zvh\",\n $$css: true\n },\n headerGroup: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n $$css: true\n },\n heading: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kogj98: \"x1ghz6dp\",\n k9WMMc: \"x2b8uid\",\n $$css: true\n },\n menuArrow: {\n kZKoxP: \"xmix8c7\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1xp8n7a\",\n $$css: true\n },\n menuArrowExpanded: {\n k3aq6I: \"x19jd1h0\",\n $$css: true\n },\n menuButton: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1sk10ar\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1rv7mn0\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"xzoy561\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kg3NbH: \"xn60lsn\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n menuCheck: {\n kZKoxP: \"xxk0z11\",\n kMwMTN: \"x139gbkf\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n menuItem: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"xbg5kjn\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n k3XXqK: \"x1t137rt\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n menuItemDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x9w6zvh\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n menuItemFocused: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n menuItemSelected: {\n kWkggS: \"xkrgufg\",\n $$css: true\n },\n menuList: {\n kZKoxP: \"xmmrubu\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x178xt8z\",\n kB7OPa: \"x9f619\",\n kUOVxO: \"xnx04jz\",\n k3XXqK: \"x1t137rt\",\n kORKVm: \"x1odjw0f\",\n $$css: true\n },\n month: {\n kB7OPa: \"x9f619\",\n kzqmXN: \"x1url4ad\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n monthCaption: {\n kGNEyG: \"xpqajaz\",\n kZKoxP: \"xsdox4t\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"x1s85apg x1dstske\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kGO01o: \"xqf7pud\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n months: {\n kGNEyG: \"x7a106z\",\n k1xSpc: \"x78zum5 x1yrkhk\",\n kOIVth: \"xj2l1yv\",\n kumcoG: \"x1kji8p3\",\n kAzted: \"x8chfrn\",\n $$css: true\n },\n monthsStacked: {\n kAzted: \"x8chfrn x1e8x83n\",\n $$css: true\n },\n root: {\n kWkggS: \"xvkjz1l\",\n kaIpWk: \"xhpdng0\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x1gka490\",\n kzqmXN: \"xeq5yr9\",\n ks0D6T: \"x193iq5w\",\n k7Eaqz: \"xjrddbv\",\n kmVPX3: \"xa36j16\",\n $$css: true\n }\n};\n\n// A date's hover and pressed layers, one pair per ground it sits on: nothing,\n// the range band, the selected circle, and the invalid one. From React Aria's\n// render state rather than `:hover` and `:active`, for Button's reasons — see\n// its header: a hover layer stayed on after a tap, and no pressed layer\n// showed for a press made from the keyboard.\n// Each layer is written whole for its ground because StyleX replaces a\n// property whole, and the band and the circles keep their forced-colours\n// `Highlight` under the layer.\nconst dateLayers = {\n inRangeHovered: {\n kWkggS: \"x3zumxv x1jzqe4\",\n $$css: true\n },\n inRangePressed: {\n kWkggS: \"x1as5h4c x1jzqe4\",\n $$css: true\n },\n invalidHovered: {\n kWkggS: \"x19qr8s6 x1jzqe4\",\n $$css: true\n },\n invalidPressed: {\n kWkggS: \"x14smkth x1jzqe4\",\n $$css: true\n },\n plainHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n plainPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n selectedHovered: {\n kWkggS: \"xo1ct44 x1jzqe4\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"x7b25lv x1jzqe4\",\n $$css: true\n }\n};\n\n// A list row's hover and pressed layers over the checked row's surface\n// variant. Over nothing a row takes a date's own pair, `dateLayers.plain*`,\n// since the page gives both the same on-surface layer.\nconst menuLayers = {\n selectedHovered: {\n kWkggS: \"xgw93rf\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"x113d7pk\",\n $$css: true\n }\n};\nexport { calendarStyles, dateLayers, menuLayers };"],"mappings":";AAyEA,MAAMA,iBAAiB;CACrBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QA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AAQ;EACRiB,OAAO;CACT;CACA2E,gBAAgB;EACd5F,QAAQ;EACRiB,OAAO;CACT;CACA4E,gBAAgB;EACd7F,QAAQ;EACRiB,OAAO;CACT;CACA6E,cAAc;EACZ9F,QAAQ;EACRiB,OAAO;CACT;CACA8E,cAAc;EACZ/F,QAAQ;EACRiB,OAAO;CACT;CACA+E,iBAAiB;EACfhG,QAAQ;EACRiB,OAAO;CACT;CACAgF,iBAAiB;EACfjG,QAAQ;EACRiB,OAAO;CACT;AACF;AAKA,MAAMiF,aAAa;CACjBF,iBAAiB;EACfhG,QAAQ;EACRiB,OAAO;CACT;CACAgF,iBAAiB;EACfjG,QAAQ;EACRiB,OAAO;CACT;AACF"}
|
package/dist/chip/label.js
CHANGED
package/dist/chip/label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","names":["stylex","useClippedTitle","chipStyles","ChipLabel","t0","$","_c","children","clipped","t1","Symbol","for","label","t2"],"sources":["../../src/chip/label.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useClippedTitle } from '../hooks/useClippedTitle';\nimport { chipStyles } from './styles';\n\n// Apart from ./index.tsx so that file keeps to the helpers it shares and this\n// one to the component, which is what keeps fast refresh working for both.\n\n// The span `chipLabel` draws, as a component, since the title is state and\n// `chipLabel` is called from React Aria's render functions.\nfunction ChipLabel({\n children\n}: {\n children: ReactNode;\n}) {\n const clipped = useClippedTitle(children);\n return <span {...clipped} {...stylex.props(chipStyles.label)}>\n {children}\n </span>;\n}\nexport { ChipLabel };"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"label.js","names":["stylex","useClippedTitle","chipStyles","ChipLabel","t0","$","_c","children","clipped","t1","Symbol","for","label","t2"],"sources":["../../src/chip/label.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useClippedTitle } from '../hooks/useClippedTitle';\nimport { chipStyles } from './styles';\n\n// Apart from ./index.tsx so that file keeps to the helpers it shares and this\n// one to the component, which is what keeps fast refresh working for both.\n\n// The span `chipLabel` draws, as a component, since the title is state and\n// `chipLabel` is called from React Aria's render functions.\n//\n// `dir=\"auto\"` runs the label the way its own first strong letter says, and\n// `chipStyles.label` isolates it from the text around it, as a `<bdi>` is: a\n// label is the call site's text, often a tag or a mention, and a leading `#`\n// or `@` is a neutral character that otherwise takes the page's direction —\n// `#first` read `first#` in a right-to-left page. A label with no strong\n// letter at all, a count, runs left to right, the way its digits read in\n// either direction.\nfunction ChipLabel({\n children\n}: {\n children: ReactNode;\n}) {\n const clipped = useClippedTitle(children);\n return <span dir=\"auto\" {...clipped} {...stylex.props(chipStyles.label)}>\n {children}\n </span>;\n}\nexport { ChipLabel };"],"mappings":";;;;;;AAkBA,SAAAG,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAmB,MAAA,EAAAC,aAAAH;CAKjB,MAAAI,UAAgBP,gBAAgBM,QAAQ;CAAE,IAAAE;CAAA,IAAAJ,EAAA,OAAAK,OAAAC,IAAA,2BAAA,GAAA;EACDF,KAAAT,MAAaE,WAAUU,KAAM;EAACP,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAE,YAAAF,EAAA,OAAAG,SAAA;EAAhEK,KAAA,oBAAA,QAAA;GAAU,KAAA;GAAM,GAAKL;GAAO,GAAMC;GACpCF;EACI,CAAA;EAAAF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAFFQ;AAEE"}
|
package/dist/chip/styles.js
CHANGED
package/dist/chip/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["chipStyles","assist","kMwMTN","$$css","base","k6CgDc","kGNEyG","kZKoxP","kaIpWk","ksu8eU","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","ks0D6T","k8WAf4","kg3NbH","kIyJzY","k1ekBW","kAMwcw","disabled","disabledSelected","kWkggS","disabledUnselected","kVAM5u","elevated","elevatedDisabled","kGVxlE","glyph","kzqmXN","kjj79g","keTefX","glyphFolded","k71WvV","kSiTet","glyphOpening","kVQacm","glyphSvg","icon","inert","label","kg5iWk","khDVqt","raised","raisedHovered","remove","kgeoSG","kFcpXp","kEoFBp","kjBf7l","kInvED","k3XXqK","kMeerF","kmVPX3","kVAEAm","removeDisabled","removeGlyph","selected","selectedHovered","surfaceCorners","target","kGOzcv","kpsdNU","trailing","unselected","chipLayers","elevatedFocused","elevatedHovered","elevatedPressed","removeHovered","removePressed","selectedFocused","selectedPressed","unselectedFocused","unselectedHovered","unselectedPressed"],"sources":["../../src/chip/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The pill the chips page draws, shared by the three components that draw\n// one: Chip, which is a toggle on its own or one of the page's two action\n// chips; ChipGroup's chip, which is one of a set that can also be removed;\n// and TokenField's token, which takes `base` and `unselected` alone — a token\n// is not selectable, so it reaches for neither the selected container nor\n// the check below. The measurements and roles are the page's filter chip — a\n// 32dp container with an 8dp corner and 16dp of inline padding, an outline\n// variant border while unselected, the secondary container pair once\n// selected.\n//\n// The assist and suggestion chips are that unselected pill, never selected.\n// The page's only difference between them is the label: on surface on an\n// assist chip, on surface variant on a suggestion chip as on a filter one.\n//\n// **An elevated chip trades the outline for a container**, surface container\n// low at the page's elevation 1, raised to 2 under a hovering pointer and\n// back to 1 while pressed, since a mouse press does not end the hover. A\n// selected one keeps the secondary container and takes the shadow with it.\n// Its 1px border stays, transparent, as every chip's does: a forced-colours\n// mode paints a transparent border in its text colour and drops the shadow\n// and the fill, so the border is the boundary left there.\n//\n// **A flat chip lies on the page, apart from one state.** A selected filter\n// chip under a hovering pointer rises to elevation 1, and comes back down\n// while pressed, as the page's filter chip tokens give it; every other flat\n// state, and every state of an input chip, stays at 0.\n//\n// **A disabled chip is translucent**, its content at 38% and its container at\n// 12% of on surface over whatever is behind it, as the page gives them,\n// rather than mixed into the surface. Mixed into the surface, a disabled chip\n// on a coloured container drew an opaque pale patch with grey text on it.\n//\n// **A label with no room on one line is cut short, never wrapped.** The\n// container is a fixed 32dp, so a second line has nowhere to go but out of\n// the pill: a chip or a token in a room narrower than its label drew the\n// rest below its own edge, and a chip in a group's row ran past the row's\n// end instead. The pill is held to the room it is in, and the label sits in\n// a span of its own that ends in an ellipsis where the pill does — a span,\n// because a flex container ignores `text-overflow`, which is also why\n// Material's own chips carry one. The whole label stays in the DOM, so a\n// screen reader still reads all of it.\n//\n// Each state composites an on-colour over its own container at the\n// interaction state's opacity rather than swapping in a separate hover\n// colour. `calc(<opacity> * 100%)` turns the token's unitless 0-1 ratio into\n// the percentage `color-mix()` takes, and it is inlined at each property\n// because @stylexjs/babel-plugin only statically recognises expressions\n// written directly as property values.\n//\n// The selected chip drops its border rather than recolouring it: it has a\n// container of its own to define its edge, and a border on top of that reads\n// as a second, competing outline.\n//\n// Disabled is applied from render state rather than from `:disabled`. Chip is\n// a button and would match the pseudo-class; a chip in a group is React\n// Aria's `Tag`, which is a div and never will. One mechanism serves both, and\n// StyleX replaces a property whole, so the disabled styles take the hover and\n// pressed branches of whichever state they are applied over.\n//\n// A selected chip carries the page's check before its label, which is what\n// makes the selection legible without colour. The two containers differ in\n// colour alone, and under a scheme whose secondary container sits close to\n// the surface — or for a reader who does not see colour — that is no\n// difference at all.\n//\n// The chip widens when the check appears, and that is the page's behaviour\n// rather than a cost of drawing it: a chip is flow content, laid out in a\n// row that wraps, so nothing around it has a width to hold. A segmented\n// button's segments are equal columns of one track, which is a different\n// geometry answering a different question, and the two should not be read\n// across. A chip given an icon does not widen, since the check takes the\n// icon's place in the same slot.\n//\n// **A filter chip can carry an icon after its label as well**, the page's\n// trailing icon, which is what draws its dropdown filter chip: an arrow\n// saying the chip opens a menu. It takes the same 18dp slot at the other\n// end, and the chip's content role rather than the primary one the leading\n// icon takes — on surface variant, then on secondary container once\n// selected, then the disabled 38% — so it is drawn in the chip's own colour\n// rather than a role of its own. The check never displaces it.\n//\n// **The widening is animated rather than taken in one frame.** A chip with\n// no icon keeps its slot mounted while unselected, folded to nothing, and\n// selecting it opens the slot over the chip's own short duration while the\n// check fades in, so the chips after it in a wrapped row glide rather than\n// jump 18dp. Reduced motion takes the change at once, as it does the\n// colours. A chip that can never be selected, an assist or suggestion chip\n// or one in a group that does not select, has no slot to open.\n//\n// **The press ripple takes the chip's corner from here** wherever the chip\n// is a ChipGroup's. The ripple clips itself to its host's corner by\n// inheriting it, and React Aria puts a cell between a group's chip and its\n// content, so what the ripple would inherit is the cell's square corner.\n// `surfaceCorners` restates the chip's own corner on a box the ripple sits\n// in, less the 1px border every chip keeps, since the ripple fills the\n// inside of that border.\n//\n// Apart from any component so a chip in a group and a chip on its own cannot\n// drift; see `src/row` for the same arrangement around a list's row.\n\n// The press area the chips page requires around its 32dp chip. A literal for\n// the reason IconButton's `TARGET_SIZE` gives.\nconst TARGET_SIZE = '48px';\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)';\nconst chipStyles = {\n assist: {\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n base: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"xig8zya\",\n kaIpWk: \"x1xdvaa9\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n ks0D6T: \"x193iq5w\",\n k8WAf4: \"xt970qd\",\n kg3NbH: \"x790zyz\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xu8237s\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n disabled: {\n kMwMTN: \"x1gpw424 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n disabledSelected: {\n kWkggS: \"x19v6zzp\",\n $$css: true\n },\n disabledUnselected: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"xrh88j3 xmnqt3w\",\n $$css: true\n },\n elevated: {\n kWkggS: \"x1vnz5z6\",\n kVAM5u: \"x9r1u3d\",\n $$css: true\n },\n elevatedDisabled: {\n kWkggS: \"x19v6zzp\",\n kVAM5u: \"x9r1u3d\",\n kGVxlE: \"x1gnnqk1\",\n $$css: true\n },\n glyph: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"xmix8c7\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kGuDYH: \"xosj86m\",\n kzqmXN: \"x1xp8n7a\",\n kjj79g: \"xl56j7k\",\n keTefX: \"xxuhe3a\",\n $$css: true\n },\n glyphFolded: {\n kzqmXN: \"xnalus7\",\n k71WvV: \"x1kfc2zf\",\n keTefX: \"x1lziwak\",\n kSiTet: \"xg01cxk\",\n $$css: true\n },\n glyphOpening: {\n k6CgDc: \"x12w9bfk\",\n kVQacm: \"xb3r6kr\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x17vvy08\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n glyphSvg: {\n kZKoxP: \"xmix8c7\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1xp8n7a\",\n $$css: true\n },\n icon: {\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n inert: {\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n label: {\n kB7OPa: \"x9f619\",\n kVQacm: \"xb3r6kr\",\n kg5iWk: \"xlyipyv\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n raised: {\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n raisedHovered: {\n kGVxlE: \"x1os83gw\",\n $$css: true\n },\n remove: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"xtu493u\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"xmix8c7\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1xp8n7a\",\n kjj79g: \"xl56j7k\",\n k71WvV: \"x1kfc2zf\",\n kjBf7l: \"x14ytart\",\n kInvED: \"x1y3gkto\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1717udv\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n removeDisabled: {\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n removeGlyph: {\n kZKoxP: \"xmix8c7\",\n kzqmXN: \"x1xp8n7a\",\n $$css: true\n },\n selected: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n selectedHovered: {\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n surfaceCorners: {\n kaIpWk: \"x5a2xki\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"xjp7ctv\",\n $$css: true\n },\n target: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1xkszu9\",\n kpsdNU: \"x1ecwmwu\",\n kEoFBp: \"x1hmns74\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n trailing: {\n k71WvV: \"x1kfc2zf\",\n keTefX: \"x1lziwak\",\n $$css: true\n },\n unselected: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x133yhug\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n }\n};\n\n// The hover and pressed layers, applied from React Aria's render state rather\n// than from `:hover` and `:active`, for Button's reasons — see its header: a\n// hover layer stayed on after a tap, and no pressed layer showed for a press\n// made from the keyboard. One pair per container, the pressed after the\n// hovered so a press wins, and one for the close target, whose own render\n// state is its button's. A token in a TokenField draws none of them: React\n// Aria reports neither state for one, since it is text the caret moves\n// through rather than a control a press acts on.\nconst chipLayers = {\n elevatedFocused: {\n kWkggS: \"x1drsm1c\",\n $$css: true\n },\n elevatedHovered: {\n kWkggS: \"x1ei6177\",\n $$css: true\n },\n elevatedPressed: {\n kWkggS: \"x1vt8e7r\",\n $$css: true\n },\n removeHovered: {\n kWkggS: \"x930l3l\",\n $$css: true\n },\n removePressed: {\n kWkggS: \"xsykwg8\",\n $$css: true\n },\n selectedFocused: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n selectedHovered: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n unselectedFocused: {\n kWkggS: \"xwqhyid\",\n $$css: true\n },\n unselectedHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n unselectedPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n }\n};\nexport { chipLayers, chipStyles };"],"mappings":";AAiHA,MAAMA,aAAa;CACjBC,QAAQ;EACNC,QAAQ;EACRC,OAAO;CACT;CACAC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ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pD,QAAQ;EACR1B,OAAO;CACT;CACA+E,mBAAmB;EACjBrD,QAAQ;EACR1B,OAAO;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"styles.js","names":["chipStyles","assist","kMwMTN","$$css","base","k6CgDc","kGNEyG","kZKoxP","kaIpWk","ksu8eU","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","ks0D6T","k8WAf4","kg3NbH","kIyJzY","k1ekBW","kAMwcw","disabled","disabledSelected","kWkggS","disabledUnselected","kVAM5u","elevated","elevatedDisabled","kGVxlE","glyph","kzqmXN","kjj79g","keTefX","glyphFolded","k71WvV","kSiTet","glyphOpening","kVQacm","glyphSvg","icon","inert","label","kVAEAm","kg5iWk","kQ0QjF","khDVqt","raised","raisedHovered","remove","kgeoSG","kFcpXp","kEoFBp","kjBf7l","kInvED","k3XXqK","kMeerF","kmVPX3","removeDisabled","removeGlyph","selected","selectedHovered","surfaceCorners","target","kGOzcv","kpsdNU","trailing","unselected","chipLayers","elevatedFocused","elevatedHovered","elevatedPressed","removeHovered","removePressed","selectedFocused","selectedPressed","unselectedFocused","unselectedHovered","unselectedPressed"],"sources":["../../src/chip/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The pill the chips page draws, shared by the three components that draw\n// one: Chip, which is a toggle on its own or one of the page's two action\n// chips; ChipGroup's chip, which is one of a set that can also be removed;\n// and TokenField's token, which takes `base` and `unselected` alone — a token\n// is not selectable, so it reaches for neither the selected container nor\n// the check below. The measurements and roles are the page's filter chip — a\n// 32dp container with an 8dp corner and 16dp of inline padding, an outline\n// variant border while unselected, the secondary container pair once\n// selected.\n//\n// The assist and suggestion chips are that unselected pill, never selected.\n// The page's only difference between them is the label: on surface on an\n// assist chip, on surface variant on a suggestion chip as on a filter one.\n//\n// **An elevated chip trades the outline for a container**, surface container\n// low at the page's elevation 1, raised to 2 under a hovering pointer and\n// back to 1 while pressed, since a mouse press does not end the hover. A\n// selected one keeps the secondary container and takes the shadow with it.\n// Its 1px border stays, transparent, as every chip's does: a forced-colours\n// mode paints a transparent border in its text colour and drops the shadow\n// and the fill, so the border is the boundary left there.\n//\n// **A flat chip lies on the page, apart from one state.** A selected filter\n// chip under a hovering pointer rises to elevation 1, and comes back down\n// while pressed, as the page's filter chip tokens give it; every other flat\n// state, and every state of an input chip, stays at 0.\n//\n// **A disabled chip is translucent**, its content at 38% and its container at\n// 12% of on surface over whatever is behind it, as the page gives them,\n// rather than mixed into the surface. Mixed into the surface, a disabled chip\n// on a coloured container drew an opaque pale patch with grey text on it.\n//\n// **A label with no room on one line is cut short, never wrapped.** The\n// container is a fixed 32dp, so a second line has nowhere to go but out of\n// the pill: a chip or a token in a room narrower than its label drew the\n// rest below its own edge, and a chip in a group's row ran past the row's\n// end instead. The pill is held to the room it is in, and the label sits in\n// a span of its own that ends in an ellipsis where the pill does — a span,\n// because a flex container ignores `text-overflow`, which is also why\n// Material's own chips carry one. The whole label stays in the DOM, so a\n// screen reader still reads all of it.\n//\n// Each state composites an on-colour over its own container at the\n// interaction state's opacity rather than swapping in a separate hover\n// colour. `calc(<opacity> * 100%)` turns the token's unitless 0-1 ratio into\n// the percentage `color-mix()` takes, and it is inlined at each property\n// because @stylexjs/babel-plugin only statically recognises expressions\n// written directly as property values.\n//\n// The selected chip drops its border rather than recolouring it: it has a\n// container of its own to define its edge, and a border on top of that reads\n// as a second, competing outline.\n//\n// Disabled is applied from render state rather than from `:disabled`. Chip is\n// a button and would match the pseudo-class; a chip in a group is React\n// Aria's `Tag`, which is a div and never will. One mechanism serves both, and\n// StyleX replaces a property whole, so the disabled styles take the hover and\n// pressed branches of whichever state they are applied over.\n//\n// A selected chip carries the page's check before its label, which is what\n// makes the selection legible without colour. The two containers differ in\n// colour alone, and under a scheme whose secondary container sits close to\n// the surface — or for a reader who does not see colour — that is no\n// difference at all.\n//\n// The chip widens when the check appears, and that is the page's behaviour\n// rather than a cost of drawing it: a chip is flow content, laid out in a\n// row that wraps, so nothing around it has a width to hold. A segmented\n// button's segments are equal columns of one track, which is a different\n// geometry answering a different question, and the two should not be read\n// across. A chip given an icon does not widen, since the check takes the\n// icon's place in the same slot.\n//\n// **A filter chip can carry an icon after its label as well**, the page's\n// trailing icon, which is what draws its dropdown filter chip: an arrow\n// saying the chip opens a menu. It takes the same 18dp slot at the other\n// end, and the chip's content role rather than the primary one the leading\n// icon takes — on surface variant, then on secondary container once\n// selected, then the disabled 38% — so it is drawn in the chip's own colour\n// rather than a role of its own. The check never displaces it.\n//\n// **The widening is animated rather than taken in one frame.** A chip with\n// no icon keeps its slot mounted while unselected, folded to nothing, and\n// selecting it opens the slot over the chip's own short duration while the\n// check fades in, so the chips after it in a wrapped row glide rather than\n// jump 18dp. Reduced motion takes the change at once, as it does the\n// colours. A chip that can never be selected, an assist or suggestion chip\n// or one in a group that does not select, has no slot to open.\n//\n// **The press ripple takes the chip's corner from here** wherever the chip\n// is a ChipGroup's. The ripple clips itself to its host's corner by\n// inheriting it, and React Aria puts a cell between a group's chip and its\n// content, so what the ripple would inherit is the cell's square corner.\n// `surfaceCorners` restates the chip's own corner on a box the ripple sits\n// in, less the 1px border every chip keeps, since the ripple fills the\n// inside of that border.\n//\n// Apart from any component so a chip in a group and a chip on its own cannot\n// drift; see `src/row` for the same arrangement around a list's row.\n\n// The press area the chips page requires around its 32dp chip. A literal for\n// the reason IconButton's `TARGET_SIZE` gives.\nconst TARGET_SIZE = '48px';\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)';\nconst chipStyles = {\n assist: {\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n base: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"xig8zya\",\n kaIpWk: \"x1xdvaa9\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n ks0D6T: \"x193iq5w\",\n k8WAf4: \"xt970qd\",\n kg3NbH: \"x790zyz\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xu8237s\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n disabled: {\n kMwMTN: \"x1gpw424 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n disabledSelected: {\n kWkggS: \"x19v6zzp\",\n $$css: true\n },\n disabledUnselected: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"xrh88j3 xmnqt3w\",\n $$css: true\n },\n elevated: {\n kWkggS: \"x1vnz5z6\",\n kVAM5u: \"x9r1u3d\",\n $$css: true\n },\n elevatedDisabled: {\n kWkggS: \"x19v6zzp\",\n kVAM5u: \"x9r1u3d\",\n kGVxlE: \"x1gnnqk1\",\n $$css: true\n },\n glyph: {\n kGNEyG: \"x6s0dn4\",\n kZKoxP: \"xmix8c7\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kGuDYH: \"xosj86m\",\n kzqmXN: \"x1xp8n7a\",\n kjj79g: \"xl56j7k\",\n keTefX: \"xxuhe3a\",\n $$css: true\n },\n glyphFolded: {\n kzqmXN: \"xnalus7\",\n k71WvV: \"x1kfc2zf\",\n keTefX: \"x1lziwak\",\n kSiTet: \"xg01cxk\",\n $$css: true\n },\n glyphOpening: {\n k6CgDc: \"x12w9bfk\",\n kVQacm: \"xb3r6kr\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"x17vvy08\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n glyphSvg: {\n kZKoxP: \"xmix8c7\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1xp8n7a\",\n $$css: true\n },\n icon: {\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n inert: {\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n label: {\n kB7OPa: \"x9f619\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x1n2onr6\",\n kg5iWk: \"xlyipyv\",\n kQ0QjF: \"x4ej8vm\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n raised: {\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n raisedHovered: {\n kGVxlE: \"x1os83gw\",\n $$css: true\n },\n remove: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"xtu493u\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"xmix8c7\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1xp8n7a\",\n kjj79g: \"xl56j7k\",\n k71WvV: \"x1kfc2zf\",\n kjBf7l: \"x14ytart\",\n kInvED: \"x1y3gkto\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1717udv\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n removeDisabled: {\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n removeGlyph: {\n kZKoxP: \"xmix8c7\",\n kzqmXN: \"x1xp8n7a\",\n $$css: true\n },\n selected: {\n kWkggS: \"x15dekr4\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n selectedHovered: {\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n surfaceCorners: {\n kaIpWk: \"x5a2xki\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"xjp7ctv\",\n $$css: true\n },\n target: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1xkszu9\",\n kpsdNU: \"x1ecwmwu\",\n kEoFBp: \"x1hmns74\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n trailing: {\n k71WvV: \"x1kfc2zf\",\n keTefX: \"x1lziwak\",\n $$css: true\n },\n unselected: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x133yhug\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n }\n};\n\n// The hover and pressed layers, applied from React Aria's render state rather\n// than from `:hover` and `:active`, for Button's reasons — see its header: a\n// hover layer stayed on after a tap, and no pressed layer showed for a press\n// made from the keyboard. One pair per container, the pressed after the\n// hovered so a press wins, and one for the close target, whose own render\n// state is its button's. A token in a TokenField draws none of them: React\n// Aria reports neither state for one, since it is text the caret moves\n// through rather than a control a press acts on.\nconst chipLayers = {\n elevatedFocused: {\n kWkggS: \"x1drsm1c\",\n $$css: true\n },\n elevatedHovered: {\n kWkggS: \"x1ei6177\",\n $$css: true\n },\n elevatedPressed: {\n kWkggS: \"x1vt8e7r\",\n $$css: true\n },\n removeHovered: {\n kWkggS: \"x930l3l\",\n $$css: true\n },\n removePressed: {\n kWkggS: \"xsykwg8\",\n $$css: true\n },\n selectedFocused: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n selectedHovered: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n unselectedFocused: {\n kWkggS: \"xwqhyid\",\n $$css: true\n },\n unselectedHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n unselectedPressed: {\n kWkggS: \"xjee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eAAe;EACbhD,QAAQ;EACR1B,OAAO;CACT;CACA2E,eAAe;EACbjD,QAAQ;EACR1B,OAAO;CACT;CACA4E,iBAAiB;EACflD,QAAQ;EACR1B,OAAO;CACT;CACA+D,iBAAiB;EACfrC,QAAQ;EACR1B,OAAO;CACT;CACA6E,iBAAiB;EACfnD,QAAQ;EACR1B,OAAO;CACT;CACA8E,mBAAmB;EACjBpD,QAAQ;EACR1B,OAAO;CACT;CACA+E,mBAAmB;EACjBrD,QAAQ;EACR1B,OAAO;CACT;CACAgF,mBAAmB;EACjBtD,QAAQ;EACR1B,OAAO;CACT;AACF"}
|
|
@@ -93,7 +93,7 @@ function containerClasses(state) {
|
|
|
93
93
|
*/
|
|
94
94
|
function rowItemStyles(supporting, overline, extra) {
|
|
95
95
|
const lines = (hasContent(overline) ? 1 : 0) + (hasContent(supporting) ? 1 : 0);
|
|
96
|
-
return (state) => props(rowStyles.base, rowStyles.list, extra, lines === 1 && rowStyles.twoLine, lines === 2 && rowStyles.threeLine, state.isDragging === true && rowStyles.dragging, state.isSelected && rowStyles.selectedList, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isPressed && rowStyles.pressed, state.isDropTarget === true && rowStyles.dropTarget, state.isDisabled && rowStyles.disabled);
|
|
96
|
+
return (state) => props(rowStyles.base, rowStyles.list, extra, lines === 1 && rowStyles.twoLine, lines === 2 && rowStyles.threeLine, state.isDragging === true && rowStyles.dragging, state.isSelected && rowStyles.selectedList, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isFocusVisible && state.isSelected && rowStyles.focusVisibleSelected, state.isPressed && rowStyles.pressed, state.isDropTarget === true && rowStyles.dropTarget, state.isDisabled && rowStyles.disabled);
|
|
97
97
|
}
|
|
98
98
|
export { collectionStyles, containerClasses, rowItemStyles };
|
|
99
99
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["stylex","hasContent","rowStyles","collectionStyles","container","kB7OPa","k1xSpc","kXwgrk","k3XXqK","k8WAf4","$$css","dropTarget","kWkggS","kjBf7l","kInvED","kMeerF","empty","kMwMTN","header","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kGO01o","kLKAdn","kg3NbH","loading","kGNEyG","kjj79g","kAzted","section","status","kZKoxP","kz4h6p","kzqmXN","kVQacm","kVAEAm","khDVqt","isDisabled","isDragging","isDropTarget","isFocusVisible","isHovered","isPressed","isSelected","containerClasses","state","className","rowItemStyles","supporting","overline","extra","lines","base","list","twoLine","threeLine","dragging","selectedList","hovered","focusVisible","pressed","disabled"],"sources":["../../src/collection/styles.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { hasContent } from '../render/content';\nimport { rowStyles } from '../row/styles';\nimport '../tokens/design.tokens.stylex';\nimport { colors, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The chrome around the row. `src/row` was extracted so a list, menu, tree and\n// drawer draw the same row; everything wrapped around it stayed behind in each\n// component, so a change to the subhead over a list was three edits with\n// nothing failing if one were missed.\n//\n// Two of these are shared by four components and two by three, and the split\n// is the Material Design spec pages rather than convenience:\n//\n// - `container` and `section` are the box and the grouping, which List,\n// ListBox, Tree and NavigationTree all draw the same way.\n// - `header` and `loading` are the lists page's, so they are shared by the\n// three components that follow it. Menu and NavigationTree keep their own,\n// because the menus page and the navigation drawer page give different\n// values — a subhead tighter to the items above it, a label role rather\n// than a title role, and an inset that lines up with pill-shaped rows.\n// Those are the specs disagreeing rather than the code drifting, so each\n// stays where its comment explaining it is.\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)';\nconst collectionStyles = {\n container: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n k3XXqK: \"x1t137rt\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n },\n dropTarget: {\n kWkggS: \"x659ado\",\n kjBf7l: \"xrgy624 x1x84bn5\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n empty: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n header: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kGO01o: \"xw3mh6e\",\n kLKAdn: \"x1clyivc\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n loading: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kAzted: \"xyax5pk\",\n $$css: true\n },\n section: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n $$css: true\n },\n status: {\n kZKoxP: \"xjm9jq1\",\n kB7OPa: \"x9f619\",\n kz4h6p: \"x1hyvwdk\",\n kzqmXN: \"x1i1rx1s\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x10l6tqk\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n }\n};\n\n/**\n * The render state every collection item this covers reports. Each of React\n * Aria's own is wider than this, and this is the part the three share.\n */\ntype CollectionItemState = {\n isDisabled: boolean;\n /** Reported only where the collection drags; see `dragging` in `src/row`. */\n isDragging?: boolean;\n /** Reported only where the collection takes drops onto its items. */\n isDropTarget?: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n};\n\n/**\n * A collection's own box, as the function React Aria's `className` prop\n * wants: the container, and the drop target while a drop would land on the\n * collection as a whole. List, ListBox and Tree each draw it.\n */\nfunction containerClasses(state: {\n isDropTarget: boolean;\n}) {\n return {\n 0: {\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt x1cmllll\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cmllll x659ado xrgy624 x1x84bn5 x2ssjo2 xaatb59 x1de99jn\"\n }\n }[!!state.isDropTarget << 0];\n}\n\n/**\n * The styles a selectable row in a list takes, as the function React Aria's\n * `className` prop wants.\n *\n * Which of the lists page's three items the row is, read from the content\n * rather than taken as a prop: a row holding all three lines already says it\n * is three lines, and a word for it would be a second place to get it wrong.\n * `ListItem` does the same arithmetic for the static row, and this is where\n * the collection forms share it.\n *\n * The three-line item is the only row whose slots move, which is why it alone\n * carries an alignment as well as a height.\n *\n * `extra` is the one difference between the three callers — Tree passes its\n * indent, which is why it sits where Tree already had it rather than at the\n * end. NavigationTree is not a caller: it draws the drawer variant, branches\n * on an ancestor being current, and reads `isCurrent` where these read\n * `isSelected`.\n */\nfunction rowItemStyles(supporting: ReactNode, overline: ReactNode, extra?: stylex.StyleXStyles) {\n const lines = (hasContent(overline) ? 1 : 0) + (hasContent(supporting) ? 1 : 0);\n return (state: CollectionItemState) => stylex.props(rowStyles.base, rowStyles.list, extra, lines === 1 && rowStyles.twoLine, lines === 2 && rowStyles.threeLine, state.isDragging === true && rowStyles.dragging, state.isSelected && rowStyles.selectedList, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isPressed && rowStyles.pressed, state.isDropTarget === true && rowStyles.dropTarget, state.isDisabled && rowStyles.disabled);\n}\nexport type { CollectionItemState };\nexport { collectionStyles, containerClasses, rowItemStyles };"],"mappings":";;;;AA6BA,MAAMG,mBAAmB;CACvBC,WAAW;EACTC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,YAAY;EACVC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRN,QAAQ;EACRO,QAAQ;EACRL,OAAO;CACT;CACAM,OAAO;EACLC,QAAQ;EACRP,OAAO;CACT;CACAQ,QAAQ;EACNb,QAAQ;EACRY,QAAQ;EACRE,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRhB,OAAO;CACT;CACAiB,SAAS;EACPC,QAAQ;EACRvB,QAAQ;EACRC,QAAQ;EACRuB,QAAQ;EACRC,QAAQ;EACRpB,OAAO;CACT;CACAqB,SAAS;EACP1B,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRG,OAAO;CACT;CACAsB,QAAQ;EACNC,QAAQ;EACR5B,QAAQ;EACR6B,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR5B,OAAO;CACT;AACF;;;;;;AAuBA,SAASoC,iBAAiBC,OAEvB;CACD,OAAO;EACL,GAAG,EACDC,WAAW,2CACb;EACA,GAAG,EACDA,WAAW,oFACb;CACF,EAAE,CAAC,CAACD,MAAMN,gBAAgB;AAC5B;;;;;;;;;;;;;;;;;;;;AAqBA,SAASQ,cAAcC,YAAuBC,UAAqBC,OAA6B;CAC9F,MAAMC,SAASpD,WAAWkD,QAAQ,IAAI,IAAI,MAAMlD,WAAWiD,UAAU,IAAI,IAAI;CAC7E,QAAQH,UAA+B/C,MAAaE,UAAUoD,MAAMpD,UAAUqD,MAAMH,OAAOC,UAAU,KAAKnD,UAAUsD,SAASH,UAAU,KAAKnD,UAAUuD,WAAWV,MAAMP,eAAe,QAAQtC,UAAUwD,UAAUX,MAAMF,cAAc3C,UAAUyD,cAAcZ,MAAMJ,aAAazC,UAAU0D,SAASb,MAAML,kBAAkBxC,UAAU2D,cAAcd,MAAMH,aAAa1C,
|
|
1
|
+
{"version":3,"file":"styles.js","names":["stylex","hasContent","rowStyles","collectionStyles","container","kB7OPa","k1xSpc","kXwgrk","k3XXqK","k8WAf4","$$css","dropTarget","kWkggS","kjBf7l","kInvED","kMeerF","empty","kMwMTN","header","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kGO01o","kLKAdn","kg3NbH","loading","kGNEyG","kjj79g","kAzted","section","status","kZKoxP","kz4h6p","kzqmXN","kVQacm","kVAEAm","khDVqt","isDisabled","isDragging","isDropTarget","isFocusVisible","isHovered","isPressed","isSelected","containerClasses","state","className","rowItemStyles","supporting","overline","extra","lines","base","list","twoLine","threeLine","dragging","selectedList","hovered","focusVisible","focusVisibleSelected","pressed","disabled"],"sources":["../../src/collection/styles.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { hasContent } from '../render/content';\nimport { rowStyles } from '../row/styles';\nimport '../tokens/design.tokens.stylex';\nimport { colors, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The chrome around the row. `src/row` was extracted so a list, menu, tree and\n// drawer draw the same row; everything wrapped around it stayed behind in each\n// component, so a change to the subhead over a list was three edits with\n// nothing failing if one were missed.\n//\n// Two of these are shared by four components and two by three, and the split\n// is the Material Design spec pages rather than convenience:\n//\n// - `container` and `section` are the box and the grouping, which List,\n// ListBox, Tree and NavigationTree all draw the same way.\n// - `header` and `loading` are the lists page's, so they are shared by the\n// three components that follow it. Menu and NavigationTree keep their own,\n// because the menus page and the navigation drawer page give different\n// values — a subhead tighter to the items above it, a label role rather\n// than a title role, and an inset that lines up with pill-shaped rows.\n// Those are the specs disagreeing rather than the code drifting, so each\n// stays where its comment explaining it is.\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)';\nconst collectionStyles = {\n container: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n k3XXqK: \"x1t137rt\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n },\n dropTarget: {\n kWkggS: \"x659ado\",\n kjBf7l: \"xrgy624 x1x84bn5\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n empty: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n header: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kGO01o: \"xw3mh6e\",\n kLKAdn: \"x1clyivc\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n loading: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kAzted: \"xyax5pk\",\n $$css: true\n },\n section: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n $$css: true\n },\n status: {\n kZKoxP: \"xjm9jq1\",\n kB7OPa: \"x9f619\",\n kz4h6p: \"x1hyvwdk\",\n kzqmXN: \"x1i1rx1s\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x10l6tqk\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n }\n};\n\n/**\n * The render state every collection item this covers reports. Each of React\n * Aria's own is wider than this, and this is the part the three share.\n */\ntype CollectionItemState = {\n isDisabled: boolean;\n /** Reported only where the collection drags; see `dragging` in `src/row`. */\n isDragging?: boolean;\n /** Reported only where the collection takes drops onto its items. */\n isDropTarget?: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n};\n\n/**\n * A collection's own box, as the function React Aria's `className` prop\n * wants: the container, and the drop target while a drop would land on the\n * collection as a whole. List, ListBox and Tree each draw it.\n */\nfunction containerClasses(state: {\n isDropTarget: boolean;\n}) {\n return {\n 0: {\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt x1cmllll\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cmllll x659ado xrgy624 x1x84bn5 x2ssjo2 xaatb59 x1de99jn\"\n }\n }[!!state.isDropTarget << 0];\n}\n\n/**\n * The styles a selectable row in a list takes, as the function React Aria's\n * `className` prop wants.\n *\n * Which of the lists page's three items the row is, read from the content\n * rather than taken as a prop: a row holding all three lines already says it\n * is three lines, and a word for it would be a second place to get it wrong.\n * `ListItem` does the same arithmetic for the static row, and this is where\n * the collection forms share it.\n *\n * The three-line item is the only row whose slots move, which is why it alone\n * carries an alignment as well as a height.\n *\n * `extra` is the one difference between the three callers — Tree passes its\n * indent, which is why it sits where Tree already had it rather than at the\n * end. NavigationTree is not a caller: it draws the drawer variant, branches\n * on an ancestor being current, and reads `isCurrent` where these read\n * `isSelected`.\n */\nfunction rowItemStyles(supporting: ReactNode, overline: ReactNode, extra?: stylex.StyleXStyles) {\n const lines = (hasContent(overline) ? 1 : 0) + (hasContent(supporting) ? 1 : 0);\n return (state: CollectionItemState) => stylex.props(rowStyles.base, rowStyles.list, extra, lines === 1 && rowStyles.twoLine, lines === 2 && rowStyles.threeLine, state.isDragging === true && rowStyles.dragging, state.isSelected && rowStyles.selectedList, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isFocusVisible && state.isSelected && rowStyles.focusVisibleSelected, state.isPressed && rowStyles.pressed, state.isDropTarget === true && rowStyles.dropTarget, state.isDisabled && rowStyles.disabled);\n}\nexport type { CollectionItemState };\nexport { collectionStyles, containerClasses, rowItemStyles };"],"mappings":";;;;AA6BA,MAAMG,mBAAmB;CACvBC,WAAW;EACTC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,YAAY;EACVC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRN,QAAQ;EACRO,QAAQ;EACRL,OAAO;CACT;CACAM,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
|
@@ -124,7 +124,10 @@ function itemContent(children, href, rel, target) {
|
|
|
124
124
|
tone: "inherit",
|
|
125
125
|
underline: "hover",
|
|
126
126
|
children
|
|
127
|
-
}), /* @__PURE__ */ jsx(ChevronEndGlyph, {
|
|
127
|
+
}), /* @__PURE__ */ jsx(ChevronEndGlyph, { ...{
|
|
128
|
+
0: { className: "xmix8c7 x2lah0s x1xp8n7a x19axjrm x1c071of" },
|
|
129
|
+
1: { className: "xmix8c7 x2lah0s x1xp8n7a x19axjrm x1c071of x1xj74d8 x1bhcspo" }
|
|
130
|
+
}[!!state.isDisabled << 0] })] });
|
|
128
131
|
};
|
|
129
132
|
}
|
|
130
133
|
Breadcrumbs.Item = BreadcrumbsItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","RACBreadcrumb","Breadcrumbs","mergeStatefulStyles","mergeStyles","children","className","href","rel","target","props","$","t0","t1","BreadcrumbsItem","T0","t2","t3","t4","t5","t6","itemContent","state","isCurrent","Item","RACBreadcrumbs","Link"],"sources":["../../../src/components/breadcrumbs/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { BreadcrumbRenderProps, BreadcrumbProps as RACBreadcrumbProps, BreadcrumbsProps as RACBreadcrumbsProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Breadcrumb as RACBreadcrumb, Breadcrumbs as RACBreadcrumbs } from 'react-aria-components';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport Link from '../link';\n\n// A trail of links back up a hierarchy, ending at the page you are on. The\n// design system carries no breadcrumbs page, so the two nearest ones stand\n// in: the row takes the top app bar's muted content role, and each link the\n// text button's label-large type. Both are written down here rather than\n// guessed at each call site.\n//\n// React Aria decides which item is current — the last one — and marks it\n// `aria-current=\"page\"`. The trail is an ordered list, which is what a screen\n// reader reads it as, and `Breadcrumbs.Item` is one entry in it.\n//\n// Three things are this component's own.\n//\n// **The current item is text, not a link.** React Aria's own answer is a\n// disabled link, and a disabled link takes the library's disabled treatment\n// — the content role at 38%, which fades the one item the trail exists to\n// name. Here it is a span carrying `aria-current=\"page\"` instead, in the\n// full-strength content role, so the page you are on is the most legible\n// thing in the row rather than the least.\n//\n// **The chevron belongs to the item before it.** Each item that is not the\n// current one draws one after its link, which puts a separator between every\n// pair and none at the end. It says \"further in\" rather than \"to the right\",\n// so it mirrors under a right-to-left writing mode.\n//\n// **A link is drawn as a link in a place already understood to be links.**\n// `tone=\"inherit\"` takes the row's muted colour and `underline=\"hover\"`\n// leaves the rule for a pointer, which is what Link's own documentation\n// names this case for. The row's position is what announces them.\n//\n// `onAction` is React Aria's and is not wrapped: give each item an `id` and\n// the trail reports which one was pressed, for a page that navigates without\n// an `href`.\n\ntype BreadcrumbsItemProps = Omit<RACBreadcrumbProps, 'children' | 'className' | 'style'> & {\n /** The item's label. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACBreadcrumbProps['className'];\n /**\n * Where the item leads. Leave it out on an item the page handles through\n * the trail's `onAction`, and on the current one, which is never a link.\n */\n href?: string;\n /** The link's `rel`. */\n rel?: string;\n /** A function may compute the style from the item's render state. */\n style?: RACBreadcrumbProps['style'];\n /** The link's `target`. */\n target?: string;\n};\ntype BreadcrumbsProps<T extends object = object> = Omit<RACBreadcrumbsProps<T>, 'children'> & {\n /** The trail, as `Breadcrumbs.Item` entries. */\n children?: ReactNode;\n};\n\n/**\n * A trail of links back up a hierarchy, ending at the page you are on.\n * React Aria makes the last item the current one and marks it\n * `aria-current=\"page\"`; everything before it is a link.\n *\n * ```tsx\n * <Breadcrumbs aria-label=\"Label\">\n * <Breadcrumbs.Item href=\"#first\">First item</Breadcrumbs.Item>\n * <Breadcrumbs.Item href=\"#second\">Second item</Breadcrumbs.Item>\n * <Breadcrumbs.Item>Third item</Breadcrumbs.Item>\n * </Breadcrumbs>\n * ```\n *\n * Name it with `aria-label` or `aria-labelledby`. A page that navigates\n * without an `href` gives each item an `id` and the trail an `onAction`,\n * which is React Aria's and reports the key that was pressed.\n *\n * The call site's `className` and `style` land on the list, which is the\n * element a layout positions.\n */\nfunction Breadcrumbs<T extends object = object>(props: BreadcrumbsProps<T> & RefAttributes<HTMLOListElement>) {\n return <RACBreadcrumbs<T> {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x1w5n3ug x78zum5 x1a02dak xkknnkr x14zspaw x1v9cpvo xzoy561 x155f00i x1lz68p4 xe8uvvx x1ghz6dp x1717udv\"\n }, props)} />;\n}\n\n/**\n * One entry in the trail. Give it an `href` to navigate, or an `id` and let\n * the trail's `onAction` handle it. The last entry is the current page and\n * is drawn as text rather than a link, whatever it is given.\n */\nfunction BreadcrumbsItem({\n children,\n href,\n rel,\n target,\n ...props\n}: BreadcrumbsItemProps & RefAttributes<HTMLLIElement>) {\n return <RACBreadcrumb {...props} {...mergeStatefulStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xzoy561\"\n }, props)}>\n {itemContent(children, href, rel, target)}\n </RACBreadcrumb>;\n}\n\n// What an entry draws, from React Aria's render state. Built by a call rather\n// than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result on\n// its inputs.\nfunction itemContent(children: ReactNode, href: string | undefined, rel: string | undefined, target: string | undefined) {\n return (state: BreadcrumbRenderProps) => {\n if (state.isCurrent) {\n return <span aria-current=\"page\" className=\"x139gbkf\">\n {children}\n </span>;\n }\n return <>\n <Link href={href} rel={rel} target={target} tone=\"inherit\" underline=\"hover\">\n {children}\n </Link>\n <ChevronEndGlyph className
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","RACBreadcrumb","Breadcrumbs","mergeStatefulStyles","mergeStyles","children","className","href","rel","target","props","$","t0","t1","BreadcrumbsItem","T0","t2","t3","t4","t5","t6","itemContent","state","isCurrent","isDisabled","Item","RACBreadcrumbs","Link"],"sources":["../../../src/components/breadcrumbs/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { BreadcrumbRenderProps, BreadcrumbProps as RACBreadcrumbProps, BreadcrumbsProps as RACBreadcrumbsProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Breadcrumb as RACBreadcrumb, Breadcrumbs as RACBreadcrumbs } from 'react-aria-components';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Link from '../link';\n\n// A trail of links back up a hierarchy, ending at the page you are on. The\n// design system carries no breadcrumbs page, so the two nearest ones stand\n// in: the row takes the top app bar's muted content role, and each link the\n// text button's label-large type. Both are written down here rather than\n// guessed at each call site.\n//\n// React Aria decides which item is current — the last one — and marks it\n// `aria-current=\"page\"`. The trail is an ordered list, which is what a screen\n// reader reads it as, and `Breadcrumbs.Item` is one entry in it.\n//\n// Three things are this component's own.\n//\n// **The current item is text, not a link.** React Aria's own answer is a\n// disabled link, and a disabled link takes the library's disabled treatment\n// — the content role at 38%, which fades the one item the trail exists to\n// name. Here it is a span carrying `aria-current=\"page\"` instead, in the\n// full-strength content role, so the page you are on is the most legible\n// thing in the row rather than the least.\n//\n// **The chevron belongs to the item before it.** Each item that is not the\n// current one draws one after its link, which puts a separator between every\n// pair and none at the end. It says \"further in\" rather than \"to the right\",\n// so it mirrors under a right-to-left writing mode.\n//\n// **A link is drawn as a link in a place already understood to be links.**\n// `tone=\"inherit\"` takes the row's muted colour and `underline=\"hover\"`\n// leaves the rule for a pointer, which is what Link's own documentation\n// names this case for. The row's position is what announces them.\n//\n// `onAction` is React Aria's and is not wrapped: give each item an `id` and\n// the trail reports which one was pressed, for a page that navigates without\n// an `href`.\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)';\ntype BreadcrumbsItemProps = Omit<RACBreadcrumbProps, 'children' | 'className' | 'style'> & {\n /** The item's label. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACBreadcrumbProps['className'];\n /**\n * Where the item leads. Leave it out on an item the page handles through\n * the trail's `onAction`, and on the current one, which is never a link.\n */\n href?: string;\n /** The link's `rel`. */\n rel?: string;\n /** A function may compute the style from the item's render state. */\n style?: RACBreadcrumbProps['style'];\n /** The link's `target`. */\n target?: string;\n};\ntype BreadcrumbsProps<T extends object = object> = Omit<RACBreadcrumbsProps<T>, 'children'> & {\n /** The trail, as `Breadcrumbs.Item` entries. */\n children?: ReactNode;\n};\n\n/**\n * A trail of links back up a hierarchy, ending at the page you are on.\n * React Aria makes the last item the current one and marks it\n * `aria-current=\"page\"`; everything before it is a link.\n *\n * ```tsx\n * <Breadcrumbs aria-label=\"Label\">\n * <Breadcrumbs.Item href=\"#first\">First item</Breadcrumbs.Item>\n * <Breadcrumbs.Item href=\"#second\">Second item</Breadcrumbs.Item>\n * <Breadcrumbs.Item>Third item</Breadcrumbs.Item>\n * </Breadcrumbs>\n * ```\n *\n * Name it with `aria-label` or `aria-labelledby`. A page that navigates\n * without an `href` gives each item an `id` and the trail an `onAction`,\n * which is React Aria's and reports the key that was pressed.\n *\n * The call site's `className` and `style` land on the list, which is the\n * element a layout positions.\n */\nfunction Breadcrumbs<T extends object = object>(props: BreadcrumbsProps<T> & RefAttributes<HTMLOListElement>) {\n return <RACBreadcrumbs<T> {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x1w5n3ug x78zum5 x1a02dak xkknnkr x14zspaw x1v9cpvo xzoy561 x155f00i x1lz68p4 xe8uvvx x1ghz6dp x1717udv\"\n }, props)} />;\n}\n\n/**\n * One entry in the trail. Give it an `href` to navigate, or an `id` and let\n * the trail's `onAction` handle it. The last entry is the current page and\n * is drawn as text rather than a link, whatever it is given.\n */\nfunction BreadcrumbsItem({\n children,\n href,\n rel,\n target,\n ...props\n}: BreadcrumbsItemProps & RefAttributes<HTMLLIElement>) {\n return <RACBreadcrumb {...props} {...mergeStatefulStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xzoy561\"\n }, props)}>\n {itemContent(children, href, rel, target)}\n </RACBreadcrumb>;\n}\n\n// What an entry draws, from React Aria's render state. Built by a call rather\n// than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result on\n// its inputs.\nfunction itemContent(children: ReactNode, href: string | undefined, rel: string | undefined, target: string | undefined) {\n return (state: BreadcrumbRenderProps) => {\n if (state.isCurrent) {\n return <span aria-current=\"page\" className=\"x139gbkf\">\n {children}\n </span>;\n }\n return <>\n <Link href={href} rel={rel} target={target} tone=\"inherit\" underline=\"hover\">\n {children}\n </Link>\n <ChevronEndGlyph {...{\n 0: {\n className: \"xmix8c7 x2lah0s x1xp8n7a x19axjrm x1c071of\"\n },\n 1: {\n className: \"xmix8c7 x2lah0s x1xp8n7a x19axjrm x1c071of x1xj74d8 x1bhcspo\"\n }\n }[!!state.isDisabled << 0]} />\n </>;\n };\n}\nBreadcrumbs.Item = BreadcrumbsItem;\nexport type { BreadcrumbsItemProps, BreadcrumbsProps };\nexport { BreadcrumbsItem };\nexport default Breadcrumbs;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,SAAAE,YAAAQ,OAAA;CAAA,MAAAC,IAAAX,EAAA,CAAA;CAAA,IAAAY;CAAA,IAAAD,EAAA,OAAAD,OAAA;EAC2CE,KAAAR,YAAY,EAAAE,WACxC,yHACb,GAAGI,KAAK;EAACC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAD,SAAAC,EAAA,OAAAC,IAAA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