@kanso-labs/kanso-ui 0.47.5 → 0.48.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/hooks.js +35 -1
- package/dist/button/hooks.js.map +1 -1
- package/dist/button/index.js +78 -65
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/styles.js +5 -5
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/styles.js +1 -1
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/context.js +6 -0
- package/dist/collection/context.js.map +1 -0
- package/dist/collection/styles.js +29 -6
- package/dist/collection/styles.js.map +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/calendar/index.js +7 -0
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/checkbox/index.js +10 -7
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.js +2 -1
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip-group/index.js +69 -66
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.js +1 -0
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/combo-box/index.js +5 -1
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/drop-zone/styles.js +11 -11
- package/dist/components/drop-zone/styles.js.map +1 -1
- package/dist/components/fab-menu/index.js +3 -3
- package/dist/components/fab-menu/index.js.map +1 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/list/index.js +58 -11
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.js +82 -103
- package/dist/components/list-box/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/number-field/index.js +3 -3
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.js +3 -3
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/radio-group/index.js +12 -11
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.js +4 -4
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/select/index.js +5 -1
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.js +3 -3
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/split-button/index.js +53 -41
- package/dist/components/split-button/index.js.map +1 -1
- package/dist/components/table/index.js +58 -45
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.js +81 -30
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/time-picker/index.js +5 -5
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/components/tree/index.js +78 -21
- package/dist/components/tree/index.js.map +1 -1
- package/dist/field/index.js +103 -104
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +1 -1
- package/dist/field/styles.js.map +1 -1
- package/dist/hooks/useScrollEdges.js +73 -0
- package/dist/hooks/useScrollEdges.js.map +1 -0
- package/dist/navigation/styles.js +5 -5
- package/dist/navigation/styles.js.map +1 -1
- package/dist/row/styles.js +7 -7
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/color.js +16 -16
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/focus.js +4 -4
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/overlay.js +3 -3
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles/scroll-fade.js +33 -0
- package/dist/styles/scroll-fade.js.map +1 -0
- package/dist/styles.css +61 -20
- package/package.json +7 -7
package/dist/button/hooks.js
CHANGED
|
@@ -77,6 +77,40 @@ function useButtonBase(input, isPending) {
|
|
|
77
77
|
return t5;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
+
* Whether the button is being pressed right now, by a pointer or a key, as
|
|
81
|
+
* opposed to reported pressed. React Aria's `DialogTrigger` and
|
|
82
|
+
* `MenuTrigger` hand their trigger `isPressed` through its press context for
|
|
83
|
+
* as long as the overlay is open, and `Select` and the pickers do the same
|
|
84
|
+
* through `ButtonContext`, so the render state's `isPressed` cannot tell an
|
|
85
|
+
* open overlay from a press. A press still reports its own start and end
|
|
86
|
+
* through `onPressChange`, which is what this follows. The call site's own
|
|
87
|
+
* handler is called as well.
|
|
88
|
+
*/
|
|
89
|
+
function useOwnPress(onPressChange) {
|
|
90
|
+
const $ = c(5);
|
|
91
|
+
const [isPressing, setPressing] = useState(false);
|
|
92
|
+
let t0;
|
|
93
|
+
if ($[0] !== onPressChange) {
|
|
94
|
+
t0 = (isPressed) => {
|
|
95
|
+
setPressing(isPressed);
|
|
96
|
+
onPressChange?.(isPressed);
|
|
97
|
+
};
|
|
98
|
+
$[0] = onPressChange;
|
|
99
|
+
$[1] = t0;
|
|
100
|
+
} else t0 = $[1];
|
|
101
|
+
let t1;
|
|
102
|
+
if ($[2] !== isPressing || $[3] !== t0) {
|
|
103
|
+
t1 = {
|
|
104
|
+
isPressing,
|
|
105
|
+
onPressChange: t0
|
|
106
|
+
};
|
|
107
|
+
$[2] = isPressing;
|
|
108
|
+
$[3] = t0;
|
|
109
|
+
$[4] = t1;
|
|
110
|
+
} else t1 = $[4];
|
|
111
|
+
return t1;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
80
114
|
* A toggle's state, for a button that is a toggle on its own rather than in
|
|
81
115
|
* a selecting group: the call site's `isSelected` where it holds the state,
|
|
82
116
|
* otherwise the button's own, starting from `defaultSelected`. `toggle` is
|
|
@@ -111,6 +145,6 @@ function useSelection(t0) {
|
|
|
111
145
|
} else t2 = $[5];
|
|
112
146
|
return t2;
|
|
113
147
|
}
|
|
114
|
-
export { useButtonBase, useSelection };
|
|
148
|
+
export { useButtonBase, useOwnPress, useSelection };
|
|
115
149
|
|
|
116
150
|
//# sourceMappingURL=hooks.js.map
|
package/dist/button/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","names":["useState","ButtonContext","useSlottedContext","useRipple","ariaAttributesOf","refCallback","disableRipple","ref","useButtonBase","input","isPending","$","_c","t0","isDisabled","onClick","onContextMenu","onKeyDown","onKeyUp","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","props","undefined","context","slot","disabled","t1","ripple","t2","t3","aria","t4","t5","element","useSelection","defaultSelected","isSelected","onChange","own","setOwn","selected","toggle"],"sources":["../../src/button/hooks.ts"],"sourcesContent":["import type { Ref } from 'react'\nimport type { FocusableElement } from 'react-aria-components'\n\nimport { useState } from 'react'\nimport { ButtonContext, useSlottedContext } from 'react-aria-components'\n\nimport type { ButtonDOMProps } from '.'\n\nimport { useRipple } from '../hooks/useRipple'\nimport { ariaAttributesOf } from '../render/aria'\nimport { refCallback } from '../render/ref'\n\n// The hook half of `src/button`, apart from ./index.tsx so that file exports\n// components alone — which is what keeps fast refresh working for it, the\n// same arrangement `src/drag` uses.\n\n/** What {@link useButtonBase} takes off a button's props for itself. */\ntype ButtonBaseInput = Pick<\n ButtonDOMProps,\n | 'isDisabled'\n | 'onClick'\n | 'onContextMenu'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onPointerCancel'\n | 'onPointerDown'\n | 'onPointerLeave'\n | 'onPointerUp'\n | 'slot'\n> & {\n disableRipple?: boolean\n ref?: Ref<HTMLAnchorElement | HTMLButtonElement>\n}\n\n/**\n * What a button does past React Aria, whichever of its elements it renders:\n * the disabled state a parent's context sets, the ripple, and the `aria-*`\n * props and keyboard handlers React Aria would drop or wrap. Hands back the\n * props it did not take, for the element.\n *\n * Shared by ButtonBase and by IconButton's toggle, which is React Aria's\n * `ToggleButton` rather than either element ButtonBase renders.\n */\nfunction useButtonBase<Props extends ButtonBaseInput>(\n input: Props,\n isPending: boolean,\n) {\n const {\n disableRipple = false,\n isDisabled,\n onClick,\n onContextMenu,\n onKeyDown,\n onKeyUp,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n ref,\n ...props\n } = input\n\n // A parent's context may disable the button — React Aria's own fields\n // disable the buttons they hold with them, a number field's stepper at the\n // end of its range and a search field's clear button with the field — and\n // React Aria takes a prop over its context, so a default of `false` here\n // would keep the button enabled whatever the parent said. The call site's\n // own prop still wins where it is given; the context is read for the\n // ripple, which has to know before the render state does.\n const context = useSlottedContext(ButtonContext, input.slot)\n const disabled = isDisabled ?? context?.isDisabled ?? false\n\n // The rest of the props (className/style, etc.) are handed back rather\n // than given to the ripple: `className` and `style` there may be functions\n // of render state, which the ripple's own handler-only merge doesn't need\n // to know about. It is also why ButtonBase merges the styles through\n // mergeStatefulStyles rather than the plain mergeStyles. The ripple is off\n // while disabled: React Aria still forwards pointer events to a disabled\n // element, and a press that changes nothing should not look like one.\n //\n // Off while pending for the same reason, and for a second one. React Aria\n // nulls out the handlers it derived itself while pending — the click among\n // them — but not the separate copy of the global pointer events that\n // carries ours, so a press still reached the ripple and started it while\n // the click that would have ended it never arrived. The ripple stayed at\n // its pressed opacity until some later press completed a cycle of its own.\n const ripple = useRipple<FocusableElement>(\n !disableRipple && !disabled && !isPending,\n {\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n },\n )\n\n return {\n disabled,\n element: { aria: ariaAttributesOf(props), onKeyDown, onKeyUp },\n props,\n // The element is a button, a link or IconButton's toggle, so the ref is\n // typed as a link or a button and handed to each as the callback all\n // three accept — see src/render/ref.ts.\n ref: refCallback(ref),\n ripple,\n }\n}\n\n/**\n * A toggle's state, for a button that is a toggle on its own rather than in\n * a selecting group: the call site's `isSelected` where it holds the state,\n * otherwise the button's own, starting from `defaultSelected`. `toggle` is\n * what a press calls, and reports the new state through `onChange` either\n * way. Called whether or not the button is a toggle, so that becoming one\n * changes no hook order.\n */\nfunction useSelection({\n defaultSelected,\n isSelected,\n onChange,\n}: {\n defaultSelected?: boolean | undefined\n isSelected?: boolean | undefined\n onChange?: ((isSelected: boolean) => void) | undefined\n}) {\n const [own, setOwn] = useState(defaultSelected ?? false)\n const selected = isSelected ?? own\n\n return {\n selected,\n toggle: () => {\n setOwn(!selected)\n onChange?.(!selected)\n },\n }\n}\n\nexport { useButtonBase, useSelection }\n"],"mappings":";;;;;;;;;;;;;;;;AA2CA,SAAAQ,cAAAC,OAAAC,WAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAIE,MAAA,EAAAN,eAAAO,IAAAC,YAAAC,SAAAC,eAAAC,WAAAC,SAAAC,iBAAAC,eAAAC,gBAAAC,aAAAf,KAAA,GAAAgB,UAaId;CAZF,MAAAH,gBAAAO,OAAAW,KAAAA,IAAA,QAAAX;CAqBF,MAAAY,UAAgBvB,kBAAkBD,eAAeQ,MAAKiB,IAAK;CAC3D,MAAAC,WAAiBb,cAAcW,SAAOX,cAArB;CAA0C,IAAAc;CAAA,IAAAjB,EAAA,OAAAI,WAAAJ,EAAA,OAAAK,iBAAAL,EAAA,OAAAQ,mBAAAR,EAAA,OAAAS,iBAAAT,EAAA,OAAAU,kBAAAV,EAAA,OAAAW,aAAA;EAkBzDM,KAAA;GAAAb;GAAAC;GAAAG;GAAAC;GAAAC;GAAAC;EAOA;EAACX,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAQ;EAAAR,EAAA,KAAAS;EAAAT,EAAA,KAAAU;EAAAV,EAAA,KAAAW;EAAAX,EAAA,KAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CATH,MAAAkB,SAAe1B,UACb,CAACG,iBAAD,CAAmBqB,YAAnB,CAAgCjB,WAChCkB,EAQF;CAImB,MAAAE,KAAA1B,iBAAiBmB,KAAK;CAAC,IAAAQ;CAAA,IAAApB,EAAA,OAAAM,aAAAN,EAAA,OAAAO,WAAAP,EAAA,OAAAmB,IAAA;EAA/BC,KAAA;GAAAC,MAAQF;GAAuBb;GAAAC;EAAqB;EAACP,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAmB;EAAAnB,EAAA,MAAAoB;CAAA,OAAAA,KAAApB,EAAA;CAAA,IAAAsB;CAAA,IAAAtB,EAAA,QAAAJ,KAAA;EAKzD0B,KAAA5B,YAAYE,GAAG;EAACI,EAAA,MAAAJ;EAAAI,EAAA,MAAAsB;CAAA,OAAAA,KAAAtB,EAAA;CAAA,IAAAuB;CAAA,IAAAvB,EAAA,QAAAgB,YAAAhB,EAAA,QAAAY,SAAAZ,EAAA,QAAAkB,UAAAlB,EAAA,QAAAoB,MAAApB,EAAA,QAAAsB,IAAA;EAPhBC,KAAA;GAAAP;GAAAQ,SAEIJ;GAAqDR;GAAAhB,KAKzD0B;GAAgBJ;EAEvB;EAAClB,EAAA,MAAAgB;EAAAhB,EAAA,MAAAY;EAAAZ,EAAA,MAAAkB;EAAAlB,EAAA,MAAAoB;EAAApB,EAAA,MAAAsB;EAAAtB,EAAA,MAAAuB;CAAA,OAAAA,KAAAvB,EAAA;CAAA,OATMuB;AASN;;;;;;;;;AAWH,
|
|
1
|
+
{"version":3,"file":"hooks.js","names":["useState","ButtonContext","useSlottedContext","useRipple","ariaAttributesOf","refCallback","disableRipple","ref","useButtonBase","input","isPending","$","_c","t0","isDisabled","onClick","onContextMenu","onKeyDown","onKeyUp","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","props","undefined","context","slot","disabled","t1","ripple","t2","t3","aria","t4","t5","element","useOwnPress","onPressChange","isPressing","setPressing","isPressed","useSelection","defaultSelected","isSelected","onChange","own","setOwn","selected","toggle"],"sources":["../../src/button/hooks.ts"],"sourcesContent":["import type { Ref } from 'react'\nimport type { FocusableElement } from 'react-aria-components'\n\nimport { useState } from 'react'\nimport { ButtonContext, useSlottedContext } from 'react-aria-components'\n\nimport type { ButtonDOMProps } from '.'\n\nimport { useRipple } from '../hooks/useRipple'\nimport { ariaAttributesOf } from '../render/aria'\nimport { refCallback } from '../render/ref'\n\n// The hook half of `src/button`, apart from ./index.tsx so that file exports\n// components alone — which is what keeps fast refresh working for it, the\n// same arrangement `src/drag` uses.\n\n/** What {@link useButtonBase} takes off a button's props for itself. */\ntype ButtonBaseInput = Pick<\n ButtonDOMProps,\n | 'isDisabled'\n | 'onClick'\n | 'onContextMenu'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onPointerCancel'\n | 'onPointerDown'\n | 'onPointerLeave'\n | 'onPointerUp'\n | 'slot'\n> & {\n disableRipple?: boolean\n ref?: Ref<HTMLAnchorElement | HTMLButtonElement>\n}\n\n/**\n * What a button does past React Aria, whichever of its elements it renders:\n * the disabled state a parent's context sets, the ripple, and the `aria-*`\n * props and keyboard handlers React Aria would drop or wrap. Hands back the\n * props it did not take, for the element.\n *\n * Shared by ButtonBase and by IconButton's toggle, which is React Aria's\n * `ToggleButton` rather than either element ButtonBase renders.\n */\nfunction useButtonBase<Props extends ButtonBaseInput>(\n input: Props,\n isPending: boolean,\n) {\n const {\n disableRipple = false,\n isDisabled,\n onClick,\n onContextMenu,\n onKeyDown,\n onKeyUp,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n ref,\n ...props\n } = input\n\n // A parent's context may disable the button — React Aria's own fields\n // disable the buttons they hold with them, a number field's stepper at the\n // end of its range and a search field's clear button with the field — and\n // React Aria takes a prop over its context, so a default of `false` here\n // would keep the button enabled whatever the parent said. The call site's\n // own prop still wins where it is given; the context is read for the\n // ripple, which has to know before the render state does.\n const context = useSlottedContext(ButtonContext, input.slot)\n const disabled = isDisabled ?? context?.isDisabled ?? false\n\n // The rest of the props (className/style, etc.) are handed back rather\n // than given to the ripple: `className` and `style` there may be functions\n // of render state, which the ripple's own handler-only merge doesn't need\n // to know about. It is also why ButtonBase merges the styles through\n // mergeStatefulStyles rather than the plain mergeStyles. The ripple is off\n // while disabled: React Aria still forwards pointer events to a disabled\n // element, and a press that changes nothing should not look like one.\n //\n // Off while pending for the same reason, and for a second one. React Aria\n // nulls out the handlers it derived itself while pending — the click among\n // them — but not the separate copy of the global pointer events that\n // carries ours, so a press still reached the ripple and started it while\n // the click that would have ended it never arrived. The ripple stayed at\n // its pressed opacity until some later press completed a cycle of its own.\n const ripple = useRipple<FocusableElement>(\n !disableRipple && !disabled && !isPending,\n {\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n },\n )\n\n return {\n disabled,\n element: { aria: ariaAttributesOf(props), onKeyDown, onKeyUp },\n props,\n // The element is a button, a link or IconButton's toggle, so the ref is\n // typed as a link or a button and handed to each as the callback all\n // three accept — see src/render/ref.ts.\n ref: refCallback(ref),\n ripple,\n }\n}\n\n/**\n * Whether the button is being pressed right now, by a pointer or a key, as\n * opposed to reported pressed. React Aria's `DialogTrigger` and\n * `MenuTrigger` hand their trigger `isPressed` through its press context for\n * as long as the overlay is open, and `Select` and the pickers do the same\n * through `ButtonContext`, so the render state's `isPressed` cannot tell an\n * open overlay from a press. A press still reports its own start and end\n * through `onPressChange`, which is what this follows. The call site's own\n * handler is called as well.\n */\nfunction useOwnPress(\n onPressChange: ((isPressed: boolean) => void) | undefined,\n) {\n const [isPressing, setPressing] = useState(false)\n\n return {\n isPressing,\n onPressChange: (isPressed: boolean) => {\n setPressing(isPressed)\n onPressChange?.(isPressed)\n },\n }\n}\n\n/**\n * A toggle's state, for a button that is a toggle on its own rather than in\n * a selecting group: the call site's `isSelected` where it holds the state,\n * otherwise the button's own, starting from `defaultSelected`. `toggle` is\n * what a press calls, and reports the new state through `onChange` either\n * way. Called whether or not the button is a toggle, so that becoming one\n * changes no hook order.\n */\nfunction useSelection({\n defaultSelected,\n isSelected,\n onChange,\n}: {\n defaultSelected?: boolean | undefined\n isSelected?: boolean | undefined\n onChange?: ((isSelected: boolean) => void) | undefined\n}) {\n const [own, setOwn] = useState(defaultSelected ?? false)\n const selected = isSelected ?? own\n\n return {\n selected,\n toggle: () => {\n setOwn(!selected)\n onChange?.(!selected)\n },\n }\n}\n\nexport { useButtonBase, useOwnPress, useSelection }\n"],"mappings":";;;;;;;;;;;;;;;;AA2CA,SAAAQ,cAAAC,OAAAC,WAAA;CAAA,MA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AQ;GAChBH,WAAW,CAACG,QAAQ;EAAC;EACtBpC,EAAA,KAAAiC;EAAAjC,EAAA,KAAAoC;EAAApC,EAAA,KAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,IAAAmB;CAAA,IAAAnB,EAAA,OAAAoC,YAAApC,EAAA,OAAAiB,IAAA;EALIE,KAAA;GAAAiB;GAAAC,QAEGpB;EAIV;EAACjB,EAAA,KAAAoC;EAAApC,EAAA,KAAAiB;EAAAjB,EAAA,KAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OANMmB;AAMN"}
|
package/dist/button/index.js
CHANGED
|
@@ -5,7 +5,7 @@ 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
7
|
import { useRadioItem } from "../toggle-group/index.js";
|
|
8
|
-
import { useButtonBase } from "./hooks.js";
|
|
8
|
+
import { useButtonBase, useOwnPress } from "./hooks.js";
|
|
9
9
|
import { buttonBaseStyles } from "./styles.js";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -25,7 +25,7 @@ function busyElement(element, isPending) {
|
|
|
25
25
|
* `Button`, or its `Link` given `href`. See the header.
|
|
26
26
|
*/
|
|
27
27
|
function ButtonBase(t0) {
|
|
28
|
-
const $ = c(
|
|
28
|
+
const $ = c(55);
|
|
29
29
|
let children;
|
|
30
30
|
let classes;
|
|
31
31
|
let href;
|
|
@@ -65,13 +65,15 @@ function ButtonBase(t0) {
|
|
|
65
65
|
const messages = useMessages();
|
|
66
66
|
const base = useButtonBase(input, isPending);
|
|
67
67
|
const { disabled, props, ref, ripple } = base;
|
|
68
|
+
const press = useOwnPress(props.onPressChange);
|
|
68
69
|
let t2;
|
|
69
|
-
if ($[11] !== classes || $[12] !== props) {
|
|
70
|
-
t2 = mergeStatefulStyles(classes, props);
|
|
70
|
+
if ($[11] !== classes || $[12] !== press.isPressing || $[13] !== props) {
|
|
71
|
+
t2 = mergeStatefulStyles(pressedByPress(classes, press.isPressing), props);
|
|
71
72
|
$[11] = classes;
|
|
72
|
-
$[12] =
|
|
73
|
-
$[13] =
|
|
74
|
-
|
|
73
|
+
$[12] = press.isPressing;
|
|
74
|
+
$[13] = props;
|
|
75
|
+
$[14] = t2;
|
|
76
|
+
} else t2 = $[14];
|
|
75
77
|
const merged = t2;
|
|
76
78
|
let T0;
|
|
77
79
|
let styleProps;
|
|
@@ -80,7 +82,7 @@ function ButtonBase(t0) {
|
|
|
80
82
|
let t5;
|
|
81
83
|
let t6;
|
|
82
84
|
let t7;
|
|
83
|
-
if ($[
|
|
85
|
+
if ($[15] !== base.element || $[16] !== children || $[17] !== disabled || $[18] !== href || $[19] !== isPending || $[20] !== isSelected || $[21] !== merged || $[22] !== press.onPressChange || $[23] !== props || $[24] !== ref || $[25] !== rel || $[26] !== render || $[27] !== ripple.handlers || $[28] !== ripple.surface || $[29] !== target) {
|
|
84
86
|
t7 = Symbol.for("react.early_return_sentinel");
|
|
85
87
|
bb0: {
|
|
86
88
|
const element = isSelected === void 0 ? base.element : {
|
|
@@ -91,7 +93,7 @@ function ButtonBase(t0) {
|
|
|
91
93
|
}
|
|
92
94
|
};
|
|
93
95
|
let t8;
|
|
94
|
-
if ($[
|
|
96
|
+
if ($[37] !== isSelected || $[38] !== merged) {
|
|
95
97
|
t8 = isSelected === void 0 ? merged : {
|
|
96
98
|
className: (state) => merged.className({
|
|
97
99
|
...state,
|
|
@@ -102,10 +104,10 @@ function ButtonBase(t0) {
|
|
|
102
104
|
isSelected
|
|
103
105
|
})
|
|
104
106
|
};
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
} else t8 = $[
|
|
107
|
+
$[37] = isSelected;
|
|
108
|
+
$[38] = merged;
|
|
109
|
+
$[39] = t8;
|
|
110
|
+
} else t8 = $[39];
|
|
109
111
|
styleProps = t8;
|
|
110
112
|
if (href !== void 0) {
|
|
111
113
|
t7 = /* @__PURE__ */ jsxs(Link, {
|
|
@@ -117,6 +119,7 @@ function ButtonBase(t0) {
|
|
|
117
119
|
target,
|
|
118
120
|
...ripple.handlers,
|
|
119
121
|
...props,
|
|
122
|
+
onPressChange: press.onPressChange,
|
|
120
123
|
...styleProps,
|
|
121
124
|
children: [children, ripple.surface]
|
|
122
125
|
});
|
|
@@ -128,71 +131,75 @@ function ButtonBase(t0) {
|
|
|
128
131
|
t5 = ref;
|
|
129
132
|
t6 = buttonRenderer(busyElement(element, isPending), selectedRender(render, isSelected));
|
|
130
133
|
}
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
134
|
+
$[15] = base.element;
|
|
135
|
+
$[16] = children;
|
|
136
|
+
$[17] = disabled;
|
|
137
|
+
$[18] = href;
|
|
138
|
+
$[19] = isPending;
|
|
139
|
+
$[20] = isSelected;
|
|
140
|
+
$[21] = merged;
|
|
141
|
+
$[22] = press.onPressChange;
|
|
142
|
+
$[23] = props;
|
|
143
|
+
$[24] = ref;
|
|
144
|
+
$[25] = rel;
|
|
145
|
+
$[26] = render;
|
|
146
|
+
$[27] = ripple.handlers;
|
|
147
|
+
$[28] = ripple.surface;
|
|
148
|
+
$[29] = target;
|
|
149
|
+
$[30] = T0;
|
|
150
|
+
$[31] = styleProps;
|
|
151
|
+
$[32] = t3;
|
|
152
|
+
$[33] = t4;
|
|
153
|
+
$[34] = t5;
|
|
154
|
+
$[35] = t6;
|
|
155
|
+
$[36] = t7;
|
|
152
156
|
} else {
|
|
153
|
-
T0 = $[
|
|
154
|
-
styleProps = $[
|
|
155
|
-
t3 = $[
|
|
156
|
-
t4 = $[
|
|
157
|
-
t5 = $[
|
|
158
|
-
t6 = $[
|
|
159
|
-
t7 = $[
|
|
157
|
+
T0 = $[30];
|
|
158
|
+
styleProps = $[31];
|
|
159
|
+
t3 = $[32];
|
|
160
|
+
t4 = $[33];
|
|
161
|
+
t5 = $[34];
|
|
162
|
+
t6 = $[35];
|
|
163
|
+
t7 = $[36];
|
|
160
164
|
}
|
|
161
165
|
if (t7 !== Symbol.for("react.early_return_sentinel")) return t7;
|
|
162
166
|
const t8 = ripple.handlers;
|
|
163
|
-
const t9 =
|
|
164
|
-
|
|
165
|
-
if ($[38] !== children || $[39] !== ripple.surface || $[40] !== t9) {
|
|
166
|
-
t10 = buttonContent(children, t9, ripple.surface);
|
|
167
|
-
$[38] = children;
|
|
168
|
-
$[39] = ripple.surface;
|
|
169
|
-
$[40] = t9;
|
|
170
|
-
$[41] = t10;
|
|
171
|
-
} else t10 = $[41];
|
|
167
|
+
const t9 = press.onPressChange;
|
|
168
|
+
const t10 = pendingLabel ?? messages.loading;
|
|
172
169
|
let t11;
|
|
173
|
-
if ($[
|
|
174
|
-
t11 =
|
|
170
|
+
if ($[40] !== children || $[41] !== ripple.surface || $[42] !== t10) {
|
|
171
|
+
t11 = buttonContent(children, t10, ripple.surface);
|
|
172
|
+
$[40] = children;
|
|
173
|
+
$[41] = ripple.surface;
|
|
174
|
+
$[42] = t10;
|
|
175
|
+
$[43] = t11;
|
|
176
|
+
} else t11 = $[43];
|
|
177
|
+
let t12;
|
|
178
|
+
if ($[44] !== T0 || $[45] !== press.onPressChange || $[46] !== props || $[47] !== ripple.handlers || $[48] !== styleProps || $[49] !== t11 || $[50] !== t3 || $[51] !== t4 || $[52] !== t5 || $[53] !== t6) {
|
|
179
|
+
t12 = /* @__PURE__ */ jsx(T0, {
|
|
175
180
|
isDisabled: t3,
|
|
176
181
|
isPending: t4,
|
|
177
182
|
ref: t5,
|
|
178
183
|
render: t6,
|
|
179
184
|
...t8,
|
|
180
185
|
...props,
|
|
186
|
+
onPressChange: t9,
|
|
181
187
|
...styleProps,
|
|
182
|
-
children:
|
|
188
|
+
children: t11
|
|
183
189
|
});
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
$[44] = T0;
|
|
191
|
+
$[45] = press.onPressChange;
|
|
192
|
+
$[46] = props;
|
|
193
|
+
$[47] = ripple.handlers;
|
|
194
|
+
$[48] = styleProps;
|
|
195
|
+
$[49] = t11;
|
|
196
|
+
$[50] = t3;
|
|
197
|
+
$[51] = t4;
|
|
198
|
+
$[52] = t5;
|
|
199
|
+
$[53] = t6;
|
|
200
|
+
$[54] = t12;
|
|
201
|
+
} else t12 = $[54];
|
|
202
|
+
return t12;
|
|
196
203
|
}
|
|
197
204
|
function buttonContent(children, pendingLabel, surface) {
|
|
198
205
|
return (state) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -213,6 +220,12 @@ function buttonContent(children, pendingLabel, surface) {
|
|
|
213
220
|
surface
|
|
214
221
|
] });
|
|
215
222
|
}
|
|
223
|
+
function pressedByPress(classes, isPressing) {
|
|
224
|
+
return (state) => classes({
|
|
225
|
+
...state,
|
|
226
|
+
isPressed: state.isPressed && isPressing
|
|
227
|
+
});
|
|
228
|
+
}
|
|
216
229
|
function selectedRender(render, isSelected) {
|
|
217
230
|
if (render === void 0 || isSelected === void 0) return render;
|
|
218
231
|
return (props, state) => {
|
package/dist/button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;C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D,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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["stylex","RACButton","useToggleGroupDisabled","useMessages","buttonRenderer","linkRenderer","toggleButtonRenderer","mergeStatefulStyles","useRadioItem","useButtonBase","useOwnPress","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","press","onPressChange","t2","isPressing","pressedByPress","merged","T0","styleProps","t3","t4","t5","t6","t7","handlers","surface","Symbol","for","bb0","t8","state_0","selectedRender","t9","t10","loading","t11","buttonContent","t12","label","labelPending","pending","isPressed","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, useOwnPress } 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// **The classes are told a button is pressed only while it is being\n// pressed.** React Aria reports an overlay's trigger pressed for as long as\n// the overlay is open — `DialogTrigger` and `MenuTrigger` through the press\n// context, `Select` through `ButtonContext` — so a Button or IconButton that\n// opened a menu, popover or dialog took its pressed corner and held it,\n// with its hover layer off, until the overlay closed. The pressed corner is\n// the short answer to a press, and an open trigger is not one, so the state\n// the component's classes see has `isPressed` only while a pointer or a key\n// is actually pressing it, from `useOwnPress`. An open trigger therefore\n// rests as it did before it opened and still answers the pointer. A call\n// site's own `className` and `style` functions are handed React Aria's state\n// unchanged, as is its `data-pressed`.\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 press = useOwnPress(props.onPressChange);\n const merged = mergeStatefulStyles(pressedByPress(classes, press.isPressing), 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} onPressChange={press.onPressChange} {...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} onPressChange={press.onPressChange} {...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// The component's classes, handed a state that is pressed only while the\n// button is being pressed — see the header.\nfunction pressedByPress(classes: ButtonBaseProps['classes'], isPressing: boolean) {\n return (state: ButtonClassesState) => classes({\n ...state,\n isPressed: state.isPressed && isPressing\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":";;;;;;;;;;;;;AAyKA,SAAS0B,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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AxB,EAAA,MAAAmB;EAAAnB,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;EAAAtB,EAAA,MAAAuB;CAAA,OAAAA,KAAAvB,EAAA;CAAA,OAFbuB;AAEa;AAKtB,SAAS0B,cAAcpE,UAAqB4C,SAAoB;CAC9D,aAAa,qBAAA,UAAA,EAAA,UAAA,CACR5C,UACA4C,OACH,EAAA,CAAA;AACJ;AAOA,SAASuB,aAAa7C,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
|
@@ -40,7 +40,7 @@ const calendarStyles = {
|
|
|
40
40
|
kAXs8y: "x1g12otp",
|
|
41
41
|
kzqmXN: "xh8yej3",
|
|
42
42
|
kUOVxO: "xrxpjvj",
|
|
43
|
-
kjBf7l: "
|
|
43
|
+
kjBf7l: "xat36cu x3teovq",
|
|
44
44
|
$$css: true
|
|
45
45
|
},
|
|
46
46
|
cellInvalid: {
|
|
@@ -68,7 +68,7 @@ const calendarStyles = {
|
|
|
68
68
|
kVAM5u: "x1uajy3w x1n2ykn",
|
|
69
69
|
kMwMTN: "xwjo7ld x1k5gbb1",
|
|
70
70
|
kAXs8y: "x1g12otp",
|
|
71
|
-
kjBf7l: "
|
|
71
|
+
kjBf7l: "xat36cu x3teovq",
|
|
72
72
|
$$css: true
|
|
73
73
|
},
|
|
74
74
|
cellSelectedDisabled: {
|
|
@@ -231,10 +231,10 @@ const calendarStyles = {
|
|
|
231
231
|
$$css: true
|
|
232
232
|
},
|
|
233
233
|
menuItemFocused: {
|
|
234
|
-
kjBf7l: "
|
|
235
|
-
kInvED: "
|
|
234
|
+
kjBf7l: "xat36cu",
|
|
235
|
+
kInvED: "x1v57pqu",
|
|
236
236
|
k3XXqK: "xaatb59",
|
|
237
|
-
kMeerF: "
|
|
237
|
+
kMeerF: "x1s780dp",
|
|
238
238
|
$$css: true
|
|
239
239
|
},
|
|
240
240
|
menuItemSelected: {
|
|
@@ -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","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,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,cAAc;EACZlB,QAAQ;EACRmB,QAAQ;EACRf,QAAQ;EACRC,QAAQ;EACRe,QAAQ;EACRH,OAAO;CACT;CACAI,aAAa;EACXrB,QAAQ;EACRmB,QAAQ;EACRjB,QAAQ;EACRE,QAAQ;EACRgB,QAAQ;EACRV,QAAQ;EACRK,QAAQ;EACRO,QAAQ;EACRL,OAAO;CACT;CACAM,aAAa;EACXvB,QAAQ;EAC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,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: \"xat36cu 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: \"xat36cu 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: \"xat36cu\",\n kInvED: \"x1v57pqu\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1s780dp\",\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,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,cAAc;EACZlB,QAAQ;EACRmB,QAAQ;EACRf,QAAQ;EACRC,QAAQ;EACRe,QAAQ;EACRH,OAAO;CACT;CACAI,aAAa;EACXrB,QAAQ;EACRmB,QAAQ;EACRjB,QAAQ;EACRE,QAAQ;EACRgB,QAAQ;EACRV,QAAQ;EACRK,QAAQ;EACRO,QAAQ;EACRL,OAAO;CACT;CACAM,aAAa;EACXvB,QAAQ;EACRmB,QAAQ;EACRf,QAAQ;EACRa,OAAO;CACT;CACAO,cAAc;EACZC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