@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/ComboBox.mjs CHANGED
@@ -12,7 +12,7 @@ import {Popover as $88b746eba92c8d0d$export$5b6b19405a83ff9d} from "./Popover.mj
12
12
  import {pressScale as $10ea7662e51a285b$export$56e8cba416805d8d} from "./pressScale.mjs";
13
13
  import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../icons/useSpectrumContextProps.mjs";
14
14
  import {jsx as $5rXoR$jsx, Fragment as $5rXoR$Fragment, jsxs as $5rXoR$jsxs} from "react/jsx-runtime";
15
- import {ComboBox as $5rXoR$ComboBox, InputContext as $5rXoR$InputContext, Button as $5rXoR$Button, Provider as $5rXoR$Provider, ListBox as $5rXoR$ListBox, ListBoxItem as $5rXoR$ListBoxItem, Section as $5rXoR$Section} from "react-aria-components";
15
+ import {ComboBox as $5rXoR$ComboBox, InputContext as $5rXoR$InputContext, Button as $5rXoR$Button, Provider as $5rXoR$Provider, ListBox as $5rXoR$ListBox, ListBoxItem as $5rXoR$ListBoxItem, ListBoxSection as $5rXoR$ListBoxSection} from "react-aria-components";
16
16
  import {createContext as $5rXoR$createContext, useRef as $5rXoR$useRef, useContext as $5rXoR$useContext, useImperativeHandle as $5rXoR$useImperativeHandle, useState as $5rXoR$useState, useCallback as $5rXoR$useCallback, forwardRef as $5rXoR$forwardRef} from "react";
17
17
  import {createFocusableRef as $5rXoR$createFocusableRef} from "@react-spectrum/utils";
18
18
  import {useResizeObserver as $5rXoR$useResizeObserver, mergeRefs as $5rXoR$mergeRefs} from "@react-aria/utils";
