@kbgarcia8/react-dynamic-form 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -8
- package/dist/components/atoms/Button/Button.d.ts +1 -1
- package/dist/components/atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/atoms/Button/Button.styles.d.ts +32 -4
- package/dist/components/atoms/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/molecules/FormActionButtons/FormActionButtons.d.ts +1 -1
- package/dist/components/molecules/FormActionButtons/FormActionButtons.d.ts.map +1 -1
- package/dist/components/molecules/FormActionButtons/FormActionButtons.styles.d.ts.map +1 -1
- package/dist/components/molecules/LabeledInput/LabeledInput.d.ts.map +1 -1
- package/dist/components/molecules/NestedEditableOption/NestedEditableOption.d.ts +1 -1
- package/dist/components/molecules/NestedEditableOption/NestedEditableOption.d.ts.map +1 -1
- package/dist/components/organisms/DynamicForm/DynamicForm.d.ts +1 -1
- package/dist/components/organisms/DynamicForm/DynamicForm.d.ts.map +1 -1
- package/dist/react-dynamic-form.cjs.js +183 -82
- package/dist/react-dynamic-form.es.js +710 -466
- package/dist/styles/theme.d.ts +16 -0
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/variables.d.ts +69 -2
- package/dist/styles/variables.d.ts.map +1 -1
- package/dist/testcase/App.d.ts +4 -0
- package/dist/testcase/App.d.ts.map +1 -0
- package/dist/testcase/DynamicForm.styles.d.ts +2 -0
- package/dist/testcase/DynamicForm.styles.d.ts.map +1 -0
- package/dist/testcase/main.d.ts +2 -0
- package/dist/testcase/main.d.ts.map +1 -0
- package/dist/type/constantTypes.d.ts +9 -24
- package/dist/type/constantTypes.d.ts.map +1 -1
- package/dist/type/propTypes.d.ts +65 -13
- package/dist/type/propTypes.d.ts.map +1 -1
- package/dist/utils/utils.d.ts +4 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/package.json +4 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsx as r, jsxs as $, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import M, { forwardRef as re, createContext as ae, useState as le, useContext as ne } from "react";
|
|
3
|
+
import u, { css as g, ThemeProvider as se } from "styled-components";
|
|
4
|
+
const o = {
|
|
5
5
|
fonts: {
|
|
6
6
|
secondary: "Raleway",
|
|
7
7
|
tertiary: "Lato",
|
|
@@ -9,12 +9,18 @@ const e = {
|
|
|
9
9
|
},
|
|
10
10
|
fontWeight: {
|
|
11
11
|
light: 300,
|
|
12
|
+
regular: 400,
|
|
12
13
|
medium: 500,
|
|
13
14
|
bold: 700,
|
|
14
15
|
bolder: 900
|
|
15
16
|
},
|
|
16
17
|
fontSize: {
|
|
17
|
-
|
|
18
|
+
xxsmall: "0.55rem",
|
|
19
|
+
xsmall: "0.75rem",
|
|
20
|
+
small: "1rem",
|
|
21
|
+
medium: "1.25rem",
|
|
22
|
+
large: "1.5rem",
|
|
23
|
+
xlarge: "1.75rem"
|
|
18
24
|
},
|
|
19
25
|
spacing: {
|
|
20
26
|
xxxsmall: "0.25rem",
|
|
@@ -26,118 +32,257 @@ const e = {
|
|
|
26
32
|
borderRadius: {
|
|
27
33
|
xsmall: "0.125rem",
|
|
28
34
|
small: "0.25rem",
|
|
29
|
-
|
|
35
|
+
medium: "0.5rem",
|
|
36
|
+
large: "1rem",
|
|
37
|
+
xlarge: "2rem",
|
|
38
|
+
circle: "50%"
|
|
30
39
|
},
|
|
31
40
|
borderThickness: {
|
|
32
41
|
thin: "0.0625rem",
|
|
33
42
|
light: "0.125rem"
|
|
43
|
+
},
|
|
44
|
+
breakpoints: {
|
|
45
|
+
mobile: "320px",
|
|
46
|
+
//Small iPhone SE & Medium: iPhone 12-15
|
|
47
|
+
tablet: "768px",
|
|
48
|
+
//iPad
|
|
49
|
+
laptop: "1024px",
|
|
50
|
+
//Macbook 13" (1280x800)
|
|
51
|
+
desktop: "1440px",
|
|
52
|
+
largeDesktop: "1920px"
|
|
34
53
|
}
|
|
35
|
-
},
|
|
54
|
+
}, ie = (e) => {
|
|
55
|
+
const n = /^#([0-9A-Fa-f]{3}){1,2}$/, l = /^rgb(a)?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}(?:\s*,\s*(0|1|0?\.\d+))?\s*\)$/;
|
|
56
|
+
return n.test(e) || l.test(e) || CSS.supports("color", e);
|
|
57
|
+
}, m = (e) => {
|
|
58
|
+
if (!ie(e)) throw new Error(`Invalid color: ${e}`);
|
|
59
|
+
return e;
|
|
60
|
+
}, I = Object.keys(o.breakpoints).reduce(
|
|
61
|
+
(e, n) => {
|
|
62
|
+
const l = n;
|
|
63
|
+
return e[l] = (...a) => g`
|
|
64
|
+
@media (min-width: ${o.breakpoints[l]}) {
|
|
65
|
+
${g(...a)}
|
|
66
|
+
}
|
|
67
|
+
`, e;
|
|
68
|
+
},
|
|
69
|
+
{}
|
|
70
|
+
), ce = {
|
|
71
|
+
primary: g`
|
|
72
|
+
background-color: ${({ theme: e }) => e.colors.backgroundColor1};
|
|
73
|
+
color: ${({ theme: e }) => e.colors.textColor3};
|
|
74
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.borderColor2};
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
background-color: ${({ theme: e }) => e.colors.backgroundColor2};
|
|
78
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.textColor3};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:disabled{
|
|
82
|
+
background-color: ${({ theme: e }) => e.notificationPalette.infoText};
|
|
83
|
+
color: ${({ theme: e }) => e.colors.shadow};
|
|
84
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.shadow};
|
|
85
|
+
cursor: not-allowed;
|
|
86
|
+
}
|
|
87
|
+
`,
|
|
88
|
+
secondary: g`
|
|
89
|
+
background-color: ${({ theme: e }) => e.colors.backgroundColor4};
|
|
90
|
+
color: ${({ theme: e }) => e.colors.textColor1};
|
|
91
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.borderColor1};
|
|
92
|
+
|
|
93
|
+
&:hover {
|
|
94
|
+
background-color: ${({ theme: e }) => e.colors.backgroundColor4};
|
|
95
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.borderColor2};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:disabled{
|
|
99
|
+
background-color: ${({ theme: e }) => e.notificationPalette.warningText};
|
|
100
|
+
color: ${({ theme: e }) => e.colors.shadow};
|
|
101
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.shadow};
|
|
102
|
+
}
|
|
103
|
+
`,
|
|
104
|
+
ghost: g`
|
|
105
|
+
background-color: transparent;
|
|
106
|
+
color: ${({ theme: e }) => e.colors.textColor3};
|
|
107
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.textColor3};
|
|
108
|
+
|
|
109
|
+
&:hover {
|
|
110
|
+
background-color: ${({ theme: e }) => e.colors.textColor2};
|
|
111
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.backgroundColor3};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:disabled{
|
|
115
|
+
background-color: ${({ theme: e }) => e.notificationPalette.shadow};
|
|
116
|
+
color: ${({ theme: e }) => e.colors.shadow};
|
|
117
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.shadow};
|
|
118
|
+
}
|
|
119
|
+
`,
|
|
120
|
+
bnw: g`
|
|
121
|
+
background-color: ${({ theme: e }) => e.colors.borderColor1};
|
|
122
|
+
color: ${({ theme: e }) => e.colors.borderColor2};
|
|
123
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.borderColor2};
|
|
124
|
+
|
|
125
|
+
&:hover {
|
|
126
|
+
background-color: ${({ theme: e }) => e.colors.textColor2};
|
|
127
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.textColor1};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:disabled{
|
|
131
|
+
background-color: ${({ theme: e }) => e.notificationPalette.shadow};
|
|
132
|
+
color: ${({ theme: e }) => e.colors.shadow};
|
|
133
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.shadow};
|
|
134
|
+
}
|
|
135
|
+
`
|
|
136
|
+
}, de = {
|
|
137
|
+
smallest: g`
|
|
138
|
+
${I.mobile`
|
|
139
|
+
font-size: ${o.fontSize.xxsmall};
|
|
140
|
+
font-weight: ${o.fontWeight.regular};
|
|
141
|
+
`}
|
|
142
|
+
`,
|
|
143
|
+
smaller: g`
|
|
144
|
+
${I.mobile`
|
|
145
|
+
font-size: ${o.fontSize.xsmall};
|
|
146
|
+
font-weight: ${o.fontWeight.regular};
|
|
147
|
+
`}
|
|
148
|
+
`,
|
|
149
|
+
small: g`
|
|
150
|
+
${I.mobile`
|
|
151
|
+
font-size: ${o.fontSize.small};
|
|
152
|
+
font-weight: ${o.fontWeight.medium};
|
|
153
|
+
`}
|
|
154
|
+
`,
|
|
155
|
+
medium: g`
|
|
156
|
+
${I.mobile`
|
|
157
|
+
font-size: ${o.fontSize.medium};
|
|
158
|
+
font-weight: ${o.fontWeight.bold};
|
|
159
|
+
`}
|
|
160
|
+
`,
|
|
161
|
+
large: g`
|
|
162
|
+
${I.mobile`
|
|
163
|
+
font-size: ${o.fontSize.large};
|
|
164
|
+
font-weight: ${o.fontWeight.bolder};
|
|
165
|
+
`}
|
|
166
|
+
`,
|
|
167
|
+
larger: g`
|
|
168
|
+
${I.mobile`
|
|
169
|
+
font-size: ${o.fontSize.xlarge};
|
|
170
|
+
font-weight: ${o.fontWeight.bolder};
|
|
171
|
+
`}
|
|
172
|
+
`
|
|
173
|
+
}, me = {
|
|
174
|
+
square: g`border-radius: ${o.borderRadius.xsmall};`,
|
|
175
|
+
roundedsquare: g`border-radius: ${o.borderRadius.medium};`,
|
|
176
|
+
squircle: g`border-radius: ${o.borderRadius.large};`,
|
|
177
|
+
pill: g`border-radius: ${o.borderRadius.xlarge};`,
|
|
178
|
+
circle: g`border-radius: ${o.borderRadius.circle};`
|
|
179
|
+
}, H = u.button`
|
|
180
|
+
width: 100%;
|
|
36
181
|
display: flex;
|
|
37
182
|
align-items: center;
|
|
38
183
|
justify-content: center;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
border-radius: ${e.borderRadius.xlarge};
|
|
43
|
-
padding: ${e.spacing.xxxsmall} ${e.spacing.small};
|
|
44
|
-
margin: 0.125rem;
|
|
45
|
-
width: auto;
|
|
184
|
+
padding: ${o.spacing.xxxsmall} ${o.spacing.xxsmall};
|
|
185
|
+
flex: 1;
|
|
186
|
+
margin: 0;
|
|
46
187
|
cursor: pointer;
|
|
47
188
|
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
background-color: lightblue;
|
|
51
|
-
border: ${e.borderThickness.light} solid gray;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
& .button-icon-text-space {
|
|
55
|
-
max-width: 100%;
|
|
56
|
-
}
|
|
189
|
+
${({ $color: e }) => ce[e || "primary"]}
|
|
190
|
+
${({ $radius: e }) => me[e || "square"]}
|
|
57
191
|
|
|
58
192
|
& .button-icon-text-space svg {
|
|
193
|
+
height: auto;
|
|
194
|
+
max-height: 100%;
|
|
59
195
|
max-width: 100%;
|
|
60
196
|
}
|
|
61
|
-
|
|
197
|
+
|
|
198
|
+
&:disabled {
|
|
199
|
+
cursor: not-allowed;
|
|
200
|
+
opacity: 0.6;
|
|
201
|
+
}
|
|
202
|
+
`, Z = u.div`
|
|
62
203
|
width: 100%;
|
|
63
204
|
display: flex;
|
|
64
205
|
flex-direction: row;
|
|
65
206
|
align-items: center;
|
|
66
|
-
justify-content:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
207
|
+
justify-content: space-around;
|
|
208
|
+
|
|
209
|
+
${({ $hasIcon: e, $hasText: n }) => e && n ? g`` : g`
|
|
210
|
+
& > * {
|
|
211
|
+
flex: 1;
|
|
212
|
+
}
|
|
213
|
+
`}
|
|
214
|
+
`, G = u.span`
|
|
215
|
+
flex: 2;
|
|
216
|
+
${({ $size: e }) => de[e || "small"]}
|
|
217
|
+
font-family: ${o.fonts.tertiary}, ${o.fonts.fallback};
|
|
75
218
|
display: flex;
|
|
76
219
|
align-items: center;
|
|
77
220
|
justify-content: center;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
221
|
+
max-width: 80%;
|
|
222
|
+
`, B = ({
|
|
223
|
+
onClick: e,
|
|
224
|
+
id: n,
|
|
225
|
+
buttonType: l = "button",
|
|
226
|
+
startIcon: a,
|
|
83
227
|
endIcon: d,
|
|
84
|
-
|
|
85
|
-
text: c = "",
|
|
228
|
+
text: i = "",
|
|
86
229
|
className: b = "",
|
|
87
|
-
dataAttributes:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
}
|
|
230
|
+
dataAttributes: h = {},
|
|
231
|
+
color: x,
|
|
232
|
+
radius: f,
|
|
233
|
+
size: y
|
|
234
|
+
}) => l === "submit" ? /* @__PURE__ */ r(
|
|
235
|
+
H,
|
|
236
|
+
{
|
|
237
|
+
id: n,
|
|
238
|
+
type: "submit",
|
|
239
|
+
className: b,
|
|
240
|
+
...h,
|
|
241
|
+
$color: x || "primary",
|
|
242
|
+
$radius: f || "squircle",
|
|
243
|
+
children: /* @__PURE__ */ $(Z, { className: "button-icon-text-space", $hasIcon: !!(a || d), $hasText: !!i, children: [
|
|
244
|
+
a || "",
|
|
245
|
+
i && /* @__PURE__ */ r(G, { $size: y || "small", id: n, children: i }),
|
|
246
|
+
d || ""
|
|
247
|
+
] })
|
|
248
|
+
}
|
|
249
|
+
) : /* @__PURE__ */ r(
|
|
250
|
+
H,
|
|
251
|
+
{
|
|
252
|
+
onClick: e,
|
|
253
|
+
id: n,
|
|
254
|
+
type: l,
|
|
255
|
+
className: b,
|
|
256
|
+
...h,
|
|
257
|
+
$color: x || "primary",
|
|
258
|
+
$radius: f || "squircle",
|
|
259
|
+
children: /* @__PURE__ */ $(Z, { className: "button-icon-text-space", $hasIcon: !!(a || d), $hasText: !!i, children: [
|
|
260
|
+
a || "",
|
|
261
|
+
i && /* @__PURE__ */ r(G, { $size: y || "small", id: n, children: i }),
|
|
262
|
+
d || ""
|
|
263
|
+
] })
|
|
264
|
+
}
|
|
265
|
+
), be = u.div`
|
|
121
266
|
display: flex;
|
|
122
267
|
flex-direction: column;
|
|
123
268
|
align-items: left;
|
|
124
269
|
width: 100%;
|
|
125
|
-
margin-bottom: ${
|
|
126
|
-
`,
|
|
270
|
+
margin-bottom: ${o.spacing.small};
|
|
271
|
+
`, ue = u.div`
|
|
127
272
|
display: flex;
|
|
128
|
-
gap: ${
|
|
273
|
+
gap: ${o.spacing.xsmall};
|
|
129
274
|
width: auto;
|
|
130
275
|
height: auto;
|
|
131
|
-
`,
|
|
276
|
+
`, he = u.label`
|
|
132
277
|
display: flex;
|
|
133
278
|
align-items: center;
|
|
134
|
-
justify-content:center;
|
|
279
|
+
justify-content: center;
|
|
135
280
|
height: auto;
|
|
136
|
-
flex-direction: ${(
|
|
137
|
-
font-family: ${
|
|
138
|
-
font-size: ${
|
|
139
|
-
font-weight: ${
|
|
140
|
-
gap: ${
|
|
281
|
+
flex-direction: ${(e) => e.$labelFlexDirection || "column"};
|
|
282
|
+
font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
|
|
283
|
+
font-size: ${o.fontSize.xsmall};
|
|
284
|
+
font-weight: ${o.fontWeight.bold};
|
|
285
|
+
gap: ${o.spacing.xxsmall};
|
|
141
286
|
|
|
142
287
|
& .label-icon-container img,
|
|
143
288
|
& .label-icon-container svg {
|
|
@@ -145,496 +290,539 @@ const M = r.span`
|
|
|
145
290
|
height: auto;
|
|
146
291
|
object-fit: contain;
|
|
147
292
|
}
|
|
148
|
-
`,
|
|
293
|
+
`, $e = u.div`
|
|
149
294
|
display: flex;
|
|
150
295
|
flex-direction: column;
|
|
151
296
|
align-items: center;
|
|
152
297
|
justify-content: center;
|
|
153
|
-
gap: ${
|
|
154
|
-
`,
|
|
155
|
-
font-weight: ${
|
|
156
|
-
`,
|
|
298
|
+
gap: ${o.spacing.xxxsmall};
|
|
299
|
+
`, ge = u.span`
|
|
300
|
+
font-weight: ${o.fontWeight.bolder};
|
|
301
|
+
`, J = u.div`
|
|
157
302
|
max-width: 100%;
|
|
158
303
|
display: flex;
|
|
159
304
|
align-items: center;
|
|
160
|
-
`,
|
|
161
|
-
font-weight: ${
|
|
162
|
-
`,
|
|
163
|
-
htmlFor:
|
|
164
|
-
textLabel:
|
|
165
|
-
additionalInfo:
|
|
166
|
-
$labelFlexDirection:
|
|
305
|
+
`, xe = u.span`
|
|
306
|
+
font-weight: ${o.fontWeight.light};
|
|
307
|
+
`, K = ({
|
|
308
|
+
htmlFor: e,
|
|
309
|
+
textLabel: n,
|
|
310
|
+
additionalInfo: l,
|
|
311
|
+
$labelFlexDirection: a,
|
|
167
312
|
startIcon: d,
|
|
168
|
-
endIcon:
|
|
169
|
-
className:
|
|
170
|
-
children:
|
|
171
|
-
}) => /* @__PURE__ */
|
|
172
|
-
d && /* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
|
|
313
|
+
endIcon: i,
|
|
314
|
+
className: b,
|
|
315
|
+
children: h
|
|
316
|
+
}) => /* @__PURE__ */ $(he, { htmlFor: e, className: b, $labelFlexDirection: a, children: [
|
|
317
|
+
d && /* @__PURE__ */ r(J, { className: "label-icon-container", children: d }),
|
|
318
|
+
/* @__PURE__ */ $($e, { className: "label-text-container", children: [
|
|
319
|
+
/* @__PURE__ */ r(ge, { className: "main-label", children: n }),
|
|
320
|
+
l && /* @__PURE__ */ r(xe, { className: "additional-info", children: l })
|
|
176
321
|
] }),
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
] }),
|
|
322
|
+
i && /* @__PURE__ */ r(J, { className: "label-icon-container", children: i }),
|
|
323
|
+
h
|
|
324
|
+
] }), Q = u.input`
|
|
180
325
|
display: flex;
|
|
181
326
|
place-content: center;
|
|
182
|
-
font-family: ${
|
|
183
|
-
font-size: ${
|
|
327
|
+
font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
|
|
328
|
+
font-size: ${o.fontSize.xsmall};
|
|
184
329
|
line-height: 1.75;
|
|
185
|
-
padding: ${
|
|
330
|
+
padding: ${o.spacing.xxxsmall} ${o.spacing.xsmall};
|
|
186
331
|
max-width: 100%;
|
|
187
332
|
height: auto;
|
|
188
333
|
background-color: #FFFFFF;
|
|
189
334
|
outline: none;
|
|
190
|
-
border: ${
|
|
191
|
-
border-radius: ${
|
|
335
|
+
border: ${o.borderThickness.thin} solid #000000;
|
|
336
|
+
border-radius: ${o.borderRadius.xsmall};
|
|
192
337
|
|
|
193
338
|
&:focus{
|
|
194
|
-
border: ${
|
|
339
|
+
border: ${o.borderThickness.thin} solid ${({ theme: e }) => e.colors.teal};
|
|
195
340
|
}
|
|
196
|
-
`,
|
|
341
|
+
`, fe = u.textarea`
|
|
197
342
|
display: flex;
|
|
198
343
|
place-content: center;
|
|
199
|
-
border: ${
|
|
200
|
-
border-radius: ${
|
|
344
|
+
border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.text};
|
|
345
|
+
border-radius: ${o.borderRadius.small};
|
|
201
346
|
outline: none;
|
|
202
|
-
line-height: ${
|
|
203
|
-
padding: ${
|
|
204
|
-
font-family: ${
|
|
205
|
-
font-size: ${
|
|
347
|
+
line-height: ${o.spacing.small};
|
|
348
|
+
padding: ${o.spacing.xxxsmall};
|
|
349
|
+
font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
|
|
350
|
+
font-size: ${o.fontSize.xsmall};
|
|
206
351
|
max-width: 100%;
|
|
207
352
|
resize: none;
|
|
208
353
|
overflow-y: auto;
|
|
209
|
-
`,
|
|
210
|
-
const { type:
|
|
211
|
-
if (
|
|
212
|
-
const { rows:
|
|
213
|
-
return /* @__PURE__ */
|
|
214
|
-
|
|
354
|
+
`, W = re((e, n) => {
|
|
355
|
+
const { type: l, id: a, onChange: d, isRequired: i, dataAttributes: b = {}, disabled: h, className: x, name: f } = e;
|
|
356
|
+
if (l === "textarea") {
|
|
357
|
+
const { rows: w = 5, cols: S = 30, value: E, ...q } = e;
|
|
358
|
+
return /* @__PURE__ */ r(
|
|
359
|
+
fe,
|
|
215
360
|
{
|
|
216
|
-
ref:
|
|
217
|
-
value:
|
|
218
|
-
rows:
|
|
219
|
-
cols:
|
|
220
|
-
id:
|
|
361
|
+
ref: n,
|
|
362
|
+
value: E,
|
|
363
|
+
rows: w,
|
|
364
|
+
cols: S,
|
|
365
|
+
id: a,
|
|
221
366
|
onChange: d,
|
|
222
|
-
required:
|
|
223
|
-
disabled:
|
|
224
|
-
...
|
|
225
|
-
className:
|
|
226
|
-
name:
|
|
367
|
+
required: i,
|
|
368
|
+
disabled: h,
|
|
369
|
+
...b,
|
|
370
|
+
className: x,
|
|
371
|
+
name: f
|
|
227
372
|
}
|
|
228
373
|
);
|
|
229
374
|
}
|
|
230
|
-
if (
|
|
231
|
-
const { checked:
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
|
|
375
|
+
if (l === "radio" || l === "checkbox") {
|
|
376
|
+
const { checked: w, ...S } = e;
|
|
377
|
+
return /* @__PURE__ */ r(
|
|
378
|
+
Q,
|
|
234
379
|
{
|
|
235
|
-
ref:
|
|
236
|
-
type:
|
|
237
|
-
checked:
|
|
238
|
-
id:
|
|
380
|
+
ref: n,
|
|
381
|
+
type: l,
|
|
382
|
+
checked: w,
|
|
383
|
+
id: a,
|
|
239
384
|
onChange: d,
|
|
240
|
-
required:
|
|
241
|
-
...
|
|
242
|
-
disabled:
|
|
243
|
-
className:
|
|
244
|
-
name:
|
|
385
|
+
required: i,
|
|
386
|
+
...b,
|
|
387
|
+
disabled: h,
|
|
388
|
+
className: x,
|
|
389
|
+
name: f
|
|
245
390
|
}
|
|
246
391
|
);
|
|
247
392
|
}
|
|
248
|
-
const
|
|
249
|
-
return /* @__PURE__ */
|
|
250
|
-
|
|
393
|
+
const y = e, { value: p, pattern: k, placeholderText: C, ...N } = y;
|
|
394
|
+
return /* @__PURE__ */ r(
|
|
395
|
+
Q,
|
|
251
396
|
{
|
|
252
|
-
ref:
|
|
253
|
-
type:
|
|
254
|
-
value:
|
|
255
|
-
pattern:
|
|
256
|
-
placeholder:
|
|
257
|
-
id:
|
|
397
|
+
ref: n,
|
|
398
|
+
type: l,
|
|
399
|
+
value: p,
|
|
400
|
+
pattern: k,
|
|
401
|
+
placeholder: C,
|
|
402
|
+
id: a,
|
|
258
403
|
onChange: d,
|
|
259
|
-
required:
|
|
260
|
-
...
|
|
261
|
-
disabled:
|
|
262
|
-
className:
|
|
263
|
-
name:
|
|
404
|
+
required: i,
|
|
405
|
+
...b,
|
|
406
|
+
disabled: h,
|
|
407
|
+
className: x,
|
|
408
|
+
name: f
|
|
264
409
|
}
|
|
265
410
|
);
|
|
266
|
-
}),
|
|
411
|
+
}), R = (e) => {
|
|
267
412
|
const {
|
|
268
|
-
className:
|
|
269
|
-
type:
|
|
270
|
-
id:
|
|
413
|
+
className: n,
|
|
414
|
+
type: l,
|
|
415
|
+
id: a,
|
|
271
416
|
textLabel: d,
|
|
272
|
-
additionalInfo:
|
|
273
|
-
$labelFlexDirection:
|
|
274
|
-
startIcon:
|
|
275
|
-
endIcon:
|
|
276
|
-
labelClass:
|
|
277
|
-
onChange:
|
|
278
|
-
isRequired:
|
|
279
|
-
dataAttributes:
|
|
280
|
-
inputClass:
|
|
281
|
-
ref:
|
|
282
|
-
disabled:
|
|
283
|
-
isEditable:
|
|
284
|
-
editIcon:
|
|
285
|
-
onClickEdit:
|
|
286
|
-
deleteIcon:
|
|
287
|
-
onClickDelete:
|
|
288
|
-
idx:
|
|
289
|
-
children:
|
|
290
|
-
} =
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
const { rows:
|
|
295
|
-
return /* @__PURE__ */
|
|
296
|
-
|
|
417
|
+
additionalInfo: i,
|
|
418
|
+
$labelFlexDirection: b,
|
|
419
|
+
startIcon: h,
|
|
420
|
+
endIcon: x,
|
|
421
|
+
labelClass: f = "",
|
|
422
|
+
onChange: y,
|
|
423
|
+
isRequired: p,
|
|
424
|
+
dataAttributes: k,
|
|
425
|
+
inputClass: C = "",
|
|
426
|
+
ref: N,
|
|
427
|
+
disabled: w,
|
|
428
|
+
isEditable: S,
|
|
429
|
+
editIcon: E,
|
|
430
|
+
onClickEdit: q,
|
|
431
|
+
deleteIcon: L,
|
|
432
|
+
onClickDelete: T,
|
|
433
|
+
idx: F,
|
|
434
|
+
children: A
|
|
435
|
+
} = e;
|
|
436
|
+
return /* @__PURE__ */ $(be, { className: `${n} ${a.replace("#", "")}-label-input-container`, children: [
|
|
437
|
+
l !== "radio" && l !== "checkbox" && /* @__PURE__ */ r(K, { startIcon: h, endIcon: x, htmlFor: a, textLabel: d, additionalInfo: i, $labelFlexDirection: b, className: f }),
|
|
438
|
+
l !== "radio" && l !== "checkbox" && l === "textarea" && (() => {
|
|
439
|
+
const { rows: z = 5, cols: D = 30, value: j, ...t } = e;
|
|
440
|
+
return /* @__PURE__ */ r(
|
|
441
|
+
W,
|
|
297
442
|
{
|
|
298
|
-
id:
|
|
299
|
-
name:
|
|
443
|
+
id: a,
|
|
444
|
+
name: a,
|
|
300
445
|
type: "textarea",
|
|
301
|
-
isRequired:
|
|
302
|
-
onChange:
|
|
303
|
-
value:
|
|
304
|
-
rows:
|
|
305
|
-
cols:
|
|
306
|
-
dataAttributes:
|
|
307
|
-
className:
|
|
308
|
-
ref:
|
|
309
|
-
disabled:
|
|
446
|
+
isRequired: p,
|
|
447
|
+
onChange: y,
|
|
448
|
+
value: j,
|
|
449
|
+
rows: z,
|
|
450
|
+
cols: D,
|
|
451
|
+
dataAttributes: k,
|
|
452
|
+
className: C,
|
|
453
|
+
ref: N,
|
|
454
|
+
disabled: w
|
|
310
455
|
}
|
|
311
456
|
);
|
|
312
457
|
})(),
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
return /* @__PURE__ */
|
|
316
|
-
|
|
458
|
+
l !== "radio" && l !== "checkbox" && l !== "textarea" && (() => {
|
|
459
|
+
const z = e, { value: D, pattern: j, placeholderText: t, ...v } = z;
|
|
460
|
+
return /* @__PURE__ */ r(
|
|
461
|
+
W,
|
|
317
462
|
{
|
|
318
|
-
id:
|
|
319
|
-
name:
|
|
320
|
-
placeholderText:
|
|
321
|
-
onChange:
|
|
322
|
-
value:
|
|
323
|
-
type:
|
|
324
|
-
isRequired:
|
|
325
|
-
dataAttributes:
|
|
326
|
-
className:
|
|
327
|
-
ref:
|
|
328
|
-
disabled:
|
|
329
|
-
pattern:
|
|
463
|
+
id: a,
|
|
464
|
+
name: a,
|
|
465
|
+
placeholderText: t,
|
|
466
|
+
onChange: y,
|
|
467
|
+
value: D,
|
|
468
|
+
type: l,
|
|
469
|
+
isRequired: p,
|
|
470
|
+
dataAttributes: k,
|
|
471
|
+
className: C,
|
|
472
|
+
ref: N,
|
|
473
|
+
disabled: w,
|
|
474
|
+
pattern: j
|
|
330
475
|
}
|
|
331
476
|
);
|
|
332
477
|
})(),
|
|
333
|
-
(
|
|
334
|
-
const { checked:
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
|
|
478
|
+
(l === "radio" || l === "checkbox") && (() => {
|
|
479
|
+
const { checked: z, ...D } = e;
|
|
480
|
+
return /* @__PURE__ */ $(O, { children: [
|
|
481
|
+
/* @__PURE__ */ r(
|
|
482
|
+
W,
|
|
338
483
|
{
|
|
339
|
-
ref:
|
|
340
|
-
type:
|
|
341
|
-
name:
|
|
342
|
-
id:
|
|
343
|
-
isRequired:
|
|
344
|
-
checked:
|
|
345
|
-
onChange:
|
|
346
|
-
disabled:
|
|
347
|
-
className:
|
|
348
|
-
dataAttributes:
|
|
484
|
+
ref: N,
|
|
485
|
+
type: l,
|
|
486
|
+
name: a,
|
|
487
|
+
id: a,
|
|
488
|
+
isRequired: p,
|
|
489
|
+
checked: z,
|
|
490
|
+
onChange: y,
|
|
491
|
+
disabled: w,
|
|
492
|
+
className: C,
|
|
493
|
+
dataAttributes: k
|
|
349
494
|
}
|
|
350
495
|
),
|
|
351
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ r(K, { startIcon: h, endIcon: x, htmlFor: a, textLabel: d, additionalInfo: i, $labelFlexDirection: b, className: f })
|
|
352
497
|
] });
|
|
353
498
|
})(),
|
|
354
|
-
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
499
|
+
S && /* @__PURE__ */ $(ue, { className: "input-edit-buttons", children: [
|
|
500
|
+
/* @__PURE__ */ r(B, { id: `editable-${a}-edit-btn`, startIcon: E, buttonType: "button", onClick: q, className: `edit-radio-${F}`, dataAttributes: k }),
|
|
501
|
+
/* @__PURE__ */ r(B, { id: `editable-${a}-delete-btn`, startIcon: L, buttonType: "button", onClick: T, className: `delete-radio-${F}`, dataAttributes: k })
|
|
357
502
|
] }),
|
|
358
|
-
|
|
503
|
+
A
|
|
359
504
|
] });
|
|
360
|
-
},
|
|
505
|
+
}, ye = u.fieldset`
|
|
361
506
|
padding: 0;
|
|
362
507
|
height: auto;
|
|
363
508
|
width: 100%;
|
|
364
|
-
`,
|
|
365
|
-
font-size: ${
|
|
509
|
+
`, ke = u.legend`
|
|
510
|
+
font-size: ${o.spacing.medium};
|
|
366
511
|
font-weight: 500;
|
|
367
|
-
margin: 0 auto ${
|
|
512
|
+
margin: 0 auto ${o.spacing.small} auto;
|
|
368
513
|
text-align: center;
|
|
369
|
-
font-family: ${
|
|
370
|
-
`,
|
|
514
|
+
font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
|
|
515
|
+
`, pe = u.div`
|
|
371
516
|
display: flex;
|
|
372
517
|
flex-direction: column;
|
|
373
518
|
align-items: flex-start;
|
|
374
519
|
width: 100%;
|
|
375
|
-
margin-bottom: ${
|
|
376
|
-
`,
|
|
520
|
+
margin-bottom: ${o.spacing.small};
|
|
521
|
+
`, Ce = u.div`
|
|
377
522
|
display: flex;
|
|
378
523
|
justify-content: space-between;
|
|
379
524
|
width: 100%;
|
|
380
|
-
`,
|
|
525
|
+
`, V = ({
|
|
526
|
+
editableButtonSize: e,
|
|
527
|
+
editableButtonColor: n,
|
|
528
|
+
editableButtonRadius: l,
|
|
381
529
|
legend: a,
|
|
382
|
-
fieldsetIndex:
|
|
383
|
-
idx:
|
|
384
|
-
editableInformation:
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
530
|
+
fieldsetIndex: d,
|
|
531
|
+
idx: i,
|
|
532
|
+
editableInformation: b,
|
|
533
|
+
saveText: h,
|
|
534
|
+
saveButtonStartIcon: x,
|
|
535
|
+
saveButtonEndIcon: f,
|
|
536
|
+
cancelText: y,
|
|
537
|
+
cancelButtonStartIcon: p,
|
|
538
|
+
cancelButtonEndIcon: k,
|
|
539
|
+
deleteText: C,
|
|
540
|
+
deleteButtonStartIcon: N,
|
|
541
|
+
deleteButtonEndIcon: w,
|
|
542
|
+
onChangeOfEditableOption: S,
|
|
543
|
+
onClickSaveEdit: E,
|
|
544
|
+
onClickCancelEdit: q,
|
|
545
|
+
onClickDeleteEntry: L
|
|
546
|
+
}) => /* @__PURE__ */ $(ye, { className: "editable-option-fieldset", children: [
|
|
547
|
+
/* @__PURE__ */ r(ke, { children: `${a} ${i + 1}` }),
|
|
548
|
+
b?.map((T, F) => /* @__PURE__ */ r(pe, { className: "editable-option-container", children: /* @__PURE__ */ r(
|
|
549
|
+
W,
|
|
393
550
|
{
|
|
394
|
-
id: `editable-option-${
|
|
395
|
-
name: `editable-option-${
|
|
396
|
-
placeholderText:
|
|
397
|
-
onChange:
|
|
398
|
-
value:
|
|
399
|
-
type:
|
|
551
|
+
id: `editable-option-${F}`,
|
|
552
|
+
name: `editable-option-${F}`,
|
|
553
|
+
placeholderText: T.name.charAt(0).toUpperCase() + T.name.slice(1),
|
|
554
|
+
onChange: S,
|
|
555
|
+
value: T.info,
|
|
556
|
+
type: T.type,
|
|
400
557
|
isRequired: !0,
|
|
401
558
|
className: "editable-option",
|
|
402
559
|
dataAttributes: {
|
|
403
|
-
"data-index":
|
|
404
|
-
"data-fieldsetindex":
|
|
405
|
-
"data-key":
|
|
560
|
+
"data-index": F,
|
|
561
|
+
"data-fieldsetindex": d,
|
|
562
|
+
"data-key": T.info
|
|
406
563
|
}
|
|
407
564
|
}
|
|
408
|
-
) }, `${
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
565
|
+
) }, `${T.name}-${F}`)),
|
|
566
|
+
/* @__PURE__ */ $(Ce, { className: "editable-option-button-space", children: [
|
|
567
|
+
/* @__PURE__ */ r(B, { startIcon: x, endIcon: f, size: e || "small", color: n || "primary", radius: l || "squircle", id: `editable-option-${i}-submit`, buttonType: "button", text: h || "Save", onClick: E, className: "editable-option-btn", dataAttributes: { "data-index": i, "data-fieldsetindex": d } }),
|
|
568
|
+
/* @__PURE__ */ r(B, { startIcon: p, endIcon: k, size: e || "small", color: n || "primary", radius: l || "squircle", id: `editable-option-${i}-cancel`, buttonType: "button", text: y || "Cancel", onClick: q, className: "editable-option-btn", dataAttributes: { "data-index": i, "data-fieldsetindex": d } }),
|
|
569
|
+
/* @__PURE__ */ r(B, { startIcon: N, endIcon: w, size: e || "small", color: n || "primary", radius: l || "squircle", id: `editable-option-${i}-delete`, buttonType: "button", text: C || "Delete", onClick: L, className: "editable-option-btn", dataAttributes: { "data-index": i, "data-fieldsetindex": d } })
|
|
413
570
|
] })
|
|
414
|
-
] }),
|
|
571
|
+
] }), we = u.div`
|
|
415
572
|
display: flex;
|
|
416
|
-
justify-content: space-
|
|
573
|
+
justify-content: space-around;
|
|
574
|
+
align-content: center;
|
|
417
575
|
max-width: 100%;
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
576
|
+
& button {
|
|
577
|
+
margin-inline: 0.25rem;
|
|
578
|
+
}
|
|
579
|
+
`, ve = ({
|
|
580
|
+
id: e,
|
|
581
|
+
formActionButtonSize: n,
|
|
582
|
+
formActionButtonColor: l,
|
|
583
|
+
formActionButtonRadius: a,
|
|
584
|
+
submitText: d,
|
|
585
|
+
submitIcon: i,
|
|
586
|
+
hasReset: b,
|
|
587
|
+
resetText: h,
|
|
588
|
+
resetIcon: x,
|
|
589
|
+
handleReset: f,
|
|
590
|
+
hasCancel: y,
|
|
591
|
+
cancelText: p,
|
|
592
|
+
cancelIcon: k,
|
|
593
|
+
handleCancel: C
|
|
594
|
+
}) => /* @__PURE__ */ $(we, { className: "form-main-button-container", children: [
|
|
595
|
+
/* @__PURE__ */ r(B, { id: `form-${e}-submit`, size: n || "small", color: l || "primary", radius: a || "squircle", startIcon: i, buttonType: "submit", text: d ?? "Submit", className: "submit-form-btn" }),
|
|
596
|
+
b && /* @__PURE__ */ r(B, { id: `form-${e}-edit`, size: n || "small", color: l || "primary", radius: a || "squircle", startIcon: x, buttonType: "button", text: h ?? "Reset", onClick: f, className: "reset-form-btn" }),
|
|
597
|
+
y && /* @__PURE__ */ r(B, { id: `form-${e}-cancel`, size: n || "small", color: l || "primary", radius: a || "squircle", startIcon: k, buttonType: "button", text: p ?? "Cancel", onClick: C, className: "cancel-form-btn" })
|
|
598
|
+
] }), X = u.legend`
|
|
599
|
+
font-size: ${o.spacing.medium};
|
|
436
600
|
font-weight: 500;
|
|
437
|
-
margin-bottom: ${
|
|
601
|
+
margin-bottom: ${o.spacing.small};
|
|
438
602
|
width: auto;
|
|
439
603
|
text-align: center;
|
|
440
|
-
font-family: ${
|
|
441
|
-
`,
|
|
604
|
+
font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
|
|
605
|
+
`, Y = u.fieldset`
|
|
442
606
|
padding: 0;
|
|
443
607
|
height: auto;
|
|
444
608
|
width: 100%;
|
|
445
|
-
`,
|
|
446
|
-
padding: ${
|
|
609
|
+
`, _ = u.div`
|
|
610
|
+
padding: ${o.spacing.small};
|
|
447
611
|
height: auto;
|
|
448
612
|
width: 100%;
|
|
449
|
-
`,
|
|
613
|
+
`, ee = u.div`
|
|
450
614
|
display: flex;
|
|
451
615
|
justify-content: center;
|
|
452
616
|
align-items: center;
|
|
453
617
|
width: 100%;
|
|
454
618
|
height: auto;
|
|
455
|
-
font-family: ${
|
|
456
|
-
font-size: ${
|
|
457
|
-
font-weight: ${
|
|
458
|
-
`,
|
|
619
|
+
font-family: ${o.fonts.tertiary}, ${o.fonts.fallback};
|
|
620
|
+
font-size: ${o.fontSize.xsmall};
|
|
621
|
+
font-weight: ${o.fontWeight.bold};
|
|
622
|
+
`, Te = u.form`
|
|
459
623
|
display: flex;
|
|
460
624
|
flex-direction: column;
|
|
461
625
|
align-items: center;
|
|
462
626
|
width: 100%;
|
|
463
|
-
`,
|
|
627
|
+
`, oe = u.div`
|
|
464
628
|
display: flex;
|
|
465
629
|
justify-content: space-between;
|
|
466
630
|
width: 100%;
|
|
467
|
-
`,
|
|
631
|
+
`, Be = u.div`
|
|
468
632
|
width: 100%;
|
|
469
633
|
display: flex;
|
|
470
634
|
flex-direction: column;
|
|
471
635
|
align-items: center;
|
|
472
636
|
justify-content: center;
|
|
473
|
-
`,
|
|
474
|
-
fieldsets:
|
|
475
|
-
legendText:
|
|
476
|
-
isExpandable:
|
|
477
|
-
id:
|
|
637
|
+
`, qe = ({
|
|
638
|
+
fieldsets: e = null,
|
|
639
|
+
legendText: n,
|
|
640
|
+
isExpandable: l,
|
|
641
|
+
id: a,
|
|
478
642
|
formInputs: d,
|
|
479
|
-
labelAndInputContainerClass:
|
|
480
|
-
labelClass:
|
|
481
|
-
inputClass:
|
|
482
|
-
onChangeOfEditableOption:
|
|
483
|
-
handleAddingInputEntry:
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
643
|
+
labelAndInputContainerClass: i,
|
|
644
|
+
labelClass: b,
|
|
645
|
+
inputClass: h,
|
|
646
|
+
onChangeOfEditableOption: x,
|
|
647
|
+
handleAddingInputEntry: f,
|
|
648
|
+
formActionButtonSize: y,
|
|
649
|
+
formActionButtonColor: p,
|
|
650
|
+
formActionButtonRadius: k,
|
|
651
|
+
submitText: C,
|
|
652
|
+
submitIcon: N,
|
|
653
|
+
hasReset: w = !1,
|
|
654
|
+
resetText: S,
|
|
655
|
+
resetIcon: E,
|
|
656
|
+
handleReset: q,
|
|
657
|
+
hasCancel: L = !1,
|
|
658
|
+
cancelText: T,
|
|
659
|
+
cancelIcon: F,
|
|
660
|
+
handleCancel: A,
|
|
661
|
+
handleSubmitForm: z,
|
|
662
|
+
className: D,
|
|
663
|
+
children: j
|
|
664
|
+
}) => /* @__PURE__ */ $(Te, { id: `${a}-form`, className: D, onSubmit: z, children: [
|
|
665
|
+
e ? e.map((t, v) => /* @__PURE__ */ $(_, { className: `${a}-fieldset-wrapper`, children: [
|
|
666
|
+
/* @__PURE__ */ $(Y, { id: `${a}-form-fieldset-${v}`, className: `${t.legend}-fieldset`, children: [
|
|
667
|
+
t.legend && /* @__PURE__ */ r(X, { className: `${t.legend}-legend`, children: t.legend }),
|
|
668
|
+
t.inputs.length !== 0 ? t.inputs.map((s, P) => /* @__PURE__ */ $(M.Fragment, { children: [
|
|
669
|
+
s.type === "textarea" && /* @__PURE__ */ r(
|
|
670
|
+
R,
|
|
504
671
|
{
|
|
505
672
|
...s,
|
|
506
|
-
id: s.id ?? `${
|
|
507
|
-
labelClass:
|
|
508
|
-
inputClass:
|
|
509
|
-
idx:
|
|
510
|
-
className: `${
|
|
673
|
+
id: s.id ?? `${t.legend}-input`,
|
|
674
|
+
labelClass: b,
|
|
675
|
+
inputClass: h,
|
|
676
|
+
idx: P,
|
|
677
|
+
className: `${i} ${s?.uniqueClass}`
|
|
511
678
|
}
|
|
512
679
|
),
|
|
513
|
-
s.type !== "textarea" && s.type !== "radio" && s.type !== "checkbox" && /* @__PURE__ */
|
|
514
|
-
|
|
680
|
+
s.type !== "textarea" && s.type !== "radio" && s.type !== "checkbox" && /* @__PURE__ */ r(
|
|
681
|
+
R,
|
|
515
682
|
{
|
|
516
683
|
...s,
|
|
517
|
-
id: s.id ?? `${
|
|
518
|
-
labelClass:
|
|
519
|
-
inputClass:
|
|
520
|
-
idx:
|
|
521
|
-
className: `${
|
|
684
|
+
id: s.id ?? `${t.legend}-input`,
|
|
685
|
+
labelClass: b,
|
|
686
|
+
inputClass: h,
|
|
687
|
+
idx: P,
|
|
688
|
+
className: `${i} ${s?.uniqueClass}`
|
|
522
689
|
}
|
|
523
690
|
),
|
|
524
|
-
(s.type === "radio" || s.type === "checkbox") && /* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
|
|
691
|
+
(s.type === "radio" || s.type === "checkbox") && /* @__PURE__ */ $(O, { children: [
|
|
692
|
+
/* @__PURE__ */ r(
|
|
693
|
+
R,
|
|
527
694
|
{
|
|
528
695
|
...s,
|
|
529
|
-
id: s.id ?? `${
|
|
530
|
-
labelClass:
|
|
531
|
-
inputClass:
|
|
532
|
-
idx:
|
|
533
|
-
className: `${
|
|
696
|
+
id: s.id ?? `${t.legend}-input`,
|
|
697
|
+
labelClass: b,
|
|
698
|
+
inputClass: h,
|
|
699
|
+
idx: P,
|
|
700
|
+
className: `${i} ${s?.uniqueClass}`
|
|
534
701
|
}
|
|
535
702
|
),
|
|
536
|
-
s.editing && s.isEditable && /* @__PURE__ */
|
|
537
|
-
|
|
703
|
+
s.editing && s.isEditable && /* @__PURE__ */ r(
|
|
704
|
+
V,
|
|
538
705
|
{
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
706
|
+
editableButtonSize: s.editableButtonSize,
|
|
707
|
+
editableButtonColor: s.editableButtonColor,
|
|
708
|
+
editableButtonRadius: s.editableButtonRadius,
|
|
709
|
+
legend: `${t.legend}`,
|
|
710
|
+
fieldsetIndex: v,
|
|
711
|
+
idx: P,
|
|
712
|
+
saveText: s.saveText ?? void 0,
|
|
713
|
+
saveButtonStartIcon: s.saveButtonStartIcon ?? void 0,
|
|
714
|
+
saveButtonEndIcon: s.saveButtonEndIcon ?? void 0,
|
|
715
|
+
cancelText: s.cancelText ?? void 0,
|
|
716
|
+
cancelButtonStartIcon: s.cancelButtonStartIcon ?? void 0,
|
|
717
|
+
cancelButtonEndIcon: s.cancelButtonEndIcon ?? void 0,
|
|
718
|
+
deleteText: s.deleteText ?? void 0,
|
|
719
|
+
deleteButtonStartIcon: s.deleteButtonStartIcon ?? void 0,
|
|
720
|
+
deleteButtonEndIcon: s.deleteButtonEndIcon ?? void 0,
|
|
542
721
|
editableInformation: s?.editableInformation || [],
|
|
543
|
-
onChangeOfEditableOption:
|
|
544
|
-
onClickSaveEdit: s?.onClickSave || ((
|
|
722
|
+
onChangeOfEditableOption: x,
|
|
723
|
+
onClickSaveEdit: s?.onClickSave || ((U) => {
|
|
545
724
|
}),
|
|
546
|
-
onClickCancelEdit: s?.onClickCancel || ((
|
|
725
|
+
onClickCancelEdit: s?.onClickCancel || ((U) => {
|
|
547
726
|
}),
|
|
548
|
-
onClickDeleteEntry: s?.onClickDelete || ((
|
|
727
|
+
onClickDeleteEntry: s?.onClickDelete || ((U) => {
|
|
549
728
|
})
|
|
550
729
|
}
|
|
551
730
|
)
|
|
552
731
|
] })
|
|
553
|
-
] }, `form-${
|
|
732
|
+
] }, `form-${a}-${P}`)) : t.isExpandable ? /* @__PURE__ */ r(ee, { children: `No entry yet on ${t.legend}. Click "+" button to add entry.` }) : ""
|
|
554
733
|
] }),
|
|
555
|
-
|
|
556
|
-
] }, `${
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
|
|
559
|
-
!
|
|
560
|
-
|
|
561
|
-
|
|
734
|
+
t.isExpandable && /* @__PURE__ */ r(oe, { className: "add-input-button-space", children: /* @__PURE__ */ r(B, { id: `expand-${t.legend}-inputs`, buttonType: "button", text: "+", onClick: f, className: "add-input-entry", dataAttributes: { "data-fieldsetindex": v } }) })
|
|
735
|
+
] }, `${t.legend}-${v}`)) : /* @__PURE__ */ $(_, { className: `${a}-fieldset-wrapper`, children: [
|
|
736
|
+
/* @__PURE__ */ $(Y, { id: `${a}-form-fieldset`, className: `${n}-fieldset`, children: [
|
|
737
|
+
n && /* @__PURE__ */ r(X, { className: `${n}-legend`, children: n }),
|
|
738
|
+
!e && d && d.length !== 0 ? d.map((t, v) => /* @__PURE__ */ $(M.Fragment, { children: [
|
|
739
|
+
t.type === "textarea" && /* @__PURE__ */ r(
|
|
740
|
+
R,
|
|
562
741
|
{
|
|
563
|
-
...
|
|
564
|
-
id:
|
|
565
|
-
labelClass:
|
|
566
|
-
inputClass:
|
|
567
|
-
idx:
|
|
568
|
-
className: `${
|
|
742
|
+
...t,
|
|
743
|
+
id: t.id ?? `${n}-input`,
|
|
744
|
+
labelClass: b,
|
|
745
|
+
inputClass: h,
|
|
746
|
+
idx: v,
|
|
747
|
+
className: `${i} ${t?.uniqueClass}`
|
|
569
748
|
}
|
|
570
749
|
),
|
|
571
|
-
|
|
572
|
-
|
|
750
|
+
t.type !== "textarea" && t.type !== "radio" && t.type !== "checkbox" && /* @__PURE__ */ r(
|
|
751
|
+
R,
|
|
573
752
|
{
|
|
574
|
-
...
|
|
575
|
-
id:
|
|
576
|
-
labelClass:
|
|
577
|
-
inputClass:
|
|
578
|
-
idx:
|
|
579
|
-
className: `${
|
|
753
|
+
...t,
|
|
754
|
+
id: t.id ?? `${n}-input`,
|
|
755
|
+
labelClass: b,
|
|
756
|
+
inputClass: h,
|
|
757
|
+
idx: v,
|
|
758
|
+
className: `${i} ${t?.uniqueClass}`
|
|
580
759
|
}
|
|
581
760
|
),
|
|
582
|
-
(
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
|
|
761
|
+
(t.type === "radio" || t.type === "checkbox") && /* @__PURE__ */ $(O, { children: [
|
|
762
|
+
/* @__PURE__ */ r(
|
|
763
|
+
R,
|
|
585
764
|
{
|
|
586
|
-
...
|
|
587
|
-
id:
|
|
588
|
-
labelClass:
|
|
589
|
-
inputClass:
|
|
590
|
-
idx:
|
|
591
|
-
className: `${
|
|
765
|
+
...t,
|
|
766
|
+
id: t.id ?? `${n}-input`,
|
|
767
|
+
labelClass: b,
|
|
768
|
+
inputClass: h,
|
|
769
|
+
idx: v,
|
|
770
|
+
className: `${i} ${t?.uniqueClass}`
|
|
592
771
|
}
|
|
593
772
|
),
|
|
594
|
-
|
|
595
|
-
|
|
773
|
+
t.editing && t.isEditable && /* @__PURE__ */ r(
|
|
774
|
+
V,
|
|
596
775
|
{
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
776
|
+
editableButtonSize: t.editableButtonSize,
|
|
777
|
+
editableButtonColor: t.editableButtonColor,
|
|
778
|
+
editableButtonRadius: t.editableButtonRadius,
|
|
779
|
+
legend: `${n}`,
|
|
780
|
+
idx: v,
|
|
781
|
+
saveText: t.saveText ?? void 0,
|
|
782
|
+
saveButtonStartIcon: t.saveButtonStartIcon ?? void 0,
|
|
783
|
+
saveButtonEndIcon: t.saveButtonEndIcon ?? void 0,
|
|
784
|
+
cancelText: t.cancelText ?? void 0,
|
|
785
|
+
cancelButtonStartIcon: t.cancelButtonStartIcon ?? void 0,
|
|
786
|
+
cancelButtonEndIcon: t.cancelButtonEndIcon ?? void 0,
|
|
787
|
+
deleteText: t.deleteText ?? void 0,
|
|
788
|
+
deleteButtonStartIcon: t.deleteButtonStartIcon ?? void 0,
|
|
789
|
+
deleteButtonEndIcon: t.deleteButtonEndIcon ?? void 0,
|
|
790
|
+
editableInformation: t?.editableInformation,
|
|
791
|
+
onChangeOfEditableOption: x,
|
|
792
|
+
onClickSaveEdit: t?.onClickSave || ((s) => {
|
|
602
793
|
}),
|
|
603
|
-
onClickCancelEdit:
|
|
794
|
+
onClickCancelEdit: t?.onClickCancel || ((s) => {
|
|
604
795
|
}),
|
|
605
|
-
onClickDeleteEntry:
|
|
796
|
+
onClickDeleteEntry: t?.onClickDelete || ((s) => {
|
|
606
797
|
})
|
|
607
798
|
}
|
|
608
799
|
)
|
|
609
800
|
] })
|
|
610
|
-
] }, `form-${
|
|
801
|
+
] }, `form-${a}-${v}`)) : l ? /* @__PURE__ */ r(ee, { children: `No entry yet on ${n}. Please click "+" button to add` }) : ""
|
|
611
802
|
] }),
|
|
612
|
-
|
|
803
|
+
l && /* @__PURE__ */ r(oe, { className: "add-input-button-space", children: /* @__PURE__ */ r(B, { id: `expand-${n}-inputs`, buttonType: "button", text: "+", onClick: f, className: "add-input-entry" }) })
|
|
613
804
|
] }),
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
|
|
805
|
+
/* @__PURE__ */ r(
|
|
806
|
+
ve,
|
|
616
807
|
{
|
|
617
|
-
id:
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
808
|
+
id: a,
|
|
809
|
+
formActionButtonSize: y,
|
|
810
|
+
formActionButtonColor: p,
|
|
811
|
+
formActionButtonRadius: k,
|
|
812
|
+
submitText: C,
|
|
813
|
+
submitIcon: N,
|
|
814
|
+
hasReset: w,
|
|
815
|
+
resetText: S,
|
|
816
|
+
resetIcon: E,
|
|
817
|
+
handleReset: q,
|
|
818
|
+
hasCancel: L,
|
|
819
|
+
cancelText: T,
|
|
820
|
+
cancelIcon: F,
|
|
821
|
+
handleCancel: A
|
|
628
822
|
}
|
|
629
823
|
),
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
] }),
|
|
632
|
-
const l = /^#([0-9A-Fa-f]{3}){1,2}$/, n = /^rgb(a)?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}(?:\s*,\s*(0|1|0?\.\d+))?\s*\)$/;
|
|
633
|
-
return l.test(a) || n.test(a) || CSS.supports("color", a);
|
|
634
|
-
}, h = (a) => {
|
|
635
|
-
if (!$e(a)) throw new Error(`Invalid color: ${a}`);
|
|
636
|
-
return a;
|
|
637
|
-
}, we = {
|
|
824
|
+
/* @__PURE__ */ r(Be, { className: "children-container", children: j })
|
|
825
|
+
] }), De = {
|
|
638
826
|
mobile: "320px",
|
|
639
827
|
//Small iPhone SE & Medium: iPhone 12-15
|
|
640
828
|
tablet: "768px",
|
|
@@ -643,52 +831,108 @@ const M = r.span`
|
|
|
643
831
|
//Macbook 13" (1280x800)
|
|
644
832
|
largeDesktop: "1200px",
|
|
645
833
|
largerDesktop: "1400px"
|
|
646
|
-
},
|
|
834
|
+
}, c = {
|
|
835
|
+
primary1: m("#202234"),
|
|
836
|
+
primary2: m("#3C5E83"),
|
|
837
|
+
primary3: m("#0F60B6"),
|
|
838
|
+
secondary1: m("#C67E10"),
|
|
839
|
+
secondary2: m("#F6C46D"),
|
|
840
|
+
neutral1: m("#FFFFFF"),
|
|
841
|
+
neutral2: m("#F2F2F2"),
|
|
842
|
+
neutral3: m("#ABABAB"),
|
|
843
|
+
neutral4: m("#373A40"),
|
|
844
|
+
neutral5: m("#000000"),
|
|
845
|
+
accent: m("#E1D3B7"),
|
|
846
|
+
shadow1: m("rgb(88, 88, 88)"),
|
|
847
|
+
shadow2: m("rgba(255, 255, 255, 0.50)")
|
|
848
|
+
}, Fe = {
|
|
647
849
|
name: "light",
|
|
648
850
|
colors: {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
851
|
+
screenColor: c.neutral2,
|
|
852
|
+
backgroundColor1: c.primary1,
|
|
853
|
+
backgroundColor2: c.primary2,
|
|
854
|
+
backgroundColor3: c.secondary2,
|
|
855
|
+
backgroundColor4: c.secondary1,
|
|
856
|
+
borderColor1: c.neutral5,
|
|
857
|
+
borderColor2: c.neutral3,
|
|
858
|
+
textColor1: c.neutral5,
|
|
859
|
+
textColor2: c.neutral4,
|
|
860
|
+
textColor3: c.accent,
|
|
861
|
+
shadow: c.shadow1
|
|
862
|
+
},
|
|
863
|
+
anchorTheme: {
|
|
864
|
+
visited: c.neutral5,
|
|
865
|
+
hover: c.primary2,
|
|
866
|
+
active: c.secondary2
|
|
867
|
+
},
|
|
868
|
+
footerTheme: {
|
|
869
|
+
backgroundColor: c.neutral5,
|
|
870
|
+
textColor: c.secondary1,
|
|
871
|
+
shadowColor: c.shadow1
|
|
872
|
+
},
|
|
873
|
+
notificationPalette: {
|
|
874
|
+
infoText: m("#C9E6F0"),
|
|
875
|
+
infoBackground: m("#202234"),
|
|
876
|
+
warningText: m("#FCFFC1"),
|
|
877
|
+
warningBackground: m("#F2C265"),
|
|
878
|
+
successText: m("#9EDF9C"),
|
|
879
|
+
successBackground: m("#123524"),
|
|
880
|
+
errorText: m("#FAD4D4"),
|
|
881
|
+
errorBackground: m("#990000")
|
|
660
882
|
}
|
|
661
|
-
},
|
|
883
|
+
}, Ne = {
|
|
662
884
|
name: "dark",
|
|
663
885
|
colors: {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
886
|
+
screenColor: c.neutral5,
|
|
887
|
+
backgroundColor1: c.primary2,
|
|
888
|
+
backgroundColor2: c.primary3,
|
|
889
|
+
backgroundColor3: c.secondary1,
|
|
890
|
+
backgroundColor4: c.secondary2,
|
|
891
|
+
borderColor1: c.neutral2,
|
|
892
|
+
borderColor2: c.neutral3,
|
|
893
|
+
textColor1: c.neutral1,
|
|
894
|
+
textColor2: c.accent,
|
|
895
|
+
textColor3: c.neutral2,
|
|
896
|
+
shadow: c.shadow2
|
|
897
|
+
},
|
|
898
|
+
anchorTheme: {
|
|
899
|
+
link: c.neutral1,
|
|
900
|
+
visited: c.neutral1,
|
|
901
|
+
hover: c.primary3,
|
|
902
|
+
active: c.secondary1
|
|
903
|
+
},
|
|
904
|
+
footerTheme: {
|
|
905
|
+
backgroundColor: c.accent,
|
|
906
|
+
textColor: c.primary1,
|
|
907
|
+
shadowColor: c.shadow2
|
|
908
|
+
},
|
|
909
|
+
notificationPalette: {
|
|
910
|
+
infoText: m("#202234"),
|
|
911
|
+
infoBackground: m("#C9E6F0"),
|
|
912
|
+
warningText: m("#F2C265"),
|
|
913
|
+
warningBackground: m("#FCFFC1"),
|
|
914
|
+
successText: m("#123524"),
|
|
915
|
+
successBackground: m("#9EDF9C"),
|
|
916
|
+
errorBackground: m("#FAD4D4"),
|
|
917
|
+
errorText: m("#990000")
|
|
675
918
|
}
|
|
676
|
-
},
|
|
677
|
-
children:
|
|
678
|
-
initialTheme:
|
|
679
|
-
secondTheme:
|
|
919
|
+
}, te = ae({}), Ie = ({
|
|
920
|
+
children: e,
|
|
921
|
+
initialTheme: n = Fe,
|
|
922
|
+
secondTheme: l = Ne
|
|
680
923
|
}) => {
|
|
681
|
-
const [
|
|
682
|
-
d((
|
|
924
|
+
const [a, d] = le(n), i = () => {
|
|
925
|
+
d((b) => b === n ? l : n);
|
|
683
926
|
};
|
|
684
|
-
return /* @__PURE__ */
|
|
685
|
-
},
|
|
927
|
+
return /* @__PURE__ */ r(te.Provider, { value: { currentTheme: a, toggleTheme: i }, children: /* @__PURE__ */ r(se, { theme: a, children: e }) });
|
|
928
|
+
}, Re = () => ne(te);
|
|
686
929
|
export {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
930
|
+
qe as DynamicForm,
|
|
931
|
+
te as ThemeContext,
|
|
932
|
+
Ie as ThemeContextProvider,
|
|
933
|
+
De as breakpoints,
|
|
934
|
+
Ne as darkTheme,
|
|
935
|
+
Fe as lightTheme,
|
|
936
|
+
c as palette,
|
|
937
|
+
Re as useTheme
|
|
694
938
|
};
|