@kbgarcia8/react-dynamic-form 1.1.4 → 1.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +422 -1
- package/dist/components/atoms/Label/Label.d.ts.map +1 -1
- package/dist/components/atoms/Label/Label.styles.d.ts +1 -0
- package/dist/components/atoms/Label/Label.styles.d.ts.map +1 -1
- package/dist/components/molecules/FormActionButtons/FormActionButtons.d.ts +1 -1
- package/dist/components/molecules/FormActionButtons/FormActionButtons.d.ts.map +1 -1
- package/dist/components/molecules/LabeledInput/LabeledInput.d.ts +2 -2
- package/dist/components/molecules/LabeledInput/LabeledInput.d.ts.map +1 -1
- package/dist/components/organisms/DynamicForm/DynamicForm.d.ts +1 -1
- package/dist/components/organisms/DynamicForm/DynamicForm.d.ts.map +1 -1
- package/dist/context/ThemeContext.d.ts +1 -1
- package/dist/context/ThemeContext.d.ts.map +1 -1
- package/dist/context/ThemeContextWrapper.d.ts +5 -1
- package/dist/context/ThemeContextWrapper.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react-dynamic-form.cjs.js +72 -66
- package/dist/react-dynamic-form.es.js +429 -424
- package/dist/styles/styled.d.ts +7 -0
- package/dist/styles/styled.d.ts.map +1 -0
- package/dist/type/propTypes.d.ts +40 -30
- package/dist/type/propTypes.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),F=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"}},J=r.button`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
background-color: ${({theme:
|
|
6
|
-
color: ${({theme:
|
|
7
|
-
border: ${
|
|
8
|
-
border-radius: ${
|
|
9
|
-
padding: ${
|
|
5
|
+
background-color: ${({theme:n})=>n.colors.blue||"blue"};
|
|
6
|
+
color: ${({theme:n})=>n.colors.bg||"white"};
|
|
7
|
+
border: ${t.borderThickness.light} solid ${({theme:n})=>n.colors.text||"black"};
|
|
8
|
+
border-radius: ${t.borderRadius.xlarge};
|
|
9
|
+
padding: ${t.spacing.xxxsmall} ${t.spacing.small};
|
|
10
10
|
margin: 0.125rem;
|
|
11
11
|
width: auto;
|
|
12
12
|
cursor: pointer;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
&:hover {
|
|
16
16
|
background-color: lightblue;
|
|
17
|
-
border: ${
|
|
17
|
+
border: ${t.borderThickness.light} solid gray;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
& .button-icon-text-space {
|
|
@@ -24,42 +24,42 @@
|
|
|
24
24
|
& .button-icon-text-space svg {
|
|
25
25
|
max-width: 100%;
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`,K=r.div`
|
|
28
28
|
width: 100%;
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: row;
|
|
31
31
|
align-items: center;
|
|
32
32
|
justify-content: center;
|
|
33
|
-
`,
|
|
33
|
+
`,Q=r.img`
|
|
34
34
|
maxwidth: 100%;
|
|
35
|
-
`,
|
|
36
|
-
font-size: ${
|
|
37
|
-
font-weight: ${
|
|
38
|
-
font-family: ${
|
|
35
|
+
`,V=r.span`
|
|
36
|
+
font-size: ${t.fontSize.xsmall};
|
|
37
|
+
font-weight: ${t.fontWeight.medium};
|
|
38
|
+
font-family: ${t.fonts.tertiary}, ${t.fonts.fallback};
|
|
39
39
|
display: flex;
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: center;
|
|
42
|
-
`,
|
|
42
|
+
`,f=({onClick:n,id:s,buttonType:l,source:o,svg:x,alt:d="alt-button-icon",text:m="",className:c="",dataAttributes:h={}})=>e.jsx(J,{onClick:n,id:s,type:l,className:c,...h,children:e.jsxs(K,{className:"button-icon-text-space",children:[o?e.jsx(Q,{src:o,alt:d}):x||"",m&&e.jsx(V,{id:s,children:m})]})}),X=r.div`
|
|
43
43
|
display: flex;
|
|
44
44
|
flex-direction: column;
|
|
45
45
|
align-items: left;
|
|
46
46
|
width: 100%;
|
|
47
|
-
margin-bottom: ${
|
|
48
|
-
`,
|
|
47
|
+
margin-bottom: ${t.spacing.small};
|
|
48
|
+
`,Y=r.div`
|
|
49
49
|
display: flex;
|
|
50
|
-
gap: ${
|
|
50
|
+
gap: ${t.spacing.xsmall};
|
|
51
51
|
width: auto;
|
|
52
52
|
height: auto;
|
|
53
|
-
`,
|
|
53
|
+
`,Z=r.label`
|
|
54
54
|
display: flex;
|
|
55
55
|
align-items: center;
|
|
56
56
|
justify-content:center;
|
|
57
57
|
height: auto;
|
|
58
|
-
flex-direction: ${
|
|
59
|
-
font-family: ${
|
|
60
|
-
font-size: ${
|
|
61
|
-
font-weight: ${
|
|
62
|
-
gap: ${
|
|
58
|
+
flex-direction: ${n=>n.$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};
|
|
63
63
|
|
|
64
64
|
& .label-icon-container img,
|
|
65
65
|
& .label-icon-container svg {
|
|
@@ -67,105 +67,111 @@
|
|
|
67
67
|
height: auto;
|
|
68
68
|
object-fit: contain;
|
|
69
69
|
}
|
|
70
|
-
`,
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
`,_=r.div`
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
gap: ${t.spacing.xxxsmall};
|
|
76
|
+
`,ee=r.span`
|
|
77
|
+
font-weight: ${t.fontWeight.bolder};
|
|
78
|
+
`,te=r.div`
|
|
73
79
|
max-width: 100%;
|
|
74
80
|
display: flex;
|
|
75
81
|
align-items: center;
|
|
76
|
-
`,
|
|
77
|
-
font-weight: ${
|
|
78
|
-
`,
|
|
82
|
+
`,ne=r.span`
|
|
83
|
+
font-weight: ${t.fontWeight.light};
|
|
84
|
+
`,R=({htmlFor:n,textLabel:s,additionalInfo:l,$labelFlexDirection:o,source:x,svg:d,className:m,children:c})=>e.jsxs(Z,{htmlFor:n,className:m,$labelFlexDirection:o,children:[(x||d)&&e.jsx(te,{className:"label-icon-container",children:x?e.jsx("img",{src:x,alt:`${n}-label-icon`}):d||""}),e.jsxs(_,{className:"label-text-container",children:[e.jsx(ee,{className:"main-label",children:s}),l&&e.jsx(ne,{className:"additional-info",children:l})]}),c]}),B=r.input`
|
|
79
85
|
display: flex;
|
|
80
86
|
place-content: center;
|
|
81
|
-
font-family: ${
|
|
82
|
-
font-size: ${
|
|
87
|
+
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
88
|
+
font-size: ${t.fontSize.xsmall};
|
|
83
89
|
line-height: 1.75;
|
|
84
|
-
padding: ${
|
|
90
|
+
padding: ${t.spacing.xxxsmall} ${t.spacing.xsmall};
|
|
85
91
|
max-width: 100%;
|
|
86
92
|
height: auto;
|
|
87
93
|
background-color: #FFFFFF;
|
|
88
94
|
outline: none;
|
|
89
|
-
border: ${
|
|
90
|
-
border-radius: ${
|
|
95
|
+
border: ${t.borderThickness.thin} solid #000000;
|
|
96
|
+
border-radius: ${t.borderRadius.xsmall};
|
|
91
97
|
|
|
92
98
|
&:focus{
|
|
93
|
-
border: ${
|
|
99
|
+
border: ${t.borderThickness.thin} solid ${({theme:n})=>n.colors.teal};
|
|
94
100
|
}
|
|
95
|
-
`,
|
|
101
|
+
`,ae=r.textarea`
|
|
96
102
|
display: flex;
|
|
97
103
|
place-content: center;
|
|
98
|
-
border: ${
|
|
99
|
-
border-radius: ${
|
|
104
|
+
border: ${t.borderThickness.light} solid ${({theme:n})=>n.colors.text};
|
|
105
|
+
border-radius: ${t.borderRadius.small};
|
|
100
106
|
outline: none;
|
|
101
|
-
line-height: ${
|
|
102
|
-
padding: ${
|
|
103
|
-
font-family: ${
|
|
104
|
-
font-size: ${
|
|
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};
|
|
105
111
|
max-width: 100%;
|
|
106
112
|
resize: none;
|
|
107
113
|
overflow-y: auto;
|
|
108
|
-
`,
|
|
114
|
+
`,A=F.forwardRef((n,s)=>{const{type:l,id:o,onChange:x,isRequired:d,dataAttributes:m,disabled:c,className:h}=n;if(l==="textarea"){const{rows:y=5,cols:N=30,value:E,...v}=n;return e.jsx(ae,{id:o,onChange:x,value:E,rows:y,cols:N,...m,className:h,ref:s,disabled:c,required:d})}if(l==="radio"||l==="checkbox"){const{checked:y,...N}=n;return e.jsx(B,{ref:s,type:"checkbox",id:o,checked:y,onChange:x,disabled:c,className:h,...m})}const g=n,{value:j,pattern:$,placeholderText:k,...C}=g;return e.jsx(B,{id:o,name:o,placeholder:k,onChange:x,value:j,type:l,required:d,...m,className:h,ref:s,disabled:c,pattern:$})}),w=n=>{const{className:s,type:l,id:o,textLabel:x,additionalInfo:d,$labelFlexDirection:m,svg:c,labelClass:h,onChange:g,isRequired:j,dataAttributes:$,inputClass:k,ref:C,disabled:y,isEditable:N,editIcon:E,onClickEdit:v,deleteIcon:D,onClickDelete:S,idx:T,children:q}=n;return e.jsxs(X,{className:`${s} ${o.replace("#","")}-label-input-container`,children:[l!=="radio"&&l!=="checkbox"&&e.jsx(R,{htmlFor:o,textLabel:x,additionalInfo:d,$labelFlexDirection:m,svg:c,className:h}),l!=="radio"&&l!=="checkbox"&&l==="textarea"&&(()=>{const{rows:a=5,cols:u=30,value:i,...p}=n;return e.jsx(A,{id:o,name:o,type:"textarea",isRequired:j,onChange:g,value:i,rows:a,cols:u,dataAttributes:$,className:k,ref:C,disabled:y})})(),l!=="radio"&&l!=="checkbox"&&l!=="textarea"&&(()=>{const a=n,{value:u,pattern:i,placeholderText:p,...z}=a;return e.jsx(A,{id:o,name:o,placeholderText:p,onChange:g,value:u,type:l,isRequired:j,dataAttributes:$,className:k,ref:C,disabled:y,pattern:i})})(),(l==="radio"||l==="checkbox")&&(()=>{const{checked:a,...u}=n;return e.jsxs(e.Fragment,{children:[e.jsx(A,{ref:C,type:"checkbox",name:o,id:o,isRequired:j,checked:a,onChange:g,disabled:y,className:k,dataAttributes:$}),e.jsx(R,{htmlFor:o,textLabel:x,additionalInfo:d,$labelFlexDirection:m,svg:c,className:h})]})})(),N&&e.jsxs(Y,{className:"input-edit-buttons",children:[e.jsx(f,{id:`editable-${o}-edit-btn`,svg:E,buttonType:"button",onClick:v,className:`edit-radio-${T}`,dataAttributes:$}),e.jsx(f,{id:`editable-${o}-delete-btn`,svg:D,buttonType:"button",onClick:S,className:`delete-radio-${T}`,dataAttributes:$})]}),q]})},se=r.fieldset`
|
|
109
115
|
padding: 0;
|
|
110
116
|
height: auto;
|
|
111
117
|
width: 100%;
|
|
112
|
-
`,
|
|
113
|
-
font-size: ${
|
|
118
|
+
`,oe=r.legend`
|
|
119
|
+
font-size: ${t.spacing.medium};
|
|
114
120
|
font-weight: 500;
|
|
115
|
-
margin: 0 auto ${
|
|
121
|
+
margin: 0 auto ${t.spacing.small} auto;
|
|
116
122
|
text-align: center;
|
|
117
|
-
font-family: ${
|
|
118
|
-
`,le=
|
|
123
|
+
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
124
|
+
`,le=r.div`
|
|
119
125
|
display: flex;
|
|
120
126
|
flex-direction: column;
|
|
121
127
|
align-items: flex-start;
|
|
122
128
|
width: 100%;
|
|
123
|
-
margin-bottom: ${
|
|
124
|
-
`,
|
|
129
|
+
margin-bottom: ${t.spacing.small};
|
|
130
|
+
`,ie=r.div`
|
|
125
131
|
display: flex;
|
|
126
132
|
justify-content: space-between;
|
|
127
133
|
width: 100%;
|
|
128
|
-
`,
|
|
134
|
+
`,P=({legend:n,idx:s,editableInformation:l,onChangeOfEditableOption:o,onClickSaveEdit:x,onClickCancelEdit:d,onClickDeleteEntry:m})=>e.jsxs(se,{className:"editable-option-fieldset",children:[e.jsx(oe,{children:`${n} ${s+1}`}),l?.map((c,h)=>e.jsx(le,{className:"editable-option-container",children:e.jsx(A,{id:`editable-option-${h}`,name:`editable-option-${h}`,placeholderText:c.name.charAt(0).toUpperCase()+c.name.slice(1),onChange:o,value:c.info,type:c.type,isRequired:!0,className:"editable-option",dataAttributes:{"data-index":h,"data-key":c.info}})},`${c.name}-${h}`)),e.jsxs(ie,{className:"editable-option-button-space",children:[e.jsx(f,{id:`editable-option-${s}-submit`,buttonType:"button",text:"Save",onClick:x,className:"editable-option-btn",dataAttributes:{"data-index":s}}),e.jsx(f,{id:`editable-option-${s}-cancel`,buttonType:"button",text:"Cancel",onClick:d,className:"editable-option-btn",dataAttributes:{"data-index":s}}),e.jsx(f,{id:`editable-option-${s}-delete`,buttonType:"button",text:"Delete",onClick:m,className:"editable-option-btn",dataAttributes:{"data-index":s}})]})]}),ce=r.div`
|
|
129
135
|
display: flex;
|
|
130
136
|
justify-content: space-between;
|
|
131
137
|
max-width: 100%;
|
|
132
|
-
`,
|
|
133
|
-
font-size: ${
|
|
138
|
+
`,re=({id:n,hasSubmit:s,submitText:l,handleSubmit:o,hasReset:x,resetText:d,handleReset:m,hasCancel:c,cancelText:h,handleCancel:g})=>e.jsxs(ce,{className:"form-main-button-container",children:[s&&e.jsx(f,{id:`form-${n}-submit`,buttonType:"submit",text:l??"Submit",onClick:o,className:"submit-form-btn"}),x&&e.jsx(f,{id:`form-${n}-edit`,buttonType:"button",text:d??"Reset",onClick:m,className:"reset-form-btn"}),c&&e.jsx(f,{id:`form-${n}-cancel`,buttonType:"button",text:h??"Cancel",onClick:g,className:"cancel-form-btn"})]}),W=r.legend`
|
|
139
|
+
font-size: ${t.spacing.medium};
|
|
134
140
|
font-weight: 500;
|
|
135
|
-
margin-bottom: ${
|
|
141
|
+
margin-bottom: ${t.spacing.small};
|
|
136
142
|
width: auto;
|
|
137
143
|
text-align: center;
|
|
138
|
-
font-family: ${
|
|
139
|
-
`,
|
|
144
|
+
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
145
|
+
`,M=r.fieldset`
|
|
140
146
|
padding: 0;
|
|
141
147
|
height: auto;
|
|
142
148
|
width: 100%;
|
|
143
|
-
`,
|
|
144
|
-
padding: ${
|
|
149
|
+
`,U=r.div`
|
|
150
|
+
padding: ${t.spacing.small};
|
|
145
151
|
height: auto;
|
|
146
152
|
width: 100%;
|
|
147
|
-
`,
|
|
153
|
+
`,O=r.div`
|
|
148
154
|
display: flex;
|
|
149
155
|
justify-content: center;
|
|
150
156
|
align-items: center;
|
|
151
157
|
width: 100%;
|
|
152
158
|
height: auto;
|
|
153
|
-
font-family: ${
|
|
154
|
-
font-size: ${
|
|
155
|
-
font-weight: ${
|
|
156
|
-
`,
|
|
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`
|
|
157
163
|
display: flex;
|
|
158
164
|
flex-direction: column;
|
|
159
165
|
align-items: center;
|
|
160
166
|
width: 100%;
|
|
161
|
-
`,
|
|
167
|
+
`,H=r.div`
|
|
162
168
|
display: flex;
|
|
163
169
|
justify-content: space-between;
|
|
164
170
|
width: 100%;
|
|
165
|
-
`,
|
|
171
|
+
`,me=r.div`
|
|
166
172
|
width: 100%;
|
|
167
173
|
display: flex;
|
|
168
174
|
flex-direction: column;
|
|
169
175
|
align-items: center;
|
|
170
176
|
justify-content: center;
|
|
171
|
-
`,
|
|
177
|
+
`,xe=({fieldsets:n=null,legendText:s,isExpandable:l,id:o,formInputs:x,labelAndInputContainerClass:d,labelClass:m,inputClass:c,onChangeOfEditableOption:h,handleAddingInputEntry:g,hasSubmit:j=!1,submitText:$,handleSubmit:k,hasReset:C=!1,resetText:y,handleReset:N,hasCancel:E=!1,cancelText:v,handleCancel:D,handleSubmitForm:S,className:T,children:q})=>e.jsxs(de,{id:`${o}-form`,className:T,onSubmit:S,children:[n?n.map((a,u)=>e.jsxs(U,{className:`${o}-fieldset-wrapper`,children:[e.jsxs(M,{id:`${o}-form-fieldset-${u}`,className:`${a.legend}-fieldset`,children:[a.legend&&e.jsx(W,{className:`${a.legend}-legend`,children:a.legend}),a.inputs.length!==0?a.inputs.map((i,p)=>e.jsxs(F.Fragment,{children:[i.type==="textarea"&&e.jsx(w,{...i,id:i.id??`${a.legend}-input`,labelClass:m,inputClass:c,idx:p,className:`${d} ${i?.uniqueClass}`}),i.type!=="textarea"&&i.type!=="radio"&&i.type!=="checkbox"&&e.jsx(w,{...i,id:i.id??`${a.legend}-input`,labelClass:m,inputClass:c,idx:p,className:`${d} ${i?.uniqueClass}`}),(i.type==="radio"||i.type==="checkbox")&&e.jsxs(e.Fragment,{children:[e.jsx(w,{...i,id:i.id??`${a.legend}-input`,labelClass:m,inputClass:c,idx:p,className:`${d} ${i?.uniqueClass}`}),i.editing&&i.isEditable&&e.jsx(P,{legend:`${a.legend}`,idx:p,editableInformation:i?.editableInformation||[],onChangeOfEditableOption:h,onClickSaveEdit:i?.onClickSave||(z=>{}),onClickCancelEdit:i?.onClickCancel||(z=>{}),onClickDeleteEntry:i?.onClickDelete||(z=>{})})]})]},`form-${o}-${p}`)):a.isExpandable?e.jsx(O,{children:`No entry yet on ${a.legend}. Click "+" button to add entry.`}):""]}),a.isExpandable&&e.jsx(H,{className:"add-input-button-space",children:e.jsx(f,{id:`expand-${a.legend}-inputs`,buttonType:"button",text:"+",onClick:g,className:"add-input-entry"})})]},`${a.legend}-${u}`)):e.jsxs(U,{className:`${o}-fieldset-wrapper`,children:[e.jsxs(M,{id:`${o}-form-fieldset`,className:`${s}-fieldset`,children:[s&&e.jsx(W,{className:`${s}-legend`,children:s}),!n&&x&&x.length!==0?x.map((a,u)=>e.jsxs(F.Fragment,{children:[a.type==="textarea"&&e.jsx(w,{...a,id:a.id??`${s}-input`,labelClass:m,inputClass:c,idx:u,className:`${d} ${a?.uniqueClass}`}),a.type!=="textarea"&&a.type!=="radio"&&a.type!=="checkbox"&&e.jsx(w,{...a,id:a.id??`${s}-input`,labelClass:m,inputClass:c,idx:u,className:`${d} ${a?.uniqueClass}`}),(a.type==="radio"||a.type==="checkbox")&&e.jsxs(e.Fragment,{children:[e.jsx(w,{...a,id:a.id??`${s}-input`,labelClass:m,inputClass:c,idx:u,className:`${d} ${a?.uniqueClass}`}),a.editing&&a.isEditable&&e.jsx(P,{legend:`${s}`,idx:u,editableInformation:a?.editableInformation,onChangeOfEditableOption:h,onClickSaveEdit:a?.onClickSave||(i=>{}),onClickCancelEdit:a?.onClickCancel||(i=>{}),onClickDeleteEntry:a?.onClickDelete||(i=>{})})]})]},`form-${o}-${u}`)):l?e.jsx(O,{children:`No entry yet on ${s}. Please click "+" button to add`}):""]}),l&&e.jsx(H,{className:"add-input-button-space",children:e.jsx(f,{id:`expand-${s}-inputs`,buttonType:"button",text:"+",onClick:g,className:"add-input-entry"})})]}),e.jsx(re,{id:o,hasSubmit:j,submitText:$,handleSubmit:k,hasReset:C,resetText:y,handleReset:N,hasCancel:E,cancelText:v,handleCancel:D}),e.jsx(me,{className:"children-container",children:q})]}),be=n=>{const s=/^#([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*\)$/;return s.test(n)||l.test(n)||CSS.supports("color",n)},b=n=>{if(!be(n))throw new Error(`Invalid color: ${n}`);return n},he={mobile:"320px",tablet:"768px",desktop:"992px",largeDesktop:"1200px",largerDesktop:"1400px"},I={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")}},G={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")}},L=F.createContext({}),ue=({children:n,initialTheme:s=I,secondTheme:l=G})=>{const[o,x]=F.useState(s),d=()=>{x(m=>m===s?l:s)};return e.jsx(L.Provider,{value:{currentTheme:o,toggleTheme:d},children:e.jsx(r.ThemeProvider,{theme:o,children:n})})},ge=()=>F.useContext(L);exports.DynamicForm=xe;exports.ThemeContext=L;exports.ThemeContextProvider=ue;exports.breakpoints=he;exports.darkTheme=G;exports.lightTheme=I;exports.useTheme=ge;
|