@wordpress/theme 0.3.1-next.8b30e05b0.0 → 0.4.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/README.md +82 -18
- package/bin/generate-primitive-tokens/index.ts +26 -33
- package/bin/terrazzo-plugin-mode-overrides/index.ts +208 -0
- package/build/color-ramps/lib/default-ramps.js +65 -65
- package/build/color-ramps/lib/default-ramps.js.map +1 -1
- package/build/color-ramps/lib/find-color-with-constraints.js.map +2 -2
- package/build/color-ramps/lib/index.js.map +2 -2
- package/build/color-ramps/lib/taper-chroma.js +18 -44
- package/build/color-ramps/lib/taper-chroma.js.map +2 -2
- package/build/prebuilt/js/design-tokens.js +32 -6
- package/build/prebuilt/js/design-tokens.js.map +2 -2
- package/build/prebuilt/ts/color-tokens.js +35 -13
- package/build/prebuilt/ts/color-tokens.js.map +2 -2
- package/build-module/color-ramps/lib/default-ramps.js +65 -65
- package/build-module/color-ramps/lib/default-ramps.js.map +1 -1
- package/build-module/color-ramps/lib/find-color-with-constraints.js.map +2 -2
- package/build-module/color-ramps/lib/index.js.map +2 -2
- package/build-module/color-ramps/lib/taper-chroma.js +19 -46
- package/build-module/color-ramps/lib/taper-chroma.js.map +2 -2
- package/build-module/prebuilt/js/design-tokens.js +32 -6
- package/build-module/prebuilt/js/design-tokens.js.map +2 -2
- package/build-module/prebuilt/ts/color-tokens.js +35 -13
- package/build-module/prebuilt/ts/color-tokens.js.map +2 -2
- package/build-types/color-ramps/lib/find-color-with-constraints.d.ts +3 -4
- package/build-types/color-ramps/lib/find-color-with-constraints.d.ts.map +1 -1
- package/build-types/color-ramps/lib/taper-chroma.d.ts +4 -4
- package/build-types/color-ramps/lib/taper-chroma.d.ts.map +1 -1
- package/build-types/prebuilt/ts/color-tokens.d.ts.map +1 -1
- package/docs/ds-tokens.md +35 -9
- package/package.json +5 -5
- package/src/color-ramps/lib/default-ramps.ts +65 -65
- package/src/color-ramps/lib/find-color-with-constraints.ts +11 -7
- package/src/color-ramps/lib/index.ts +4 -4
- package/src/color-ramps/lib/taper-chroma.ts +32 -63
- package/src/prebuilt/css/design-tokens.css +72 -28
- package/src/prebuilt/js/design-tokens.js +32 -6
- package/src/prebuilt/ts/color-tokens.ts +31 -9
- package/terrazzo.config.ts +11 -14
- package/tokens/border.json +44 -22
- package/tokens/color.json +1160 -630
- package/tokens/dimension.json +112 -52
- package/tokens/elevation.json +1 -1
- package/tokens/modes/border.high-dpi.json +15 -0
- package/tokens/modes/dimension.comfortable.json +54 -0
- package/tokens/modes/dimension.compact.json +54 -0
- package/tokens/typography.json +1 -1
- package/tsconfig.bin.tsbuildinfo +1 -1
- package/tsconfig.src.json +1 -1
- package/tsconfig.src.tsbuildinfo +1 -1
- package/bin/terrazzo-plugin-figma-ds-token-manager/index.ts +0 -217
- package/bin/terrazzo-plugin-figma-ds-token-manager/lib.ts +0 -1
- package/build/prebuilt/json/figma.json +0 -715
- package/build/token-id.js +0 -30
- package/build/token-id.js.map +0 -7
- package/build/types/css-modules.d.js +0 -1
- package/build/types/css-modules.d.js.map +0 -7
- package/build-module/prebuilt/json/figma.json +0 -715
- package/build-module/token-id.js +0 -6
- package/build-module/token-id.js.map +0 -7
- package/build-module/types/css-modules.d.js +0 -1
- package/build-module/types/css-modules.d.js.map +0 -7
- package/build-types/token-id.d.ts +0 -9
- package/build-types/token-id.d.ts.map +0 -1
- package/src/prebuilt/json/figma.json +0 -715
- package/src/test/token-id.test.ts +0 -12
- package/src/token-id.ts +0 -9
- package/src/types/css-modules.d.ts +0 -4
package/terrazzo.config.ts
CHANGED
|
@@ -8,11 +8,10 @@ import { makeCSSVar } from '@terrazzo/token-tools/css';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import
|
|
11
|
+
import pluginModeOverrides from './bin/terrazzo-plugin-mode-overrides/index';
|
|
12
12
|
import pluginKnownWpdsCssVariables from './bin/terrazzo-plugin-known-wpds-css-variables/index';
|
|
13
13
|
import pluginDsTokenDocs from './bin/terrazzo-plugin-ds-tokens-docs/index';
|
|
14
14
|
import inlineAliasValues from './bin/terrazzo-plugin-inline-alias-values/index';
|
|
15
|
-
import { publicTokenId } from './src/token-id.ts';
|
|
16
15
|
|
|
17
16
|
export default defineConfig( {
|
|
18
17
|
tokens: [
|
|
@@ -26,36 +25,36 @@ export default defineConfig( {
|
|
|
26
25
|
|
|
27
26
|
plugins: [
|
|
28
27
|
inlineAliasValues( {
|
|
29
|
-
pattern: /^color\.primitive\./,
|
|
28
|
+
pattern: /^wpds-color\.primitive\./,
|
|
30
29
|
filename: 'ts/color-tokens.ts',
|
|
31
30
|
tokenId: ( tokenId ) =>
|
|
32
|
-
|
|
33
|
-
.replace(
|
|
31
|
+
tokenId
|
|
32
|
+
.replace( /\.primitive/, '' )
|
|
33
|
+
.replace( /^wpds-color\./, '' )
|
|
34
34
|
.replace( /\./g, '-' ),
|
|
35
35
|
} ),
|
|
36
|
-
inlineAliasValues( { pattern: /^dimension\.primitive\./ } ),
|
|
36
|
+
inlineAliasValues( { pattern: /^wpds-dimension\.primitive\./ } ),
|
|
37
37
|
pluginCSS( {
|
|
38
38
|
filename: 'css/design-tokens.css',
|
|
39
|
-
variableName: ( token ) =>
|
|
40
|
-
makeCSSVar( `wpds.${ publicTokenId( token.id ) }` ),
|
|
39
|
+
variableName: ( token ) => makeCSSVar( token.id ),
|
|
41
40
|
baseSelector: ':root',
|
|
42
41
|
modeSelectors: [
|
|
43
42
|
{
|
|
44
|
-
tokens: [ 'dimension.*' ],
|
|
43
|
+
tokens: [ 'wpds-dimension.*' ],
|
|
45
44
|
mode: '.',
|
|
46
45
|
selectors: [
|
|
47
46
|
"[data-wpds-theme-provider-id][data-wpds-density='default']",
|
|
48
47
|
],
|
|
49
48
|
},
|
|
50
49
|
{
|
|
51
|
-
tokens: [ 'dimension.*' ],
|
|
50
|
+
tokens: [ 'wpds-dimension.*' ],
|
|
52
51
|
mode: 'compact',
|
|
53
52
|
selectors: [
|
|
54
53
|
"[data-wpds-theme-provider-id][data-wpds-density='compact']",
|
|
55
54
|
],
|
|
56
55
|
},
|
|
57
56
|
{
|
|
58
|
-
tokens: [ 'dimension.*' ],
|
|
57
|
+
tokens: [ 'wpds-dimension.*' ],
|
|
59
58
|
mode: 'comfortable',
|
|
60
59
|
selectors: [
|
|
61
60
|
"[data-wpds-theme-provider-id][data-wpds-density='comfortable']",
|
|
@@ -70,15 +69,13 @@ export default defineConfig( {
|
|
|
70
69
|
],
|
|
71
70
|
legacyHex: true,
|
|
72
71
|
} ),
|
|
73
|
-
pluginFigmaDsTokenManager( {
|
|
74
|
-
filename: 'json/figma.json',
|
|
75
|
-
} ),
|
|
76
72
|
pluginKnownWpdsCssVariables( {
|
|
77
73
|
filename: 'js/design-tokens.js',
|
|
78
74
|
} ),
|
|
79
75
|
pluginDsTokenDocs( {
|
|
80
76
|
filename: '../../docs/ds-tokens.md',
|
|
81
77
|
} ),
|
|
78
|
+
pluginModeOverrides(),
|
|
82
79
|
],
|
|
83
80
|
|
|
84
81
|
// Linter rules current error when multiple entry files are used
|
package/tokens/border.json
CHANGED
|
@@ -1,31 +1,53 @@
|
|
|
1
1
|
{
|
|
2
|
-
"border": {
|
|
2
|
+
"wpds-border": {
|
|
3
3
|
"$type": "dimension",
|
|
4
4
|
"radius": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
5
|
+
"surface": {
|
|
6
|
+
"xs": {
|
|
7
|
+
"$value": { "value": 1, "unit": "px" },
|
|
8
|
+
"$description": "Extra small radius for surfaces"
|
|
9
|
+
},
|
|
10
|
+
"sm": {
|
|
11
|
+
"$value": { "value": 2, "unit": "px" },
|
|
12
|
+
"$description": "Small radius for surfaces"
|
|
13
|
+
},
|
|
14
|
+
"md": {
|
|
15
|
+
"$value": { "value": 4, "unit": "px" },
|
|
16
|
+
"$description": "Medium radius for surfaces"
|
|
17
|
+
},
|
|
18
|
+
"lg": {
|
|
19
|
+
"$value": { "value": 8, "unit": "px" },
|
|
20
|
+
"$description": "Large radius for surfaces"
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
23
|
},
|
|
22
24
|
"width": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
"surface": {
|
|
26
|
+
"xs": {
|
|
27
|
+
"$value": { "value": 1, "unit": "px" },
|
|
28
|
+
"$description": "Extra small width for surfaces"
|
|
29
|
+
},
|
|
30
|
+
"sm": {
|
|
31
|
+
"$value": { "value": 2, "unit": "px" },
|
|
32
|
+
"$description": "Small width for surfaces"
|
|
33
|
+
},
|
|
34
|
+
"md": {
|
|
35
|
+
"$value": { "value": 4, "unit": "px" },
|
|
36
|
+
"$description": "Medium width for surfaces"
|
|
37
|
+
},
|
|
38
|
+
"lg": {
|
|
39
|
+
"$value": { "value": 8, "unit": "px" },
|
|
40
|
+
"$description": "Large width for surfaces"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"interactive": {
|
|
44
|
+
"focus": {
|
|
45
|
+
"$value": { "value": 2, "unit": "px" },
|
|
46
|
+
"$description": "Border width for focus ring",
|
|
47
|
+
"$extensions": {
|
|
48
|
+
"mode": {
|
|
49
|
+
"high-dpi": { "value": 1.5, "unit": "px" }
|
|
50
|
+
}
|
|
29
51
|
}
|
|
30
52
|
}
|
|
31
53
|
}
|