Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-spectrum/layout

Package Overview
Dependencies
Maintainers
2
Versions
861
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-spectrum/layout - npm Package Compare versions

Comparing version 3.2.2-nightly.3040 to 3.2.2-nightly.3047

453

dist/main.js

@@ -1,127 +0,124 @@

var {
useIsSSR
} = require("@react-aria/ssr");
require("./main.css");
var $7sZ04$reactspectrumutils = require("@react-spectrum/utils");
var $7sZ04$reactariautils = require("@react-aria/utils");
var $7sZ04$react = require("react");
var $7sZ04$reactariassr = require("@react-aria/ssr");
var _react2 = require("react");
function $parcel$exportWildcard(dest, source) {
Object.keys(source).forEach(function(key) {
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
return;
}
var _react = $parcel$interopDefault(_react2);
Object.defineProperty(dest, key, {
enumerable: true,
get: function get() {
return source[key];
}
});
});
var {
forwardRef
} = _react2;
var {
filterDOMProps
} = require("@react-aria/utils");
var {
baseStyleProps,
dimensionValue,
passthroughStyle,
useDOMRef,
useStyleProps,
classNames,
responsiveDimensionValue,
useBreakpoint
} = require("@react-spectrum/utils");
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
var _babelRuntimeHelpersObjectWithoutPropertiesLoose = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
require("./main.css");
return dest;
}
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
var $702303612cb59c6a$exports = {};
const $f784fbb881b5b101cd7607722a86$var$gridStyleProps = _babelRuntimeHelpersExtends({}, baseStyleProps, {
autoFlow: ['gridAutoFlow', passthroughStyle],
autoColumns: ['gridAutoColumns', $f784fbb881b5b101cd7607722a86$var$gridDimensionValue],
autoRows: ['gridAutoRows', $f784fbb881b5b101cd7607722a86$var$gridDimensionValue],
areas: ['gridTemplateAreas', $f784fbb881b5b101cd7607722a86$var$gridTemplateAreasValue],
columns: ['gridTemplateColumns', $f784fbb881b5b101cd7607722a86$var$gridTemplateValue],
rows: ['gridTemplateRows', $f784fbb881b5b101cd7607722a86$var$gridTemplateValue],
gap: ['gap', dimensionValue],
rowGap: ['rowGap', dimensionValue],
columnGap: ['columnGap', dimensionValue],
justifyItems: ['justifyItems', passthroughStyle],
justifyContent: ['justifyContent', passthroughStyle],
alignItems: ['alignItems', passthroughStyle],
alignContent: ['alignContent', passthroughStyle]
});
$parcel$export($702303612cb59c6a$exports, "repeat", () => $702303612cb59c6a$export$76d90c956114f2c2);
$parcel$export($702303612cb59c6a$exports, "minmax", () => $702303612cb59c6a$export$9c1b655deaca4988);
$parcel$export($702303612cb59c6a$exports, "fitContent", () => $702303612cb59c6a$export$2f0b47b0911ce698);
$parcel$export($702303612cb59c6a$exports, "Grid", () => $702303612cb59c6a$export$ef2184bd89960b14);
function $f784fbb881b5b101cd7607722a86$var$Grid(props, ref) {
let {
children
} = props,
otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["children"]);
let {
styleProps
} = useStyleProps(otherProps, $f784fbb881b5b101cd7607722a86$var$gridStyleProps);
styleProps.style.display = 'grid'; // inline-grid?
let domRef = useDOMRef(ref);
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({}, filterDOMProps(otherProps), styleProps, {
ref: domRef
}), children);
const $702303612cb59c6a$var$gridStyleProps = {
...$7sZ04$reactspectrumutils.baseStyleProps,
autoFlow: [
'gridAutoFlow',
$7sZ04$reactspectrumutils.passthroughStyle
],
autoColumns: [
'gridAutoColumns',
$702303612cb59c6a$var$gridDimensionValue
],
autoRows: [
'gridAutoRows',
$702303612cb59c6a$var$gridDimensionValue
],
areas: [
'gridTemplateAreas',
$702303612cb59c6a$var$gridTemplateAreasValue
],
columns: [
'gridTemplateColumns',
$702303612cb59c6a$var$gridTemplateValue
],
rows: [
'gridTemplateRows',
$702303612cb59c6a$var$gridTemplateValue
],
gap: [
'gap',
$7sZ04$reactspectrumutils.dimensionValue
],
rowGap: [
'rowGap',
$7sZ04$reactspectrumutils.dimensionValue
],
columnGap: [
'columnGap',
$7sZ04$reactspectrumutils.dimensionValue
],
justifyItems: [
'justifyItems',
$7sZ04$reactspectrumutils.passthroughStyle
],
justifyContent: [
'justifyContent',
$7sZ04$reactspectrumutils.passthroughStyle
],
alignItems: [
'alignItems',
$7sZ04$reactspectrumutils.passthroughStyle
],
alignContent: [
'alignContent',
$7sZ04$reactspectrumutils.passthroughStyle
]
};
function $702303612cb59c6a$var$Grid(props, ref) {
let { children: children , ...otherProps } = props;
let { styleProps: styleProps } = $7sZ04$reactspectrumutils.useStyleProps(otherProps, $702303612cb59c6a$var$gridStyleProps);
styleProps.style.display = 'grid'; // inline-grid?
let domRef = $7sZ04$reactspectrumutils.useDOMRef(ref);
return(/*#__PURE__*/ ($parcel$interopDefault($7sZ04$react)).createElement("div", {
...$7sZ04$reactariautils.filterDOMProps(otherProps),
...styleProps,
ref: domRef
}, children));
}
/**
* Can be used to make a repeating fragment of the columns or rows list.
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/repeat).
* @param count - The number of times to repeat the fragment.
* @param repeat - The fragment to repeat.
*/
function repeat(count, repeat) {
return "repeat(" + count + ", " + $f784fbb881b5b101cd7607722a86$var$gridTemplateValue(repeat) + ")";
function $702303612cb59c6a$export$76d90c956114f2c2(count, $702303612cb59c6a$export$76d90c956114f2c2) {
return `repeat(${count}, ${$702303612cb59c6a$var$gridTemplateValue($702303612cb59c6a$export$76d90c956114f2c2)})`;
}
/**
* Defines a size range greater than or equal to min and less than or equal to max.
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/minmax).
* @param min - The minimum size.
* @param max - The maximum size.
*/
exports.repeat = repeat;
function minmax(min, max) {
return "minmax(" + $f784fbb881b5b101cd7607722a86$var$gridDimensionValue(min) + ", " + $f784fbb881b5b101cd7607722a86$var$gridDimensionValue(max) + ")";
function $702303612cb59c6a$export$9c1b655deaca4988(min, max) {
return `minmax(${$702303612cb59c6a$var$gridDimensionValue(min)}, ${$702303612cb59c6a$var$gridDimensionValue(max)})`;
}
/**
* Clamps a given size to an available size.
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content).
* @param dimension - The size to clamp.
*/
exports.minmax = minmax;
function fitContent(dimension) {
return "fit-content(" + $f784fbb881b5b101cd7607722a86$var$gridDimensionValue(dimension) + ")";
function $702303612cb59c6a$export$2f0b47b0911ce698(dimension) {
return `fit-content(${$702303612cb59c6a$var$gridDimensionValue(dimension)})`;
}
exports.fitContent = fitContent;
function $f784fbb881b5b101cd7607722a86$var$gridTemplateAreasValue(value) {
return value.map(v => "\"" + v + "\"").join('\n');
function $702303612cb59c6a$var$gridTemplateAreasValue(value) {
return value.map((v)=>`"${v}"`
).join('\n');
}
function $f784fbb881b5b101cd7607722a86$var$gridDimensionValue(value) {
if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) {
return value;
}
return dimensionValue(value);
function $702303612cb59c6a$var$gridDimensionValue(value) {
if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) return value;
return $7sZ04$reactspectrumutils.dimensionValue(value);
}
function $f784fbb881b5b101cd7607722a86$var$gridTemplateValue(value) {
if (Array.isArray(value)) {
return value.map($f784fbb881b5b101cd7607722a86$var$gridDimensionValue).join(' ');
}
return $f784fbb881b5b101cd7607722a86$var$gridDimensionValue(value);
function $702303612cb59c6a$var$gridTemplateValue(value) {
if (Array.isArray(value)) return value.map($702303612cb59c6a$var$gridDimensionValue).join(' ');
return $702303612cb59c6a$var$gridDimensionValue(value);
}

@@ -131,82 +128,94 @@ /**

* ensure consistent and adaptive sizing and spacing.
*/
*/ const $702303612cb59c6a$export$ef2184bd89960b14 = /*#__PURE__*/ $7sZ04$react.forwardRef($702303612cb59c6a$var$Grid);
const Grid = /*#__PURE__*/forwardRef($f784fbb881b5b101cd7607722a86$var$Grid);
exports.Grid = Grid;
// ASSET: /home/circleci/react-spectrum/packages/@react-spectrum/layout/src/flex-gap.css
var $fc072772828195097956358aadf4fa$exports = {};
$fc072772828195097956358aadf4fa$exports = {
"flex-container": "_flex-container_6144c",
"-ms-flex": "_flex_6144c",
"flex": "_flex_6144c",
"flex-gap": "_flex-gap_6144c"
};
const $e9098d18abf2a118bc3bc95f0d402bb5$var$flexStyleProps = {
direction: ['flexDirection', passthroughStyle],
wrap: ['flexWrap', $e9098d18abf2a118bc3bc95f0d402bb5$var$flexWrapValue],
justifyContent: ['justifyContent', $e9098d18abf2a118bc3bc95f0d402bb5$var$flexAlignValue],
alignItems: ['alignItems', $e9098d18abf2a118bc3bc95f0d402bb5$var$flexAlignValue],
alignContent: ['alignContent', $e9098d18abf2a118bc3bc95f0d402bb5$var$flexAlignValue]
};
var $fc072772828195097956358aadf4fa$$interop$default = $parcel$interopDefault($fc072772828195097956358aadf4fa$exports);
var $e321e5cdc9cc685b$exports = {};
function $e9098d18abf2a118bc3bc95f0d402bb5$var$Flex(props, ref) {
let {
children
} = props,
otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["children"]);
$parcel$export($e321e5cdc9cc685b$exports, "Flex", () => $e321e5cdc9cc685b$export$f51f4c4ede09e011);
let breakpointProvider = useBreakpoint();
let matchedBreakpoints = (breakpointProvider == null ? void 0 : breakpointProvider.matchedBreakpoints) || ['base'];
let {
styleProps
} = useStyleProps(otherProps);
let {
styleProps: flexStyle
} = useStyleProps(otherProps, $e9098d18abf2a118bc3bc95f0d402bb5$var$flexStyleProps);
let domRef = useDOMRef(ref);
let isSSR = useIsSSR(); // If a gap property is specified, and there is no native support or we're in SSR, use a shim.
// Two divs are required for this: the outer one contains most style properties, and the inner
// one is the flex container. Each item inside the flex container gets a margin around it based
// on the gap, and the flex container has a negative margin to counteract this. The outer container
// is necessary to allow nesting of flex containers with gaps, so that the inner CSS variable doesn't
// override the outer one.
if ((props.gap || props.rowGap || props.columnGap) && (isSSR || !$e9098d18abf2a118bc3bc95f0d402bb5$var$isFlexGapSupported())) {
let style = _babelRuntimeHelpersExtends({}, flexStyle.style, {
'--column-gap': props.columnGap != null ? responsiveDimensionValue(props.columnGap, matchedBreakpoints) : undefined,
'--row-gap': props.rowGap != null ? responsiveDimensionValue(props.rowGap, matchedBreakpoints) : undefined,
'--gap': props.gap != null ? responsiveDimensionValue(props.gap, matchedBreakpoints) : undefined
});
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({}, filterDOMProps(otherProps), styleProps, {
className: classNames($fc072772828195097956358aadf4fa$$interop$default, 'flex-container', styleProps.className),
ref: domRef
}), /*#__PURE__*/_react.createElement("div", {
className: classNames($fc072772828195097956358aadf4fa$$interop$default, 'flex', 'flex-gap'),
style: style
}, children));
} // If no gaps, or native support exists, then we only need to render a single div.
var $5965d0ff00ce6fc2$exports = {};
$parcel$export($5965d0ff00ce6fc2$exports, "flex-container", () => $5965d0ff00ce6fc2$export$69d7a39fa31a000b, (v) => $5965d0ff00ce6fc2$export$69d7a39fa31a000b = v);
$parcel$export($5965d0ff00ce6fc2$exports, "flex", () => $5965d0ff00ce6fc2$export$97691fbb80847c19, (v) => $5965d0ff00ce6fc2$export$97691fbb80847c19 = v);
$parcel$export($5965d0ff00ce6fc2$exports, "flex-gap", () => $5965d0ff00ce6fc2$export$31a9da8b58047a44, (v) => $5965d0ff00ce6fc2$export$31a9da8b58047a44 = v);
var $5965d0ff00ce6fc2$export$69d7a39fa31a000b;
var $5965d0ff00ce6fc2$export$97691fbb80847c19;
var $5965d0ff00ce6fc2$export$31a9da8b58047a44;
$5965d0ff00ce6fc2$export$69d7a39fa31a000b = "_flex-container_e15493";
$5965d0ff00ce6fc2$export$97691fbb80847c19 = "_flex_e15493";
$5965d0ff00ce6fc2$export$31a9da8b58047a44 = "_flex-gap_e15493";
let style = _babelRuntimeHelpersExtends({}, styleProps.style, flexStyle.style);
if (props.gap != null) {
style.gap = responsiveDimensionValue(props.gap, matchedBreakpoints);
}
if (props.columnGap != null) {
style.columnGap = responsiveDimensionValue(props.columnGap, matchedBreakpoints);
}
if (props.rowGap != null) {
style.rowGap = responsiveDimensionValue(props.rowGap, matchedBreakpoints);
}
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({}, filterDOMProps(otherProps), {
className: classNames($fc072772828195097956358aadf4fa$$interop$default, 'flex', styleProps.className),
style: style,
ref: domRef
}), children);
const $e321e5cdc9cc685b$var$flexStyleProps = {
direction: [
'flexDirection',
$7sZ04$reactspectrumutils.passthroughStyle
],
wrap: [
'flexWrap',
$e321e5cdc9cc685b$var$flexWrapValue
],
justifyContent: [
'justifyContent',
$e321e5cdc9cc685b$var$flexAlignValue
],
alignItems: [
'alignItems',
$e321e5cdc9cc685b$var$flexAlignValue
],
alignContent: [
'alignContent',
$e321e5cdc9cc685b$var$flexAlignValue
]
};
function $e321e5cdc9cc685b$var$Flex(props, ref) {
let { children: children , ...otherProps } = props;
let breakpointProvider = $7sZ04$reactspectrumutils.useBreakpoint();
let matchedBreakpoints = breakpointProvider?.matchedBreakpoints || [
'base'
];
let { styleProps: styleProps } = $7sZ04$reactspectrumutils.useStyleProps(otherProps);
let { styleProps: flexStyle } = $7sZ04$reactspectrumutils.useStyleProps(otherProps, $e321e5cdc9cc685b$var$flexStyleProps);
let domRef = $7sZ04$reactspectrumutils.useDOMRef(ref);
let isSSR = $7sZ04$reactariassr.useIsSSR();
// If a gap property is specified, and there is no native support or we're in SSR, use a shim.
// Two divs are required for this: the outer one contains most style properties, and the inner
// one is the flex container. Each item inside the flex container gets a margin around it based
// on the gap, and the flex container has a negative margin to counteract this. The outer container
// is necessary to allow nesting of flex containers with gaps, so that the inner CSS variable doesn't
// override the outer one.
if ((props.gap || props.rowGap || props.columnGap) && (isSSR || !$e321e5cdc9cc685b$var$isFlexGapSupported())) {
let style = {
...flexStyle.style,
'--column-gap': props.columnGap != null ? $7sZ04$reactspectrumutils.responsiveDimensionValue(props.columnGap, matchedBreakpoints) : undefined,
'--row-gap': props.rowGap != null ? $7sZ04$reactspectrumutils.responsiveDimensionValue(props.rowGap, matchedBreakpoints) : undefined,
'--gap': props.gap != null ? $7sZ04$reactspectrumutils.responsiveDimensionValue(props.gap, matchedBreakpoints) : undefined
};
return(/*#__PURE__*/ ($parcel$interopDefault($7sZ04$react)).createElement("div", {
...$7sZ04$reactariautils.filterDOMProps(otherProps),
...styleProps,
className: $7sZ04$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($5965d0ff00ce6fc2$exports)), 'flex-container', styleProps.className),
ref: domRef
}, /*#__PURE__*/ ($parcel$interopDefault($7sZ04$react)).createElement("div", {
className: $7sZ04$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($5965d0ff00ce6fc2$exports)), 'flex', 'flex-gap'),
style: style
}, children)));
}
// If no gaps, or native support exists, then we only need to render a single div.
let style = {
...styleProps.style,
...flexStyle.style
};
if (props.gap != null) style.gap = $7sZ04$reactspectrumutils.responsiveDimensionValue(props.gap, matchedBreakpoints);
if (props.columnGap != null) style.columnGap = $7sZ04$reactspectrumutils.responsiveDimensionValue(props.columnGap, matchedBreakpoints);
if (props.rowGap != null) style.rowGap = $7sZ04$reactspectrumutils.responsiveDimensionValue(props.rowGap, matchedBreakpoints);
return(/*#__PURE__*/ ($parcel$interopDefault($7sZ04$react)).createElement("div", {
...$7sZ04$reactariautils.filterDOMProps(otherProps),
className: $7sZ04$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($5965d0ff00ce6fc2$exports)), 'flex', styleProps.className),
style: style,
ref: domRef
}, children));
}

