@kanso-labs/kanso-ui 0.40.5 → 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.
Files changed (98) hide show
  1. package/dist/button/hooks.js +37 -1
  2. package/dist/button/hooks.js.map +1 -1
  3. package/dist/button/index.d.ts +57 -1
  4. package/dist/button/index.js +153 -96
  5. package/dist/button/index.js.map +1 -1
  6. package/dist/button/toggle.js +17 -0
  7. package/dist/button/toggle.js.map +1 -0
  8. package/dist/calendar/index.js +69 -58
  9. package/dist/calendar/index.js.map +1 -1
  10. package/dist/calendar/styles.js +29 -6
  11. package/dist/calendar/styles.js.map +1 -1
  12. package/dist/chip/index.js +3 -4
  13. package/dist/chip/index.js.map +1 -1
  14. package/dist/chip/styles.js +2 -6
  15. package/dist/chip/styles.js.map +1 -1
  16. package/dist/collection/empty.js +7 -0
  17. package/dist/collection/empty.js.map +1 -0
  18. package/dist/collection/index.js +125 -2
  19. package/dist/collection/index.js.map +1 -1
  20. package/dist/collection/styles.js +14 -0
  21. package/dist/collection/styles.js.map +1 -1
  22. package/dist/components/app-bar/index.d.ts +26 -23
  23. package/dist/components/app-bar/index.js +89 -72
  24. package/dist/components/app-bar/index.js.map +1 -1
  25. package/dist/components/autocomplete/index.d.ts +6 -4
  26. package/dist/components/autocomplete/index.js +23 -14
  27. package/dist/components/autocomplete/index.js.map +1 -1
  28. package/dist/components/button/index.d.ts +15 -35
  29. package/dist/components/button/index.js +102 -74
  30. package/dist/components/button/index.js.map +1 -1
  31. package/dist/components/calendar/index.d.ts +9 -3
  32. package/dist/components/calendar/index.js +51 -42
  33. package/dist/components/calendar/index.js.map +1 -1
  34. package/dist/components/card/index.js +43 -27
  35. package/dist/components/card/index.js.map +1 -1
  36. package/dist/components/carousel/index.js +1 -1
  37. package/dist/components/checkbox/index.d.ts +9 -0
  38. package/dist/components/checkbox/index.js +47 -35
  39. package/dist/components/checkbox/index.js.map +1 -1
  40. package/dist/components/checkbox-group/index.js +1 -1
  41. package/dist/components/chip/index.d.ts +9 -4
  42. package/dist/components/chip/index.js.map +1 -1
  43. package/dist/components/chip-group/index.js +51 -37
  44. package/dist/components/chip-group/index.js.map +1 -1
  45. package/dist/components/copy-field/index.d.ts +28 -6
  46. package/dist/components/copy-field/index.js +140 -54
  47. package/dist/components/copy-field/index.js.map +1 -1
  48. package/dist/components/currency/index.d.ts +6 -2
  49. package/dist/components/currency/index.js +74 -46
  50. package/dist/components/currency/index.js.map +1 -1
  51. package/dist/components/disclosure/index.js +1 -1
  52. package/dist/components/icon-button/index.d.ts +6 -31
  53. package/dist/components/icon-button/index.js +64 -52
  54. package/dist/components/icon-button/index.js.map +1 -1
  55. package/dist/components/index.d.ts +2 -1
  56. package/dist/components/list/index.js +2 -2
  57. package/dist/components/list-box/index.d.ts +14 -2
  58. package/dist/components/list-box/index.js +16 -8
  59. package/dist/components/list-box/index.js.map +1 -1
  60. package/dist/components/list-item/index.js +1 -1
  61. package/dist/components/menu/index.d.ts +14 -1
  62. package/dist/components/menu/index.js +32 -17
  63. package/dist/components/menu/index.js.map +1 -1
  64. package/dist/components/navigation-tree/index.js +2 -2
  65. package/dist/components/radio-group/index.d.ts +4 -0
  66. package/dist/components/radio-group/index.js +2 -2
  67. package/dist/components/radio-group/index.js.map +1 -1
  68. package/dist/components/range-calendar/index.d.ts +9 -3
  69. package/dist/components/range-calendar/index.js +51 -42
  70. package/dist/components/range-calendar/index.js.map +1 -1
  71. package/dist/components/search-view/index.js +1 -1
  72. package/dist/components/segmented-button/index.d.ts +5 -4
  73. package/dist/components/segmented-button/index.js +3 -3
  74. package/dist/components/segmented-button/index.js.map +1 -1
  75. package/dist/components/split-button/index.d.ts +1 -1
  76. package/dist/components/split-button/index.js.map +1 -1
  77. package/dist/components/switch/index.d.ts +9 -2
  78. package/dist/components/switch/index.js +2 -2
  79. package/dist/components/switch/index.js.map +1 -1
  80. package/dist/components/table/index.js +3 -3
  81. package/dist/components/time-picker/index.js +1 -1
  82. package/dist/components/tree/index.js +2 -2
  83. package/dist/control/index.js +55 -17
  84. package/dist/control/index.js.map +1 -1
  85. package/dist/field/index.js +59 -51
  86. package/dist/field/index.js.map +1 -1
  87. package/dist/hooks/useAppBarScroll.d.ts +52 -0
  88. package/dist/hooks/useAppBarScroll.js +75 -0
  89. package/dist/hooks/useAppBarScroll.js.map +1 -0
  90. package/dist/i18n/index.js +2 -0
  91. package/dist/i18n/index.js.map +1 -1
  92. package/dist/i18n/messages.js +68 -0
  93. package/dist/i18n/messages.js.map +1 -1
  94. package/dist/index.d.ts +2 -1
  95. package/dist/index.js +3 -2
  96. package/dist/render/name.d.ts +22 -0
  97. package/dist/styles.css +83 -24
  98. package/package.json +2 -2
