@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.
package/dist/module.js CHANGED
@@ -1,16 +1,6 @@
1
- import "./module.css";
2
- import {baseStyleProps as $9LQqs$baseStyleProps, passthroughStyle as $9LQqs$passthroughStyle, dimensionValue as $9LQqs$dimensionValue, useStyleProps as $9LQqs$useStyleProps, useDOMRef as $9LQqs$useDOMRef, useBreakpoint as $9LQqs$useBreakpoint, responsiveDimensionValue as $9LQqs$responsiveDimensionValue, classNames as $9LQqs$classNames} from "@react-spectrum/utils";
3
- import {filterDOMProps as $9LQqs$filterDOMProps} from "@react-aria/utils";
4
- import $9LQqs$react, {forwardRef as $9LQqs$forwardRef} from "react";
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";
5
3
 
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
-
11
- function $parcel$export(e, n, v, s) {
12
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
- }
14
4
  /*
15
5
  * Copyright 2020 Adobe. All rights reserved.
16
6
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -22,200 +12,6 @@ function $parcel$export(e, n, v, s) {
22
12
  * OF ANY KIND, either express or implied. See the License for the specific language
23
13
  * governing permissions and limitations under the License.
24
14
  */ /// <reference types="css-module-types" />
25
- /*
26
- * Copyright 2020 Adobe. All rights reserved.
27
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
28
- * you may not use this file except in compliance with the License. You may obtain a copy
29
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
30
- *
31
- * Unless required by applicable law or agreed to in writing, software distributed under
32
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
33
- * OF ANY KIND, either express or implied. See the License for the specific language
34
- * governing permissions and limitations under the License.
35
- */
36
-
37
-
38
- const $994c48bfb00b620b$var$gridStyleProps = {
39
- ...(0, $9LQqs$baseStyleProps),
40
- autoFlow: [
41
- "gridAutoFlow",
42
- (0, $9LQqs$passthroughStyle)
43
- ],
44
- autoColumns: [
45
- "gridAutoColumns",
46
- $994c48bfb00b620b$var$gridDimensionValue
47
- ],
48
- autoRows: [
49
- "gridAutoRows",
50
- $994c48bfb00b620b$var$gridDimensionValue
51
- ],
52
- areas: [
53
- "gridTemplateAreas",
54
- $994c48bfb00b620b$var$gridTemplateAreasValue
55
- ],
56
- columns: [
57
- "gridTemplateColumns",
58
- $994c48bfb00b620b$var$gridTemplateValue
59
- ],
60
- rows: [
61
- "gridTemplateRows",
62
- $994c48bfb00b620b$var$gridTemplateValue
63
- ],
64
- gap: [
65
- "gap",
66
- (0, $9LQqs$dimensionValue)
67
- ],
68
- rowGap: [
69
- "rowGap",
70
- (0, $9LQqs$dimensionValue)
71
- ],
72
- columnGap: [
73
- "columnGap",
74
- (0, $9LQqs$dimensionValue)
75
- ],
76
- justifyItems: [
77
- "justifyItems",
78
- (0, $9LQqs$passthroughStyle)
79
- ],
80
- justifyContent: [
81
- "justifyContent",
82
- (0, $9LQqs$passthroughStyle)
83
- ],
84
- alignItems: [
85
- "alignItems",
86
- (0, $9LQqs$passthroughStyle)
87
- ],
88
- alignContent: [
89
- "alignContent",
90
- (0, $9LQqs$passthroughStyle)
91
- ]
92
- };
93
- function $994c48bfb00b620b$var$Grid(props, ref) {
94
- let { children: children, ...otherProps } = props;
95
- let { styleProps: styleProps } = (0, $9LQqs$useStyleProps)(otherProps, $994c48bfb00b620b$var$gridStyleProps);
96
- styleProps.style.display = "grid"; // inline-grid?
97
- let domRef = (0, $9LQqs$useDOMRef)(ref);
98
- return /*#__PURE__*/ (0, $9LQqs$react).createElement("div", {
99
- ...(0, $9LQqs$filterDOMProps)(otherProps),
100
- ...styleProps,
101
- ref: domRef
102
- }, children);
103
- }
104
- function $994c48bfb00b620b$export$76d90c956114f2c2(count, repeat) {
105
- return `repeat(${count}, ${$994c48bfb00b620b$var$gridTemplateValue(repeat)})`;
106
- }
107
- function $994c48bfb00b620b$export$9c1b655deaca4988(min, max) {
108
- return `minmax(${$994c48bfb00b620b$var$gridDimensionValue(min)}, ${$994c48bfb00b620b$var$gridDimensionValue(max)})`;
109
- }
110
- function $994c48bfb00b620b$export$2f0b47b0911ce698(dimension) {
111
- return `fit-content(${$994c48bfb00b620b$var$gridDimensionValue(dimension)})`;
112
- }
113
- function $994c48bfb00b620b$var$gridTemplateAreasValue(value) {
114
- return value.map((v)=>`"${v}"`).join("\n");
115
- }
116
- function $994c48bfb00b620b$var$gridDimensionValue(value) {
117
- if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) return value;
118
- return (0, $9LQqs$dimensionValue)(value);
119
- }
120
- function $994c48bfb00b620b$var$gridTemplateValue(value) {
121
- if (Array.isArray(value)) return value.map($994c48bfb00b620b$var$gridDimensionValue).join(" ");
122
- return $994c48bfb00b620b$var$gridDimensionValue(value);
123
- }
124
- /**
125
- * A layout container using CSS grid. Supports Spectrum dimensions as values to
126
- * ensure consistent and adaptive sizing and spacing.
127
- */ const $994c48bfb00b620b$export$ef2184bd89960b14 = /*#__PURE__*/ (0, $9LQqs$forwardRef)($994c48bfb00b620b$var$Grid);
128
-
129
-
130
- /*
131
- * Copyright 2020 Adobe. All rights reserved.
132
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
133
- * you may not use this file except in compliance with the License. You may obtain a copy
134
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
135
- *
136
- * Unless required by applicable law or agreed to in writing, software distributed under
137
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
138
- * OF ANY KIND, either express or implied. See the License for the specific language
139
- * governing permissions and limitations under the License.
140
- */
141
-
142
-
143
- var $01dd1839b5376a46$exports = {};
144
-
145
- $parcel$export($01dd1839b5376a46$exports, "flex", () => $01dd1839b5376a46$export$97691fbb80847c19, (v) => $01dd1839b5376a46$export$97691fbb80847c19 = v);
146
- $parcel$export($01dd1839b5376a46$exports, "flex-container", () => $01dd1839b5376a46$export$69d7a39fa31a000b, (v) => $01dd1839b5376a46$export$69d7a39fa31a000b = v);
147
- $parcel$export($01dd1839b5376a46$exports, "flex-gap", () => $01dd1839b5376a46$export$31a9da8b58047a44, (v) => $01dd1839b5376a46$export$31a9da8b58047a44 = v);
148
- var $01dd1839b5376a46$export$97691fbb80847c19;
149
- var $01dd1839b5376a46$export$69d7a39fa31a000b;
150
- var $01dd1839b5376a46$export$31a9da8b58047a44;
151
- $01dd1839b5376a46$export$97691fbb80847c19 = `NW91UW_flex`;
152
- $01dd1839b5376a46$export$69d7a39fa31a000b = `NW91UW_flex-container`;
153
- $01dd1839b5376a46$export$31a9da8b58047a44 = `NW91UW_flex-gap`;
154
-
155
-
156
- const $884c64d19340d345$var$flexStyleProps = {
157
- direction: [
158
- "flexDirection",
159
- (0, $9LQqs$passthroughStyle)
160
- ],
161
- wrap: [
162
- "flexWrap",
163
- $884c64d19340d345$var$flexWrapValue
164
- ],
165
- justifyContent: [
166
- "justifyContent",
167
- $884c64d19340d345$var$flexAlignValue
168
- ],
169
- alignItems: [
170
- "alignItems",
171
- $884c64d19340d345$var$flexAlignValue
172
- ],
173
- alignContent: [
174
- "alignContent",
175
- $884c64d19340d345$var$flexAlignValue
176
- ]
177
- };
178
- function $884c64d19340d345$var$Flex(props, ref) {
179
- let { children: children, ...otherProps } = props;
180
- let breakpointProvider = (0, $9LQqs$useBreakpoint)();
181
- let matchedBreakpoints = (breakpointProvider === null || breakpointProvider === void 0 ? void 0 : breakpointProvider.matchedBreakpoints) || [
182
- "base"
183
- ];
184
- let { styleProps: styleProps } = (0, $9LQqs$useStyleProps)(otherProps);
185
- let { styleProps: flexStyle } = (0, $9LQqs$useStyleProps)(otherProps, $884c64d19340d345$var$flexStyleProps);
186
- let domRef = (0, $9LQqs$useDOMRef)(ref);
187
- let style = {
188
- ...styleProps.style,
189
- ...flexStyle.style
190
- };
191
- if (props.gap != null) style.gap = (0, $9LQqs$responsiveDimensionValue)(props.gap, matchedBreakpoints);
192
- if (props.columnGap != null) style.columnGap = (0, $9LQqs$responsiveDimensionValue)(props.columnGap, matchedBreakpoints);
193
- if (props.rowGap != null) style.rowGap = (0, $9LQqs$responsiveDimensionValue)(props.rowGap, matchedBreakpoints);
194
- return /*#__PURE__*/ (0, $9LQqs$react).createElement("div", {
195
- ...(0, $9LQqs$filterDOMProps)(otherProps),
196
- className: (0, $9LQqs$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($01dd1839b5376a46$exports))), "flex", styleProps.className),
197
- style: style,
198
- ref: domRef
199
- }, children);
200
- }
201
- /**
202
- * Normalize 'start' and 'end' alignment values to 'flex-start' and 'flex-end'
203
- * in flex containers for browser compatibility.
204
- */ function $884c64d19340d345$var$flexAlignValue(value) {
205
- if (value === "start") return "flex-start";
206
- if (value === "end") return "flex-end";
207
- return value;
208
- }
209
- /**
210
- * Takes a boolean and translates it to flex wrap or nowrap.
211
- */ function $884c64d19340d345$var$flexWrapValue(value) {
212
- if (typeof value === "boolean") return value ? "wrap" : "nowrap";
213
- return value;
214
- }
215
- /**
216
- * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap
217
- * property to define consistent spacing between items.
218
- */ const $884c64d19340d345$export$f51f4c4ede09e011 = /*#__PURE__*/ (0, $9LQqs$forwardRef)($884c64d19340d345$var$Flex);
219
15
 
220
16
 
221
17
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;AAeD,MAAM,uCAAgC;IACpC,GAAG,CAAA,GAAA,qBAA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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,gEAAK,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/index.ts","packages/@react-spectrum/layout/src/Grid.tsx","packages/@react-spectrum/layout/src/Flex.tsx","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/// <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","/*\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","/*\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","/*\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":"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 './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"}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DimensionValue } from "@react-types/shared";
1
+ import { DimensionValue, DOMRefValue } from "@react-types/shared";
2
2
  import { GridProps, FlexProps } from "@react-types/layout";
3
3
  import React from "react";
4
4
  /**
@@ -25,12 +25,12 @@ export function fitContent(dimension: DimensionValue): string;
25
25
  * A layout container using CSS grid. Supports Spectrum dimensions as values to
26
26
  * ensure consistent and adaptive sizing and spacing.
27
27
  */
28
- export const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>>;
28
+ export const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<DOMRefValue<HTMLDivElement>>>;
29
29
  /**
30
30
  * A layout container using flexbox. Provides Spectrum dimension values, and supports the gap
31
31
  * property to define consistent spacing between items.
32
32
  */
33
- export const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>>;
33
+ export const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<DOMRefValue<HTMLDivElement>>>;
34
34
  export type { DimensionValue } from '@react-types/shared';
