@kanso-labs/kanso-ui 0.28.6 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/calendar/styles.js +5 -5
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/styles.js +2 -2
- 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/avatar/index.js +1 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/button/index.js +6 -6
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/combo-box/index.js +1 -1
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/icon-button/index.js +12 -12
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +1 -1
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/progress-indicator/index.js +2 -2
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.js +2 -2
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.js +2 -2
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.js +7 -7
- package/dist/components/segmented-button/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 +7 -7
- 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/switch/index.js +3 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/table/index.js +8 -8
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.js +5 -5
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/toolbar/index.js +1 -1
- 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/control/styles.js +1 -1
- package/dist/control/styles.js.map +1 -1
- package/dist/drag/styles.js +3 -3
- package/dist/drag/styles.js.map +1 -1
- package/dist/indicator/styles.js +3 -3
- package/dist/indicator/styles.js.map +1 -1
- package/dist/row/styles.js +6 -6
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/color.js +8 -8
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/icon-button.js +2 -2
- package/dist/styles/icon-button.js.map +1 -1
- package/dist/styles.css +107 -57
- package/dist/tokens/design.tokens.stylex.js.map +1 -1
- package/dist/tokens.css +12 -1
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ import { Button, ButtonContext, Link, ToggleButton, useSlottedContext } from "re
|
|
|
11
11
|
const styles = {
|
|
12
12
|
base: {
|
|
13
13
|
kGNEyG: "x6s0dn4",
|
|
14
|
-
kaIpWk: "
|
|
14
|
+
kaIpWk: "x1dkaolv",
|
|
15
15
|
kMzoRj: "xc342km",
|
|
16
16
|
kB7OPa: "x9f619",
|
|
17
17
|
kkrTdU: "x1ypdohk",
|
|
@@ -27,7 +27,7 @@ const styles = {
|
|
|
27
27
|
$$css: true
|
|
28
28
|
},
|
|
29
29
|
disabled: {
|
|
30
|
-
kaIpWk: "
|
|
30
|
+
kaIpWk: "x1dkaolv",
|
|
31
31
|
kkrTdU: "x1h6gzvc",
|
|
32
32
|
$$css: true
|
|
33
33
|
},
|
|
@@ -55,15 +55,15 @@ const styles = {
|
|
|
55
55
|
$$css: true
|
|
56
56
|
},
|
|
57
57
|
lg: {
|
|
58
|
-
kZKoxP: "
|
|
59
|
-
kaIpWk: "xtt5grq
|
|
58
|
+
kZKoxP: "xs1ryiz",
|
|
59
|
+
kaIpWk: "xtt5grq x1dkaolv",
|
|
60
60
|
kGuDYH: "x1pvqxga",
|
|
61
61
|
kzqmXN: "x15yg21f",
|
|
62
62
|
$$css: true
|
|
63
63
|
},
|
|
64
64
|
md: {
|
|
65
|
-
kZKoxP: "
|
|
66
|
-
kaIpWk: "x1r81nxe
|
|
65
|
+
kZKoxP: "x1rv7mn0",
|
|
66
|
+
kaIpWk: "x1r81nxe x1dkaolv",
|
|
67
67
|
kGuDYH: "x1pvqxga",
|
|
68
68
|
kzqmXN: "x100vrsf",
|
|
69
69
|
$$css: true
|
|
@@ -126,22 +126,22 @@ const styles = {
|
|
|
126
126
|
$$css: true
|
|
127
127
|
},
|
|
128
128
|
xl: {
|
|
129
|
-
kZKoxP: "
|
|
130
|
-
kaIpWk: "x11f6t2b
|
|
129
|
+
kZKoxP: "x1xaimp3",
|
|
130
|
+
kaIpWk: "x11f6t2b x1dkaolv",
|
|
131
131
|
kGuDYH: "x1s3cmhv",
|
|
132
132
|
kzqmXN: "x13oubkp",
|
|
133
133
|
$$css: true
|
|
134
134
|
},
|
|
135
135
|
xs: {
|
|
136
|
-
kZKoxP: "
|
|
137
|
-
kaIpWk: "x1r81nxe
|
|
136
|
+
kZKoxP: "xig8zya",
|
|
137
|
+
kaIpWk: "x1r81nxe x1dkaolv",
|
|
138
138
|
kGuDYH: "xwsyq91",
|
|
139
139
|
kzqmXN: "x1td3qas",
|
|
140
140
|
$$css: true
|
|
141
141
|
},
|
|
142
142
|
xxl: {
|
|
143
|
-
kZKoxP: "
|
|
144
|
-
kaIpWk: "x11f6t2b
|
|
143
|
+
kZKoxP: "x173yhrv",
|
|
144
|
+
kaIpWk: "x11f6t2b x1dkaolv",
|
|
145
145
|
kGuDYH: "x1tgwohi",
|
|
146
146
|
kzqmXN: "x1f2tiqu",
|
|
147
147
|
$$css: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","ButtonRenderProps","ClassNameOrFunction","DOMRenderFunction","FocusableElement","StyleOrFunction","stylex","ButtonContext","Button","RACButton","Link","RACLink","ToggleButton","RACToggleButton","useSlottedContext","ButtonDOMProps","ButtonState","useRipple","ariaAttributesOf","buttonRenderer","linkRenderer","toggleButtonRenderer","focus","mergeStatefulStyles","colors","motion","radii","stateLayerOpacity","ProgressIndicator","Ripple","ReturnType","styles","base","kGNEyG","kaIpWk","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","kVAEAm","kybGjl","kIyJzY","k1ekBW","kAMwcw","$$css","disabled","filled","kWkggS","kMwMTN","filledDisabled","filledToggle","label","labelPending","k33iCy","lg","kZKoxP","kGuDYH","kzqmXN","md","outlined","kVAM5u","ksu8eU","outlinedDisabled","outlinedToggleSelected","pending","kpwlN0","standard","standardDisabled","standardToggleSelected","tonal","tonalDisabled","tonalToggleSelected","xl","xs","xxl","outlineWidths","selectedShapes","toggleStyles","selected","unselected","disabledStyles","IconButtonProps","children","className","IconButtonState","defaultSelected","disableRipple","href","isSelected","onChange","pendingLabel","rel","render","size","IconButtonSize","style","target","variant","IconButtonVariant","Omit","buttonContent","ripple","state","isPending","surface","IconButton","t0","$","_c","t1","isDisabled","onClick","onContextMenu","onKeyDown","onKeyUp","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","t2","t3","t4","props","undefined","context","slot","t5","element","aria","t6","t7","handlers","t8","toggleStyleProps","t9","toggleContent","ring","styleProps","T0","t10"],"sources":["../../../src/components/icon-button/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ButtonRenderProps, ClassNameOrFunction, DOMRenderFunction, FocusableElement, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ButtonContext, Button as RACButton, Link as RACLink, ToggleButton as RACToggleButton, useSlottedContext } from 'react-aria-components';\nimport type { ButtonDOMProps, ButtonState } from '../button';\nimport { useRipple } from '../../hooks/useRipple';\nimport { ariaAttributesOf, buttonRenderer, linkRenderer, toggleButtonRenderer } from '../../render/aria';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\nimport ProgressIndicator from '../progress-indicator';\n\n// Each variant composites an 'on-color' over its own container at the\n// interaction state's opacity, rather than swapping in a separate hover\n// color. The pairs are the icon buttons spec page's: filled on primary,\n// tonal on secondary container, outlined with an outline variant border and\n// an on-surface-variant icon, standard on surface variant over nothing. calc(<opacity> * 100%) turns the token's unitless 0-1 ratio into the\n// percentage color-mix() takes. Inlined at each property rather than factored\n// into a helper: @stylexjs/babel-plugin only statically recognizes\n// expressions written directly as property values.\n//\n// Disabled is a style of its own per variant rather than a `:disabled`\n// branch inside each property, for the reason Button's comment gives: given\n// `href` this renders as a link, which React Aria turns into a <span> while\n// disabled, and neither matches the pseudo-class. Applied last from the\n// render state, the disabled styles replace each property whole, hover and\n// pressed branches included.\n//\n// **The outlined border thickens with the size, and the widths are Button's\n// rather than this page's.** The icon buttons page keeps them in a size token\n// set its widget will not open to a script, and the two components already\n// share their five heights on purpose — a 96dp icon button beside a 96dp\n// outlined button with a different border weight would read as a mistake.\n//\n// **A toggle is the same button reporting a state.** Given `isSelected`,\n// `defaultSelected` or `onChange` it is React Aria's `ToggleButton` instead\n// of its `Button`, which announces the state through `aria-pressed` rather\n// than a role of its own — every variant and size still applies. The page\n// gives each style a second pair of colour roles for it, and they are not\n// the plain button's: a filled toggle rests on surface container with an\n// on-surface-variant icon and takes primary once chosen, a tonal one rests\n// on secondary container and takes secondary, and a standard one is\n// transparent throughout with the icon going from on-surface-variant to\n// primary, and an outlined one swaps its border for the inverse surface\n// pair. So a chosen filled toggle looks like a plain filled button, and an\n// unchosen one does not.\n//\n// A toggle is never a link and never pending. React Aria's `ToggleButton`\n// takes neither, and neither means anything for a control whose whole job is\n// to report which of two states it is in.\n//\n// The corner softens from a circle to a rounded square while pressed, which\n// is the shape morph the icon buttons spec page gives this control, at the\n// pressed corner its size token set names: 8 for the two small sizes, 12 at\n// medium, 16 at the two large. Each size carries its own pressed radius, since\n// StyleX replaces the property whole. The two transitioned properties take\n// different curves — the colour change is linear-ish and the shape change is\n// emphasized — so the timing functions are a matching comma list rather than\n// one value.\n//\n// A chosen toggle rests at that same pressed corner, which is the page's\n// shape morph: a toggle icon button moves from round while unchosen to\n// square once chosen. The square shape's own corner sits in a token set the\n// page keeps behind its size menu, but the page also says both shapes press\n// to the same radius — so the size's pressed corner is the value it already\n// assigns to that size, used here at rest rather than invented.\ntype Ripple = ReturnType<typeof useRipple<FocusableElement>>;\nconst styles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kaIpWk: \"x3y1ksm\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n kVAEAm: \"x1n2onr6\",\n kybGjl: \"x1hl2dhg\",\n kIyJzY: \"x1iuyhda\",\n k1ekBW: \"xb5u718\",\n kAMwcw: \"x15l9jch\",\n $$css: true\n },\n disabled: {\n kaIpWk: \"x3y1ksm\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n filled: {\n kWkggS: \"xpky1to xyf7a0q xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n filledDisabled: {\n kWkggS: \"xepofeg\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"xbck2fw x1h1ujn1 x1mjdul6\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n label: {\n k1xSpc: \"xjp7ctv\",\n $$css: true\n },\n labelPending: {\n k33iCy: \"xlshs6z\",\n $$css: true\n },\n lg: {\n kZKoxP: \"xnnlda6\",\n kaIpWk: \"xtt5grq x3y1ksm\",\n kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x15yg21f\",\n $$css: true\n },\n md: {\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x1r81nxe x3y1ksm\",\n kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x100vrsf\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x1dg9itu x1728qcm xjbqb8w\",\n kVAM5u: \"x133yhug\",\n ksu8eU: \"x1y0btm7\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n outlinedDisabled: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"xrh88j3\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"x1q27o6y x1v1ylhe x1c5gpgi\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"x1girmi0\",\n $$css: true\n },\n pending: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kpwlN0: \"x10a8y8t\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x10l6tqk\",\n $$css: true\n },\n standard: {\n kWkggS: \"x83qkoq x1p2om7n xjbqb8w\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n standardDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"x12vej0r x14dcer4 xjbqb8w\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n tonal: {\n kWkggS: \"xnqsvhv xlizrex x15dekr4\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n tonalDisabled: {\n kWkggS: \"xepofeg\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x1q841l6 x1ofvui0 x167r6xl\",\n kMwMTN: \"x1lba3jz\",\n $$css: true\n },\n xl: {\n kZKoxP: \"xjp8j0k\",\n kaIpWk: \"x11f6t2b x3y1ksm\",\n kGuDYH: \"x1s3cmhv\",\n kzqmXN: \"x13oubkp\",\n $$css: true\n },\n xs: {\n kZKoxP: \"x10w6t97\",\n kaIpWk: \"x1r81nxe x3y1ksm\",\n kGuDYH: \"xwsyq91\",\n kzqmXN: \"x1td3qas\",\n $$css: true\n },\n xxl: {\n kZKoxP: \"xn866dk\",\n kaIpWk: \"x11f6t2b x3y1ksm\",\n kGuDYH: \"x1tgwohi\",\n kzqmXN: \"x1f2tiqu\",\n $$css: true\n }\n};\n\n// The outlined border thickens with the size, as Button's does: 1dp up to M,\n// 2dp at XL, 3dp at XXL. A style per size rather than a value in the size\n// style, since a border on a filled button would draw in the icon's colour.\nconst outlineWidths = {\n lg: {\n kMzoRj: \"xmkeg23\",\n $$css: true\n },\n md: {\n kMzoRj: \"xmkeg23\",\n $$css: true\n },\n xl: {\n kMzoRj: \"xdh2fpr\",\n $$css: true\n },\n xs: {\n kMzoRj: \"xmkeg23\",\n $$css: true\n },\n xxl: {\n kMzoRj: \"x9r2w2z\",\n $$css: true\n }\n};\n\n// A chosen toggle rests at the corner its size presses to, which is the\n// page's round-to-square morph. A style per size rather than a value inside\n// each size style, since StyleX replaces the property whole and this one has\n// to beat both the size's `:active` branch and the disabled style's circle.\nconst selectedShapes = {\n lg: {\n kaIpWk: \"x62ce2h\",\n $$css: true\n },\n md: {\n kaIpWk: \"x1xdvaa9\",\n $$css: true\n },\n xl: {\n kaIpWk: \"xhpdng0\",\n $$css: true\n },\n xs: {\n kaIpWk: \"x1xdvaa9\",\n $$css: true\n },\n xxl: {\n kaIpWk: \"xhpdng0\",\n $$css: true\n }\n};\n\n// Which container a toggle draws, chosen and not. Three of the six are the\n// plain button's own styles: a chosen filled toggle is the filled button, and\n// an unchosen tonal or standard one is the tonal or standard button.\nconst toggleStyles = {\n filled: {\n selected: styles.filled,\n unselected: styles.filledToggle\n },\n outlined: {\n selected: styles.outlinedToggleSelected,\n unselected: styles.outlined\n },\n standard: {\n selected: styles.standardToggleSelected,\n unselected: styles.standard\n },\n tonal: {\n selected: styles.tonalToggleSelected,\n unselected: styles.tonal\n }\n};\nconst disabledStyles = {\n filled: styles.filledDisabled,\n outlined: styles.outlinedDisabled,\n standard: styles.standardDisabled,\n tonal: styles.tonalDisabled\n};\ntype IconButtonProps = {\n /**\n * What the button does, in words. Required rather than optional: an icon\n * on its own has no accessible name, so without this the control announces\n * nothing at all.\n */\n 'aria-label': string;\n children?: ReactNode;\n /** A function may compute the class from the button's render state. */\n className?: ClassNameOrFunction<IconButtonState>;\n /**\n * Whether a toggle starts chosen, when it keeps its own state. Passing\n * this, `isSelected` or `onChange` is what makes the button a toggle.\n */\n defaultSelected?: boolean;\n /**\n * Disables the press ripple. The hover and pressed state layers are\n * unaffected.\n * @default false\n */\n disableRipple?: boolean;\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 * `render`, `type`, and the form and pending props apply to the button\n * form only, and a toggle is never a link.\n */\n href?: string;\n /**\n * Whether a toggle is chosen, when the call site holds the state. Pass it\n * with `onChange`; passing this, `defaultSelected` or `onChange` is what\n * makes the button a toggle.\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 /**\n * The name of the ring shown while the button is pending, for a screen\n * reader. The label it replaces is hidden while it shows.\n * @default 'Loading'\n */\n pendingLabel?: string;\n /** The link's `rel`, when `href` is set. */\n rel?: string;\n /**\n * The element to render, given the props it would have carried. React\n * Aria's own form: it has to return the element the component would have\n * rendered itself.\n */\n render?: DOMRenderFunction<'button', IconButtonState>;\n /**\n * Control size: `xs` 32px, `md` 40px, `lg` 56px, `xl` 96px, `xxl` 136px —\n * the icon buttons spec page's XS to XL, and the same heights `Button`\n * uses, so the two line up beside each other in a row. The icon is 20px,\n * 24px, 24px, 32px and 40px in turn.\n * @default 'md'\n */\n size?: IconButtonSize;\n /** A function may compute the style from the button's render state. */\n style?: StyleOrFunction<IconButtonState>;\n /** The link's `target`, when `href` is set. */\n target?: string;\n /**\n * `standard` is transparent and tints what it sits on; `outlined` is\n * transparent with a rule around it; `filled` and `tonal` carry a container\n * of their own.\n * @default 'standard'\n */\n variant?: IconButtonVariant;\n} & Omit<ButtonDOMProps, 'render'>;\ntype IconButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl';\n\n// The render state a call site's `className`, `style` or `render` function is\n// handed. `isSelected` is optional because only the toggle form has one, and\n// one function has to be accepted by both: React Aria hands the plain button\n// a state without it and the toggle a state with it, and a parameter type\n// this wide accepts either.\ntype IconButtonState = ButtonState & {\n isSelected?: boolean;\n};\ntype IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';\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, ripple: Ripple) {\n return (state: ButtonRenderProps) => <>\n <span {...{\n 0: {\n className: \"xjp7ctv\"\n },\n 1: {\n className: \"xjp7ctv xlshs6z\"\n }\n }[!!state.isPending << 0]}>\n {children}\n </span>\n {state.isPending ? <span className=\"x6s0dn4 x78zum5 x10a8y8t xl56j7k x10l6tqk\">\n <ProgressIndicator aria-label={pendingLabel} isIndeterminate size=\"1em\" tone=\"inherit\" variant=\"circular\" />\n </span> : null}\n {ripple.surface}\n </>;\n}\n/**\n * A button that is an icon, at five control heights. Given `href` it is a\n * link with the same appearance. Every `aria-*` prop is forwarded to the\n * element; React Aria alone would keep only the labelling ones.\n *\n * Given `isSelected`, `defaultSelected` or `onChange` it is a toggle, which\n * reports its state through `aria-pressed` and draws the page's second pair\n * of colour roles for its variant. A toggle takes neither `href` nor the\n * pending props.\n *\n * ```tsx\n * <IconButton aria-label=\"Label\" defaultSelected variant=\"tonal\">\n * <StarIcon />\n * </IconButton>\n * ```\n */\nfunction IconButton({\n children,\n defaultSelected,\n disableRipple = false,\n href,\n isDisabled,\n isSelected,\n onChange,\n onClick,\n onContextMenu,\n onKeyDown,\n onKeyUp,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n pendingLabel = 'Loading',\n rel,\n render,\n size = 'md',\n target,\n variant = 'standard',\n ...props\n}: IconButtonProps) {\n // A field's context may disable the button — a number field's stepper at\n // the end of its range, 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 every one of them enabled. The call site's own prop still\n // wins where it is given; the context is read for the ripple, which has\n // to know before the render state does.\n const context = useSlottedContext(ButtonContext, props.slot);\n const disabled = isDisabled ?? context?.isDisabled ?? false;\n\n // `props` (className/style, etc.) is spread separately: `className` and\n // `style` there may be functions of render state, which ripple's own\n // handler-only merge doesn't need to know about. It is also why the styles\n // below merge through mergeStatefulStyles rather than the plain\n // mergeStyles. The ripple is off while disabled, as in Button.\n const ripple = useRipple<FocusableElement>(!disableRipple && !disabled, {\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n });\n const element = {\n aria: ariaAttributesOf(props),\n onKeyDown,\n onKeyUp\n };\n\n // The three props that make this a toggle. Read together rather than behind\n // a `toggle` word of its own, the way `href` already turns the button into\n // a link: a button given none of them has no state to report, and one given\n // any of them has nothing else it could mean.\n if (defaultSelected !== undefined || isSelected !== undefined || onChange !== undefined) {\n return <RACToggleButton defaultSelected={defaultSelected} isDisabled={disabled} isSelected={isSelected} onChange={onChange} render={toggleButtonRenderer(element, render)} {...ripple.handlers} {...props} {...mergeStatefulStyles(toggleStyleProps(size, variant), props)}>\n {toggleContent(children, ripple)}\n </RACToggleButton>;\n }\n const styleProps = mergeStatefulStyles((state: ButtonState) => stylex.props(styles.base, focus.ring, styles[variant], styles[size], variant === 'outlined' && outlineWidths[size], state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]), props);\n if (href !== undefined) {\n return <RACLink href={href} isDisabled={disabled} rel={rel} render={linkRenderer(element)} target={target} {...ripple.handlers} {...props} {...styleProps}>\n {children}\n {ripple.surface}\n </RACLink>;\n }\n return <RACButton isDisabled={disabled} render={buttonRenderer(element, render)} {...ripple.handlers} {...props} {...styleProps}>\n {buttonContent(children, pendingLabel, ripple)}\n </RACButton>;\n}\n\n// What a toggle draws: its icon and the ripple. No pending ring — React\n// Aria's toggle button has no pending state, and a control reporting which of\n// two states it is in has nothing to be pending about.\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 memoises\n// the result on its inputs.\nfunction toggleContent(children: ReactNode, ripple: Ripple) {\n return () => <>\n {children}\n {ripple.surface}\n </>;\n}\n\n// A toggle's styles, from React Aria's render state. The chosen shape is\n// applied after the disabled styles so it survives them: which of the two\n// states a disabled toggle is in should still be readable, and the disabled\n// style otherwise forces the circle back.\nfunction toggleStyleProps(size: IconButtonSize, variant: IconButtonVariant) {\n return (state: IconButtonState) => stylex.props(styles.base, focus.ring, state.isSelected === true ? toggleStyles[variant].selected : toggleStyles[variant].unselected, styles[size],\n // A chosen outlined toggle has a container rather than a rule, so the\n // width goes on only while it is unchosen.\n variant === 'outlined' && state.isSelected !== true && outlineWidths[size], state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant], state.isSelected === true && selectedShapes[size]);\n}\nexport type { IconButtonProps, IconButtonSize, IconButtonState, IconButtonVariant };\nexport default IconButton;"],"mappings":";;;;;;;;;;AAoEA,MAAM+B,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRd,QAAQ;EACRG,QAAQ;EACRU,OAAO;CACT;CACAE,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRJ,O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ayB,OAAOC,MAAMV,MAAMqH,MAAMlC,MAAMd,eAAe,OAAOX,aAAaoB,QAAQ,CAACnB,WAAWD,aAAaoB,QAAQ,CAAClB,YAAYnD,OAAOiE,OAG/KI,YAAY,cAAcK,MAAMd,eAAe,QAAQb,cAAckB,OAAOS,MAAMQ,cAAclF,OAAOiB,UAAUyD,MAAMQ,cAAc9B,eAAeiB,UAAUK,MAAMd,eAAe,QAAQZ,eAAeiB,KAAK;AACjN"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","ButtonRenderProps","ClassNameOrFunction","DOMRenderFunction","FocusableElement","StyleOrFunction","stylex","ButtonContext","Button","RACButton","Link","RACLink","ToggleButton","RACToggleButton","useSlottedContext","ButtonDOMProps","ButtonState","useRipple","ariaAttributesOf","buttonRenderer","linkRenderer","toggleButtonRenderer","focus","mergeStatefulStyles","colors","motion","radii","sizing","stateLayerOpacity","ProgressIndicator","Ripple","ReturnType","styles","base","kGNEyG","kaIpWk","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","kVAEAm","kybGjl","kIyJzY","k1ekBW","kAMwcw","$$css","disabled","filled","kWkggS","kMwMTN","filledDisabled","filledToggle","label","labelPending","k33iCy","lg","kZKoxP","kGuDYH","kzqmXN","md","outlined","kVAM5u","ksu8eU","outlinedDisabled","outlinedToggleSelected","pending","kpwlN0","standard","standardDisabled","standardToggleSelected","tonal","tonalDisabled","tonalToggleSelected","xl","xs","xxl","outlineWidths","selectedShapes","toggleStyles","selected","unselected","disabledStyles","IconButtonProps","children","className","IconButtonState","defaultSelected","disableRipple","href","isSelected","onChange","pendingLabel","rel","render","size","IconButtonSize","style","target","variant","IconButtonVariant","Omit","buttonContent","ripple","state","isPending","surface","IconButton","t0","$","_c","t1","isDisabled","onClick","onContextMenu","onKeyDown","onKeyUp","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","t2","t3","t4","props","undefined","context","slot","t5","element","aria","t6","t7","handlers","t8","toggleStyleProps","t9","toggleContent","ring","styleProps","T0","t10"],"sources":["../../../src/components/icon-button/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ButtonRenderProps, ClassNameOrFunction, DOMRenderFunction, FocusableElement, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ButtonContext, Button as RACButton, Link as RACLink, ToggleButton as RACToggleButton, useSlottedContext } from 'react-aria-components';\nimport type { ButtonDOMProps, ButtonState } from '../button';\nimport { useRipple } from '../../hooks/useRipple';\nimport { ariaAttributesOf, buttonRenderer, linkRenderer, toggleButtonRenderer } from '../../render/aria';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\nimport ProgressIndicator from '../progress-indicator';\n\n// Each variant composites an 'on-color' over its own container at the\n// interaction state's opacity, rather than swapping in a separate hover\n// color. The pairs are the icon buttons spec page's: filled on primary,\n// tonal on secondary container, outlined with an outline variant border and\n// an on-surface-variant icon, standard on surface variant over nothing. calc(<opacity> * 100%) turns the token's unitless 0-1 ratio into the\n// percentage color-mix() takes. Inlined at each property rather than factored\n// into a helper: @stylexjs/babel-plugin only statically recognizes\n// expressions written directly as property values.\n//\n// Disabled is a style of its own per variant rather than a `:disabled`\n// branch inside each property, for the reason Button's comment gives: given\n// `href` this renders as a link, which React Aria turns into a <span> while\n// disabled, and neither matches the pseudo-class. Applied last from the\n// render state, the disabled styles replace each property whole, hover and\n// pressed branches included.\n//\n// **The outlined border thickens with the size, and the widths are Button's\n// rather than this page's.** The icon buttons page keeps them in a size token\n// set its widget will not open to a script, and the two components already\n// share their five heights on purpose — a 96dp icon button beside a 96dp\n// outlined button with a different border weight would read as a mistake.\n//\n// **A toggle is the same button reporting a state.** Given `isSelected`,\n// `defaultSelected` or `onChange` it is React Aria's `ToggleButton` instead\n// of its `Button`, which announces the state through `aria-pressed` rather\n// than a role of its own — every variant and size still applies. The page\n// gives each style a second pair of colour roles for it, and they are not\n// the plain button's: a filled toggle rests on surface container with an\n// on-surface-variant icon and takes primary once chosen, a tonal one rests\n// on secondary container and takes secondary, and a standard one is\n// transparent throughout with the icon going from on-surface-variant to\n// primary, and an outlined one swaps its border for the inverse surface\n// pair. So a chosen filled toggle looks like a plain filled button, and an\n// unchosen one does not.\n//\n// A toggle is never a link and never pending. React Aria's `ToggleButton`\n// takes neither, and neither means anything for a control whose whole job is\n// to report which of two states it is in.\n//\n// The corner softens from a circle to a rounded square while pressed, which\n// is the shape morph the icon buttons spec page gives this control, at the\n// pressed corner its size token set names: 8 for the two small sizes, 12 at\n// medium, 16 at the two large. Each size carries its own pressed radius, since\n// StyleX replaces the property whole. The two transitioned properties take\n// different curves — the colour change is linear-ish and the shape change is\n// emphasized — so the timing functions are a matching comma list rather than\n// one value.\n//\n// A chosen toggle rests at that same pressed corner, which is the page's\n// shape morph: a toggle icon button moves from round while unchosen to\n// square once chosen. The square shape's own corner sits in a token set the\n// page keeps behind its size menu, but the page also says both shapes press\n// to the same radius — so the size's pressed corner is the value it already\n// assigns to that size, used here at rest rather than invented.\ntype Ripple = ReturnType<typeof useRipple<FocusableElement>>;\nconst styles = {\n base: {\n kGNEyG: \"x6s0dn4\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n kVAEAm: \"x1n2onr6\",\n kybGjl: \"x1hl2dhg\",\n kIyJzY: \"x1iuyhda\",\n k1ekBW: \"xb5u718\",\n kAMwcw: \"x15l9jch\",\n $$css: true\n },\n disabled: {\n kaIpWk: \"x1dkaolv\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n filled: {\n kWkggS: \"xpky1to xyf7a0q xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n filledDisabled: {\n kWkggS: \"xepofeg\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"xbck2fw x1h1ujn1 x1mjdul6\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n label: {\n k1xSpc: \"xjp7ctv\",\n $$css: true\n },\n labelPending: {\n k33iCy: \"xlshs6z\",\n $$css: true\n },\n lg: {\n kZKoxP: \"xs1ryiz\",\n kaIpWk: \"xtt5grq x1dkaolv\",\n kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x15yg21f\",\n $$css: true\n },\n md: {\n kZKoxP: \"x1rv7mn0\",\n kaIpWk: \"x1r81nxe x1dkaolv\",\n kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x100vrsf\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x1dg9itu x1728qcm xjbqb8w\",\n kVAM5u: \"x133yhug\",\n ksu8eU: \"x1y0btm7\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n outlinedDisabled: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"xrh88j3\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"x1q27o6y x1v1ylhe x1c5gpgi\",\n kVAM5u: \"x9r1u3d\",\n kMwMTN: \"x1girmi0\",\n $$css: true\n },\n pending: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kpwlN0: \"x10a8y8t\",\n kjj79g: \"xl56j7k\",\n kVAEAm: \"x10l6tqk\",\n $$css: true\n },\n standard: {\n kWkggS: \"x83qkoq x1p2om7n xjbqb8w\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n standardDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"x12vej0r x14dcer4 xjbqb8w\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n tonal: {\n kWkggS: \"xnqsvhv xlizrex x15dekr4\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n tonalDisabled: {\n kWkggS: \"xepofeg\",\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x1q841l6 x1ofvui0 x167r6xl\",\n kMwMTN: \"x1lba3jz\",\n $$css: true\n },\n xl: {\n kZKoxP: \"x1xaimp3\",\n kaIpWk: \"x11f6t2b x1dkaolv\",\n kGuDYH: \"x1s3cmhv\",\n kzqmXN: \"x13oubkp\",\n $$css: true\n },\n xs: {\n kZKoxP: \"xig8zya\",\n kaIpWk: \"x1r81nxe x1dkaolv\",\n kGuDYH: \"xwsyq91\",\n kzqmXN: \"x1td3qas\",\n $$css: true\n },\n xxl: {\n kZKoxP: \"x173yhrv\",\n kaIpWk: \"x11f6t2b x1dkaolv\",\n kGuDYH: \"x1tgwohi\",\n kzqmXN: \"x1f2tiqu\",\n $$css: true\n }\n};\n\n// The outlined border thickens with the size, as Button's does: 1dp up to M,\n// 2dp at XL, 3dp at XXL. A style per size rather than a value in the size\n// style, since a border on a filled button would draw in the icon's colour.\nconst outlineWidths = {\n lg: {\n kMzoRj: \"xmkeg23\",\n $$css: true\n },\n md: {\n kMzoRj: \"xmkeg23\",\n $$css: true\n },\n xl: {\n kMzoRj: \"xdh2fpr\",\n $$css: true\n },\n xs: {\n kMzoRj: \"xmkeg23\",\n $$css: true\n },\n xxl: {\n kMzoRj: \"x9r2w2z\",\n $$css: true\n }\n};\n\n// A chosen toggle rests at the corner its size presses to, which is the\n// page's round-to-square morph. A style per size rather than a value inside\n// each size style, since StyleX replaces the property whole and this one has\n// to beat both the size's `:active` branch and the disabled style's circle.\nconst selectedShapes = {\n lg: {\n kaIpWk: \"x62ce2h\",\n $$css: true\n },\n md: {\n kaIpWk: \"x1xdvaa9\",\n $$css: true\n },\n xl: {\n kaIpWk: \"xhpdng0\",\n $$css: true\n },\n xs: {\n kaIpWk: \"x1xdvaa9\",\n $$css: true\n },\n xxl: {\n kaIpWk: \"xhpdng0\",\n $$css: true\n }\n};\n\n// Which container a toggle draws, chosen and not. Three of the six are the\n// plain button's own styles: a chosen filled toggle is the filled button, and\n// an unchosen tonal or standard one is the tonal or standard button.\nconst toggleStyles = {\n filled: {\n selected: styles.filled,\n unselected: styles.filledToggle\n },\n outlined: {\n selected: styles.outlinedToggleSelected,\n unselected: styles.outlined\n },\n standard: {\n selected: styles.standardToggleSelected,\n unselected: styles.standard\n },\n tonal: {\n selected: styles.tonalToggleSelected,\n unselected: styles.tonal\n }\n};\nconst disabledStyles = {\n filled: styles.filledDisabled,\n outlined: styles.outlinedDisabled,\n standard: styles.standardDisabled,\n tonal: styles.tonalDisabled\n};\ntype IconButtonProps = {\n /**\n * What the button does, in words. Required rather than optional: an icon\n * on its own has no accessible name, so without this the control announces\n * nothing at all.\n */\n 'aria-label': string;\n children?: ReactNode;\n /** A function may compute the class from the button's render state. */\n className?: ClassNameOrFunction<IconButtonState>;\n /**\n * Whether a toggle starts chosen, when it keeps its own state. Passing\n * this, `isSelected` or `onChange` is what makes the button a toggle.\n */\n defaultSelected?: boolean;\n /**\n * Disables the press ripple. The hover and pressed state layers are\n * unaffected.\n * @default false\n */\n disableRipple?: boolean;\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 * `render`, `type`, and the form and pending props apply to the button\n * form only, and a toggle is never a link.\n */\n href?: string;\n /**\n * Whether a toggle is chosen, when the call site holds the state. Pass it\n * with `onChange`; passing this, `defaultSelected` or `onChange` is what\n * makes the button a toggle.\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 /**\n * The name of the ring shown while the button is pending, for a screen\n * reader. The label it replaces is hidden while it shows.\n * @default 'Loading'\n */\n pendingLabel?: string;\n /** The link's `rel`, when `href` is set. */\n rel?: string;\n /**\n * The element to render, given the props it would have carried. React\n * Aria's own form: it has to return the element the component would have\n * rendered itself.\n */\n render?: DOMRenderFunction<'button', IconButtonState>;\n /**\n * Control size: `xs` 32px, `md` 40px, `lg` 56px, `xl` 96px, `xxl` 136px —\n * the icon buttons spec page's XS to XL, and the same heights `Button`\n * uses, so the two line up beside each other in a row. The icon is 20px,\n * 24px, 24px, 32px and 40px in turn.\n * @default 'md'\n */\n size?: IconButtonSize;\n /** A function may compute the style from the button's render state. */\n style?: StyleOrFunction<IconButtonState>;\n /** The link's `target`, when `href` is set. */\n target?: string;\n /**\n * `standard` is transparent and tints what it sits on; `outlined` is\n * transparent with a rule around it; `filled` and `tonal` carry a container\n * of their own.\n * @default 'standard'\n */\n variant?: IconButtonVariant;\n} & Omit<ButtonDOMProps, 'render'>;\ntype IconButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl';\n\n// The render state a call site's `className`, `style` or `render` function is\n// handed. `isSelected` is optional because only the toggle form has one, and\n// one function has to be accepted by both: React Aria hands the plain button\n// a state without it and the toggle a state with it, and a parameter type\n// this wide accepts either.\ntype IconButtonState = ButtonState & {\n isSelected?: boolean;\n};\ntype IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';\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, ripple: Ripple) {\n return (state: ButtonRenderProps) => <>\n <span {...{\n 0: {\n className: \"xjp7ctv\"\n },\n 1: {\n className: \"xjp7ctv xlshs6z\"\n }\n }[!!state.isPending << 0]}>\n {children}\n </span>\n {state.isPending ? <span className=\"x6s0dn4 x78zum5 x10a8y8t xl56j7k x10l6tqk\">\n <ProgressIndicator aria-label={pendingLabel} isIndeterminate size=\"1em\" tone=\"inherit\" variant=\"circular\" />\n </span> : null}\n {ripple.surface}\n </>;\n}\n/**\n * A button that is an icon, at five control heights. Given `href` it is a\n * link with the same appearance. Every `aria-*` prop is forwarded to the\n * element; React Aria alone would keep only the labelling ones.\n *\n * Given `isSelected`, `defaultSelected` or `onChange` it is a toggle, which\n * reports its state through `aria-pressed` and draws the page's second pair\n * of colour roles for its variant. A toggle takes neither `href` nor the\n * pending props.\n *\n * ```tsx\n * <IconButton aria-label=\"Label\" defaultSelected variant=\"tonal\">\n * <StarIcon />\n * </IconButton>\n * ```\n */\nfunction IconButton({\n children,\n defaultSelected,\n disableRipple = false,\n href,\n isDisabled,\n isSelected,\n onChange,\n onClick,\n onContextMenu,\n onKeyDown,\n onKeyUp,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n pendingLabel = 'Loading',\n rel,\n render,\n size = 'md',\n target,\n variant = 'standard',\n ...props\n}: IconButtonProps) {\n // A field's context may disable the button — a number field's stepper at\n // the end of its range, 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 every one of them enabled. The call site's own prop still\n // wins where it is given; the context is read for the ripple, which has\n // to know before the render state does.\n const context = useSlottedContext(ButtonContext, props.slot);\n const disabled = isDisabled ?? context?.isDisabled ?? false;\n\n // `props` (className/style, etc.) is spread separately: `className` and\n // `style` there may be functions of render state, which ripple's own\n // handler-only merge doesn't need to know about. It is also why the styles\n // below merge through mergeStatefulStyles rather than the plain\n // mergeStyles. The ripple is off while disabled, as in Button.\n const ripple = useRipple<FocusableElement>(!disableRipple && !disabled, {\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n });\n const element = {\n aria: ariaAttributesOf(props),\n onKeyDown,\n onKeyUp\n };\n\n // The three props that make this a toggle. Read together rather than behind\n // a `toggle` word of its own, the way `href` already turns the button into\n // a link: a button given none of them has no state to report, and one given\n // any of them has nothing else it could mean.\n if (defaultSelected !== undefined || isSelected !== undefined || onChange !== undefined) {\n return <RACToggleButton defaultSelected={defaultSelected} isDisabled={disabled} isSelected={isSelected} onChange={onChange} render={toggleButtonRenderer(element, render)} {...ripple.handlers} {...props} {...mergeStatefulStyles(toggleStyleProps(size, variant), props)}>\n {toggleContent(children, ripple)}\n </RACToggleButton>;\n }\n const styleProps = mergeStatefulStyles((state: ButtonState) => stylex.props(styles.base, focus.ring, styles[variant], styles[size], variant === 'outlined' && outlineWidths[size], state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]), props);\n if (href !== undefined) {\n return <RACLink href={href} isDisabled={disabled} rel={rel} render={linkRenderer(element)} target={target} {...ripple.handlers} {...props} {...styleProps}>\n {children}\n {ripple.surface}\n </RACLink>;\n }\n return <RACButton isDisabled={disabled} render={buttonRenderer(element, render)} {...ripple.handlers} {...props} {...styleProps}>\n {buttonContent(children, pendingLabel, ripple)}\n </RACButton>;\n}\n\n// What a toggle draws: its icon and the ripple. No pending ring — React\n// Aria's toggle button has no pending state, and a control reporting which of\n// two states it is in has nothing to be pending about.\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 memoises\n// the result on its inputs.\nfunction toggleContent(children: ReactNode, ripple: Ripple) {\n return () => <>\n {children}\n {ripple.surface}\n </>;\n}\n\n// A toggle's styles, from React Aria's render state. The chosen shape is\n// applied after the disabled styles so it survives them: which of the two\n// states a disabled toggle is in should still be readable, and the disabled\n// style otherwise forces the circle back.\nfunction toggleStyleProps(size: IconButtonSize, variant: IconButtonVariant) {\n return (state: IconButtonState) => stylex.props(styles.base, focus.ring, state.isSelected === true ? toggleStyles[variant].selected : toggleStyles[variant].unselected, styles[size],\n // A chosen outlined toggle has a container rather than a rule, so the\n // width goes on only while it is unchosen.\n variant === 'outlined' && state.isSelected !== true && outlineWidths[size], state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant], state.isSelected === true && selectedShapes[size]);\n}\nexport type { IconButtonProps, IconButtonSize, IconButtonState, IconButtonVariant };\nexport default IconButton;"],"mappings":";;;;;;;;;;AAoEA,MAAMgC,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRd,QAAQ;EACRG,QAAQ;EACRU,OAAO;CACT;CACAE,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,gBAAgB;EACdF,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAM,cAAc;EACZH,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAO,OAAO;EACLhB,QAAQ;EACRS,OAAO;CACT;CACAQ,cAAc;EACZC,QAAQ;EACRT,OAAO;CACT;CACAU,IAAI;EACFC,QAAQ;EACRxB,QAAQ;EACRyB,QAAQ;EACRC,QAAQ;EACRb,OAAO;CACT;CACAc,IAAI;EACFH,QAAQ;EACRxB,QAAQ;EACRyB,QAAQ;EACRC,QAAQ;EACRb,OAAO;CACT;CACAe,UAAU;EACRZ,QAAQ;EACRa,QAAQ;EACRC,QAAQ;EACRb,QAAQ;EACRJ,OAAO;CACT;CACAkB,kBAAkB;EAChBf,QAAQ;EACRa,QAAQ;EACRZ,QAAQ;EACRJ,OAAO;CACT;CACAmB,wBAAwB;EACtBhB,QAAQ;EACRa,QAAQ;EACRZ,QAAQ;EACRJ,OAAO;CACT;CACAoB,SAAS;EACPlC,QAAQ;EACRK,QAAQ;EACR8B,QAAQ;EACR5B,QAAQ;EACRE,QAAQ;EACRK,OAAO;CACT;CACAsB,UAAU;EACRnB,QA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;GAA+B,GAAME;GAAe,GAAMV;GAAK,GAAMe;GAChHH,UAAAA;EADY,CAAA;EAEH3B,EAAA,MAAA+B;EAAA/B,EAAA,MAAA9D;EAAA8D,EAAA,MAAAe;EAAAf,EAAA,MAAAN,OAAA8B;EAAAxB,EAAA,MAAA8B;EAAA9B,EAAA,MAAAuB;EAAAvB,EAAA,MAAA2B;EAAA3B,EAAA,MAAAgC;CAAA,OAAAA,MAAAhC,EAAA;CAAA,OAFPgC;AAEO;AAUhB,SAASJ,cAAcrD,UAAqBmB,QAAgB;CAC1D,aAAa,qBAAA,UAAA,EAAA,UAAA,CACRnB,UACAmB,OAAOG,OACV,EAAA,CAAA;AACJ;AAMA,SAAS6B,iBAAiBxC,MAAsBI,SAA4B;CAC1E,QAAQK,UAA2BpG,MAAa0B,OAAOC,MAAMX,MAAMsH,MAAMlC,MAAMd,eAAe,OAAOX,aAAaoB,QAAQ,CAACnB,WAAWD,aAAaoB,QAAQ,CAAClB,YAAYnD,OAAOiE,OAG/KI,YAAY,cAAcK,MAAMd,eAAe,QAAQb,cAAckB,OAAOS,MAAMQ,cAAclF,OAAOiB,UAAUyD,MAAMQ,cAAc9B,eAAeiB,UAAUK,MAAMd,eAAe,QAAQZ,eAAeiB,KAAK;AACjN"}
|
|
@@ -274,7 +274,7 @@ function MenuLoadMore(t0) {
|
|
|
274
274
|
label = t3 === void 0 ? "Loading more" : t3;
|
|
275
275
|
T0 = MenuLoadMoreItem;
|
|
276
276
|
t1 = props;
|
|
277
|
-
t2 = mergeStyles({ className: "x6s0dn4 x9f619 x78zum5 xl56j7k
|
|
277
|
+
t2 = mergeStyles({ className: "x6s0dn4 x9f619 x78zum5 xl56j7k x1ddmzdj" }, props);
|
|
278
278
|
$[0] = t0;
|
|
279
279
|
$[1] = T0;
|
|
280
280
|
$[2] = label;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ComponentProps","ReactElement","ReactNode","MenuItemRenderProps","PopoverRenderProps","MenuItemProps","RACMenuItemProps","MenuLoadMoreItemProps","RACMenuLoadMoreItemProps","MenuProps","RACMenuProps","MenuSectionProps","RACMenuSectionProps","MenuTriggerProps","RACMenuTriggerProps","stylex","Header","Keyboard","Menu","RACMenu","MenuItem","RACMenuItem","MenuLoadMoreItem","RACMenuLoadMoreItem","MenuSection","RACMenuSection","MenuTrigger","RACMenuTrigger","Popover","RACPopover","SubmenuTrigger","RACSubmenuTrigger","Text","OverlayAlign","OverlaySide","CollectionLoadMore","ChevronEndGlyph","RowContent","rowStyles","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","colors","radii","spacing","typography","Separator","MENU_MIN","MENU_MAX","styles","content","kWkggS","kaIpWk","ks0D6T","k7Eaqz","k3XXqK","k8WAf4","$$css","MenuAlign","MenuContentProps","align","alignOffset","className","T","container","Element","search","side","MenuSide","sideOffset","style","Omit","children","leading","shortcut","trailing","MenuLoadMoreProps","label","header","MenuSeparatorProps","MenuSubmenuProps","delay","itemContent","state","isDisabled","isSelected","trailingOf","itemStyles","props","base","menu","interactive","selectedMenu","disabled","t0","$","_c","t1","MenuContent","t2","t3","undefined","t4","t5","Symbol","for","surfaceStyles","t6","t7","t8","t9","T0","textValue","textOf","MenuLoadMore","MenuSeparator","MenuSubmenu","popup","placement","hasSubmenu","Content","Item","LoadMore","Section","Submenu"],"sources":["../../../src/components/menu/index.tsx"],"sourcesContent":["import type { ComponentProps, ReactElement, ReactNode } from 'react';\nimport type { MenuItemRenderProps, PopoverRenderProps, MenuItemProps as RACMenuItemProps, MenuLoadMoreItemProps as RACMenuLoadMoreItemProps, MenuProps as RACMenuProps, MenuSectionProps as RACMenuSectionProps, MenuTriggerProps as RACMenuTriggerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Header, Keyboard, Menu as RACMenu, MenuItem as RACMenuItem, MenuLoadMoreItem as RACMenuLoadMoreItem, MenuSection as RACMenuSection, MenuTrigger as RACMenuTrigger, Popover as RACPopover, SubmenuTrigger as RACSubmenuTrigger, Text } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { CollectionLoadMore } from '../../collection';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport Separator from '../separator';\n\n// The menus page's menu: a surface between 112 and 280 wide with a 4dp\n// corner and 8dp above and below its items, holding rows of the row module's\n// menu variant — 48dp tall, a label-large label, tertiary container when\n// selected. The surface itself is the overlay module's, shared with Popover\n// and Sheet, with the two things the menus page decides differently applied\n// over it: the corner, which is the extra-small step rather than the\n// medium one every other overlay takes, and the container colour, which is\n// the Expressive column's surface container low rather than the baseline's\n// surface container.\n//\n// Six parts, because everything a menu holds takes arbitrary content:\n// `Menu.Content`, `Menu.Item`, `Menu.Section`, `Menu.Separator`,\n// `Menu.Submenu` and `Menu.LoadMore`. A `Button` or `IconButton` placed\n// directly inside `Menu` is the trigger, wired through React Aria's context\n// rather than a part of ours — the same arrangement Sheet and Popover use.\n//\n// Four things are worth knowing about how this maps onto React Aria.\n//\n// **The item's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function, wrapped in `mergeStatefulStyles` so a call site's own\n// `className` survives.\n//\n// **A shortcut goes through React Aria's `Keyboard` slot**, and the label\n// through its `Text` slot. The second is what makes the first work: React\n// Aria points the item's `aria-labelledby` at the labelled text, so a screen\n// reader reads the label alone and announces the keystroke separately. Left\n// as plain content, the item's name is its whole text and the shortcut is\n// read as part of what the item does. The keycap itself is the library's.\n//\n// **A submenu's arrow is drawn from render state, not from a prop.** React\n// Aria reports `hasSubmenu` on the item inside a `SubmenuTrigger`, so an item\n// that opens one gets the chevron without the call site saying so twice. The\n// glyph carries no direction of its own, so the style mirrors it under a\n// right-to-left writing mode.\n//\n// **A menu's children are a collection**, so anything that is not an item is\n// dropped: React Aria walks them looking for items and finds a search input\n// no place to be. `Menu.Content` therefore takes a `search` slot, drawn on\n// the surface above the items — which is also what puts the bar and the\n// items inside one `Autocomplete` when the menu is filtered.\n//\n// **A separator needs no slot from the call site.** React Aria's menu\n// provides the separator context, which is what `Menu.Separator` picks up —\n// that is why Separator moved onto React Aria in Phase 0. What is added here\n// is the menus page's 8dp either side of the rule.\n\nconst MENU_MIN = '112px';\nconst MENU_MAX = '280px';\nconst styles = {\n content: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n ks0D6T: \"x1jkqq1h\",\n k7Eaqz: \"x1c7vg25\",\n k3XXqK: \"x1t137rt\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n }\n};\ntype MenuAlign = OverlayAlign;\ntype MenuContentProps<T extends object = object> = {\n /** Where the menu lines up along that side. @default 'start' */\n align?: MenuAlign;\n /** Moves the menu along that side, in pixels. */\n alignOffset?: number;\n /** A function may compute the class from the menu's render state. */\n className?: RACMenuProps<T>['className'];\n /**\n * Where to portal the menu. Defaults to the end of `<body>`, which is right\n * for an app that sets its StyleX theme on `:root`. An app that scopes the\n * theme to a subtree has to point this at an element inside it, or the menu\n * renders outside the theme and falls back to the tokens'\n * `prefers-color-scheme` default.\n */\n container?: Element;\n /**\n * Content drawn on the surface above the items — a search bar that filters\n * them, usually. It goes here rather than among the children because a\n * menu's children are a collection: React Aria walks them for items and\n * drops anything else, so an input written beside them disappears.\n *\n * To filter with it, wrap this whole part in `Autocomplete`, which puts\n * the bar and the items inside one wrapper.\n */\n search?: ReactNode;\n /** Which side of the trigger the menu opens on. @default 'bottom' */\n side?: MenuSide;\n /** How far the menu sits from the trigger, in pixels. @default 8 */\n sideOffset?: number;\n /** A function may compute the style from the menu's render state. */\n style?: RACMenuProps<T>['style'];\n} & Omit<RACMenuProps<T>, 'className' | 'style'>;\ntype MenuItemProps<T extends object = object> = {\n /** The item's label — what it does. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACMenuItemProps<T>['className'];\n /** Content before the label, usually an icon. */\n leading?: ReactNode;\n /**\n * The keystroke that runs the item, drawn as a keycap at the end. Goes\n * through React Aria's keyboard slot, so a screen reader announces it\n * apart from the label rather than reading the two as one name.\n */\n shortcut?: ReactNode;\n /** A function may compute the style from the item's render state. */\n style?: RACMenuItemProps<T>['style'];\n /** Content after the label, before the shortcut. */\n trailing?: ReactNode;\n} & Omit<RACMenuItemProps<T>, 'children' | 'className' | 'style'>;\ntype MenuLoadMoreProps = Omit<RACMenuLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\n\n// `children` is optional here where React Aria makes it required, so the\n// type reads the way Sheet's and Popover's do: a root that composes rather\n// than one that has to be handed something. Sheet does the same for the same\n// reason.\ntype MenuProps = Omit<RACMenuTriggerProps, 'children'> & {\n /** The trigger, then the `Menu.Content` it opens. */\n children?: ReactNode;\n};\ntype MenuSectionProps<T extends object = object> = Omit<RACMenuSectionProps<T>, 'children'> & {\n /**\n * The items in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\ntype MenuSeparatorProps = Omit<ComponentProps<typeof Separator>, 'orientation'>;\ntype MenuSide = OverlaySide;\ntype MenuSubmenuProps = {\n /**\n * The item that opens the submenu, then the `Menu.Content` it opens.\n * Exactly those two, in that order.\n */\n children: ReactElement[];\n /**\n * How long the pointer rests on the item before the submenu opens, in\n * milliseconds.\n * @default 200\n */\n delay?: number;\n};\n\n// What the item draws, from React Aria's render state. Built by a call\n// rather 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\n// on its inputs.\n//\n// The render state decides two things: the chevron, which an item inside a\n// SubmenuTrigger gets without the call site asking twice, and the supporting\n// line's colour, which the row module takes from whether the row is selected\n// or disabled.\nfunction itemContent(children: ReactNode, leading: ReactNode, shortcut: ReactNode, trailing: ReactNode) {\n return (state: MenuItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} trailing={trailingOf(state, shortcut, trailing)} variant=\"menu\">\n <Text slot=\"label\">{children}</Text>\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// item's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n// No overline, and so no three-line row: the menus page gives one item\n// height and one line of text. `List.Item` and `ListBox.Item` take the prop\n// because the lists page is what they draw, and this row is 48dp rather than\n// that page's 56.\nfunction itemStyles(state: MenuItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.menu, rowStyles.interactive, state.isSelected && rowStyles.selectedMenu, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * A list of actions opened from a control. Open state is React Aria's: pass\n * `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it keep\n * its own.\n *\n * A `Button` or `IconButton` placed directly inside opens it; everything the\n * menu shows goes in `Menu.Content`, since the trigger lives in the page\n * while the menu is portalled out to the end of the body.\n *\n * ```tsx\n * <Menu>\n * <Button>Open</Button>\n * <Menu.Content aria-label=\"Label\">\n * <Menu.Item id=\"first\">First item</Menu.Item>\n * </Menu.Content>\n * </Menu>\n * ```\n */\nfunction Menu({\n children,\n ...props\n}: MenuProps) {\n return <RACMenuTrigger {...props}>{children}</RACMenuTrigger>;\n}\n\n/**\n * The menu itself, and the surface it is drawn on. React Aria names it after\n * the control that opened it, so `aria-label` here is ignored — name the\n * trigger instead.\n *\n * The call site's `className` and `style` land on the surface, which is the\n * element a layout positions.\n */\nfunction MenuContent<T extends object = object>({\n align = 'start',\n alignOffset,\n className,\n container,\n search,\n side = 'bottom',\n sideOffset = 8,\n style,\n ...props\n}: MenuContentProps<T>) {\n return <RACPopover crossOffset={alignOffset} offset={sideOffset} placement={placementOf(side, align)}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles(surfaceStyles, {})}>\n {search === undefined ? null : <div className=\"x9f619 xqf7pud xn60lsn\">{search}</div>}\n <RACMenu<T> {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt\"\n }, {\n className,\n style\n })} />\n </RACPopover>;\n}\n\n/**\n * One action. Its slots are the row's: `leading` before the label, the label\n * as children, and `trailing` after it, with `shortcut` at the end. An item\n * that opens a submenu draws the chevron itself.\n */\nfunction MenuItem<T extends object = object>({\n children,\n leading,\n shortcut,\n textValue,\n trailing,\n ...props\n}: MenuItemProps<T>) {\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n {itemContent(children, leading, shortcut, trailing)}\n </RACMenuItem>;\n}\n\n/**\n * The row shown while more items are being fetched. React Aria calls\n * `onLoadMore` when it comes into view, and draws it only while `isLoading`.\n */\nfunction MenuLoadMore({\n label = 'Loading more',\n ...props\n}: MenuLoadMoreProps) {\n return <RACMenuLoadMoreItem {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xl56j7k x1wxaq2x\"\n }, props)}>\n <CollectionLoadMore label={label} size=\"20px\" />\n </RACMenuLoadMoreItem>;\n}\n\n/**\n * A named group of items. `header` names it, and is what a screen reader\n * reads before the items inside.\n */\nfunction MenuSection<T extends object = object>({\n children,\n header,\n ...props\n}: MenuSectionProps<T>) {\n return <RACMenuSection {...props}>\n {header === undefined ? null : <Header className=\"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x6gmt8y x790zyz\">{header}</Header>}\n {children}\n </RACMenuSection>;\n}\n\n/**\n * A rule between groups of items. It takes its role from the menu around it,\n * so it needs no slot from the call site.\n */\nfunction MenuSeparator(props: MenuSeparatorProps) {\n return <Separator {...props} {...mergeStyles({\n className: \"xwpi13i\"\n }, props)} />;\n}\n\n/**\n * An item that opens a menu of its own. Takes exactly two children: the\n * `Menu.Item` that opens it, then the `Menu.Content` it opens.\n */\nfunction MenuSubmenu(props: MenuSubmenuProps) {\n return <RACSubmenuTrigger {...props} />;\n}\n\n// The surface grows from the edge it is anchored by, which is what makes it\n// read as coming out of the trigger. Built by a call rather than written\n// inline at the prop, which is what react-perf's no-new-function-as-prop is\n// after.\nfunction surfaceStyles(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.content, popupOrigin(state.placement));\n}\n\n// What the item is worth as text, for the typeahead React Aria drives from\n// an item's words rather than its element. It reads it off the children when\n// they are a string and finds nothing when they are not — and an item here\n// is always an element, since the row wraps its label. So a plain-string\n// label becomes the text value, and anything else has to say what it is\n// worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\n\n/** What sits after the label: the call site's content, then the shortcut or\n * the submenu's chevron. */\nfunction trailingOf(state: MenuItemRenderProps, shortcut: ReactNode, trailing: ReactNode) {\n if (state.hasSubmenu) {\n return <>\n {trailing}\n <ChevronEndGlyph className=\"x1qx5ct2 xw4jnvo x19axjrm x1c071of\" />\n </>;\n }\n if (shortcut === undefined && trailing === undefined) {\n return undefined;\n }\n return <>\n {trailing}\n {shortcut === undefined ? null : <Keyboard className=\"x1w5n3ug\">{shortcut}</Keyboard>}\n </>;\n}\nMenu.Content = MenuContent;\nMenu.Item = MenuItem;\nMenu.LoadMore = MenuLoadMore;\nMenu.Section = MenuSection;\nMenu.Separator = MenuSeparator;\nMenu.Submenu = MenuSubmenu;\nexport type { MenuAlign, MenuContentProps, MenuItemProps, MenuLoadMoreProps, MenuProps, MenuSectionProps, MenuSeparatorProps, MenuSide, MenuSubmenuPro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ACtF,EAAA,CAAA;AACJ;AACA1D,OAAKwG,UAAUtB;AACflF,OAAKyG,OAAOvG;AACZF,OAAK0G,WAAWR;AAChBlG,OAAK2G,UAAUrG;AACfN,OAAK8B,YAAYqE;AACjBnG,OAAK4G,UAAUR"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentProps","ReactElement","ReactNode","MenuItemRenderProps","PopoverRenderProps","MenuItemProps","RACMenuItemProps","MenuLoadMoreItemProps","RACMenuLoadMoreItemProps","MenuProps","RACMenuProps","MenuSectionProps","RACMenuSectionProps","MenuTriggerProps","RACMenuTriggerProps","stylex","Header","Keyboard","Menu","RACMenu","MenuItem","RACMenuItem","MenuLoadMoreItem","RACMenuLoadMoreItem","MenuSection","RACMenuSection","MenuTrigger","RACMenuTrigger","Popover","RACPopover","SubmenuTrigger","RACSubmenuTrigger","Text","OverlayAlign","OverlaySide","CollectionLoadMore","ChevronEndGlyph","RowContent","rowStyles","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","colors","radii","sizing","spacing","typography","Separator","MENU_MIN","MENU_MAX","styles","content","kWkggS","kaIpWk","ks0D6T","k7Eaqz","k3XXqK","k8WAf4","$$css","MenuAlign","MenuContentProps","align","alignOffset","className","T","container","Element","search","side","MenuSide","sideOffset","style","Omit","children","leading","shortcut","trailing","MenuLoadMoreProps","label","header","MenuSeparatorProps","MenuSubmenuProps","delay","itemContent","state","isDisabled","isSelected","trailingOf","itemStyles","props","base","menu","interactive","selectedMenu","disabled","t0","$","_c","t1","MenuContent","t2","t3","undefined","t4","t5","Symbol","for","surfaceStyles","t6","t7","t8","t9","T0","textValue","textOf","MenuLoadMore","MenuSeparator","MenuSubmenu","popup","placement","hasSubmenu","Content","Item","LoadMore","Section","Submenu"],"sources":["../../../src/components/menu/index.tsx"],"sourcesContent":["import type { ComponentProps, ReactElement, ReactNode } from 'react';\nimport type { MenuItemRenderProps, PopoverRenderProps, MenuItemProps as RACMenuItemProps, MenuLoadMoreItemProps as RACMenuLoadMoreItemProps, MenuProps as RACMenuProps, MenuSectionProps as RACMenuSectionProps, MenuTriggerProps as RACMenuTriggerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Header, Keyboard, Menu as RACMenu, MenuItem as RACMenuItem, MenuLoadMoreItem as RACMenuLoadMoreItem, MenuSection as RACMenuSection, MenuTrigger as RACMenuTrigger, Popover as RACPopover, SubmenuTrigger as RACSubmenuTrigger, Text } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { CollectionLoadMore } from '../../collection';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, sizing, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport Separator from '../separator';\n\n// The menus page's menu: a surface between 112 and 280 wide with a 4dp\n// corner and 8dp above and below its items, holding rows of the row module's\n// menu variant — 48dp tall, a label-large label, tertiary container when\n// selected. The surface itself is the overlay module's, shared with Popover\n// and Sheet, with the two things the menus page decides differently applied\n// over it: the corner, which is the extra-small step rather than the\n// medium one every other overlay takes, and the container colour, which is\n// the Expressive column's surface container low rather than the baseline's\n// surface container.\n//\n// Six parts, because everything a menu holds takes arbitrary content:\n// `Menu.Content`, `Menu.Item`, `Menu.Section`, `Menu.Separator`,\n// `Menu.Submenu` and `Menu.LoadMore`. A `Button` or `IconButton` placed\n// directly inside `Menu` is the trigger, wired through React Aria's context\n// rather than a part of ours — the same arrangement Sheet and Popover use.\n//\n// Four things are worth knowing about how this maps onto React Aria.\n//\n// **The item's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function, wrapped in `mergeStatefulStyles` so a call site's own\n// `className` survives.\n//\n// **A shortcut goes through React Aria's `Keyboard` slot**, and the label\n// through its `Text` slot. The second is what makes the first work: React\n// Aria points the item's `aria-labelledby` at the labelled text, so a screen\n// reader reads the label alone and announces the keystroke separately. Left\n// as plain content, the item's name is its whole text and the shortcut is\n// read as part of what the item does. The keycap itself is the library's.\n//\n// **A submenu's arrow is drawn from render state, not from a prop.** React\n// Aria reports `hasSubmenu` on the item inside a `SubmenuTrigger`, so an item\n// that opens one gets the chevron without the call site saying so twice. The\n// glyph carries no direction of its own, so the style mirrors it under a\n// right-to-left writing mode.\n//\n// **A menu's children are a collection**, so anything that is not an item is\n// dropped: React Aria walks them looking for items and finds a search input\n// no place to be. `Menu.Content` therefore takes a `search` slot, drawn on\n// the surface above the items — which is also what puts the bar and the\n// items inside one `Autocomplete` when the menu is filtered.\n//\n// **A separator needs no slot from the call site.** React Aria's menu\n// provides the separator context, which is what `Menu.Separator` picks up —\n// that is why Separator moved onto React Aria in Phase 0. What is added here\n// is the menus page's 8dp either side of the rule.\n\nconst MENU_MIN = '112px';\nconst MENU_MAX = '280px';\nconst styles = {\n content: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n ks0D6T: \"x1jkqq1h\",\n k7Eaqz: \"x1c7vg25\",\n k3XXqK: \"x1t137rt\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n }\n};\ntype MenuAlign = OverlayAlign;\ntype MenuContentProps<T extends object = object> = {\n /** Where the menu lines up along that side. @default 'start' */\n align?: MenuAlign;\n /** Moves the menu along that side, in pixels. */\n alignOffset?: number;\n /** A function may compute the class from the menu's render state. */\n className?: RACMenuProps<T>['className'];\n /**\n * Where to portal the menu. Defaults to the end of `<body>`, which is right\n * for an app that sets its StyleX theme on `:root`. An app that scopes the\n * theme to a subtree has to point this at an element inside it, or the menu\n * renders outside the theme and falls back to the tokens'\n * `prefers-color-scheme` default.\n */\n container?: Element;\n /**\n * Content drawn on the surface above the items — a search bar that filters\n * them, usually. It goes here rather than among the children because a\n * menu's children are a collection: React Aria walks them for items and\n * drops anything else, so an input written beside them disappears.\n *\n * To filter with it, wrap this whole part in `Autocomplete`, which puts\n * the bar and the items inside one wrapper.\n */\n search?: ReactNode;\n /** Which side of the trigger the menu opens on. @default 'bottom' */\n side?: MenuSide;\n /** How far the menu sits from the trigger, in pixels. @default 8 */\n sideOffset?: number;\n /** A function may compute the style from the menu's render state. */\n style?: RACMenuProps<T>['style'];\n} & Omit<RACMenuProps<T>, 'className' | 'style'>;\ntype MenuItemProps<T extends object = object> = {\n /** The item's label — what it does. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACMenuItemProps<T>['className'];\n /** Content before the label, usually an icon. */\n leading?: ReactNode;\n /**\n * The keystroke that runs the item, drawn as a keycap at the end. Goes\n * through React Aria's keyboard slot, so a screen reader announces it\n * apart from the label rather than reading the two as one name.\n */\n shortcut?: ReactNode;\n /** A function may compute the style from the item's render state. */\n style?: RACMenuItemProps<T>['style'];\n /** Content after the label, before the shortcut. */\n trailing?: ReactNode;\n} & Omit<RACMenuItemProps<T>, 'children' | 'className' | 'style'>;\ntype MenuLoadMoreProps = Omit<RACMenuLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\n\n// `children` is optional here where React Aria makes it required, so the\n// type reads the way Sheet's and Popover's do: a root that composes rather\n// than one that has to be handed something. Sheet does the same for the same\n// reason.\ntype MenuProps = Omit<RACMenuTriggerProps, 'children'> & {\n /** The trigger, then the `Menu.Content` it opens. */\n children?: ReactNode;\n};\ntype MenuSectionProps<T extends object = object> = Omit<RACMenuSectionProps<T>, 'children'> & {\n /**\n * The items in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\ntype MenuSeparatorProps = Omit<ComponentProps<typeof Separator>, 'orientation'>;\ntype MenuSide = OverlaySide;\ntype MenuSubmenuProps = {\n /**\n * The item that opens the submenu, then the `Menu.Content` it opens.\n * Exactly those two, in that order.\n */\n children: ReactElement[];\n /**\n * How long the pointer rests on the item before the submenu opens, in\n * milliseconds.\n * @default 200\n */\n delay?: number;\n};\n\n// What the item draws, from React Aria's render state. Built by a call\n// rather 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\n// on its inputs.\n//\n// The render state decides two things: the chevron, which an item inside a\n// SubmenuTrigger gets without the call site asking twice, and the supporting\n// line's colour, which the row module takes from whether the row is selected\n// or disabled.\nfunction itemContent(children: ReactNode, leading: ReactNode, shortcut: ReactNode, trailing: ReactNode) {\n return (state: MenuItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} trailing={trailingOf(state, shortcut, trailing)} variant=\"menu\">\n <Text slot=\"label\">{children}</Text>\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// item's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n// No overline, and so no three-line row: the menus page gives one item\n// height and one line of text. `List.Item` and `ListBox.Item` take the prop\n// because the lists page is what they draw, and this row is 48dp rather than\n// that page's 56.\nfunction itemStyles(state: MenuItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.menu, rowStyles.interactive, state.isSelected && rowStyles.selectedMenu, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * A list of actions opened from a control. Open state is React Aria's: pass\n * `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it keep\n * its own.\n *\n * A `Button` or `IconButton` placed directly inside opens it; everything the\n * menu shows goes in `Menu.Content`, since the trigger lives in the page\n * while the menu is portalled out to the end of the body.\n *\n * ```tsx\n * <Menu>\n * <Button>Open</Button>\n * <Menu.Content aria-label=\"Label\">\n * <Menu.Item id=\"first\">First item</Menu.Item>\n * </Menu.Content>\n * </Menu>\n * ```\n */\nfunction Menu({\n children,\n ...props\n}: MenuProps) {\n return <RACMenuTrigger {...props}>{children}</RACMenuTrigger>;\n}\n\n/**\n * The menu itself, and the surface it is drawn on. React Aria names it after\n * the control that opened it, so `aria-label` here is ignored — name the\n * trigger instead.\n *\n * The call site's `className` and `style` land on the surface, which is the\n * element a layout positions.\n */\nfunction MenuContent<T extends object = object>({\n align = 'start',\n alignOffset,\n className,\n container,\n search,\n side = 'bottom',\n sideOffset = 8,\n style,\n ...props\n}: MenuContentProps<T>) {\n return <RACPopover crossOffset={alignOffset} offset={sideOffset} placement={placementOf(side, align)}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles(surfaceStyles, {})}>\n {search === undefined ? null : <div className=\"x9f619 xqf7pud xn60lsn\">{search}</div>}\n <RACMenu<T> {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt\"\n }, {\n className,\n style\n })} />\n </RACPopover>;\n}\n\n/**\n * One action. Its slots are the row's: `leading` before the label, the label\n * as children, and `trailing` after it, with `shortcut` at the end. An item\n * that opens a submenu draws the chevron itself.\n */\nfunction MenuItem<T extends object = object>({\n children,\n leading,\n shortcut,\n textValue,\n trailing,\n ...props\n}: MenuItemProps<T>) {\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n {itemContent(children, leading, shortcut, trailing)}\n </RACMenuItem>;\n}\n\n/**\n * The row shown while more items are being fetched. React Aria calls\n * `onLoadMore` when it comes into view, and draws it only while `isLoading`.\n */\nfunction MenuLoadMore({\n label = 'Loading more',\n ...props\n}: MenuLoadMoreProps) {\n return <RACMenuLoadMoreItem {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xl56j7k x1ddmzdj\"\n }, props)}>\n <CollectionLoadMore label={label} size=\"20px\" />\n </RACMenuLoadMoreItem>;\n}\n\n/**\n * A named group of items. `header` names it, and is what a screen reader\n * reads before the items inside.\n */\nfunction MenuSection<T extends object = object>({\n children,\n header,\n ...props\n}: MenuSectionProps<T>) {\n return <RACMenuSection {...props}>\n {header === undefined ? null : <Header className=\"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x6gmt8y x790zyz\">{header}</Header>}\n {children}\n </RACMenuSection>;\n}\n\n/**\n * A rule between groups of items. It takes its role from the menu around it,\n * so it needs no slot from the call site.\n */\nfunction MenuSeparator(props: MenuSeparatorProps) {\n return <Separator {...props} {...mergeStyles({\n className: \"xwpi13i\"\n }, props)} />;\n}\n\n/**\n * An item that opens a menu of its own. Takes exactly two children: the\n * `Menu.Item` that opens it, then the `Menu.Content` it opens.\n */\nfunction MenuSubmenu(props: MenuSubmenuProps) {\n return <RACSubmenuTrigger {...props} />;\n}\n\n// The surface grows from the edge it is anchored by, which is what makes it\n// read as coming out of the trigger. Built by a call rather than written\n// inline at the prop, which is what react-perf's no-new-function-as-prop is\n// after.\nfunction surfaceStyles(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.content, popupOrigin(state.placement));\n}\n\n// What the item is worth as text, for the typeahead React Aria drives from\n// an item's words rather than its element. It reads it off the children when\n// they are a string and finds nothing when they are not — and an item here\n// is always an element, since the row wraps its label. So a plain-string\n// label becomes the text value, and anything else has to say what it is\n// worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\n\n/** What sits after the label: the call site's content, then the shortcut or\n * the submenu's chevron. */\nfunction trailingOf(state: MenuItemRenderProps, shortcut: ReactNode, trailing: ReactNode) {\n if (state.hasSubmenu) {\n return <>\n {trailing}\n <ChevronEndGlyph className=\"x1qx5ct2 xw4jnvo x19axjrm x1c071of\" />\n </>;\n }\n if (shortcut === undefined && trailing === undefined) {\n return undefined;\n }\n return <>\n {trailing}\n {shortcut === undefined ? null : <Keyboard className=\"x1w5n3ug\">{shortcut}</Keyboard>}\n </>;\n}\nMenu.Content = MenuContent;\nMenu.Item = MenuItem;\nMenu.LoadMore = MenuLoadMore;\nMenu.Section = MenuSection;\nMenu.Separator = MenuSeparator;\nMenu.Submenu = MenuSubmenu;\nexport type { MenuAlign, MenuContentProps, MenuItemProps, MenuLoadMoreProps, MenuProps, MenuSectionProps, MenuSeparatorProps, MenuSide, MenuSubmenuProps };\nexport default Menu;"],"mappings":";;;;;;;;;;;;AAiEA,MAAMoD,SAAS,EACbC,SAAS;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA2GA,SAASyB,YAAYV,UAAqBC,SAAoBC,UAAqBC,UAAqB;CACtG,QAAQQ,UAA+B,oBAAC,YAAD;EAAY,YAAYA,MAAMC;EAAY,YAAYD,MAAME;EAAqBZ;EAAS,UAAUa,WAAWH,OAAOT,UAAUC,QAAQ;EAAG,SAAQ;EACtL,UAAA,oBAAC,MAAD;GAAM,MAAK;GAASH;EAAe,CAAA;CACzB,CAAA;AAChB;AAWA,SAASe,WAAWJ,OAA4B;CAC9C,OAAOvE,MAAauB,UAAUsD,MAAMtD,UAAUuD,MAAMvD,UAAUwD,aAAaR,MAAME,cAAclD,UAAUyD,cAAcT,MAAMC,cAAcjD,UAAU0D,QAAQ;AAC/J;;;;;;;;;;;;;;;;;;;AAoBA,SAAA9E,OAAA+E,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAxB;CAAA,IAAAgB;CAAA,IAAAO,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAAtB,UAAA,GAAAgB,SAAAM;EAGFC,EAAA,KAAAD;EAAAC,EAAA,KAAAvB;EAAAuB,EAAA,KAAAP;CAAA,OAAA;EAAAhB,WAAAuB,EAAA;EAAAP,QAAAO,EAAA;CAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAvB,YAAAuB,EAAA,O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UACD,oBAAC,iBAAD,EAAiB,WAAU,qCAAoC,CAAA,CACjE,EAAA,CAAA;CAEJ,IAAID,aAAa2B,KAAAA,KAAa1B,aAAa0B,KAAAA,GACzC;CAEF,OAAO,qBAAA,UAAA,EAAA,UAAA,CACF1B,UACAD,aAAa2B,KAAAA,IAAY,OAAO,oBAAC,UAAD;EAAU,WAAU;EAAY3B,UAAAA;CAAmB,CAAA,CACtF,EAAA,CAAA;AACJ;AACA3D,OAAKyG,UAAUtB;AACfnF,OAAK0G,OAAOxG;AACZF,OAAK2G,WAAWR;AAChBnG,OAAK4G,UAAUtG;AACfN,OAAK+B,YAAYqE;AACjBpG,OAAK6G,UAAUR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","NavigationTreeItemRenderProps","NavigationTreeItemProps","RACNavigationTreeItemProps","NavigationTreeProps","RACNavigationTreeProps","stylex","Button","RACButton","NavigationTree","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","NavigationTreeItemContent","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection","collectionStyles","ChevronEndGlyph","RowContent","rowStyles","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","typography","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","currentAncestor","k63SB2","indent","kZCmMZ","NavigationTreeHeaderProps","children","NavigationTreeItemText","Omit","T","className","leading","style","supporting","trailing","label","textValue","NavigationTreeSectionProps","Parameters","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","isDisabled","isCurrent","leadingFor","itemStyles","base","drawer","interactive","isCurrentAncestor","selectedDrawer","disabled","$","_c","t0","container","t1","T0","t2","t3","t4","t5","t6","t7","t8","textValueFor","section","undefined","Item","Section"],"sources":["../../../src/components/navigation-tree/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { NavigationTreeItemRenderProps, NavigationTreeItemProps as RACNavigationTreeItemProps, NavigationTreeProps as RACNavigationTreeProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NavigationTree as RACNavigationTree, NavigationTreeHeader as RACNavigationTreeHeader, NavigationTreeItem as RACNavigationTreeItem, NavigationTreeItemContent as RACNavigationTreeItemContent, NavigationTreeSection as RACNavigationTreeSection } from 'react-aria-components';\nimport { collectionStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The navigation drawer page's contents: a nested set of links with the\n// current one marked. Each row is the row every list here draws — `src/row`,\n// shared with ListItem, ListBox, List, Tree and Disclosure — under that\n// module's `drawer` variant, which is the page's own 56dp row with a\n// label-large label and a secondary-container pill on the current one.\n//\n// This is Tree's shape over React Aria's navigation primitive, and the\n// difference is what the two are for. A tree selects: rows are chosen and\n// the choice is reported. A navigation tree navigates: each row is a link,\n// and which one is current is decided by matching the route rather than by\n// anything the reader selected. So this takes `selectedRoute` where Tree\n// takes `selectedKeys`, and has no selection at all — React Aria omits every\n// selection prop from it.\n//\n// Three things are this component's own.\n//\n// **A level indents by one caret's width**, exactly as Tree does and for the\n// same reason: React Aria writes the depth on each row as a custom property,\n// and 24dp is the size the drawer page gives its icon, so a level of nesting\n// is as wide as the glyph beside it.\n//\n// **An ancestor of the current row is marked too, and softly.** React Aria\n// reports it, and a drawer whose current row is collapsed out of sight would\n// otherwise show nothing at all. It takes the label's weight rather than the\n// pill, so the trail reads as a trail rather than as a second current row.\n//\n// **The pill's shape is the library's own.** The page gives the active\n// indicator's colour, height and width but keeps its shape behind a token\n// set that does not open to a script — the same gap recorded on the buttons\n// and lists pages. It is drawn as a full pill, which is what the page's own\n// images show and what 56dp of height comes to.\n\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x3y1ksm\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n currentAncestor: {\n k63SB2: \"x1bf3uqz\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype NavigationTreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype NavigationTreeItemProps<T extends object = object> = NavigationTreeItemText & Omit<RACNavigationTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & {\n /** The rows nested under this one, as further `NavigationTree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACNavigationTreeItemProps<T>['className'];\n /** Content before the label: an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACNavigationTreeItemProps<T>['style'];\n /** A second line under the label, in the muted role. */\n supporting?: ReactNode;\n /** Content after the label, such as a count. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a row here wraps\n// its label in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string label is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype NavigationTreeItemText = {\n /** The row's label — where it goes. */\n label: string;\n /** What typeahead matches the row on. Defaults to the label. */\n textValue?: string;\n} | {\n /** The row's label, as something other than a plain string. */\n label?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype NavigationTreeProps<T extends object = object> = Omit<RACNavigationTreeProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the tree's render state. */\n className?: RACNavigationTreeProps<T>['className'];\n /** A function may compute the style from the tree's render state. */\n style?: RACNavigationTreeProps<T>['style'];\n};\ntype NavigationTreeSectionProps<T extends object = object> = Omit<Parameters<typeof RACNavigationTreeSection<T>>[0], 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its label lines up with the\n// label of a sibling that opens.\nfunction chevronFor(state: NavigationTreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"xxk0z11 xvy4d1p x19axjrm x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x1y10d4b x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then whatever the row was given — one order, always, which is what keeps a\n// column of rows reading down.\nfunction itemContent(label: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode) {\n return (state: NavigationTreeItemRenderProps): ReactNode => <RowContent isDisabled={state.isDisabled} isSelected={state.isCurrent} leading={leadingFor(state, leading)} supporting={supporting} trailing={trailing} variant=\"drawer\">\n {label}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-current]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the current branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n// No overline, and so no three-line row: the navigation drawer page gives\n// one item height and one line of text. `List.Item` and `ListBox.Item` take\n// the prop because the lists page is what they draw; this row follows the\n// drawer's own metrics.\nfunction itemStyles(state: NavigationTreeItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.drawer, rowStyles.interactive, styles.indent, state.isCurrentAncestor && styles.currentAncestor, state.isCurrent && rowStyles.selectedDrawer, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * The caret, then whatever the row was given. Its return type is written out\n * rather than inferred: `ReactNode` is a union that includes a promise, and\n * a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: NavigationTreeItemRenderProps, leading: ReactNode): ReactNode {\n return <>\n {chevronFor(state)}\n {leading}\n </>;\n}\n\n/**\n * A nested set of links, with the current one marked. Which row is current\n * is React Aria's: give the tree a `selectedRoute` and each row an `href`,\n * and the row whose `href` matches is the current one — its ancestors are\n * marked too, so a collapsed trail still shows where you are.\n *\n * ```tsx\n * <NavigationTree aria-label=\"Label\" selectedRoute=\"#second\">\n * <NavigationTree.Item href=\"#first\" id=\"first\" label=\"First item\">\n * <NavigationTree.Item href=\"#second\" id=\"second\" label=\"Second item\" />\n * </NavigationTree.Item>\n * </NavigationTree>\n * ```\n *\n * There is no selection here, and that is React Aria's design rather than an\n * omission: a navigation tree navigates, so what is current comes from the\n * route rather than from anything the reader picked. `Tree` is the one that\n * selects.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction NavigationTree<T extends object>(props: NavigationTreeProps<T>) {\n return <RACNavigationTree<T> {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction NavigationTreeHeader({\n children\n}: NavigationTreeHeaderProps) {\n return <RACNavigationTreeHeader className=\"x9f619 x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xw3mh6e x1clyivc x140yoea\">\n {children}\n </RACNavigationTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Give it an `href` — that is what\n * `selectedRoute` is matched against — and an `id`, which is the key\n * expansion is reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret.\n */\nfunction NavigationTreeItem<T extends object = object>({\n children,\n label,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: NavigationTreeItemProps<T>) {\n return <RACNavigationTreeItem<T> textValue={textValueFor(textValue, label)} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n <RACNavigationTreeItemContent>\n {itemContent(label, leading, supporting, trailing)}\n </RACNavigationTreeItemContent>\n {children}\n </RACNavigationTreeItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction NavigationTreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: NavigationTreeSectionProps<T>) {\n return <RACNavigationTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <NavigationTreeHeader>{header}</NavigationTreeHeader>}\n {children}\n </RACNavigationTreeSection>;\n}\n\n// What React Aria matches typeahead on, and what names the row.\n// `NavigationTreeItemText` makes one of the two a string, so the last branch\n// is unreachable through the public type — it is there because destructuring\n// the two apart is what loses the narrowing, not because a row can arrive\n// without either.\nfunction textValueFor(textValue: string | undefined, label: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof label === 'string' ? label : '';\n}\nNavigationTree.Item = NavigationTreeItem;\nNavigationTree.Section = NavigationTreeSection;\nexport type { NavigationTreeHeaderProps, NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSectionProps };\nexport default NavigationTree;"],"mappings":";;;;;;;;;;;AA6CA,MAAM+B,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;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IAAAQ;CAAA,IAAAR,EAAA,OAAAK,MAAAL,EAAA,OAAAhC,YAAAgC,EAAA,QAAAI,MAAAJ,EAAA,QAAAM,MAAAN,EAAA,QAAAO,IAAA;EADjFC,KAAA,qBAAC,IAAD;GAAyB,GAAQzB;GAAK,GAAMuB;GAA5C,UAAA,CACFC,IACAvC,QAF2B;;EAGHgC,EAAA,KAAAK;EAAAL,EAAA,KAAAhC;EAAAgC,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAHtBQ;AAGsB;AAQ/B,SAASK,aAAanC,WAA+BD,OAAkB;CACrE,IAAIC,cAAcqC,KAAAA,GAChB,OAAOrC;CAET,OAAO,OAAOD,UAAU,WAAWA,QAAQ;AAC7C;AACAlD,iBAAeyF,OAAOrF;AACtBJ,iBAAe0F,UAAUlF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","NavigationTreeItemRenderProps","NavigationTreeItemProps","RACNavigationTreeItemProps","NavigationTreeProps","RACNavigationTreeProps","stylex","Button","RACButton","NavigationTree","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","NavigationTreeItemContent","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection","collectionStyles","ChevronEndGlyph","RowContent","rowStyles","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","typography","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","currentAncestor","k63SB2","indent","kZCmMZ","NavigationTreeHeaderProps","children","NavigationTreeItemText","Omit","T","className","leading","style","supporting","trailing","label","textValue","NavigationTreeSectionProps","Parameters","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","isDisabled","isCurrent","leadingFor","itemStyles","base","drawer","interactive","isCurrentAncestor","selectedDrawer","disabled","$","_c","t0","container","t1","T0","t2","t3","t4","t5","t6","t7","t8","textValueFor","section","undefined","Item","Section"],"sources":["../../../src/components/navigation-tree/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { NavigationTreeItemRenderProps, NavigationTreeItemProps as RACNavigationTreeItemProps, NavigationTreeProps as RACNavigationTreeProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NavigationTree as RACNavigationTree, NavigationTreeHeader as RACNavigationTreeHeader, NavigationTreeItem as RACNavigationTreeItem, NavigationTreeItemContent as RACNavigationTreeItemContent, NavigationTreeSection as RACNavigationTreeSection } from 'react-aria-components';\nimport { collectionStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The navigation drawer page's contents: a nested set of links with the\n// current one marked. Each row is the row every list here draws — `src/row`,\n// shared with ListItem, ListBox, List, Tree and Disclosure — under that\n// module's `drawer` variant, which is the page's own 56dp row with a\n// label-large label and a secondary-container pill on the current one.\n//\n// This is Tree's shape over React Aria's navigation primitive, and the\n// difference is what the two are for. A tree selects: rows are chosen and\n// the choice is reported. A navigation tree navigates: each row is a link,\n// and which one is current is decided by matching the route rather than by\n// anything the reader selected. So this takes `selectedRoute` where Tree\n// takes `selectedKeys`, and has no selection at all — React Aria omits every\n// selection prop from it.\n//\n// Three things are this component's own.\n//\n// **A level indents by one caret's width**, exactly as Tree does and for the\n// same reason: React Aria writes the depth on each row as a custom property,\n// and 24dp is the size the drawer page gives its icon, so a level of nesting\n// is as wide as the glyph beside it.\n//\n// **An ancestor of the current row is marked too, and softly.** React Aria\n// reports it, and a drawer whose current row is collapsed out of sight would\n// otherwise show nothing at all. It takes the label's weight rather than the\n// pill, so the trail reads as a trail rather than as a second current row.\n//\n// **The pill's shape is the library's own.** The page gives the active\n// indicator's colour, height and width but keeps its shape behind a token\n// set that does not open to a script — the same gap recorded on the buttons\n// and lists pages. It is drawn as a full pill, which is what the page's own\n// images show and what 56dp of height comes to.\n\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n currentAncestor: {\n k63SB2: \"x1bf3uqz\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype NavigationTreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype NavigationTreeItemProps<T extends object = object> = NavigationTreeItemText & Omit<RACNavigationTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & {\n /** The rows nested under this one, as further `NavigationTree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACNavigationTreeItemProps<T>['className'];\n /** Content before the label: an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACNavigationTreeItemProps<T>['style'];\n /** A second line under the label, in the muted role. */\n supporting?: ReactNode;\n /** Content after the label, such as a count. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a row here wraps\n// its label in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string label is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype NavigationTreeItemText = {\n /** The row's label — where it goes. */\n label: string;\n /** What typeahead matches the row on. Defaults to the label. */\n textValue?: string;\n} | {\n /** The row's label, as something other than a plain string. */\n label?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype NavigationTreeProps<T extends object = object> = Omit<RACNavigationTreeProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the tree's render state. */\n className?: RACNavigationTreeProps<T>['className'];\n /** A function may compute the style from the tree's render state. */\n style?: RACNavigationTreeProps<T>['style'];\n};\ntype NavigationTreeSectionProps<T extends object = object> = Omit<Parameters<typeof RACNavigationTreeSection<T>>[0], 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its label lines up with the\n// label of a sibling that opens.\nfunction chevronFor(state: NavigationTreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"xxk0z11 xvy4d1p x19axjrm x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x1y10d4b x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then whatever the row was given — one order, always, which is what keeps a\n// column of rows reading down.\nfunction itemContent(label: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode) {\n return (state: NavigationTreeItemRenderProps): ReactNode => <RowContent isDisabled={state.isDisabled} isSelected={state.isCurrent} leading={leadingFor(state, leading)} supporting={supporting} trailing={trailing} variant=\"drawer\">\n {label}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-current]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the current branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n// No overline, and so no three-line row: the navigation drawer page gives\n// one item height and one line of text. `List.Item` and `ListBox.Item` take\n// the prop because the lists page is what they draw; this row follows the\n// drawer's own metrics.\nfunction itemStyles(state: NavigationTreeItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.drawer, rowStyles.interactive, styles.indent, state.isCurrentAncestor && styles.currentAncestor, state.isCurrent && rowStyles.selectedDrawer, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * The caret, then whatever the row was given. Its return type is written out\n * rather than inferred: `ReactNode` is a union that includes a promise, and\n * a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: NavigationTreeItemRenderProps, leading: ReactNode): ReactNode {\n return <>\n {chevronFor(state)}\n {leading}\n </>;\n}\n\n/**\n * A nested set of links, with the current one marked. Which row is current\n * is React Aria's: give the tree a `selectedRoute` and each row an `href`,\n * and the row whose `href` matches is the current one — its ancestors are\n * marked too, so a collapsed trail still shows where you are.\n *\n * ```tsx\n * <NavigationTree aria-label=\"Label\" selectedRoute=\"#second\">\n * <NavigationTree.Item href=\"#first\" id=\"first\" label=\"First item\">\n * <NavigationTree.Item href=\"#second\" id=\"second\" label=\"Second item\" />\n * </NavigationTree.Item>\n * </NavigationTree>\n * ```\n *\n * There is no selection here, and that is React Aria's design rather than an\n * omission: a navigation tree navigates, so what is current comes from the\n * route rather than from anything the reader picked. `Tree` is the one that\n * selects.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction NavigationTree<T extends object>(props: NavigationTreeProps<T>) {\n return <RACNavigationTree<T> {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction NavigationTreeHeader({\n children\n}: NavigationTreeHeaderProps) {\n return <RACNavigationTreeHeader className=\"x9f619 x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xw3mh6e x1clyivc x140yoea\">\n {children}\n </RACNavigationTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Give it an `href` — that is what\n * `selectedRoute` is matched against — and an `id`, which is the key\n * expansion is reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret.\n */\nfunction NavigationTreeItem<T extends object = object>({\n children,\n label,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: NavigationTreeItemProps<T>) {\n return <RACNavigationTreeItem<T> textValue={textValueFor(textValue, label)} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n <RACNavigationTreeItemContent>\n {itemContent(label, leading, supporting, trailing)}\n </RACNavigationTreeItemContent>\n {children}\n </RACNavigationTreeItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction NavigationTreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: NavigationTreeSectionProps<T>) {\n return <RACNavigationTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <NavigationTreeHeader>{header}</NavigationTreeHeader>}\n {children}\n </RACNavigationTreeSection>;\n}\n\n// What React Aria matches typeahead on, and what names the row.\n// `NavigationTreeItemText` makes one of the two a string, so the last branch\n// is unreachable through the public type — it is there because destructuring\n// the two apart is what loses the narrowing, not because a row can arrive\n// without either.\nfunction textValueFor(textValue: string | undefined, label: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof label === 'string' ? label : '';\n}\nNavigationTree.Item = NavigationTreeItem;\nNavigationTree.Section = NavigationTreeSection;\nexport type { NavigationTreeHeaderProps, NavigationTreeItemProps, NavigationTreeProps, NavigationTree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X,OAA8B,oBAAC,wBAAD,EAAA,UAAuBlC,OAAF,CAAA;EAAgCmB,EAAA,KAAAnB;EAAAmB,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAK,MAAAL,EAAA,OAAAhC,YAAAgC,EAAA,QAAAI,MAAAJ,EAAA,QAAAM,MAAAN,EAAA,QAAAO,IAAA;EADjFC,KAAA,qBAAC,IAAD;GAAyB,GAAQzB;GAAK,GAAMuB;GAA5C,UAAA,CACFC,IACAvC,QAF2B;;EAGHgC,EAAA,KAAAK;EAAAL,EAAA,KAAAhC;EAAAgC,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAHtBQ;AAGsB;AAQ/B,SAASK,aAAanC,WAA+BD,OAAkB;CACrE,IAAIC,cAAcqC,KAAAA,GAChB,OAAOrC;CAET,OAAO,OAAOD,UAAU,WAAWA,QAAQ;AAC7C;AACAlD,iBAAeyF,OAAOrF;AACtBJ,iBAAe0F,UAAUlF"}
|
|
@@ -67,7 +67,7 @@ const styles = {
|
|
|
67
67
|
}],
|
|
68
68
|
indeterminateBarInner: {
|
|
69
69
|
kWkggS: "xnety89",
|
|
70
|
-
kaIpWk: "
|
|
70
|
+
kaIpWk: "x1dkaolv",
|
|
71
71
|
kB7OPa: "x9f619",
|
|
72
72
|
kpwlN0: "x10a8y8t",
|
|
73
73
|
kVAEAm: "x10l6tqk",
|
|
@@ -279,7 +279,7 @@ function LinearTrack(t0) {
|
|
|
279
279
|
let t7;
|
|
280
280
|
if ($[12] !== t2 || $[13] !== t4 || $[14] !== t6) {
|
|
281
281
|
t7 = /* @__PURE__ */ jsxs("div", {
|
|
282
|
-
className: "xqu0tyb
|
|
282
|
+
className: "xqu0tyb x1dkaolv x9f619 xh8yej3 xb3r6kr x1n2onr6",
|
|
283
283
|
children: [
|
|
284
284
|
t2,
|
|
285
285
|
t4,
|