@carbonare/grid
Version:
Grid in js for Carbon Design System
135 lines (122 loc) • 4.71 kB
JavaScript
;
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Column = exports.Row = exports.Grid = void 0;
var Cn = _interopRequireWildcard(require("re-classnames/src/Cn.bs.js"));
var React = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE
function Grid$Grid(Props) {
var children = Props.children;
var className = Props.className;
return React.createElement("div", {
className: Cn.make(
/* :: */
["bx--grid",
/* :: */
[Cn.ifSome(className, className),
/* [] */
0]])
}, children);
}
var Grid = {
make: Grid$Grid
};
exports.Grid = Grid;
function Grid$Row(Props) {
var children = Props.children;
var className = Props.className;
return React.createElement("div", {
className: Cn.make(
/* :: */
["bx--row",
/* :: */
[Cn.ifSome(className, className),
/* [] */
0]])
}, children);
}
var Row = {
make: Grid$Row
};
exports.Row = Row;
function Grid$Column(Props) {
var children = Props.children;
var colSm = Props.colSm;
var colMd = Props.colMd;
var colLg = Props.colLg;
var colXl = Props.colXl;
var colMax = Props.colMax;
var offsetSm = Props.offsetSm;
var offsetMd = Props.offsetMd;
var offsetLg = Props.offsetLg;
var offsetXl = Props.offsetXl;
var offsetMax = Props.offsetMax;
var noGutterSm = Props.noGutterSm;
var noGutterMd = Props.noGutterMd;
var noGutterLg = Props.noGutterLg;
var noGutterXl = Props.noGutterXl;
var noGutterMax = Props.noGutterMax;
var noGutterSmLeft = Props.noGutterSmLeft;
var noGutterMdLeft = Props.noGutterMdLeft;
var noGutterLgLeft = Props.noGutterLgLeft;
var noGutterXlLeft = Props.noGutterXlLeft;
var noGutterMaxLeft = Props.noGutterMaxLeft;
var className = Props.className;
var colClasses = Cn.make(
/* :: */
[Cn.ifSome(className, className),
/* :: */
[Cn.ifSome("bx--col-sm-" + String(colSm), colSm),
/* :: */
[Cn.ifSome("bx--col-md-" + String(colMd), colMd),
/* :: */
[Cn.ifSome("bx--col-lg-" + String(colLg), colLg),
/* :: */
[Cn.ifSome("bx--col-xl-" + String(colXl), colXl),
/* :: */
[Cn.ifSome("bx--col-lg-" + String(colMax), colMax),
/* :: */
[Cn.ifSome("bx--offset-sm-" + String(offsetSm), offsetSm),
/* :: */
[Cn.ifSome("bx--offset-md-" + String(offsetMd), offsetMd),
/* :: */
[Cn.ifSome("bx--offset-lg-" + String(offsetLg), offsetLg),
/* :: */
[Cn.ifSome("bx--offset-xl-" + String(offsetXl), offsetXl),
/* :: */
[Cn.ifSome("bx--offset-max-" + String(offsetMax), offsetMax),
/* :: */
[Cn.ifSome("bx--no-gutter-sm", noGutterSm),
/* :: */
[Cn.ifSome("bx--no-gutter-md", noGutterMd),
/* :: */
[Cn.ifSome("bx--no-gutter-lg", noGutterLg),
/* :: */
[Cn.ifSome("bx--no-gutter-xl", noGutterXl),
/* :: */
[Cn.ifSome("bx--no-gutter-max", noGutterMax),
/* :: */
[Cn.ifSome("bx--no-gutter-sm--left", noGutterSmLeft),
/* :: */
[Cn.ifSome("bx--no-gutter-md--left", noGutterMdLeft),
/* :: */
[Cn.ifSome("bx--no-gutter-lg--left", noGutterLgLeft),
/* :: */
[Cn.ifSome("bx--no-gutter-xl--left", noGutterXlLeft),
/* :: */
[Cn.ifSome("bx--no-gutter-max--left", noGutterMaxLeft),
/* [] */
0]]]]]]]]]]]]]]]]]]]]]);
return React.createElement("div", {
className: colClasses
}, children);
}
var Column = {
make: Grid$Column
};
/* react Not a pure module */
exports.Column = Column;