@kbgarcia8/react-dynamic-form 2.0.2 → 2.0.4

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