@kanso-labs/kanso-ui 0.43.7 → 0.44.1

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 (161) hide show
  1. package/README.md +1 -0
  2. package/dist/calendar/index.js +34 -10
  3. package/dist/calendar/index.js.map +1 -1
  4. package/dist/calendar/styles.js +30 -0
  5. package/dist/calendar/styles.js.map +1 -1
  6. package/dist/chip/index.js +27 -18
  7. package/dist/chip/index.js.map +1 -1
  8. package/dist/chip/label.js +32 -0
  9. package/dist/chip/label.js.map +1 -0
  10. package/dist/chip/styles.js +32 -2
  11. package/dist/chip/styles.js.map +1 -1
  12. package/dist/collection/text.js +24 -3
  13. package/dist/collection/text.js.map +1 -1
  14. package/dist/components/app-bar/index.d.ts +9 -5
  15. package/dist/components/app-bar/index.js +400 -170
  16. package/dist/components/app-bar/index.js.map +1 -1
  17. package/dist/components/button/index.js.map +1 -1
  18. package/dist/components/calendar/index.d.ts +8 -1
  19. package/dist/components/calendar/index.js +129 -73
  20. package/dist/components/calendar/index.js.map +1 -1
  21. package/dist/components/checkbox/index.js +31 -31
  22. package/dist/components/checkbox/index.js.map +1 -1
  23. package/dist/components/checkbox-group/index.js +4 -2
  24. package/dist/components/checkbox-group/index.js.map +1 -1
  25. package/dist/components/chip/index.js +1 -1
  26. package/dist/components/chip/index.js.map +1 -1
  27. package/dist/components/chip-group/index.d.ts +35 -5
  28. package/dist/components/chip-group/index.js +137 -97
  29. package/dist/components/chip-group/index.js.map +1 -1
  30. package/dist/components/copy-field/index.js +1 -1
  31. package/dist/components/copy-field/index.js.map +1 -1
  32. package/dist/components/currency/index.d.ts +64 -6
  33. package/dist/components/currency/index.js +117 -40
  34. package/dist/components/currency/index.js.map +1 -1
  35. package/dist/components/date-picker/index.js +1 -1
  36. package/dist/components/dialog/index.d.ts +3 -1
  37. package/dist/components/dialog/index.js +115 -81
  38. package/dist/components/dialog/index.js.map +1 -1
  39. package/dist/components/disclosure-group/index.js +1 -1
  40. package/dist/components/disclosure-group/index.js.map +1 -1
  41. package/dist/components/icon-button/index.js +18 -1
  42. package/dist/components/icon-button/index.js.map +1 -1
  43. package/dist/components/index.d.ts +2 -2
  44. package/dist/components/keycap/index.d.ts +3 -0
  45. package/dist/components/keycap/index.js +30 -44
  46. package/dist/components/keycap/index.js.map +1 -1
  47. package/dist/components/list/index.d.ts +16 -2
  48. package/dist/components/list/index.js +124 -69
  49. package/dist/components/list/index.js.map +1 -1
  50. package/dist/components/list-detail/index.d.ts +11 -3
  51. package/dist/components/list-detail/index.js +13 -6
  52. package/dist/components/list-detail/index.js.map +1 -1
  53. package/dist/components/list-item/index.d.ts +16 -1
  54. package/dist/components/list-item/index.js.map +1 -1
  55. package/dist/components/menu/index.d.ts +6 -2
  56. package/dist/components/menu/index.js +22 -15
  57. package/dist/components/menu/index.js.map +1 -1
  58. package/dist/components/meter/index.d.ts +4 -1
  59. package/dist/components/meter/index.js +6 -0
  60. package/dist/components/meter/index.js.map +1 -1
  61. package/dist/components/navigation-bar/index.d.ts +14 -4
  62. package/dist/components/navigation-bar/index.js +77 -50
  63. package/dist/components/navigation-bar/index.js.map +1 -1
  64. package/dist/components/navigation-rail/index.d.ts +3 -2
  65. package/dist/components/navigation-rail/index.js +59 -52
  66. package/dist/components/navigation-rail/index.js.map +1 -1
  67. package/dist/components/navigation-tree/index.js +4 -1
  68. package/dist/components/navigation-tree/index.js.map +1 -1
  69. package/dist/components/number-field/index.d.ts +3 -2
  70. package/dist/components/number-field/index.js +91 -115
  71. package/dist/components/number-field/index.js.map +1 -1
  72. package/dist/components/popover/index.d.ts +3 -1
  73. package/dist/components/popover/index.js +102 -100
  74. package/dist/components/popover/index.js.map +1 -1
  75. package/dist/components/progress-indicator/index.d.ts +4 -2
  76. package/dist/components/progress-indicator/index.js +4 -3
  77. package/dist/components/progress-indicator/index.js.map +1 -1
  78. package/dist/components/radio-group/index.js +34 -24
  79. package/dist/components/radio-group/index.js.map +1 -1
  80. package/dist/components/search-field/index.d.ts +11 -1
  81. package/dist/components/search-field/index.js +32 -28
  82. package/dist/components/search-field/index.js.map +1 -1
  83. package/dist/components/segmented-button/index.d.ts +9 -2
  84. package/dist/components/segmented-button/index.js +1 -1
  85. package/dist/components/segmented-button/index.js.map +1 -1
  86. package/dist/components/separator/index.d.ts +19 -7
  87. package/dist/components/separator/index.js +36 -13
  88. package/dist/components/separator/index.js.map +1 -1
  89. package/dist/components/sheet/index.js +29 -25
  90. package/dist/components/sheet/index.js.map +1 -1
  91. package/dist/components/snackbar/index.d.ts +4 -1
  92. package/dist/components/snackbar/index.js +140 -55
  93. package/dist/components/snackbar/index.js.map +1 -1
  94. package/dist/components/stack/index.d.ts +6 -3
  95. package/dist/components/stack/index.js +48 -31
  96. package/dist/components/stack/index.js.map +1 -1
  97. package/dist/components/switch/index.d.ts +16 -6
  98. package/dist/components/switch/index.js +116 -62
  99. package/dist/components/switch/index.js.map +1 -1
  100. package/dist/components/text-area/index.d.ts +10 -1
  101. package/dist/components/text-area/index.js +21 -19
  102. package/dist/components/text-area/index.js.map +1 -1
  103. package/dist/components/text-field/index.d.ts +16 -2
  104. package/dist/components/text-field/index.js +49 -43
  105. package/dist/components/text-field/index.js.map +1 -1
  106. package/dist/components/time-picker/index.js +1 -1
  107. package/dist/components/tooltip/index.d.ts +3 -1
  108. package/dist/components/tooltip/index.js.map +1 -1
  109. package/dist/components/tree/index.d.ts +15 -3
  110. package/dist/components/tree/index.js +41 -28
  111. package/dist/components/tree/index.js.map +1 -1
  112. package/dist/control/index.js +26 -23
  113. package/dist/control/index.js.map +1 -1
  114. package/dist/control/styles.js +7 -1
  115. package/dist/control/styles.js.map +1 -1
  116. package/dist/field/index.js +220 -193
  117. package/dist/field/index.js.map +1 -1
  118. package/dist/field/styles.js +64 -8
  119. package/dist/field/styles.js.map +1 -1
  120. package/dist/glyphs/index.js +37 -1
  121. package/dist/glyphs/index.js.map +1 -1
  122. package/dist/hooks/useClippedTitle.js +44 -0
  123. package/dist/hooks/useClippedTitle.js.map +1 -0
  124. package/dist/hooks/useRipple.js +7 -6
  125. package/dist/hooks/useRipple.js.map +1 -1
  126. package/dist/hooks/useScrollStop.js +133 -0
  127. package/dist/hooks/useScrollStop.js.map +1 -0
  128. package/dist/i18n/index.js +1 -0
  129. package/dist/i18n/index.js.map +1 -1
  130. package/dist/i18n/messages.js +34 -0
  131. package/dist/i18n/messages.js.map +1 -1
  132. package/dist/index.d.ts +2 -2
  133. package/dist/indicator/index.js +18 -16
  134. package/dist/indicator/index.js.map +1 -1
  135. package/dist/indicator/styles.js +3 -0
  136. package/dist/indicator/styles.js.map +1 -1
  137. package/dist/keycap/context.js +7 -0
  138. package/dist/keycap/context.js.map +1 -0
  139. package/dist/layout.d.ts +4 -1
  140. package/dist/layout.js +4 -1
  141. package/dist/layout.js.map +1 -1
  142. package/dist/navigation/index.d.ts +16 -2
  143. package/dist/navigation/index.js +145 -44
  144. package/dist/navigation/index.js.map +1 -1
  145. package/dist/navigation/styles.js +79 -16
  146. package/dist/navigation/styles.js.map +1 -1
  147. package/dist/row/index.js +92 -89
  148. package/dist/row/index.js.map +1 -1
  149. package/dist/row/styles.js +26 -2
  150. package/dist/row/styles.js.map +1 -1
  151. package/dist/styles/overlay.d.ts +6 -2
  152. package/dist/styles/overlay.js +4 -1
  153. package/dist/styles/overlay.js.map +1 -1
  154. package/dist/styles.css +296 -38
  155. package/dist/theme-scope.d.ts +5 -1
  156. package/dist/theme-scope.js +100 -51
  157. package/dist/theme-scope.js.map +1 -1
  158. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  159. package/package.json +21 -20
  160. package/dist/hooks/useScrollable.js +0 -69
  161. package/dist/hooks/useScrollable.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","DOMRenderFunction","StyleOrFunction","stylex","useContext","ToggleGroupStateContext","ButtonClassesState","ButtonDOMProps","ButtonForm","ButtonState","ButtonGroupItem","ButtonBase","ToggleButtonBase","ButtonGroupItemContext","groupPressHandlers","useSelection","pressThen","focus","colors","motion","radii","sizing","stateLayerOpacity","FORCED_COLORS","TARGET_SIZE","styles","base","kGNEyG","kVAM5u","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","pending","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","roundShapes","kaIpWk","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 { ButtonClassesState, 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 transitioned properties take two\n// curves — the container, icon and rule colours the standard one, the corner\n// and a group's change of width the emphasized one — so the timing functions\n// are a matching comma list rather than one value. All of them move at once\n// for a reader who asks for reduced motion.\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// The circle is half the button's edge as a length, not the pill token's\n// 9999px. The browser draws a corner no larger than half the box but eases\n// the value as written, so from 9999px a press spent all but the last frame\n// or two of its 150ms above the 20dp a medium button can show: the corner\n// held round and then jumped. Nor is it 50%, which a standard ButtonGroup\n// would stretch into an ellipse as it narrows the buttons beside a pressed\n// one, where a length still draws their ends round.\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 kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1ylmb6m\",\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: \"x1pvxwa0 x12w9bfk\",\n k1ekBW: \"x1ss3tkz\",\n kAMwcw: \"xcviomn\",\n $$css: true\n },\n disabled: {\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 kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x1fh0d6s\",\n $$css: true\n },\n md: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x1q69gdh\",\n kEoFBp: \"x1hmns74\",\n kZKoxP: \"x1rv7mn0\",\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 pending: {\n kkrTdU: \"x19v85br\",\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 kGuDYH: \"x1s3cmhv\",\n kzqmXN: \"xszbqgh\",\n $$css: true\n },\n xs: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x1n6cgzf\",\n kEoFBp: \"x1hmns74\",\n kZKoxP: \"xig8zya\",\n kGuDYH: \"xwsyq91\",\n kzqmXN: \"x11ts1a5\",\n $$css: true\n },\n xxl: {\n kZKoxP: \"x173yhrv\",\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 circle each size rests at: half its edge, written as a length rather\n// than as the pill token's 9999px or as 50% — see the header. `min()` leaves\n// the pill token in charge below that, so a scheme that sets\n// `--kui-radius-pill` small still draws its icon buttons at that corner.\n// Applied after the size's style, and again for a disabled button, which\n// keeps its circle whether or not a press is still held.\nconst roundShapes = {\n lg: {\n kaIpWk: \"x1j5kmnq\",\n $$css: true\n },\n md: {\n kaIpWk: \"x1y5wlyh\",\n $$css: true\n },\n xl: {\n kaIpWk: \"x39tcx0\",\n $$css: true\n },\n xs: {\n kaIpWk: \"xcslhsm\",\n $$css: true\n },\n xxl: {\n kaIpWk: \"xjy9rn5\",\n $$css: true\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 a disabled\n// button'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: ButtonClassesState) => stylex.props(styles.base, focus.ring, styles[variant], styles[size], roundShapes[size], variant === 'outlined' && outlineWidths[size], state.isHovered && hovered[variant], state.isFocusVisible && focused[variant], state.isPressed && pressed[variant], state.isPressed && selectedShapes[size], state.isPending === true && styles.pending, state.isDisabled && styles.disabled, state.isDisabled && roundShapes[size], 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: ButtonClassesState) => {\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], roundShapes[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.isPending === true && styles.pending, state.isDisabled && styles.disabled, state.isDisabled && roundShapes[size], 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":";;;;;;;;;;;;;;AA+GA,MAAM6B,SAAS;CACbC,MAAM;EACJC,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;EACRX,QAAQ;EACRU,OAAO;CACT;CACAE,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,gBAAgB;EACdF,QAAQ;EACRjB,QAAQ;EACRkB,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;EACRC,QAAQ;EACRC,QAAQ;EACRX,OAAO;CACT;CACAY,IAAI;EACFC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRN,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRX,OAAO;CACT;CACAgB,UAAU;EACRb,QAAQ;EACRjB,QAAQ;EACRC,QAAQ;EACRiB,QAAQ;EACRJ,OAAO;CACT;CACAiB,kBAAkB;EAChBd,QAAQ;EACRjB,QAAQ;EACRkB,QAAQ;EACRJ,OAAO;CACT;CACAkB,wBAAwB;EACtBf,QAAQ;EACRjB,QAAQ;EACRkB,QAAQ;EACRJ,OAAO;CACT;CACAmB,SAAS;EACP7B,QAAQ;EACRU,OAAO;CACT;CACAoB,UAAU;EACRjB,QAAQ;EACRf,QAAQ;EACRgB,QAAQ;E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B,OAAOQ,MAAMmC,cAAcnD,eAAeW,UAAUK,MAAMQ,eAAe,QAAQ9B,eAAec,OAAOM,YAAYC,OAAOP,MAAMQ,KAAK,CAAC;CACxe;AACF"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","DOMRenderFunction","StyleOrFunction","stylex","useContext","ToggleGroupStateContext","ButtonClassesState","ButtonDOMProps","ButtonForm","ButtonState","ButtonGroupItem","ButtonBase","ToggleButtonBase","ButtonGroupItemContext","groupPressHandlers","useSelection","pressThen","focus","colors","motion","radii","sizing","stateLayerOpacity","FORCED_COLORS","TARGET_SIZE","styles","base","kGNEyG","kVAM5u","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","outlinedToggleSelectedDisabled","pending","standard","standardDisabled","standardToggleSelected","standardToggleSelectedDisabled","tonal","tonalDisabled","tonalToggleSelected","xl","xs","xxl","hovered","focused","pressed","outlineWidths","EDGES","controlLg","controlSm","controlXl","controlXs","controlXxl","_temp","shifted","width","value","val","undefined","roundShapes","kaIpWk","selectedShapes","toggleStyles","selected","unselected","toggleContainers","const","disabledStyles","selectedDisabledStyles","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 { ButtonClassesState, 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// **The outlined rule is faint on purpose.** Outline variant sits at about\n// 1.6:1 against the surface in the light theme and 2:1 in the dark, under the\n// 3:1 WCAG asks of a boundary that identifies a control. The rule is not that\n// boundary: the icon identifies the button, in on-surface-variant at about\n// 9:1, and the rule only shows how far the button reaches. Button's outlined\n// variant draws its rule in the same role for the same reason.\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 transitioned properties take two\n// curves — the container, icon and rule colours the standard one, the corner\n// and a group's change of width the emphasized one — so the timing functions\n// are a matching comma list rather than one value. All of them move at once\n// for a reader who asks for reduced motion.\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// The circle is half the button's edge as a length, not the pill token's\n// 9999px. The browser draws a corner no larger than half the box but eases\n// the value as written, so from 9999px a press spent all but the last frame\n// or two of its 150ms above the 20dp a medium button can show: the corner\n// held round and then jumped. Nor is it 50%, which a standard ButtonGroup\n// would stretch into an ellipse as it narrows the buttons beside a pressed\n// one, where a length still draws their ends round.\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// **A disabled toggle keeps an edge for its corner to show on.** Disabled,\n// every variant takes one grey, so the corner it rests at is what tells a\n// chosen toggle from an unchosen one, and a corner shows only where\n// something is drawn round it. Filled and tonal keep their disabled\n// container, and an unchosen outlined toggle its disabled rule. A chosen\n// outlined toggle trades its rule for a container, which the disabled style\n// cleared, so it takes on-surface at the disabled-container opacity, where\n// Material Design's own tokens give that state a faint on-surface container\n// too. A chosen standard\n// toggle takes the same faint container over nothing. That departs from the\n// page, which draws a standard toggle with no container in any state, and\n// it is the one way the two states of a disabled standard toggle differ at\n// all. Under forced colours, which paint both containers over, the chosen\n// outlined toggle keeps its `GrayText` rule and the chosen standard one\n// draws one, in place of the rule its variant otherwise goes without.\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 kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1ylmb6m\",\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: \"x1pvxwa0 x12w9bfk\",\n k1ekBW: \"x1ss3tkz\",\n kAMwcw: \"xcviomn\",\n $$css: true\n },\n disabled: {\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 kGuDYH: \"x1pvqxga\",\n kzqmXN: \"x1fh0d6s\",\n $$css: true\n },\n md: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x1q69gdh\",\n kEoFBp: \"x1hmns74\",\n kZKoxP: \"x1rv7mn0\",\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 outlinedToggleSelectedDisabled: {\n kWkggS: \"xepofeg\",\n $$css: true\n },\n pending: {\n kkrTdU: \"x19v85br\",\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 standardToggleSelectedDisabled: {\n kWkggS: \"x19v6zzp\",\n kVAM5u: \"xmnqt3w\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\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 kGuDYH: \"x1s3cmhv\",\n kzqmXN: \"xszbqgh\",\n $$css: true\n },\n xs: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x1n6cgzf\",\n kEoFBp: \"x1hmns74\",\n kZKoxP: \"xig8zya\",\n kGuDYH: \"xwsyq91\",\n kzqmXN: \"x11ts1a5\",\n $$css: true\n },\n xxl: {\n kZKoxP: \"x173yhrv\",\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 circle each size rests at: half its edge, written as a length rather\n// than as the pill token's 9999px or as 50% — see the header. `min()` leaves\n// the pill token in charge below that, so a scheme that sets\n// `--kui-radius-pill` small still draws its icon buttons at that corner.\n// Applied after the size's style, and again for a disabled button, which\n// keeps its circle whether or not a press is still held.\nconst roundShapes = {\n lg: {\n kaIpWk: \"x1j5kmnq\",\n $$css: true\n },\n md: {\n kaIpWk: \"x1y5wlyh\",\n $$css: true\n },\n xl: {\n kaIpWk: \"x39tcx0\",\n $$css: true\n },\n xs: {\n kaIpWk: \"xcslhsm\",\n $$css: true\n },\n xxl: {\n kaIpWk: \"xjy9rn5\",\n $$css: true\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 a disabled\n// button'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};\n\n// What a chosen toggle adds once disabled, over its variant's disabled style,\n// so its corner keeps an edge to show on — see the header. Filled and tonal\n// add nothing, since their disabled container already is one.\nconst selectedDisabledStyles = {\n filled: null,\n outlined: styles.outlinedToggleSelectedDisabled,\n standard: styles.standardToggleSelectedDisabled,\n tonal: null\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: ButtonClassesState) => stylex.props(styles.base, focus.ring, styles[variant], styles[size], roundShapes[size], variant === 'outlined' && outlineWidths[size], state.isHovered && hovered[variant], state.isFocusVisible && focused[variant], state.isPressed && pressed[variant], state.isPressed && selectedShapes[size], state.isPending === true && styles.pending, state.isDisabled && styles.disabled, state.isDisabled && roundShapes[size], 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. A chosen toggle's disabled edge\n// comes after them for the same reason.\nfunction toggleStyleProps(size: IconButtonSize, variant: IconButtonVariant, group: ButtonGroupItem | null) {\n return (state: ButtonClassesState) => {\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], roundShapes[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.isPending === true && styles.pending, state.isDisabled && styles.disabled, state.isDisabled && roundShapes[size], state.isDisabled && disabledStyles[variant], state.isDisabled && state.isSelected === true && selectedDisabledStyles[variant], state.isSelected === true && selectedShapes[size], groupStyles(group, size, state));\n };\n}\nexport type { IconButtonProps, IconButtonSize, IconButtonState, IconButtonVariant };\nexport default IconButton;"],"mappings":";;;;;;;;;;;;;;AAsIA,MAAM6B,SAAS;CACbC,MAAM;EACJC,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;EACRX,QAAQ;EACRU,OAAO;CACT;CACAE,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,gBAAgB;EACdF,QAAQ;EACRjB,QAAQ;EACRkB,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;EACRC,QAAQ;EACRC,QAAQ;EACRX,OAAO;CACT;CACAY,IAAI;EACFC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRN,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRX,OAAO;CACT;CACAgB,UAAU;EACRb,QAAQ;EACRjB,QAAQ;EACRC,QAAQ;EACRiB,QAAQ;EACRJ,OAAO;CACT;CACAiB,kBAAkB;EAChBd,QAAQ;EACRjB,QAAQ;EACRkB,QAAQ;E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AAasB,OAAOC,MAAMT,MAAMgI,MAAM/B,MAAMQ,eAAe,OAAO9B,aAAaiB,QAAQ,CAAChB,WAAWD,aAAaiB,QAAQ,CAACf,YAAYrE,OAAOiF,OAAOjB,YAAYiB,OAGtKG,YAAY,cAAcK,MAAMQ,eAAe,QAAQ9C,cAAc8B,OAAOQ,MAAMgC,aAAazE,QAAQ6E,YAAYpC,MAAMiC,kBAAkBzE,QAAQ4E,YAAYpC,MAAMkC,aAAazE,QAAQ2E,YAAYpC,MAAMkC,aAAazD,eAAee,OAAOQ,MAAMO,cAAc,QAAQhG,OAAOqC,SAASoD,MAAMmC,cAAc5H,OAAOkB,UAAUuE,MAAMmC,cAAc5D,YAAYiB,OAAOQ,MAAMmC,cAAcpD,eAAeY,UAAUK,MAAMmC,cAAcnC,MAAMQ,eAAe,QAAQxB,uBAAuBW,UAAUK,MAAMQ,eAAe,QAAQ/B,eAAee,OAAOM,YAAYC,OAAOP,MAAMQ,KAAK,CAAC;CAC1jB;AACF"}
@@ -26,7 +26,7 @@ import ColorWheel, { ColorWheelProps } from "./color-wheel/index.js";
26
26
  import ComboBox, { ComboBoxProps, ComboBoxSelectionMode } from "./combo-box/index.js";
27
27
  import Container, { ContainerProps } from "./container/index.js";
28
28
  import CopyField, { CopyFieldProps } from "./copy-field/index.js";
29
- import Currency, { CurrencyProps, CurrencySignDisplay, CurrencyTone } from "./currency/index.js";
29
+ import Currency, { CurrencyDisplay, CurrencyNotation, CurrencyProps, CurrencySignDisplay, CurrencyTone } from "./currency/index.js";
30
30
  import DateField, { DateFieldProps } from "./date-field/index.js";
31
31
  import DatePicker, { DatePickerProps } from "./date-picker/index.js";
32
32
  import DateRangePicker, { DateRangePickerProps } from "./date-range-picker/index.js";
@@ -82,4 +82,4 @@ import TokenField, { TokenFieldProps, TokenSegment } from "./token-field/index.j
82
82
  import Toolbar, { ToolbarProps, ToolbarTone } from "./toolbar/index.js";
83
83
  import Tooltip, { TooltipAlign, TooltipProps, TooltipSide } from "./tooltip/index.js";
84
84
  import Tree, { TreeItem, TreeItemProps, TreeLoadMore, TreeLoadMoreProps, TreeProps, TreeSection, TreeSectionProps } from "./tree/index.js";
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 };
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 CurrencyDisplay, type CurrencyNotation, 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 };
@@ -5,6 +5,9 @@ type KeycapProps = RenderComponentProps<'kbd'>;
5
5
  * A single key on a keyboard, as named in an instruction — `Enter`, `Esc`,
