@kbgarcia8/react-dynamic-form 2.0.2 → 2.0.3
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/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 +685 -459
- 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 +38 -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 t, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsx as t, jsxs as $, Fragment as U } from "react/jsx-runtime";
|
|
2
|
+
import H, { forwardRef as re, createContext as ae, useState as le, useContext as ne } from "react";
|
|
3
|
+
import h, { css as g, ThemeProvider as ie } 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
|
+
}, se = (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
|
+
}, d = (e) => {
|
|
58
|
+
if (!se(e)) throw new Error(`Invalid color: ${e}`);
|
|
59
|
+
return e;
|
|
60
|
+
}, R = Object.keys(o.breakpoints).reduce(
|
|
61
|
+
(e, n) => {
|
|
62
|
+
const l = n;
|
|
63
|
+
return e[l] = (...r) => g`
|
|
64
|
+
@media (min-width: ${o.breakpoints[l]}) {
|
|
65
|
+
${g(...r)}
|
|
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
|
+
${R.mobile`
|
|
139
|
+
font-size: ${o.fontSize.xxsmall};
|
|
140
|
+
font-weight: ${o.fontWeight.regular};
|
|
141
|
+
`}
|
|
142
|
+
`,
|
|
143
|
+
smaller: g`
|
|
144
|
+
${R.mobile`
|
|
145
|
+
font-size: ${o.fontSize.xsmall};
|
|
146
|
+
font-weight: ${o.fontWeight.regular};
|
|
147
|
+
`}
|
|
148
|
+
`,
|
|
149
|
+
small: g`
|
|
150
|
+
${R.mobile`
|
|
151
|
+
font-size: ${o.fontSize.small};
|
|
152
|
+
font-weight: ${o.fontWeight.medium};
|
|
153
|
+
`}
|
|
154
|
+
`,
|
|
155
|
+
medium: g`
|
|
156
|
+
${R.mobile`
|
|
157
|
+
font-size: ${o.fontSize.medium};
|
|
158
|
+
font-weight: ${o.fontWeight.bold};
|
|
159
|
+
`}
|
|
160
|
+
`,
|
|
161
|
+
large: g`
|
|
162
|
+
${R.mobile`
|
|
163
|
+
font-size: ${o.fontSize.large};
|
|
164
|
+
font-weight: ${o.fontWeight.bolder};
|
|
165
|
+
`}
|
|
166
|
+
`,
|
|
167
|
+
larger: g`
|
|
168
|
+
${R.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
|
+
}, Z = h.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
|
+
`, G = h.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
|
+
`, I = h.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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
text:
|
|
221
|
+
max-width: 80%;
|
|
222
|
+
`, T = ({
|
|
223
|
+
onClick: e,
|
|
224
|
+
id: n,
|
|
225
|
+
buttonType: l = "button",
|
|
226
|
+
startIcon: r,
|
|
227
|
+
endIcon: c,
|
|
228
|
+
text: i = "",
|
|
86
229
|
className: b = "",
|
|
87
|
-
dataAttributes: u = {}
|
|
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: u = {},
|
|
231
|
+
color: x,
|
|
232
|
+
radius: f,
|
|
233
|
+
size: p
|
|
234
|
+
}) => l === "submit" ? /* @__PURE__ */ t(
|
|
235
|
+
Z,
|
|
236
|
+
{
|
|
237
|
+
id: n,
|
|
238
|
+
type: "submit",
|
|
239
|
+
className: b,
|
|
240
|
+
...u,
|
|
241
|
+
$color: x || "primary",
|
|
242
|
+
$radius: f || "squircle",
|
|
243
|
+
children: /* @__PURE__ */ $(G, { className: "button-icon-text-space", $hasIcon: !!(r || c), $hasText: !!i, children: [
|
|
244
|
+
r || "",
|
|
245
|
+
i && /* @__PURE__ */ t(I, { $size: p || "small", id: n, children: i }),
|
|
246
|
+
c || ""
|
|
247
|
+
] })
|
|
248
|
+
}
|
|
249
|
+
) : /* @__PURE__ */ t(
|
|
250
|
+
Z,
|
|
251
|
+
{
|
|
252
|
+
onClick: e,
|
|
253
|
+
id: n,
|
|
254
|
+
type: l,
|
|
255
|
+
className: b,
|
|
256
|
+
...u,
|
|
257
|
+
$color: x || "primary",
|
|
258
|
+
$radius: f || "squircle",
|
|
259
|
+
children: /* @__PURE__ */ $(G, { className: "button-icon-text-space", $hasIcon: !!(r || c), $hasText: !!i, children: [
|
|
260
|
+
r || "",
|
|
261
|
+
i && /* @__PURE__ */ t(I, { $size: p || "small", id: n, children: i }),
|
|
262
|
+
c || ""
|
|
263
|
+
] })
|
|
264
|
+
}
|
|
265
|
+
), be = h.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
|
+
`, he = h.div`
|
|
127
272
|
display: flex;
|
|
128
|
-
gap: ${
|
|
273
|
+
gap: ${o.spacing.xsmall};
|
|
129
274
|
width: auto;
|
|
130
275
|
height: auto;
|
|
131
|
-
`,
|
|
276
|
+
`, ue = h.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,521 @@ const M = r.span`
|
|
|
145
290
|
height: auto;
|
|
146
291
|
object-fit: contain;
|
|
147
292
|
}
|
|
148
|
-
`,
|
|
293
|
+
`, $e = h.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 = h.span`
|
|
300
|
+
font-weight: ${o.fontWeight.bolder};
|
|
301
|
+
`, J = h.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:
|
|
167
|
-
startIcon:
|
|
168
|
-
endIcon:
|
|
169
|
-
className:
|
|
170
|
-
children:
|
|
171
|
-
}) => /* @__PURE__ */
|
|
172
|
-
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */ t(
|
|
175
|
-
|
|
305
|
+
`, xe = h.span`
|
|
306
|
+
font-weight: ${o.fontWeight.light};
|
|
307
|
+
`, K = ({
|
|
308
|
+
htmlFor: e,
|
|
309
|
+
textLabel: n,
|
|
310
|
+
additionalInfo: l,
|
|
311
|
+
$labelFlexDirection: r,
|
|
312
|
+
startIcon: c,
|
|
313
|
+
endIcon: i,
|
|
314
|
+
className: b,
|
|
315
|
+
children: u
|
|
316
|
+
}) => /* @__PURE__ */ $(ue, { htmlFor: e, className: b, $labelFlexDirection: r, children: [
|
|
317
|
+
c && /* @__PURE__ */ t(J, { className: "label-icon-container", children: c }),
|
|
318
|
+
/* @__PURE__ */ $($e, { className: "label-text-container", children: [
|
|
319
|
+
/* @__PURE__ */ t(ge, { className: "main-label", children: n }),
|
|
320
|
+
l && /* @__PURE__ */ t(xe, { className: "additional-info", children: l })
|
|
176
321
|
] }),
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
] }),
|
|
322
|
+
i && /* @__PURE__ */ t(J, { className: "label-icon-container", children: i }),
|
|
323
|
+
u
|
|
324
|
+
] }), Q = h.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 = h.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:
|
|
354
|
+
`, A = re((e, n) => {
|
|
355
|
+
const { type: l, id: r, onChange: c, isRequired: i, dataAttributes: b = {}, disabled: u, className: x, name: f } = e;
|
|
356
|
+
if (l === "textarea") {
|
|
357
|
+
const { rows: w = 5, cols: S = 30, value: B, ...D } = e;
|
|
213
358
|
return /* @__PURE__ */ t(
|
|
214
|
-
|
|
359
|
+
fe,
|
|
215
360
|
{
|
|
216
|
-
ref:
|
|
217
|
-
value:
|
|
218
|
-
rows:
|
|
219
|
-
cols:
|
|
220
|
-
id:
|
|
221
|
-
onChange:
|
|
222
|
-
required:
|
|
223
|
-
disabled:
|
|
224
|
-
...
|
|
225
|
-
className:
|
|
226
|
-
name:
|
|
361
|
+
ref: n,
|
|
362
|
+
value: B,
|
|
363
|
+
rows: w,
|
|
364
|
+
cols: S,
|
|
365
|
+
id: r,
|
|
366
|
+
onChange: c,
|
|
367
|
+
required: i,
|
|
368
|
+
disabled: u,
|
|
369
|
+
...b,
|
|
370
|
+
className: x,
|
|
371
|
+
name: f
|
|
227
372
|
}
|
|
228
373
|
);
|
|
229
374
|
}
|
|
230
|
-
if (
|
|
231
|
-
const { checked:
|
|
375
|
+
if (l === "radio" || l === "checkbox") {
|
|
376
|
+
const { checked: w, ...S } = e;
|
|
232
377
|
return /* @__PURE__ */ t(
|
|
233
|
-
|
|
378
|
+
Q,
|
|
234
379
|
{
|
|
235
|
-
ref:
|
|
236
|
-
type:
|
|
237
|
-
checked:
|
|
238
|
-
id:
|
|
239
|
-
onChange:
|
|
240
|
-
required:
|
|
241
|
-
...
|
|
242
|
-
disabled:
|
|
243
|
-
className:
|
|
244
|
-
name:
|
|
380
|
+
ref: n,
|
|
381
|
+
type: l,
|
|
382
|
+
checked: w,
|
|
383
|
+
id: r,
|
|
384
|
+
onChange: c,
|
|
385
|
+
required: i,
|
|
386
|
+
...b,
|
|
387
|
+
disabled: u,
|
|
388
|
+
className: x,
|
|
389
|
+
name: f
|
|
245
390
|
}
|
|
246
391
|
);
|
|
247
392
|
}
|
|
248
|
-
const p =
|
|
393
|
+
const p = e, { value: k, pattern: y, placeholderText: C, ...z } = p;
|
|
249
394
|
return /* @__PURE__ */ t(
|
|
250
|
-
|
|
395
|
+
Q,
|
|
251
396
|
{
|
|
252
|
-
ref:
|
|
253
|
-
type:
|
|
254
|
-
value:
|
|
397
|
+
ref: n,
|
|
398
|
+
type: l,
|
|
399
|
+
value: k,
|
|
255
400
|
pattern: y,
|
|
256
|
-
placeholder:
|
|
257
|
-
id:
|
|
258
|
-
onChange:
|
|
259
|
-
required:
|
|
260
|
-
...
|
|
261
|
-
disabled:
|
|
262
|
-
className:
|
|
263
|
-
name:
|
|
401
|
+
placeholder: C,
|
|
402
|
+
id: r,
|
|
403
|
+
onChange: c,
|
|
404
|
+
required: i,
|
|
405
|
+
...b,
|
|
406
|
+
disabled: u,
|
|
407
|
+
className: x,
|
|
408
|
+
name: f
|
|
264
409
|
}
|
|
265
410
|
);
|
|
266
|
-
}),
|
|
411
|
+
}), L = (e) => {
|
|
267
412
|
const {
|
|
268
|
-
className:
|
|
269
|
-
type:
|
|
270
|
-
id:
|
|
271
|
-
textLabel:
|
|
272
|
-
additionalInfo:
|
|
273
|
-
$labelFlexDirection:
|
|
274
|
-
startIcon:
|
|
275
|
-
endIcon:
|
|
276
|
-
labelClass:
|
|
413
|
+
className: n,
|
|
414
|
+
type: l,
|
|
415
|
+
id: r,
|
|
416
|
+
textLabel: c,
|
|
417
|
+
additionalInfo: i,
|
|
418
|
+
$labelFlexDirection: b,
|
|
419
|
+
startIcon: u,
|
|
420
|
+
endIcon: x,
|
|
421
|
+
labelClass: f = "",
|
|
277
422
|
onChange: p,
|
|
278
|
-
isRequired:
|
|
423
|
+
isRequired: k,
|
|
279
424
|
dataAttributes: y,
|
|
280
|
-
inputClass:
|
|
281
|
-
ref:
|
|
282
|
-
disabled:
|
|
283
|
-
isEditable:
|
|
284
|
-
editIcon:
|
|
425
|
+
inputClass: C = "",
|
|
426
|
+
ref: z,
|
|
427
|
+
disabled: w,
|
|
428
|
+
isEditable: S,
|
|
429
|
+
editIcon: B,
|
|
285
430
|
onClickEdit: D,
|
|
286
|
-
deleteIcon:
|
|
287
|
-
onClickDelete:
|
|
288
|
-
idx:
|
|
289
|
-
children:
|
|
290
|
-
} =
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
const { rows:
|
|
431
|
+
deleteIcon: j,
|
|
432
|
+
onClickDelete: N,
|
|
433
|
+
idx: v,
|
|
434
|
+
children: O
|
|
435
|
+
} = e;
|
|
436
|
+
return /* @__PURE__ */ $(be, { className: `${n} ${r.replace("#", "")}-label-input-container`, children: [
|
|
437
|
+
l !== "radio" && l !== "checkbox" && /* @__PURE__ */ t(K, { startIcon: u, endIcon: x, htmlFor: r, textLabel: c, additionalInfo: i, $labelFlexDirection: b, className: f }),
|
|
438
|
+
l !== "radio" && l !== "checkbox" && l === "textarea" && (() => {
|
|
439
|
+
const { rows: q = 5, cols: E = 30, value: P, ...a } = e;
|
|
295
440
|
return /* @__PURE__ */ t(
|
|
296
|
-
|
|
441
|
+
A,
|
|
297
442
|
{
|
|
298
|
-
id:
|
|
299
|
-
name:
|
|
443
|
+
id: r,
|
|
444
|
+
name: r,
|
|
300
445
|
type: "textarea",
|
|
301
|
-
isRequired:
|
|
446
|
+
isRequired: k,
|
|
302
447
|
onChange: p,
|
|
303
|
-
value:
|
|
304
|
-
rows:
|
|
305
|
-
cols:
|
|
448
|
+
value: P,
|
|
449
|
+
rows: q,
|
|
450
|
+
cols: E,
|
|
306
451
|
dataAttributes: y,
|
|
307
|
-
className:
|
|
308
|
-
ref:
|
|
309
|
-
disabled:
|
|
452
|
+
className: C,
|
|
453
|
+
ref: z,
|
|
454
|
+
disabled: w
|
|
310
455
|
}
|
|
311
456
|
);
|
|
312
457
|
})(),
|
|
313
|
-
|
|
314
|
-
const
|
|
458
|
+
l !== "radio" && l !== "checkbox" && l !== "textarea" && (() => {
|
|
459
|
+
const q = e, { value: E, pattern: P, placeholderText: a, ...F } = q;
|
|
315
460
|
return /* @__PURE__ */ t(
|
|
316
|
-
|
|
461
|
+
A,
|
|
317
462
|
{
|
|
318
|
-
id:
|
|
319
|
-
name:
|
|
320
|
-
placeholderText:
|
|
463
|
+
id: r,
|
|
464
|
+
name: r,
|
|
465
|
+
placeholderText: a,
|
|
321
466
|
onChange: p,
|
|
322
|
-
value:
|
|
323
|
-
type:
|
|
324
|
-
isRequired:
|
|
467
|
+
value: E,
|
|
468
|
+
type: l,
|
|
469
|
+
isRequired: k,
|
|
325
470
|
dataAttributes: y,
|
|
326
|
-
className:
|
|
327
|
-
ref:
|
|
328
|
-
disabled:
|
|
329
|
-
pattern:
|
|
471
|
+
className: C,
|
|
472
|
+
ref: z,
|
|
473
|
+
disabled: w,
|
|
474
|
+
pattern: P
|
|
330
475
|
}
|
|
331
476
|
);
|
|
332
477
|
})(),
|
|
333
|
-
(
|
|
334
|
-
const { checked:
|
|
335
|
-
return /* @__PURE__ */
|
|
478
|
+
(l === "radio" || l === "checkbox") && (() => {
|
|
479
|
+
const { checked: q, ...E } = e;
|
|
480
|
+
return /* @__PURE__ */ $(U, { children: [
|
|
336
481
|
/* @__PURE__ */ t(
|
|
337
|
-
|
|
482
|
+
A,
|
|
338
483
|
{
|
|
339
|
-
ref:
|
|
340
|
-
type:
|
|
341
|
-
name:
|
|
342
|
-
id:
|
|
343
|
-
isRequired:
|
|
344
|
-
checked:
|
|
484
|
+
ref: z,
|
|
485
|
+
type: l,
|
|
486
|
+
name: r,
|
|
487
|
+
id: r,
|
|
488
|
+
isRequired: k,
|
|
489
|
+
checked: q,
|
|
345
490
|
onChange: p,
|
|
346
|
-
disabled:
|
|
347
|
-
className:
|
|
491
|
+
disabled: w,
|
|
492
|
+
className: C,
|
|
348
493
|
dataAttributes: y
|
|
349
494
|
}
|
|
350
495
|
),
|
|
351
|
-
/* @__PURE__ */ t(
|
|
496
|
+
/* @__PURE__ */ t(K, { startIcon: u, endIcon: x, htmlFor: r, textLabel: c, additionalInfo: i, $labelFlexDirection: b, className: f })
|
|
352
497
|
] });
|
|
353
498
|
})(),
|
|
354
|
-
|
|
355
|
-
/* @__PURE__ */ t(
|
|
356
|
-
/* @__PURE__ */ t(
|
|
499
|
+
S && /* @__PURE__ */ $(he, { className: "input-edit-buttons", children: [
|
|
500
|
+
/* @__PURE__ */ t(T, { id: `editable-${r}-edit-btn`, startIcon: B, buttonType: "button", onClick: D, className: `edit-radio-${v}`, dataAttributes: y }),
|
|
501
|
+
/* @__PURE__ */ t(T, { id: `editable-${r}-delete-btn`, startIcon: j, buttonType: "button", onClick: N, className: `delete-radio-${v}`, dataAttributes: y })
|
|
357
502
|
] }),
|
|
358
|
-
|
|
503
|
+
O
|
|
359
504
|
] });
|
|
360
|
-
},
|
|
505
|
+
}, pe = h.fieldset`
|
|
361
506
|
padding: 0;
|
|
362
507
|
height: auto;
|
|
363
508
|
width: 100%;
|
|
364
|
-
`,
|
|
365
|
-
font-size: ${
|
|
509
|
+
`, ye = h.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
|
+
`, ke = h.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 = h.div`
|
|
377
522
|
display: flex;
|
|
378
523
|
justify-content: space-between;
|
|
379
524
|
width: 100%;
|
|
380
|
-
`,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
525
|
+
`, V = ({
|
|
526
|
+
editableButtonSize: e,
|
|
527
|
+
editableButtonColor: n,
|
|
528
|
+
editableButtonRadius: l,
|
|
529
|
+
legend: r,
|
|
530
|
+
fieldsetIndex: c,
|
|
531
|
+
idx: i,
|
|
532
|
+
editableInformation: b,
|
|
533
|
+
saveText: u,
|
|
534
|
+
saveButtonStartIcon: x,
|
|
535
|
+
saveButtonEndIcon: f,
|
|
536
|
+
cancelText: p,
|
|
537
|
+
cancelButtonStartIcon: k,
|
|
538
|
+
cancelButtonEndIcon: y,
|
|
539
|
+
deleteText: C,
|
|
540
|
+
deleteButtonStartIcon: z,
|
|
541
|
+
deleteButtonEndIcon: w,
|
|
542
|
+
onChangeOfEditableOption: S,
|
|
543
|
+
onClickSaveEdit: B,
|
|
544
|
+
onClickCancelEdit: D,
|
|
545
|
+
onClickDeleteEntry: j
|
|
546
|
+
}) => /* @__PURE__ */ $(pe, { className: "editable-option-fieldset", children: [
|
|
547
|
+
/* @__PURE__ */ t(ye, { children: `${r} ${i + 1}` }),
|
|
548
|
+
b?.map((N, v) => /* @__PURE__ */ t(ke, { className: "editable-option-container", children: /* @__PURE__ */ t(
|
|
549
|
+
A,
|
|
393
550
|
{
|
|
394
|
-
id: `editable-option-${
|
|
395
|
-
name: `editable-option-${
|
|
396
|
-
placeholderText:
|
|
397
|
-
onChange:
|
|
398
|
-
value:
|
|
399
|
-
type:
|
|
551
|
+
id: `editable-option-${v}`,
|
|
552
|
+
name: `editable-option-${v}`,
|
|
553
|
+
placeholderText: N.name.charAt(0).toUpperCase() + N.name.slice(1),
|
|
554
|
+
onChange: S,
|
|
555
|
+
value: N.info,
|
|
556
|
+
type: N.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": v,
|
|
561
|
+
"data-fieldsetindex": c,
|
|
562
|
+
"data-key": N.info
|
|
406
563
|
}
|
|
407
564
|
}
|
|
408
|
-
) }, `${
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
-
/* @__PURE__ */ t(
|
|
411
|
-
/* @__PURE__ */ t(
|
|
412
|
-
/* @__PURE__ */ t(
|
|
565
|
+
) }, `${N.name}-${v}`)),
|
|
566
|
+
/* @__PURE__ */ $(Ce, { className: "editable-option-button-space", children: [
|
|
567
|
+
/* @__PURE__ */ t(T, { startIcon: x, endIcon: f, size: e || "small", color: n || "primary", radius: l || "squircle", id: `editable-option-${i}-submit`, buttonType: "button", text: u || "Save", onClick: B, className: "editable-option-btn", dataAttributes: { "data-index": i, "data-fieldsetindex": c } }),
|
|
568
|
+
/* @__PURE__ */ t(T, { startIcon: k, endIcon: y, size: e || "small", color: n || "primary", radius: l || "squircle", id: `editable-option-${i}-cancel`, buttonType: "button", text: p || "Cancel", onClick: D, className: "editable-option-btn", dataAttributes: { "data-index": i, "data-fieldsetindex": c } }),
|
|
569
|
+
/* @__PURE__ */ t(T, { startIcon: z, endIcon: w, size: e || "small", color: n || "primary", radius: l || "squircle", id: `editable-option-${i}-delete`, buttonType: "button", text: C || "Delete", onClick: j, className: "editable-option-btn", dataAttributes: { "data-index": i, "data-fieldsetindex": c } })
|
|
413
570
|
] })
|
|
414
|
-
] }),
|
|
571
|
+
] }), we = h.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
|
+
`, Fe = ({
|
|
580
|
+
id: e,
|
|
581
|
+
formActionButtonSize: n,
|
|
582
|
+
formActionButtonColor: l,
|
|
583
|
+
formActionButtonRadius: r,
|
|
584
|
+
submitText: c,
|
|
585
|
+
submitIcon: i,
|
|
586
|
+
hasReset: b,
|
|
587
|
+
resetText: u,
|
|
588
|
+
resetIcon: x,
|
|
589
|
+
handleReset: f,
|
|
590
|
+
hasCancel: p,
|
|
591
|
+
cancelText: k,
|
|
592
|
+
cancelIcon: y,
|
|
593
|
+
handleCancel: C
|
|
594
|
+
}) => /* @__PURE__ */ $(we, { className: "form-main-button-container", children: [
|
|
595
|
+
/* @__PURE__ */ t(T, { id: `form-${e}-submit`, size: n || "small", color: l || "primary", radius: r || "squircle", startIcon: i, buttonType: "submit", text: c ?? "Submit", className: "submit-form-btn" }),
|
|
596
|
+
b && /* @__PURE__ */ t(T, { id: `form-${e}-edit`, size: n || "small", color: l || "primary", radius: r || "squircle", startIcon: x, buttonType: "button", text: u ?? "Reset", onClick: f, className: "reset-form-btn" }),
|
|
597
|
+
p && /* @__PURE__ */ t(T, { id: `form-${e}-cancel`, size: n || "small", color: l || "primary", radius: r || "squircle", startIcon: y, buttonType: "button", text: k ?? "Cancel", onClick: C, className: "cancel-form-btn" })
|
|
598
|
+
] }), X = h.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 = h.fieldset`
|
|
442
606
|
padding: 0;
|
|
443
607
|
height: auto;
|
|
444
608
|
width: 100%;
|
|
445
|
-
`,
|
|
446
|
-
padding: ${
|
|
609
|
+
`, _ = h.div`
|
|
610
|
+
padding: ${o.spacing.small};
|
|
447
611
|
height: auto;
|
|
448
612
|
width: 100%;
|
|
449
|
-
`,
|
|
613
|
+
`, ee = h.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
|
+
`, Ne = h.form`
|
|
459
623
|
display: flex;
|
|
460
624
|
flex-direction: column;
|
|
461
625
|
align-items: center;
|
|
462
626
|
width: 100%;
|
|
463
|
-
`,
|
|
627
|
+
`, oe = h.div`
|
|
464
628
|
display: flex;
|
|
465
629
|
justify-content: space-between;
|
|
466
630
|
width: 100%;
|
|
467
|
-
`,
|
|
631
|
+
`, Te = h.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:
|
|
478
|
-
formInputs:
|
|
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
|
-
|
|
637
|
+
`, De = ({
|
|
638
|
+
fieldsets: e = null,
|
|
639
|
+
legendText: n,
|
|
640
|
+
isExpandable: l,
|
|
641
|
+
id: r,
|
|
642
|
+
formInputs: c,
|
|
643
|
+
labelAndInputContainerClass: i,
|
|
644
|
+
labelClass: b,
|
|
645
|
+
inputClass: u,
|
|
646
|
+
onChangeOfEditableOption: x,
|
|
647
|
+
handleAddingInputEntry: f,
|
|
648
|
+
formActionButtonSize: p,
|
|
649
|
+
formActionButtonColor: k,
|
|
650
|
+
formActionButtonRadius: y,
|
|
651
|
+
submitText: C,
|
|
652
|
+
submitIcon: z,
|
|
653
|
+
hasReset: w = !1,
|
|
654
|
+
resetText: S,
|
|
655
|
+
resetIcon: B,
|
|
656
|
+
handleReset: D,
|
|
657
|
+
hasCancel: j = !1,
|
|
658
|
+
cancelText: N,
|
|
659
|
+
cancelIcon: v,
|
|
660
|
+
handleCancel: O,
|
|
661
|
+
handleSubmitForm: q,
|
|
662
|
+
className: E,
|
|
663
|
+
children: P
|
|
664
|
+
}) => /* @__PURE__ */ $(Ne, { id: `${r}-form`, className: E, onSubmit: q, children: [
|
|
665
|
+
e ? e.map((a, F) => /* @__PURE__ */ $(_, { className: `${r}-fieldset-wrapper`, children: [
|
|
666
|
+
/* @__PURE__ */ $(Y, { id: `${r}-form-fieldset-${F}`, className: `${a.legend}-fieldset`, children: [
|
|
667
|
+
a.legend && /* @__PURE__ */ t(X, { className: `${a.legend}-legend`, children: a.legend }),
|
|
668
|
+
a.inputs.length !== 0 ? a.inputs.map((m, W) => /* @__PURE__ */ $(H.Fragment, { children: [
|
|
669
|
+
m.type === "textarea" && /* @__PURE__ */ t(
|
|
670
|
+
L,
|
|
504
671
|
{
|
|
505
|
-
...
|
|
506
|
-
id:
|
|
507
|
-
labelClass:
|
|
508
|
-
inputClass:
|
|
509
|
-
idx:
|
|
510
|
-
className: `${
|
|
672
|
+
...m,
|
|
673
|
+
id: m.id ?? `${a.legend}-input`,
|
|
674
|
+
labelClass: b,
|
|
675
|
+
inputClass: u,
|
|
676
|
+
idx: W,
|
|
677
|
+
className: `${i} ${m?.uniqueClass}`
|
|
511
678
|
}
|
|
512
679
|
),
|
|
513
|
-
|
|
514
|
-
|
|
680
|
+
m.type !== "textarea" && m.type !== "radio" && m.type !== "checkbox" && /* @__PURE__ */ t(
|
|
681
|
+
L,
|
|
515
682
|
{
|
|
516
|
-
...
|
|
517
|
-
id:
|
|
518
|
-
labelClass:
|
|
519
|
-
inputClass:
|
|
520
|
-
idx:
|
|
521
|
-
className: `${
|
|
683
|
+
...m,
|
|
684
|
+
id: m.id ?? `${a.legend}-input`,
|
|
685
|
+
labelClass: b,
|
|
686
|
+
inputClass: u,
|
|
687
|
+
idx: W,
|
|
688
|
+
className: `${i} ${m?.uniqueClass}`
|
|
522
689
|
}
|
|
523
690
|
),
|
|
524
|
-
(
|
|
691
|
+
(m.type === "radio" || m.type === "checkbox") && /* @__PURE__ */ $(U, { children: [
|
|
525
692
|
/* @__PURE__ */ t(
|
|
526
|
-
|
|
693
|
+
L,
|
|
527
694
|
{
|
|
528
|
-
...
|
|
529
|
-
id:
|
|
530
|
-
labelClass:
|
|
531
|
-
inputClass:
|
|
532
|
-
idx:
|
|
533
|
-
className: `${
|
|
695
|
+
...m,
|
|
696
|
+
id: m.id ?? `${a.legend}-input`,
|
|
697
|
+
labelClass: b,
|
|
698
|
+
inputClass: u,
|
|
699
|
+
idx: W,
|
|
700
|
+
className: `${i} ${m?.uniqueClass}`
|
|
534
701
|
}
|
|
535
702
|
),
|
|
536
|
-
|
|
537
|
-
|
|
703
|
+
m.editing && m.isEditable && /* @__PURE__ */ t(
|
|
704
|
+
V,
|
|
538
705
|
{
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
706
|
+
editableButtonSize: m.editableButtonSize,
|
|
707
|
+
editableButtonColor: m.editableButtonColor,
|
|
708
|
+
editableButtonRadius: m.editableButtonRadius,
|
|
709
|
+
legend: `${a.legend}`,
|
|
710
|
+
fieldsetIndex: F,
|
|
711
|
+
idx: W,
|
|
712
|
+
editableInformation: m?.editableInformation || [],
|
|
713
|
+
onChangeOfEditableOption: x,
|
|
714
|
+
onClickSaveEdit: m?.onClickSave || ((M) => {
|
|
545
715
|
}),
|
|
546
|
-
onClickCancelEdit:
|
|
716
|
+
onClickCancelEdit: m?.onClickCancel || ((M) => {
|
|
547
717
|
}),
|
|
548
|
-
onClickDeleteEntry:
|
|
718
|
+
onClickDeleteEntry: m?.onClickDelete || ((M) => {
|
|
549
719
|
})
|
|
550
720
|
}
|
|
551
721
|
)
|
|
552
722
|
] })
|
|
553
|
-
] }, `form-${
|
|
723
|
+
] }, `form-${r}-${W}`)) : a.isExpandable ? /* @__PURE__ */ t(ee, { children: `No entry yet on ${a.legend}. Click "+" button to add entry.` }) : ""
|
|
554
724
|
] }),
|
|
555
|
-
|
|
556
|
-
] }, `${
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
|
|
559
|
-
!
|
|
560
|
-
|
|
561
|
-
|
|
725
|
+
a.isExpandable && /* @__PURE__ */ t(oe, { className: "add-input-button-space", children: /* @__PURE__ */ t(T, { id: `expand-${a.legend}-inputs`, buttonType: "button", text: "+", onClick: f, className: "add-input-entry", dataAttributes: { "data-fieldsetindex": F } }) })
|
|
726
|
+
] }, `${a.legend}-${F}`)) : /* @__PURE__ */ $(_, { className: `${r}-fieldset-wrapper`, children: [
|
|
727
|
+
/* @__PURE__ */ $(Y, { id: `${r}-form-fieldset`, className: `${n}-fieldset`, children: [
|
|
728
|
+
n && /* @__PURE__ */ t(X, { className: `${n}-legend`, children: n }),
|
|
729
|
+
!e && c && c.length !== 0 ? c.map((a, F) => /* @__PURE__ */ $(H.Fragment, { children: [
|
|
730
|
+
a.type === "textarea" && /* @__PURE__ */ t(
|
|
731
|
+
L,
|
|
562
732
|
{
|
|
563
|
-
...
|
|
564
|
-
id:
|
|
565
|
-
labelClass:
|
|
566
|
-
inputClass:
|
|
567
|
-
idx:
|
|
568
|
-
className: `${
|
|
733
|
+
...a,
|
|
734
|
+
id: a.id ?? `${n}-input`,
|
|
735
|
+
labelClass: b,
|
|
736
|
+
inputClass: u,
|
|
737
|
+
idx: F,
|
|
738
|
+
className: `${i} ${a?.uniqueClass}`
|
|
569
739
|
}
|
|
570
740
|
),
|
|
571
|
-
|
|
572
|
-
|
|
741
|
+
a.type !== "textarea" && a.type !== "radio" && a.type !== "checkbox" && /* @__PURE__ */ t(
|
|
742
|
+
L,
|
|
573
743
|
{
|
|
574
|
-
...
|
|
575
|
-
id:
|
|
576
|
-
labelClass:
|
|
577
|
-
inputClass:
|
|
578
|
-
idx:
|
|
579
|
-
className: `${
|
|
744
|
+
...a,
|
|
745
|
+
id: a.id ?? `${n}-input`,
|
|
746
|
+
labelClass: b,
|
|
747
|
+
inputClass: u,
|
|
748
|
+
idx: F,
|
|
749
|
+
className: `${i} ${a?.uniqueClass}`
|
|
580
750
|
}
|
|
581
751
|
),
|
|
582
|
-
(
|
|
752
|
+
(a.type === "radio" || a.type === "checkbox") && /* @__PURE__ */ $(U, { children: [
|
|
583
753
|
/* @__PURE__ */ t(
|
|
584
|
-
|
|
754
|
+
L,
|
|
585
755
|
{
|
|
586
|
-
...
|
|
587
|
-
id:
|
|
588
|
-
labelClass:
|
|
589
|
-
inputClass:
|
|
590
|
-
idx:
|
|
591
|
-
className: `${
|
|
756
|
+
...a,
|
|
757
|
+
id: a.id ?? `${n}-input`,
|
|
758
|
+
labelClass: b,
|
|
759
|
+
inputClass: u,
|
|
760
|
+
idx: F,
|
|
761
|
+
className: `${i} ${a?.uniqueClass}`
|
|
592
762
|
}
|
|
593
763
|
),
|
|
594
|
-
|
|
595
|
-
|
|
764
|
+
a.editing && a.isEditable && /* @__PURE__ */ t(
|
|
765
|
+
V,
|
|
596
766
|
{
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
767
|
+
editableButtonSize: a.editableButtonSize,
|
|
768
|
+
editableButtonColor: a.editableButtonColor,
|
|
769
|
+
editableButtonRadius: a.editableButtonRadius,
|
|
770
|
+
legend: `${n}`,
|
|
771
|
+
idx: F,
|
|
772
|
+
editableInformation: a?.editableInformation,
|
|
773
|
+
onChangeOfEditableOption: x,
|
|
774
|
+
onClickSaveEdit: a?.onClickSave || ((m) => {
|
|
602
775
|
}),
|
|
603
|
-
onClickCancelEdit:
|
|
776
|
+
onClickCancelEdit: a?.onClickCancel || ((m) => {
|
|
604
777
|
}),
|
|
605
|
-
onClickDeleteEntry:
|
|
778
|
+
onClickDeleteEntry: a?.onClickDelete || ((m) => {
|
|
606
779
|
})
|
|
607
780
|
}
|
|
608
781
|
)
|
|
609
782
|
] })
|
|
610
|
-
] }, `form-${
|
|
783
|
+
] }, `form-${r}-${F}`)) : l ? /* @__PURE__ */ t(ee, { children: `No entry yet on ${n}. Please click "+" button to add` }) : ""
|
|
611
784
|
] }),
|
|
612
|
-
|
|
785
|
+
l && /* @__PURE__ */ t(oe, { className: "add-input-button-space", children: /* @__PURE__ */ t(T, { id: `expand-${n}-inputs`, buttonType: "button", text: "+", onClick: f, className: "add-input-entry" }) })
|
|
613
786
|
] }),
|
|
614
787
|
/* @__PURE__ */ t(
|
|
615
|
-
|
|
788
|
+
Fe,
|
|
616
789
|
{
|
|
617
|
-
id:
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
790
|
+
id: r,
|
|
791
|
+
formActionButtonSize: p,
|
|
792
|
+
formActionButtonColor: k,
|
|
793
|
+
formActionButtonRadius: y,
|
|
794
|
+
submitText: C,
|
|
795
|
+
submitIcon: z,
|
|
796
|
+
hasReset: w,
|
|
797
|
+
resetText: S,
|
|
798
|
+
resetIcon: B,
|
|
799
|
+
handleReset: D,
|
|
800
|
+
hasCancel: j,
|
|
801
|
+
cancelText: N,
|
|
802
|
+
cancelIcon: v,
|
|
803
|
+
handleCancel: O
|
|
628
804
|
}
|
|
629
805
|
),
|
|
630
|
-
/* @__PURE__ */ t(
|
|
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 = {
|
|
806
|
+
/* @__PURE__ */ t(Te, { className: "children-container", children: P })
|
|
807
|
+
] }), Ee = {
|
|
638
808
|
mobile: "320px",
|
|
639
809
|
//Small iPhone SE & Medium: iPhone 12-15
|
|
640
810
|
tablet: "768px",
|
|
@@ -643,52 +813,108 @@ const M = r.span`
|
|
|
643
813
|
//Macbook 13" (1280x800)
|
|
644
814
|
largeDesktop: "1200px",
|
|
645
815
|
largerDesktop: "1400px"
|
|
646
|
-
},
|
|
816
|
+
}, s = {
|
|
817
|
+
primary1: d("#202234"),
|
|
818
|
+
primary2: d("#3C5E83"),
|
|
819
|
+
primary3: d("#0F60B6"),
|
|
820
|
+
secondary1: d("#C67E10"),
|
|
821
|
+
secondary2: d("#F6C46D"),
|
|
822
|
+
neutral1: d("#FFFFFF"),
|
|
823
|
+
neutral2: d("#F2F2F2"),
|
|
824
|
+
neutral3: d("#ABABAB"),
|
|
825
|
+
neutral4: d("#373A40"),
|
|
826
|
+
neutral5: d("#000000"),
|
|
827
|
+
accent: d("#E1D3B7"),
|
|
828
|
+
shadow1: d("rgb(88, 88, 88)"),
|
|
829
|
+
shadow2: d("rgba(255, 255, 255, 0.50)")
|
|
830
|
+
}, ve = {
|
|
647
831
|
name: "light",
|
|
648
832
|
colors: {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
833
|
+
screenColor: s.neutral2,
|
|
834
|
+
backgroundColor1: s.primary1,
|
|
835
|
+
backgroundColor2: s.primary2,
|
|
836
|
+
backgroundColor3: s.secondary2,
|
|
837
|
+
backgroundColor4: s.secondary1,
|
|
838
|
+
borderColor1: s.neutral5,
|
|
839
|
+
borderColor2: s.neutral3,
|
|
840
|
+
textColor1: s.neutral5,
|
|
841
|
+
textColor2: s.neutral4,
|
|
842
|
+
textColor3: s.accent,
|
|
843
|
+
shadow: s.shadow1
|
|
844
|
+
},
|
|
845
|
+
anchorTheme: {
|
|
846
|
+
visited: s.neutral5,
|
|
847
|
+
hover: s.primary2,
|
|
848
|
+
active: s.secondary2
|
|
849
|
+
},
|
|
850
|
+
footerTheme: {
|
|
851
|
+
backgroundColor: s.neutral5,
|
|
852
|
+
textColor: s.secondary1,
|
|
853
|
+
shadowColor: s.shadow1
|
|
854
|
+
},
|
|
855
|
+
notificationPalette: {
|
|
856
|
+
infoText: d("#C9E6F0"),
|
|
857
|
+
infoBackground: d("#202234"),
|
|
858
|
+
warningText: d("#FCFFC1"),
|
|
859
|
+
warningBackground: d("#F2C265"),
|
|
860
|
+
successText: d("#9EDF9C"),
|
|
861
|
+
successBackground: d("#123524"),
|
|
862
|
+
errorText: d("#FAD4D4"),
|
|
863
|
+
errorBackground: d("#990000")
|
|
660
864
|
}
|
|
661
|
-
},
|
|
865
|
+
}, ze = {
|
|
662
866
|
name: "dark",
|
|
663
867
|
colors: {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
868
|
+
screenColor: s.neutral5,
|
|
869
|
+
backgroundColor1: s.primary2,
|
|
870
|
+
backgroundColor2: s.primary3,
|
|
871
|
+
backgroundColor3: s.secondary1,
|
|
872
|
+
backgroundColor4: s.secondary2,
|
|
873
|
+
borderColor1: s.neutral2,
|
|
874
|
+
borderColor2: s.neutral3,
|
|
875
|
+
textColor1: s.neutral1,
|
|
876
|
+
textColor2: s.accent,
|
|
877
|
+
textColor3: s.neutral2,
|
|
878
|
+
shadow: s.shadow2
|
|
879
|
+
},
|
|
880
|
+
anchorTheme: {
|
|
881
|
+
link: s.neutral1,
|
|
882
|
+
visited: s.neutral1,
|
|
883
|
+
hover: s.primary3,
|
|
884
|
+
active: s.secondary1
|
|
885
|
+
},
|
|
886
|
+
footerTheme: {
|
|
887
|
+
backgroundColor: s.accent,
|
|
888
|
+
textColor: s.primary1,
|
|
889
|
+
shadowColor: s.shadow2
|
|
890
|
+
},
|
|
891
|
+
notificationPalette: {
|
|
892
|
+
infoText: d("#202234"),
|
|
893
|
+
infoBackground: d("#C9E6F0"),
|
|
894
|
+
warningText: d("#F2C265"),
|
|
895
|
+
warningBackground: d("#FCFFC1"),
|
|
896
|
+
successText: d("#123524"),
|
|
897
|
+
successBackground: d("#9EDF9C"),
|
|
898
|
+
errorBackground: d("#FAD4D4"),
|
|
899
|
+
errorText: d("#990000")
|
|
675
900
|
}
|
|
676
|
-
},
|
|
677
|
-
children:
|
|
678
|
-
initialTheme:
|
|
679
|
-
secondTheme:
|
|
901
|
+
}, te = ae({}), Re = ({
|
|
902
|
+
children: e,
|
|
903
|
+
initialTheme: n = ve,
|
|
904
|
+
secondTheme: l = ze
|
|
680
905
|
}) => {
|
|
681
|
-
const [
|
|
682
|
-
|
|
906
|
+
const [r, c] = le(n), i = () => {
|
|
907
|
+
c((b) => b === n ? l : n);
|
|
683
908
|
};
|
|
684
|
-
return /* @__PURE__ */ t(
|
|
685
|
-
},
|
|
909
|
+
return /* @__PURE__ */ t(te.Provider, { value: { currentTheme: r, toggleTheme: i }, children: /* @__PURE__ */ t(ie, { theme: r, children: e }) });
|
|
910
|
+
}, Le = () => ne(te);
|
|
686
911
|
export {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
912
|
+
De as DynamicForm,
|
|
913
|
+
te as ThemeContext,
|
|
914
|
+
Re as ThemeContextProvider,
|
|
915
|
+
Ee as breakpoints,
|
|
916
|
+
ze as darkTheme,
|
|
917
|
+
ve as lightTheme,
|
|
918
|
+
s as palette,
|
|
919
|
+
Le as useTheme
|
|
694
920
|
};
|