@ag.ds-next/content
Advanced tools
Comparing version 7.0.0 to 8.0.0
# @ag.ds-next/content | ||
## 8.0.0 | ||
### Patch Changes | ||
- 2ee1443ee: Update documentation | ||
- 042fb9e8c: Added `@babel/runtime` as a package dependency. | ||
- Updated dependencies [0f76d269a] | ||
- Updated dependencies [d43864f0e] | ||
- Updated dependencies [27b6ef36b] | ||
- Updated dependencies [46eea44f4] | ||
- Updated dependencies [b67fa1685] | ||
- Updated dependencies [042fb9e8c] | ||
- @ag.ds-next/box@6.1.0 | ||
- @ag.ds-next/core@3.0.1 | ||
## 7.0.0 | ||
@@ -4,0 +19,0 @@ |
@@ -5,29 +5,14 @@ 'use strict'; | ||
var _defineProperty = require('@babel/runtime/helpers/defineProperty'); | ||
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties'); | ||
var box = require('@ag.ds-next/box'); | ||
var core = require('@ag.ds-next/core'); | ||
var react = require('react'); | ||
var react$1 = require('@emotion/react'); | ||
var jsxRuntime = require('@emotion/react/jsx-runtime'); | ||
require('@emotion/react'); | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
var ContentSpacingContext = /*#__PURE__*/react.createContext(undefined); | ||
var useContentSpacing = function useContentSpacing() { | ||
var value = react.useContext(ContentSpacingContext); | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
const ContentSpacingContext = react.createContext(undefined); | ||
const useContentSpacing = () => { | ||
const value = react.useContext(ContentSpacingContext); | ||
if (value === undefined) { | ||
@@ -40,3 +25,3 @@ throw new Error('Context not found'); | ||
const paddingYMap = { | ||
var paddingYMap = { | ||
none: { | ||
@@ -68,81 +53,117 @@ top: 0, | ||
function BaseContent({ | ||
as = 'section', | ||
className, | ||
palette, | ||
background, | ||
children, | ||
paddingY | ||
}) { | ||
return react$1.jsx(ContentSpacingContext.Provider, { | ||
value: paddingY | ||
}, react$1.jsx(box.Flex, { | ||
as: as, | ||
justifyContent: "center", | ||
palette: palette, | ||
background: background, | ||
className: className | ||
}, react$1.jsx(box.Box, { | ||
width: "100%", | ||
maxWidth: core.tokens.maxWidth.container, | ||
paddingTop: paddingYMap[paddingY].top, | ||
paddingBottom: paddingYMap[paddingY].bottom, | ||
paddingX: core.tokens.containerPadding | ||
}, children))); | ||
function BaseContent(_ref) { | ||
var _ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'section' : _ref$as, | ||
className = _ref.className, | ||
palette = _ref.palette, | ||
background = _ref.background, | ||
children = _ref.children, | ||
paddingY = _ref.paddingY; | ||
return jsxRuntime.jsx(ContentSpacingContext.Provider, { | ||
value: paddingY, | ||
children: jsxRuntime.jsx(box.Flex, { | ||
as: as, | ||
justifyContent: "center", | ||
palette: palette, | ||
background: background, | ||
className: className, | ||
children: jsxRuntime.jsx(box.Box, { | ||
width: "100%", | ||
maxWidth: core.tokens.maxWidth.container, | ||
paddingTop: paddingYMap[paddingY].top, | ||
paddingBottom: paddingYMap[paddingY].bottom, | ||
paddingX: core.tokens.containerPadding, | ||
children: children | ||
}) | ||
}) | ||
}); | ||
} | ||
function Content({ | ||
children, | ||
as = 'div', | ||
...props | ||
}) { | ||
return react$1.jsx(BaseContent, _extends({ | ||
var _excluded$2 = ["children", "as"]; | ||
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function Content(_ref) { | ||
var children = _ref.children, | ||
_ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'div' : _ref$as, | ||
props = _objectWithoutProperties(_ref, _excluded$2); | ||
return jsxRuntime.jsx(BaseContent, _objectSpread$2(_objectSpread$2({ | ||
as: as | ||
}, props, { | ||
paddingY: "none" | ||
}), children); | ||
}, props), {}, { | ||
paddingY: "none", | ||
children: children | ||
})); | ||
} | ||
function PageContent({ | ||
children, | ||
as = 'div', | ||
...props | ||
}) { | ||
return react$1.jsx(BaseContent, _extends({ | ||
var _excluded$1 = ["children", "as"]; | ||
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function PageContent(_ref) { | ||
var children = _ref.children, | ||
_ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'div' : _ref$as, | ||
props = _objectWithoutProperties(_ref, _excluded$1); | ||
return jsxRuntime.jsx(BaseContent, _objectSpread$1(_objectSpread$1({ | ||
as: as | ||
}, props, { | ||
paddingY: "page" | ||
}), children); | ||
}, props), {}, { | ||
paddingY: "page", | ||
children: children | ||
})); | ||
} | ||
function SectionContent({ | ||
children, | ||
as = 'section', | ||
...props | ||
}) { | ||
return react$1.jsx(BaseContent, _extends({ | ||
var _excluded = ["children", "as"]; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function SectionContent(_ref) { | ||
var children = _ref.children, | ||
_ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'section' : _ref$as, | ||
props = _objectWithoutProperties(_ref, _excluded); | ||
return jsxRuntime.jsx(BaseContent, _objectSpread(_objectSpread({ | ||
as: as | ||
}, props, { | ||
paddingY: "section" | ||
}), children); | ||
}, props), {}, { | ||
paddingY: "section", | ||
children: children | ||
})); | ||
} | ||
function ContentBleed({ | ||
children, | ||
visible | ||
}) { | ||
const spacing = useContentSpacing(); | ||
return react$1.jsx("div", { | ||
function ContentBleed(_ref) { | ||
var children = _ref.children, | ||
visible = _ref.visible; | ||
var spacing = useContentSpacing(); | ||
return jsxRuntime.jsx("div", { | ||
css: [// Use negative margins to position this element | ||
core.mq({ | ||
marginTop: core.mapResponsiveProp(paddingYMap[spacing].top, v => `-${core.mapSpacing(v)}`), | ||
marginLeft: core.mapResponsiveProp(core.tokens.containerPadding, v => `-${core.mapSpacing(v)}`), | ||
marginRight: core.mapResponsiveProp(core.tokens.containerPadding, v => `-${core.mapSpacing(v)}`) | ||
marginTop: core.mapResponsiveProp(paddingYMap[spacing].top, function (v) { | ||
return "-".concat(core.mapSpacing(v)); | ||
}), | ||
marginLeft: core.mapResponsiveProp(core.tokens.containerPadding, function (v) { | ||
return "-".concat(core.mapSpacing(v)); | ||
}), | ||
marginRight: core.mapResponsiveProp(core.tokens.containerPadding, function (v) { | ||
return "-".concat(core.mapSpacing(v)); | ||
}) | ||
}), // Override any margins set when the `visible` prop is set | ||
core.mq({ | ||
marginTop: core.mapResponsiveProp(visible, v => v ? undefined : 0), | ||
marginLeft: core.mapResponsiveProp(visible, v => v ? undefined : 0), | ||
marginRight: core.mapResponsiveProp(visible, v => v ? undefined : 0) | ||
}), process.env.NODE_ENV === "production" ? "" : ";label:ContentBleed;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbnRlbnRCbGVlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbUJHIiwiZmlsZSI6IkNvbnRlbnRCbGVlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQcm9wc1dpdGhDaGlsZHJlbiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7XG5cdG1hcFJlc3BvbnNpdmVQcm9wLFxuXHRtYXBTcGFjaW5nLFxuXHRtcSxcblx0UmVzcG9uc2l2ZVByb3AsXG5cdHRva2Vucyxcbn0gZnJvbSAnQGFnLmRzLW5leHQvY29yZSc7XG5pbXBvcnQgeyB1c2VDb250ZW50U3BhY2luZyB9IGZyb20gJy4vY29udGV4dCc7XG5pbXBvcnQgeyBwYWRkaW5nWU1hcCB9IGZyb20gJy4vdXRpbHMnO1xuXG5leHBvcnQgdHlwZSBDb250ZW50QmxlZWRQcm9wcyA9IFByb3BzV2l0aENoaWxkcmVuPHtcblx0dmlzaWJsZT86IFJlc3BvbnNpdmVQcm9wPGJvb2xlYW4+O1xufT47XG5cbmV4cG9ydCBmdW5jdGlvbiBDb250ZW50QmxlZWQoeyBjaGlsZHJlbiwgdmlzaW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pYmxlLCAodikgPT4gKHYgPyB1bmRlZmluZWQgOiAwKSksXG5cdFx0XHRcdFx0bWFyZ2luUmlnaHQ6IG1hcFJlc3BvbnNpdmVQcm9wKHZpc2libGUsICh2KSA9PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0fSksXG5cdFx0XHRdfVxuXHRcdD5cblx0XHRcdHtjaGlsZHJlbn1cblx0XHQ8L2Rpdj5cblx0KTtcbn1cbiJdfQ== */"] | ||
}, children); | ||
marginTop: core.mapResponsiveProp(visible, function (v) { | ||
return v ? undefined : 0; | ||
}), | ||
marginLeft: core.mapResponsiveProp(visible, function (v) { | ||
return v ? undefined : 0; | ||
}), | ||
marginRight: core.mapResponsiveProp(visible, function (v) { | ||
return v ? undefined : 0; | ||
}) | ||
}), process.env.NODE_ENV === "production" ? "" : ";label:ContentBleed;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbnRlbnRCbGVlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbUJHIiwiZmlsZSI6IkNvbnRlbnRCbGVlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQcm9wc1dpdGhDaGlsZHJlbiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7XG5cdG1hcFJlc3BvbnNpdmVQcm9wLFxuXHRtYXBTcGFjaW5nLFxuXHRtcSxcblx0UmVzcG9uc2l2ZVByb3AsXG5cdHRva2Vucyxcbn0gZnJvbSAnQGFnLmRzLW5leHQvY29yZSc7XG5pbXBvcnQgeyB1c2VDb250ZW50U3BhY2luZyB9IGZyb20gJy4vY29udGV4dCc7XG5pbXBvcnQgeyBwYWRkaW5nWU1hcCB9IGZyb20gJy4vdXRpbHMnO1xuXG5leHBvcnQgdHlwZSBDb250ZW50QmxlZWRQcm9wcyA9IFByb3BzV2l0aENoaWxkcmVuPHtcbl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NpdmVQcm9wKHZpc2libGUsICh2KSA9PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0XHRtYXJnaW5MZWZ0OiBtYXBSZXNwb25zaXZlUHJvcCh2aXNpYmxlLCAodikgPT4gKHYgPyB1bmRlZmluZWQgOiAwKSksXG5cdFx0XHRcdFx0bWFyZ2luUmlnaHQ6IG1hcFJlc3BvbnNpdmVQcm9wKHZpc2libGUsICh2KSA9PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0fSksXG5cdFx0XHRdfVxuXHRcdD5cblx0XHRcdHtjaGlsZHJlbn1cblx0XHQ8L2Rpdj5cblx0KTtcbn1cbiJdfQ== */", process.env.NODE_ENV === "production" ? "" : ";label:ContentBleed;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbnRlbnRCbGVlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbUJHIiwiZmlsZSI6IkNvbnRlbnRCbGVlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQcm9wc1dpdGhDaGlsZHJlbiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7XG5cdG1hcFJlc3BvbnNpdmVQcm9wLFxuXHRtYXBTcGFjaW5nLFxuXHRtcSxcblx0UmVzcG9uc2l2ZVByb3AsXG5cdHRva2Vucyxcbn0gZnJvbSAnQGFnLmRzLW5leHQvY29yZSc7XG5pbXBvcnQgeyB1c2VDb250ZW50U3BhY2luZyB9IGZyb20gJy4vY29udGV4dCc7XG5pbXBvcnQgeyBwYWRkaW5nWU1hcCB9IGZyb20gJy4vdXRpbHMnO1xuXG5leHBvcnQgdHlwZSBDb250ZW50QmxlZWRQcm9wcyA9IFByb3BzV2l0aENoaWxkcmVuPHtcblx0dmlzaWJsZT86IFJlc3BvbnNpdmVQcm9wPGJvb2xlYW4+O1xufT47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DApKSxcblx0XHRcdFx0XHRtYXJnaW5MZWZ0OiBtYXBSZXNwb25zaXZlUHJvcCh2aXNpYmxlLCAodikgPT4gKHYgPyB1bmRlZmluZWQgOiAwKSksXG5cdFx0XHRcdFx0bWFyZ2luUmlnaHQ6IG1hcFJlc3BvbnNpdmVQcm9wKHZpc2libGUsICh2KSA9PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0fSksXG5cdFx0XHRdfVxuXHRcdD5cblx0XHRcdHtjaGlsZHJlbn1cblx0XHQ8L2Rpdj5cblx0KTtcbn1cbiJdfQ== */"], | ||
children: children | ||
}); | ||
} | ||
@@ -149,0 +170,0 @@ |
@@ -5,29 +5,14 @@ 'use strict'; | ||
var _defineProperty = require('@babel/runtime/helpers/defineProperty'); | ||
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties'); | ||
var box = require('@ag.ds-next/box'); | ||
var core = require('@ag.ds-next/core'); | ||
var react = require('react'); | ||
var react$1 = require('@emotion/react'); | ||
var jsxRuntime = require('@emotion/react/jsx-runtime'); | ||
require('@emotion/react'); | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
var ContentSpacingContext = /*#__PURE__*/react.createContext(undefined); | ||
var useContentSpacing = function useContentSpacing() { | ||
var value = react.useContext(ContentSpacingContext); | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
const ContentSpacingContext = react.createContext(undefined); | ||
const useContentSpacing = () => { | ||
const value = react.useContext(ContentSpacingContext); | ||
if (value === undefined) { | ||
@@ -40,3 +25,3 @@ throw new Error('Context not found'); | ||
const paddingYMap = { | ||
var paddingYMap = { | ||
none: { | ||
@@ -68,81 +53,117 @@ top: 0, | ||
function BaseContent({ | ||
as = 'section', | ||
className, | ||
palette, | ||
background, | ||
children, | ||
paddingY | ||
}) { | ||
return react$1.jsx(ContentSpacingContext.Provider, { | ||
value: paddingY | ||
}, react$1.jsx(box.Flex, { | ||
as: as, | ||
justifyContent: "center", | ||
palette: palette, | ||
background: background, | ||
className: className | ||
}, react$1.jsx(box.Box, { | ||
width: "100%", | ||
maxWidth: core.tokens.maxWidth.container, | ||
paddingTop: paddingYMap[paddingY].top, | ||
paddingBottom: paddingYMap[paddingY].bottom, | ||
paddingX: core.tokens.containerPadding | ||
}, children))); | ||
function BaseContent(_ref) { | ||
var _ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'section' : _ref$as, | ||
className = _ref.className, | ||
palette = _ref.palette, | ||
background = _ref.background, | ||
children = _ref.children, | ||
paddingY = _ref.paddingY; | ||
return jsxRuntime.jsx(ContentSpacingContext.Provider, { | ||
value: paddingY, | ||
children: jsxRuntime.jsx(box.Flex, { | ||
as: as, | ||
justifyContent: "center", | ||
palette: palette, | ||
background: background, | ||
className: className, | ||
children: jsxRuntime.jsx(box.Box, { | ||
width: "100%", | ||
maxWidth: core.tokens.maxWidth.container, | ||
paddingTop: paddingYMap[paddingY].top, | ||
paddingBottom: paddingYMap[paddingY].bottom, | ||
paddingX: core.tokens.containerPadding, | ||
children: children | ||
}) | ||
}) | ||
}); | ||
} | ||
function Content({ | ||
children, | ||
as = 'div', | ||
...props | ||
}) { | ||
return react$1.jsx(BaseContent, _extends({ | ||
var _excluded$2 = ["children", "as"]; | ||
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function Content(_ref) { | ||
var children = _ref.children, | ||
_ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'div' : _ref$as, | ||
props = _objectWithoutProperties(_ref, _excluded$2); | ||
return jsxRuntime.jsx(BaseContent, _objectSpread$2(_objectSpread$2({ | ||
as: as | ||
}, props, { | ||
paddingY: "none" | ||
}), children); | ||
}, props), {}, { | ||
paddingY: "none", | ||
children: children | ||
})); | ||
} | ||
function PageContent({ | ||
children, | ||
as = 'div', | ||
...props | ||
}) { | ||
return react$1.jsx(BaseContent, _extends({ | ||
var _excluded$1 = ["children", "as"]; | ||
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function PageContent(_ref) { | ||
var children = _ref.children, | ||
_ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'div' : _ref$as, | ||
props = _objectWithoutProperties(_ref, _excluded$1); | ||
return jsxRuntime.jsx(BaseContent, _objectSpread$1(_objectSpread$1({ | ||
as: as | ||
}, props, { | ||
paddingY: "page" | ||
}), children); | ||
}, props), {}, { | ||
paddingY: "page", | ||
children: children | ||
})); | ||
} | ||
function SectionContent({ | ||
children, | ||
as = 'section', | ||
...props | ||
}) { | ||
return react$1.jsx(BaseContent, _extends({ | ||
var _excluded = ["children", "as"]; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function SectionContent(_ref) { | ||
var children = _ref.children, | ||
_ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'section' : _ref$as, | ||
props = _objectWithoutProperties(_ref, _excluded); | ||
return jsxRuntime.jsx(BaseContent, _objectSpread(_objectSpread({ | ||
as: as | ||
}, props, { | ||
paddingY: "section" | ||
}), children); | ||
}, props), {}, { | ||
paddingY: "section", | ||
children: children | ||
})); | ||
} | ||
function ContentBleed({ | ||
children, | ||
visible | ||
}) { | ||
const spacing = useContentSpacing(); | ||
return react$1.jsx("div", { | ||
function ContentBleed(_ref) { | ||
var children = _ref.children, | ||
visible = _ref.visible; | ||
var spacing = useContentSpacing(); | ||
return jsxRuntime.jsx("div", { | ||
css: [// Use negative margins to position this element | ||
core.mq({ | ||
marginTop: core.mapResponsiveProp(paddingYMap[spacing].top, v => `-${core.mapSpacing(v)}`), | ||
marginLeft: core.mapResponsiveProp(core.tokens.containerPadding, v => `-${core.mapSpacing(v)}`), | ||
marginRight: core.mapResponsiveProp(core.tokens.containerPadding, v => `-${core.mapSpacing(v)}`) | ||
marginTop: core.mapResponsiveProp(paddingYMap[spacing].top, function (v) { | ||
return "-".concat(core.mapSpacing(v)); | ||
}), | ||
marginLeft: core.mapResponsiveProp(core.tokens.containerPadding, function (v) { | ||
return "-".concat(core.mapSpacing(v)); | ||
}), | ||
marginRight: core.mapResponsiveProp(core.tokens.containerPadding, function (v) { | ||
return "-".concat(core.mapSpacing(v)); | ||
}) | ||
}), // Override any margins set when the `visible` prop is set | ||
core.mq({ | ||
marginTop: core.mapResponsiveProp(visible, v => v ? undefined : 0), | ||
marginLeft: core.mapResponsiveProp(visible, v => v ? undefined : 0), | ||
marginRight: core.mapResponsiveProp(visible, v => v ? undefined : 0) | ||
}), "" , "" ] | ||
}, children); | ||
marginTop: core.mapResponsiveProp(visible, function (v) { | ||
return v ? undefined : 0; | ||
}), | ||
marginLeft: core.mapResponsiveProp(visible, function (v) { | ||
return v ? undefined : 0; | ||
}), | ||
marginRight: core.mapResponsiveProp(visible, function (v) { | ||
return v ? undefined : 0; | ||
}) | ||
}), "" , "" , "" , "" ], | ||
children: children | ||
}); | ||
} | ||
@@ -149,0 +170,0 @@ |
@@ -0,28 +1,13 @@ | ||
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty'; | ||
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties'; | ||
import { Flex, Box } from '@ag.ds-next/box'; | ||
import { tokens, mq, mapResponsiveProp, mapSpacing } from '@ag.ds-next/core'; | ||
import { createContext, useContext } from 'react'; | ||
import { jsx } from '@emotion/react'; | ||
import { useContext, createContext } from 'react'; | ||
import { jsx } from '@emotion/react/jsx-runtime'; | ||
import '@emotion/react'; | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
var ContentSpacingContext = /*#__PURE__*/createContext(undefined); | ||
var useContentSpacing = function useContentSpacing() { | ||
var value = useContext(ContentSpacingContext); | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
const ContentSpacingContext = createContext(undefined); | ||
const useContentSpacing = () => { | ||
const value = useContext(ContentSpacingContext); | ||
if (value === undefined) { | ||
@@ -35,3 +20,3 @@ throw new Error('Context not found'); | ||
const paddingYMap = { | ||
var paddingYMap = { | ||
none: { | ||
@@ -63,83 +48,119 @@ top: 0, | ||
function BaseContent({ | ||
as = 'section', | ||
className, | ||
palette, | ||
background, | ||
children, | ||
paddingY | ||
}) { | ||
function BaseContent(_ref) { | ||
var _ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'section' : _ref$as, | ||
className = _ref.className, | ||
palette = _ref.palette, | ||
background = _ref.background, | ||
children = _ref.children, | ||
paddingY = _ref.paddingY; | ||
return jsx(ContentSpacingContext.Provider, { | ||
value: paddingY | ||
}, jsx(Flex, { | ||
as: as, | ||
justifyContent: "center", | ||
palette: palette, | ||
background: background, | ||
className: className | ||
}, jsx(Box, { | ||
width: "100%", | ||
maxWidth: tokens.maxWidth.container, | ||
paddingTop: paddingYMap[paddingY].top, | ||
paddingBottom: paddingYMap[paddingY].bottom, | ||
paddingX: tokens.containerPadding | ||
}, children))); | ||
value: paddingY, | ||
children: jsx(Flex, { | ||
as: as, | ||
justifyContent: "center", | ||
palette: palette, | ||
background: background, | ||
className: className, | ||
children: jsx(Box, { | ||
width: "100%", | ||
maxWidth: tokens.maxWidth.container, | ||
paddingTop: paddingYMap[paddingY].top, | ||
paddingBottom: paddingYMap[paddingY].bottom, | ||
paddingX: tokens.containerPadding, | ||
children: children | ||
}) | ||
}) | ||
}); | ||
} | ||
function Content({ | ||
children, | ||
as = 'div', | ||
...props | ||
}) { | ||
return jsx(BaseContent, _extends({ | ||
var _excluded$2 = ["children", "as"]; | ||
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function Content(_ref) { | ||
var children = _ref.children, | ||
_ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'div' : _ref$as, | ||
props = _objectWithoutProperties(_ref, _excluded$2); | ||
return jsx(BaseContent, _objectSpread$2(_objectSpread$2({ | ||
as: as | ||
}, props, { | ||
paddingY: "none" | ||
}), children); | ||
}, props), {}, { | ||
paddingY: "none", | ||
children: children | ||
})); | ||
} | ||
function PageContent({ | ||
children, | ||
as = 'div', | ||
...props | ||
}) { | ||
return jsx(BaseContent, _extends({ | ||
var _excluded$1 = ["children", "as"]; | ||
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function PageContent(_ref) { | ||
var children = _ref.children, | ||
_ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'div' : _ref$as, | ||
props = _objectWithoutProperties(_ref, _excluded$1); | ||
return jsx(BaseContent, _objectSpread$1(_objectSpread$1({ | ||
as: as | ||
}, props, { | ||
paddingY: "page" | ||
}), children); | ||
}, props), {}, { | ||
paddingY: "page", | ||
children: children | ||
})); | ||
} | ||
function SectionContent({ | ||
children, | ||
as = 'section', | ||
...props | ||
}) { | ||
return jsx(BaseContent, _extends({ | ||
var _excluded = ["children", "as"]; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function SectionContent(_ref) { | ||
var children = _ref.children, | ||
_ref$as = _ref.as, | ||
as = _ref$as === void 0 ? 'section' : _ref$as, | ||
props = _objectWithoutProperties(_ref, _excluded); | ||
return jsx(BaseContent, _objectSpread(_objectSpread({ | ||
as: as | ||
}, props, { | ||
paddingY: "section" | ||
}), children); | ||
}, props), {}, { | ||
paddingY: "section", | ||
children: children | ||
})); | ||
} | ||
function ContentBleed({ | ||
children, | ||
visible | ||
}) { | ||
const spacing = useContentSpacing(); | ||
function ContentBleed(_ref) { | ||
var children = _ref.children, | ||
visible = _ref.visible; | ||
var spacing = useContentSpacing(); | ||
return jsx("div", { | ||
css: [// Use negative margins to position this element | ||
mq({ | ||
marginTop: mapResponsiveProp(paddingYMap[spacing].top, v => `-${mapSpacing(v)}`), | ||
marginLeft: mapResponsiveProp(tokens.containerPadding, v => `-${mapSpacing(v)}`), | ||
marginRight: mapResponsiveProp(tokens.containerPadding, v => `-${mapSpacing(v)}`) | ||
marginTop: mapResponsiveProp(paddingYMap[spacing].top, function (v) { | ||
return "-".concat(mapSpacing(v)); | ||
}), | ||
marginLeft: mapResponsiveProp(tokens.containerPadding, function (v) { | ||
return "-".concat(mapSpacing(v)); | ||
}), | ||
marginRight: mapResponsiveProp(tokens.containerPadding, function (v) { | ||
return "-".concat(mapSpacing(v)); | ||
}) | ||
}), // Override any margins set when the `visible` prop is set | ||
mq({ | ||
marginTop: mapResponsiveProp(visible, v => v ? undefined : 0), | ||
marginLeft: mapResponsiveProp(visible, v => v ? undefined : 0), | ||
marginRight: mapResponsiveProp(visible, v => v ? undefined : 0) | ||
}), process.env.NODE_ENV === "production" ? "" : ";label:ContentBleed;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbnRlbnRCbGVlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbUJHIiwiZmlsZSI6IkNvbnRlbnRCbGVlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQcm9wc1dpdGhDaGlsZHJlbiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7XG5cdG1hcFJlc3BvbnNpdmVQcm9wLFxuXHRtYXBTcGFjaW5nLFxuXHRtcSxcblx0UmVzcG9uc2l2ZVByb3AsXG5cdHRva2Vucyxcbn0gZnJvbSAnQGFnLmRzLW5leHQvY29yZSc7XG5pbXBvcnQgeyB1c2VDb250ZW50U3BhY2luZyB9IGZyb20gJy4vY29udGV4dCc7XG5pbXBvcnQgeyBwYWRkaW5nWU1hcCB9IGZyb20gJy4vdXRpbHMnO1xuXG5leHBvcnQgdHlwZSBDb250ZW50QmxlZWRQcm9wcyA9IFByb3BzV2l0aENoaWxkcmVuPHtcblx0dmlzaWJsZT86IFJlc3BvbnNpdm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PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0XHRtYXJnaW5MZWZ0OiBtYXBSZXNwb25zaXZlUHJvcCh2aXNpYmxlLCAodikgPT4gKHYgPyB1bmRlZmluZWQgOiAwKSksXG5cdFx0XHRcdFx0bWFyZ2luUmlnaHQ6IG1hcFJlc3BvbnNpdmVQcm9wKHZpc2libGUsICh2KSA9PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0fSksXG5cdFx0XHRdfVxuXHRcdD5cblx0XHRcdHtjaGlsZHJlbn1cblx0XHQ8L2Rpdj5cblx0KTtcbn1cbiJdfQ== */"] | ||
}, children); | ||
marginTop: mapResponsiveProp(visible, function (v) { | ||
return v ? undefined : 0; | ||
}), | ||
marginLeft: mapResponsiveProp(visible, function (v) { | ||
return v ? undefined : 0; | ||
}), | ||
marginRight: mapResponsiveProp(visible, function (v) { | ||
return v ? undefined : 0; | ||
}) | ||
}), process.env.NODE_ENV === "production" ? "" : ";label:ContentBleed;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbnRlbnRCbGVlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbUJHIiwiZmlsZSI6IkNvbnRlbnRCbGVlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQcm9wc1dpdGhDaGlsZHJlbiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7XG5cdG1hcFJlc3BvbnNpdmVQcm9wLFxuXHRtYXBTcGFjaW5nLFxuXHRtcSxcblx0UmVzcG9uc2l2ZVByb3AsXG5cdHRva2Vucyxcbn0gZnJvbSAnQGFnLmRzLW5leHQvY29yZSc7XG5pbXBvcnQgeyB1c2VDb250ZW50U3BhY2luZyB9IGZyb20gJy4vY29udGV4dCc7XG5pbXBvcnQgeyBwYWRkaW5nWU1hcCB9IGZyb20gJy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2libGVgIHByb3AgaXMgc2V0XG5cdFx0XHRcdG1xKHtcblx0XHRcdFx0XHRtYXJnaW5Ub3A6IG1hcFJlc3BvbnNpdmVQcm9wKHZpc2libGUsICh2KSA9PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0XHRtYXJnaW5MZWZ0OiBtYXBSZXNwb25zaXZlUHJvcCh2aXNpYmxlLCAodikgPT4gKHYgPyB1bmRlZmluZWQgOiAwKSksXG5cdFx0XHRcdFx0bWFyZ2luUmlnaHQ6IG1hcFJlc3BvbnNpdmVQcm9wKHZpc2libGUsICh2KSA9PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0fSksXG5cdFx0XHRdfVxuXHRcdD5cblx0XHRcdHtjaGlsZHJlbn1cblx0XHQ8L2Rpdj5cblx0KTtcbn1cbiJdfQ== */", process.env.NODE_ENV === "production" ? "" : ";label:ContentBleed;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbnRlbnRCbGVlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbUJHIiwiZmlsZSI6IkNvbnRlbnRCbGVlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQcm9wc1dpdGhDaGlsZHJlbiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7XG5cdG1hcFJlc3BvbnNpdmVQcm9wLFxuXHRtYXBTcGFjaW5nLFxuXHRtcSxcblx0UmVzcG9uc2l2ZVByb3AsXG5cdHRva2Vucyxcbn0gZnJvbSAnQGFnLmRzLW5leHQvY29yZSc7XG5pbXBvcnQgeyB1c2VDb250ZW50U3BhY2luZyB9IGZyb20gJy4vY29udGV4dCc7XG5pbXBvcnQgeyBwYWRkaW5nWU1hcCB9IGZyb20gJy4vdXRpbHMnO1xuXG5leHBvcnQgdHlwZSBDb250ZW50QmxlZWRQcm9w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XHRtYXJnaW5Ub3A6IG1hcFJlc3BvbnNpdmVQcm9wKHZpc2libGUsICh2KSA9PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0XHRtYXJnaW5MZWZ0OiBtYXBSZXNwb25zaXZlUHJvcCh2aXNpYmxlLCAodikgPT4gKHYgPyB1bmRlZmluZWQgOiAwKSksXG5cdFx0XHRcdFx0bWFyZ2luUmlnaHQ6IG1hcFJlc3BvbnNpdmVQcm9wKHZpc2libGUsICh2KSA9PiAodiA/IHVuZGVmaW5lZCA6IDApKSxcblx0XHRcdFx0fSksXG5cdFx0XHRdfVxuXHRcdD5cblx0XHRcdHtjaGlsZHJlbn1cblx0XHQ8L2Rpdj5cblx0KTtcbn1cbiJdfQ== */"], | ||
children: children | ||
}); | ||
} | ||
export { Content, ContentBleed, PageContent, SectionContent }; |
{ | ||
"name": "@ag.ds-next/content", | ||
"version": "7.0.0", | ||
"version": "8.0.0", | ||
"main": "dist/ag.ds-next-content.cjs.js", | ||
"module": "dist/ag.ds-next-content.esm.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@babel/runtime": "^7.4.5" | ||
}, | ||
"peerDependencies": { | ||
"@ag.ds-next/box": "6.0.0", | ||
"@ag.ds-next/core": "3.0.0", | ||
"@ag.ds-next/box": "6.1.0", | ||
"@ag.ds-next/core": "3.0.1", | ||
"@emotion/react": "^11.7.0", | ||
@@ -11,0 +14,0 @@ "react": "^16.14.0 || ^17.0.0 || ^18.0.0" |
@@ -1,46 +0,3 @@ | ||
--- | ||
title: Content | ||
description: A collection of simple layout containers to wrap content. | ||
group: Layout | ||
storybookPath: /storybook/index.html?path=/story/layout-content-content--basic | ||
--- | ||
## @ag.ds-next/content | ||
### PageContent | ||
The `PageContent` component should be used to wrap your applications page content. Typically this component will sit in-between your applications header and footer component. | ||
```jsx | ||
<YourApplicationsHeader /> | ||
<PageContent as="main"> | ||
<YourApplicationsPageContent /> | ||
</PageContent> | ||
<YourApplicationsFooter /> | ||
``` | ||
### SectionContent | ||
The `SectionContent` component should be used to wrap sections your applications page content. | ||
```jsx | ||
<SectionContent> | ||
<H2>Section 1</H2> | ||
</SectionContent> | ||
<SectionContent background="shade"> | ||
<H2>Section 2</H2> | ||
</SectionContent> | ||
<SectionContent> | ||
<H2>Section 3</H2> | ||
</SectionContent> | ||
``` | ||
### Content | ||
The `Content` component can be used when you wrap content in a consistent container with a maximum width, but don't want any associated vertical padding. | ||
```jsx | ||
<Content> | ||
<Box paddingY={2}> | ||
<H2>Example title</H2> | ||
</Box> | ||
</Content> | ||
``` | ||
Documentation for this package can be found here: https://steelthreads.github.io/agds-next/packages/layout/content |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
46259
29
815
0
5
4
8
+ Added@babel/runtime@^7.4.5
+ Added@ag.ds-next/box@6.1.0(transitive)
+ Added@ag.ds-next/core@3.0.1(transitive)
- Removed@ag.ds-next/box@6.0.0(transitive)
- Removed@ag.ds-next/core@3.0.0(transitive)