UNPKG

14.3 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.BODY = exports.EXIT_BUTTON = exports.BUTTONS = exports.HEADER = exports.MPM_HEADER = exports.CONTAINER = exports.USHIRO = exports.TAIL = exports.STEPS = exports.STEP = undefined;
7
8var _defineProperty2 = require("babel-runtime/helpers/defineProperty");
9
10var _defineProperty3 = _interopRequireDefault(_defineProperty2);
11
12var _taggedTemplateLiteral2 = require("babel-runtime/helpers/taggedTemplateLiteral");
13
14var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2);
15
16var _templateObject = (0, _taggedTemplateLiteral3.default)(["\n @media (max-width: ", "px) {\n bottom: -15%;\n right: 50%;\n border-width: 0 0 1px 1px;\n }\n @media (min-width: ", "px) {\n top: 50%;\n right: 0;\n border-width: 0 1px 1px 0;\n }\n display: block;\n position: absolute;\n z-index: 1;\n width: 1rem;\n height: 1rem;\n border-style: solid;\n transform: translateY(-50%) translateX(50%) rotate(-45deg);\n transition: background-color 200ms;\n border-color: ", ";\n background-color: ", ";\n"], ["\n @media (max-width: ", "px) {\n bottom: -15%;\n right: 50%;\n border-width: 0 0 1px 1px;\n }\n @media (min-width: ", "px) {\n top: 50%;\n right: 0;\n border-width: 0 1px 1px 0;\n }\n display: block;\n position: absolute;\n z-index: 1;\n width: 1rem;\n height: 1rem;\n border-style: solid;\n transform: translateY(-50%) translateX(50%) rotate(-45deg);\n transition: background-color 200ms;\n border-color: ", ";\n background-color: ", ";\n"]),
17 _templateObject2 = (0, _taggedTemplateLiteral3.default)(["\n width: 100%;\n display: flex;\n @media (max-width: ", "px) {\n flex-direction: column;\n }\n @media (min-width: ", "px) {\n flex-direction: row;\n }\n"], ["\n width: 100%;\n display: flex;\n @media (max-width: ", "px) {\n flex-direction: column;\n }\n @media (min-width: ", "px) {\n flex-direction: row;\n }\n"]),
18 _templateObject3 = (0, _taggedTemplateLiteral3.default)(["\n position: relative;\n display: flex;\n align-items: center;\n cursor: ", ";\n height: 6rem;\n padding: 1rem 2rem;\n justify-content: flex-start;\n border-style: solid;\n border-color: ", ";\n @media (min-width: ", "px) {\n flex-basis: 100%;\n border-width: 0 1px 1px 0;\n }\n @media (max-width: ", "px) {\n flex-basis: auto;\n border-width: 0 1px 1px 0;\n }\n transition: background-color 200ms;\n ", ";\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n cursor: ", ";\n height: 6rem;\n padding: 1rem 2rem;\n justify-content: flex-start;\n border-style: solid;\n border-color: ", ";\n @media (min-width: ", "px) {\n flex-basis: 100%;\n border-width: 0 1px 1px 0;\n }\n @media (max-width: ", "px) {\n flex-basis: auto;\n border-width: 0 1px 1px 0;\n }\n transition: background-color 200ms;\n ", ";\n"]),
19 _templateObject4 = (0, _taggedTemplateLiteral3.default)(["\n position: fixed;\n height: 100%;\n top: 0;\n left: 0;\n width: 100%;\n background: ", ";\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n -webkit-tap-highlight-color: transparent;\n"], ["\n position: fixed;\n height: 100%;\n top: 0;\n left: 0;\n width: 100%;\n background: ", ";\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n -webkit-tap-highlight-color: transparent;\n"]),
20 _templateObject5 = (0, _taggedTemplateLiteral3.default)(["\n overflow-y: ", ";\n background: ", ";\n padding: ", ";\n border-radius: ", ";\n"], ["\n overflow-y: ", ";\n background: ", ";\n padding: ", ";\n border-radius: ", ";\n"]),
21 _templateObject6 = (0, _taggedTemplateLiteral3.default)(["\n background: ", ";\n padding: ", ";\n border-radius: ", ";\n border-top: ", ";\n display: flex;\n align-items: center;\n justify-content: flex-end;\n"], ["\n background: ", ";\n padding: ", ";\n border-radius: ", ";\n border-top: ", ";\n display: flex;\n align-items: center;\n justify-content: flex-end;\n"]),
22 _templateObject7 = (0, _taggedTemplateLiteral3.default)(["\n position: relative;\n cursor: default;\n z-index: 0;\n background: ", ";\n color: ", ";\n margin: ", ";\n border: ", ";\n border-radius: ", ";\n"], ["\n position: relative;\n cursor: default;\n z-index: 0;\n background: ", ";\n color: ", ";\n margin: ", ";\n border: ", ";\n border-radius: ", ";\n"]),
23 _templateObject8 = (0, _taggedTemplateLiteral3.default)(["\n display: flex;\n align-items: center;\n\n padding: ", ";\n margin: ", ";\n border-bottom: ", ";\n border-radius: ", ";\n background: ", ";\n"], ["\n display: flex;\n align-items: center;\n\n padding: ", ";\n margin: ", ";\n border-bottom: ", ";\n border-radius: ", ";\n background: ", ";\n"]),
24 _templateObject9 = (0, _taggedTemplateLiteral3.default)(["\n padding: 0;\n"], ["\n padding: 0;\n"]);
25
26var _styledComponents = require("styled-components");
27
28var _styledComponents2 = _interopRequireDefault(_styledComponents);
29
30var _tinycolor = require("tinycolor2");
31
32var _tinycolor2 = _interopRequireDefault(_tinycolor);
33
34function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
36var backgroundColorTail = function backgroundColorTail(_ref) {
37 var isOn = _ref.isOn,
38 colors = _ref.colors,
39 isDisabled = _ref.isDisabled;
40
41 var getBackgroundColor = function getBackgroundColor(backgroundColorID) {
42 return isOn ? colors.on[backgroundColorID] : colors.off[backgroundColorID];
43 };
44 if (isDisabled) {
45 return "\n background-color: " + colors.disabled.backgroundColor + ";\n ";
46 }
47 return "\n background-color: " + getBackgroundColor("backgroundColorA") + "; \n ";
48};
49
50var backgroundColor = function backgroundColor(_ref2) {
51 var isOn = _ref2.isOn,
52 colors = _ref2.colors,
53 isDisabled = _ref2.isDisabled;
54
55 var getBackgroundColor = function getBackgroundColor(backgroundColorID) {
56 return isOn ? colors.on[backgroundColorID] : colors.off[backgroundColorID];
57 };
58 if (isDisabled) {
59 return " \n background-color: " + colors.disabled.backgroundColor + ";\n ";
60 }
61 return "\n background-color: " + getBackgroundColor("backgroundColorA") + ";\n :hover {\n background-color: " + getBackgroundColor("backgroundColorB") + ";\n }\n :active {\n background-color: " + getBackgroundColor("backgroundColorC") + ";\n }\n &:hover " + TAIL + " {\n background-color: " + getBackgroundColor("backgroundColorB") + ";\n }\n &:active " + TAIL + " {\n background-color: " + getBackgroundColor("backgroundColorC") + ";\n }\n ";
62};
63
64var TAIL = (0, _styledComponents2.default)("div")(_templateObject, function (_ref3) {
65 var flexDirectionThreshold = _ref3.flexDirectionThreshold;
66 return flexDirectionThreshold;
67}, function (_ref4) {
68 var flexDirectionThreshold = _ref4.flexDirectionThreshold;
69 return flexDirectionThreshold;
70}, function (_ref5) {
71 var isDisabled = _ref5.isDisabled,
72 colors = _ref5.colors;
73 return isDisabled ? colors.disabled.backgroundColor : colors.on.backgroundColorC;
74}, function (_ref6) {
75 var isOn = _ref6.isOn,
76 colors = _ref6.colors,
77 isDisabled = _ref6.isDisabled;
78 return !isDisabled ? isOn ? colors.on.backgroundColorA : colors.off.backgroundColorA : colors.disabled.backgroundColor;
79});
80
81var STEPS = _styledComponents2.default.div(_templateObject2, function (_ref7) {
82 var flexDirectionThreshold = _ref7.flexDirectionThreshold;
83 return flexDirectionThreshold;
84}, function (_ref8) {
85 var flexDirectionThreshold = _ref8.flexDirectionThreshold;
86 return flexDirectionThreshold;
87});
88
89var STEP = (0, _styledComponents2.default)("div")(_templateObject3, function (_ref9) {
90 var isDisabled = _ref9.isDisabled;
91 return isDisabled ? "default" : "pointer";
92}, function (_ref10) {
93 var isDisabled = _ref10.isDisabled,
94 colors = _ref10.colors;
95 return isDisabled ? colors.disabled.backgroundColor : colors.on.backgroundColorC;
96}, function (_ref11) {
97 var flexDirectionThreshold = _ref11.flexDirectionThreshold;
98 return flexDirectionThreshold;
99}, function (_ref12) {
100 var flexDirectionThreshold = _ref12.flexDirectionThreshold;
101 return flexDirectionThreshold;
102}, backgroundColor);
103
104var USHIRO = _styledComponents2.default.div(_templateObject4, function (_ref13) {
105 var theme = _ref13.theme;
106 return theme.modaldialog.ushiro.background;
107});
108USHIRO.defaultProps = {
109 theme: {
110 modaldialog: {
111 ushiro: {
112 background: "rgba(0, 0, 0, 0.5)"
113 }
114 }
115 }
116};
117var BODY = _styledComponents2.default.div(_templateObject5, function (_ref14) {
118 var theme = _ref14.theme;
119 return theme.modaldialog.body.overflowY;
120}, function (_ref15) {
121 var theme = _ref15.theme;
122 return theme.modaldialog.body.background;
123}, function (_ref16) {
124 var theme = _ref16.theme;
125 return theme.modaldialog.body.padding;
126}, function (_ref17) {
127 var hasheader = _ref17.hasheader,
128 hasfooter = _ref17.hasfooter,
129 theme = _ref17.theme;
130 return (hasheader ? "0 0" : theme.modaldialog.body.borderRadius + " " + theme.modaldialog.body.borderRadius) + " " + (hasfooter ? "0 0" : theme.modaldialog.body.borderRadius + " " + theme.modaldialog.body.borderRadius);
131});
132BODY.defaultProps = {
133 hasfooter: "false",
134 hasheader: "false",
135 theme: {
136 modaldialog: {
137 body: {
138 background: "#fdfdfd",
139 padding: "2.4rem 2rem",
140 overflowY: "auto",
141 borderRadius: "1rem"
142 }
143 }
144 }
145};
146var EXIT_BUTTON = _styledComponents2.default.div(function (_ref18) {
147 var _ref19;
148
149 var theme = _ref18.theme;
150 return theme.modaldialog && theme.modaldialog.exitbutton ? {
151 zIndex: "2",
152 position: "fixed",
153 cursor: "pointer",
154 background: theme.modaldialog.exitbutton.background,
155 height: theme.modaldialog.exitbutton.height,
156 width: theme.modaldialog.exitbutton.width,
157 border: theme.modaldialog.exitbutton.border,
158 top: theme.modaldialog.exitbutton.top,
159 right: theme.modaldialog.exitbutton.right,
160 borderRadius: "1rem",
161 display: "flex"
162 } : (_ref19 = {
163 zIndex: "2",
164 position: "fixed",
165 cursor: "pointer"
166 }, (0, _defineProperty3.default)(_ref19, "zIndex", 2), (0, _defineProperty3.default)(_ref19, "top", "2rem"), (0, _defineProperty3.default)(_ref19, "right", "2rem"), (0, _defineProperty3.default)(_ref19, "position", "fixed"), (0, _defineProperty3.default)(_ref19, "height", "1.75rem"), (0, _defineProperty3.default)(_ref19, "width", "1.75rem"), (0, _defineProperty3.default)(_ref19, "background", "#fff"), (0, _defineProperty3.default)(_ref19, "border", "1px solid #575757"), (0, _defineProperty3.default)(_ref19, "borderRadius", "1rem"), (0, _defineProperty3.default)(_ref19, "display", "flex"), _ref19);
167});
168// const EXIT_BUTTON = styled.div`
169// z-index: 2;
170// position: fixed;
171// cursor: pointer;
172// background: ${({ theme }) => theme.modaldialog.exitbutton.background};
173// height: ${({ theme }) => theme.modaldialog.exitbutton.height};
174// width: ${({ theme }) => theme.modaldialog.exitbutton.width};
175// border: ${({ theme }) => theme.modaldialog.exitbutton.border};
176// top: ${({ theme }) => theme.modaldialog.exitbutton.top};
177// right: ${({ theme }) => theme.modaldialog.exitbutton.right};
178// border-radius: 1rem;
179// display: flex;
180// `
181EXIT_BUTTON.defaultProps = {
182 theme: {
183 modaldialog: {
184 exitbutton: {
185 zIndex: 2,
186 top: "2rem",
187 right: "2rem",
188 position: "fixed",
189 height: "1.75rem",
190 width: "1.75rem",
191
192 background: "#fff",
193 border: "1px solid #575757"
194 }
195 }
196 }
197};
198
199var BUTTONS = _styledComponents2.default.div(_templateObject6, function (_ref20) {
200 var theme = _ref20.theme;
201 return theme.modaldialog.buttons.background;
202}, function (_ref21) {
203 var theme = _ref21.theme;
204 return theme.modaldialog.buttons.padding;
205}, function (_ref22) {
206 var theme = _ref22.theme;
207 return theme.modaldialog.buttons.borderRadius;
208}, function (_ref23) {
209 var theme = _ref23.theme;
210 return theme.modaldialog.buttons.borderTop;
211});
212
213BUTTONS.defaultProps = {
214 theme: {
215 modaldialog: {
216 buttons: {
217 borderTop: "1px solid #575757",
218 borderRadius: "0 0 0.375rem 0.375rem",
219 padding: "0.5rem",
220 background: "#fafafa"
221 }
222 }
223 }
224};
225
226var CONTAINER = _styledComponents2.default.div(_templateObject7, function (_ref24) {
227 var theme = _ref24.theme;
228 return theme.modaldialog.container.background;
229}, function (_ref25) {
230 var theme = _ref25.theme;
231 return theme.modaldialog.container.color;
232}, function (_ref26) {
233 var theme = _ref26.theme;
234 return theme.modaldialog.container.margin;
235}, function (_ref27) {
236 var theme = _ref27.theme;
237 return theme.modaldialog.container.border;
238}, function (_ref28) {
239 var theme = _ref28.theme;
240 return theme.modaldialog.container.borderRadius;
241});
242
243CONTAINER.defaultProps = {
244 theme: {
245 modaldialog: {
246 container: {
247 margin: "0 1rem",
248 border: "1px solid #575757",
249 borderRadius: "0.375rem",
250 color: "#020202",
251 background: "#fff"
252 }
253 }
254 }
255};
256
257var HEADER = _styledComponents2.default.div(_templateObject8, function (_ref29) {
258 var theme = _ref29.theme;
259 return theme.modaldialog.header.padding;
260}, function (_ref30) {
261 var theme = _ref30.theme;
262 return theme.modaldialog.header.margin;
263}, function (_ref31) {
264 var theme = _ref31.theme;
265 return theme.modaldialog.header.borderBottom;
266}, function (_ref32) {
267 var theme = _ref32.theme;
268 return theme.modaldialog.header.borderRadius;
269}, function (_ref33) {
270 var theme = _ref33.theme;
271 return theme.modaldialog.header.background;
272});
273
274HEADER.defaultProps = {
275 theme: {
276 modaldialog: {
277 header: {
278 margin: "0",
279 padding: "2rem 2rem 1.5rem 2rem",
280 borderBottom: "0.5rem solid #f0f0f0",
281 borderRadius: "0.375rem 0.375rem 0 0 ",
282 background: "#fafafa"
283 }
284 }
285 }
286};
287
288var MPM_HEADER = (0, _styledComponents2.default)(HEADER)(_templateObject9);
289
290exports.STEP = STEP;
291exports.STEPS = STEPS;
292exports.TAIL = TAIL;
293exports.USHIRO = USHIRO;
294exports.CONTAINER = CONTAINER;
295exports.MPM_HEADER = MPM_HEADER;
296exports.HEADER = HEADER;
297exports.BUTTONS = BUTTONS;
298exports.EXIT_BUTTON = EXIT_BUTTON;
299exports.BODY = BODY;
\No newline at end of file