@djangocfg/layouts 1.2.38 → 1.2.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/layouts",
3
- "version": "1.2.38",
3
+ "version": "1.2.39",
4
4
  "description": "Layout system and components for Unrealon applications",
5
5
  "author": {
6
6
  "name": "DjangoCFG",
@@ -63,9 +63,9 @@
63
63
  "check": "tsc --noEmit"
64
64
  },
65
65
  "peerDependencies": {
66
- "@djangocfg/api": "^1.2.38",
67
- "@djangocfg/og-image": "^1.2.38",
68
- "@djangocfg/ui": "^1.2.38",
66
+ "@djangocfg/api": "^1.2.39",
67
+ "@djangocfg/og-image": "^1.2.39",
68
+ "@djangocfg/ui": "^1.2.39",
69
69
  "@hookform/resolvers": "^5.2.0",
70
70
  "consola": "^3.4.2",
71
71
  "lucide-react": "^0.468.0",
@@ -86,7 +86,7 @@
86
86
  "vidstack": "0.6.15"
87
87
  },
88
88
  "devDependencies": {
89
- "@djangocfg/typescript-config": "^1.2.38",
89
+ "@djangocfg/typescript-config": "^1.2.39",
90
90
  "@types/node": "^24.7.2",
91
91
  "@types/react": "19.2.2",
92
92
  "@types/react-dom": "19.2.1",
@@ -16,36 +16,36 @@ export interface PackageInfo {
16
16
  /**
17
17
  * Package versions registry
18
18
  * Auto-synced from package.json files
19
- * Last updated: 2025-11-18T03:21:56.291Z
19
+ * Last updated: 2025-11-19T04:18:48.875Z
20
20
  */
21
21
  const PACKAGE_VERSIONS: PackageInfo[] = [
22
22
  {
23
23
  "name": "@djangocfg/ui",
24
- "version": "1.2.38"
24
+ "version": "1.2.39"
25
25
  },
26
26
  {
27
27
  "name": "@djangocfg/api",
28
- "version": "1.2.38"
28
+ "version": "1.2.39"
29
29
  },
30
30
  {
31
31
  "name": "@djangocfg/layouts",
32
- "version": "1.2.38"
32
+ "version": "1.2.39"
33
33
  },
34
34
  {
35
35
  "name": "@djangocfg/markdown",
36
- "version": "1.2.38"
36
+ "version": "1.2.39"
37
37
  },
38
38
  {
39
39
  "name": "@djangocfg/og-image",
40
- "version": "1.2.38"
40
+ "version": "1.2.39"
41
41
  },
42
42
  {
43
43
  "name": "@djangocfg/eslint-config",
44
- "version": "1.2.38"
44
+ "version": "1.2.39"
45
45
  },
46
46
  {
47
47
  "name": "@djangocfg/typescript-config",
48
- "version": "1.2.38"
48
+ "version": "1.2.39"
49
49
  }
50
50
  ];
51
51
 
@@ -33,6 +33,7 @@ import {
33
33
  FormMessage,
34
34
  Field,
35
35
  } from '@djangocfg/ui';
36
+ import { JsonSchemaForm } from '@djangocfg/ui/tools';
36
37
  import type { ComponentConfig } from './types';
37
38
 
38
39
  export const FORM_COMPONENTS: ComponentConfig[] = [
@@ -463,4 +464,122 @@ function MyForm() {
463
464
  </div>
464
465
  ),
465
466
  },
467
+ {
468
+ name: 'JsonSchemaForm',
469
+ category: 'forms',
470
+ description: 'Automatic form generator from JSON Schema with validation, custom widgets, and full type safety',
471
+ importPath: "import { JsonSchemaForm } from '@djangocfg/ui/tools';",
472
+ example: `// Basic usage
473
+ const schema = {
474
+ type: 'object',
475
+ required: ['name', 'email'],
476
+ properties: {
477
+ name: {
478
+ type: 'string',
479
+ title: 'Full Name',
480
+ minLength: 2
481
+ },
482
+ email: {
483
+ type: 'string',
484
+ title: 'Email',
485
+ format: 'email'
486
+ },
487
+ age: {
488
+ type: 'number',
489
+ title: 'Age',
490
+ minimum: 18
491
+ },
492
+ subscribe: {
493
+ type: 'boolean',
494
+ title: 'Subscribe to newsletter'
495
+ }
496
+ }
497
+ };
498
+
499
+ <JsonSchemaForm
500
+ schema={schema}
501
+ onSubmit={(data) => console.log(data.formData)}
502
+ liveValidate={false}
503
+ />
504
+
505
+ // With UI Schema for customization
506
+ const uiSchema = {
507
+ subscribe: {
508
+ 'ui:widget': 'SwitchWidget'
509
+ }
510
+ };
511
+
512
+ <JsonSchemaForm
513
+ schema={schema}
514
+ uiSchema={uiSchema}
515
+ formData={initialData}
516
+ onChange={(data) => setFormData(data.formData)}
517
+ onSubmit={handleSubmit}
518
+ />`,
519
+ preview: (
520
+ <div className="space-y-4">
521
+ <JsonSchemaForm
522
+ schema={{
523
+ type: 'object',
524
+ required: ['name', 'email'],
525
+ properties: {
526
+ name: {
527
+ type: 'string',
528
+ title: 'Full Name',
529
+ description: 'Enter your first and last name',
530
+ minLength: 2
531
+ },
532
+ email: {
533
+ type: 'string',
534
+ title: 'Email Address',
535
+ format: 'email'
536
+ },
537
+ role: {
538
+ type: 'string',
539
+ title: 'Role',
540
+ enum: ['developer', 'designer', 'manager', 'other'],
541
+ default: 'developer'
542
+ },
543
+ experience: {
544
+ type: 'number',
545
+ title: 'Years of Experience',
546
+ minimum: 0,
547
+ maximum: 50,
548
+ default: 5
549
+ },
550
+ subscribe: {
551
+ type: 'boolean',
552
+ title: 'Subscribe to newsletter',
553
+ default: false
554
+ }
555
+ }
556
+ }}
557
+ uiSchema={{
558
+ subscribe: {
559
+ 'ui:widget': 'SwitchWidget'
560
+ }
561
+ }}
562
+ onSubmit={(data) => {
563
+ console.log('Form submitted:', data.formData);
564
+ alert('Form submitted! Check console for data.');
565
+ }}
566
+ liveValidate={false}
567
+ showErrorList="top"
568
+ />
569
+
570
+ <div className="p-4 border rounded-md bg-muted/50">
571
+ <p className="text-sm font-medium mb-2">Features:</p>
572
+ <ul className="space-y-1 text-sm text-muted-foreground">
573
+ <li>• Automatic form generation from JSON Schema 7</li>
574
+ <li>• Built-in validation with ajv8</li>
575
+ <li>• Custom widgets (Switch, Select, Textarea, etc.)</li>
576
+ <li>• Custom templates for fields, objects, arrays</li>
577
+ <li>• Live validation support</li>
578
+ <li>• Full TypeScript support</li>
579
+ <li>• Radix UI components integration</li>
580
+ </ul>
581
+ </div>
582
+ </div>
583
+ ),
584
+ },
466
585
  ];