New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@atlaskit/page

Package Overview
Dependencies
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/page - npm Package Compare versions

Comparing version 8.0.7 to 8.0.8

3

CHANGELOG.md
# @atlaskit/page
## 8.0.8
- [patch] Adds missing implicit @babel/runtime dependency [b71751b](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/b71751b)
## 8.0.7

@@ -4,0 +7,0 @@ - [patch] Upgrade react-syntax-highlighter again and use async loaded prism [260d66a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/260d66a)

88

dist/cjs/Grid.js

@@ -1,58 +0,54 @@

'use strict';
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _createClass2 = require('babel-runtime/helpers/createClass');
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createClass3 = _interopRequireDefault(_createClass2);
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _react = _interopRequireWildcard(require("react"));
var _inherits2 = require('babel-runtime/helpers/inherits');
var _styledComponents = require("styled-components");
var _inherits3 = _interopRequireDefault(_inherits2);
var _vars = require("./internal/vars");
var _class, _temp2;
var _GridElement = _interopRequireDefault(require("./internal/GridElement"));
var _react = require('react');
var _class, _temp;
var _react2 = _interopRequireDefault(_react);
var _default = (0, _styledComponents.withTheme)((_temp = _class =
/*#__PURE__*/
function (_Component) {
(0, _inherits2.default)(AkGrid, _Component);
var _styledComponents = require('styled-components');
var _vars = require('./internal/vars');
var _GridElement = require('./internal/GridElement');
var _GridElement2 = _interopRequireDefault(_GridElement);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (0, _styledComponents.withTheme)((_temp2 = _class = function (_Component) {
(0, _inherits3.default)(AkGrid, _Component);
function AkGrid() {
var _ref;
var _getPrototypeOf2;
var _temp, _this, _ret;
var _this;
(0, _classCallCheck3.default)(this, AkGrid);
(0, _classCallCheck2.default)(this, AkGrid);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = AkGrid.__proto__ || (0, _getPrototypeOf2.default)(AkGrid)).call.apply(_ref, [this].concat(args))), _this), _this.getTheme = function (props) {
_this = (0, _possibleConstructorReturn2.default)(this, (_getPrototypeOf2 = (0, _getPrototypeOf3.default)(AkGrid)).call.apply(_getPrototypeOf2, [this].concat(args)));
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "getTheme", function (props) {
return {

@@ -63,23 +59,23 @@ columns: props.theme && props.theme.columns ? props.theme.columns : _vars.defaultGridColumns,

};
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
});
return _this;
}
(0, _createClass3.default)(AkGrid, [{
key: 'render',
(0, _createClass2.default)(AkGrid, [{
key: "render",
value: function render() {
return _react2.default.createElement(
_styledComponents.ThemeProvider,
{ theme: this.getTheme(this.props) },
_react2.default.createElement(
_GridElement2.default,
{ spacing: this.props.spacing, layout: this.props.layout },
this.props.children
)
);
return _react.default.createElement(_styledComponents.ThemeProvider, {
theme: this.getTheme(this.props)
}, _react.default.createElement(_GridElement.default, {
spacing: this.props.spacing,
layout: this.props.layout
}, this.props.children));
}
}]);
return AkGrid;
}(_react.Component), _class.defaultProps = {
}(_react.Component), (0, _defineProperty2.default)(_class, "defaultProps", {
spacing: 'cosy',
layout: 'fixed'
}, _temp2));
}), _temp));
exports.default = _default;

@@ -1,60 +0,56 @@

