@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.
Files changed (31) hide show
  1. package/dist/components/atoms/Button/Button.d.ts +1 -1
  2. package/dist/components/atoms/Button/Button.d.ts.map +1 -1
  3. package/dist/components/atoms/Button/Button.styles.d.ts +32 -4
  4. package/dist/components/atoms/Button/Button.styles.d.ts.map +1 -1
  5. package/dist/components/molecules/FormActionButtons/FormActionButtons.d.ts +1 -1
  6. package/dist/components/molecules/FormActionButtons/FormActionButtons.d.ts.map +1 -1
  7. package/dist/components/molecules/FormActionButtons/FormActionButtons.styles.d.ts.map +1 -1
  8. package/dist/components/molecules/LabeledInput/LabeledInput.d.ts.map +1 -1
  9. package/dist/components/molecules/NestedEditableOption/NestedEditableOption.d.ts +1 -1
  10. package/dist/components/molecules/NestedEditableOption/NestedEditableOption.d.ts.map +1 -1
  11. package/dist/components/organisms/DynamicForm/DynamicForm.d.ts +1 -1
  12. package/dist/components/organisms/DynamicForm/DynamicForm.d.ts.map +1 -1
  13. package/dist/react-dynamic-form.cjs.js +183 -82
  14. package/dist/react-dynamic-form.es.js +685 -459
  15. package/dist/styles/theme.d.ts +16 -0
  16. package/dist/styles/theme.d.ts.map +1 -1
  17. package/dist/styles/variables.d.ts +69 -2
  18. package/dist/styles/variables.d.ts.map +1 -1
  19. package/dist/testcase/App.d.ts +4 -0
  20. package/dist/testcase/App.d.ts.map +1 -0
  21. package/dist/testcase/DynamicForm.styles.d.ts +2 -0
  22. package/dist/testcase/DynamicForm.styles.d.ts.map +1 -0
  23. package/dist/testcase/main.d.ts +2 -0
  24. package/dist/testcase/main.d.ts.map +1 -0
  25. package/dist/type/constantTypes.d.ts +9 -24
  26. package/dist/type/constantTypes.d.ts.map +1 -1
  27. package/dist/type/propTypes.d.ts +38 -13
  28. package/dist/type/propTypes.d.ts.map +1 -1
  29. package/dist/utils/utils.d.ts +4 -0
  30. package/dist/utils/utils.d.ts.map +1 -1
  31. package/package.json +4 -1
