formhell 0.1.5

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.
@@ -0,0 +1,599 @@
1
+ .raf-schema-form {
2
+ --raf-color-border: #d9dce1;
3
+ --raf-color-border-focus: #1976d2;
4
+ --raf-color-label: #2a3340;
5
+ --raf-color-muted: #6c7684;
6
+ --raf-color-surface: #ffffff;
7
+ --raf-color-surface-alt: #f8f9fb;
8
+ --raf-color-danger: #b42318;
9
+ --raf-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.08);
10
+ --raf-shadow-md: 0 8px 20px rgba(16, 24, 40, 0.08);
11
+ color: #101828;
12
+ font-family: "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
13
+ }
14
+
15
+ .raf-field {
16
+ display: block;
17
+ margin-bottom: 0.875rem;
18
+ }
19
+
20
+ .raf-field-label-row {
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: space-between;
24
+ margin-bottom: 0.375rem;
25
+ }
26
+
27
+ .raf-field-summary {
28
+ color: var(--raf-color-muted);
29
+ font-size: 0.75rem;
30
+ line-height: 1.35;
31
+ margin: -0.125rem 0 0.375rem;
32
+ }
33
+
34
+ .raf-field-label {
35
+ color: var(--raf-color-label);
36
+ font-size: 0.92rem;
37
+ font-weight: 600;
38
+ }
39
+
40
+ .raf-field-required {
41
+ color: var(--raf-color-danger);
42
+ margin-left: 0.1875rem;
43
+ }
44
+
45
+ .raf-field-optional {
46
+ color: var(--raf-color-muted);
47
+ font-size: 0.74rem;
48
+ }
49
+
50
+ .raf-input,
51
+ .raf-select {
52
+ width: 100%;
53
+ box-sizing: border-box;
54
+ border: 0.0625rem solid var(--raf-color-border);
55
+ background: var(--raf-color-surface);
56
+ border-radius: 0.625rem;
57
+ font-size: 0.95rem;
58
+ padding: 0.625rem 0.75rem;
59
+ color: #101828;
60
+ transition: border-color 120ms ease, box-shadow 120ms ease;
61
+ box-shadow: var(--raf-shadow-sm);
62
+ }
63
+
64
+ .raf-input:focus,
65
+ .raf-select:focus {
66
+ border-color: var(--raf-color-border-focus);
67
+ outline: none;
68
+ box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
69
+ }
70
+
71
+ .raf-input:disabled,
72
+ .raf-select:disabled,
73
+ .raf-textarea:disabled {
74
+ background: #eef2f6;
75
+ border-color: #c7ced8;
76
+ color: #667085;
77
+ cursor: not-allowed;
78
+ box-shadow: none;
79
+ }
80
+
81
+ .raf-input:disabled::placeholder,
82
+ .raf-textarea:disabled::placeholder {
83
+ color: #98a2b3;
84
+ }
85
+
86
+ .raf-checkbox-row {
87
+ display: flex;
88
+ align-items: center;
89
+ gap: 0.5rem;
90
+ min-height: 2.375rem;
91
+ }
92
+
93
+ .raf-checkbox {
94
+ width: 1rem;
95
+ height: 1rem;
96
+ }
97
+
98
+ .raf-checkbox:disabled {
99
+ cursor: not-allowed;
100
+ accent-color: #98a2b3;
101
+ }
102
+
103
+ .raf-checkbox:disabled + span {
104
+ color: #98a2b3;
105
+ }
106
+
107
+ .raf-object {
108
+ border: 0.0625rem solid var(--raf-color-border);
109
+ border-radius: 0.75rem;
110
+ background: var(--raf-color-surface-alt);
111
+ margin-bottom: 0.875rem;
112
+ overflow: hidden;
113
+ }
114
+
115
+ .raf-object-summary {
116
+ cursor: pointer;
117
+ padding: 0.625rem 0.75rem;
118
+ font-weight: 600;
119
+ color: var(--raf-color-label);
120
+ user-select: none;
121
+ }
122
+
123
+ .raf-object-content {
124
+ padding: 0.625rem 0.75rem 0.125rem 0.75rem;
125
+ }
126
+
127
+ .raf-array-item {
128
+ border: 0.0625rem solid var(--raf-color-border);
129
+ border-radius: 0.625rem;
130
+ background: var(--raf-color-surface);
131
+ box-shadow: var(--raf-shadow-sm);
132
+ padding: 0.625rem;
133
+ margin-bottom: 0.625rem;
134
+ }
135
+
136
+ .raf-button {
137
+ border: 0;
138
+ border-radius: 0.5rem;
139
+ padding: 0.4375rem 0.75rem;
140
+ cursor: pointer;
141
+ font-size: 0.86rem;
142
+ font-weight: 600;
143
+ }
144
+
145
+ .raf-button:disabled {
146
+ opacity: 0.55;
147
+ cursor: not-allowed;
148
+ filter: grayscale(15%);
149
+ }
150
+
151
+ .raf-button-primary {
152
+ background: #1976d2;
153
+ color: #ffffff;
154
+ }
155
+
156
+ .raf-button-secondary {
157
+ background: #eef2f6;
158
+ color: #1d2939;
159
+ border: 0.0625rem solid #cfd7e3;
160
+ }
161
+
162
+ .raf-button-danger {
163
+ background: #fee4e2;
164
+ color: #b42318;
165
+ border: 0.0625rem solid #f3b8b2;
166
+ }
167
+
168
+ .raf-button-row {
169
+ display: flex;
170
+ align-items: center;
171
+ gap: 0.5rem;
172
+ }
173
+
174
+ .raf-type-list-row + .raf-type-list-row {
175
+ margin-top: 0.25rem;
176
+ }
177
+
178
+ .raf-type-list-add-row {
179
+ margin-top: 0.5rem;
180
+ }
181
+
182
+ .raf-info-button {
183
+ border: 0.0625rem solid #cfd7e3;
184
+ background: #ffffff;
185
+ color: #344054;
186
+ border-radius: 62.4375rem;
187
+ width: 1.375rem;
188
+ height: 1.375rem;
189
+ display: inline-flex;
190
+ align-items: center;
191
+ justify-content: center;
192
+ padding: 0;
193
+ cursor: pointer;
194
+ box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
195
+ }
196
+
197
+ .raf-info-button:hover {
198
+ background: #f8fafc;
199
+ }
200
+
201
+ .raf-info-button:focus {
202
+ outline: none;
203
+ border-color: var(--raf-color-border-focus);
204
+ box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
205
+ }
206
+
207
+ .raf-info-icon {
208
+ font-size: 0.72rem;
209
+ font-weight: 700;
210
+ line-height: 1;
211
+ }
212
+
213
+ .raf-sr-only {
214
+ position: absolute;
215
+ width: 0.0625rem;
216
+ height: 0.0625rem;
217
+ margin: -0.0625rem;
218
+ padding: 0;
219
+ border: 0;
220
+ clip: rect(0, 0, 0, 0);
221
+ overflow: hidden;
222
+ }
223
+
224
+ .raf-button-row[aria-label$="type chooser"] {
225
+ flex-wrap: wrap;
226
+ gap: 0.375rem;
227
+ margin: 0.125rem 0 0.5rem;
228
+ }
229
+
230
+ .raf-button-row[aria-label$="type chooser"] .raf-button {
231
+ padding: 0.375rem 0.625rem;
232
+ border: 0.0625rem solid #d0d5dd;
233
+ background: #f8fafc;
234
+ color: #344054;
235
+ box-shadow: none;
236
+ }
237
+
238
+ .raf-button-row[aria-label$="type chooser"] .raf-button[aria-pressed="true"] {
239
+ background: #e8f1fb;
240
+ border-color: #98b8e8;
241
+ color: #1849a9;
242
+ }
243
+
244
+ .raf-muted {
245
+ color: var(--raf-color-muted);
246
+ font-size: 0.85rem;
247
+ }
248
+
249
+ .raf-loading-state {
250
+ display: inline-flex;
251
+ align-items: center;
252
+ gap: 0.5rem;
253
+ color: var(--raf-color-muted);
254
+ font-size: 0.88rem;
255
+ font-weight: 500;
256
+ }
257
+
258
+ .raf-loading-spinner {
259
+ width: 0.9rem;
260
+ height: 0.9rem;
261
+ border: 0.125rem solid #cbd5e1;
262
+ border-top-color: #0f172a;
263
+ border-radius: 50%;
264
+ animation: raf-spin 0.8s linear infinite;
265
+ }
266
+
267
+ @keyframes raf-spin {
268
+ to {
269
+ transform: rotate(360deg);
270
+ }
271
+ }
272
+
273
+ .raf-schema-builder {
274
+ color: #101828;
275
+ font-family: "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
276
+ }
277
+
278
+ .raf-schema-builder .raf-object {
279
+ overflow: visible;
280
+ }
281
+
282
+ .raf-schema-builder .raf-object-content {
283
+ overflow: visible;
284
+ }
285
+
286
+ .raf-builder-grid {
287
+ display: grid;
288
+ grid-template-columns: repeat(2, minmax(0, 1fr));
289
+ gap: 0.625rem;
290
+ }
291
+
292
+ .raf-builder-block {
293
+ border: 0.0625rem dashed #ccd3dd;
294
+ border-radius: 0.625rem;
295
+ padding: 0.625rem;
296
+ margin-bottom: 0.75rem;
297
+ background: #fcfdff;
298
+ }
299
+
300
+ .raf-builder-heading {
301
+ margin: 0 0 0.5rem;
302
+ color: #344054;
303
+ font-size: 0.92rem;
304
+ }
305
+
306
+ .raf-field-label-row .raf-builder-heading {
307
+ margin: 0;
308
+ }
309
+
310
+ .raf-builder-heading-wrap {
311
+ margin-bottom: 0.5rem;
312
+ }
313
+
314
+ .raf-builder-heading-wrap .raf-field {
315
+ margin-bottom: 0;
316
+ }
317
+
318
+ .raf-builder-heading-wrap .raf-field-summary {
319
+ margin-bottom: 0;
320
+ }
321
+
322
+ .raf-builder-property {
323
+ border: 0.0625rem solid #d9dce1;
324
+ border-radius: 0.625rem;
325
+ padding: 0.625rem;
326
+ margin: 0.625rem 0;
327
+ background: #ffffff;
328
+ }
329
+
330
+ .raf-builder-disclosure {
331
+ margin: 0.625rem 0 0.75rem;
332
+ border: 0.0625rem solid #d9dce1;
333
+ border-radius: 0.625rem;
334
+ background: #f8fafc;
335
+ overflow: hidden;
336
+ }
337
+
338
+ .raf-builder-disclosure-summary {
339
+ cursor: pointer;
340
+ padding: 0.625rem 0.75rem;
341
+ font-size: 0.9rem;
342
+ font-weight: 700;
343
+ color: #344054;
344
+ user-select: none;
345
+ }
346
+
347
+ .raf-builder-disclosure-content {
348
+ padding: 0 0.625rem 0.625rem;
349
+ }
350
+
351
+ .raf-builder-section-group > .raf-builder-block:last-child {
352
+ margin-bottom: 0;
353
+ }
354
+
355
+ .raf-textarea {
356
+ width: 100%;
357
+ min-height: 6rem;
358
+ box-sizing: border-box;
359
+ border: 0.0625rem solid var(--raf-color-border);
360
+ background: var(--raf-color-surface);
361
+ border-radius: 0.625rem;
362
+ font-size: 0.9rem;
363
+ padding: 0.625rem 0.75rem;
364
+ color: #101828;
365
+ resize: vertical;
366
+ font-family: Consolas, "Courier New", monospace;
367
+ }
368
+
369
+ .raf-textarea:focus {
370
+ border-color: var(--raf-color-border-focus);
371
+ outline: none;
372
+ box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
373
+ }
374
+
375
+ .raf-builder-control {
376
+ appearance: none;
377
+ -webkit-appearance: none;
378
+ background-color: #ffffff;
379
+ border: 0.0625rem solid #98a2b3;
380
+ color: #101828;
381
+ opacity: 1;
382
+ box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
383
+ }
384
+
385
+ .raf-builder-control::placeholder {
386
+ color: #98a2b3;
387
+ opacity: 1;
388
+ }
389
+
390
+ .raf-builder-control:focus {
391
+ border-color: var(--raf-color-border-focus);
392
+ outline: none;
393
+ box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
394
+ }
395
+
396
+ .raf-typeahead {
397
+ position: relative;
398
+ z-index: 30;
399
+ }
400
+
401
+ .raf-typeahead-menu {
402
+ position: absolute;
403
+ top: calc(100% + 0.25rem);
404
+ left: 0;
405
+ right: 0;
406
+ min-width: 100%;
407
+ z-index: 40;
408
+ display: flex;
409
+ flex-direction: column;
410
+ gap: 0.125rem;
411
+ max-height: 13.75rem;
412
+ overflow-y: auto;
413
+ padding: 0.375rem;
414
+ border: 0.0625rem solid #98a2b3;
415
+ border-radius: 0.625rem;
416
+ background: #ffffff;
417
+ box-shadow: 0 14px 28px rgba(16, 24, 40, 0.18), 0 4px 10px rgba(16, 24, 40, 0.1);
418
+ }
419
+
420
+ .raf-typeahead-option {
421
+ width: 100%;
422
+ border: 0;
423
+ border-radius: 0.5rem;
424
+ background: transparent;
425
+ color: #1d2939;
426
+ text-align: left;
427
+ padding: 0.5rem 0.625rem;
428
+ cursor: pointer;
429
+ font-size: 0.9rem;
430
+ }
431
+
432
+ .raf-typeahead-option:hover,
433
+ .raf-typeahead-option[aria-selected="true"] {
434
+ background: #eef4ff;
435
+ color: #1849a9;
436
+ }
437
+
438
+ .raf-error {
439
+ margin-top: 0.375rem;
440
+ border: 0.0625rem solid #fecdca;
441
+ background: #fee4e2;
442
+ color: #b42318;
443
+ border-radius: 0.5rem;
444
+ font-size: 0.84rem;
445
+ padding: 0.5rem 0.625rem;
446
+ }
447
+
448
+ .raf-json-preview {
449
+ margin: 0;
450
+ background: #0f172a;
451
+ color: #e2e8f0;
452
+ border-radius: 0.625rem;
453
+ padding: 0.625rem;
454
+ overflow: auto;
455
+ font-size: 0.82rem;
456
+ }
457
+
458
+ .raf-info-layer {
459
+ position: fixed;
460
+ inset: 0;
461
+ z-index: 1200;
462
+ background: transparent;
463
+ }
464
+
465
+ .raf-info-modal {
466
+ position: fixed;
467
+ width: min(24rem, calc(100vw - 1.5rem));
468
+ max-width: 24rem;
469
+ max-height: 38vh;
470
+ border: 0.0625rem solid #cfd7e3;
471
+ border-radius: 0.75rem;
472
+ background: #ffffff;
473
+ box-shadow: 0 16px 30px rgba(16, 24, 40, 0.2), 0 6px 12px rgba(16, 24, 40, 0.12);
474
+ overflow: hidden;
475
+ }
476
+
477
+ .raf-info-modal-header {
478
+ display: flex;
479
+ align-items: center;
480
+ justify-content: space-between;
481
+ gap: 0.625rem;
482
+ padding: 0.625rem 0.75rem;
483
+ border-bottom: 0.0625rem solid #e4e7ec;
484
+ background: #f8fafc;
485
+ }
486
+
487
+ .raf-info-modal-body {
488
+ padding: 0.625rem 0.75rem 0.75rem;
489
+ overflow-y: auto;
490
+ max-height: calc(38vh - 3.5rem);
491
+ }
492
+
493
+ .raf-info-modal-body p {
494
+ margin: 0;
495
+ color: #344054;
496
+ font-size: 0.85rem;
497
+ line-height: 1.45;
498
+ }
499
+
500
+ .raf-info-link {
501
+ display: inline-block;
502
+ margin-bottom: 0.5rem;
503
+ color: #0d5ea8;
504
+ font-size: 0.8rem;
505
+ font-weight: 600;
506
+ text-decoration: underline;
507
+ }
508
+
509
+ .raf-helper-panel {
510
+ display: grid;
511
+ gap: 0.625rem;
512
+ }
513
+
514
+ .raf-helper-title {
515
+ margin: 0;
516
+ font-size: 1rem;
517
+ color: #1d2939;
518
+ }
519
+
520
+ .raf-helper-subtitle {
521
+ margin-top: -0.125rem;
522
+ color: #667085;
523
+ font-size: 0.82rem;
524
+ }
525
+
526
+ .raf-helper-results {
527
+ border: 0.0625rem solid #d0d5dd;
528
+ border-radius: 0.625rem;
529
+ background: #f8fafc;
530
+ padding: 0.5rem;
531
+ max-height: 26.25rem;
532
+ overflow-y: auto;
533
+ display: grid;
534
+ gap: 0.5rem;
535
+ }
536
+
537
+ .raf-helper-empty {
538
+ color: #667085;
539
+ font-size: 0.85rem;
540
+ padding: 0.5rem;
541
+ }
542
+
543
+ .raf-helper-snippet {
544
+ border: 0.0625rem solid #d0d5dd;
545
+ border-radius: 0.5625rem;
546
+ background: #ffffff;
547
+ padding: 0.5rem 0.625rem;
548
+ }
549
+
550
+ .raf-helper-snippet-keyword {
551
+ font-size: 0.74rem;
552
+ letter-spacing: 0.04em;
553
+ color: #1849a9;
554
+ margin-bottom: 0.3125rem;
555
+ font-weight: 700;
556
+ }
557
+
558
+ .raf-helper-snippet-body {
559
+ color: #344054;
560
+ font-size: 0.84rem;
561
+ line-height: 1.45;
562
+ }
563
+
564
+ .raf-helper-snippet-body strong {
565
+ color: #0f172a;
566
+ }
567
+
568
+ @media (max-width: 53.75rem) {
569
+ .raf-builder-grid {
570
+ grid-template-columns: 1fr;
571
+ }
572
+ }
573
+ @media (max-width: 47.5rem) {
574
+ .raf-info-layer {
575
+ background: rgba(15, 23, 42, 0.28);
576
+ padding: 0.75rem;
577
+ box-sizing: border-box;
578
+ display: flex;
579
+ align-items: stretch;
580
+ justify-content: stretch;
581
+ }
582
+
583
+ .raf-info-modal,
584
+ .raf-info-modal.raf-info-modal-mobile {
585
+ position: relative;
586
+ top: auto;
587
+ left: auto;
588
+ width: 100%;
589
+ max-width: none;
590
+ max-height: none;
591
+ height: 100%;
592
+ border-radius: 0.875rem;
593
+ }
594
+
595
+ .raf-info-modal-body {
596
+ max-height: none;
597
+ height: calc(100% - 3.5rem);
598
+ }
599
+ }
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "formhell",
3
+ "author": "Ryan Rutkin",
4
+ "version": "0.1.5",
5
+ "description": "React JSON Schema form and schema builder library with draft 2020-12 support, robust $ref resolution, and strong defaults handling",
6
+ "license": "MIT",
7
+ "main": "dist/index.cjs",
8
+ "module": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "homepage": "https://ryanrutkin.github.io/formhell/",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/RyanRutkin/formhell"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/RyanRutkin/formhell/issues"
17
+ },
18
+ "keywords": [
19
+ "react",
20
+ "json-schema",
21
+ "json schema",
22
+ "json-schema-form",
23
+ "react-json-schema-form",
24
+ "schema-driven-forms",
25
+ "schema builder",
26
+ "form builder",
27
+ "ajv",
28
+ "draft-2020-12",
29
+ "ref resolution",
30
+ "autogenerated forms",
31
+ "typescript",
32
+ "react forms",
33
+ "dynamic forms"
34
+ ],
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "exports": {
39
+ ".": {
40
+ "types": "./dist/index.d.ts",
41
+ "import": "./dist/index.js",
42
+ "require": "./dist/index.cjs"
43
+ },
44
+ "./styles.css": "./dist/styles.css"
45
+ },
46
+ "scripts": {
47
+ "clean": "rimraf dist",
48
+ "build": "npm run clean && tsup",
49
+ "typecheck": "tsc --noEmit",
50
+ "playground:sitemap": "node scripts/generate-playground-sitemap.mjs",
51
+ "playground:dev": "npm --prefix playground run dev",
52
+ "playground:build": "npm --prefix playground run build",
53
+ "playground:preview": "npm --prefix playground run preview",
54
+ "prepublishOnly": "npm run build",
55
+ "publish:npm": "npm publish --access public"
56
+ },
57
+ "peerDependencies": {
58
+ "@hyperjump/json-schema": "^1.17.8",
59
+ "ajv": "^8.17.1",
60
+ "html-react-parser": "^5.2.7",
61
+ "json-pointer-relational": "^1.0.5",
62
+ "react": "^18.2.0 || ^19.0.0",
63
+ "react-dom": "^18.2.0 || ^19.0.0"
64
+ },
65
+ "devDependencies": {
66
+ "@hyperjump/json-schema": "^1.17.8",
67
+ "@types/react": "^19.1.12",
68
+ "@types/react-dom": "^19.1.9",
69
+ "html-react-parser": "^5.2.7",
70
+ "rimraf": "^6.0.1",
71
+ "tsup": "^8.3.5",
72
+ "typescript": "^5.9.2"
73
+ }
74
+ }