@mysugr/spring-core
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -1,2 +0,2 @@ | ||
{"/Users/florianeckerstorfer/Projects/spring/@mysugr/spring-core/src/components/Button/Button.js": {"path":"/Users/florianeckerstorfer/Projects/spring/@mysugr/spring-core/src/components/Button/Button.js","statementMap":{"0":{"start":{"line":6,"column":2},"end":{"line":6,"column":64}},"1":{"start":{"line":9,"column":2},"end":{"line":9,"column":68}},"2":{"start":{"line":12,"column":2},"end":{"line":12,"column":60}},"3":{"start":{"line":14,"column":22},"end":{"line":14,"column":79}},"4":{"start":{"line":17,"column":2},"end":{"line":17,"column":62}},"5":{"start":{"line":20,"column":2},"end":{"line":20,"column":62}},"6":{"start":{"line":22,"column":15},"end":{"line":72,"column":1}},"7":{"start":{"line":35,"column":2},"end":{"line":37,"column":3}},"8":{"start":{"line":36,"column":4},"end":{"line":36,"column":40}},"9":{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},"10":{"start":{"line":39,"column":4},"end":{"line":39,"column":44}},"11":{"start":{"line":41,"column":2},"end":{"line":43,"column":3}},"12":{"start":{"line":42,"column":4},"end":{"line":42,"column":36}},"13":{"start":{"line":44,"column":2},"end":{"line":46,"column":3}},"14":{"start":{"line":45,"column":4},"end":{"line":45,"column":35}},"15":{"start":{"line":47,"column":2},"end":{"line":49,"column":3}},"16":{"start":{"line":48,"column":4},"end":{"line":48,"column":38}},"17":{"start":{"line":50,"column":2},"end":{"line":52,"column":3}},"18":{"start":{"line":51,"column":4},"end":{"line":51,"column":38}},"19":{"start":{"line":53,"column":2},"end":{"line":71,"column":4}},"20":{"start":{"line":74,"column":0},"end":{"line":85,"column":2}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":22,"column":15},"end":{"line":22,"column":16}},"loc":{"start":{"line":34,"column":6},"end":{"line":72,"column":1}},"line":34}},"branchMap":{"0":{"loc":{"start":{"line":35,"column":2},"end":{"line":37,"column":3}},"type":"if","locations":[{"start":{"line":35,"column":2},"end":{"line":37,"column":3}},{"start":{"line":35,"column":2},"end":{"line":37,"column":3}}],"line":35},"1":{"loc":{"start":{"line":35,"column":6},"end":{"line":35,"column":23}},"type":"binary-expr","locations":[{"start":{"line":35,"column":6},"end":{"line":35,"column":11}},{"start":{"line":35,"column":15},"end":{"line":35,"column":23}}],"line":35},"2":{"loc":{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},"type":"if","locations":[{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},{"start":{"line":38,"column":2},"end":{"line":40,"column":3}}],"line":38},"3":{"loc":{"start":{"line":38,"column":6},"end":{"line":38,"column":27}},"type":"binary-expr","locations":[{"start":{"line":38,"column":6},"end":{"line":38,"column":15}},{"start":{"line":38,"column":19},"end":{"line":38,"column":27}}],"line":38},"4":{"loc":{"start":{"line":41,"column":2},"end":{"line":43,"column":3}},"type":"if","locations":[{"start":{"line":41,"column":2},"end":{"line":43,"column":3}},{"start":{"line":41,"column":2},"end":{"line":43,"column":3}}],"line":41},"5":{"loc":{"start":{"line":41,"column":6},"end":{"line":41,"column":19}},"type":"binary-expr","locations":[{"start":{"line":41,"column":6},"end":{"line":41,"column":11}},{"start":{"line":41,"column":15},"end":{"line":41,"column":19}}],"line":41},"6":{"loc":{"start":{"line":44,"column":2},"end":{"line":46,"column":3}},"type":"if","locations":[{"start":{"line":44,"column":2},"end":{"line":46,"column":3}},{"start":{"line":44,"column":2},"end":{"line":46,"column":3}}],"line":44},"7":{"loc":{"start":{"line":44,"column":6},"end":{"line":44,"column":18}},"type":"binary-expr","locations":[{"start":{"line":44,"column":6},"end":{"line":44,"column":10}},{"start":{"line":44,"column":14},"end":{"line":44,"column":18}}],"line":44},"8":{"loc":{"start":{"line":47,"column":2},"end":{"line":49,"column":3}},"type":"if","locations":[{"start":{"line":47,"column":2},"end":{"line":49,"column":3}},{"start":{"line":47,"column":2},"end":{"line":49,"column":3}}],"line":47},"9":{"loc":{"start":{"line":47,"column":6},"end":{"line":47,"column":21}},"type":"binary-expr","locations":[{"start":{"line":47,"column":6},"end":{"line":47,"column":10}},{"start":{"line":47,"column":14},"end":{"line":47,"column":21}}],"line":47},"10":{"loc":{"start":{"line":50,"column":2},"end":{"line":52,"column":3}},"type":"if","locations":[{"start":{"line":50,"column":2},"end":{"line":52,"column":3}},{"start":{"line":50,"column":2},"end":{"line":52,"column":3}}],"line":50},"11":{"loc":{"start":{"line":50,"column":6},"end":{"line":50,"column":21}},"type":"binary-expr","locations":[{"start":{"line":50,"column":6},"end":{"line":50,"column":10}},{"start":{"line":50,"column":14},"end":{"line":50,"column":21}}],"line":50}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":16,"8":1,"9":15,"10":1,"11":14,"12":1,"13":13,"14":1,"15":12,"16":1,"17":11,"18":1,"19":10,"20":1},"f":{"0":16},"b":{"0":[1,15],"1":[16,2],"2":[1,14],"3":[15,2],"4":[1,13],"5":[14,2],"6":[1,12],"7":[13,2],"8":[1,11],"9":[12,1],"10":[1,10],"11":[11,2]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"0d21b75bf5d1e6492032c671a22a6919b9b0e7ed"} | ||
{"/Users/florianeckerstorfer/Projects/spring/@mysugr/spring-core/src/components/Button/Button.tsx": {"path":"/Users/florianeckerstorfer/Projects/spring/@mysugr/spring-core/src/components/Button/Button.tsx","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}},"3":{"start":{"line":6,"column":12},"end":{"line":6,"column":51}},"4":{"start":{"line":23,"column":2},"end":{"line":23,"column":64}},"5":{"start":{"line":26,"column":2},"end":{"line":26,"column":68}},"6":{"start":{"line":29,"column":2},"end":{"line":29,"column":60}},"7":{"start":{"line":31,"column":22},"end":{"line":31,"column":79}},"8":{"start":{"line":34,"column":2},"end":{"line":34,"column":62}},"9":{"start":{"line":37,"column":2},"end":{"line":37,"column":62}},"10":{"start":{"line":39,"column":15},"end":{"line":89,"column":1}},"11":{"start":{"line":40,"column":2},"end":{"line":40,"column":10}},"12":{"start":{"line":41,"column":2},"end":{"line":41,"column":10}},"13":{"start":{"line":42,"column":2},"end":{"line":42,"column":7}},"14":{"start":{"line":43,"column":2},"end":{"line":43,"column":9}},"15":{"start":{"line":44,"column":2},"end":{"line":44,"column":7}},"16":{"start":{"line":45,"column":2},"end":{"line":45,"column":6}},"17":{"start":{"line":46,"column":2},"end":{"line":46,"column":9}},"18":{"start":{"line":47,"column":2},"end":{"line":47,"column":11}},"19":{"start":{"line":48,"column":2},"end":{"line":48,"column":6}},"20":{"start":{"line":49,"column":2},"end":{"line":49,"column":10}},"21":{"start":{"line":50,"column":2},"end":{"line":50,"column":6}},"22":{"start":{"line":52,"column":2},"end":{"line":54,"column":3}},"23":{"start":{"line":53,"column":4},"end":{"line":53,"column":40}},"24":{"start":{"line":55,"column":2},"end":{"line":57,"column":3}},"25":{"start":{"line":56,"column":4},"end":{"line":56,"column":44}},"26":{"start":{"line":58,"column":2},"end":{"line":60,"column":3}},"27":{"start":{"line":59,"column":4},"end":{"line":59,"column":36}},"28":{"start":{"line":61,"column":2},"end":{"line":63,"column":3}},"29":{"start":{"line":62,"column":4},"end":{"line":62,"column":35}},"30":{"start":{"line":64,"column":2},"end":{"line":66,"column":3}},"31":{"start":{"line":65,"column":4},"end":{"line":65,"column":38}},"32":{"start":{"line":67,"column":2},"end":{"line":69,"column":3}},"33":{"start":{"line":68,"column":4},"end":{"line":68,"column":38}},"34":{"start":{"line":70,"column":2},"end":{"line":88,"column":4}},"35":{"start":{"line":91,"column":0},"end":{"line":102,"column":2}},"36":{"start":{"line":104,"column":0},"end":{"line":104,"column":22}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":39,"column":15},"end":{"line":39,"column":15}},"loc":{"start":{"line":51,"column":9},"end":{"line":89,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":6,"column":28},"end":{"line":6,"column":34}},"type":"cond-expr","locations":[{"start":{"line":6,"column":28},"end":{"line":6,"column":34}},{"start":{"line":6,"column":37},"end":{"line":6,"column":51}}]},"1":{"loc":{"start":{"line":52,"column":2},"end":{"line":54,"column":3}},"type":"if","locations":[{"start":{"line":52,"column":2},"end":{"line":54,"column":3}},{"start":{"line":52,"column":2},"end":{"line":54,"column":3}}]},"2":{"loc":{"start":{"line":52,"column":6},"end":{"line":52,"column":11}},"type":"binary-expr","locations":[{"start":{"line":52,"column":6},"end":{"line":52,"column":11}},{"start":{"line":52,"column":15},"end":{"line":52,"column":23}}]},"3":{"loc":{"start":{"line":55,"column":2},"end":{"line":57,"column":3}},"type":"if","locations":[{"start":{"line":55,"column":2},"end":{"line":57,"column":3}},{"start":{"line":55,"column":2},"end":{"line":57,"column":3}}]},"4":{"loc":{"start":{"line":55,"column":6},"end":{"line":55,"column":15}},"type":"binary-expr","locations":[{"start":{"line":55,"column":6},"end":{"line":55,"column":15}},{"start":{"line":55,"column":19},"end":{"line":55,"column":27}}]},"5":{"loc":{"start":{"line":58,"column":2},"end":{"line":60,"column":3}},"type":"if","locations":[{"start":{"line":58,"column":2},"end":{"line":60,"column":3}},{"start":{"line":58,"column":2},"end":{"line":60,"column":3}}]},"6":{"loc":{"start":{"line":58,"column":6},"end":{"line":58,"column":11}},"type":"binary-expr","locations":[{"start":{"line":58,"column":6},"end":{"line":58,"column":11}},{"start":{"line":58,"column":15},"end":{"line":58,"column":19}}]},"7":{"loc":{"start":{"line":61,"column":2},"end":{"line":63,"column":3}},"type":"if","locations":[{"start":{"line":61,"column":2},"end":{"line":63,"column":3}},{"start":{"line":61,"column":2},"end":{"line":63,"column":3}}]},"8":{"loc":{"start":{"line":61,"column":6},"end":{"line":61,"column":10}},"type":"binary-expr","locations":[{"start":{"line":61,"column":6},"end":{"line":61,"column":10}},{"start":{"line":61,"column":14},"end":{"line":61,"column":18}}]},"9":{"loc":{"start":{"line":64,"column":2},"end":{"line":66,"column":3}},"type":"if","locations":[{"start":{"line":64,"column":2},"end":{"line":66,"column":3}},{"start":{"line":64,"column":2},"end":{"line":66,"column":3}}]},"10":{"loc":{"start":{"line":64,"column":6},"end":{"line":64,"column":10}},"type":"binary-expr","locations":[{"start":{"line":64,"column":6},"end":{"line":64,"column":10}},{"start":{"line":64,"column":14},"end":{"line":64,"column":21}}]},"11":{"loc":{"start":{"line":67,"column":2},"end":{"line":69,"column":3}},"type":"if","locations":[{"start":{"line":67,"column":2},"end":{"line":69,"column":3}},{"start":{"line":67,"column":2},"end":{"line":69,"column":3}}]},"12":{"loc":{"start":{"line":67,"column":6},"end":{"line":67,"column":10}},"type":"binary-expr","locations":[{"start":{"line":67,"column":6},"end":{"line":67,"column":10}},{"start":{"line":67,"column":14},"end":{"line":67,"column":21}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":16,"12":16,"13":16,"14":16,"15":16,"16":16,"17":16,"18":16,"19":16,"20":16,"21":16,"22":16,"23":1,"24":15,"25":1,"26":14,"27":1,"28":13,"29":1,"30":12,"31":1,"32":11,"33":1,"34":10,"35":1,"36":1},"f":{"0":16},"b":{"0":[1,0],"1":[1,15],"2":[16,2],"3":[1,14],"4":[15,2],"5":[1,13],"6":[14,2],"7":[1,12],"8":[13,2],"9":[1,11],"10":[12,1],"11":[1,10],"12":[11,2]}} | ||
} |
@@ -7,85 +7,67 @@ 'use strict'; | ||
var React = _interopDefault(require('react')); | ||
var classNames = _interopDefault(require('classnames')); | ||
var React = require('react'); | ||
var css = { "button": "Button_button__3_Ozh", "focus": "Button_focus__6iQfE", "large": "Button_large__1AC7w", "slim": "Button_slim__3DaeJ", "line": "Button_line__2JqtO", "text": "Button_text__74Hf2", "inverse": "Button_inverse__11bW2", "secondary": "Button_secondary__3Hm6m", "tertiary": "Button_tertiary__1vMCD", "disabled": "Button_disabled__3O5v9" }; | ||
var Button = {"button":"Button_button__3_Ozh","focus":"Button_focus__6iQfE","large":"Button_large__1AC7w","slim":"Button_slim__3DaeJ","line":"Button_line__2JqtO","text":"Button_text__74Hf2","inverse":"Button_inverse__11bW2","secondary":"Button_secondary__3Hm6m","tertiary":"Button_tertiary__1vMCD","disabled":"Button_disabled__3O5v9"}; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var styles = /*#__PURE__*/Object.freeze({ | ||
default: Button | ||
}); | ||
// This is the only way to make CSS Modules work with Rollup and Jest | ||
var css = undefined ? styles : Button; | ||
var ERR_FOCUS_DISABLED = 'Can not combine focus and disabled props on a single button.'; | ||
var ERR_SECONDARY_TERTIARY = 'Can not combine secondary and tertiary props on a single button.'; | ||
var ERR_LARGE_SLIM = 'Can not combine large and slim props on a single button.'; | ||
var ERR_LINE_TEXT = 'Can not combine line and text props on a single button.'; | ||
var ERR_LINE_INVERSE = 'Can not combine line and inverse props on a single button.'; | ||
var ERR_TEXT_INVERSE = 'Can not combine text and inverse props on a single button.'; | ||
var Button = function Button(_ref) { | ||
var _classNames; | ||
var children = _ref.children, | ||
disabled = _ref.disabled, | ||
focus = _ref.focus, | ||
inverse = _ref.inverse, | ||
large = _ref.large, | ||
line = _ref.line, | ||
onClick = _ref.onClick, | ||
secondary = _ref.secondary, | ||
slim = _ref.slim, | ||
tertiary = _ref.tertiary, | ||
text = _ref.text; | ||
if (focus && disabled) { | ||
throw new Error(ERR_FOCUS_DISABLED); | ||
} | ||
if (secondary && tertiary) { | ||
throw new Error(ERR_SECONDARY_TERTIARY); | ||
} | ||
if (large && slim) { | ||
throw new Error(ERR_LARGE_SLIM); | ||
} | ||
if (line && text) { | ||
throw new Error(ERR_LINE_TEXT); | ||
} | ||
if (line && inverse) { | ||
throw new Error(ERR_LINE_INVERSE); | ||
} | ||
if (text && inverse) { | ||
throw new Error(ERR_TEXT_INVERSE); | ||
} | ||
return React.createElement( | ||
'button', | ||
{ | ||
className: classNames(css.button, (_classNames = {}, _defineProperty(_classNames, css.disabled, disabled), _defineProperty(_classNames, css.focus, focus), _defineProperty(_classNames, css.inverse, inverse), _defineProperty(_classNames, css.large, large), _defineProperty(_classNames, css.line, line), _defineProperty(_classNames, css.secondary, secondary), _defineProperty(_classNames, css.slim, slim), _defineProperty(_classNames, css.tertiary, tertiary), _defineProperty(_classNames, css.text, text), _classNames)), | ||
disabled: disabled, | ||
onClick: onClick | ||
}, | ||
children | ||
); | ||
var Button$1 = function (_a) { | ||
var children = _a.children, disabled = _a.disabled, focus = _a.focus, inverse = _a.inverse, large = _a.large, line = _a.line, onClick = _a.onClick, secondary = _a.secondary, slim = _a.slim, tertiary = _a.tertiary, text = _a.text; | ||
var _b; | ||
if (focus && disabled) { | ||
throw new Error(ERR_FOCUS_DISABLED); | ||
} | ||
if (secondary && tertiary) { | ||
throw new Error(ERR_SECONDARY_TERTIARY); | ||
} | ||
if (large && slim) { | ||
throw new Error(ERR_LARGE_SLIM); | ||
} | ||
if (line && text) { | ||
throw new Error(ERR_LINE_TEXT); | ||
} | ||
if (line && inverse) { | ||
throw new Error(ERR_LINE_INVERSE); | ||
} | ||
if (text && inverse) { | ||
throw new Error(ERR_TEXT_INVERSE); | ||
} | ||
return (React.createElement("button", { className: classNames(css.button, (_b = {}, | ||
_b[css.disabled] = disabled, | ||
_b[css.focus] = focus, | ||
_b[css.inverse] = inverse, | ||
_b[css.large] = large, | ||
_b[css.line] = line, | ||
_b[css.secondary] = secondary, | ||
_b[css.slim] = slim, | ||
_b[css.tertiary] = tertiary, | ||
_b[css.text] = text, | ||
_b)), disabled: disabled, onClick: onClick }, children)); | ||
}; | ||
Button.defaultProps = { | ||
disabled: false, | ||
focus: false, | ||
inverse: false, | ||
large: false, | ||
line: false, | ||
onClick: null, | ||
secondary: false, | ||
slim: false, | ||
tertiary: false, | ||
text: false | ||
Button$1.defaultProps = { | ||
disabled: false, | ||
focus: false, | ||
inverse: false, | ||
large: false, | ||
line: false, | ||
onClick: null, | ||
secondary: false, | ||
slim: false, | ||
tertiary: false, | ||
text: false, | ||
}; | ||
var variables = { "msGreen": "#8eb927", "msMidnight": "#343434", "msTwilight": "#737373", "msNoon": "#a3a3a3", "msDim": "#c4c2c2", "msDaytime": "#e6e6e6", "msShady": "#f2f2f2", "msNeutral": "#fafafa", "msWhite": "#ffffff", "msRed": "#e75d32", "msGold": "#f0ac00", "msPetrol": "#479d95", "msDarkPetrol": "#088e85", "msOrange": "#ff8819", "msDarkOrange": "#e07716", "msPurple": "#a53257", "msBrown": "#9e6c3b", "msTree": "#72951f", "msBlue": "#66d4d9", "msGreen70": "#afce67", "msGreen50": "#c6dc93", "msGreen40": "#d2e3a9", "msGreen20": "#e8f1d4", "msGreen10": "#f3f8e9", "msOrange70": "#ffac5e", "msOrange50": "#ffc48c", "msOrange20": "#ffe7d1", "msOrange10": "#fff3e8", "msPetrol70": "#7ebab5", "msPetrol50": "#a3ceca", "msPetrol20": "#daebea", "msPetrol10": "#edf5f4" }; | ||
/* istanbul ignore file */ | ||
var variables$1 = { "regularWeight": "400", "mediunWeight": "500", "brandonText": "'Brandon Text'", "fontFamily": "$brandon-text, 'Trebuchet MS', sans-serif", "fontSizeBodyDesktop": "1.0625rem", "fontWeightBodyDesktop": "500", "lineHeightBodyDesktop": "1.5", "marginParagraphDesktop": "1.59375rem", "fontSizeH1Desktop": "2.625rem", "fontWeightH1Desktop": "500", "lineHeightH1Desktop": "1.2", "marginH1Desktop": "3.15rem", "fontSizeH2Desktop": "2rem", "fontWeightH2Desktop": "500", "lineHeightH2Desktop": "1.2", "marginH2Desktop": "2.4rem", "fontSizeH3Desktop": "1.5rem", "fontWeightH3Desktop": "500", "lineHeightH3Desktop": "1.2", "marginH3Desktop": "1.8rem", "fontSizeH4Desktop": "1.25rem", "fontWeightH4Desktop": "500", "lineHeightH4Desktop": "1.5", "marginH4Desktop": "1.875rem", "fontSizeBodyTablet": "1rem", "fontWeightBodyTablet": "400", "lineHeightBodyTablet": "1.5", "marginBodyTablet": "1.5rem", "fontSizeH1Tablet": "2.25rem", "fontWeightH1Tablet": "500", "lineHeightH1Tablet": "1.2", "marginH1Tablet": "2.7rem", "fontSizeH2Tablet": "1.625rem", "fontWeightH2Tablet": "500", "lineHeightH2Tablet": "1.5", "marginH2Tablet": "2.6rem", "fontSizeH3Tablet": "1.3125rem", "fontWeightH3Tablet": "500", "lineHeightH3Tablet": "1.5", "marginH3Tablet": "1.96875rem", "fontSizeH4Tablet": "1.0625rem", "fontWeightH4Tablet": "500", "lineHeightH4Tablet": "1.5", "marginH4Tablet": "1.59375rem", "fontSizeBodyMobile": "1rem", "fontWeightBodyMobile": "400", "lineHeightBodyMobile": "1.5", "marginBodyMobile": "1.5rem", "fontSizeH1Mobile": "1.75rem", "fontWeightH1Mobile": "500", "lineHeightH1Mobile": "1.2", "marginH1Mobile": "2.1rem", "fontSizeH2Mobile": "1.5rem", "fontWeightH2Mobile": "500", "lineHeightH2Mobile": "1.5", "marginH2Mobile": "2.25rem", "fontSizeH3Mobile": "1.3125rem", "fontWeightH3Mobile": "500", "lineHeightH3Mobile": "1.5", "marginH3Mobile": "1.96875rem", "fontSizeH4Mobile": "1.0625rem", "fontWeightH4Mobile": "500", "lineHeightH4Mobile": "1.5", "marginH4Mobile": "1.59375rem" }; | ||
var constants = { colors: variables, typography: variables$1 }; | ||
exports.Button = Button; | ||
exports.constants = constants; | ||
exports.Button = Button$1; |
@@ -1,83 +0,66 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import { createElement } from 'react'; | ||
var css = { "button": "Button_button__3_Ozh", "focus": "Button_focus__6iQfE", "large": "Button_large__1AC7w", "slim": "Button_slim__3DaeJ", "line": "Button_line__2JqtO", "text": "Button_text__74Hf2", "inverse": "Button_inverse__11bW2", "secondary": "Button_secondary__3Hm6m", "tertiary": "Button_tertiary__1vMCD", "disabled": "Button_disabled__3O5v9" }; | ||
var Button = {"button":"Button_button__3_Ozh","focus":"Button_focus__6iQfE","large":"Button_large__1AC7w","slim":"Button_slim__3DaeJ","line":"Button_line__2JqtO","text":"Button_text__74Hf2","inverse":"Button_inverse__11bW2","secondary":"Button_secondary__3Hm6m","tertiary":"Button_tertiary__1vMCD","disabled":"Button_disabled__3O5v9"}; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var styles = /*#__PURE__*/Object.freeze({ | ||
default: Button | ||
}); | ||
// This is the only way to make CSS Modules work with Rollup and Jest | ||
var css = undefined ? styles : Button; | ||
var ERR_FOCUS_DISABLED = 'Can not combine focus and disabled props on a single button.'; | ||
var ERR_SECONDARY_TERTIARY = 'Can not combine secondary and tertiary props on a single button.'; | ||
var ERR_LARGE_SLIM = 'Can not combine large and slim props on a single button.'; | ||
var ERR_LINE_TEXT = 'Can not combine line and text props on a single button.'; | ||
var ERR_LINE_INVERSE = 'Can not combine line and inverse props on a single button.'; | ||
var ERR_TEXT_INVERSE = 'Can not combine text and inverse props on a single button.'; | ||
var Button = function Button(_ref) { | ||
var _classNames; | ||
var children = _ref.children, | ||
disabled = _ref.disabled, | ||
focus = _ref.focus, | ||
inverse = _ref.inverse, | ||
large = _ref.large, | ||
line = _ref.line, | ||
onClick = _ref.onClick, | ||
secondary = _ref.secondary, | ||
slim = _ref.slim, | ||
tertiary = _ref.tertiary, | ||
text = _ref.text; | ||
if (focus && disabled) { | ||
throw new Error(ERR_FOCUS_DISABLED); | ||
} | ||
if (secondary && tertiary) { | ||
throw new Error(ERR_SECONDARY_TERTIARY); | ||
} | ||
if (large && slim) { | ||
throw new Error(ERR_LARGE_SLIM); | ||
} | ||
if (line && text) { | ||
throw new Error(ERR_LINE_TEXT); | ||
} | ||
if (line && inverse) { | ||
throw new Error(ERR_LINE_INVERSE); | ||
} | ||
if (text && inverse) { | ||
throw new Error(ERR_TEXT_INVERSE); | ||
} | ||
return React.createElement( | ||
'button', | ||
{ | ||
className: classNames(css.button, (_classNames = {}, _defineProperty(_classNames, css.disabled, disabled), _defineProperty(_classNames, css.focus, focus), _defineProperty(_classNames, css.inverse, inverse), _defineProperty(_classNames, css.large, large), _defineProperty(_classNames, css.line, line), _defineProperty(_classNames, css.secondary, secondary), _defineProperty(_classNames, css.slim, slim), _defineProperty(_classNames, css.tertiary, tertiary), _defineProperty(_classNames, css.text, text), _classNames)), | ||
disabled: disabled, | ||
onClick: onClick | ||
}, | ||
children | ||
); | ||
var Button$1 = function (_a) { | ||
var children = _a.children, disabled = _a.disabled, focus = _a.focus, inverse = _a.inverse, large = _a.large, line = _a.line, onClick = _a.onClick, secondary = _a.secondary, slim = _a.slim, tertiary = _a.tertiary, text = _a.text; | ||
var _b; | ||
if (focus && disabled) { | ||
throw new Error(ERR_FOCUS_DISABLED); | ||
} | ||
if (secondary && tertiary) { | ||
throw new Error(ERR_SECONDARY_TERTIARY); | ||
} | ||
if (large && slim) { | ||
throw new Error(ERR_LARGE_SLIM); | ||
} | ||
if (line && text) { | ||
throw new Error(ERR_LINE_TEXT); | ||
} | ||
if (line && inverse) { | ||
throw new Error(ERR_LINE_INVERSE); | ||
} | ||
if (text && inverse) { | ||
throw new Error(ERR_TEXT_INVERSE); | ||
} | ||
return (createElement("button", { className: classNames(css.button, (_b = {}, | ||
_b[css.disabled] = disabled, | ||
_b[css.focus] = focus, | ||
_b[css.inverse] = inverse, | ||
_b[css.large] = large, | ||
_b[css.line] = line, | ||
_b[css.secondary] = secondary, | ||
_b[css.slim] = slim, | ||
_b[css.tertiary] = tertiary, | ||
_b[css.text] = text, | ||
_b)), disabled: disabled, onClick: onClick }, children)); | ||
}; | ||
Button.defaultProps = { | ||
disabled: false, | ||
focus: false, | ||
inverse: false, | ||
large: false, | ||
line: false, | ||
onClick: null, | ||
secondary: false, | ||
slim: false, | ||
tertiary: false, | ||
text: false | ||
Button$1.defaultProps = { | ||
disabled: false, | ||
focus: false, | ||
inverse: false, | ||
large: false, | ||
line: false, | ||
onClick: null, | ||
secondary: false, | ||
slim: false, | ||
tertiary: false, | ||
text: false, | ||
}; | ||
var variables = { "msGreen": "#8eb927", "msMidnight": "#343434", "msTwilight": "#737373", "msNoon": "#a3a3a3", "msDim": "#c4c2c2", "msDaytime": "#e6e6e6", "msShady": "#f2f2f2", "msNeutral": "#fafafa", "msWhite": "#ffffff", "msRed": "#e75d32", "msGold": "#f0ac00", "msPetrol": "#479d95", "msDarkPetrol": "#088e85", "msOrange": "#ff8819", "msDarkOrange": "#e07716", "msPurple": "#a53257", "msBrown": "#9e6c3b", "msTree": "#72951f", "msBlue": "#66d4d9", "msGreen70": "#afce67", "msGreen50": "#c6dc93", "msGreen40": "#d2e3a9", "msGreen20": "#e8f1d4", "msGreen10": "#f3f8e9", "msOrange70": "#ffac5e", "msOrange50": "#ffc48c", "msOrange20": "#ffe7d1", "msOrange10": "#fff3e8", "msPetrol70": "#7ebab5", "msPetrol50": "#a3ceca", "msPetrol20": "#daebea", "msPetrol10": "#edf5f4" }; | ||
/* istanbul ignore file */ | ||
var variables$1 = { "regularWeight": "400", "mediunWeight": "500", "brandonText": "'Brandon Text'", "fontFamily": "$brandon-text, 'Trebuchet MS', sans-serif", "fontSizeBodyDesktop": "1.0625rem", "fontWeightBodyDesktop": "500", "lineHeightBodyDesktop": "1.5", "marginParagraphDesktop": "1.59375rem", "fontSizeH1Desktop": "2.625rem", "fontWeightH1Desktop": "500", "lineHeightH1Desktop": "1.2", "marginH1Desktop": "3.15rem", "fontSizeH2Desktop": "2rem", "fontWeightH2Desktop": "500", "lineHeightH2Desktop": "1.2", "marginH2Desktop": "2.4rem", "fontSizeH3Desktop": "1.5rem", "fontWeightH3Desktop": "500", "lineHeightH3Desktop": "1.2", "marginH3Desktop": "1.8rem", "fontSizeH4Desktop": "1.25rem", "fontWeightH4Desktop": "500", "lineHeightH4Desktop": "1.5", "marginH4Desktop": "1.875rem", "fontSizeBodyTablet": "1rem", "fontWeightBodyTablet": "400", "lineHeightBodyTablet": "1.5", "marginBodyTablet": "1.5rem", "fontSizeH1Tablet": "2.25rem", "fontWeightH1Tablet": "500", "lineHeightH1Tablet": "1.2", "marginH1Tablet": "2.7rem", "fontSizeH2Tablet": "1.625rem", "fontWeightH2Tablet": "500", "lineHeightH2Tablet": "1.5", "marginH2Tablet": "2.6rem", "fontSizeH3Tablet": "1.3125rem", "fontWeightH3Tablet": "500", "lineHeightH3Tablet": "1.5", "marginH3Tablet": "1.96875rem", "fontSizeH4Tablet": "1.0625rem", "fontWeightH4Tablet": "500", "lineHeightH4Tablet": "1.5", "marginH4Tablet": "1.59375rem", "fontSizeBodyMobile": "1rem", "fontWeightBodyMobile": "400", "lineHeightBodyMobile": "1.5", "marginBodyMobile": "1.5rem", "fontSizeH1Mobile": "1.75rem", "fontWeightH1Mobile": "500", "lineHeightH1Mobile": "1.2", "marginH1Mobile": "2.1rem", "fontSizeH2Mobile": "1.5rem", "fontWeightH2Mobile": "500", "lineHeightH2Mobile": "1.5", "marginH2Mobile": "2.25rem", "fontSizeH3Mobile": "1.3125rem", "fontWeightH3Mobile": "500", "lineHeightH3Mobile": "1.5", "marginH3Mobile": "1.96875rem", "fontSizeH4Mobile": "1.0625rem", "fontWeightH4Mobile": "500", "lineHeightH4Mobile": "1.5", "marginH4Mobile": "1.59375rem" }; | ||
var constants = { colors: variables, typography: variables$1 }; | ||
export { Button, constants }; | ||
export { Button$1 as Button }; |
@@ -15,4 +15,3 @@ { | ||
"watch": "rollup -c -w", | ||
"test": "jest", | ||
"coverage": "jest --coverage" | ||
"clean": "rm -rf ./dist" | ||
}, | ||
@@ -22,4 +21,4 @@ "peerDependencies": { | ||
}, | ||
"version": "0.3.0", | ||
"gitHead": "1aabb062129004d27c6edb9d58f0bac4126843ef" | ||
"version": "0.4.0", | ||
"gitHead": "0c178158560aaab2e2874997af57f2b7bad3b065" | ||
} |
# spring-core | ||
> 🌱 Spring is the Design System from [mySugr](https://mysugr.com). | ||
--- | ||
🚨 This is still in work. |
import autoprefixer from 'autoprefixer'; | ||
import babel from 'rollup-plugin-babel'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import filesize from 'rollup-plugin-filesize'; | ||
import localResolve from 'rollup-plugin-local-resolve'; | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; | ||
@@ -10,13 +8,10 @@ import pkg from './package.json'; | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import scssVariable from 'rollup-plugin-sass-variables'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
import url from 'rollup-plugin-url'; | ||
import svgr from '@svgr/rollup'; | ||
const config = { | ||
input: 'src/index.js', | ||
input: 'src/index.tsx', | ||
output: [ | ||
{ | ||
file: pkg.browser, | ||
format: 'umd', | ||
name: 'spring-core', | ||
}, | ||
{ | ||
file: pkg.main, | ||
@@ -40,6 +35,10 @@ format: 'cjs', | ||
}), | ||
scssVariable(), | ||
babel({ exclude: 'node_modules/**' }), | ||
localResolve(), | ||
url(), | ||
svgr(), | ||
resolve(), | ||
typescript({ | ||
tsconfig: '../../tsconfig.json', | ||
rollupCommonJSResolveHack: true, | ||
clean: true, | ||
}), | ||
commonjs(), | ||
@@ -46,0 +45,0 @@ filesize(), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
140204
43
8
0
1275