6
6
  * `Ctrl`. It renders a `<kbd>` and takes its scale from the text around it. A
7
7
  * chord is several of these, combined at the call site.
8
+ *
9
+ * In a menu item's `shortcut` it follows the item: while the item is selected
10
+ * or disabled, its text and its rule take the item's colour.
8
11
  */
9
12
  declare function Keycap({ render, ...props }: KeycapProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
10
13
  //#endregion
@@ -1,63 +1,49 @@
1
1
  "use client";
2
2
  import { useRender } from "../../render/useRender.js";
3
3
  import { mergeStyles } from "../../styles/merge.js";
4
+ import { KeycapToneContext } from "../../keycap/context.js";
4
5
  import { c } from "react/compiler-runtime";
6
+ import { useContext } from "react";
5
7
  //#region src/components/keycap/index.tsx
6
8
  /**
7
9
  * A single key on a keyboard, as named in an instruction — `Enter`, `Esc`,
8
10
  * `Ctrl`. It renders a `<kbd>` and takes its scale from the text around it. A
9
11
  * chord is several of these, combined at the call site.
12
+ *
13
+ * In a menu item's `shortcut` it follows the item: while the item is selected
14
+ * or disabled, its text and its rule take the item's colour.
10
15
  */
11
16
  function Keycap(t0) {
12
- const $ = c(13);
13
- let render;
14
- let t1;
15
- let t2;
17
+ const $ = c(6);
18
+ const { render, ...props } = t0;
19
+ const tone = useContext(KeycapToneContext);
20
+ const t1 = "kbd";
21
+ const t2 = mergeStyles({
22
+ 0: { className: "xjbqb8w x1fwvt7v x1tfhd1 x1y0btm7 xmkeg23 x9f619 x139gbkf x1rg5ohu xbppi91 xuegzgz x37zpob xt970qd xdomwbk xuxw1ft" },
23
+ 1: { className: "xjbqb8w x1tfhd1 x1y0btm7 xmkeg23 x9f619 x1rg5ohu xbppi91 xuegzgz x37zpob xt970qd xdomwbk xuxw1ft x1r7ld26 x1heor9g" }
24
+ }[!!(tone === "inherit") << 0], props);
16
25
  let t3;
17
- let t4;
18
- if ($[0] !== t0) {
19
- const { render: t5, ...props } = t0;
20
- render = t5;
21
- t4 = useRender;
22
- t3 = "kbd";
23
- t1 = props;
24
- t2 = mergeStyles({ className: "xjbqb8w x1fwvt7v x1tfhd1 x1y0btm7 xmkeg23 x9f619 x139gbkf x1rg5ohu xbppi91 xuegzgz x37zpob xt970qd xdomwbk xuxw1ft" }, props);
25
- $[0] = t0;
26
- $[1] = render;
27
- $[2] = t1;
28
- $[3] = t2;
29
- $[4] = t3;
30
- $[5] = t4;
31
- } else {
32
- render = $[1];
33
- t1 = $[2];
34
- t2 = $[3];
35
- t3 = $[4];
36
- t4 = $[5];
37
- }
38
- let t5;
39
- if ($[6] !== t1 || $[7] !== t2) {
40
- t5 = {
41
- ...t1,
26
+ if ($[0] !== props || $[1] !== t2) {
27
+ t3 = {
28
+ ...props,
42
29
  ...t2
43
30
  };
44
- $[6] = t1;
45
- $[7] = t2;
46
- $[8] = t5;
47
- } else t5 = $[8];
48
- let t6;
49
- if ($[9] !== render || $[10] !== t3 || $[11] !== t5) {
50
- t6 = {
51
- defaultTagName: t3,
52
- props: t5,
31
+ $[0] = props;
32
+ $[1] = t2;
33
+ $[2] = t3;
34
+ } else t3 = $[2];
35
+ let t4;
36
+ if ($[3] !== render || $[4] !== t3) {
37
+ t4 = {
38
+ defaultTagName: t1,
39
+ props: t3,
53
40
  render
54
41
  };
55
- $[9] = render;
56
- $[10] = t3;
57
- $[11] = t5;
58
- $[12] = t6;
59
- } else t6 = $[12];
60
- return t4(t6);
42
+ $[3] = render;
43
+ $[4] = t3;
44
+ $[5] = t4;
45
+ } else t4 = $[5];
46
+ return useRender(t4);
61
47
  }
62
48
  //#endregion
63
49
  export { Keycap as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","stylex","RenderComponentProps","useRender","mergeStyles","colors","radii","spacing","typography","KeycapProps","Keycap","t0","$","render","t1","t2","t3","t4","t5","props","className","t6","defaultTagName","_c"],"sources":["../../../src/components/keycap/index.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// Named for the physical thing it draws rather than for the element it\n// renders. `Kbd` would match the tag, but a component library is read by\n// people writing call sites, not markup, and `Key` in that setting is already\n// spoken for several times over — an API key, an object key, React's own key\n// prop. A keycap is unambiguously the one on a keyboard.\n//\n// Sized in em for the same reason Code is: a key named inside a footnote and\n// one named inside a paragraph are the same component. The ratio is smaller\n// than Code's because the border adds height that the glyphs do not, and\n// matching Code's 0.875 leaves a keycap standing taller than the line it\n// sits in.\n//\n// Transparent rather than filled, so a keycap inside a Card or a Sheet does\n// not read as a nested surface. The border alone carries the metaphor.\n//\n// No Material Design page draws a keycap. Its rule is the assist chip's, 1dp\n// in the outline role around a label. Its size is the text's, as above, and\n// its corner is the extra-small step of the shape scale rather than the\n// chip's small one, since a box the height of a line has no room for 8dp.\n\ntype KeycapProps = RenderComponentProps<'kbd'>;\n\n/**\n * A single key on a keyboard, as named in an instruction — `Enter`, `Esc`,\n * `Ctrl`. It renders a `<kbd>` and takes its scale from the text around it. A\n * chord is several of these, combined at the call site.\n */\nfunction Keycap({\n render,\n ...props\n}: KeycapProps) {\n return useRender({\n defaultTagName: 'kbd',\n props: {\n ...props,\n ...m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;AAAC"}
1
+ {"version":3,"file":"index.js","names":["c","_c","stylex","useContext","RenderComponentProps","KeycapToneContext","useRender","mergeStyles","colors","radii","spacing","typography","KeycapProps","Keycap","t0","$","render","props","tone","t1","t2","0","className","1","t3","t4","defaultTagName","_c"],"sources":["../../../src/components/keycap/index.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { KeycapToneContext } from '../../keycap/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// Named for the physical thing it draws rather than for the element it\n// renders. `Kbd` would match the tag, but a component library is read by\n// people writing call sites, not markup, and `Key` in that setting is already\n// spoken for several times over — an API key, an object key, React's own key\n// prop. A keycap is unambiguously the one on a keyboard.\n//\n// Sized in em for the same reason Code is: a key named inside a footnote and\n// one named inside a paragraph are the same component. The ratio is smaller\n// than Code's because the border adds height that the glyphs do not, and\n// matching Code's 0.875 leaves a keycap standing taller than the line it\n// sits in.\n//\n// Transparent rather than filled, so a keycap inside a Card or a Sheet does\n// not read as a nested surface. The border alone carries the metaphor.\n//\n// No Material Design page draws a keycap. Its rule is the assist chip's, 1dp\n// in the outline role around a label. Its size is the text's, as above, and\n// its corner is the extra-small step of the shape scale rather than the\n// chip's small one, since a box the height of a line has no room for 8dp.\n//\n// Inside a selected or disabled menu item's shortcut it draws in the\n// shortcut's colour instead, its rule included, through a context the item\n// provides — see `KeycapToneContext`. Its own on surface would otherwise\n// stay dark on a row that has faded, and its own colours do not belong on\n// the selected container, which brings an on-colour of its own.\n\ntype KeycapProps = RenderComponentProps<'kbd'>;\n\n/**\n * A single key on a keyboard, as named in an instruction — `Enter`, `Esc`,\n * `Ctrl`. It renders a `<kbd>` and takes its scale from the text around it. A\n * chord is several of these, combined at the call site.\n *\n * In a menu item's `shortcut` it follows the item: while the item is selected\n * or disabled, its text and its rule take the item's colour.\n */\nfunction Keycap({\n render,\n ...props\n}: KeycapProps) {\n const tone = useContext(KeycapToneContext);\n return useRender({\n defaultTagName: 'kbd',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"xjbqb8w x1fwvt7v x1tfhd1 x1y0btm7 xmkeg23 x9f619 x139gbkf x1rg5ohu xbppi91 xuegzgz x37zpob xt970qd xdomwbk xuxw1ft\"\n },\n 1: {\n className: \"xjbqb8w x1tfhd1 x1y0btm7 xmkeg23 x9f619 x1rg5ohu xbppi91 xuegzgz x37zpob xt970qd xdomwbk xuxw1ft x1r7ld26 x1heor9g\"\n }\n }[!!(tone === 'inherit') << 0], props)\n },\n render\n });\n}\nexport type { KeycapProps };\nexport default Keycap;"],"mappings":";;;;;;;;;;;;;;;AA+CA,SAAAa,OAAAC,IAAA;CAAA,MAAAC,IAAAd,EAAA,CAAA;CAAgB,MAAA,EAAAe,QAAA,GAAAC,UAAAH;CAId,MAAAI,OAAaf,WAAWE,iBAAiB;CAEvB,MAAAc,KAAA;CAGX,MAAAC,KAAAb,YAAY;EAAAc,GACV,EAAAC,WACU,qHACb;EAACC,GACE,EAAAD,WACU,qHACb;CACF,EAAE,CAAC,EAAEJ,SAAS,cAAc,IAAID,KAAK;CAAC,IAAAO;CAAA,IAAAT,EAAA,OAAAE,SAAAF,EAAA,OAAAK,IAAA;EATjCI,KAAA;GAAA,GACFP;GAAK,GACLG;EAQL;EAACL,EAAA,KAAAE;EAAAF,EAAA,KAAAK;EAAAL,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,OAAAC,UAAAD,EAAA,OAAAS,IAAA;EAZcC,KAAA;GAAAC,gBACCP;GAAKF,OACdO;GAUNR;EAEH;EAACD,EAAA,KAAAC;EAAAD,EAAA,KAAAS;EAAAT,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAdMT,UAAUmB,EAchB;AAAC"}
@@ -13,6 +13,16 @@ type ListLoadMoreProps = Omit<GridListLoadMoreItemProps, 'children'> & {
13
13
  type ListProps<T extends object = object> = {
14
14
  /** A function may compute the class from the list's render state. */
15
15
  className?: GridListProps<T>['className'];
16
+ /**
17
+ * How a press selects. `toggle` draws a checkbox on every row, and a press
18
+ * adds that row to the selection or takes it out. `replace` draws none, a
19
+ * press makes that row the selection, and the arrow keys carry the
20
+ * selection with the focus; where rows also take an action, a click
21
+ * selects and a double click acts. Left out, a `single` list replaces and
22
+ * any other toggles, since a single choice drawn as checkboxes unticks one
23
+ * box whenever another is ticked.
24
+ */
25
+ selectionBehavior?: GridListProps<T>['selectionBehavior'];
16
26
  /**
17
27
  * What each row's selection checkbox is called, for a screen reader. The
18
28
  * row's own text is what names the row; this names the box inside it.
@@ -22,7 +32,7 @@ type ListProps<T extends object = object> = {
22
32
  selectLabel?: string;
23
33
  /** A function may compute the style from the list's render state. */
24
34
  style?: GridListProps<T>['style'];
25
- } & Omit<GridListProps<T>, 'className' | 'style'>;
35
+ } & Omit<GridListProps<T>, 'className' | 'selectionBehavior' | 'style'>;
26
36
  type ListRowProps<T extends object = object> = {
27
37
  /** The row's headline — the one thing it is mostly about. */
28
38
  children?: ReactNode;
@@ -63,6 +73,10 @@ type ListSectionProps<T extends object = object> = Omit<GridListSectionProps<T>,
63
73
  * `defaultSelectedKeys` to let it keep its own. A list that only responds to
64
74
  * a press takes `onAction` on the row instead.
65
75
  *
76
+ * A `multiple` list draws a checkbox on every row. A `single` one draws none
77
+ * and marks the chosen row alone, since a checkbox promises a choice that
78
+ * leaves the others standing; `selectionBehavior` overrides either.
79
+ *
66
80
  * ListItem is the static row — one row, presenting, on its own. This is the
67
81
  * collection that draws the same row and adds selection, keyboard navigation
68
82
  * between rows, sections and a load-more sentinel.
@@ -74,7 +88,7 @@ type ListSectionProps<T extends object = object> = Omit<GridListSectionProps<T>,
74
88
  * The call site's `className` and `style` land on the container, which is
75
89
  * the element a layout positions.
76
90
  */
77
- declare function List<T extends object>({ selectLabel, ...props }: ListProps<T> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
91
+ declare function List<T extends object>({ selectionBehavior, selectLabel, ...props }: ListProps<T> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
78
92
  declare namespace List {
79
93
  var Item: typeof ListRow;
80
94
  var LoadMore: typeof ListLoadMore;