@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,65 +1,162 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),E=require("react"),r=require("styled-components"),t={fonts:{secondary:"Raleway",tertiary:"Lato",fallback:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif"},fontWeight:{light:300,medium:500,bold:700,bolder:900},fontSize:{xsmall:"0.75rem"},spacing:{xxxsmall:"0.25rem",xxsmall:"0.375rem",xsmall:"0.5rem",small:"0.75rem",medium:"1.25rem"},borderRadius:{xsmall:"0.125rem",small:"0.25rem",xlarge:"2rem"},borderThickness:{thin:"0.0625rem",light:"0.125rem"}},B=r.button`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),D=require("react"),s=require("styled-components"),o={fonts:{secondary:"Raleway",tertiary:"Lato",fallback:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif"},fontWeight:{light:300,regular:400,medium:500,bold:700,bolder:900},fontSize:{xxsmall:"0.55rem",xsmall:"0.75rem",small:"1rem",medium:"1.25rem",large:"1.5rem",xlarge:"1.75rem"},spacing:{xxxsmall:"0.25rem",xxsmall:"0.375rem",xsmall:"0.5rem",small:"0.75rem",medium:"1.25rem"},borderRadius:{xsmall:"0.125rem",small:"0.25rem",medium:"0.5rem",large:"1rem",xlarge:"2rem",circle:"50%"},borderThickness:{thin:"0.0625rem",light:"0.125rem"},breakpoints:{mobile:"320px",tablet:"768px",laptop:"1024px",desktop:"1440px",largeDesktop:"1920px"}},te=e=>{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*\)$/;return l.test(e)||n.test(e)||CSS.supports("color",e)},b=e=>{if(!te(e))throw new Error(`Invalid color: ${e}`);return e},z=Object.keys(o.breakpoints).reduce((e,l)=>{const n=l;return e[n]=(...a)=>s.css`
2
+ @media (min-width: ${o.breakpoints[n]}) {
3
+ ${s.css(...a)}
4
+ }
5
+ `,e},{}),re={primary:s.css`
6
+ background-color: ${({theme:e})=>e.colors.backgroundColor1};
7
+ color: ${({theme:e})=>e.colors.textColor3};
8
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.borderColor2};
9
+
10
+ &:hover {
11
+ background-color: ${({theme:e})=>e.colors.backgroundColor2};
12
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.textColor3};
13
+ }
14
+
15
+ &:disabled{
16
+ background-color: ${({theme:e})=>e.notificationPalette.infoText};
17
+ color: ${({theme:e})=>e.colors.shadow};
18
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.shadow};
19
+ cursor: not-allowed;
20
+ }
21
+ `,secondary:s.css`
22
+ background-color: ${({theme:e})=>e.colors.backgroundColor4};
23
+ color: ${({theme:e})=>e.colors.textColor1};
24
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.borderColor1};
25
+
26
+ &:hover {
27
+ background-color: ${({theme:e})=>e.colors.backgroundColor4};
28
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.borderColor2};
29
+ }
30
+
31
+ &:disabled{
32
+ background-color: ${({theme:e})=>e.notificationPalette.warningText};
33
+ color: ${({theme:e})=>e.colors.shadow};
34
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.shadow};
35
+ }
36
+ `,ghost:s.css`
37
+ background-color: transparent;
38
+ color: ${({theme:e})=>e.colors.textColor3};
39
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.textColor3};
40
+
41
+ &:hover {
42
+ background-color: ${({theme:e})=>e.colors.textColor2};
43
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.backgroundColor3};
44
+ }
45
+
46
+ &:disabled{
47
+ background-color: ${({theme:e})=>e.notificationPalette.shadow};
48
+ color: ${({theme:e})=>e.colors.shadow};
49
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.shadow};
50
+ }
51
+ `,bnw:s.css`
52
+ background-color: ${({theme:e})=>e.colors.borderColor1};
53
+ color: ${({theme:e})=>e.colors.borderColor2};
54
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.borderColor2};
55
+
56
+ &:hover {
57
+ background-color: ${({theme:e})=>e.colors.textColor2};
58
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.textColor1};
59
+ }
60
+
61
+ &:disabled{
62
+ background-color: ${({theme:e})=>e.notificationPalette.shadow};
63
+ color: ${({theme:e})=>e.colors.shadow};
64
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.shadow};
65
+ }
66
+ `},ae={smallest:s.css`
67
+ ${z.mobile`
68
+ font-size: ${o.fontSize.xxsmall};
69
+ font-weight: ${o.fontWeight.regular};
70
+ `}
71
+ `,smaller:s.css`
72
+ ${z.mobile`
73
+ font-size: ${o.fontSize.xsmall};
74
+ font-weight: ${o.fontWeight.regular};
75
+ `}
76
+ `,small:s.css`
77
+ ${z.mobile`
78
+ font-size: ${o.fontSize.small};
79
+ font-weight: ${o.fontWeight.medium};
80
+ `}
81
+ `,medium:s.css`
82
+ ${z.mobile`
83
+ font-size: ${o.fontSize.medium};
84
+ font-weight: ${o.fontWeight.bold};
85
+ `}
86
+ `,large:s.css`
87
+ ${z.mobile`
88
+ font-size: ${o.fontSize.large};
89
+ font-weight: ${o.fontWeight.bolder};
90
+ `}
91
+ `,larger:s.css`
92
+ ${z.mobile`
93
+ font-size: ${o.fontSize.xlarge};
94
+ font-weight: ${o.fontWeight.bolder};
95
+ `}
96
+ `},se={square:s.css`border-radius: ${o.borderRadius.xsmall};`,roundedsquare:s.css`border-radius: ${o.borderRadius.medium};`,squircle:s.css`border-radius: ${o.borderRadius.large};`,pill:s.css`border-radius: ${o.borderRadius.xlarge};`,circle:s.css`border-radius: ${o.borderRadius.circle};`},M=s.button`
97
+ width: 100%;
2
98
  display: flex;
3
99
  align-items: center;
4
100
  justify-content: center;
5
- background-color: ${({theme:a})=>a.colors.blue||"blue"};
6
- color: ${({theme:a})=>a.colors.bg||"white"};
7
- border: ${t.borderThickness.light} solid ${({theme:a})=>a.colors.text||"black"};
8
- border-radius: ${t.borderRadius.xlarge};
9
- padding: ${t.spacing.xxxsmall} ${t.spacing.small};
10
- margin: 0.125rem;
11
- width: auto;
101
+ padding: ${o.spacing.xxxsmall} ${o.spacing.xxsmall};
102
+ flex: 1;
103
+ margin: 0;
12
104
  cursor: pointer;
13
105
  transition: background-color 0.2s ease, border-color 0.2s ease;
14
-
15
- &:hover {
16
- background-color: lightblue;
17
- border: ${t.borderThickness.light} solid gray;
18
- }
19
-
20
- & .button-icon-text-space {
21
- max-width: 100%;
22
- }
106
+ ${({$color:e})=>re[e||"primary"]}
107
+ ${({$radius:e})=>se[e||"square"]}
23
108
 
24
109
  & .button-icon-text-space svg {
110
+ height: auto;
111
+ max-height: 100%;
25
112
  max-width: 100%;
26
113
  }
27
- `,P=r.div`
114
+
115
+ &:disabled {
116
+ cursor: not-allowed;
117
+ opacity: 0.6;
118
+ }
119
+ `,U=s.div`
28
120
  width: 100%;
29
121
  display: flex;
30
122
  flex-direction: row;
31
123
  align-items: center;
32
- justify-content: center;
33
- `;r.img`
34
- maxwidth: 100%;
35
- `;const W=r.span`
36
- font-size: ${t.fontSize.xsmall};
37
- font-weight: ${t.fontWeight.medium};
38
- font-family: ${t.fonts.tertiary}, ${t.fonts.fallback};
124
+ justify-content: space-around;
125
+
126
+ ${({$hasIcon:e,$hasText:l})=>e&&l?s.css``:s.css`
127
+ & > * {
128
+ flex: 1;
129
+ }
130
+ `}
131
+ `,H=s.span`
132
+ flex: 2;
133
+ ${({$size:e})=>ae[e||"small"]}
134
+ font-family: ${o.fonts.tertiary}, ${o.fonts.fallback};
39
135
  display: flex;
40
136
  align-items: center;
41
137
  justify-content: center;
42
- `,f=({onClick:a,id:i,buttonType:n,startIcon:o,endIcon:d,alt:m="alt-button-icon",text:c="",className:x="",dataAttributes:h={}})=>{if(n==="button")return e.jsx(B,{onClick:a,id:i,type:n,className:x,...h,children:e.jsxs(P,{className:"button-icon-text-space",children:[o||"",c&&e.jsx(W,{id:i,children:c}),d||""]})});if(n==="submit")return e.jsx(B,{id:i,type:n,className:x,...h,children:e.jsxs(P,{className:"button-icon-text-space",children:[o||"",c&&e.jsx(W,{id:i,children:c}),d||""]})})},Z=r.div`
138
+ max-width: 80%;
139
+ `,w=({onClick:e,id:l,buttonType:n="button",startIcon:a,endIcon:m,text:d="",className:x="",dataAttributes:u={},color:h,radius:$,size:g})=>n==="submit"?t.jsx(M,{id:l,type:"submit",className:x,...u,$color:h||"primary",$radius:$||"squircle",children:t.jsxs(U,{className:"button-icon-text-space",$hasIcon:!!(a||m),$hasText:!!d,children:[a||"",d&&t.jsx(H,{$size:g||"small",id:l,children:d}),m||""]})}):t.jsx(M,{onClick:e,id:l,type:n,className:x,...u,$color:h||"primary",$radius:$||"squircle",children:t.jsxs(U,{className:"button-icon-text-space",$hasIcon:!!(a||m),$hasText:!!d,children:[a||"",d&&t.jsx(H,{$size:g||"small",id:l,children:d}),m||""]})}),ne=s.div`
43
140
  display: flex;
44
141
  flex-direction: column;
45
142
  align-items: left;
46
143
  width: 100%;
47
- margin-bottom: ${t.spacing.small};
48
- `,_=r.div`
144
+ margin-bottom: ${o.spacing.small};
145
+ `,le=s.div`
49
146
  display: flex;
50
- gap: ${t.spacing.xsmall};
147
+ gap: ${o.spacing.xsmall};
51
148
  width: auto;
52
149
  height: auto;
53
- `,I=r.label`
150
+ `,ce=s.label`
54
151
  display: flex;
55
152
  align-items: center;
56
- justify-content:center;
153
+ justify-content: center;
57
154
  height: auto;
58
- flex-direction: ${a=>a.$labelFlexDirection||"column"};
59
- font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
60
- font-size: ${t.fontSize.xsmall};
61
- font-weight: ${t.fontWeight.bold};
62
- gap: ${t.spacing.xxsmall};
155
+ flex-direction: ${e=>e.$labelFlexDirection||"column"};
156
+ font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
157
+ font-size: ${o.fontSize.xsmall};
158
+ font-weight: ${o.fontWeight.bold};
159
+ gap: ${o.spacing.xxsmall};
63
160
 
64
161
  & .label-icon-container img,
65
162
  & .label-icon-container svg {
@@ -67,111 +164,115 @@
67
164
  height: auto;
68
165
  object-fit: contain;
69
166
  }
70
- `,ee=r.div`
167
+ `,ie=s.div`
71
168
  display: flex;
72
169
  flex-direction: column;
73
170
  align-items: center;
74
171
  justify-content: center;
75
- gap: ${t.spacing.xxxsmall};
76
- `,te=r.span`
77
- font-weight: ${t.fontWeight.bolder};
78
- `,M=r.div`
172
+ gap: ${o.spacing.xxxsmall};
173
+ `,de=s.span`
174
+ font-weight: ${o.fontWeight.bolder};
175
+ `,Z=s.div`
79
176
  max-width: 100%;
80
177
  display: flex;
81
178
  align-items: center;
82
- `,ae=r.span`
83
- font-weight: ${t.fontWeight.light};
84
- `,U=({htmlFor:a,textLabel:i,additionalInfo:n,$labelFlexDirection:o,startIcon:d,endIcon:m,className:c,children:x})=>e.jsxs(I,{htmlFor:a,className:c,$labelFlexDirection:o,children:[d&&e.jsx(M,{className:"label-icon-container",children:d}),e.jsxs(ee,{className:"label-text-container",children:[e.jsx(te,{className:"main-label",children:i}),n&&e.jsx(ae,{className:"additional-info",children:n})]}),m&&e.jsx(M,{className:"label-icon-container",children:m}),x]}),O=r.input`
179
+ `,me=s.span`
180
+ font-weight: ${o.fontWeight.light};
181
+ `,G=({htmlFor:e,textLabel:l,additionalInfo:n,$labelFlexDirection:a,startIcon:m,endIcon:d,className:x,children:u})=>t.jsxs(ce,{htmlFor:e,className:x,$labelFlexDirection:a,children:[m&&t.jsx(Z,{className:"label-icon-container",children:m}),t.jsxs(ie,{className:"label-text-container",children:[t.jsx(de,{className:"main-label",children:l}),n&&t.jsx(me,{className:"additional-info",children:n})]}),d&&t.jsx(Z,{className:"label-icon-container",children:d}),u]}),J=s.input`
85
182
  display: flex;
86
183
  place-content: center;
87
- font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
88
- font-size: ${t.fontSize.xsmall};
184
+ font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
185
+ font-size: ${o.fontSize.xsmall};
89
186
  line-height: 1.75;
90
- padding: ${t.spacing.xxxsmall} ${t.spacing.xsmall};
187
+ padding: ${o.spacing.xxxsmall} ${o.spacing.xsmall};
91
188
  max-width: 100%;
92
189
  height: auto;
93
190
  background-color: #FFFFFF;
94
191
  outline: none;
95
- border: ${t.borderThickness.thin} solid #000000;
96
- border-radius: ${t.borderRadius.xsmall};
192
+ border: ${o.borderThickness.thin} solid #000000;
193
+ border-radius: ${o.borderRadius.xsmall};
97
194
 
98
195
  &:focus{
99
- border: ${t.borderThickness.thin} solid ${({theme:a})=>a.colors.teal};
196
+ border: ${o.borderThickness.thin} solid ${({theme:e})=>e.colors.teal};
100
197
  }
101
- `,ne=r.textarea`
198
+ `,be=s.textarea`
102
199
  display: flex;
103
200
  place-content: center;
104
- border: ${t.borderThickness.light} solid ${({theme:a})=>a.colors.text};
105
- border-radius: ${t.borderRadius.small};
201
+ border: ${o.borderThickness.light} solid ${({theme:e})=>e.colors.text};
202
+ border-radius: ${o.borderRadius.small};
106
203
  outline: none;
107
- line-height: ${t.spacing.small};
108
- padding: ${t.spacing.xxxsmall};
109
- font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
110
- font-size: ${t.fontSize.xsmall};
204
+ line-height: ${o.spacing.small};
205
+ padding: ${o.spacing.xxxsmall};
206
+ font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
207
+ font-size: ${o.fontSize.xsmall};
111
208
  max-width: 100%;
112
209
  resize: none;
113
210
  overflow-y: auto;
114
- `,D=E.forwardRef((a,i)=>{const{type:n,id:o,onChange:d,isRequired:m,dataAttributes:c={},disabled:x,className:h,name:u}=a;if(n==="textarea"){const{rows:p=5,cols:w=30,value:v,...T}=a;return e.jsx(ne,{ref:i,value:v,rows:p,cols:w,id:o,onChange:d,required:m,disabled:x,...c,className:h,name:u})}if(n==="radio"||n==="checkbox"){const{checked:p,...w}=a;return e.jsx(O,{ref:i,type:n,checked:p,id:o,onChange:d,required:m,...c,disabled:x,className:h,name:u})}const $=a,{value:k,pattern:y,placeholderText:N,...C}=$;return e.jsx(O,{ref:i,type:n,value:k,pattern:y,placeholder:N,id:o,onChange:d,required:m,...c,disabled:x,className:h,name:u})}),F=a=>{const{className:i,type:n,id:o,textLabel:d,additionalInfo:m,$labelFlexDirection:c,startIcon:x,endIcon:h,labelClass:u,onChange:$,isRequired:k,dataAttributes:y,inputClass:N,ref:C,disabled:p,isEditable:w,editIcon:v,onClickEdit:T,deleteIcon:S,onClickDelete:q,idx:A,children:z}=a;return e.jsxs(Z,{className:`${i} ${o.replace("#","")}-label-input-container`,children:[n!=="radio"&&n!=="checkbox"&&e.jsx(U,{startIcon:x,endIcon:h,htmlFor:o,textLabel:d,additionalInfo:m,$labelFlexDirection:c,className:u}),n!=="radio"&&n!=="checkbox"&&n==="textarea"&&(()=>{const{rows:s=5,cols:g=30,value:l,...j}=a;return e.jsx(D,{id:o,name:o,type:"textarea",isRequired:k,onChange:$,value:l,rows:s,cols:g,dataAttributes:y,className:N,ref:C,disabled:p})})(),n!=="radio"&&n!=="checkbox"&&n!=="textarea"&&(()=>{const s=a,{value:g,pattern:l,placeholderText:j,...L}=s;return e.jsx(D,{id:o,name:o,placeholderText:j,onChange:$,value:g,type:n,isRequired:k,dataAttributes:y,className:N,ref:C,disabled:p,pattern:l})})(),(n==="radio"||n==="checkbox")&&(()=>{const{checked:s,...g}=a;return e.jsxs(e.Fragment,{children:[e.jsx(D,{ref:C,type:n,name:o,id:o,isRequired:k,checked:s,onChange:$,disabled:p,className:N,dataAttributes:y}),e.jsx(U,{startIcon:x,endIcon:h,htmlFor:o,textLabel:d,additionalInfo:m,$labelFlexDirection:c,className:u})]})})(),w&&e.jsxs(_,{className:"input-edit-buttons",children:[e.jsx(f,{id:`editable-${o}-edit-btn`,startIcon:v,buttonType:"button",onClick:T,className:`edit-radio-${A}`,dataAttributes:y}),e.jsx(f,{id:`editable-${o}-delete-btn`,startIcon:S,buttonType:"button",onClick:q,className:`delete-radio-${A}`,dataAttributes:y})]}),z]})},se=r.fieldset`
211
+ `,P=D.forwardRef((e,l)=>{const{type:n,id:a,onChange:m,isRequired:d,dataAttributes:x={},disabled:u,className:h,name:$}=e;if(n==="textarea"){const{rows:p=5,cols:F=30,value:B,...S}=e;return t.jsx(be,{ref:l,value:B,rows:p,cols:F,id:a,onChange:m,required:d,disabled:u,...x,className:h,name:$})}if(n==="radio"||n==="checkbox"){const{checked:p,...F}=e;return t.jsx(J,{ref:l,type:n,checked:p,id:a,onChange:m,required:d,...x,disabled:u,className:h,name:$})}const g=e,{value:y,pattern:f,placeholderText:k,...T}=g;return t.jsx(J,{ref:l,type:n,value:y,pattern:f,placeholder:k,id:a,onChange:m,required:d,...x,disabled:u,className:h,name:$})}),q=e=>{const{className:l,type:n,id:a,textLabel:m,additionalInfo:d,$labelFlexDirection:x,startIcon:u,endIcon:h,labelClass:$="",onChange:g,isRequired:y,dataAttributes:f,inputClass:k="",ref:T,disabled:p,isEditable:F,editIcon:B,onClickEdit:S,deleteIcon:I,onClickDelete:j,idx:v,children:W}=e;return t.jsxs(ne,{className:`${l} ${a.replace("#","")}-label-input-container`,children:[n!=="radio"&&n!=="checkbox"&&t.jsx(G,{startIcon:u,endIcon:h,htmlFor:a,textLabel:m,additionalInfo:d,$labelFlexDirection:x,className:$}),n!=="radio"&&n!=="checkbox"&&n==="textarea"&&(()=>{const{rows:N=5,cols:E=30,value:R,...r}=e;return t.jsx(P,{id:a,name:a,type:"textarea",isRequired:y,onChange:g,value:R,rows:N,cols:E,dataAttributes:f,className:k,ref:T,disabled:p})})(),n!=="radio"&&n!=="checkbox"&&n!=="textarea"&&(()=>{const N=e,{value:E,pattern:R,placeholderText:r,...C}=N;return t.jsx(P,{id:a,name:a,placeholderText:r,onChange:g,value:E,type:n,isRequired:y,dataAttributes:f,className:k,ref:T,disabled:p,pattern:R})})(),(n==="radio"||n==="checkbox")&&(()=>{const{checked:N,...E}=e;return t.jsxs(t.Fragment,{children:[t.jsx(P,{ref:T,type:n,name:a,id:a,isRequired:y,checked:N,onChange:g,disabled:p,className:k,dataAttributes:f}),t.jsx(G,{startIcon:u,endIcon:h,htmlFor:a,textLabel:m,additionalInfo:d,$labelFlexDirection:x,className:$})]})})(),F&&t.jsxs(le,{className:"input-edit-buttons",children:[t.jsx(w,{id:`editable-${a}-edit-btn`,startIcon:B,buttonType:"button",onClick:S,className:`edit-radio-${v}`,dataAttributes:f}),t.jsx(w,{id:`editable-${a}-delete-btn`,startIcon:I,buttonType:"button",onClick:j,className:`delete-radio-${v}`,dataAttributes:f})]}),W]})},xe=s.fieldset`
115
212
  padding: 0;
116
213
  height: auto;
117
214
  width: 100%;
118
- `,oe=r.legend`
119
- font-size: ${t.spacing.medium};
215
+ `,ue=s.legend`
216
+ font-size: ${o.spacing.medium};
120
217
  font-weight: 500;
121
- margin: 0 auto ${t.spacing.small} auto;
218
+ margin: 0 auto ${o.spacing.small} auto;
122
219
  text-align: center;
123
- font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
124
- `,ie=r.div`
220
+ font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
221
+ `,he=s.div`
125
222
  display: flex;
126
223
  flex-direction: column;
127
224
  align-items: flex-start;
128
225
  width: 100%;
129
- margin-bottom: ${t.spacing.small};
130
- `,le=r.div`
226
+ margin-bottom: ${o.spacing.small};
227
+ `,$e=s.div`
131
228
  display: flex;
132
229
  justify-content: space-between;
133
230
  width: 100%;
134
- `,H=({legend:a,fieldsetIndex:i,idx:n,editableInformation:o,onChangeOfEditableOption:d,onClickSaveEdit:m,onClickCancelEdit:c,onClickDeleteEntry:x})=>e.jsxs(se,{className:"editable-option-fieldset",children:[e.jsx(oe,{children:`${a} ${n+1}`}),o?.map((h,u)=>e.jsx(ie,{className:"editable-option-container",children:e.jsx(D,{id:`editable-option-${u}`,name:`editable-option-${u}`,placeholderText:h.name.charAt(0).toUpperCase()+h.name.slice(1),onChange:d,value:h.info,type:h.type,isRequired:!0,className:"editable-option",dataAttributes:{"data-index":u,"data-fieldsetindex":i,"data-key":h.info}})},`${h.name}-${u}`)),e.jsxs(le,{className:"editable-option-button-space",children:[e.jsx(f,{id:`editable-option-${n}-submit`,buttonType:"button",text:"Save",onClick:m,className:"editable-option-btn",dataAttributes:{"data-index":n,"data-fieldsetindex":i}}),e.jsx(f,{id:`editable-option-${n}-cancel`,buttonType:"button",text:"Cancel",onClick:c,className:"editable-option-btn",dataAttributes:{"data-index":n,"data-fieldsetindex":i}}),e.jsx(f,{id:`editable-option-${n}-delete`,buttonType:"button",text:"Delete",onClick:x,className:"editable-option-btn",dataAttributes:{"data-index":n,"data-fieldsetindex":i}})]})]}),ce=r.div`
231
+ `,K=({editableButtonSize:e,editableButtonColor:l,editableButtonRadius:n,legend:a,fieldsetIndex:m,idx:d,editableInformation:x,saveText:u,saveButtonStartIcon:h,saveButtonEndIcon:$,cancelText:g,cancelButtonStartIcon:y,cancelButtonEndIcon:f,deleteText:k,deleteButtonStartIcon:T,deleteButtonEndIcon:p,onChangeOfEditableOption:F,onClickSaveEdit:B,onClickCancelEdit:S,onClickDeleteEntry:I})=>t.jsxs(xe,{className:"editable-option-fieldset",children:[t.jsx(ue,{children:`${a} ${d+1}`}),x?.map((j,v)=>t.jsx(he,{className:"editable-option-container",children:t.jsx(P,{id:`editable-option-${v}`,name:`editable-option-${v}`,placeholderText:j.name.charAt(0).toUpperCase()+j.name.slice(1),onChange:F,value:j.info,type:j.type,isRequired:!0,className:"editable-option",dataAttributes:{"data-index":v,"data-fieldsetindex":m,"data-key":j.info}})},`${j.name}-${v}`)),t.jsxs($e,{className:"editable-option-button-space",children:[t.jsx(w,{startIcon:h,endIcon:$,size:e||"small",color:l||"primary",radius:n||"squircle",id:`editable-option-${d}-submit`,buttonType:"button",text:u||"Save",onClick:B,className:"editable-option-btn",dataAttributes:{"data-index":d,"data-fieldsetindex":m}}),t.jsx(w,{startIcon:y,endIcon:f,size:e||"small",color:l||"primary",radius:n||"squircle",id:`editable-option-${d}-cancel`,buttonType:"button",text:g||"Cancel",onClick:S,className:"editable-option-btn",dataAttributes:{"data-index":d,"data-fieldsetindex":m}}),t.jsx(w,{startIcon:T,endIcon:p,size:e||"small",color:l||"primary",radius:n||"squircle",id:`editable-option-${d}-delete`,buttonType:"button",text:k||"Delete",onClick:I,className:"editable-option-btn",dataAttributes:{"data-index":d,"data-fieldsetindex":m}})]})]}),ge=s.div`
135
232
  display: flex;
136
- justify-content: space-between;
233
+ justify-content: space-around;
234
+ align-content: center;
137
235
  max-width: 100%;
138
- `,re=({id:a,submitText:i,submitIcon:n,hasReset:o,resetText:d,resetIcon:m,handleReset:c,hasCancel:x,cancelText:h,cancelIcon:u,handleCancel:$})=>e.jsxs(ce,{className:"form-main-button-container",children:[e.jsx(f,{id:`form-${a}-submit`,startIcon:n,buttonType:"submit",text:i??"Submit",className:"submit-form-btn"}),o&&e.jsx(f,{id:`form-${a}-edit`,startIcon:m,buttonType:"button",text:d??"Reset",onClick:c,className:"reset-form-btn"}),x&&e.jsx(f,{id:`form-${a}-cancel`,startIcon:u,buttonType:"button",text:h??"Cancel",onClick:$,className:"cancel-form-btn"})]}),G=r.legend`
139
- font-size: ${t.spacing.medium};
236
+ & button {
237
+ margin-inline: 0.25rem;
238
+ }
239
+ `,fe=({id:e,formActionButtonSize:l,formActionButtonColor:n,formActionButtonRadius:a,submitText:m,submitIcon:d,hasReset:x,resetText:u,resetIcon:h,handleReset:$,hasCancel:g,cancelText:y,cancelIcon:f,handleCancel:k})=>t.jsxs(ge,{className:"form-main-button-container",children:[t.jsx(w,{id:`form-${e}-submit`,size:l||"small",color:n||"primary",radius:a||"squircle",startIcon:d,buttonType:"submit",text:m??"Submit",className:"submit-form-btn"}),x&&t.jsx(w,{id:`form-${e}-edit`,size:l||"small",color:n||"primary",radius:a||"squircle",startIcon:h,buttonType:"button",text:u??"Reset",onClick:$,className:"reset-form-btn"}),g&&t.jsx(w,{id:`form-${e}-cancel`,size:l||"small",color:n||"primary",radius:a||"squircle",startIcon:f,buttonType:"button",text:y??"Cancel",onClick:k,className:"cancel-form-btn"})]}),Q=s.legend`
240
+ font-size: ${o.spacing.medium};
140
241
  font-weight: 500;
141
- margin-bottom: ${t.spacing.small};
242
+ margin-bottom: ${o.spacing.small};
142
243
  width: auto;
143
244
  text-align: center;
144
- font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
145
- `,J=r.fieldset`
245
+ font-family: ${o.fonts.secondary}, ${o.fonts.fallback};
246
+ `,V=s.fieldset`
146
247
  padding: 0;
147
248
  height: auto;
148
249
  width: 100%;
149
- `,K=r.div`
150
- padding: ${t.spacing.small};
250
+ `,X=s.div`
251
+ padding: ${o.spacing.small};
151
252
  height: auto;
152
253
  width: 100%;
153
- `,Q=r.div`
254
+ `,Y=s.div`
154
255
  display: flex;
155
256
  justify-content: center;
156
257
  align-items: center;
157
258
  width: 100%;
158
259
  height: auto;
159
- font-family: ${t.fonts.tertiary}, ${t.fonts.fallback};
160
- font-size: ${t.fontSize.xsmall};
161
- font-weight: ${t.fontWeight.bold};
162
- `,de=r.form`
260
+ font-family: ${o.fonts.tertiary}, ${o.fonts.fallback};
261
+ font-size: ${o.fontSize.xsmall};
262
+ font-weight: ${o.fontWeight.bold};
263
+ `,ye=s.form`
163
264
  display: flex;
164
265
  flex-direction: column;
165
266
  align-items: center;
166
267
  width: 100%;
167
- `,V=r.div`
268
+ `,_=s.div`
168
269
  display: flex;
169
270
  justify-content: space-between;
170
271
  width: 100%;
171
- `,me=r.div`
272
+ `,ke=s.div`
172
273
  width: 100%;
173
274
  display: flex;
174
275
  flex-direction: column;
175
276
  align-items: center;
176
277
  justify-content: center;
177
- `,xe=({fieldsets:a=null,legendText:i,isExpandable:n,id:o,formInputs:d,labelAndInputContainerClass:m,labelClass:c,inputClass:x,onChangeOfEditableOption:h,handleAddingInputEntry:u,submitText:$,submitIcon:k,hasReset:y=!1,resetText:N,resetIcon:C,handleReset:p,hasCancel:w=!1,cancelText:v,cancelIcon:T,handleCancel:S,handleSubmitForm:q,className:A,children:z})=>e.jsxs(de,{id:`${o}-form`,className:A,onSubmit:q,children:[a?a.map((s,g)=>e.jsxs(K,{className:`${o}-fieldset-wrapper`,children:[e.jsxs(J,{id:`${o}-form-fieldset-${g}`,className:`${s.legend}-fieldset`,children:[s.legend&&e.jsx(G,{className:`${s.legend}-legend`,children:s.legend}),s.inputs.length!==0?s.inputs.map((l,j)=>e.jsxs(E.Fragment,{children:[l.type==="textarea"&&e.jsx(F,{...l,id:l.id??`${s.legend}-input`,labelClass:c,inputClass:x,idx:j,className:`${m} ${l?.uniqueClass}`}),l.type!=="textarea"&&l.type!=="radio"&&l.type!=="checkbox"&&e.jsx(F,{...l,id:l.id??`${s.legend}-input`,labelClass:c,inputClass:x,idx:j,className:`${m} ${l?.uniqueClass}`}),(l.type==="radio"||l.type==="checkbox")&&e.jsxs(e.Fragment,{children:[e.jsx(F,{...l,id:l.id??`${s.legend}-input`,labelClass:c,inputClass:x,idx:j,className:`${m} ${l?.uniqueClass}`}),l.editing&&l.isEditable&&e.jsx(H,{legend:`${s.legend}`,fieldsetIndex:g,idx:j,editableInformation:l?.editableInformation||[],onChangeOfEditableOption:h,onClickSaveEdit:l?.onClickSave||(L=>{}),onClickCancelEdit:l?.onClickCancel||(L=>{}),onClickDeleteEntry:l?.onClickDelete||(L=>{})})]})]},`form-${o}-${j}`)):s.isExpandable?e.jsx(Q,{children:`No entry yet on ${s.legend}. Click "+" button to add entry.`}):""]}),s.isExpandable&&e.jsx(V,{className:"add-input-button-space",children:e.jsx(f,{id:`expand-${s.legend}-inputs`,buttonType:"button",text:"+",onClick:u,className:"add-input-entry",dataAttributes:{"data-fieldsetindex":g}})})]},`${s.legend}-${g}`)):e.jsxs(K,{className:`${o}-fieldset-wrapper`,children:[e.jsxs(J,{id:`${o}-form-fieldset`,className:`${i}-fieldset`,children:[i&&e.jsx(G,{className:`${i}-legend`,children:i}),!a&&d&&d.length!==0?d.map((s,g)=>e.jsxs(E.Fragment,{children:[s.type==="textarea"&&e.jsx(F,{...s,id:s.id??`${i}-input`,labelClass:c,inputClass:x,idx:g,className:`${m} ${s?.uniqueClass}`}),s.type!=="textarea"&&s.type!=="radio"&&s.type!=="checkbox"&&e.jsx(F,{...s,id:s.id??`${i}-input`,labelClass:c,inputClass:x,idx:g,className:`${m} ${s?.uniqueClass}`}),(s.type==="radio"||s.type==="checkbox")&&e.jsxs(e.Fragment,{children:[e.jsx(F,{...s,id:s.id??`${i}-input`,labelClass:c,inputClass:x,idx:g,className:`${m} ${s?.uniqueClass}`}),s.editing&&s.isEditable&&e.jsx(H,{legend:`${i}`,idx:g,editableInformation:s?.editableInformation,onChangeOfEditableOption:h,onClickSaveEdit:s?.onClickSave||(l=>{}),onClickCancelEdit:s?.onClickCancel||(l=>{}),onClickDeleteEntry:s?.onClickDelete||(l=>{})})]})]},`form-${o}-${g}`)):n?e.jsx(Q,{children:`No entry yet on ${i}. Please click "+" button to add`}):""]}),n&&e.jsx(V,{className:"add-input-button-space",children:e.jsx(f,{id:`expand-${i}-inputs`,buttonType:"button",text:"+",onClick:u,className:"add-input-entry"})})]}),e.jsx(re,{id:o,submitText:$,submitIcon:k,hasReset:y,resetText:N,resetIcon:C,handleReset:p,hasCancel:w,cancelText:v,cancelIcon:T,handleCancel:S}),e.jsx(me,{className:"children-container",children:z})]}),be=a=>{const i=/^#([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*\)$/;return i.test(a)||n.test(a)||CSS.supports("color",a)},b=a=>{if(!be(a))throw new Error(`Invalid color: ${a}`);return a},he={mobile:"320px",tablet:"768px",desktop:"992px",largeDesktop:"1200px",largerDesktop:"1400px"},X={name:"light",colors:{text:b("#333446"),bg:b("#EEEEEE"),blue:b("#7F8CAA"),blue2:b("#80A6FF"),teal:b("#5b8280ff"),teal2:b("#AEEAE7"),gray:b("#AEAEAE"),information:b("#202234"),success:b("#123524"),warning:b("#F2C265"),error:b("#990000")}},Y={name:"dark",colors:{bg:b("#333446"),text:b("#EEEEEE"),blue:b("#80A6FF"),blue2:b("#7F8CAA"),teal:b("#AEEAE7"),teal2:b("#5b8280ff"),gray:b("#D0D0DD"),information:b("#C9E6F0"),success:b("#9EDF9C"),warning:b("#FCFFC1"),error:b("#FAD4D4")}},R=E.createContext({}),ue=({children:a,initialTheme:i=X,secondTheme:n=Y})=>{const[o,d]=E.useState(i),m=()=>{d(c=>c===i?n:i)};return e.jsx(R.Provider,{value:{currentTheme:o,toggleTheme:m},children:e.jsx(r.ThemeProvider,{theme:o,children:a})})},ge=()=>E.useContext(R);exports.DynamicForm=xe;exports.ThemeContext=R;exports.ThemeContextProvider=ue;exports.breakpoints=he;exports.darkTheme=Y;exports.lightTheme=X;exports.useTheme=ge;
278
+ `,pe=({fieldsets:e=null,legendText:l,isExpandable:n,id:a,formInputs:m,labelAndInputContainerClass:d,labelClass:x,inputClass:u,onChangeOfEditableOption:h,handleAddingInputEntry:$,formActionButtonSize:g,formActionButtonColor:y,formActionButtonRadius:f,submitText:k,submitIcon:T,hasReset:p=!1,resetText:F,resetIcon:B,handleReset:S,hasCancel:I=!1,cancelText:j,cancelIcon:v,handleCancel:W,handleSubmitForm:N,className:E,children:R})=>t.jsxs(ye,{id:`${a}-form`,className:E,onSubmit:N,children:[e?e.map((r,C)=>t.jsxs(X,{className:`${a}-fieldset-wrapper`,children:[t.jsxs(V,{id:`${a}-form-fieldset-${C}`,className:`${r.legend}-fieldset`,children:[r.legend&&t.jsx(Q,{className:`${r.legend}-legend`,children:r.legend}),r.inputs.length!==0?r.inputs.map((c,L)=>t.jsxs(D.Fragment,{children:[c.type==="textarea"&&t.jsx(q,{...c,id:c.id??`${r.legend}-input`,labelClass:x,inputClass:u,idx:L,className:`${d} ${c?.uniqueClass}`}),c.type!=="textarea"&&c.type!=="radio"&&c.type!=="checkbox"&&t.jsx(q,{...c,id:c.id??`${r.legend}-input`,labelClass:x,inputClass:u,idx:L,className:`${d} ${c?.uniqueClass}`}),(c.type==="radio"||c.type==="checkbox")&&t.jsxs(t.Fragment,{children:[t.jsx(q,{...c,id:c.id??`${r.legend}-input`,labelClass:x,inputClass:u,idx:L,className:`${d} ${c?.uniqueClass}`}),c.editing&&c.isEditable&&t.jsx(K,{editableButtonSize:c.editableButtonSize,editableButtonColor:c.editableButtonColor,editableButtonRadius:c.editableButtonRadius,legend:`${r.legend}`,fieldsetIndex:C,idx:L,saveText:c.saveText??void 0,saveButtonStartIcon:c.saveButtonStartIcon??void 0,saveButtonEndIcon:c.saveButtonEndIcon??void 0,cancelText:c.cancelText??void 0,cancelButtonStartIcon:c.cancelButtonStartIcon??void 0,cancelButtonEndIcon:c.cancelButtonEndIcon??void 0,deleteText:c.deleteText??void 0,deleteButtonStartIcon:c.deleteButtonStartIcon??void 0,deleteButtonEndIcon:c.deleteButtonEndIcon??void 0,editableInformation:c?.editableInformation||[],onChangeOfEditableOption:h,onClickSaveEdit:c?.onClickSave||(O=>{}),onClickCancelEdit:c?.onClickCancel||(O=>{}),onClickDeleteEntry:c?.onClickDelete||(O=>{})})]})]},`form-${a}-${L}`)):r.isExpandable?t.jsx(Y,{children:`No entry yet on ${r.legend}. Click "+" button to add entry.`}):""]}),r.isExpandable&&t.jsx(_,{className:"add-input-button-space",children:t.jsx(w,{id:`expand-${r.legend}-inputs`,buttonType:"button",text:"+",onClick:$,className:"add-input-entry",dataAttributes:{"data-fieldsetindex":C}})})]},`${r.legend}-${C}`)):t.jsxs(X,{className:`${a}-fieldset-wrapper`,children:[t.jsxs(V,{id:`${a}-form-fieldset`,className:`${l}-fieldset`,children:[l&&t.jsx(Q,{className:`${l}-legend`,children:l}),!e&&m&&m.length!==0?m.map((r,C)=>t.jsxs(D.Fragment,{children:[r.type==="textarea"&&t.jsx(q,{...r,id:r.id??`${l}-input`,labelClass:x,inputClass:u,idx:C,className:`${d} ${r?.uniqueClass}`}),r.type!=="textarea"&&r.type!=="radio"&&r.type!=="checkbox"&&t.jsx(q,{...r,id:r.id??`${l}-input`,labelClass:x,inputClass:u,idx:C,className:`${d} ${r?.uniqueClass}`}),(r.type==="radio"||r.type==="checkbox")&&t.jsxs(t.Fragment,{children:[t.jsx(q,{...r,id:r.id??`${l}-input`,labelClass:x,inputClass:u,idx:C,className:`${d} ${r?.uniqueClass}`}),r.editing&&r.isEditable&&t.jsx(K,{editableButtonSize:r.editableButtonSize,editableButtonColor:r.editableButtonColor,editableButtonRadius:r.editableButtonRadius,legend:`${l}`,idx:C,saveText:r.saveText??void 0,saveButtonStartIcon:r.saveButtonStartIcon??void 0,saveButtonEndIcon:r.saveButtonEndIcon??void 0,cancelText:r.cancelText??void 0,cancelButtonStartIcon:r.cancelButtonStartIcon??void 0,cancelButtonEndIcon:r.cancelButtonEndIcon??void 0,deleteText:r.deleteText??void 0,deleteButtonStartIcon:r.deleteButtonStartIcon??void 0,deleteButtonEndIcon:r.deleteButtonEndIcon??void 0,editableInformation:r?.editableInformation,onChangeOfEditableOption:h,onClickSaveEdit:r?.onClickSave||(c=>{}),onClickCancelEdit:r?.onClickCancel||(c=>{}),onClickDeleteEntry:r?.onClickDelete||(c=>{})})]})]},`form-${a}-${C}`)):n?t.jsx(Y,{children:`No entry yet on ${l}. Please click "+" button to add`}):""]}),n&&t.jsx(_,{className:"add-input-button-space",children:t.jsx(w,{id:`expand-${l}-inputs`,buttonType:"button",text:"+",onClick:$,className:"add-input-entry"})})]}),t.jsx(fe,{id:a,formActionButtonSize:g,formActionButtonColor:y,formActionButtonRadius:f,submitText:k,submitIcon:T,hasReset:p,resetText:F,resetIcon:B,handleReset:S,hasCancel:I,cancelText:j,cancelIcon:v,handleCancel:W}),t.jsx(ke,{className:"children-container",children:R})]}),Ce={mobile:"320px",tablet:"768px",desktop:"992px",largeDesktop:"1200px",largerDesktop:"1400px"},i={primary1:b("#202234"),primary2:b("#3C5E83"),primary3:b("#0F60B6"),secondary1:b("#C67E10"),secondary2:b("#F6C46D"),neutral1:b("#FFFFFF"),neutral2:b("#F2F2F2"),neutral3:b("#ABABAB"),neutral4:b("#373A40"),neutral5:b("#000000"),accent:b("#E1D3B7"),shadow1:b("rgb(88, 88, 88)"),shadow2:b("rgba(255, 255, 255, 0.50)")},ee={name:"light",colors:{screenColor:i.neutral2,backgroundColor1:i.primary1,backgroundColor2:i.primary2,backgroundColor3:i.secondary2,backgroundColor4:i.secondary1,borderColor1:i.neutral5,borderColor2:i.neutral3,textColor1:i.neutral5,textColor2:i.neutral4,textColor3:i.accent,shadow:i.shadow1},anchorTheme:{visited:i.neutral5,hover:i.primary2,active:i.secondary2},footerTheme:{backgroundColor:i.neutral5,textColor:i.secondary1,shadowColor:i.shadow1},notificationPalette:{infoText:b("#C9E6F0"),infoBackground:b("#202234"),warningText:b("#FCFFC1"),warningBackground:b("#F2C265"),successText:b("#9EDF9C"),successBackground:b("#123524"),errorText:b("#FAD4D4"),errorBackground:b("#990000")}},oe={name:"dark",colors:{screenColor:i.neutral5,backgroundColor1:i.primary2,backgroundColor2:i.primary3,backgroundColor3:i.secondary1,backgroundColor4:i.secondary2,borderColor1:i.neutral2,borderColor2:i.neutral3,textColor1:i.neutral1,textColor2:i.accent,textColor3:i.neutral2,shadow:i.shadow2},anchorTheme:{link:i.neutral1,visited:i.neutral1,hover:i.primary3,active:i.secondary1},footerTheme:{backgroundColor:i.accent,textColor:i.primary1,shadowColor:i.shadow2},notificationPalette:{infoText:b("#202234"),infoBackground:b("#C9E6F0"),warningText:b("#F2C265"),warningBackground:b("#FCFFC1"),successText:b("#123524"),successBackground:b("#9EDF9C"),errorBackground:b("#FAD4D4"),errorText:b("#990000")}},A=D.createContext({}),je=({children:e,initialTheme:l=ee,secondTheme:n=oe})=>{const[a,m]=D.useState(l),d=()=>{m(x=>x===l?n:l)};return t.jsx(A.Provider,{value:{currentTheme:a,toggleTheme:d},children:t.jsx(s.ThemeProvider,{theme:a,children:e})})},we=()=>D.useContext(A);exports.DynamicForm=pe;exports.ThemeContext=A;exports.ThemeContextProvider=je;exports.breakpoints=Ce;exports.darkTheme=oe;exports.lightTheme=ee;exports.palette=i;exports.useTheme=we;