@@ -2,9 +2,11 @@
2
2
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
3
  import { spacing } 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 { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -24,11 +26,13 @@ const styles = {
24
26
  kGuDYH: "x14zspaw",
25
27
  k63SB2: "x1v9cpvo",
26
28
  kOIVth: "x126z3so",
29
+ kjj79g: "xl56j7k",
27
30
  kb6lSQ: "x155f00i",
28
31
  kLWn49: "x1lz68p4",
29
32
  ks0D6T: "x193iq5w",
30
33
  kHjlTd: "xj0a0fe",
31
34
  kVAEAm: "x1n2onr6",
35
+ k9WMMc: "x2b8uid",
32
36
  kybGjl: "x1hl2dhg",
33
37
  kIyJzY: "x1qno0dh x12w9bfk",
34
38
  k1ekBW: "x1hdt7lq",
@@ -100,7 +104,7 @@ const styles = {
100
104
  },
101
105
  md: {
102
106
  kgeoSG: "x1cpjm7i",
103
- kGOzcv: "x1gvacq5",
107
+ kGOzcv: "xun2zgk",
104
108
  kpsdNU: "xm4btww",
105
109
  kEoFBp: "x1hmns74",
106
110
  kAzted: "x1cio8j0",
@@ -175,7 +179,7 @@ const styles = {
175
179
  },
176
180
  xs: {
177
181
  kgeoSG: "x1cpjm7i",
178
- kGOzcv: "x1arwny6",
182
+ kGOzcv: "xun2zgk",
179
183
  kpsdNU: "x1ecwmwu",
180
184
  kEoFBp: "x1hmns74",
181
185
  kAzted: "xlzjxrf",
@@ -196,25 +200,37 @@ const styles = {
196
200
  $$css: true
197
201
  }
198
202
  };
199
- const outlineWidths = {
203
+ const OUTLINE_WIDTHS = {
204
+ lg: "1px",
205
+ md: "1px",
206
+ xl: "2px",
207
+ xs: "1px",
208
+ xxl: "3px"
209
+ };
210
+ const outlinedSizes = {
200
211
  lg: {
201
212
  kMzoRj: "xmkeg23",
213
+ kg3NbH: "xfeiziq",
202
214
  $$css: true
203
215
  },
204
216
  md: {
205
217
  kMzoRj: "xmkeg23",
218
+ kg3NbH: "x1uvede8",
206
219
  $$css: true
207
220
  },
208
221
  xl: {
209
222
  kMzoRj: "xdh2fpr",
223
+ kg3NbH: "xrhf21y",
210
224
  $$css: true
211
225
  },
212
226
  xs: {
213
227
  kMzoRj: "xmkeg23",
228
+ kg3NbH: "x9t8nta",
214
229
  $$css: true
215
230
  },
216
231
  xxl: {
217
232
  kMzoRj: "x9r2w2z",
233
+ kg3NbH: "x1wz3vkj",
218
234
  $$css: true
219
235
  }
220
236
  };
@@ -460,8 +476,12 @@ const toggleContainers = {
460
476
  *
461
477
  * Given `isSelected`, `defaultSelected` or `onChange` it is a toggle, which
462
478
  * reports its state through `aria-pressed` and draws the page's second pair
463
- * of colour roles for its variant. A toggle takes neither `href` nor the
464
- * pending props, and a `text` button never toggles.
479
+ * of colour roles for its variant. The three forms are exclusive, so a toggle
480
+ * given `href` does not compile, and nor does a `text` toggle, which the page
481
+ * gives no selected colours — a `text` button in a selecting `ButtonGroup`
482
+ * is the one that toggles, for the group's sake. A toggle may be pending,
483
+ * for a state saved somewhere slow: the ring replaces its label and a press
484
+ * changes nothing until it clears.
465
485
  *
466
486
  * ```tsx
467
487
  * <Button defaultSelected variant="tonal">
@@ -470,7 +490,7 @@ const toggleContainers = {
470
490
  * ```
471
491
  */
472
492
  function Button$1(t0) {
473
- const $ = c(33);
493
+ const $ = c(32);
474
494
  const { children, defaultSelected, href, icon, isPending, isSelected, onChange, pendingLabel, rel, shape: t1, size: ownSize, target, variant: t2, ...props$1 } = t0;
475
495
  const shape = t1 === void 0 ? "round" : t1;
476
496
  const variant = t2 === void 0 ? "filled" : t2;
@@ -479,98 +499,106 @@ function Button$1(t0) {
479
499
  const inSelectingGroup = useContext(ToggleGroupStateContext) !== null;
480
500
  const press = groupPressHandlers(group, props$1.onPressStart, props$1.onPressEnd);
481
501
  let t3;
482
- if ($[0] !== children || $[1] !== icon || $[2] !== size) {
483
- t3 = icon === void 0 ? children : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
502
+ if ($[0] !== defaultSelected || $[1] !== isSelected || $[2] !== onChange) {
503
+ t3 = {
504
+ defaultSelected,
505
+ isSelected,
506
+ onChange
507
+ };
508
+ $[0] = defaultSelected;
509
+ $[1] = isSelected;
510
+ $[2] = onChange;
511
+ $[3] = t3;
512
+ } else t3 = $[3];
513
+ const selection = useSelection(t3);
514
+ let t4;
515
+ if ($[4] !== children || $[5] !== icon || $[6] !== size) {
516
+ t4 = icon === void 0 ? children : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
484
517
  ...props(styles.icon, iconSizes[size]),
485
518
  children: icon
486
519
  }), children] });
487
- $[0] = children;
488
- $[1] = icon;
489
- $[2] = size;
490
- $[3] = t3;
491
- } else t3 = $[3];
492
- const content = t3;
493
- if (inSelectingGroup || variant !== "text" && (defaultSelected !== void 0 || isSelected !== void 0 || onChange !== void 0)) {
494
- let t4;
495
- if ($[4] !== group || $[5] !== shape || $[6] !== size || $[7] !== variant) {
496
- t4 = variant === "text" ? buttonClasses(shape, size, variant, group) : toggleClasses(shape, size, variant, group);
497
- $[4] = group;
498
- $[5] = shape;
499
- $[6] = size;
500
- $[7] = variant;
501
- $[8] = t4;
502
- } else t4 = $[8];
520
+ $[4] = children;
521
+ $[5] = icon;
522
+ $[6] = size;
523
+ $[7] = t4;
524
+ } else t4 = $[7];
525
+ const content = t4;
526
+ if (inSelectingGroup) {
503
527
  let t5;
504
- if ($[9] !== content || $[10] !== defaultSelected || $[11] !== isPending || $[12] !== isSelected || $[13] !== onChange || $[14] !== press || $[15] !== props$1 || $[16] !== t4) {
505
- t5 = /* @__PURE__ */ jsx(ToggleButtonBase, {
506
- ...props$1,
507
- ...press,
508
- classes: t4,
509
- defaultSelected,
510
- isPending,
511
- isSelected,
512
- onChange,
513
- children: content
514
- });
515
- $[9] = content;
516
- $[10] = defaultSelected;
517
- $[11] = isPending;
518
- $[12] = isSelected;
519
- $[13] = onChange;
520
- $[14] = press;
521
- $[15] = props$1;
522
- $[16] = t4;
523
- $[17] = t5;
524
- } else t5 = $[17];
525
- return t5;
528
+ if ($[8] !== group || $[9] !== shape || $[10] !== size || $[11] !== variant) {
529
+ t5 = variant === "text" ? buttonClasses(shape, size, variant, group) : toggleClasses(shape, size, variant, group);
530
+ $[8] = group;
531
+ $[9] = shape;
532
+ $[10] = size;
533
+ $[11] = variant;
534
+ $[12] = t5;
535
+ } else t5 = $[12];
536
+ return /* @__PURE__ */ jsx(ToggleButtonBase, {
537
+ ...props$1,
538
+ ...press,
539
+ classes: t5,
540
+ isPending,
541
+ children: content
542
+ });
526
543
  }
527
- let t4;
528
- if ($[18] !== group || $[19] !== shape || $[20] !== size || $[21] !== variant) {
529
- t4 = buttonClasses(shape, size, variant, group);
530
- $[18] = group;
531
- $[19] = shape;
532
- $[20] = size;
533
- $[21] = variant;
534
- $[22] = t4;
535
- } else t4 = $[22];
544
+ const isToggle = variant !== "text" && (defaultSelected !== void 0 || isSelected !== void 0 || onChange !== void 0);
545
+ const T0 = ButtonBase;
536
546
  let t5;
537
- if ($[23] !== content || $[24] !== href || $[25] !== isPending || $[26] !== pendingLabel || $[27] !== press || $[28] !== props$1 || $[29] !== rel || $[30] !== t4 || $[31] !== target) {
538
- t5 = /* @__PURE__ */ jsx(ButtonBase, {
547
+ if ($[13] !== group || $[14] !== isToggle || $[15] !== shape || $[16] !== size || $[17] !== variant) {
548
+ t5 = isToggle ? toggleClasses(shape, size, variant, group) : buttonClasses(shape, size, variant, group);
549
+ $[13] = group;
550
+ $[14] = isToggle;
551
+ $[15] = shape;
552
+ $[16] = size;
553
+ $[17] = variant;
554
+ $[18] = t5;
555
+ } else t5 = $[18];
556
+ const t6 = isToggle ? selection.selected : void 0;
557
+ const t7 = isToggle ? pressThen(props$1.onPress, selection.toggle) : props$1.onPress;
558
+ let t8;
559
+ if ($[19] !== T0 || $[20] !== content || $[21] !== href || $[22] !== isPending || $[23] !== pendingLabel || $[24] !== press || $[25] !== props$1 || $[26] !== rel || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 || $[30] !== target) {
560
+ t8 = /* @__PURE__ */ jsx(T0, {
539
561
  ...props$1,
540
562
  ...press,
541
- classes: t4,
563
+ classes: t5,
542
564
  href,
543
565
  isPending,
566
+ isSelected: t6,
567
+ onPress: t7,
544
568
  pendingLabel,
545
569
  rel,
546
570
  target,
547
571
  children: content
548
572
  });
549
- $[23] = content;
550
- $[24] = href;
551
- $[25] = isPending;
552
- $[26] = pendingLabel;
553
- $[27] = press;
554
- $[28] = props$1;
555
- $[29] = rel;
556
- $[30] = t4;
557
- $[31] = target;
558
- $[32] = t5;
559
- } else t5 = $[32];
560
- return t5;
573
+ $[19] = T0;
574
+ $[20] = content;
575
+ $[21] = href;
576
+ $[22] = isPending;
577
+ $[23] = pendingLabel;
578
+ $[24] = press;
579
+ $[25] = props$1;
580
+ $[26] = rel;
581
+ $[27] = t5;
582
+ $[28] = t6;
583
+ $[29] = t7;
584
+ $[30] = target;
585
+ $[31] = t8;
586
+ } else t8 = $[31];
587
+ return t8;
561
588
  }
562
589
  function buttonClasses(shape, size, variant, group) {
563
- return (state) => props(styles.base, focus.ring, styles[variant], styles[size], shape === "square" && squareShapes[size], variant === "outlined" && outlineWidths[size], state.isHovered && hovered[variant], state.isFocusVisible && focused[variant], state.isPressed && pressed[variant], state.isPressed && pressedShapes[size], groupStyles(group, size, state), state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]);
590
+ return (state) => props(styles.base, focus.ring, styles[variant], styles[size], shape === "square" && squareShapes[size], variant === "outlined" && outlinedSizes[size], state.isHovered && hovered[variant], state.isFocusVisible && focused[variant], state.isPressed && pressed[variant], state.isPressed && pressedShapes[size], groupStyles(group, size, variant, state), state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]);
564
591
  }
565
- function groupStyles(group, size, state) {
592
+ function groupStyles(group, size, variant, state) {
566
593
  if (group === null) return null;
567
- return [group.styles?.(state), group.shift !== 0 && shifted.padding(`calc(${PADDINGS[size]} + ${group.shift / 2}px)`)];
594
+ const border = variant === "outlined" ? OUTLINE_WIDTHS[size] : "0px";
595
+ return [group.styles?.(state), group.shift !== 0 && shifted.padding(`calc(${PADDINGS[size]} - ${border} + ${group.shift / 2}px)`)];
568
596
  }
569
597
  function toggleClasses(shape, size, variant, group) {
570
598
  return (state) => {
571
599
  const isSelected = state.isSelected === true;
572
600
  const container = toggleContainers[variant][isSelected ? "selected" : "unselected"];
573
- return props(styles.base, focus.ring, styles[variant], styles[container], styles[size], shape === "square" && squareShapes[size], isSelected && (shape === "square" ? styles.round : squareShapes[size]), variant === "outlined" && outlineWidths[size], state.isHovered && hovered[variant], state.isHovered && hovered[container], state.isFocusVisible && focused[variant], state.isFocusVisible && focused[container], state.isPressed && pressed[variant], state.isPressed && pressed[container], state.isPressed && pressedShapes[size], groupStyles(group, size, state), state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]);
601
+ return props(styles.base, focus.ring, styles[variant], styles[container], styles[size], shape === "square" && squareShapes[size], isSelected && (shape === "square" ? styles.round : squareShapes[size]), variant === "outlined" && outlinedSizes[size], state.isHovered && hovered[variant], state.isHovered && hovered[container], state.isFocusVisible && focused[variant], state.isFocusVisible && focused[container], state.isPressed && pressed[variant], state.isPressed && pressed[container], state.isPressed && pressedShapes[size], groupStyles(group, size, variant, state), state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]);
574
602
  };
575
603
  }
576
604
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","StyleOrFunction","stylex","useContext","ToggleGroupStateContext","ButtonDOMProps","ButtonState","ButtonGroupItem","ButtonBase","ToggleButtonBase","ButtonGroupItemContext","groupPressHandlers","focus","colors","motion","radii","shadows","sizing","spacing","stateLayerOpacity","typography","TARGET_SIZE","FORCED_COLORS","styles","base","kGNEyG","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","ks0D6T","kHjlTd","kVAEAm","kybGjl","kIyJzY","k1ekBW","kAMwcw","$$css","disabled","elevated","kWkggS","kGVxlE","kMwMTN","elevatedDisabled","elevatedToggleSelected","filled","filledDisabled","filledToggle","filledToggleSelected","icon","kmuXW","kjj79g","lg","kAzted","k8WAf4","kg3NbH","md","kgeoSG","kGOzcv","kpsdNU","kEoFBp","outlined","outlinedDisabled","outlinedToggleSelected","round","text","textDisabled","tonal","tonalDisabled","tonalToggleSelected","xl","xs","xxl","outlineWidths","iconSizes","PADDINGS","shifted","padding","value","val","undefined","squareShapes","pressedShapes","hovered","focused","pressed","disabledStyles","toggleContainers","selected","unselected","const","ButtonProps","children","className","defaultSelected","disableRipple","href","isSelected","onChange","pendingLabel","rel","shape","ButtonShape","size","ButtonSize","style","target","variant","ButtonVariant","ToggleVariant","Button","t0","$","isPending","t1","ownSize","t2","props","group","inSelectingGroup","press","onPressStart","onPressEnd","t3","content","t4","buttonClasses","toggleClasses","t5","state","ring","isHovered","isFocusVisible","isPressed","groupStyles","isDisabled","shift","container","Button","_c","props","stylex.props"],"sources":["../../../src/components/button/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, 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, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// Each variant composites its label colour over its container at the\n// interaction state's opacity, rather than swapping in a separate\n// hover/pressed color: filled and tonal paint the 'on-color' over the\n// container, outlined, text and elevated paint the label colour over their\n// own. The pairs are the buttons spec page's newer values: tonal on\n// secondary container, outlined with an outline variant border and an\n// on-surface-variant label, text on primary, elevated on surface container\n// low with a primary label.\n//\n// **Elevated is the one variant whose shadow is part of its identity.** The\n// page rests it at elevation 1 rather than flat, raises it on hover and\n// returns it to 1 while pressed — where filled and tonal rest flat and lift\n// only on hover. Disabled drops it to none, since a shadow says a control is\n// available to press.\n// calc(<opacity> * 100%) turns the token's unitless 0-1 ratio into the\n// percentage color-mix() takes. Inlined rather than factored into a helper:\n// @stylexjs/babel-plugin only statically recognizes expressions written\n// directly as property values, and a call to an externally-defined function\n// isn't one of them.\n//\n// The hover, focus and pressed layers come from React Aria's render state,\n// `isHovered`, `isFocusVisible` and `isPressed`, rather than from `:hover`,\n// `:focus-visible` and `:active`. On a touch screen Chromium leaves `:hover`\n// on the last element tapped, so the layer and its lifted shadow stayed on a\n// button after the tap had ended, where React Aria ignores the emulated mouse\n// events that follow a touch. And React Aria prevents the default of the\n// keydown that presses a button with Space or Enter, so `:active` never\n// matched a keyboard press, which `isPressed` reports like any other.\n//\n// Disabled is a style of its own per variant rather than a `:disabled`\n// branch inside each property: a button given `href` renders as a link,\n// which React Aria turns into a <span> while disabled, and neither matches\n// the pseudo-class. The disabled styles are applied last from the render\n// state's `isDisabled`, and StyleX replaces a property whole, so they win\n// over any state layer applied before them.\n//\n// **Under forced colours a container is drawn as a rule.** That mode drops\n// the shadow and paints author backgrounds in a system colour, which left a\n// filled, tonal or elevated button as a label with nothing round it. `base`\n// draws a 1px `ButtonText` border there instead. Outlined keeps its own rule,\n// and text stays without one, as the page draws it. The mode repaints a\n// disabled button's fade at full strength as well. Chromium greys a disabled\n// `<button>` there by itself, but not the `<span>` React Aria renders for a\n// disabled link, so the disabled styles name `GrayText` for the label and\n// the edge rather than leave it to the browser.\n//\n// Two independent axes, applied base -> variant -> size. The variant carries\n// colour and the size carries geometry, so the two never argue: inline\n// padding belongs to the size alone, and every size declares its own.\n//\n// That is deliberate rather than incidental. The buttons page gives padding\n// per size — its Small button padding is 16dp, the 24dp beside it being the\n// older value the page marks as not recommended — and gives the five colour\n// styles no padding of their own. A text button is therefore as wide as a\n// filled one at the same size, which is what the code draws.\n//\n// This did once read the other way, with `md` declaring no padding so a\n// medium button fell through to its variant's. `fix(button)!: the spec's\n// five sizes` replaced that when the component took the page's sizes, since\n// a per-variant padding had nowhere to sit once every size carried one. The\n// comment describing the old cascade outlived it by some months, which is\n// how it came to say `text` keeps a tighter padding it has never had — back\n// then `text` declared 16dp while a filled `md` declared none at all, so the\n// text button was the wider of the two.\n//\n// **A toggle is the same button reporting a state.** Given `isSelected`,\n// `defaultSelected` or `onChange` it is React Aria's `ToggleButton`, which\n// announces the state through `aria-pressed`, as IconButton's toggle does.\n// The page gives four of the five styles a second pair of colour roles for\n// it: a filled toggle rests on surface container with an on-surface-variant\n// label and takes primary once selected, a tonal one moves from the\n// secondary container pair to secondary, an elevated one keeps its low\n// surface until it takes primary, and an outlined one swaps its rule for the\n// inverse surface pair. Under forced colours a selected toggle of any style\n// is filled `Highlight`, as IconButton's is. The page gives text no pair, so\n// a text button given those props stays a plain one.\n//\n// **The corner is a shape the button morphs between**, from the page's size\n// token sets. `round` rests as the pill and `square` at the size's square\n// corner: 12dp up to the page's S, 16dp at M and 28dp above. A press tightens\n// either to the size's pressed corner, 8dp, 12dp or 16dp, and a toggle\n// trades its shape for the other once selected — a round one for the square\n// corner, a square one for the pill. The corner eases over the motion\n// tokens' short duration, and moves at once for a reader who asks for\n// reduced motion.\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 IconButton.\n\n/**\n * The press area the buttons page requires, which its two smallest sizes are\n * drawn under. A literal rather than `sizing.controlMd`, which holds the same\n * number, for the reason IconButton's `TARGET_SIZE` gives: a consumer\n * resizing their medium controls should not shrink a target the page states\n * as a floor.\n */\nconst TARGET_SIZE = '48px';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n base: {\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 kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n ks0D6T: \"x193iq5w\",\n kHjlTd: \"xj0a0fe\",\n kVAEAm: \"x1n2onr6\",\n kybGjl: \"x1hl2dhg\",\n kIyJzY: \"x1qno0dh x12w9bfk\",\n k1ekBW: \"x1hdt7lq\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n disabled: {\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n elevated: {\n kWkggS: \"x1vnz5z6\",\n kGVxlE: \"x19efjv6\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n elevatedDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n elevatedToggleSelected: {\n kWkggS: \"xnety89 x1jzqe4\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n $$css: true\n },\n filled: {\n kWkggS: \"xnety89\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n filledDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\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 icon: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n lg: {\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n kAzted: \"xdovgog\",\n k8WAf4: \"x1uvvd8r\",\n kg3NbH: \"xg0ps1x\",\n $$css: true\n },\n md: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1gvacq5\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kAzted: \"x1cio8j0\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n outlined: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x133yhug\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\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 round: {\n kaIpWk: \"x1dkaolv\",\n $$css: true\n },\n text: {\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n textDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x15dekr4\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n tonalDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\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 kMv6JI: \"x1fz0g89\",\n kGuDYH: \"xkb6epg\",\n k63SB2: \"x76yrz5\",\n kOIVth: \"x1gka490\",\n kb6lSQ: \"x1s1qhaa\",\n kLWn49: \"x1voeury\",\n kAzted: \"x112cvos\",\n k8WAf4: \"xny1cbh\",\n kg3NbH: \"x1sdxjpb\",\n $$css: true\n },\n xs: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1arwny6\",\n kpsdNU: \"x1ecwmwu\",\n kEoFBp: \"x1hmns74\",\n kAzted: \"xlzjxrf\",\n k8WAf4: \"xmqoko8\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n xxl: {\n kMv6JI: \"x1vsmgmf\",\n kGuDYH: \"xh9c4x\",\n k63SB2: \"x1y15vu6\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"xoqu3bc\",\n kLWn49: \"x10x9d6x\",\n kAzted: \"xldltni\",\n k8WAf4: \"x1lrxzt4\",\n kg3NbH: \"x1dao9b2\",\n $$css: true\n }\n};\n\n// The outlined button's border thickens with the size, as the page's size\n// tokens have it: 1dp up to M, 2dp at L, 3dp at XL. A style per size rather\n// than a value in the size style, since a border on a filled button would\n// draw in the label 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// The icon each size draws, from the page's size token sets: 20dp for the\n// two small sizes, then 24, 32 and 40. The gap before it is the size's own,\n// which `base`, `xl` and `xxl` already set as the page gives them.\nconst iconSizes = {\n lg: {\n kGuDYH: \"x1pvqxga\",\n $$css: true\n },\n md: {\n kGuDYH: \"xwsyq91\",\n $$css: true\n },\n xl: {\n kGuDYH: \"x1s3cmhv\",\n $$css: true\n },\n xs: {\n kGuDYH: \"xwsyq91\",\n $$css: true\n },\n xxl: {\n kGuDYH: \"x1tgwohi\",\n $$css: true\n }\n};\n\n// Each size's inline padding again, for the one place it is read at runtime:\n// a standard ButtonGroup widening a pressed button by adding to it. The size\n// styles above write the same values.\nconst PADDINGS = {\n lg: spacing.xl,\n md: spacing.lg,\n xl: '48px',\n xs: spacing.md,\n xxl: '64px'\n};\n\n// The padding a standard group sets while it widens or narrows the button.\nconst shifted = {\n padding: (value: string) => [{\n kg3NbH: value != null ? \"x30g6up\" : value,\n $$css: true\n }, {\n \"--x-paddingInline\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(value)\n }]\n};\n\n// The square corner each size rests at, and a round toggle once selected.\nconst squareShapes = {\n lg: {\n kaIpWk: \"xhpdng0\",\n $$css: true\n },\n md: {\n kaIpWk: \"x62ce2h\",\n $$css: true\n },\n xl: {\n kaIpWk: \"x19pkqky\",\n $$css: true\n },\n xs: {\n kaIpWk: \"x62ce2h\",\n $$css: true\n },\n xxl: {\n kaIpWk: \"x19pkqky\",\n $$css: true\n }\n};\n\n// The corner each size presses to, whatever its shape. Applied after the\n// resting and selected shapes, so a press is felt whichever the button rests\n// at.\nconst pressedShapes = {\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// The interaction state layers, one style per variant for each state, applied\n// from React Aria's render state — see the header for why that and not the\n// pseudo-classes. 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. Hover lifts filled and tonal off the page and raises elevated a\n// level, and a press brings each back to where it rests.\n//\n// A toggle's containers carry a layer of their own, each the label colour\n// over that container, applied after the variant's so the variant still\n// decides the shadow. A selected toggle's keeps its forced-colours\n// `Highlight`, since a later style replaces the property whole.\nconst hovered = {\n elevated: {\n kWkggS: \"xltxkvm\",\n kGVxlE: \"x1os83gw\",\n $$css: true\n },\n elevatedToggleSelected: {\n kWkggS: \"xo1ct44 x1jzqe4\",\n $$css: true\n },\n filled: {\n kWkggS: \"xo1ct44\",\n kGVxlE: \"x19efjv6\",\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 text: {\n kWkggS: \"x659ado\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x1fctxn6\",\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x12r95rf x1jzqe4\",\n $$css: true\n }\n};\nconst focused = {\n elevated: {\n kWkggS: \"xcn1wy9\",\n $$css: true\n },\n elevatedToggleSelected: {\n kWkggS: \"xhodiby x1jzqe4\",\n $$css: true\n },\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 text: {\n kWkggS: \"x1sog3nf\",\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 elevated: {\n kWkggS: \"x1d33wxb\",\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n elevatedToggleSelected: {\n kWkggS: \"x7b25lv x1jzqe4\",\n $$css: true\n },\n filled: {\n kWkggS: \"x7b25lv\",\n kGVxlE: \"x1gnnqk1\",\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 text: {\n kWkggS: \"x1dvjsmr\",\n $$css: true\n },\n tonal: {\n kWkggS: \"xzpauq9\",\n kGVxlE: \"x1gnnqk1\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x12o6fnv x1jzqe4\",\n $$css: true\n }\n};\nconst disabledStyles = {\n elevated: styles.elevatedDisabled,\n filled: styles.filledDisabled,\n outlined: styles.outlinedDisabled,\n text: styles.textDisabled,\n tonal: styles.tonalDisabled\n};\n\n// Which container a toggle draws, selected and not, by its name in the\n// tables above. Three of the eight are the plain button's own: an unselected\n// tonal, elevated or outlined toggle is the tonal, elevated or outlined\n// button.\nconst toggleContainers = {\n elevated: {\n selected: 'elevatedToggleSelected',\n unselected: 'elevated'\n },\n filled: {\n selected: 'filledToggleSelected',\n unselected: 'filledToggle'\n },\n outlined: {\n selected: 'outlinedToggleSelected',\n unselected: 'outlined'\n },\n tonal: {\n selected: 'tonalToggleSelected',\n unselected: 'tonal'\n }\n} as const;\ntype ButtonProps = {\n children?: ReactNode;\n /** A function may compute the class from the button's render state. */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Whether a toggle starts selected, when it keeps its own state. Passing\n * this, `isSelected` or `onChange` is what makes the button a toggle —\n * except a `text` button, which the page gives no selected colours, so it\n * stays a plain button.\n */\n defaultSelected?: boolean;\n /**\n * Disables the press ripple. The hover/pressed background state layer is\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 * An icon before the label, at the page's icon size for the button's size:\n * 20px at `xs` and `md`, 24px at `lg`, 32px at `xl` and 40px at `xxl`. Draw\n * it `1em` square in `currentColor`, as every icon here is, and it follows.\n * Hidden with the label while the button is pending.\n */\n icon?: ReactNode;\n /**\n * Whether a toggle is selected, when the call site holds the state. Pass\n * it with `onChange`; passing this, `defaultSelected` or `onChange` is what\n * makes the button a toggle, `text` excepted.\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 * `text` excepted.\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 corner the button rests at: `round` is the pill, `square` the\n * page's rounded rectangle, 12px up to `md`, 16px at `lg` and 28px above.\n * Either tightens while pressed, and a toggle trades one for the other\n * once selected.\n * @default 'round'\n */\n shape?: ButtonShape;\n /**\n * Control height: `xs` 32px, `md` 40px, `lg` 56px, `xl` 96px, `xxl` 136px —\n * the buttons spec page's XS, S, M, L and XL, each with its own inline\n * padding and type role. `md` is the page's default.\n * @default 'md'\n */\n size?: ButtonSize;\n /** A function may compute the style from the button's render state. */\n style?: StyleOrFunction<ButtonState>;\n /** The link's `target`, when `href` is set. */\n target?: string;\n /**\n * How much weight the button pulls. `filled` and `tonal` carry a container\n * of their own; `outlined` and `text` sit on the page; `elevated` sits on\n * a low surface and lifts off it with a shadow, for a button that has to\n * separate from a busy background rather than from the page.\n * @default 'filled'\n */\n variant?: ButtonVariant;\n} & ButtonDOMProps;\ntype ButtonShape = 'round' | 'square';\ntype ButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl';\ntype ButtonVariant = 'elevated' | 'filled' | 'outlined' | 'text' | 'tonal';\n\n// The four styles the page gives a toggle's colour pairs; see the header.\ntype ToggleVariant = keyof typeof toggleContainers;\n\n/**\n * The design's button, at five emphasis levels and five control heights,\n * round or square. Given `href` it is a link with the same appearance. Every\n * `aria-*` prop is forwarded to the element; React Aria alone would keep only\n * 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, and a `text` button never toggles.\n *\n * ```tsx\n * <Button defaultSelected variant=\"tonal\">\n * Label\n * </Button>\n * ```\n */\nfunction Button({\n children,\n defaultSelected,\n href,\n icon,\n isPending,\n isSelected,\n onChange,\n pendingLabel,\n rel,\n shape = 'round',\n size: ownSize,\n target,\n variant = 'filled',\n ...props\n}: ButtonProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>) {\n // A ButtonGroup or a SplitButton around the button hands it a size, its\n // shape at the group's inner edges and the press interaction; 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 // A group that selects is React Aria's ToggleButtonGroup, whose buttons\n // have to be toggles to take part in its selection.\n const inSelectingGroup = useContext(ToggleGroupStateContext) !== null;\n const press = groupPressHandlers(group, props.onPressStart, props.onPressEnd);\n\n // The icon goes in with the label, inside what ButtonBase hides while the\n // button is pending, so the ring takes the place of both.\n const content = icon === undefined ? children : <>\n <span {...stylex.props(styles.icon, iconSizes[size])}>{icon}</span>\n {children}\n </>;\n\n // The three props that make this a toggle, read as IconButton reads them,\n // for every style the page gives a toggle's colours to — or a selecting\n // group around it. A text button in such a group is a toggle too, for the\n // group's sake, and draws its selection by nothing but the group's shape.\n if (inSelectingGroup || variant !== 'text' && (defaultSelected !== undefined || isSelected !== undefined || onChange !== undefined)) {\n return <ToggleButtonBase {...props} {...press} classes={variant === 'text' ? buttonClasses(shape, size, variant, group) : toggleClasses(shape, size, variant, group)} defaultSelected={defaultSelected} isPending={isPending} isSelected={isSelected} onChange={onChange}>\n {content}\n </ToggleButtonBase>;\n }\n return <ButtonBase {...props} {...press} classes={buttonClasses(shape, size, variant, group)} href={href} isPending={isPending} pendingLabel={pendingLabel} rel={rel} target={target}>\n {content}\n </ButtonBase>;\n}\n\n// The button's own classes, from React Aria's render state — see the header\n// for why that and not the pseudo-classes. Built by a call rather than\n// 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 buttonClasses(shape: ButtonShape, size: ButtonSize, variant: ButtonVariant, group: ButtonGroupItem | null) {\n return (state: ButtonState) => stylex.props(styles.base, focus.ring, styles[variant], styles[size], shape === 'square' && squareShapes[size], variant === 'outlined' && outlineWidths[size], state.isHovered && hovered[variant], state.isFocusVisible && focused[variant], state.isPressed && pressed[variant], state.isPressed && pressedShapes[size], groupStyles(group, size, state), state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]);\n}\n\n// What a group lays over the button: its own styles for the button's state,\n// and the standard group's widening or narrowing as extra inline padding,\n// half of the shift on either side.\nfunction groupStyles(group: ButtonGroupItem | null, size: ButtonSize, state: ButtonState) {\n if (group === null) {\n return null;\n }\n return [group.styles?.(state), group.shift !== 0 && shifted.padding(`calc(${PADDINGS[size]} + ${group.shift / 2}px)`)];\n}\n\n// A toggle's classes: the plain button's, with the container and its layers\n// swapped for the toggle's pair, and the selected shape between the resting\n// and the pressed one. The variant's own style and layers still go first, for\n// the shadow and the rule they carry. Built by a call for the reason\n// `buttonClasses` is.\nfunction toggleClasses(shape: ButtonShape, size: ButtonSize, variant: ToggleVariant, group: ButtonGroupItem | null) {\n return (state: ButtonState) => {\n const isSelected = state.isSelected === true;\n const container = toggleContainers[variant][isSelected ? 'selected' : 'unselected'];\n return stylex.props(styles.base, focus.ring, styles[variant], styles[container], styles[size], shape === 'square' && squareShapes[size], isSelected && (shape === 'square' ? styles.round : squareShapes[size]), variant === 'outlined' && outlineWidths[size], state.isHovered && hovered[variant], state.isHovered && hovered[container], state.isFocusVisible && focused[variant], state.isFocusVisible && focused[container], state.isPressed && pressed[variant], state.isPressed && pressed[container], state.isPressed && pressedShapes[size], groupStyles(group, size, state), state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]);\n };\n}\nexport type { ButtonDOMProps, ButtonProps, ButtonShape, ButtonSize, ButtonState, ButtonVariant };\nexport default Button;"],"mappings":";;;;;;;;;;;;AAwHA,MAAM2B,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRhB,QAAQ;EACRe,OAAO;CACT;CACAE,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,kBAAkB;EAChBH,QAAQ;EACRvB,QAAQ;EACRwB,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAO,wBAAwB;EACtBJ,QAAQ;EACRE,QAAQ;EACRL,OAAO;CACT;CACAQ,QAAQ;EACNL,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAS,gBAAgB;EACdN,QAAQ;EACRvB,QAAQ;EACRwB,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAU,cAAc;EACZP,QAAQ;EACRE,QAAQ;EACRL,OAAO;CACT;CACAW,sBAAsB;EACpBR,QAAQ;EACRE,QAAQ;EACRL,OAAO;CACT;CACAY,MAAM;EACJjC,QAAQ;EACRO,QAAQ;EACR2B,OAAO;EACPC,QAAQ;EACRd,OAAO;CACT;CACAe,IAAI;EACF5B,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRE,QAAQ;EACRC,QAAQ;EACRwB,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRlB,OAAO;CACT;CACAmB,IAAI;EACFC,QAAQ;EACRC,QAAQ;EACRC,QAAQ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,UAAU2F,MAAMM,cAAcjD,eAAeqB,QAAQ;CACzoB;AACF"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","StyleOrFunction","stylex","useContext","ToggleGroupStateContext","ButtonDOMProps","ButtonLinkForm","ButtonPressForm","ButtonState","ButtonToggleForm","ButtonGroupItem","ButtonBase","ToggleButtonBase","ButtonGroupItemContext","groupPressHandlers","useSelection","pressThen","focus","colors","motion","radii","shadows","sizing","spacing","stateLayerOpacity","typography","TARGET_SIZE","FORCED_COLORS","styles","base","kGNEyG","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kOIVth","kjj79g","kb6lSQ","kLWn49","ks0D6T","kHjlTd","kVAEAm","k9WMMc","kybGjl","kIyJzY","k1ekBW","kAMwcw","$$css","disabled","elevated","kWkggS","kGVxlE","kMwMTN","elevatedDisabled","elevatedToggleSelected","filled","filledDisabled","filledToggle","filledToggleSelected","icon","kmuXW","lg","kAzted","k8WAf4","kg3NbH","md","kgeoSG","kGOzcv","kpsdNU","kEoFBp","outlined","outlinedDisabled","outlinedToggleSelected","round","text","textDisabled","tonal","tonalDisabled","tonalToggleSelected","xl","xs","xxl","OUTLINE_WIDTHS","const","outlinedSizes","iconSizes","PADDINGS","shifted","padding","value","val","undefined","squareShapes","pressedShapes","hovered","focused","pressed","disabledStyles","toggleContainers","selected","unselected","ButtonProps","variant","Exclude","ButtonVariant","children","className","disableRipple","pendingLabel","shape","ButtonShape","size","ButtonSize","style","ToggleVariant","Button","t0","$","defaultSelected","href","isPending","isSelected","onChange","rel","t1","ownSize","target","t2","props","group","inSelectingGroup","press","onPressStart","onPressEnd","t3","selection","t4","content","t5","buttonClasses","toggleClasses","isToggle","T0","t6","t7","onPress","toggle","t8","state","ring","isHovered","isFocusVisible","isPressed","groupStyles","isDisabled","border","shift","container","Button","_c","props","stylex.props"],"sources":["../../../src/components/button/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { ToggleGroupStateContext } from 'react-aria-components';\nimport type { ButtonDOMProps, ButtonLinkForm, ButtonPressForm, ButtonState, ButtonToggleForm } 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, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// Each variant composites its label colour over its container at the\n// interaction state's opacity, rather than swapping in a separate\n// hover/pressed color: filled and tonal paint the 'on-color' over the\n// container, outlined, text and elevated paint the label colour over their\n// own. The pairs are the buttons spec page's newer values: tonal on\n// secondary container, outlined with an outline variant border and an\n// on-surface-variant label, text on primary, elevated on surface container\n// low with a primary label.\n//\n// **Elevated is the one variant whose shadow is part of its identity.** The\n// page rests it at elevation 1 rather than flat, raises it on hover and\n// returns it to 1 while pressed — where filled and tonal rest flat and lift\n// only on hover. Disabled drops it to none, since a shadow says a control is\n// available to press.\n// calc(<opacity> * 100%) turns the token's unitless 0-1 ratio into the\n// percentage color-mix() takes. Inlined rather than factored into a helper:\n// @stylexjs/babel-plugin only statically recognizes expressions written\n// directly as property values, and a call to an externally-defined function\n// isn't one of them.\n//\n// The hover, focus and pressed layers come from React Aria's render state,\n// `isHovered`, `isFocusVisible` and `isPressed`, rather than from `:hover`,\n// `:focus-visible` and `:active`. On a touch screen Chromium leaves `:hover`\n// on the last element tapped, so the layer and its lifted shadow stayed on a\n// button after the tap had ended, where React Aria ignores the emulated mouse\n// events that follow a touch. And React Aria prevents the default of the\n// keydown that presses a button with Space or Enter, so `:active` never\n// matched a keyboard press, which `isPressed` reports like any other.\n//\n// Disabled is a style of its own per variant rather than a `:disabled`\n// branch inside each property: a button given `href` renders as a link,\n// which React Aria turns into a <span> while disabled, and neither matches\n// the pseudo-class. The disabled styles are applied last from the render\n// state's `isDisabled`, and StyleX replaces a property whole, so they win\n// over any state layer applied before them.\n//\n// **Under forced colours a container is drawn as a rule.** That mode drops\n// the shadow and paints author backgrounds in a system colour, which left a\n// filled, tonal or elevated button as a label with nothing round it. `base`\n// draws a 1px `ButtonText` border there instead. Outlined keeps its own rule,\n// and text stays without one, as the page draws it. The mode repaints a\n// disabled button's fade at full strength as well. Chromium greys a disabled\n// `<button>` there by itself, but not the `<span>` React Aria renders for a\n// disabled link, so the disabled styles name `GrayText` for the label and\n// the edge rather than leave it to the browser.\n//\n// Two independent axes, applied base -> variant -> size. The variant carries\n// colour and the size carries geometry, so the two never argue: inline\n// padding belongs to the size alone, and every size declares its own.\n//\n// That is deliberate rather than incidental. The buttons page gives padding\n// per size — its Small button padding is 16dp, the 24dp beside it being the\n// older value the page marks as not recommended — and gives the five colour\n// styles no padding of their own. A text button is therefore as wide as a\n// filled one at the same size, which is what the code draws.\n//\n// This did once read the other way, with `md` declaring no padding so a\n// medium button fell through to its variant's. `fix(button)!: the spec's\n// five sizes` replaced that when the component took the page's sizes, since\n// a per-variant padding had nowhere to sit once every size carried one. The\n// comment describing the old cascade outlived it by some months, which is\n// how it came to say `text` keeps a tighter padding it has never had — back\n// then `text` declared 16dp while a filled `md` declared none at all, so the\n// text button was the wider of the two.\n//\n// **A toggle is the same button reporting a state.** Given `isSelected`,\n// `defaultSelected` or `onChange` it is React Aria's `ToggleButton`, which\n// announces the state through `aria-pressed`, as IconButton's toggle does.\n// The page gives four of the five styles a second pair of colour roles for\n// it: a filled toggle rests on surface container with an on-surface-variant\n// label and takes primary once selected, a tonal one moves from the\n// secondary container pair to secondary, an elevated one keeps its low\n// surface until it takes primary, and an outlined one swaps its rule for the\n// inverse surface pair. Under forced colours a selected toggle of any style\n// is filled `Highlight`, as IconButton's is. The page gives text no pair, so\n// a text button given those props stays a plain one.\n//\n// **The corner is a shape the button morphs between**, from the page's size\n// token sets. `round` rests as the pill and `square` at the size's square\n// corner: 12dp up to the page's S, 16dp at M and 28dp above. A press tightens\n// either to the size's pressed corner, 8dp, 12dp or 16dp, and a toggle\n// trades its shape for the other once selected — a round one for the square\n// corner, a square one for the pill. The corner eases over the motion\n// tokens' short duration, and moves at once for a reader who asks for\n// reduced motion.\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 IconButton.\n\n/**\n * The press area the buttons page requires, which its two smallest sizes are\n * drawn under. A literal rather than `sizing.controlMd`, which holds the same\n * number, for the reason IconButton's `TARGET_SIZE` gives: a consumer\n * resizing their medium controls should not shrink a target the page states\n * as a floor.\n */\nconst TARGET_SIZE = '48px';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n base: {\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 kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"x126z3so\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n ks0D6T: \"x193iq5w\",\n kHjlTd: \"xj0a0fe\",\n kVAEAm: \"x1n2onr6\",\n k9WMMc: \"x2b8uid\",\n kybGjl: \"x1hl2dhg\",\n kIyJzY: \"x1qno0dh x12w9bfk\",\n k1ekBW: \"x1hdt7lq\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n disabled: {\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n elevated: {\n kWkggS: \"x1vnz5z6\",\n kGVxlE: \"x19efjv6\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n elevatedDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n elevatedToggleSelected: {\n kWkggS: \"xnety89 x1jzqe4\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n $$css: true\n },\n filled: {\n kWkggS: \"xnety89\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n filledDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\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 icon: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n lg: {\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n kAzted: \"xdovgog\",\n k8WAf4: \"x1uvvd8r\",\n kg3NbH: \"xg0ps1x\",\n $$css: true\n },\n md: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"xun2zgk\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kAzted: \"x1cio8j0\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n outlined: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x133yhug\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\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 round: {\n kaIpWk: \"x1dkaolv\",\n $$css: true\n },\n text: {\n kWkggS: \"xjbqb8w\",\n kMzoRj: \"xc342km\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n textDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x15dekr4\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1sawysd\",\n $$css: true\n },\n tonalDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\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 kMv6JI: \"x1fz0g89\",\n kGuDYH: \"xkb6epg\",\n k63SB2: \"x76yrz5\",\n kOIVth: \"x1gka490\",\n kb6lSQ: \"x1s1qhaa\",\n kLWn49: \"x1voeury\",\n kAzted: \"x112cvos\",\n k8WAf4: \"xny1cbh\",\n kg3NbH: \"x1sdxjpb\",\n $$css: true\n },\n xs: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"xun2zgk\",\n kpsdNU: \"x1ecwmwu\",\n kEoFBp: \"x1hmns74\",\n kAzted: \"xlzjxrf\",\n k8WAf4: \"xmqoko8\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n xxl: {\n kMv6JI: \"x1vsmgmf\",\n kGuDYH: \"xh9c4x\",\n k63SB2: \"x1y15vu6\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"xoqu3bc\",\n kLWn49: \"x10x9d6x\",\n kAzted: \"xldltni\",\n k8WAf4: \"x1lrxzt4\",\n kg3NbH: \"x1dao9b2\",\n $$css: true\n }\n};\n\n// The outlined button's border thickens with the size, as the page's size\n// tokens have it: 1dp up to M, 2dp at L, 3dp at XL. A style per size rather\n// than a value in the size style, since a border on a filled button would\n// draw in the label colour.\nconst OUTLINE_WIDTHS = {\n lg: '1px',\n md: '1px',\n xl: '2px',\n xs: '1px',\n xxl: '3px'\n} as const;\n\n// The outlined button draws its rule inside the width the other variants\n// take, as the page's buttons do: the padding gives up what the border takes,\n// so an outlined and a filled button with one label are one width, and a\n// group mixing them lines up. The height needs nothing, since it is a floor\n// the border already counts towards.\nconst outlinedSizes = {\n lg: {\n kMzoRj: \"xmkeg23\",\n kg3NbH: \"xfeiziq\",\n $$css: true\n },\n md: {\n kMzoRj: \"xmkeg23\",\n kg3NbH: \"x1uvede8\",\n $$css: true\n },\n xl: {\n kMzoRj: \"xdh2fpr\",\n kg3NbH: \"xrhf21y\",\n $$css: true\n },\n xs: {\n kMzoRj: \"xmkeg23\",\n kg3NbH: \"x9t8nta\",\n $$css: true\n },\n xxl: {\n kMzoRj: \"x9r2w2z\",\n kg3NbH: \"x1wz3vkj\",\n $$css: true\n }\n};\n\n// The icon each size draws, from the page's size token sets: 20dp for the\n// two small sizes, then 24, 32 and 40. The gap before it is the size's own,\n// which `base`, `xl` and `xxl` already set as the page gives them.\nconst iconSizes = {\n lg: {\n kGuDYH: \"x1pvqxga\",\n $$css: true\n },\n md: {\n kGuDYH: \"xwsyq91\",\n $$css: true\n },\n xl: {\n kGuDYH: \"x1s3cmhv\",\n $$css: true\n },\n xs: {\n kGuDYH: \"xwsyq91\",\n $$css: true\n },\n xxl: {\n kGuDYH: \"x1tgwohi\",\n $$css: true\n }\n};\n\n// Each size's inline padding again, for the one place it is read at runtime:\n// a standard ButtonGroup widening a pressed button by adding to it. The size\n// styles above write the same values, and an outlined button's border comes\n// off them here as it does in `outlinedSizes`.\nconst PADDINGS = {\n lg: spacing.xl,\n md: spacing.lg,\n xl: '48px',\n xs: spacing.md,\n xxl: '64px'\n};\n\n// The padding a standard group sets while it widens or narrows the button.\nconst shifted = {\n padding: (value: string) => [{\n kg3NbH: value != null ? \"x30g6up\" : value,\n $$css: true\n }, {\n \"--x-paddingInline\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(value)\n }]\n};\n\n// The square corner each size rests at, and a round toggle once selected.\nconst squareShapes = {\n lg: {\n kaIpWk: \"xhpdng0\",\n $$css: true\n },\n md: {\n kaIpWk: \"x62ce2h\",\n $$css: true\n },\n xl: {\n kaIpWk: \"x19pkqky\",\n $$css: true\n },\n xs: {\n kaIpWk: \"x62ce2h\",\n $$css: true\n },\n xxl: {\n kaIpWk: \"x19pkqky\",\n $$css: true\n }\n};\n\n// The corner each size presses to, whatever its shape. Applied after the\n// resting and selected shapes, so a press is felt whichever the button rests\n// at.\nconst pressedShapes = {\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// The interaction state layers, one style per variant for each state, applied\n// from React Aria's render state — see the header for why that and not the\n// pseudo-classes. 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. Hover lifts filled and tonal off the page and raises elevated a\n// level, and a press brings each back to where it rests.\n//\n// A toggle's containers carry a layer of their own, each the label colour\n// over that container, applied after the variant's so the variant still\n// decides the shadow. A selected toggle's keeps its forced-colours\n// `Highlight`, since a later style replaces the property whole.\nconst hovered = {\n elevated: {\n kWkggS: \"xltxkvm\",\n kGVxlE: \"x1os83gw\",\n $$css: true\n },\n elevatedToggleSelected: {\n kWkggS: \"xo1ct44 x1jzqe4\",\n $$css: true\n },\n filled: {\n kWkggS: \"xo1ct44\",\n kGVxlE: \"x19efjv6\",\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 text: {\n kWkggS: \"x659ado\",\n $$css: true\n },\n tonal: {\n kWkggS: \"x1fctxn6\",\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x12r95rf x1jzqe4\",\n $$css: true\n }\n};\nconst focused = {\n elevated: {\n kWkggS: \"xcn1wy9\",\n $$css: true\n },\n elevatedToggleSelected: {\n kWkggS: \"xhodiby x1jzqe4\",\n $$css: true\n },\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 text: {\n kWkggS: \"x1sog3nf\",\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 elevated: {\n kWkggS: \"x1d33wxb\",\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n elevatedToggleSelected: {\n kWkggS: \"x7b25lv x1jzqe4\",\n $$css: true\n },\n filled: {\n kWkggS: \"x7b25lv\",\n kGVxlE: \"x1gnnqk1\",\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 text: {\n kWkggS: \"x1dvjsmr\",\n $$css: true\n },\n tonal: {\n kWkggS: \"xzpauq9\",\n kGVxlE: \"x1gnnqk1\",\n $$css: true\n },\n tonalToggleSelected: {\n kWkggS: \"x12o6fnv x1jzqe4\",\n $$css: true\n }\n};\nconst disabledStyles = {\n elevated: styles.elevatedDisabled,\n filled: styles.filledDisabled,\n outlined: styles.outlinedDisabled,\n text: styles.textDisabled,\n tonal: styles.tonalDisabled\n};\n\n// Which container a toggle draws, selected and not, by its name in the\n// tables above. Three of the eight are the plain button's own: an unselected\n// tonal, elevated or outlined toggle is the tonal, elevated or outlined\n// button.\nconst toggleContainers = {\n elevated: {\n selected: 'elevatedToggleSelected',\n unselected: 'elevated'\n },\n filled: {\n selected: 'filledToggleSelected',\n unselected: 'filledToggle'\n },\n outlined: {\n selected: 'outlinedToggleSelected',\n unselected: 'outlined'\n },\n tonal: {\n selected: 'tonalToggleSelected',\n unselected: 'tonal'\n }\n} as const;\ntype ButtonProps = ButtonDOMProps & (ButtonLinkForm | ButtonPressForm | (ButtonToggleForm & {\n /**\n * A toggle takes any variant but `text`, which the page gives no\n * selected colours.\n */\n variant?: Exclude<ButtonVariant, 'text'>;\n})) & {\n children?: ReactNode;\n /** A function may compute the class from the button's render state. */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Disables the press ripple. The hover/pressed background state layer is\n * unaffected.\n * @default false\n */\n disableRipple?: boolean;\n /**\n * An icon before the label, at the page's icon size for the button's size:\n * 20px at `xs` and `md`, 24px at `lg`, 32px at `xl` and 40px at `xxl`. Draw\n * it `1em` square in `currentColor`, as every icon here is, and it follows.\n * Hidden with the label while the button is pending.\n */\n icon?: ReactNode;\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 corner the button rests at: `round` is the pill, `square` the\n * page's rounded rectangle, 12px up to `md`, 16px at `lg` and 28px above.\n * Either tightens while pressed, and a toggle trades one for the other\n * once selected.\n * @default 'round'\n */\n shape?: ButtonShape;\n /**\n * Control height: `xs` 32px, `md` 40px, `lg` 56px, `xl` 96px, `xxl` 136px —\n * the buttons spec page's XS, S, M, L and XL, each with its own inline\n * padding and type role. `md` is the page's default.\n * @default 'md'\n */\n size?: ButtonSize;\n /** A function may compute the style from the button's render state. */\n style?: StyleOrFunction<ButtonState>;\n /**\n * How much weight the button pulls. `filled` and `tonal` carry a container\n * of their own; `outlined` and `text` sit on the page; `elevated` sits on\n * a low surface and lifts off it with a shadow, for a button that has to\n * separate from a busy background rather than from the page.\n * @default 'filled'\n */\n variant?: ButtonVariant;\n};\ntype ButtonShape = 'round' | 'square';\ntype ButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl';\ntype ButtonVariant = 'elevated' | 'filled' | 'outlined' | 'text' | 'tonal';\n\n// The four styles the page gives a toggle's colour pairs; see the header.\ntype ToggleVariant = keyof typeof toggleContainers;\n\n/**\n * The design's button, at five emphasis levels and five control heights,\n * round or square. Given `href` it is a link with the same appearance. Every\n * `aria-*` prop is forwarded to the element; React Aria alone would keep only\n * 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, and nor does a `text` toggle, which the page\n * gives no selected colours — a `text` button in a selecting `ButtonGroup`\n * is the one that toggles, for the group's sake. A toggle may be pending,\n * for a state saved somewhere slow: the ring replaces its label and a press\n * changes nothing until it clears.\n *\n * ```tsx\n * <Button defaultSelected variant=\"tonal\">\n * Label\n * </Button>\n * ```\n */\nfunction Button({\n children,\n defaultSelected,\n href,\n icon,\n isPending,\n isSelected,\n onChange,\n pendingLabel,\n rel,\n shape = 'round',\n size: ownSize,\n target,\n variant = 'filled',\n ...props\n}: ButtonProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>) {\n // A ButtonGroup or a SplitButton around the button hands it a size, its\n // shape at the group's inner edges and the press interaction; 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 // A group that selects is React Aria's ToggleButtonGroup, whose buttons\n // have to be toggles to take part in its selection.\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 // The icon goes in with the label, inside what ButtonBase hides while the\n // button is pending, so the ring takes the place of both.\n const content = icon === undefined ? children : <>\n <span {...stylex.props(styles.icon, iconSizes[size])}>{icon}</span>\n {children}\n </>;\n\n // A selecting ButtonGroup around it makes it React Aria's ToggleButton, to\n // take part in the group's selection — a text button too, which draws its\n // selection by nothing but the group's shape. Whether a button sits in one\n // does not change from one render to the next.\n if (inSelectingGroup) {\n return <ToggleButtonBase {...props} {...press} classes={variant === 'text' ? buttonClasses(shape, size, variant, group) : toggleClasses(shape, size, variant, group)} isPending={isPending}>\n {content}\n </ToggleButtonBase>;\n }\n\n // The three props that make this a toggle on its own, read as IconButton\n // reads them, and on the same component as the plain button so a toggle\n // whose `isSelected` is still loading stays one element when it arrives.\n // The types keep them off a `text` button; the check here keeps a call\n // site that slipped past them a plain button, as it always was.\n const isToggle = variant !== 'text' && (defaultSelected !== undefined || isSelected !== undefined || onChange !== undefined);\n return <ButtonBase {...props} {...press} classes={isToggle ? toggleClasses(shape, size, variant, group) : buttonClasses(shape, 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 {content}\n </ButtonBase>;\n}\n\n// The button's own classes, from React Aria's render state — see the header\n// for why that and not the pseudo-classes. Built by a call rather than\n// 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 buttonClasses(shape: ButtonShape, size: ButtonSize, variant: ButtonVariant, group: ButtonGroupItem | null) {\n return (state: ButtonState) => stylex.props(styles.base, focus.ring, styles[variant], styles[size], shape === 'square' && squareShapes[size], variant === 'outlined' && outlinedSizes[size], state.isHovered && hovered[variant], state.isFocusVisible && focused[variant], state.isPressed && pressed[variant], state.isPressed && pressedShapes[size], groupStyles(group, size, variant, state), state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]);\n}\n\n// What a group lays over the button: its own styles for the button's state,\n// and the standard group's widening or narrowing as extra inline padding,\n// half of the shift on either side.\nfunction groupStyles(group: ButtonGroupItem | null, size: ButtonSize, variant: ButtonVariant, state: ButtonState) {\n if (group === null) {\n return null;\n }\n const border = variant === 'outlined' ? OUTLINE_WIDTHS[size] : '0px';\n return [group.styles?.(state), group.shift !== 0 && shifted.padding(`calc(${PADDINGS[size]} - ${border} + ${group.shift / 2}px)`)];\n}\n\n// A toggle's classes: the plain button's, with the container and its layers\n// swapped for the toggle's pair, and the selected shape between the resting\n// and the pressed one. The variant's own style and layers still go first, for\n// the shadow and the rule they carry. Built by a call for the reason\n// `buttonClasses` is.\nfunction toggleClasses(shape: ButtonShape, size: ButtonSize, variant: ToggleVariant, group: ButtonGroupItem | null) {\n return (state: ButtonState) => {\n const isSelected = state.isSelected === true;\n const container = toggleContainers[variant][isSelected ? 'selected' : 'unselected'];\n return stylex.props(styles.base, focus.ring, styles[variant], styles[container], styles[size], shape === 'square' && squareShapes[size], isSelected && (shape === 'square' ? styles.round : squareShapes[size]), variant === 'outlined' && outlinedSizes[size], state.isHovered && hovered[variant], state.isHovered && hovered[container], state.isFocusVisible && focused[variant], state.isFocusVisible && focused[container], state.isPressed && pressed[variant], state.isPressed && pressed[container], state.isPressed && pressedShapes[size], groupStyles(group, size, variant, state), state.isDisabled && styles.disabled, state.isDisabled && disabledStyles[variant]);\n };\n}\nexport type { ButtonDOMProps, ButtonProps, ButtonShape, ButtonSize, ButtonState, ButtonVariant };\nexport default Button;"],"mappings":";;;;;;;;;;;;;;AA0HA,MAAMgC,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRlB,QAAQ;EACRiB,OAAO;CACT;CACAE,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,kBAAkB;EAChBH,QAAQ;EACRzB,QAAQ;EACR0B,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAO,wBAAwB;EACtBJ,QAAQ;EACRE,QAAQ;EACRL,OAAO;CACT;CACAQ,QAAQ;EACNL,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAS,gBAAgB;EACdN,QAAQ;EACRzB,QAAQ;EACR0B,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAU,cAAc;EACZP,QAAQ;EACRE,QAAQ;EACRL,OAAO;CAC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CAET,MAAM0B,SAASrD,YAAY,aAAapB,eAAe6B,QAAQ;CAC/D,OAAO,CAACkB,MAAM3G,SAAS8H,KAAK,GAAGnB,MAAM2B,UAAU,KAAKrE,QAAQC,QAAQ,QAAQF,SAASyB,MAAK,KAAM4C,OAAM,KAAM1B,MAAM2B,QAAQ,EAAC,IAAK,CAAC;AACnI;AAOA,SAAShB,cAAc/B,OAAoBE,MAAkBT,SAAwB2B,OAA+B;CAClH,QAAQmB,UAAuB;EAC7B,MAAM3B,aAAa2B,MAAM3B,eAAe;EACxC,MAAMoC,YAAY3D,iBAAiBI,QAAQ,CAACmB,aAAa,aAAa;EACtE,OAAO7H,MAAa0B,OAAOC,MAAMZ,MAAM0I,MAAM/H,OAAOgF,UAAUhF,OAAOuI,YAAYvI,OAAOyF,OAAOF,UAAU,YAAYjB,aAAamB,OAAOU,eAAeZ,UAAU,WAAWvF,OAAOmD,QAAQmB,aAAamB,QAAQT,YAAY,cAAclB,cAAc2B,OAAOqC,MAAME,aAAaxD,QAAQQ,UAAU8C,MAAME,aAAaxD,QAAQ+D,YAAYT,MAAMG,kBAAkBxD,QAAQO,UAAU8C,MAAMG,kBAAkBxD,QAAQ8D,YAAYT,MAAMI,aAAaxD,QAAQM,UAAU8C,MAAMI,aAAaxD,QAAQ6D,YAAYT,MAAMI,aAAa3D,cAAckB,OAAO0C,YAAYxB,OAAOlB,MAAMT,SAAS8C,KAAK,GAAGA,MAAMM,cAAcpI,OAAO0B,UAAUoG,MAAMM,cAAczD,eAAeK,QAAQ;CAClpB;AACF"}
@@ -1,20 +1,26 @@
1
1
  import { RefAttributes } from "react";
2
2
  import { CalendarProps, DateValue } from "react-aria-components";
3
3
  //#region src/components/calendar/index.d.ts
4
- type CalendarProps$1<T extends DateValue = DateValue> = Omit<CalendarProps<T>, 'children' | 'className' | 'style'> & {
4
+ type CalendarProps$1<T extends DateValue = DateValue> = {
5
5
  /** A function may compute the class from the calendar's render state. */
6
6
  className?: CalendarProps<T>['className'];
7
7
  /**
8
8
  * Whether the header draws the month and the year as menu buttons, each
9
9
  * opening a list of them in the grid's place, as the docked date picker's
10
10
  * header does, rather than one heading between the chevrons. For a date
11
- * far from the one shown, such as a date of birth.
11
+ * far from the one shown, such as a date of birth: the year list runs a
12
+ * century either side of the year shown, or to `minValue` and `maxValue`
13
+ * where they are closer.
14
+ *
15
+ * For one visible month. With `visibleDuration` of more than one, the
16
+ * header is the plain one, whose heading names every month shown — the
17
+ * menus name only the first, which would leave the others unlabelled.
12
18
  * @default false
13
19
  */
14
20
  showMonthYearMenus?: boolean;
15
21
  /** A function may compute the style from the calendar's render state. */
16
22
  style?: CalendarProps<T>['style'];
17
- };
23
+ } & Omit<CalendarProps<T>, 'children' | 'className' | 'style'>;
18
24
  /**
19
25
  * A month calendar for picking a date. The value is React Aria's: pass
20
26
  * `value` with `onChange` to control it, or `defaultValue` to let it keep its