@conductor-by-89soone/tokens 0.2.0 → 0.3.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/dist/cli.js +4 -2
- package/dist/contrast-cli.js +9 -3
- package/dist/contrast-report.json +6 -1
- package/dist/index.js +2 -1
- package/dist/lint-cli.js +3 -3
- package/dist/tokens.css +3 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +2 -1
- package/dist/tokens.json +11 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -270,7 +270,8 @@ var breakpoint = Object.keys(BREAKPOINT_PX).map(
|
|
|
270
270
|
var motion = [
|
|
271
271
|
semantic("motion.fast", "140ms {ease.entrance}", "Colour, background and border transitions."),
|
|
272
272
|
semantic("motion.standard", "240ms {ease.entrance}", "Overlay and page entrance."),
|
|
273
|
-
semantic("motion.bounce", "300ms {ease.overshoot}", "Toggle and switch settle.")
|
|
273
|
+
semantic("motion.bounce", "300ms {ease.overshoot}", "Toggle and switch settle."),
|
|
274
|
+
semantic("motion.spin", "1000ms {ease.linear}", "One revolution of the indeterminate spinner.")
|
|
274
275
|
];
|
|
275
276
|
var scaleTokens = [
|
|
276
277
|
...fontSize,
|
|
@@ -1282,7 +1283,8 @@ var nonColour = [
|
|
|
1282
1283
|
primitive("curve.18", "18px", "Corner radius step."),
|
|
1283
1284
|
primitive("curve.24", "24px", "Corner radius step."),
|
|
1284
1285
|
primitive("ease.entrance", "cubic-bezier(0.2, 0, 0, 1)", "Entrance and state-change easing."),
|
|
1285
|
-
primitive("ease.overshoot", "cubic-bezier(0.34, 1.56, 0.64, 1)", "Toggle settle easing.")
|
|
1286
|
+
primitive("ease.overshoot", "cubic-bezier(0.34, 1.56, 0.64, 1)", "Toggle settle easing."),
|
|
1287
|
+
primitive("ease.linear", "linear", "Constant-rate motion: spinners and marquees.")
|
|
1286
1288
|
];
|
|
1287
1289
|
var primitiveTokens = [
|
|
1288
1290
|
...ink,
|
package/dist/contrast-cli.js
CHANGED
|
@@ -384,7 +384,10 @@ var forbiddenPairs = [
|
|
|
384
384
|
id: "FP-002",
|
|
385
385
|
foreground: "accent",
|
|
386
386
|
background: "surface.elevated",
|
|
387
|
-
reason: "the accent is a body foreground on `surface.base` and `surface.raised` only; on the elevated surface it measures 4.40:1 in dark, below body 4.5:1 (tokens spec 8.4)"
|
|
387
|
+
reason: "the accent is a body foreground on `surface.base` and `surface.raised` only; on the elevated surface it measures 4.40:1 in dark, below body 4.5:1 (tokens spec 8.4)",
|
|
388
|
+
// Body only. 4.40:1 clears both the `large` 3:1 and the `nonText` 3:1 thresholds, and the
|
|
389
|
+
// SRS forbids only body use on this surface.
|
|
390
|
+
usages: ["body"]
|
|
388
391
|
}
|
|
389
392
|
];
|
|
390
393
|
|
|
@@ -488,7 +491,8 @@ var breakpoint = Object.keys(BREAKPOINT_PX).map(
|
|
|
488
491
|
var motion = [
|
|
489
492
|
semantic("motion.fast", "140ms {ease.entrance}", "Colour, background and border transitions."),
|
|
490
493
|
semantic("motion.standard", "240ms {ease.entrance}", "Overlay and page entrance."),
|
|
491
|
-
semantic("motion.bounce", "300ms {ease.overshoot}", "Toggle and switch settle.")
|
|
494
|
+
semantic("motion.bounce", "300ms {ease.overshoot}", "Toggle and switch settle."),
|
|
495
|
+
semantic("motion.spin", "1000ms {ease.linear}", "One revolution of the indeterminate spinner.")
|
|
492
496
|
];
|
|
493
497
|
var scaleTokens = [
|
|
494
498
|
...fontSize,
|
|
@@ -1500,7 +1504,8 @@ var nonColour = [
|
|
|
1500
1504
|
primitive("curve.18", "18px", "Corner radius step."),
|
|
1501
1505
|
primitive("curve.24", "24px", "Corner radius step."),
|
|
1502
1506
|
primitive("ease.entrance", "cubic-bezier(0.2, 0, 0, 1)", "Entrance and state-change easing."),
|
|
1503
|
-
primitive("ease.overshoot", "cubic-bezier(0.34, 1.56, 0.64, 1)", "Toggle settle easing.")
|
|
1507
|
+
primitive("ease.overshoot", "cubic-bezier(0.34, 1.56, 0.64, 1)", "Toggle settle easing."),
|
|
1508
|
+
primitive("ease.linear", "linear", "Constant-rate motion: spinners and marquees.")
|
|
1504
1509
|
];
|
|
1505
1510
|
var primitiveTokens = [
|
|
1506
1511
|
...ink,
|
|
@@ -1772,6 +1777,7 @@ function assertNotForbidden(pair2, index, forbidden) {
|
|
|
1772
1777
|
const bannedForeground = aliasTerminus(index, banned.foreground);
|
|
1773
1778
|
const bannedBackground = aliasTerminus(index, banned.background);
|
|
1774
1779
|
if (resolvedForeground !== bannedForeground || resolvedBackground !== bannedBackground) continue;
|
|
1780
|
+
if (banned.usages !== void 0 && !banned.usages.includes(pair2.usage)) continue;
|
|
1775
1781
|
throw new TokenBuildError("TOK-CP-FORBIDDEN", "contrast pair declares a forbidden combination", [
|
|
1776
1782
|
`pair: ${pair2.id} (${pair2.foreground} on ${pair2.background})`,
|
|
1777
1783
|
`forbidden: ${banned.id} (${banned.foreground} on ${banned.background})`,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"checks": 232,
|
|
15
15
|
"passed": 232,
|
|
16
16
|
"failed": 0,
|
|
17
|
-
"excludedTokens":
|
|
17
|
+
"excludedTokens": 229,
|
|
18
18
|
"forbiddenPairs": 2
|
|
19
19
|
},
|
|
20
20
|
"results": [
|
|
@@ -3391,6 +3391,11 @@
|
|
|
3391
3391
|
"usage": "decorative",
|
|
3392
3392
|
"reason": "Toggle and switch settle."
|
|
3393
3393
|
},
|
|
3394
|
+
{
|
|
3395
|
+
"key": "motion.spin",
|
|
3396
|
+
"usage": "decorative",
|
|
3397
|
+
"reason": "One revolution of the indeterminate spinner."
|
|
3398
|
+
},
|
|
3394
3399
|
{
|
|
3395
3400
|
"key": "button.minHeight",
|
|
3396
3401
|
"usage": "decorative",
|
package/dist/index.js
CHANGED
|
@@ -168,7 +168,8 @@ var tokens = {
|
|
|
168
168
|
motion: {
|
|
169
169
|
fast: "var(--cdt-motion-fast)",
|
|
170
170
|
standard: "var(--cdt-motion-standard)",
|
|
171
|
-
bounce: "var(--cdt-motion-bounce)"
|
|
171
|
+
bounce: "var(--cdt-motion-bounce)",
|
|
172
|
+
spin: "var(--cdt-motion-spin)"
|
|
172
173
|
},
|
|
173
174
|
button: {
|
|
174
175
|
minHeight: "var(--cdt-button-min-height)",
|
package/dist/lint-cli.js
CHANGED
|
@@ -125,9 +125,9 @@ function isAllowed(allowances, line) {
|
|
|
125
125
|
// src/lint/rules.ts
|
|
126
126
|
var HEX_COLOR = /#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})\b/gi;
|
|
127
127
|
var FUNCTIONAL_COLOR = /\b(?:rgba?|hsla?)\([^)]*\)/gi;
|
|
128
|
-
var PX_LITERAL = /(?<![\w#.])(\d+(?:\.\d+)
|
|
129
|
-
var REM_LITERAL = /(?<![\w#.])(\d+(?:\.\d+)
|
|
130
|
-
var MS_LITERAL = /(?<![\w#.])(\d+(?:\.\d+)
|
|
128
|
+
var PX_LITERAL = /(?<![\w#.])(\d+(?:\.\d+)?|\.\d+)px\b/g;
|
|
129
|
+
var REM_LITERAL = /(?<![\w#.])(\d+(?:\.\d+)?|\.\d+)rem\b/g;
|
|
130
|
+
var MS_LITERAL = /(?<![\w#.])(\d+(?:\.\d+)?|\.\d+)ms\b/g;
|
|
131
131
|
var Z_INDEX = /\b(?:z-index|zIndex)\s*:\s*["'`]?\s*(-?\d+)/g;
|
|
132
132
|
var FONT_SIZE_PX = /\b(?:font-size|fontSize)\s*:\s*["'`]?\s*(\d+(?:\.\d+)?px)/g;
|
|
133
133
|
var MEDIA_PRELUDE = /@media[^{;]*/g;
|
package/dist/tokens.css
CHANGED
|
@@ -144,6 +144,7 @@
|
|
|
144
144
|
--cdt-motion-fast: 140ms cubic-bezier(0.2, 0, 0, 1);
|
|
145
145
|
--cdt-motion-standard: 240ms cubic-bezier(0.2, 0, 0, 1);
|
|
146
146
|
--cdt-motion-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
147
|
+
--cdt-motion-spin: 1000ms linear;
|
|
147
148
|
|
|
148
149
|
--cdt-button-min-height: 40px;
|
|
149
150
|
--cdt-button-min-height-compact: 42px;
|
|
@@ -488,6 +489,7 @@
|
|
|
488
489
|
--cdt-motion-fast: 140ms cubic-bezier(0.2, 0, 0, 1);
|
|
489
490
|
--cdt-motion-standard: 240ms cubic-bezier(0.2, 0, 0, 1);
|
|
490
491
|
--cdt-motion-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
492
|
+
--cdt-motion-spin: 1000ms linear;
|
|
491
493
|
|
|
492
494
|
--cdt-button-min-height: 40px;
|
|
493
495
|
--cdt-button-min-height-compact: 42px;
|
|
@@ -833,6 +835,7 @@
|
|
|
833
835
|
--cdt-motion-fast: 140ms cubic-bezier(0.2, 0, 0, 1);
|
|
834
836
|
--cdt-motion-standard: 240ms cubic-bezier(0.2, 0, 0, 1);
|
|
835
837
|
--cdt-motion-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
838
|
+
--cdt-motion-spin: 1000ms linear;
|
|
836
839
|
|
|
837
840
|
--cdt-button-min-height: 40px;
|
|
838
841
|
--cdt-button-min-height-compact: 42px;
|
package/dist/tokens.d.ts
CHANGED
|
@@ -171,6 +171,7 @@ declare const tokens: {
|
|
|
171
171
|
readonly fast: "var(--cdt-motion-fast)";
|
|
172
172
|
readonly standard: "var(--cdt-motion-standard)";
|
|
173
173
|
readonly bounce: "var(--cdt-motion-bounce)";
|
|
174
|
+
readonly spin: "var(--cdt-motion-spin)";
|
|
174
175
|
};
|
|
175
176
|
readonly button: {
|
|
176
177
|
readonly minHeight: "var(--cdt-button-min-height)";
|
package/dist/tokens.js
CHANGED
|
@@ -164,7 +164,8 @@ var tokens = {
|
|
|
164
164
|
motion: {
|
|
165
165
|
fast: "var(--cdt-motion-fast)",
|
|
166
166
|
standard: "var(--cdt-motion-standard)",
|
|
167
|
-
bounce: "var(--cdt-motion-bounce)"
|
|
167
|
+
bounce: "var(--cdt-motion-bounce)",
|
|
168
|
+
spin: "var(--cdt-motion-spin)"
|
|
168
169
|
},
|
|
169
170
|
button: {
|
|
170
171
|
minHeight: "var(--cdt-button-min-height)",
|
package/dist/tokens.json
CHANGED
|
@@ -1346,6 +1346,17 @@
|
|
|
1346
1346
|
"light": "300ms cubic-bezier(0.34, 1.56, 0.64, 1)"
|
|
1347
1347
|
}
|
|
1348
1348
|
},
|
|
1349
|
+
{
|
|
1350
|
+
"key": "motion.spin",
|
|
1351
|
+
"cssName": "--cdt-motion-spin",
|
|
1352
|
+
"tier": "semantic",
|
|
1353
|
+
"usage": "decorative",
|
|
1354
|
+
"description": "One revolution of the indeterminate spinner.",
|
|
1355
|
+
"values": {
|
|
1356
|
+
"dark": "1000ms linear",
|
|
1357
|
+
"light": "1000ms linear"
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1349
1360
|
{
|
|
1350
1361
|
"key": "button.minHeight",
|
|
1351
1362
|
"cssName": "--cdt-button-min-height",
|
package/package.json
CHANGED