react-grid-system
Advanced tools
Comparing version 8.1.9 to 8.2.0
@@ -13,13 +13,11 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const NO_PROVIDER_FLAG = 'NO_PROVIDER_FLAG'; | ||
exports.NO_PROVIDER_FLAG = NO_PROVIDER_FLAG; | ||
const ScreenClassContext = /*#__PURE__*/_react.default.createContext(NO_PROVIDER_FLAG); | ||
exports.ScreenClassContext = ScreenClassContext; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
const NO_PROVIDER_FLAG = exports.NO_PROVIDER_FLAG = "NO_PROVIDER_FLAG"; | ||
const ScreenClassContext = exports.ScreenClassContext = /*#__PURE__*/_react.default.createContext(NO_PROVIDER_FLAG); | ||
const ScreenClassProvider = _ref => { | ||
let { | ||
useOwnWidth, | ||
useOwnWidth = false, | ||
children, | ||
fallbackScreenClass | ||
fallbackScreenClass = null | ||
} = _ref; | ||
@@ -55,9 +53,4 @@ const screenClassRef = (0, _react.useRef)(); | ||
*/ | ||
fallbackScreenClass: _propTypes.default.oneOf([null, 'xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl']) | ||
fallbackScreenClass: _propTypes.default.oneOf([null, "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]) | ||
}; | ||
ScreenClassProvider.defaultProps = { | ||
useOwnWidth: false, | ||
fallbackScreenClass: null | ||
}; | ||
var _default = ScreenClassProvider; | ||
exports.default = _default; | ||
var _default = exports.default = ScreenClassProvider; |
@@ -10,4 +10,4 @@ "use strict"; | ||
var _ScreenClassProvider = _interopRequireWildcard(require("../ScreenClassProvider")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -28,3 +28,2 @@ const ScreenClassResolver = _ref => { | ||
}; | ||
var _default = ScreenClassResolver; | ||
exports.default = _default; | ||
var _default = exports.default = ScreenClassResolver; |
@@ -15,22 +15,22 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
const Col = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => { | ||
let { | ||
children, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
offset, | ||
pull, | ||
push, | ||
order, | ||
debug, | ||
style, | ||
component, | ||
width, | ||
children = null, | ||
xs = null, | ||
sm = null, | ||
md = null, | ||
lg = null, | ||
xl = null, | ||
xxl = null, | ||
xxxl = null, | ||
offset = {}, | ||
pull = {}, | ||
push = {}, | ||
order = {}, | ||
debug = false, | ||
style = {}, | ||
component = _primitives.Div, | ||
width = null, | ||
...otherProps | ||
@@ -76,27 +76,27 @@ } = _ref; | ||
*/ | ||
xs: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(['content'])]), | ||
xs: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `sm`, either a number between 0 and 12, or "content" | ||
*/ | ||
sm: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(['content'])]), | ||
sm: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `md`, either a number between 0 and 12, or "content" | ||
*/ | ||
md: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(['content'])]), | ||
md: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `lg`, either a number between 0 and 12, or "content" | ||
*/ | ||
lg: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(['content'])]), | ||
lg: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `xl`, either a number between 0 and 12, or "content" | ||
*/ | ||
xl: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(['content'])]), | ||
xl: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `xxl`, either a number between 0 and 12, or "content" | ||
*/ | ||
xxl: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(['content'])]), | ||
xxl: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `xxl`, either a number between 0 and 12, or "content" | ||
*/ | ||
xxxl: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(['content'])]), | ||
xxxl: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.oneOf(["content"])]), | ||
/** | ||
@@ -167,22 +167,3 @@ * A fixed width of the column for all screenclasses" | ||
}; | ||
Col.defaultProps = { | ||
children: null, | ||
xs: null, | ||
sm: null, | ||
md: null, | ||
lg: null, | ||
xl: null, | ||
xxl: null, | ||
xxxl: null, | ||
width: null, | ||
offset: {}, | ||
push: {}, | ||
pull: {}, | ||
style: {}, | ||
order: {}, | ||
debug: false, | ||
component: _primitives.Div | ||
}; | ||
Col.displayName = "Col"; | ||
var _default = Col; | ||
exports.default = _default; | ||
var _default = exports.default = Col; |
@@ -14,17 +14,17 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
const Container = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => { | ||
let { | ||
children, | ||
fluid, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
style, | ||
component, | ||
fluid = false, | ||
xs = false, | ||
sm = false, | ||
md = false, | ||
lg = false, | ||
xl = false, | ||
xxl = false, | ||
xxxl = false, | ||
style = {}, | ||
component = _primitives.Div, | ||
...otherProps | ||
@@ -104,16 +104,3 @@ } = _ref; | ||
}; | ||
Container.defaultProps = { | ||
fluid: false, | ||
xs: false, | ||
sm: false, | ||
md: false, | ||
lg: false, | ||
xl: false, | ||
xxl: false, | ||
xxxl: false, | ||
style: {}, | ||
component: _primitives.Div | ||
}; | ||
Container.displayName = "Container"; | ||
var _default = Container; | ||
exports.default = _default; | ||
var _default = exports.default = Container; |
@@ -13,16 +13,15 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const GutterWidthContext = /*#__PURE__*/_react.default.createContext(false); | ||
exports.GutterWidthContext = GutterWidthContext; | ||
const GutterWidthContext = exports.GutterWidthContext = /*#__PURE__*/_react.default.createContext(false); | ||
const Row = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => { | ||
let { | ||
children, | ||
style, | ||
align, | ||
justify, | ||
wrap, | ||
debug, | ||
nogutter, | ||
gutterWidth, | ||
component, | ||
direction, | ||
style = {}, | ||
align = "normal", | ||
justify = "start", | ||
wrap = "wrap", | ||
debug = false, | ||
nogutter = false, | ||
gutterWidth = null, | ||
component = _primitives.Div, | ||
direction = "row", | ||
...otherProps | ||
@@ -32,3 +31,3 @@ } = _ref; | ||
if (nogutter) theGutterWidth = 0; | ||
if (typeof gutterWidth === 'number') theGutterWidth = gutterWidth; | ||
if (typeof gutterWidth === "number") theGutterWidth = gutterWidth; | ||
const theStyle = (0, _style.default)({ | ||
@@ -59,15 +58,15 @@ gutterWidth: theGutterWidth, | ||
*/ | ||
align: _propTypes.default.oneOf(['normal', 'start', 'center', 'end', 'stretch']), | ||
align: _propTypes.default.oneOf(["normal", "start", "center", "end", "stretch"]), | ||
/** | ||
* Horizontal column alignment | ||
*/ | ||
justify: _propTypes.default.oneOf(['start', 'center', 'end', 'between', 'around', 'initial', 'inherit']), | ||
justify: _propTypes.default.oneOf(["start", "center", "end", "between", "around", "initial", "inherit"]), | ||
/** | ||
* flex-direction style attribute | ||
*/ | ||
direction: _propTypes.default.oneOf(['column', 'row', 'column-reverse', 'row-reverse']), | ||
direction: _propTypes.default.oneOf(["column", "row", "column-reverse", "row-reverse"]), | ||
/** | ||
* flex-wrap style attribute | ||
*/ | ||
wrap: _propTypes.default.oneOf(['nowrap', 'wrap', 'reverse']), | ||
wrap: _propTypes.default.oneOf(["nowrap", "wrap", "reverse"]), | ||
/** | ||
@@ -94,15 +93,3 @@ * No gutter for this row | ||
}; | ||
Row.defaultProps = { | ||
align: 'normal', | ||
justify: 'start', | ||
direction: 'row', | ||
wrap: 'wrap', | ||
nogutter: false, | ||
gutterWidth: null, | ||
style: {}, | ||
debug: false, | ||
component: _primitives.Div | ||
}; | ||
Row.displayName = "Row"; | ||
var _default = Row; | ||
exports.default = _default; | ||
var _default = exports.default = Row; |
@@ -75,4 +75,4 @@ "use strict"; | ||
var _utils = require("./utils"); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -7,3 +7,2 @@ "use strict"; | ||
exports.default = void 0; | ||
var _default = 'div'; | ||
exports.default = _default; | ||
var _default = exports.default = 'div'; |
@@ -7,3 +7,2 @@ "use strict"; | ||
exports.default = void 0; | ||
var _default = 'span'; | ||
exports.default = _default; | ||
var _default = exports.default = 'span'; |
@@ -8,3 +8,2 @@ "use strict"; | ||
var _reactNative = require("react-native"); | ||
var _default = _reactNative.View; | ||
exports.default = _default; | ||
var _default = exports.default = _reactNative.View; |
@@ -8,3 +8,2 @@ "use strict"; | ||
/* global window */ | ||
var _default = typeof window !== 'undefined' ? window : undefined; | ||
exports.default = _default; | ||
var _default = exports.default = typeof window !== 'undefined' ? window : undefined; |
@@ -35,3 +35,2 @@ "use strict"; | ||
}; | ||
var _default = WindowRef.current; | ||
exports.default = _default; | ||
var _default = exports.default = WindowRef.current; |
@@ -11,4 +11,4 @@ "use strict"; | ||
var _ScreenClassResolver = _interopRequireDefault(require("../../context/ScreenClassResolver")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -18,9 +18,9 @@ const Hidden = _ref => { | ||
children, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl | ||
xs = false, | ||
sm = false, | ||
md = false, | ||
lg = false, | ||
xl = false, | ||
xxl = false, | ||
xxxl = false | ||
} = _ref; | ||
@@ -72,12 +72,2 @@ return /*#__PURE__*/_react.default.createElement(_ScreenClassResolver.default, null, screenClass => style.hidden({ | ||
}; | ||
Hidden.defaultProps = { | ||
xs: false, | ||
sm: false, | ||
md: false, | ||
lg: false, | ||
xl: false, | ||
xxl: false, | ||
xxxl: false | ||
}; | ||
var _default = Hidden; | ||
exports.default = _default; | ||
var _default = exports.default = Hidden; |
@@ -27,3 +27,2 @@ "use strict"; | ||
exports.hidden = hidden; | ||
var _default = hidden; | ||
exports.default = _default; | ||
var _default = exports.default = hidden; |
@@ -24,3 +24,2 @@ "use strict"; | ||
}; | ||
var _default = ScreenClassRender; | ||
exports.default = _default; | ||
var _default = exports.default = ScreenClassRender; |
@@ -11,4 +11,4 @@ "use strict"; | ||
var _ScreenClassResolver = _interopRequireDefault(require("../../context/ScreenClassResolver")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -18,9 +18,9 @@ const Visible = _ref => { | ||
children, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl | ||
xs = false, | ||
sm = false, | ||
md = false, | ||
lg = false, | ||
xl = false, | ||
xxl = false, | ||
xxxl = false | ||
} = _ref; | ||
@@ -72,12 +72,2 @@ return /*#__PURE__*/_react.default.createElement(_ScreenClassResolver.default, null, screenClass => !style.visible({ | ||
}; | ||
Visible.defaultProps = { | ||
xs: false, | ||
sm: false, | ||
md: false, | ||
lg: false, | ||
xl: false, | ||
xxl: false, | ||
xxxl: false | ||
}; | ||
var _default = Visible; | ||
exports.default = _default; | ||
var _default = exports.default = Visible; |
@@ -27,3 +27,2 @@ "use strict"; | ||
exports.visible = visible; | ||
var _default = visible; | ||
exports.default = _default; | ||
var _default = exports.default = visible; |
@@ -21,4 +21,3 @@ "use strict"; | ||
}; | ||
const screenClasses = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl']; | ||
exports.screenClasses = screenClasses; | ||
const screenClasses = exports.screenClasses = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl']; | ||
const useScreenClass = (source, fallbackScreenClass) => { | ||
@@ -25,0 +24,0 @@ const getScreenClass = () => { |
{ | ||
"name": "react-grid-system", | ||
"version": "8.1.9", | ||
"version": "8.2.0", | ||
"description": "A powerful Bootstrap-like responsive grid system for React.", | ||
@@ -44,21 +44,21 @@ "main": "./build/index.js", | ||
"devDependencies": { | ||
"@babel/cli": "7.21.0", | ||
"@babel/core": "7.21.0", | ||
"@babel/eslint-parser": "7.19.1", | ||
"@babel/preset-env": "7.20.2", | ||
"@babel/preset-react": "7.18.6", | ||
"@babel/cli": "7.23.9", | ||
"@babel/core": "7.23.9", | ||
"@babel/eslint-parser": "7.23.10", | ||
"@babel/preset-env": "7.23.9", | ||
"@babel/preset-react": "7.23.3", | ||
"babel-eslint": "10.1.0", | ||
"babel-loader": "9.1.2", | ||
"eslint": "8.34.0", | ||
"babel-loader": "9.1.3", | ||
"eslint": "8.57.0", | ||
"eslint-config-airbnb": "19.0.4", | ||
"eslint-plugin-import": "2.27.5", | ||
"eslint-plugin-jsx-a11y": "6.7.1", | ||
"eslint-plugin-react": "7.32.2", | ||
"eslint-plugin-import": "2.29.1", | ||
"eslint-plugin-jsx-a11y": "6.8.0", | ||
"eslint-plugin-react": "7.33.2", | ||
"eslint-plugin-react-hooks": "4.6.0", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"react-styleguidist": "13.1.1", | ||
"rimraf": "4.1.2", | ||
"webpack": "5.75.0" | ||
"react-styleguidist": "13.1.2", | ||
"rimraf": "5.0.5", | ||
"webpack": "5.90.3" | ||
} | ||
} |
@@ -1,18 +0,27 @@ | ||
import React, { useRef, useState, useEffect } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { useScreenClass } from '../../utils'; | ||
import { getConfiguration } from '../../config'; | ||
import { Div } from '../../primitives' | ||
import React, { useRef, useState, useEffect } from "react"; | ||
import PropTypes from "prop-types"; | ||
import { useScreenClass } from "../../utils"; | ||
import { getConfiguration } from "../../config"; | ||
import { Div } from "../../primitives"; | ||
export const NO_PROVIDER_FLAG = 'NO_PROVIDER_FLAG'; | ||
export const NO_PROVIDER_FLAG = "NO_PROVIDER_FLAG"; | ||
export const ScreenClassContext = React.createContext(NO_PROVIDER_FLAG); | ||
const ScreenClassProvider = ({ useOwnWidth, children, fallbackScreenClass }) => { | ||
const ScreenClassProvider = ({ | ||
useOwnWidth = false, | ||
children, | ||
fallbackScreenClass = null, | ||
}) => { | ||
const screenClassRef = useRef(); | ||
const [mounted, setMounted] = useState(false); | ||
const detectedScreenClass = useScreenClass(screenClassRef, fallbackScreenClass); | ||
const detectedScreenClass = useScreenClass( | ||
screenClassRef, | ||
fallbackScreenClass | ||
); | ||
const { defaultScreenClass } = getConfiguration(); | ||
const screenClass = mounted ? detectedScreenClass : (fallbackScreenClass || defaultScreenClass); | ||
const screenClass = mounted | ||
? detectedScreenClass | ||
: fallbackScreenClass || defaultScreenClass; | ||
@@ -23,5 +32,7 @@ useEffect(() => setMounted(true), []); | ||
<ScreenClassContext.Provider value={screenClass}> | ||
{useOwnWidth | ||
? <Div ref={useOwnWidth ? screenClassRef : null}>{children}</Div> | ||
: <>{children}</>} | ||
{useOwnWidth ? ( | ||
<Div ref={useOwnWidth ? screenClassRef : null}>{children}</Div> | ||
) : ( | ||
<>{children}</> | ||
)} | ||
</ScreenClassContext.Provider> | ||
@@ -46,10 +57,14 @@ ); | ||
*/ | ||
fallbackScreenClass: PropTypes.oneOf([null, 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' , 'xxxl']), | ||
fallbackScreenClass: PropTypes.oneOf([ | ||
null, | ||
"xs", | ||
"sm", | ||
"md", | ||
"lg", | ||
"xl", | ||
"xxl", | ||
"xxxl", | ||
]), | ||
}; | ||
ScreenClassProvider.defaultProps = { | ||
useOwnWidth: false, | ||
fallbackScreenClass: null, | ||
}; | ||
export default ScreenClassProvider; |
@@ -1,59 +0,69 @@ | ||
import React, { createElement } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import getStyle from './style'; | ||
import { getConfiguration } from '../../config'; | ||
import { GutterWidthContext } from '../Row'; | ||
import ScreenClassResolver from '../../context/ScreenClassResolver'; | ||
import { Div } from '../../primitives'; | ||
import React, { createElement } from "react"; | ||
import PropTypes from "prop-types"; | ||
import getStyle from "./style"; | ||
import { getConfiguration } from "../../config"; | ||
import { GutterWidthContext } from "../Row"; | ||
import ScreenClassResolver from "../../context/ScreenClassResolver"; | ||
import { Div } from "../../primitives"; | ||
const Col = React.forwardRef(({ | ||
children, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
offset, | ||
pull, | ||
push, | ||
order, | ||
debug, | ||
style, | ||
component, | ||
width, | ||
...otherProps | ||
}, ref) => ( | ||
<ScreenClassResolver> | ||
{(screenClass) => ( | ||
<GutterWidthContext.Consumer> | ||
{(gutterWidth) => { | ||
const theStyle = getStyle({ | ||
forceWidth: width, | ||
width: { | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
}, | ||
offset, | ||
pull, | ||
push, | ||
order, | ||
debug, | ||
screenClass, | ||
gutterWidth, | ||
gridColumns: getConfiguration().gridColumns, | ||
moreStyle: style, | ||
}); | ||
return createElement(component, { ref, style: theStyle, ...otherProps, children }); | ||
}} | ||
</GutterWidthContext.Consumer> | ||
)} | ||
</ScreenClassResolver> | ||
)); | ||
const Col = React.forwardRef( | ||
( | ||
{ | ||
children = null, | ||
xs = null, | ||
sm = null, | ||
md = null, | ||
lg = null, | ||
xl = null, | ||
xxl = null, | ||
xxxl = null, | ||
offset = {}, | ||
pull = {}, | ||
push = {}, | ||
order = {}, | ||
debug = false, | ||
style = {}, | ||
component = Div, | ||
width = null, | ||
...otherProps | ||
}, | ||
ref | ||
) => ( | ||
<ScreenClassResolver> | ||
{(screenClass) => ( | ||
<GutterWidthContext.Consumer> | ||
{(gutterWidth) => { | ||
const theStyle = getStyle({ | ||
forceWidth: width, | ||
width: { | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
}, | ||
offset, | ||
pull, | ||
push, | ||
order, | ||
debug, | ||
screenClass, | ||
gutterWidth, | ||
gridColumns: getConfiguration().gridColumns, | ||
moreStyle: style, | ||
}); | ||
return createElement(component, { | ||
ref, | ||
style: theStyle, | ||
...otherProps, | ||
children, | ||
}); | ||
}} | ||
</GutterWidthContext.Consumer> | ||
)} | ||
</ScreenClassResolver> | ||
) | ||
); | ||
@@ -68,55 +78,31 @@ Col.propTypes = { | ||
*/ | ||
xs: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.oneOf(['content']), | ||
]), | ||
xs: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `sm`, either a number between 0 and 12, or "content" | ||
*/ | ||
sm: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.oneOf(['content']), | ||
]), | ||
sm: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `md`, either a number between 0 and 12, or "content" | ||
*/ | ||
md: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.oneOf(['content']), | ||
]), | ||
md: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `lg`, either a number between 0 and 12, or "content" | ||
*/ | ||
lg: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.oneOf(['content']), | ||
]), | ||
lg: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `xl`, either a number between 0 and 12, or "content" | ||
*/ | ||
xl: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.oneOf(['content']), | ||
]), | ||
xl: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `xxl`, either a number between 0 and 12, or "content" | ||
*/ | ||
xxl: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.oneOf(['content']), | ||
]), | ||
xxl: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(["content"])]), | ||
/** | ||
* The width of the column for screenclass `xxl`, either a number between 0 and 12, or "content" | ||
*/ | ||
xxxl: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.oneOf(['content']), | ||
]), | ||
xxxl: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(["content"])]), | ||
/** | ||
* A fixed width of the column for all screenclasses" | ||
*/ | ||
width: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.string, | ||
]), | ||
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
/** | ||
@@ -173,3 +159,5 @@ * The offset of this column for all screenclasses | ||
*/ | ||
style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), | ||
style: PropTypes.objectOf( | ||
PropTypes.oneOfType([PropTypes.number, PropTypes.string]) | ||
), | ||
/** | ||
@@ -185,23 +173,4 @@ * Set to apply some debug styling | ||
Col.defaultProps = { | ||
children: null, | ||
xs: null, | ||
sm: null, | ||
md: null, | ||
lg: null, | ||
xl: null, | ||
xxl: null, | ||
xxxl: null, | ||
width: null, | ||
offset: {}, | ||
push: {}, | ||
pull: {}, | ||
style: {}, | ||
order: {}, | ||
debug: false, | ||
component: Div, | ||
}; | ||
Col.displayName = "Col"; | ||
export default Col; |
@@ -1,47 +0,54 @@ | ||
import React, { createElement } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import getStyle from './style'; | ||
import { getConfiguration } from '../../config'; | ||
import ScreenClassResolver from '../../context/ScreenClassResolver'; | ||
import { Div } from '../../primitives'; | ||
import React, { createElement } from "react"; | ||
import PropTypes from "prop-types"; | ||
import getStyle from "./style"; | ||
import { getConfiguration } from "../../config"; | ||
import ScreenClassResolver from "../../context/ScreenClassResolver"; | ||
import { Div } from "../../primitives"; | ||
const Container = React.forwardRef(({ | ||
children, | ||
fluid, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
style, | ||
component, | ||
...otherProps | ||
}, ref) => ( | ||
<ScreenClassResolver> | ||
{(screenClass) => createElement( | ||
component, | ||
{ | ||
ref, | ||
style: getStyle({ | ||
fluid, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
screenClass, | ||
containerWidths: getConfiguration().containerWidths, | ||
gutterWidth: getConfiguration().gutterWidth, | ||
moreStyle: style, | ||
}), | ||
...otherProps, | ||
}, | ||
const Container = React.forwardRef( | ||
( | ||
{ | ||
children, | ||
)} | ||
</ScreenClassResolver> | ||
)); | ||
fluid = false, | ||
xs = false, | ||
sm = false, | ||
md = false, | ||
lg = false, | ||
xl = false, | ||
xxl = false, | ||
xxxl = false, | ||
style = {}, | ||
component = Div, | ||
...otherProps | ||
}, | ||
ref | ||
) => ( | ||
<ScreenClassResolver> | ||
{(screenClass) => | ||
createElement( | ||
component, | ||
{ | ||
ref, | ||
style: getStyle({ | ||
fluid, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
screenClass, | ||
containerWidths: getConfiguration().containerWidths, | ||
gutterWidth: getConfiguration().gutterWidth, | ||
moreStyle: style, | ||
}), | ||
...otherProps, | ||
}, | ||
children | ||
) | ||
} | ||
</ScreenClassResolver> | ||
) | ||
); | ||
@@ -95,3 +102,5 @@ Container.propTypes = { | ||
*/ | ||
style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), | ||
style: PropTypes.objectOf( | ||
PropTypes.oneOfType([PropTypes.number, PropTypes.string]) | ||
), | ||
/** | ||
@@ -103,17 +112,4 @@ * Use your own component | ||
Container.defaultProps = { | ||
fluid: false, | ||
xs: false, | ||
sm: false, | ||
md: false, | ||
lg: false, | ||
xl: false, | ||
xxl: false, | ||
xxxl: false, | ||
style: {}, | ||
component: Div, | ||
}; | ||
Container.displayName = "Container"; | ||
export default Container; |
@@ -1,42 +0,47 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { getConfiguration } from '../../config'; | ||
import getStyle from './style'; | ||
import { Div } from '../../primitives'; | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import { getConfiguration } from "../../config"; | ||
import getStyle from "./style"; | ||
import { Div } from "../../primitives"; | ||
export const GutterWidthContext = React.createContext(false); | ||
const Row = React.forwardRef(({ | ||
children, | ||
style, | ||
align, | ||
justify, | ||
wrap, | ||
debug, | ||
nogutter, | ||
gutterWidth, | ||
component, | ||
direction, | ||
...otherProps | ||
}, ref) => { | ||
let theGutterWidth = getConfiguration().gutterWidth; | ||
if (nogutter) theGutterWidth = 0; | ||
if (typeof gutterWidth === 'number') theGutterWidth = gutterWidth; | ||
const theStyle = getStyle({ | ||
gutterWidth: theGutterWidth, | ||
align, | ||
justify, | ||
debug, | ||
moreStyle: style, | ||
direction, | ||
wrap | ||
}); | ||
return React.createElement( | ||
component, | ||
{ ref, style: theStyle, ...otherProps }, | ||
<GutterWidthContext.Provider value={theGutterWidth}> | ||
{children} | ||
</GutterWidthContext.Provider>, | ||
); | ||
}); | ||
const Row = React.forwardRef( | ||
( | ||
{ | ||
children, | ||
style = {}, | ||
align = "normal", | ||
justify = "start", | ||
wrap = "wrap", | ||
debug = false, | ||
nogutter = false, | ||
gutterWidth = null, | ||
component = Div, | ||
direction = "row", | ||
...otherProps | ||
}, | ||
ref | ||
) => { | ||
let theGutterWidth = getConfiguration().gutterWidth; | ||
if (nogutter) theGutterWidth = 0; | ||
if (typeof gutterWidth === "number") theGutterWidth = gutterWidth; | ||
const theStyle = getStyle({ | ||
gutterWidth: theGutterWidth, | ||
align, | ||
justify, | ||
debug, | ||
moreStyle: style, | ||
direction, | ||
wrap, | ||
}); | ||
return React.createElement( | ||
component, | ||
{ ref, style: theStyle, ...otherProps }, | ||
<GutterWidthContext.Provider value={theGutterWidth}> | ||
{children} | ||
</GutterWidthContext.Provider> | ||
); | ||
} | ||
); | ||
@@ -51,3 +56,3 @@ Row.propTypes = { | ||
*/ | ||
align: PropTypes.oneOf(['normal', 'start', 'center', 'end', 'stretch']), | ||
align: PropTypes.oneOf(["normal", "start", "center", "end", "stretch"]), | ||
/** | ||
@@ -57,9 +62,9 @@ * Horizontal column alignment | ||
justify: PropTypes.oneOf([ | ||
'start', | ||
'center', | ||
'end', | ||
'between', | ||
'around', | ||
'initial', | ||
'inherit', | ||
"start", | ||
"center", | ||
"end", | ||
"between", | ||
"around", | ||
"initial", | ||
"inherit", | ||
]), | ||
@@ -69,7 +74,12 @@ /** | ||
*/ | ||
direction: PropTypes.oneOf(['column', 'row', 'column-reverse', 'row-reverse']), | ||
direction: PropTypes.oneOf([ | ||
"column", | ||
"row", | ||
"column-reverse", | ||
"row-reverse", | ||
]), | ||
/** | ||
* flex-wrap style attribute | ||
*/ | ||
wrap: PropTypes.oneOf(['nowrap', 'wrap', 'reverse']), | ||
wrap: PropTypes.oneOf(["nowrap", "wrap", "reverse"]), | ||
/** | ||
@@ -87,3 +97,3 @@ * No gutter for this row | ||
style: PropTypes.objectOf( | ||
PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
PropTypes.oneOfType([PropTypes.number, PropTypes.string]) | ||
), | ||
@@ -97,19 +107,7 @@ /** | ||
*/ | ||
component: PropTypes.elementType | ||
component: PropTypes.elementType, | ||
}; | ||
Row.defaultProps = { | ||
align: 'normal', | ||
justify: 'start', | ||
direction: 'row', | ||
wrap: 'wrap', | ||
nogutter: false, | ||
gutterWidth: null, | ||
style: {}, | ||
debug: false, | ||
component: Div, | ||
}; | ||
Row.displayName = "Row"; | ||
export default Row; |
@@ -1,29 +0,31 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import * as style from './style'; | ||
import ScreenClassResolver from '../../context/ScreenClassResolver'; | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import * as style from "./style"; | ||
import ScreenClassResolver from "../../context/ScreenClassResolver"; | ||
const Hidden = ({ | ||
children, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
xs = false, | ||
sm = false, | ||
md = false, | ||
lg = false, | ||
xl = false, | ||
xxl = false, | ||
xxxl = false, | ||
}) => ( | ||
<ScreenClassResolver> | ||
{(screenClass) => (style.hidden({ | ||
screenClass, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
}) | ||
? null | ||
: children)} | ||
{(screenClass) => | ||
style.hidden({ | ||
screenClass, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
}) | ||
? null | ||
: children | ||
} | ||
</ScreenClassResolver> | ||
@@ -67,12 +69,2 @@ ); | ||
Hidden.defaultProps = { | ||
xs: false, | ||
sm: false, | ||
md: false, | ||
lg: false, | ||
xl: false, | ||
xxl: false, | ||
xxxl: false, | ||
}; | ||
export default Hidden; |
@@ -1,29 +0,31 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import * as style from './style'; | ||
import ScreenClassResolver from '../../context/ScreenClassResolver'; | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import * as style from "./style"; | ||
import ScreenClassResolver from "../../context/ScreenClassResolver"; | ||
const Visible = ({ | ||
children, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
xs = false, | ||
sm = false, | ||
md = false, | ||
lg = false, | ||
xl = false, | ||
xxl = false, | ||
xxxl = false, | ||
}) => ( | ||
<ScreenClassResolver> | ||
{(screenClass) => (!style.visible({ | ||
screenClass, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
}) | ||
? null | ||
: children)} | ||
{(screenClass) => | ||
!style.visible({ | ||
screenClass, | ||
xs, | ||
sm, | ||
md, | ||
lg, | ||
xl, | ||
xxl, | ||
xxxl, | ||
}) | ||
? null | ||
: children | ||
} | ||
</ScreenClassResolver> | ||
@@ -67,12 +69,2 @@ ); | ||
Visible.defaultProps = { | ||
xs: false, | ||
sm: false, | ||
md: false, | ||
lg: false, | ||
xl: false, | ||
xxl: false, | ||
xxxl: false, | ||
}; | ||
export default Visible; |
88986
2065