35
35
  export type { FlexProps, GridProps } from '@react-types/layout';
36
36
 
@@ -1 +1 @@
1
- {"mappings":";;;AA0DA;;;;;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;AAsBD;;;GAGG;AACH,OAAA,MAAM,iIAAwB,CAAC;ACtB/B;;;GAGG;AACH,OAAA,MAAM,iIAAwB,CAAC;AC7E/B,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"}
1
+ {"mappings":";;;AA0DA;;;;;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;AAsBD;;;GAGG;AACH,OAAA,MAAM,mGAAwB,CAAC;ACtB/B;;;GAGG;AACH,OAAA,MAAM,mGAAwB,CAAC;AC7E/B,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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/layout",
3
- "version": "3.6.4-nightly.4555+81162ea39",
3
+ "version": "3.6.4-nightly.4560+72775d272",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,14 +36,14 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/utils": "3.0.0-nightly.2843+81162ea39",
40
- "@react-spectrum/utils": "3.0.0-nightly.2843+81162ea39",
41
- "@react-types/layout": "3.3.14-nightly.4555+81162ea39",
42
- "@react-types/shared": "3.0.0-nightly.2843+81162ea39",
39
+ "@react-aria/utils": "3.0.0-nightly.2848+72775d272",
40
+ "@react-spectrum/utils": "3.0.0-nightly.2848+72775d272",
41
+ "@react-types/layout": "3.3.14-nightly.4560+72775d272",
42
+ "@react-types/shared": "3.0.0-nightly.2848+72775d272",
43
43
  "@swc/helpers": "^0.5.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@adobe/spectrum-css-temp": "3.0.0-nightly.2843+81162ea39"
46
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.2848+72775d272"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@react-spectrum/provider": "^3.0.0",
@@ -52,5 +52,5 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  },
55
- "gitHead": "81162ea392926d06ec3d25c228e6f9b6b5479d59"
55
+ "gitHead": "72775d272be04cfa32d26ec821bc68513d92a72b"
56
56
  }
package/dist/module.css DELETED
@@ -1,17 +0,0 @@
1
- .NW91UW_flex-container, .NW91UW_flex {
2
- display: flex;
3
- }
4
-
5
- .NW91UW_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
- .NW91UW_flex-container .NW91UW_flex-gap > * {
15
- margin: calc(var(--row-gap) / 2) calc(var(--column-gap) / 2);
16
- }
17
- /*# sourceMappingURL=module.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":"module.css.map"}