@terpjs/contract 0.8.0 → 0.10.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/openapi.json +8 -0
- package/package.json +1 -1
- package/scripts/build-tokens.mjs +61 -1
- package/src/appearance-mechanism.js +19 -0
- package/src/icons.ts +98 -0
- package/src/index.ts +3 -1
- package/src/manifest.ts +128 -2
- package/src/routes-codegen.js +100 -32
- package/src/routes-codegen.test.js +92 -15
- package/src/schema.d.ts +5 -0
- package/src/tokens.contrast.test.js +16 -5
- package/src/tokens.css +23 -0
- package/src/tokens.manifest.json +104 -5
- package/src/tokens.manifest.test.js +49 -2
- package/src/tokens.themes.test.js +22 -1
- package/token-pairs.json +22 -1
- package/tokens.json +19 -0
package/token-pairs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "Token pairings the framework renders, as data, in two sections held to two different bars. `textPairs` are foreground/background pairs painted as TEXT and held to WCAG 2.1 AA for normal text; `nonTextPairs` are the visual boundaries and state indicators SC 1.4.11 asks 3:1 of — a focus indicator, the border that says which control is active, the outline of a control against its surface. Two consumers read both: tokens.contrast.test.js measures each pairing at its own bar, and the generated token manifest publishes them so a theme editor or an agent can tell which tokens must stay legible against which. A pair of token names appears in one section only: the text bar is the stricter of the two, so restating a text pairing under a non-text name would add a case that cannot fail unless the stricter one already has, and would overstate how much the ratchets cover. Purely decorative marks stay absent from both sections — WCAG sets no ratio for a divider or for an aria-hidden ornament, and asserting one would teach the next reader to ignore this file. Names are CSS custom properties because that is the vocabulary a theme author writes and a manifest consumer reads.",
|
|
2
|
+
"$comment": "The sidebar's edge (--color-sidebar-border against the canvas) is deliberately NOT declared: WCAG 1.4.11 covers UI components and graphical objects needed to understand content, and a decorative separator beside a sidebar that already differs in background is neither. Declaring it would fail at ~1.2:1 in four themes and the only ways out would be darkening a decorative line everywhere or booking an allowance the ratchet may not grow. Token pairings the framework renders, as data, in two sections held to two different bars. `textPairs` are foreground/background pairs painted as TEXT and held to WCAG 2.1 AA for normal text; `nonTextPairs` are the visual boundaries and state indicators SC 1.4.11 asks 3:1 of — a focus indicator, the border that says which control is active, the outline of a control against its surface. Two consumers read both: tokens.contrast.test.js measures each pairing at its own bar, and the generated token manifest publishes them so a theme editor or an agent can tell which tokens must stay legible against which. A pair of token names appears in one section only: the text bar is the stricter of the two, so restating a text pairing under a non-text name would add a case that cannot fail unless the stricter one already has, and would overstate how much the ratchets cover. Purely decorative marks stay absent from both sections — WCAG sets no ratio for a divider or for an aria-hidden ornament, and asserting one would teach the next reader to ignore this file. Names are CSS custom properties because that is the vocabulary a theme author writes and a manifest consumer reads. A pairing earns its place here even when no specimen paints it, and two of them are exactly that: axe measures the pixels a lane renders, so a surface that only appears on a state no specimen can reach - a failed sign-in, a failed create - has no lane coverage at all, and the declared pairing is the only gate it will ever have.",
|
|
3
3
|
"textPairs": [
|
|
4
4
|
{
|
|
5
5
|
"id": "body-on-card",
|
|
@@ -29,6 +29,20 @@
|
|
|
29
29
|
"bg": "--color-neutral-50",
|
|
30
30
|
"layer": "primitive"
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
"id": "danger-on-card",
|
|
34
|
+
"label": "danger text on a card",
|
|
35
|
+
"fg": "--color-status-danger",
|
|
36
|
+
"bg": "--color-neutral-0",
|
|
37
|
+
"layer": "primitive"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "danger-on-canvas",
|
|
41
|
+
"label": "danger text on the canvas",
|
|
42
|
+
"fg": "--color-status-danger",
|
|
43
|
+
"bg": "--color-neutral-50",
|
|
44
|
+
"layer": "primitive"
|
|
45
|
+
},
|
|
32
46
|
{
|
|
33
47
|
"id": "primary-button-label",
|
|
34
48
|
"label": "primary button label",
|
|
@@ -175,6 +189,13 @@
|
|
|
175
189
|
"fg": "--color-fg-muted",
|
|
176
190
|
"bg": "--color-status-danger-soft",
|
|
177
191
|
"layer": "semantic"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "sidebar-nav-link-hover",
|
|
195
|
+
"label": "a hovered sidebar navigation link",
|
|
196
|
+
"fg": "--color-sidebar-fg",
|
|
197
|
+
"bg": "--color-sidebar-accent",
|
|
198
|
+
"layer": "semantic"
|
|
178
199
|
}
|
|
179
200
|
],
|
|
180
201
|
"nonTextPairs": [
|
package/tokens.json
CHANGED
|
@@ -103,6 +103,15 @@
|
|
|
103
103
|
"padY": { "value": "0.5rem" },
|
|
104
104
|
"padX": { "value": "0.5rem" }
|
|
105
105
|
}
|
|
106
|
+
},
|
|
107
|
+
"comfortable": {
|
|
108
|
+
"control": {
|
|
109
|
+
"minHeight": { "value": "2.25rem" }
|
|
110
|
+
},
|
|
111
|
+
"cell": {
|
|
112
|
+
"padY": { "value": "0.75rem" },
|
|
113
|
+
"padX": { "value": "0.75rem" }
|
|
114
|
+
}
|
|
106
115
|
}
|
|
107
116
|
},
|
|
108
117
|
"radius": {
|
|
@@ -121,11 +130,21 @@
|
|
|
121
130
|
"base": { "value": "0" },
|
|
122
131
|
"sticky": { "value": "30" },
|
|
123
132
|
"backdrop": { "value": "40" },
|
|
133
|
+
"skipLink": { "value": "45" },
|
|
124
134
|
"drawer": { "value": "50" },
|
|
125
135
|
"popover": { "value": "60" },
|
|
126
136
|
"tooltip": { "value": "70" },
|
|
127
137
|
"toast": { "value": "100" }
|
|
128
138
|
},
|
|
139
|
+
"shell": {
|
|
140
|
+
"sidebarWidth": {
|
|
141
|
+
"expanded": { "value": "15rem" },
|
|
142
|
+
"collapsed": { "value": "4rem" }
|
|
143
|
+
},
|
|
144
|
+
"headerHeight": { "value": "3rem" },
|
|
145
|
+
"contentMaxWidth": { "value": "80rem" },
|
|
146
|
+
"brandSize": { "value": "1.75rem" }
|
|
147
|
+
},
|
|
129
148
|
"breakpoint": {
|
|
130
149
|
"sm": { "value": "480px" },
|
|
131
150
|
"md": { "value": "768px" },
|