@react-spectrum/layout 3.6.22 → 3.7.0

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/import.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import {fitContent as $994c48bfb00b620b$export$2f0b47b0911ce698, Grid as $994c48bfb00b620b$export$ef2184bd89960b14, minmax as $994c48bfb00b620b$export$9c1b655deaca4988, repeat as $994c48bfb00b620b$export$76d90c956114f2c2} from "./Grid.mjs";
2
- import {Flex as $884c64d19340d345$export$f51f4c4ede09e011} from "./Flex.mjs";
1
+ import {repeat as $ae8425e94ffaa32a$re_export$repeat, minmax as $ae8425e94ffaa32a$re_export$minmax, fitContent as $ae8425e94ffaa32a$re_export$fitContent, Grid as $ae8425e94ffaa32a$re_export$Grid} from "@adobe/react-spectrum/Grid";
2
+ import {Flex as $ae8425e94ffaa32a$re_export$Flex} from "@adobe/react-spectrum/Flex";
3
3
 
4
4
  /*
5
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -16,5 +16,5 @@ import {Flex as $884c64d19340d345$export$f51f4c4ede09e011} from "./Flex.mjs";
16
16
 
17
17
 
18
18
 
19
- export {$994c48bfb00b620b$export$76d90c956114f2c2 as repeat, $994c48bfb00b620b$export$9c1b655deaca4988 as minmax, $994c48bfb00b620b$export$2f0b47b0911ce698 as fitContent, $994c48bfb00b620b$export$ef2184bd89960b14 as Grid, $884c64d19340d345$export$f51f4c4ede09e011 as Flex};
19
+ export {$ae8425e94ffaa32a$re_export$repeat as repeat, $ae8425e94ffaa32a$re_export$minmax as minmax, $ae8425e94ffaa32a$re_export$fitContent as fitContent, $ae8425e94ffaa32a$re_export$Grid as Grid, $ae8425e94ffaa32a$re_export$Flex as Flex};
20
20
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,16 +1,16 @@
1
- var $65aafe8662d00781$exports = require("./Grid.main.js");
2
- var $a2ef5497697e8437$exports = require("./Flex.main.js");
1
+ var $47bRu$adobereactspectrumGrid = require("@adobe/react-spectrum/Grid");
2
+ var $47bRu$adobereactspectrumFlex = require("@adobe/react-spectrum/Flex");
3
3
 
4
4
 
5
5
  function $parcel$export(e, n, v, s) {
6
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
7
  }
8
8
 
9
- $parcel$export(module.exports, "repeat", () => $65aafe8662d00781$exports.repeat);
10
- $parcel$export(module.exports, "minmax", () => $65aafe8662d00781$exports.minmax);
11
- $parcel$export(module.exports, "fitContent", () => $65aafe8662d00781$exports.fitContent);
12
- $parcel$export(module.exports, "Grid", () => $65aafe8662d00781$exports.Grid);
13
- $parcel$export(module.exports, "Flex", () => $a2ef5497697e8437$exports.Flex);
9
+ $parcel$export(module.exports, "repeat", function () { return $47bRu$adobereactspectrumGrid.repeat; });
10
+ $parcel$export(module.exports, "minmax", function () { return $47bRu$adobereactspectrumGrid.minmax; });
11
+ $parcel$export(module.exports, "fitContent", function () { return $47bRu$adobereactspectrumGrid.fitContent; });
12
+ $parcel$export(module.exports, "Grid", function () { return $47bRu$adobereactspectrumGrid.Grid; });
13
+ $parcel$export(module.exports, "Flex", function () { return $47bRu$adobereactspectrumFlex.Flex; });
14
14
  /*
15
15
  * Copyright 2020 Adobe. All rights reserved.
16
16
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/layout/src/index.ts"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {repeat, minmax, fitContent, Grid} from './Grid';\nexport {Flex} from './Flex';\nexport type {DimensionValue} from '@react-types/shared';\nexport type {FlexProps, GridProps} from '@react-types/layout';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/layout/src/index.ts"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {repeat, minmax, fitContent, Grid} from '@adobe/react-spectrum/Grid';\n\nexport {Flex} from '@adobe/react-spectrum/Flex';\nexport type {FlexProps} from '@adobe/react-spectrum/Flex';\nexport type {GridProps} from '@adobe/react-spectrum/Grid';\nexport type {DimensionValue} from '@react-types/shared';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,5 +1,5 @@
1
- import {fitContent as $994c48bfb00b620b$export$2f0b47b0911ce698, Grid as $994c48bfb00b620b$export$ef2184bd89960b14, minmax as $994c48bfb00b620b$export$9c1b655deaca4988, repeat as $994c48bfb00b620b$export$76d90c956114f2c2} from "./Grid.module.js";
2
- import {Flex as $884c64d19340d345$export$f51f4c4ede09e011} from "./Flex.module.js";
1
+ import {repeat as $ae8425e94ffaa32a$re_export$repeat, minmax as $ae8425e94ffaa32a$re_export$minmax, fitContent as $ae8425e94ffaa32a$re_export$fitContent, Grid as $ae8425e94ffaa32a$re_export$Grid} from "@adobe/react-spectrum/Grid";
2
+ import {Flex as $ae8425e94ffaa32a$re_export$Flex} from "@adobe/react-spectrum/Flex";
3
3
 
4
4
  /*
5
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -16,5 +16,5 @@ import {Flex as $884c64d19340d345$export$f51f4c4ede09e011} from "./Flex.module.j
16
16
 
17
17
 
18
18
 
19
- export {$994c48bfb00b620b$export$76d90c956114f2c2 as repeat, $994c48bfb00b620b$export$9c1b655deaca4988 as minmax, $994c48bfb00b620b$export$2f0b47b0911ce698 as fitContent, $994c48bfb00b620b$export$ef2184bd89960b14 as Grid, $884c64d19340d345$export$f51f4c4ede09e011 as Flex};
19
+ export {$ae8425e94ffaa32a$re_export$repeat as repeat, $ae8425e94ffaa32a$re_export$minmax as minmax, $ae8425e94ffaa32a$re_export$fitContent as fitContent, $ae8425e94ffaa32a$re_export$Grid as Grid, $ae8425e94ffaa32a$re_export$Flex as Flex};
20
20
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/layout/src/index.ts"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {repeat, minmax, fitContent, Grid} from './Grid';\nexport {Flex} from './Flex';\nexport type {DimensionValue} from '@react-types/shared';\nexport type {FlexProps, GridProps} from '@react-types/layout';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/layout/src/index.ts"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {repeat, minmax, fitContent, Grid} from '@adobe/react-spectrum/Grid';\n\nexport {Flex} from '@adobe/react-spectrum/Flex';\nexport type {FlexProps} from '@adobe/react-spectrum/Flex';\nexport type {GridProps} from '@adobe/react-spectrum/Grid';\nexport type {DimensionValue} from '@react-types/shared';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,5 @@
1
+ export { repeat, minmax, fitContent, Grid } from '@adobe/react-spectrum/Grid';
2
+ export { Flex } from '@adobe/react-spectrum/Flex';
3
+ export type { FlexProps } from '@adobe/react-spectrum/Flex';
4
+ export type { GridProps } from '@adobe/react-spectrum/Grid';
5
+ export type { DimensionValue } from '@react-types/shared';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-spectrum/layout",
3
- "version": "3.6.22",
3
+ "version": "3.7.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -24,38 +24,23 @@
24
24
  "*.css"
25
25
  ],
26
26
  "targets": {
27
- "main": {
28
- "includeNodeModules": [
29
- "@adobe/spectrum-css-temp"
30
- ]
31
- },
32
- "module": {
33
- "includeNodeModules": [
34
- "@adobe/spectrum-css-temp"
35
- ]
36
- }
27
+ "types": false
37
28
  },
38
29
  "repository": {
39
30
  "type": "git",
40
31
  "url": "https://github.com/adobe/react-spectrum"
41
32
  },
42
33
  "dependencies": {
43
- "@react-aria/utils": "^3.33.1",
44
- "@react-spectrum/utils": "^3.12.12",
45
- "@react-types/layout": "^3.3.29",
46
- "@react-types/shared": "^3.33.1",
34
+ "@adobe/react-spectrum": "3.47.0",
35
+ "@react-types/shared": "^3.34.0",
47
36
  "@swc/helpers": "^0.5.0"
48
37
  },
49
- "devDependencies": {
50
- "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
51
- },
52
38
  "peerDependencies": {
53
- "@react-spectrum/provider": "^3.0.0",
54
39
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
55
40
  "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
56
41
  },
57
42
  "publishConfig": {
58
43
  "access": "public"
59
44
  },
60
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
45
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
61
46
  }
package/src/index.ts CHANGED
@@ -12,7 +12,9 @@
12
12
 
13
13
  /// <reference types="css-module-types" />
14
14
 
15
- export {repeat, minmax, fitContent, Grid} from './Grid';
16
- export {Flex} from './Flex';
15
+ export {repeat, minmax, fitContent, Grid} from '@adobe/react-spectrum/Grid';
16
+
17
+ export {Flex} from '@adobe/react-spectrum/Flex';
18
+ export type {FlexProps} from '@adobe/react-spectrum/Flex';
19
+ export type {GridProps} from '@adobe/react-spectrum/Grid';
17
20
  export type {DimensionValue} from '@react-types/shared';
18
- export type {FlexProps, GridProps} from '@react-types/layout';
package/dist/Flex.main.js DELETED
@@ -1,92 +0,0 @@
1
- require("./layout.6b24b540.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
- const $a2ef5497697e8437$export$f51f4c4ede09e011 = /*#__PURE__*/ (0, $1yXrx$react.forwardRef)(function 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
-
92
- //# sourceMappingURL=Flex.main.js.map
@@ -1 +0,0 @@
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;AAMO,MAAM,0DAAO,CAAA,GAAA,uBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA2B;IACxF,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","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\n/**\n * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap\n * property to define consistent spacing between items.\n */\nexport const Flex = forwardRef(function 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"],"names":[],"version":3,"file":"Flex.main.js.map"}
package/dist/Flex.mjs DELETED
@@ -1,87 +0,0 @@
1
- import "./layout.6b24b540.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
- const $884c64d19340d345$export$f51f4c4ede09e011 = /*#__PURE__*/ (0, $bDezp$forwardRef)(function 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
-
86
- export {$884c64d19340d345$export$f51f4c4ede09e011 as Flex};
87
- //# sourceMappingURL=Flex.module.js.map
@@ -1,87 +0,0 @@
1
- import "./layout.6b24b540.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
- const $884c64d19340d345$export$f51f4c4ede09e011 = /*#__PURE__*/ (0, $bDezp$forwardRef)(function 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
-
86
- export {$884c64d19340d345$export$f51f4c4ede09e011 as Flex};
87
- //# sourceMappingURL=Flex.module.js.map
@@ -1 +0,0 @@
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;AAMO,MAAM,0DAAO,CAAA,GAAA,iBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA2B;IACxF,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","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\n/**\n * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap\n * property to define consistent spacing between items.\n */\nexport const Flex = forwardRef(function 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"],"names":[],"version":3,"file":"Flex.module.js.map"}
package/dist/Grid.main.js DELETED
@@ -1,119 +0,0 @@
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, "Grid", () => $65aafe8662d00781$export$ef2184bd89960b14);
15
- $parcel$export(module.exports, "repeat", () => $65aafe8662d00781$export$76d90c956114f2c2);
16
- $parcel$export(module.exports, "minmax", () => $65aafe8662d00781$export$9c1b655deaca4988);
17
- $parcel$export(module.exports, "fitContent", () => $65aafe8662d00781$export$2f0b47b0911ce698);
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
- const $65aafe8662d00781$export$ef2184bd89960b14 = /*#__PURE__*/ (0, $ATZAs$react.forwardRef)(function Grid(props, ref) {
87
- let { children: children, ...otherProps } = props;
88
- let { styleProps: styleProps } = (0, $ATZAs$reactspectrumutils.useStyleProps)(otherProps, $65aafe8662d00781$var$gridStyleProps);
89
- if (styleProps.style) 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
-
119
- //# sourceMappingURL=Grid.main.js.map
@@ -1 +0,0 @@
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;AAMO,MAAM,0DAAO,CAAA,GAAA,uBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA2B;IACxF,IAAI,YACF,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE,YAAY;IAC7C,IAAI,WAAW,KAAK,EAClB,WAAW,KAAK,CAAC,OAAO,GAAG,QAAQ,eAAe;IAEpD,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","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\n/**\n * A layout container using CSS grid. Supports Spectrum dimensions as values to\n * ensure consistent and adaptive sizing and spacing.\n */\nexport const Grid = forwardRef(function Grid(props: GridProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps, gridStyleProps);\n if (styleProps.style) {\n styleProps.style.display = 'grid'; // inline-grid?\n }\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"],"names":[],"version":3,"file":"Grid.main.js.map"}
package/dist/Grid.mjs DELETED
@@ -1,107 +0,0 @@
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
- const $994c48bfb00b620b$export$ef2184bd89960b14 = /*#__PURE__*/ (0, $2XVCg$forwardRef)(function Grid(props, ref) {
74
- let { children: children, ...otherProps } = props;
75
- let { styleProps: styleProps } = (0, $2XVCg$useStyleProps)(otherProps, $994c48bfb00b620b$var$gridStyleProps);
76
- if (styleProps.style) 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
-
106
- export {$994c48bfb00b620b$export$ef2184bd89960b14 as Grid, $994c48bfb00b620b$export$76d90c956114f2c2 as repeat, $994c48bfb00b620b$export$9c1b655deaca4988 as minmax, $994c48bfb00b620b$export$2f0b47b0911ce698 as fitContent};
107
- //# sourceMappingURL=Grid.module.js.map
@@ -1,107 +0,0 @@
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
- const $994c48bfb00b620b$export$ef2184bd89960b14 = /*#__PURE__*/ (0, $2XVCg$forwardRef)(function Grid(props, ref) {
74
- let { children: children, ...otherProps } = props;
75
- let { styleProps: styleProps } = (0, $2XVCg$useStyleProps)(otherProps, $994c48bfb00b620b$var$gridStyleProps);
76
- if (styleProps.style) 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
-
106
- export {$994c48bfb00b620b$export$ef2184bd89960b14 as Grid, $994c48bfb00b620b$export$76d90c956114f2c2 as repeat, $994c48bfb00b620b$export$9c1b655deaca4988 as minmax, $994c48bfb00b620b$export$2f0b47b0911ce698 as fitContent};
107
- //# sourceMappingURL=Grid.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAeD,MAAM,uCAAgC;IACpC,GAAG,CAAA,GAAA,qBAAa,CAAC;IACjB,UAAU;QAAC;QAAgB,CAAA,GAAA,uBAAe;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,qBAAa;KAAE;IAC5B,QAAQ;QAAC;QAAU,CAAA,GAAA,qBAAa;KAAE;IAClC,WAAW;QAAC;QAAa,CAAA,GAAA,qBAAa;KAAE;IACxC,cAAc;QAAC;QAAgB,CAAA,GAAA,uBAAe;KAAE;IAChD,gBAAgB;QAAC;QAAkB,CAAA,GAAA,uBAAe;KAAE;IACpD,YAAY;QAAC;QAAc,CAAA,GAAA,uBAAe;KAAE;IAC5C,cAAc;QAAC;QAAgB,CAAA,GAAA,uBAAe;KAAE;AAClD;AAMO,MAAM,0DAAO,CAAA,GAAA,iBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA2B;IACxF,IAAI,YACF,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE,YAAY;IAC7C,IAAI,WAAW,KAAK,EAClB,WAAW,KAAK,CAAC,OAAO,GAAG,QAAQ,eAAe;IAEpD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gCAAC;QAAK,GAAG,CAAA,GAAA,qBAAa,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,qBAAa,EAAE;AACxB;AAEA,SAAS,wCAAkB,KAAK;IAC9B,IAAI,MAAM,OAAO,CAAC,QAChB,OAAO,MAAM,GAAG,CAAC,0CAAoB,IAAI,CAAC;IAG5C,OAAO,yCAAmB;AAC5B","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\n/**\n * A layout container using CSS grid. Supports Spectrum dimensions as values to\n * ensure consistent and adaptive sizing and spacing.\n */\nexport const Grid = forwardRef(function Grid(props: GridProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps, gridStyleProps);\n if (styleProps.style) {\n styleProps.style.display = 'grid'; // inline-grid?\n }\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"],"names":[],"version":3,"file":"Grid.module.js.map"}
@@ -1,17 +0,0 @@
1
-
2
- function $parcel$export(e, n, v, s) {
3
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
- }
5
-
6
- $parcel$export(module.exports, "flex", () => $12be0ef8be5abc46$export$97691fbb80847c19, (v) => $12be0ef8be5abc46$export$97691fbb80847c19 = v);
7
- $parcel$export(module.exports, "flex-container", () => $12be0ef8be5abc46$export$69d7a39fa31a000b, (v) => $12be0ef8be5abc46$export$69d7a39fa31a000b = v);
8
- $parcel$export(module.exports, "flex-gap", () => $12be0ef8be5abc46$export$31a9da8b58047a44, (v) => $12be0ef8be5abc46$export$31a9da8b58047a44 = v);
9
- var $12be0ef8be5abc46$export$97691fbb80847c19;
10
- var $12be0ef8be5abc46$export$69d7a39fa31a000b;
11
- var $12be0ef8be5abc46$export$31a9da8b58047a44;
12
- $12be0ef8be5abc46$export$97691fbb80847c19 = `vi3c6W_flex`;
13
- $12be0ef8be5abc46$export$69d7a39fa31a000b = `vi3c6W_flex-container`;
14
- $12be0ef8be5abc46$export$31a9da8b58047a44 = `vi3c6W_flex-gap`;
15
-
16
-
17
- //# sourceMappingURL=flex-gap_css.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AAFA,4CAAyB,CAAC,WAAW,CAAC;AACtC,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA6B,CAAC,eAAe,CAAC","sources":["packages/@react-spectrum/layout/src/flex-gap.css"],"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\n.flex-container {\n /* this is necessary so that the inner margins don't affect anything outside */\n display: flex;\n}\n\n.flex {\n display: flex;\n}\n\n.flex-gap {\n --gap: 0px;\n --column-gap: var(--gap);\n --row-gap: var(--gap);\n\n /* apply a negative margin to counteract the margin on each item at the edges */\n margin: calc(var(--row-gap) / -2) calc(var(--column-gap) / -2);\n\n /* increase the width and height to account for this margin */\n /* Add 1px to fix rounding error in Safari (╯°□°)╯︵ ┻━┻ */\n width: calc(100% + calc(var(--column-gap) + 1px));\n height: calc(100% + var(--row-gap));\n}\n\n/* If the selector was .flex-gap > *, it wouldn't override when components have a margin 0 specified by a single\n * class selector, specificity is equal. Both are one class. Neither > nor * contribute to specificity.\n * We need to make it more specific, so we raise it by 1 class.\n */\n.flex-container .flex-gap > * {\n /* apply half of the gap to each side of every item */\n margin: calc(var(--row-gap) / 2) calc(var(--column-gap) / 2);\n}\n"],"names":[],"version":3,"file":"flex-gap_css.main.js.map"}
@@ -1,19 +0,0 @@
1
-
2
- function $parcel$export(e, n, v, s) {
3
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
- }
5
- var $01dd1839b5376a46$exports = {};
6
-
7
- $parcel$export($01dd1839b5376a46$exports, "flex", () => $01dd1839b5376a46$export$97691fbb80847c19, (v) => $01dd1839b5376a46$export$97691fbb80847c19 = v);
8
- $parcel$export($01dd1839b5376a46$exports, "flex-container", () => $01dd1839b5376a46$export$69d7a39fa31a000b, (v) => $01dd1839b5376a46$export$69d7a39fa31a000b = v);
9
- $parcel$export($01dd1839b5376a46$exports, "flex-gap", () => $01dd1839b5376a46$export$31a9da8b58047a44, (v) => $01dd1839b5376a46$export$31a9da8b58047a44 = v);
10
- var $01dd1839b5376a46$export$97691fbb80847c19;
11
- var $01dd1839b5376a46$export$69d7a39fa31a000b;
12
- var $01dd1839b5376a46$export$31a9da8b58047a44;
13
- $01dd1839b5376a46$export$97691fbb80847c19 = `vi3c6W_flex`;
14
- $01dd1839b5376a46$export$69d7a39fa31a000b = `vi3c6W_flex-container`;
15
- $01dd1839b5376a46$export$31a9da8b58047a44 = `vi3c6W_flex-gap`;
16
-
17
-
18
- export {$01dd1839b5376a46$exports as default};
19
- //# sourceMappingURL=flex-gap_css.module.js.map
@@ -1,19 +0,0 @@
1
-
2
- function $parcel$export(e, n, v, s) {
3
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
- }
5
- var $01dd1839b5376a46$exports = {};
6
-
7
- $parcel$export($01dd1839b5376a46$exports, "flex", () => $01dd1839b5376a46$export$97691fbb80847c19, (v) => $01dd1839b5376a46$export$97691fbb80847c19 = v);
8
- $parcel$export($01dd1839b5376a46$exports, "flex-container", () => $01dd1839b5376a46$export$69d7a39fa31a000b, (v) => $01dd1839b5376a46$export$69d7a39fa31a000b = v);
9
- $parcel$export($01dd1839b5376a46$exports, "flex-gap", () => $01dd1839b5376a46$export$31a9da8b58047a44, (v) => $01dd1839b5376a46$export$31a9da8b58047a44 = v);
10
- var $01dd1839b5376a46$export$97691fbb80847c19;
11
- var $01dd1839b5376a46$export$69d7a39fa31a000b;
12
- var $01dd1839b5376a46$export$31a9da8b58047a44;
13
- $01dd1839b5376a46$export$97691fbb80847c19 = `vi3c6W_flex`;
14
- $01dd1839b5376a46$export$69d7a39fa31a000b = `vi3c6W_flex-container`;
15
- $01dd1839b5376a46$export$31a9da8b58047a44 = `vi3c6W_flex-gap`;
16
-
17
-
18
- export {$01dd1839b5376a46$exports as default};
19
- //# sourceMappingURL=flex-gap_css.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AAFA,4CAAyB,CAAC,WAAW,CAAC;AACtC,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA6B,CAAC,eAAe,CAAC","sources":["packages/@react-spectrum/layout/src/flex-gap.css"],"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\n.flex-container {\n /* this is necessary so that the inner margins don't affect anything outside */\n display: flex;\n}\n\n.flex {\n display: flex;\n}\n\n.flex-gap {\n --gap: 0px;\n --column-gap: var(--gap);\n --row-gap: var(--gap);\n\n /* apply a negative margin to counteract the margin on each item at the edges */\n margin: calc(var(--row-gap) / -2) calc(var(--column-gap) / -2);\n\n /* increase the width and height to account for this margin */\n /* Add 1px to fix rounding error in Safari (╯°□°)╯︵ ┻━┻ */\n width: calc(100% + calc(var(--column-gap) + 1px));\n height: calc(100% + var(--row-gap));\n}\n\n/* If the selector was .flex-gap > *, it wouldn't override when components have a margin 0 specified by a single\n * class selector, specificity is equal. Both are one class. Neither > nor * contribute to specificity.\n * We need to make it more specific, so we raise it by 1 class.\n */\n.flex-container .flex-gap > * {\n /* apply half of the gap to each side of every item */\n margin: calc(var(--row-gap) / 2) calc(var(--column-gap) / 2);\n}\n"],"names":[],"version":3,"file":"flex-gap_css.module.js.map"}
@@ -1,17 +0,0 @@
1
- .vi3c6W_flex-container, .vi3c6W_flex {
2
- display: flex;
3
- }
4
-
5
- .vi3c6W_flex-gap {
6
- --gap: 0px;
7
- --column-gap: var(--gap);
8
- --row-gap: var(--gap);
9
- margin: calc(var(--row-gap) / -2) calc(var(--column-gap) / -2);
10
- width: calc(100% + calc(var(--column-gap) + 1px));
11
- height: calc(100% + var(--row-gap));
12
- }
13
-
14
- .vi3c6W_flex-container .vi3c6W_flex-gap > * {
15
- margin: calc(var(--row-gap) / 2) calc(var(--column-gap) / 2);
16
- }
17
- /*# sourceMappingURL=layout.6b24b540.css.map */
@@ -1 +0,0 @@
1
- {"mappings":"AAYA;;;;AASA;;;;;;;;;AAmBA","sources":["packages/@react-spectrum/layout/src/flex-gap.css"],"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\n.flex-container {\n /* this is necessary so that the inner margins don't affect anything outside */\n display: flex;\n}\n\n.flex {\n display: flex;\n}\n\n.flex-gap {\n --gap: 0px;\n --column-gap: var(--gap);\n --row-gap: var(--gap);\n\n /* apply a negative margin to counteract the margin on each item at the edges */\n margin: calc(var(--row-gap) / -2) calc(var(--column-gap) / -2);\n\n /* increase the width and height to account for this margin */\n /* Add 1px to fix rounding error in Safari (╯°□°)╯︵ ┻━┻ */\n width: calc(100% + calc(var(--column-gap) + 1px));\n height: calc(100% + var(--row-gap));\n}\n\n/* If the selector was .flex-gap > *, it wouldn't override when components have a margin 0 specified by a single\n * class selector, specificity is equal. Both are one class. Neither > nor * contribute to specificity.\n * We need to make it more specific, so we raise it by 1 class.\n */\n.flex-container .flex-gap > * {\n /* apply half of the gap to each side of every item */\n margin: calc(var(--row-gap) / 2) calc(var(--column-gap) / 2);\n}\n"],"names":[],"version":3,"file":"layout.6b24b540.css.map"}
package/dist/types.d.ts DELETED
@@ -1,37 +0,0 @@
1
- import { DimensionValue, DOMRefValue } from "@react-types/shared";
2
- import { GridProps, FlexProps } from "@react-types/layout";
3
- import React from "react";
4
- /**
5
- * A layout container using CSS grid. Supports Spectrum dimensions as values to
6
- * ensure consistent and adaptive sizing and spacing.
7
- */
8
- export const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<DOMRefValue<HTMLDivElement>>>;
9
- /**
10
- * Can be used to make a repeating fragment of the columns or rows list.
11
- * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/repeat).
12
- * @param count - The number of times to repeat the fragment.
13
- * @param repeat - The fragment to repeat.
14
- */
15
- export function repeat(count: number | 'auto-fill' | 'auto-fit', repeat: DimensionValue | DimensionValue[]): string;
16
- /**
17
- * Defines a size range greater than or equal to min and less than or equal to max.
18
- * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/minmax).
19
- * @param min - The minimum size.
20
- * @param max - The maximum size.
21
- */
22
- export function minmax(min: DimensionValue, max: DimensionValue): string;
23
- /**
24
- * Clamps a given size to an available size.
25
- * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content).
26
- * @param dimension - The size to clamp.
27
- */
28
- export function fitContent(dimension: DimensionValue): string;
29
- /**
30
- * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap
31
- * property to define consistent spacing between items.
32
- */
33
- export const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<DOMRefValue<HTMLDivElement>>>;
34
- export type { DimensionValue } from '@react-types/shared';
35
- export type { FlexProps, GridProps } from '@react-types/layout';
36
-
37
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"mappings":";;;AA0CA;;;GAGG;AACH,OAAO,MAAM,mGAgBX,CAAC;AAEH;;;;;GAKG;AACH,uBAAuB,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,EAAE,QAAQ,cAAc,GAAG,cAAc,EAAE,GAAG,MAAM,CAElH;AAED;;;;;GAKG;AACH,uBAAuB,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,cAAc,GAAG,MAAM,CAEvE;AAED;;;;GAIG;AACH,2BAA2B,SAAS,EAAE,cAAc,GAAG,MAAM,CAE5D;AChED;;;GAGG;AACH,OAAO,MAAM,mGAiCX,CAAC;AChDH,YAAY,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-spectrum/layout/src/packages/@react-spectrum/layout/src/Grid.tsx","packages/@react-spectrum/layout/src/packages/@react-spectrum/layout/src/Flex.tsx","packages/@react-spectrum/layout/src/packages/@react-spectrum/layout/src/index.ts","packages/@react-spectrum/layout/src/index.ts"],"sourcesContent":[null,null,null,"/*\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\n/// <reference types=\"css-module-types\" />\n\nexport {repeat, minmax, fitContent, Grid} from './Grid';\nexport {Flex} from './Flex';\nexport type {DimensionValue} from '@react-types/shared';\nexport type {FlexProps, GridProps} from '@react-types/layout';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/src/Flex.tsx DELETED
@@ -1,92 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {classNames, passthroughStyle, responsiveDimensionValue, StyleHandlers, useBreakpoint, useDOMRef, useStyleProps} from '@react-spectrum/utils';
14
- import {DOMRef} from '@react-types/shared';
15
- import {filterDOMProps} from '@react-aria/utils';
16
- import {FlexProps} from '@react-types/layout';
17
- import React, {forwardRef} from 'react';
18
- import styles from './flex-gap.css';
19
-
20
- const flexStyleProps: StyleHandlers = {
21
- direction: ['flexDirection', passthroughStyle],
22
- wrap: ['flexWrap', flexWrapValue],
23
- justifyContent: ['justifyContent', flexAlignValue],
24
- alignItems: ['alignItems', flexAlignValue],
25
- alignContent: ['alignContent', flexAlignValue]
26
- };
27
-
28
- /**
29
- * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap
30
- * property to define consistent spacing between items.
31
- */
32
- export const Flex = forwardRef(function Flex(props: FlexProps, ref: DOMRef<HTMLDivElement>) {
33
- let {
34
- children,
35
- ...otherProps
36
- } = props;
37
- let breakpointProvider = useBreakpoint();
38
- let matchedBreakpoints = breakpointProvider?.matchedBreakpoints || ['base'];
39
- let {styleProps} = useStyleProps(otherProps);
40
- let {styleProps: flexStyle} = useStyleProps(otherProps, flexStyleProps);
41
- let domRef = useDOMRef(ref);
42
-
43
- let style = {
44
- ...styleProps.style,
45
- ...flexStyle.style
46
- };
47
-
48
- if (props.gap != null) {
49
- style.gap = responsiveDimensionValue(props.gap, matchedBreakpoints);
50
- }
51
-
52
- if (props.columnGap != null) {
53
- style.columnGap = responsiveDimensionValue(props.columnGap, matchedBreakpoints);
54
- }
55
-
56
- if (props.rowGap != null) {
57
- style.rowGap = responsiveDimensionValue(props.rowGap, matchedBreakpoints);
58
- }
59
-
60
- return (
61
- <div {...filterDOMProps(otherProps)} className={classNames(styles, 'flex', styleProps.className)} style={style} ref={domRef}>
62
- {children}
63
- </div>
64
- );
65
- });
66
-
67
- /**
68
- * Normalize 'start' and 'end' alignment values to 'flex-start' and 'flex-end'
69
- * in flex containers for browser compatibility.
70
- */
71
- function flexAlignValue(value) {
72
- if (value === 'start') {
73
- return 'flex-start';
74
- }
75
-
76
- if (value === 'end') {
77
- return 'flex-end';
78
- }
79
-
80
- return value;
81
- }
82
-
83
- /**
84
- * Takes a boolean and translates it to flex wrap or nowrap.
85
- */
86
- function flexWrapValue(value) {
87
- if (typeof value === 'boolean') {
88
- return value ? 'wrap' : 'nowrap';
89
- }
90
-
91
- return value;
92
- }
package/src/Grid.tsx DELETED
@@ -1,112 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {
14
- baseStyleProps,
15
- dimensionValue,
16
- passthroughStyle,
17
- StyleHandlers,
18
- useDOMRef,
19
- useStyleProps
20
- } from '@react-spectrum/utils';
21
- import {DimensionValue, DOMRef} from '@react-types/shared';
22
- import {filterDOMProps} from '@react-aria/utils';
23
- import {GridProps} from '@react-types/layout';
24
- import React, {forwardRef} from 'react';
25
-
26
- const gridStyleProps: StyleHandlers = {
27
- ...baseStyleProps,
28
- autoFlow: ['gridAutoFlow', passthroughStyle],
29
- autoColumns: ['gridAutoColumns', gridDimensionValue],
30
- autoRows: ['gridAutoRows', gridDimensionValue],
31
- areas: ['gridTemplateAreas', gridTemplateAreasValue],
32
- columns: ['gridTemplateColumns', gridTemplateValue],
33
- rows: ['gridTemplateRows', gridTemplateValue],
34
- gap: ['gap', dimensionValue],
35
- rowGap: ['rowGap', dimensionValue],
36
- columnGap: ['columnGap', dimensionValue],
37
- justifyItems: ['justifyItems', passthroughStyle],
38
- justifyContent: ['justifyContent', passthroughStyle],
39
- alignItems: ['alignItems', passthroughStyle],
40
- alignContent: ['alignContent', passthroughStyle]
41
- };
42
-
43
- /**
44
- * A layout container using CSS grid. Supports Spectrum dimensions as values to
45
- * ensure consistent and adaptive sizing and spacing.
46
- */
47
- export const Grid = forwardRef(function Grid(props: GridProps, ref: DOMRef<HTMLDivElement>) {
48
- let {
49
- children,
50
- ...otherProps
51
- } = props;
52
- let {styleProps} = useStyleProps(otherProps, gridStyleProps);
53
- if (styleProps.style) {
54
- styleProps.style.display = 'grid'; // inline-grid?
55
- }
56
- let domRef = useDOMRef(ref);
57
-
58
- return (
59
- <div {...filterDOMProps(otherProps)} {...styleProps} ref={domRef}>
60
- {children}
61
- </div>
62
- );
63
- });
64
-
65
- /**
66
- * Can be used to make a repeating fragment of the columns or rows list.
67
- * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/repeat).
68
- * @param count - The number of times to repeat the fragment.
69
- * @param repeat - The fragment to repeat.
70
- */
71
- export function repeat(count: number | 'auto-fill' | 'auto-fit', repeat: DimensionValue | DimensionValue[]): string {
72
- return `repeat(${count}, ${gridTemplateValue(repeat)})`;
73
- }
74
-
75
- /**
76
- * Defines a size range greater than or equal to min and less than or equal to max.
77
- * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/minmax).
78
- * @param min - The minimum size.
79
- * @param max - The maximum size.
80
- */
81
- export function minmax(min: DimensionValue, max: DimensionValue): string {
82
- return `minmax(${gridDimensionValue(min)}, ${gridDimensionValue(max)})`;
83
- }
84
-
85
- /**
86
- * Clamps a given size to an available size.
87
- * See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content).
88
- * @param dimension - The size to clamp.
89
- */
90
- export function fitContent(dimension: DimensionValue): string {
91
- return `fit-content(${gridDimensionValue(dimension)})`;
92
- }
93
-
94
- function gridTemplateAreasValue(value) {
95
- return value.map(v => `"${v}"`).join('\n');
96
- }
97
-
98
- function gridDimensionValue(value) {
99
- if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) {
100
- return value;
101
- }
102
-
103
- return dimensionValue(value);
104
- }
105
-
106
- function gridTemplateValue(value) {
107
- if (Array.isArray(value)) {
108
- return value.map(gridDimensionValue).join(' ');
109
- }
110
-
111
- return gridDimensionValue(value);
112
- }
package/src/flex-gap.css DELETED
@@ -1,43 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- .flex-container {
14
- /* this is necessary so that the inner margins don't affect anything outside */
15
- display: flex;
16
- }
17
-
18
- .flex {
19
- display: flex;
20
- }
21
-
22
- .flex-gap {
23
- --gap: 0px;
24
- --column-gap: var(--gap);
25
- --row-gap: var(--gap);
26
-
27
- /* apply a negative margin to counteract the margin on each item at the edges */
28
- margin: calc(var(--row-gap) / -2) calc(var(--column-gap) / -2);
29
-
30
- /* increase the width and height to account for this margin */
31
- /* Add 1px to fix rounding error in Safari (╯°□°)╯︵ ┻━┻ */
32
- width: calc(100% + calc(var(--column-gap) + 1px));
33
- height: calc(100% + var(--row-gap));
34
- }
35
-
36
- /* If the selector was .flex-gap > *, it wouldn't override when components have a margin 0 specified by a single
37
- * class selector, specificity is equal. Both are one class. Neither > nor * contribute to specificity.
38
- * We need to make it more specific, so we raise it by 1 class.
39
- */
40
- .flex-container .flex-gap > * {
41
- /* apply half of the gap to each side of every item */
42
- margin: calc(var(--row-gap) / 2) calc(var(--column-gap) / 2);
43
- }