@@ -1,7 +1,7 @@
1
- import { jsx as t, jsxs as f, Fragment as R } from "react/jsx-runtime";
2
- import B, { forwardRef as Z, createContext as _, useState as I, useContext as ee } from "react";
3
- import r, { ThemeProvider as te } from "styled-components";
4
- const e = {
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
- xsmall: "0.75rem"
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
- xlarge: "2rem"
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
- }, W = r.button`
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
- background-color: ${({ theme: a }) => a.colors.blue || "blue"};
40
- color: ${({ theme: a }) => a.colors.bg || "white"};
41
- border: ${e.borderThickness.light} solid ${({ theme: a }) => a.colors.text || "black"};
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
- &:hover {
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
- `, P = r.div`
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: center;
67
- `;
68
- r.img`
69
- maxwidth: 100%;
70
- `;
71
- const M = r.span`
72
- font-size: ${e.fontSize.xsmall};
73
- font-weight: ${e.fontWeight.medium};
74
- font-family: ${e.fonts.tertiary}, ${e.fonts.fallback};
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
- `, x = ({
79
- onClick: a,
80
- id: l,
81
- buttonType: n,
82
- startIcon: i,
83
- endIcon: d,
84
- alt: m = "alt-button-icon",
85
- text: c = "",
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
- if (n === "button")
90
- return /* @__PURE__ */ t(
91
- W,
92
- {
93
- onClick: a,
94
- id: l,
95
- type: n,
96
- className: b,
97
- ...u,
98
- children: /* @__PURE__ */ f(P, { className: "button-icon-text-space", children: [
99
- i || "",
100
- c && /* @__PURE__ */ t(M, { id: l, children: c }),
101
- d || ""
102
- ] })
103
- }
104
- );
105
- if (n === "submit")
106
- return /* @__PURE__ */ t(
107
- W,
108
- {
109
- id: l,
110
- type: n,
111
- className: b,
112
- ...u,
113
- children: /* @__PURE__ */ f(P, { className: "button-icon-text-space", children: [
114
- i || "",
115
- c && /* @__PURE__ */ t(M, { id: l, children: c }),
116
- d || ""
117
- ] })
118
- }
119
- );
120
- }, ae = r.div`
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: ${e.spacing.small};
126
- `, ne = r.div`
270
+ margin-bottom: ${o.spacing.small};
271
+ `, he = h.div`
127
272
  display: flex;
128
- gap: ${e.spacing.xsmall};
273
+ gap: ${o.spacing.xsmall};
129
274
  width: auto;
130
275
  height: auto;
131
- `, oe = r.label`
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: ${(a) => a.$labelFlexDirection || "column"};
137
- font-family: ${e.fonts.secondary}, ${e.fonts.fallback};
138
- font-size: ${e.fontSize.xsmall};
139
- font-weight: ${e.fontWeight.bold};
140
- gap: ${e.spacing.xxsmall};
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
- `, ie = r.div`
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: ${e.spacing.xxxsmall};
154
- `, le = r.span`
155
- font-weight: ${e.fontWeight.bolder};
156
- `, U = r.div`
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
- `, se = r.span`
161
- font-weight: ${e.fontWeight.light};
162
- `, H = ({
163
- htmlFor: a,
164
- textLabel: l,
165
- additionalInfo: n,
166
- $labelFlexDirection: i,
167
- startIcon: d,
168
- endIcon: m,
169
- className: c,
170
- children: b
171
- }) => /* @__PURE__ */ f(oe, { htmlFor: a, className: c, $labelFlexDirection: i, children: [
172
- d && /* @__PURE__ */ t(U, { className: "label-icon-container", children: d }),
173
- /* @__PURE__ */ f(ie, { className: "label-text-container", children: [
174
- /* @__PURE__ */ t(le, { className: "main-label", children: l }),
175
- n && /* @__PURE__ */ t(se, { className: "additional-info", children: n })
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
- m && /* @__PURE__ */ t(U, { className: "label-icon-container", children: m }),
178
- b
179
- ] }), O = r.input`
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: ${e.fonts.secondary}, ${e.fonts.fallback};
183
- font-size: ${e.fontSize.xsmall};
327
+ font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
328
+ font-size: ${o.fontSize.xsmall};
184
329
  line-height: 1.75;
185
- padding: ${e.spacing.xxxsmall} ${e.spacing.xsmall};
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: ${e.borderThickness.thin} solid #000000;
191
- border-radius: ${e.borderRadius.xsmall};
335
+ border: ${o.borderThickness.thin} solid #000000;
336
+ border-radius: ${o.borderRadius.xsmall};
192
337
 
193
338
  &:focus{
194
- border: ${e.borderThickness.thin} solid ${({ theme: a }) => a.colors.teal};
339
+ border: ${o.borderThickness.thin} solid ${({ theme: e }) => e.colors.teal};
195
340
  }
196
- `, ce = r.textarea`
341
+ `, fe = h.textarea`
197
342
  display: flex;
198
343
  place-content: center;
199
- border: ${e.borderThickness.light} solid ${({ theme: a }) => a.colors.text};
200
- border-radius: ${e.borderRadius.small};
344
+ border: ${o.borderThickness.light} solid ${({ theme: e }) => e.colors.text};
345
+ border-radius: ${o.borderRadius.small};
201
346
  outline: none;
202
- line-height: ${e.spacing.small};
203
- padding: ${e.spacing.xxxsmall};
204
- font-family: ${e.fonts.secondary}, ${e.fonts.fallback};
205
- font-size: ${e.fontSize.xsmall};
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
- `, T = Z((a, l) => {
210
- const { type: n, id: i, onChange: d, isRequired: m, dataAttributes: c = {}, disabled: b, className: u, name: g } = a;
211
- if (n === "textarea") {
212
- const { rows: k = 5, cols: E = 30, value: A, ...D } = a;
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
- ce,
359
+ fe,
215
360
  {
216
- ref: l,
217
- value: A,
218
- rows: k,
219
- cols: E,
220
- id: i,
221
- onChange: d,
222
- required: m,
223
- disabled: b,
224
- ...c,
225
- className: u,
226
- name: g
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 (n === "radio" || n === "checkbox") {
231
- const { checked: k, ...E } = a;
375
+ if (l === "radio" || l === "checkbox") {
376
+ const { checked: w, ...S } = e;
232
377
  return /* @__PURE__ */ t(
233
- O,
378
+ Q,
234
379
  {
235
- ref: l,
236
- type: n,
237
- checked: k,
238
- id: i,
239
- onChange: d,
240
- required: m,
241
- ...c,
242
- disabled: b,
243
- className: u,
244
- name: g
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 = a, { value: C, pattern: y, placeholderText: w, ...F } = p;
393
+ const p = e, { value: k, pattern: y, placeholderText: C, ...z } = p;
249
394
  return /* @__PURE__ */ t(
250
- O,
395
+ Q,
251
396
  {
252
- ref: l,
253
- type: n,
254
- value: C,
397
+ ref: n,
398
+ type: l,
399
+ value: k,
255
400
  pattern: y,
256
- placeholder: w,
257
- id: i,
258
- onChange: d,
259
- required: m,
260
- ...c,
261
- disabled: b,
262
- className: u,
263
- name: g
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
- }), v = (a) => {
411
+ }), L = (e) => {
267
412
  const {
268
- className: l,
269
- type: n,
270
- id: i,
271
- textLabel: d,
272
- additionalInfo: m,
273
- $labelFlexDirection: c,
274
- startIcon: b,
275
- endIcon: u,
276
- labelClass: g,
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: C,
423
+ isRequired: k,
279
424
  dataAttributes: y,
280
- inputClass: w,
281
- ref: F,
282
- disabled: k,
283
- isEditable: E,
284
- editIcon: A,
425
+ inputClass: C = "",
426
+ ref: z,
427
+ disabled: w,
428
+ isEditable: S,
429
+ editIcon: B,
285
430
  onClickEdit: D,
286
- deleteIcon: z,
287
- onClickDelete: j,
288
- idx: S,
289
- children: L
290
- } = a;
291
- return /* @__PURE__ */ f(ae, { className: `${l} ${i.replace("#", "")}-label-input-container`, children: [
292
- n !== "radio" && n !== "checkbox" && /* @__PURE__ */ t(H, { startIcon: b, endIcon: u, htmlFor: i, textLabel: d, additionalInfo: m, $labelFlexDirection: c, className: g }),
293
- n !== "radio" && n !== "checkbox" && n === "textarea" && (() => {
294
- const { rows: o = 5, cols: $ = 30, value: s, ...N } = a;
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
- T,
441
+ A,
297
442
  {
298
- id: i,
299
- name: i,
443
+ id: r,
444
+ name: r,
300
445
  type: "textarea",
301
- isRequired: C,
446
+ isRequired: k,
302
447
  onChange: p,
303
- value: s,
304
- rows: o,
305
- cols: $,
448
+ value: P,
449
+ rows: q,
450
+ cols: E,
306
451
  dataAttributes: y,
307
- className: w,
308
- ref: F,
309
- disabled: k
452
+ className: C,
453
+ ref: z,
454
+ disabled: w
310
455
  }
311
456
  );
312
457
  })(),
313
- n !== "radio" && n !== "checkbox" && n !== "textarea" && (() => {
314
- const o = a, { value: $, pattern: s, placeholderText: N, ...q } = o;
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
- T,
461
+ A,
317
462
  {
318
- id: i,
319
- name: i,
320
- placeholderText: N,
463
+ id: r,
464
+ name: r,
465
+ placeholderText: a,
321
466
  onChange: p,
322
- value: $,
323
- type: n,
324
- isRequired: C,
467
+ value: E,
468
+ type: l,
469
+ isRequired: k,
325
470
  dataAttributes: y,
326
- className: w,
327
- ref: F,
328
- disabled: k,
329
- pattern: s
471
+ className: C,
472
+ ref: z,
473
+ disabled: w,
474
+ pattern: P
330
475
  }
331
476
  );
332
477
  })(),
333
- (n === "radio" || n === "checkbox") && (() => {
334
- const { checked: o, ...$ } = a;
335
- return /* @__PURE__ */ f(R, { children: [
478
+ (l === "radio" || l === "checkbox") && (() => {
479
+ const { checked: q, ...E } = e;
480
+ return /* @__PURE__ */ $(U, { children: [
336
481
  /* @__PURE__ */ t(
337
- T,
482
+ A,
338
483
  {
339
- ref: F,
340
- type: n,
341
- name: i,
342
- id: i,
343
- isRequired: C,
344
- checked: o,
484
+ ref: z,
485
+ type: l,
486
+ name: r,
487
+ id: r,
488
+ isRequired: k,
489
+ checked: q,
345
490
  onChange: p,
346
- disabled: k,
347
- className: w,
491
+ disabled: w,
492
+ className: C,
348
493
  dataAttributes: y
349
494
  }
350
495
  ),
351
- /* @__PURE__ */ t(H, { startIcon: b, endIcon: u, htmlFor: i, textLabel: d, additionalInfo: m, $labelFlexDirection: c, className: g })
496
+ /* @__PURE__ */ t(K, { startIcon: u, endIcon: x, htmlFor: r, textLabel: c, additionalInfo: i, $labelFlexDirection: b, className: f })
352
497
  ] });
353
498
  })(),
354
- E && /* @__PURE__ */ f(ne, { className: "input-edit-buttons", children: [
355
- /* @__PURE__ */ t(x, { id: `editable-${i}-edit-btn`, startIcon: A, buttonType: "button", onClick: D, className: `edit-radio-${S}`, dataAttributes: y }),
356
- /* @__PURE__ */ t(x, { id: `editable-${i}-delete-btn`, startIcon: z, buttonType: "button", onClick: j, className: `delete-radio-${S}`, dataAttributes: y })
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
- L
503
+ O
359
504
  ] });
360
- }, re = r.fieldset`
505
+ }, pe = h.fieldset`
361
506
  padding: 0;
362
507
  height: auto;
363
508
  width: 100%;
364
- `, de = r.legend`
365
- font-size: ${e.spacing.medium};
509
+ `, ye = h.legend`
510
+ font-size: ${o.spacing.medium};
366
511
  font-weight: 500;
367
- margin: 0 auto ${e.spacing.small} auto;
512
+ margin: 0 auto ${o.spacing.small} auto;
368
513
  text-align: center;
369
- font-family: ${e.fonts.secondary}, ${e.fonts.fallback};
370
- `, me = r.div`
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: ${e.spacing.small};
376
- `, be = r.div`
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
- `, G = ({
381
- legend: a,
382
- fieldsetIndex: l,
383
- idx: n,
384
- editableInformation: i,
385
- onChangeOfEditableOption: d,
386
- onClickSaveEdit: m,
387
- onClickCancelEdit: c,
388
- onClickDeleteEntry: b
389
- }) => /* @__PURE__ */ f(re, { className: "editable-option-fieldset", children: [
390
- /* @__PURE__ */ t(de, { children: `${a} ${n + 1}` }),
391
- i?.map((u, g) => /* @__PURE__ */ t(me, { className: "editable-option-container", children: /* @__PURE__ */ t(
392
- T,
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-${g}`,
395
- name: `editable-option-${g}`,
396
- placeholderText: u.name.charAt(0).toUpperCase() + u.name.slice(1),
397
- onChange: d,
398
- value: u.info,
399
- type: u.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": g,
404
- "data-fieldsetindex": l,
405
- "data-key": u.info
560
+ "data-index": v,
561
+ "data-fieldsetindex": c,
562
+ "data-key": N.info
406
563
  }
407
564
  }
408
- ) }, `${u.name}-${g}`)),
409
- /* @__PURE__ */ f(be, { className: "editable-option-button-space", children: [
410
- /* @__PURE__ */ t(x, { id: `editable-option-${n}-submit`, buttonType: "button", text: "Save", onClick: m, className: "editable-option-btn", dataAttributes: { "data-index": n, "data-fieldsetindex": l } }),
411
- /* @__PURE__ */ t(x, { id: `editable-option-${n}-cancel`, buttonType: "button", text: "Cancel", onClick: c, className: "editable-option-btn", dataAttributes: { "data-index": n, "data-fieldsetindex": l } }),
412
- /* @__PURE__ */ t(x, { id: `editable-option-${n}-delete`, buttonType: "button", text: "Delete", onClick: b, className: "editable-option-btn", dataAttributes: { "data-index": n, "data-fieldsetindex": l } })
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
- ] }), he = r.div`
571
+ ] }), we = h.div`
415
572
  display: flex;
416
- justify-content: space-between;
573
+ justify-content: space-around;
574
+ align-content: center;
417
575
  max-width: 100%;
418
- `, ue = ({
419
- id: a,
420
- submitText: l,
421
- submitIcon: n,
422
- hasReset: i,
423
- resetText: d,
424
- resetIcon: m,
425
- handleReset: c,
426
- hasCancel: b,
427
- cancelText: u,
428
- cancelIcon: g,
429
- handleCancel: p
430
- }) => /* @__PURE__ */ f(he, { className: "form-main-button-container", children: [
431
- /* @__PURE__ */ t(x, { id: `form-${a}-submit`, startIcon: n, buttonType: "submit", text: l ?? "Submit", className: "submit-form-btn" }),
432
- i && /* @__PURE__ */ t(x, { id: `form-${a}-edit`, startIcon: m, buttonType: "button", text: d ?? "Reset", onClick: c, className: "reset-form-btn" }),
433
- b && /* @__PURE__ */ t(x, { id: `form-${a}-cancel`, startIcon: g, buttonType: "button", text: u ?? "Cancel", onClick: p, className: "cancel-form-btn" })
434
- ] }), J = r.legend`
435
- font-size: ${e.spacing.medium};
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: ${e.spacing.small};
601
+ margin-bottom: ${o.spacing.small};
438
602
  width: auto;
439
603
  text-align: center;
440
- font-family: ${e.fonts.secondary}, ${e.fonts.fallback};
441
- `, K = r.fieldset`
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
- `, Q = r.div`
446
- padding: ${e.spacing.small};
609
+ `, _ = h.div`
610
+ padding: ${o.spacing.small};
447
611
  height: auto;
448
612
  width: 100%;
449
- `, V = r.div`
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: ${e.fonts.tertiary}, ${e.fonts.fallback};
456
- font-size: ${e.fontSize.xsmall};
457
- font-weight: ${e.fontWeight.bold};
458
- `, fe = r.form`
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
- `, X = r.div`
627
+ `, oe = h.div`
464
628
  display: flex;
465
629
  justify-content: space-between;
466
630
  width: 100%;
467
- `, ge = r.div`
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
- `, Ce = ({
474
- fieldsets: a = null,
475
- legendText: l,
476
- isExpandable: n,
477
- id: i,
478
- formInputs: d,
479
- labelAndInputContainerClass: m,
480
- labelClass: c,
481
- inputClass: b,
482
- onChangeOfEditableOption: u,
483
- handleAddingInputEntry: g,
484
- submitText: p,
485
- submitIcon: C,
486
- hasReset: y = !1,
487
- resetText: w,
488
- resetIcon: F,
489
- handleReset: k,
490
- hasCancel: E = !1,
491
- cancelText: A,
492
- cancelIcon: D,
493
- handleCancel: z,
494
- handleSubmitForm: j,
495
- className: S,
496
- children: L
497
- }) => /* @__PURE__ */ f(fe, { id: `${i}-form`, className: S, onSubmit: j, children: [
498
- a ? a.map((o, $) => /* @__PURE__ */ f(Q, { className: `${i}-fieldset-wrapper`, children: [
499
- /* @__PURE__ */ f(K, { id: `${i}-form-fieldset-${$}`, className: `${o.legend}-fieldset`, children: [
500
- o.legend && /* @__PURE__ */ t(J, { className: `${o.legend}-legend`, children: o.legend }),
501
- o.inputs.length !== 0 ? o.inputs.map((s, N) => /* @__PURE__ */ f(B.Fragment, { children: [
502
- s.type === "textarea" && /* @__PURE__ */ t(
503
- v,
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
- ...s,
506
- id: s.id ?? `${o.legend}-input`,
507
- labelClass: c,
508
- inputClass: b,
509
- idx: N,
510
- className: `${m} ${s?.uniqueClass}`
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
- s.type !== "textarea" && s.type !== "radio" && s.type !== "checkbox" && /* @__PURE__ */ t(
514
- v,
680
+ m.type !== "textarea" && m.type !== "radio" && m.type !== "checkbox" && /* @__PURE__ */ t(
681
+ L,
515
682
  {
516
- ...s,
517
- id: s.id ?? `${o.legend}-input`,
518
- labelClass: c,
519
- inputClass: b,
520
- idx: N,
521
- className: `${m} ${s?.uniqueClass}`
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
- (s.type === "radio" || s.type === "checkbox") && /* @__PURE__ */ f(R, { children: [
691
+ (m.type === "radio" || m.type === "checkbox") && /* @__PURE__ */ $(U, { children: [
525
692
  /* @__PURE__ */ t(
526
- v,
693
+ L,
527
694
  {
528
- ...s,
529
- id: s.id ?? `${o.legend}-input`,
530
- labelClass: c,
531
- inputClass: b,
532
- idx: N,
533
- className: `${m} ${s?.uniqueClass}`
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
- s.editing && s.isEditable && /* @__PURE__ */ t(
537
- G,
703
+ m.editing && m.isEditable && /* @__PURE__ */ t(
704
+ V,
538
705
  {
539
- legend: `${o.legend}`,
540
- fieldsetIndex: $,
541
- idx: N,
542
- editableInformation: s?.editableInformation || [],
543
- onChangeOfEditableOption: u,
544
- onClickSaveEdit: s?.onClickSave || ((q) => {
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: s?.onClickCancel || ((q) => {
716
+ onClickCancelEdit: m?.onClickCancel || ((M) => {
547
717
  }),
548
- onClickDeleteEntry: s?.onClickDelete || ((q) => {
718
+ onClickDeleteEntry: m?.onClickDelete || ((M) => {
549
719
  })
550
720
  }
551
721
  )
552
722
  ] })
553
- ] }, `form-${i}-${N}`)) : o.isExpandable ? /* @__PURE__ */ t(V, { children: `No entry yet on ${o.legend}. Click "+" button to add entry.` }) : ""
723
+ ] }, `form-${r}-${W}`)) : a.isExpandable ? /* @__PURE__ */ t(ee, { children: `No entry yet on ${a.legend}. Click "+" button to add entry.` }) : ""
554
724
  ] }),
555
- o.isExpandable && /* @__PURE__ */ t(X, { className: "add-input-button-space", children: /* @__PURE__ */ t(x, { id: `expand-${o.legend}-inputs`, buttonType: "button", text: "+", onClick: g, className: "add-input-entry", dataAttributes: { "data-fieldsetindex": $ } }) })
556
- ] }, `${o.legend}-${$}`)) : /* @__PURE__ */ f(Q, { className: `${i}-fieldset-wrapper`, children: [
557
- /* @__PURE__ */ f(K, { id: `${i}-form-fieldset`, className: `${l}-fieldset`, children: [
558
- l && /* @__PURE__ */ t(J, { className: `${l}-legend`, children: l }),
559
- !a && d && d.length !== 0 ? d.map((o, $) => /* @__PURE__ */ f(B.Fragment, { children: [
560
- o.type === "textarea" && /* @__PURE__ */ t(
561
- v,
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
- ...o,
564
- id: o.id ?? `${l}-input`,
565
- labelClass: c,
566
- inputClass: b,
567
- idx: $,
568
- className: `${m} ${o?.uniqueClass}`
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
- o.type !== "textarea" && o.type !== "radio" && o.type !== "checkbox" && /* @__PURE__ */ t(
572
- v,
741
+ a.type !== "textarea" && a.type !== "radio" && a.type !== "checkbox" && /* @__PURE__ */ t(
742
+ L,
573
743
  {
574
- ...o,
575
- id: o.id ?? `${l}-input`,
576
- labelClass: c,
577
- inputClass: b,
578
- idx: $,
579
- className: `${m} ${o?.uniqueClass}`
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
- (o.type === "radio" || o.type === "checkbox") && /* @__PURE__ */ f(R, { children: [
752
+ (a.type === "radio" || a.type === "checkbox") && /* @__PURE__ */ $(U, { children: [
583
753
  /* @__PURE__ */ t(
584
- v,
754
+ L,
585
755
  {
586
- ...o,
587
- id: o.id ?? `${l}-input`,
588
- labelClass: c,
589
- inputClass: b,
590
- idx: $,
591
- className: `${m} ${o?.uniqueClass}`
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
- o.editing && o.isEditable && /* @__PURE__ */ t(
595
- G,
764
+ a.editing && a.isEditable && /* @__PURE__ */ t(
765
+ V,
596
766
  {
597
- legend: `${l}`,
598
- idx: $,
599
- editableInformation: o?.editableInformation,
600
- onChangeOfEditableOption: u,
601
- onClickSaveEdit: o?.onClickSave || ((s) => {
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: o?.onClickCancel || ((s) => {
776
+ onClickCancelEdit: a?.onClickCancel || ((m) => {
604
777
  }),
605
- onClickDeleteEntry: o?.onClickDelete || ((s) => {
778
+ onClickDeleteEntry: a?.onClickDelete || ((m) => {
606
779
  })
607
780
  }
608
781
  )
609
782
  ] })
610
- ] }, `form-${i}-${$}`)) : n ? /* @__PURE__ */ t(V, { children: `No entry yet on ${l}. Please click "+" button to add` }) : ""
783
+ ] }, `form-${r}-${F}`)) : l ? /* @__PURE__ */ t(ee, { children: `No entry yet on ${n}. Please click "+" button to add` }) : ""
611
784
  ] }),
612
- n && /* @__PURE__ */ t(X, { className: "add-input-button-space", children: /* @__PURE__ */ t(x, { id: `expand-${l}-inputs`, buttonType: "button", text: "+", onClick: g, className: "add-input-entry" }) })
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
- ue,
788
+ Fe,
616
789
  {
617
- id: i,
618
- submitText: p,
619
- submitIcon: C,
620
- hasReset: y,
621
- resetText: w,
622
- resetIcon: F,
623
- handleReset: k,
624
- hasCancel: E,
625
- cancelText: A,
626
- cancelIcon: D,
627
- handleCancel: z
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(ge, { className: "children-container", children: L })
631
- ] }), $e = (a) => {
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
- }, xe = {
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
- text: h("#333446"),
650
- bg: h("#EEEEEE"),
651
- blue: h("#7F8CAA"),
652
- blue2: h("#80A6FF"),
653
- teal: h("#5b8280ff"),
654
- teal2: h("#AEEAE7"),
655
- gray: h("#AEAEAE"),
656
- information: h("#202234"),
657
- success: h("#123524"),
658
- warning: h("#F2C265"),
659
- error: h("#990000")
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
- }, pe = {
865
+ }, ze = {
662
866
  name: "dark",
663
867
  colors: {
664
- bg: h("#333446"),
665
- text: h("#EEEEEE"),
666
- blue: h("#80A6FF"),
667
- blue2: h("#7F8CAA"),
668
- teal: h("#AEEAE7"),
669
- teal2: h("#5b8280ff"),
670
- gray: h("#D0D0DD"),
671
- information: h("#C9E6F0"),
672
- success: h("#9EDF9C"),
673
- warning: h("#FCFFC1"),
674
- error: h("#FAD4D4")
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
- }, Y = _({}), Fe = ({
677
- children: a,
678
- initialTheme: l = xe,
679
- secondTheme: n = pe
901
+ }, te = ae({}), Re = ({
902
+ children: e,
903
+ initialTheme: n = ve,
904
+ secondTheme: l = ze
680
905
  }) => {
681
- const [i, d] = I(l), m = () => {
682
- d((c) => c === l ? n : l);
906
+ const [r, c] = le(n), i = () => {
907
+ c((b) => b === n ? l : n);
683
908
  };
684
- return /* @__PURE__ */ t(Y.Provider, { value: { currentTheme: i, toggleTheme: m }, children: /* @__PURE__ */ t(te, { theme: i, children: a }) });
685
- }, Ee = () => ee(Y);
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
- Ce as DynamicForm,
688
- Y as ThemeContext,
689
- Fe as ThemeContextProvider,
690
- we as breakpoints,
691
- pe as darkTheme,
692
- xe as lightTheme,
693
- Ee as useTheme
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
  };