@kbgarcia8/react-dynamic-form 1.1.4 → 1.1.27
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/molecules/NestedEditableOption/NestedEditableOption.d.ts +1 -1
- package/dist/components/molecules/NestedEditableOption/NestedEditableOption.d.ts.map +1 -1
- package/dist/components/organisms/DynamicForm/DynamicForm.d.ts +1 -1
- package/dist/components/organisms/DynamicForm/DynamicForm.d.ts.map +1 -1
- package/dist/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 +70 -64
- package/dist/react-dynamic-form.es.js +416 -409
- package/dist/styles/styled.d.ts +7 -0
- package/dist/styles/styled.d.ts.map +1 -0
- package/dist/type/propTypes.d.ts +43 -32
- 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"),c=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=c.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: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
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=c.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=c.img`
|
|
34
34
|
maxwidth: 100%;
|
|
35
|
-
`,
|
|
36
|
-
font-size: ${
|
|
37
|
-
font-weight: ${
|
|
38
|
-
font-family: ${
|
|
35
|
+
`,V=c.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:a,id:l,buttonType:s,source:o,svg:m,alt:r="alt-button-icon",text:d="",className:b="",dataAttributes:h={}})=>e.jsx(J,{onClick:a,id:l,type:s,className:b,...h,children:e.jsxs(K,{className:"button-icon-text-space",children:[o?e.jsx(Q,{src:o,alt:r}):m||"",d&&e.jsx(V,{id:l,children:d})]})}),X=c.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=c.div`
|
|
49
49
|
display: flex;
|
|
50
|
-
gap: ${
|
|
50
|
+
gap: ${t.spacing.xsmall};
|
|
51
51
|
width: auto;
|
|
52
52
|
height: auto;
|
|
53
|
-
`,
|
|
53
|
+
`,Z=c.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: ${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};
|
|
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
|
+
`,_=c.div`
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
gap: ${t.spacing.xxxsmall};
|
|
76
|
+
`,ee=c.span`
|
|
77
|
+
font-weight: ${t.fontWeight.bolder};
|
|
78
|
+
`,te=c.div`
|
|
73
79
|
max-width: 100%;
|
|
74
80
|
display: flex;
|
|
75
81
|
align-items: center;
|
|
76
82
|
`,ae=c.span`
|
|
77
|
-
font-weight: ${
|
|
78
|
-
`,
|
|
83
|
+
font-weight: ${t.fontWeight.light};
|
|
84
|
+
`,R=({htmlFor:a,textLabel:l,additionalInfo:s,$labelFlexDirection:o,source:m,svg:r,className:d,children:b})=>e.jsxs(Z,{htmlFor:a,className:d,$labelFlexDirection:o,children:[(m||r)&&e.jsx(te,{className:"label-icon-container",children:m?e.jsx("img",{src:m,alt:`${a}-label-icon`}):r||""}),e.jsxs(_,{className:"label-text-container",children:[e.jsx(ee,{className:"main-label",children:l}),s&&e.jsx(ae,{className:"additional-info",children:s})]}),b]}),B=c.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:a})=>a.colors.teal};
|
|
94
100
|
}
|
|
95
|
-
`,
|
|
101
|
+
`,ne=c.textarea`
|
|
96
102
|
display: flex;
|
|
97
103
|
place-content: center;
|
|
98
|
-
border: ${
|
|
99
|
-
border-radius: ${
|
|
104
|
+
border: ${t.borderThickness.light} solid ${({theme:a})=>a.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((a,l)=>{const{type:s,id:o,onChange:m,isRequired:r,dataAttributes:d,disabled:b,className:h}=a;if(s==="textarea"){const{rows:y=5,cols:N=30,value:E,...v}=a;return e.jsx(ne,{id:o,onChange:m,value:E,rows:y,cols:N,...d,className:h,ref:l,disabled:b,required:r})}if(s==="radio"||s==="checkbox"){const{checked:y,...N}=a;return e.jsx(B,{ref:l,type:"checkbox",id:o,checked:y,onChange:m,disabled:b,className:h,...d})}const u=a,{value:j,pattern:$,placeholderText:k,...C}=u;return e.jsx(B,{id:o,name:o,placeholder:k,onChange:m,value:j,type:s,required:r,...d,className:h,ref:l,disabled:b,pattern:$})}),w=a=>{const{className:l,type:s,id:o,textLabel:m,additionalInfo:r,$labelFlexDirection:d,svg:b,labelClass:h,onChange:u,isRequired:j,dataAttributes:$,inputClass:k,ref:C,disabled:y,isEditable:N,editIcon:E,onClickEdit:v,deleteIcon:D,onClickDelete:S,idx:T,children:q}=a;return e.jsxs(X,{className:`${l} ${o.replace("#","")}-label-input-container`,children:[s!=="radio"&&s!=="checkbox"&&e.jsx(R,{htmlFor:o,textLabel:m,additionalInfo:r,$labelFlexDirection:d,svg:b,className:h}),s!=="radio"&&s!=="checkbox"&&s==="textarea"&&(()=>{const{rows:n=5,cols:g=30,value:i,...p}=a;return e.jsx(A,{id:o,name:o,type:"textarea",isRequired:j,onChange:u,value:i,rows:n,cols:g,dataAttributes:$,className:k,ref:C,disabled:y})})(),s!=="radio"&&s!=="checkbox"&&s!=="textarea"&&(()=>{const n=a,{value:g,pattern:i,placeholderText:p,...z}=n;return e.jsx(A,{id:o,name:o,placeholderText:p,onChange:u,value:g,type:s,isRequired:j,dataAttributes:$,className:k,ref:C,disabled:y,pattern:i})})(),(s==="radio"||s==="checkbox")&&(()=>{const{checked:n,...g}=a;return e.jsxs(e.Fragment,{children:[e.jsx(A,{ref:C,type:"checkbox",name:o,id:o,isRequired:j,checked:n,onChange:u,disabled:y,className:k,dataAttributes:$}),e.jsx(R,{htmlFor:o,textLabel:m,additionalInfo:r,$labelFlexDirection:d,svg:b,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=c.fieldset`
|
|
109
115
|
padding: 0;
|
|
110
116
|
height: auto;
|
|
111
117
|
width: 100%;
|
|
112
|
-
`,
|
|
113
|
-
font-size: ${
|
|
118
|
+
`,oe=c.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: ${
|
|
123
|
+
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
118
124
|
`,le=c.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=c.div`
|
|
125
131
|
display: flex;
|
|
126
132
|
justify-content: space-between;
|
|
127
133
|
width: 100%;
|
|
128
|
-
`,
|
|
134
|
+
`,P=({legend:a,fieldsetIndex:l=null,idx:s,editableInformation:o,onChangeOfEditableOption:m,onClickSaveEdit:r,onClickCancelEdit:d,onClickDeleteEntry:b})=>e.jsxs(se,{className:"editable-option-fieldset",children:[e.jsx(oe,{children:`${a} ${s+1}`}),o?.map((h,u)=>e.jsx(le,{className:"editable-option-container",children:e.jsx(A,{id:`editable-option-${u}`,name:`editable-option-${u}`,placeholderText:h.name.charAt(0).toUpperCase()+h.name.slice(1),onChange:m,value:h.info,type:h.type,isRequired:!0,className:"editable-option",dataAttributes:{"data-index":u,"data-key":h.info}})},`${h.name}-${u}`)),e.jsxs(ie,{className:"editable-option-button-space",children:[e.jsx(f,{id:`editable-option-${s}-submit`,buttonType:"button",text:"Save",onClick:r,className:"editable-option-btn",dataAttributes:{"data-index":s,"data-fieldsetIndex":l}}),e.jsx(f,{id:`editable-option-${s}-cancel`,buttonType:"button",text:"Cancel",onClick:d,className:"editable-option-btn",dataAttributes:{"data-index":s,"data-fieldsetIndex":l}}),e.jsx(f,{id:`editable-option-${s}-delete`,buttonType:"button",text:"Delete",onClick:b,className:"editable-option-btn",dataAttributes:{"data-index":s,"data-fieldsetIndex":l}})]})]}),ce=c.div`
|
|
129
135
|
display: flex;
|
|
130
136
|
justify-content: space-between;
|
|
131
137
|
max-width: 100%;
|
|
132
|
-
`,
|
|
133
|
-
font-size: ${
|
|
138
|
+
`,re=({id:a,hasSubmit:l,submitText:s,handleSubmit:o,hasReset:m,resetText:r,handleReset:d,hasCancel:b,cancelText:h,handleCancel:u})=>e.jsxs(ce,{className:"form-main-button-container",children:[l&&e.jsx(f,{id:`form-${a}-submit`,buttonType:"submit",text:s??"Submit",onClick:o,className:"submit-form-btn"}),m&&e.jsx(f,{id:`form-${a}-edit`,buttonType:"button",text:r??"Reset",onClick:d,className:"reset-form-btn"}),b&&e.jsx(f,{id:`form-${a}-cancel`,buttonType:"button",text:h??"Cancel",onClick:u,className:"cancel-form-btn"})]}),W=c.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=c.fieldset`
|
|
140
146
|
padding: 0;
|
|
141
147
|
height: auto;
|
|
142
148
|
width: 100%;
|
|
143
|
-
`,
|
|
144
|
-
padding: ${
|
|
149
|
+
`,U=c.div`
|
|
150
|
+
padding: ${t.spacing.small};
|
|
145
151
|
height: auto;
|
|
146
152
|
width: 100%;
|
|
147
|
-
`,
|
|
153
|
+
`,O=c.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=c.form`
|
|
157
163
|
display: flex;
|
|
158
164
|
flex-direction: column;
|
|
159
165
|
align-items: center;
|
|
160
166
|
width: 100%;
|
|
161
|
-
`,
|
|
167
|
+
`,H=c.div`
|
|
162
168
|
display: flex;
|
|
163
169
|
justify-content: space-between;
|
|
164
170
|
width: 100%;
|
|
165
|
-
`,
|
|
171
|
+
`,me=c.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:a=null,legendText:l,isExpandable:s,id:o,formInputs:m,labelAndInputContainerClass:r,labelClass:d,inputClass:b,onChangeOfEditableOption:h,handleAddingInputEntry:u,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:[a?a.map((n,g)=>e.jsxs(U,{className:`${o}-fieldset-wrapper`,children:[e.jsxs(M,{id:`${o}-form-fieldset-${g}`,className:`${n.legend}-fieldset`,children:[n.legend&&e.jsx(W,{className:`${n.legend}-legend`,children:n.legend}),n.inputs.length!==0?n.inputs.map((i,p)=>e.jsxs(F.Fragment,{children:[i.type==="textarea"&&e.jsx(w,{...i,id:i.id??`${n.legend}-input`,labelClass:d,inputClass:b,idx:p,className:`${r} ${i?.uniqueClass}`}),i.type!=="textarea"&&i.type!=="radio"&&i.type!=="checkbox"&&e.jsx(w,{...i,id:i.id??`${n.legend}-input`,labelClass:d,inputClass:b,idx:p,className:`${r} ${i?.uniqueClass}`}),(i.type==="radio"||i.type==="checkbox")&&e.jsxs(e.Fragment,{children:[e.jsx(w,{...i,id:i.id??`${n.legend}-input`,labelClass:d,inputClass:b,idx:p,className:`${r} ${i?.uniqueClass}`}),i.editing&&i.isEditable&&e.jsx(P,{legend:`${n.legend}`,fieldsetIndex:g,idx:p,editableInformation:i?.editableInformation||[],onChangeOfEditableOption:h,onClickSaveEdit:i?.onClickSave||(z=>{}),onClickCancelEdit:i?.onClickCancel||(z=>{}),onClickDeleteEntry:i?.onClickDelete||(z=>{})})]})]},`form-${o}-${p}`)):n.isExpandable?e.jsx(O,{children:`No entry yet on ${n.legend}. Click "+" button to add entry.`}):""]}),n.isExpandable&&e.jsx(H,{className:"add-input-button-space",children:e.jsx(f,{id:`expand-${n.legend}-inputs`,buttonType:"button",text:"+",onClick:u,className:"add-input-entry",dataAttributes:{"data-fieldsetidx":g}})})]},`${n.legend}-${g}`)):e.jsxs(U,{className:`${o}-fieldset-wrapper`,children:[e.jsxs(M,{id:`${o}-form-fieldset`,className:`${l}-fieldset`,children:[l&&e.jsx(W,{className:`${l}-legend`,children:l}),!a&&m&&m.length!==0?m.map((n,g)=>e.jsxs(F.Fragment,{children:[n.type==="textarea"&&e.jsx(w,{...n,id:n.id??`${l}-input`,labelClass:d,inputClass:b,idx:g,className:`${r} ${n?.uniqueClass}`}),n.type!=="textarea"&&n.type!=="radio"&&n.type!=="checkbox"&&e.jsx(w,{...n,id:n.id??`${l}-input`,labelClass:d,inputClass:b,idx:g,className:`${r} ${n?.uniqueClass}`}),(n.type==="radio"||n.type==="checkbox")&&e.jsxs(e.Fragment,{children:[e.jsx(w,{...n,id:n.id??`${l}-input`,labelClass:d,inputClass:b,idx:g,className:`${r} ${n?.uniqueClass}`}),n.editing&&n.isEditable&&e.jsx(P,{legend:`${l}`,idx:g,editableInformation:n?.editableInformation,onChangeOfEditableOption:h,onClickSaveEdit:n?.onClickSave||(i=>{}),onClickCancelEdit:n?.onClickCancel||(i=>{}),onClickDeleteEntry:n?.onClickDelete||(i=>{})})]})]},`form-${o}-${g}`)):s?e.jsx(O,{children:`No entry yet on ${l}. Please click "+" button to add`}):""]}),s&&e.jsx(H,{className:"add-input-button-space",children:e.jsx(f,{id:`expand-${l}-inputs`,buttonType:"button",text:"+",onClick:u,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=a=>{const l=/^#([0-9A-Fa-f]{3}){1,2}$/,s=/^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(a)||s.test(a)||CSS.supports("color",a)},x=a=>{if(!be(a))throw new Error(`Invalid color: ${a}`);return a},he={mobile:"320px",tablet:"768px",desktop:"992px",largeDesktop:"1200px",largerDesktop:"1400px"},I={name:"light",colors:{text:x("#333446"),bg:x("#EEEEEE"),blue:x("#7F8CAA"),blue2:x("#80A6FF"),teal:x("#5b8280ff"),teal2:x("#AEEAE7"),gray:x("#AEAEAE"),information:x("#202234"),success:x("#123524"),warning:x("#F2C265"),error:x("#990000")}},G={name:"dark",colors:{bg:x("#333446"),text:x("#EEEEEE"),blue:x("#80A6FF"),blue2:x("#7F8CAA"),teal:x("#AEEAE7"),teal2:x("#5b8280ff"),gray:x("#D0D0DD"),information:x("#C9E6F0"),success:x("#9EDF9C"),warning:x("#FCFFC1"),error:x("#FAD4D4")}},L=F.createContext({}),ue=({children:a,initialTheme:l=I,secondTheme:s=G})=>{const[o,m]=F.useState(l),r=()=>{m(d=>d===l?s:l)};return e.jsx(L.Provider,{value:{currentTheme:o,toggleTheme:r},children:e.jsx(c.ThemeProvider,{theme:o,children:a})})},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;
|