@react-spectrum/s2 3.0.0-nightly-1b425caa2-250114 → 3.0.0-nightly-1286a652e-250116

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 (162) hide show
  1. package/dist/Accordion.css +1 -5
  2. package/dist/Accordion.css.map +1 -1
  3. package/dist/ActionBar.cjs +3 -4
  4. package/dist/ActionBar.cjs.map +1 -1
  5. package/dist/ActionBar.css +9 -15
  6. package/dist/ActionBar.css.map +1 -1
  7. package/dist/ActionBar.mjs +3 -4
  8. package/dist/ActionBar.mjs.map +1 -1
  9. package/dist/ActionButton.css +0 -6
  10. package/dist/ActionButton.css.map +1 -1
  11. package/dist/ActionButtonGroup.css +1 -5
  12. package/dist/ActionButtonGroup.css.map +1 -1
  13. package/dist/AlertDialog.css +1 -5
  14. package/dist/AlertDialog.css.map +1 -1
  15. package/dist/Avatar.css +1 -5
  16. package/dist/Avatar.css.map +1 -1
  17. package/dist/AvatarGroup.css +0 -6
  18. package/dist/AvatarGroup.css.map +1 -1
  19. package/dist/Badge.css +0 -6
  20. package/dist/Badge.css.map +1 -1
  21. package/dist/Breadcrumbs.cjs +2 -2
  22. package/dist/Breadcrumbs.cjs.map +1 -1
  23. package/dist/Breadcrumbs.css +0 -6
  24. package/dist/Breadcrumbs.css.map +1 -1
  25. package/dist/Breadcrumbs.mjs +2 -2
  26. package/dist/Breadcrumbs.mjs.map +1 -1
  27. package/dist/Button.css +0 -6
  28. package/dist/Button.css.map +1 -1
  29. package/dist/ButtonGroup.css +1 -5
  30. package/dist/ButtonGroup.css.map +1 -1
  31. package/dist/Card.cjs +1 -1
  32. package/dist/Card.cjs.map +1 -1
  33. package/dist/Card.css +0 -6
  34. package/dist/Card.css.map +1 -1
  35. package/dist/Card.mjs +2 -2
  36. package/dist/Card.mjs.map +1 -1
  37. package/dist/CardView.css +1 -5
  38. package/dist/CardView.css.map +1 -1
  39. package/dist/CenterBaseline.css +1 -5
  40. package/dist/CenterBaseline.css.map +1 -1
  41. package/dist/Checkbox.css +0 -6
  42. package/dist/Checkbox.css.map +1 -1
  43. package/dist/CheckboxGroup.css +0 -6
  44. package/dist/CheckboxGroup.css.map +1 -1
  45. package/dist/ClearButton.css +1 -5
  46. package/dist/ClearButton.css.map +1 -1
  47. package/dist/CloseButton.css +1 -5
  48. package/dist/CloseButton.css.map +1 -1
  49. package/dist/ColorArea.css +1 -5
  50. package/dist/ColorArea.css.map +1 -1
  51. package/dist/ColorField.css +0 -6
  52. package/dist/ColorField.css.map +1 -1
  53. package/dist/ColorHandle.css +1 -5
  54. package/dist/ColorHandle.css.map +1 -1
  55. package/dist/ColorSlider.css +0 -6
  56. package/dist/ColorSlider.css.map +1 -1
  57. package/dist/ColorSwatch.css +1 -5
  58. package/dist/ColorSwatch.css.map +1 -1
  59. package/dist/ColorSwatchPicker.css +1 -5
  60. package/dist/ColorSwatchPicker.css.map +1 -1
  61. package/dist/ColorWheel.css +1 -5
  62. package/dist/ColorWheel.css.map +1 -1
  63. package/dist/ComboBox.css +0 -6
  64. package/dist/ComboBox.css.map +1 -1
  65. package/dist/Content.cjs +3 -1
  66. package/dist/Content.cjs.map +1 -1
  67. package/dist/Content.mjs +3 -1
  68. package/dist/Content.mjs.map +1 -1
  69. package/dist/ContextualHelp.css +0 -6
  70. package/dist/ContextualHelp.css.map +1 -1
  71. package/dist/CustomDialog.css +1 -5
  72. package/dist/CustomDialog.css.map +1 -1
  73. package/dist/Dialog.css +0 -6
  74. package/dist/Dialog.css.map +1 -1
  75. package/dist/Disclosure.css +0 -6
  76. package/dist/Disclosure.css.map +1 -1
  77. package/dist/Divider.css +1 -5
  78. package/dist/Divider.css.map +1 -1
  79. package/dist/DropZone.css +0 -6
  80. package/dist/DropZone.css.map +1 -1
  81. package/dist/Field.css +0 -6
  82. package/dist/Field.css.map +1 -1
  83. package/dist/Form.css +1 -5
  84. package/dist/Form.css.map +1 -1
  85. package/dist/FullscreenDialog.css +0 -6
  86. package/dist/FullscreenDialog.css.map +1 -1
  87. package/dist/IllustratedMessage.css +0 -6
  88. package/dist/IllustratedMessage.css.map +1 -1
  89. package/dist/Image.css +1 -5
  90. package/dist/Image.css.map +1 -1
  91. package/dist/InlineAlert.css +0 -6
  92. package/dist/InlineAlert.css.map +1 -1
  93. package/dist/Link.css +0 -6
  94. package/dist/Link.css.map +1 -1
  95. package/dist/Menu.css +0 -6
  96. package/dist/Menu.css.map +1 -1
  97. package/dist/Meter.css +0 -6
  98. package/dist/Meter.css.map +1 -1
  99. package/dist/Modal.css +1 -5
  100. package/dist/Modal.css.map +1 -1
  101. package/dist/NumberField.css +0 -6
  102. package/dist/NumberField.css.map +1 -1
  103. package/dist/Picker.css +0 -6
  104. package/dist/Picker.css.map +1 -1
  105. package/dist/Popover.css +1 -5
  106. package/dist/Popover.css.map +1 -1
  107. package/dist/ProgressBar.css +0 -6
  108. package/dist/ProgressBar.css.map +1 -1
  109. package/dist/ProgressCircle.css +1 -5
  110. package/dist/ProgressCircle.css.map +1 -1
  111. package/dist/Provider.css +1 -5
  112. package/dist/Provider.css.map +1 -1
  113. package/dist/Radio.css +0 -6
  114. package/dist/Radio.css.map +1 -1
  115. package/dist/RadioGroup.css +0 -6
  116. package/dist/RadioGroup.css.map +1 -1
  117. package/dist/SearchField.css +0 -6
  118. package/dist/SearchField.css.map +1 -1
  119. package/dist/SegmentedControl.css +0 -6
  120. package/dist/SegmentedControl.css.map +1 -1
  121. package/dist/Slider.css +0 -6
  122. package/dist/Slider.css.map +1 -1
  123. package/dist/StatusLight.css +0 -6
  124. package/dist/StatusLight.css.map +1 -1
  125. package/dist/Switch.css +0 -6
  126. package/dist/Switch.css.map +1 -1
  127. package/dist/TableView.css +0 -6
  128. package/dist/TableView.css.map +1 -1
  129. package/dist/Tabs.css +0 -6
  130. package/dist/Tabs.css.map +1 -1
  131. package/dist/TagGroup.cjs +2 -2
  132. package/dist/TagGroup.cjs.map +1 -1
  133. package/dist/TagGroup.css +0 -6
  134. package/dist/TagGroup.css.map +1 -1
  135. package/dist/TagGroup.mjs +2 -2
  136. package/dist/TagGroup.mjs.map +1 -1
  137. package/dist/TextField.css +0 -6
  138. package/dist/TextField.css.map +1 -1
  139. package/dist/ToggleButton.css +1 -5
  140. package/dist/ToggleButton.css.map +1 -1
  141. package/dist/Tooltip.css +0 -6
  142. package/dist/Tooltip.css.map +1 -1
  143. package/dist/types.d.ts.map +1 -1
  144. package/icons/Skeleton.cjs +2 -2
  145. package/icons/Skeleton.cjs.map +1 -1
  146. package/icons/Skeleton.css +3 -5
  147. package/icons/Skeleton.css.map +1 -1
  148. package/icons/Skeleton.mjs +3 -3
  149. package/icons/Skeleton.mjs.map +1 -1
  150. package/package.json +19 -22
  151. package/src/ActionBar.tsx +3 -6
  152. package/src/Breadcrumbs.tsx +2 -2
  153. package/src/Card.tsx +2 -2
  154. package/src/Content.tsx +2 -1
  155. package/src/Skeleton.tsx +3 -3
  156. package/src/TagGroup.tsx +2 -2
  157. package/style/__tests__/style-macro.test.js +2 -6
  158. package/style/dist/style-macro.cjs +4 -2
  159. package/style/dist/style-macro.cjs.map +1 -1
  160. package/style/dist/style-macro.mjs +4 -2
  161. package/style/dist/style-macro.mjs.map +1 -1
  162. package/style/style-macro.ts +8 -2
@@ -177,8 +177,6 @@
177
177
  }
178
178
  }
179
179
 
180
- @layer UNSAFE_overrides;
181
-
182
180
  @layer _.b.b {
183
181
  @media not ((hover: hover) and (pointer: fine)) {
184
182
  ._ebf {
@@ -214,8 +212,4 @@
214
212
  }
215
213
  }
216
214
  }
217
-
218
- .\.:not(#a#b) {
219
- all: revert-layer;
220
- }
221
215
  /*# sourceMappingURL=SearchField.css.map */
@@ -1 +1 @@
1
- {"mappings":"ACoFoC;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;;;;EAgClB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAUQ;;;;EAAA;;;;EAAA;;;;EASF;;;;EAAA;;;;EAAA;;;;EAQ0B;;;;;AA3Dd;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA0CV;;;;;;AA1CU;EAAA;IAAA;;;;;;AAgClB","sources":["701be11ab8dca66d","packages/@react-spectrum/s2/src/SearchField.tsx"],"sourcesContent":["@import \"95c78f98597e8421\";\n@import \"f4cdd67932b2e9e6\";\n@import \"6e171d7f06abfdd6\";\n@import \"0c29dd3d96ea9e9e\";\n@import \"a7198624cd817afc\";\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 {\n SearchField as AriaSearchField,\n SearchFieldProps as AriaSearchFieldProps,\n ContextValue,\n Provider\n} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {createContext, forwardRef, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {fontRelative, style} from '../style' with {type: 'macro'};\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport SearchIcon from '../s2wf-icons/S2_Icon_Search_20_N.svg';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'className' | 'style' | 'children'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the SearchField.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const SearchFieldContext = createContext<ContextValue<SearchFieldProps, TextFieldRef>>(null);\n\n/**\n * A SearchField is a text field designed for searches.\n */\nexport const SearchField = /*#__PURE__*/ forwardRef(function SearchField(props: SearchFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, SearchFieldContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n UNSAFE_className = '',\n UNSAFE_style,\n ...searchFieldProps\n } = props;\n\n let domRef = useRef<HTMLDivElement>(null);\n let inputRef = useRef<HTMLInputElement>(null);\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 return (\n <AriaSearchField\n {...searchFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style({\n ...field(),\n '--iconMargin': {\n type: 'marginTop',\n value: fontRelative(-2)\n },\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n }\n }, getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {({isDisabled, isInvalid, isEmpty}) => (<>\n {label && <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>}\n <FieldGroup\n isDisabled={isDisabled}\n size={props.size}\n styles={style({\n borderRadius: 'full',\n paddingStart: 'pill',\n paddingEnd: 0\n })}>\n <Provider\n values={[\n [IconContext, {\n render: centerBaseline({\n slot: 'icon',\n styles: style({\n flexShrink: 0,\n marginEnd: 'text-to-visual',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })\n }),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin'\n })\n }]\n ]}>\n <SearchIcon />\n </Provider>\n <Input ref={inputRef} UNSAFE_className={raw('&::-webkit-search-cancel-button { display: none }')} />\n {!isEmpty && !searchFieldProps.isReadOnly && <ClearButton size={props.size} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>)}\n </AriaSearchField>\n );\n});\n"],"names":[],"version":3,"file":"SearchField.css.map"}
1
+ {"mappings":"ACoFoC;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;;;;EAgClB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAUQ;;;;EAAA;;;;EAAA;;;;EASF;;;;EAAA;;;;EAAA;;;;EAQ0B;;;;;AA3Dd;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA0CV;;;;;;AA1CU;EAAA;IAAA","sources":["701be11ab8dca66d","packages/@react-spectrum/s2/src/SearchField.tsx"],"sourcesContent":["@import \"95c78f98597e8421\";\n@import \"f4cdd67932b2e9e6\";\n@import \"6e171d7f06abfdd6\";\n@import \"0c29dd3d96ea9e9e\";\n@import \"a7198624cd817afc\";\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 {\n SearchField as AriaSearchField,\n SearchFieldProps as AriaSearchFieldProps,\n ContextValue,\n Provider\n} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {createContext, forwardRef, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {fontRelative, style} from '../style' with {type: 'macro'};\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport SearchIcon from '../s2wf-icons/S2_Icon_Search_20_N.svg';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'className' | 'style' | 'children'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the SearchField.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const SearchFieldContext = createContext<ContextValue<SearchFieldProps, TextFieldRef>>(null);\n\n/**\n * A SearchField is a text field designed for searches.\n */\nexport const SearchField = /*#__PURE__*/ forwardRef(function SearchField(props: SearchFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, SearchFieldContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n UNSAFE_className = '',\n UNSAFE_style,\n ...searchFieldProps\n } = props;\n\n let domRef = useRef<HTMLDivElement>(null);\n let inputRef = useRef<HTMLInputElement>(null);\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 return (\n <AriaSearchField\n {...searchFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style({\n ...field(),\n '--iconMargin': {\n type: 'marginTop',\n value: fontRelative(-2)\n },\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n }\n }, getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {({isDisabled, isInvalid, isEmpty}) => (<>\n {label && <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>}\n <FieldGroup\n isDisabled={isDisabled}\n size={props.size}\n styles={style({\n borderRadius: 'full',\n paddingStart: 'pill',\n paddingEnd: 0\n })}>\n <Provider\n values={[\n [IconContext, {\n render: centerBaseline({\n slot: 'icon',\n styles: style({\n flexShrink: 0,\n marginEnd: 'text-to-visual',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })\n }),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin'\n })\n }]\n ]}>\n <SearchIcon />\n </Provider>\n <Input ref={inputRef} UNSAFE_className={raw('&::-webkit-search-cancel-button { display: none }')} />\n {!isEmpty && !searchFieldProps.isReadOnly && <ClearButton size={props.size} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>)}\n </AriaSearchField>\n );\n});\n"],"names":[],"version":3,"file":"SearchField.css.map"}
@@ -305,8 +305,6 @@
305
305
  }
306
306
  }
307
307
 
308
- @layer UNSAFE_overrides;
309
-
310
308
  @layer _.c {
311
309
  ._d-enzwzjc:lang(he) {
312
310
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
@@ -410,8 +408,4 @@
410
408
  }
411
409
  }
412
410
  }
413
-
414
- .\.:not(#a#b) {
415
- all: revert-layer;
416
- }
417
411
  /*# sourceMappingURL=SegmentedControl.css.map */
@@ -1 +1 @@
1
- {"mappings":"ACwDyB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAQL;;;;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;;;;EA6CL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkK+C;;;;EAAA;;;;EAGzB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAE4C;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA5NxD;EAQL;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AARK;;AAQL;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA6CL;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AA7CK;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAoN6D;;;;IAAA;;;;;;AAvKlE","sources":["90909571be522c78","packages/@react-spectrum/s2/src/SegmentedControl.tsx"],"sourcesContent":["@import \"3076f581d900045a\";\n@import \"37c2fdb040131115\";\n@import \"d075b97bae773d34\";\n@import \"6903fca31535b056\";\n@import \"a6b79b4602e6c53c\";\n@import \"c3f3a2eb3541e76f\";\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, DOMRef, DOMRefValue, FocusableRef, Key} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SlotProps, ToggleButton, ToggleButtonGroup, ToggleGroupStateContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, space, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** Whether the items should divide the container width equally. */\n isJustified?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: Key | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: Key,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: Key) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: Key,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<SegmentedControlProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style({\n display: 'flex',\n gap: 4,\n backgroundColor: 'gray-100',\n borderRadius: 'default',\n width: 'fit'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n ...focusRing(),\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n font: 'control',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]):not(:has([data-rsp-slot=text]))': space(6)\n },\n height: 32,\n alignItems: 'center',\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n userSelect: 'none',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n borderRadius: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: Key, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: Key | null,\n value?: Key | null,\n children?: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nexport const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (values: Set<Key>) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(values.values().next().value);\n }\n };\n\n return (\n <ToggleButtonGroup \n {...props}\n selectedKeys={selectedKey != null ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey != null ? [defaultSelectedKey] : undefined}\n disallowEmptySelection\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onSelectionChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl(null, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef} isJustified={props.isJustified}>\n {props.children}\n </DefaultSelectionTracker>\n </ToggleButtonGroup>\n );\n});\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(ToggleGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: Key) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.toggleKey(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef, isJustified: props.isJustified}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nexport const SegmentedControlItem = /*#__PURE__*/ forwardRef(function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLButtonElement>) {\n let domRef = useFocusableRef(ref);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef, isJustified} = useContext(InternalSegmentedControlContext);\n let state = useContext(ToggleGroupStateContext);\n let isSelected = state?.selectedKeys.has(props.id);\n // do not apply animation if a user has the prefers-reduced-motion setting\n let isReduced = false;\n if (window?.matchMedia) {\n isReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !isReduced) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected]);\n\n return (\n <ToggleButton \n {...props}\n ref={domRef} \n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps, isJustified}, props.styles)} >\n {({isSelected, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </ToggleButton>\n );\n});\n"],"names":[],"version":3,"file":"SegmentedControl.css.map"}
1
+ {"mappings":"ACwDyB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAQL;;;;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;;;;EA6CL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkK+C;;;;EAAA;;;;EAGzB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAE4C;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA5NxD;EAQL;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA6CL;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AA7CK;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAoN6D;;;;IAAA","sources":["90909571be522c78","packages/@react-spectrum/s2/src/SegmentedControl.tsx"],"sourcesContent":["@import \"3076f581d900045a\";\n@import \"37c2fdb040131115\";\n@import \"d075b97bae773d34\";\n@import \"6903fca31535b056\";\n@import \"a6b79b4602e6c53c\";\n@import \"c3f3a2eb3541e76f\";\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, DOMRef, DOMRefValue, FocusableRef, Key} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, SlotProps, ToggleButton, ToggleButtonGroup, ToggleGroupStateContext} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, space, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** Whether the items should divide the container width equally. */\n isJustified?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: Key | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: Key,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: Key) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: Key,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<SegmentedControlProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style({\n display: 'flex',\n gap: 4,\n backgroundColor: 'gray-100',\n borderRadius: 'default',\n width: 'fit'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n ...focusRing(),\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n font: 'control',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]):not(:has([data-rsp-slot=text]))': space(6)\n },\n height: 32,\n alignItems: 'center',\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n userSelect: 'none',\n backgroundColor: 'transparent',\n borderStyle: 'none',\n borderRadius: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: Key, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: Key | null,\n value?: Key | null,\n children?: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>,\n isJustified?: boolean\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nexport const SegmentedControl = /*#__PURE__*/ forwardRef(function SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (values: Set<Key>) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(values.values().next().value);\n }\n };\n\n return (\n <ToggleButtonGroup \n {...props}\n selectedKeys={selectedKey != null ? [selectedKey] : undefined}\n defaultSelectedKeys={defaultSelectedKey != null ? [defaultSelectedKey] : undefined}\n disallowEmptySelection\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onSelectionChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl(null, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef} isJustified={props.isJustified}>\n {props.children}\n </DefaultSelectionTracker>\n </ToggleButtonGroup>\n );\n});\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(ToggleGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: Key) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.toggleKey(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef, isJustified: props.isJustified}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nexport const SegmentedControlItem = /*#__PURE__*/ forwardRef(function SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLButtonElement>) {\n let domRef = useFocusableRef(ref);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef, isJustified} = useContext(InternalSegmentedControlContext);\n let state = useContext(ToggleGroupStateContext);\n let isSelected = state?.selectedKeys.has(props.id);\n // do not apply animation if a user has the prefers-reduced-motion setting\n let isReduced = false;\n if (window?.matchMedia) {\n isReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !isReduced) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected]);\n\n return (\n <ToggleButton \n {...props}\n ref={domRef} \n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps, isJustified}, props.styles)} >\n {({isSelected, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </ToggleButton>\n );\n});\n"],"names":[],"version":3,"file":"SegmentedControl.css.map"}
package/dist/Slider.css CHANGED
@@ -582,8 +582,6 @@
582
582
  }
583
583
  }
584
584
 