'use strict';
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _createClass2 = require('babel-runtime/helpers/createClass');
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createClass3 = _interopRequireDefault(_createClass2);
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _react = _interopRequireWildcard(require("react"));
var _inherits2 = require('babel-runtime/helpers/inherits');
var _styledComponents = require("styled-components");
var _inherits3 = _interopRequireDefault(_inherits2);
var _vars = require("./internal/vars");
var _class, _temp2;
var _GridColumnElement = _interopRequireDefault(require("./internal/GridColumnElement"));
var _react = require('react');
var _class, _temp;
var _react2 = _interopRequireDefault(_react);
var _styledComponents = require('styled-components');
var _vars = require('./internal/vars');
var _GridColumnElement = require('./internal/GridColumnElement');
var _GridColumnElement2 = _interopRequireDefault(_GridColumnElement);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultSpacing = 'cosy';
exports.default = (0, _styledComponents.withTheme)((_temp2 = _class = function (_Component) {
(0, _inherits3.default)(AkGridColumn, _Component);
var _default = (0, _styledComponents.withTheme)((_temp = _class =
/*#__PURE__*/
function (_Component) {
(0, _inherits2.default)(AkGridColumn, _Component);
function AkGridColumn() {
var _ref;
var _getPrototypeOf2;
var _temp, _this, _ret;
var _this;
(0, _classCallCheck3.default)(this, AkGridColumn);
(0, _classCallCheck2.default)(this, AkGridColumn);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = AkGridColumn.__proto__ || (0, _getPrototypeOf2.default)(AkGridColumn)).call.apply(_ref, [this].concat(args))), _this), _this.getTheme = function (props) {
_this = (0, _possibleConstructorReturn2.default)(this, (_getPrototypeOf2 = (0, _getPrototypeOf3.default)(AkGridColumn)).call.apply(_getPrototypeOf2, [this].concat(args)));
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "getTheme", function (props) {
return {

@@ -65,3 +61,4 @@ columns: props.theme && props.theme.columns ? props.theme.columns : _vars.defaultGridColumns,

};
}, _this.getNestedTheme = function (props) {
});
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "getNestedTheme", function (props) {
return {

@@ -72,30 +69,23 @@ columns: props.medium,

};
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
});
return _this;
}
(0, _createClass3.default)(AkGridColumn, [{
key: 'render',
(0, _createClass2.default)(AkGridColumn, [{
key: "render",
value: function render() {
return _react2.default.createElement(
_styledComponents.ThemeProvider,
{ theme: this.getTheme(this.props) },
_react2.default.createElement(
_GridColumnElement2.default,
{ medium: this.props.medium },
_react2.default.createElement(
_styledComponents.ThemeProvider,
{ theme: this.getNestedTheme(this.props) },
_react2.default.createElement(
'div',
null,
this.props.children
)
)
)
);
return _react.default.createElement(_styledComponents.ThemeProvider, {
theme: this.getTheme(this.props)
}, _react.default.createElement(_GridColumnElement.default, {
medium: this.props.medium
}, _react.default.createElement(_styledComponents.ThemeProvider, {
theme: this.getNestedTheme(this.props)
}, _react.default.createElement("div", null, this.props.children))));
}
}]);
return AkGridColumn;
}(_react.Component), _class.defaultProps = {
}(_react.Component), (0, _defineProperty2.default)(_class, "defaultProps", {
medium: 0
}, _temp2));
}), _temp));
exports.default = _default;

@@ -1,32 +0,29 @@