@@ -216,57 +225,33 @@ /**

* in flex containers for browser compatibility.
*/
function $e9098d18abf2a118bc3bc95f0d402bb5$var$flexAlignValue(value) {
if (value === 'start') {
return 'flex-start';
}
if (value === 'end') {
return 'flex-end';
}
return value;
*/ function $e321e5cdc9cc685b$var$flexAlignValue(value) {
if (value === 'start') return 'flex-start';
if (value === 'end') return 'flex-end';
return value;
}
/**
* Takes a boolean and translates it to flex wrap or nowrap.
*/
function $e9098d18abf2a118bc3bc95f0d402bb5$var$flexWrapValue(value) {
if (typeof value === 'boolean') {
return value ? 'wrap' : 'nowrap';
}
return value;
} // Original licensing for the following method can be found in the
*/ function $e321e5cdc9cc685b$var$flexWrapValue(value) {
if (typeof value === 'boolean') return value ? 'wrap' : 'nowrap';
return value;
}
// Original licensing for the following method can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/Modernizr/Modernizr/blob/7efb9d0edd66815fb115fdce95fabaf019ce8db5/feature-detects/css/flexgap.js
let $e9098d18abf2a118bc3bc95f0d402bb5$var$_isFlexGapSupported = null;
function $e9098d18abf2a118bc3bc95f0d402bb5$var$isFlexGapSupported() {
if ($e9098d18abf2a118bc3bc95f0d402bb5$var$_isFlexGapSupported != null) {
return $e9098d18abf2a118bc3bc95f0d402bb5$var$_isFlexGapSupported;
}
if (typeof document === 'undefined') {
return false;
} // create flex container with row-gap set
var flex = document.createElement('div');
flex.style.display = 'flex';
flex.style.flexDirection = 'column';
flex.style.rowGap = '1px'; // create two, elements inside it
flex.appendChild(document.createElement('div'));
flex.appendChild(document.createElement('div')); // append to the DOM (needed to obtain scrollHeight)
document.body.appendChild(flex);
$e9098d18abf2a118bc3bc95f0d402bb5$var$_isFlexGapSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap
flex.parentNode.removeChild(flex);
return $e9098d18abf2a118bc3bc95f0d402bb5$var$_isFlexGapSupported;
let $e321e5cdc9cc685b$var$_isFlexGapSupported = null;
function $e321e5cdc9cc685b$var$isFlexGapSupported() {
if ($e321e5cdc9cc685b$var$_isFlexGapSupported != null) return $e321e5cdc9cc685b$var$_isFlexGapSupported;
if (typeof document === 'undefined') return false;
// create flex container with row-gap set
var flex = document.createElement('div');
flex.style.display = 'flex';
flex.style.flexDirection = 'column';
flex.style.rowGap = '1px';
// create two, elements inside it
flex.appendChild(document.createElement('div'));
flex.appendChild(document.createElement('div'));
// append to the DOM (needed to obtain scrollHeight)
document.body.appendChild(flex);
$e321e5cdc9cc685b$var$_isFlexGapSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap
flex.parentNode.removeChild(flex);
return $e321e5cdc9cc685b$var$_isFlexGapSupported;
}

@@ -276,7 +261,9 @@ /**

* property to define consistent spacing between items.
*/
*/ const $e321e5cdc9cc685b$export$f51f4c4ede09e011 = /*#__PURE__*/ $7sZ04$react.forwardRef($e321e5cdc9cc685b$var$Flex);
const Flex = /*#__PURE__*/forwardRef($e9098d18abf2a118bc3bc95f0d402bb5$var$Flex);
exports.Flex = Flex;
$parcel$exportWildcard(module.exports, $702303612cb59c6a$exports);
$parcel$exportWildcard(module.exports, $e321e5cdc9cc685b$exports);
//# sourceMappingURL=main.js.map

@@ -1,94 +0,108 @@

import { useIsSSR } from "@react-aria/ssr";
import _react, { forwardRef } from "react";
import { filterDOMProps } from "@react-aria/utils";
import { baseStyleProps, dimensionValue, passthroughStyle, useDOMRef, useStyleProps, classNames, responsiveDimensionValue, useBreakpoint } from "@react-spectrum/utils";
import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
import _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import "./main.css";
import {baseStyleProps as $4QZis$baseStyleProps, passthroughStyle as $4QZis$passthroughStyle, dimensionValue as $4QZis$dimensionValue, useStyleProps as $4QZis$useStyleProps, useDOMRef as $4QZis$useDOMRef, useBreakpoint as $4QZis$useBreakpoint, responsiveDimensionValue as $4QZis$responsiveDimensionValue, classNames as $4QZis$classNames} from "@react-spectrum/utils";
import {filterDOMProps as $4QZis$filterDOMProps} from "@react-aria/utils";
import $4QZis$react, {forwardRef as $4QZis$forwardRef} from "react";
import {useIsSSR as $4QZis$useIsSSR} from "@react-aria/ssr";
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
var $698863dbed9612fa$exports = {};
const $b23dc17afddee903803cb9d0132e8399$var$gridStyleProps = _babelRuntimeHelpersEsmExtends({}, baseStyleProps, {
autoFlow: ['gridAutoFlow', passthroughStyle],
autoColumns: ['gridAutoColumns', $b23dc17afddee903803cb9d0132e8399$var$gridDimensionValue],
autoRows: ['gridAutoRows', $b23dc17afddee903803cb9d0132e8399$var$gridDimensionValue],
areas: ['gridTemplateAreas', $b23dc17afddee903803cb9d0132e8399$var$gridTemplateAreasValue],
columns: ['gridTemplateColumns', $b23dc17afddee903803cb9d0132e8399$var$gridTemplateValue],
rows: ['gridTemplateRows', $b23dc17afddee903803cb9d0132e8399$var$gridTemplateValue],
gap: ['gap', dimensionValue],
rowGap: ['rowGap', dimensionValue],
columnGap: ['columnGap', dimensionValue],
justifyItems: ['justifyItems', passthroughStyle],
justifyContent: ['justifyContent', passthroughStyle],
alignItems: ['alignItems', passthroughStyle],
alignContent: ['alignContent', passthroughStyle]
});
$parcel$export($698863dbed9612fa$exports, "repeat", () => $698863dbed9612fa$export$76d90c956114f2c2);
$parcel$export($698863dbed9612fa$exports, "minmax", () => $698863dbed9612fa$export$9c1b655deaca4988);
$parcel$export($698863dbed9612fa$exports, "fitContent", () => $698863dbed9612fa$export$2f0b47b0911ce698);
$parcel$export($698863dbed9612fa$exports, "Grid", () => $698863dbed9612fa$export$ef2184bd89960b14);
function $b23dc17afddee903803cb9d0132e8399$var$Grid(props, ref) {
let {
children
} = props,
otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["children"]);
let {
styleProps
} = useStyleProps(otherProps, $b23dc17afddee903803cb9d0132e8399$var$gridStyleProps);
styleProps.style.display = 'grid'; // inline-grid?
let domRef = useDOMRef(ref);
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersEsmExtends({}, filterDOMProps(otherProps), styleProps, {
ref: domRef
}), children);
const $698863dbed9612fa$var$gridStyleProps = {
...$4QZis$baseStyleProps,
autoFlow: [
'gridAutoFlow',
$4QZis$passthroughStyle
],
autoColumns: [
'gridAutoColumns',
$698863dbed9612fa$var$gridDimensionValue
],
autoRows: [
'gridAutoRows',
$698863dbed9612fa$var$gridDimensionValue
],
areas: [
'gridTemplateAreas',
$698863dbed9612fa$var$gridTemplateAreasValue
],
columns: [
'gridTemplateColumns',
$698863dbed9612fa$var$gridTemplateValue
],
rows: [
'gridTemplateRows',
$698863dbed9612fa$var$gridTemplateValue
],
gap: [
'gap',
$4QZis$dimensionValue
],
rowGap: [
'rowGap',
$4QZis$dimensionValue
],
columnGap: [
'columnGap',
$4QZis$dimensionValue
],
justifyItems: [
'justifyItems',
$4QZis$passthroughStyle
],
justifyContent: [
'justifyContent',
$4QZis$passthroughStyle
],
alignItems: [
'alignItems',
$4QZis$passthroughStyle
],
alignContent: [
'alignContent',
$4QZis$passthroughStyle
]
};
function $698863dbed9612fa$var$Grid(props, ref) {
let { children: children , ...otherProps } = props;
let { styleProps: styleProps } = $4QZis$useStyleProps(otherProps, $698863dbed9612fa$var$gridStyleProps);
styleProps.style.display = 'grid'; // inline-grid?
let domRef = $4QZis$useDOMRef(ref);
return(/*#__PURE__*/ $4QZis$react.createElement("div", {
...$4QZis$filterDOMProps(otherProps),
...styleProps,
ref: domRef
}, children));
}
/**
* Can be used to make a repeating fragment of the columns or rows list.
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/repeat).
* @param count - The number of times to repeat the fragment.
* @param repeat - The fragment to repeat.
*/
export function repeat(count, repeat) {
return "repeat(" + count + ", " + $b23dc17afddee903803cb9d0132e8399$var$gridTemplateValue(repeat) + ")";
function $698863dbed9612fa$export$76d90c956114f2c2(count, $698863dbed9612fa$export$76d90c956114f2c2) {
return `repeat(${count}, ${$698863dbed9612fa$var$gridTemplateValue($698863dbed9612fa$export$76d90c956114f2c2)})`;
}
/**
* Defines a size range greater than or equal to min and less than or equal to max.
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/minmax).
* @param min - The minimum size.
* @param max - The maximum size.
*/
export function minmax(min, max) {
return "minmax(" + $b23dc17afddee903803cb9d0132e8399$var$gridDimensionValue(min) + ", " + $b23dc17afddee903803cb9d0132e8399$var$gridDimensionValue(max) + ")";
function $698863dbed9612fa$export$9c1b655deaca4988(min, max) {
return `minmax(${$698863dbed9612fa$var$gridDimensionValue(min)}, ${$698863dbed9612fa$var$gridDimensionValue(max)})`;
}
/**
* Clamps a given size to an available size.
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content).
* @param dimension - The size to clamp.
*/
export function fitContent(dimension) {
return "fit-content(" + $b23dc17afddee903803cb9d0132e8399$var$gridDimensionValue(dimension) + ")";
function $698863dbed9612fa$export$2f0b47b0911ce698(dimension) {
return `fit-content(${$698863dbed9612fa$var$gridDimensionValue(dimension)})`;
}
function $b23dc17afddee903803cb9d0132e8399$var$gridTemplateAreasValue(value) {
return value.map(v => "\"" + v + "\"").join('\n');
function $698863dbed9612fa$var$gridTemplateAreasValue(value) {
return value.map((v)=>`"${v}"`
).join('\n');
}
function $b23dc17afddee903803cb9d0132e8399$var$gridDimensionValue(value) {
if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) {
return value;
}
return dimensionValue(value);
function $698863dbed9612fa$var$gridDimensionValue(value) {
if (/^max-content|min-content|minmax|auto|fit-content|repeat|subgrid/.test(value)) return value;
return $4QZis$dimensionValue(value);
}
function $b23dc17afddee903803cb9d0132e8399$var$gridTemplateValue(value) {
if (Array.isArray(value)) {
return value.map($b23dc17afddee903803cb9d0132e8399$var$gridDimensionValue).join(' ');
}
return $b23dc17afddee903803cb9d0132e8399$var$gridDimensionValue(value);
function $698863dbed9612fa$var$gridTemplateValue(value) {
if (Array.isArray(value)) return value.map($698863dbed9612fa$var$gridDimensionValue).join(' ');
return $698863dbed9612fa$var$gridDimensionValue(value);
}

@@ -98,81 +112,94 @@ /**

* ensure consistent and adaptive sizing and spacing.
*/
*/ const $698863dbed9612fa$export$ef2184bd89960b14 = /*#__PURE__*/ $4QZis$forwardRef($698863dbed9612fa$var$Grid);
export const Grid = /*#__PURE__*/forwardRef($b23dc17afddee903803cb9d0132e8399$var$Grid);
// ASSET: /home/circleci/react-spectrum/packages/@react-spectrum/layout/src/flex-gap.css
var $ab667a8f1fb16c30562d2deb99f756$exports = {};
$ab667a8f1fb16c30562d2deb99f756$exports = {
"flex-container": "_flex-container_6144c",
"-ms-flex": "_flex_6144c",
"flex": "_flex_6144c",
"flex-gap": "_flex-gap_6144c"
};
const $f9fee2c1db386bde8f28b36a814d1eb2$var$flexStyleProps = {
direction: ['flexDirection', passthroughStyle],
wrap: ['flexWrap', $f9fee2c1db386bde8f28b36a814d1eb2$var$flexWrapValue],
justifyContent: ['justifyContent', $f9fee2c1db386bde8f28b36a814d1eb2$var$flexAlignValue],
alignItems: ['alignItems', $f9fee2c1db386bde8f28b36a814d1eb2$var$flexAlignValue],
alignContent: ['alignContent', $f9fee2c1db386bde8f28b36a814d1eb2$var$flexAlignValue]
};
var $ab667a8f1fb16c30562d2deb99f756$$interop$default = $parcel$interopDefault($ab667a8f1fb16c30562d2deb99f756$exports);
var $be7a0a56123cb91a$exports = {};
function $f9fee2c1db386bde8f28b36a814d1eb2$var$Flex(props, ref) {
let {
children
} = props,
otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["children"]);
$parcel$export($be7a0a56123cb91a$exports, "Flex", () => $be7a0a56123cb91a$export$f51f4c4ede09e011);
let breakpointProvider = useBreakpoint();
let matchedBreakpoints = (breakpointProvider == null ? void 0 : breakpointProvider.matchedBreakpoints) || ['base'];
let {
styleProps
} = useStyleProps(otherProps);
let {
styleProps: flexStyle
} = useStyleProps(otherProps, $f9fee2c1db386bde8f28b36a814d1eb2$var$flexStyleProps);
let domRef = useDOMRef(ref);
let isSSR = useIsSSR(); // If a gap property is specified, and there is no native support or we're in SSR, use a shim.
// Two divs are required for this: the outer one contains most style properties, and the inner
// one is the flex container. Each item inside the flex container gets a margin around it based
// on the gap, and the flex container has a negative margin to counteract this. The outer container
// is necessary to allow nesting of flex containers with gaps, so that the inner CSS variable doesn't
// override the outer one.
if ((props.gap || props.rowGap || props.columnGap) && (isSSR || !$f9fee2c1db386bde8f28b36a814d1eb2$var$isFlexGapSupported())) {
let style = _babelRuntimeHelpersEsmExtends({}, flexStyle.style, {
'--column-gap': props.columnGap != null ? responsiveDimensionValue(props.columnGap, matchedBreakpoints) : undefined,
'--row-gap': props.rowGap != null ? responsiveDimensionValue(props.rowGap, matchedBreakpoints) : undefined,
'--gap': props.gap != null ? responsiveDimensionValue(props.gap, matchedBreakpoints) : undefined
});
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersEsmExtends({}, filterDOMProps(otherProps), styleProps, {
className: classNames($ab667a8f1fb16c30562d2deb99f756$$interop$default, 'flex-container', styleProps.className),
ref: domRef
}), /*#__PURE__*/_react.createElement("div", {
className: classNames($ab667a8f1fb16c30562d2deb99f756$$interop$default, 'flex', 'flex-gap'),
style: style
}, children));
} // If no gaps, or native support exists, then we only need to render a single div.
var $a719c1e6c17b3619$exports = {};
$parcel$export($a719c1e6c17b3619$exports, "flex-container", () => $a719c1e6c17b3619$export$69d7a39fa31a000b, (v) => $a719c1e6c17b3619$export$69d7a39fa31a000b = v);
$parcel$export($a719c1e6c17b3619$exports, "flex", () => $a719c1e6c17b3619$export$97691fbb80847c19, (v) => $a719c1e6c17b3619$export$97691fbb80847c19 = v);
$parcel$export($a719c1e6c17b3619$exports, "flex-gap", () => $a719c1e6c17b3619$export$31a9da8b58047a44, (v) => $a719c1e6c17b3619$export$31a9da8b58047a44 = v);
var $a719c1e6c17b3619$export$69d7a39fa31a000b;
var $a719c1e6c17b3619$export$97691fbb80847c19;
var $a719c1e6c17b3619$export$31a9da8b58047a44;
$a719c1e6c17b3619$export$69d7a39fa31a000b = "_flex-container_e15493";
$a719c1e6c17b3619$export$97691fbb80847c19 = "_flex_e15493";
$a719c1e6c17b3619$export$31a9da8b58047a44 = "_flex-gap_e15493";
let style = _babelRuntimeHelpersEsmExtends({}, styleProps.style, flexStyle.style);
if (props.gap != null) {
style.gap = responsiveDimensionValue(props.gap, matchedBreakpoints);
}
if (props.columnGap != null) {
style.columnGap = responsiveDimensionValue(props.columnGap, matchedBreakpoints);
}
if (props.rowGap != null) {
style.rowGap = responsiveDimensionValue(props.rowGap, matchedBreakpoints);
}
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersEsmExtends({}, filterDOMProps(otherProps), {
className: classNames($ab667a8f1fb16c30562d2deb99f756$$interop$default, 'flex', styleProps.className),
style: style,
ref: domRef
}), children);
const $be7a0a56123cb91a$var$flexStyleProps = {
direction: [
'flexDirection',
$4QZis$passthroughStyle
],
wrap: [
'flexWrap',
$be7a0a56123cb91a$var$flexWrapValue
],
justifyContent: [
'justifyContent',
$be7a0a56123cb91a$var$flexAlignValue
],
alignItems: [
'alignItems',
$be7a0a56123cb91a$var$flexAlignValue
],
alignContent: [
'alignContent',
$be7a0a56123cb91a$var$flexAlignValue
]
};
function $be7a0a56123cb91a$var$Flex(props, ref) {
let { children: children , ...otherProps } = props;
let breakpointProvider = $4QZis$useBreakpoint();
let matchedBreakpoints = breakpointProvider?.matchedBreakpoints || [
'base'
];
let { styleProps: styleProps } = $4QZis$useStyleProps(otherProps);
let { styleProps: flexStyle } = $4QZis$useStyleProps(otherProps, $be7a0a56123cb91a$var$flexStyleProps);
let domRef = $4QZis$useDOMRef(ref);
let isSSR = $4QZis$useIsSSR();
// If a gap property is specified, and there is no native support or we're in SSR, use a shim.
// Two divs are required for this: the outer one contains most style properties, and the inner
// one is the flex container. Each item inside the flex container gets a margin around it based
// on the gap, and the flex container has a negative margin to counteract this. The outer container
// is necessary to allow nesting of flex containers with gaps, so that the inner CSS variable doesn't
// override the outer one.
if ((props.gap || props.rowGap || props.columnGap) && (isSSR || !$be7a0a56123cb91a$var$isFlexGapSupported())) {
let style = {
...flexStyle.style,
'--column-gap': props.columnGap != null ? $4QZis$responsiveDimensionValue(props.columnGap, matchedBreakpoints) : undefined,
'--row-gap': props.rowGap != null ? $4QZis$responsiveDimensionValue(props.rowGap, matchedBreakpoints) : undefined,
'--gap': props.gap != null ? $4QZis$responsiveDimensionValue(props.gap, matchedBreakpoints) : undefined
};
return(/*#__PURE__*/ $4QZis$react.createElement("div", {
...$4QZis$filterDOMProps(otherProps),
...styleProps,
className: $4QZis$classNames((/*@__PURE__*/$parcel$interopDefault($a719c1e6c17b3619$exports)), 'flex-container', styleProps.className),
ref: domRef
}, /*#__PURE__*/ $4QZis$react.createElement("div", {
className: $4QZis$classNames((/*@__PURE__*/$parcel$interopDefault($a719c1e6c17b3619$exports)), 'flex', 'flex-gap'),
style: style
}, children)));
}
// If no gaps, or native support exists, then we only need to render a single div.
let style = {
...styleProps.style,
...flexStyle.style
};
if (props.gap != null) style.gap = $4QZis$responsiveDimensionValue(props.gap, matchedBreakpoints);
if (props.columnGap != null) style.columnGap = $4QZis$responsiveDimensionValue(props.columnGap, matchedBreakpoints);
if (props.rowGap != null) style.rowGap = $4QZis$responsiveDimensionValue(props.rowGap, matchedBreakpoints);
return(/*#__PURE__*/ $4QZis$react.createElement("div", {
...$4QZis$filterDOMProps(otherProps),
className: $4QZis$classNames((/*@__PURE__*/$parcel$interopDefault($a719c1e6c17b3619$exports)), 'flex', styleProps.className),
style: style,
ref: domRef
}, children));
}

@@ -182,57 +209,33 @@ /**

* in flex containers for browser compatibility.
*/
function $f9fee2c1db386bde8f28b36a814d1eb2$var$flexAlignValue(value) {
if (value === 'start') {
return 'flex-start';
}
if (value === 'end') {
return 'flex-end';
}
return value;
*/ function $be7a0a56123cb91a$var$flexAlignValue(value) {
if (value === 'start') return 'flex-start';
if (value === 'end') return 'flex-end';
return value;
}
/**
* Takes a boolean and translates it to flex wrap or nowrap.
*/
function $f9fee2c1db386bde8f28b36a814d1eb2$var$flexWrapValue(value) {
if (typeof value === 'boolean') {
return value ? 'wrap' : 'nowrap';
}
return value;
} // Original licensing for the following method can be found in the
*/ function $be7a0a56123cb91a$var$flexWrapValue(value) {
if (typeof value === 'boolean') return value ? 'wrap' : 'nowrap';
return value;
}
// Original licensing for the following method can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/Modernizr/Modernizr/blob/7efb9d0edd66815fb115fdce95fabaf019ce8db5/feature-detects/css/flexgap.js
let $f9fee2c1db386bde8f28b36a814d1eb2$var$_isFlexGapSupported = null;
function $f9fee2c1db386bde8f28b36a814d1eb2$var$isFlexGapSupported() {
if ($f9fee2c1db386bde8f28b36a814d1eb2$var$_isFlexGapSupported != null) {
return $f9fee2c1db386bde8f28b36a814d1eb2$var$_isFlexGapSupported;
}
if (typeof document === 'undefined') {
return false;
} // create flex container with row-gap set
var flex = document.createElement('div');
flex.style.display = 'flex';
flex.style.flexDirection = 'column';
flex.style.rowGap = '1px'; // create two, elements inside it
flex.appendChild(document.createElement('div'));
flex.appendChild(document.createElement('div')); // append to the DOM (needed to obtain scrollHeight)
document.body.appendChild(flex);
$f9fee2c1db386bde8f28b36a814d1eb2$var$_isFlexGapSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap
flex.parentNode.removeChild(flex);
return $f9fee2c1db386bde8f28b36a814d1eb2$var$_isFlexGapSupported;
let $be7a0a56123cb91a$var$_isFlexGapSupported = null;
function $be7a0a56123cb91a$var$isFlexGapSupported() {
if ($be7a0a56123cb91a$var$_isFlexGapSupported != null) return $be7a0a56123cb91a$var$_isFlexGapSupported;
if (typeof document === 'undefined') return false;
// create flex container with row-gap set
var flex = document.createElement('div');
flex.style.display = 'flex';
flex.style.flexDirection = 'column';
flex.style.rowGap = '1px';
// create two, elements inside it
flex.appendChild(document.createElement('div'));
flex.appendChild(document.createElement('div'));
// append to the DOM (needed to obtain scrollHeight)
document.body.appendChild(flex);
$be7a0a56123cb91a$var$_isFlexGapSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap
flex.parentNode.removeChild(flex);
return $be7a0a56123cb91a$var$_isFlexGapSupported;
}

@@ -242,6 +245,8 @@ /**

* property to define consistent spacing between items.
*/
*/ const $be7a0a56123cb91a$export$f51f4c4ede09e011 = /*#__PURE__*/ $4QZis$forwardRef($be7a0a56123cb91a$var$Flex);
export const Flex = /*#__PURE__*/forwardRef($f9fee2c1db386bde8f28b36a814d1eb2$var$Flex);
export {$698863dbed9612fa$export$76d90c956114f2c2 as repeat, $698863dbed9612fa$export$9c1b655deaca4988 as minmax, $698863dbed9612fa$export$2f0b47b0911ce698 as fitContent, $698863dbed9612fa$export$ef2184bd89960b14 as Grid, $be7a0a56123cb91a$export$f51f4c4ede09e011 as Flex};
//# sourceMappingURL=module.js.map
{
"name": "@react-spectrum/layout",
"version": "3.2.2-nightly.3040+e2b459ab9",
"version": "3.2.2-nightly.3047+87960ad25",
"description": "Spectrum UI components in React",

@@ -35,11 +35,11 @@ "license": "Apache-2.0",

"@babel/runtime": "^7.6.2",
"@react-aria/ssr": "3.1.1-nightly.3040+e2b459ab9",
"@react-aria/utils": "3.0.0-nightly.1349+e2b459ab9",
"@react-spectrum/utils": "3.0.0-nightly.1349+e2b459ab9",
"@react-types/layout": "3.2.1-nightly.3040+e2b459ab9",
"@react-types/shared": "3.0.0-nightly.1349+e2b459ab9",
"@react-aria/ssr": "3.1.1-nightly.3047+87960ad25",
"@react-aria/utils": "3.0.0-nightly.1356+87960ad25",
"@react-spectrum/utils": "3.0.0-nightly.1356+87960ad25",
"@react-types/layout": "3.2.1-nightly.3047+87960ad25",
"@react-types/shared": "3.0.0-nightly.1356+87960ad25",
"clsx": "^1.1.1"
},
"devDependencies": {
"@adobe/spectrum-css-temp": "3.0.0-nightly.1349+e2b459ab9"
"@adobe/spectrum-css-temp": "3.0.0-nightly.1356+87960ad25"
},

@@ -53,3 +53,3 @@ "peerDependencies": {

},
"gitHead": "e2b459ab996abd06b0913942e9801b88493ed940"
"gitHead": "87960ad25c26bc4cd6af506bb5e7e0f06621556c"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc