@react-spectrum/s2 3.0.0-nightly-5ed06068e-241105 → 3.0.0-nightly-09ccc53e7-241107
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.
- package/dist/ActionButton.cjs +54 -11
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +47 -3
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +55 -12
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/ActionButtonGroup.cjs +77 -0
- package/dist/ActionButtonGroup.cjs.map +1 -0
- package/dist/ActionButtonGroup.css +44 -0
- package/dist/ActionButtonGroup.css.map +1 -0
- package/dist/ActionButtonGroup.mjs +70 -0
- package/dist/ActionButtonGroup.mjs.map +1 -0
- package/dist/Badge.cjs +42 -42
- package/dist/Badge.css +35 -35
- package/dist/Badge.mjs +42 -42
- package/dist/Card.cjs +1 -1
- package/dist/Card.css +1 -1
- package/dist/Card.mjs +1 -1
- package/dist/Content.cjs +1 -0
- package/dist/Content.cjs.map +1 -1
- package/dist/Content.mjs +1 -0
- package/dist/Content.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +1 -1
- package/dist/ContextualHelp.cjs.map +1 -1
- package/dist/ContextualHelp.css +32 -16
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs +1 -1
- package/dist/ContextualHelp.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs +6 -2
- package/dist/IllustratedMessage.cjs.map +1 -1
- package/dist/IllustratedMessage.css +2 -2
- package/dist/IllustratedMessage.css.map +1 -1
- package/dist/IllustratedMessage.mjs +6 -2
- package/dist/IllustratedMessage.mjs.map +1 -1
- package/dist/InlineAlert.cjs +8 -8
- package/dist/InlineAlert.css +6 -6
- package/dist/InlineAlert.mjs +8 -8
- package/dist/Meter.cjs +4 -17
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css +7 -19
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs +4 -17
- package/dist/Meter.mjs.map +1 -1
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.css +1 -1
- package/dist/Modal.mjs +1 -1
- package/dist/Picker.cjs +3 -0
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +12 -0
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +3 -0
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.css +1 -1
- package/dist/Popover.mjs +1 -1
- package/dist/ProgressBar.cjs +19 -3
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css +14 -0
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs +19 -3
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/Provider.cjs +1 -1
- package/dist/Provider.css +1 -1
- package/dist/Provider.mjs +1 -1
- package/dist/Radio.cjs +2 -2
- package/dist/Radio.cjs.map +1 -1
- package/dist/Radio.css +4 -8
- package/dist/Radio.css.map +1 -1
- package/dist/Radio.mjs +2 -2
- package/dist/Radio.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +76 -62
- package/dist/SegmentedControl.cjs.map +1 -1
- package/dist/SegmentedControl.css +110 -69
- package/dist/SegmentedControl.css.map +1 -1
- package/dist/SegmentedControl.mjs +77 -63
- package/dist/SegmentedControl.mjs.map +1 -1
- package/dist/ToggleButton.cjs +13 -6
- package/dist/ToggleButton.cjs.map +1 -1
- package/dist/ToggleButton.css +16 -0
- package/dist/ToggleButton.css.map +1 -1
- package/dist/ToggleButton.mjs +14 -7
- package/dist/ToggleButton.mjs.map +1 -1
- package/dist/ToggleButtonGroup.cjs +54 -0
- package/dist/ToggleButtonGroup.cjs.map +1 -0
- package/dist/ToggleButtonGroup.mjs +48 -0
- package/dist/ToggleButtonGroup.mjs.map +1 -0
- package/dist/main.cjs +8 -0
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +5 -1
- package/dist/module.mjs.map +1 -1
- package/dist/types.d.ts +57 -12
- package/dist/types.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/ActionButton.tsx +88 -8
- package/src/ActionButtonGroup.tsx +106 -0
- package/src/Content.tsx +2 -1
- package/src/ContextualHelp.tsx +1 -1
- package/src/IllustratedMessage.tsx +1 -3
- package/src/Meter.tsx +4 -4
- package/src/Picker.tsx +10 -1
- package/src/ProgressBar.tsx +20 -3
- package/src/Radio.tsx +1 -3
- package/src/SegmentedControl.tsx +56 -45
- package/src/ToggleButton.tsx +23 -7
- package/src/ToggleButtonGroup.tsx +55 -0
- package/src/index.ts +4 -0
- package/style/dist/spectrum-theme.cjs +5 -0
- package/style/dist/spectrum-theme.cjs.map +1 -1
- package/style/dist/spectrum-theme.mjs +5 -0
- package/style/dist/spectrum-theme.mjs.map +1 -1
- package/style/dist/types.d.ts +2 -2
- package/style/dist/types.d.ts.map +1 -1
- package/style/spectrum-theme.ts +5 -0
package/dist/ProgressBar.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA+CM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA+D;AAE7G,MAAM;AASN,MAAM;AASN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaN,MAAM;;;;;;;;;;;;;;;;;;;;;AAyBN,MAAM;;;;;;;;;;;AAcN,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SACF,KAAK,QAAE,OAAO,kBACd,WAAW,mBACX,eAAe,iBACf,gBAAgB,qBAChB,YAAY,oBACZ,mBAAmB,IACpB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,8BAAQ;IAE1B,qBACE,gCAAC,CAAA,GAAA,sCAAc;QACZ,GAAG,KAAK;QACT,KAAK;QACL,OAAO;QACP,WAAW,mBAAmB,8BAAQ;YAAC,GAAG,KAAK;kBAAE;2BAAM;QAAa,GAAG,MAAM,MAAM;kBAClF,CAAC,cAAC,UAAU,aAAE,SAAS,EAAC,iBACvB;;oBACG,uBAAS,gCAAC,CAAA,GAAA,oCAAS;wBAAE,MAAM;wBAAM,YAAW;wBAAQ,eAAe;wBAAe,aAAa;kCAAc;;oBAC7G,SAAS,CAAC,iCAAmB,gCAAC;wBAAK,WAAW,kCAAY;kCAAC;4BAAM,YAAY;yCAAO;wBAAW;kCAAK;;kCACrG,gCAAC;wBAAI,WAAW,kCAAY;4BAAC,GAAG,KAAK;wBAAA;kCACnC,cAAA,gCAAC;4BACC,WAAW,CAAA,GAAA,qCAAU,EAAE,2BAAK;gCAAC,GAAG,KAAK;6CAAE;4BAAW,IAAK,kBAAkB,6CAAuB;2CAAC;4BAAS,KAAK;4BAC/G,OAAO;gCAAC,OAAO,kBAAkB,YAAY,aAAa;4BAAG;;;;;;AAM3E;AAEA;;;CAGC,GACD,MAAM,4CAAe,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ProgressBar.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n ProgressBar as AriaProgressBar,\n ProgressBarProps as AriaProgressBarProps,\n ContextValue\n} from 'react-aria-components';\nimport {bar, track} from './bar-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {DOMRef, DOMRefValue, LabelPosition} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {mergeStyles} from '../style/runtime';\nimport {size, style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ProgressBarStyleProps {\n /**\n * The size of the ProgressBar.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether presentation is indeterminate when progress isn't known.\n */\n isIndeterminate?: boolean,\n /**\n * The static color style to apply. Useful when the button appears over a color background.\n */\n staticColor?: 'white' | 'black',\n /**\n * The label's overall position relative to the element it is labeling.\n * @default 'top'\n */\n labelPosition?: LabelPosition\n\n}\n\nexport interface ProgressBarProps extends Omit<AriaProgressBarProps, 'children' | 'className' | 'style'>, ProgressBarStyleProps, StyleProps {\n /** The content to display as the label. */\n label?: ReactNode\n}\n\nexport const ProgressBarContext = createContext<ContextValue<ProgressBarProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst indeterminateLTR = keyframes(`\n 0% {\n transform: translateX(-70%) scaleX(0.7);\n }\n 100% {\n transform: translateX(100%) scaleX(0.7);\n }\n`);\n\nconst indeterminateRTL = keyframes(`\n 0% {\n transform: translateX(100%) scaleX(0.7);\n }\n 100% {\n transform: translateX(-70%) scaleX(0.7);\n }\n`);\n\nconst wrapper = style({\n ...bar(),\n gridTemplateColumns: {\n default: {\n labelPosition: {\n top: ['1fr', 'auto'],\n side: ['auto', '1fr']\n }\n },\n isIndeterminate: {\n labelPosition: {\n top: ['1fr'],\n side: ['auto', '1fr']\n }\n }\n },\n gridTemplateAreas: {\n default: {\n labelPosition: {\n top: [\n 'label value',\n 'bar bar'\n ],\n side: [\n 'label bar value'\n ]\n }\n },\n isIndeterminate: {\n labelPosition: {\n top: [\n 'label',\n 'bar'\n ],\n side: [\n 'label bar'\n ]\n }\n }\n }\n}, getAllowedOverrides());\n\nconst valueStyles = style({\n ...fieldLabel(),\n gridArea: 'value'\n});\n\nconst trackStyles = style({\n ...track(),\n height: {\n default: size(6),\n size: {\n S: 4, // progress-bar-thickness-small\n M: size(6), // progress-bar-thickness-medium\n L: 8, // progress-bar-thickness-large\n XL: size(10) // progress-bar-thickness-extra-large\n }\n }\n});\n\nconst fill = style<ProgressBarStyleProps>({\n height: 'full',\n borderStyle: 'none',\n borderRadius: 'full',\n backgroundColor: {\n default: 'accent',\n staticColor: {\n white: {\n default: 'transparent-white-900'\n },\n // TODO: Is there a black static color in S2?\n black: {\n default: 'transparent-black-900'\n }\n },\n forcedColors: 'ButtonText'\n },\n width: {\n isIndeterminate: 'full'\n },\n transformOrigin: {\n isIndeterminate: 'left'\n }\n});\n\nconst indeterminateAnimation = style({\n animation: {\n direction: {\n ltr: indeterminateLTR,\n rtl: indeterminateRTL\n }\n },\n animationDuration: 1000,\n animationIterationCount: 'infinite',\n animationTimingFunction: 'in-out',\n willChange: 'transform',\n position: 'relative'\n});\n\nfunction ProgressBar(props: ProgressBarProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ProgressBarContext);\n let {\n label, size = 'M',\n staticColor,\n isIndeterminate,\n labelPosition = 'top',\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n let {direction} = useLocale();\n\n return (\n <AriaProgressBar\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({...props, size, labelPosition}, props.styles)}>\n {({percentage, valueText}) => (\n <>\n {label && <FieldLabel size={size} labelAlign=\"start\" labelPosition={labelPosition} staticColor={staticColor}>{label}</FieldLabel>}\n {label && !isIndeterminate && <span className={valueStyles({size, labelAlign: 'end', staticColor})}>{valueText}</span>}\n <div className={trackStyles({...props})}>\n <div\n className={mergeStyles(fill({...props, staticColor}), (isIndeterminate ? indeterminateAnimation({direction}) : null))}\n style={{width: isIndeterminate ? undefined : percentage + '%'}} />\n </div>\n </>\n )}\n </AriaProgressBar>\n );\n}\n\n/**\n * ProgressBars show the progression of a system operation: downloading, uploading, processing, etc., in a visual way.\n * They can represent either determinate or indeterminate progress.\n */\nconst _ProgressBar = /*#__PURE__*/ forwardRef(ProgressBar);\nexport {_ProgressBar as ProgressBar};\n\n"],"names":[],"version":3,"file":"ProgressBar.cjs.map"}
|
package/dist/ProgressBar.css
CHANGED
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
@keyframes -_167g35 {
|
|
12
|
+
0% {
|
|
13
|
+
transform: translateX(100%)scaleX(.7);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
100% {
|
|
17
|
+
transform: translateX(-70%)scaleX(.7);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
11
21
|
@layer _.a {
|
|
12
22
|
._Zf {
|
|
13
23
|
display: grid;
|
|
@@ -325,6 +335,10 @@
|
|
|
325
335
|
animation-name: -vliq1d;
|
|
326
336
|
}
|
|
327
337
|
|
|
338
|
+
._S-2vmxa6 {
|
|
339
|
+
animation-name: -_167g35;
|
|
340
|
+
}
|
|
341
|
+
|
|
328
342
|
._T-yjb9nq {
|
|
329
343
|
animation-duration: 1s;
|
|
330
344
|
}
|
package/dist/ProgressBar.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AC2DyB;;;;;;;;;;AASA;;;;;;;;;;AAST;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA0CI;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAKA;;;;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;;;;EAaP;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyBkB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AArFf;EA0CI;;;;EAAA;;;;;AA1CJ;;AA0CI;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAKA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAaP;;;;;;AAbO;EAAA;IAAA;;;;;;AAaP","sources":["7293bad37f188837","packages/@react-spectrum/s2/src/ProgressBar.tsx"],"sourcesContent":["@import \"0b8d2821d82ee250\";\n@import \"f2b8eec694697861\";\n@import \"bd67a9a4e04bbe30\";\n@import \"928e619efccddb64\";\n@import \"27fd25d02acf65a5\";\n@import \"47f66b5fa7a24be0\";\n@import \"5d9861be4320075f\";\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 ProgressBar as AriaProgressBar,\n ProgressBarProps as AriaProgressBarProps,\n ContextValue\n} from 'react-aria-components';\nimport {bar, track} from './bar-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {DOMRef, DOMRefValue, LabelPosition} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {mergeStyles} from '../style/runtime';\nimport {size, style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ProgressBarStyleProps {\n /**\n * The size of the ProgressBar.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether presentation is indeterminate when progress isn't known.\n */\n isIndeterminate?: boolean,\n /**\n * The static color style to apply. Useful when the button appears over a color background.\n */\n staticColor?: 'white' | 'black',\n /**\n * The label's overall position relative to the element it is labeling.\n * @default 'top'\n */\n labelPosition?: LabelPosition\n\n}\n\nexport interface ProgressBarProps extends Omit<AriaProgressBarProps, 'children' | 'className' | 'style'>, ProgressBarStyleProps, StyleProps {\n /** The content to display as the label. */\n label?: ReactNode\n}\n\nexport const ProgressBarContext = createContext<ContextValue<ProgressBarProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst indeterminateLTR = keyframes(`\n 0% {\n transform: translateX(-70%) scaleX(0.7);\n }\n 100% {\n transform: translateX(100%) scaleX(0.7);\n }\n`);\n\nconst indeterminateRTL = keyframes(`\n 0% {\n transform: translateX(100%) scaleX(0.7);\n }\n 100% {\n transform: translateX(-70%) scaleX(0.7);\n }\n`);\n\nconst wrapper = style({\n ...bar(),\n gridTemplateColumns: {\n default: {\n labelPosition: {\n top: ['1fr', 'auto'],\n side: ['auto', '1fr']\n }\n },\n isIndeterminate: {\n labelPosition: {\n top: ['1fr'],\n side: ['auto', '1fr']\n }\n }\n },\n gridTemplateAreas: {\n default: {\n labelPosition: {\n top: [\n 'label value',\n 'bar bar'\n ],\n side: [\n 'label bar value'\n ]\n }\n },\n isIndeterminate: {\n labelPosition: {\n top: [\n 'label',\n 'bar'\n ],\n side: [\n 'label bar'\n ]\n }\n }\n }\n}, getAllowedOverrides());\n\nconst valueStyles = style({\n ...fieldLabel(),\n gridArea: 'value'\n});\n\nconst trackStyles = style({\n ...track(),\n height: {\n default: size(6),\n size: {\n S: 4, // progress-bar-thickness-small\n M: size(6), // progress-bar-thickness-medium\n L: 8, // progress-bar-thickness-large\n XL: size(10) // progress-bar-thickness-extra-large\n }\n }\n});\n\nconst fill = style<ProgressBarStyleProps>({\n height: 'full',\n borderStyle: 'none',\n borderRadius: 'full',\n backgroundColor: {\n default: 'accent',\n staticColor: {\n white: {\n default: 'transparent-white-900'\n },\n // TODO: Is there a black static color in S2?\n black: {\n default: 'transparent-black-900'\n }\n },\n forcedColors: 'ButtonText'\n },\n width: {\n isIndeterminate: 'full'\n },\n transformOrigin: {\n isIndeterminate: 'left'\n }\n});\n\nconst indeterminateAnimation = style({\n animation: {\n direction: {\n ltr: indeterminateLTR,\n rtl: indeterminateRTL\n }\n },\n animationDuration: 1000,\n animationIterationCount: 'infinite',\n animationTimingFunction: 'in-out',\n willChange: 'transform',\n position: 'relative'\n});\n\nfunction ProgressBar(props: ProgressBarProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ProgressBarContext);\n let {\n label, size = 'M',\n staticColor,\n isIndeterminate,\n labelPosition = 'top',\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n let {direction} = useLocale();\n\n return (\n <AriaProgressBar\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({...props, size, labelPosition}, props.styles)}>\n {({percentage, valueText}) => (\n <>\n {label && <FieldLabel size={size} labelAlign=\"start\" labelPosition={labelPosition} staticColor={staticColor}>{label}</FieldLabel>}\n {label && !isIndeterminate && <span className={valueStyles({size, labelAlign: 'end', staticColor})}>{valueText}</span>}\n <div className={trackStyles({...props})}>\n <div\n className={mergeStyles(fill({...props, staticColor}), (isIndeterminate ? indeterminateAnimation({direction}) : null))}\n style={{width: isIndeterminate ? undefined : percentage + '%'}} />\n </div>\n </>\n )}\n </AriaProgressBar>\n );\n}\n\n/**\n * ProgressBars show the progression of a system operation: downloading, uploading, processing, etc., in a visual way.\n * They can represent either determinate or indeterminate progress.\n */\nconst _ProgressBar = /*#__PURE__*/ forwardRef(ProgressBar);\nexport {_ProgressBar as ProgressBar};\n\n"],"names":[],"version":3,"file":"ProgressBar.css.map"}
|
package/dist/ProgressBar.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import {jsx as $cNVLZ$jsx, jsxs as $cNVLZ$jsxs, Fragment as $cNVLZ$Fragment} fro
|
|
|
6
6
|
import {ProgressBar as $cNVLZ$ProgressBar} from "react-aria-components";
|
|
7
7
|
import {createContext as $cNVLZ$createContext, forwardRef as $cNVLZ$forwardRef} from "react";
|
|
8
8
|
import {useDOMRef as $cNVLZ$useDOMRef} from "@react-spectrum/utils";
|
|
9
|
+
import {useLocale as $cNVLZ$useLocale} from "@react-aria/i18n";
|
|
9
10
|
|
|
10
11
|
/*
|
|
11
12
|
* Copyright 2024 Adobe. All rights reserved.
|
|
@@ -24,8 +25,10 @@ import {useDOMRef as $cNVLZ$useDOMRef} from "@react-spectrum/utils";
|
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
|
|
28
|
+
|
|
27
29
|
const $b847b7cd294eafba$export$e9f3bf65a26ce129 = /*#__PURE__*/ (0, $cNVLZ$createContext)(null);
|
|
28
|
-
const $b847b7cd294eafba$var$
|
|
30
|
+
const $b847b7cd294eafba$var$indeterminateLTR = "-vliq1d";
|
|
31
|
+
const $b847b7cd294eafba$var$indeterminateRTL = "-_167g35";
|
|
29
32
|
const $b847b7cd294eafba$var$wrapper = function anonymous(props, overrides) {
|
|
30
33
|
let rules = " .";
|
|
31
34
|
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|_8|h|_5|_4|__A|__c|__d|__a|__b|U|__Q|X|Z|V|W|l|q|r)[^\s]+/g) || [];
|
|
@@ -177,11 +180,22 @@ const $b847b7cd294eafba$var$fill = function anonymous(props) {
|
|
|
177
180
|
if (props.isIndeterminate) rules += ' __Gh';
|
|
178
181
|
return rules;
|
|
179
182
|
};
|
|
180
|
-
const $b847b7cd294eafba$var$indeterminateAnimation =
|
|
183
|
+
const $b847b7cd294eafba$var$indeterminateAnimation = function anonymous(props) {
|
|
184
|
+
let rules = " .";
|
|
185
|
+
if (props.direction === "rtl") rules += ' _S-2vmxa6';
|
|
186
|
+
else if (props.direction === "ltr") rules += ' _S-1aanztv';
|
|
187
|
+
rules += ' _T-yjb9nq';
|
|
188
|
+
rules += ' _Ya';
|
|
189
|
+
rules += ' _X-twzmrf';
|
|
190
|
+
rules += ' __Pd';
|
|
191
|
+
rules += ' Uc';
|
|
192
|
+
return rules;
|
|
193
|
+
};
|
|
181
194
|
function $b847b7cd294eafba$var$ProgressBar(props, ref) {
|
|
182
195
|
[props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $b847b7cd294eafba$export$e9f3bf65a26ce129);
|
|
183
196
|
let { label: label, size: size = 'M', staticColor: staticColor, isIndeterminate: isIndeterminate, labelPosition: labelPosition = 'top', UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '' } = props;
|
|
184
197
|
let domRef = (0, $cNVLZ$useDOMRef)(ref);
|
|
198
|
+
let { direction: direction } = (0, $cNVLZ$useLocale)();
|
|
185
199
|
return /*#__PURE__*/ (0, $cNVLZ$jsx)((0, $cNVLZ$ProgressBar), {
|
|
186
200
|
...props,
|
|
187
201
|
ref: domRef,
|
|
@@ -216,7 +230,9 @@ function $b847b7cd294eafba$var$ProgressBar(props, ref) {
|
|
|
216
230
|
className: (0, $feb886035e0d4633$export$e618dc39ac9ad607)($b847b7cd294eafba$var$fill({
|
|
217
231
|
...props,
|
|
218
232
|
staticColor: staticColor
|
|
219
|
-
}), isIndeterminate ? $b847b7cd294eafba$var$indeterminateAnimation
|
|
233
|
+
}), isIndeterminate ? $b847b7cd294eafba$var$indeterminateAnimation({
|
|
234
|
+
direction: direction
|
|
235
|
+
}) : null),
|
|
220
236
|
style: {
|
|
221
237
|
width: isIndeterminate ? undefined : percentage + '%'
|
|
222
238
|
}
|
package/dist/ProgressBar.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA+CM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA+D;AAE7G,MAAM;AASN,MAAM;AASN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaN,MAAM;;;;;;;;;;;;;;;;;;;;;AAyBN,MAAM;;;;;;;;;;;AAcN,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SACF,KAAK,QAAE,OAAO,kBACd,WAAW,mBACX,eAAe,iBACf,gBAAgB,qBAChB,YAAY,oBACZ,mBAAmB,IACpB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAE1B,qBACE,gBAAC,CAAA,GAAA,kBAAc;QACZ,GAAG,KAAK;QACT,KAAK;QACL,OAAO;QACP,WAAW,mBAAmB,8BAAQ;YAAC,GAAG,KAAK;kBAAE;2BAAM;QAAa,GAAG,MAAM,MAAM;kBAClF,CAAC,cAAC,UAAU,aAAE,SAAS,EAAC,iBACvB;;oBACG,uBAAS,gBAAC,CAAA,GAAA,yCAAS;wBAAE,MAAM;wBAAM,YAAW;wBAAQ,eAAe;wBAAe,aAAa;kCAAc;;oBAC7G,SAAS,CAAC,iCAAmB,gBAAC;wBAAK,WAAW,kCAAY;kCAAC;4BAAM,YAAY;yCAAO;wBAAW;kCAAK;;kCACrG,gBAAC;wBAAI,WAAW,kCAAY;4BAAC,GAAG,KAAK;wBAAA;kCACnC,cAAA,gBAAC;4BACC,WAAW,CAAA,GAAA,yCAAU,EAAE,2BAAK;gCAAC,GAAG,KAAK;6CAAE;4BAAW,IAAK,kBAAkB,6CAAuB;2CAAC;4BAAS,KAAK;4BAC/G,OAAO;gCAAC,OAAO,kBAAkB,YAAY,aAAa;4BAAG;;;;;;AAM3E;AAEA;;;CAGC,GACD,MAAM,4CAAe,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ProgressBar.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n ProgressBar as AriaProgressBar,\n ProgressBarProps as AriaProgressBarProps,\n ContextValue\n} from 'react-aria-components';\nimport {bar, track} from './bar-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {DOMRef, DOMRefValue, LabelPosition} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {mergeStyles} from '../style/runtime';\nimport {size, style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ProgressBarStyleProps {\n /**\n * The size of the ProgressBar.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether presentation is indeterminate when progress isn't known.\n */\n isIndeterminate?: boolean,\n /**\n * The static color style to apply. Useful when the button appears over a color background.\n */\n staticColor?: 'white' | 'black',\n /**\n * The label's overall position relative to the element it is labeling.\n * @default 'top'\n */\n labelPosition?: LabelPosition\n\n}\n\nexport interface ProgressBarProps extends Omit<AriaProgressBarProps, 'children' | 'className' | 'style'>, ProgressBarStyleProps, StyleProps {\n /** The content to display as the label. */\n label?: ReactNode\n}\n\nexport const ProgressBarContext = createContext<ContextValue<ProgressBarProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst indeterminateLTR = keyframes(`\n 0% {\n transform: translateX(-70%) scaleX(0.7);\n }\n 100% {\n transform: translateX(100%) scaleX(0.7);\n }\n`);\n\nconst indeterminateRTL = keyframes(`\n 0% {\n transform: translateX(100%) scaleX(0.7);\n }\n 100% {\n transform: translateX(-70%) scaleX(0.7);\n }\n`);\n\nconst wrapper = style({\n ...bar(),\n gridTemplateColumns: {\n default: {\n labelPosition: {\n top: ['1fr', 'auto'],\n side: ['auto', '1fr']\n }\n },\n isIndeterminate: {\n labelPosition: {\n top: ['1fr'],\n side: ['auto', '1fr']\n }\n }\n },\n gridTemplateAreas: {\n default: {\n labelPosition: {\n top: [\n 'label value',\n 'bar bar'\n ],\n side: [\n 'label bar value'\n ]\n }\n },\n isIndeterminate: {\n labelPosition: {\n top: [\n 'label',\n 'bar'\n ],\n side: [\n 'label bar'\n ]\n }\n }\n }\n}, getAllowedOverrides());\n\nconst valueStyles = style({\n ...fieldLabel(),\n gridArea: 'value'\n});\n\nconst trackStyles = style({\n ...track(),\n height: {\n default: size(6),\n size: {\n S: 4, // progress-bar-thickness-small\n M: size(6), // progress-bar-thickness-medium\n L: 8, // progress-bar-thickness-large\n XL: size(10) // progress-bar-thickness-extra-large\n }\n }\n});\n\nconst fill = style<ProgressBarStyleProps>({\n height: 'full',\n borderStyle: 'none',\n borderRadius: 'full',\n backgroundColor: {\n default: 'accent',\n staticColor: {\n white: {\n default: 'transparent-white-900'\n },\n // TODO: Is there a black static color in S2?\n black: {\n default: 'transparent-black-900'\n }\n },\n forcedColors: 'ButtonText'\n },\n width: {\n isIndeterminate: 'full'\n },\n transformOrigin: {\n isIndeterminate: 'left'\n }\n});\n\nconst indeterminateAnimation = style({\n animation: {\n direction: {\n ltr: indeterminateLTR,\n rtl: indeterminateRTL\n }\n },\n animationDuration: 1000,\n animationIterationCount: 'infinite',\n animationTimingFunction: 'in-out',\n willChange: 'transform',\n position: 'relative'\n});\n\nfunction ProgressBar(props: ProgressBarProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ProgressBarContext);\n let {\n label, size = 'M',\n staticColor,\n isIndeterminate,\n labelPosition = 'top',\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n let {direction} = useLocale();\n\n return (\n <AriaProgressBar\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({...props, size, labelPosition}, props.styles)}>\n {({percentage, valueText}) => (\n <>\n {label && <FieldLabel size={size} labelAlign=\"start\" labelPosition={labelPosition} staticColor={staticColor}>{label}</FieldLabel>}\n {label && !isIndeterminate && <span className={valueStyles({size, labelAlign: 'end', staticColor})}>{valueText}</span>}\n <div className={trackStyles({...props})}>\n <div\n className={mergeStyles(fill({...props, staticColor}), (isIndeterminate ? indeterminateAnimation({direction}) : null))}\n style={{width: isIndeterminate ? undefined : percentage + '%'}} />\n </div>\n </>\n )}\n </AriaProgressBar>\n );\n}\n\n/**\n * ProgressBars show the progression of a system operation: downloading, uploading, processing, etc., in a visual way.\n * They can represent either determinate or indeterminate progress.\n */\nconst _ProgressBar = /*#__PURE__*/ forwardRef(ProgressBar);\nexport {_ProgressBar as ProgressBar};\n\n"],"names":[],"version":3,"file":"ProgressBar.mjs.map"}
|
package/dist/Provider.cjs
CHANGED
|
@@ -53,7 +53,7 @@ let $914a06b3a1c679bc$var$providerStyles = function anonymous(props) {
|
|
|
53
53
|
else if (props.colorScheme === "light") rules += ' _Aa';
|
|
54
54
|
else if (props.colorScheme === "light dark") rules += ' _Ac';
|
|
55
55
|
else rules += ' _A-10jn6wd';
|
|
56
|
-
if (props.background === "layer-2") rules += ' -_1de2x0q_b-
|
|
56
|
+
if (props.background === "layer-2") rules += ' -_1de2x0q_b-______o';
|
|
57
57
|
else if (props.background === "layer-1") rules += ' -_1de2x0q_b-e';
|
|
58
58
|
else if (props.background === "base") rules += ' -_1de2x0q_b-d';
|
|
59
59
|
if (props.background === "layer-2") rules += ' b-1de2x0q';
|
package/dist/Provider.css
CHANGED
package/dist/Provider.mjs
CHANGED
|
@@ -46,7 +46,7 @@ let $9affbfa4e13b9582$var$providerStyles = function anonymous(props) {
|
|
|
46
46
|
else if (props.colorScheme === "light") rules += ' _Aa';
|
|
47
47
|
else if (props.colorScheme === "light dark") rules += ' _Ac';
|
|
48
48
|
else rules += ' _A-10jn6wd';
|
|
49
|
-
if (props.background === "layer-2") rules += ' -_1de2x0q_b-
|
|
49
|
+
if (props.background === "layer-2") rules += ' -_1de2x0q_b-______o';
|
|
50
50
|
else if (props.background === "layer-1") rules += ' -_1de2x0q_b-e';
|
|
51
51
|
else if (props.background === "base") rules += ' -_1de2x0q_b-d';
|
|
52
52
|
if (props.background === "layer-2") rules += ' b-1de2x0q';
|
package/dist/Radio.cjs
CHANGED
|
@@ -101,8 +101,8 @@ const $49f41f366ec3019f$var$circle = function anonymous(props) {
|
|
|
101
101
|
rules += ' _Zd';
|
|
102
102
|
rules += ' _1c';
|
|
103
103
|
rules += ' _2d';
|
|
104
|
-
rules += '
|
|
105
|
-
rules += ' _Q-
|
|
104
|
+
rules += ' _Oa';
|
|
105
|
+
rules += ' _Q-375x7f';
|
|
106
106
|
rules += ' _Ra';
|
|
107
107
|
rules += ' _vf';
|
|
108
108
|
rules += ' _wf';
|
package/dist/Radio.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAwCD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAwCD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCN,SAAS,4BAAM,KAAiB,EAAE,GAAmC;IACnE,IAAI,YAAC,QAAQ,oBAAE,mBAAmB,kBAAI,YAAY,EAAC,GAAG;IACtD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,WAAW,CAAC,CAAC,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,qCAAU;IACtC,IAAI,QACF,OAAO,KACP,GAAG,UACJ,GAAG,CAAA,GAAA,sCAAW,EAAqB;IAEpC,qBACE,gCAAC,CAAA,GAAA,gCAAQ;QACN,GAAG,QAAQ;QACZ,KAAK;QACL,UAAU;QACV,OAAO;QACP,WAAW,CAAA,cAAe,mBAAmB,8BAAQ;gBAAC,GAAG,WAAW;0BAAE;sBAAU;YAAI,GAAG,SAAS,MAAM;kBACrG,CAAA,4BACC;;kCACE,gCAAC,CAAA,GAAA,wCAAa;kCACZ,cAAA,gCAAC;4BACC,KAAK;4BACL,OAAO,CAAA,GAAA,oCAAS,EAAE,WAAW;4BAC7B,WAAW,6BAAO;gCAChB,GAAG,WAAW;gCACd,cAAc,SAAS,YAAY;gCACnC,YAAY,YAAY,UAAU;sCAClC;4BACF;;;oBAEH;;;;AAKX;AAEA;;;CAGC,GACD,IAAI,4CAAS,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Radio.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Radio as AriaRadio,\n RadioProps as AriaRadioProps,\n RadioRenderProps\n} from 'react-aria-components';\nimport {baseColor, focusRing, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport {FocusableRef} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\n\nexport interface RadioProps extends Omit<AriaRadioProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps {\n /**\n * The label for the element.\n */\n children?: ReactNode\n}\n\ninterface ContextProps {\n /**\n * The size of the Radio.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Radio within a RadioGroup should be displayed with an emphasized style.\n */\n isEmphasized?: boolean\n}\n\ninterface RadioContextProps extends RadioProps, ContextProps {}\n\ninterface RenderProps extends RadioRenderProps, ContextProps {}\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\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 circle = style<RenderProps>({\n ...focusRing(),\n size: 'control-sm',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transition: 'default',\n borderRadius: 'full',\n borderStyle: 'solid',\n boxSizing: 'border-box',\n borderWidth: {\n default: 2,\n isSelected: '[calc((self(height) - 4px) / 2)]'\n },\n forcedColorAdjust: 'none',\n backgroundColor: 'gray-25',\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isSelected: {\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight'\n },\n isInvalid: {\n default: 'negative',\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n});\n\nfunction Radio(props: RadioProps, ref: FocusableRef<HTMLLabelElement>) {\n let {children, UNSAFE_className = '', UNSAFE_style} = props;\n let circleRef = useRef(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let isInForm = !!useContext(FormContext);\n let {\n size = 'M',\n ...allProps\n } = useFormProps<RadioContextProps>(props);\n\n return (\n <AriaRadio\n {...allProps}\n ref={domRef}\n inputRef={inputRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + wrapper({...renderProps, isInForm, size}, allProps.styles)}>\n {renderProps => (\n <>\n <CenterBaseline>\n <div\n ref={circleRef}\n style={pressScale(circleRef)(renderProps)}\n className={circle({\n ...renderProps,\n isEmphasized: allProps.isEmphasized,\n isSelected: renderProps.isSelected,\n size\n })} />\n </CenterBaseline>\n {children}\n </>\n )}\n </AriaRadio>\n );\n}\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nlet _Radio = /*#__PURE__*/ forwardRef(Radio);\nexport {_Radio as Radio};\n"],"names":[],"version":3,"file":"Radio.cjs.map"}
|
package/dist/Radio.css
CHANGED
|
@@ -57,10 +57,6 @@
|
|
|
57
57
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
._Q-375x7f {
|
|
61
|
-
transition-duration: .15s;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
60
|
.__a-4a7c5l {
|
|
65
61
|
grid-column-start: field;
|
|
66
62
|
}
|
|
@@ -125,12 +121,12 @@
|
|
|
125
121
|
justify-content: center;
|
|
126
122
|
}
|
|
127
123
|
|
|
128
|
-
.
|
|
129
|
-
transition-property: border-
|
|
124
|
+
._Oa {
|
|
125
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter;
|
|
130
126
|
}
|
|
131
127
|
|
|
132
|
-
._Q-
|
|
133
|
-
transition-duration: .
|
|
128
|
+
._Q-375x7f {
|
|
129
|
+
transition-duration: .15s;
|
|
134
130
|
}
|
|
135
131
|
|
|
136
132
|
._Ra {
|
package/dist/Radio.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"ACkDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;
|
|
1
|
+
{"mappings":"ACkDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAmBD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnBC;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;;;;IAmBD;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA","sources":["9fa8f4e96c5d74b7","packages/@react-spectrum/s2/src/Radio.tsx"],"sourcesContent":["@import \"4c55815e8f2cdad6\";\n@import \"4d824628f052c21a\";\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 Radio as AriaRadio,\n RadioProps as AriaRadioProps,\n RadioRenderProps\n} from 'react-aria-components';\nimport {baseColor, focusRing, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport {FocusableRef} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\n\nexport interface RadioProps extends Omit<AriaRadioProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps {\n /**\n * The label for the element.\n */\n children?: ReactNode\n}\n\ninterface ContextProps {\n /**\n * The size of the Radio.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Radio within a RadioGroup should be displayed with an emphasized style.\n */\n isEmphasized?: boolean\n}\n\ninterface RadioContextProps extends RadioProps, ContextProps {}\n\ninterface RenderProps extends RadioRenderProps, ContextProps {}\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\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 circle = style<RenderProps>({\n ...focusRing(),\n size: 'control-sm',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transition: 'default',\n borderRadius: 'full',\n borderStyle: 'solid',\n boxSizing: 'border-box',\n borderWidth: {\n default: 2,\n isSelected: '[calc((self(height) - 4px) / 2)]'\n },\n forcedColorAdjust: 'none',\n backgroundColor: 'gray-25',\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isSelected: {\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight'\n },\n isInvalid: {\n default: 'negative',\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n});\n\nfunction Radio(props: RadioProps, ref: FocusableRef<HTMLLabelElement>) {\n let {children, UNSAFE_className = '', UNSAFE_style} = props;\n let circleRef = useRef(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let isInForm = !!useContext(FormContext);\n let {\n size = 'M',\n ...allProps\n } = useFormProps<RadioContextProps>(props);\n\n return (\n <AriaRadio\n {...allProps}\n ref={domRef}\n inputRef={inputRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + wrapper({...renderProps, isInForm, size}, allProps.styles)}>\n {renderProps => (\n <>\n <CenterBaseline>\n <div\n ref={circleRef}\n style={pressScale(circleRef)(renderProps)}\n className={circle({\n ...renderProps,\n isEmphasized: allProps.isEmphasized,\n isSelected: renderProps.isSelected,\n size\n })} />\n </CenterBaseline>\n {children}\n </>\n )}\n </AriaRadio>\n );\n}\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nlet _Radio = /*#__PURE__*/ forwardRef(Radio);\nexport {_Radio as Radio};\n"],"names":[],"version":3,"file":"Radio.css.map"}
|
package/dist/Radio.mjs
CHANGED
|
@@ -95,8 +95,8 @@ const $1ae2870af9a200f8$var$circle = function anonymous(props) {
|
|
|
95
95
|
rules += ' _Zd';
|
|
96
96
|
rules += ' _1c';
|
|
97
97
|
rules += ' _2d';
|
|
98
|
-
rules += '
|
|
99
|
-
rules += ' _Q-
|
|
98
|
+
rules += ' _Oa';
|
|
99
|
+
rules += ' _Q-375x7f';
|
|
100
100
|
rules += ' _Ra';
|
|
101
101
|
rules += ' _vf';
|
|
102
102
|
rules += ' _wf';
|
package/dist/Radio.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAwCD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAwCD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCN,SAAS,4BAAM,KAAiB,EAAE,GAAmC;IACnE,IAAI,YAAC,QAAQ,oBAAE,mBAAmB,kBAAI,YAAY,EAAC,GAAG;IACtD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE,KAAK;IAClC,IAAI,WAAW,CAAC,CAAC,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAU;IACtC,IAAI,QACF,OAAO,KACP,GAAG,UACJ,GAAG,CAAA,GAAA,yCAAW,EAAqB;IAEpC,qBACE,gBAAC,CAAA,GAAA,YAAQ;QACN,GAAG,QAAQ;QACZ,KAAK;QACL,UAAU;QACV,OAAO;QACP,WAAW,CAAA,cAAe,mBAAmB,8BAAQ;gBAAC,GAAG,WAAW;0BAAE;sBAAU;YAAI,GAAG,SAAS,MAAM;kBACrG,CAAA,4BACC;;kCACE,gBAAC,CAAA,GAAA,yCAAa;kCACZ,cAAA,gBAAC;4BACC,KAAK;4BACL,OAAO,CAAA,GAAA,yCAAS,EAAE,WAAW;4BAC7B,WAAW,6BAAO;gCAChB,GAAG,WAAW;gCACd,cAAc,SAAS,YAAY;gCACnC,YAAY,YAAY,UAAU;sCAClC;4BACF;;;oBAEH;;;;AAKX;AAEA;;;CAGC,GACD,IAAI,4CAAS,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Radio.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Radio as AriaRadio,\n RadioProps as AriaRadioProps,\n RadioRenderProps\n} from 'react-aria-components';\nimport {baseColor, focusRing, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport {FocusableRef} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\n\nexport interface RadioProps extends Omit<AriaRadioProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps {\n /**\n * The label for the element.\n */\n children?: ReactNode\n}\n\ninterface ContextProps {\n /**\n * The size of the Radio.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Radio within a RadioGroup should be displayed with an emphasized style.\n */\n isEmphasized?: boolean\n}\n\ninterface RadioContextProps extends RadioProps, ContextProps {}\n\ninterface RenderProps extends RadioRenderProps, ContextProps {}\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\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 circle = style<RenderProps>({\n ...focusRing(),\n size: 'control-sm',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transition: 'default',\n borderRadius: 'full',\n borderStyle: 'solid',\n boxSizing: 'border-box',\n borderWidth: {\n default: 2,\n isSelected: '[calc((self(height) - 4px) / 2)]'\n },\n forcedColorAdjust: 'none',\n backgroundColor: 'gray-25',\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isSelected: {\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight'\n },\n isInvalid: {\n default: 'negative',\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n});\n\nfunction Radio(props: RadioProps, ref: FocusableRef<HTMLLabelElement>) {\n let {children, UNSAFE_className = '', UNSAFE_style} = props;\n let circleRef = useRef(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let isInForm = !!useContext(FormContext);\n let {\n size = 'M',\n ...allProps\n } = useFormProps<RadioContextProps>(props);\n\n return (\n <AriaRadio\n {...allProps}\n ref={domRef}\n inputRef={inputRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + wrapper({...renderProps, isInForm, size}, allProps.styles)}>\n {renderProps => (\n <>\n <CenterBaseline>\n <div\n ref={circleRef}\n style={pressScale(circleRef)(renderProps)}\n className={circle({\n ...renderProps,\n isEmphasized: allProps.isEmphasized,\n isSelected: renderProps.isSelected,\n size\n })} />\n </CenterBaseline>\n {children}\n </>\n )}\n </AriaRadio>\n );\n}\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nlet _Radio = /*#__PURE__*/ forwardRef(Radio);\nexport {_Radio as Radio};\n"],"names":[],"version":3,"file":"Radio.mjs.map"}
|
|
@@ -45,6 +45,42 @@ const $e33225559d5e019f$var$segmentedControl = function anonymous(props, overrid
|
|
|
45
45
|
rules += matches.join('');
|
|
46
46
|
let $l = false;
|
|
47
47
|
for (let p of matches)if (/^\s*l/.test(p)) $l = true;
|
|
48
|
+
rules += ' _Zd';
|
|
49
|
+
rules += ' ic';
|
|
50
|
+
rules += ' jc';
|
|
51
|
+
rules += ' bg';
|
|
52
|
+
rules += ' _vc';
|
|
53
|
+
rules += ' _wc';
|
|
54
|
+
rules += ' _xc';
|
|
55
|
+
rules += ' _yc';
|
|
56
|
+
if (!$l) rules += ' lJ';
|
|
57
|
+
return rules;
|
|
58
|
+
};
|
|
59
|
+
const $e33225559d5e019f$var$controlItem = function anonymous(props, overrides) {
|
|
60
|
+
let rules = " .";
|
|
61
|
+
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|_8|h|_5|_4|__A|__c|__d|__a|__b|U|__Q|X|Z|V|W|l|q|r)[^\s]+/g) || [];
|
|
62
|
+
rules += matches.join('');
|
|
63
|
+
let $U = false;
|
|
64
|
+
let $_9 = false;
|
|
65
|
+
let $h = false;
|
|
66
|
+
let $_8 = false;
|
|
67
|
+
let $q = false;
|
|
68
|
+
for (let p of matches){
|
|
69
|
+
if (/^\s*U/.test(p)) $U = true;
|
|
70
|
+
if (/^\s*_9/.test(p)) $_9 = true;
|
|
71
|
+
if (/^\s*h/.test(p)) $h = true;
|
|
72
|
+
if (/^\s*_8/.test(p)) $_8 = true;
|
|
73
|
+
if (/^\s*q/.test(p)) $q = true;
|
|
74
|
+
}
|
|
75
|
+
if (props.isFocusVisible) rules += ' _Lb';
|
|
76
|
+
else rules += ' _La';
|
|
77
|
+
rules += ' da_____z';
|
|
78
|
+
rules += ' dx';
|
|
79
|
+
rules += ' _Nc';
|
|
80
|
+
rules += ' _M-3t1z';
|
|
81
|
+
if (!$U) rules += ' Uc';
|
|
82
|
+
rules += ' _Zd';
|
|
83
|
+
rules += ' _zb';
|
|
48
84
|
rules += ' _c-bc1l9oh';
|
|
49
85
|
rules += ' _c-1uotwbwg';
|
|
50
86
|
rules += ' _c-eo0c6sf';
|
|
@@ -72,35 +108,6 @@ const $e33225559d5e019f$var$segmentedControl = function anonymous(props, overrid
|
|
|
72
108
|
rules += ' _eb';
|
|
73
109
|
rules += ' _f-1x99dlob';
|
|
74
110
|
rules += ' _fa';
|
|
75
|
-
rules += ' an';
|
|
76
|
-
rules += ' _Zd';
|
|
77
|
-
rules += ' bg';
|
|
78
|
-
rules += ' _vd';
|
|
79
|
-
rules += ' _wd';
|
|
80
|
-
rules += ' _xd';
|
|
81
|
-
rules += ' _yd';
|
|
82
|
-
if (!$l) rules += ' lG';
|
|
83
|
-
return rules;
|
|
84
|
-
};
|
|
85
|
-
const $e33225559d5e019f$var$controlItem = function anonymous(props, overrides) {
|
|
86
|
-
let rules = " .";
|
|
87
|
-
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|_8|h|_5|_4|__A|__c|__d|__a|__b|U|__Q|X|Z|V|W|l|q|r)[^\s]+/g) || [];
|
|
88
|
-
rules += matches.join('');
|
|
89
|
-
let $U = false;
|
|
90
|
-
let $h = false;
|
|
91
|
-
let $_9 = false;
|
|
92
|
-
let $_8 = false;
|
|
93
|
-
let $q = false;
|
|
94
|
-
for (let p of matches){
|
|
95
|
-
if (/^\s*U/.test(p)) $U = true;
|
|
96
|
-
if (/^\s*h/.test(p)) $h = true;
|
|
97
|
-
if (/^\s*_9/.test(p)) $_9 = true;
|
|
98
|
-
if (/^\s*_8/.test(p)) $_8 = true;
|
|
99
|
-
if (/^\s*q/.test(p)) $q = true;
|
|
100
|
-
}
|
|
101
|
-
if (!$U) rules += ' Uc';
|
|
102
|
-
rules += ' _Zd';
|
|
103
|
-
rules += ' _zb';
|
|
104
111
|
if (props.isSelected) rules += ' aa_____A';
|
|
105
112
|
else if (props.isDisabled) rules += ' aa_____B';
|
|
106
113
|
else rules += ' aa_____x';
|
|
@@ -116,31 +123,36 @@ const $e33225559d5e019f$var$controlItem = function anonymous(props, overrides) {
|
|
|
116
123
|
else if (props.isHovered) rules += ' an';
|
|
117
124
|
else rules += ' am';
|
|
118
125
|
} else rules += ' am';
|
|
119
|
-
rules += ' C-
|
|
126
|
+
rules += ' C-soocic-ve8p9e';
|
|
120
127
|
rules += ' CI';
|
|
121
|
-
rules += ' D-
|
|
128
|
+
rules += ' D-soocic-ve8p9e';
|
|
122
129
|
rules += ' DI';
|
|
123
130
|
rules += ' k-375toq';
|
|
124
131
|
rules += ' _1c';
|
|
125
|
-
if (!$
|
|
126
|
-
|
|
132
|
+
if (!$_9) {
|
|
133
|
+
if (props.isJustified) rules += ' _9-3t1y';
|
|
134
|
+
}
|
|
135
|
+
if (!$h) {
|
|
136
|
+
if (props.isJustified) rules += ' ha';
|
|
137
|
+
}
|
|
127
138
|
if (!$_8) rules += ' _8-3t1x';
|
|
128
139
|
if (!$q) rules += ' qa';
|
|
129
140
|
rules += ' _2d';
|
|
130
141
|
rules += ' _pb';
|
|
131
142
|
rules += ' __R-yksgrp';
|
|
143
|
+
rules += ' __Da';
|
|
144
|
+
rules += ' ba';
|
|
145
|
+
rules += ' wf';
|
|
146
|
+
rules += ' _vc';
|
|
147
|
+
rules += ' _wc';
|
|
148
|
+
rules += ' _xc';
|
|
149
|
+
rules += ' _yc';
|
|
132
150
|
rules += ' -rwx0fg_e-b';
|
|
133
151
|
rules += ' -_375toq_k-j';
|
|
134
152
|
return rules;
|
|
135
153
|
};
|
|
136
154
|
const $e33225559d5e019f$var$slider = function anonymous(props) {
|
|
137
155
|
let rules = " .";
|
|
138
|
-
if (props.isFocusVisible) rules += ' _Lb';
|
|
139
|
-
else rules += ' _La';
|
|
140
|
-
rules += ' da_____z';
|
|
141
|
-
rules += ' dx';
|
|
142
|
-
rules += ' _Nc';
|
|
143
|
-
rules += ' _M-3t1z';
|
|
144
156
|
if (props.isDisabled) rules += ' ba_____B';
|
|
145
157
|
else rules += ' ba_____z';
|
|
146
158
|
rules += ' bd';
|
|
@@ -171,39 +183,43 @@ function $e33225559d5e019f$var$SegmentedControl(props, ref) {
|
|
|
171
183
|
let domRef = (0, $4JHQR$reactspectrumutils.useDOMRef)(ref);
|
|
172
184
|
let prevRef = (0, $4JHQR$react.useRef)(null);
|
|
173
185
|
let currentSelectedRef = (0, $4JHQR$react.useRef)(null);
|
|
174
|
-
let onChange = (
|
|
186
|
+
let onChange = (values)=>{
|
|
175
187
|
if (currentSelectedRef.current) prevRef.current = currentSelectedRef?.current.getBoundingClientRect();
|
|
176
|
-
if (onSelectionChange) onSelectionChange(value);
|
|
188
|
+
if (onSelectionChange) onSelectionChange(values.values().next().value);
|
|
177
189
|
};
|
|
178
|
-
return /*#__PURE__*/ (0, $4JHQR$reactjsxruntime.jsx)((0, $4JHQR$reactariacomponents.
|
|
190
|
+
return /*#__PURE__*/ (0, $4JHQR$reactjsxruntime.jsx)((0, $4JHQR$reactariacomponents.ToggleButtonGroup), {
|
|
179
191
|
...props,
|
|
180
|
-
|
|
181
|
-
|
|
192
|
+
selectedKeys: selectedKey != null ? [
|
|
193
|
+
selectedKey
|
|
194
|
+
] : undefined,
|
|
195
|
+
defaultSelectedKeys: defaultSelectedKey != null ? [
|
|
196
|
+
defaultSelectedKey
|
|
197
|
+
] : undefined,
|
|
198
|
+
disallowEmptySelection: true,
|
|
182
199
|
ref: domRef,
|
|
183
200
|
orientation: "horizontal",
|
|
184
201
|
style: props.UNSAFE_style,
|
|
185
|
-
|
|
186
|
-
className: (props.UNSAFE_className || '') + $e33225559d5e019f$var$segmentedControl(
|
|
187
|
-
size: 'M'
|
|
188
|
-
}, props.styles),
|
|
202
|
+
onSelectionChange: onChange,
|
|
203
|
+
className: (props.UNSAFE_className || '') + $e33225559d5e019f$var$segmentedControl(null, props.styles),
|
|
189
204
|
"aria-label": props['aria-label'],
|
|
190
205
|
children: /*#__PURE__*/ (0, $4JHQR$reactjsxruntime.jsx)($e33225559d5e019f$var$DefaultSelectionTracker, {
|
|
191
206
|
defaultValue: defaultSelectedKey,
|
|
192
207
|
value: selectedKey,
|
|
193
208
|
prevRef: prevRef,
|
|
194
209
|
currentSelectedRef: currentSelectedRef,
|
|
210
|
+
isJustified: props.isJustified,
|
|
195
211
|
children: props.children
|
|
196
212
|
})
|
|
197
213
|
});
|
|
198
214
|
}
|
|
199
215
|
function $e33225559d5e019f$var$DefaultSelectionTracker(props) {
|
|
200
|
-
let state = (0, $4JHQR$react.useContext)((0, $4JHQR$reactariacomponents.
|
|
216
|
+
let state = (0, $4JHQR$react.useContext)((0, $4JHQR$reactariacomponents.ToggleGroupStateContext));
|
|
201
217
|
let isRegistered = (0, $4JHQR$react.useRef)(!(props.defaultValue == null && props.value == null));
|
|
202
218
|
// default select the first available item
|
|
203
219
|
let register = (0, $4JHQR$react.useCallback)((value)=>{
|
|
204
220
|
if (state && !isRegistered.current) {
|
|
205
221
|
isRegistered.current = true;
|
|
206
|
-
state.
|
|
222
|
+
state.toggleKey(value);
|
|
207
223
|
}
|
|
208
224
|
}, []);
|
|
209
225
|
return /*#__PURE__*/ (0, $4JHQR$reactjsxruntime.jsx)((0, $4JHQR$reactariacomponents.Provider), {
|
|
@@ -213,7 +229,8 @@ function $e33225559d5e019f$var$DefaultSelectionTracker(props) {
|
|
|
213
229
|
{
|
|
214
230
|
register: register,
|
|
215
231
|
prevRef: props.prevRef,
|
|
216
|
-
currentSelectedRef: props.currentSelectedRef
|
|
232
|
+
currentSelectedRef: props.currentSelectedRef,
|
|
233
|
+
isJustified: props.isJustified
|
|
217
234
|
}
|
|
218
235
|
]
|
|
219
236
|
],
|
|
@@ -221,12 +238,11 @@ function $e33225559d5e019f$var$DefaultSelectionTracker(props) {
|
|
|
221
238
|
});
|
|
222
239
|
}
|
|
223
240
|
function $e33225559d5e019f$var$SegmentedControlItem(props, ref) {
|
|
224
|
-
let
|
|
225
|
-
let domRef = (0, $4JHQR$reactspectrumutils.useFocusableRef)(ref, inputRef);
|
|
241
|
+
let domRef = (0, $4JHQR$reactspectrumutils.useFocusableRef)(ref);
|
|
226
242
|
let divRef = (0, $4JHQR$react.useRef)(null);
|
|
227
|
-
let { register: register, prevRef: prevRef, currentSelectedRef: currentSelectedRef } = (0, $4JHQR$react.useContext)($e33225559d5e019f$var$InternalSegmentedControlContext);
|
|
228
|
-
let state = (0, $4JHQR$react.useContext)((0, $4JHQR$reactariacomponents.
|
|
229
|
-
let isSelected = props.id
|
|
243
|
+
let { register: register, prevRef: prevRef, currentSelectedRef: currentSelectedRef, isJustified: isJustified } = (0, $4JHQR$react.useContext)($e33225559d5e019f$var$InternalSegmentedControlContext);
|
|
244
|
+
let state = (0, $4JHQR$react.useContext)((0, $4JHQR$reactariacomponents.ToggleGroupStateContext));
|
|
245
|
+
let isSelected = state?.selectedKeys.has(props.id);
|
|
230
246
|
// do not apply animation if a user has the prefers-reduced-motion setting
|
|
231
247
|
let isReduced = false;
|
|
232
248
|
if (window?.matchMedia) isReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
@@ -255,20 +271,18 @@ function $e33225559d5e019f$var$SegmentedControlItem(props, ref) {
|
|
|
255
271
|
}, [
|
|
256
272
|
isSelected
|
|
257
273
|
]);
|
|
258
|
-
return /*#__PURE__*/ (0, $4JHQR$reactjsxruntime.jsx)((0, $4JHQR$reactariacomponents.
|
|
274
|
+
return /*#__PURE__*/ (0, $4JHQR$reactjsxruntime.jsx)((0, $4JHQR$reactariacomponents.ToggleButton), {
|
|
259
275
|
...props,
|
|
260
|
-
value: props.id,
|
|
261
276
|
ref: domRef,
|
|
262
|
-
inputRef: inputRef,
|
|
263
277
|
style: props.UNSAFE_style,
|
|
264
278
|
className: (renderProps)=>(props.UNSAFE_className || '') + $e33225559d5e019f$var$controlItem({
|
|
265
|
-
...renderProps
|
|
279
|
+
...renderProps,
|
|
280
|
+
isJustified: isJustified
|
|
266
281
|
}, props.styles),
|
|
267
|
-
children: ({ isSelected: isSelected,
|
|
282
|
+
children: ({ isSelected: isSelected, isPressed: isPressed, isDisabled: isDisabled })=>/*#__PURE__*/ (0, $4JHQR$reactjsxruntime.jsxs)((0, $4JHQR$reactjsxruntime.Fragment), {
|
|
268
283
|
children: [
|
|
269
284
|
isSelected && /*#__PURE__*/ (0, $4JHQR$reactjsxruntime.jsx)("div", {
|
|
270
285
|
className: $e33225559d5e019f$var$slider({
|
|
271
|
-
isFocusVisible: isFocusVisible,
|
|
272
286
|
isDisabled: isDisabled
|
|
273
287
|
}),
|
|
274
288
|
ref: currentSelectedRef
|