585
- @layer UNSAFE_overrides;
586
-
587
585
  @layer _.b.b {
588
586
  @media not ((hover: hover) and (pointer: fine)) {
589
587
  ._ebf {
@@ -632,10 +630,6 @@
632
630
  }
633
631
  }
634
632
 
635
- .\.:not(#a#b) {
636
- all: revert-layer;
637
- }
638
-
639
633
  @layer _.b.-_1s8glxu {
640
634
  @supports (contain-intrinsic-width: 1px) {
641
635
  .__n-1s8glxue {
@@ -1 +1 @@
1
- {"mappings":"ACsEe;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAsBQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAoCR;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;;EAqBI;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6BO;;;;EAuBP;;;;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;;;;EAwEK;;;;EAAA;;;;EAqBC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EA4CoD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA0CjD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAtTb;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IA4Q8D;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAzI1D;EAAA;IAAA;;;;IA6FM;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AArBD;;;;AA2GI;EAAA;IAAA","sources":["ac662f3d1cc9df76","packages/@react-spectrum/s2/src/Slider.tsx"],"sourcesContent":["@import \"08b0e2dddac244ec\";\n@import \"a216064bff7feb94\";\n@import \"0e026599f927ff3c\";\n@import \"1cb0b30bc0f5a958\";\n@import \"edc162e184e119d3\";\n@import \"b86a124969f6f615\";\n@import \"9b5953d83288c51e\";\n@import \"d1e50ca165bdf4c3\";\n@import \"da42e21b823e7a9c\";\n@import \"6f133df38f9a43ae\";\n@import \"5a00966d61027041\";\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 {\n Slider as AriaSlider,\n SliderProps as AriaSliderProps,\n ContextValue,\n SliderOutput,\n SliderThumb,\n SliderTrack\n} from 'react-aria-components';\nimport {clamp} from '@react-aria/utils';\nimport {createContext, forwardRef, ReactNode, RefObject, useContext, useRef} from 'react';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {FocusableRef, FocusableRefValue, InputDOMProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {focusRing, style} from '../style' with {type: 'macro'};\nimport {FormContext, useFormProps} from './Form';\nimport {mergeStyles} from '../style/runtime';\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocale, useNumberFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SliderBaseProps<T> extends Omit<AriaSliderProps<T>, 'children' | 'style' | 'className' | 'orientation'>, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, StyleProps {\n children?: ReactNode,\n /**\n * The size of the Slider.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Slider should be displayed with an emphasized style.\n */\n isEmphasized?: boolean,\n /**\n * The style of the Slider's track.\n *\n * @default 'thin'\n */\n trackStyle?: 'thin' | 'thick', // TODO: add ramp\n /**\n * The style of the Slider's thumb.\n *\n * @default 'default'\n */\n thumbStyle?: 'default' | 'precise'\n // TODO\n // isEditable?: boolean,\n}\n\nexport interface SliderProps extends Omit<SliderBaseProps<number>, 'children'>, InputDOMProps {\n /**\n * The offset from which to start the fill.\n */\n fillOffset?: number\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, FocusableRefValue<HTMLDivElement>>>(null);\n\nconst slider = style({\n font: 'control',\n alignItems: {\n labelPosition: {\n side: 'center'\n }\n },\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n },\n columnGap: {\n size: {\n S: 16,\n M: 16,\n L: 20,\n XL: 24\n },\n isInForm: 12\n }\n}, getAllowedOverrides());\n\nconst labelContainer = style({\n display: {\n labelPosition: {\n top: 'grid'\n }\n },\n gridArea: 'label',\n width: 'full',\n gridTemplateAreas: {\n labelPosition: {\n top: ['label output']\n }\n },\n gridTemplateColumns: {\n labelPosition: {\n top: [\n '1fr auto'\n ]\n }\n },\n textAlign: {\n labelPosition: {\n side: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n }\n }\n },\n '--field-gap': {\n type: 'paddingBottom',\n value: 0\n }\n});\n\nconst output = style({\n gridArea: 'output',\n textAlign: {\n labelPosition: {\n top: {\n direction: {\n ltr: 'end',\n rtl: 'start'\n }\n },\n side: {\n direction: {\n ltr: 'start',\n rtl: 'end'\n },\n isInForm: 'end'\n }\n }\n }\n});\n\nexport let track = style({\n gridArea: 'track',\n position: 'relative',\n width: 'full',\n height: {\n size: {\n S: 24,\n M: 32,\n L: 40,\n XL: 48\n }\n }\n});\n\nexport let thumbContainer = style({\n size: {\n size: {\n S: 18,\n M: 20,\n L: 22,\n XL: 24\n }\n },\n display: 'inline-block',\n position: 'absolute',\n top: '[50%]'\n});\n\n// if precision thumb should have a smaller hit area, then remove this\nexport let thumbHitArea = style({\n size: {\n thumbStyle: {\n default: {\n size: {\n S: 18,\n M: 20,\n L: 22,\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: 22,\n L: 24,\n XL: 26\n }\n }\n }\n }\n});\n\nexport let thumb = style({\n ...focusRing(),\n display: 'inline-block',\n boxSizing: 'border-box',\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translateY(-50%) translateX(-50%)',\n width: {\n thumbStyle: {\n default: {\n size: {\n S: 18,\n M: 20,\n L: 22,\n XL: 24\n }\n },\n precise: 6\n }\n },\n height: {\n thumbStyle: {\n default: {\n size: {\n S: 18,\n M: 20,\n L: 22,\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: 22,\n L: 24,\n XL: 26\n }\n }\n }\n },\n borderRadius: 'full',\n borderStyle: 'solid',\n borderWidth: '[2px]',\n borderColor: {\n default: 'gray-800',\n isHovered: 'gray-900',\n isDragging: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n isDisabled: 'GrayText'\n }\n },\n backgroundColor: 'gray-25'\n});\n\nconst trackStyling = {\n height: {\n trackStyle: {\n thin: 4,\n thick: 16\n }\n },\n top: '[50%]',\n borderRadius: {\n trackStyle: {\n thin: 'lg',\n thick: 'sm'\n }\n }\n} as const;\n\nexport let upperTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-300',\n isDisabled: 'disabled'\n },\n translateY: '[-50%]',\n width: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n});\n\nexport let filledTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-700',\n isEmphasized: 'accent-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n translateY: '[-50%]'\n});\n\nexport function SliderBase<T extends number | number[]>(props: SliderBaseProps<T> & {sliderRef: RefObject<HTMLDivElement | null>}) {\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n labelPosition = 'top',\n labelAlign = 'start',\n size = 'M',\n minValue = 0,\n maxValue = 100,\n formatOptions\n } = props;\n let formatter = useNumberFormatter(formatOptions);\n let {direction} = useLocale();\n\n return (\n <AriaSlider\n {...props}\n ref={props.sliderRef}\n className={renderProps => (props.UNSAFE_className || '') + mergeStyles(style(field())({labelPosition, isInForm: !!formContext}), slider({...renderProps, labelPosition, size, isInForm: !!formContext}, props.styles))}>\n {({state}) => {\n let maxLabelLength = Math.max([...formatter.format(minValue)].length, [...formatter.format(maxValue)].length);\n switch (state.values.length) {\n case 1:\n break;\n case 2:\n // This should really use the NumberFormat#formatRange proposal...\n // https://github.com/tc39/ecma402/issues/393\n // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatRange\n maxLabelLength = 3 + 2 * Math.max(\n maxLabelLength,\n [...formatter.format(minValue)].length, [...formatter.format(maxValue)].length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n\n let outputValue = (\n <SliderOutput\n style={{width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`, fontVariantNumeric: 'tabular-nums'}}\n className={output({direction, labelPosition, isInForm: !!formContext})}>\n {({state}) =>\n state.values.map((_, i) => state.getThumbValueLabel(i)).join(' – ')}\n </SliderOutput>\n );\n\n return (\n <>\n <div className={labelContainer({labelPosition, labelAlign})}>\n <FieldLabel\n isDisabled={props.isDisabled}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {labelPosition === 'top' && outputValue}\n </div>\n <div className={style({...fieldInput(), display: 'inline-flex', alignItems: 'center', gap: {default: 16, size: {L: 20, XL: 24}}})({size})}>\n {props.children}\n {labelPosition === 'side' && outputValue}\n </div>\n </>\n );\n }}\n </AriaSlider>\n );\n}\n\nexport const Slider = /*#__PURE__*/ forwardRef(function Slider(props: SliderProps, ref: FocusableRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SliderContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n labelPosition = 'top',\n size = 'M',\n fillOffset,\n isEmphasized,\n trackStyle = 'thin',\n thumbStyle = 'default'\n } = props;\n let thumbRef = useRef(null);\n let inputRef = useRef(null); // TODO: need to pass inputRef to SliderThumb when we release the next version of RAC 1.3.0\n let domRef = useFocusableRef(ref, inputRef);\n let {direction} = useLocale();\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n return (\n <SliderBase\n {...props}\n sliderRef={domRef}>\n <SliderTrack\n className={track({size, labelPosition, isInForm: !!formContext})}>\n {({state, isDisabled}) => {\n\n fillOffset = fillOffset !== undefined ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : state.getThumbMinValue(0);\n\n let fillWidth = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = fillWidth > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n\n return (\n <>\n <div className={upperTrack({isDisabled, trackStyle})} />\n <div style={{width: `${Math.abs(fillWidth) * 100}%`, [cssDirection]: `${offset * 100}%`}} className={filledTrack({isDisabled, isEmphasized, trackStyle})} />\n <SliderThumb className={thumbContainer} index={0} name={props.name} ref={thumbRef} style={(renderProps) => pressScale(thumbRef, {transform: 'translate(-50%, -50%)'})({...renderProps, isPressed: renderProps.isDragging})}>\n {(renderProps) => (\n <div className={thumbHitArea({size})}>\n <div\n className={thumb({\n ...renderProps,\n size,\n thumbStyle\n })} />\n </div>\n )}\n </SliderThumb>\n </>\n );\n }}\n </SliderTrack>\n </SliderBase>\n );\n});\n"],"names":[],"version":3,"file":"Slider.css.map"}
1
+ {"mappings":"ACsEe;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAsBQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAoCR;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;;EAqBI;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6BO;;;;EAuBP;;;;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;;;;EAwEK;;;;EAAA;;;;EAqBC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EA4CoD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA0CjD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAtTb;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IA4Q8D;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAzI1D;EAAA;IAAA;;;;IA6FM;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAsFG;EAAA;IAAA","sources":["ac662f3d1cc9df76","packages/@react-spectrum/s2/src/Slider.tsx"],"sourcesContent":["@import \"08b0e2dddac244ec\";\n@import \"a216064bff7feb94\";\n@import \"0e026599f927ff3c\";\n@import \"1cb0b30bc0f5a958\";\n@import \"edc162e184e119d3\";\n@import \"b86a124969f6f615\";\n@import \"9b5953d83288c51e\";\n@import \"d1e50ca165bdf4c3\";\n@import \"da42e21b823e7a9c\";\n@import \"6f133df38f9a43ae\";\n@import \"5a00966d61027041\";\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 {\n Slider as AriaSlider,\n SliderProps as AriaSliderProps,\n ContextValue,\n SliderOutput,\n SliderThumb,\n SliderTrack\n} from 'react-aria-components';\nimport {clamp} from '@react-aria/utils';\nimport {createContext, forwardRef, ReactNode, RefObject, useContext, useRef} from 'react';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {FocusableRef, FocusableRefValue, InputDOMProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {focusRing, style} from '../style' with {type: 'macro'};\nimport {FormContext, useFormProps} from './Form';\nimport {mergeStyles} from '../style/runtime';\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocale, useNumberFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SliderBaseProps<T> extends Omit<AriaSliderProps<T>, 'children' | 'style' | 'className' | 'orientation'>, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, StyleProps {\n children?: ReactNode,\n /**\n * The size of the Slider.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Slider should be displayed with an emphasized style.\n */\n isEmphasized?: boolean,\n /**\n * The style of the Slider's track.\n *\n * @default 'thin'\n */\n trackStyle?: 'thin' | 'thick', // TODO: add ramp\n /**\n * The style of the Slider's thumb.\n *\n * @default 'default'\n */\n thumbStyle?: 'default' | 'precise'\n // TODO\n // isEditable?: boolean,\n}\n\nexport interface SliderProps extends Omit<SliderBaseProps<number>, 'children'>, InputDOMProps {\n /**\n * The offset from which to start the fill.\n */\n fillOffset?: number\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, FocusableRefValue<HTMLDivElement>>>(null);\n\nconst slider = style({\n font: 'control',\n alignItems: {\n labelPosition: {\n side: 'center'\n }\n },\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n },\n columnGap: {\n size: {\n S: 16,\n M: 16,\n L: 20,\n XL: 24\n },\n isInForm: 12\n }\n}, getAllowedOverrides());\n\nconst labelContainer = style({\n display: {\n labelPosition: {\n top: 'grid'\n }\n },\n gridArea: 'label',\n width: 'full',\n gridTemplateAreas: {\n labelPosition: {\n top: ['label output']\n }\n },\n gridTemplateColumns: {\n labelPosition: {\n top: [\n '1fr auto'\n ]\n }\n },\n textAlign: {\n labelPosition: {\n side: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n }\n }\n },\n '--field-gap': {\n type: 'paddingBottom',\n value: 0\n }\n});\n\nconst output = style({\n gridArea: 'output',\n textAlign: {\n labelPosition: {\n top: {\n direction: {\n ltr: 'end',\n rtl: 'start'\n }\n },\n side: {\n direction: {\n ltr: 'start',\n rtl: 'end'\n },\n isInForm: 'end'\n }\n }\n }\n});\n\nexport let track = style({\n gridArea: 'track',\n position: 'relative',\n width: 'full',\n height: {\n size: {\n S: 24,\n M: 32,\n L: 40,\n XL: 48\n }\n }\n});\n\nexport let thumbContainer = style({\n size: {\n size: {\n S: 18,\n M: 20,\n L: 22,\n XL: 24\n }\n },\n display: 'inline-block',\n position: 'absolute',\n top: '[50%]'\n});\n\n// if precision thumb should have a smaller hit area, then remove this\nexport let thumbHitArea = style({\n size: {\n thumbStyle: {\n default: {\n size: {\n S: 18,\n M: 20,\n L: 22,\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: 22,\n L: 24,\n XL: 26\n }\n }\n }\n }\n});\n\nexport let thumb = style({\n ...focusRing(),\n display: 'inline-block',\n boxSizing: 'border-box',\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translateY(-50%) translateX(-50%)',\n width: {\n thumbStyle: {\n default: {\n size: {\n S: 18,\n M: 20,\n L: 22,\n XL: 24\n }\n },\n precise: 6\n }\n },\n height: {\n thumbStyle: {\n default: {\n size: {\n S: 18,\n M: 20,\n L: 22,\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: 22,\n L: 24,\n XL: 26\n }\n }\n }\n },\n borderRadius: 'full',\n borderStyle: 'solid',\n borderWidth: '[2px]',\n borderColor: {\n default: 'gray-800',\n isHovered: 'gray-900',\n isDragging: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n isDisabled: 'GrayText'\n }\n },\n backgroundColor: 'gray-25'\n});\n\nconst trackStyling = {\n height: {\n trackStyle: {\n thin: 4,\n thick: 16\n }\n },\n top: '[50%]',\n borderRadius: {\n trackStyle: {\n thin: 'lg',\n thick: 'sm'\n }\n }\n} as const;\n\nexport let upperTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-300',\n isDisabled: 'disabled'\n },\n translateY: '[-50%]',\n width: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n});\n\nexport let filledTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-700',\n isEmphasized: 'accent-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n translateY: '[-50%]'\n});\n\nexport function SliderBase<T extends number | number[]>(props: SliderBaseProps<T> & {sliderRef: RefObject<HTMLDivElement | null>}) {\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n labelPosition = 'top',\n labelAlign = 'start',\n size = 'M',\n minValue = 0,\n maxValue = 100,\n formatOptions\n } = props;\n let formatter = useNumberFormatter(formatOptions);\n let {direction} = useLocale();\n\n return (\n <AriaSlider\n {...props}\n ref={props.sliderRef}\n className={renderProps => (props.UNSAFE_className || '') + mergeStyles(style(field())({labelPosition, isInForm: !!formContext}), slider({...renderProps, labelPosition, size, isInForm: !!formContext}, props.styles))}>\n {({state}) => {\n let maxLabelLength = Math.max([...formatter.format(minValue)].length, [...formatter.format(maxValue)].length);\n switch (state.values.length) {\n case 1:\n break;\n case 2:\n // This should really use the NumberFormat#formatRange proposal...\n // https://github.com/tc39/ecma402/issues/393\n // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatRange\n maxLabelLength = 3 + 2 * Math.max(\n maxLabelLength,\n [...formatter.format(minValue)].length, [...formatter.format(maxValue)].length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n\n let outputValue = (\n <SliderOutput\n style={{width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`, fontVariantNumeric: 'tabular-nums'}}\n className={output({direction, labelPosition, isInForm: !!formContext})}>\n {({state}) =>\n state.values.map((_, i) => state.getThumbValueLabel(i)).join(' – ')}\n </SliderOutput>\n );\n\n return (\n <>\n <div className={labelContainer({labelPosition, labelAlign})}>\n <FieldLabel\n isDisabled={props.isDisabled}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {labelPosition === 'top' && outputValue}\n </div>\n <div className={style({...fieldInput(), display: 'inline-flex', alignItems: 'center', gap: {default: 16, size: {L: 20, XL: 24}}})({size})}>\n {props.children}\n {labelPosition === 'side' && outputValue}\n </div>\n </>\n );\n }}\n </AriaSlider>\n );\n}\n\nexport const Slider = /*#__PURE__*/ forwardRef(function Slider(props: SliderProps, ref: FocusableRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SliderContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n labelPosition = 'top',\n size = 'M',\n fillOffset,\n isEmphasized,\n trackStyle = 'thin',\n thumbStyle = 'default'\n } = props;\n let thumbRef = useRef(null);\n let inputRef = useRef(null); // TODO: need to pass inputRef to SliderThumb when we release the next version of RAC 1.3.0\n let domRef = useFocusableRef(ref, inputRef);\n let {direction} = useLocale();\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n return (\n <SliderBase\n {...props}\n sliderRef={domRef}>\n <SliderTrack\n className={track({size, labelPosition, isInForm: !!formContext})}>\n {({state, isDisabled}) => {\n\n fillOffset = fillOffset !== undefined ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : state.getThumbMinValue(0);\n\n let fillWidth = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = fillWidth > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n\n return (\n <>\n <div className={upperTrack({isDisabled, trackStyle})} />\n <div style={{width: `${Math.abs(fillWidth) * 100}%`, [cssDirection]: `${offset * 100}%`}} className={filledTrack({isDisabled, isEmphasized, trackStyle})} />\n <SliderThumb className={thumbContainer} index={0} name={props.name} ref={thumbRef} style={(renderProps) => pressScale(thumbRef, {transform: 'translate(-50%, -50%)'})({...renderProps, isPressed: renderProps.isDragging})}>\n {(renderProps) => (\n <div className={thumbHitArea({size})}>\n <div\n className={thumb({\n ...renderProps,\n size,\n thumbStyle\n })} />\n </div>\n )}\n </SliderThumb>\n </>\n );\n }}\n </SliderTrack>\n </SliderBase>\n );\n});\n"],"names":[],"version":3,"file":"Slider.css.map"}
@@ -236,8 +236,6 @@
236
236
  }
237
237
  }
238
238
 
239
- @layer UNSAFE_overrides;
240
-
241
239
  @layer _.b.b {
242
240
  @media not ((hover: hover) and (pointer: fine)) {
243
241
  .ibH {
@@ -269,8 +267,4 @@
269
267
  }
270
268
  }
271
269
  }
272
-
273
- .\.:not(#a#b) {
274
- all: revert-layer;
275
- }
276
270
  /*# sourceMappingURL=StatusLight.css.map */
@@ -1 +1 @@
1
- {"mappings":"ACqDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;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;;;;;AAfE;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAeF","sources":["dcb557d93c6b9336","packages/@react-spectrum/s2/src/StatusLight.tsx"],"sourcesContent":["@import \"f9aed9e8e46292d1\";\n@import \"946093cc8d031f9b\";\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 {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {Text} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useIsSkeleton} from './Skeleton';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface StatusLightStyleProps {\n /**\n * The variant changes the color of the status light.\n * When status lights have a semantic meaning, they should use the variant for semantic colors.\n */\n variant: 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'celery' | 'chartreuse' | 'cyan' | 'fuchsia' | 'purple' | 'magenta' | 'indigo' | 'seafoam' | 'yellow' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n /**\n * The size of the StatusLight.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display as the label.\n */\n children?: ReactNode,\n /**\n * An accessibility role for the status light. Should be set when the status\n * can change at runtime, and no more than one status light will update simultaneously.\n * For cases where multiple statuses can change at the same time, use a Toast instead.\n */\n role?: 'status'\n}\n\nexport const StatusLightContext = createContext<ContextValue<StatusLightProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<StatusLightStyleProps>({\n display: 'flex',\n gap: 'text-to-visual',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n color: {\n default: 'neutral',\n variant: {\n neutral: 'gray-600'\n }\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst light = style<StatusLightStyleProps & {isSkeleton: boolean}>({\n size: {\n size: {\n S: 8,\n M: 10,\n L: 12,\n XL: 14\n }\n },\n fill: {\n variant: {\n informative: 'informative',\n neutral: 'neutral',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n celery: 'celery',\n chartreuse: 'chartreuse',\n cyan: 'cyan',\n fuchsia: 'fuchsia',\n purple: 'purple',\n magenta: 'magenta',\n indigo: 'indigo',\n seafoam: 'seafoam',\n yellow: 'yellow',\n pink: 'pink',\n turquoise: 'turquoise',\n cinnamon: 'cinnamon',\n brown: 'brown',\n silver: 'silver'\n },\n isSkeleton: 'gray-200'\n },\n overflow: 'visible' // prevents the light from getting clipped on iOS\n});\n\n/**\n * Status lights are used to color code categories and labels commonly found in data visualization.\n * When status lights have a semantic meaning, they should use semantic variant colors.\n */\nexport const StatusLight = /*#__PURE__*/ forwardRef(function StatusLight(props: StatusLightProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, StatusLightContext);\n let {children, size = 'M', variant, role, UNSAFE_className = '', UNSAFE_style, styles} = props;\n let domRef = useDOMRef(ref);\n let isSkeleton = useIsSkeleton();\n\n if (!children && !props['aria-label']) {\n console.warn('If no children are provided, an aria-label must be specified');\n }\n\n if (!role && (props['aria-label'] || props['aria-labelledby'])) {\n console.warn('A labelled StatusLight must have a role.');\n }\n\n return (\n <div\n {...filterDOMProps(props, {labelable: !!role})}\n ref={domRef}\n role={role}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({size, variant}, styles)}>\n <CenterBaseline>\n <svg className={light({size, variant, isSkeleton})} aria-hidden=\"true\">\n <circle r=\"50%\" cx=\"50%\" cy=\"50%\" />\n </svg>\n </CenterBaseline>\n <Text>{children}</Text>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"StatusLight.css.map"}
1
+ {"mappings":"ACqDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;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;;;;;AAfE;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["dcb557d93c6b9336","packages/@react-spectrum/s2/src/StatusLight.tsx"],"sourcesContent":["@import \"f9aed9e8e46292d1\";\n@import \"946093cc8d031f9b\";\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 {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {Text} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useIsSkeleton} from './Skeleton';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface StatusLightStyleProps {\n /**\n * The variant changes the color of the status light.\n * When status lights have a semantic meaning, they should use the variant for semantic colors.\n */\n variant: 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'celery' | 'chartreuse' | 'cyan' | 'fuchsia' | 'purple' | 'magenta' | 'indigo' | 'seafoam' | 'yellow' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n /**\n * The size of the StatusLight.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display as the label.\n */\n children?: ReactNode,\n /**\n * An accessibility role for the status light. Should be set when the status\n * can change at runtime, and no more than one status light will update simultaneously.\n * For cases where multiple statuses can change at the same time, use a Toast instead.\n */\n role?: 'status'\n}\n\nexport const StatusLightContext = createContext<ContextValue<StatusLightProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<StatusLightStyleProps>({\n display: 'flex',\n gap: 'text-to-visual',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n color: {\n default: 'neutral',\n variant: {\n neutral: 'gray-600'\n }\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst light = style<StatusLightStyleProps & {isSkeleton: boolean}>({\n size: {\n size: {\n S: 8,\n M: 10,\n L: 12,\n XL: 14\n }\n },\n fill: {\n variant: {\n informative: 'informative',\n neutral: 'neutral',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n celery: 'celery',\n chartreuse: 'chartreuse',\n cyan: 'cyan',\n fuchsia: 'fuchsia',\n purple: 'purple',\n magenta: 'magenta',\n indigo: 'indigo',\n seafoam: 'seafoam',\n yellow: 'yellow',\n pink: 'pink',\n turquoise: 'turquoise',\n cinnamon: 'cinnamon',\n brown: 'brown',\n silver: 'silver'\n },\n isSkeleton: 'gray-200'\n },\n overflow: 'visible' // prevents the light from getting clipped on iOS\n});\n\n/**\n * Status lights are used to color code categories and labels commonly found in data visualization.\n * When status lights have a semantic meaning, they should use semantic variant colors.\n */\nexport const StatusLight = /*#__PURE__*/ forwardRef(function StatusLight(props: StatusLightProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, StatusLightContext);\n let {children, size = 'M', variant, role, UNSAFE_className = '', UNSAFE_style, styles} = props;\n let domRef = useDOMRef(ref);\n let isSkeleton = useIsSkeleton();\n\n if (!children && !props['aria-label']) {\n console.warn('If no children are provided, an aria-label must be specified');\n }\n\n if (!role && (props['aria-label'] || props['aria-labelledby'])) {\n console.warn('A labelled StatusLight must have a role.');\n }\n\n return (\n <div\n {...filterDOMProps(props, {labelable: !!role})}\n ref={domRef}\n role={role}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({size, variant}, styles)}>\n <CenterBaseline>\n <svg className={light({size, variant, isSkeleton})} aria-hidden=\"true\">\n <circle r=\"50%\" cx=\"50%\" cy=\"50%\" />\n </svg>\n </CenterBaseline>\n <Text>{children}</Text>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"StatusLight.css.map"}
package/dist/Switch.css CHANGED
@@ -272,8 +272,6 @@
272
272
  }
273
273
  }
274
274
 
275
- @layer UNSAFE_overrides;
276
-
277
275
  @layer _.b.b {
278
276
  @media not ((hover: hover) and (pointer: fine)) {
279
277
  ._ebf {
@@ -325,8 +323,4 @@
325
323
  }
326
324
  }
327
325
  }
328
-
329
- .\.:not(#a#b) {
330
- all: revert-layer;
331
- }
332
326
  /*# sourceMappingURL=Switch.css.map */
@@ -1 +1 @@
1
- {"mappings":"ACiDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAoBF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyCC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA7DC;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAoBF;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA","sources":["dcb0a1e1b828d584","packages/@react-spectrum/s2/src/Switch.tsx"],"sourcesContent":["@import \"b4e99f1579042857\";\n@import \"8f3fcc7ad85a1ee6\";\n@import \"a22e7952bd491c56\";\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 {\n Switch as AriaSwitch,\n SwitchProps as AriaSwitchProps,\n ContextValue,\n SwitchRenderProps\n} from 'react-aria-components';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface SwitchStyleProps {\n /**\n * The size of the Switch.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Switch should be displayed with an emphasized style.\n */\n isEmphasized?: boolean\n}\n\ninterface RenderProps extends SwitchRenderProps, SwitchStyleProps {}\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, SwitchStyleProps {\n children?: ReactNode\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, FocusableRefValue<HTMLLabelElement>>>(null);\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n transition: 'colors',\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n gridColumnStart: {\n isInForm: 'field'\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst track = style<RenderProps>({\n ...focusRing(),\n borderRadius: 'full',\n '--trackWidth': {\n type: 'width',\n value: fontRelative(26)\n },\n '--trackHeight': {\n type: 'height',\n value: 'control-sm'\n },\n width: '--trackWidth',\n height: '--trackHeight',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n forcedColorAdjust: 'none',\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'transparent'\n },\n backgroundColor: {\n default: 'gray-25',\n isSelected: {\n default: 'neutral',\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n }\n});\n\nconst handle = style<RenderProps>({\n height: 'full',\n aspectRatio: 'square',\n borderRadius: 'full',\n backgroundColor: {\n default: 'neutral',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'gray-25'\n },\n transition: 'default'\n});\n\n// Use an inline style to calculate the transform so we can combine it with the press scale.\nconst transformStyle = ({isSelected}: SwitchRenderProps) => ({\n // In the default state, the handle is 8px smaller than the track. When selected it grows to 6px smaller than the track.\n // Normally this could be calculated as a scale transform with (trackHeight - 8px) / trackHeight, however,\n // CSS does not allow division with units. To solve this we use a 3d perspective transform. Perspective is the\n // distance from the Z=0 plane to the viewer. Since we want to scale the handle by a fixed amount and we cannot divide\n // by a value with units, we can set the Z translation to a fixed amount and change the perspective in order to achieve\n // the desired effect. Given the following formula:\n //\n // scale = perspective / (perspective - translateZ)\n //\n // and desired scale factors (accounting for the 2px border on each side of the track):\n //\n // defaultScale = (trackHeight - 8px) / (trackHeight - 4px)\n // selectedScale = (trackHeight - 6px) / (trackHeight - 4px)\n //\n // we can solve for the perspective needed in each case where translateZ is hard coded to -4px:\n //\n // defaultPerspective = trackHeight - 8px\n // selectedPerspective = 2 * (trackHeight - 6px)\n transform: isSelected\n // The selected state also translates the X position to the end of the track (minus the borders).\n ? 'translateX(calc(var(--trackWidth) - 100% - 4px)) perspective(calc(2 * (var(--trackHeight) - 6px))) translateZ(-4px)'\n : 'perspective(calc(var(--trackHeight) - 8px)) translateZ(-4px)'\n});\n\n/**\n * Switches allow users to turn an individual option on or off.\n * They are usually used to activate or deactivate a specific setting.\n */\nexport const Switch = /*#__PURE__*/ forwardRef(function Switch(props: SwitchProps, ref: FocusableRef<HTMLLabelElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SwitchContext);\n let {children, UNSAFE_className = '', UNSAFE_style} = props;\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let handleRef = useRef(null);\n let isInForm = !!useContext(FormContext);\n props = useFormProps(props);\n return (\n <AriaSwitch\n {...props}\n ref={domRef}\n inputRef={inputRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + wrapper({...renderProps, isInForm, size: props.size || 'M'}, props.styles)}>\n {renderProps => (\n <>\n <CenterBaseline>\n <div\n className={track({\n ...renderProps,\n size: props.size || 'M',\n isEmphasized: props.isEmphasized\n })}>\n <div\n ref={handleRef}\n style={pressScale(handleRef, transformStyle)(renderProps)}\n className={handle(renderProps)} />\n </div>\n </CenterBaseline>\n {children}\n </>\n )}\n </AriaSwitch>\n );\n});\n"],"names":[],"version":3,"file":"Switch.css.map"}
1
+ {"mappings":"ACiDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAoBF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyCC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA7DC;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAoBF;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["dcb0a1e1b828d584","packages/@react-spectrum/s2/src/Switch.tsx"],"sourcesContent":["@import \"b4e99f1579042857\";\n@import \"8f3fcc7ad85a1ee6\";\n@import \"a22e7952bd491c56\";\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 {\n Switch as AriaSwitch,\n SwitchProps as AriaSwitchProps,\n ContextValue,\n SwitchRenderProps\n} from 'react-aria-components';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface SwitchStyleProps {\n /**\n * The size of the Switch.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Switch should be displayed with an emphasized style.\n */\n isEmphasized?: boolean\n}\n\ninterface RenderProps extends SwitchRenderProps, SwitchStyleProps {}\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, SwitchStyleProps {\n children?: ReactNode\n}\n\nexport const SwitchContext = createContext<ContextValue<SwitchProps, FocusableRefValue<HTMLLabelElement>>>(null);\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n transition: 'colors',\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n gridColumnStart: {\n isInForm: 'field'\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst track = style<RenderProps>({\n ...focusRing(),\n borderRadius: 'full',\n '--trackWidth': {\n type: 'width',\n value: fontRelative(26)\n },\n '--trackHeight': {\n type: 'height',\n value: 'control-sm'\n },\n width: '--trackWidth',\n height: '--trackHeight',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n forcedColorAdjust: 'none',\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'transparent'\n },\n backgroundColor: {\n default: 'gray-25',\n isSelected: {\n default: 'neutral',\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n }\n});\n\nconst handle = style<RenderProps>({\n height: 'full',\n aspectRatio: 'square',\n borderRadius: 'full',\n backgroundColor: {\n default: 'neutral',\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'gray-25'\n },\n transition: 'default'\n});\n\n// Use an inline style to calculate the transform so we can combine it with the press scale.\nconst transformStyle = ({isSelected}: SwitchRenderProps) => ({\n // In the default state, the handle is 8px smaller than the track. When selected it grows to 6px smaller than the track.\n // Normally this could be calculated as a scale transform with (trackHeight - 8px) / trackHeight, however,\n // CSS does not allow division with units. To solve this we use a 3d perspective transform. Perspective is the\n // distance from the Z=0 plane to the viewer. Since we want to scale the handle by a fixed amount and we cannot divide\n // by a value with units, we can set the Z translation to a fixed amount and change the perspective in order to achieve\n // the desired effect. Given the following formula:\n //\n // scale = perspective / (perspective - translateZ)\n //\n // and desired scale factors (accounting for the 2px border on each side of the track):\n //\n // defaultScale = (trackHeight - 8px) / (trackHeight - 4px)\n // selectedScale = (trackHeight - 6px) / (trackHeight - 4px)\n //\n // we can solve for the perspective needed in each case where translateZ is hard coded to -4px:\n //\n // defaultPerspective = trackHeight - 8px\n // selectedPerspective = 2 * (trackHeight - 6px)\n transform: isSelected\n // The selected state also translates the X position to the end of the track (minus the borders).\n ? 'translateX(calc(var(--trackWidth) - 100% - 4px)) perspective(calc(2 * (var(--trackHeight) - 6px))) translateZ(-4px)'\n : 'perspective(calc(var(--trackHeight) - 8px)) translateZ(-4px)'\n});\n\n/**\n * Switches allow users to turn an individual option on or off.\n * They are usually used to activate or deactivate a specific setting.\n */\nexport const Switch = /*#__PURE__*/ forwardRef(function Switch(props: SwitchProps, ref: FocusableRef<HTMLLabelElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SwitchContext);\n let {children, UNSAFE_className = '', UNSAFE_style} = props;\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let handleRef = useRef(null);\n let isInForm = !!useContext(FormContext);\n props = useFormProps(props);\n return (\n <AriaSwitch\n {...props}\n ref={domRef}\n inputRef={inputRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + wrapper({...renderProps, isInForm, size: props.size || 'M'}, props.styles)}>\n {renderProps => (\n <>\n <CenterBaseline>\n <div\n className={track({\n ...renderProps,\n size: props.size || 'M',\n isEmphasized: props.isEmphasized\n })}>\n <div\n ref={handleRef}\n style={pressScale(handleRef, transformStyle)(renderProps)}\n className={handle(renderProps)} />\n </div>\n </CenterBaseline>\n {children}\n </>\n )}\n </AriaSwitch>\n );\n});\n"],"names":[],"version":3,"file":"Switch.css.map"}
@@ -608,8 +608,6 @@
608
608
  }
609
609
  }
