-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4541aa3
commit 9ce75b6
Showing
10 changed files
with
1,774 additions
and
1,697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
## IDE ## | ||
.vscode | ||
.idea | ||
|
||
## REPO ## | ||
dist |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,103 @@ | ||
'use strict'; | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
|
||
var _templateObject = _taggedTemplateLiteral(['\n\t@media (max-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n\t@media (min-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n\t@media (min-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n\t@media (min-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n\t@media (min-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n'], ['\n\t@media (max-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n\t@media (min-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n\t@media (min-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n\t@media (min-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n\t@media (min-width: ', ') {\n\t\tgrid-column: ', ';\n\t\tgrid-row: ', ';\n\t}\n']); | ||
var _react = _interopRequireDefault(require("react")); | ||
|
||
var _react = require('react'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
|
||
var _react2 = _interopRequireDefault(_react); | ||
var _styledComponents = _interopRequireDefault(require("styled-components")); | ||
|
||
var _propTypes = require('prop-types'); | ||
var _breakpoints = _interopRequireDefault(require("../breakpoints")); | ||
|
||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
|
||
var _styledComponents = require('styled-components'); | ||
|
||
var _styledComponents2 = _interopRequireDefault(_styledComponents); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
var _breakpoints = require('../breakpoints'); | ||
function _templateObject() { | ||
var data = _taggedTemplateLiteral(["\n\t@media (max-width: ", ") {\n\t\tgrid-column: ", ";\n\t\tgrid-row: ", ";\n\t}\n\t@media (min-width: ", ") {\n\t\tgrid-column: ", ";\n\t\tgrid-row: ", ";\n\t}\n\t@media (min-width: ", ") {\n\t\tgrid-column: ", ";\n\t\tgrid-row: ", ";\n\t}\n\t@media (min-width: ", ") {\n\t\tgrid-column: ", ";\n\t\tgrid-row: ", ";\n\t}\n\t@media (min-width: ", ") {\n\t\tgrid-column: ", ";\n\t\tgrid-row: ", ";\n\t}\n"]); | ||
|
||
var _breakpoints2 = _interopRequireDefault(_breakpoints); | ||
_templateObject = function _templateObject() { | ||
return data; | ||
}; | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
return data; | ||
} | ||
|
||
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } | ||
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } | ||
|
||
var utils = { | ||
getSize: function getSize(props, size) { | ||
var breakProvided = Object.keys(props).includes(size); | ||
return breakProvided ? props[size] : this.scaleDown(props, size); | ||
}, | ||
scaleDown: function scaleDown(props, size) { | ||
switch (size) { | ||
case 'sm': | ||
return props.xs || this.scaleUp(props); | ||
case 'md': | ||
return props.sm || props.xs || this.scaleUp(props); | ||
case 'lg': | ||
return props.md || props.sm || props.xs || this.scaleUp(props); | ||
case 'xl': | ||
return props.lg || props.md || props.sm || props.xs || this.scaleUp(props); | ||
default: | ||
return [1, 1, 1, 1]; | ||
} | ||
}, | ||
scaleUp: function scaleUp(props) { | ||
return props.xs || props.sm || props.md || props.lg || props.xl || [1, 1, 1, 1]; | ||
}, | ||
setCells: function setCells(props, type) { | ||
if (type === 'col') { | ||
if (props[0] === '*') return '1 / -1'; | ||
return props[0] + ' / ' + props[1]; | ||
} | ||
|
||
if (type === 'row') { | ||
if (props[0] === '*') return ''; | ||
return props[2] + ' / ' + props[3]; | ||
} | ||
} | ||
getSize: function getSize(props, size) { | ||
var breakProvided = Object.keys(props).includes(size); | ||
return breakProvided ? props[size] : this.scaleDown(props, size); | ||
}, | ||
scaleDown: function scaleDown(props, size) { | ||
switch (size) { | ||
case 'sm': | ||
return props.xs || this.scaleUp(props); | ||
|
||
case 'md': | ||
return props.sm || props.xs || this.scaleUp(props); | ||
|
||
case 'lg': | ||
return props.md || props.sm || props.xs || this.scaleUp(props); | ||
|
||
case 'xl': | ||
return props.lg || props.md || props.sm || props.xs || this.scaleUp(props); | ||
|
||
default: | ||
return [1, 1, 1, 1]; | ||
} | ||
}, | ||
scaleUp: function scaleUp(props) { | ||
return props.xs || props.sm || props.md || props.lg || props.xl || [1, 1, 1, 1]; | ||
}, | ||
setCells: function setCells(props, type) { | ||
if (type === 'col') { | ||
if (props[0] === '*') return "1 / -1"; | ||
return "".concat(props[0], " / ").concat(props[1]); | ||
} | ||
|
||
if (type === 'row') { | ||
if (props[0] === '*') return ""; | ||
return "".concat(props[2], " / ").concat(props[3]); | ||
} | ||
} | ||
}; | ||
|
||
var CellDiv = _styledComponents2.default.div(_templateObject, _breakpoints2.default.xs, function (props) { | ||
return utils.setCells(utils.getSize(props, 'xs'), 'col'); | ||
var CellDiv = _styledComponents.default.div(_templateObject(), _breakpoints.default.xs, function (props) { | ||
return utils.setCells(utils.getSize(props, 'xs'), 'col'); | ||
}, function (props) { | ||
return utils.setCells(utils.getSize(props, 'xs'), 'row'); | ||
}, _breakpoints2.default.sm, function (props) { | ||
return utils.setCells(utils.getSize(props, 'sm'), 'col'); | ||
return utils.setCells(utils.getSize(props, 'xs'), 'row'); | ||
}, _breakpoints.default.sm, function (props) { | ||
return utils.setCells(utils.getSize(props, 'sm'), 'col'); | ||
}, function (props) { | ||
return utils.setCells(utils.getSize(props, 'sm'), 'row'); | ||
}, _breakpoints2.default.md, function (props) { | ||
return utils.setCells(utils.getSize(props, 'md'), 'col'); | ||
return utils.setCells(utils.getSize(props, 'sm'), 'row'); | ||
}, _breakpoints.default.md, function (props) { | ||
return utils.setCells(utils.getSize(props, 'md'), 'col'); | ||
}, function (props) { | ||
return utils.setCells(utils.getSize(props, 'md'), 'row'); | ||
}, _breakpoints2.default.lg, function (props) { | ||
return utils.setCells(utils.getSize(props, 'lg'), 'col'); | ||
return utils.setCells(utils.getSize(props, 'md'), 'row'); | ||
}, _breakpoints.default.lg, function (props) { | ||
return utils.setCells(utils.getSize(props, 'lg'), 'col'); | ||
}, function (props) { | ||
return utils.setCells(utils.getSize(props, 'lg'), 'row'); | ||
}, _breakpoints2.default.xl, function (props) { | ||
return utils.setCells(utils.getSize(props, 'xl'), 'col'); | ||
return utils.setCells(utils.getSize(props, 'lg'), 'row'); | ||
}, _breakpoints.default.xl, function (props) { | ||
return utils.setCells(utils.getSize(props, 'xl'), 'col'); | ||
}, function (props) { | ||
return utils.setCells(utils.getSize(props, 'xl'), 'row'); | ||
return utils.setCells(utils.getSize(props, 'xl'), 'row'); | ||
}); | ||
|
||
function Cell(props) { | ||
return _react2.default.createElement( | ||
CellDiv, | ||
props, | ||
props.children | ||
); | ||
return _react.default.createElement(CellDiv, props, props.children); | ||
} | ||
|
||
Cell.propTypes = { | ||
xs: _propTypes2.default.arrayOf(_propTypes2.default.number), | ||
sm: _propTypes2.default.arrayOf(_propTypes2.default.number), | ||
md: _propTypes2.default.arrayOf(_propTypes2.default.number), | ||
lg: _propTypes2.default.arrayOf(_propTypes2.default.number), | ||
xl: _propTypes2.default.arrayOf(_propTypes2.default.number) | ||
xs: _propTypes.default.arrayOf(_propTypes.default.number), | ||
sm: _propTypes.default.arrayOf(_propTypes.default.number), | ||
md: _propTypes.default.arrayOf(_propTypes.default.number), | ||
lg: _propTypes.default.arrayOf(_propTypes.default.number), | ||
xl: _propTypes.default.arrayOf(_propTypes.default.number) | ||
}; | ||
|
||
exports.default = Cell; | ||
var _default = Cell; | ||
exports.default = _default; |
Oops, something went wrong.