'use strict';
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridColumn = exports.Grid = undefined;
var _Grid = require('./Grid');
Object.defineProperty(exports, 'Grid', {
Object.defineProperty(exports, "Grid", {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Grid).default;
return _Grid.default;
}
});
var _GridColumn = require('./GridColumn');
Object.defineProperty(exports, 'GridColumn', {
Object.defineProperty(exports, "GridColumn", {
enumerable: true,
get: function get() {
return _interopRequireDefault(_GridColumn).default;
return _GridColumn.default;
}
});
exports.default = void 0;
var _Page = require('./Page');
var _Page = _interopRequireDefault(require("./Page"));
var _Page2 = _interopRequireDefault(_Page);
var _Grid = _interopRequireDefault(require("./Grid"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _GridColumn = _interopRequireDefault(require("./GridColumn"));
exports.default = _Page2.default;
var _default = _Page.default;
exports.default = _default;

@@ -1,22 +0,14 @@

'use strict';
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getColumnWidth = undefined;
exports.getColumnWidth = exports.default = void 0;
var _taggedTemplateLiteral2 = require('babel-runtime/helpers/taggedTemplateLiteral');
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2);
var _vars = require("./vars");
var _templateObject = (0, _taggedTemplateLiteral3.default)(['\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: ', ';\n margin: 0 ', 'px;\n max-width: calc(', ' - ', 'px);\n min-width: calc(99.9999% / ', ' - ', 'px);\n word-wrap: break-word;\n'], ['\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: ', ';\n margin: 0 ', 'px;\n max-width: calc(', ' - ', 'px);\n min-width: calc(99.9999% / ', ' - ', 'px);\n word-wrap: break-word;\n']);
var _styledComponents = require('styled-components');
var _styledComponents2 = _interopRequireDefault(_styledComponents);
var _vars = require('./vars');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var getColumnRatio = function getColumnRatio(props) {

@@ -26,19 +18,28 @@ if (props.medium === props.theme.columns) {

}
return '99.9999% / ' + props.theme.columns + ' * ' + props.medium;
return "99.9999% / ".concat(props.theme.columns, " * ").concat(props.medium);
};
var getColumnWidth = function getColumnWidth(props) {
return props.medium > 0 ? 'calc(' + getColumnRatio(props) + ' - ' + _vars.spacing[props.theme.spacing] + 'px)' : 'auto';
return props.medium > 0 ? "calc(".concat(getColumnRatio(props), " - ").concat(_vars.spacing[props.theme.spacing], "px)") : 'auto';
};
exports.getColumnWidth = getColumnWidth;
var availableColumns = function availableColumns(props) {
return props.theme.columns;
};
var specifiedColumns = function specifiedColumns(props) {
return props.medium ? props.medium : availableColumns(props);
};
var columns = function columns(props) {
return Math.min(availableColumns(props), specifiedColumns(props));
};
var gridSpacing = function gridSpacing(props) {
return _vars.spacing[props.theme.spacing];
};
var getMaxWidthColumnRatio = function getMaxWidthColumnRatio(props) {

@@ -48,14 +49,18 @@ if (columns(props) >= availableColumns(props)) {

}
return '99.9999% / ' + availableColumns(props) + ' * ' + columns(props);
};
// Unable to use the flexbox shorthand rules because Styled Components doesn't
return "99.9999% / ".concat(availableColumns(props), " * ").concat(columns(props));
}; // Unable to use the flexbox shorthand rules because Styled Components doesn't
// handle them correctly for IE11.
// Also IE11 and Edge both have rounding issues for flexbox which is why a width of
// 99.9999% is used. Using 100% here causes columns to wrap prematurely.
var GridColumn = _styledComponents2.default.div(_templateObject, getColumnWidth, function (props) {
var GridColumn = _styledComponents.default.div.withConfig({
displayName: "GridColumnElement__GridColumn",
componentId: "sc-57x38k-0"
})(["\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: ", ";\n margin: 0 ", "px;\n max-width: calc(", " - ", "px);\n min-width: calc(99.9999% / ", " - ", "px);\n word-wrap: break-word;\n"], getColumnWidth, function (props) {
return _vars.spacing[props.theme.spacing] / 2;
}, getMaxWidthColumnRatio, gridSpacing, availableColumns, gridSpacing);
exports.default = GridColumn;
exports.getColumnWidth = getColumnWidth;
var _default = GridColumn;
exports.default = _default;

@@ -1,37 +0,38 @@

'use strict';
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPadding = exports.getMaxWidth = exports.getMargin = undefined;
exports.getPadding = exports.getMaxWidth = exports.getMargin = exports.default = void 0;
var _taggedTemplateLiteral2 = require('babel-runtime/helpers/taggedTemplateLiteral');
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2);
var _vars = require("./vars");
var _templateObject = (0, _taggedTemplateLiteral3.default)(['\n align-items: flex-start;\n display: flex;\n flex-wrap: wrap;\n margin: 0 ', ';\n max-width: ', ';\n padding: 0 ', ';\n position: relative;\n'], ['\n align-items: flex-start;\n display: flex;\n flex-wrap: wrap;\n margin: 0 ', ';\n max-width: ', ';\n padding: 0 ', ';\n position: relative;\n']);
var getMargin = function getMargin(props) {
return props.theme.isNestedGrid ? "-".concat(_vars.spacing[props.theme.spacing], "px") : 'auto';
};
var _styledComponents = require('styled-components');
exports.getMargin = getMargin;
var _styledComponents2 = _interopRequireDefault(_styledComponents);
var getMaxWidth = function getMaxWidth(props) {
return props.layout === 'fixed' ? "".concat(_vars.defaultGridColumnWidth * props.theme.columns, "px") : '100%';
};
var _vars = require('./vars');
exports.getMaxWidth = getMaxWidth;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var getMargin = function getMargin(props) {
return props.theme.isNestedGrid ? '-' + _vars.spacing[props.theme.spacing] + 'px' : 'auto';
};
var getMaxWidth = function getMaxWidth(props) {
return props.layout === 'fixed' ? _vars.defaultGridColumnWidth * props.theme.columns + 'px' : '100%';
};
var getPadding = function getPadding(props) {
return _vars.spacing[props.theme.spacing] / 2 + 'px';
return "".concat(_vars.spacing[props.theme.spacing] / 2, "px");
};
var Grid = _styledComponents2.default.div(_templateObject, getMargin, getMaxWidth, getPadding);
exports.getPadding = getPadding;
exports.default = Grid;
exports.getMargin = getMargin;
exports.getMaxWidth = getMaxWidth;
exports.getPadding = getPadding;
var Grid = _styledComponents.default.div.withConfig({
displayName: "GridElement__Grid",
componentId: "sc-6y1aox-0"
})(["\n align-items: flex-start;\n display: flex;\n flex-wrap: wrap;\n margin: 0 ", ";\n max-width: ", ";\n padding: 0 ", ";\n position: relative;\n"], getMargin, getMaxWidth, getPadding);
var _default = Grid;
exports.default = _default;

@@ -1,2 +0,2 @@

'use strict';
"use strict";

@@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", {

});
var defaultGridSize = exports.defaultGridSize = 8;
var defaultGridColumns = exports.defaultGridColumns = 12;
var defaultGridColumnWidth = exports.defaultGridColumnWidth = defaultGridSize * 10;
var spacing = exports.spacing = {
exports.layout = exports.spacing = exports.defaultGridColumnWidth = exports.defaultGridColumns = exports.defaultGridSize = void 0;
var defaultGridSize = 8;
exports.defaultGridSize = defaultGridSize;
var defaultGridColumns = 12;
exports.defaultGridColumns = defaultGridColumns;
var defaultGridColumnWidth = defaultGridSize * 10;
exports.defaultGridColumnWidth = defaultGridColumnWidth;
var spacing = {
comfortable: defaultGridSize * 5,

@@ -18,3 +19,4 @@ cosy: defaultGridSize * 2,

};
var layout = exports.layout = ['fixed', 'fluid'];
exports.spacing = spacing;
var layout = ['fixed', 'fluid'];
exports.layout = layout;

@@ -1,118 +0,88 @@

'use strict';
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _createClass2 = require('babel-runtime/helpers/createClass');
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createClass3 = _interopRequireDefault(_createClass2);
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
var _react = _interopRequireWildcard(require("react"));
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _inherits2 = require('babel-runtime/helpers/inherits');
var Wrapper = _styledComponents.default.div.withConfig({
displayName: "Page__Wrapper",
componentId: "oj2x06-0"
})(["\n display: flex;\n flex-direction: column;\n min-height: 100%;\n width: 100%;\n"]);
var _inherits3 = _interopRequireDefault(_inherits2);
var NavigationAndContent = _styledComponents.default.div.withConfig({
displayName: "Page__NavigationAndContent",
componentId: "oj2x06-1"
})(["\n display: flex;\n flex: 1 1 auto;\n"]);
var _taggedTemplateLiteral2 = require('babel-runtime/helpers/taggedTemplateLiteral');
var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2);
var _templateObject = (0, _taggedTemplateLiteral3.default)(['\n display: flex;\n flex-direction: column;\n min-height: 100%;\n width: 100%;\n'], ['\n display: flex;\n flex-direction: column;\n min-height: 100%;\n width: 100%;\n']),
_templateObject2 = (0, _taggedTemplateLiteral3.default)(['\n display: flex;\n flex: 1 1 auto;\n'], ['\n display: flex;\n flex: 1 1 auto;\n']),
_templateObject3 = (0, _taggedTemplateLiteral3.default)(['\n flex: 1 0 auto;\n transition: height 0.25s ease-in-out;\n height: ', 'px;\n position: relative;\n width: 100%;\n z-index: 3;\n'], ['\n flex: 1 0 auto;\n transition: height 0.25s ease-in-out;\n height: ', 'px;\n position: relative;\n width: 100%;\n z-index: 3;\n']),
_templateObject4 = (0, _taggedTemplateLiteral3.default)(['\n position: fixed;\n width: 100%;\n'], ['\n position: fixed;\n width: 100%;\n']),
_templateObject5 = (0, _taggedTemplateLiteral3.default)(['\n position: relative;\n z-index: 2;\n'], ['\n position: relative;\n z-index: 2;\n']),
_templateObject6 = (0, _taggedTemplateLiteral3.default)(['\n flex: 1 1 auto;\n position: relative;\n z-index: 1;\n min-width: 0;\n'], ['\n flex: 1 1 auto;\n position: relative;\n z-index: 1;\n min-width: 0;\n']);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _styledComponents = require('styled-components');
var _styledComponents2 = _interopRequireDefault(_styledComponents);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Wrapper = _styledComponents2.default.div(_templateObject);
var NavigationAndContent = _styledComponents2.default.div(_templateObject2);
var BannerContainer = _styledComponents2.default.div(_templateObject3, function (props) {
var BannerContainer = _styledComponents.default.div.withConfig({
displayName: "Page__BannerContainer",
componentId: "oj2x06-2"
})(["\n flex: 1 0 auto;\n transition: height 0.25s ease-in-out;\n height: ", "px;\n position: relative;\n width: 100%;\n z-index: 3;\n"], function (props) {
return props.isBannerOpen ? props.bannerHeight : 0;
});
var Banner = _styledComponents2.default.div(_templateObject4);
var Banner = _styledComponents.default.div.withConfig({
displayName: "Page__Banner",
componentId: "oj2x06-3"
})(["\n position: fixed;\n width: 100%;\n"]);
var Navigation = _styledComponents2.default.div(_templateObject5);
var Navigation = _styledComponents.default.div.withConfig({
displayName: "Page__Navigation",
componentId: "oj2x06-4"
})(["\n position: relative;\n z-index: 2;\n"]);
var PageContent = _styledComponents2.default.div(_templateObject6);
var PageContent = _styledComponents.default.div.withConfig({
displayName: "Page__PageContent",
componentId: "oj2x06-5"
})(["\n flex: 1 1 auto;\n position: relative;\n z-index: 1;\n min-width: 0;\n"]);
var emptyTheme = {};
var Page = function (_Component) {
(0, _inherits3.default)(Page, _Component);
var Page =
/*#__PURE__*/
function (_Component) {
(0, _inherits2.default)(Page, _Component);
function Page() {
(0, _classCallCheck3.default)(this, Page);
return (0, _possibleConstructorReturn3.default)(this, (Page.__proto__ || (0, _getPrototypeOf2.default)(Page)).apply(this, arguments));
(0, _classCallCheck2.default)(this, Page);
return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(Page).apply(this, arguments));
}
(0, _createClass3.default)(Page, [{
key: 'render',
(0, _createClass2.default)(Page, [{
key: "render",
value: function render() {
var _props = this.props,
isBannerOpen = _props.isBannerOpen,
banner = _props.banner,
navigation = _props.navigation,
children = _props.children,
bannerHeight = _props.bannerHeight;
return _react2.default.createElement(
_styledComponents.ThemeProvider,
{ theme: emptyTheme },
_react2.default.createElement(
Wrapper,
null,
this.props.banner ? _react2.default.createElement(
BannerContainer,
{
'aria-hidden': isBannerOpen,
isBannerOpen: isBannerOpen,
bannerHeight: bannerHeight
},
_react2.default.createElement(
Banner,
null,
banner
)
) : null,
_react2.default.createElement(
NavigationAndContent,
null,
_react2.default.createElement(
Navigation,
null,
navigation
),
_react2.default.createElement(
PageContent,
null,
children
)
)
)
);
var _this$props = this.props,
isBannerOpen = _this$props.isBannerOpen,
banner = _this$props.banner,
navigation = _this$props.navigation,
children = _this$props.children,
bannerHeight = _this$props.bannerHeight;
return _react.default.createElement(_styledComponents.ThemeProvider, {
theme: emptyTheme
}, _react.default.createElement(Wrapper, null, this.props.banner ? _react.default.createElement(BannerContainer, {
"aria-hidden": isBannerOpen,
isBannerOpen: isBannerOpen,
bannerHeight: bannerHeight
}, _react.default.createElement(Banner, null, banner)) : null, _react.default.createElement(NavigationAndContent, null, _react.default.createElement(Navigation, null, navigation), _react.default.createElement(PageContent, null, children))));
}

@@ -123,7 +93,7 @@ }]);

Page.displayName = 'AkPage';
Page.defaultProps = {
exports.default = Page;
(0, _defineProperty2.default)(Page, "displayName", 'AkPage');
(0, _defineProperty2.default)(Page, "defaultProps", {
isBannerOpen: false,
bannerHeight: 52
};
exports.default = Page;
});

@@ -1,30 +0,34 @@

import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
var _class, _temp2;
var _class, _temp;
import React, { Component } from 'react';
import { ThemeProvider, withTheme } from 'styled-components';
import { defaultGridColumns } from './internal/vars';
import Grid from './internal/GridElement';
export default withTheme((_temp2 = _class = function (_Component) {
export default withTheme((_temp = _class =
/*#__PURE__*/
function (_Component) {
_inherits(AkGrid, _Component);
function AkGrid() {
var _ref;
var _getPrototypeOf2;
var _temp, _this, _ret;
var _this;
_classCallCheck(this, AkGrid);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AkGrid.__proto__ || _Object$getPrototypeOf(AkGrid)).call.apply(_ref, [this].concat(args))), _this), _this.getTheme = function (props) {
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(AkGrid)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getTheme", function (props) {
return {

@@ -35,17 +39,16 @@ columns: props.theme && props.theme.columns ? props.theme.columns : defaultGridColumns,

};
}, _temp), _possibleConstructorReturn(_this, _ret);
});
return _this;
}
_createClass(AkGrid, [{
key: 'render',
key: "render",
value: function render() {
return React.createElement(
ThemeProvider,
{ theme: this.getTheme(this.props) },
React.createElement(
Grid,
{ spacing: this.props.spacing, layout: this.props.layout },
this.props.children
)
);
return React.createElement(ThemeProvider, {
theme: this.getTheme(this.props)
}, React.createElement(Grid, {
spacing: this.props.spacing,
layout: this.props.layout
}, this.props.children));
}

@@ -55,5 +58,5 @@ }]);

return AkGrid;
}(Component), _class.defaultProps = {
}(Component), _defineProperty(_class, "defaultProps", {
spacing: 'cosy',
layout: 'fixed'
}, _temp2));
}), _temp));

@@ -1,32 +0,35 @@

import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
var _class, _temp2;
var _class, _temp;
import React, { Component } from 'react';
import { ThemeProvider, withTheme } from 'styled-components';
import { defaultGridColumns } from './internal/vars';
import GridColumn from './internal/GridColumnElement';
var defaultSpacing = 'cosy';
export default withTheme((_temp2 = _class = function (_Component) {
export default withTheme((_temp = _class =
/*#__PURE__*/
function (_Component) {
_inherits(AkGridColumn, _Component);
function AkGridColumn() {
var _ref;
var _getPrototypeOf2;
var _temp, _this, _ret;
var _this;
_classCallCheck(this, AkGridColumn);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AkGridColumn.__proto__ || _Object$getPrototypeOf(AkGridColumn)).call.apply(_ref, [this].concat(args))), _this), _this.getTheme = function (props) {
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(AkGridColumn)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getTheme", function (props) {
return {

@@ -37,3 +40,5 @@ columns: props.theme && props.theme.columns ? props.theme.columns : defaultGridColumns,

};
}, _this.getNestedTheme = function (props) {
});
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getNestedTheme", function (props) {
return {

@@ -44,25 +49,17 @@ columns: props.medium,

};
}, _temp), _possibleConstructorReturn(_this, _ret);
});
return _this;
}
_createClass(AkGridColumn, [{
key: 'render',
key: "render",
value: function render() {
return React.createElement(
ThemeProvider,
{ theme: this.getTheme(this.props) },
React.createElement(
GridColumn,
{ medium: this.props.medium },
React.createElement(
ThemeProvider,
{ theme: this.getNestedTheme(this.props) },
React.createElement(
'div',
null,
this.props.children
)
)
)
);
return React.createElement(ThemeProvider, {
theme: this.getTheme(this.props)
}, React.createElement(GridColumn, {
medium: this.props.medium
}, React.createElement(ThemeProvider, {
theme: this.getNestedTheme(this.props)
}, React.createElement("div", null, this.props.children))));
}

@@ -72,4 +69,4 @@ }]);

