@kanso-labs/kanso-ui 0.40.4 → 0.40.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button/hooks.js +37 -1
- package/dist/button/hooks.js.map +1 -1
- package/dist/button/index.d.ts +57 -1
- package/dist/button/index.js +153 -96
- package/dist/button/index.js.map +1 -1
- package/dist/button/toggle.js +17 -0
- package/dist/button/toggle.js.map +1 -0
- package/dist/calendar/index.js +69 -58
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +29 -6
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/index.js +3 -4
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/styles.js +2 -6
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/empty.js +7 -0
- package/dist/collection/empty.js.map +1 -0
- package/dist/collection/index.js +125 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/styles.js +14 -0
- package/dist/collection/styles.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +26 -23
- package/dist/components/app-bar/index.js +89 -72
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +6 -4
- package/dist/components/autocomplete/index.js +23 -14
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/button/index.d.ts +15 -35
- package/dist/components/button/index.js +102 -74
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +9 -3
- package/dist/components/calendar/index.js +51 -42
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/card/index.js +43 -27
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/checkbox/index.d.ts +9 -0
- package/dist/components/checkbox/index.js +47 -35
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/chip/index.d.ts +9 -4
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.js +51 -37
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/copy-field/index.d.ts +28 -6
- package/dist/components/copy-field/index.js +140 -54
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/currency/index.d.ts +6 -2
- package/dist/components/currency/index.js +74 -46
- package/dist/components/currency/index.js.map +1 -1
- package/dist/components/disclosure/index.js +1 -1
- package/dist/components/icon-button/index.d.ts +6 -31
- package/dist/components/icon-button/index.js +64 -52
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/list/index.js +2 -2
- package/dist/components/list-box/index.d.ts +14 -2
- package/dist/components/list-box/index.js +16 -8
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/list-item/index.js +1 -1
- package/dist/components/menu/index.d.ts +14 -1
- package/dist/components/menu/index.js +32 -17
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +2 -2
- package/dist/components/radio-group/index.d.ts +4 -0
- package/dist/components/radio-group/index.js +2 -2
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +9 -3
- package/dist/components/range-calendar/index.js +51 -42
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/search-view/index.js +1 -1
- package/dist/components/segmented-button/index.d.ts +5 -4
- package/dist/components/segmented-button/index.js +3 -3
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/split-button/index.d.ts +1 -1
- package/dist/components/split-button/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +9 -2
- package/dist/components/switch/index.js +2 -2
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/table/index.js +3 -3
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/tree/index.js +2 -2
- package/dist/control/index.js +55 -17
- package/dist/control/index.js.map +1 -1
- package/dist/field/index.js +59 -51
- package/dist/field/index.js.map +1 -1
- package/dist/hooks/useAppBarScroll.d.ts +52 -0
- package/dist/hooks/useAppBarScroll.js +75 -0
- package/dist/hooks/useAppBarScroll.js.map +1 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +68 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/render/name.d.ts +22 -0
- package/dist/styles.css +83 -24
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonDOMProps, ButtonState } from "../../button/index.js";
|
|
1
|
+
import { ButtonDOMProps, ButtonForm, ButtonState } from "../../button/index.js";
|
|
2
2
|
import { ReactNode, RefAttributes } from "react";
|
|
3
3
|
import { ClassNameOrFunction, DOMRenderFunction, StyleOrFunction } from "react-aria-components";
|
|
4
4
|
//#region src/components/icon-button/index.d.ts
|
|
@@ -17,43 +17,18 @@ type IconButtonProps = {
|
|
|
17
17
|
children?: ReactNode;
|
|
18
18
|
/** A function may compute the class from the button's render state. */
|
|
19
19
|
className?: ClassNameOrFunction<IconButtonState>;
|
|
20
|
-
/**
|
|
21
|
-
* Whether a toggle starts chosen, when it keeps its own state. Passing
|
|
22
|
-
* this, `isSelected` or `onChange` is what makes the button a toggle.
|
|
23
|
-
*/
|
|
24
|
-
defaultSelected?: boolean;
|
|
25
20
|
/**
|
|
26
21
|
* Disables the press ripple. The hover and pressed state layers are
|
|
27
22
|
* unaffected.
|
|
28
23
|
* @default false
|
|
29
24
|
*/
|
|
30
25
|
disableRipple?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Where the button leads. Given one, the button is rendered as a link —
|
|
33
|
-
* an `<a>`, announced as the link it is — with the same styles and ripple.
|
|
34
|
-
* `render`, `type`, and the form and pending props apply to the button
|
|
35
|
-
* form only, and a toggle is never a link.
|
|
36
|
-
*/
|
|
37
|
-
href?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Whether a toggle is chosen, when the call site holds the state. Pass it
|
|
40
|
-
* with `onChange`; passing this, `defaultSelected` or `onChange` is what
|
|
41
|
-
* makes the button a toggle.
|
|
42
|
-
*/
|
|
43
|
-
isSelected?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Called with the new state when a toggle is pressed. Passing this,
|
|
46
|
-
* `isSelected` or `defaultSelected` is what makes the button a toggle.
|
|
47
|
-
*/
|
|
48
|
-
onChange?: (isSelected: boolean) => void;
|
|
49
26
|
/**
|
|
50
27
|
* The name of the ring shown while the button is pending, for a screen
|
|
51
28
|
* reader. The label it replaces is hidden while it shows. Left out, it is
|
|
52
29
|
* the word for it in the I18nProvider's locale — "Loading" in English.
|
|
53
30
|
*/
|
|
54
31
|
pendingLabel?: string;
|
|
55
|
-
/** The link's `rel`, when `href` is set. */
|
|
56
|
-
rel?: string;
|
|
57
32
|
/**
|
|
58
33
|
* The element to render, given the props it would have carried. React
|
|
59
34
|
* Aria's own form: it has to return the element the component would have
|
|
@@ -70,8 +45,6 @@ type IconButtonProps = {
|
|
|
70
45
|
size?: IconButtonSize;
|
|
71
46
|
/** A function may compute the style from the button's render state. */
|
|
72
47
|
style?: StyleOrFunction<IconButtonState>;
|
|
73
|
-
/** The link's `target`, when `href` is set. */
|
|
74
|
-
target?: string;
|
|
75
48
|
/**
|
|
76
49
|
* `standard` is transparent and tints what it sits on; `outlined` is
|
|
77
50
|
* transparent with a rule around it; `filled` and `tonal` carry a container
|
|
@@ -79,7 +52,7 @@ type IconButtonProps = {
|
|
|
79
52
|
* @default 'standard'
|
|
80
53
|
*/
|
|
81
54
|
variant?: IconButtonVariant;
|
|
82
|
-
} & Omit<ButtonDOMProps, 'render'>;
|
|
55
|
+
} & ButtonForm & Omit<ButtonDOMProps, 'render'>;
|
|
83
56
|
type IconButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl';
|
|
84
57
|
type IconButtonState = ButtonState;
|
|
85
58
|
type IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';
|
|
@@ -90,8 +63,10 @@ type IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';
|
|
|
90
63
|
*
|
|
91
64
|
* Given `isSelected`, `defaultSelected` or `onChange` it is a toggle, which
|
|
92
65
|
* reports its state through `aria-pressed` and draws the page's second pair
|
|
93
|
-
* of colour roles for its variant.
|
|
94
|
-
* pending
|
|
66
|
+
* of colour roles for its variant. The three forms are exclusive, so a toggle
|
|
67
|
+
* given `href` does not compile. A toggle may be pending, for a state saved
|
|
68
|
+
* somewhere slow: the ring replaces its icon and a press changes nothing
|
|
69
|
+
* until it clears.
|
|
95
70
|
*
|
|
96
71
|
* ```tsx
|
|
97
72
|
* <IconButton aria-label="Label" defaultSelected variant="tonal">
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
3
3
|
import { sizing } from "../../tokens/design.tokens.stylex.js";
|
|
4
4
|
import { focus } from "../../styles/focus.js";
|
|
5
|
+
import { useSelection } from "../../button/hooks.js";
|
|
5
6
|
import { ButtonBase, ToggleButtonBase } from "../../button/index.js";
|
|
6
7
|
import { ButtonGroupItemContext } from "../../button/context.js";
|
|
7
8
|
import { groupPressHandlers } from "../../button/group.js";
|
|
9
|
+
import { pressThen } from "../../button/toggle.js";
|
|
8
10
|
import { c } from "react/compiler-runtime";
|
|
9
11
|
import { useContext } from "react";
|
|
10
12
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -374,8 +376,10 @@ function groupStyles(group, size, state) {
|
|
|
374
376
|
*
|
|
375
377
|
* Given `isSelected`, `defaultSelected` or `onChange` it is a toggle, which
|
|
376
378
|
* reports its state through `aria-pressed` and draws the page's second pair
|
|
377
|
-
* of colour roles for its variant.
|
|
378
|
-
* pending
|
|
379
|
+
* of colour roles for its variant. The three forms are exclusive, so a toggle
|
|
380
|
+
* given `href` does not compile. A toggle may be pending, for a state saved
|
|
381
|
+
* somewhere slow: the ring replaces its icon and a press changes nothing
|
|
382
|
+
* until it clears.
|
|
379
383
|
*
|
|
380
384
|
* ```tsx
|
|
381
385
|
* <IconButton aria-label="Label" defaultSelected variant="tonal">
|
|
@@ -391,68 +395,76 @@ function IconButton(t0) {
|
|
|
391
395
|
const size = ownSize ?? group?.size ?? "md";
|
|
392
396
|
const inSelectingGroup = useContext(ToggleGroupStateContext) !== null;
|
|
393
397
|
const press = groupPressHandlers(group, props.onPressStart, props.onPressEnd);
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
398
|
+
let t2;
|
|
399
|
+
if ($[0] !== defaultSelected || $[1] !== isSelected || $[2] !== onChange) {
|
|
400
|
+
t2 = {
|
|
401
|
+
defaultSelected,
|
|
402
|
+
isSelected,
|
|
403
|
+
onChange
|
|
404
|
+
};
|
|
405
|
+
$[0] = defaultSelected;
|
|
406
|
+
$[1] = isSelected;
|
|
407
|
+
$[2] = onChange;
|
|
408
|
+
$[3] = t2;
|
|
409
|
+
} else t2 = $[3];
|
|
410
|
+
const selection = useSelection(t2);
|
|
411
|
+
if (inSelectingGroup) {
|
|
403
412
|
let t3;
|
|
404
|
-
if ($[4] !==
|
|
405
|
-
t3 =
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
$[7] = onChange;
|
|
418
|
-
$[8] = press;
|
|
419
|
-
$[9] = props;
|
|
420
|
-
$[10] = t2;
|
|
421
|
-
$[11] = t3;
|
|
422
|
-
} else t3 = $[11];
|
|
423
|
-
return t3;
|
|
413
|
+
if ($[4] !== group || $[5] !== size || $[6] !== variant) {
|
|
414
|
+
t3 = toggleStyleProps(size, variant, group);
|
|
415
|
+
$[4] = group;
|
|
416
|
+
$[5] = size;
|
|
417
|
+
$[6] = variant;
|
|
418
|
+
$[7] = t3;
|
|
419
|
+
} else t3 = $[7];
|
|
420
|
+
return /* @__PURE__ */ jsx(ToggleButtonBase, {
|
|
421
|
+
...props,
|
|
422
|
+
...press,
|
|
423
|
+
classes: t3,
|
|
424
|
+
isPending
|
|
425
|
+
});
|
|
424
426
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
t2 = iconButtonClasses(size, variant, group);
|
|
428
|
-
$[12] = group;
|
|
429
|
-
$[13] = size;
|
|
430
|
-
$[14] = variant;
|
|
431
|
-
$[15] = t2;
|
|
432
|
-
} else t2 = $[15];
|
|
427
|
+
const isToggle = defaultSelected !== void 0 || isSelected !== void 0 || onChange !== void 0;
|
|
428
|
+
const T0 = ButtonBase;
|
|
433
429
|
let t3;
|
|
434
|
-
if ($[
|
|
435
|
-
t3 =
|
|
430
|
+
if ($[8] !== group || $[9] !== isToggle || $[10] !== size || $[11] !== variant) {
|
|
431
|
+
t3 = isToggle ? toggleStyleProps(size, variant, group) : iconButtonClasses(size, variant, group);
|
|
432
|
+
$[8] = group;
|
|
433
|
+
$[9] = isToggle;
|
|
434
|
+
$[10] = size;
|
|
435
|
+
$[11] = variant;
|
|
436
|
+
$[12] = t3;
|
|
437
|
+
} else t3 = $[12];
|
|
438
|
+
const t4 = isToggle ? selection.selected : void 0;
|
|
439
|
+
const t5 = isToggle ? pressThen(props.onPress, selection.toggle) : props.onPress;
|
|
440
|
+
let t6;
|
|
441
|
+
if ($[13] !== T0 || $[14] !== href || $[15] !== isPending || $[16] !== pendingLabel || $[17] !== press || $[18] !== props || $[19] !== rel || $[20] !== t3 || $[21] !== t4 || $[22] !== t5 || $[23] !== target) {
|
|
442
|
+
t6 = /* @__PURE__ */ jsx(T0, {
|
|
436
443
|
...props,
|
|
437
444
|
...press,
|
|
438
|
-
classes:
|
|
445
|
+
classes: t3,
|
|
439
446
|
href,
|
|
440
447
|
isPending,
|
|
448
|
+
isSelected: t4,
|
|
449
|
+
onPress: t5,
|
|
441
450
|
pendingLabel,
|
|
442
451
|
rel,
|
|
443
452
|
target
|
|
444
453
|
});
|
|
445
|
-
$[
|
|
446
|
-
$[
|
|
447
|
-
$[
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
450
|
-
$[
|
|
451
|
-
$[
|
|
454
|
+
$[13] = T0;
|
|
455
|
+
$[14] = href;
|
|
456
|
+
$[15] = isPending;
|
|
457
|
+
$[16] = pendingLabel;
|
|
458
|
+
$[17] = press;
|
|
459
|
+
$[18] = props;
|
|
460
|
+
$[19] = rel;
|
|
461
|
+
$[20] = t3;
|
|
462
|
+
$[21] = t4;
|
|
463
|
+
$[22] = t5;
|
|
452
464
|
$[23] = target;
|
|
453
|
-
$[24] =
|
|
454
|
-
} else
|
|
455
|
-
return
|
|
465
|
+
$[24] = t6;
|
|
466
|
+
} else t6 = $[24];
|
|
467
|
+
return t6;
|
|
456
468
|
}
|
|
457
469
|
function iconButtonClasses(size, variant, group) {
|
|
458
470
|
return (state) => props(styles.base, focus.ring, styles[variant], styles[size], variant === "outlined" && outlineWidths[size], state.isHovered && hovered[variant], state.isFocusVisible && focused[variant], state.isPressed && pressed[variant], state.isPressed && selectedShapes[size], state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant], groupStyles(group, size, state));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","DOMRenderFunction","StyleOrFunction","stylex","useContext","ToggleGroupStateContext","ButtonDOMProps","ButtonState","ButtonGroupItem","ButtonBase","ToggleButtonBase","ButtonGroupItemContext","groupPressHandlers","focus","colors","motion","radii","sizing","stateLayerOpacity","FORCED_COLORS","TARGET_SIZE","styles","base","k6CgDc","kGNEyG","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","kVAEAm","kybGjl","kIyJzY","k1ekBW","kAMwcw","$$css","disabled","filled","kWkggS","kMwMTN","filledDisabled","filledToggle","filledToggleSelected","lg","kZKoxP","kGuDYH","kzqmXN","md","kgeoSG","kFcpXp","kEoFBp","outlined","outlinedDisabled","outlinedToggleSelected","standard","standardDisabled","standardToggleSelected","tonal","tonalDisabled","tonalToggleSelected","xl","xs","xxl","hovered","focused","pressed","outlineWidths","EDGES","controlLg","controlSm","controlXl","controlXs","controlXxl","_temp","shifted","width","value","val","undefined","selectedShapes","toggleStyles","selected","unselected","toggleContainers","const","disabledStyles","IconButtonProps","children","className","IconButtonState","defaultSelected","disableRipple","href","isSelected","onChange","pendingLabel","rel","render","size","IconButtonSize","style","target","variant","IconButtonVariant","Omit","groupStyles","group","state","shift","IconButton","t0","$","isPending","ownSize","t1","props","inSelectingGroup","press","onPressStart","onPressEnd","t2","toggleStyleProps","t3","iconButtonClasses","ring","isHovered","isFocusVisible","isPressed","isDisabled","container","_c","stylex.props"],"sources":["../../../src/components/icon-button/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, DOMRenderFunction, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { ToggleGroupStateContext } from 'react-aria-components';\nimport type { ButtonDOMProps, ButtonState } from '../../button';\nimport type { ButtonGroupItem } from '../../button/context';\nimport { ButtonBase, ToggleButtonBase } from '../../button';\nimport { ButtonGroupItemContext } from '../../button/context';\nimport { groupPressHandlers } from '../../button/group';\nimport { focus } from '../../styles/focus';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\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.\n// 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.\n//\n// **Under forced colours a container is drawn as a rule, and a chosen toggle\n// as the mode's own chosen pair.** That mode paints author backgrounds in a\n// system colour and forces the icon's, which left a filled or tonal icon\n// button as an icon with nothing round it and a chosen toggle the same as an\n// unchosen one. `base` draws a 1px `ButtonText` border there, as Button's\n// does. Outlined keeps its own rule, and standard stays without one, as the\n// page draws it. A chosen toggle of any style is filled `Highlight` with its\n// icon in `HighlightText`. A disabled button's icon and edge are `GrayText`,\n// for the reason Button's comment gives: the browser greys a disabled\n// `<button>` there, but not the `<span>` a disabled link is.\n//\n// What every button does past its own styles — the ripple, the link and\n// toggle forms, the pending ring, a parent's disabled state — is\n// `src/button`'s, shared with Button.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n/**\n * The press area the page requires of its two smallest sizes. A literal\n * rather than `sizing.controlMd`, which holds the same number: that is a step\n * of the control scale, and a consumer resizing their medium controls should\n * not shrink a target the page states as a floor.\n */\nconst TARGET_SIZE = '48px';\nconst styles = {\n base: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\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: \"x9w8ftz\",\n k1ekBW: \"x1n0k3g7\",\n kAMwcw: \"x1hu1jz6\",\n $$css: true\n },\n disabled: {\n kaIpWk: \"x1dkaolv\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n filled: {\n kWkggS: \"xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n filledDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"x1mjdul6\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n filledToggleSelected: {\n kWkggS: \"xnety89 x1jzqe4\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n $$css: true\n },\n lg: {\n kZKoxP: \"xs1ryiz\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x1fh0d6s\",\n $$css: true\n },\n md: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x1q69gdh\",\n kEoFBp: \"x1hmns74\",\n kZKoxP: \"x1rv7mn0\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x1eujcsb\",\n $$css: true\n },\n outlined: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x133yhug\",\n ksu8eU: \"x1y0btm7\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n outlinedDisabled: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"xrh88j3 xmnqt3w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"x1c5gpgi x1jzqe4\",\n kVAM5u: \"x9r1u3d x1n2ykn\",\n kMwMTN: \"x1girmi0 x1k5gbb1\",\n $$css: true\n },\n standard: {\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n standardDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"xjbqb8w x1jzqe4\",\n kMzoRj: \"xc342km\",\n kMwMTN: \"x1mxwv8y x1k5gbb1\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x15dekr4\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n tonalDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x167r6xl x1jzqe4\",\n kMwMTN: \"x1lba3jz x1k5gbb1\",\n $$css: true\n },\n xl: {\n kZKoxP: \"x1xaimp3\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"x1s3cmhv\",\n kzqmXN: \"xszbqgh\",\n $$css: true\n },\n xs: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x1n6cgzf\",\n kEoFBp: \"x1hmns74\",\n kZKoxP: \"xig8zya\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"xwsyq91\",\n kzqmXN: \"x11ts1a5\",\n $$css: true\n },\n xxl: {\n kZKoxP: \"x173yhrv\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"x1tgwohi\",\n kzqmXN: \"xz1kjiq\",\n $$css: true\n }\n};\n\n// The hover, focus and pressed layers, one style per container, applied from\n// React Aria's render state rather than from `:hover`, `:focus-visible` and\n// `:active`, for Button's reasons — see its header: a hover layer stayed on\n// after a tap, and no pressed layer or corner showed for a press made from\n// the keyboard. In the order they are applied, so where two hold the later\n// wins, as the page draws one layer at a time: focus over hover, and a press\n// over both. A chosen toggle's layer keeps its forced-colours `Highlight`,\n// since a later style replaces the property whole.\nconst hovered = {\n filled: {\n kWkggS: \"xo1ct44\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"xtxe0ya\",\n $$css: true\n },\n filledToggleSelected: {\n kWkggS: \"xo1ct44 x1jzqe4\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"x1hxzsxp x1jzqe4\",\n $$css: true\n },\n standard: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"x659ado x1jzqe4\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x12r95rf x1jzqe4\",\n $$css: true\n }\n};\nconst focused = {\n filled: {\n kWkggS: \"xhodiby\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"x1ppcb1\",\n $$css: true\n },\n filledToggleSelected: {\n kWkggS: \"xhodiby x1jzqe4\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x19p5drm\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"xn4e5mw x1jzqe4\",\n $$css: true\n },\n standard: {\n kWkggS: \"x19p5drm\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"x1sog3nf x1jzqe4\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x16tkg7c x1jzqe4\",\n $$css: true\n }\n};\nconst pressed = {\n filled: {\n kWkggS: \"x7b25lv\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"x1qdfkg1\",\n $$css: true\n },\n filledToggleSelected: {\n kWkggS: \"x7b25lv x1jzqe4\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x123fei2\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"x167cdfs x1jzqe4\",\n $$css: true\n },\n standard: {\n kWkggS: \"x123fei2\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"x1dvjsmr x1jzqe4\",\n $$css: true\n },\n tonal: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x12o6fnv x1jzqe4\",\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// Each size's edge again, for the one place it is read at runtime: a standard\n// ButtonGroup widening a pressed button by adding to it. The size styles\n// above write the same values.\nconst EDGES = {\n lg: sizing.controlLg,\n md: sizing.controlSm,\n xl: sizing.controlXl,\n xs: sizing.controlXs,\n xxl: sizing.controlXxl\n};\n\n// The width a standard group sets while it widens or narrows the button.\nconst _temp = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst shifted = {\n width: (value: string) => [_temp, {\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(value)\n }]\n};\n\n// The corner each size presses to, which is the page's round-to-square\n// morph, and the corner a chosen toggle rests at. A style per size rather than\n// a value inside each size style, since StyleX replaces the property whole:\n// it comes after the size's circle while pressed, and after the disabled\n// style's circle too for a chosen toggle, which keeps its corner disabled.\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. Two of the six are the\n// plain button's own styles: an unchosen tonal or standard toggle is the\n// tonal or standard button. A chosen filled toggle takes the filled button's\n// colours from a style of its own, which adds the forced-colours pair.\nconst toggleStyles = {\n filled: {\n selected: styles.filledToggleSelected,\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};\n\n// The same containers by name, for the layers above.\nconst toggleContainers = {\n filled: {\n selected: 'filledToggleSelected',\n unselected: 'filledToggle'\n },\n outlined: {\n selected: 'outlinedToggleSelected',\n unselected: 'outlined'\n },\n standard: {\n selected: 'standardToggleSelected',\n unselected: 'standard'\n },\n tonal: {\n selected: 'tonalToggleSelected',\n unselected: 'tonal'\n }\n} as const;\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 * `undefined` is for a button inside a React Aria component that names it\n * itself — a search field's clear button, a number field's steppers. React\n * Aria takes a prop over its context, so a name written here would replace\n * the one it gives in the reader's locale, and undefined leaves that stand.\n */\n 'aria-label': string | undefined;\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. Left out, it is\n * the word for it in the I18nProvider's locale — \"Loading\" in English.\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: the one every button shares, whose `isSelected` only the toggle\n// form fills in — see `ButtonState` in src/button.\ntype IconButtonState = ButtonState;\ntype IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';\n\n// What a group lays over the button: its own styles for the button's state,\n// last so a connected group's corners hold whatever the button's own shape\n// would be, and the standard group's widening or narrowing as extra width.\nfunction groupStyles(group: ButtonGroupItem | null, size: IconButtonSize, state: ButtonState) {\n if (group === null) {\n return null;\n }\n return [group.styles?.(state), group.shift !== 0 && shifted.width(`calc(${EDGES[size]} + ${group.shift}px)`)];\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 defaultSelected,\n href,\n isPending,\n isSelected,\n onChange,\n pendingLabel,\n rel,\n size: ownSize,\n target,\n variant = 'standard',\n ...props\n}: IconButtonProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>) {\n // A ButtonGroup around the button hands it a size, its shape at the\n // group's inner edges and the press interaction, as it does Button's; see\n // src/button/context.ts. A size named here still wins.\n const group = useContext(ButtonGroupItemContext);\n const size = ownSize ?? group?.size ?? 'md';\n const inSelectingGroup = useContext(ToggleGroupStateContext) !== null;\n const press = groupPressHandlers(group, props.onPressStart, props.onPressEnd);\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. A selecting ButtonGroup\n // around it makes it one as well, to take part in the group's selection.\n if (inSelectingGroup || defaultSelected !== undefined || isSelected !== undefined || onChange !== undefined) {\n return <ToggleButtonBase {...props} {...press} classes={toggleStyleProps(size, variant, group)} defaultSelected={defaultSelected} isPending={isPending} isSelected={isSelected} onChange={onChange} />;\n }\n return <ButtonBase {...props} {...press} classes={iconButtonClasses(size, variant, group)} href={href} isPending={isPending} pendingLabel={pendingLabel} rel={rel} target={target} />;\n}\n\n// The plain button's classes, from React Aria's render state — see the hover\n// and pressed layers above for why that and not the pseudo-classes. Built by\n// a call 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 on\n// its inputs.\nfunction iconButtonClasses(size: IconButtonSize, variant: IconButtonVariant, group: ButtonGroupItem | null) {\n return (state: ButtonState) => stylex.props(styles.base, focus.ring, styles[variant], styles[size], variant === 'outlined' && outlineWidths[size], state.isHovered && hovered[variant], state.isFocusVisible && focused[variant], state.isPressed && pressed[variant], state.isPressed && selectedShapes[size], state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant], groupStyles(group, size, state));\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, group: ButtonGroupItem | null) {\n return (state: IconButtonState) => {\n const container = toggleContainers[variant][state.isSelected === true ? 'selected' : 'unselected'];\n return 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.isHovered && hovered[container], state.isFocusVisible && focused[container], state.isPressed && pressed[container], state.isPressed && selectedShapes[size], state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant], state.isSelected === true && selectedShapes[size], groupStyles(group, size, state));\n };\n}\nexport type { IconButtonProps, IconButtonSize, IconButtonState, IconButtonVariant };\nexport default IconButton;"],"mappings":";;;;;;;;;;;;AAoGA,MAAMyB,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,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;EACRf,QAAQ;EACRI,QAAQ;EACRU,OAAO;CACT;CACAE,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,gBAAgB;EACdF,QAAQ;EACRlB,QAAQ;EACRmB,QAAQ;EACRJ,OAAO;CACT;CACAM,cAAc;EACZH,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAO,sBAAsB;EACpBJ,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAQ,IAAI;EACFC,QAAQ;EACRvB,QAAQ;EACRwB,QAAQ;EACRC,QAAQ;EACRX,OAAO;CACT;CACAY,IAAI;EACFC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRN,QAAQ;EACRvB,QAAQ;EACRwB,QAAQ;EACRC,Q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AAakB,OAAOC,MAAMT,MAAMoH,MAAM5G,OAAOsF,UAAUtF,OAAOkF,OAAOI,YAAY,cAAcpC,cAAcgC,OAAOS,MAAMkB,aAAa9D,QAAQuC,UAAUK,MAAMmB,kBAAkB9D,QAAQsC,UAAUK,MAAMoB,aAAa9D,QAAQqC,UAAUK,MAAMoB,aAAahD,eAAemB,OAAOS,MAAMqB,cAAchH,OAAOoB,UAAUuE,MAAMqB,cAAc3C,eAAeiB,UAAUG,YAAYC,OAAOR,MAAMS,KAAK,CAAC;AACna;AAMA,SAASc,iBAAiBvB,MAAsBI,SAA4BI,OAA+B;CACzG,QAAQC,UAA2B;EACjC,MAAMsB,YAAY9C,iBAAiBmB,QAAQ,CAACK,MAAMd,eAAe,OAAO,aAAa;EACrF,OAAO/F,MAAakB,OAAOC,MAAMT,MAAMoH,MAAMjB,MAAMd,eAAe,OAAOb,aAAasB,QAAQ,CAACrB,WAAWD,aAAasB,QAAQ,CAACpB,YAAYlE,OAAOkF,OAGnJI,YAAY,cAAcK,MAAMd,eAAe,QAAQ3B,cAAcgC,OAAOS,MAAMkB,aAAa9D,QAAQkE,YAAYtB,MAAMmB,kBAAkB9D,QAAQiE,YAAYtB,MAAMoB,aAAa9D,QAAQgE,YAAYtB,MAAMoB,aAAahD,eAAemB,OAAOS,MAAMqB,cAAchH,OAAOoB,UAAUuE,MAAMqB,cAAc3C,eAAeiB,UAAUK,MAAMd,eAAe,QAAQd,eAAemB,OAAOO,YAAYC,OAAOR,MAAMS,KAAK,CAAC;CACrZ;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","DOMRenderFunction","StyleOrFunction","stylex","useContext","ToggleGroupStateContext","ButtonDOMProps","ButtonForm","ButtonState","ButtonGroupItem","ButtonBase","ToggleButtonBase","ButtonGroupItemContext","groupPressHandlers","useSelection","pressThen","focus","colors","motion","radii","sizing","stateLayerOpacity","FORCED_COLORS","TARGET_SIZE","styles","base","k6CgDc","kGNEyG","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","kVAEAm","kybGjl","kIyJzY","k1ekBW","kAMwcw","$$css","disabled","filled","kWkggS","kMwMTN","filledDisabled","filledToggle","filledToggleSelected","lg","kZKoxP","kGuDYH","kzqmXN","md","kgeoSG","kFcpXp","kEoFBp","outlined","outlinedDisabled","outlinedToggleSelected","standard","standardDisabled","standardToggleSelected","tonal","tonalDisabled","tonalToggleSelected","xl","xs","xxl","hovered","focused","pressed","outlineWidths","EDGES","controlLg","controlSm","controlXl","controlXs","controlXxl","_temp","shifted","width","value","val","undefined","selectedShapes","toggleStyles","selected","unselected","toggleContainers","const","disabledStyles","IconButtonProps","children","className","IconButtonState","disableRipple","pendingLabel","render","size","IconButtonSize","style","variant","IconButtonVariant","Omit","groupStyles","group","state","shift","IconButton","t0","$","defaultSelected","href","isPending","isSelected","onChange","rel","ownSize","target","t1","props","inSelectingGroup","press","onPressStart","onPressEnd","t2","selection","t3","toggleStyleProps","isToggle","T0","iconButtonClasses","t4","t5","onPress","toggle","t6","ring","isHovered","isFocusVisible","isPressed","isDisabled","container","_c","stylex.props"],"sources":["../../../src/components/icon-button/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, DOMRenderFunction, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { ToggleGroupStateContext } from 'react-aria-components';\nimport type { ButtonDOMProps, ButtonForm, ButtonState } from '../../button';\nimport type { ButtonGroupItem } from '../../button/context';\nimport { ButtonBase, ToggleButtonBase } from '../../button';\nimport { ButtonGroupItemContext } from '../../button/context';\nimport { groupPressHandlers } from '../../button/group';\nimport { useSelection } from '../../button/hooks';\nimport { pressThen } from '../../button/toggle';\nimport { focus } from '../../styles/focus';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\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.\n// 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.\n//\n// **Under forced colours a container is drawn as a rule, and a chosen toggle\n// as the mode's own chosen pair.** That mode paints author backgrounds in a\n// system colour and forces the icon's, which left a filled or tonal icon\n// button as an icon with nothing round it and a chosen toggle the same as an\n// unchosen one. `base` draws a 1px `ButtonText` border there, as Button's\n// does. Outlined keeps its own rule, and standard stays without one, as the\n// page draws it. A chosen toggle of any style is filled `Highlight` with its\n// icon in `HighlightText`. A disabled button's icon and edge are `GrayText`,\n// for the reason Button's comment gives: the browser greys a disabled\n// `<button>` there, but not the `<span>` a disabled link is.\n//\n// What every button does past its own styles — the ripple, the link and\n// toggle forms, the pending ring, a parent's disabled state — is\n// `src/button`'s, shared with Button.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n/**\n * The press area the page requires of its two smallest sizes. A literal\n * rather than `sizing.controlMd`, which holds the same number: that is a step\n * of the control scale, and a consumer resizing their medium controls should\n * not shrink a target the page states as a floor.\n */\nconst TARGET_SIZE = '48px';\nconst styles = {\n base: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\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: \"x9w8ftz\",\n k1ekBW: \"x1n0k3g7\",\n kAMwcw: \"x1hu1jz6\",\n $$css: true\n },\n disabled: {\n kaIpWk: \"x1dkaolv\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n filled: {\n kWkggS: \"xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n filledDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"x1mjdul6\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n filledToggleSelected: {\n kWkggS: \"xnety89 x1jzqe4\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n $$css: true\n },\n lg: {\n kZKoxP: \"xs1ryiz\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x1fh0d6s\",\n $$css: true\n },\n md: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x1q69gdh\",\n kEoFBp: \"x1hmns74\",\n kZKoxP: \"x1rv7mn0\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x1eujcsb\",\n $$css: true\n },\n outlined: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x133yhug\",\n ksu8eU: \"x1y0btm7\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n outlinedDisabled: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"xrh88j3 xmnqt3w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"x1c5gpgi x1jzqe4\",\n kVAM5u: \"x9r1u3d x1n2ykn\",\n kMwMTN: \"x1girmi0 x1k5gbb1\",\n $$css: true\n },\n standard: {\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n standardDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"xjbqb8w x1jzqe4\",\n kMzoRj: \"xc342km\",\n kMwMTN: \"x1mxwv8y x1k5gbb1\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x15dekr4\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n tonalDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x167r6xl x1jzqe4\",\n kMwMTN: \"x1lba3jz x1k5gbb1\",\n $$css: true\n },\n xl: {\n kZKoxP: \"x1xaimp3\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"x1s3cmhv\",\n kzqmXN: \"xszbqgh\",\n $$css: true\n },\n xs: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x1n6cgzf\",\n kEoFBp: \"x1hmns74\",\n kZKoxP: \"xig8zya\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"xwsyq91\",\n kzqmXN: \"x11ts1a5\",\n $$css: true\n },\n xxl: {\n kZKoxP: \"x173yhrv\",\n kaIpWk: \"x1dkaolv\",\n kGuDYH: \"x1tgwohi\",\n kzqmXN: \"xz1kjiq\",\n $$css: true\n }\n};\n\n// The hover, focus and pressed layers, one style per container, applied from\n// React Aria's render state rather than from `:hover`, `:focus-visible` and\n// `:active`, for Button's reasons — see its header: a hover layer stayed on\n// after a tap, and no pressed layer or corner showed for a press made from\n// the keyboard. In the order they are applied, so where two hold the later\n// wins, as the page draws one layer at a time: focus over hover, and a press\n// over both. A chosen toggle's layer keeps its forced-colours `Highlight`,\n// since a later style replaces the property whole.\nconst hovered = {\n filled: {\n kWkggS: \"xo1ct44\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"xtxe0ya\",\n $$css: true\n },\n filledToggleSelected: {\n kWkggS: \"xo1ct44 x1jzqe4\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"x1hxzsxp x1jzqe4\",\n $$css: true\n },\n standard: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"x659ado x1jzqe4\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x1fctxn6\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x12r95rf x1jzqe4\",\n $$css: true\n }\n};\nconst focused = {\n filled: {\n kWkggS: \"xhodiby\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"x1ppcb1\",\n $$css: true\n },\n filledToggleSelected: {\n kWkggS: \"xhodiby x1jzqe4\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x19p5drm\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"xn4e5mw x1jzqe4\",\n $$css: true\n },\n standard: {\n kWkggS: \"x19p5drm\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"x1sog3nf x1jzqe4\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x1s5x49g\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x16tkg7c x1jzqe4\",\n $$css: true\n }\n};\nconst pressed = {\n filled: {\n kWkggS: \"x7b25lv\",\n $$css: true\n },\n filledToggle: {\n kWkggS: \"x1qdfkg1\",\n $$css: true\n },\n filledToggleSelected: {\n kWkggS: \"x7b25lv x1jzqe4\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x123fei2\",\n $$css: true\n },\n outlinedToggleSelected: {\n kWkggS: \"x167cdfs x1jzqe4\",\n $$css: true\n },\n standard: {\n kWkggS: \"x123fei2\",\n $$css: true\n },\n standardToggleSelected: {\n kWkggS: \"x1dvjsmr x1jzqe4\",\n $$css: true\n },\n tonal: {\n kWkggS: \"xzpauq9\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x12o6fnv x1jzqe4\",\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// Each size's edge again, for the one place it is read at runtime: a standard\n// ButtonGroup widening a pressed button by adding to it. The size styles\n// above write the same values.\nconst EDGES = {\n lg: sizing.controlLg,\n md: sizing.controlSm,\n xl: sizing.controlXl,\n xs: sizing.controlXs,\n xxl: sizing.controlXxl\n};\n\n// The width a standard group sets while it widens or narrows the button.\nconst _temp = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst shifted = {\n width: (value: string) => [_temp, {\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(value)\n }]\n};\n\n// The corner each size presses to, which is the page's round-to-square\n// morph, and the corner a chosen toggle rests at. A style per size rather than\n// a value inside each size style, since StyleX replaces the property whole:\n// it comes after the size's circle while pressed, and after the disabled\n// style's circle too for a chosen toggle, which keeps its corner disabled.\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. Two of the six are the\n// plain button's own styles: an unchosen tonal or standard toggle is the\n// tonal or standard button. A chosen filled toggle takes the filled button's\n// colours from a style of its own, which adds the forced-colours pair.\nconst toggleStyles = {\n filled: {\n selected: styles.filledToggleSelected,\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};\n\n// The same containers by name, for the layers above.\nconst toggleContainers = {\n filled: {\n selected: 'filledToggleSelected',\n unselected: 'filledToggle'\n },\n outlined: {\n selected: 'outlinedToggleSelected',\n unselected: 'outlined'\n },\n standard: {\n selected: 'standardToggleSelected',\n unselected: 'standard'\n },\n tonal: {\n selected: 'tonalToggleSelected',\n unselected: 'tonal'\n }\n} as const;\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 * `undefined` is for a button inside a React Aria component that names it\n * itself — a search field's clear button, a number field's steppers. React\n * Aria takes a prop over its context, so a name written here would replace\n * the one it gives in the reader's locale, and undefined leaves that stand.\n */\n 'aria-label': string | undefined;\n children?: ReactNode;\n /** A function may compute the class from the button's render state. */\n className?: ClassNameOrFunction<IconButtonState>;\n /**\n * Disables the press ripple. The hover and pressed state layers are\n * unaffected.\n * @default false\n */\n disableRipple?: boolean;\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. Left out, it is\n * the word for it in the I18nProvider's locale — \"Loading\" in English.\n */\n pendingLabel?: 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 /**\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} & ButtonForm & 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: the one every button shares, whose `isSelected` only the toggle\n// form fills in — see `ButtonState` in src/button.\ntype IconButtonState = ButtonState;\ntype IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';\n\n// What a group lays over the button: its own styles for the button's state,\n// last so a connected group's corners hold whatever the button's own shape\n// would be, and the standard group's widening or narrowing as extra width.\nfunction groupStyles(group: ButtonGroupItem | null, size: IconButtonSize, state: ButtonState) {\n if (group === null) {\n return null;\n }\n return [group.styles?.(state), group.shift !== 0 && shifted.width(`calc(${EDGES[size]} + ${group.shift}px)`)];\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. The three forms are exclusive, so a toggle\n * given `href` does not compile. A toggle may be pending, for a state saved\n * somewhere slow: the ring replaces its icon and a press changes nothing\n * until it clears.\n *\n * ```tsx\n * <IconButton aria-label=\"Label\" defaultSelected variant=\"tonal\">\n * <StarIcon />\n * </IconButton>\n * ```\n */\nfunction IconButton({\n defaultSelected,\n href,\n isPending,\n isSelected,\n onChange,\n pendingLabel,\n rel,\n size: ownSize,\n target,\n variant = 'standard',\n ...props\n}: IconButtonProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>) {\n // A ButtonGroup around the button hands it a size, its shape at the\n // group's inner edges and the press interaction, as it does Button's; see\n // src/button/context.ts. A size named here still wins.\n const group = useContext(ButtonGroupItemContext);\n const size = ownSize ?? group?.size ?? 'md';\n const inSelectingGroup = useContext(ToggleGroupStateContext) !== null;\n const press = groupPressHandlers(group, props.onPressStart, props.onPressEnd);\n const selection = useSelection({\n defaultSelected,\n isSelected,\n onChange\n });\n\n // A selecting ButtonGroup around it makes it React Aria's ToggleButton, to\n // take part in the group's selection. Whether a button sits in one does\n // not change from one render to the next.\n if (inSelectingGroup) {\n return <ToggleButtonBase {...props} {...press} classes={toggleStyleProps(size, variant, group)} isPending={isPending} />;\n }\n\n // The three props that make this a toggle on its own. Read together rather\n // than behind a `toggle` word of its own, the way `href` already turns the\n // button into a link: a button given none of them has no state to report,\n // and one given any of them has nothing else it could mean. Either way it\n // is the same component underneath, so a toggle whose `isSelected` is\n // still loading stays the same element when the value arrives, and keeps\n // focus.\n const isToggle = defaultSelected !== undefined || isSelected !== undefined || onChange !== undefined;\n return <ButtonBase {...props} {...press} classes={isToggle ? toggleStyleProps(size, variant, group) : iconButtonClasses(size, variant, group)} href={href} isPending={isPending} isSelected={isToggle ? selection.selected : undefined} onPress={isToggle ? pressThen(props.onPress, selection.toggle) : props.onPress} pendingLabel={pendingLabel} rel={rel} target={target} />;\n}\n\n// The plain button's classes, from React Aria's render state — see the hover\n// and pressed layers above for why that and not the pseudo-classes. Built by\n// a call 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 on\n// its inputs.\nfunction iconButtonClasses(size: IconButtonSize, variant: IconButtonVariant, group: ButtonGroupItem | null) {\n return (state: ButtonState) => stylex.props(styles.base, focus.ring, styles[variant], styles[size], variant === 'outlined' && outlineWidths[size], state.isHovered && hovered[variant], state.isFocusVisible && focused[variant], state.isPressed && pressed[variant], state.isPressed && selectedShapes[size], state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant], groupStyles(group, size, state));\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, group: ButtonGroupItem | null) {\n return (state: IconButtonState) => {\n const container = toggleContainers[variant][state.isSelected === true ? 'selected' : 'unselected'];\n return 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.isHovered && hovered[container], state.isFocusVisible && focused[container], state.isPressed && pressed[container], state.isPressed && selectedShapes[size], state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant], state.isSelected === true && selectedShapes[size], groupStyles(group, size, state));\n };\n}\nexport type { IconButtonProps, IconButtonSize, IconButtonState, IconButtonVariant };\nexport default IconButton;"],"mappings":";;;;;;;;;;;;;;AAsGA,MAAM4B,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,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;EACRf,QAAQ;EACRI,QAAQ;EACRU,OAAO;CACT;CACAE,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,gBAAgB;EACdF,QAAQ;EACRlB,QAAQ;EACRmB,QAAQ;EACRJ,OAAO;CACT;CACAM,cAAc;EACZH,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAO,sBAAsB;EACpBJ,QAAQ;EACRC,QAAQ;EACRJ,OAAO;C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kBAAkBtE,QAAQyE,YAAYpC,MAAMkC,aAAatE,QAAQwE,YAAYpC,MAAMkC,aAAaxD,eAAec,OAAOQ,MAAMmC,cAAcxH,OAAOoB,UAAUiE,MAAMmC,cAAcnD,eAAeW,UAAUK,MAAMQ,eAAe,QAAQ9B,eAAec,OAAOM,YAAYC,OAAOP,MAAMQ,KAAK,CAAC;CACrZ;AACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FieldVariant } from "../field/index.js";
|
|
2
|
+
import { AppBarScroll, AppBarScrollOptions, useAppBarScroll } from "../hooks/useAppBarScroll.js";
|
|
2
3
|
import AppBar, { AppBarProps } from "./app-bar/index.js";
|
|
3
4
|
import Autocomplete, { AutocompleteFilter, AutocompleteProps } from "./autocomplete/index.js";
|
|
4
5
|
import Avatar, { AvatarProps } from "./avatar/index.js";
|
|
@@ -81,4 +82,4 @@ import TokenField, { TokenFieldProps, TokenSegment } from "./token-field/index.j
|
|
|
81
82
|
import Toolbar, { ToolbarProps, ToolbarTone } from "./toolbar/index.js";
|
|
82
83
|
import Tooltip, { TooltipAlign, TooltipProps, TooltipSide } from "./tooltip/index.js";
|
|
83
84
|
import Tree, { TreeItem, TreeItemProps, TreeLoadMore, TreeLoadMoreProps, TreeProps, TreeSection, TreeSectionProps } from "./tree/index.js";
|
|
84
|
-
export { AppBar, type AppBarProps, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Form, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, Keycap, type KeycapProps, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, Separator, type SeparatorInset, type SeparatorProps, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps };
|
|
85
|
+
export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Form, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, Keycap, type KeycapProps, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, Separator, type SeparatorInset, type SeparatorProps, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, useAppBarScroll };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
3
3
|
import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
4
|
+
import { collectionStyles, containerClasses, rowItemStyles } from "../../collection/styles.js";
|
|
5
|
+
import { CollectionLoadMore } from "../../collection/index.js";
|
|
4
6
|
import { useRipple } from "../../hooks/useRipple.js";
|
|
5
7
|
import Checkbox from "../checkbox/index.js";
|
|
6
8
|
import { textOf } from "../../collection/text.js";
|
|
7
|
-
import { CollectionLoadMore } from "../../collection/index.js";
|
|
8
|
-
import { collectionStyles, containerClasses, rowItemStyles } from "../../collection/styles.js";
|
|
9
9
|
import { RowContent } from "../../row/index.js";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
11
|
import { createContext, useContext } from "react";
|
|
@@ -30,12 +30,20 @@ type ListBoxLoadMoreProps = Omit<ListBoxLoadMoreItemProps, 'children'> & {
|
|
|
30
30
|
*/
|
|
31
31
|
label?: string;
|
|
32
32
|
};
|
|
33
|
-
type ListBoxProps$1<T extends object = object> =
|
|
33
|
+
type ListBoxProps$1<T extends object = object> = {
|
|
34
34
|
/** A function may compute the class from the list's render state. */
|
|
35
35
|
className?: ListBoxProps<T>['className'];
|
|
36
|
+
/**
|
|
37
|
+
* What the list shows when nothing is in it — after a search that matched
|
|
38
|
+
* nothing, usually. Left out, it is a muted row saying "No results" in the
|
|
39
|
+
* I18nProvider's locale, which an `Autocomplete` around the list also
|
|
40
|
+
* announces. One of the call site's own replaces the announcement as well
|
|
41
|
+
* as the row, so what it says to a screen reader is the call site's too.
|
|
42
|
+
*/
|
|
43
|
+
renderEmptyState?: ListBoxProps<T>['renderEmptyState'];
|
|
36
44
|
/** A function may compute the style from the list's render state. */
|
|
37
45
|
style?: ListBoxProps<T>['style'];
|
|
38
|
-
}
|
|
46
|
+
} & Omit<ListBoxProps<T>, 'className' | 'renderEmptyState' | 'style'>;
|
|
39
47
|
type ListBoxSectionProps$1<T extends object = object> = Omit<ListBoxSectionProps<T>, 'children'> & {
|
|
40
48
|
/**
|
|
41
49
|
* The options in the section. A section built from data puts React Aria's
|
|
@@ -62,6 +70,10 @@ type ListBoxSectionProps$1<T extends object = object> = Omit<ListBoxSectionProps
|
|
|
62
70
|
*
|
|
63
71
|
* The call site's `className` and `style` land on the container, which is
|
|
64
72
|
* the element a layout positions.
|
|
73
|
+
*
|
|
74
|
+
* A list with nothing in it shows a muted "No results" row in place of its
|
|
75
|
+
* options, which is what a search that matches nothing leaves; pass
|
|
76
|
+
* `renderEmptyState` to draw something else.
|
|
65
77
|
*/
|
|
66
78
|
declare function ListBox$1<T extends object>(props: ListBoxProps$1<T> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
67
79
|
declare namespace ListBox$1 {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
3
3
|
import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
4
|
+
import { collectionStyles, containerClasses, rowItemStyles } from "../../collection/styles.js";
|
|
5
|
+
import { CollectionEmpty, CollectionLoadMore } from "../../collection/index.js";
|
|
4
6
|
import { useRipple } from "../../hooks/useRipple.js";
|
|
5
7
|
import { textOf } from "../../collection/text.js";
|
|
6
|
-
import { CollectionLoadMore } from "../../collection/index.js";
|
|
7
|
-
import { collectionStyles, containerClasses, rowItemStyles } from "../../collection/styles.js";
|
|
8
8
|
import { RowContent } from "../../row/index.js";
|
|
9
9
|
import { c } from "react/compiler-runtime";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Header, ListBox, ListBoxItem, ListBoxLoadMoreItem, ListBoxSection } from "react-aria-components";
|
|
12
12
|
//#region src/components/list-box/index.tsx
|
|
13
|
+
function emptyState() {
|
|
14
|
+
return /* @__PURE__ */ jsx(CollectionEmpty, { variant: "list" });
|
|
15
|
+
}
|
|
13
16
|
function itemContent(children, leading, overline, supporting, trailing, ripple) {
|
|
14
17
|
return (state) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(RowContent, {
|
|
15
18
|
isDisabled: state.isDisabled,
|
|
@@ -34,6 +37,10 @@ function itemContent(children, leading, overline, supporting, trailing, ripple)
|
|
|
34
37
|
*
|
|
35
38
|
* The call site's `className` and `style` land on the container, which is
|
|
36
39
|
* the element a layout positions.
|
|
40
|
+
*
|
|
41
|
+
* A list with nothing in it shows a muted "No results" row in place of its
|
|
42
|
+
* options, which is what a search that matches nothing leaves; pass
|
|
43
|
+
* `renderEmptyState` to draw something else.
|
|
37
44
|
*/
|
|
38
45
|
function ListBox$1(props) {
|
|
39
46
|
const $ = c(5);
|
|
@@ -46,6 +53,7 @@ function ListBox$1(props) {
|
|
|
46
53
|
let t1;
|
|
47
54
|
if ($[2] !== props || $[3] !== t0) {
|
|
48
55
|
t1 = /* @__PURE__ */ jsx(ListBox, {
|
|
56
|
+
renderEmptyState: emptyState,
|
|
49
57
|
...props,
|
|
50
58
|
...t0
|
|
51
59
|
});
|
|
@@ -132,11 +140,11 @@ function ListBoxLoadMore(t0) {
|
|
|
132
140
|
let t1;
|
|
133
141
|
let t2;
|
|
134
142
|
if ($[0] !== t0) {
|
|
135
|
-
const { label: t3, ...props$
|
|
143
|
+
const { label: t3, ...props$1 } = t0;
|
|
136
144
|
label = t3;
|
|
137
145
|
T0 = ListBoxLoadMoreItem;
|
|
138
|
-
t1 = props$
|
|
139
|
-
t2 = mergeStyles(props(collectionStyles.loading), props$
|
|
146
|
+
t1 = props$1;
|
|
147
|
+
t2 = mergeStyles(props(collectionStyles.loading), props$1);
|
|
140
148
|
$[0] = t0;
|
|
141
149
|
$[1] = T0;
|
|
142
150
|
$[2] = label;
|
|
@@ -184,12 +192,12 @@ function ListBoxSection$1(t0) {
|
|
|
184
192
|
let t1;
|
|
185
193
|
let t2;
|
|
186
194
|
if ($[0] !== t0) {
|
|
187
|
-
const { children: t3, header: t4, ...props$
|
|
195
|
+
const { children: t3, header: t4, ...props$2 } = t0;
|
|
188
196
|
children = t3;
|
|
189
197
|
header = t4;
|
|
190
198
|
T0 = ListBoxSection;
|
|
191
|
-
t1 = props$
|
|
192
|
-
t2 = mergeStyles(props(collectionStyles.section), props$
|
|
199
|
+
t1 = props$2;
|
|
200
|
+
t2 = mergeStyles(props(collectionStyles.section), props$2);
|
|
193
201
|
$[0] = t0;
|
|
194
202
|
$[1] = T0;
|
|
195
203
|
$[2] = children;
|