@@ -57,32 +57,14 @@ const $a2f262fac286a920$var$inputButton = function anonymous(props) {
57
57
  rules += ' _yi';
58
58
  rules += ' _1c';
59
59
  rules += ' _2d';
60
- if (props.size === "XL") {
61
- rules += ' lbr';
62
- rules += ' lq';
63
- } else if (props.size === "L") {
64
- rules += ' lbn';
65
- rules += ' lm';
66
- } else if (props.size === "M") {
67
- rules += ' lbl';
68
- rules += ' lk';
69
- } else if (props.size === "S") {
70
- rules += ' lbk';
71
- rules += ' lj';
72
- }
73
- if (props.size === "XL") {
74
- rules += ' kbr';
75
- rules += ' kq';
76
- } else if (props.size === "L") {
77
- rules += ' kbn';
78
- rules += ' km';
79
- } else if (props.size === "M") {
80
- rules += ' kbl';
81
- rules += ' kk';
82
- } else if (props.size === "S") {
83
- rules += ' kbk';
84
- rules += ' kj';
85
- }
60
+ if (props.size === "XL") rules += ' lj';
61
+ else if (props.size === "L") rules += ' lh';
62
+ else if (props.size === "M") rules += ' lg';
63
+ else if (props.size === "S") rules += ' lf';
64
+ if (props.size === "XL") rules += ' kj';
65
+ else if (props.size === "L") rules += ' kh';
66
+ else if (props.size === "M") rules += ' kg';
67
+ else if (props.size === "S") rules += ' kf';
86
68
  rules += ' yF';
87
69
  rules += ' _bb';
88
70
  rules += ' _8-3t1x';
@@ -210,22 +192,11 @@ function $a2f262fac286a920$var$ComboBox(props1, ref) {
210
192
  rules += ' _1d';
211
193
  rules += ' _f-1x99dlob';
212
194
  rules += ' _fa';
213
- if (props.size === "XL") {
214
- rules += ' -aqrvqh_k-by';
215
- rules += ' -aqrvqh_k-x';
216
- } else if (props.size === "L") {
217
- rules += ' -aqrvqh_k-bu';
218
- rules += ' -aqrvqh_k-r';
219
- } else if (props.size === "S") {
220
- rules += ' -aqrvqh_k-bn';
221
- rules += ' -aqrvqh_k-m';
222
- } else if (props.size === "XS") {
223
- rules += ' -aqrvqh_k-bl';
224
- rules += ' -aqrvqh_k-k';
225
- } else {
226
- rules += ' -aqrvqh_k-br';
227
- rules += ' -aqrvqh_k-q';
228
- }
195
+ if (props.size === "XL") rules += ' -aqrvqh_k-n';
196
+ else if (props.size === "L") rules += ' -aqrvqh_k-l';
197
+ else if (props.size === "S") rules += ' -aqrvqh_k-h';
198
+ else if (props.size === "XS") rules += ' -aqrvqh_k-g';
199
+ else rules += ' -aqrvqh_k-j';
229
200
  rules += ' -_1inj1bc_i--prjw07';
230
201
  rules += ' je';
231
202
  rules += ' __R-yksgrp';
@@ -263,37 +234,17 @@ function $a2f262fac286a920$var$ComboBox(props1, ref) {
263
234
  rules += ' __b-4cfph1';
264
235
  rules += ' __c-4cfph1';
265
236
  rules += ' __d-4cfph1';
266
- if (props.size === "XL") {
267
- rules += ' qby';
268
- rules += ' qx';
269
- } else if (props.size === "L") {
270
- rules += ' qbu';
271
- rules += ' qr';
272
- } else if (props.size === "S") {
273
- rules += ' qbn';
274
- rules += ' qm';
275
- } else if (props.size === "XS") {
276
- rules += ' qbl';
277
- rules += ' qk';
278
- } else {
279
- rules += ' qbr';
280
- rules += ' qq';
281
- }
237
+ if (props.size === "XL") rules += ' qn';
238
+ else if (props.size === "L") rules += ' ql';
239
+ else if (props.size === "S") rules += ' qh';
240
+ else if (props.size === "XS") rules += ' qg';
241
+ else rules += ' qj';
282
242
  if (props.isQuiet) rules += ' __ma';
283
243
  else rules += ' __m-1s8glxue';
284
- if (props.size === "XL") {
285
- rules += ' -usygro_l-bV';
286
- rules += ' -usygro_l-Q';
287
- } else if (props.size === "L") {
288
- rules += ' -usygro_l-bU';
289
- rules += ' -usygro_l-T';
290
- } else if (props.size === "S") {
291
- rules += ' -usygro_l-bQ';
292
- rules += ' -usygro_l-P';
293
- } else {
294
- rules += ' -usygro_l-bS';
295
- rules += ' -usygro_l-R';
296
- }
244
+ if (props.size === "XL") rules += ' -usygro_l-A';
245
+ else if (props.size === "L") rules += ' -usygro_l-z';
246
+ else if (props.size === "S") rules += ' -usygro_l-x';
247
+ else rules += ' -usygro_l-y';
297
248
  rules += ' m-rwozxi';
298
249
  rules += ' C-375tnm';
299
250
  rules += ' D-375tnn';
@@ -478,7 +429,7 @@ function $a2f262fac286a920$export$b674b8ff01584ab1(props) {
478
429
  function $a2f262fac286a920$export$5510125537491b61(props) {
479
430
  return /*#__PURE__*/ (0, $5rXoR$jsxs)((0, $5rXoR$Fragment), {
480
431
  children: [
481
- /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$Section), {
432
+ /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$ListBoxSection), {
482
433
  ...props,
483
434
  className: (0, $13afb0ea5f0ed767$export$fe2e36411d703b3d),
484
435
  children: props.children
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAqFM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA2D;AAEtG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CN,MAAM;AASN,IAAI,8DAA0B,CAAA,GAAA,oBAAY,EAAkC;IAAC,MAAM;AAAG;AAEtF,SAAS,+BAA2B,MAAuB,EAAE,GAAsB;IACjF,CAAC,QAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,QAAO,KAAK;IACnD,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,aAAK,EAAkB;IACpC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAqB;IAC1C,IAAI,cAAc,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAU;IACvC,SAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,aACF,YAAY,iBACZ,QAAQ,qBACR,aAAa,iBACb,SAAS,SACT,KAAK,EACL,aAAa,kBAAkB,gBAC/B,YAAY,YACZ,QAAQ,SACR,KAAK,QACL,OAAO,oBACP,gBAAgB,mBAChB,aAAa,6BACb,kBAAkB,oBAClB,mBAAmB,kBACnB,YAAY,EACZ,GAAG,aACJ,GAAG;IAEJ,sCAAsC;I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G;YACjB,qBACE;0BACE,cAAA,iBAAC,CAAA,GAAA,eAAO;oBACN,QAAQ;wBACN;4BAAC,CAAA,GAAA,yCAAU;4BAAG;gCACZ,OAAO;oCACL,MAAM;wCAAC,QAAQ,CAAA,GAAA,yCAAa,EAAE;4CAAC,MAAM;4CAAQ,QAAQ,CAAA,GAAA,yCAAgB;wCAAC;wCAAI,QAAQ,CAAA,GAAA,yCAAG;oCAAC;gCACxF;4BACF;yBAAE;wBACF;4BAAC,CAAA,GAAA,yCAAU;4BAAG;gCACZ,OAAO;oCACL,OAAO;wCAAC,QAAQ,CAAA,GAAA,yCAAI,EAAE;kDAAC;wCAAI;oCAAE;oCAC7B,aAAa;wCAAC,QAAQ,CAAA,GAAA,yCAAU,EAAE;4CAAC,GAAG,WAAW;kDAAE;wCAAI;oCAAE;gCAC3D;4BACF;yBAAE;qBACH;;wBACA,CAAC,wBAAU,gBAAC,CAAA,GAAA,wCAAY;4BAAE,MAAM,uCAAiB,CAAC,KAAK;4BAAE,WAAW,CAAA,GAAA,wCAAQ,EAAE;gCAAC,GAAG,WAAW;sCAAE;4BAAI;;wBACnG,OAAO,aAAa,yBAAW,gBAAC,CAAA,GAAA,yCAAG;4BAAE,MAAK;sCAAS;6BAAmB;;;;QAI/E;;AAGN;AAGO,SAAS,0CAAkC,KAA8B;IAC9E,qBACE;;0BACE,gBAAC,CAAA,GAAA,cAAU;gBACR,GAAG,KAAK;gBACT,WAAW,CAAA,GAAA,yCAAM;0BAChB,MAAM,QAAQ;;0BAEjB,gBAAC,CAAA,GAAA,yCAAM;;;AAGb","sources":["packages/@react-spectrum/s2/src/ComboBox.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 {\n ComboBox as AriaComboBox,\n ComboBoxProps as AriaComboBoxProps,\n PopoverProps as AriaPopoverProps,\n Section as AriaSection,\n Button,\n ContextValue,\n InputContext,\n ListBox,\n ListBoxItem,\n ListBoxItemProps,\n ListBoxProps,\n Provider,\n SectionProps\n} from 'react-aria-components';\nimport {baseColor, style} from '../style' with {type: 'macro'};\nimport {centerBaseline} from './CenterBaseline';\nimport {\n checkmark,\n description,\n Divider,\n icon,\n iconCenterWrapper,\n label,\n menuitem,\n section,\n sectionHeader,\n sectionHeading\n} from './Menu';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {createContext, CSSProperties, forwardRef, ReactNode, Ref, useCallback, useContext, useImperativeHandle, useRef, useState} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {HeaderContext, HeadingContext, Text, TextContext} from './Content';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {menu} from './Picker';\nimport {mergeRefs, useResizeObserver} from '@react-aria/utils';\nimport {Placement} from 'react-aria';\nimport {Popover} from './Popover';\nimport {pressScale} from './pressScale';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface ComboboxStyleProps {\n /**\n * The size of the Combobox.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\nexport interface ComboBoxProps<T extends object> extends\n Omit<AriaComboBoxProps<T>, 'children' | 'style' | 'className' | 'defaultFilter' | 'allowsEmptyCollection'>,\n ComboboxStyleProps,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps,\n Pick<ListBoxProps<T>, 'items'>,\n Pick<AriaPopoverProps, 'shouldFlip'> {\n /** The contents of the collection. */\n children: ReactNode | ((item: T) => ReactNode),\n /**\n * Direction the menu will render relative to the Picker.\n *\n * @default 'bottom'\n */\n direction?: 'bottom' | 'top',\n /**\n * Alignment of the menu relative to the input target.\n *\n * @default 'start'\n */\n align?: 'start' | 'end',\n /** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */\n menuWidth?: number\n}\n\nexport const ComboBoxContext = createContext<ContextValue<Partial<ComboBoxProps<any>>, TextFieldRef>>(null);\n\nconst inputButton = style({\n display: 'flex',\n outlineStyle: 'none',\n textAlign: 'center',\n borderStyle: 'none',\n borderRadius: 'control-sm',\n alignItems: 'center',\n justifyContent: 'center',\n size: {\n size: {\n S: 16,\n M: 20,\n L: 24,\n XL: 32\n }\n },\n marginStart: 'text-to-control',\n aspectRatio: 'square',\n flexShrink: 0,\n transition: {\n default: 'default',\n forcedColors: 'none'\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isOpen: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n color: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace'\n }\n }\n});\n\nconst iconStyles = style({\n flexShrink: 0,\n rotate: 90,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nlet InternalComboboxContext = createContext<{size: 'S' | 'M' | 'L' | 'XL'}>({size: 'M'});\n\nfunction ComboBox<T extends object>(props: ComboBoxProps<T>, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, ComboBoxContext);\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let buttonRef = useRef<HTMLButtonElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n direction = 'bottom',\n align = 'start',\n shouldFlip = true,\n menuWidth,\n label,\n description: descriptionMessage,\n errorMessage,\n children,\n items,\n size = 'M',\n labelPosition = 'top',\n labelAlign = 'start',\n necessityIndicator,\n UNSAFE_className = '',\n UNSAFE_style,\n ...pickerProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n // Better way to encode this into a style? need to account for flipping\n let menuOffset: number;\n if (size === 'S') {\n menuOffset = 6;\n } else if (size === 'M') {\n menuOffset = 6;\n } else if (size === 'L') {\n menuOffset = 7;\n } else {\n menuOffset = 8;\n }\n\n let triggerRef = useRef<HTMLDivElement>(null);\n // Make menu width match input + button\n let [triggerWidth, setTriggerWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (triggerRef.current) {\n let inputRect = triggerRef.current.getBoundingClientRect();\n let minX = inputRect.left;\n let maxX = inputRect.right;\n setTriggerWidth((maxX - minX) + 'px');\n }\n }, [triggerRef, setTriggerWidth]);\n\n useResizeObserver({\n ref: triggerRef,\n onResize: onResize\n });\n\n return (\n <AriaComboBox\n {...pickerProps}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n isInForm: !!formContext,\n labelPosition,\n size\n }, props.styles)}>\n {({isDisabled, isOpen, isRequired, isInvalid}) => (\n <>\n <InternalComboboxContext.Provider value={{size}}>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup\n ref={triggerRef}\n role=\"presentation\"\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n size={size}\n styles={style({\n ...fieldInput(),\n paddingStart: 'edge-to-text',\n // better way to do this one? it's not actually half, they are\n // [9, 4], [12, 6], [15, 8], [18, 8]\n // also noticed that our measurement is including the border, making the padding too much\n paddingEnd: '[calc(self(height, self(minHeight)) * 3 / 16)]'\n })({size})}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n <Input />\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n <Button\n ref={buttonRef}\n // Prevent press scale from sticking while ComboBox is open.\n // @ts-ignore\n isPressed={false}\n style={renderProps => pressScale(buttonRef)(renderProps)}\n className={renderProps => inputButton({\n ...renderProps,\n size,\n isOpen\n })}>\n <ChevronIcon\n size={size}\n className={iconStyles} />\n </Button>\n </FieldGroup>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {errorMessage}\n </HelpText>\n <Popover\n hideArrow\n triggerRef={triggerRef}\n offset={menuOffset}\n placement={`${direction} ${align}` as Placement}\n shouldFlip={shouldFlip}\n UNSAFE_style={{\n width: menuWidth ? `${menuWidth}px` : undefined,\n // manually subtract border as we can't set Popover to border-box, it causes the contents to spill out\n '--trigger-width': `calc(${triggerWidth} - 2px)`\n } as CSSProperties}\n styles={style({\n minWidth: '[var(--trigger-width)]',\n width: '[var(--trigger-width)]'\n })}>\n <Provider\n values={[\n [HeaderContext, {styles: sectionHeader({size})}],\n [HeadingContext, {styles: sectionHeading}],\n [TextContext, {\n slots: {\n 'description': {styles: description({size})}\n }\n }]\n ]}>\n <ListBox\n items={items}\n className={menu({size})}>\n {children}\n </ListBox>\n </Provider>\n </Popover>\n </InternalComboboxContext.Provider>\n </>\n )}\n </AriaComboBox>\n );\n}\n\n/**\n * ComboBox allow users to choose a single option from a collapsible list of options when space is limited.\n */\nlet _ComboBox = /*#__PURE__*/ (forwardRef as forwardRefType)(ComboBox);\nexport {_ComboBox as ComboBox};\n\n\nexport interface ComboBoxItemProps extends Omit<ListBoxItemProps, 'children' | 'style' | 'className'>, StyleProps {\n children: ReactNode\n}\n\nconst checkmarkIconSize = {\n S: 'XS',\n M: 'M',\n L: 'L',\n XL: 'XL'\n} as const;\n\nexport function ComboBoxItem(props: ComboBoxItemProps) {\n let ref = useRef(null);\n let isLink = props.href != null;\n let {size} = useContext(InternalComboboxContext);\n return (\n <ListBoxItem\n {...props}\n ref={ref}\n textValue={props.textValue || (typeof props.children === 'string' ? props.children as string : undefined)}\n style={pressScale(ref, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + menuitem({...renderProps, size, isLink}, props.styles)}>\n {(renderProps) => {\n let {children} = props;\n return (\n <>\n <Provider\n values={[\n [IconContext, {\n slots: {\n icon: {render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), styles: icon}\n }\n }],\n [TextContext, {\n slots: {\n label: {styles: label({size})},\n description: {styles: description({...renderProps, size})}\n }\n }]\n ]}>\n {!isLink && <CheckmarkIcon size={checkmarkIconSize[size]} className={checkmark({...renderProps, size})} />}\n {typeof children === 'string' ? <Text slot=\"label\">{children}</Text> : children}\n </Provider>\n </>\n );\n }}\n </ListBoxItem>\n );\n}\n\nexport interface ComboBoxSectionProps<T extends object> extends SectionProps<T> {}\nexport function ComboBoxSection<T extends object>(props: ComboBoxSectionProps<T>) {\n return (\n <>\n <AriaSection\n {...props}\n className={section}>\n {props.children}\n </AriaSection>\n <Divider />\n </>\n );\n}\n"],"names":[],"version":3,"file":"ComboBox.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAqFM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA2D;AAEtG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CN,MAAM;AASN,IAAI,8DAA0B,CAAA,GAAA,oBAAY,EAAkC;IAAC,MAAM;AAAG;AAEt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AAE;4BAAI;;wBACnG,OAAO,aAAa,yBAAW,gBAAC,CAAA,GAAA,yCAAG;4BAAE,MAAK;sCAAS;6BAAmB;;;;QAI/E;;AAGN;AAGO,SAAS,0CAAkC,KAA8B;IAC9E,qBACE;;0BACE,gBAAC,CAAA,GAAA,qBAAiB;gBACf,GAAG,KAAK;gBACT,WAAW,CAAA,GAAA,yCAAM;0BAChB,MAAM,QAAQ;;0BAEjB,gBAAC,CAAA,GAAA,yCAAM;;;AAGb","sources":["packages/@react-spectrum/s2/src/ComboBox.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 {\n ComboBox as AriaComboBox,\n ComboBoxProps as AriaComboBoxProps,\n ListBoxSection as AriaListBoxSection,\n PopoverProps as AriaPopoverProps,\n Button,\n ContextValue,\n InputContext,\n ListBox,\n ListBoxItem,\n ListBoxItemProps,\n ListBoxProps,\n Provider,\n SectionProps\n} from 'react-aria-components';\nimport {baseColor, style} from '../style' with {type: 'macro'};\nimport {centerBaseline} from './CenterBaseline';\nimport {\n checkmark,\n description,\n Divider,\n icon,\n iconCenterWrapper,\n label,\n menuitem,\n section,\n sectionHeader,\n sectionHeading\n} from './Menu';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {createContext, CSSProperties, forwardRef, ReactNode, Ref, useCallback, useContext, useImperativeHandle, useRef, useState} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {HeaderContext, HeadingContext, Text, TextContext} from './Content';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {menu} from './Picker';\nimport {mergeRefs, useResizeObserver} from '@react-aria/utils';\nimport {Placement} from 'react-aria';\nimport {Popover} from './Popover';\nimport {pressScale} from './pressScale';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface ComboboxStyleProps {\n /**\n * The size of the Combobox.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\nexport interface ComboBoxProps<T extends object> extends\n Omit<AriaComboBoxProps<T>, 'children' | 'style' | 'className' | 'defaultFilter' | 'allowsEmptyCollection'>,\n ComboboxStyleProps,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps,\n Pick<ListBoxProps<T>, 'items'>,\n Pick<AriaPopoverProps, 'shouldFlip'> {\n /** The contents of the collection. */\n children: ReactNode | ((item: T) => ReactNode),\n /**\n * Direction the menu will render relative to the Picker.\n *\n * @default 'bottom'\n */\n direction?: 'bottom' | 'top',\n /**\n * Alignment of the menu relative to the input target.\n *\n * @default 'start'\n */\n align?: 'start' | 'end',\n /** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */\n menuWidth?: number\n}\n\nexport const ComboBoxContext = createContext<ContextValue<Partial<ComboBoxProps<any>>, TextFieldRef>>(null);\n\nconst inputButton = style({\n display: 'flex',\n outlineStyle: 'none',\n textAlign: 'center',\n borderStyle: 'none',\n borderRadius: 'control-sm',\n alignItems: 'center',\n justifyContent: 'center',\n size: {\n size: {\n S: 16,\n M: 20,\n L: 24,\n XL: 32\n }\n },\n marginStart: 'text-to-control',\n aspectRatio: 'square',\n flexShrink: 0,\n transition: {\n default: 'default',\n forcedColors: 'none'\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isOpen: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n color: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace'\n }\n }\n});\n\nconst iconStyles = style({\n flexShrink: 0,\n rotate: 90,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nlet InternalComboboxContext = createContext<{size: 'S' | 'M' | 'L' | 'XL'}>({size: 'M'});\n\nfunction ComboBox<T extends object>(props: ComboBoxProps<T>, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, ComboBoxContext);\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let buttonRef = useRef<HTMLButtonElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n direction = 'bottom',\n align = 'start',\n shouldFlip = true,\n menuWidth,\n label,\n description: descriptionMessage,\n errorMessage,\n children,\n items,\n size = 'M',\n labelPosition = 'top',\n labelAlign = 'start',\n necessityIndicator,\n UNSAFE_className = '',\n UNSAFE_style,\n ...pickerProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n // Better way to encode this into a style? need to account for flipping\n let menuOffset: number;\n if (size === 'S') {\n menuOffset = 6;\n } else if (size === 'M') {\n menuOffset = 6;\n } else if (size === 'L') {\n menuOffset = 7;\n } else {\n menuOffset = 8;\n }\n\n let triggerRef = useRef<HTMLDivElement>(null);\n // Make menu width match input + button\n let [triggerWidth, setTriggerWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (triggerRef.current) {\n let inputRect = triggerRef.current.getBoundingClientRect();\n let minX = inputRect.left;\n let maxX = inputRect.right;\n setTriggerWidth((maxX - minX) + 'px');\n }\n }, [triggerRef, setTriggerWidth]);\n\n useResizeObserver({\n ref: triggerRef,\n onResize: onResize\n });\n\n return (\n <AriaComboBox\n {...pickerProps}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n isInForm: !!formContext,\n labelPosition,\n size\n }, props.styles)}>\n {({isDisabled, isOpen, isRequired, isInvalid}) => (\n <>\n <InternalComboboxContext.Provider value={{size}}>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup\n ref={triggerRef}\n role=\"presentation\"\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n size={size}\n styles={style({\n ...fieldInput(),\n paddingStart: 'edge-to-text',\n // better way to do this one? it's not actually half, they are\n // [9, 4], [12, 6], [15, 8], [18, 8]\n // also noticed that our measurement is including the border, making the padding too much\n paddingEnd: '[calc(self(height, self(minHeight)) * 3 / 16)]'\n })({size})}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n <Input />\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n <Button\n ref={buttonRef}\n // Prevent press scale from sticking while ComboBox is open.\n // @ts-ignore\n isPressed={false}\n style={renderProps => pressScale(buttonRef)(renderProps)}\n className={renderProps => inputButton({\n ...renderProps,\n size,\n isOpen\n })}>\n <ChevronIcon\n size={size}\n className={iconStyles} />\n </Button>\n </FieldGroup>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {errorMessage}\n </HelpText>\n <Popover\n hideArrow\n triggerRef={triggerRef}\n offset={menuOffset}\n placement={`${direction} ${align}` as Placement}\n shouldFlip={shouldFlip}\n UNSAFE_style={{\n width: menuWidth ? `${menuWidth}px` : undefined,\n // manually subtract border as we can't set Popover to border-box, it causes the contents to spill out\n '--trigger-width': `calc(${triggerWidth} - 2px)`\n } as CSSProperties}\n styles={style({\n minWidth: '[var(--trigger-width)]',\n width: '[var(--trigger-width)]'\n })}>\n <Provider\n values={[\n [HeaderContext, {styles: sectionHeader({size})}],\n [HeadingContext, {styles: sectionHeading}],\n [TextContext, {\n slots: {\n 'description': {styles: description({size})}\n }\n }]\n ]}>\n <ListBox\n items={items}\n className={menu({size})}>\n {children}\n </ListBox>\n </Provider>\n </Popover>\n </InternalComboboxContext.Provider>\n </>\n )}\n </AriaComboBox>\n );\n}\n\n/**\n * ComboBox allow users to choose a single option from a collapsible list of options when space is limited.\n */\nlet _ComboBox = /*#__PURE__*/ (forwardRef as forwardRefType)(ComboBox);\nexport {_ComboBox as ComboBox};\n\n\nexport interface ComboBoxItemProps extends Omit<ListBoxItemProps, 'children' | 'style' | 'className'>, StyleProps {\n children: ReactNode\n}\n\nconst checkmarkIconSize = {\n S: 'XS',\n M: 'M',\n L: 'L',\n XL: 'XL'\n} as const;\n\nexport function ComboBoxItem(props: ComboBoxItemProps) {\n let ref = useRef(null);\n let isLink = props.href != null;\n let {size} = useContext(InternalComboboxContext);\n return (\n <ListBoxItem\n {...props}\n ref={ref}\n textValue={props.textValue || (typeof props.children === 'string' ? props.children as string : undefined)}\n style={pressScale(ref, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + menuitem({...renderProps, size, isLink}, props.styles)}>\n {(renderProps) => {\n let {children} = props;\n return (\n <>\n <Provider\n values={[\n [IconContext, {\n slots: {\n icon: {render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), styles: icon}\n }\n }],\n [TextContext, {\n slots: {\n label: {styles: label({size})},\n description: {styles: description({...renderProps, size})}\n }\n }]\n ]}>\n {!isLink && <CheckmarkIcon size={checkmarkIconSize[size]} className={checkmark({...renderProps, size})} />}\n {typeof children === 'string' ? <Text slot=\"label\">{children}</Text> : children}\n </Provider>\n </>\n );\n }}\n </ListBoxItem>\n );\n}\n\nexport interface ComboBoxSectionProps<T extends object> extends SectionProps<T> {}\nexport function ComboBoxSection<T extends object>(props: ComboBoxSectionProps<T>) {\n return (\n <>\n <AriaListBoxSection\n {...props}\n className={section}>\n {props.children}\n </AriaListBoxSection>\n <Divider />\n </>\n );\n}\n"],"names":[],"version":3,"file":"ComboBox.mjs.map"}
@@ -96,7 +96,7 @@ function $bab829476f85a155$var$ContextualHelp(props, ref) {
96
96
  [
97
97
  (0, $6367bc87eb7d24ad$exports.HeadingContext),
98
98
  {
99
- styles: " . _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _di _dbj _ee _e-1x99dloe _fa _f-1x99dlob ao Aa B-y6pz8c Bb-8hx8xw ya za"
99
+ styles: " . _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _di _dbj _ee _e-1x99dloe _fa _f-1x99dlob ao Aa B-1ya11p4 ya za"
100
100
  }
101
101
  ],
102
102
  [
@@ -61,8 +61,8 @@
61
61
  margin-top: 0;
62
62
  }
63
63
 
64
- .B-y6pz8c {
65
- margin-bottom: .5rem;
64
+ .B-1ya11p4 {
65
+ margin-bottom: calc(.5rem * var(--s2-scale));
66
66
  }
67
67
 
68
68
  .ya {
@@ -164,10 +164,6 @@
164
164
  font-size: 1.375rem;
165
165
  }
166
166
 
167
- .Bb-8hx8xw {
168
- margin-bottom: .625rem;
169
- }
170
-
171
167
  ._dbf {
172
168
  font-size: 1.0625rem;
173
169
  }
@@ -1 +1 @@
1
- {"mappings":"ACyCgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8DuC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAQf;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAQD;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA9EvB;EAsEwB;;;;;;EAAA;;;;EAQD;;;;EAAA;;;;;AA9EvB;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAsEwB;EAAA;IAAA;;;;IAAA;;;;IAKA;;;;;;AAAA","sources":["019fb1fcc3c1598d","packages/@react-spectrum/s2/src/ContextualHelp.tsx"],"sourcesContent":["@import \"3578337ca657fa78\";\n@import \"a023844b8de14349\";\n@import \"3be9de50ea21a4ea\";\n@import \"5266771b1d67e2fb\";\n@import \"ccaa61f08a335ea7\";\n","import {ActionButton} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {ContentContext, FooterContext, HeadingContext} from './Content';\nimport {ContextValue, DEFAULT_SLOT, Provider, Dialog as RACDialog, TextContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {dialogInner} from './Dialog';\nimport {DialogTrigger, DialogTriggerProps} from './DialogTrigger';\nimport {filterDOMProps, mergeProps, useLabels} from '@react-aria/utils';\nimport HelpIcon from '../s2wf-icons/S2_Icon_HelpCircle_20_N.svg';\nimport InfoIcon from '../s2wf-icons/S2_Icon_InfoCircle_20_N.svg';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeStyles} from '../style/runtime';\nimport {Popover, PopoverProps} from './Popover';\nimport {style, size as styleSize} from '../style' with {type: 'macro'};\nimport {StyleProps} from './style-utils' with { type: 'macro' };\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ContextualHelpStyleProps {\n /**\n * Indicates whether contents are informative or provides helpful guidance.\n *\n * @default 'help'\n */\n variant?: 'info' | 'help'\n}\nexport interface ContextualHelpProps extends\n Pick<DialogTriggerProps, 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'shouldFlip' | 'offset' | 'crossOffset' | 'placement'>,\n Pick<PopoverProps, 'containerPadding'>,\n ContextualHelpStyleProps, StyleProps, DOMProps, AriaLabelingProps {\n /** Contents of the Contextual Help popover. */\n children?: ReactNode,\n /**\n * The size of the ActionButton.\n *\n * @default 'XS'\n */\n size?: 'XS' | 'S'\n}\n\nconst popover = style({\n fontFamily: 'sans',\n minWidth: '[218px]',\n width: '[218px]',\n padding: 24\n});\n\nexport const ContextualHelpContext = createContext<ContextValue<ContextualHelpProps, FocusableRefValue<HTMLButtonElement>>>(null);\n\nfunction ContextualHelp(props: ContextualHelpProps, ref: FocusableRef<HTMLButtonElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, ContextualHelpContext);\n let {\n children,\n defaultOpen,\n // containerPadding = 24, // See popover() above. Issue noted in Popover.tsx.\n size = 'XS',\n crossOffset,\n isOpen,\n offset = 8,\n onOpenChange,\n placement = 'bottom start',\n shouldFlip,\n UNSAFE_className,\n UNSAFE_style,\n styles,\n variant = 'help'\n } = props;\n\n // In a FieldLabel we're getting the context's aria-labeledby, so we need to\n // manually set the aria-label after useLabels() to keep the order of label\n // then ContextualHelp variant\n let labelProps = useLabels(props);\n let label = stringFormatter.format(`contextualhelp.${variant}`);\n labelProps['aria-label'] = labelProps['aria-label'] ? labelProps['aria-label'] + ' ' + label : label;\n\n let buttonProps = filterDOMProps(props, {labelable: true});\n\n return (\n <DialogTrigger\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}>\n <ActionButton\n slot={null}\n ref={ref}\n size={size}\n {...mergeProps(buttonProps, labelProps)}\n UNSAFE_style={UNSAFE_style}\n UNSAFE_className={UNSAFE_className}\n styles={styles}\n isQuiet>\n {variant === 'info' ? <InfoIcon /> : <HelpIcon />}\n </ActionButton>\n <Popover\n placement={placement}\n shouldFlip={shouldFlip}\n // not working => containerPadding={containerPadding}\n offset={offset}\n crossOffset={crossOffset}\n hideArrow\n UNSAFE_className={popover}>\n <RACDialog className={mergeStyles(dialogInner, style({borderRadius: 'none'}))}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {}\n }\n }],\n [HeadingContext, {styles: style({\n font: 'heading-xs',\n margin: 0,\n marginBottom: styleSize(8) // This only makes it 10px on mobile and should be 12px\n })}],\n [ContentContext, {styles: style({\n font: 'body-sm'\n })}],\n [FooterContext, {styles: style({\n font: 'body-sm',\n marginTop: 16\n })}]\n ]}>\n {children}\n </Provider>\n </RACDialog>\n </Popover>\n </DialogTrigger>\n );\n}\n\n/**\n * Contextual help shows a user extra information about the state of an adjacent component, or a total view.\n */\nlet _ContextualHelp = forwardRef(ContextualHelp);\nexport {_ContextualHelp as ContextualHelp};\n"],"names":[],"version":3,"file":"ContextualHelp.css.map"}
1
+ {"mappings":"ACyCgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8DuC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAQf;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAQD;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA9EvB;EAsEwB;;;;;;EAAA;;;;EAQD;;;;EAAA;;;;;AA9EvB;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAsEwB;EAAA;IAAA;;;;IAKA;;;;;;AAAA","sources":["019fb1fcc3c1598d","packages/@react-spectrum/s2/src/ContextualHelp.tsx"],"sourcesContent":["@import \"3578337ca657fa78\";\n@import \"a023844b8de14349\";\n@import \"3be9de50ea21a4ea\";\n@import \"5266771b1d67e2fb\";\n@import \"ccaa61f08a335ea7\";\n","import {ActionButton} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {ContentContext, FooterContext, HeadingContext} from './Content';\nimport {ContextValue, DEFAULT_SLOT, Provider, Dialog as RACDialog, TextContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {dialogInner} from './Dialog';\nimport {DialogTrigger, DialogTriggerProps} from './DialogTrigger';\nimport {filterDOMProps, mergeProps, useLabels} from '@react-aria/utils';\nimport HelpIcon from '../s2wf-icons/S2_Icon_HelpCircle_20_N.svg';\nimport InfoIcon from '../s2wf-icons/S2_Icon_InfoCircle_20_N.svg';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeStyles} from '../style/runtime';\nimport {Popover, PopoverProps} from './Popover';\nimport {style, size as styleSize} from '../style' with {type: 'macro'};\nimport {StyleProps} from './style-utils' with { type: 'macro' };\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ContextualHelpStyleProps {\n /**\n * Indicates whether contents are informative or provides helpful guidance.\n *\n * @default 'help'\n */\n variant?: 'info' | 'help'\n}\nexport interface ContextualHelpProps extends\n Pick<DialogTriggerProps, 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'shouldFlip' | 'offset' | 'crossOffset' | 'placement'>,\n Pick<PopoverProps, 'containerPadding'>,\n ContextualHelpStyleProps, StyleProps, DOMProps, AriaLabelingProps {\n /** Contents of the Contextual Help popover. */\n children?: ReactNode,\n /**\n * The size of the ActionButton.\n *\n * @default 'XS'\n */\n size?: 'XS' | 'S'\n}\n\nconst popover = style({\n fontFamily: 'sans',\n minWidth: '[218px]',\n width: '[218px]',\n padding: 24\n});\n\nexport const ContextualHelpContext = createContext<ContextValue<ContextualHelpProps, FocusableRefValue<HTMLButtonElement>>>(null);\n\nfunction ContextualHelp(props: ContextualHelpProps, ref: FocusableRef<HTMLButtonElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, ContextualHelpContext);\n let {\n children,\n defaultOpen,\n // containerPadding = 24, // See popover() above. Issue noted in Popover.tsx.\n size = 'XS',\n crossOffset,\n isOpen,\n offset = 8,\n onOpenChange,\n placement = 'bottom start',\n shouldFlip,\n UNSAFE_className,\n UNSAFE_style,\n styles,\n variant = 'help'\n } = props;\n\n // In a FieldLabel we're getting the context's aria-labeledby, so we need to\n // manually set the aria-label after useLabels() to keep the order of label\n // then ContextualHelp variant\n let labelProps = useLabels(props);\n let label = stringFormatter.format(`contextualhelp.${variant}`);\n labelProps['aria-label'] = labelProps['aria-label'] ? labelProps['aria-label'] + ' ' + label : label;\n\n let buttonProps = filterDOMProps(props, {labelable: true});\n\n return (\n <DialogTrigger\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}>\n <ActionButton\n slot={null}\n ref={ref}\n size={size}\n {...mergeProps(buttonProps, labelProps)}\n UNSAFE_style={UNSAFE_style}\n UNSAFE_className={UNSAFE_className}\n styles={styles}\n isQuiet>\n {variant === 'info' ? <InfoIcon /> : <HelpIcon />}\n </ActionButton>\n <Popover\n placement={placement}\n shouldFlip={shouldFlip}\n // not working => containerPadding={containerPadding}\n offset={offset}\n crossOffset={crossOffset}\n hideArrow\n UNSAFE_className={popover}>\n <RACDialog className={mergeStyles(dialogInner, style({borderRadius: 'none'}))}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {}\n }\n }],\n [HeadingContext, {styles: style({\n font: 'heading-xs',\n margin: 0,\n marginBottom: styleSize(8) // This only makes it 10px on mobile and should be 12px\n })}],\n [ContentContext, {styles: style({\n font: 'body-sm'\n })}],\n [FooterContext, {styles: style({\n font: 'body-sm',\n marginTop: 16\n })}]\n ]}>\n {children}\n </Provider>\n </RACDialog>\n </Popover>\n </DialogTrigger>\n );\n}\n\n/**\n * Contextual help shows a user extra information about the state of an adjacent component, or a total view.\n */\nlet _ContextualHelp = forwardRef(ContextualHelp);\nexport {_ContextualHelp as ContextualHelp};\n"],"names":[],"version":3,"file":"ContextualHelp.css.map"}
@@ -89,7 +89,7 @@ function $8e176595bc49ca3f$var$ContextualHelp(props, ref) {
89
89
  [
90
90
  (0, $8e847109a6ab556d$export$d688439359537581),
91
91
  {
92
- styles: " . _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _di _dbj _ee _e-1x99dloe _fa _f-1x99dlob ao Aa B-y6pz8c Bb-8hx8xw ya za"
92
+ styles: " . _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _di _dbj _ee _e-1x99dloe _fa _f-1x99dlob ao Aa B-1ya11p4 ya za"
93
93
  }
94
94
  ],
95
95
  [
package/dist/Dialog.cjs CHANGED
@@ -46,7 +46,7 @@ $parcel$export(module.exports, "dialogInner", () => $0f4636c7093b9233$export$6af
46
46
 
47
47
 
48
48
 
49
- const $0f4636c7093b9233$var$image = " . l4 k-37m3s2 __Nb";
49
+ const $0f4636c7093b9233$var$image = " . lG k-37m3s2 __Nb";
50
50
  const $0f4636c7093b9233$var$heading = " . _9-3t1y Aa Ba _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _dj _dbm _ee _e-1x99dloe _fa _f-1x99dlob ao";
51
51
  const $0f4636c7093b9233$var$header = " . _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _di _dbj _eb _fb _f-1x99dloc an";
52
52
  const $0f4636c7093b9233$var$content = function anonymous(props) {
@@ -76,7 +76,7 @@ const $0f4636c7093b9233$var$content = function anonymous(props) {
76
76
  return rules;
77
77
  };
78
78
  const $0f4636c7093b9233$var$footer = " . _9-3t1y _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _dg _dbh _eb _fb _f-1x99dloc an";
79
- const $0f4636c7093b9233$var$buttonGroup = " . y_d r4";
79
+ const $0f4636c7093b9233$var$buttonGroup = " . y_d rG";
80
80
  const $0f4636c7093b9233$export$8b93a07348a7730c = /*#__PURE__*/ (0, $WjfVF$react.createContext)({
81
81
  type: 'modal',
82
82
  isDismissable: false,
package/dist/Dialog.css CHANGED
@@ -1,5 +1,5 @@
1
1
  @layer _.a {
2
- .l4 {
2
+ .lG {
3
3
  width: 100%;
4
4
  }
5
5
 
@@ -67,7 +67,7 @@
67
67
  margin-inline-start: auto;
68
68
  }
69
69
 
70
- .r4 {
70
+ .rG {
71
71
  max-width: 100%;
72
72
  }
73
73
 
package/dist/Dialog.mjs CHANGED
@@ -38,7 +38,7 @@ function $parcel$interopDefault(a) {
38
38
 
39
39
 
40
40
 
41
- const $9bbc115952dac5a6$var$image = " . l4 k-37m3s2 __Nb";
41
+ const $9bbc115952dac5a6$var$image = " . lG k-37m3s2 __Nb";
42
42
  const $9bbc115952dac5a6$var$heading = " . _9-3t1y Aa Ba _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _dj _dbm _ee _e-1x99dloe _fa _f-1x99dlob ao";
43
43
  const $9bbc115952dac5a6$var$header = " . _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _di _dbj _eb _fb _f-1x99dloc an";
44
44
  const $9bbc115952dac5a6$var$content = function anonymous(props) {
@@ -68,7 +68,7 @@ const $9bbc115952dac5a6$var$content = function anonymous(props) {
68
68
  return rules;
69
69
  };
70
70
  const $9bbc115952dac5a6$var$footer = " . _9-3t1y _ca _c-enzrfpb _c-enzwzjc _c-enzykdd _c-enzzrge _c-eo0c6sf _c-1uotwbwg _c-bc1l9oh _dg _dbh _eb _fb _f-1x99dloc an";
71
- const $9bbc115952dac5a6$var$buttonGroup = " . y_d r4";
71
+ const $9bbc115952dac5a6$var$buttonGroup = " . y_d rG";
72
72
  const $9bbc115952dac5a6$export$8b93a07348a7730c = /*#__PURE__*/ (0, $9Rtwv$createContext)({
73
73
  type: 'modal',
74
74
  isDismissable: false,
@@ -58,10 +58,7 @@ const $4e301a98f0cc4e4f$var$disclosure = function anonymous(props, overrides) {
58
58
  rules += ' ta';
59
59
  rules += ' wa';
60
60
  rules += ' ch';
61
- if (!$q) {
62
- rules += ' qb-z005a2';
63
- rules += ' q-ffvo8f';
64
- }
61
+ if (!$q) rules += ' q-1efr0vf';
65
62
  return rules;
66
63
  };
67
64
  function $4e301a98f0cc4e4f$var$Disclosure(props, ref) {
@@ -144,7 +141,7 @@ const $4e301a98f0cc4e4f$var$buttonStyles = function anonymous(props) {
144
141
  rules += ' i-10cd9hn';
145
142
  rules += ' j-10cd9hn';
146
143
  rules += ' o-375tou';
147
- rules += ' l4';
144
+ rules += ' lG';
148
145
  if (props.isPressed) rules += ' b-mufwl5';
149
146
  else if (props.isHovered) rules += ' b-1tgz9bq';
150
147
  else if (props.isFocusVisible) rules += ' b-1tgz9bq';
@@ -171,49 +168,21 @@ const $4e301a98f0cc4e4f$var$buttonStyles = function anonymous(props) {
171
168
  rules += ' _ja';
172
169
  rules += ' __R-yksgrp';
173
170
  if (props.size === "XL") {
174
- if (props.density === "spacious") {
175
- rules += ' -_375tou_o-bC';
176
- rules += ' -_375tou_o-B';
177
- } else if (props.density === "regular") {
178
- rules += ' -_375tou_o-bA';
179
- rules += ' -_375tou_o-z';
180
- } else if (props.density === "compact") {
181
- rules += ' -_375tou_o-by';
182
- rules += ' -_375tou_o-x';
183
- }
171
+ if (props.density === "spacious") rules += ' -_375tou_o-p';
172
+ else if (props.density === "regular") rules += ' -_375tou_o-o';
173
+ else if (props.density === "compact") rules += ' -_375tou_o-n';
184
174
  } else if (props.size === "L") {
185
- if (props.density === "spacious") {
186
- rules += ' -_375tou_o-bA';
187
- rules += ' -_375tou_o-z';
188
- } else if (props.density === "regular") {
189
- rules += ' -_375tou_o-by';
190
- rules += ' -_375tou_o-x';
191
- } else if (props.density === "compact") {
192
- rules += ' -_375tou_o-bu';
193
- rules += ' -_375tou_o-r';
194
- }
175
+ if (props.density === "spacious") rules += ' -_375tou_o-o';
176
+ else if (props.density === "regular") rules += ' -_375tou_o-n';
177
+ else if (props.density === "compact") rules += ' -_375tou_o-l';
195
178
  } else if (props.size === "M") {
196
- if (props.density === "spacious") {
197
- rules += ' -_375tou_o-by';
198
- rules += ' -_375tou_o-x';
199
- } else if (props.density === "regular") {
200
- rules += ' -_375tou_o-bu';
201
- rules += ' -_375tou_o-r';
202
- } else if (props.density === "compact") {
203
- rules += ' -_375tou_o-br';
204
- rules += ' -_375tou_o-q';
205
- }
179
+ if (props.density === "spacious") rules += ' -_375tou_o-n';
180
+ else if (props.density === "regular") rules += ' -_375tou_o-l';
181
+ else if (props.density === "compact") rules += ' -_375tou_o-j';
206
182
  } else if (props.size === "S") {
207
- if (props.density === "spacious") {
208
- rules += ' -_375tou_o-bu';
209
- rules += ' -_375tou_o-r';
210
- } else if (props.density === "regular") {
211
- rules += ' -_375tou_o-br';
212
- rules += ' -_375tou_o-q';
213
- } else if (props.density === "compact") {
214
- rules += ' -_375tou_o-bn';
215
- rules += ' -_375tou_o-m';
216
- }
183
+ if (props.density === "spacious") rules += ' -_375tou_o-l';
184
+ else if (props.density === "regular") rules += ' -_375tou_o-j';
185
+ else if (props.density === "compact") rules += ' -_375tou_o-h';
217
186
  }
218
187
  rules += ' -_375tp0_u-a';
219
188
  rules += ' -_375tp1_v-a';
@@ -332,24 +301,16 @@ const $4e301a98f0cc4e4f$var$panelStyles = function anonymous(props) {
332
301
  if (props.isExpanded) rules += ' Ed';
333
302
  if (props.isExpanded) rules += ' Ff';
334
303
  if (props.isExpanded) {
335
- if (props.size === "XL") {
336
- rules += ' Cb-yk4pb9';
337
- rules += ' C-1p15uv3';
338
- } else if (props.size === "L") rules += ' Ce';
339
- else if (props.size === "M") {
340
- rules += ' Cb-1itkwgp';
341
- rules += ' C-1ch0ogp';
342
- } else if (props.size === "S") rules += ' Cd';
304
+ if (props.size === "XL") rules += ' C-wukrgb';
305
+ else if (props.size === "L") rules += ' Ce';
306
+ else if (props.size === "M") rules += ' C-1dtpt05';
307
+ else if (props.size === "S") rules += ' Cd';
343
308
  }
344
309
  if (props.isExpanded) {
345
- if (props.size === "XL") {
346
- rules += ' Db-yk4pb9';
347
- rules += ' D-1p15uv3';
348
- } else if (props.size === "L") rules += ' De';
349
- else if (props.size === "M") {
350
- rules += ' Db-1itkwgp';
351
- rules += ' D-1ch0ogp';
352
- } else if (props.size === "S") rules += ' Dd';
310
+ if (props.size === "XL") rules += ' D-wukrgb';
311
+ else if (props.size === "L") rules += ' De';
312
+ else if (props.size === "M") rules += ' D-1dtpt05';
313
+ else if (props.size === "S") rules += ' Dd';
353
314
  }
354
315
  return rules;
355
316
  };
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+BM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAgF;AAE7H,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;AAwBN,SAAS,iCAAW,KAAsB,EAAE,GAA2B;IACrE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,QACF,OAAO,cACP,UAAU,oBACV,OAAO,gBACP,YAAY,oBACZ,mBAAmB,IACpB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI,YAAY,CAAA,GAAA,uBAAS,EAAE,+CAAuB;IAElD,qBACE,gCAAC,CAAA,GAAA,mCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmB;0BAAC;6BAAM;6BAAS;gBAAO;aAAE;SAC9C;kBACD,cAAA,gC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,oCAAa,EAAE;IAChC,IAAI,QAAC,IAAI,EAAC,GAAG,CAAA,GAAA,4CAAgB,EAAE;IAC/B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAqB;IACnD,IAAI,WAAW,CAAA,GAAA,mCAAQ,EAAE;IACzB,qBACE,gCAAC,CAAA,GAAA,0CAAiB;QACf,GAAG,QAAQ;QACZ,KAAK;QACL,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,kCAAY;kBAAC;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB;AAEA;;CAEC,GACD,IAAI,0DAAmB,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Disclosure.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 {ActionButtonContext} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, size as sizeValue, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 1,\n isQuiet: 0,\n isInGroup: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n let isInGroup = useContext(DisclosureContext) !== null;\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet, isInGroup}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\ninterface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0,\n flexGrow: 1\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-300', 'transparent-white-300')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nconst InternalDisclosureHeader = createContext<{} | null>(null);\n\nfunction DisclosureHeaderWithForwardRef(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_className,\n UNSAFE_style,\n children\n } = props;\n let domRef = useDOMRef(ref);\n let {size, isQuiet, density} = useSlottedContext(DisclosureContext)!;\n\n let mapSize = {\n S: 'XS',\n M: 'S',\n L: 'M',\n XL: 'L'\n };\n\n // maps to one size smaller in the compact density to ensure there is space between the top and bottom of the action button and container\n let newSize : 'XS' | 'S' | 'M' | 'L' | 'XL' | undefined = size;\n if (density === 'compact') {\n newSize = mapSize[size ?? 'M'] as 'XS' | 'S' | 'M' | 'L';\n }\n\n return (\n <Provider\n values={[\n [ActionButtonContext, {size: newSize, isQuiet}],\n [InternalDisclosureHeader, {}]\n ]}>\n <div\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + style({display: 'flex', alignItems: 'center', gap: 4})}\n ref={domRef}>\n {children}\n </div>\n </Provider>\n );\n}\n\n/**\n * A wrapper element for the disclosure title that can contain other elements not part of the trigger.\n */\nexport const DisclosureHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosureHeaderWithForwardRef);\n\nfunction DisclosureTitle(props: DisclosureTitleProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n\n let buttonTrigger = (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n let ctx = useContext(InternalDisclosureHeader);\n if (ctx) {\n return buttonTrigger;\n }\n\n return (\n <DisclosureHeader>\n {buttonTrigger}\n </DisclosureHeader>\n );\n}\n\n/**\n * A disclosure title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureTitle = forwardRef(DisclosureTitle);\nexport {_DisclosureTitle as DisclosureTitle};\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+BM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAgF;AAE7H,MAAM;;;;;;;;;;;;;;;;;;;;;;AAwBN,SAAS,iCAAW,KAAsB,EAAE,GAA2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,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,KACF,OAAO;IAGT,qBACE,gCAAC;kBACE;;AAGP;AAEA;;CAEC,GACD,IAAI,0DAAmB,CAAA,GAAA,uBAAS,EAAE;AAOlC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBN,SAAS,sCAAgB,KAA2B,EAAE,GAA2B;IAC/E,IAAI,gBACF,YAAY,oBACZ,mBAAmB,IACnB,GAAG,YACJ,GAAG;IACJ,MAAM,WAAW,CAAA,GAAA,oCAAa,EAAE;IAChC,IAAI,QAAC,IAAI,EAAC,GAAG,CAAA,GAAA,4CAAgB,EAAE;IAC/B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAqB;IACnD,IAAI,WAAW,CAAA,GAAA,mCAAQ,EAAE;IACzB,qBACE,gCAAC,CAAA,GAAA,0CAAiB;QACf,GAAG,QAAQ;QACZ,KAAK;QACL,OAAO;QACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,kCAAY;kBAAC;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB;AAEA;;CAEC,GACD,IAAI,0DAAmB,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Disclosure.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 {ActionButtonContext} from './ActionButton';\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {focusRing, lightDark, size as sizeValue, style} from '../style' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends Omit<RACDisclosureProps, 'className' | 'style' | 'children'>, StyleProps {\n /**\n * The size of the disclosure.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 1,\n isQuiet: 0,\n isInGroup: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n let isInGroup = useContext(DisclosureContext) !== null;\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet, isInGroup}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureTitleProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\ninterface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0,\n flexGrow: 1\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-300', 'transparent-white-300')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nconst InternalDisclosureHeader = createContext<{} | null>(null);\n\nfunction DisclosureHeaderWithForwardRef(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_className,\n UNSAFE_style,\n children\n } = props;\n let domRef = useDOMRef(ref);\n let {size, isQuiet, density} = useSlottedContext(DisclosureContext)!;\n\n let mapSize = {\n S: 'XS',\n M: 'S',\n L: 'M',\n XL: 'L'\n };\n\n // maps to one size smaller in the compact density to ensure there is space between the top and bottom of the action button and container\n let newSize : 'XS' | 'S' | 'M' | 'L' | 'XL' | undefined = size;\n if (density === 'compact') {\n newSize = mapSize[size ?? 'M'] as 'XS' | 'S' | 'M' | 'L';\n }\n\n return (\n <Provider\n values={[\n [ActionButtonContext, {size: newSize, isQuiet}],\n [InternalDisclosureHeader, {}]\n ]}>\n <div\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + style({display: 'flex', alignItems: 'center', gap: 4})}\n ref={domRef}>\n {children}\n </div>\n </Provider>\n );\n}\n\n/**\n * A wrapper element for the disclosure title that can contain other elements not part of the trigger.\n */\nexport const DisclosureHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosureHeaderWithForwardRef);\n\nfunction DisclosureTitle(props: DisclosureTitleProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n\n let buttonTrigger = (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n let ctx = useContext(InternalDisclosureHeader);\n if (ctx) {\n return buttonTrigger;\n }\n\n return (\n <DisclosureHeader>\n {buttonTrigger}\n </DisclosureHeader>\n );\n}\n\n/**\n * A disclosure title consisting of a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureTitle = forwardRef(DisclosureTitle);\nexport {_DisclosureTitle as DisclosureTitle};\n\nexport interface DisclosurePanelProps extends Omit<RACDisclosurePanelProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}