UNPKG

8.11 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.CONTAINER = exports.FOOTNOTE_SIGN = exports.SUBLABEL = exports.ROW = exports.LABEL = exports.ICON = exports.CHECKBOX_CONTAINER = exports.CONTENT = exports.RADIO_TRIGGER = exports.CHECKBOX_TRIGGER = exports.OPTION = undefined;
7
8var _taggedTemplateLiteral2 = require("babel-runtime/helpers/taggedTemplateLiteral");
9
10var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2);
11
12var _templateObject = (0, _taggedTemplateLiteral3.default)([""], [""]),
13 _templateObject2 = (0, _taggedTemplateLiteral3.default)(["\n display: flex;\n flex-direction: column;\n padding: ", ";\n margin: ", ";\n\n max-width: 100%;\n flex-direction: row;\n"], ["\n display: flex;\n flex-direction: column;\n padding: ", ";\n margin: ", ";\n\n max-width: 100%;\n flex-direction: row;\n"]),
14 _templateObject3 = (0, _taggedTemplateLiteral3.default)(["\n display: flex;\n flex-direction: column;\n padding: ", ";\n margin: 0 -2.4rem;\n max-width: 100%;\n flex-direction: row;\n"], ["\n display: flex;\n flex-direction: column;\n padding: ", ";\n margin: 0 -2.4rem;\n max-width: 100%;\n flex-direction: row;\n"]),
15 _templateObject4 = (0, _taggedTemplateLiteral3.default)(["\n display: flex;\n flex-direction: column;\n\n width: 100%;\n"], ["\n display: flex;\n flex-direction: column;\n\n width: 100%;\n"]),
16 _templateObject5 = (0, _taggedTemplateLiteral3.default)(["\n display: flex;\n flex-direction: row;\n width: 100%;\n"], ["\n display: flex;\n flex-direction: row;\n width: 100%;\n"]),
17 _templateObject6 = (0, _taggedTemplateLiteral3.default)(["\n margin-right: 2.4rem;\n display: flex;\n justify-content: flex-start;\n"], ["\n margin-right: 2.4rem;\n display: flex;\n justify-content: flex-start;\n"]),
18 _templateObject7 = (0, _taggedTemplateLiteral3.default)(["\n @media (max-width: ", "px) {\n display: ", ";\n }\n min-width: ", "rem;\n height: ", "rem;\n margin-left: 1rem;\n position: absolute;\n right: 2.4rem;\n border-radius: 0.25rem;\n border: 2px solid white;\n background-image: ", ";\n background-position: center;\n background-repeat: no-repeat;\n background-size: contain;\n"], ["\n @media (max-width: ", "px) {\n display: ", ";\n }\n min-width: ", "rem;\n height: ", "rem;\n margin-left: 1rem;\n position: absolute;\n right: 2.4rem;\n border-radius: 0.25rem;\n border: 2px solid white;\n background-image: ", ";\n background-position: center;\n background-repeat: no-repeat;\n background-size: contain;\n"]),
19 _templateObject8 = (0, _taggedTemplateLiteral3.default)(["\n display: flex;\n width: 100%;\n justify-content: space-evenly;\n flex-direction: column;\n"], ["\n display: flex;\n width: 100%;\n justify-content: space-evenly;\n flex-direction: column;\n"]),
20 _templateObject9 = (0, _taggedTemplateLiteral3.default)(["\n display: flex;\n justify-content: space-between;\n \n margin: 0 -2.5rem 0 0;\n /* padding: 0.5rem ", "rem 0.5rem 1rem;\n margin: 0rem -", "rem 0rem 0rem; */\n \n padding: 0.5rem 3rem 0.75rem 2rem;\n \n /* @media (max-width: 425px) {\n }\n @media (min-width: 425px) {\n padding: 0.5rem 9rem 0.75rem 2rem;\n } */\n :first-child {\n background: linear-gradient(to right, ", ", ", ");\n /* color: ", "; */\n color: white;\n }\n /* :last-child {\n background: #fdd;\n //color: white;\n } */\n"], ["\n display: flex;\n justify-content: space-between;\n \n margin: 0 -2.5rem 0 0;\n /* padding: 0.5rem ", "rem 0.5rem 1rem;\n margin: 0rem -", "rem 0rem 0rem; */\n \n padding: 0.5rem 3rem 0.75rem 2rem;\n \n /* @media (max-width: 425px) {\n }\n @media (min-width: 425px) {\n padding: 0.5rem 9rem 0.75rem 2rem;\n } */\n :first-child {\n background: linear-gradient(to right, ", ", ", ");\n /* color: ", "; */\n color: white;\n }\n /* :last-child {\n background: #fdd;\n //color: white;\n } */\n"]);
21
22var _defaultStyles = require("./defaultStyles");
23
24var _tinycolor = require("tinycolor2");
25
26var _tinycolor2 = _interopRequireDefault(_tinycolor);
27
28var _StyledButton = require("./StyledButton");
29
30var _styledComponents = require("styled-components");
31
32var _styledComponents2 = _interopRequireDefault(_styledComponents);
33
34var _StyledGeneric = require("./StyledGeneric");
35
36function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
38var CONTAINER = (0, _styledComponents2.default)("div")(_templateObject);
39
40var RADIO_TRIGGER = (0, _styledComponents2.default)(_StyledButton.BUTTON).attrs(function (props) {
41 return {
42 colors: !props.theme ? _defaultStyles.buttonStyles.neutral : {
43 transition: "mix",
44 on: {
45 backgroundColor: (0, _tinycolor2.default)(props.theme.beta).lighten(55).toString(),
46 color: "#000"
47 },
48 off: {
49 backgroundColor: (0, _tinycolor2.default)(props.theme.alpha).lighten(100).toString(),
50 color: "#000"
51 },
52 disabled: { backgroundColor: "#ccc", color: "#888" },
53 diff: 30
54 }
55 };
56})(_templateObject2, function (_ref) {
57 var _ref$padding = _ref.padding,
58 padding = _ref$padding === undefined ? "0 2.4rem 0" : _ref$padding;
59 return padding;
60}, function (_ref2) {
61 var _ref2$margin = _ref2.margin,
62 margin = _ref2$margin === undefined ? "0 -2.4rem 0" : _ref2$margin;
63 return margin;
64});
65
66var CHECKBOX_TRIGGER = (0, _styledComponents2.default)(_StyledButton.BUTTON).attrs(function (props) {
67 return {
68 colors: !props.theme ? _defaultStyles.buttonStyles.neutral : {
69 transition: "mix",
70 on: {
71 backgroundColor: (0, _tinycolor2.default)(props.theme.beta).lighten(55).toString(),
72 color: "#000"
73 },
74 off: {
75 backgroundColor: (0, _tinycolor2.default)(props.theme.alpha).lighten(50).toString(),
76 color: "#000"
77 },
78 disabled: { backgroundColor: "#ccc", color: "#888" },
79 diff: 30
80 }
81 };
82})(_templateObject3, function (_ref3) {
83 var _ref3$padding = _ref3.padding,
84 padding = _ref3$padding === undefined ? "0 2.4rem 0" : _ref3$padding;
85 return padding;
86});
87
88var OPTION = (0, _styledComponents2.default)("div")(_templateObject4);
89var CONTENT = (0, _styledComponents2.default)("div")(_templateObject5);
90var CHECKBOX_CONTAINER = (0, _styledComponents2.default)("div")(_templateObject6);
91var ICON = (0, _styledComponents2.default)("div")(_templateObject7, function (_ref4) {
92 var renderIconMediaMin = _ref4.renderIconMediaMin;
93 return renderIconMediaMin;
94}, function (_ref5) {
95 var renderIconMediaMin = _ref5.renderIconMediaMin;
96 return renderIconMediaMin !== 0 ? "none" : "flex";
97}, function (_ref6) {
98 var iconSize = _ref6.iconSize;
99 return iconSize;
100}, function (_ref7) {
101 var iconSize = _ref7.iconSize;
102 return iconSize;
103}, function (_ref8) {
104 var src = _ref8.src;
105 return "url(\"" + src + "\")";
106});
107
108var LABEL = (0, _styledComponents2.default)("div")(_templateObject8);
109var ROW = (0, _styledComponents2.default)("div")(_templateObject9, function (_ref9) {
110 var _ref9$iconSize = _ref9.iconSize,
111 iconSize = _ref9$iconSize === undefined ? 4 : _ref9$iconSize;
112 return iconSize + 4;
113}, function (_ref10) {
114 var _ref10$iconSize = _ref10.iconSize,
115 iconSize = _ref10$iconSize === undefined ? 4 : _ref10$iconSize;
116 return iconSize + 4;
117}, function (props) {
118 return props.isOn ? props.theme.beta : props.theme.alpha;
119}, function (props) {
120 return props.isOn ? props.theme.alpha : props.theme.gamma;
121}, function (props) {
122 return props.isOn ? "white" : props.theme.beta;
123});
124
125ROW.defaultProps = {
126 theme: {
127 primary: "salmon",
128 secondary: "papayawhip"
129 }
130};
131var SUBLABEL = (0, _styledComponents2.default)("div")(_templateObject);
132
133exports.OPTION = OPTION;
134exports.CHECKBOX_TRIGGER = CHECKBOX_TRIGGER;
135exports.RADIO_TRIGGER = RADIO_TRIGGER;
136exports.CONTENT = CONTENT;
137exports.CHECKBOX_CONTAINER = CHECKBOX_CONTAINER;
138exports.ICON = ICON;
139exports.LABEL = LABEL;
140exports.ROW = ROW;
141exports.SUBLABEL = SUBLABEL;
142exports.FOOTNOTE_SIGN = _StyledGeneric.FOOTNOTE_SIGN;
143exports.CONTAINER = CONTAINER;
\No newline at end of file