@react-spectrum/s2 3.0.0-nightly-4baa1b08e-241029 → 3.0.0-nightly-dcc0752f8-241031

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 (270) hide show
  1. package/dist/ActionButton.cjs +10 -32
  2. package/dist/ActionButton.cjs.map +1 -1
  3. package/dist/ActionButton.css +20 -60
  4. package/dist/ActionButton.css.map +1 -1
  5. package/dist/ActionButton.mjs +10 -32
  6. package/dist/ActionButton.mjs.map +1 -1
  7. package/dist/Avatar.cjs +2 -4
  8. package/dist/Avatar.cjs.map +1 -1
  9. package/dist/Avatar.css +4 -16
  10. package/dist/Avatar.css.map +1 -1
  11. package/dist/Avatar.mjs +2 -4
  12. package/dist/Avatar.mjs.map +1 -1
  13. package/dist/Badge.cjs +5 -16
  14. package/dist/Badge.cjs.map +1 -1
  15. package/dist/Badge.css +10 -30
  16. package/dist/Badge.css.map +1 -1
  17. package/dist/Badge.mjs +5 -16
  18. package/dist/Badge.mjs.map +1 -1
  19. package/dist/Breadcrumbs.cjs +12 -41
  20. package/dist/Breadcrumbs.cjs.map +1 -1
  21. package/dist/Breadcrumbs.css +38 -86
  22. package/dist/Breadcrumbs.css.map +1 -1
  23. package/dist/Breadcrumbs.mjs +12 -41
  24. package/dist/Breadcrumbs.mjs.map +1 -1
  25. package/dist/Button.cjs +19 -59
  26. package/dist/Button.cjs.map +1 -1
  27. package/dist/Button.css +37 -113
  28. package/dist/Button.css.map +1 -1
  29. package/dist/Button.mjs +19 -59
  30. package/dist/Button.mjs.map +1 -1
  31. package/dist/Card.cjs +27 -67
  32. package/dist/Card.cjs.map +1 -1
  33. package/dist/Card.css +42 -117
  34. package/dist/Card.css.map +1 -1
  35. package/dist/Card.mjs +27 -67
  36. package/dist/Card.mjs.map +1 -1
  37. package/dist/Checkbox.cjs +9 -27
  38. package/dist/Checkbox.cjs.map +1 -1
  39. package/dist/Checkbox.css +17 -49
  40. package/dist/Checkbox.css.map +1 -1
  41. package/dist/Checkbox.mjs +9 -27
  42. package/dist/Checkbox.mjs.map +1 -1
  43. package/dist/CheckboxGroup.cjs +5 -16
  44. package/dist/CheckboxGroup.cjs.map +1 -1
  45. package/dist/CheckboxGroup.css +10 -30
  46. package/dist/CheckboxGroup.css.map +1 -1
  47. package/dist/CheckboxGroup.mjs +5 -16
  48. package/dist/CheckboxGroup.mjs.map +1 -1
  49. package/dist/ClearButton.cjs +6 -17
  50. package/dist/ClearButton.cjs.map +1 -1
  51. package/dist/ClearButton.css +11 -35
  52. package/dist/ClearButton.css.map +1 -1
  53. package/dist/ClearButton.mjs +6 -17
  54. package/dist/ClearButton.mjs.map +1 -1
  55. package/dist/CloseButton.cjs +10 -32
  56. package/dist/CloseButton.cjs.map +1 -1
  57. package/dist/CloseButton.css +20 -64
  58. package/dist/CloseButton.css.map +1 -1
  59. package/dist/CloseButton.mjs +10 -32
  60. package/dist/CloseButton.mjs.map +1 -1
  61. package/dist/ColorArea.cjs +4 -16
  62. package/dist/ColorArea.cjs.map +1 -1
  63. package/dist/ColorArea.css +8 -28
  64. package/dist/ColorArea.css.map +1 -1
  65. package/dist/ColorArea.mjs +4 -16
  66. package/dist/ColorArea.mjs.map +1 -1
  67. package/dist/ColorField.cjs +5 -16
  68. package/dist/ColorField.cjs.map +1 -1
  69. package/dist/ColorField.css +10 -30
  70. package/dist/ColorField.css.map +1 -1
  71. package/dist/ColorField.mjs +5 -16
  72. package/dist/ColorField.mjs.map +1 -1
  73. package/dist/ColorHandle.cjs +5 -15
  74. package/dist/ColorHandle.cjs.map +1 -1
  75. package/dist/ColorHandle.css +10 -30
  76. package/dist/ColorHandle.css.map +1 -1
  77. package/dist/ColorHandle.mjs +5 -15
  78. package/dist/ColorHandle.mjs.map +1 -1
  79. package/dist/ColorSlider.cjs +6 -17
  80. package/dist/ColorSlider.cjs.map +1 -1
  81. package/dist/ColorSlider.css +34 -50
  82. package/dist/ColorSlider.css.map +1 -1
  83. package/dist/ColorSlider.mjs +6 -17
  84. package/dist/ColorSlider.mjs.map +1 -1
  85. package/dist/ColorSwatch.cjs +8 -26
  86. package/dist/ColorSwatch.cjs.map +1 -1
  87. package/dist/ColorSwatch.css +16 -52
  88. package/dist/ColorSwatch.css.map +1 -1
  89. package/dist/ColorSwatch.mjs +8 -26
  90. package/dist/ColorSwatch.mjs.map +1 -1
  91. package/dist/ColorSwatchPicker.cjs +6 -16
  92. package/dist/ColorSwatchPicker.cjs.map +1 -1
  93. package/dist/ColorSwatchPicker.css +8 -28
  94. package/dist/ColorSwatchPicker.css.map +1 -1
  95. package/dist/ColorSwatchPicker.mjs +6 -16
  96. package/dist/ColorSwatchPicker.mjs.map +1 -1
  97. package/dist/ComboBox.cjs +23 -72
  98. package/dist/ComboBox.cjs.map +1 -1
  99. package/dist/ComboBox.css +64 -152
  100. package/dist/ComboBox.css.map +1 -1
  101. package/dist/ComboBox.mjs +24 -73
  102. package/dist/ComboBox.mjs.map +1 -1
  103. package/dist/ContextualHelp.cjs +1 -1
  104. package/dist/ContextualHelp.css +2 -6
  105. package/dist/ContextualHelp.css.map +1 -1
  106. package/dist/ContextualHelp.mjs +1 -1
  107. package/dist/Dialog.cjs +2 -2
  108. package/dist/Dialog.css +2 -2
  109. package/dist/Dialog.mjs +2 -2
  110. package/dist/Disclosure.cjs +22 -61
  111. package/dist/Disclosure.cjs.map +1 -1
  112. package/dist/Disclosure.css +47 -91
  113. package/dist/Disclosure.css.map +1 -1
  114. package/dist/Disclosure.mjs +22 -61
  115. package/dist/Disclosure.mjs.map +1 -1
  116. package/dist/DropZone.cjs +2 -4
  117. package/dist/DropZone.cjs.map +1 -1
  118. package/dist/DropZone.css +4 -16
  119. package/dist/DropZone.css.map +1 -1
  120. package/dist/DropZone.mjs +2 -4
  121. package/dist/DropZone.mjs.map +1 -1
  122. package/dist/Field.cjs +16 -47
  123. package/dist/Field.cjs.map +1 -1
  124. package/dist/Field.css +31 -95
  125. package/dist/Field.css.map +1 -1
  126. package/dist/Field.mjs +16 -47
  127. package/dist/Field.mjs.map +1 -1
  128. package/dist/IllustratedMessage.cjs +6 -20
  129. package/dist/IllustratedMessage.cjs.map +1 -1
  130. package/dist/IllustratedMessage.css +10 -24
  131. package/dist/IllustratedMessage.css.map +1 -1
  132. package/dist/IllustratedMessage.mjs +6 -20
  133. package/dist/IllustratedMessage.mjs.map +1 -1
  134. package/dist/Image.cjs +2 -2
  135. package/dist/Image.css +2 -2
  136. package/dist/Image.mjs +2 -2
  137. package/dist/InlineAlert.cjs +2 -5
  138. package/dist/InlineAlert.cjs.map +1 -1
  139. package/dist/InlineAlert.css +11 -15
  140. package/dist/InlineAlert.css.map +1 -1
  141. package/dist/InlineAlert.mjs +2 -5
  142. package/dist/InlineAlert.mjs.map +1 -1
  143. package/dist/Menu.cjs +23 -68
  144. package/dist/Menu.cjs.map +1 -1
  145. package/dist/Menu.css +32 -96
  146. package/dist/Menu.css.map +1 -1
  147. package/dist/Menu.mjs +24 -69
  148. package/dist/Menu.mjs.map +1 -1
  149. package/dist/Meter.cjs +22 -68
  150. package/dist/Meter.cjs.map +1 -1
  151. package/dist/Meter.css +63 -139
  152. package/dist/Meter.css.map +1 -1
  153. package/dist/Meter.mjs +22 -68
  154. package/dist/Meter.mjs.map +1 -1
  155. package/dist/Modal.cjs +2 -2
  156. package/dist/Modal.css +2 -2
  157. package/dist/Modal.mjs +2 -2
  158. package/dist/NumberField.cjs +23 -71
  159. package/dist/NumberField.cjs.map +1 -1
  160. package/dist/NumberField.css +63 -146
  161. package/dist/NumberField.css.map +1 -1
  162. package/dist/NumberField.mjs +23 -71
  163. package/dist/NumberField.mjs.map +1 -1
  164. package/dist/Picker.cjs +24 -68
  165. package/dist/Picker.cjs.map +1 -1
  166. package/dist/Picker.css +50 -130
  167. package/dist/Picker.css.map +1 -1
  168. package/dist/Picker.mjs +25 -69
  169. package/dist/Picker.mjs.map +1 -1
  170. package/dist/ProgressBar.cjs +23 -69
  171. package/dist/ProgressBar.cjs.map +1 -1
  172. package/dist/ProgressBar.css +64 -140
  173. package/dist/ProgressBar.css.map +1 -1
  174. package/dist/ProgressBar.mjs +23 -69
  175. package/dist/ProgressBar.mjs.map +1 -1
  176. package/dist/ProgressCircle.cjs +6 -20
  177. package/dist/ProgressCircle.cjs.map +1 -1
  178. package/dist/ProgressCircle.css +12 -40
  179. package/dist/ProgressCircle.css.map +1 -1
  180. package/dist/ProgressCircle.mjs +6 -20
  181. package/dist/ProgressCircle.mjs.map +1 -1
  182. package/dist/Provider.css +7 -0
  183. package/dist/Provider.css.map +1 -1
  184. package/dist/Radio.cjs +8 -26
  185. package/dist/Radio.cjs.map +1 -1
  186. package/dist/Radio.css +16 -48
  187. package/dist/Radio.css.map +1 -1
  188. package/dist/Radio.mjs +8 -26
  189. package/dist/Radio.mjs.map +1 -1
  190. package/dist/RadioGroup.cjs +5 -16
  191. package/dist/RadioGroup.cjs.map +1 -1
  192. package/dist/RadioGroup.css +10 -30
  193. package/dist/RadioGroup.css.map +1 -1
  194. package/dist/RadioGroup.mjs +5 -16
  195. package/dist/RadioGroup.mjs.map +1 -1
  196. package/dist/SearchField.cjs +5 -16
  197. package/dist/SearchField.cjs.map +1 -1
  198. package/dist/SearchField.css +10 -30
  199. package/dist/SearchField.css.map +1 -1
  200. package/dist/SearchField.mjs +5 -16
  201. package/dist/SearchField.mjs.map +1 -1
  202. package/dist/SegmentedControl.cjs +8 -14
  203. package/dist/SegmentedControl.cjs.map +1 -1
  204. package/dist/SegmentedControl.css +9 -29
  205. package/dist/SegmentedControl.css.map +1 -1
  206. package/dist/SegmentedControl.mjs +8 -14
  207. package/dist/SegmentedControl.mjs.map +1 -1
  208. package/dist/Slider.cjs +63 -196
  209. package/dist/Slider.cjs.map +1 -1
  210. package/dist/Slider.css +61 -181
  211. package/dist/Slider.css.map +1 -1
  212. package/dist/Slider.mjs +63 -196
  213. package/dist/Slider.mjs.map +1 -1
  214. package/dist/StatusLight.cjs +9 -27
  215. package/dist/StatusLight.cjs.map +1 -1
  216. package/dist/StatusLight.css +17 -49
  217. package/dist/StatusLight.css.map +1 -1
  218. package/dist/StatusLight.mjs +9 -27
  219. package/dist/StatusLight.mjs.map +1 -1
  220. package/dist/Switch.cjs +6 -15
  221. package/dist/Switch.cjs.map +1 -1
  222. package/dist/Switch.css +10 -26
  223. package/dist/Switch.css.map +1 -1
  224. package/dist/Switch.mjs +6 -15
  225. package/dist/Switch.mjs.map +1 -1
  226. package/dist/TableView.cjs +42 -86
  227. package/dist/TableView.cjs.map +1 -1
  228. package/dist/TableView.css +65 -129
  229. package/dist/TableView.css.map +1 -1
  230. package/dist/TableView.mjs +42 -86
  231. package/dist/TableView.mjs.map +1 -1
  232. package/dist/Tabs.cjs +4 -15
  233. package/dist/Tabs.cjs.map +1 -1
  234. package/dist/Tabs.css +18 -34
  235. package/dist/Tabs.css.map +1 -1
  236. package/dist/Tabs.mjs +4 -15
  237. package/dist/Tabs.mjs.map +1 -1
  238. package/dist/TagGroup.cjs +14 -37
  239. package/dist/TagGroup.cjs.map +1 -1
  240. package/dist/TagGroup.css +23 -67
  241. package/dist/TagGroup.css.map +1 -1
  242. package/dist/TagGroup.mjs +14 -37
  243. package/dist/TagGroup.mjs.map +1 -1
  244. package/dist/TextField.cjs +11 -34
  245. package/dist/TextField.cjs.map +1 -1
  246. package/dist/TextField.css +22 -66
  247. package/dist/TextField.css.map +1 -1
  248. package/dist/TextField.mjs +11 -34
  249. package/dist/TextField.mjs.map +1 -1
  250. package/dist/Tooltip.cjs +2 -4
  251. package/dist/Tooltip.cjs.map +1 -1
  252. package/dist/Tooltip.css +4 -12
  253. package/dist/Tooltip.css.map +1 -1
  254. package/dist/Tooltip.mjs +2 -4
  255. package/dist/Tooltip.mjs.map +1 -1
  256. package/dist/types.d.ts +2 -2
  257. package/dist/types.d.ts.map +1 -1
  258. package/package.json +17 -17
  259. package/page.css +7 -0
  260. package/src/ComboBox.tsx +3 -3
  261. package/src/Menu.tsx +5 -5
  262. package/src/Picker.tsx +3 -3
  263. package/src/page.macro.ts +11 -0
  264. package/style/dist/spectrum-theme.cjs +2 -8
  265. package/style/dist/spectrum-theme.cjs.map +1 -1
  266. package/style/dist/spectrum-theme.mjs +2 -8
  267. package/style/dist/spectrum-theme.mjs.map +1 -1
  268. package/style/dist/types.d.ts +1 -4
  269. package/style/dist/types.d.ts.map +1 -1
  270. package/style/spectrum-theme.ts +4 -4
