@react-spectrum/color 3.0.1 → 3.0.3
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/ColorArea.main.js +2 -5
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +2 -5
- package/dist/ColorArea.module.js +2 -5
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorEditor.f85fa1f2.css +20 -0
- package/dist/ColorEditor.f85fa1f2.css.map +1 -0
- package/dist/ColorEditor.main.js +13 -16
- package/dist/ColorEditor.main.js.map +1 -1
- package/dist/ColorEditor.mjs +13 -16
- package/dist/ColorEditor.module.js +13 -16
- package/dist/ColorEditor.module.js.map +1 -1
- package/dist/ColorField.main.js +2 -5
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +2 -5
- package/dist/ColorField.module.js +2 -5
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorPicker.96797a19.css +206 -0
- package/dist/ColorPicker.96797a19.css.map +1 -0
- package/dist/ColorPicker.main.js +37 -40
- package/dist/ColorPicker.main.js.map +1 -1
- package/dist/ColorPicker.mjs +37 -40
- package/dist/ColorPicker.module.js +37 -40
- package/dist/ColorPicker.module.js.map +1 -1
- package/dist/ColorSlider.main.js +3 -6
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +3 -6
- package/dist/ColorSlider.module.js +3 -6
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.fabed858.css +260 -0
- package/dist/ColorSwatch.fabed858.css.map +1 -0
- package/dist/ColorSwatch.main.js +31 -34
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +32 -35
- package/dist/ColorSwatch.module.js +32 -35
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.25f8fb63.css +356 -0
- package/dist/ColorSwatchPicker.25f8fb63.css.map +1 -0
- package/dist/ColorSwatchPicker.main.js +42 -45
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +42 -45
- package/dist/ColorSwatchPicker.module.js +42 -45
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorWheel.main.js +2 -6
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +2 -6
- package/dist/ColorWheel.module.js +2 -6
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/colorhandle_vars_css.main.js.map +1 -1
- package/dist/colorhandle_vars_css.module.js.map +1 -1
- package/dist/colorslider_vars_css.main.js.map +1 -1
- package/dist/colorslider_vars_css.module.js.map +1 -1
- package/dist/colorwheel_vars_css.main.js.map +1 -1
- package/dist/colorwheel_vars_css.module.js.map +1 -1
- package/dist/types.d.ts +7 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/{vars.d78ec0e6.css → vars.a54898d8.css} +2 -2
- package/dist/{vars.d78ec0e6.css.map → vars.a54898d8.css.map} +1 -1
- package/package.json +23 -23
- package/src/ColorArea.tsx +5 -8
- package/src/ColorEditor.tsx +5 -8
- package/src/ColorField.tsx +5 -8
- package/src/ColorPicker.tsx +5 -8
- package/src/ColorSlider.tsx +5 -8
- package/src/ColorSwatch.tsx +5 -8
- package/src/ColorSwatchPicker.tsx +5 -8
- package/src/ColorWheel.tsx +5 -9
- package/dist/ColorEditor.32e497e8.css +0 -20
- package/dist/ColorEditor.32e497e8.css.map +0 -1
- package/dist/ColorPicker.ab9f47c0.css +0 -204
- package/dist/ColorPicker.ab9f47c0.css.map +0 -1
- package/dist/ColorSwatch.f6e6f811.css +0 -260
- package/dist/ColorSwatch.f6e6f811.css.map +0 -1
- package/dist/ColorSwatchPicker.1575be06.css +0 -356
- package/dist/ColorSwatchPicker.1575be06.css.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;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AG,GAAG,UAAU;QAAE,KAAK;QAAU,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAK9F","sources":["packages/@react-spectrum/color/src/ColorSlider.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 {classNames, SlotProvider, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {ColorSliderContext, useContextProps} from 'react-aria-components';\nimport {ColorThumb} from './ColorThumb';\nimport {FocusableRef} from '@react-types/shared';\nimport {Label} from '@react-spectrum/label';\nimport React, {useRef, useState} from 'react';\nimport {SpectrumColorSliderProps} from '@react-types/color';\nimport styles from '@adobe/spectrum-css-temp/components/colorslider/vars.css';\nimport {useColorSlider} from '@react-aria/color';\nimport {useColorSliderState} from '@react-stately/color';\nimport {useFocus, useFocusVisible} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * ColorSliders allow users to adjust an individual channel of a color value.\n */\nexport const ColorSlider = React.forwardRef(function ColorSlider(props: SpectrumColorSliderProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let inputRef = useRef(null);\n let trackRef = useRef(null);\n let domRef = useFocusableRef(ref, inputRef);\n [props, domRef] = useContextProps(props, domRef, ColorSliderContext);\n\n let {\n isDisabled,\n channel,\n orientation,\n label,\n showValueLabel,\n 'aria-label': ariaLabel\n } = props;\n let vertical = orientation === 'vertical';\n\n let {styleProps} = useStyleProps(props);\n let {locale} = useLocale();\n\n let state = useColorSliderState({...props, locale});\n\n // If vertical and a label is provided, use it as an aria-label instead.\n if (vertical && label) {\n ariaLabel = ariaLabel || (typeof label === 'string' ? label : undefined);\n label = null;\n }\n\n // If no external label, aria-label or aria-labelledby is provided,\n // default to displaying the localized channel value.\n // Specifically check if label is undefined. If label is `null` then display no visible label.\n // A default aria-label is provided by useColorSlider in that case.\n if (label === undefined && !ariaLabel && !props['aria-labelledby'] && !vertical) {\n label = state.value.getChannelName(channel, locale);\n }\n\n // Show the value label by default if there is a visible label\n if (showValueLabel == null) {\n showValueLabel = !!label;\n }\n\n let {inputProps, thumbProps, trackProps, labelProps, outputProps} = useColorSlider({\n ...props,\n label,\n 'aria-label': ariaLabel,\n trackRef,\n inputRef\n }, state);\n\n let {isFocusVisible} = useFocusVisible();\n let [isFocused, setIsFocused] = useState(false);\n let {focusProps} = useFocus({\n isDisabled,\n onFocusChange: setIsFocused\n });\n\n return (\n <div\n ref={domRef}\n {...styleProps}\n className={classNames(\n styles,\n {\n 'spectrum-ColorSlider-container--horizontal': !vertical,\n 'spectrum-ColorSlider-container--vertical': vertical\n }\n )}>\n {label &&\n <div className={classNames(styles, 'spectrum-ColorSlider-labelContainer')}>\n <Label {...labelProps}>{label}</Label>\n {props.contextualHelp &&\n <SlotProvider\n slots={{\n actionButton: {\n UNSAFE_className: classNames(styles, 'spectrum-ColorSlider-contextualHelp')\n }\n }}>\n {props.contextualHelp}\n </SlotProvider>\n }\n {showValueLabel && (\n <Label elementType=\"span\" UNSAFE_className={classNames(styles, 'spectrum-ColorSlider-valueLabel')}>\n <output {...outputProps}>{state.value.formatChannelValue(channel, locale)}</output>\n </Label>\n )}\n </div>\n }\n <div\n {...trackProps}\n ref={trackRef}\n className={classNames(\n styles,\n 'spectrum-ColorSlider', {\n 'is-disabled': isDisabled,\n 'spectrum-ColorSlider--vertical': vertical\n }\n )\n }>\n <ColorThumb\n value={state.getDisplayColor()}\n isFocused={isFocused && isFocusVisible}\n isDisabled={isDisabled}\n isDragging={state.isThumbDragging(0)}\n containerRef={trackRef}\n className={classNames(styles, 'spectrum-ColorSlider-handle')}\n {...thumbProps}>\n <input {...inputProps} {...focusProps} ref={inputRef} className={classNames(styles, 'spectrum-ColorSlider-slider')} />\n </ColorThumb>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ColorSlider.main.js.map"}
|
package/dist/ColorSlider.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import {ColorThumb as $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc} from "./ColorThumb.mjs";
|
2
|
-
import "./vars.
|
2
|
+
import "./vars.a54898d8.css";
|
3
3
|
import $fxUYb$colorslider_vars_cssmodulejs from "./colorslider_vars_css.mjs";
|
4
4
|
import {useFocusableRef as $fxUYb$useFocusableRef, useStyleProps as $fxUYb$useStyleProps, classNames as $fxUYb$classNames, SlotProvider as $fxUYb$SlotProvider} from "@react-spectrum/utils";
|
5
5
|
import {useContextProps as $fxUYb$useContextProps, ColorSliderContext as $fxUYb$ColorSliderContext} from "react-aria-components";
|
@@ -36,7 +36,7 @@ function $parcel$interopDefault(a) {
|
|
36
36
|
|
37
37
|
|
38
38
|
|
39
|
-
|
39
|
+
const $3870e4ce67ed7ee1$export$44fd664bcca5b6fb = /*#__PURE__*/ (0, $fxUYb$react).forwardRef(function ColorSlider(props, ref) {
|
40
40
|
props = (0, $fxUYb$useProviderProps)(props);
|
41
41
|
let inputRef = (0, $fxUYb$useRef)(null);
|
42
42
|
let trackRef = (0, $fxUYb$useRef)(null);
|
@@ -114,10 +114,7 @@ function $3870e4ce67ed7ee1$var$ColorSlider(props, ref) {
|
|
114
114
|
ref: inputRef,
|
115
115
|
className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), 'spectrum-ColorSlider-slider')
|
116
116
|
}))));
|
117
|
-
}
|
118
|
-
/**
|
119
|
-
* ColorSliders allow users to adjust an individual channel of a color value.
|
120
|
-
*/ let $3870e4ce67ed7ee1$export$44fd664bcca5b6fb = /*#__PURE__*/ (0, $fxUYb$react).forwardRef($3870e4ce67ed7ee1$var$ColorSlider);
|
117
|
+
});
|
121
118
|
|
122
119
|
|
123
120
|
export {$3870e4ce67ed7ee1$export$44fd664bcca5b6fb as ColorSlider};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import {ColorThumb as $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc} from "./ColorThumb.module.js";
|
2
|
-
import "./vars.
|
2
|
+
import "./vars.a54898d8.css";
|
3
3
|
import $fxUYb$colorslider_vars_cssmodulejs from "./colorslider_vars_css.module.js";
|
4
4
|
import {useFocusableRef as $fxUYb$useFocusableRef, useStyleProps as $fxUYb$useStyleProps, classNames as $fxUYb$classNames, SlotProvider as $fxUYb$SlotProvider} from "@react-spectrum/utils";
|
5
5
|
import {useContextProps as $fxUYb$useContextProps, ColorSliderContext as $fxUYb$ColorSliderContext} from "react-aria-components";
|
@@ -36,7 +36,7 @@ function $parcel$interopDefault(a) {
|
|
36
36
|
|
37
37
|
|
38
38
|
|
39
|
-
|
39
|
+
const $3870e4ce67ed7ee1$export$44fd664bcca5b6fb = /*#__PURE__*/ (0, $fxUYb$react).forwardRef(function ColorSlider(props, ref) {
|
40
40
|
props = (0, $fxUYb$useProviderProps)(props);
|
41
41
|
let inputRef = (0, $fxUYb$useRef)(null);
|
42
42
|
let trackRef = (0, $fxUYb$useRef)(null);
|
@@ -114,10 +114,7 @@ function $3870e4ce67ed7ee1$var$ColorSlider(props, ref) {
|
|
114
114
|
ref: inputRef,
|
115
115
|
className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), 'spectrum-ColorSlider-slider')
|
116
116
|
}))));
|
117
|
-
}
|
118
|
-
/**
|
119
|
-
* ColorSliders allow users to adjust an individual channel of a color value.
|
120
|
-
*/ let $3870e4ce67ed7ee1$export$44fd664bcca5b6fb = /*#__PURE__*/ (0, $fxUYb$react).forwardRef($3870e4ce67ed7ee1$var$ColorSlider);
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O,MAAM,eAAe;QAC5B,WAAW,aAAa;QACxB,YAAY;QACZ,YAAY,MAAM,eAAe,CAAC;QAClC,cAAc;QACd,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6DAAK,GAAG;QAC7B,GAAG,UAAU;qBACd,gCAAC;QAAO,GAAG,UAAU;QAAG,GAAG,UAAU;QAAE,KAAK;QAAU,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6DAAK,GAAG;;AAK9F","sources":["packages/@react-spectrum/color/src/ColorSlider.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 {classNames, SlotProvider, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {ColorSliderContext, useContextProps} from 'react-aria-components';\nimport {ColorThumb} from './ColorThumb';\nimport {FocusableRef} from '@react-types/shared';\nimport {Label} from '@react-spectrum/label';\nimport React, {useRef, useState} from 'react';\nimport {SpectrumColorSliderProps} from '@react-types/color';\nimport styles from '@adobe/spectrum-css-temp/components/colorslider/vars.css';\nimport {useColorSlider} from '@react-aria/color';\nimport {useColorSliderState} from '@react-stately/color';\nimport {useFocus, useFocusVisible} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * ColorSliders allow users to adjust an individual channel of a color value.\n */\nexport const ColorSlider = React.forwardRef(function ColorSlider(props: SpectrumColorSliderProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let inputRef = useRef(null);\n let trackRef = useRef(null);\n let domRef = useFocusableRef(ref, inputRef);\n [props, domRef] = useContextProps(props, domRef, ColorSliderContext);\n\n let {\n isDisabled,\n channel,\n orientation,\n label,\n showValueLabel,\n 'aria-label': ariaLabel\n } = props;\n let vertical = orientation === 'vertical';\n\n let {styleProps} = useStyleProps(props);\n let {locale} = useLocale();\n\n let state = useColorSliderState({...props, locale});\n\n // If vertical and a label is provided, use it as an aria-label instead.\n if (vertical && label) {\n ariaLabel = ariaLabel || (typeof label === 'string' ? label : undefined);\n label = null;\n }\n\n // If no external label, aria-label or aria-labelledby is provided,\n // default to displaying the localized channel value.\n // Specifically check if label is undefined. If label is `null` then display no visible label.\n // A default aria-label is provided by useColorSlider in that case.\n if (label === undefined && !ariaLabel && !props['aria-labelledby'] && !vertical) {\n label = state.value.getChannelName(channel, locale);\n }\n\n // Show the value label by default if there is a visible label\n if (showValueLabel == null) {\n showValueLabel = !!label;\n }\n\n let {inputProps, thumbProps, trackProps, labelProps, outputProps} = useColorSlider({\n ...props,\n label,\n 'aria-label': ariaLabel,\n trackRef,\n inputRef\n }, state);\n\n let {isFocusVisible} = useFocusVisible();\n let [isFocused, setIsFocused] = useState(false);\n let {focusProps} = useFocus({\n isDisabled,\n onFocusChange: setIsFocused\n });\n\n return (\n <div\n ref={domRef}\n {...styleProps}\n className={classNames(\n styles,\n {\n 'spectrum-ColorSlider-container--horizontal': !vertical,\n 'spectrum-ColorSlider-container--vertical': vertical\n }\n )}>\n {label &&\n <div className={classNames(styles, 'spectrum-ColorSlider-labelContainer')}>\n <Label {...labelProps}>{label}</Label>\n {props.contextualHelp &&\n <SlotProvider\n slots={{\n actionButton: {\n UNSAFE_className: classNames(styles, 'spectrum-ColorSlider-contextualHelp')\n }\n }}>\n {props.contextualHelp}\n </SlotProvider>\n }\n {showValueLabel && (\n <Label elementType=\"span\" UNSAFE_className={classNames(styles, 'spectrum-ColorSlider-valueLabel')}>\n <output {...outputProps}>{state.value.formatChannelValue(channel, locale)}</output>\n </Label>\n )}\n </div>\n }\n <div\n {...trackProps}\n ref={trackRef}\n className={classNames(\n styles,\n 'spectrum-ColorSlider', {\n 'is-disabled': isDisabled,\n 'spectrum-ColorSlider--vertical': vertical\n }\n )\n }>\n <ColorThumb\n value={state.getDisplayColor()}\n isFocused={isFocused && isFocusVisible}\n isDisabled={isDisabled}\n isDragging={state.isThumbDragging(0)}\n containerRef={trackRef}\n className={classNames(styles, 'spectrum-ColorSlider-handle')}\n {...thumbProps}>\n <input {...inputProps} {...focusProps} ref={inputRef} className={classNames(styles, 'spectrum-ColorSlider-slider')} />\n </ColorThumb>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ColorSlider.module.js.map"}
|
@@ -0,0 +1,260 @@
|
|
1
|
+
@layer s1-a, s1-b;
|
2
|
+
|
3
|
+
@layer a {
|
4
|
+
.s1-os1-e {
|
5
|
+
width: calc(1rem * var(--spectrum-global-dimension-scale-factor));
|
6
|
+
}
|
7
|
+
|
8
|
+
.s1-os1-g {
|
9
|
+
width: calc(1.5rem * var(--spectrum-global-dimension-scale-factor));
|
10
|
+
}
|
11
|
+
|
12
|
+
.s1-os1-i {
|
13
|
+
width: calc(2rem * var(--spectrum-global-dimension-scale-factor));
|
14
|
+
}
|
15
|
+
|
16
|
+
.s1-os1-k {
|
17
|
+
width: calc(2.5rem * var(--spectrum-global-dimension-scale-factor));
|
18
|
+
}
|
19
|
+
|
20
|
+
.s1-ns1-e {
|
21
|
+
height: calc(1rem * var(--spectrum-global-dimension-scale-factor));
|
22
|
+
}
|
23
|
+
|
24
|
+
.s1-ns1-g {
|
25
|
+
height: calc(1.5rem * var(--spectrum-global-dimension-scale-factor));
|
26
|
+
}
|
27
|
+
|
28
|
+
.s1-ns1-i {
|
29
|
+
height: calc(2rem * var(--spectrum-global-dimension-scale-factor));
|
30
|
+
}
|
31
|
+
|
32
|
+
.s1-ns1-k {
|
33
|
+
height: calc(2.5rem * var(--spectrum-global-dimension-scale-factor));
|
34
|
+
}
|
35
|
+
|
36
|
+
.s1-_ps1-c:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
37
|
+
border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
38
|
+
}
|
39
|
+
|
40
|
+
.s1-_ps1-c:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
41
|
+
border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
42
|
+
}
|
43
|
+
|
44
|
+
.s1-_ps1-c:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
45
|
+
border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
46
|
+
}
|
47
|
+
|
48
|
+
.s1-_ps1-c:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
49
|
+
border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
50
|
+
}
|
51
|
+
|
52
|
+
.s1-_ps1-a:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
53
|
+
border-top-left-radius: 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
.s1-_ps1-a:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
57
|
+
border-top-left-radius: 0;
|
58
|
+
}
|
59
|
+
|
60
|
+
.s1-_ps1-a:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
61
|
+
border-top-right-radius: 0;
|
62
|
+
}
|
63
|
+
|
64
|
+
.s1-_ps1-a:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
65
|
+
border-top-right-radius: 0;
|
66
|
+
}
|
67
|
+
|
68
|
+
.s1-_ps1-f:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
69
|
+
border-top-left-radius: 9999px;
|
70
|
+
}
|
71
|
+
|
72
|
+
.s1-_ps1-f:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
73
|
+
border-top-left-radius: 9999px;
|
74
|
+
}
|
75
|
+
|
76
|
+
.s1-_ps1-f:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
77
|
+
border-top-right-radius: 9999px;
|
78
|
+
}
|
79
|
+
|
80
|
+
.s1-_ps1-f:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
81
|
+
border-top-right-radius: 9999px;
|
82
|
+
}
|
83
|
+
|
84
|
+
.s1-_qs1-c:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
85
|
+
border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
86
|
+
}
|
87
|
+
|
88
|
+
.s1-_qs1-c:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
89
|
+
border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
90
|
+
}
|
91
|
+
|
92
|
+
.s1-_qs1-c:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
93
|
+
border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
94
|
+
}
|
95
|
+
|
96
|
+
.s1-_qs1-c:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
97
|
+
border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
98
|
+
}
|
99
|
+
|
100
|
+
.s1-_qs1-a:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
101
|
+
border-top-right-radius: 0;
|
102
|
+
}
|
103
|
+
|
104
|
+
.s1-_qs1-a:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
105
|
+
border-top-right-radius: 0;
|
106
|
+
}
|
107
|
+
|
108
|
+
.s1-_qs1-a:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
109
|
+
border-top-left-radius: 0;
|
110
|
+
}
|
111
|
+
|
112
|
+
.s1-_qs1-a:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
113
|
+
border-top-left-radius: 0;
|
114
|
+
}
|
115
|
+
|
116
|
+
.s1-_qs1-f:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
117
|
+
border-top-right-radius: 9999px;
|
118
|
+
}
|
119
|
+
|
120
|
+
.s1-_qs1-f:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
121
|
+
border-top-right-radius: 9999px;
|
122
|
+
}
|
123
|
+
|
124
|
+
.s1-_qs1-f:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
125
|
+
border-top-left-radius: 9999px;
|
126
|
+
}
|
127
|
+
|
128
|
+
.s1-_qs1-f:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
129
|
+
border-top-left-radius: 9999px;
|
130
|
+
}
|
131
|
+
|
132
|
+
.s1-_rs1-c:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
133
|
+
border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
134
|
+
}
|
135
|
+
|
136
|
+
.s1-_rs1-c:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
137
|
+
border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
138
|
+
}
|
139
|
+
|
140
|
+
.s1-_rs1-c:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
141
|
+
border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
142
|
+
}
|
143
|
+
|
144
|
+
.s1-_rs1-c:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
145
|
+
border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
146
|
+
}
|
147
|
+
|
148
|
+
.s1-_rs1-a:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
149
|
+
border-bottom-left-radius: 0;
|
150
|
+
}
|
151
|
+
|
152
|
+
.s1-_rs1-a:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
153
|
+
border-bottom-left-radius: 0;
|
154
|
+
}
|
155
|
+
|
156
|
+
.s1-_rs1-a:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
157
|
+
border-bottom-right-radius: 0;
|
158
|
+
}
|
159
|
+
|
160
|
+
.s1-_rs1-a:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
161
|
+
border-bottom-right-radius: 0;
|
162
|
+
}
|
163
|
+
|
164
|
+
.s1-_rs1-f:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
165
|
+
border-bottom-left-radius: 9999px;
|
166
|
+
}
|
167
|
+
|
168
|
+
.s1-_rs1-f:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
169
|
+
border-bottom-left-radius: 9999px;
|
170
|
+
}
|
171
|
+
|
172
|
+
.s1-_rs1-f:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
173
|
+
border-bottom-right-radius: 9999px;
|
174
|
+
}
|
175
|
+
|
176
|
+
.s1-_rs1-f:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
177
|
+
border-bottom-right-radius: 9999px;
|
178
|
+
}
|
179
|
+
|
180
|
+
.s1-_ss1-c:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
181
|
+
border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
182
|
+
}
|
183
|
+
|
184
|
+
.s1-_ss1-c:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
185
|
+
border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
186
|
+
}
|
187
|
+
|
188
|
+
.s1-_ss1-c:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
189
|
+
border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
190
|
+
}
|
191
|
+
|
192
|
+
.s1-_ss1-c:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
193
|
+
border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
|
194
|
+
}
|
195
|
+
|
196
|
+
.s1-_ss1-a:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
197
|
+
border-bottom-right-radius: 0;
|
198
|
+
}
|
199
|
+
|
200
|
+
.s1-_ss1-a:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
201
|
+
border-bottom-right-radius: 0;
|
202
|
+
}
|
203
|
+
|
204
|
+
.s1-_ss1-a:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
205
|
+
border-bottom-left-radius: 0;
|
206
|
+
}
|
207
|
+
|
208
|
+
.s1-_ss1-a:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
209
|
+
border-bottom-left-radius: 0;
|
210
|
+
}
|
211
|
+
|
212
|
+
.s1-_ss1-f:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
213
|
+
border-bottom-right-radius: 9999px;
|
214
|
+
}
|
215
|
+
|
216
|
+
.s1-_ss1-f:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
|
217
|
+
border-bottom-right-radius: 9999px;
|
218
|
+
}
|
219
|
+
|
220
|
+
.s1-_ss1-f:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
221
|
+
border-bottom-left-radius: 9999px;
|
222
|
+
}
|
223
|
+
|
224
|
+
.s1-_ss1-f:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
|
225
|
+
border-bottom-left-radius: 9999px;
|
226
|
+
}
|
227
|
+
|
228
|
+
.s1-c-1n5whoe {
|
229
|
+
border-color: color-mix(in srgb, var(--spectrum-gray-900), transparent 49%);
|
230
|
+
}
|
231
|
+
|
232
|
+
.s1-ws1-b {
|
233
|
+
border-top-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));
|
234
|
+
}
|
235
|
+
|
236
|
+
.s1-xs1-b {
|
237
|
+
border-bottom-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));
|
238
|
+
}
|
239
|
+
|
240
|
+
.s1-us1-b {
|
241
|
+
border-inline-start-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));
|
242
|
+
}
|
243
|
+
|
244
|
+
.s1-vs1-b {
|
245
|
+
border-inline-end-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));
|
246
|
+
}
|
247
|
+
|
248
|
+
.s1-As1-a {
|
249
|
+
border-style: solid;
|
250
|
+
}
|
251
|
+
|
252
|
+
.s1-__ks1-a {
|
253
|
+
box-sizing: border-box;
|
254
|
+
}
|
255
|
+
|
256
|
+
.s1-_ts1-b {
|
257
|
+
forced-color-adjust: none;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
/*# sourceMappingURL=ColorSwatch.fabed858.css.map */
|
@@ -0,0 +1 @@
|
|
1
|
+
{"mappings":"AAAA;;AAEA;EACE;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA","sources":["packages/@react-spectrum/color/src/ColorSwatch.tsx"],"sourcesContent":["@layer s1-a, s1-b;\n\n@layer a {\n .s1-os1-e {\n width: calc(1rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .s1-os1-g {\n width: calc(1.5rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .s1-os1-i {\n width: calc(2rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .s1-os1-k {\n width: calc(2.5rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .s1-ns1-e {\n height: calc(1rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .s1-ns1-g {\n height: calc(1.5rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .s1-ns1-i {\n height: calc(2rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .s1-ns1-k {\n height: calc(2.5rem * var(--spectrum-global-dimension-scale-factor));\n }\n}\n\n@layer a {\n .s1-_ps1-c {\n border-start-start-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));\n }\n}\n\n@layer a {\n .s1-_ps1-a {\n border-start-start-radius: 0px;\n }\n}\n\n@layer a {\n .s1-_ps1-f {\n border-start-start-radius: 9999px;\n }\n}\n\n@layer a {\n .s1-_qs1-c {\n border-start-end-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));\n }\n}\n\n@layer a {\n .s1-_qs1-a {\n border-start-end-radius: 0px;\n }\n}\n\n@layer a {\n .s1-_qs1-f {\n border-start-end-radius: 9999px;\n }\n}\n\n@layer a {\n .s1-_rs1-c {\n border-end-start-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));\n }\n}\n\n@layer a {\n .s1-_rs1-a {\n border-end-start-radius: 0px;\n }\n}\n\n@layer a {\n .s1-_rs1-f {\n border-end-start-radius: 9999px;\n }\n}\n\n@layer a {\n .s1-_ss1-c {\n border-end-end-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));\n }\n}\n\n@layer a {\n .s1-_ss1-a {\n border-end-end-radius: 0px;\n }\n}\n\n@layer a {\n .s1-_ss1-f {\n border-end-end-radius: 9999px;\n }\n}\n\n@layer a {\n .s1-c-1n5whoe {\n border-color: color-mix(in srgb, var(--spectrum-gray-900), transparent 49%);\n }\n}\n\n@layer a {\n .s1-ws1-b {\n border-top-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));\n }\n}\n\n@layer a {\n .s1-xs1-b {\n border-bottom-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));\n }\n}\n\n@layer a {\n .s1-us1-b {\n border-inline-start-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));\n }\n}\n\n@layer a {\n .s1-vs1-b {\n border-inline-end-width: var(--spectrum-alias-border-size-thin, var(--spectrum-global-dimension-static-size-10));\n }\n}\n\n@layer a {\n .s1-As1-a {\n border-style: solid;\n }\n}\n\n@layer a {\n .s1-__ks1-a {\n box-sizing: border-box;\n }\n}\n\n@layer a {\n .s1-_ts1-b {\n forced-color-adjust: none;\n }\n}\n\n"],"names":[],"version":3,"file":"ColorSwatch.fabed858.css.map"}
|
package/dist/ColorSwatch.main.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require("./ColorSwatch.
|
1
|
+
require("./ColorSwatch.fabed858.css");
|
2
2
|
var $ikjCA$reactariacolor = require("@react-aria/color");
|
3
3
|
var $ikjCA$reactariacomponents = require("react-aria-components");
|
4
4
|
var $ikjCA$react = require("react");
|
@@ -30,7 +30,7 @@ $parcel$export(module.exports, "ColorSwatch", () => $f076f5c85640192a$export$cae
|
|
30
30
|
|
31
31
|
|
32
32
|
const $f076f5c85640192a$export$8529d7908a78c058 = /*#__PURE__*/ (0, $ikjCA$react.createContext)(null);
|
33
|
-
|
33
|
+
const $f076f5c85640192a$export$cae13e90592f246a = /*#__PURE__*/ (0, $ikjCA$react.forwardRef)(function ColorSwatch(props, ref) {
|
34
34
|
let domRef = (0, $ikjCA$reactspectrumutils.useDOMRef)(ref);
|
35
35
|
[props, domRef] = (0, $ikjCA$reactariacomponents.useContextProps)(props, domRef, (0, $ikjCA$reactariacomponents.ColorSwatchContext));
|
36
36
|
let { colorSwatchProps: colorSwatchProps, color: color } = (0, $ikjCA$reactariacolor.useColorSwatch)(props);
|
@@ -48,34 +48,34 @@ function $f076f5c85640192a$var$ColorSwatch(props, ref) {
|
|
48
48
|
},
|
49
49
|
className: styleProps.className + function anonymous(props) {
|
50
50
|
let rules = "";
|
51
|
-
if (props.size === "L") rules += '
|
52
|
-
else if (props.size === "M") rules += '
|
53
|
-
else if (props.size === "S") rules += '
|
54
|
-
else if (props.size === "XS") rules += '
|
55
|
-
if (props.size === "L") rules += '
|
56
|
-
else if (props.size === "M") rules += '
|
57
|
-
else if (props.size === "S") rules += '
|
58
|
-
else if (props.size === "XS") rules += '
|
59
|
-
if (props.rounding === "full") rules += '
|
60
|
-
else if (props.rounding === "none") rules += '
|
61
|
-
else if (props.rounding === "default") rules += '
|
62
|
-
if (props.rounding === "full") rules += '
|
63
|
-
else if (props.rounding === "none") rules += '
|
64
|
-
else if (props.rounding === "default") rules += '
|
65
|
-
if (props.rounding === "full") rules += '
|
66
|
-
else if (props.rounding === "none") rules += '
|
67
|
-
else if (props.rounding === "default") rules += '
|
68
|
-
if (props.rounding === "full") rules += '
|
69
|
-
else if (props.rounding === "none") rules += '
|
70
|
-
else if (props.rounding === "default") rules += '
|
71
|
-
rules += ' c-1n5whoe';
|
72
|
-
rules += '
|
73
|
-
rules += '
|
74
|
-
rules += '
|
75
|
-
rules += '
|
76
|
-
rules += '
|
77
|
-
rules += '
|
78
|
-
rules += '
|
51
|
+
if (props.size === "L") rules += ' s1-os1-k';
|
52
|
+
else if (props.size === "M") rules += ' s1-os1-i';
|
53
|
+
else if (props.size === "S") rules += ' s1-os1-g';
|
54
|
+
else if (props.size === "XS") rules += ' s1-os1-e';
|
55
|
+
if (props.size === "L") rules += ' s1-ns1-k';
|
56
|
+
else if (props.size === "M") rules += ' s1-ns1-i';
|
57
|
+
else if (props.size === "S") rules += ' s1-ns1-g';
|
58
|
+
else if (props.size === "XS") rules += ' s1-ns1-e';
|
59
|
+
if (props.rounding === "full") rules += ' s1-_ps1-f';
|
60
|
+
else if (props.rounding === "none") rules += ' s1-_ps1-a';
|
61
|
+
else if (props.rounding === "default") rules += ' s1-_ps1-c';
|
62
|
+
if (props.rounding === "full") rules += ' s1-_qs1-f';
|
63
|
+
else if (props.rounding === "none") rules += ' s1-_qs1-a';
|
64
|
+
else if (props.rounding === "default") rules += ' s1-_qs1-c';
|
65
|
+
if (props.rounding === "full") rules += ' s1-_rs1-f';
|
66
|
+
else if (props.rounding === "none") rules += ' s1-_rs1-a';
|
67
|
+
else if (props.rounding === "default") rules += ' s1-_rs1-c';
|
68
|
+
if (props.rounding === "full") rules += ' s1-_ss1-f';
|
69
|
+
else if (props.rounding === "none") rules += ' s1-_ss1-a';
|
70
|
+
else if (props.rounding === "default") rules += ' s1-_ss1-c';
|
71
|
+
rules += ' s1-c-1n5whoe';
|
72
|
+
rules += ' s1-ws1-b';
|
73
|
+
rules += ' s1-xs1-b';
|
74
|
+
rules += ' s1-us1-b';
|
75
|
+
rules += ' s1-vs1-b';
|
76
|
+
rules += ' s1-As1-a';
|
77
|
+
rules += ' s1-__ks1-a';
|
78
|
+
rules += ' s1-_ts1-b';
|
79
79
|
return rules;
|
80
80
|
}({
|
81
81
|
size: size,
|
@@ -85,10 +85,7 @@ function $f076f5c85640192a$var$ColorSwatch(props, ref) {
|
|
85
85
|
// ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.
|
86
86
|
if (ctx) return ctx.useWrapper(swatch, color, rounding);
|
87
87
|
return swatch;
|
88
|
-
}
|
89
|
-
/**
|
90
|
-
* A ColorSwatch displays a preview of a selected color.
|
91
|
-
*/ let $f076f5c85640192a$export$cae13e90592f246a = /*#__PURE__*/ (0, $ikjCA$react.forwardRef)($f076f5c85640192a$var$ColorSwatch);
|
88
|
+
});
|
92
89
|
|
93
90
|
|
94
91
|
//# sourceMappingURL=ColorSwatch.main.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA2BM,MAAM,0DAA6B,CAAA,GAAA,0BAAY,EAA0C;
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA2BM,MAAM,0DAA6B,CAAA,GAAA,0BAAY,EAA0C;AAKzF,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAAY,KAA+B,EAAE,GAA2B;IACrH,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,0CAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,6CAAiB;IAClE,IAAI,oBAAC,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,oCAAa,EAAE;IAC/C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,QACF,OAAO,CAAA,gBAAA,0BAAA,IAAK,IAAI,KAAI,eACpB,WAAW,CAAA,gBAAA,0BAAA,IAAK,QAAQ,KAAI,WAC7B,GAAG;IAEJ,IAAI,uBACF,0DAAC;QACE,GAAG,gBAAgB;QACnB,GAAG,UAAU;QACd,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,oFAAoF;YACpF,YAAY,MAAM,eAAe,CAAC,WAAW,IACzC,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,MAAM,4EAA4E,CAAC,GAEhH;QACN;QACA,WAAW,WAAW,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuB/B;kBAAC;sBAAM;QAAQ;;IAGtB,+DAA+D;IAC/D,IAAI,KACF,OAAO,IAAI,UAAU,CAAC,QAAQ,OAAO;IAGvC,OAAO;AACT","sources":["packages/@react-spectrum/color/src/ColorSwatch.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 {AriaColorSwatchProps, useColorSwatch} from '@react-aria/color';\nimport {Color} from '@react-types/color';\nimport {ColorSwatchContext, useContextProps} from 'react-aria-components';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport React, {createContext, forwardRef, JSX, ReactElement, useContext} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useDOMRef, useStyleProps} from '@react-spectrum/utils';\n\nexport interface SpectrumColorSwatchProps extends AriaColorSwatchProps, StyleProps {\n /**\n * The size of the ColorSwatch.\n * @default \"M\"\n */\n size?: 'XS' | 'S' | 'M' | 'L',\n /**\n * The corner rounding of the ColorSwatch.\n * @default \"default\"\n */\n rounding?: 'default' | 'none' | 'full'\n}\n\ninterface SpectrumColorSwatchContextValue extends Pick<SpectrumColorSwatchProps, 'size' | 'rounding'> {\n useWrapper: (swatch: ReactElement, color: Color, rounding: SpectrumColorSwatchProps['rounding']) => JSX.Element\n}\n\nexport const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(null);\n\n/**\n * A ColorSwatch displays a preview of a selected color.\n */\nexport const ColorSwatch = forwardRef(function ColorSwatch(props: SpectrumColorSwatchProps, ref: DOMRef<HTMLDivElement>): JSX.Element {\n let domRef = useDOMRef(ref);\n [props, domRef] = useContextProps(props, domRef, ColorSwatchContext);\n let {colorSwatchProps, color} = useColorSwatch(props);\n let {styleProps} = useStyleProps(props);\n let ctx = useContext(SpectrumColorSwatchContext);\n let {\n size = ctx?.size || 'M',\n rounding = ctx?.rounding || 'default'\n } = props;\n\n let swatch = (\n <div\n {...colorSwatchProps}\n {...styleProps}\n ref={domRef}\n style={{\n ...styleProps.style,\n // TODO: should there be a distinction between transparent and no value (e.g. null)?\n background: color.getChannelValue('alpha') > 0\n ? `linear-gradient(${color}, ${color}), repeating-conic-gradient(#e6e6e6 0% 25%, white 0% 50%) 0% 50% / 16px 16px`\n // Red slash to indicate there is no selected color.\n : 'linear-gradient(to bottom right, transparent calc(50% - 2px), var(--spectrum-red-900) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)) no-repeat'\n }}\n className={styleProps.className + style({\n size: {\n size: {\n XS: 4,\n S: 6,\n M: 8,\n L: 10\n }\n },\n borderRadius: {\n rounding: {\n default: 'default',\n none: 'none',\n full: 'full'\n }\n },\n // Trick to create a partially transparent color from a variable.\n // Ideally we'd use relative color syntax for this but it's not in Firefox yet.\n borderColor: '[color-mix(in srgb, var(--spectrum-gray-900), transparent 49%)]',\n borderWidth: 1,\n borderStyle: 'solid',\n boxSizing: 'border-box',\n forcedColorAdjust: 'none'\n })({size, rounding})} />\n );\n\n // ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.\n if (ctx) {\n return ctx.useWrapper(swatch, color, rounding);\n }\n\n return swatch;\n});\n"],"names":[],"version":3,"file":"ColorSwatch.main.js.map"}
|
package/dist/ColorSwatch.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import "./ColorSwatch.
|
1
|
+
import "./ColorSwatch.fabed858.css";
|
2
2
|
import {useColorSwatch as $5Pjc1$useColorSwatch} from "@react-aria/color";
|
3
3
|
import {useContextProps as $5Pjc1$useContextProps, ColorSwatchContext as $5Pjc1$ColorSwatchContext} from "react-aria-components";
|
4
|
-
import $5Pjc1$react, {createContext as $5Pjc1$createContext,
|
4
|
+
import $5Pjc1$react, {createContext as $5Pjc1$createContext, forwardRef as $5Pjc1$forwardRef, useContext as $5Pjc1$useContext} from "react";
|
5
5
|
import {useDOMRef as $5Pjc1$useDOMRef, useStyleProps as $5Pjc1$useStyleProps} from "@react-spectrum/utils";
|
6
6
|
|
7
7
|
/*
|
@@ -19,7 +19,7 @@ import {useDOMRef as $5Pjc1$useDOMRef, useStyleProps as $5Pjc1$useStyleProps} fr
|
|
19
19
|
|
20
20
|
|
21
21
|
const $d68786ae409fa722$export$8529d7908a78c058 = /*#__PURE__*/ (0, $5Pjc1$createContext)(null);
|
22
|
-
|
22
|
+
const $d68786ae409fa722$export$cae13e90592f246a = /*#__PURE__*/ (0, $5Pjc1$forwardRef)(function ColorSwatch(props, ref) {
|
23
23
|
let domRef = (0, $5Pjc1$useDOMRef)(ref);
|
24
24
|
[props, domRef] = (0, $5Pjc1$useContextProps)(props, domRef, (0, $5Pjc1$ColorSwatchContext));
|
25
25
|
let { colorSwatchProps: colorSwatchProps, color: color } = (0, $5Pjc1$useColorSwatch)(props);
|
@@ -37,34 +37,34 @@ function $d68786ae409fa722$var$ColorSwatch(props, ref) {
|
|
37
37
|
},
|
38
38
|
className: styleProps.className + function anonymous(props) {
|
39
39
|
let rules = "";
|
40
|
-
if (props.size === "L") rules += '
|
41
|
-
else if (props.size === "M") rules += '
|
42
|
-
else if (props.size === "S") rules += '
|
43
|
-
else if (props.size === "XS") rules += '
|
44
|
-
if (props.size === "L") rules += '
|
45
|
-
else if (props.size === "M") rules += '
|
46
|
-
else if (props.size === "S") rules += '
|
47
|
-
else if (props.size === "XS") rules += '
|
48
|
-
if (props.rounding === "full") rules += '
|
49
|
-
else if (props.rounding === "none") rules += '
|
50
|
-
else if (props.rounding === "default") rules += '
|
51
|
-
if (props.rounding === "full") rules += '
|
52
|
-
else if (props.rounding === "none") rules += '
|
53
|
-
else if (props.rounding === "default") rules += '
|
54
|
-
if (props.rounding === "full") rules += '
|
55
|
-
else if (props.rounding === "none") rules += '
|
56
|
-
else if (props.rounding === "default") rules += '
|
57
|
-
if (props.rounding === "full") rules += '
|
58
|
-
else if (props.rounding === "none") rules += '
|
59
|
-
else if (props.rounding === "default") rules += '
|
60
|
-
rules += ' c-1n5whoe';
|
61
|
-
rules += '
|
62
|
-
rules += '
|
63
|
-
rules += '
|
64
|
-
rules += '
|
65
|
-
rules += '
|
66
|
-
rules += '
|
67
|
-
rules += '
|
40
|
+
if (props.size === "L") rules += ' s1-os1-k';
|
41
|
+
else if (props.size === "M") rules += ' s1-os1-i';
|
42
|
+
else if (props.size === "S") rules += ' s1-os1-g';
|
43
|
+
else if (props.size === "XS") rules += ' s1-os1-e';
|
44
|
+
if (props.size === "L") rules += ' s1-ns1-k';
|
45
|
+
else if (props.size === "M") rules += ' s1-ns1-i';
|
46
|
+
else if (props.size === "S") rules += ' s1-ns1-g';
|
47
|
+
else if (props.size === "XS") rules += ' s1-ns1-e';
|
48
|
+
if (props.rounding === "full") rules += ' s1-_ps1-f';
|
49
|
+
else if (props.rounding === "none") rules += ' s1-_ps1-a';
|
50
|
+
else if (props.rounding === "default") rules += ' s1-_ps1-c';
|
51
|
+
if (props.rounding === "full") rules += ' s1-_qs1-f';
|
52
|
+
else if (props.rounding === "none") rules += ' s1-_qs1-a';
|
53
|
+
else if (props.rounding === "default") rules += ' s1-_qs1-c';
|
54
|
+
if (props.rounding === "full") rules += ' s1-_rs1-f';
|
55
|
+
else if (props.rounding === "none") rules += ' s1-_rs1-a';
|
56
|
+
else if (props.rounding === "default") rules += ' s1-_rs1-c';
|
57
|
+
if (props.rounding === "full") rules += ' s1-_ss1-f';
|
58
|
+
else if (props.rounding === "none") rules += ' s1-_ss1-a';
|
59
|
+
else if (props.rounding === "default") rules += ' s1-_ss1-c';
|
60
|
+
rules += ' s1-c-1n5whoe';
|
61
|
+
rules += ' s1-ws1-b';
|
62
|
+
rules += ' s1-xs1-b';
|
63
|
+
rules += ' s1-us1-b';
|
64
|
+
rules += ' s1-vs1-b';
|
65
|
+
rules += ' s1-As1-a';
|
66
|
+
rules += ' s1-__ks1-a';
|
67
|
+
rules += ' s1-_ts1-b';
|
68
68
|
return rules;
|
69
69
|
}({
|
70
70
|
size: size,
|
@@ -74,10 +74,7 @@ function $d68786ae409fa722$var$ColorSwatch(props, ref) {
|
|
74
74
|
// ColorSwatchPicker needs to wrap the swatch in a ListBoxItem.
|
75
75
|
if (ctx) return ctx.useWrapper(swatch, color, rounding);
|
76
76
|
return swatch;
|
77
|
-
}
|
78
|
-
/**
|
79
|
-
* A ColorSwatch displays a preview of a selected color.
|
80
|
-
*/ let $d68786ae409fa722$export$cae13e90592f246a = /*#__PURE__*/ (0, $5Pjc1$forwardRef)($d68786ae409fa722$var$ColorSwatch);
|
77
|
+
});
|
81
78
|
|
82
79
|
|
83
80
|
export {$d68786ae409fa722$export$8529d7908a78c058 as SpectrumColorSwatchContext, $d68786ae409fa722$export$cae13e90592f246a as ColorSwatch};
|