@react-spectrum/layout 3.6.4-nightly.4555 → 3.6.4-nightly.4560

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.
@@ -0,0 +1,96 @@
1
+ require("./flex-gap.27391a03.css");
2
+ var $12be0ef8be5abc46$exports = require("./flex-gap_css.main.js");
3
+ var $1yXrx$reactspectrumutils = require("@react-spectrum/utils");
4
+ var $1yXrx$reactariautils = require("@react-aria/utils");
5
+ var $1yXrx$react = require("react");
6
+
7
+
8
+ function $parcel$interopDefault(a) {
9
+ return a && a.__esModule ? a.default : a;
10
+ }
11
+
12
+ function $parcel$export(e, n, v, s) {
13
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
14
+ }
15
+
16
+ $parcel$export(module.exports, "Flex", () => $a2ef5497697e8437$export$f51f4c4ede09e011);
17
+ /*
18
+ * Copyright 2020 Adobe. All rights reserved.
19
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
20
+ * you may not use this file except in compliance with the License. You may obtain a copy
21
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
22
+ *
23
+ * Unless required by applicable law or agreed to in writing, software distributed under
24
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
25
+ * OF ANY KIND, either express or implied. See the License for the specific language
26
+ * governing permissions and limitations under the License.
27
+ */
28
+
29
+
30
+
31
+ const $a2ef5497697e8437$var$flexStyleProps = {
32
+ direction: [
33
+ "flexDirection",
34
+ (0, $1yXrx$reactspectrumutils.passthroughStyle)
35
+ ],
36
+ wrap: [
37
+ "flexWrap",
38
+ $a2ef5497697e8437$var$flexWrapValue
39
+ ],
40
+ justifyContent: [
41
+ "justifyContent",
42
+ $a2ef5497697e8437$var$flexAlignValue
43
+ ],
44
+ alignItems: [
45
+ "alignItems",
46
+ $a2ef5497697e8437$var$flexAlignValue
47
+ ],
48
+ alignContent: [
49
+ "alignContent",
50
+ $a2ef5497697e8437$var$flexAlignValue
51
+ ]
52
+ };
53
+ function $a2ef5497697e8437$var$Flex(props, ref) {
54
+ let { children: children, ...otherProps } = props;
55
+ let breakpointProvider = (0, $1yXrx$reactspectrumutils.useBreakpoint)();
56
+ let matchedBreakpoints = (breakpointProvider === null || breakpointProvider === void 0 ? void 0 : breakpointProvider.matchedBreakpoints) || [
57
+ "base"
58
+ ];
59
+ let { styleProps: styleProps } = (0, $1yXrx$reactspectrumutils.useStyleProps)(otherProps);
60
+ let { styleProps: flexStyle } = (0, $1yXrx$reactspectrumutils.useStyleProps)(otherProps, $a2ef5497697e8437$var$flexStyleProps);
61
+ let domRef = (0, $1yXrx$reactspectrumutils.useDOMRef)(ref);
62
+ let style = {
63
+ ...styleProps.style,
64
+ ...flexStyle.style
65
+ };
66
+ if (props.gap != null) style.gap = (0, $1yXrx$reactspectrumutils.responsiveDimensionValue)(props.gap, matchedBreakpoints);
67
+ if (props.columnGap != null) style.columnGap = (0, $1yXrx$reactspectrumutils.responsiveDimensionValue)(props.columnGap, matchedBreakpoints);
68
+ if (props.rowGap != null) style.rowGap = (0, $1yXrx$reactspectrumutils.responsiveDimensionValue)(props.rowGap, matchedBreakpoints);
69
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($1yXrx$react))).createElement("div", {
70
+ ...(0, $1yXrx$reactariautils.filterDOMProps)(otherProps),
71
+ className: (0, $1yXrx$reactspectrumutils.classNames)((0, ($parcel$interopDefault($12be0ef8be5abc46$exports))), "flex", styleProps.className),
72
+ style: style,
73
+ ref: domRef
74
+ }, children);
75
+ }
76
+ /**
77
+ * Normalize 'start' and 'end' alignment values to 'flex-start' and 'flex-end'
78
+ * in flex containers for browser compatibility.
79
+ */ function $a2ef5497697e8437$var$flexAlignValue(value) {
80
+ if (value === "start") return "flex-start";
81
+ if (value === "end") return "flex-end";
82
+ return value;
83
+ }
84
+ /**
85
+ * Takes a boolean and translates it to flex wrap or nowrap.
86
+ */ function $a2ef5497697e8437$var$flexWrapValue(value) {
87
+ if (typeof value === "boolean") return value ? "wrap" : "nowrap";
88
+ return value;
89
+ }
90
+ /**
91
+ * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap
92
+ * property to define consistent spacing between items.
93
+ */ const $a2ef5497697e8437$export$f51f4c4ede09e011 = /*#__PURE__*/ (0, $1yXrx$react.forwardRef)($a2ef5497697e8437$var$Flex);
94
+
95
+
96
+ //# sourceMappingURL=Flex.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AASD,MAAM,uCAAgC;IACpC,WAAW;QAAC;QAAiB,CAAA,GAAA,0CAAe;KAAE;IAC9C,MAAM;QAAC;QAAY;KAAc;IACjC,gBAAgB;QAAC;QAAkB;KAAe;IAClD,YAAY;QAAC;QAAc;KAAe;IAC1C,cAAc;QAAC;QAAgB;KAAe;AAChD;AAEA,SAAS,2BAAK,KAAgB,EAAE,GAA2B;IACzD,IAAI,YACF,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,qBAAqB,CAAA,GAAA,uCAAY;IACrC,IAAI,qBAAqB,CAAA,+BAAA,yCAAA,mBAAoB,kBAAkB,KAAI;QAAC;KAAO;IAC3E,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,EAAC,YAAY,SAAS,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE,YAAY;IACxD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI,QAAQ;QACV,GAAG,WAAW,KAAK;QACnB,GAAG,UAAU,KAAK;IACpB;IAEA,IAAI,MAAM,GAAG,IAAI,MACf,MAAM,GAAG,GAAG,CAAA,GAAA,kDAAuB,EAAE,MAAM,GAAG,EAAE;IAGlD,IAAI,MAAM,SAAS,IAAI,MACrB,MAAM,SAAS,GAAG,CAAA,GAAA,kDAAuB,EAAE,MAAM,SAAS,EAAE;IAG9D,IAAI,MAAM,MAAM,IAAI,MAClB,MAAM,MAAM,GAAG,CAAA,GAAA,kDAAuB,EAAE,MAAM,MAAM,EAAE;IAGxD,qBACE,0DAAC;QAAK,GAAG,CAAA,GAAA,oCAAa,EAAE,WAAW;QAAE,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,QAAQ,WAAW,SAAS;QAAG,OAAO;QAAO,KAAK;OAClH;AAGP;AAEA;;;CAGC,GACD,SAAS,qCAAe,KAAK;IAC3B,IAAI,UAAU,SACZ,OAAO;IAGT,IAAI,UAAU,OACZ,OAAO;IAGT,OAAO;AACT;AAEA;;CAEC,GACD,SAAS,oCAAc,KAAK;IAC1B,IAAI,OAAO,UAAU,WACnB,OAAO,QAAQ,SAAS;IAG1B,OAAO;AACT;AAEA;;;CAGC,GACD,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/layout/src/Flex.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, passthroughStyle, responsiveDimensionValue, StyleHandlers, useBreakpoint, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FlexProps} from '@react-types/layout';\nimport React, {forwardRef} from 'react';\nimport styles from './flex-gap.css';\n\nconst flexStyleProps: StyleHandlers = {\n direction: ['flexDirection', passthroughStyle],\n wrap: ['flexWrap', flexWrapValue],\n justifyContent: ['justifyContent', flexAlignValue],\n alignItems: ['alignItems', flexAlignValue],\n alignContent: ['alignContent', flexAlignValue]\n};\n\nfunction Flex(props: FlexProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n ...otherProps\n } = props;\n let breakpointProvider = useBreakpoint();\n let matchedBreakpoints = breakpointProvider?.matchedBreakpoints || ['base'];\n let {styleProps} = useStyleProps(otherProps);\n let {styleProps: flexStyle} = useStyleProps(otherProps, flexStyleProps);\n let domRef = useDOMRef(ref);\n\n let style = {\n ...styleProps.style,\n ...flexStyle.style\n };\n\n if (props.gap != null) {\n style.gap = responsiveDimensionValue(props.gap, matchedBreakpoints);\n }\n\n if (props.columnGap != null) {\n style.columnGap = responsiveDimensionValue(props.columnGap, matchedBreakpoints);\n }\n\n if (props.rowGap != null) {\n style.rowGap = responsiveDimensionValue(props.rowGap, matchedBreakpoints);\n }\n\n return (\n <div {...filterDOMProps(otherProps)} className={classNames(styles, 'flex', styleProps.className)} style={style} ref={domRef}>\n {children}\n </div>\n );\n}\n\n/**\n * Normalize 'start' and 'end' alignment values to 'flex-start' and 'flex-end'\n * in flex containers for browser compatibility.\n */\nfunction flexAlignValue(value) {\n if (value === 'start') {\n return 'flex-start';\n }\n\n if (value === 'end') {\n return 'flex-end';\n }\n\n return value;\n}\n\n/**\n * Takes a boolean and translates it to flex wrap or nowrap.\n */\nfunction flexWrapValue(value) {\n if (typeof value === 'boolean') {\n return value ? 'wrap' : 'nowrap';\n }\n\n return value;\n}\n\n/**\n * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap\n * property to define consistent spacing between items.\n */\nconst _Flex = forwardRef(Flex);\nexport {_Flex as Flex};\n"],"names":[],"version":3,"file":"Flex.main.js.map"}
package/dist/Flex.mjs ADDED
@@ -0,0 +1,91 @@
1
+ import "./flex-gap.27391a03.css";
2
+ import $bDezp$flexgap_cssmodulejs from "./flex-gap_css.mjs";
3
+ import {passthroughStyle as $bDezp$passthroughStyle, useBreakpoint as $bDezp$useBreakpoint, useStyleProps as $bDezp$useStyleProps, useDOMRef as $bDezp$useDOMRef, responsiveDimensionValue as $bDezp$responsiveDimensionValue, classNames as $bDezp$classNames} from "@react-spectrum/utils";
4
+ import {filterDOMProps as $bDezp$filterDOMProps} from "@react-aria/utils";
5
+ import $bDezp$react, {forwardRef as $bDezp$forwardRef} from "react";
6
+
7
+
8
+ function $parcel$interopDefault(a) {
9
+ return a && a.__esModule ? a.default : a;
10
+ }
11
+ /*
12
+ * Copyright 2020 Adobe. All rights reserved.
13
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14
+ * you may not use this file except in compliance with the License. You may obtain a copy
15
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software distributed under
18
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
19
+ * OF ANY KIND, either express or implied. See the License for the specific language
20
+ * governing permissions and limitations under the License.
21
+ */
22
+
23
+
24
+
25
+ const $884c64d19340d345$var$flexStyleProps = {
26
+ direction: [
27
+ "flexDirection",
28
+ (0, $bDezp$passthroughStyle)
29
+ ],
30
+ wrap: [
31
+ "flexWrap",
32
+ $884c64d19340d345$var$flexWrapValue
33
+ ],
34
+ justifyContent: [
35
+ "justifyContent",
36
+ $884c64d19340d345$var$flexAlignValue
37
+ ],
38
+ alignItems: [
39
+ "alignItems",
40
+ $884c64d19340d345$var$flexAlignValue
41
+ ],
42
+ alignContent: [
43
+ "alignContent",
44
+ $884c64d19340d345$var$flexAlignValue
45
+ ]
46
+ };
47
+ function $884c64d19340d345$var$Flex(props, ref) {
48
+ let { children: children, ...otherProps } = props;
49
+ let breakpointProvider = (0, $bDezp$useBreakpoint)();
50
+ let matchedBreakpoints = (breakpointProvider === null || breakpointProvider === void 0 ? void 0 : breakpointProvider.matchedBreakpoints) || [
51
+ "base"
52
+ ];
53
+ let { styleProps: styleProps } = (0, $bDezp$useStyleProps)(otherProps);
54
+ let { styleProps: flexStyle } = (0, $bDezp$useStyleProps)(otherProps, $884c64d19340d345$var$flexStyleProps);
55
+ let domRef = (0, $bDezp$useDOMRef)(ref);
56
+ let style = {
57
+ ...styleProps.style,
58
+ ...flexStyle.style
59
+ };
60
+ if (props.gap != null) style.gap = (0, $bDezp$responsiveDimensionValue)(props.gap, matchedBreakpoints);
61
+ if (props.columnGap != null) style.columnGap = (0, $bDezp$responsiveDimensionValue)(props.columnGap, matchedBreakpoints);
62
+ if (props.rowGap != null) style.rowGap = (0, $bDezp$responsiveDimensionValue)(props.rowGap, matchedBreakpoints);
63
+ return /*#__PURE__*/ (0, $bDezp$react).createElement("div", {
64
+ ...(0, $bDezp$filterDOMProps)(otherProps),
65
+ className: (0, $bDezp$classNames)((0, ($parcel$interopDefault($bDezp$flexgap_cssmodulejs))), "flex", styleProps.className),
66
+ style: style,
67
+ ref: domRef
68
+ }, children);
69
+ }
70
+ /**
71
+ * Normalize 'start' and 'end' alignment values to 'flex-start' and 'flex-end'
72
+ * in flex containers for browser compatibility.
73
+ */ function $884c64d19340d345$var$flexAlignValue(value) {
74
+ if (value === "start") return "flex-start";
75
+ if (value === "end") return "flex-end";
76
+ return value;
77
+ }
78
+ /**
79
+ * Takes a boolean and translates it to flex wrap or nowrap.
80
+ */ function $884c64d19340d345$var$flexWrapValue(value) {
81
+ if (typeof value === "boolean") return value ? "wrap" : "nowrap";
82
+ return value;
83
+ }
84
+ /**
85
+ * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap
86
+ * property to define consistent spacing between items.
87
+ */ const $884c64d19340d345$export$f51f4c4ede09e011 = /*#__PURE__*/ (0, $bDezp$forwardRef)($884c64d19340d345$var$Flex);
88
+
89
+
90
+ export {$884c64d19340d345$export$f51f4c4ede09e011 as Flex};
91
+ //# sourceMappingURL=Flex.mjs.map
@@ -0,0 +1,91 @@
1
+ import "./flex-gap.27391a03.css";
2
+ import $bDezp$flexgap_cssmodulejs from "./flex-gap_css.module.js";
3
+ import {passthroughStyle as $bDezp$passthroughStyle, useBreakpoint as $bDezp$useBreakpoint, useStyleProps as $bDezp$useStyleProps, useDOMRef as $bDezp$useDOMRef, responsiveDimensionValue as $bDezp$responsiveDimensionValue, classNames as $bDezp$classNames} from "@react-spectrum/utils";
4
+ import {filterDOMProps as $bDezp$filterDOMProps} from "@react-aria/utils";
5
+ import $bDezp$react, {forwardRef as $bDezp$forwardRef} from "react";
6
+
7
+
8
+ function $parcel$interopDefault(a) {
9
+ return a && a.__esModule ? a.default : a;
10
+ }
11
+ /*
12
+ * Copyright 2020 Adobe. All rights reserved.
13
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14
+ * you may not use this file except in compliance with the License. You may obtain a copy
15
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software distributed under
18
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
19
+ * OF ANY KIND, either express or implied. See the License for the specific language
20
+ * governing permissions and limitations under the License.
21
+ */
22
+
23
+
24
+
25
+ const $884c64d19340d345$var$flexStyleProps = {
26
+ direction: [
27
+ "flexDirection",
28
+ (0, $bDezp$passthroughStyle)
29
+ ],
30
+ wrap: [
31
+ "flexWrap",
32
+ $884c64d19340d345$var$flexWrapValue
33
+ ],
34
+ justifyContent: [
35
+ "justifyContent",
36
+ $884c64d19340d345$var$flexAlignValue
37
+ ],
38
+ alignItems: [
39
+ "alignItems",
40
+ $884c64d19340d345$var$flexAlignValue
41
+ ],
42
+ alignContent: [
43
+ "alignContent",
44
+ $884c64d19340d345$var$flexAlignValue
45
+ ]
46
+ };
47
+ function $884c64d19340d345$var$Flex(props, ref) {
48
+ let { children: children, ...otherProps } = props;
49
+ let breakpointProvider = (0, $bDezp$useBreakpoint)();
50
+ let matchedBreakpoints = (breakpointProvider === null || breakpointProvider === void 0 ? void 0 : breakpointProvider.matchedBreakpoints) || [
51
+ "base"
52
+ ];
53
+ let { styleProps: styleProps } = (0, $bDezp$useStyleProps)(otherProps);
54
+ let { styleProps: flexStyle } = (0, $bDezp$useStyleProps)(otherProps, $884c64d19340d345$var$flexStyleProps);
55
+ let domRef = (0, $bDezp$useDOMRef)(ref);
56
+ let style = {
57
+ ...styleProps.style,
58
+ ...flexStyle.style
59
+ };
60
+ if (props.gap != null) style.gap = (0, $bDezp$responsiveDimensionValue)(props.gap, matchedBreakpoints);
61
+ if (props.columnGap != null) style.columnGap = (0, $bDezp$responsiveDimensionValue)(props.columnGap, matchedBreakpoints);
62
+ if (props.rowGap != null) style.rowGap = (0, $bDezp$responsiveDimensionValue)(props.rowGap, matchedBreakpoints);
63
+ return /*#__PURE__*/ (0, $bDezp$react).createElement("div", {
64
+ ...(0, $bDezp$filterDOMProps)(otherProps),
65
+ className: (0, $bDezp$classNames)((0, ($parcel$interopDefault($bDezp$flexgap_cssmodulejs))), "flex", styleProps.className),
66
+ style: style,
67
+ ref: domRef
68
+ }, children);
69
+ }
70
+ /**
71
+ * Normalize 'start' and 'end' alignment values to 'flex-start' and 'flex-end'
72
+ * in flex containers for browser compatibility.
73
+ */ function $884c64d19340d345$var$flexAlignValue(value) {
74
+ if (value === "start") return "flex-start";
75
+ if (value === "end") return "flex-end";
76
+ return value;
77
+ }
78
+ /**
79
+ * Takes a boolean and translates it to flex wrap or nowrap.
80
+ */ function $884c64d19340d345$var$flexWrapValue(value) {
81
+ if (typeof value === "boolean") return value ? "wrap" : "nowrap";
82
+ return value;
83
+ }
84
+ /**
85
+ * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap
86
+ * property to define consistent spacing between items.
87
+ */ const $884c64d19340d345$export$f51f4c4ede09e011 = /*#__PURE__*/ (0, $bDezp$forwardRef)($884c64d19340d345$var$Flex);
88
+
89
+
90
+ export {$884c64d19340d345$export$f51f4c4ede09e011 as Flex};
91
+ //# sourceMappingURL=Flex.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AASD,MAAM,uCAAgC;IACpC,WAAW;QAAC;QAAiB,CAAA,GAAA,uBAAe;KAAE;IAC9C,MAAM;QAAC;QAAY;KAAc;IACjC,gBAAgB;QAAC;QAAkB;KAAe;IAClD,YAAY;QAAC;QAAc;KAAe;IAC1C,cAAc;QAAC;QAAgB;KAAe;AAChD;AAEA,SAAS,2BAAK,KAAgB,EAAE,GAA2B;IACzD,IAAI,YACF,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,qBAAqB,CAAA,GAAA,oBAAY;IACrC,IAAI,qBAAqB,CAAA,+BAAA,yCAAA,mBAAoB,kBAAkB,KAAI;QAAC;KAAO;IAC3E,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,EAAC,YAAY,SAAS,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE,YAAY;IACxD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,QAAQ;QACV,GAAG,WAAW,KAAK;QACnB,GAAG,UAAU,KAAK;IACpB;IAEA,IAAI,MAAM,GAAG,IAAI,MACf,MAAM,GAAG,GAAG,CAAA,GAAA,+BAAuB,EAAE,MAAM,GAAG,EAAE;IAGlD,IAAI,MAAM,SAAS,IAAI,MACrB,MAAM,SAAS,GAAG,CAAA,GAAA,+BAAuB,EAAE,MAAM,SAAS,EAAE;IAG9D,IAAI,MAAM,MAAM,IAAI,MAClB,MAAM,MAAM,GAAG,CAAA,GAAA,+BAAuB,EAAE,MAAM,MAAM,EAAE;IAGxD,qBACE,gCAAC;QAAK,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAAE,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,oDAAK,GAAG,QAAQ,WAAW,SAAS;QAAG,OAAO;QAAO,KAAK;OAClH;AAGP;AAEA;;;CAGC,GACD,SAAS,qCAAe,KAAK;IAC3B,IAAI,UAAU,SACZ,OAAO;IAGT,IAAI,UAAU,OACZ,OAAO;IAGT,OAAO;AACT;AAEA;;CAEC,GACD,SAAS,oCAAc,KAAK;IAC1B,IAAI,OAAO,UAAU,WACnB,OAAO,QAAQ,SAAS;IAG1B,OAAO;AACT;AAEA;;;CAGC,GACD,MAAM,0DAAQ,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/layout/src/Flex.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, passthroughStyle, responsiveDimensionValue, StyleHandlers, useBreakpoint, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FlexProps} from '@react-types/layout';\nimport React, {forwardRef} from 'react';\nimport styles from './flex-gap.css';\n\nconst flexStyleProps: StyleHandlers = {\n direction: ['flexDirection', passthroughStyle],\n wrap: ['flexWrap', flexWrapValue],\n justifyContent: ['justifyContent', flexAlignValue],\n alignItems: ['alignItems', flexAlignValue],\n alignContent: ['alignContent', flexAlignValue]\n};\n\nfunction Flex(props: FlexProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n ...otherProps\n } = props;\n let breakpointProvider = useBreakpoint();\n let matchedBreakpoints = breakpointProvider?.matchedBreakpoints || ['base'];\n let {styleProps} = useStyleProps(otherProps);\n let {styleProps: flexStyle} = useStyleProps(otherProps, flexStyleProps);\n let domRef = useDOMRef(ref);\n\n let style = {\n ...styleProps.style,\n ...flexStyle.style\n };\n\n if (props.gap != null) {\n style.gap = responsiveDimensionValue(props.gap, matchedBreakpoints);\n }\n\n if (props.columnGap != null) {\n style.columnGap = responsiveDimensionValue(props.columnGap, matchedBreakpoints);\n }\n\n if (props.rowGap != null) {\n style.rowGap = responsiveDimensionValue(props.rowGap, matchedBreakpoints);\n }\n\n return (\n <div {...filterDOMProps(otherProps)} className={classNames(styles, 'flex', styleProps.className)} style={style} ref={domRef}>\n {children}\n </div>\n );\n}\n\n/**\n * Normalize 'start' and 'end' alignment values to 'flex-start' and 'flex-end'\n * in flex containers for browser compatibility.\n */\nfunction flexAlignValue(value) {\n if (value === 'start') {\n return 'flex-start';\n }\n\n if (value === 'end') {\n return 'flex-end';\n }\n\n return value;\n}\n\n/**\n * Takes a boolean and translates it to flex wrap or nowrap.\n */\nfunction flexWrapValue(value) {\n if (typeof value === 'boolean') {\n return value ? 'wrap' : 'nowrap';\n }\n\n return value;\n}\n\n/**\n * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap\n * property to define consistent spacing between items.\n */\nconst _Flex = forwardRef(Flex);\nexport {_Flex as Flex};\n"],"names":[],"version":3,"file":"Flex.module.js.map"}
@@ -0,0 +1,123 @@
1
+ var $ATZAs$reactspectrumutils = require("@react-spectrum/utils");
2
+ var $ATZAs$reactariautils = require("@react-aria/utils");
3
+ var $ATZAs$react = require("react");
4
+
5
+
6
+ function $parcel$interopDefault(a) {
7
+ return a && a.__esModule ? a.default : a;
8
+ }
9
+
10
+ function $parcel$export(e, n, v, s) {
11
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
+ }
13
+
14
+ $parcel$export(module.exports, "repeat", () => $65aafe8662d00781$export$76d90c956114f2c2);
15
+ $parcel$export(module.exports, "minmax", () => $65aafe8662d00781$export$9c1b655deaca4988);
16
+ $parcel$export(module.exports, "fitContent", () => $65aafe8662d00781$export$2f0b47b0911ce698);
17
+ $parcel$export(module.exports, "Grid", () => $65aafe8662d00781$export$ef2184bd89960b14);
18
+ /*
19
+ * Copyright 2020 Adobe. All rights reserved.
20
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
+ * you may not use this file except in compliance with the License. You may obtain a copy
22
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
+ *
24
+ * Unless required by applicable law or agreed to in writing, software distributed under
25
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
+ * OF ANY KIND, either express or implied. See the License for the specific language
27
+ * governing permissions and limitations under the License.
28
+ */
29
+
30
+
31
+ const $65aafe8662d00781$var$gridStyleProps = {
32
+ ...(0, $ATZAs$reactspectrumutils.baseStyleProps),
33
+ autoFlow: [
34
+ "gridAutoFlow",
35
+ (0, $ATZAs$reactspectrumutils.passthroughStyle)
36
+ ],
37
+ autoColumns: [
38
+ "gridAutoColumns",
39
+ $65aafe8662d00781$var$gridDimensionValue
40
+ ],
41
+ autoRows: [
42
+ "gridAutoRows",
43
+ $65aafe8662d00781$var$gridDimensionValue
44
+ ],
45
+ areas: [
46
+ "gridTemplateAreas",
47
+ $65aafe8662d00781$var$gridTemplateAreasValue
48
+ ],
49
+ columns: [
50
+ "gridTemplateColumns",
51
+ $65aafe8662d00781$var$gridTemplateValue
52
+ ],
53
+ rows: [
54
+ "gridTemplateRows",
55
+ $65aafe8662d00781$var$gridTemplateValue
56
+ ],
57
+ gap: [
58
+ "gap",
59
+ (0, $ATZAs$reactspectrumutils.dimensionValue)
60
+ ],
61
+ rowGap: [
62
+ "rowGap",
63
+ (0, $ATZAs$reactspectrumutils.dimensionValue)
64
+ ],
65
+ columnGap: [
66
+ "columnGap",
67
+ (0, $ATZAs$reactspectrumutils.dimensionValue)
68
+ ],
69
+ justifyItems: [
70
+ "justifyItems",
71
+ (0, $ATZAs$reactspectrumutils.passthroughStyle)
72
+ ],
73
+ justifyContent: [
74
+ "justifyContent",
75
+ (0, $ATZAs$reactspectrumutils.passthroughStyle)
76
+ ],
77
+ alignItems: [
78
+ "alignItems",
79
+ (0, $ATZAs$reactspectrumutils.passthroughStyle)
80
+ ],
81
+ alignContent: [
82
+ "alignContent",
83
+ (0, $ATZAs$reactspectrumutils.passthroughStyle)
84
+ ]
85
+ };
86
+ function $65aafe8662d00781$var$Grid(props, ref) {
87
+ let { children: children, ...otherProps } = props;
88
+ let { styleProps: styleProps } = (0, $ATZAs$reactspectrumutils.useStyleProps)(otherProps, $65aafe8662d00781$var$gridStyleProps);
89
+ styleProps.style.display = "grid"; // inline-grid?
90
+ let domRef = (0, $ATZAs$reactspectrumutils.useDOMRef)(ref);
91
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($ATZAs$react))).createElement("div", {
92
+ ...(0, $ATZAs$reactariautils.filterDOMProps)(otherProps),
93
+ ...styleProps,
94
+ ref: domRef
95
+ }, children);
96
+ }
97
+ function $65aafe8662d00781$export$76d90c956114f2c2(count, repeat) {
98
+ return `repeat(${count}, ${$65aafe8662d00781$var$gridTemplateValue(repeat)})`;
99
+ }
100
+ function $65aafe8662d00781$export$9c1b655deaca4988(min, max) {
101
+ return `minmax(${$65aafe8662d00781$var$gridDimensionValue(min)}, ${$65aafe8662d00781$var$gridDimensionValue(max)})`;
102
+ }
103
+ function $65aafe8662d00781$export$2f0b47b0911ce698(dimension) {
104
+ return `fit-content(${$65aafe8662d00781$var$gridDimensionValue(dimension)})`;
105
+ }
106
+ function $65aafe8662d00781$var$gridTemplateAreasValue(value) {
107
+ return value.map((v)=>`"${v}"`).join("\n");
108
+ }
109
+ function $65aafe8662d00781$var$gridDimensionValue(value) {
110
+ if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) return value;
111
+ return (0, $ATZAs$reactspectrumutils.dimensionValue)(value);
112
+ }
113
+ function $65aafe8662d00781$var$gridTemplateValue(value) {
114
+ if (Array.isArray(value)) return value.map($65aafe8662d00781$var$gridDimensionValue).join(" ");
115
+ return $65aafe8662d00781$var$gridDimensionValue(value);
116
+ }
117
+ /**
118
+ * A layout container using CSS grid. Supports Spectrum dimensions as values to
119
+ * ensure consistent and adaptive sizing and spacing.
120
+ */ const $65aafe8662d00781$export$ef2184bd89960b14 = /*#__PURE__*/ (0, $ATZAs$react.forwardRef)($65aafe8662d00781$var$Grid);
121
+
122
+
123
+ //# sourceMappingURL=Grid.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAeD,MAAM,uCAAgC;IACpC,GAAG,CAAA,GAAA,wCAAa,CAAC;IACjB,UAAU;QAAC;QAAgB,CAAA,GAAA,0CAAe;KAAE;IAC5C,aAAa;QAAC;QAAmB;KAAmB;IACpD,UAAU;QAAC;QAAgB;KAAmB;IAC9C,OAAO;QAAC;QAAqB;KAAuB;IACpD,SAAS;QAAC;QAAuB;KAAkB;IACnD,MAAM;QAAC;QAAoB;KAAkB;IAC7C,KAAK;QAAC;QAAO,CAAA,GAAA,wCAAa;KAAE;IAC5B,QAAQ;QAAC;QAAU,CAAA,GAAA,wCAAa;KAAE;IAClC,WAAW;QAAC;QAAa,CAAA,GAAA,wCAAa;KAAE;IACxC,cAAc;QAAC;QAAgB,CAAA,GAAA,0CAAe;KAAE;IAChD,gBAAgB;QAAC;QAAkB,CAAA,GAAA,0CAAe;KAAE;IACpD,YAAY;QAAC;QAAc,CAAA,GAAA,0CAAe;KAAE;IAC5C,cAAc;QAAC;QAAgB,CAAA,GAAA,0CAAe;KAAE;AAClD;AAEA,SAAS,2BAAK,KAAgB,EAAE,GAA2B;IACzD,IAAI,YACF,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE,YAAY;IAC7C,WAAW,KAAK,CAAC,OAAO,GAAG,QAAQ,eAAe;IAClD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,0DAAC;QAAK,GAAG,CAAA,GAAA,oCAAa,EAAE,WAAW;QAAG,GAAG,UAAU;QAAE,KAAK;OACvD;AAGP;AAQO,SAAS,0CAAO,KAAwC,EAAE,MAAyC;IACxG,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,wCAAkB,QAAQ,CAAC,CAAC;AACzD;AAQO,SAAS,0CAAO,GAAmB,EAAE,GAAmB;IAC7D,OAAO,CAAC,OAAO,EAAE,yCAAmB,KAAK,EAAE,EAAE,yCAAmB,KAAK,CAAC,CAAC;AACzE;AAOO,SAAS,0CAAW,SAAyB;IAClD,OAAO,CAAC,YAAY,EAAE,yCAAmB,WAAW,CAAC,CAAC;AACxD;AAEA,SAAS,6CAAuB,KAAK;IACnC,OAAO,MAAM,GAAG,CAAC,CAAA,IAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;AACvC;AAEA,SAAS,yCAAmB,KAAK;IAC/B,IAAI,kEAAkE,IAAI,CAAC,QACzE,OAAO;IAGT,OAAO,CAAA,GAAA,wCAAa,EAAE;AACxB;AAEA,SAAS,wCAAkB,KAAK;IAC9B,IAAI,MAAM,OAAO,CAAC,QAChB,OAAO,MAAM,GAAG,CAAC,0CAAoB,IAAI,CAAC;IAG5C,OAAO,yCAAmB;AAC5B;AAEA;;;CAGC,GACD,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/layout/src/Grid.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 {\n baseStyleProps,\n dimensionValue,\n passthroughStyle,\n StyleHandlers,\n useDOMRef,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {DimensionValue, DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {GridProps} from '@react-types/layout';\nimport React, {forwardRef} from 'react';\n\nconst gridStyleProps: StyleHandlers = {\n ...baseStyleProps,\n autoFlow: ['gridAutoFlow', passthroughStyle],\n autoColumns: ['gridAutoColumns', gridDimensionValue],\n autoRows: ['gridAutoRows', gridDimensionValue],\n areas: ['gridTemplateAreas', gridTemplateAreasValue],\n columns: ['gridTemplateColumns', gridTemplateValue],\n rows: ['gridTemplateRows', gridTemplateValue],\n gap: ['gap', dimensionValue],\n rowGap: ['rowGap', dimensionValue],\n columnGap: ['columnGap', dimensionValue],\n justifyItems: ['justifyItems', passthroughStyle],\n justifyContent: ['justifyContent', passthroughStyle],\n alignItems: ['alignItems', passthroughStyle],\n alignContent: ['alignContent', passthroughStyle]\n};\n\nfunction Grid(props: GridProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps, gridStyleProps);\n styleProps.style.display = 'grid'; // inline-grid?\n let domRef = useDOMRef(ref);\n\n return (\n <div {...filterDOMProps(otherProps)} {...styleProps} ref={domRef}>\n {children}\n </div>\n );\n}\n\n/**\n * Can be used to make a repeating fragment of the columns or rows list.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/repeat).\n * @param count - The number of times to repeat the fragment.\n * @param repeat - The fragment to repeat.\n */\nexport function repeat(count: number | 'auto-fill' | 'auto-fit', repeat: DimensionValue | DimensionValue[]): string {\n return `repeat(${count}, ${gridTemplateValue(repeat)})`;\n}\n\n/**\n * Defines a size range greater than or equal to min and less than or equal to max.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/minmax).\n * @param min - The minimum size.\n * @param max - The maximum size.\n */\nexport function minmax(min: DimensionValue, max: DimensionValue): string {\n return `minmax(${gridDimensionValue(min)}, ${gridDimensionValue(max)})`;\n}\n\n/**\n * Clamps a given size to an available size.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content).\n * @param dimension - The size to clamp.\n */\nexport function fitContent(dimension: DimensionValue): string {\n return `fit-content(${gridDimensionValue(dimension)})`;\n}\n\nfunction gridTemplateAreasValue(value) {\n return value.map(v => `\"${v}\"`).join('\\n');\n}\n\nfunction gridDimensionValue(value) {\n if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) {\n return value;\n }\n\n return dimensionValue(value);\n}\n\nfunction gridTemplateValue(value) {\n if (Array.isArray(value)) {\n return value.map(gridDimensionValue).join(' ');\n }\n\n return gridDimensionValue(value);\n}\n\n/**\n * A layout container using CSS grid. Supports Spectrum dimensions as values to\n * ensure consistent and adaptive sizing and spacing.\n */\nconst _Grid = forwardRef(Grid);\nexport {_Grid as Grid};\n"],"names":[],"version":3,"file":"Grid.main.js.map"}
package/dist/Grid.mjs ADDED
@@ -0,0 +1,111 @@
1
+ import {baseStyleProps as $2XVCg$baseStyleProps, passthroughStyle as $2XVCg$passthroughStyle, dimensionValue as $2XVCg$dimensionValue, useStyleProps as $2XVCg$useStyleProps, useDOMRef as $2XVCg$useDOMRef} from "@react-spectrum/utils";
2
+ import {filterDOMProps as $2XVCg$filterDOMProps} from "@react-aria/utils";
3
+ import $2XVCg$react, {forwardRef as $2XVCg$forwardRef} from "react";
4
+
5
+ /*
6
+ * Copyright 2020 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */
16
+
17
+
18
+ const $994c48bfb00b620b$var$gridStyleProps = {
19
+ ...(0, $2XVCg$baseStyleProps),
20
+ autoFlow: [
21
+ "gridAutoFlow",
22
+ (0, $2XVCg$passthroughStyle)
23
+ ],
24
+ autoColumns: [
25
+ "gridAutoColumns",
26
+ $994c48bfb00b620b$var$gridDimensionValue
27
+ ],
28
+ autoRows: [
29
+ "gridAutoRows",
30
+ $994c48bfb00b620b$var$gridDimensionValue
31
+ ],
32
+ areas: [
33
+ "gridTemplateAreas",
34
+ $994c48bfb00b620b$var$gridTemplateAreasValue
35
+ ],
36
+ columns: [
37
+ "gridTemplateColumns",
38
+ $994c48bfb00b620b$var$gridTemplateValue
39
+ ],
40
+ rows: [
41
+ "gridTemplateRows",
42
+ $994c48bfb00b620b$var$gridTemplateValue
43
+ ],
44
+ gap: [
45
+ "gap",
46
+ (0, $2XVCg$dimensionValue)
47
+ ],
48
+ rowGap: [
49
+ "rowGap",
50
+ (0, $2XVCg$dimensionValue)
51
+ ],
52
+ columnGap: [
53
+ "columnGap",
54
+ (0, $2XVCg$dimensionValue)
55
+ ],
56
+ justifyItems: [
57
+ "justifyItems",
58
+ (0, $2XVCg$passthroughStyle)
59
+ ],
60
+ justifyContent: [
61
+ "justifyContent",
62
+ (0, $2XVCg$passthroughStyle)
63
+ ],
64
+ alignItems: [
65
+ "alignItems",
66
+ (0, $2XVCg$passthroughStyle)
67
+ ],
68
+ alignContent: [
69
+ "alignContent",
70
+ (0, $2XVCg$passthroughStyle)
71
+ ]
72
+ };
73
+ function $994c48bfb00b620b$var$Grid(props, ref) {
74
+ let { children: children, ...otherProps } = props;
75
+ let { styleProps: styleProps } = (0, $2XVCg$useStyleProps)(otherProps, $994c48bfb00b620b$var$gridStyleProps);
76
+ styleProps.style.display = "grid"; // inline-grid?
77
+ let domRef = (0, $2XVCg$useDOMRef)(ref);
78
+ return /*#__PURE__*/ (0, $2XVCg$react).createElement("div", {
79
+ ...(0, $2XVCg$filterDOMProps)(otherProps),
80
+ ...styleProps,
81
+ ref: domRef
82
+ }, children);
83
+ }
84
+ function $994c48bfb00b620b$export$76d90c956114f2c2(count, repeat) {
85
+ return `repeat(${count}, ${$994c48bfb00b620b$var$gridTemplateValue(repeat)})`;
86
+ }
87
+ function $994c48bfb00b620b$export$9c1b655deaca4988(min, max) {
88
+ return `minmax(${$994c48bfb00b620b$var$gridDimensionValue(min)}, ${$994c48bfb00b620b$var$gridDimensionValue(max)})`;
89
+ }
90
+ function $994c48bfb00b620b$export$2f0b47b0911ce698(dimension) {
91
+ return `fit-content(${$994c48bfb00b620b$var$gridDimensionValue(dimension)})`;
92
+ }
93
+ function $994c48bfb00b620b$var$gridTemplateAreasValue(value) {
94
+ return value.map((v)=>`"${v}"`).join("\n");
95
+ }
96
+ function $994c48bfb00b620b$var$gridDimensionValue(value) {
97
+ if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) return value;
98
+ return (0, $2XVCg$dimensionValue)(value);
99
+ }
100
+ function $994c48bfb00b620b$var$gridTemplateValue(value) {
101
+ if (Array.isArray(value)) return value.map($994c48bfb00b620b$var$gridDimensionValue).join(" ");
102
+ return $994c48bfb00b620b$var$gridDimensionValue(value);
103
+ }
104
+ /**
105
+ * A layout container using CSS grid. Supports Spectrum dimensions as values to
106
+ * ensure consistent and adaptive sizing and spacing.
107
+ */ const $994c48bfb00b620b$export$ef2184bd89960b14 = /*#__PURE__*/ (0, $2XVCg$forwardRef)($994c48bfb00b620b$var$Grid);
108
+
109
+
110
+ export {$994c48bfb00b620b$export$76d90c956114f2c2 as repeat, $994c48bfb00b620b$export$9c1b655deaca4988 as minmax, $994c48bfb00b620b$export$2f0b47b0911ce698 as fitContent, $994c48bfb00b620b$export$ef2184bd89960b14 as Grid};
111
+ //# sourceMappingURL=Grid.mjs.map
@@ -0,0 +1,111 @@
1
+ import {baseStyleProps as $2XVCg$baseStyleProps, passthroughStyle as $2XVCg$passthroughStyle, dimensionValue as $2XVCg$dimensionValue, useStyleProps as $2XVCg$useStyleProps, useDOMRef as $2XVCg$useDOMRef} from "@react-spectrum/utils";
2
+ import {filterDOMProps as $2XVCg$filterDOMProps} from "@react-aria/utils";
3
+ import $2XVCg$react, {forwardRef as $2XVCg$forwardRef} from "react";
4
+
5
+ /*
6
+ * Copyright 2020 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */
16
+
17
+
18
+ const $994c48bfb00b620b$var$gridStyleProps = {
19
+ ...(0, $2XVCg$baseStyleProps),
20
+ autoFlow: [
21
+ "gridAutoFlow",
22
+ (0, $2XVCg$passthroughStyle)
23
+ ],
24
+ autoColumns: [
25
+ "gridAutoColumns",
26
+ $994c48bfb00b620b$var$gridDimensionValue
27
+ ],
28
+ autoRows: [
29
+ "gridAutoRows",
30
+ $994c48bfb00b620b$var$gridDimensionValue
31
+ ],
32
+ areas: [
33
+ "gridTemplateAreas",
34
+ $994c48bfb00b620b$var$gridTemplateAreasValue
35
+ ],
36
+ columns: [
37
+ "gridTemplateColumns",
38
+ $994c48bfb00b620b$var$gridTemplateValue
39
+ ],
40
+ rows: [
41
+ "gridTemplateRows",
42
+ $994c48bfb00b620b$var$gridTemplateValue
43
+ ],
44
+ gap: [
45
+ "gap",
46
+ (0, $2XVCg$dimensionValue)
47
+ ],
48
+ rowGap: [
49
+ "rowGap",
50
+ (0, $2XVCg$dimensionValue)
51
+ ],
52
+ columnGap: [
53
+ "columnGap",
54
+ (0, $2XVCg$dimensionValue)
55
+ ],
56
+ justifyItems: [
57
+ "justifyItems",
58
+ (0, $2XVCg$passthroughStyle)
59
+ ],
60
+ justifyContent: [
61
+ "justifyContent",
62
+ (0, $2XVCg$passthroughStyle)
63
+ ],
64
+ alignItems: [
65
+ "alignItems",
66
+ (0, $2XVCg$passthroughStyle)
67
+ ],
68
+ alignContent: [
69
+ "alignContent",
70
+ (0, $2XVCg$passthroughStyle)
71
+ ]
72
+ };
73
+ function $994c48bfb00b620b$var$Grid(props, ref) {
74
+ let { children: children, ...otherProps } = props;
75
+ let { styleProps: styleProps } = (0, $2XVCg$useStyleProps)(otherProps, $994c48bfb00b620b$var$gridStyleProps);
76
+ styleProps.style.display = "grid"; // inline-grid?
77
+ let domRef = (0, $2XVCg$useDOMRef)(ref);
78
+ return /*#__PURE__*/ (0, $2XVCg$react).createElement("div", {
79
+ ...(0, $2XVCg$filterDOMProps)(otherProps),
80
+ ...styleProps,
81
+ ref: domRef
82
+ }, children);
83
+ }
84
+ function $994c48bfb00b620b$export$76d90c956114f2c2(count, repeat) {
85
+ return `repeat(${count}, ${$994c48bfb00b620b$var$gridTemplateValue(repeat)})`;
86
+ }
87
+ function $994c48bfb00b620b$export$9c1b655deaca4988(min, max) {
88
+ return `minmax(${$994c48bfb00b620b$var$gridDimensionValue(min)}, ${$994c48bfb00b620b$var$gridDimensionValue(max)})`;
89
+ }
90
+ function $994c48bfb00b620b$export$2f0b47b0911ce698(dimension) {
91
+ return `fit-content(${$994c48bfb00b620b$var$gridDimensionValue(dimension)})`;
92
+ }
93
+ function $994c48bfb00b620b$var$gridTemplateAreasValue(value) {
94
+ return value.map((v)=>`"${v}"`).join("\n");
95
+ }
96
+ function $994c48bfb00b620b$var$gridDimensionValue(value) {
97
+ if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) return value;
98
+ return (0, $2XVCg$dimensionValue)(value);
99
+ }
100
+ function $994c48bfb00b620b$var$gridTemplateValue(value) {
101
+ if (Array.isArray(value)) return value.map($994c48bfb00b620b$var$gridDimensionValue).join(" ");
102
+ return $994c48bfb00b620b$var$gridDimensionValue(value);
103
+ }
104
+ /**
105
+ * A layout container using CSS grid. Supports Spectrum dimensions as values to
106
+ * ensure consistent and adaptive sizing and spacing.
107
+ */ const $994c48bfb00b620b$export$ef2184bd89960b14 = /*#__PURE__*/ (0, $2XVCg$forwardRef)($994c48bfb00b620b$var$Grid);
108
+
109
+
110
+ export {$994c48bfb00b620b$export$76d90c956114f2c2 as repeat, $994c48bfb00b620b$export$9c1b655deaca4988 as minmax, $994c48bfb00b620b$export$2f0b47b0911ce698 as fitContent, $994c48bfb00b620b$export$ef2184bd89960b14 as Grid};
111
+ //# sourceMappingURL=Grid.module.js.map