package/dist/Badge.css CHANGED
@@ -321,24 +321,24 @@
321
321
  --iconPrimary: currentColor;
322
322
  }
323
323
 
324
- .-_375tou_o-q {
325
- --o: 2rem;
324
+ .-_375tou_o-j {
325
+ --o: calc(2rem * var(--s2-scale));
326
326
  }
327
327
 
328
- .-_375tou_o-k {
329
- --o: 1.25rem;
328
+ .-_375tou_o-g {
329
+ --o: calc(1.25rem * var(--s2-scale));
330
330
  }
331
331
 
332
- .-_375tou_o-m {
333
- --o: 1.5rem;
332
+ .-_375tou_o-h {
333
+ --o: calc(1.5rem * var(--s2-scale));
334
334
  }
335
335
 
336
- .-_375tou_o-r {
337
- --o: 2.5rem;
336
+ .-_375tou_o-l {
337
+ --o: calc(2.5rem * var(--s2-scale));
338
338
  }
339
339
 
340
- .-_375tou_o-x {
341
- --o: 3rem;
340
+ .-_375tou_o-n {
341
+ --o: calc(3rem * var(--s2-scale));
342
342
  }
343
343
 
344
344
  .-_375tp0_u-c {
@@ -471,26 +471,6 @@
471
471
  .jbH {
472
472
  column-gap: .470588em;
473
473
  }
474
-
475
- .-_375tou_o-br {
476
- --o: 2.5rem;
477
- }
478
-
479
- .-_375tou_o-bl {
480
- --o: 1.5625rem;
481
- }
482
-
483
- .-_375tou_o-bn {
484
- --o: 1.875rem;
485
- }
486
-
487
- .-_375tou_o-bu {
488
- --o: 3.125rem;
489
- }
490
-
491
- .-_375tou_o-by {
492
- --o: 3.75rem;
493
- }
494
474
  }
495
475
  }
496
476
 
@@ -1 +1 @@
1
- {"mappings":"ACsDc;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;E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":["@import \"08c4d7ffd2baa021\";\n@import \"1aad76937c73131b\";\n@import \"7989dc282effbbd8\";\n@import \"a50d3ac159f93c2b\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {SkeletonWrapper} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface BadgeStyleProps {\n /**\n * The size of the badge.\n *\n * @default 'S'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The variant changes the background color of the badge. When badge has a semantic meaning, they should use the variant for semantic colors.\n *\n * @default 'neutral'\n */\n variant?: 'accent' | 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'gray' | 'red' | 'orange' | 'yellow' | 'charteuse' | 'celery' | 'green' | 'seafoam' | 'cyan' | 'blue' | 'indigo' | 'purple' | 'fuchsia' | 'magenta' | 'pink' | 'turquoise' | 'brown' | 'cinnamon' | 'silver',\n /**\n * The fill of the badge.\n * @default 'bold'\n */\n fillStyle?: 'bold' | 'subtle' | 'outline'\n}\n\nexport interface BadgeProps extends DOMProps, AriaLabelingProps, StyleProps, BadgeStyleProps, SlotProps {\n /**\n * The content to display in the badge.\n */\n children: ReactNode\n}\n\nexport const BadgeContext = createContext<ContextValue<Partial<BadgeProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst badge = style<BadgeStyleProps>({\n display: 'flex',\n font: 'control',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 'control',\n minHeight: 'control',\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]:only-child)': 0\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n aspectRatio: {\n ':has([slot=icon]:only-child)': 'square'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n ':has([slot=icon]:only-child)': 0\n }\n },\n columnGap: 'text-to-visual',\n color: {\n fillStyle: {\n bold: {\n default: 'white',\n variant: {\n notice: 'black',\n orange: 'black',\n yellow: 'black',\n charteuse: 'black',\n celery: 'black'\n }\n },\n subtle: 'gray-1000',\n outline: 'gray-1000'\n }\n },\n backgroundColor: {\n fillStyle: {\n bold: {\n variant: {\n accent: 'accent',\n informative: 'informative',\n neutral: 'neutral-subdued',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n gray: 'gray',\n red: 'red',\n orange: 'orange',\n yellow: 'yellow',\n charteuse: 'chartreuse',\n celery: 'celery',\n green: 'green',\n seafoam: 'seafoam',\n cyan: 'cyan',\n blue: 'blue',\n indigo: 'indigo',\n purple: 'purple',\n fuchsia: 'fuchsia',\n magenta: 'magenta',\n pink: 'pink',\n turquoise: 'turquoise',\n brown: 'brown',\n cinnamon: 'cinnamon',\n silver: 'silver'\n }\n },\n subtle: {\n variant: {\n accent: 'accent-subtle',\n informative: 'informative-subtle',\n neutral: 'neutral-subtle',\n positive: 'positive-subtle',\n notice: 'notice-subtle',\n negative: 'negative-subtle',\n gray: 'gray-subtle',\n red: 'red-subtle',\n orange: 'orange-subtle',\n yellow: 'yellow-subtle',\n charteuse: 'chartreuse-subtle',\n celery: 'celery-subtle',\n green: 'green-subtle',\n seafoam: 'seafoam-subtle',\n cyan: 'cyan-subtle',\n blue: 'blue-subtle',\n indigo: 'indigo-subtle',\n purple: 'purple-subtle',\n fuchsia: 'fuchsia-subtle',\n magenta: 'magenta-subtle',\n pink: 'pink-subtle',\n turquoise: 'turquoise-subtle',\n brown: 'brown-subtle',\n cinnamon: 'cinnamon-subtle',\n silver: 'silver-subtle'\n }\n },\n outline: 'layer-2'\n }\n },\n borderStyle: 'solid',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderColor: {\n default: 'transparent',\n fillStyle: {\n outline: {\n variant: {\n accent: lightDark('accent-800', 'accent-900'), // accent-visual-color\n informative: lightDark('informative-800', 'informative-900'), // informative-visual-color\n neutral: lightDark('gray-500', 'gray-600'), // neutral-visual-color\n positive: lightDark('positive-800', 'positive-900'), // positive-visual-color\n notice: lightDark('notice-800', 'notice-900'), // notice-visual-color\n negative: lightDark('negative-800', 'negative-900') // negative-visual-color\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nfunction Badge(props: BadgeProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BadgeContext);\n let {\n children,\n variant = 'neutral',\n size = 'S',\n fillStyle = 'bold',\n ...otherProps\n } = props; // useProviderProps(props) in v3\n let domRef = useDOMRef(ref);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <Provider\n values={[\n [TextContext, {styles: style({paddingY: '--labelPadding', order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n <SkeletonWrapper>\n <span\n {...filterDOMProps(otherProps)}\n role=\"presentation\"\n className={(props.UNSAFE_className || '') + badge({variant, size, fillStyle}, props.styles)}\n style={props.UNSAFE_style}\n ref={domRef}>\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </span>\n </SkeletonWrapper>\n </Provider>\n );\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nlet _Badge = forwardRef(Badge);\nexport {_Badge as Badge};\n"],"names":[],"version":3,"file":"Badge.css.map"}
1
+ {"mappings":"ACsDc;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAgJiB;;;;EAAA;;;;EAAA;;;;EAEyB;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnJJ;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAgJiB","sources":["31052c90be0d94da","packages/@react-spectrum/s2/src/Badge.tsx"],"sourcesContent":["@import \"08c4d7ffd2baa021\";\n@import \"1aad76937c73131b\";\n@import \"7989dc282effbbd8\";\n@import \"a50d3ac159f93c2b\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {SkeletonWrapper} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface BadgeStyleProps {\n /**\n * The size of the badge.\n *\n * @default 'S'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The variant changes the background color of the badge. When badge has a semantic meaning, they should use the variant for semantic colors.\n *\n * @default 'neutral'\n */\n variant?: 'accent' | 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'gray' | 'red' | 'orange' | 'yellow' | 'charteuse' | 'celery' | 'green' | 'seafoam' | 'cyan' | 'blue' | 'indigo' | 'purple' | 'fuchsia' | 'magenta' | 'pink' | 'turquoise' | 'brown' | 'cinnamon' | 'silver',\n /**\n * The fill of the badge.\n * @default 'bold'\n */\n fillStyle?: 'bold' | 'subtle' | 'outline'\n}\n\nexport interface BadgeProps extends DOMProps, AriaLabelingProps, StyleProps, BadgeStyleProps, SlotProps {\n /**\n * The content to display in the badge.\n */\n children: ReactNode\n}\n\nexport const BadgeContext = createContext<ContextValue<Partial<BadgeProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst badge = style<BadgeStyleProps>({\n display: 'flex',\n font: 'control',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 'control',\n minHeight: 'control',\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]:only-child)': 0\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n aspectRatio: {\n ':has([slot=icon]:only-child)': 'square'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n ':has([slot=icon]:only-child)': 0\n }\n },\n columnGap: 'text-to-visual',\n color: {\n fillStyle: {\n bold: {\n default: 'white',\n variant: {\n notice: 'black',\n orange: 'black',\n yellow: 'black',\n charteuse: 'black',\n celery: 'black'\n }\n },\n subtle: 'gray-1000',\n outline: 'gray-1000'\n }\n },\n backgroundColor: {\n fillStyle: {\n bold: {\n variant: {\n accent: 'accent',\n informative: 'informative',\n neutral: 'neutral-subdued',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n gray: 'gray',\n red: 'red',\n orange: 'orange',\n yellow: 'yellow',\n charteuse: 'chartreuse',\n celery: 'celery',\n green: 'green',\n seafoam: 'seafoam',\n cyan: 'cyan',\n blue: 'blue',\n indigo: 'indigo',\n purple: 'purple',\n fuchsia: 'fuchsia',\n magenta: 'magenta',\n pink: 'pink',\n turquoise: 'turquoise',\n brown: 'brown',\n cinnamon: 'cinnamon',\n silver: 'silver'\n }\n },\n subtle: {\n variant: {\n accent: 'accent-subtle',\n informative: 'informative-subtle',\n neutral: 'neutral-subtle',\n positive: 'positive-subtle',\n notice: 'notice-subtle',\n negative: 'negative-subtle',\n gray: 'gray-subtle',\n red: 'red-subtle',\n orange: 'orange-subtle',\n yellow: 'yellow-subtle',\n charteuse: 'chartreuse-subtle',\n celery: 'celery-subtle',\n green: 'green-subtle',\n seafoam: 'seafoam-subtle',\n cyan: 'cyan-subtle',\n blue: 'blue-subtle',\n indigo: 'indigo-subtle',\n purple: 'purple-subtle',\n fuchsia: 'fuchsia-subtle',\n magenta: 'magenta-subtle',\n pink: 'pink-subtle',\n turquoise: 'turquoise-subtle',\n brown: 'brown-subtle',\n cinnamon: 'cinnamon-subtle',\n silver: 'silver-subtle'\n }\n },\n outline: 'layer-2'\n }\n },\n borderStyle: 'solid',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderColor: {\n default: 'transparent',\n fillStyle: {\n outline: {\n variant: {\n accent: lightDark('accent-800', 'accent-900'), // accent-visual-color\n informative: lightDark('informative-800', 'informative-900'), // informative-visual-color\n neutral: lightDark('gray-500', 'gray-600'), // neutral-visual-color\n positive: lightDark('positive-800', 'positive-900'), // positive-visual-color\n notice: lightDark('notice-800', 'notice-900'), // notice-visual-color\n negative: lightDark('negative-800', 'negative-900') // negative-visual-color\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nfunction Badge(props: BadgeProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BadgeContext);\n let {\n children,\n variant = 'neutral',\n size = 'S',\n fillStyle = 'bold',\n ...otherProps\n } = props; // useProviderProps(props) in v3\n let domRef = useDOMRef(ref);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <Provider\n values={[\n [TextContext, {styles: style({paddingY: '--labelPadding', order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n <SkeletonWrapper>\n <span\n {...filterDOMProps(otherProps)}\n role=\"presentation\"\n className={(props.UNSAFE_className || '') + badge({variant, size, fillStyle}, props.styles)}\n style={props.UNSAFE_style}\n ref={domRef}>\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </span>\n </SkeletonWrapper>\n </Provider>\n );\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nlet _Badge = forwardRef(Badge);\nexport {_Badge as Badge};\n"],"names":[],"version":3,"file":"Badge.css.map"}
package/dist/Badge.mjs CHANGED
@@ -180,22 +180,11 @@ const $6357025487dea614$var$badge = function anonymous(props, overrides) {
180
180
  else if (props.variant === "accent") rules += ' c-1n5lxsq';
181
181
  } else rules += ' ca';
182
182
  rules += ' -rwx0fg_e-b';
183
- if (props.size === "XL") {
184
- rules += ' -_375tou_o-by';
185
- rules += ' -_375tou_o-x';
186
- } else if (props.size === "L") {
187
- rules += ' -_375tou_o-bu';
188
- rules += ' -_375tou_o-r';
189
- } else if (props.size === "S") {
190
- rules += ' -_375tou_o-bn';
191
- rules += ' -_375tou_o-m';
192
- } else if (props.size === "XS") {
193
- rules += ' -_375tou_o-bl';
194
- rules += ' -_375tou_o-k';
195
- } else {
196
- rules += ' -_375tou_o-br';
197
- rules += ' -_375tou_o-q';
198
- }
183
+ if (props.size === "XL") rules += ' -_375tou_o-n';
184
+ else if (props.size === "L") rules += ' -_375tou_o-l';
185
+ else if (props.size === "S") rules += ' -_375tou_o-h';
186
+ else if (props.size === "XS") rules += ' -_375tou_o-g';
187
+ else rules += ' -_375tou_o-j';
199
188
  rules += ' -_375tp0_u-c';
200
189
  rules += ' -_375tp1_v-c';
201
190
  return rules;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;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Aa,YAAY,2BAC5B,gBAAC,CAAA,GAAA,yCAAG;8BAAG;qBACP;;;;AAMhB;AAEA;;CAEC,GACD,IAAI,0DAAS,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Badge.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {SkeletonWrapper} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface BadgeStyleProps {\n /**\n * The size of the badge.\n *\n * @default 'S'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The variant changes the background color of the badge. When badge has a semantic meaning, they should use the variant for semantic colors.\n *\n * @default 'neutral'\n */\n variant?: 'accent' | 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'gray' | 'red' | 'orange' | 'yellow' | 'charteuse' | 'celery' | 'green' | 'seafoam' | 'cyan' | 'blue' | 'indigo' | 'purple' | 'fuchsia' | 'magenta' | 'pink' | 'turquoise' | 'brown' | 'cinnamon' | 'silver',\n /**\n * The fill of the badge.\n * @default 'bold'\n */\n fillStyle?: 'bold' | 'subtle' | 'outline'\n}\n\nexport interface BadgeProps extends DOMProps, AriaLabelingProps, StyleProps, BadgeStyleProps, SlotProps {\n /**\n * The content to display in the badge.\n */\n children: ReactNode\n}\n\nexport const BadgeContext = createContext<ContextValue<Partial<BadgeProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst badge = style<BadgeStyleProps>({\n display: 'flex',\n font: 'control',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 'control',\n minHeight: 'control',\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]:only-child)': 0\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n aspectRatio: {\n ':has([slot=icon]:only-child)': 'square'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n ':has([slot=icon]:only-child)': 0\n }\n },\n columnGap: 'text-to-visual',\n color: {\n fillStyle: {\n bold: {\n default: 'white',\n variant: {\n notice: 'black',\n orange: 'black',\n yellow: 'black',\n charteuse: 'black',\n celery: 'black'\n }\n },\n subtle: 'gray-1000',\n outline: 'gray-1000'\n }\n },\n backgroundColor: {\n fillStyle: {\n bold: {\n variant: {\n accent: 'accent',\n informative: 'informative',\n neutral: 'neutral-subdued',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n gray: 'gray',\n red: 'red',\n orange: 'orange',\n yellow: 'yellow',\n charteuse: 'chartreuse',\n celery: 'celery',\n green: 'green',\n seafoam: 'seafoam',\n cyan: 'cyan',\n blue: 'blue',\n indigo: 'indigo',\n purple: 'purple',\n fuchsia: 'fuchsia',\n magenta: 'magenta',\n pink: 'pink',\n turquoise: 'turquoise',\n brown: 'brown',\n cinnamon: 'cinnamon',\n silver: 'silver'\n }\n },\n subtle: {\n variant: {\n accent: 'accent-subtle',\n informative: 'informative-subtle',\n neutral: 'neutral-subtle',\n positive: 'positive-subtle',\n notice: 'notice-subtle',\n negative: 'negative-subtle',\n gray: 'gray-subtle',\n red: 'red-subtle',\n orange: 'orange-subtle',\n yellow: 'yellow-subtle',\n charteuse: 'chartreuse-subtle',\n celery: 'celery-subtle',\n green: 'green-subtle',\n seafoam: 'seafoam-subtle',\n cyan: 'cyan-subtle',\n blue: 'blue-subtle',\n indigo: 'indigo-subtle',\n purple: 'purple-subtle',\n fuchsia: 'fuchsia-subtle',\n magenta: 'magenta-subtle',\n pink: 'pink-subtle',\n turquoise: 'turquoise-subtle',\n brown: 'brown-subtle',\n cinnamon: 'cinnamon-subtle',\n silver: 'silver-subtle'\n }\n },\n outline: 'layer-2'\n }\n },\n borderStyle: 'solid',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderColor: {\n default: 'transparent',\n fillStyle: {\n outline: {\n variant: {\n accent: lightDark('accent-800', 'accent-900'), // accent-visual-color\n informative: lightDark('informative-800', 'informative-900'), // informative-visual-color\n neutral: lightDark('gray-500', 'gray-600'), // neutral-visual-color\n positive: lightDark('positive-800', 'positive-900'), // positive-visual-color\n notice: lightDark('notice-800', 'notice-900'), // notice-visual-color\n negative: lightDark('negative-800', 'negative-900') // negative-visual-color\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nfunction Badge(props: BadgeProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BadgeContext);\n let {\n children,\n variant = 'neutral',\n size = 'S',\n fillStyle = 'bold',\n ...otherProps\n } = props; // useProviderProps(props) in v3\n let domRef = useDOMRef(ref);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <Provider\n values={[\n [TextContext, {styles: style({paddingY: '--labelPadding', order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n <SkeletonWrapper>\n <span\n {...filterDOMProps(otherProps)}\n role=\"presentation\"\n className={(props.UNSAFE_className || '') + badge({variant, size, fillStyle}, props.styles)}\n style={props.UNSAFE_style}\n ref={domRef}>\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </span>\n </SkeletonWrapper>\n </Provider>\n );\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nlet _Badge = forwardRef(Badge);\nexport {_Badge as Badge};\n"],"names":[],"version":3,"file":"Badge.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0CM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAAkE;AAE1G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiIN,SAAS,4BAAM,KAAiB,EAAE,GAA2B;IAC3D,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,YACF,QAAQ,WACR,UAAU,iBACV,OAAO,gBACP,YAAY,QACZ,GAAG,YACJ,GAAG,OAAO,gCAAgC;IAC3C,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,KAAK,CAAC,CAAA,IAAK,eAAC,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC;IAEzF,qBACE,gBAAC,CAAA,GAAA,eAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAU;gBAAG;oBAAC,MAAM;gBAA+C;aAAE;YACtE;gBAAC,CAAA,GAAA,yCAAU;gBAAG;oBACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;wBAAC,MAAM;wBAAQ,MAAM;oBAAmB;oBAC/D,MAAM;gBACR;aAAE;SACH;kBACD,cAAA,gBAAC,CAAA,GAAA,yCAAc;sBACb,cAAA,gBAAC;gBACE,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;gBAC9B,MAAK;gBACL,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,4BAAM;6BAAC;0BAAS;+BAAM;gBAAS,GAAG,MAAM,MAAM;gBAC1F,OAAO,MAAM,YAAY;gBACzB,KAAK;0BAEH,OAAO,aAAa,YAAY,2BAC5B,gBAAC,CAAA,GAAA,yCAAG;8BAAG;qBACP;;;;AAMhB;AAEA;;CAEC,GACD,IAAI,0DAAS,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Badge.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {SkeletonWrapper} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface BadgeStyleProps {\n /**\n * The size of the badge.\n *\n * @default 'S'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The variant changes the background color of the badge. When badge has a semantic meaning, they should use the variant for semantic colors.\n *\n * @default 'neutral'\n */\n variant?: 'accent' | 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'gray' | 'red' | 'orange' | 'yellow' | 'charteuse' | 'celery' | 'green' | 'seafoam' | 'cyan' | 'blue' | 'indigo' | 'purple' | 'fuchsia' | 'magenta' | 'pink' | 'turquoise' | 'brown' | 'cinnamon' | 'silver',\n /**\n * The fill of the badge.\n * @default 'bold'\n */\n fillStyle?: 'bold' | 'subtle' | 'outline'\n}\n\nexport interface BadgeProps extends DOMProps, AriaLabelingProps, StyleProps, BadgeStyleProps, SlotProps {\n /**\n * The content to display in the badge.\n */\n children: ReactNode\n}\n\nexport const BadgeContext = createContext<ContextValue<Partial<BadgeProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst badge = style<BadgeStyleProps>({\n display: 'flex',\n font: 'control',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 'control',\n minHeight: 'control',\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]:only-child)': 0\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n aspectRatio: {\n ':has([slot=icon]:only-child)': 'square'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n ':has([slot=icon]:only-child)': 0\n }\n },\n columnGap: 'text-to-visual',\n color: {\n fillStyle: {\n bold: {\n default: 'white',\n variant: {\n notice: 'black',\n orange: 'black',\n yellow: 'black',\n charteuse: 'black',\n celery: 'black'\n }\n },\n subtle: 'gray-1000',\n outline: 'gray-1000'\n }\n },\n backgroundColor: {\n fillStyle: {\n bold: {\n variant: {\n accent: 'accent',\n informative: 'informative',\n neutral: 'neutral-subdued',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n gray: 'gray',\n red: 'red',\n orange: 'orange',\n yellow: 'yellow',\n charteuse: 'chartreuse',\n celery: 'celery',\n green: 'green',\n seafoam: 'seafoam',\n cyan: 'cyan',\n blue: 'blue',\n indigo: 'indigo',\n purple: 'purple',\n fuchsia: 'fuchsia',\n magenta: 'magenta',\n pink: 'pink',\n turquoise: 'turquoise',\n brown: 'brown',\n cinnamon: 'cinnamon',\n silver: 'silver'\n }\n },\n subtle: {\n variant: {\n accent: 'accent-subtle',\n informative: 'informative-subtle',\n neutral: 'neutral-subtle',\n positive: 'positive-subtle',\n notice: 'notice-subtle',\n negative: 'negative-subtle',\n gray: 'gray-subtle',\n red: 'red-subtle',\n orange: 'orange-subtle',\n yellow: 'yellow-subtle',\n charteuse: 'chartreuse-subtle',\n celery: 'celery-subtle',\n green: 'green-subtle',\n seafoam: 'seafoam-subtle',\n cyan: 'cyan-subtle',\n blue: 'blue-subtle',\n indigo: 'indigo-subtle',\n purple: 'purple-subtle',\n fuchsia: 'fuchsia-subtle',\n magenta: 'magenta-subtle',\n pink: 'pink-subtle',\n turquoise: 'turquoise-subtle',\n brown: 'brown-subtle',\n cinnamon: 'cinnamon-subtle',\n silver: 'silver-subtle'\n }\n },\n outline: 'layer-2'\n }\n },\n borderStyle: 'solid',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderColor: {\n default: 'transparent',\n fillStyle: {\n outline: {\n variant: {\n accent: lightDark('accent-800', 'accent-900'), // accent-visual-color\n informative: lightDark('informative-800', 'informative-900'), // informative-visual-color\n neutral: lightDark('gray-500', 'gray-600'), // neutral-visual-color\n positive: lightDark('positive-800', 'positive-900'), // positive-visual-color\n notice: lightDark('notice-800', 'notice-900'), // notice-visual-color\n negative: lightDark('negative-800', 'negative-900') // negative-visual-color\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nfunction Badge(props: BadgeProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BadgeContext);\n let {\n children,\n variant = 'neutral',\n size = 'S',\n fillStyle = 'bold',\n ...otherProps\n } = props; // useProviderProps(props) in v3\n let domRef = useDOMRef(ref);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <Provider\n values={[\n [TextContext, {styles: style({paddingY: '--labelPadding', order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n <SkeletonWrapper>\n <span\n {...filterDOMProps(otherProps)}\n role=\"presentation\"\n className={(props.UNSAFE_className || '') + badge({variant, size, fillStyle}, props.styles)}\n style={props.UNSAFE_style}\n ref={domRef}>\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </span>\n </SkeletonWrapper>\n </Provider>\n );\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nlet _Badge = forwardRef(Badge);\nexport {_Badge as Badge};\n"],"names":[],"version":3,"file":"Badge.mjs.map"}
@@ -81,20 +81,10 @@ const $4130f4e17f7081aa$var$wrapper = function anonymous(props, overrides) {
81
81
  if (!$_9) rules += ' _9-3t1y';
82
82
  if (!$_8) rules += ' _8-3t1x';
83
83
  if (!$h) rules += ' ha';
84
- if (props.size === "L") {
85
- rules += ' ib-1itkwgp';
86
- rules += ' i-1ch0ogp';
87
- } else if (props.size === "M") {
88
- rules += ' ib-1aa9md1';
89
- rules += ' i-6njx2e';
90
- }
91
- if (props.size === "L") {
92
- rules += ' jb-1itkwgp';
93
- rules += ' j-1ch0ogp';
94
- } else if (props.size === "M") {
95
- rules += ' jb-1aa9md1';
96
- rules += ' j-6njx2e';
97
- }
84
+ if (props.size === "L") rules += ' i-1dtpt05';
85
+ else if (props.size === "M") rules += ' i-ve8p9e';
86
+ if (props.size === "L") rules += ' j-1dtpt05';
87
+ else if (props.size === "M") rules += ' j-ve8p9e';
98
88
  rules += ' Ea';
99
89
  rules += ' Fa';
100
90
  rules += ' Ca';
@@ -105,13 +95,8 @@ const $4130f4e17f7081aa$var$wrapper = function anonymous(props, overrides) {
105
95
  if (!$A) rules += ' Aa';
106
96
  if (!$B) rules += ' Ba';
107
97
  if (!$y) {
108
- if (props.size === "L") {
109
- rules += ' yb-1itkwgp';
110
- rules += ' y-1ch0ogp';
111
- } else if (props.size === "M") {
112
- rules += ' yb-1aa9md1';
113
- rules += ' y-6njx2e';
114
- }
98
+ if (props.size === "L") rules += ' y-1dtpt05';
99
+ else if (props.size === "M") rules += ' y-ve8p9e';
115
100
  }
116
101
  return rules;
117
102
  };
@@ -234,22 +219,11 @@ const $4130f4e17f7081aa$var$breadcrumbStyles = function anonymous(props) {
234
219
  rules += ' _Zd';
235
220
  rules += ' _1c';
236
221
  rules += ' _2b';
237
- if (props.size === "XL") {
238
- rules += ' kby';
239
- rules += ' kx';
240
- } else if (props.size === "L") {
241
- rules += ' kbu';
242
- rules += ' kr';
243
- } else if (props.size === "S") {
244
- rules += ' kbn';
245
- rules += ' km';
246
- } else if (props.size === "XS") {
247
- rules += ' kbl';
248
- rules += ' kk';
249
- } else {
250
- rules += ' kbr';
251
- rules += ' kq';
252
- }
222
+ if (props.size === "XL") rules += ' kn';
223
+ else if (props.size === "L") rules += ' kl';
224
+ else if (props.size === "S") rules += ' kh';
225
+ else if (props.size === "XS") rules += ' kg';
226
+ else rules += ' kj';
253
227
  rules += ' _Oa';
254
228
  rules += ' _Q-375x7f';
255
229
  rules += ' _Ra';
@@ -265,10 +239,7 @@ const $4130f4e17f7081aa$var$breadcrumbStyles = function anonymous(props) {
265
239
  else rules += ' an';
266
240
  }
267
241
  rules += ' wf';
268
- if (props.isMenu) {
269
- rules += ' yb-1l44p6q';
270
- rules += ' y-2al4ab';
271
- }
242
+ if (props.isMenu) rules += ' y-460fe7';
272
243
  return rules;
273
244
  };
274
245
  const $4130f4e17f7081aa$var$chevronStyles = function anonymous(props) {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;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AS,OAAO,OAAO,GAAI;YAClC,kBAAkB;YAClB,IAAI,kBAAkB,GACpB;YAEF,kBAAkB;YAClB;QACF;QAEA,gBAAgB,KAAK,GAAG,CAAC,yCAAmB,KAAK,GAAG,CAAC,iBAAiB;IACxE,GAAG;QAAC,WAAW,IAAI;QAAE;KAAgB;IAErC,4FAA4F;IAC5F,CAAA,GAAA,2CAAgB,EAAE;QAAC,KAAK;QAAc,UAAU;IAAc;IAE9D,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,WAAW,IAAI,GAAG,GACpB,eAAe;IAEnB,GAAG;QAAC,WAAW,IAAI;QAAE;KAAe;IAEpC,CAAA,GAAA,sBAAQ,EAAE;QACR,kDAAkD;QAClD,SAAS,KAAK,EAAE,MAAM,KAAK,IAAM;IACjC,uDAAuD;IACzD,GAAG,EAAE;IACL,IAAI,aAAa,WAAW,IAAI,GAAG;IAEnC,qBACE;;0BACE,gCAAC;gBAAkB,OAAO;gBAAU,MAAM;gBAAM,SAAS;;YACxD,eAAe,WAAW,IAAI,IAAI,WAAW,IAAI,GAAG,kBACnD;;oBACG,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE;kCACjC,gCAAC;wBAAe,OAAO,SAAS,KAAK,CAAC,GAAG;wBAAa,UAAU;;oBAC/D,SAAS,KAAK,CAAC,YAAY,GAAG,CAAC,CAAA,qBAAQ,gCAAC,CAAA,GAAA,qBAAO;sCAAkB,KAAK,MAAM,GAAG;2BAAzB,KAAK,GAAG;;+BAGjE;0BACG,SAAS,GAAG,CAAC,CAAA,qBAAQ,gCAAC,CAAA,GAAA,qBAAO;kCAAkB,KAAK,MAAM,GAAG;uBAAzB,KAAK,GAAG;;;;AAKvD","sources":["packages/@react-spectrum/s2/src/Breadcrumbs.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from './ActionButton';\nimport {\n Breadcrumb as AriaBreadcrumb,\n BreadcrumbsProps as AriaBreadcrumbsProps,\n CollectionRenderer,\n ContextValue,\n HeadingContext,\n Link,\n Provider,\n Breadcrumbs as RACBreadcrumbs,\n UNSTABLE_CollectionRendererContext,\n UNSTABLE_DefaultCollectionRenderer\n} from 'react-aria-components';\nimport {AriaBreadcrumbItemProps, useLocale} from 'react-aria';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {Collection, DOMRef, DOMRefValue, LinkDOMProps, Node} from '@react-types/shared';\nimport {createContext, forwardRef, Fragment, ReactNode, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {focusRing, size, style} from '../style' with { type: 'macro' };\nimport FolderIcon from '../s2wf-icons/S2_Icon_FolderBreadcrumb_20_N.svg';\nimport {forwardRefType} from './types';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Menu, MenuItem, MenuTrigger} from './Menu';\nimport {Text} from './Content';\nimport {useDOMRef, useResizeObserver} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nconst MIN_VISIBLE_ITEMS = 1;\nconst MAX_VISIBLE_ITEMS = 4;\n\ninterface BreadcrumbsStyleProps {\n /**\n * Size of the Breadcrumbs including spacing and layout.\n *\n * @default 'M'\n */\n size?: 'M' | 'L',\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean\n /**\n * Whether to place the last Breadcrumb item onto a new line.\n */\n // TODO: isMultiline?: boolean\n /** Whether to always show the root item if the items are collapsed. */\n // TODO: showRoot?: boolean,\n}\n\nexport interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps<T>, 'children' | 'items' | 'style' | 'className'>, BreadcrumbsStyleProps, StyleProps {\n /** The children of the Breadcrumbs. */\n children?: ReactNode\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, DOMRefValue<HTMLOListElement>>>(null);\n\nconst wrapper = style<BreadcrumbsStyleProps>({\n position: 'relative',\n display: 'flex',\n justifyContent: 'start',\n listStyleType: 'none',\n flexWrap: 'nowrap',\n flexGrow: 1,\n flexShrink: 0,\n flexBasis: 0,\n gap: {\n size: {\n M: size(6), // breadcrumbs-text-to-separator-medium\n L: size(9) // breadcrumbs-text-to-separator-large\n }\n },\n padding: 0,\n transition: 'default',\n marginTop: 0,\n marginBottom: 0,\n marginStart: {\n size: {\n M: size(6),\n L: size(9)\n }\n }\n}, getAllowedOverrides());\n\nconst InternalBreadcrumbsContext = createContext<BreadcrumbsProps<any>>({});\n\nfunction Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BreadcrumbsContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_className = '',\n UNSAFE_style,\n styles,\n size = 'M',\n children,\n isDisabled,\n ...otherProps\n } = props;\n\n return (\n <Provider\n values={[\n [InternalBreadcrumbsContext, {size, isDisabled}]\n ]}>\n <CollapsingCollection containerRef={domRef} onAction={props.onAction}>\n <RACBreadcrumbs\n {...otherProps}\n isDisabled={isDisabled}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({\n size\n }, styles)}>\n {children}\n </RACBreadcrumbs>\n </CollapsingCollection>\n </Provider>\n );\n}\n\nlet BreadcrumbMenu = (props: {items: Array<Node<any>>, onAction: BreadcrumbsProps<unknown>['onAction']}) => {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {items, onAction} = props;\n let {direction} = useLocale();\n let {size, isDisabled} = useContext(InternalBreadcrumbsContext);\n let label = stringFormatter.format('breadcrumbs.more');\n return (\n <UNSTABLE_CollectionRendererContext.Provider value={UNSTABLE_DefaultCollectionRenderer}>\n <li className={breadcrumbStyles({size, isDisabled, isMenu: true})}>\n <MenuTrigger>\n <ActionButton isDisabled={isDisabled} isQuiet aria-label={label}><FolderIcon /></ActionButton>\n <Menu items={items} onAction={onAction}>\n {(item: Node<any>) => (\n <MenuItem\n {...item.props.originalProps}\n key={item.key}>\n <Text slot=\"label\">\n {item.props.children({size, isCurrent: false, isMenu: true})}\n </Text>\n </MenuItem>\n )}\n </Menu>\n </MenuTrigger>\n <ChevronIcon\n size={size}\n className={chevronStyles({direction, isMenu: true})} />\n </li>\n </UNSTABLE_CollectionRendererContext.Provider>\n );\n};\n\n/** Breadcrumbs show hierarchy and navigational context for a user’s location within an application. */\nlet _Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\n\nlet HiddenBreadcrumbs = function (props: {listRef: RefObject<HTMLDivElement | null>, items: Array<Node<any>>, size: string}) {\n let {listRef, items, size} = props;\n return (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={listRef}\n className={style({\n display: '[inherit]',\n gap: '[inherit]',\n flexWrap: '[inherit]',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: 0,\n end: 0,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {items.map((item, idx) => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n return (\n <div\n data-hidden-breadcrumb\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, isCurrent: idx === items.length - 1})}>\n {item.props.children({size, isCurrent: idx === items.length - 1})}\n </div>\n );\n })}\n <ActionButton data-hidden-button isQuiet><FolderIcon /></ActionButton>\n </div>\n );\n};\n\nconst breadcrumbStyles = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'start',\n height: 'control',\n transition: 'default',\n position: 'relative',\n flexShrink: 0,\n color: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n marginStart: {\n // adjusts with the parent flex gap\n isMenu: size(-6)\n }\n});\n\nconst chevronStyles = style({\n scale: {\n direction: {\n rtl: -1\n }\n },\n marginStart: {\n default: 'text-to-visual',\n isMenu: 0\n },\n color: {\n default: 'neutral',\n forcedColors: {\n default: 'LinkText'\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst linkStyles = style({\n ...focusRing(),\n borderRadius: 'sm',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled',\n isCurrent: 'neutral',\n forcedColors: {\n default: 'LinkText',\n isDisabled: 'GrayText'\n }\n },\n transition: 'default',\n textDecoration: {\n default: 'none',\n isHovered: 'underline',\n isFocusVisible: 'underline',\n isDisabled: 'none'\n },\n cursor: {\n default: 'pointer',\n isDisabled: 'default'\n },\n outlineColor: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n },\n disableTapHighlight: true\n});\n\nconst currentStyles = style<{size: string}>({\n font: 'control',\n fontWeight: 'bold'\n});\n\n// TODO: support user heading size customization, for now just set it to large\nconst heading = style({\n margin: 0,\n font: 'heading-lg',\n fontWeight: 'extra-bold'\n});\n\nexport interface BreadcrumbProps extends Omit<AriaBreadcrumbItemProps, 'children' | 'style' | 'className' | 'autoFocus'>, LinkDOMProps {\n /** The children of the breadcrumb item. */\n children?: ReactNode\n}\n\nfunction Breadcrumb({children, ...props}: BreadcrumbProps, ref: DOMRef<HTMLLIElement>) {\n let {href, target, rel, download, ping, referrerPolicy} = props;\n let {size = 'M'} = useContext(InternalBreadcrumbsContext) ?? {};\n let domRef = useDOMRef(ref);\n let {direction} = useLocale();\n return (\n <AriaBreadcrumb\n {...props}\n ref={domRef}\n // @ts-ignore\n originalProps={props}\n className={({isCurrent, isDisabled}) => breadcrumbStyles({size, isCurrent, isDisabled})}>\n {({\n isCurrent,\n isDisabled,\n // @ts-ignore\n isMenu\n }) => {\n if (isMenu) {\n return children;\n }\n return (\n isCurrent ?\n <div\n className={currentStyles({size})}>\n <Provider\n values={[\n [HeadingContext, {className: heading}]\n ]}>\n {children}\n </Provider>\n </div>\n : (\n <>\n <Link\n style={({isFocusVisible}) => ({clipPath: isFocusVisible ? 'none' : 'margin-box'})}\n href={href}\n target={target}\n rel={rel}\n download={download}\n ping={ping}\n referrerPolicy={referrerPolicy}\n isDisabled={isDisabled || isCurrent}\n className={({isFocused, isFocusVisible, isHovered, isDisabled, isPressed}) => linkStyles({isFocused, isFocusVisible, isHovered, isDisabled, size, isPressed})}>\n {children}\n </Link>\n <ChevronIcon\n size=\"M\"\n className={chevronStyles({direction})} />\n </>\n )\n );\n }}\n </AriaBreadcrumb>\n );\n}\n\n/** An individual Breadcrumb for Breadcrumbs. */\nlet _Breadcrumb = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumb);\nexport {_Breadcrumb as Breadcrumb};\n\n// Context for passing the count for the custom renderer\nlet CollapseContext = createContext<{\n containerRef: RefObject<HTMLOListElement | null>,\n onAction: BreadcrumbsProps<unknown>['onAction']\n} | null>(null);\n\nfunction CollapsingCollection({children, containerRef, onAction}) {\n return (\n <CollapseContext.Provider value={{containerRef, onAction}}>\n <UNSTABLE_CollectionRendererContext.Provider value={CollapsingCollectionRenderer}>\n {children}\n </UNSTABLE_CollectionRendererContext.Provider>\n </CollapseContext.Provider>\n );\n}\n\nlet CollapsingCollectionRenderer: CollectionRenderer = {\n CollectionRoot({collection}) {\n return useCollectionRender(collection);\n },\n CollectionBranch({collection}) {\n return useCollectionRender(collection);\n }\n};\n\nlet useCollectionRender = (collection: Collection<Node<unknown>>) => {\n let {containerRef, onAction} = useContext(CollapseContext) ?? {};\n let [visibleItems, setVisibleItems] = useState(collection.size);\n let {size = 'M'} = useContext(InternalBreadcrumbsContext);\n\n let children = useMemo(() => {\n let result: Node<any>[] = [];\n for (let key of collection.getKeys()) {\n result.push(collection.getItem(key)!);\n }\n return result;\n }, [collection]);\n\n let listRef = useRef<HTMLDivElement | null>(null);\n let updateOverflow = useCallback(() => {\n let currListRef: HTMLDivElement | null = listRef.current;\n if (!currListRef) {\n setVisibleItems(collection.size);\n return;\n }\n let container = currListRef.parentElement;\n if (!container) {\n setVisibleItems(collection.size);\n return;\n }\n\n let listItems = Array.from(currListRef.querySelectorAll('[data-hidden-breadcrumb]')) as HTMLLIElement[];\n let folder = currListRef.querySelector('button') as HTMLButtonElement;\n if (listItems.length <= 0) {\n setVisibleItems(collection.size);\n return;\n }\n let containerWidth = container.offsetWidth;\n let containerGap = parseInt(getComputedStyle(container).gap, 10);\n let folderGap = parseInt(getComputedStyle(folder).marginInlineStart, 10);\n let newVisibleItems = 0;\n let maxVisibleItems = MAX_VISIBLE_ITEMS;\n\n let widths: Array<number> = [];\n let totalWidth = 0;\n for (let breadcrumb of listItems) {\n let width = breadcrumb.offsetWidth + 1; // offsetWidth is rounded down\n widths.push(width);\n totalWidth += width;\n }\n\n // can we fit all the items without collapsing\n if (totalWidth <= containerWidth - (collection.size * containerGap) && collection.size <= MAX_VISIBLE_ITEMS) {\n setVisibleItems(collection.size);\n return;\n }\n\n // we know there is always at least one item because of the listItems.length check up above\n let widthOfFirst = widths.shift()!;\n let availableWidth = containerWidth - widthOfFirst - folderGap - folder.offsetWidth - containerGap;\n maxVisibleItems -= 2; // account for the first item and folder\n for (let width of widths.reverse()) {\n availableWidth -= width;\n if (availableWidth <= 0) {\n break;\n }\n availableWidth -= containerGap;\n newVisibleItems++;\n }\n\n setVisibleItems(Math.max(MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems)));\n }, [collection.size, setVisibleItems]);\n\n // making bad assumption that i can listen to containerRef when it's declared in the parent?\n useResizeObserver({ref: containerRef, onResize: updateOverflow});\n\n useLayoutEffect(() => {\n if (collection.size > 0) {\n queueMicrotask(updateOverflow);\n }\n }, [collection.size, updateOverflow]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateOverflow());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let sliceIndex = collection.size - visibleItems;\n\n return (\n <>\n <HiddenBreadcrumbs items={children} size={size} listRef={listRef} />\n {visibleItems < collection.size && collection.size > 2 ? (\n <>\n {children[0].render?.(children[0])}\n <BreadcrumbMenu items={children.slice(1, sliceIndex)} onAction={onAction} />\n {children.slice(sliceIndex).map(node => <Fragment key={node.key}>{node.render?.(node)}</Fragment >)}\n </>\n ) : (\n <>\n {children.map(node => <Fragment key={node.key}>{node.render?.(node)}</Fragment>)}\n </>\n )}\n </>\n );\n};\n"],"names":[],"version":3,"file":"Breadcrumbs.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAgCD,MAAM,0CAAoB;AAC1B,MAAM,0CAAoB;AAwBnB,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsE;AAEpH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BN,MAAM,iEAA6B,CAAA,GAAA,0BAAY,EAAyB,CAAC;AAEzE,SAAS,kCAA8B,KAA0B,EAAE,GAA6B;IAC9F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,oBACF,mBAAmB,kBACnB,YAAY,UACZ,MAAM,QACN,OAAO,eACP,QAAQ,cACR,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,qBACE,gCAAC,CAAA,GAAA,mCAAO;QACN,QAAQ;YACN;gBAAC;gBAA4B;0BAAC;gCAAM;gBAAU;aAAE;SACjD;kBACD,cAAA,gCAAC;YAAqB,cAAc;Y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AAQ,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE;kCACjC,gCAAC;wBAAe,OAAO,SAAS,KAAK,CAAC,GAAG;wBAAa,UAAU;;oBAC/D,SAAS,KAAK,CAAC,YAAY,GAAG,CAAC,CAAA,qBAAQ,gCAAC,CAAA,GAAA,qBAAO;sCAAkB,KAAK,MAAM,GAAG;2BAAzB,KAAK,GAAG;;+BAGjE;0BACG,SAAS,GAAG,CAAC,CAAA,qBAAQ,gCAAC,CAAA,GAAA,qBAAO;kCAAkB,KAAK,MAAM,GAAG;uBAAzB,KAAK,GAAG;;;;AAKvD","sources":["packages/@react-spectrum/s2/src/Breadcrumbs.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from './ActionButton';\nimport {\n Breadcrumb as AriaBreadcrumb,\n BreadcrumbsProps as AriaBreadcrumbsProps,\n CollectionRenderer,\n ContextValue,\n HeadingContext,\n Link,\n Provider,\n Breadcrumbs as RACBreadcrumbs,\n UNSTABLE_CollectionRendererContext,\n UNSTABLE_DefaultCollectionRenderer\n} from 'react-aria-components';\nimport {AriaBreadcrumbItemProps, useLocale} from 'react-aria';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {Collection, DOMRef, DOMRefValue, LinkDOMProps, Node} from '@react-types/shared';\nimport {createContext, forwardRef, Fragment, ReactNode, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {focusRing, size, style} from '../style' with { type: 'macro' };\nimport FolderIcon from '../s2wf-icons/S2_Icon_FolderBreadcrumb_20_N.svg';\nimport {forwardRefType} from './types';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Menu, MenuItem, MenuTrigger} from './Menu';\nimport {Text} from './Content';\nimport {useDOMRef, useResizeObserver} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nconst MIN_VISIBLE_ITEMS = 1;\nconst MAX_VISIBLE_ITEMS = 4;\n\ninterface BreadcrumbsStyleProps {\n /**\n * Size of the Breadcrumbs including spacing and layout.\n *\n * @default 'M'\n */\n size?: 'M' | 'L',\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean\n /**\n * Whether to place the last Breadcrumb item onto a new line.\n */\n // TODO: isMultiline?: boolean\n /** Whether to always show the root item if the items are collapsed. */\n // TODO: showRoot?: boolean,\n}\n\nexport interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps<T>, 'children' | 'items' | 'style' | 'className'>, BreadcrumbsStyleProps, StyleProps {\n /** The children of the Breadcrumbs. */\n children?: ReactNode\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, DOMRefValue<HTMLOListElement>>>(null);\n\nconst wrapper = style<BreadcrumbsStyleProps>({\n position: 'relative',\n display: 'flex',\n justifyContent: 'start',\n listStyleType: 'none',\n flexWrap: 'nowrap',\n flexGrow: 1,\n flexShrink: 0,\n flexBasis: 0,\n gap: {\n size: {\n M: size(6), // breadcrumbs-text-to-separator-medium\n L: size(9) // breadcrumbs-text-to-separator-large\n }\n },\n padding: 0,\n transition: 'default',\n marginTop: 0,\n marginBottom: 0,\n marginStart: {\n size: {\n M: size(6),\n L: size(9)\n }\n }\n}, getAllowedOverrides());\n\nconst InternalBreadcrumbsContext = createContext<BreadcrumbsProps<any>>({});\n\nfunction Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BreadcrumbsContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_className = '',\n UNSAFE_style,\n styles,\n size = 'M',\n children,\n isDisabled,\n ...otherProps\n } = props;\n\n return (\n <Provider\n values={[\n [InternalBreadcrumbsContext, {size, isDisabled}]\n ]}>\n <CollapsingCollection containerRef={domRef} onAction={props.onAction}>\n <RACBreadcrumbs\n {...otherProps}\n isDisabled={isDisabled}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({\n size\n }, styles)}>\n {children}\n </RACBreadcrumbs>\n </CollapsingCollection>\n </Provider>\n );\n}\n\nlet BreadcrumbMenu = (props: {items: Array<Node<any>>, onAction: BreadcrumbsProps<unknown>['onAction']}) => {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {items, onAction} = props;\n let {direction} = useLocale();\n let {size, isDisabled} = useContext(InternalBreadcrumbsContext);\n let label = stringFormatter.format('breadcrumbs.more');\n return (\n <UNSTABLE_CollectionRendererContext.Provider value={UNSTABLE_DefaultCollectionRenderer}>\n <li className={breadcrumbStyles({size, isDisabled, isMenu: true})}>\n <MenuTrigger>\n <ActionButton isDisabled={isDisabled} isQuiet aria-label={label}><FolderIcon /></ActionButton>\n <Menu items={items} onAction={onAction}>\n {(item: Node<any>) => (\n <MenuItem\n {...item.props.originalProps}\n key={item.key}>\n <Text slot=\"label\">\n {item.props.children({size, isCurrent: false, isMenu: true})}\n </Text>\n </MenuItem>\n )}\n </Menu>\n </MenuTrigger>\n <ChevronIcon\n size={size}\n className={chevronStyles({direction, isMenu: true})} />\n </li>\n </UNSTABLE_CollectionRendererContext.Provider>\n );\n};\n\n/** Breadcrumbs show hierarchy and navigational context for a user’s location within an application. */\nlet _Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\n\nlet HiddenBreadcrumbs = function (props: {listRef: RefObject<HTMLDivElement | null>, items: Array<Node<any>>, size: string}) {\n let {listRef, items, size} = props;\n return (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={listRef}\n className={style({\n display: '[inherit]',\n gap: '[inherit]',\n flexWrap: '[inherit]',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: 0,\n end: 0,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {items.map((item, idx) => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n return (\n <div\n data-hidden-breadcrumb\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, isCurrent: idx === items.length - 1})}>\n {item.props.children({size, isCurrent: idx === items.length - 1})}\n </div>\n );\n })}\n <ActionButton data-hidden-button isQuiet><FolderIcon /></ActionButton>\n </div>\n );\n};\n\nconst breadcrumbStyles = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'start',\n height: 'control',\n transition: 'default',\n position: 'relative',\n flexShrink: 0,\n color: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n marginStart: {\n // adjusts with the parent flex gap\n isMenu: size(-6)\n }\n});\n\nconst chevronStyles = style({\n scale: {\n direction: {\n rtl: -1\n }\n },\n marginStart: {\n default: 'text-to-visual',\n isMenu: 0\n },\n color: {\n default: 'neutral',\n forcedColors: {\n default: 'LinkText'\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst linkStyles = style({\n ...focusRing(),\n borderRadius: 'sm',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled',\n isCurrent: 'neutral',\n forcedColors: {\n default: 'LinkText',\n isDisabled: 'GrayText'\n }\n },\n transition: 'default',\n textDecoration: {\n default: 'none',\n isHovered: 'underline',\n isFocusVisible: 'underline',\n isDisabled: 'none'\n },\n cursor: {\n default: 'pointer',\n isDisabled: 'default'\n },\n outlineColor: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n },\n disableTapHighlight: true\n});\n\nconst currentStyles = style<{size: string}>({\n font: 'control',\n fontWeight: 'bold'\n});\n\n// TODO: support user heading size customization, for now just set it to large\nconst heading = style({\n margin: 0,\n font: 'heading-lg',\n fontWeight: 'extra-bold'\n});\n\nexport interface BreadcrumbProps extends Omit<AriaBreadcrumbItemProps, 'children' | 'style' | 'className' | 'autoFocus'>, LinkDOMProps {\n /** The children of the breadcrumb item. */\n children?: ReactNode\n}\n\nfunction Breadcrumb({children, ...props}: BreadcrumbProps, ref: DOMRef<HTMLLIElement>) {\n let {href, target, rel, download, ping, referrerPolicy} = props;\n let {size = 'M'} = useContext(InternalBreadcrumbsContext) ?? {};\n let domRef = useDOMRef(ref);\n let {direction} = useLocale();\n return (\n <AriaBreadcrumb\n {...props}\n ref={domRef}\n // @ts-ignore\n originalProps={props}\n className={({isCurrent, isDisabled}) => breadcrumbStyles({size, isCurrent, isDisabled})}>\n {({\n isCurrent,\n isDisabled,\n // @ts-ignore\n isMenu\n }) => {\n if (isMenu) {\n return children;\n }\n return (\n isCurrent ?\n <div\n className={currentStyles({size})}>\n <Provider\n values={[\n [HeadingContext, {className: heading}]\n ]}>\n {children}\n </Provider>\n </div>\n : (\n <>\n <Link\n style={({isFocusVisible}) => ({clipPath: isFocusVisible ? 'none' : 'margin-box'})}\n href={href}\n target={target}\n rel={rel}\n download={download}\n ping={ping}\n referrerPolicy={referrerPolicy}\n isDisabled={isDisabled || isCurrent}\n className={({isFocused, isFocusVisible, isHovered, isDisabled, isPressed}) => linkStyles({isFocused, isFocusVisible, isHovered, isDisabled, size, isPressed})}>\n {children}\n </Link>\n <ChevronIcon\n size=\"M\"\n className={chevronStyles({direction})} />\n </>\n )\n );\n }}\n </AriaBreadcrumb>\n );\n}\n\n/** An individual Breadcrumb for Breadcrumbs. */\nlet _Breadcrumb = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumb);\nexport {_Breadcrumb as Breadcrumb};\n\n// Context for passing the count for the custom renderer\nlet CollapseContext = createContext<{\n containerRef: RefObject<HTMLOListElement | null>,\n onAction: BreadcrumbsProps<unknown>['onAction']\n} | null>(null);\n\nfunction CollapsingCollection({children, containerRef, onAction}) {\n return (\n <CollapseContext.Provider value={{containerRef, onAction}}>\n <UNSTABLE_CollectionRendererContext.Provider value={CollapsingCollectionRenderer}>\n {children}\n </UNSTABLE_CollectionRendererContext.Provider>\n </CollapseContext.Provider>\n );\n}\n\nlet CollapsingCollectionRenderer: CollectionRenderer = {\n CollectionRoot({collection}) {\n return useCollectionRender(collection);\n },\n CollectionBranch({collection}) {\n return useCollectionRender(collection);\n }\n};\n\nlet useCollectionRender = (collection: Collection<Node<unknown>>) => {\n let {containerRef, onAction} = useContext(CollapseContext) ?? {};\n let [visibleItems, setVisibleItems] = useState(collection.size);\n let {size = 'M'} = useContext(InternalBreadcrumbsContext);\n\n let children = useMemo(() => {\n let result: Node<any>[] = [];\n for (let key of collection.getKeys()) {\n result.push(collection.getItem(key)!);\n }\n return result;\n }, [collection]);\n\n let listRef = useRef<HTMLDivElement | null>(null);\n let updateOverflow = useCallback(() => {\n let currListRef: HTMLDivElement | null = listRef.current;\n if (!currListRef) {\n setVisibleItems(collection.size);\n return;\n }\n let container = currListRef.parentElement;\n if (!container) {\n setVisibleItems(collection.size);\n return;\n }\n\n let listItems = Array.from(currListRef.querySelectorAll('[data-hidden-breadcrumb]')) as HTMLLIElement[];\n let folder = currListRef.querySelector('button') as HTMLButtonElement;\n if (listItems.length <= 0) {\n setVisibleItems(collection.size);\n return;\n }\n let containerWidth = container.offsetWidth;\n let containerGap = parseInt(getComputedStyle(container).gap, 10);\n let folderGap = parseInt(getComputedStyle(folder).marginInlineStart, 10);\n let newVisibleItems = 0;\n let maxVisibleItems = MAX_VISIBLE_ITEMS;\n\n let widths: Array<number> = [];\n let totalWidth = 0;\n for (let breadcrumb of listItems) {\n let width = breadcrumb.offsetWidth + 1; // offsetWidth is rounded down\n widths.push(width);\n totalWidth += width;\n }\n\n // can we fit all the items without collapsing\n if (totalWidth <= containerWidth - (collection.size * containerGap) && collection.size <= MAX_VISIBLE_ITEMS) {\n setVisibleItems(collection.size);\n return;\n }\n\n // we know there is always at least one item because of the listItems.length check up above\n let widthOfFirst = widths.shift()!;\n let availableWidth = containerWidth - widthOfFirst - folderGap - folder.offsetWidth - containerGap;\n maxVisibleItems -= 2; // account for the first item and folder\n for (let width of widths.reverse()) {\n availableWidth -= width;\n if (availableWidth <= 0) {\n break;\n }\n availableWidth -= containerGap;\n newVisibleItems++;\n }\n\n setVisibleItems(Math.max(MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems)));\n }, [collection.size, setVisibleItems]);\n\n // making bad assumption that i can listen to containerRef when it's declared in the parent?\n useResizeObserver({ref: containerRef, onResize: updateOverflow});\n\n useLayoutEffect(() => {\n if (collection.size > 0) {\n queueMicrotask(updateOverflow);\n }\n }, [collection.size, updateOverflow]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateOverflow());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let sliceIndex = collection.size - visibleItems;\n\n return (\n <>\n <HiddenBreadcrumbs items={children} size={size} listRef={listRef} />\n {visibleItems < collection.size && collection.size > 2 ? (\n <>\n {children[0].render?.(children[0])}\n <BreadcrumbMenu items={children.slice(1, sliceIndex)} onAction={onAction} />\n {children.slice(sliceIndex).map(node => <Fragment key={node.key}>{node.render?.(node)}</Fragment >)}\n </>\n ) : (\n <>\n {children.map(node => <Fragment key={node.key}>{node.render?.(node)}</Fragment>)}\n </>\n )}\n </>\n );\n};\n"],"names":[],"version":3,"file":"Breadcrumbs.cjs.map"}
@@ -15,20 +15,20 @@
15
15
  flex-basis: 0;
16
16
  }
17
17
 
18
- .i-6njx2e {
19
- row-gap: .375rem;
18
+ .i-ve8p9e {
19
+ row-gap: calc(.375rem * var(--s2-scale));
20
20
  }
21
21
 
22
- .i-1ch0ogp {
23
- row-gap: .5625rem;
22
+ .i-1dtpt05 {
23
+ row-gap: calc(.5625rem * var(--s2-scale));
24
24
  }
25
25
 
26
- .j-6njx2e {
27
- column-gap: .375rem;
26
+ .j-ve8p9e {
27
+ column-gap: calc(.375rem * var(--s2-scale));
28
28
  }
29
29
 
30
- .j-1ch0ogp {
31
- column-gap: .5625rem;
30
+ .j-1dtpt05 {
31
+ column-gap: calc(.5625rem * var(--s2-scale));
32
32
  }
33
33
 
34
34
  .Ea {
@@ -47,12 +47,12 @@
47
47
  padding-inline-end: 0;
48
48
  }
49
49
 
50
- .y-6njx2e {
51
- margin-inline-start: .375rem;
50
+ .y-ve8p9e {
51
+ margin-inline-start: calc(.375rem * var(--s2-scale));
52
52
  }
53
53
 
54
- .y-1ch0ogp {
55
- margin-inline-start: .5625rem;
54
+ .y-1dtpt05 {
55
+ margin-inline-start: calc(.5625rem * var(--s2-scale));
56
56
  }
57
57
 
58
58
  ._Z-17zqamw {
@@ -111,24 +111,24 @@
111
111
  justify-content: start;
112
112
  }
113
113
 
114
- .kq {
115
- height: 2rem;
114
+ .kj {
115
+ height: calc(2rem * var(--s2-scale));
116
116
  }
117
117
 
118
- .kk {
119
- height: 1.25rem;
118
+ .kg {
119
+ height: calc(1.25rem * var(--s2-scale));
120
120
  }
121
121
 
122
- .km {
123
- height: 1.5rem;
122
+ .kh {
123
+ height: calc(1.5rem * var(--s2-scale));
124
124
  }
125
125
 
126
- .kr {
127
- height: 2.5rem;
126
+ .kl {
127
+ height: calc(2.5rem * var(--s2-scale));
128
128
  }
129
129
 
130
- .kx {
131
- height: 3rem;
130
+ .kn {
131
+ height: calc(3rem * var(--s2-scale));
132
132
  }
133
133
 
134
134
  .Uc {
@@ -143,8 +143,8 @@
143
143
  border-style: none;
144
144
  }
145
145
 
146
- .y-2al4ab {
147
- margin-inline-start: -.375rem;
146
+ .y-460fe7 {
147
+ margin-inline-start: calc(-.375rem * var(--s2-scale));
148
148
  }
149
149
 
150
150
  .S-3hmpv {
@@ -324,56 +324,28 @@
324
324
 
325
325
  @layer UNSAFE_overrides;
326
326
 
327
- @layer _.b.b {
328
- @media not ((hover: hover) and (pointer: fine)) {
329
- .ib-1aa9md1 {
330
- row-gap: .46875rem;
331
- }
332
-
333
- .ib-1itkwgp {
334
- row-gap: .703125rem;
335
- }
336
-
337
- .jb-1aa9md1 {
338
- column-gap: .46875rem;
339
- }
340
-
341
- .jb-1itkwgp {
342
- column-gap: .703125rem;
343
- }
344
-
345
- .yb-1aa9md1 {
346
- margin-inline-start: .46875rem;
347
- }
348
-
349
- .yb-1itkwgp {
350
- margin-inline-start: .703125rem;
351
- }
352
-
353
- .kbr {
354
- height: 2.5rem;
355
- }
356
-
357
- .kbl {
358
- height: 1.5625rem;
359
- }
360
-
361
- .kbn {
362
- height: 1.875rem;
327
+ @layer _.b.a {
328
+ @media (forced-colors: active) {
329
+ .aa_____x {
330
+ color: buttontext;
363
331
  }
364
332
 
365
- .kbu {
366
- height: 3.125rem;
333
+ .da_____z {
334
+ outline-color: highlight;
367
335
  }
368
336
 
369
- .kby {
370
- height: 3.75rem;
337
+ .aa_____D {
338
+ color: linktext;
371
339
  }
372
340
 
373
- .yb-1l44p6q {
374
- margin-inline-start: -.46875rem;
341
+ .aa_____B {
342
+ color: graytext;
375
343
  }
344
+ }
345
+ }
376
346
 
347
+ @layer _.b.b {
348
+ @media not ((hover: hover) and (pointer: fine)) {
377
349
  .ybH {
378
350
  margin-inline-start: .470588em;
379
351
  }
@@ -404,26 +376,6 @@
404
376
  }
405
377
  }
406
378
 
407
- @layer _.b.a {
408
- @media (forced-colors: active) {
409
- .aa_____x {
410
- color: buttontext;
411
- }
412
-
413
- .da_____z {
414
- outline-color: highlight;
415
- }
416
-
417
- .aa_____D {
418
- color: linktext;
419
- }
420
-
421
- .aa_____B {
422
- color: graytext;
423
- }
424
- }
425
- }
426
-
427
379
  @layer _.c {
428
380
  ._c-enzwzjc:lang(he) {
429
381
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;