@react-spectrum/s2 3.0.0-nightly-9421c1409-240922 → 3.0.0-nightly-5a0b4fabc-240924
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/Accordion.cjs +9 -18
- package/dist/Accordion.cjs.map +1 -1
- package/dist/Accordion.css.map +1 -1
- package/dist/Accordion.mjs +10 -19
- package/dist/Accordion.mjs.map +1 -1
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/Disclosure.cjs +23 -32
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +12 -4
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +23 -32
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/types.d.ts +10 -11
- package/dist/types.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/Accordion.tsx +11 -20
- package/src/ColorSlider.tsx +3 -3
- package/src/Disclosure.tsx +22 -29
package/dist/Accordion.cjs
CHANGED
|
@@ -3,7 +3,6 @@ var $4e301a98f0cc4e4f$exports = require("./Disclosure.cjs");
|
|
|
3
3
|
var $ac757a4c2bd72aee$exports = require("./useSpectrumContextProps.cjs");
|
|
4
4
|
var $etdk1$reactjsxruntime = require("react/jsx-runtime");
|
|
5
5
|
var $etdk1$reactariacomponents = require("react-aria-components");
|
|
6
|
-
var $etdk1$reactariautils = require("@react-aria/utils");
|
|
7
6
|
var $etdk1$react = require("react");
|
|
8
7
|
var $etdk1$reactspectrumutils = require("@react-spectrum/utils");
|
|
9
8
|
|
|
@@ -30,7 +29,6 @@ $parcel$export(module.exports, "Accordion", () => $152a25dfd79f123a$export$a766c
|
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
|
|
33
|
-
|
|
34
32
|
const $152a25dfd79f123a$var$accordion = function anonymous(props, overrides) {
|
|
35
33
|
let rules = " .";
|
|
36
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|k|o|p)[^\s]+/g) || [];
|
|
@@ -43,22 +41,15 @@ const $152a25dfd79f123a$export$6bd5bb82c987ab74 = /*#__PURE__*/ (0, $etdk1$react
|
|
|
43
41
|
function $152a25dfd79f123a$var$Accordion(props, ref) {
|
|
44
42
|
[props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $152a25dfd79f123a$export$6bd5bb82c987ab74);
|
|
45
43
|
let domRef = (0, $etdk1$reactspectrumutils.useDOMRef)(ref);
|
|
46
|
-
let { UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', size: size = 'M', density: density = 'regular', isQuiet: isQuiet
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
density: density,
|
|
56
|
-
isDisabled: isDisabled
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
],
|
|
60
|
-
children: /*#__PURE__*/ (0, $etdk1$reactjsxruntime.jsx)("div", {
|
|
61
|
-
...domProps,
|
|
44
|
+
let { UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', size: size = 'M', density: density = 'regular', isQuiet: isQuiet } = props;
|
|
45
|
+
return /*#__PURE__*/ (0, $etdk1$reactjsxruntime.jsx)((0, $4e301a98f0cc4e4f$exports.DisclosureContext).Provider, {
|
|
46
|
+
value: {
|
|
47
|
+
size: size,
|
|
48
|
+
isQuiet: isQuiet,
|
|
49
|
+
density: density
|
|
50
|
+
},
|
|
51
|
+
children: /*#__PURE__*/ (0, $etdk1$reactjsxruntime.jsx)((0, $etdk1$reactariacomponents.DisclosureGroup), {
|
|
52
|
+
...props,
|
|
62
53
|
ref: domRef,
|
|
63
54
|
style: UNSAFE_style,
|
|
64
55
|
className: (UNSAFE_className ?? '') + $152a25dfd79f123a$var$accordion(null, props.styles),
|
package/dist/Accordion.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA8BD,MAAM;;;;;;;;AAKC,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAA6D;AAEzG,SAAS,gCAAU,KAAqB,EAAE,GAA2B;IACnE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,gBACF,YAAY,oBACZ,mBAAmB,UACnB,OAAO,cACP,UAAU,oBACV,OAAO,EACR,GAAG;IACJ,qBACE,gCAAC,CAAA,GAAA,2CAAgB,EAAE,QAAQ;QAAC,OAAO;kBAAC;qBAAM;qBAAS;QAAO;kBACxD,cAAA,gCAAC,CAAA,GAAA,0CAAc;YACZ,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,gCAAU,MAAM,MAAM,MAAM;sBACjE,MAAM,QAAQ;;;AAIvB;AAEA;;CAEC,GACD,IAAI,0DAAa,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Accordion.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 {ContextValue, DisclosureGroup, DisclosureGroupProps, SlotProps} from 'react-aria-components';\nimport {DisclosureContext} from './Disclosure';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef} from 'react';\nimport {style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends DisclosureGroupProps, UnsafeStyles, DOMProps, SlotProps {\n /** The disclosure elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default \"M\"\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosure items.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<AccordionProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n}\n\n/**\n * An accordion is a container for multiple disclosures.\n */\nlet _Accordion = forwardRef(Accordion);\nexport {_Accordion as Accordion};\n"],"names":[],"version":3,"file":"Accordion.cjs.map"}
|
package/dist/Accordion.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AAwCkB;;;;AAAA;EAAA;;;;EAAA;;;;;AAAA","sources":["packages/@react-spectrum/s2/src/Accordion.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 {ContextValue, DisclosureGroup, DisclosureGroupProps, SlotProps} from 'react-aria-components';\nimport {DisclosureContext} from './Disclosure';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef} from 'react';\nimport {style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends DisclosureGroupProps, UnsafeStyles, DOMProps, SlotProps {\n /** The disclosure elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default \"M\"\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosure items.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<AccordionProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n}\n\n/**\n * An accordion is a container for multiple disclosures.\n */\nlet _Accordion = forwardRef(Accordion);\nexport {_Accordion as Accordion};\n"],"names":[],"version":3,"file":"Accordion.css.map"}
|
package/dist/Accordion.mjs
CHANGED
|
@@ -2,8 +2,7 @@ import "./Accordion.css";
|
|
|
2
2
|
import {DisclosureContext as $cf1d656285911959$export$d665dd135a51b28a} from "./Disclosure.mjs";
|
|
3
3
|
import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "./useSpectrumContextProps.mjs";
|
|
4
4
|
import {jsx as $cFlas$jsx} from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
6
|
-
import {filterDOMProps as $cFlas$filterDOMProps} from "@react-aria/utils";
|
|
5
|
+
import {DisclosureGroup as $cFlas$DisclosureGroup} from "react-aria-components";
|
|
7
6
|
import {createContext as $cFlas$createContext, forwardRef as $cFlas$forwardRef} from "react";
|
|
8
7
|
import {useDOMRef as $cFlas$useDOMRef} from "@react-spectrum/utils";
|
|
9
8
|
|
|
@@ -23,7 +22,6 @@ import {useDOMRef as $cFlas$useDOMRef} from "@react-spectrum/utils";
|
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
|
|
26
|
-
|
|
27
25
|
const $e0a5d45f488fa6ba$var$accordion = function anonymous(props, overrides) {
|
|
28
26
|
let rules = " .";
|
|
29
27
|
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|k|o|p)[^\s]+/g) || [];
|
|
@@ -36,22 +34,15 @@ const $e0a5d45f488fa6ba$export$6bd5bb82c987ab74 = /*#__PURE__*/ (0, $cFlas$creat
|
|
|
36
34
|
function $e0a5d45f488fa6ba$var$Accordion(props, ref) {
|
|
37
35
|
[props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $e0a5d45f488fa6ba$export$6bd5bb82c987ab74);
|
|
38
36
|
let domRef = (0, $cFlas$useDOMRef)(ref);
|
|
39
|
-
let { UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', size: size = 'M', density: density = 'regular', isQuiet: isQuiet
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
density: density,
|
|
49
|
-
isDisabled: isDisabled
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
],
|
|
53
|
-
children: /*#__PURE__*/ (0, $cFlas$jsx)("div", {
|
|
54
|
-
...domProps,
|
|
37
|
+
let { UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', size: size = 'M', density: density = 'regular', isQuiet: isQuiet } = props;
|
|
38
|
+
return /*#__PURE__*/ (0, $cFlas$jsx)((0, $cf1d656285911959$export$d665dd135a51b28a).Provider, {
|
|
39
|
+
value: {
|
|
40
|
+
size: size,
|
|
41
|
+
isQuiet: isQuiet,
|
|
42
|
+
density: density
|
|
43
|
+
},
|
|
44
|
+
children: /*#__PURE__*/ (0, $cFlas$jsx)((0, $cFlas$DisclosureGroup), {
|
|
45
|
+
...props,
|
|
55
46
|
ref: domRef,
|
|
56
47
|
style: UNSAFE_style,
|
|
57
48
|
className: (UNSAFE_className ?? '') + $e0a5d45f488fa6ba$var$accordion(null, props.styles),
|
package/dist/Accordion.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA8BD,MAAM;;;;;;;;AAKC,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA6D;AAEzG,SAAS,gCAAU,KAAqB,EAAE,GAA2B;IACnE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,gBACF,YAAY,oBACZ,mBAAmB,UACnB,OAAO,cACP,UAAU,oBACV,OAAO,EACR,GAAG;IACJ,qBACE,gBAAC,CAAA,GAAA,yCAAgB,EAAE,QAAQ;QAAC,OAAO;kBAAC;qBAAM;qBAAS;QAAO;kBACxD,cAAA,gBAAC,CAAA,GAAA,sBAAc;YACZ,GAAG,KAAK;YACT,KAAK;YACL,OAAO;YACP,WAAW,AAAC,CAAA,oBAAoB,EAAC,IAAK,gCAAU,MAAM,MAAM,MAAM;sBACjE,MAAM,QAAQ;;;AAIvB;AAEA;;CAEC,GACD,IAAI,0DAAa,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Accordion.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 {ContextValue, DisclosureGroup, DisclosureGroupProps, SlotProps} from 'react-aria-components';\nimport {DisclosureContext} from './Disclosure';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef} from 'react';\nimport {style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends DisclosureGroupProps, UnsafeStyles, DOMProps, SlotProps {\n /** The disclosure elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default \"M\"\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosure items.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<AccordionProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n}\n\n/**\n * An accordion is a container for multiple disclosures.\n */\nlet _Accordion = forwardRef(Accordion);\nexport {_Accordion as Accordion};\n"],"names":[],"version":3,"file":"Accordion.mjs.map"}
|
package/dist/ColorSlider.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA+D;AAE7G,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,oBAAC,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U;4BACT,cAAc;4BACd,aAAa;gCACX,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,eAAe,CAAC,KAAK;gCACxE,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,IAAI,MAAM,eAAe,CAAC;gCAC7E,OAAO;uCAAC;uCAAG;gCAAC;4BACd;;;;;;AAKZ;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ColorSlider.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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA+D;AAE7G,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,oBAAC,mBAAmB,kBAAI,YAAY,UAAE,MAAM,EAAC,GAAG;IACpD,IAAI,eAAe,CAAA,GAAA,mCAAQ,EAAE;IAC7B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,oCAAQ;IAEvB,qBACE,gCAAC,CAAA,GAAA,sCAAc;QACZ,GAAG,KAAK;QACT,KAAK;QACL,OAAO;QACP,8EAA8E;QAC9E,cAAY,KAAK,CAAC,aAAa,IAAK,CAAA,MAAM,WAAW,KAAK,aAAa,MAAM,KAAK,GAAG,SAAQ;QAC7F,WAAW,CAAA,cAAe,mBAAmB;;;;;;;;;;;;;;;;;;;;;;cAuBnB,aAAa;kBACtC,CAAC,cAAC,UAAU,eAAE,WAAW,SAAE,KAAK,EAAC,iBAAM;;oBACrC,gBAAgB,gBAAiB,CAAA,MAAM,KAAK,IAAK,MAAM,KAAK,KAAK,aAAa,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB,KAC9H,mEAAmE;oBACnE,qDAAqD;oBACrD,8FAA8F;oBAC9F,mEAAmE;kCACnE,gCAAC,CAAA,GAAA,oCAAS;wBAAE,YAAY;wBAAY,gBAAgB,MAAM,cAAc;kCACrE,MAAM,KAAK,IAAI,MAAM,KAAK,CAAC,cAAc,CAAC,MAAM,OAAO,EAAE;;oBAG7D,gBAAgB,8BACf,gCAAC,CAAA,GAAA,uCAAW;wBACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAUJ,gCAAC,CAAA,GAAA,sCAAU;wBACT,KAAK;wBACL,OAAO,CAAC,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAM,CAAA;gCACtC,YAAY,aAAa,YAAY,CAAC,EAAE,aAAa,UAAU,CAAC,wEAAwE,CAAC;4BAC3I,CAAA;wBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA6BA,cAAA,gCAAC,CAAA,GAAA,qCAAU;4BACT,cAAc;4BACd,aAAa;gCACX,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,eAAe,CAAC,KAAK;gCACxE,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,IAAI,MAAM,eAAe,CAAC;gCAC7E,OAAO;uCAAC;uCAAG;gCAAC;4BACd;;;;;;AAKZ;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ColorSlider.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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider\n {...props}\n ref={containerRef}\n style={UNSAFE_style}\n // The visual label is hidden when vertical, so make it an aria-label instead.\n aria-label={props['aria-label'] || (props.orientation === 'vertical' ? props.label : undefined)}\n className={renderProps => UNSAFE_className + style({\n width: {\n orientation: {\n horizontal: 192\n }\n },\n height: {\n orientation: {\n vertical: 192\n }\n },\n display: {\n orientation: {\n horizontal: 'grid',\n vertical: 'block'\n }\n },\n gridTemplateColumns: ['1fr', 'auto'],\n gridTemplateAreas: [\n 'label output',\n 'track track'\n ],\n rowGap: 4\n }, getAllowedOverrides())(renderProps, styles)}>\n {({isDisabled, orientation, state}) => (<>\n {orientation === 'horizontal' && (props.label || (props.label === undefined && !props['aria-label'] && !props['aria-labelledby'])) && (\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 <FieldLabel isDisabled={isDisabled} contextualHelp={props.contextualHelp}>\n {props.label || state.value.getChannelName(props.channel, locale)}\n </FieldLabel>\n )}\n {orientation === 'horizontal' &&\n <SliderOutput\n className={style({\n gridArea: 'output',\n font: 'control',\n cursor: 'default',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n }\n })} />\n }\n <SliderTrack\n ref={trackRef}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `${defaultStyle.background}, repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`\n })}\n className={style({\n gridArea: 'track',\n width: {\n orientation: {\n horizontal: 'full',\n vertical: 24\n }\n },\n height: {\n orientation: {\n horizontal: 24,\n vertical: 'full'\n }\n },\n borderRadius: 'default',\n outlineColor: {\n default: 'gray-1000/10',\n forcedColors: 'ButtonBorder'\n },\n outlineWidth: 1,\n outlineOffset: -1,\n outlineStyle: {\n default: 'solid',\n isDisabled: 'none'\n },\n backgroundColor: {\n isDisabled: 'disabled'\n }\n })}>\n <ColorHandle\n containerRef={trackRef}\n getPosition={() => {\n let x = state.orientation === 'horizontal' ? state.getThumbPercent(0) : 0.5;\n let y = state.orientation === 'horizontal' ? 0.5 : 1 - state.getThumbPercent(0);\n return {x, y};\n }} />\n </SliderTrack>\n </>)}\n </AriaColorSlider>\n );\n}\n\n/**\n * A ColorSlider allows users to adjust an individual channel of a color value.\n */\nlet _ColorSlider = forwardRef(ColorSlider);\nexport {_ColorSlider as ColorSlider};\n"],"names":[],"version":3,"file":"ColorSlider.cjs.map"}
|
package/dist/ColorSlider.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"ACiDmD;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAoC5B;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnD8B;EAoC5B;;;;EAAA;;;;;AApC4B;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAoC5B;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAeF;;;;IAAA;;;;;;AAfE;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAeF;;;;AAAA;EAAA;IAAA","sources":["14771332a5b9bbc4","packages/@react-spectrum/s2/src/ColorSlider.tsx"],"sourcesContent":["@import \"d6c5746f419c314b\";\n@import \"59869632975fb938\";\n@import \"927ebdef839461cd\";\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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider
|
|
1
|
+
{"mappings":"ACiDmD;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAoC5B;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnD8B;EAoC5B;;;;EAAA;;;;;AApC4B;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAoC5B;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAeF;;;;IAAA;;;;;;AAfE;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAeF;;;;AAAA;EAAA;IAAA","sources":["14771332a5b9bbc4","packages/@react-spectrum/s2/src/ColorSlider.tsx"],"sourcesContent":["@import \"d6c5746f419c314b\";\n@import \"59869632975fb938\";\n@import \"927ebdef839461cd\";\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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider\n {...props}\n ref={containerRef}\n style={UNSAFE_style}\n // The visual label is hidden when vertical, so make it an aria-label instead.\n aria-label={props['aria-label'] || (props.orientation === 'vertical' ? props.label : undefined)}\n className={renderProps => UNSAFE_className + style({\n width: {\n orientation: {\n horizontal: 192\n }\n },\n height: {\n orientation: {\n vertical: 192\n }\n },\n display: {\n orientation: {\n horizontal: 'grid',\n vertical: 'block'\n }\n },\n gridTemplateColumns: ['1fr', 'auto'],\n gridTemplateAreas: [\n 'label output',\n 'track track'\n ],\n rowGap: 4\n }, getAllowedOverrides())(renderProps, styles)}>\n {({isDisabled, orientation, state}) => (<>\n {orientation === 'horizontal' && (props.label || (props.label === undefined && !props['aria-label'] && !props['aria-labelledby'])) && (\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 <FieldLabel isDisabled={isDisabled} contextualHelp={props.contextualHelp}>\n {props.label || state.value.getChannelName(props.channel, locale)}\n </FieldLabel>\n )}\n {orientation === 'horizontal' &&\n <SliderOutput\n className={style({\n gridArea: 'output',\n font: 'control',\n cursor: 'default',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n }\n })} />\n }\n <SliderTrack\n ref={trackRef}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `${defaultStyle.background}, repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`\n })}\n className={style({\n gridArea: 'track',\n width: {\n orientation: {\n horizontal: 'full',\n vertical: 24\n }\n },\n height: {\n orientation: {\n horizontal: 24,\n vertical: 'full'\n }\n },\n borderRadius: 'default',\n outlineColor: {\n default: 'gray-1000/10',\n forcedColors: 'ButtonBorder'\n },\n outlineWidth: 1,\n outlineOffset: -1,\n outlineStyle: {\n default: 'solid',\n isDisabled: 'none'\n },\n backgroundColor: {\n isDisabled: 'disabled'\n }\n })}>\n <ColorHandle\n containerRef={trackRef}\n getPosition={() => {\n let x = state.orientation === 'horizontal' ? state.getThumbPercent(0) : 0.5;\n let y = state.orientation === 'horizontal' ? 0.5 : 1 - state.getThumbPercent(0);\n return {x, y};\n }} />\n </SliderTrack>\n </>)}\n </AriaColorSlider>\n );\n}\n\n/**\n * A ColorSlider allows users to adjust an individual channel of a color value.\n */\nlet _ColorSlider = forwardRef(ColorSlider);\nexport {_ColorSlider as ColorSlider};\n"],"names":[],"version":3,"file":"ColorSlider.css.map"}
|
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;;;;;;;;;;;;kCAUJ,gBAAC,CAAA,GAAA,kBAAU;wBACT,KAAK;wBACL,OAAO,CAAC,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAM,CAAA;gCACtC,YAAY,aAAa,YAAY,CAAC,EAAE,aAAa,UAAU,CAAC,wEAAwE,CAAC;4BAC3I,CAAA;wBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA6BA,cAAA,gBAAC,CAAA,GAAA,yCAAU;4BACT,cAAc;4BACd,aAAa;gCACX,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,eAAe,CAAC,KAAK;gCACxE,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,IAAI,MAAM,eAAe,CAAC;gCAC7E,OAAO;uCAAC;uCAAG;gCAAC;4BACd;;;;;;AAKZ;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ColorSlider.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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA+D;AAE7G,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,oBAAC,mBAAmB,kBAAI,YAAY,UAAE,MAAM,EAAC,GAAG;IACpD,IAAI,eAAe,CAAA,GAAA,gBAAQ,EAAE;IAC7B,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAEvB,qBACE,gBAAC,CAAA,GAAA,kBAAc;QACZ,GAAG,KAAK;QACT,KAAK;QACL,OAAO;QACP,8EAA8E;QAC9E,cAAY,KAAK,CAAC,aAAa,IAAK,CAAA,MAAM,WAAW,KAAK,aAAa,MAAM,KAAK,GAAG,SAAQ;QAC7F,WAAW,CAAA,cAAe,mBAAmB;;;;;;;;;;;;;;;;;;;;;;cAuBnB,aAAa;kBACtC,CAAC,cAAC,UAAU,eAAE,WAAW,SAAE,KAAK,EAAC,iBAAM;;oBACrC,gBAAgB,gBAAiB,CAAA,MAAM,KAAK,IAAK,MAAM,KAAK,KAAK,aAAa,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB,KAC9H,mEAAmE;oBACnE,qDAAqD;oBACrD,8FAA8F;oBAC9F,mEAAmE;kCACnE,gBAAC,CAAA,GAAA,yCAAS;wBAAE,YAAY;wBAAY,gBAAgB,MAAM,cAAc;kCACrE,MAAM,KAAK,IAAI,MAAM,KAAK,CAAC,cAAc,CAAC,MAAM,OAAO,EAAE;;oBAG7D,gBAAgB,8BACf,gBAAC,CAAA,GAAA,mBAAW;wBACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAUJ,gBAAC,CAAA,GAAA,kBAAU;wBACT,KAAK;wBACL,OAAO,CAAC,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAM,CAAA;gCACtC,YAAY,aAAa,YAAY,CAAC,EAAE,aAAa,UAAU,CAAC,wEAAwE,CAAC;4BAC3I,CAAA;wBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA6BA,cAAA,gBAAC,CAAA,GAAA,yCAAU;4BACT,cAAc;4BACd,aAAa;gCACX,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,eAAe,CAAC,KAAK;gCACxE,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,IAAI,MAAM,eAAe,CAAC;gCAC7E,OAAO;uCAAC;uCAAG;gCAAC;4BACd;;;;;;AAKZ;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ColorSlider.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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider\n {...props}\n ref={containerRef}\n style={UNSAFE_style}\n // The visual label is hidden when vertical, so make it an aria-label instead.\n aria-label={props['aria-label'] || (props.orientation === 'vertical' ? props.label : undefined)}\n className={renderProps => UNSAFE_className + style({\n width: {\n orientation: {\n horizontal: 192\n }\n },\n height: {\n orientation: {\n vertical: 192\n }\n },\n display: {\n orientation: {\n horizontal: 'grid',\n vertical: 'block'\n }\n },\n gridTemplateColumns: ['1fr', 'auto'],\n gridTemplateAreas: [\n 'label output',\n 'track track'\n ],\n rowGap: 4\n }, getAllowedOverrides())(renderProps, styles)}>\n {({isDisabled, orientation, state}) => (<>\n {orientation === 'horizontal' && (props.label || (props.label === undefined && !props['aria-label'] && !props['aria-labelledby'])) && (\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 <FieldLabel isDisabled={isDisabled} contextualHelp={props.contextualHelp}>\n {props.label || state.value.getChannelName(props.channel, locale)}\n </FieldLabel>\n )}\n {orientation === 'horizontal' &&\n <SliderOutput\n className={style({\n gridArea: 'output',\n font: 'control',\n cursor: 'default',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n }\n })} />\n }\n <SliderTrack\n ref={trackRef}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `${defaultStyle.background}, repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`\n })}\n className={style({\n gridArea: 'track',\n width: {\n orientation: {\n horizontal: 'full',\n vertical: 24\n }\n },\n height: {\n orientation: {\n horizontal: 24,\n vertical: 'full'\n }\n },\n borderRadius: 'default',\n outlineColor: {\n default: 'gray-1000/10',\n forcedColors: 'ButtonBorder'\n },\n outlineWidth: 1,\n outlineOffset: -1,\n outlineStyle: {\n default: 'solid',\n isDisabled: 'none'\n },\n backgroundColor: {\n isDisabled: 'disabled'\n }\n })}>\n <ColorHandle\n containerRef={trackRef}\n getPosition={() => {\n let x = state.orientation === 'horizontal' ? state.getThumbPercent(0) : 0.5;\n let y = state.orientation === 'horizontal' ? 0.5 : 1 - state.getThumbPercent(0);\n return {x, y};\n }} />\n </SliderTrack>\n </>)}\n </AriaColorSlider>\n );\n}\n\n/**\n * A ColorSlider allows users to adjust an individual channel of a color value.\n */\nlet _ColorSlider = forwardRef(ColorSlider);\nexport {_ColorSlider as ColorSlider};\n"],"names":[],"version":3,"file":"ColorSlider.mjs.map"}
|
package/dist/Disclosure.cjs
CHANGED
|
@@ -60,10 +60,8 @@ const $4e301a98f0cc4e4f$var$disclosure = function anonymous(props, overrides) {
|
|
|
60
60
|
};
|
|
61
61
|
function $4e301a98f0cc4e4f$var$Disclosure(props, ref) {
|
|
62
62
|
[props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $4e301a98f0cc4e4f$export$d665dd135a51b28a);
|
|
63
|
-
let { size: size = 'M', density: density = 'regular', isQuiet: isQuiet,
|
|
63
|
+
let { size: size = 'M', density: density = 'regular', isQuiet: isQuiet, UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '' } = props;
|
|
64
64
|
let domRef = (0, $5FRIp$reactspectrumutils.useDOMRef)(ref);
|
|
65
|
-
let { UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', ...otherProps } = props;
|
|
66
|
-
const domProps = (0, $5FRIp$reactariautils.filterDOMProps)(otherProps);
|
|
67
65
|
return /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $5FRIp$reactariacomponents.Provider), {
|
|
68
66
|
values: [
|
|
69
67
|
[
|
|
@@ -71,14 +69,12 @@ function $4e301a98f0cc4e4f$var$Disclosure(props, ref) {
|
|
|
71
69
|
{
|
|
72
70
|
size: size,
|
|
73
71
|
isQuiet: isQuiet,
|
|
74
|
-
density: density
|
|
75
|
-
isDisabled: isDisabled
|
|
72
|
+
density: density
|
|
76
73
|
}
|
|
77
74
|
]
|
|
78
75
|
],
|
|
79
76
|
children: /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $5FRIp$reactariacomponents.Disclosure), {
|
|
80
|
-
...
|
|
81
|
-
isDisabled: isDisabled,
|
|
77
|
+
...props,
|
|
82
78
|
ref: domRef,
|
|
83
79
|
style: UNSAFE_style,
|
|
84
80
|
className: (UNSAFE_className ?? '') + $4e301a98f0cc4e4f$var$disclosure({
|
|
@@ -141,32 +137,28 @@ const $4e301a98f0cc4e4f$var$buttonStyles = function anonymous(props) {
|
|
|
141
137
|
rules += ' j-10cd9hn';
|
|
142
138
|
rules += ' o-375tou';
|
|
143
139
|
rules += ' l4';
|
|
144
|
-
if (props.
|
|
145
|
-
else if (props.
|
|
140
|
+
if (props.isPressed) rules += ' b-1tgz9bq';
|
|
141
|
+
else if (props.isHovered) rules += ' b-1tgz9bq';
|
|
142
|
+
else if (props.isFocusVisible) rules += ' b-1tgz9bq';
|
|
146
143
|
else rules += ' ba';
|
|
144
|
+
rules += ' _Oa';
|
|
145
|
+
rules += ' _Q-375x7f';
|
|
146
|
+
rules += ' _Ra';
|
|
147
147
|
rules += ' u-375tp0';
|
|
148
148
|
rules += ' v-375tp1';
|
|
149
149
|
rules += ' sa';
|
|
150
150
|
rules += ' ta';
|
|
151
|
-
if (props.isQuiet)
|
|
152
|
-
|
|
153
|
-
else if (props.isHovered) rules += ' _vh';
|
|
154
|
-
} else if (props.isFocusVisible) rules += ' _vh';
|
|
151
|
+
if (props.isQuiet) rules += ' _vh';
|
|
152
|
+
else if (props.isFocusVisible) rules += ' _vh';
|
|
155
153
|
else rules += ' _va';
|
|
156
|
-
if (props.isQuiet)
|
|
157
|
-
|
|
158
|
-
else if (props.isHovered) rules += ' _wh';
|
|
159
|
-
} else if (props.isFocusVisible) rules += ' _wh';
|
|
154
|
+
if (props.isQuiet) rules += ' _wh';
|
|
155
|
+
else if (props.isFocusVisible) rules += ' _wh';
|
|
160
156
|
else rules += ' _wa';
|
|
161
|
-
if (props.isQuiet)
|
|
162
|
-
|
|
163
|
-
else if (props.isHovered) rules += ' _xh';
|
|
164
|
-
} else if (props.isFocusVisible) rules += ' _xh';
|
|
157
|
+
if (props.isQuiet) rules += ' _xh';
|
|
158
|
+
else if (props.isFocusVisible) rules += ' _xh';
|
|
165
159
|
else rules += ' _xa';
|
|
166
|
-
if (props.isQuiet)
|
|
167
|
-
|
|
168
|
-
else if (props.isHovered) rules += ' _yh';
|
|
169
|
-
} else if (props.isFocusVisible) rules += ' _yh';
|
|
160
|
+
if (props.isQuiet) rules += ' _yh';
|
|
161
|
+
else if (props.isFocusVisible) rules += ' _yh';
|
|
170
162
|
else rules += ' _ya';
|
|
171
163
|
rules += ' _ja';
|
|
172
164
|
rules += ' __R-yksgrp';
|
|
@@ -223,7 +215,9 @@ const $4e301a98f0cc4e4f$var$chevronStyles = function anonymous(props) {
|
|
|
223
215
|
let rules = " .";
|
|
224
216
|
if (props.isExpanded) rules += ' R-3hn0u';
|
|
225
217
|
else if (props.isRTL) rules += ' R-375xa6';
|
|
226
|
-
rules += '
|
|
218
|
+
rules += ' _Oa';
|
|
219
|
+
rules += ' _Q-375x7f';
|
|
220
|
+
rules += ' _Ra';
|
|
227
221
|
rules += ' -rwx0fg_e-b';
|
|
228
222
|
rules += ' _8-3t1x';
|
|
229
223
|
return rules;
|
|
@@ -243,14 +237,11 @@ function $4e301a98f0cc4e4f$var$DisclosureHeader(props, ref) {
|
|
|
243
237
|
style: UNSAFE_style,
|
|
244
238
|
className: (UNSAFE_className ?? '') + $4e301a98f0cc4e4f$var$headingStyle,
|
|
245
239
|
children: /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsxs)((0, $5FRIp$reactariacomponents.Button), {
|
|
246
|
-
className: (
|
|
240
|
+
className: (renderProps)=>$4e301a98f0cc4e4f$var$buttonStyles({
|
|
241
|
+
...renderProps,
|
|
247
242
|
size: size,
|
|
248
|
-
isHovered: isHovered,
|
|
249
|
-
isFocused: isFocused,
|
|
250
|
-
isFocusVisible: isFocusVisible,
|
|
251
243
|
density: density,
|
|
252
|
-
isQuiet: isQuiet
|
|
253
|
-
isDisabled: isDisabled
|
|
244
|
+
isQuiet: isQuiet
|
|
254
245
|
}),
|
|
255
246
|
slot: "trigger",
|
|
256
247
|
children: [
|
package/dist/Disclosure.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA+BM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAgF;AAE7H,MAAM;;;;;;;;;;;;;;;;;;;;;;AAoBN,SAAS,iCAAW,KAAsB,EAAE,GAA2B;IACrE,CAA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;wBAAM;QAAU;kBAClE,MAAM,QAAQ;;AAGrB;AAEA;;CAEC,GACD,IAAI,4CAAiC,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB","sources":["packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, focusRing, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {createContext, forwardRef, ReactElement, useContext} from 'react';\nimport {size as sizeValue, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface DisclosureProps extends RACDisclosureProps, StyleProps, DOMProps {\n /**\n * The size of the disclosure.\n * @default \"M\"\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: [ReactElement<DisclosureHeaderProps>, ReactElement<DisclosurePanelProps>]\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet, isDisabled\n } = props;\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density, isDisabled}]\n ]}>\n <RACDisclosure\n {...domProps}\n isDisabled={isDisabled}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: 'transparent-black-100',\n isHovered: 'transparent-black-100'\n },\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet hover.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: {\n isHovered: 'control',\n isFocusVisible: 'control'\n }\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transitionDuration: '100ms',\n transitionProperty: 'rotate',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nfunction DisclosureHeader(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n return (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={({isHovered, isFocused, isFocusVisible, isDisabled}) => buttonStyles({size, isHovered, isFocused, isFocusVisible, density, isQuiet, isDisabled})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n}\n\n/**\n * A header for a disclosure. Contains a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosureHeader);\nexport {_DisclosureHeader as DisclosureHeader};\n\nexport interface DisclosurePanelProps extends RACDisclosurePanelProps, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AA8BM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAgF;AAE7H,MAAM;;;;;;;;;;;;;;;;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2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, focusRing, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {lightDark, size as sizeValue, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends RACDisclosureProps, StyleProps {\n /**\n * The size of the disclosure.\n * @default \"M\"\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-100', 'transparent-white-100')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nfunction DisclosureHeader(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n return (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n}\n\n/**\n * A header for a disclosure. Contains a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureHeader = forwardRef(DisclosureHeader);\nexport {_DisclosureHeader as DisclosureHeader};\n\nexport interface DisclosurePanelProps extends RACDisclosurePanelProps, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.cjs.map"}
|
package/dist/Disclosure.css
CHANGED
|
@@ -133,8 +133,8 @@
|
|
|
133
133
|
background-color: #0000;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.
|
|
137
|
-
background-color: #00000017;
|
|
136
|
+
.b-1tgz9bq {
|
|
137
|
+
background-color: var(--lightningcss-light, #00000017) var(--lightningcss-dark, #ffffff1c);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.u-375tp0 {
|
|
@@ -233,8 +233,16 @@
|
|
|
233
233
|
rotate: 90deg;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
.
|
|
237
|
-
transition-
|
|
236
|
+
._Oa {
|
|
237
|
+
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;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
._Q-375x7f {
|
|
241
|
+
transition-duration: .15s;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
._Ra {
|
|
245
|
+
transition-timing-function: cubic-bezier(.45, 0, .4, 1);
|
|
238
246
|
}
|
|
239
247
|
|
|
240
248
|
.-rwx0fg_e-b {
|
package/dist/Disclosure.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AC0CmB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA+DE;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAIA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2EC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqDF;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnMD;EAAA;;;;EAAA;;;;EAmEE;;;;EAgID;;;;EAAA;;;;;AAnMD;;AAAA;EAAA;IAAA;;;;IAmEE;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAgID;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAhIC;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;;;AA2EC","sources":["af82a6f8008c749b","packages/@react-spectrum/s2/src/Disclosure.tsx"],"sourcesContent":["@import \"02b9b02b69a441b2\";\n@import \"80d1cf6aba9342e9\";\n@import \"d47c144c912b2c65\";\n@import \"54c3947845455457\";\n@import \"47e48706d70658de\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components';\nimport {CenterBaseline} from './CenterBaseline';\nimport {centerPadding, focusRing, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport Chevron from '../ui-icons/Chevron';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {lightDark, size as sizeValue, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport React, {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface DisclosureProps extends RACDisclosureProps, StyleProps {\n /**\n * The size of the disclosure.\n * @default \"M\"\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosures.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the disclosure should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The contents of the disclosure, consisting of an DisclosureHeader and DisclosurePanel. */\n children: ReactNode\n}\n\nexport const DisclosureContext = createContext<ContextValue<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst disclosure = style({\n color: 'heading',\n borderTopWidth: {\n default: 1,\n isQuiet: 0\n },\n borderBottomWidth: {\n default: 0,\n ':last-child': {\n default: 1,\n isQuiet: 0\n }\n },\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: 'gray-200',\n minWidth: sizeValue(200)\n}, getAllowedOverrides());\n\nfunction Disclosure(props: DisclosureProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, DisclosureContext);\n let {\n size = 'M',\n density = 'regular',\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <Provider\n values={[\n [DisclosureContext, {size, isQuiet, density}]\n ]}>\n <RACDisclosure\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + disclosure({isQuiet}, props.styles)}>\n {props.children}\n </RACDisclosure>\n </Provider>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nlet _Disclosure = forwardRef(Disclosure);\nexport {_Disclosure as Disclosure};\n\nexport interface DisclosureHeaderProps extends UnsafeStyles, DOMProps {\n /** The heading level of the disclosure header.\n * \n * @default 3\n */\n level?: number,\n /** The contents of the disclosure header. */\n children: React.ReactNode\n}\n\nconst headingStyle = style({\n margin: 0\n});\n\nconst buttonStyles = style({\n ...focusRing(),\n outlineOffset: -2,\n font: 'heading',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n fontWeight: 'bold',\n fontSize: {\n size: {\n S: 'heading-xs',\n M: 'heading-sm',\n L: 'heading',\n XL: 'heading-lg'\n }\n },\n lineHeight: 'ui',\n display: 'flex',\n alignItems: 'baseline',\n paddingX: '[calc(self(minHeight) * 3/8 - 1px)]',\n paddingY: centerPadding(),\n gap: '[calc(self(minHeight) * 3/8 - 1px)]',\n minHeight: {\n // compact is equivalent to 'control', but other densities have more padding.\n size: {\n S: {\n density: {\n compact: 24,\n regular: 32,\n spacious: 40\n }\n },\n M: {\n density: {\n compact: 32,\n regular: 40,\n spacious: 48\n }\n },\n L: {\n density: {\n compact: 40,\n regular: 48,\n spacious: 56\n }\n },\n XL: {\n density: {\n compact: 48,\n regular: 56,\n spacious: 64\n }\n }\n }\n },\n width: 'full',\n backgroundColor: {\n default: 'transparent',\n isFocusVisible: lightDark('transparent-black-100', 'transparent-white-100'),\n isHovered: lightDark('transparent-black-100', 'transparent-white-100'),\n isPressed: lightDark('transparent-black-100', 'transparent-white-100')\n },\n transition: 'default',\n borderWidth: 0,\n borderRadius: {\n // Only rounded for keyboard focus and quiet.\n default: 'none',\n isFocusVisible: 'control',\n isQuiet: 'control'\n },\n textAlign: 'start',\n disableTapHighlight: true\n});\n\nconst chevronStyles = style({\n rotate: {\n isRTL: 180,\n isExpanded: 90\n },\n transition: 'default',\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n flexShrink: 0\n});\n\nfunction DisclosureHeader(props: DisclosureHeaderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n level = 3,\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n const domProps = filterDOMProps(otherProps);\n let {direction} = useLocale();\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let {size, density, isQuiet} = useSlottedContext(DisclosureContext)!;\n let isRTL = direction === 'rtl';\n return (\n <Heading\n {...domProps}\n level={level}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + headingStyle}>\n <Button className={(renderProps) => buttonStyles({...renderProps, size, density, isQuiet})} slot=\"trigger\">\n <CenterBaseline>\n <Chevron size={size} className={chevronStyles({isExpanded, isRTL})} aria-hidden=\"true\" />\n </CenterBaseline>\n {props.children}\n </Button>\n </Heading>\n );\n}\n\n/**\n * A header for a disclosure. Contains a heading and a trigger button to expand/collapse the panel.\n */\nlet _DisclosureHeader = forwardRef(DisclosureHeader);\nexport {_DisclosureHeader as DisclosureHeader};\n\nexport interface DisclosurePanelProps extends RACDisclosurePanelProps, UnsafeStyles, DOMProps, AriaLabelingProps {\n children: React.ReactNode\n}\n\nconst panelStyles = style({\n font: 'body',\n paddingTop: {\n isExpanded: 8\n },\n paddingBottom: {\n isExpanded: 16\n },\n paddingX: {\n isExpanded: {\n size: {\n S: 8,\n M: sizeValue(9),\n L: 12,\n XL: sizeValue(15)\n }\n }\n }\n});\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n let {size} = useSlottedContext(DisclosureContext)!;\n let {isExpanded} = useContext(DisclosureStateContext)!;\n let panelRef = useDOMRef(ref);\n return (\n <RACDisclosurePanel\n {...domProps}\n ref={panelRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + panelStyles({size, isExpanded})}>\n {props.children}\n </RACDisclosurePanel>\n );\n}\n\n/**\n * A disclosure panel is a collapsible section of content that is hidden until the disclosure is expanded.\n */\nlet _DisclosurePanel = forwardRef(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n\n"],"names":[],"version":3,"file":"Disclosure.css.map"}
|