@insticc/genericform 1.0.10 → 2.0.0
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/build/Demo.js +559 -0
- package/build/Demo2.js +495 -0
- package/build/FormFields/CustomAccordion.js +105 -0
- package/build/FormFields/CustomCheckbox.js +50 -72
- package/build/FormFields/CustomCheckboxGroup.js +87 -0
- package/build/FormFields/CustomComponent.js +42 -0
- package/build/FormFields/CustomDatePicker.js +61 -77
- package/build/FormFields/CustomDropdown.js +103 -26
- package/build/FormFields/CustomInput.js +60 -54
- package/build/FormFields/CustomJson.js +148 -0
- package/build/FormFields/CustomLabel.js +13 -18
- package/build/FormFields/CustomMultiDropdown.js +88 -0
- package/build/FormFields/CustomNumberInput.js +56 -52
- package/build/FormFields/CustomRadioGroup.js +91 -0
- package/build/FormFields/CustomSearch.js +66 -39
- package/build/FormFields/CustomSeparator.js +24 -0
- package/build/FormFields/CustomTextArea.js +62 -55
- package/build/FormFields/CustomToggle.js +73 -0
- package/build/FormFields/defaults.js +32 -0
- package/build/index.css +450 -12
- package/build/index.js +739 -385
- package/package.json +28 -14
- package/build/FormFields/CustomRadioButton.js +0 -56
- package/build/FormFields/MultipleCheckbox.js +0 -91
- package/build/FormFields/MultipleDropdown.js +0 -75
- package/build/FormFields/MultipleRadioButton.js +0 -89
- package/build/FormFields/YearDatePicker.js +0 -114
package/build/index.css
CHANGED
|
@@ -1,18 +1,456 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Merged CSS — Bootstrap Modal fixes + FormGeneric component styles
|
|
3
|
+
========================================================================== */
|
|
4
|
+
|
|
5
|
+
/* --------------------------------------------------------------------------
|
|
6
|
+
CSS Custom Properties
|
|
7
|
+
-------------------------------------------------------------------------- */
|
|
8
|
+
:root {
|
|
9
|
+
--ufg-primary: #1d4ed8;
|
|
10
|
+
--ufg-primary-dark: #1e40af;
|
|
11
|
+
--ufg-primary-darker: #1e3a8a;
|
|
12
|
+
--ufg-error: #dc2626;
|
|
13
|
+
--ufg-border: #cbd5e1;
|
|
14
|
+
--ufg-bg: #ffffff;
|
|
15
|
+
--ufg-surface: #fafafa;
|
|
16
|
+
--ufg-text: #111111;
|
|
17
|
+
--ufg-text-secondary: #6b7280;
|
|
18
|
+
--ufg-radius: 10px;
|
|
19
|
+
--ufg-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* --------------------------------------------------------------------------
|
|
23
|
+
Bootstrap Modal conflict fixes
|
|
24
|
+
These rules must come AFTER any third-party CSS imports
|
|
25
|
+
(Semantic UI, Tailwind, etc.) to prevent .fade overrides.
|
|
26
|
+
-------------------------------------------------------------------------- */
|
|
27
|
+
|
|
28
|
+
/* Fix: some CSS frameworks redefine .fade and keep opacity:0,
|
|
29
|
+
which makes the modal invisible while the backdrop still shows. */
|
|
30
|
+
.modal.fade.show {
|
|
31
|
+
opacity: 1 !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Fix: ensure the transition itself is preserved for smooth open/close */
|
|
35
|
+
.modal.fade {
|
|
36
|
+
transition: opacity 0.15s linear;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Fix: duplicated class names (modal-header modal-header, modal-title modal-title)
|
|
40
|
+
are harmless visually but indicate a component wrapper conflict —
|
|
41
|
+
these rules make sure layout is not broken regardless. */
|
|
42
|
+
.modal-header {
|
|
43
|
+
border-bottom: 1px solid #e5e7eb;
|
|
44
|
+
padding: 20px 32px;
|
|
7
45
|
}
|
|
8
46
|
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
47
|
+
.modal-title {
|
|
48
|
+
font-weight: bold;
|
|
49
|
+
font-size: 1.4rem;
|
|
50
|
+
color: #111827;
|
|
12
51
|
}
|
|
13
52
|
|
|
53
|
+
/* --------------------------------------------------------------------------
|
|
54
|
+
Container
|
|
55
|
+
-------------------------------------------------------------------------- */
|
|
56
|
+
.ufg-container {
|
|
57
|
+
width: 100%;
|
|
58
|
+
background: var(--ufg-bg);
|
|
59
|
+
border-radius: 14px;
|
|
60
|
+
padding: 32px;
|
|
61
|
+
box-shadow: var(--ufg-shadow);
|
|
62
|
+
border: 1px solid #d1d5db;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ufg-modal-body {
|
|
67
|
+
padding: 24px 32px;
|
|
68
|
+
background: var(--ufg-bg);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* --------------------------------------------------------------------------
|
|
72
|
+
Typography
|
|
73
|
+
-------------------------------------------------------------------------- */
|
|
74
|
+
.ufg-title {
|
|
75
|
+
font-size: 24px;
|
|
76
|
+
font-weight: 700;
|
|
77
|
+
color: var(--ufg-text);
|
|
78
|
+
margin-bottom: 24px;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: 12px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* --------------------------------------------------------------------------
|
|
85
|
+
Form layout
|
|
86
|
+
-------------------------------------------------------------------------- */
|
|
87
|
+
.ufg-form-columns {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: row;
|
|
90
|
+
gap: 2rem;
|
|
91
|
+
align-items: flex-start;
|
|
92
|
+
flex-wrap: wrap;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ufg-form {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
gap: 10px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ufg-field-group {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
gap: 6px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ufg-field-row {
|
|
108
|
+
display: grid;
|
|
109
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
110
|
+
gap: 16px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* --------------------------------------------------------------------------
|
|
114
|
+
Labels
|
|
115
|
+
-------------------------------------------------------------------------- */
|
|
116
|
+
.ufg-label {
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
color: #1f2937;
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
gap: 6px;
|
|
123
|
+
margin: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ufg-required {
|
|
127
|
+
color: var(--ufg-error);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* --------------------------------------------------------------------------
|
|
131
|
+
Inputs, Textareas, Selects
|
|
132
|
+
-------------------------------------------------------------------------- */
|
|
133
|
+
.ufg-input,
|
|
134
|
+
.ufg-textarea,
|
|
135
|
+
.ufg-select {
|
|
136
|
+
width: 100%;
|
|
137
|
+
border: 2px solid var(--ufg-border);
|
|
138
|
+
border-radius: var(--ufg-radius);
|
|
139
|
+
padding: 12px 14px;
|
|
140
|
+
font-size: 15px;
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
outline: none;
|
|
143
|
+
color: var(--ufg-text);
|
|
144
|
+
background: var(--ufg-surface);
|
|
145
|
+
transition: all 0.12s ease;
|
|
146
|
+
font-family: inherit;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.ufg-input:hover,
|
|
150
|
+
.ufg-textarea:hover,
|
|
151
|
+
.ufg-select:hover {
|
|
152
|
+
background: #f3f4f6;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ufg-input:focus,
|
|
156
|
+
.ufg-textarea:focus,
|
|
157
|
+
.ufg-select:focus {
|
|
158
|
+
border-color: var(--ufg-primary);
|
|
159
|
+
background: var(--ufg-bg);
|
|
160
|
+
box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.25);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ufg-input:disabled,
|
|
164
|
+
.ufg-textarea:disabled,
|
|
165
|
+
.ufg-select:disabled {
|
|
166
|
+
background: #f3f4f6;
|
|
167
|
+
color: var(--ufg-text-secondary);
|
|
168
|
+
cursor: not-allowed;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.ufg-input.error,
|
|
172
|
+
.ufg-textarea.error,
|
|
173
|
+
.ufg-select.error {
|
|
174
|
+
border-color: var(--ufg-error);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.ufg-select[multiple] {
|
|
178
|
+
min-height: 120px;
|
|
179
|
+
padding: 10px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.ufg-select option {
|
|
183
|
+
padding: 6px 8px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* --------------------------------------------------------------------------
|
|
187
|
+
Textarea
|
|
188
|
+
-------------------------------------------------------------------------- */
|
|
189
|
+
.ufg-textarea {
|
|
190
|
+
min-height: 100px;
|
|
191
|
+
resize: vertical;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* --------------------------------------------------------------------------
|
|
195
|
+
Error & Helper text
|
|
196
|
+
-------------------------------------------------------------------------- */
|
|
197
|
+
.ufg-error-message {
|
|
198
|
+
color: var(--ufg-error);
|
|
199
|
+
font-size: 12px;
|
|
200
|
+
margin-top: 4px;
|
|
201
|
+
font-weight: 500;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.ufg-tooltip {
|
|
205
|
+
font-size: 12px;
|
|
206
|
+
color: var(--ufg-text-secondary);
|
|
207
|
+
font-style: italic;
|
|
208
|
+
margin-top: 4px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ufg-help-icon {
|
|
212
|
+
cursor: help;
|
|
213
|
+
color: var(--ufg-text-secondary);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.ufg-date-input {
|
|
217
|
+
position: relative;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* --------------------------------------------------------------------------
|
|
221
|
+
Checkboxes & Radios
|
|
222
|
+
-------------------------------------------------------------------------- */
|
|
223
|
+
.ufg-checkbox-group,
|
|
224
|
+
.ufg-radio-group {
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-direction: column;
|
|
227
|
+
gap: 10px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.ufg-radio-group-inline {
|
|
231
|
+
display: flex;
|
|
232
|
+
flex-direction: row;
|
|
233
|
+
margin: 0;
|
|
234
|
+
gap: 20px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.ufg-checkbox-item,
|
|
238
|
+
.ufg-radio-item {
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
gap: 8px;
|
|
242
|
+
margin: 0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.ufg-checkbox-item input,
|
|
246
|
+
.ufg-radio-item input {
|
|
247
|
+
width: 18px;
|
|
248
|
+
height: 18px;
|
|
249
|
+
cursor: pointer;
|
|
250
|
+
margin: 0;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.ufg-checkbox-item label,
|
|
254
|
+
.ufg-radio-item label {
|
|
255
|
+
font-size: 14px;
|
|
256
|
+
font-weight: 400;
|
|
257
|
+
cursor: pointer;
|
|
258
|
+
margin: 0;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* --------------------------------------------------------------------------
|
|
262
|
+
Toggle
|
|
263
|
+
-------------------------------------------------------------------------- */
|
|
264
|
+
.ufg-toggle-wrapper {
|
|
265
|
+
display: flex;
|
|
266
|
+
align-items: center;
|
|
267
|
+
justify-content: space-between;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.ufg-toggle-track {
|
|
271
|
+
width: 44px;
|
|
272
|
+
height: 24px;
|
|
273
|
+
border-radius: 12px;
|
|
274
|
+
background: #ccc;
|
|
275
|
+
cursor: pointer;
|
|
276
|
+
position: relative;
|
|
277
|
+
transition: background 0.2s;
|
|
278
|
+
flex-shrink: 0;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.ufg-toggle-track.active {
|
|
282
|
+
background: #4f46e5;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.ufg-toggle-track.disabled {
|
|
286
|
+
opacity: 0.4;
|
|
287
|
+
cursor: not-allowed;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.ufg-toggle-thumb {
|
|
291
|
+
width: 18px;
|
|
292
|
+
height: 18px;
|
|
293
|
+
border-radius: 50%;
|
|
294
|
+
background: white;
|
|
295
|
+
position: absolute;
|
|
296
|
+
top: 3px;
|
|
297
|
+
left: 3px;
|
|
298
|
+
transition: transform 0.2s;
|
|
299
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.ufg-toggle-track.active .ufg-toggle-thumb {
|
|
303
|
+
transform: translateX(20px);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* --------------------------------------------------------------------------
|
|
307
|
+
Actions & Buttons
|
|
308
|
+
-------------------------------------------------------------------------- */
|
|
309
|
+
.ufg-actions {
|
|
310
|
+
display: flex;
|
|
311
|
+
flex-direction: row;
|
|
312
|
+
align-items: center;
|
|
313
|
+
justify-content: center;
|
|
314
|
+
gap: 2rem;
|
|
315
|
+
margin-top: 24px;
|
|
316
|
+
flex-wrap: wrap;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.ufg-button {
|
|
320
|
+
padding: 12px 24px;
|
|
321
|
+
border-radius: var(--ufg-radius);
|
|
322
|
+
font-weight: 600;
|
|
323
|
+
font-size: 15px;
|
|
324
|
+
cursor: pointer;
|
|
325
|
+
border: 2px solid transparent;
|
|
326
|
+
transition: all 0.12s ease;
|
|
327
|
+
display: flex;
|
|
328
|
+
align-items: center;
|
|
329
|
+
gap: 8px;
|
|
330
|
+
min-width: 120px;
|
|
331
|
+
justify-content: center;
|
|
332
|
+
background: none;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.ufg-button-primary {
|
|
336
|
+
background: var(--ufg-primary);
|
|
337
|
+
border-color: var(--ufg-primary-dark);
|
|
338
|
+
color: #ffffff;
|
|
339
|
+
box-shadow: 0 6px 20px rgba(29, 78, 216, 0.25);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.ufg-button-primary:hover:not(:disabled) {
|
|
343
|
+
background: var(--ufg-primary-dark);
|
|
344
|
+
border-color: var(--ufg-primary-darker);
|
|
345
|
+
transform: translateY(-1px);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.ufg-button-secondary {
|
|
349
|
+
background: #e5e7eb;
|
|
350
|
+
color: var(--ufg-text);
|
|
351
|
+
border-color: #9ca3af;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.ufg-button-secondary:hover:not(:disabled) {
|
|
355
|
+
background: #d1d5db;
|
|
356
|
+
border-color: #6b7280;
|
|
357
|
+
transform: translateY(-1px);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.ufg-button:disabled {
|
|
361
|
+
background: #94a3b8;
|
|
362
|
+
border-color: #94a3b8;
|
|
363
|
+
color: #e2e8f0;
|
|
364
|
+
cursor: not-allowed;
|
|
365
|
+
opacity: 0.7;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* --------------------------------------------------------------------------
|
|
369
|
+
Separator
|
|
370
|
+
-------------------------------------------------------------------------- */
|
|
371
|
+
.ufg-separator {
|
|
372
|
+
border: 0;
|
|
373
|
+
border-top: 2px solid #e5e7eb;
|
|
374
|
+
margin: 10px 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* --------------------------------------------------------------------------
|
|
378
|
+
Accordion
|
|
379
|
+
-------------------------------------------------------------------------- */
|
|
380
|
+
|
|
381
|
+
.ef-accordion {
|
|
382
|
+
border: none !important;
|
|
383
|
+
box-shadow: none !important;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.ef-accordion .title {
|
|
387
|
+
font-weight: 600;
|
|
388
|
+
font-size: 15px;
|
|
389
|
+
padding: 14px 18px !important;
|
|
390
|
+
background: #f8f9fa;
|
|
391
|
+
border-radius: 10px;
|
|
392
|
+
margin-bottom: 6px;
|
|
393
|
+
transition: background 0.15s ease;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.ef-accordion .title:hover {
|
|
397
|
+
background: #e5e7eb;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.ef-accordion .title.active {
|
|
401
|
+
background: #1d4ed8;
|
|
402
|
+
color: white;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.ef-accordion .title .icon {
|
|
406
|
+
margin-right: 10px;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.ef-accordion .content {
|
|
410
|
+
padding: 16px 18px !important;
|
|
411
|
+
border-radius: 10px;
|
|
412
|
+
background: #fafafa;
|
|
413
|
+
margin-bottom: 10px;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.ef-accordion-content {
|
|
417
|
+
display: flex;
|
|
418
|
+
flex-direction: column;
|
|
419
|
+
gap: 8px;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.ef-info-row {
|
|
423
|
+
display: flex;
|
|
424
|
+
justify-content: space-between;
|
|
425
|
+
gap: 12px;
|
|
426
|
+
font-size: 14px;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.ef-info-row strong {
|
|
430
|
+
color: #374151;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.ef-info-row span {
|
|
434
|
+
color: #111827;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
/* --------------------------------------------------------------------------
|
|
439
|
+
Misc wrappers
|
|
440
|
+
-------------------------------------------------------------------------- */
|
|
441
|
+
.ufg-component-wrapper {
|
|
442
|
+
margin: 10px 0;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/* --------------------------------------------------------------------------
|
|
446
|
+
Responsive
|
|
447
|
+
-------------------------------------------------------------------------- */
|
|
14
448
|
@media (max-width: 768px) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
449
|
+
.ufg-container {
|
|
450
|
+
padding: 20px 10px;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.ufg-field-row {
|
|
454
|
+
grid-template-columns: 1fr;
|
|
455
|
+
}
|
|
18
456
|
}
|