@echelon-foundry/design-system 0.7.0 → 0.8.0-main.250.1

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,191 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://forma.echelonfoundry.com/schemas/design/1.0/forma-design.schema.json",
4
+ "title": "Forma Design Contract 1.0",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["format", "schemaVersion", "id", "mode", "compatibility", "responsive", "motion", "root"],
8
+ "properties": {
9
+ "$schema": { "type": "string" },
10
+ "format": { "const": "forma.design" },
11
+ "schemaVersion": { "const": "1.0.0" },
12
+ "id": { "$ref": "#/$defs/id" },
13
+ "mode": { "enum": ["standard", "extended", "custom"] },
14
+ "customReason": { "type": "string", "minLength": 1 },
15
+ "validationEvidence": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "items": { "type": "string", "minLength": 1 }
19
+ },
20
+ "compatibility": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": ["forma"],
24
+ "properties": { "forma": { "type": "string", "minLength": 1 } }
25
+ },
26
+ "responsive": {
27
+ "type": "object",
28
+ "additionalProperties": false,
29
+ "required": ["strategy", "narrow", "minimumViewportCssPx"],
30
+ "properties": {
31
+ "strategy": { "const": "container" },
32
+ "narrow": { "const": "stack" },
33
+ "minimumViewportCssPx": { "type": "integer", "minimum": 240, "maximum": 320 }
34
+ }
35
+ },
36
+ "motion": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["profile", "reducedMotion"],
40
+ "properties": {
41
+ "profile": { "enum": ["none", "perceptual", "direct", "inertial", "gravity"] },
42
+ "reducedMotion": { "const": "preserve-state" }
43
+ }
44
+ },
45
+ "extensions": {
46
+ "type": "object",
47
+ "propertyNames": { "pattern": "^[a-z][a-z0-9-]*:[a-z][a-z0-9-]*$" },
48
+ "additionalProperties": true
49
+ },
50
+ "root": { "$ref": "#/$defs/form" }
51
+ },
52
+ "allOf": [
53
+ {
54
+ "if": { "properties": { "mode": { "const": "custom" } }, "required": ["mode"] },
55
+ "then": { "required": ["customReason", "validationEvidence"] }
56
+ }
57
+ ],
58
+ "$defs": {
59
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
60
+ "form": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["kind", "id", "title", "method", "action", "children"],
64
+ "properties": {
65
+ "kind": { "const": "form" },
66
+ "id": { "$ref": "#/$defs/id" },
67
+ "title": { "type": "string", "minLength": 1 },
68
+ "method": { "enum": ["get", "post"] },
69
+ "action": { "type": "string", "pattern": "^#[a-z][a-z0-9-]*$" },
70
+ "children": {
71
+ "type": "array",
72
+ "minItems": 2,
73
+ "items": { "oneOf": [
74
+ { "$ref": "#/$defs/layout" },
75
+ { "$ref": "#/$defs/actions" },
76
+ { "$ref": "#/$defs/feedback" }
77
+ ] }
78
+ }
79
+ }
80
+ },
81
+ "layout": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["kind", "id", "model", "overflow", "children"],
85
+ "properties": {
86
+ "kind": { "const": "layout" },
87
+ "id": { "$ref": "#/$defs/id" },
88
+ "model": { "enum": ["stack", "grid"] },
89
+ "alignControls": { "type": "boolean" },
90
+ "overflow": { "enum": ["wrap", "bounded-scroll"] },
91
+ "density": { "enum": ["comfortable", "dense"] },
92
+ "children": {
93
+ "type": "array",
94
+ "minItems": 1,
95
+ "items": { "$ref": "#/$defs/field" }
96
+ }
97
+ }
98
+ },
99
+ "field": {
100
+ "type": "object",
101
+ "additionalProperties": false,
102
+ "required": ["kind", "id", "name", "label", "control"],
103
+ "properties": {
104
+ "kind": { "const": "field" },
105
+ "id": { "$ref": "#/$defs/id" },
106
+ "name": { "type": "string", "minLength": 1 },
107
+ "label": { "type": "string", "minLength": 1 },
108
+ "description": { "type": "string", "minLength": 1 },
109
+ "control": { "$ref": "#/$defs/control" },
110
+ "validation": { "$ref": "#/$defs/validation" }
111
+ }
112
+ },
113
+ "control": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": ["kind"],
117
+ "properties": {
118
+ "kind": { "enum": ["text", "email", "tel", "url", "number", "date", "time", "datetime-local", "textarea", "select", "checkbox", "radio-group", "toggle"] },
119
+ "value": { "type": ["string", "number"] },
120
+ "checked": { "type": "boolean" },
121
+ "required": { "type": "boolean" },
122
+ "readonly": { "type": "boolean" },
123
+ "disabled": { "type": "boolean" },
124
+ "autocomplete": { "type": "string", "minLength": 1 },
125
+ "inputmode": { "type": "string", "minLength": 1 },
126
+ "rows": { "type": "integer", "minimum": 2, "maximum": 20 },
127
+ "options": {
128
+ "type": "array",
129
+ "minItems": 1,
130
+ "items": {
131
+ "type": "object",
132
+ "additionalProperties": false,
133
+ "required": ["value", "label"],
134
+ "properties": {
135
+ "value": { "type": "string" },
136
+ "label": { "type": "string", "minLength": 1 },
137
+ "selected": { "type": "boolean" },
138
+ "disabled": { "type": "boolean" }
139
+ }
140
+ }
141
+ }
142
+ }
143
+ },
144
+ "validation": {
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "required": ["kind", "message"],
148
+ "properties": {
149
+ "kind": { "enum": ["required", "email", "range", "pattern"] },
150
+ "message": { "type": "string", "minLength": 1 }
151
+ }
152
+ },
153
+ "actions": {
154
+ "type": "object",
155
+ "additionalProperties": false,
156
+ "required": ["kind", "id", "children"],
157
+ "properties": {
158
+ "kind": { "const": "actions" },
159
+ "id": { "$ref": "#/$defs/id" },
160
+ "children": {
161
+ "type": "array",
162
+ "minItems": 1,
163
+ "items": { "$ref": "#/$defs/action" }
164
+ }
165
+ }
166
+ },
167
+ "action": {
168
+ "type": "object",
169
+ "additionalProperties": false,
170
+ "required": ["kind", "id", "label", "type", "binding"],
171
+ "properties": {
172
+ "kind": { "const": "action" },
173
+ "id": { "$ref": "#/$defs/id" },
174
+ "label": { "type": "string", "minLength": 1 },
175
+ "type": { "enum": ["submit", "reset"] },
176
+ "binding": { "enum": ["form.submit", "form.reset"] }
177
+ }
178
+ },
179
+ "feedback": {
180
+ "type": "object",
181
+ "additionalProperties": false,
182
+ "required": ["kind", "id", "label", "message"],
183
+ "properties": {
184
+ "kind": { "const": "feedback" },
185
+ "id": { "$ref": "#/$defs/id" },
186
+ "label": { "type": "string", "minLength": 1 },
187
+ "message": { "type": "string", "minLength": 1 }
188
+ }
189
+ }
190
+ }
191
+ }