@aziontech/theme 5.2.1 → 5.2.2
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/v4/globals.css +2 -2
- package/dist/v4/globals.scss +2 -2
- package/package.json +1 -1
- package/src/scripts/build-tokens.mjs +1 -121
- package/src/scripts/compile-primitives.js +0 -18
- package/src/scripts/compile-theme.js +0 -10
- package/src/scripts/refs.d.ts.map +1 -1
- package/src/scripts/refs.js +0 -9
- package/src/scripts/zero-unit.mjs +0 -19
- package/src/tokens/README.md +0 -7
- package/src/tokens/index.js +0 -4
- package/src/tokens/primitives/animations/animate.d.ts.map +1 -1
- package/src/tokens/primitives/animations/animate.js +0 -2
- package/src/tokens/primitives/animations/keyframes.d.ts +0 -5
- package/src/tokens/primitives/animations/keyframes.d.ts.map +1 -1
- package/src/tokens/primitives/animations/keyframes.js +0 -25
- package/src/tokens/primitives/colors/colors.js +0 -5
- package/src/tokens/primitives/shape/container.d.ts.map +1 -1
- package/src/tokens/primitives/shape/container.js +13 -30
- package/src/tokens/primitives/typography/tracking.js +0 -6
- package/src/tokens/semantic/colors.js +0 -21
- package/src/tokens/semantic/containers.d.ts.map +1 -1
- package/src/tokens/semantic/containers.data.d.ts +0 -10
- package/src/tokens/semantic/containers.data.d.ts.map +1 -1
- package/src/tokens/semantic/containers.data.js +0 -11
- package/src/tokens/semantic/containers.js +1 -7
- package/src/tokens/semantic/layouts.data.d.ts +0 -15
- package/src/tokens/semantic/layouts.data.d.ts.map +1 -1
- package/src/tokens/semantic/layouts.data.js +10 -265
- package/src/tokens/semantic/spacings.data.d.ts +0 -6
- package/src/tokens/semantic/spacings.data.d.ts.map +1 -1
- package/src/tokens/semantic/spacings.data.js +0 -7
- package/src/tokens/semantic/texts.data.d.ts +0 -1
- package/src/tokens/semantic/texts.data.d.ts.map +1 -1
- package/src/tokens/semantic/texts.data.js +0 -48
- package/src/tokens/semantic/z-indices.data.d.ts +0 -22
- package/src/tokens/semantic/z-indices.data.d.ts.map +1 -1
- package/src/tokens/semantic/z-indices.data.js +0 -23
- package/src/tokens/theme/accent.js +0 -12
- package/src/tokens/theme/background.js +0 -5
- package/src/tokens/theme/border.js +0 -22
- package/src/tokens/theme/code-sintax.js +0 -4
- package/src/tokens/theme/text.js +1 -1
- package/src/scripts/measure-comment.mjs +0 -47
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Measure-comment gate for the layout tokens — the check that keeps a `// 1620px`
|
|
3
|
-
* annotation honest against the `var(--container-*)` it annotates. The VALUE is the
|
|
4
|
-
* source of truth; the comment is a reader's convenience, and a comment that disagrees
|
|
5
|
-
* with it is worse than no comment at all.
|
|
6
|
-
*
|
|
7
|
-
* Nothing else sees this: the annotation is a JS comment, so it never reaches the
|
|
8
|
-
* compiled CSS the zero-unit gate reads, and no linter resolves a `var()` back to the
|
|
9
|
-
* rung it names. A value can therefore be changed — or reverted — under a comment that
|
|
10
|
-
* still describes the old one, with every gate green. Pure: node built-ins only.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const MEASURE_LINE = /'([\w-]+)':\s*'var\(--container-([\w]+)\)',?\s*\/\/\s*(\d+)px/
|
|
14
|
-
|
|
15
|
-
/** Every `'token': 'var(--container-X)', // Npx` line, as `{ token, rung, claimed, n }`. */
|
|
16
|
-
export const findMeasureComments = (sourceText) =>
|
|
17
|
-
sourceText.split('\n').flatMap((line, i) => {
|
|
18
|
-
const m = line.match(MEASURE_LINE)
|
|
19
|
-
return m ? [{ token: m[1], rung: m[2], claimed: Number(m[3]), n: i + 1 }] : []
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Throw when a measure comment disagrees with the container rung it annotates, or names
|
|
24
|
-
* a rung that does not exist. `container` is the rung table; `source` names the artifact.
|
|
25
|
-
*/
|
|
26
|
-
export const assertMeasureCommentsMatch = (sourceText, container, source = 'layouts.data.js') => {
|
|
27
|
-
const rows = findMeasureComments(sourceText)
|
|
28
|
-
const wrong = rows.flatMap(({ token, rung, claimed, n }) => {
|
|
29
|
-
const real = container[rung]
|
|
30
|
-
if (real === undefined) return [{ token, rung, claimed, n, real: null }]
|
|
31
|
-
return parseInt(real, 10) === claimed ? [] : [{ token, rung, claimed, n, real }]
|
|
32
|
-
})
|
|
33
|
-
if (wrong.length === 0) return
|
|
34
|
-
|
|
35
|
-
const detail = wrong
|
|
36
|
-
.map(({ token, rung, claimed, n, real }) =>
|
|
37
|
-
real === null
|
|
38
|
-
? ` ${source}:${n} ${token} → --container-${rung} is not a rung of the ladder`
|
|
39
|
-
: ` ${source}:${n} ${token} → --container-${rung} is ${real}, comment says ${claimed}px`
|
|
40
|
-
)
|
|
41
|
-
.join('\n')
|
|
42
|
-
throw new Error(
|
|
43
|
-
`build:tokens — ${wrong.length} measure comment(s) disagree with the token value.\n${detail}\n` +
|
|
44
|
-
'The value is the source of truth: fix the comment to match it, or change the rung if the ' +
|
|
45
|
-
'value is what is wrong. Rungs live in src/tokens/primitives/shape/container.js.'
|
|
46
|
-
)
|
|
47
|
-
}
|