@pure-ds/core 0.4.17 → 0.4.19

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.
@@ -1,4 +1,4 @@
1
- {
1
+ {
2
2
  "schemaVersion": "1.0.0",
3
3
  "readme": "",
4
4
  "modules": [
@@ -671,11 +671,11 @@
671
671
  },
672
672
  {
673
673
  "kind": "javascript-module",
674
- "path": "public/assets/pds/components/pds-jsonform.js",
674
+ "path": "public/assets/pds/components/pds-form.js",
675
675
  "declarations": [
676
676
  {
677
677
  "kind": "class",
678
- "description": "<pds-jsonform>\n\nForm Actions:\nBy default, the form includes Submit and Reset buttons inside the <form> element.\n\nUsage options:\n1. Default buttons:\n <pds-jsonform .jsonSchema=${schema}></pds-jsonform>\n\n2. Customize labels:\n <pds-jsonform .jsonSchema=${schema} submit-label=\"Save\" reset-label=\"Clear\"></pds-jsonform>\n\n3. Hide reset button:\n <pds-jsonform .jsonSchema=${schema} hide-reset></pds-jsonform>\n\n4. Add extra buttons (slot):\n <pds-jsonform .jsonSchema=${schema}>\n <button type=\"button\" slot=\"actions\"",
678
+ "description": "<pds-form>\n\nForm Actions:\nBy default, the form includes Submit and Reset buttons inside the <form> element.\n\nUsage options:\n1. Default buttons:\n <pds-form .jsonSchema=${schema}></pds-form>\n\n2. Customize labels:\n <pds-form .jsonSchema=${schema} submit-label=\"Save\" reset-label=\"Clear\"></pds-form>\n\n3. Hide reset button:\n <pds-form .jsonSchema=${schema} hide-reset></pds-form>\n\n4. Add extra buttons (slot):\n <pds-form .jsonSchema=${schema}>\n <button type=\"button\" slot=\"actions\"",
679
679
  "name": "SchemaForm",
680
680
  "members": [
681
681
  {
@@ -953,9 +953,9 @@
953
953
  ],
954
954
  "superclass": {
955
955
  "name": "LitElement",
956
- "module": "/public/assets/pds/components/pds-jsonform.js"
956
+ "module": "/public/assets/pds/components/pds-form.js"
957
957
  },
958
- "tagName": "pds-jsonform",
958
+ "tagName": "pds-form",
959
959
  "customElement": true
960
960
  }
961
961
  ],
@@ -965,15 +965,15 @@
965
965
  "name": "SchemaForm",
966
966
  "declaration": {
967
967
  "name": "SchemaForm",
968
- "module": "public/assets/pds/components/pds-jsonform.js"
968
+ "module": "public/assets/pds/components/pds-form.js"
969
969
  }
970
970
  },
971
971
  {
972
972
  "kind": "custom-element-definition",
973
- "name": "pds-jsonform",
973
+ "name": "pds-form",
974
974
  "declaration": {
975
975
  "name": "SchemaForm",
976
- "module": "public/assets/pds/components/pds-jsonform.js"
976
+ "module": "public/assets/pds/components/pds-form.js"
977
977
  }
978
978
  }
979
979
  ]
@@ -65,6 +65,69 @@
65
65
  }
66
66
  ]
67
67
  },
68
+ {
69
+ "name": "pds-form",
70
+ "description": "<pds-form>\n\nForm Actions:\nBy default, the form includes Submit and Reset buttons inside the <form> element.\n\nUsage options:\n1. Default buttons:\n <pds-form .jsonSchema=${schema}></pds-form>\n\n2. Customize labels:\n <pds-form .jsonSchema=${schema} submit-label=\"Save\" reset-label=\"Clear\"></pds-form>\n\n3. Hide reset button:\n <pds-form .jsonSchema=${schema} hide-reset></pds-form>\n\n4. Add extra buttons (slot):\n <pds-form .jsonSchema=${schema}>\n <button type=\"button\" slot=\"actions\"",
71
+ "attributes": [
72
+ {
73
+ "name": "json-schema",
74
+ "description": ""
75
+ },
76
+ {
77
+ "name": "ui-schema",
78
+ "description": ""
79
+ },
80
+ {
81
+ "name": "options",
82
+ "description": ""
83
+ },
84
+ {
85
+ "name": "values",
86
+ "description": ""
87
+ },
88
+ {
89
+ "name": "action",
90
+ "description": ""
91
+ },
92
+ {
93
+ "name": "method",
94
+ "description": ""
95
+ },
96
+ {
97
+ "name": "disabled",
98
+ "description": "",
99
+ "valueSet": "v"
100
+ },
101
+ {
102
+ "name": "hide-actions",
103
+ "description": "",
104
+ "valueSet": "v"
105
+ },
106
+ {
107
+ "name": "submit-label",
108
+ "description": ""
109
+ },
110
+ {
111
+ "name": "reset-label",
112
+ "description": ""
113
+ },
114
+ {
115
+ "name": "hide-reset",
116
+ "description": "",
117
+ "valueSet": "v"
118
+ },
119
+ {
120
+ "name": "hide-submit",
121
+ "description": "",
122
+ "valueSet": "v"
123
+ },
124
+ {
125
+ "name": "hide-legend",
126
+ "description": "",
127
+ "valueSet": "v"
128
+ }
129
+ ]
130
+ },
68
131
  {
69
132
  "name": "pds-icon",
70
133
  "description": "SVG Icon Web Component",
@@ -598,69 +661,6 @@
598
661
  }