return AkGridColumn;
}(Component), _class.defaultProps = {
}(Component), _defineProperty(_class, "defaultProps", {
medium: 0
}, _temp2));
}), _temp));
import Page from './Page';
export default Page;
export { default as Grid } from './Grid';
export { default as GridColumn } from './GridColumn';

@@ -1,7 +0,2 @@

import _taggedTemplateLiteral from 'babel-runtime/helpers/taggedTemplateLiteral';
var _templateObject = _taggedTemplateLiteral(['\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: ', ';\n margin: 0 ', 'px;\n max-width: calc(', ' - ', 'px);\n min-width: calc(99.9999% / ', ' - ', 'px);\n word-wrap: break-word;\n'], ['\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: ', ';\n margin: 0 ', 'px;\n max-width: calc(', ' - ', 'px);\n min-width: calc(99.9999% / ', ' - ', 'px);\n word-wrap: break-word;\n']);
import styled from 'styled-components';
import { spacing } from './vars';

@@ -13,19 +8,26 @@

}
return '99.9999% / ' + props.theme.columns + ' * ' + props.medium;
return "99.9999% / ".concat(props.theme.columns, " * ").concat(props.medium);
};
var getColumnWidth = function getColumnWidth(props) {
return props.medium > 0 ? 'calc(' + getColumnRatio(props) + ' - ' + spacing[props.theme.spacing] + 'px)' : 'auto';
return props.medium > 0 ? "calc(".concat(getColumnRatio(props), " - ").concat(spacing[props.theme.spacing], "px)") : 'auto';
};
var availableColumns = function availableColumns(props) {
return props.theme.columns;
};
var specifiedColumns = function specifiedColumns(props) {
return props.medium ? props.medium : availableColumns(props);
};
var columns = function columns(props) {
return Math.min(availableColumns(props), specifiedColumns(props));
};
var gridSpacing = function gridSpacing(props) {
return spacing[props.theme.spacing];
};
var getMaxWidthColumnRatio = function getMaxWidthColumnRatio(props) {

@@ -35,14 +37,17 @@ if (columns(props) >= availableColumns(props)) {

}
return '99.9999% / ' + availableColumns(props) + ' * ' + columns(props);
};
// Unable to use the flexbox shorthand rules because Styled Components doesn't
return "99.9999% / ".concat(availableColumns(props), " * ").concat(columns(props));
}; // Unable to use the flexbox shorthand rules because Styled Components doesn't
// handle them correctly for IE11.
// Also IE11 and Edge both have rounding issues for flexbox which is why a width of
// 99.9999% is used. Using 100% here causes columns to wrap prematurely.
var GridColumn = styled.div(_templateObject, getColumnWidth, function (props) {
var GridColumn = styled.div.withConfig({
displayName: "GridColumnElement__GridColumn",
componentId: "sc-57x38k-0"
})(["\n flex-grow: 1;\n flex-shrink: 0;\n flex-basis: ", ";\n margin: 0 ", "px;\n max-width: calc(", " - ", "px);\n min-width: calc(99.9999% / ", " - ", "px);\n word-wrap: break-word;\n"], getColumnWidth, function (props) {
return spacing[props.theme.spacing] / 2;
}, getMaxWidthColumnRatio, gridSpacing, availableColumns, gridSpacing);
export default GridColumn;
export { getColumnWidth };

@@ -1,22 +0,21 @@

import _taggedTemplateLiteral from 'babel-runtime/helpers/taggedTemplateLiteral';
var _templateObject = _taggedTemplateLiteral(['\n align-items: flex-start;\n display: flex;\n flex-wrap: wrap;\n margin: 0 ', ';\n max-width: ', ';\n padding: 0 ', ';\n position: relative;\n'], ['\n align-items: flex-start;\n display: flex;\n flex-wrap: wrap;\n margin: 0 ', ';\n max-width: ', ';\n padding: 0 ', ';\n position: relative;\n']);
import styled from 'styled-components';
import { defaultGridColumnWidth, spacing } from './vars';
var getMargin = function getMargin(props) {
return props.theme.isNestedGrid ? '-' + spacing[props.theme.spacing] + 'px' : 'auto';
return props.theme.isNestedGrid ? "-".concat(spacing[props.theme.spacing], "px") : 'auto';
};
var getMaxWidth = function getMaxWidth(props) {
return props.layout === 'fixed' ? defaultGridColumnWidth * props.theme.columns + 'px' : '100%';
return props.layout === 'fixed' ? "".concat(defaultGridColumnWidth * props.theme.columns, "px") : '100%';
};
var getPadding = function getPadding(props) {
return spacing[props.theme.spacing] / 2 + 'px';
return "".concat(spacing[props.theme.spacing] / 2, "px");
};
var Grid = styled.div(_templateObject, getMargin, getMaxWidth, getPadding);
var Grid = styled.div.withConfig({
displayName: "GridElement__Grid",
componentId: "sc-6y1aox-0"
})(["\n align-items: flex-start;\n display: flex;\n flex-wrap: wrap;\n margin: 0 ", ";\n max-width: ", ";\n padding: 0 ", ";\n position: relative;\n"], getMargin, getMaxWidth, getPadding);
export default Grid;
export { getMargin, getMaxWidth, getPadding };
export var defaultGridSize = 8;
export var defaultGridColumns = 12;
export var defaultGridColumnWidth = defaultGridSize * 10;
export var spacing = {

@@ -12,3 +9,2 @@ comfortable: defaultGridSize * 5,

};
export var layout = ['fixed', 'fluid'];

@@ -1,35 +0,40 @@

import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import _taggedTemplateLiteral from 'babel-runtime/helpers/taggedTemplateLiteral';
var _templateObject = _taggedTemplateLiteral(['\n display: flex;\n flex-direction: column;\n min-height: 100%;\n width: 100%;\n'], ['\n display: flex;\n flex-direction: column;\n min-height: 100%;\n width: 100%;\n']),
_templateObject2 = _taggedTemplateLiteral(['\n display: flex;\n flex: 1 1 auto;\n'], ['\n display: flex;\n flex: 1 1 auto;\n']),
_templateObject3 = _taggedTemplateLiteral(['\n flex: 1 0 auto;\n transition: height 0.25s ease-in-out;\n height: ', 'px;\n position: relative;\n width: 100%;\n z-index: 3;\n'], ['\n flex: 1 0 auto;\n transition: height 0.25s ease-in-out;\n height: ', 'px;\n position: relative;\n width: 100%;\n z-index: 3;\n']),
_templateObject4 = _taggedTemplateLiteral(['\n position: fixed;\n width: 100%;\n'], ['\n position: fixed;\n width: 100%;\n']),
_templateObject5 = _taggedTemplateLiteral(['\n position: relative;\n z-index: 2;\n'], ['\n position: relative;\n z-index: 2;\n']),
_templateObject6 = _taggedTemplateLiteral(['\n flex: 1 1 auto;\n position: relative;\n z-index: 1;\n min-width: 0;\n'], ['\n flex: 1 1 auto;\n position: relative;\n z-index: 1;\n min-width: 0;\n']);
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React, { Component } from 'react';
import styled, { ThemeProvider } from 'styled-components';
var Wrapper = styled.div(_templateObject);
var NavigationAndContent = styled.div(_templateObject2);
var BannerContainer = styled.div(_templateObject3, function (props) {
var Wrapper = styled.div.withConfig({
displayName: "Page__Wrapper",
componentId: "oj2x06-0"
})(["\n display: flex;\n flex-direction: column;\n min-height: 100%;\n width: 100%;\n"]);
var NavigationAndContent = styled.div.withConfig({
displayName: "Page__NavigationAndContent",
componentId: "oj2x06-1"
})(["\n display: flex;\n flex: 1 1 auto;\n"]);
var BannerContainer = styled.div.withConfig({
displayName: "Page__BannerContainer",
componentId: "oj2x06-2"
})(["\n flex: 1 0 auto;\n transition: height 0.25s ease-in-out;\n height: ", "px;\n position: relative;\n width: 100%;\n z-index: 3;\n"], function (props) {
return props.isBannerOpen ? props.bannerHeight : 0;
});
var Banner = styled.div(_templateObject4);
var Navigation = styled.div(_templateObject5);
var PageContent = styled.div(_templateObject6);
var Banner = styled.div.withConfig({
displayName: "Page__Banner",
componentId: "oj2x06-3"
})(["\n position: fixed;\n width: 100%;\n"]);
var Navigation = styled.div.withConfig({
displayName: "Page__Navigation",
componentId: "oj2x06-4"
})(["\n position: relative;\n z-index: 2;\n"]);
var PageContent = styled.div.withConfig({
displayName: "Page__PageContent",
componentId: "oj2x06-5"
})(["\n flex: 1 1 auto;\n position: relative;\n z-index: 1;\n min-width: 0;\n"]);
var emptyTheme = {};
var Page = function (_Component) {
var Page =
/*#__PURE__*/
function (_Component) {
_inherits(Page, _Component);

@@ -40,51 +45,21 @@

return _possibleConstructorReturn(this, (Page.__proto__ || _Object$getPrototypeOf(Page)).apply(this, arguments));
return _possibleConstructorReturn(this, _getPrototypeOf(Page).apply(this, arguments));
}
_createClass(Page, [{
key: 'render',
key: "render",
value: function render() {
var _props = this.props,
isBannerOpen = _props.isBannerOpen,
banner = _props.banner,
navigation = _props.navigation,
children = _props.children,
bannerHeight = _props.bannerHeight;
return React.createElement(
ThemeProvider,
{ theme: emptyTheme },
React.createElement(
Wrapper,
null,
this.props.banner ? React.createElement(
BannerContainer,
{
'aria-hidden': isBannerOpen,
isBannerOpen: isBannerOpen,
bannerHeight: bannerHeight
},
React.createElement(
Banner,
null,
banner
)
) : null,
React.createElement(
NavigationAndContent,
null,
React.createElement(
Navigation,
null,
navigation
),
React.createElement(
PageContent,
null,
children
)
)
)
);
var _this$props = this.props,
isBannerOpen = _this$props.isBannerOpen,
banner = _this$props.banner,
navigation = _this$props.navigation,
children = _this$props.children,
bannerHeight = _this$props.bannerHeight;
return React.createElement(ThemeProvider, {
theme: emptyTheme
}, React.createElement(Wrapper, null, this.props.banner ? React.createElement(BannerContainer, {
"aria-hidden": isBannerOpen,
isBannerOpen: isBannerOpen,
bannerHeight: bannerHeight
}, React.createElement(Banner, null, banner)) : null, React.createElement(NavigationAndContent, null, React.createElement(Navigation, null, navigation), React.createElement(PageContent, null, children))));
}

@@ -96,7 +71,9 @@ }]);

Page.displayName = 'AkPage';
Page.defaultProps = {
_defineProperty(Page, "displayName", 'AkPage');
_defineProperty(Page, "defaultProps", {
isBannerOpen: false,
bannerHeight: 52
};
export default Page;
});
export { Page as default };
{
"name": "@atlaskit/page",
"version": "8.0.7",
"version": "8.0.8",
"sideEffects": false
}
{
"name": "@atlaskit/page",
"version": "8.0.7",
"version": "8.0.8",
"description": "A component for building page layouts. Also includes the Grid and GridColumn components.",

@@ -21,3 +21,5 @@ "license": "Apache-2.0",

"repository": "https://bitbucket.org/atlassian/atlaskit-mk-2",
"dependencies": {},
"dependencies": {
"@babel/runtime": "^7.0.0"
},
"peerDependencies": {

@@ -28,9 +30,9 @@ "react": "^16.4.0",

"devDependencies": {
"@atlaskit/banner": "^7.0.6",
"@atlaskit/banner": "^7.0.8",
"@atlaskit/build-utils": "^2.0.0",
"@atlaskit/button": "^9.0.8",
"@atlaskit/button": "^9.0.15",
"@atlaskit/docs": "^5.0.2",
"@atlaskit/logo": "^9.2.2",
"@atlaskit/navigation": "^33.1.8",
"@atlaskit/toggle": "^5.0.8",
"@atlaskit/logo": "^9.2.3",
"@atlaskit/navigation": "^33.2.1",
"@atlaskit/toggle": "^5.0.10",
"enzyme": "https://registry.npmjs.org/@pgleeson/enzyme/-/enzyme-3.3.7.tgz",

@@ -46,2 +48,2 @@ "react-dom": "^16.4.2",

]
}
}
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