1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | var __assign = (this && this.__assign) || function () {
|
15 | __assign = Object.assign || function(t) {
|
16 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
17 | s = arguments[i];
|
18 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
19 | t[p] = s[p];
|
20 | }
|
21 | return t;
|
22 | };
|
23 | return __assign.apply(this, arguments);
|
24 | };
|
25 | var __importStar = (this && this.__importStar) || function (mod) {
|
26 | if (mod && mod.__esModule) return mod;
|
27 | var result = {};
|
28 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
29 | result["default"] = mod;
|
30 | return result;
|
31 | };
|
32 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
33 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
34 | };
|
35 | Object.defineProperty(exports, "__esModule", { value: true });
|
36 | var React = __importStar(require("react"));
|
37 | var core_1 = require("@aws-amplify/core");
|
38 | var AmplifyTheme_1 = __importDefault(require("./AmplifyTheme"));
|
39 | exports.Container = function (props) {
|
40 | var theme = props.theme || AmplifyTheme_1.default;
|
41 | var style = exports.propStyle(props, theme.container);
|
42 | var p = core_1.objectLessAttributes(props, 'theme');
|
43 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-container", style: style }), props.children));
|
44 | };
|
45 | exports.FormContainer = function (props) {
|
46 | var theme = props.theme || AmplifyTheme_1.default;
|
47 | var style = exports.propStyle(props, theme.formContainer);
|
48 | return exports.beforeAfter(React.createElement("div", { className: "amplify-form-container", style: style }, props.children));
|
49 | };
|
50 | exports.FormSection = function (props) {
|
51 | var theme = props.theme || AmplifyTheme_1.default;
|
52 | var style = exports.propStyle(props, theme.formSection);
|
53 | return (React.createElement(exports.FormContainer, { theme: theme }, exports.beforeAfter(React.createElement("div", { className: "amplify-form-section", style: style }, props.children))));
|
54 | };
|
55 | exports.ErrorSection = function (props) {
|
56 | var theme = props.theme || AmplifyTheme_1.default;
|
57 | var style = exports.propStyle(props, theme.errorSection);
|
58 | var p = core_1.objectLessAttributes(props, 'theme');
|
59 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-error-section", style: style }),
|
60 | React.createElement(exports.ErrorSectionContent, null, props.children)));
|
61 | };
|
62 | exports.ErrorSectionContent = function (props) {
|
63 | var theme = props.theme || AmplifyTheme_1.default;
|
64 | var style = exports.propStyle(props, theme.errorSectionContent);
|
65 | return exports.beforeAfter(React.createElement("span", { className: "amplify-error-section-content", style: style }, props.children));
|
66 | };
|
67 | exports.SectionHeader = function (props) {
|
68 | var theme = props.theme || AmplifyTheme_1.default;
|
69 | var style = exports.propStyle(props, theme.sectionHeader);
|
70 | var p = core_1.objectLessAttributes(props, 'theme');
|
71 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-section-header", style: style }),
|
72 | React.createElement(exports.SectionHeaderContent, { theme: theme }, props.children)));
|
73 | };
|
74 | exports.SectionHeaderContent = function (props) {
|
75 | var theme = props.theme || AmplifyTheme_1.default;
|
76 | var style = exports.propStyle(props, theme.sectionHeaderContent);
|
77 | return exports.beforeAfter(React.createElement("span", { className: "amplify-section-header-content", style: style }, props.children));
|
78 | };
|
79 | exports.SectionFooter = function (props) {
|
80 | var theme = props.theme || AmplifyTheme_1.default;
|
81 | var style = exports.propStyle(props, theme.sectionFooter);
|
82 | var p = core_1.objectLessAttributes(props, 'theme');
|
83 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-section-footer", style: style }),
|
84 | React.createElement(exports.SectionFooterContent, { theme: theme }, props.children)));
|
85 | };
|
86 | exports.SectionFooterContent = function (props) {
|
87 | var theme = props.theme || AmplifyTheme_1.default;
|
88 | var style = exports.propStyle(props, theme.sectionFooterContent);
|
89 | return exports.beforeAfter(React.createElement("span", { className: "amplify-section-footer-content", style: style }, props.children));
|
90 | };
|
91 | exports.SectionBody = function (props) {
|
92 | var theme = props.theme || AmplifyTheme_1.default;
|
93 | var style = exports.propStyle(props, theme.sectionBody);
|
94 | var p = core_1.objectLessAttributes(props, 'theme');
|
95 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-section-body", style: style }), props.children));
|
96 | };
|
97 | exports.ActionRow = function (props) {
|
98 | var theme = props.theme || AmplifyTheme_1.default;
|
99 | var style = exports.propStyle(props, theme.actionRow);
|
100 | var p = core_1.objectLessAttributes(props, 'theme');
|
101 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-action-row", style: style }), props.children));
|
102 | };
|
103 | exports.FormRow = function (props) {
|
104 | var theme = props.theme || AmplifyTheme_1.default;
|
105 | var style = exports.propStyle(props, theme.formRow);
|
106 | var p = core_1.objectLessAttributes(props, 'theme');
|
107 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-form-row", style: style }), props.children));
|
108 | };
|
109 | exports.InputRow = function (props) {
|
110 | var theme = props.theme || AmplifyTheme_1.default;
|
111 | var style = exports.propStyle(props, theme.input);
|
112 | var p = core_1.objectLessAttributes(props, 'theme');
|
113 | return (React.createElement(exports.FormRow, { theme: theme }, exports.beforeAfter(React.createElement("input", __assign({}, p, { className: "amplify-input", style: style })))));
|
114 | };
|
115 | exports.RadioRow = function (props) {
|
116 | var id = props.id || '_' + props.value;
|
117 | var theme = props.theme || AmplifyTheme_1.default;
|
118 | return (React.createElement(exports.FormRow, { theme: theme },
|
119 | React.createElement(exports.Radio, __assign({}, props, { id: id })),
|
120 | React.createElement(exports.Label, { htmlFor: id, theme: theme }, props.placeholder)));
|
121 | };
|
122 | exports.Radio = function (props) {
|
123 | var theme = props.theme || AmplifyTheme_1.default;
|
124 | var style = exports.propStyle(props, theme.radio);
|
125 | var p = core_1.objectLessAttributes(props, 'theme');
|
126 | return exports.beforeAfter(React.createElement("input", __assign({}, p, { type: "radio", className: "amplify-radio", style: style })));
|
127 | };
|
128 | exports.CheckboxRow = function (props) {
|
129 | var id = props.id || '_' + props.name;
|
130 | var theme = props.theme || AmplifyTheme_1.default;
|
131 | return (React.createElement(exports.FormRow, { theme: theme },
|
132 | React.createElement(exports.Checkbox, __assign({}, props, { id: id })),
|
133 | React.createElement(exports.Label, { htmlFor: id, theme: theme }, props.placeholder)));
|
134 | };
|
135 | exports.Checkbox = function (props) {
|
136 | var theme = props.theme || AmplifyTheme_1.default;
|
137 | var style = exports.propStyle(props, theme.checkbox);
|
138 | var p = core_1.objectLessAttributes(props, 'theme');
|
139 | return exports.beforeAfter(React.createElement("input", __assign({}, p, { type: "checkbox", className: "amplify-checkbox", style: style })));
|
140 | };
|
141 | exports.MessageRow = function (props) {
|
142 | var theme = props.theme || AmplifyTheme_1.default;
|
143 | return (React.createElement(exports.FormRow, { theme: theme },
|
144 | React.createElement(exports.MessageContent, { theme: theme }, props.children)));
|
145 | };
|
146 | exports.MessageContent = function (props) {
|
147 | var theme = props.theme || AmplifyTheme_1.default;
|
148 | return exports.beforeAfter(React.createElement("span", { className: "amplify-message-content", style: theme.messageContent }, props.children));
|
149 | };
|
150 | exports.ButtonRow = function (props) {
|
151 | var theme = props.theme || AmplifyTheme_1.default;
|
152 | return exports.beforeAfter(React.createElement("div", { className: "amplify-action-row", style: theme.actionRow },
|
153 | React.createElement(exports.Button, __assign({}, props))));
|
154 | };
|
155 | exports.Button = function (props) {
|
156 | var theme = props.theme || AmplifyTheme_1.default;
|
157 | var style = exports.propStyle(props, theme.button);
|
158 | var p = core_1.objectLessAttributes(props, 'theme');
|
159 | return exports.beforeAfter(React.createElement("button", __assign({}, p, { className: "amplify-button", style: style }),
|
160 | React.createElement(exports.ButtonContent, { theme: theme }, props.children)));
|
161 | };
|
162 | exports.ButtonContent = function (props) {
|
163 | var theme = props.theme || AmplifyTheme_1.default;
|
164 | return exports.beforeAfter(React.createElement("span", { className: "amplify-button-content", style: theme.buttonContent }, props.children));
|
165 | };
|
166 | exports.SignInButton = function (props) {
|
167 | var theme = props.theme || AmplifyTheme_1.default;
|
168 | var style = exports.propStyle(props, theme.signInButton);
|
169 | var p = core_1.objectLessAttributes(props, 'theme');
|
170 | return exports.beforeAfter(React.createElement("button", __assign({}, p, { className: "amplify-signin-button", style: style }), props.children));
|
171 | };
|
172 | exports.Link = function (props) {
|
173 | var theme = props.theme || AmplifyTheme_1.default;
|
174 | var style = exports.propStyle(props, theme.a);
|
175 | var p = core_1.objectLessAttributes(props, 'theme');
|
176 | return exports.beforeAfter(React.createElement("a", __assign({}, p, { className: "amplify-a", style: style }), props.children));
|
177 | };
|
178 | exports.Label = function (props) {
|
179 | var theme = props.theme || AmplifyTheme_1.default;
|
180 | var style = exports.propStyle(props, theme.label);
|
181 | var p = core_1.objectLessAttributes(props, 'theme');
|
182 | return exports.beforeAfter(React.createElement("label", __assign({}, p, { className: "amplify-label", style: style }), props.children));
|
183 | };
|
184 | exports.Space = function (props) {
|
185 | var theme = props.theme || AmplifyTheme_1.default;
|
186 | var style = exports.propStyle(props, theme.space);
|
187 | var p = core_1.objectLessAttributes(props, 'theme');
|
188 | return exports.beforeAfter(React.createElement("span", __assign({}, p, { className: "amplify-space", style: style }), props.children));
|
189 | };
|
190 | exports.NavBar = function (props) {
|
191 | var theme = props.theme || AmplifyTheme_1.default;
|
192 | var style = exports.propStyle(props, theme.navBar);
|
193 | var p = core_1.objectLessAttributes(props, 'theme');
|
194 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-nav-bar", style: style }), props.children));
|
195 | };
|
196 | exports.Nav = function (props) {
|
197 | var theme = props.theme || AmplifyTheme_1.default;
|
198 | var style = exports.propStyle(props, theme.nav);
|
199 | var p = core_1.objectLessAttributes(props, 'theme');
|
200 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-nav", style: style }), props.children));
|
201 | };
|
202 | exports.NavRight = function (props) {
|
203 | var theme = props.theme || AmplifyTheme_1.default;
|
204 | var style = exports.propStyle(props, theme.navRight);
|
205 | var p = core_1.objectLessAttributes(props, 'theme');
|
206 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-nav-right", style: style }), props.children));
|
207 | };
|
208 | exports.NavItem = function (props) {
|
209 | var theme = props.theme || AmplifyTheme_1.default;
|
210 | var style = exports.propStyle(props, theme.navItem);
|
211 | var p = core_1.objectLessAttributes(props, 'theme');
|
212 | return exports.beforeAfter(React.createElement("div", __assign({}, p, { className: "amplify-nav-item", style: style }), props.children));
|
213 | };
|
214 | exports.NavButton = function (props) {
|
215 | var theme = props.theme || AmplifyTheme_1.default;
|
216 | var style = exports.propStyle(props, theme.navButton);
|
217 | var p = core_1.objectLessAttributes(props, 'theme');
|
218 | return exports.beforeAfter(React.createElement("button", __assign({}, p, { className: "amplify-nav-button", style: style }), exports.beforeAfter(React.createElement("span", { style: theme.navButtonContent }, props.children))));
|
219 | };
|
220 | exports.beforeAfter = function (el) {
|
221 | var style = el.props.style || {};
|
222 | var before = style.before, after = style.after;
|
223 | if (!before && !after) {
|
224 | return el;
|
225 | }
|
226 | return (React.createElement("span", { style: { position: 'relative' } },
|
227 | before ? React.createElement("span", { style: before }, before.content) : null,
|
228 | el,
|
229 | after ? React.createElement("span", { style: after }, after.content) : null));
|
230 | };
|
231 | exports.propStyle = function (props, themeStyle) {
|
232 | var id = props.id, style = props.style;
|
233 | var styl = Object.assign({}, style, themeStyle);
|
234 | if (!id) {
|
235 | return styl;
|
236 | }
|
237 | var selector = '#' + id;
|
238 | Object.assign(styl, styl[selector]);
|
239 | return styl;
|
240 | };
|
241 | exports.transparent1X1 = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';
|
242 | exports.white1X1 = 'data:image/gif;base64,R0lGODlhAQABAIAAAP7//wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
|
243 |
|
\ | No newline at end of file |