599
662
  ]
600
663
  },
601
- {
602
- "name": "pds-jsonform",
603
- "description": "<pds-jsonform>\n\nForm Actions:\nBy default, the form includes Submit and Reset buttons inside the <form> element.\n\nUsage options:\n1. Default buttons:\n <pds-jsonform .jsonSchema=${schema}></pds-jsonform>\n\n2. Customize labels:\n <pds-jsonform .jsonSchema=${schema} submit-label=\"Save\" reset-label=\"Clear\"></pds-jsonform>\n\n3. Hide reset button:\n <pds-jsonform .jsonSchema=${schema} hide-reset></pds-jsonform>\n\n4. Add extra buttons (slot):\n <pds-jsonform .jsonSchema=${schema}>\n <button type=\"button\" slot=\"actions\"",
604
- "attributes": [
605
- {
606
- "name": "json-schema",
607
- "description": ""
608
- },
609
- {
610
- "name": "ui-schema",
611
- "description": ""
612
- },
613
- {
614
- "name": "options",
615
- "description": ""
616
- },
617
- {
618
- "name": "values",
619
- "description": ""
620
- },
621
- {
622
- "name": "action",
623
- "description": ""
624
- },
625
- {
626
- "name": "method",
627
- "description": ""
628
- },
629
- {
630
- "name": "disabled",
631
- "description": "",
632
- "valueSet": "v"
633
- },
634
- {
635
- "name": "hide-actions",
636
- "description": "",
637
- "valueSet": "v"
638
- },
639
- {
640
- "name": "submit-label",
641
- "description": ""
642
- },
643
- {
644
- "name": "reset-label",
645
- "description": ""
646
- },
647
- {
648
- "name": "hide-reset",
649
- "description": "",
650
- "valueSet": "v"
651
- },
652
- {
653
- "name": "hide-submit",
654
- "description": "",
655
- "valueSet": "v"
656
- },
657
- {
658
- "name": "hide-legend",
659
- "description": "",
660
- "valueSet": "v"
661
- }
662
- ]
663
- },
664
664
  {
665
665
  "name": "pds-richtext",
666
666
  "description": "RichText component",
package/readme.md CHANGED
@@ -1,4 +1,4 @@
1
- # Pure Design System (PDS)
1
+ # Pure Design System (PDS)
2
2
 
3
3
  > ⚠️ **Beta Software** - APIs are stabilizing but may still change. Pin versions in production: `"@pure-ds/core": "~0.3.0"`
4
4
 
@@ -166,7 +166,7 @@ A growing set of PDS components:
166
166
  - `<pds-icon>` — SVG sprite icons
167
167
  - `<pds-drawer>` — Slide-out panels
168
168
  - `<pds-tabstrip>` — Accessible tabs
169
- - `<pds-jsonform>` — Forms from JSON Schema
169
+ - `<pds-form>` — Forms from JSON Schema
170
170
  - `<pds-upload>` — Drag & drop file upload
171
171
  - `<pds-richtext>` — Rich text / Markdown editor
172
172
  - `<pds-splitpanel>` — Resizable panes
@@ -707,9 +707,9 @@ Features:
707
707
  - Undo/redo
708
708
  - Markdown shortcuts
709
709
 
710
- **`<pds-jsonform>`** - Dynamic forms from JSON Schema
710
+ **`<pds-form>`** - Dynamic forms from JSON Schema
711
711
  ```html
712
- <pds-jsonform schema='{"type":"object","properties":{...}}'></pds-jsonform>
712
+ <pds-form schema='{"type":"object","properties":{...}}'></pds-form>
713
713
  ```
714
714
 
715
715
  Generates complete forms with validation from JSON Schema.
@@ -23,7 +23,7 @@ export const presets = {
23
23
  darkMode: {
24
24
  background: "#0c1821",
25
25
  secondary: "#94a3b8",
26
- primary: "#0891b2", // Tailwind cyan-600 as base - generates darker 600 shade
26
+ primary: "#0891b2", // cyan-600 as base - generates darker 600 shade
27
27
  },
28
28
  },
29
29
  typography: {
@@ -55,7 +55,7 @@ export const presets = {
55
55
  darkMode: {
56
56
  background: "#18181b",
57
57
  secondary: "#71717a",
58
- primary: "#3b82f6", // Tailwind blue-500 - optimized mid-tone
58
+ primary: "#3b82f6", // blue-500 - optimized mid-tone
59
59
  },
60
60
  },
61
61
  typography: {
@@ -88,7 +88,7 @@ export const presets = {
88
88
  darkMode: {
89
89
  background: "#0f0a1a",
90
90
  secondary: "#818cf8",
91
- primary: "#8b5cf6", // Tailwind violet-500 - optimized mid-tone
91
+ primary: "#8b5cf6", // violet-500 - optimized mid-tone
92
92
  },
93
93
  },
94
94
  typography: {
@@ -122,7 +122,7 @@ export const presets = {
122
122
  darkMode: {
123
123
  background: "#0a0a0a",
124
124
  secondary: "#a3a3a3",
125
- primary: "#737373", // Tailwind gray-500 - optimized mid-tone
125
+ primary: "#737373", // gray-500 - optimized mid-tone
126
126
  },
127
127
  },
128
128
  typography: {
@@ -159,7 +159,7 @@ export const presets = {
159
159
  background: "#1a0f0a",
160
160
  secondary: "#c9a482",
161
161
  // Ensure sufficient contrast for primary-filled components with white text in dark mode
162
- primary: "#f97316", // Tailwind orange-500 - optimized mid-tone
162
+ primary: "#f97316", // orange-500 - optimized mid-tone
163
163
  },
164
164
  },
165
165
  typography: {
@@ -190,7 +190,7 @@ export const presets = {
190
190
  background: "#1a0a1f",
191
191
  secondary: "#c4b5fd",
192
192
  // Deepen primary for dark mode to meet AA contrast with white text
193
- primary: "#d946ef", // Tailwind fuchsia-500 - optimized mid-tone
193
+ primary: "#d946ef", // fuchsia-500 - optimized mid-tone
194
194
  },
195
195
  },
196
196
  typography: {
@@ -224,7 +224,7 @@ export const presets = {
224
224
  darkMode: {
225
225
  background: "#0a1410",
226
226
  secondary: "#a8a29e",
227
- primary: "#10b981", // Tailwind emerald-500 - optimized mid-tone
227
+ primary: "#10b981", // emerald-500 - optimized mid-tone
228
228
  },
229
229
  },
230
230
  typography: {
@@ -254,7 +254,7 @@ export const presets = {
254
254
  darkMode: {
255
255
  background: "#1b0808",
256
256
  secondary: "#d1d5db",
257
- primary: "#ef4444", // Tailwind red-500 - optimized mid-tone
257
+ primary: "#ef4444", // red-500 - optimized mid-tone
258
258
  },
259
259
  },
260
260
  typography: {
@@ -288,7 +288,7 @@ export const presets = {
288
288
  background: "#12100e",
289
289
  secondary: "#d1d5db",
290
290
  // Deepen primary in dark to keep white text AA-compliant
291
- primary: "#f59e0b", // Tailwind amber-500 - optimized mid-tone
291
+ primary: "#f59e0b", // amber-500 - optimized mid-tone
292
292
  },
293
293
  },
294
294
  typography: {
@@ -323,7 +323,7 @@ export const presets = {
323
323
  // has strong contrast against the very-dark surface. The generator
324
324
  // will still pick appropriate darker fill shades for buttons so
325
325
  // white-on-fill contrast is preserved.
326
- primary: "#9ca3af", // Tailwind gray-400 - optimized mid-tone
326
+ primary: "#9ca3af", // gray-400 - optimized mid-tone
327
327
  },
328
328
  },
329
329
  typography: {
@@ -361,7 +361,7 @@ export const presets = {
361
361
  darkMode: {
362
362
  background: "#1a1016",
363
363
  secondary: "#c4b5fd",
364
- primary: "#ec4899", // Tailwind pink-500 - optimized mid-tone
364
+ primary: "#ec4899", // pink-500 - optimized mid-tone
365
365
  },
366
366
  },
367
367
  typography: {
@@ -401,7 +401,7 @@ export const presets = {
401
401
  // - outline/link contrast on dark surface, and
402
402
  // - sufficient button fill contrast against white text.
403
403
  // Cyan signal aligns with preset accent and produces high-contrast dark fills.
404
- primary: "#06b6d4", // Tailwind cyan-500 - optimized mid-tone
404
+ primary: "#06b6d4", // cyan-500 - optimized mid-tone
405
405
  },
406
406
  },
407
407
  typography: {
@@ -437,7 +437,7 @@ export const presets = {
437
437
  darkMode: {
438
438
  background: "#0d130a",
439
439
  secondary: "#a3a3a3",
440
- primary: "#84cc16", // Tailwind lime-500 - optimized mid-tone
440
+ primary: "#84cc16", // lime-500 - optimized mid-tone
441
441
  },
442
442
  },
443
443
  typography: {
@@ -845,7 +845,7 @@ presets.default = {
845
845
  darkMode: {
846
846
  background: "#16171a", // Custom dark mode background (cool blue-gray)
847
847
  secondary: "#8b9199", // Optional: custom dark grays (uses light secondary if omitted)
848
- primary: "#06b6d4", // Tailwind cyan-500 - optimized mid-tone
848
+ primary: "#06b6d4", // cyan-500 - optimized mid-tone
849
849
  // accent: null, // Optional: override accent color for dark mode
850
850
  },
851
851
 
@@ -1,4 +1,4 @@
1
- import { registry as pdsRegistry } from "./pds-registry.js";
1
+ import { registry as pdsRegistry } from "./pds-registry.js";
2
2
 
3
3
  /**
4
4
  * Generator - A JS-config-first design system
@@ -1810,10 +1810,8 @@ form {
1810
1810
  }
1811
1811
 
1812
1812
  fieldset {
1813
- margin: 0;
1814
- padding: var(--spacing-5);
1813
+ margin: 0;
1815
1814
  width: 100%;
1816
- background-color: color-mix(in oklab, var(--color-surface-subtle) 50%, transparent 50%);
1817
1815
 
1818
1816
  /* Unified styling for radio groups and checkbox groups */
1819
1817
  &[role="radiogroup"],
@@ -3044,15 +3042,24 @@ dialog[open]::backdrop {
3044
3042
  }
3045
3043
  }
3046
3044
 
3045
+ /* Dialog - constrain max height to 90vh, support custom maxHeight via CSS variable */
3046
+ dialog {
3047
+ max-height: var(--dialog-max-height, 90vh);
3048
+ display: flex;
3049
+ flex-direction: column;
3050
+ overflow: hidden; /* Prevent dialog itself from scrolling - let .dialog-body handle it */
3051
+ }
3052
+
3047
3053
  /* Form structure - use flexbox instead of contents */
3048
3054
  dialog form {
3049
3055
  display: flex;
3050
3056
  flex-direction: column;
3051
- height: 100%;
3057
+ flex: 1;
3058
+ min-height: 0; /* Allow flex child to shrink */
3052
3059
  margin: 0;
3053
3060
  }
3054
3061
 
3055
- /* Dialog fields - to open pds-jsonform subforms */
3062
+ /* Dialog fields - to open pds-form subforms */
3056
3063
  .dialog-field {
3057
3064
  margin-top: var(--spacing-3);
3058
3065
  }
@@ -3107,7 +3114,8 @@ dialog {
3107
3114
  article,
3108
3115
  form > article,
3109
3116
  .dialog-body {
3110
- flex: 1;
3117
+ flex: 1 1 auto;
3118
+ min-height: 0; /* Critical: allow flex child to shrink and scroll */
3111
3119
  padding: var(--spacing-3) var(--spacing-6);
3112
3120
  overflow-y: auto;
3113
3121
  overflow-x: hidden;
@@ -3133,9 +3141,17 @@ dialog.dialog-lg { max-width: min(800px, calc(100vw - var(--spacing-8))); }
3133
3141
  dialog.dialog-xl { max-width: min(1200px, calc(100vw - var(--spacing-8))); }
3134
3142
  dialog.dialog-full { max-width: calc(100vw - var(--spacing-8)); max-height: calc(100vh - var(--spacing-8)); }
3135
3143
 
3136
- /* Mobile responsiveness */
3144
+ /* Mobile responsiveness - maximize on mobile */
3137
3145
  @media (max-width: ${breakpoints.sm - 1}px) {
3138
- dialog { max-width: 100vw; max-height: 100vh; border-radius: 0; top: 50%; transform: translateY(-50%); margin: 0; }
3146
+ dialog {
3147
+ max-width: 100vw;
3148
+ max-height: 100vh;
3149
+ --dialog-max-height: 100vh; /* Override custom maxHeight on mobile */
3150
+ border-radius: 0;
3151
+ top: 50%;
3152
+ transform: translateY(-50%);
3153
+ margin: 0;
3154
+ }
3139
3155
  dialog header, dialog form > header, dialog article, dialog form > article, dialog footer, dialog form > footer { padding: var(--spacing-4); }
3140
3156
  }
3141
3157
 
@@ -4213,9 +4229,6 @@ nav[data-dropdown] {
4213
4229
 
4214
4230
  :where(fieldset) {
4215
4231
  border: none;
4216
- padding: var(--spacing-4);
4217
- margin: 0 0 var(--spacing-4) 0;
4218
- background-color: var(--color-surface-subtle);
4219
4232
  }
4220
4233
 
4221
4234
  :where(legend) {
@@ -1,4 +1,4 @@
1
- // Pure Design System Ontology (PDS)
1
+ // Pure Design System Ontology (PDS)
2
2
  // This file is the single source-of-truth metadata for primitives, components, tokens, themes and enhancements.
3
3
  // Used by PDS.query() for searching and correlating concepts.
4
4
 
@@ -223,10 +223,10 @@ export const ontology = {
223
223
  category: "feedback"
224
224
  },
225
225
  {
226
- id: "pds-jsonform",
226
+ id: "pds-form",
227
227
  name: "JSON Form",
228
228
  description: "Auto-generated form from JSON Schema",
229
- selectors: ["pds-jsonform"],
229
+ selectors: ["pds-form"],
230
230
  tags: ["form", "schema", "auto-generate"],
231
231
  category: "form"
232
232
  },
@@ -481,7 +481,7 @@ export const ontology = {
481
481
  form: {
482
482
  description: "Form inputs and controls",
483
483
  primitives: ["button", "fieldset", "label-field", "form"],
484
- components: ["pds-upload", "pds-jsonform", "pds-richtext", "pds-calendar"]
484
+ components: ["pds-upload", "pds-form", "pds-richtext", "pds-calendar"]
485
485
  },
486
486
  layout: {
487
487
  description: "Page structure and content arrangement",
@@ -541,7 +541,7 @@ export const ontology = {
541
541
  content: ["text", "typography", "body", "article"],
542
542
 
543
543
  // Forms & Inputs
544
- form: ["input", "field", "label", "button", "fieldset", "pds-jsonform", "pds-upload", "pds-richtext", "pds-calendar", "required", "validation", "submit"],
544
+ form: ["input", "field", "label", "button", "fieldset", "pds-form", "pds-upload", "pds-richtext", "pds-calendar", "required", "validation", "submit"],
545
545
  input: ["form", "field", "text", "label", "required", "validation"],
546
546
  field: ["form", "input", "label", "required"],
547
547
  button: ["btn", "interactive", "action", "submit", "form", "btn-primary", "btn-secondary", "btn-working"],
package/src/js/pds.d.ts CHANGED
@@ -217,7 +217,7 @@ export class PDS extends EventTarget {
217
217
 
218
218
  export { PDS as default };
219
219
 
220
- // ===== pds-jsonform Types =====
220
+ // ===== pds-form Types =====
221
221
 
222
222
  export interface JsonFormOptions {
223
223
  widgets?: {
@@ -358,7 +358,7 @@ export interface JsonFormEventMap {
358
358
 
359
359
  declare global {
360
360
  interface HTMLElementTagNameMap {
361
- 'pds-jsonform': SchemaForm;
361
+ 'pds-form': SchemaForm;
362
362
  }
363
363
  }
364
364
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"pds-jsonform.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-jsonform.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAGF,yBAEC;IAaC,gBAA2B;IAC3B,cAAyB;IACzB,aAAwB;IACxB,YAAuB;IACvB,eAAoB;IACpB,qBAAwB;IACxB,oBAA2B;IAC3B,mBAAyB;IACzB,mBAAsB;IACtB,oBAAuB;IAiBzB,8CAEC;IACD,4BAEC;IAGD,oBAEC;IAkBD;;;MAIC;IAED,uBAEC;IAED,0BAMC;IAGD,+BAyBC;IA+ND,cAyCC;;CAu4CF"}