610
610
 
611
- @layer UNSAFE_overrides;
612
-
613
611
  @layer _.c {
614
612
  ._d-enzwzjc:lang(he) {
615
613
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
@@ -721,8 +719,4 @@
721
719
  }
722
720
  }
723
721
  }
724
-
725
- .\.:not(#a#b) {
726
- all: revert-layer;
727
- }
728
722
  /*# sourceMappingURL=TableView.css.map */
@@ -1 +1 @@
1
- {"mappings":"ACuHqB;EAAA;;;;EAAA;;;;EAAA;;;;EAWP;;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyU+B;;;;EAAA;;;;EAAA;;;;EAGxB;;;;EA2FQ;;;;EAOZ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2CkB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAwBJ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqBT;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyBG;;;;EAAA;;;;EAAA;;;;EASL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAWL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6F6C;;;;EAwBxC;;;;EAQM;;;;EAIM;;;;EAAA;;;;EA6FnB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAmCa;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAUN;;;;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;;;;EA4FR;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAuEoC;;;;;;;;;;;;;;AA5+B3B;EAWP;;;;;AAXO;;AAWP;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAydqB;;;;IA6Cb;;;;IAAA;;;;IAAA;;;;IA6CP;;;;IAAA;;;;IAiQW;;;;IAsGd;;;;IAAA;;;;IAAA;;;;;;AA9kBS;EAAA;IAkGJ;;;;IA0HG;;;;IAyOP;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AA1WgB","sources":["2240c4c45ca0caf3","packages/@react-spectrum/s2/src/TableView.tsx"],"sourcesContent":["@import \"5b1d6c31fe4487e1\";\n@import \"f77e406826513ab2\";\n@import \"8dbcf3cea8cfcf9c\";\n@import \"890f8aae714c4bd1\";\n@import \"48b36de5a4ffba52\";\n@import \"f6b070bd01650099\";\n@import \"cdde521fb70eb9ad\";\n@import \"d7adc374eba6f78a\";\n@import \"35aaf22940bf2f2a\";\n@import \"32213075f389df20\";\n@import \"b0feba60a0629310\";\n@import \"7c09a91fbb0fbaa4\";\n@import \"b2c69c7a7ed62426\";\n@import \"07b0d08572549118\";\n@import \"5e5dc59c220c1582\";\n@import \"0c3bd1e2e2accabc\";\n@import \"be20f998f58af945\";\n@import \"dd6f10cdba64c3a3\";\n@import \"06cceb4ec05a1b8a\";\n@import \"8cc40857bd78d993\";\n@import \"36e840b6feb3c919\";\n@import \"b0c207aa30d06f1f\";\n@import \"0d7bafdf4e6377cb\";\n@import \"219f545e8afc3f03\";\n@import \"c40132ec5eb61ae5\";\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 {\n Button,\n CellRenderProps,\n Collection,\n ColumnRenderProps,\n ColumnResizer,\n ContextValue,\n Key,\n Provider,\n Cell as RACCell,\n CellProps as RACCellProps,\n CheckboxContext as RACCheckboxContext,\n Column as RACColumn,\n ColumnProps as RACColumnProps,\n Row as RACRow,\n RowProps as RACRowProps,\n Table as RACTable,\n TableBody as RACTableBody,\n TableBodyProps as RACTableBodyProps,\n TableHeader as RACTableHeader,\n TableHeaderProps as RACTableHeaderProps,\n TableProps as RACTableProps,\n ResizableTableContainer,\n RowRenderProps,\n TableBodyRenderProps,\n TableRenderProps,\n UNSTABLE_TableLayout,\n UNSTABLE_TableLoadingIndicator,\n UNSTABLE_Virtualizer,\n useSlottedContext,\n useTableOptions\n} from 'react-aria-components';\nimport {centerPadding, getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {Checkbox} from './Checkbox';\nimport Chevron from '../ui-icons/Chevron';\nimport {colorMix, focusRing, fontRelative, lightDark, space, style} from '../style' with {type: 'macro'};\nimport {ColumnSize} from '@react-types/table';\nimport {DOMRef, DOMRefValue, forwardRefType, LoadingState, Node} from '@react-types/shared';\nimport {GridNode} from '@react-types/grid';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {LayoutNode} from '@react-stately/layout';\nimport {Menu, MenuItem, MenuTrigger} from './Menu';\nimport {mergeStyles} from '../style/runtime';\nimport Nubbin from '../ui-icons/S2_MoveHorizontalTableWidget.svg';\nimport {ProgressCircle} from './ProgressCircle';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactElement, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {Rect} from '@react-stately/virtualizer';\nimport SortDownArrow from '../s2wf-icons/S2_Icon_SortDown_20_N.svg';\nimport SortUpArrow from '../s2wf-icons/S2_Icon_SortUp_20_N.svg';\nimport {useActionBarContainer} from './ActionBar';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLoadMore} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useScale} from './utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\nimport {VisuallyHidden} from 'react-aria';\n\ninterface S2TableProps {\n /** Whether the Table should be displayed with a quiet style. */\n isQuiet?: boolean,\n /**\n * Sets the amount of vertical padding within each cell.\n * @default 'regular'\n */\n density?: 'compact' | 'spacious' | 'regular',\n /**\n * Sets the overflow behavior for the cell contents.\n * @default 'truncate'\n */\n overflowMode?: 'wrap' | 'truncate',\n // TODO: will we contine with onAction or rename to onRowAction like it is in RAC?\n /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void,\n /**\n * Handler that is called when a user starts a column resize.\n */\n onResizeStart?: (widths: Map<Key, ColumnSize>) => void,\n /**\n * Handler that is called when a user performs a column resize.\n * Can be used with the width property on columns to put the column widths into\n * a controlled state.\n */\n onResize?: (widths: Map<Key, ColumnSize>) => void,\n /**\n * Handler that is called after a user performs a column resize.\n * Can be used to store the widths of columns for another future session.\n */\n onResizeEnd?: (widths: Map<Key, ColumnSize>) => void,\n /** The current loading state of the table. */\n loadingState?: LoadingState,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => any,\n /** Provides the ActionBar to display when rows are selected in the TableView. */\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement\n}\n\n// TODO: Note that loadMore and loadingState are now on the Table instead of on the TableBody\nexport interface TableViewProps extends Omit<RACTableProps, 'style' | 'disabledBehavior' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks'>, UnsafeStyles, S2TableProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nlet InternalTableContext = createContext<TableViewProps & {layout?: S2TableLayout<unknown>, setIsInResizeMode?:(val: boolean) => void, isInResizeMode?: boolean}>({});\n\nconst tableWrapper = style({\n minHeight: 0,\n minWidth: 0,\n display: 'flex',\n isolation: 'isolate',\n disableTapHighlight: true,\n position: 'relative',\n // Clip ActionBar animation.\n overflow: 'clip'\n});\n\nconst table = style<TableRenderProps & S2TableProps & {isCheckboxSelection?: boolean}>({\n width: 'full',\n userSelect: 'none',\n minHeight: 0,\n minWidth: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n overflow: 'auto',\n backgroundColor: {\n default: 'gray-25',\n isQuiet: 'transparent',\n forcedColors: 'Background'\n },\n borderColor: 'gray-300',\n borderStyle: 'solid',\n borderWidth: {\n default: 1,\n isQuiet: 0\n },\n ...focusRing(),\n outlineOffset: -1, // Cover the border\n borderRadius: {\n default: '[6px]',\n isQuiet: 'none'\n },\n // Multiple browser bugs from scrollIntoView and scrollPadding:\n // Bug: Table doesn't scroll items into view perfectly in Chrome\n // https://issues.chromium.org/issues/365913982\n // Bug: Table scrolls to the left when navigating up/down through the checkboxes when body is scrolled to the right.\n // https://issues.chromium.org/issues/40067778\n // https://bugs.webkit.org/show_bug.cgi?id=272799\n // Base reproduction: https://codepen.io/lfdanlu/pen/zYVVGPW\n scrollPaddingTop: 32,\n scrollPaddingStart: {\n isCheckboxSelection: 40\n }\n}, getAllowedOverrides({height: true}));\n\n// component-height-100\nconst DEFAULT_HEADER_HEIGHT = {\n medium: 32,\n large: 40\n};\n\nconst ROW_HEIGHTS = {\n compact: {\n medium: 32, // table-row-height-medium-compact (aka component-height-100)\n large: 40\n },\n regular: {\n medium: 40, // table-row-height-medium-regular\n large: 50\n },\n spacious: {\n medium: 48, // table-row-height-medium-spacious\n large: 60\n }\n};\n\nexport class S2TableLayout<T> extends UNSTABLE_TableLayout<T> {\n constructor(options) {\n super({...options, loaderHeight: 60});\n }\n\n protected isStickyColumn(node: GridNode<T>): boolean {\n return node.props.isSticky;\n }\n\n protected buildCollection(): LayoutNode[] {\n let [header, body] = super.buildCollection();\n let {children, layoutInfo} = body;\n // TableLayout's buildCollection always sets the body width to the max width between the header width, but\n // we want the body to be sticky and only as wide as the table so it is always in view if loading/empty\n if (children?.length === 0) {\n layoutInfo.rect.width = this.virtualizer!.visibleRect.width - 80;\n }\n\n return [\n header,\n body\n ];\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildLoader(node, x, y);\n let {layoutInfo} = layoutNode;\n layoutInfo.allowOverflow = true;\n layoutInfo.rect.width = this.virtualizer!.visibleRect.width;\n layoutInfo.isSticky = true;\n return layoutNode;\n }\n\n protected buildBody(y: number): LayoutNode {\n let layoutNode = super.buildBody(y);\n let {children, layoutInfo} = layoutNode;\n // Needs overflow for sticky loader\n layoutInfo.allowOverflow = true;\n // If loading or empty, we'll want the body to be sticky and centered\n if (children?.length === 0) {\n layoutInfo.rect = new Rect(40, 40, this.virtualizer!.visibleRect.width - 80, this.virtualizer!.visibleRect.height - 80);\n layoutInfo.isSticky = true;\n }\n\n return {...layoutNode, layoutInfo};\n }\n\n protected buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildRow(node, x, y);\n layoutNode.layoutInfo.allowOverflow = true;\n // Needs overflow for sticky selection/drag cells\n return layoutNode;\n }\n\n protected buildTableHeader(): LayoutNode {\n let layoutNode = super.buildTableHeader();\n // Needs overflow for sticky selection/drag column\n layoutNode.layoutInfo.allowOverflow = true;\n return layoutNode;\n }\n\n protected buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildColumn(node, x, y);\n // Needs overflow for the resize handle\n layoutNode.layoutInfo.allowOverflow = true;\n return layoutNode;\n }\n}\n\nexport const TableContext = createContext<ContextValue<TableViewProps, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * Tables are containers for displaying information. They allow users to quickly scan, sort, compare, and take action on large amounts of data.\n */\nexport const TableView = forwardRef(function TableView(props: TableViewProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TableContext);\n let {\n UNSAFE_style,\n UNSAFE_className,\n isQuiet = false,\n density = 'regular',\n overflowMode = 'truncate',\n styles,\n loadingState,\n onLoadMore,\n onResize: propsOnResize,\n onResizeStart: propsOnResizeStart,\n onResizeEnd: propsOnResizeEnd,\n onAction,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let scale = useScale();\n let layout = useMemo(() => {\n return new S2TableLayout({\n rowHeight: overflowMode === 'wrap'\n ? undefined\n : ROW_HEIGHTS[density][scale],\n estimatedRowHeight: overflowMode === 'wrap'\n ? ROW_HEIGHTS[density][scale]\n : undefined,\n // No need for estimated headingHeight since the headers aren't affected by overflow mode: wrap\n headingHeight: DEFAULT_HEADER_HEIGHT[scale]\n });\n }, [overflowMode, density, scale]);\n\n // Starts when the user selects resize from the menu, ends when resizing ends\n // used to control the visibility of the resizer Nubbin\n let [isInResizeMode, setIsInResizeMode] = useState(false);\n let onResizeStart = useCallback((widths) => {\n propsOnResizeStart?.(widths);\n }, [propsOnResizeStart]);\n let onResizeEnd = useCallback((widths) => {\n setIsInResizeMode(false);\n propsOnResizeEnd?.(widths);\n }, [propsOnResizeEnd, setIsInResizeMode]);\n\n let context = useMemo(() => ({\n isQuiet,\n density,\n overflowMode,\n loadingState,\n isInResizeMode,\n setIsInResizeMode\n }), [isQuiet, density, overflowMode, loadingState, isInResizeMode, setIsInResizeMode]);\n\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n let scrollRef = useRef<HTMLElement | null>(null);\n let memoedLoadMoreProps = useMemo(() => ({\n isLoading: isLoading,\n onLoadMore\n }), [isLoading, onLoadMore]);\n useLoadMore(memoedLoadMoreProps, scrollRef);\n let isCheckboxSelection = props.selectionMode === 'multiple' || props.selectionMode === 'single';\n\n let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({...props, scrollRef});\n\n return (\n <ResizableTableContainer\n // TODO: perhaps this ref should be attached to the RACTable but it expects a table type ref which isn't true in the virtualized case\n ref={domRef}\n onResize={propsOnResize}\n onResizeEnd={onResizeEnd}\n onResizeStart={onResizeStart}\n className={(UNSAFE_className || '') + mergeStyles(tableWrapper, styles)}\n style={UNSAFE_style}>\n <UNSTABLE_Virtualizer layout={layout}>\n <InternalTableContext.Provider value={context}>\n <RACTable\n ref={scrollRef as any}\n style={{\n // Fix webkit bug where scrollbars appear above the checkboxes/other table elements\n WebkitTransform: 'translateZ(0)',\n // Add padding at the bottom when the action bar is visible so users can scroll to the last items.\n // Also add scroll padding so navigating with the keyboard doesn't go behind the action bar.\n paddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0,\n scrollPaddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0\n }}\n className={renderProps => table({\n ...renderProps,\n isCheckboxSelection,\n isQuiet\n })}\n selectionBehavior=\"toggle\"\n onRowAction={onAction}\n {...otherProps}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={undefined}\n onSelectionChange={onSelectionChange} />\n </InternalTableContext.Provider>\n </UNSTABLE_Virtualizer>\n {actionBar}\n </ResizableTableContainer>\n );\n});\n\nconst centeredWrapper = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 'full',\n height: 'full'\n});\n\nexport interface TableBodyProps<T> extends Omit<RACTableBodyProps<T>, 'style' | 'className' | 'dependencies'> {}\n\n/**\n * The body of a `<Table>`, containing the table rows.\n */\nexport const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableBody<T extends object>(props: TableBodyProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {items, renderEmptyState, children} = props;\n let domRef = useDOMRef(ref);\n let {loadingState} = useContext(InternalTableContext);\n let emptyRender;\n let renderer = children;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let loadMoreSpinner = (\n <UNSTABLE_TableLoadingIndicator className={style({height: 'full', width: 'full'})}>\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loadingMore')} />\n </div>\n </UNSTABLE_TableLoadingIndicator>\n );\n\n // If the user is rendering their rows in dynamic fashion, wrap their render function in Collection so we can inject\n // the loader. Otherwise it is a static renderer and thus we can simply add the table loader after\n // TODO: this assumes that the user isn't providing their children in some wrapper though and/or isn't doing a map of children\n // (though I guess they wouldn't provide items then so the check for this is still valid in the latter case)...\n if (typeof children === 'function' && items) {\n renderer = (\n <>\n <Collection items={items}>\n {children}\n </Collection>\n {loadingState === 'loadingMore' && loadMoreSpinner}\n </>\n );\n } else {\n renderer = (\n <>\n {children}\n {loadingState === 'loadingMore' && loadMoreSpinner}\n </>\n );\n }\n\n if (renderEmptyState != null && loadingState !== 'loading') {\n emptyRender = (props: TableBodyRenderProps) => (\n <div className={centeredWrapper}>\n {renderEmptyState(props)}\n </div>\n );\n } else if (loadingState === 'loading') {\n emptyRender = () => (\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loading')} />\n </div>\n );\n }\n\n return (\n <RACTableBody\n // @ts-ignore\n ref={domRef}\n className={style({height: 'full'})}\n {...props}\n renderEmptyState={emptyRender}\n dependencies={[loadingState]}>\n {renderer}\n </RACTableBody>\n );\n});\n\nconst cellFocus = {\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineOffset: -2,\n outlineWidth: 2,\n outlineColor: 'focus-ring',\n borderRadius: '[6px]'\n} as const;\n\nfunction CellFocusRing() {\n return <div role=\"presentation\" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible: true})} />;\n}\n\nconst columnStyles = style({\n height: '[inherit]',\n boxSizing: 'border-box',\n color: {\n default: 'neutral',\n forcedColors: 'ButtonText'\n },\n paddingX: {\n default: 16,\n isColumnResizable: 0\n },\n textAlign: {\n align: {\n start: 'start',\n center: 'center',\n end: 'end'\n }\n },\n outlineStyle: 'none',\n position: 'relative',\n fontSize: 'control',\n fontFamily: 'sans',\n fontWeight: 'bold',\n display: 'flex',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n borderTopWidth: {\n default: 0,\n isQuiet: 1\n },\n borderBottomWidth: 1,\n borderStartWidth: 0,\n borderEndWidth: {\n default: 0,\n isColumnResizable: 1\n },\n borderStyle: 'solid',\n forcedColorAdjust: 'none'\n});\n\nexport interface ColumnProps extends RACColumnProps {\n /** Whether the column should render a divider between it and the next column. */\n showDivider?: boolean,\n /** Whether the column allows resizing. */\n allowsResizing?: boolean,\n /**\n * The alignment of the column's contents relative to its allotted width.\n * @default 'start'\n */\n align?: 'start' | 'center' | 'end',\n /** The content to render as the column header. */\n children: ReactNode\n}\n\n/**\n * A column within a `<Table>`.\n */\nexport const Column = forwardRef(function Column(props: ColumnProps, ref: DOMRef<HTMLDivElement>) {\n let {isHeaderRowHovered} = useContext(InternalTableHeaderContext);\n let {isQuiet} = useContext(InternalTableContext);\n let {allowsResizing, children, align = 'start'} = props;\n let domRef = useDOMRef(ref);\n let isColumnResizable = allowsResizing;\n\n return (\n <RACColumn {...props} ref={domRef} style={{borderInlineEndColor: 'transparent'}} className={renderProps => columnStyles({...renderProps, isColumnResizable, align, isQuiet})}>\n {({allowsSorting, sortDirection, isFocusVisible, sort, startResize, isHovered}) => (\n <>\n {/* Note this is mainly for column's without a dropdown menu. If there is a dropdown menu, the button is styled to have a focus ring for simplicity\n (no need to juggle showing this focus ring if focus is on the menu button and not if it is on the resizer) */}\n {/* Separate absolutely positioned element because appyling the ring on the column directly via outline means the ring's required borderRadius will cause the bottom gray border to curve as well */}\n {isFocusVisible && <CellFocusRing />}\n {isColumnResizable ?\n (\n <ResizableColumnContents allowsSorting={allowsSorting} sortDirection={sortDirection} sort={sort} startResize={startResize} isHovered={isHeaderRowHovered || isHovered} align={align}>\n {children}\n </ResizableColumnContents>\n ) : (\n <ColumnContents allowsSorting={allowsSorting} sortDirection={sortDirection}>\n {children}\n </ColumnContents>\n )\n }\n </>\n )}\n </RACColumn>\n );\n});\n\nconst columnContentWrapper = style({\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n width: 'full'\n});\n\nconst sortIcon = style({\n size: fontRelative(16),\n flexShrink: 0,\n marginEnd: {\n default: 8,\n isButton: 'text-to-visual'\n },\n verticalAlign: {\n default: 'bottom',\n isButton: 0\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\ninterface ColumnContentProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sortDirection'>, Pick<ColumnProps, 'children'> {}\n\nfunction ColumnContents(props: ColumnContentProps) {\n let {allowsSorting, sortDirection, children} = props;\n\n return (\n <div className={columnContentWrapper}>\n {allowsSorting && (\n <Provider\n values={[\n [IconContext, {\n styles: sortIcon({})\n }]\n ]}>\n {sortDirection != null && (\n sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />\n )}\n </Provider>\n )}\n <span className={style({truncate: true, width: 'full'})}>\n {children}\n </span>\n </div>\n );\n}\n\nconst resizableMenuButtonWrapper = style({\n ...cellFocus,\n color: 'gray-800', // body-color\n width: 'full',\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: {\n align: {\n default: 'start',\n center: 'center',\n end: 'end'\n }\n },\n // TODO: when align: end, the dropdown arrow is misaligned with the text, not sure how best to make the svg be flush with the end of the button other than modifying the\n // paddingEnd\n paddingX: 16,\n backgroundColor: 'transparent',\n borderStyle: 'none',\n fontSize: 'control',\n fontFamily: 'sans',\n fontWeight: 'bold'\n});\n\nconst resizerHandleContainer = style({\n display: {\n default: 'none',\n isResizing: 'block',\n isHovered: 'block'\n },\n width: 12,\n height: 'full',\n position: 'absolute',\n top: 0,\n insetEnd: space(-6),\n cursor: {\n default: 'none',\n resizableDirection: {\n 'left': 'e-resize',\n 'right': 'w-resize',\n 'both': 'ew-resize'\n }\n }\n});\n\nconst resizerHandle = style({\n backgroundColor: {\n default: 'transparent',\n isHovered: 'gray-300',\n isFocusVisible: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that will use the focusVisible version\n isResizing: lightDark('informative-900', 'informative-700'),\n forcedColors: {\n default: 'Background',\n isHovered: 'ButtonBorder',\n isFocusVisible: 'Highlight',\n isResizing: 'Highlight'\n }\n },\n height: {\n default: 'full',\n isResizing: 'screen'\n },\n width: {\n default: 1,\n isResizing: 2\n },\n position: 'absolute',\n insetStart: space(6)\n});\n\nconst columnHeaderText = style({\n truncate: true,\n // Make it so the text doesn't completely disappear when column is resized to smallest width + both sort and chevron icon is rendered\n minWidth: fontRelative(16),\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto'\n});\n\nconst chevronIcon = style({\n rotate: 90,\n marginStart: 'text-to-visual',\n minWidth: fontRelative(16),\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst nubbin = style({\n position: 'absolute',\n top: 0,\n insetStart: space(-1),\n size: fontRelative(16),\n fill: {\n default: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that won't be the background color value\n forcedColors: 'Highlight'\n },\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'white',\n forcedColors: 'HighlightText'\n }\n }\n});\n\ninterface ResizableColumnContentProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sort' | 'sortDirection' | 'startResize' | 'isHovered'>, Pick<ColumnProps, 'align' | 'children'> {}\n\nfunction ResizableColumnContents(props: ResizableColumnContentProps) {\n let {allowsSorting, sortDirection, sort, startResize, children, isHovered, align} = props;\n let {setIsInResizeMode, isInResizeMode} = useContext(InternalTableContext);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n const onMenuSelect = (key) => {\n switch (key) {\n case 'sort-asc':\n sort('ascending');\n break;\n case 'sort-desc':\n sort('descending');\n break;\n case 'resize':\n setIsInResizeMode?.(true);\n startResize();\n break;\n }\n };\n\n let items = useMemo(() => {\n let options = [\n {\n label: stringFormatter.format('table.resizeColumn'),\n id: 'resize'\n }\n ];\n if (allowsSorting) {\n options = [\n {\n label: stringFormatter.format('table.sortAscending'),\n id: 'sort-asc'\n },\n {\n label: stringFormatter.format('table.sortDescending'),\n id: 'sort-desc'\n },\n ...options\n ];\n }\n return options;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [allowsSorting]);\n\n let buttonAlignment = 'start';\n let menuAlign = 'start' as 'start' | 'end';\n if (align === 'center') {\n buttonAlignment = 'center';\n } else if (align === 'end') {\n buttonAlignment = 'end';\n menuAlign = 'end';\n }\n\n return (\n <>\n <MenuTrigger align={menuAlign}>\n <Button className={(renderProps) => resizableMenuButtonWrapper({...renderProps, align: buttonAlignment})}>\n {allowsSorting && (\n <Provider\n values={[\n [IconContext, {\n styles: sortIcon({isButton: true})\n }]\n ]}>\n {sortDirection != null && (\n sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />\n )}\n </Provider>\n )}\n <div className={columnHeaderText}>\n {children}\n </div>\n <Chevron size=\"M\" className={chevronIcon} />\n </Button>\n <Menu onAction={onMenuSelect} items={items} styles={style({minWidth: 128})}>\n {(item) => <MenuItem>{item?.label}</MenuItem>}\n </Menu>\n </MenuTrigger>\n <div data-react-aria-prevent-focus=\"true\">\n <ColumnResizer data-react-aria-prevent-focus=\"true\" className={({resizableDirection, isResizing}) => resizerHandleContainer({resizableDirection, isResizing, isHovered: isInResizeMode || isHovered})}>\n {({isFocusVisible, isResizing}) => (\n <>\n <ResizerIndicator isInResizeMode={isInResizeMode} isFocusVisible={isFocusVisible} isHovered={isHovered} isResizing={isResizing} />\n {(isFocusVisible || isInResizeMode) && isResizing && <div className={nubbin}><Nubbin /></div>}\n </>\n )}\n </ColumnResizer>\n </div>\n </>\n );\n}\n\nfunction ResizerIndicator({isFocusVisible, isHovered, isResizing, isInResizeMode}) {\n return (\n <div className={resizerHandle({isFocusVisible, isHovered: isHovered || isInResizeMode, isResizing})} />\n );\n}\n\nconst tableHeader = style({\n height: 'full',\n width: 'full',\n backgroundColor: 'gray-75',\n // Attempt to prevent 1px area where you can see scrolled cell content between the table outline and the table header\n marginTop: '[-1px]'\n});\n\nconst selectAllCheckbox = style({\n marginStart: 16 // table-edge-to-content, same between mobile and desktop\n});\n\nconst selectAllCheckboxColumn = style({\n padding: 0,\n height: 'full',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n position: 'relative',\n alignContent: 'center',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n borderXWidth: 0,\n borderTopWidth: {\n default: 0,\n isQuiet: 1\n },\n borderBottomWidth: 1,\n borderStyle: 'solid',\n backgroundColor: 'gray-75'\n});\n\nlet InternalTableHeaderContext = createContext<{isHeaderRowHovered?: boolean}>({isHeaderRowHovered: false});\n\nexport interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'dependencies' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'> {}\n\n/**\n * A header within a `<Table>`, containing the table columns.\n */\nexport const TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableHeader<T extends object>({columns, children}: TableHeaderProps<T>, ref: DOMRef<HTMLDivElement>) {\n let scale = useScale();\n let {selectionBehavior, selectionMode} = useTableOptions();\n let {isQuiet} = useContext(InternalTableContext);\n let [isHeaderRowHovered, setHeaderRowHovered] = useState(false);\n let domRef = useDOMRef(ref);\n\n return (\n <InternalTableHeaderContext.Provider value={{isHeaderRowHovered}}>\n <RACTableHeader\n // @ts-ignore\n ref={domRef}\n onHoverChange={setHeaderRowHovered}\n className={tableHeader}>\n {/* Add extra columns for selection. */}\n {selectionBehavior === 'toggle' && (\n // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later\n // @ts-ignore\n <RACColumn isSticky width={scale === 'medium' ? 40 : 52} minWidth={scale === 'medium' ? 40 : 52} className={selectAllCheckboxColumn({isQuiet})}>\n {({isFocusVisible}) => (\n <>\n {selectionMode === 'single' &&\n <>\n {isFocusVisible && <CellFocusRing />}\n <VisuallyHiddenSelectAllLabel />\n </>\n }\n {selectionMode === 'multiple' &&\n <Checkbox isEmphasized styles={selectAllCheckbox} slot=\"selection\" />\n }\n </>\n )}\n </RACColumn>\n )}\n <Collection items={columns}>\n {children}\n </Collection>\n </RACTableHeader>\n </InternalTableHeaderContext.Provider>\n );\n});\n\nfunction VisuallyHiddenSelectAllLabel() {\n let checkboxProps = useSlottedContext(RACCheckboxContext, 'selection');\n\n return (\n <VisuallyHidden>{checkboxProps?.['aria-label']}</VisuallyHidden>\n );\n}\n\nconst commonCellStyles = {\n borderColor: 'transparent',\n borderBottomWidth: 1,\n borderTopWidth: 0,\n borderXWidth: 0,\n borderStyle: 'solid',\n position: 'relative',\n color: {\n default: 'gray-800',\n forcedColors: 'ButtonText'\n },\n outlineStyle: 'none',\n paddingX: 16 // table-edge-to-content\n} as const;\n\nconst cell = style<CellRenderProps & S2TableProps & {isDivider: boolean}>({\n ...commonCellStyles,\n color: 'neutral',\n paddingY: centerPadding(),\n minHeight: {\n default: 40,\n density: {\n compact: 32,\n spacious: 48\n }\n },\n boxSizing: 'border-box',\n height: 'full',\n width: 'full',\n fontSize: 'control',\n alignItems: 'center',\n display: 'flex',\n borderStyle: {\n default: 'none',\n isDivider: 'solid'\n },\n borderEndWidth: {\n default: 0,\n isDivider: 1\n },\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n }\n});\n\nconst stickyCell = {\n backgroundColor: 'gray-25'\n} as const;\n\nconst checkboxCellStyle = style({\n ...commonCellStyles,\n ...stickyCell,\n paddingStart: 16,\n alignContent: 'center',\n height: '[calc(100% - 1px)]',\n borderBottomWidth: 0,\n backgroundColor: '--rowBackgroundColor'\n});\n\nconst cellContent = style({\n truncate: true,\n whiteSpace: {\n default: 'nowrap',\n overflowMode: {\n wrap: 'normal'\n }\n },\n textAlign: {\n align: {\n start: 'start',\n center: 'center',\n end: 'end'\n }\n },\n width: 'full',\n isolation: 'isolate',\n padding: {\n default: 4,\n isSticky: 0\n },\n margin: {\n default: -4,\n isSticky: 0\n },\n backgroundColor: {\n default: 'transparent',\n isSticky: '--rowBackgroundColor'\n }\n});\n\nexport interface CellProps extends RACCellProps, Pick<ColumnProps, 'align' | 'showDivider'> {\n /** @private */\n isSticky?: boolean,\n /** The content to render as the cell children. */\n children: ReactNode\n}\n\n/**\n * A cell within a table row.\n */\nexport const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isSticky, showDivider = false, align, textValue, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let tableVisualOptions = useContext(InternalTableContext);\n textValue ||= typeof children === 'string' ? children : undefined;\n\n return (\n <RACCell\n ref={domRef}\n // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later\n // @ts-ignore\n isSticky={isSticky}\n className={renderProps => cell({\n ...renderProps,\n ...tableVisualOptions,\n isDivider: showDivider\n })}\n textValue={textValue}\n {...otherProps}>\n {({isFocusVisible}) => (\n <>\n {isFocusVisible && <CellFocusRing />}\n <span className={cellContent({...tableVisualOptions, isSticky, align: align || 'start'})}>{children}</span>\n </>\n )}\n </RACCell>\n );\n});\n\n// Use color-mix instead of transparency so sticky cells work correctly.\nconst selectedBackground = lightDark(colorMix('gray-25', 'informative-900', 10), colorMix('gray-25', 'informative-700', 10));\nconst selectedActiveBackground = lightDark(colorMix('gray-25', 'informative-900', 15), colorMix('gray-25', 'informative-700', 15));\nconst rowBackgroundColor = {\n default: {\n default: 'gray-25',\n isQuiet: '--s2-container-bg'\n },\n isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color\n isHovered: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color\n isPressed: colorMix('gray-25', 'gray-900', 10), // table-row-hover-color\n isSelected: {\n default: selectedBackground, // table-selected-row-background-color, opacity /10\n isFocusVisibleWithin: selectedActiveBackground, // table-selected-row-background-color, opacity /15\n isHovered: selectedActiveBackground, // table-selected-row-background-color, opacity /15\n isPressed: selectedActiveBackground // table-selected-row-background-color, opacity /15\n },\n forcedColors: {\n default: 'Background'\n }\n} as const;\n\nconst row = style<RowRenderProps & S2TableProps>({\n height: 'full',\n position: 'relative',\n boxSizing: 'border-box',\n backgroundColor: '--rowBackgroundColor',\n '--rowBackgroundColor': {\n type: 'backgroundColor',\n value: rowBackgroundColor\n },\n '--rowFocusIndicatorColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n // TODO: outline here is to emulate v3 forcedColors experience but runs into the same problem where the sticky column covers the outline\n // This doesn't quite work because it gets cut off by the checkbox cell background masking element, figure out another way. Could shrink the checkbox cell's content even more\n // and offset it by margin top but that messes up the checkbox centering a bit\n // outlineWidth: {\n // forcedColors: {\n // isFocusVisible: 2\n // }\n // },\n // outlineOffset: {\n // forcedColors: {\n // isFocusVisible: -1\n // }\n // },\n // outlineColor: {\n // forcedColors: {\n // isFocusVisible: 'ButtonBorder'\n // }\n // },\n // outlineStyle: {\n // default: 'none',\n // forcedColors: {\n // isFocusVisible: 'solid'\n // }\n // },\n outlineStyle: 'none',\n borderTopWidth: 0,\n borderBottomWidth: 1,\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n forcedColorAdjust: 'none'\n});\n\nexport interface RowProps<T> extends Pick<RACRowProps<T>, 'id' | 'columns' | 'children' | 'textValue'> {}\n\n/**\n * A row within a `<Table>`.\n */\nexport const Row = /*#__PURE__*/ (forwardRef as forwardRefType)(function Row<T extends object>({id, columns, children, ...otherProps}: RowProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {selectionBehavior, selectionMode} = useTableOptions();\n let tableVisualOptions = useContext(InternalTableContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACRow\n // @ts-ignore\n ref={domRef}\n id={id}\n className={renderProps => row({\n ...renderProps,\n ...tableVisualOptions\n }) + (renderProps.isFocusVisible && ' ' + raw('&:before { content: \"\"; display: inline-block; position: sticky; inset-inline-start: 0; width: 3px; height: 100%; margin-inline-end: -3px; margin-block-end: 1px; z-index: 3; background-color: var(--rowFocusIndicatorColor)'))}\n {...otherProps}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n <Cell isSticky className={checkboxCellStyle}>\n <Checkbox isEmphasized slot=\"selection\" />\n </Cell>\n )}\n <Collection items={columns}>\n {children}\n </Collection>\n </RACRow>\n );\n});\n"],"names":[],"version":3,"file":"TableView.css.map"}
1
+ {"mappings":"ACuHqB;EAAA;;;;EAAA;;;;EAAA;;;;EAWP;;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyU+B;;;;EAAA;;;;EAAA;;;;EAGxB;;;;EA2FQ;;;;EAOZ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2CkB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAwBJ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqBT;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyBG;;;;EAAA;;;;EAAA;;;;EASL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAWL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6F6C;;;;EAwBxC;;;;EAQM;;;;EAIM;;;;EAAA;;;;EA6FnB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAmCa;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAUN;;;;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;;;;EA4FR;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAuEoC;;;;;;;;;;;;;;AA5+B3B;EAWP;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAydqB;;;;IA6Cb;;;;IAAA;;;;IAAA;;;;IA6CP;;;;IAAA;;;;IAiQW;;;;IAsGd;;;;IAAA;;;;IAAA;;;;;;AA9kBS;EAAA;IAkGJ;;;;IA0HG;;;;IAyOP;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["2240c4c45ca0caf3","packages/@react-spectrum/s2/src/TableView.tsx"],"sourcesContent":["@import \"5b1d6c31fe4487e1\";\n@import \"f77e406826513ab2\";\n@import \"8dbcf3cea8cfcf9c\";\n@import \"890f8aae714c4bd1\";\n@import \"48b36de5a4ffba52\";\n@import \"f6b070bd01650099\";\n@import \"cdde521fb70eb9ad\";\n@import \"d7adc374eba6f78a\";\n@import \"35aaf22940bf2f2a\";\n@import \"32213075f389df20\";\n@import \"b0feba60a0629310\";\n@import \"7c09a91fbb0fbaa4\";\n@import \"b2c69c7a7ed62426\";\n@import \"07b0d08572549118\";\n@import \"5e5dc59c220c1582\";\n@import \"0c3bd1e2e2accabc\";\n@import \"be20f998f58af945\";\n@import \"dd6f10cdba64c3a3\";\n@import \"06cceb4ec05a1b8a\";\n@import \"8cc40857bd78d993\";\n@import \"36e840b6feb3c919\";\n@import \"b0c207aa30d06f1f\";\n@import \"0d7bafdf4e6377cb\";\n@import \"219f545e8afc3f03\";\n@import \"c40132ec5eb61ae5\";\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 {\n Button,\n CellRenderProps,\n Collection,\n ColumnRenderProps,\n ColumnResizer,\n ContextValue,\n Key,\n Provider,\n Cell as RACCell,\n CellProps as RACCellProps,\n CheckboxContext as RACCheckboxContext,\n Column as RACColumn,\n ColumnProps as RACColumnProps,\n Row as RACRow,\n RowProps as RACRowProps,\n Table as RACTable,\n TableBody as RACTableBody,\n TableBodyProps as RACTableBodyProps,\n TableHeader as RACTableHeader,\n TableHeaderProps as RACTableHeaderProps,\n TableProps as RACTableProps,\n ResizableTableContainer,\n RowRenderProps,\n TableBodyRenderProps,\n TableRenderProps,\n UNSTABLE_TableLayout,\n UNSTABLE_TableLoadingIndicator,\n UNSTABLE_Virtualizer,\n useSlottedContext,\n useTableOptions\n} from 'react-aria-components';\nimport {centerPadding, getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {Checkbox} from './Checkbox';\nimport Chevron from '../ui-icons/Chevron';\nimport {colorMix, focusRing, fontRelative, lightDark, space, style} from '../style' with {type: 'macro'};\nimport {ColumnSize} from '@react-types/table';\nimport {DOMRef, DOMRefValue, forwardRefType, LoadingState, Node} from '@react-types/shared';\nimport {GridNode} from '@react-types/grid';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {LayoutNode} from '@react-stately/layout';\nimport {Menu, MenuItem, MenuTrigger} from './Menu';\nimport {mergeStyles} from '../style/runtime';\nimport Nubbin from '../ui-icons/S2_MoveHorizontalTableWidget.svg';\nimport {ProgressCircle} from './ProgressCircle';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactElement, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {Rect} from '@react-stately/virtualizer';\nimport SortDownArrow from '../s2wf-icons/S2_Icon_SortDown_20_N.svg';\nimport SortUpArrow from '../s2wf-icons/S2_Icon_SortUp_20_N.svg';\nimport {useActionBarContainer} from './ActionBar';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLoadMore} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useScale} from './utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\nimport {VisuallyHidden} from 'react-aria';\n\ninterface S2TableProps {\n /** Whether the Table should be displayed with a quiet style. */\n isQuiet?: boolean,\n /**\n * Sets the amount of vertical padding within each cell.\n * @default 'regular'\n */\n density?: 'compact' | 'spacious' | 'regular',\n /**\n * Sets the overflow behavior for the cell contents.\n * @default 'truncate'\n */\n overflowMode?: 'wrap' | 'truncate',\n // TODO: will we contine with onAction or rename to onRowAction like it is in RAC?\n /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void,\n /**\n * Handler that is called when a user starts a column resize.\n */\n onResizeStart?: (widths: Map<Key, ColumnSize>) => void,\n /**\n * Handler that is called when a user performs a column resize.\n * Can be used with the width property on columns to put the column widths into\n * a controlled state.\n */\n onResize?: (widths: Map<Key, ColumnSize>) => void,\n /**\n * Handler that is called after a user performs a column resize.\n * Can be used to store the widths of columns for another future session.\n */\n onResizeEnd?: (widths: Map<Key, ColumnSize>) => void,\n /** The current loading state of the table. */\n loadingState?: LoadingState,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => any,\n /** Provides the ActionBar to display when rows are selected in the TableView. */\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement\n}\n\n// TODO: Note that loadMore and loadingState are now on the Table instead of on the TableBody\nexport interface TableViewProps extends Omit<RACTableProps, 'style' | 'disabledBehavior' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks'>, UnsafeStyles, S2TableProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nlet InternalTableContext = createContext<TableViewProps & {layout?: S2TableLayout<unknown>, setIsInResizeMode?:(val: boolean) => void, isInResizeMode?: boolean}>({});\n\nconst tableWrapper = style({\n minHeight: 0,\n minWidth: 0,\n display: 'flex',\n isolation: 'isolate',\n disableTapHighlight: true,\n position: 'relative',\n // Clip ActionBar animation.\n overflow: 'clip'\n});\n\nconst table = style<TableRenderProps & S2TableProps & {isCheckboxSelection?: boolean}>({\n width: 'full',\n userSelect: 'none',\n minHeight: 0,\n minWidth: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n overflow: 'auto',\n backgroundColor: {\n default: 'gray-25',\n isQuiet: 'transparent',\n forcedColors: 'Background'\n },\n borderColor: 'gray-300',\n borderStyle: 'solid',\n borderWidth: {\n default: 1,\n isQuiet: 0\n },\n ...focusRing(),\n outlineOffset: -1, // Cover the border\n borderRadius: {\n default: '[6px]',\n isQuiet: 'none'\n },\n // Multiple browser bugs from scrollIntoView and scrollPadding:\n // Bug: Table doesn't scroll items into view perfectly in Chrome\n // https://issues.chromium.org/issues/365913982\n // Bug: Table scrolls to the left when navigating up/down through the checkboxes when body is scrolled to the right.\n // https://issues.chromium.org/issues/40067778\n // https://bugs.webkit.org/show_bug.cgi?id=272799\n // Base reproduction: https://codepen.io/lfdanlu/pen/zYVVGPW\n scrollPaddingTop: 32,\n scrollPaddingStart: {\n isCheckboxSelection: 40\n }\n}, getAllowedOverrides({height: true}));\n\n// component-height-100\nconst DEFAULT_HEADER_HEIGHT = {\n medium: 32,\n large: 40\n};\n\nconst ROW_HEIGHTS = {\n compact: {\n medium: 32, // table-row-height-medium-compact (aka component-height-100)\n large: 40\n },\n regular: {\n medium: 40, // table-row-height-medium-regular\n large: 50\n },\n spacious: {\n medium: 48, // table-row-height-medium-spacious\n large: 60\n }\n};\n\nexport class S2TableLayout<T> extends UNSTABLE_TableLayout<T> {\n constructor(options) {\n super({...options, loaderHeight: 60});\n }\n\n protected isStickyColumn(node: GridNode<T>): boolean {\n return node.props.isSticky;\n }\n\n protected buildCollection(): LayoutNode[] {\n let [header, body] = super.buildCollection();\n let {children, layoutInfo} = body;\n // TableLayout's buildCollection always sets the body width to the max width between the header width, but\n // we want the body to be sticky and only as wide as the table so it is always in view if loading/empty\n if (children?.length === 0) {\n layoutInfo.rect.width = this.virtualizer!.visibleRect.width - 80;\n }\n\n return [\n header,\n body\n ];\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildLoader(node, x, y);\n let {layoutInfo} = layoutNode;\n layoutInfo.allowOverflow = true;\n layoutInfo.rect.width = this.virtualizer!.visibleRect.width;\n layoutInfo.isSticky = true;\n return layoutNode;\n }\n\n protected buildBody(y: number): LayoutNode {\n let layoutNode = super.buildBody(y);\n let {children, layoutInfo} = layoutNode;\n // Needs overflow for sticky loader\n layoutInfo.allowOverflow = true;\n // If loading or empty, we'll want the body to be sticky and centered\n if (children?.length === 0) {\n layoutInfo.rect = new Rect(40, 40, this.virtualizer!.visibleRect.width - 80, this.virtualizer!.visibleRect.height - 80);\n layoutInfo.isSticky = true;\n }\n\n return {...layoutNode, layoutInfo};\n }\n\n protected buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildRow(node, x, y);\n layoutNode.layoutInfo.allowOverflow = true;\n // Needs overflow for sticky selection/drag cells\n return layoutNode;\n }\n\n protected buildTableHeader(): LayoutNode {\n let layoutNode = super.buildTableHeader();\n // Needs overflow for sticky selection/drag column\n layoutNode.layoutInfo.allowOverflow = true;\n return layoutNode;\n }\n\n protected buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildColumn(node, x, y);\n // Needs overflow for the resize handle\n layoutNode.layoutInfo.allowOverflow = true;\n return layoutNode;\n }\n}\n\nexport const TableContext = createContext<ContextValue<TableViewProps, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * Tables are containers for displaying information. They allow users to quickly scan, sort, compare, and take action on large amounts of data.\n */\nexport const TableView = forwardRef(function TableView(props: TableViewProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TableContext);\n let {\n UNSAFE_style,\n UNSAFE_className,\n isQuiet = false,\n density = 'regular',\n overflowMode = 'truncate',\n styles,\n loadingState,\n onLoadMore,\n onResize: propsOnResize,\n onResizeStart: propsOnResizeStart,\n onResizeEnd: propsOnResizeEnd,\n onAction,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let scale = useScale();\n let layout = useMemo(() => {\n return new S2TableLayout({\n rowHeight: overflowMode === 'wrap'\n ? undefined\n : ROW_HEIGHTS[density][scale],\n estimatedRowHeight: overflowMode === 'wrap'\n ? ROW_HEIGHTS[density][scale]\n : undefined,\n // No need for estimated headingHeight since the headers aren't affected by overflow mode: wrap\n headingHeight: DEFAULT_HEADER_HEIGHT[scale]\n });\n }, [overflowMode, density, scale]);\n\n // Starts when the user selects resize from the menu, ends when resizing ends\n // used to control the visibility of the resizer Nubbin\n let [isInResizeMode, setIsInResizeMode] = useState(false);\n let onResizeStart = useCallback((widths) => {\n propsOnResizeStart?.(widths);\n }, [propsOnResizeStart]);\n let onResizeEnd = useCallback((widths) => {\n setIsInResizeMode(false);\n propsOnResizeEnd?.(widths);\n }, [propsOnResizeEnd, setIsInResizeMode]);\n\n let context = useMemo(() => ({\n isQuiet,\n density,\n overflowMode,\n loadingState,\n isInResizeMode,\n setIsInResizeMode\n }), [isQuiet, density, overflowMode, loadingState, isInResizeMode, setIsInResizeMode]);\n\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n let scrollRef = useRef<HTMLElement | null>(null);\n let memoedLoadMoreProps = useMemo(() => ({\n isLoading: isLoading,\n onLoadMore\n }), [isLoading, onLoadMore]);\n useLoadMore(memoedLoadMoreProps, scrollRef);\n let isCheckboxSelection = props.selectionMode === 'multiple' || props.selectionMode === 'single';\n\n let {selectedKeys, onSelectionChange, actionBar, actionBarHeight} = useActionBarContainer({...props, scrollRef});\n\n return (\n <ResizableTableContainer\n // TODO: perhaps this ref should be attached to the RACTable but it expects a table type ref which isn't true in the virtualized case\n ref={domRef}\n onResize={propsOnResize}\n onResizeEnd={onResizeEnd}\n onResizeStart={onResizeStart}\n className={(UNSAFE_className || '') + mergeStyles(tableWrapper, styles)}\n style={UNSAFE_style}>\n <UNSTABLE_Virtualizer layout={layout}>\n <InternalTableContext.Provider value={context}>\n <RACTable\n ref={scrollRef as any}\n style={{\n // Fix webkit bug where scrollbars appear above the checkboxes/other table elements\n WebkitTransform: 'translateZ(0)',\n // Add padding at the bottom when the action bar is visible so users can scroll to the last items.\n // Also add scroll padding so navigating with the keyboard doesn't go behind the action bar.\n paddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0,\n scrollPaddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0\n }}\n className={renderProps => table({\n ...renderProps,\n isCheckboxSelection,\n isQuiet\n })}\n selectionBehavior=\"toggle\"\n onRowAction={onAction}\n {...otherProps}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={undefined}\n onSelectionChange={onSelectionChange} />\n </InternalTableContext.Provider>\n </UNSTABLE_Virtualizer>\n {actionBar}\n </ResizableTableContainer>\n );\n});\n\nconst centeredWrapper = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 'full',\n height: 'full'\n});\n\nexport interface TableBodyProps<T> extends Omit<RACTableBodyProps<T>, 'style' | 'className' | 'dependencies'> {}\n\n/**\n * The body of a `<Table>`, containing the table rows.\n */\nexport const TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableBody<T extends object>(props: TableBodyProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {items, renderEmptyState, children} = props;\n let domRef = useDOMRef(ref);\n let {loadingState} = useContext(InternalTableContext);\n let emptyRender;\n let renderer = children;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let loadMoreSpinner = (\n <UNSTABLE_TableLoadingIndicator className={style({height: 'full', width: 'full'})}>\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loadingMore')} />\n </div>\n </UNSTABLE_TableLoadingIndicator>\n );\n\n // If the user is rendering their rows in dynamic fashion, wrap their render function in Collection so we can inject\n // the loader. Otherwise it is a static renderer and thus we can simply add the table loader after\n // TODO: this assumes that the user isn't providing their children in some wrapper though and/or isn't doing a map of children\n // (though I guess they wouldn't provide items then so the check for this is still valid in the latter case)...\n if (typeof children === 'function' && items) {\n renderer = (\n <>\n <Collection items={items}>\n {children}\n </Collection>\n {loadingState === 'loadingMore' && loadMoreSpinner}\n </>\n );\n } else {\n renderer = (\n <>\n {children}\n {loadingState === 'loadingMore' && loadMoreSpinner}\n </>\n );\n }\n\n if (renderEmptyState != null && loadingState !== 'loading') {\n emptyRender = (props: TableBodyRenderProps) => (\n <div className={centeredWrapper}>\n {renderEmptyState(props)}\n </div>\n );\n } else if (loadingState === 'loading') {\n emptyRender = () => (\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loading')} />\n </div>\n );\n }\n\n return (\n <RACTableBody\n // @ts-ignore\n ref={domRef}\n className={style({height: 'full'})}\n {...props}\n renderEmptyState={emptyRender}\n dependencies={[loadingState]}>\n {renderer}\n </RACTableBody>\n );\n});\n\nconst cellFocus = {\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineOffset: -2,\n outlineWidth: 2,\n outlineColor: 'focus-ring',\n borderRadius: '[6px]'\n} as const;\n\nfunction CellFocusRing() {\n return <div role=\"presentation\" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible: true})} />;\n}\n\nconst columnStyles = style({\n height: '[inherit]',\n boxSizing: 'border-box',\n color: {\n default: 'neutral',\n forcedColors: 'ButtonText'\n },\n paddingX: {\n default: 16,\n isColumnResizable: 0\n },\n textAlign: {\n align: {\n start: 'start',\n center: 'center',\n end: 'end'\n }\n },\n outlineStyle: 'none',\n position: 'relative',\n fontSize: 'control',\n fontFamily: 'sans',\n fontWeight: 'bold',\n display: 'flex',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n borderTopWidth: {\n default: 0,\n isQuiet: 1\n },\n borderBottomWidth: 1,\n borderStartWidth: 0,\n borderEndWidth: {\n default: 0,\n isColumnResizable: 1\n },\n borderStyle: 'solid',\n forcedColorAdjust: 'none'\n});\n\nexport interface ColumnProps extends RACColumnProps {\n /** Whether the column should render a divider between it and the next column. */\n showDivider?: boolean,\n /** Whether the column allows resizing. */\n allowsResizing?: boolean,\n /**\n * The alignment of the column's contents relative to its allotted width.\n * @default 'start'\n */\n align?: 'start' | 'center' | 'end',\n /** The content to render as the column header. */\n children: ReactNode\n}\n\n/**\n * A column within a `<Table>`.\n */\nexport const Column = forwardRef(function Column(props: ColumnProps, ref: DOMRef<HTMLDivElement>) {\n let {isHeaderRowHovered} = useContext(InternalTableHeaderContext);\n let {isQuiet} = useContext(InternalTableContext);\n let {allowsResizing, children, align = 'start'} = props;\n let domRef = useDOMRef(ref);\n let isColumnResizable = allowsResizing;\n\n return (\n <RACColumn {...props} ref={domRef} style={{borderInlineEndColor: 'transparent'}} className={renderProps => columnStyles({...renderProps, isColumnResizable, align, isQuiet})}>\n {({allowsSorting, sortDirection, isFocusVisible, sort, startResize, isHovered}) => (\n <>\n {/* Note this is mainly for column's without a dropdown menu. If there is a dropdown menu, the button is styled to have a focus ring for simplicity\n (no need to juggle showing this focus ring if focus is on the menu button and not if it is on the resizer) */}\n {/* Separate absolutely positioned element because appyling the ring on the column directly via outline means the ring's required borderRadius will cause the bottom gray border to curve as well */}\n {isFocusVisible && <CellFocusRing />}\n {isColumnResizable ?\n (\n <ResizableColumnContents allowsSorting={allowsSorting} sortDirection={sortDirection} sort={sort} startResize={startResize} isHovered={isHeaderRowHovered || isHovered} align={align}>\n {children}\n </ResizableColumnContents>\n ) : (\n <ColumnContents allowsSorting={allowsSorting} sortDirection={sortDirection}>\n {children}\n </ColumnContents>\n )\n }\n </>\n )}\n </RACColumn>\n );\n});\n\nconst columnContentWrapper = style({\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n width: 'full'\n});\n\nconst sortIcon = style({\n size: fontRelative(16),\n flexShrink: 0,\n marginEnd: {\n default: 8,\n isButton: 'text-to-visual'\n },\n verticalAlign: {\n default: 'bottom',\n isButton: 0\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\ninterface ColumnContentProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sortDirection'>, Pick<ColumnProps, 'children'> {}\n\nfunction ColumnContents(props: ColumnContentProps) {\n let {allowsSorting, sortDirection, children} = props;\n\n return (\n <div className={columnContentWrapper}>\n {allowsSorting && (\n <Provider\n values={[\n [IconContext, {\n styles: sortIcon({})\n }]\n ]}>\n {sortDirection != null && (\n sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />\n )}\n </Provider>\n )}\n <span className={style({truncate: true, width: 'full'})}>\n {children}\n </span>\n </div>\n );\n}\n\nconst resizableMenuButtonWrapper = style({\n ...cellFocus,\n color: 'gray-800', // body-color\n width: 'full',\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: {\n align: {\n default: 'start',\n center: 'center',\n end: 'end'\n }\n },\n // TODO: when align: end, the dropdown arrow is misaligned with the text, not sure how best to make the svg be flush with the end of the button other than modifying the\n // paddingEnd\n paddingX: 16,\n backgroundColor: 'transparent',\n borderStyle: 'none',\n fontSize: 'control',\n fontFamily: 'sans',\n fontWeight: 'bold'\n});\n\nconst resizerHandleContainer = style({\n display: {\n default: 'none',\n isResizing: 'block',\n isHovered: 'block'\n },\n width: 12,\n height: 'full',\n position: 'absolute',\n top: 0,\n insetEnd: space(-6),\n cursor: {\n default: 'none',\n resizableDirection: {\n 'left': 'e-resize',\n 'right': 'w-resize',\n 'both': 'ew-resize'\n }\n }\n});\n\nconst resizerHandle = style({\n backgroundColor: {\n default: 'transparent',\n isHovered: 'gray-300',\n isFocusVisible: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that will use the focusVisible version\n isResizing: lightDark('informative-900', 'informative-700'),\n forcedColors: {\n default: 'Background',\n isHovered: 'ButtonBorder',\n isFocusVisible: 'Highlight',\n isResizing: 'Highlight'\n }\n },\n height: {\n default: 'full',\n isResizing: 'screen'\n },\n width: {\n default: 1,\n isResizing: 2\n },\n position: 'absolute',\n insetStart: space(6)\n});\n\nconst columnHeaderText = style({\n truncate: true,\n // Make it so the text doesn't completely disappear when column is resized to smallest width + both sort and chevron icon is rendered\n minWidth: fontRelative(16),\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto'\n});\n\nconst chevronIcon = style({\n rotate: 90,\n marginStart: 'text-to-visual',\n minWidth: fontRelative(16),\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst nubbin = style({\n position: 'absolute',\n top: 0,\n insetStart: space(-1),\n size: fontRelative(16),\n fill: {\n default: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that won't be the background color value\n forcedColors: 'Highlight'\n },\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'white',\n forcedColors: 'HighlightText'\n }\n }\n});\n\ninterface ResizableColumnContentProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sort' | 'sortDirection' | 'startResize' | 'isHovered'>, Pick<ColumnProps, 'align' | 'children'> {}\n\nfunction ResizableColumnContents(props: ResizableColumnContentProps) {\n let {allowsSorting, sortDirection, sort, startResize, children, isHovered, align} = props;\n let {setIsInResizeMode, isInResizeMode} = useContext(InternalTableContext);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n const onMenuSelect = (key) => {\n switch (key) {\n case 'sort-asc':\n sort('ascending');\n break;\n case 'sort-desc':\n sort('descending');\n break;\n case 'resize':\n setIsInResizeMode?.(true);\n startResize();\n break;\n }\n };\n\n let items = useMemo(() => {\n let options = [\n {\n label: stringFormatter.format('table.resizeColumn'),\n id: 'resize'\n }\n ];\n if (allowsSorting) {\n options = [\n {\n label: stringFormatter.format('table.sortAscending'),\n id: 'sort-asc'\n },\n {\n label: stringFormatter.format('table.sortDescending'),\n id: 'sort-desc'\n },\n ...options\n ];\n }\n return options;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [allowsSorting]);\n\n let buttonAlignment = 'start';\n let menuAlign = 'start' as 'start' | 'end';\n if (align === 'center') {\n buttonAlignment = 'center';\n } else if (align === 'end') {\n buttonAlignment = 'end';\n menuAlign = 'end';\n }\n\n return (\n <>\n <MenuTrigger align={menuAlign}>\n <Button className={(renderProps) => resizableMenuButtonWrapper({...renderProps, align: buttonAlignment})}>\n {allowsSorting && (\n <Provider\n values={[\n [IconContext, {\n styles: sortIcon({isButton: true})\n }]\n ]}>\n {sortDirection != null && (\n sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />\n )}\n </Provider>\n )}\n <div className={columnHeaderText}>\n {children}\n </div>\n <Chevron size=\"M\" className={chevronIcon} />\n </Button>\n <Menu onAction={onMenuSelect} items={items} styles={style({minWidth: 128})}>\n {(item) => <MenuItem>{item?.label}</MenuItem>}\n </Menu>\n </MenuTrigger>\n <div data-react-aria-prevent-focus=\"true\">\n <ColumnResizer data-react-aria-prevent-focus=\"true\" className={({resizableDirection, isResizing}) => resizerHandleContainer({resizableDirection, isResizing, isHovered: isInResizeMode || isHovered})}>\n {({isFocusVisible, isResizing}) => (\n <>\n <ResizerIndicator isInResizeMode={isInResizeMode} isFocusVisible={isFocusVisible} isHovered={isHovered} isResizing={isResizing} />\n {(isFocusVisible || isInResizeMode) && isResizing && <div className={nubbin}><Nubbin /></div>}\n </>\n )}\n </ColumnResizer>\n </div>\n </>\n );\n}\n\nfunction ResizerIndicator({isFocusVisible, isHovered, isResizing, isInResizeMode}) {\n return (\n <div className={resizerHandle({isFocusVisible, isHovered: isHovered || isInResizeMode, isResizing})} />\n );\n}\n\nconst tableHeader = style({\n height: 'full',\n width: 'full',\n backgroundColor: 'gray-75',\n // Attempt to prevent 1px area where you can see scrolled cell content between the table outline and the table header\n marginTop: '[-1px]'\n});\n\nconst selectAllCheckbox = style({\n marginStart: 16 // table-edge-to-content, same between mobile and desktop\n});\n\nconst selectAllCheckboxColumn = style({\n padding: 0,\n height: 'full',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n position: 'relative',\n alignContent: 'center',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n borderXWidth: 0,\n borderTopWidth: {\n default: 0,\n isQuiet: 1\n },\n borderBottomWidth: 1,\n borderStyle: 'solid',\n backgroundColor: 'gray-75'\n});\n\nlet InternalTableHeaderContext = createContext<{isHeaderRowHovered?: boolean}>({isHeaderRowHovered: false});\n\nexport interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'dependencies' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'> {}\n\n/**\n * A header within a `<Table>`, containing the table columns.\n */\nexport const TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(function TableHeader<T extends object>({columns, children}: TableHeaderProps<T>, ref: DOMRef<HTMLDivElement>) {\n let scale = useScale();\n let {selectionBehavior, selectionMode} = useTableOptions();\n let {isQuiet} = useContext(InternalTableContext);\n let [isHeaderRowHovered, setHeaderRowHovered] = useState(false);\n let domRef = useDOMRef(ref);\n\n return (\n <InternalTableHeaderContext.Provider value={{isHeaderRowHovered}}>\n <RACTableHeader\n // @ts-ignore\n ref={domRef}\n onHoverChange={setHeaderRowHovered}\n className={tableHeader}>\n {/* Add extra columns for selection. */}\n {selectionBehavior === 'toggle' && (\n // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later\n // @ts-ignore\n <RACColumn isSticky width={scale === 'medium' ? 40 : 52} minWidth={scale === 'medium' ? 40 : 52} className={selectAllCheckboxColumn({isQuiet})}>\n {({isFocusVisible}) => (\n <>\n {selectionMode === 'single' &&\n <>\n {isFocusVisible && <CellFocusRing />}\n <VisuallyHiddenSelectAllLabel />\n </>\n }\n {selectionMode === 'multiple' &&\n <Checkbox isEmphasized styles={selectAllCheckbox} slot=\"selection\" />\n }\n </>\n )}\n </RACColumn>\n )}\n <Collection items={columns}>\n {children}\n </Collection>\n </RACTableHeader>\n </InternalTableHeaderContext.Provider>\n );\n});\n\nfunction VisuallyHiddenSelectAllLabel() {\n let checkboxProps = useSlottedContext(RACCheckboxContext, 'selection');\n\n return (\n <VisuallyHidden>{checkboxProps?.['aria-label']}</VisuallyHidden>\n );\n}\n\nconst commonCellStyles = {\n borderColor: 'transparent',\n borderBottomWidth: 1,\n borderTopWidth: 0,\n borderXWidth: 0,\n borderStyle: 'solid',\n position: 'relative',\n color: {\n default: 'gray-800',\n forcedColors: 'ButtonText'\n },\n outlineStyle: 'none',\n paddingX: 16 // table-edge-to-content\n} as const;\n\nconst cell = style<CellRenderProps & S2TableProps & {isDivider: boolean}>({\n ...commonCellStyles,\n color: 'neutral',\n paddingY: centerPadding(),\n minHeight: {\n default: 40,\n density: {\n compact: 32,\n spacious: 48\n }\n },\n boxSizing: 'border-box',\n height: 'full',\n width: 'full',\n fontSize: 'control',\n alignItems: 'center',\n display: 'flex',\n borderStyle: {\n default: 'none',\n isDivider: 'solid'\n },\n borderEndWidth: {\n default: 0,\n isDivider: 1\n },\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n }\n});\n\nconst stickyCell = {\n backgroundColor: 'gray-25'\n} as const;\n\nconst checkboxCellStyle = style({\n ...commonCellStyles,\n ...stickyCell,\n paddingStart: 16,\n alignContent: 'center',\n height: '[calc(100% - 1px)]',\n borderBottomWidth: 0,\n backgroundColor: '--rowBackgroundColor'\n});\n\nconst cellContent = style({\n truncate: true,\n whiteSpace: {\n default: 'nowrap',\n overflowMode: {\n wrap: 'normal'\n }\n },\n textAlign: {\n align: {\n start: 'start',\n center: 'center',\n end: 'end'\n }\n },\n width: 'full',\n isolation: 'isolate',\n padding: {\n default: 4,\n isSticky: 0\n },\n margin: {\n default: -4,\n isSticky: 0\n },\n backgroundColor: {\n default: 'transparent',\n isSticky: '--rowBackgroundColor'\n }\n});\n\nexport interface CellProps extends RACCellProps, Pick<ColumnProps, 'align' | 'showDivider'> {\n /** @private */\n isSticky?: boolean,\n /** The content to render as the cell children. */\n children: ReactNode\n}\n\n/**\n * A cell within a table row.\n */\nexport const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isSticky, showDivider = false, align, textValue, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let tableVisualOptions = useContext(InternalTableContext);\n textValue ||= typeof children === 'string' ? children : undefined;\n\n return (\n <RACCell\n ref={domRef}\n // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later\n // @ts-ignore\n isSticky={isSticky}\n className={renderProps => cell({\n ...renderProps,\n ...tableVisualOptions,\n isDivider: showDivider\n })}\n textValue={textValue}\n {...otherProps}>\n {({isFocusVisible}) => (\n <>\n {isFocusVisible && <CellFocusRing />}\n <span className={cellContent({...tableVisualOptions, isSticky, align: align || 'start'})}>{children}</span>\n </>\n )}\n </RACCell>\n );\n});\n\n// Use color-mix instead of transparency so sticky cells work correctly.\nconst selectedBackground = lightDark(colorMix('gray-25', 'informative-900', 10), colorMix('gray-25', 'informative-700', 10));\nconst selectedActiveBackground = lightDark(colorMix('gray-25', 'informative-900', 15), colorMix('gray-25', 'informative-700', 15));\nconst rowBackgroundColor = {\n default: {\n default: 'gray-25',\n isQuiet: '--s2-container-bg'\n },\n isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color\n isHovered: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color\n isPressed: colorMix('gray-25', 'gray-900', 10), // table-row-hover-color\n isSelected: {\n default: selectedBackground, // table-selected-row-background-color, opacity /10\n isFocusVisibleWithin: selectedActiveBackground, // table-selected-row-background-color, opacity /15\n isHovered: selectedActiveBackground, // table-selected-row-background-color, opacity /15\n isPressed: selectedActiveBackground // table-selected-row-background-color, opacity /15\n },\n forcedColors: {\n default: 'Background'\n }\n} as const;\n\nconst row = style<RowRenderProps & S2TableProps>({\n height: 'full',\n position: 'relative',\n boxSizing: 'border-box',\n backgroundColor: '--rowBackgroundColor',\n '--rowBackgroundColor': {\n type: 'backgroundColor',\n value: rowBackgroundColor\n },\n '--rowFocusIndicatorColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n // TODO: outline here is to emulate v3 forcedColors experience but runs into the same problem where the sticky column covers the outline\n // This doesn't quite work because it gets cut off by the checkbox cell background masking element, figure out another way. Could shrink the checkbox cell's content even more\n // and offset it by margin top but that messes up the checkbox centering a bit\n // outlineWidth: {\n // forcedColors: {\n // isFocusVisible: 2\n // }\n // },\n // outlineOffset: {\n // forcedColors: {\n // isFocusVisible: -1\n // }\n // },\n // outlineColor: {\n // forcedColors: {\n // isFocusVisible: 'ButtonBorder'\n // }\n // },\n // outlineStyle: {\n // default: 'none',\n // forcedColors: {\n // isFocusVisible: 'solid'\n // }\n // },\n outlineStyle: 'none',\n borderTopWidth: 0,\n borderBottomWidth: 1,\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n forcedColorAdjust: 'none'\n});\n\nexport interface RowProps<T> extends Pick<RACRowProps<T>, 'id' | 'columns' | 'children' | 'textValue'> {}\n\n/**\n * A row within a `<Table>`.\n */\nexport const Row = /*#__PURE__*/ (forwardRef as forwardRefType)(function Row<T extends object>({id, columns, children, ...otherProps}: RowProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {selectionBehavior, selectionMode} = useTableOptions();\n let tableVisualOptions = useContext(InternalTableContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACRow\n // @ts-ignore\n ref={domRef}\n id={id}\n className={renderProps => row({\n ...renderProps,\n ...tableVisualOptions\n }) + (renderProps.isFocusVisible && ' ' + raw('&:before { content: \"\"; display: inline-block; position: sticky; inset-inline-start: 0; width: 3px; height: 100%; margin-inline-end: -3px; margin-block-end: 1px; z-index: 3; background-color: var(--rowFocusIndicatorColor)'))}\n {...otherProps}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n <Cell isSticky className={checkboxCellStyle}>\n <Checkbox isEmphasized slot=\"selection\" />\n </Cell>\n )}\n <Collection items={columns}>\n {children}\n </Collection>\n </RACRow>\n );\n});\n"],"names":[],"version":3,"file":"TableView.css.map"}
package/dist/Tabs.css CHANGED
@@ -228,8 +228,6 @@
228
228
  }
229
229
  }
230
230
 
231
- @layer UNSAFE_overrides;
232
-
233
231
  @layer _.b.a {
234
232
  @media (forced-colors: active) {
235
233
  .da_____M {
@@ -266,10 +264,6 @@
266
264
  }
267
265
  }
268
266
 
269
- .\.:not(#a#b) {
270
- all: revert-layer;
271
- }
272
-
273
267
  @layer _.c {
274
268
  ._d-enzwzjc:lang(he) {
275
269
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;