1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.BODY = exports.EXIT_BUTTON = exports.BUTTONS = exports.HEADER = exports.MPM_HEADER = exports.CONTAINER = exports.USHIRO = exports.TAIL = exports.STEPS = exports.STEP = undefined;
|
7 |
|
8 | var _defineProperty2 = require("babel-runtime/helpers/defineProperty");
|
9 |
|
10 | var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
11 |
|
12 | var _taggedTemplateLiteral2 = require("babel-runtime/helpers/taggedTemplateLiteral");
|
13 |
|
14 | var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2);
|
15 |
|
16 | var _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 |
|
26 | var _styledComponents = require("styled-components");
|
27 |
|
28 | var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
29 |
|
30 | var _tinycolor = require("tinycolor2");
|
31 |
|
32 | var _tinycolor2 = _interopRequireDefault(_tinycolor);
|
33 |
|
34 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
35 |
|
36 | var 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 |
|
50 | var 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 |
|
64 | var 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 |
|
81 | var 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 |
|
89 | var 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 |
|
104 | var USHIRO = _styledComponents2.default.div(_templateObject4, function (_ref13) {
|
105 | var theme = _ref13.theme;
|
106 | return theme.modaldialog.ushiro.background;
|
107 | });
|
108 | USHIRO.defaultProps = {
|
109 | theme: {
|
110 | modaldialog: {
|
111 | ushiro: {
|
112 | background: "rgba(0, 0, 0, 0.5)"
|
113 | }
|
114 | }
|
115 | }
|
116 | };
|
117 | var 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 | });
|
132 | BODY.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 | };
|
146 | var 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 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 | EXIT_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 |
|
199 | var 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 |
|
213 | BUTTONS.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 |
|
226 | var 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 |
|
243 | CONTAINER.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 |
|
257 | var 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 |
|
274 | HEADER.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 |
|
288 | var MPM_HEADER = (0, _styledComponents2.default)(HEADER)(_templateObject9);
|
289 |
|
290 | exports.STEP = STEP;
|
291 | exports.STEPS = STEPS;
|
292 | exports.TAIL = TAIL;
|
293 | exports.USHIRO = USHIRO;
|
294 | exports.CONTAINER = CONTAINER;
|
295 | exports.MPM_HEADER = MPM_HEADER;
|
296 | exports.HEADER = HEADER;
|
297 | exports.BUTTONS = BUTTONS;
|
298 | exports.EXIT_BUTTON = EXIT_BUTTON;
|
299 | exports.BODY = BODY; |
\ | No newline at end of file |