@phcdevworks/spectre-tokens 4.16.0 → 4.17.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 +50 -2
- package/dist/index.cjs +140 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +91 -14
- package/dist/index.d.cts +92 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +140 -18
- package/dist/index.js.map +1 -1
- package/dist/tokens.dtcg.json +286 -14
- package/package.json +2 -2
- package/tokens/modes.json +16 -0
- package/tokens/palette.json +26 -0
- package/tokens/primitives.json +2 -1
- package/tokens/semantic-roles.json +53 -0
- package/tokens/typography.json +17 -15
package/dist/index.js
CHANGED
|
@@ -1927,6 +1927,11 @@ var coreTokens = {
|
|
|
1927
1927
|
}
|
|
1928
1928
|
},
|
|
1929
1929
|
"dark": {
|
|
1930
|
+
"decorative": {
|
|
1931
|
+
"gradient": {
|
|
1932
|
+
"action": "linear-gradient(135deg, {colors.brand.300} 0%, {colors.brand.500} 100%)"
|
|
1933
|
+
}
|
|
1934
|
+
},
|
|
1930
1935
|
"action": {
|
|
1931
1936
|
"onPage": "{colors.brand.400}",
|
|
1932
1937
|
"onSurface": "{colors.brand.400}",
|
|
@@ -2817,6 +2822,11 @@ var coreTokens = {
|
|
|
2817
2822
|
}
|
|
2818
2823
|
},
|
|
2819
2824
|
"highContrast": {
|
|
2825
|
+
"decorative": {
|
|
2826
|
+
"gradient": {
|
|
2827
|
+
"action": "linear-gradient(135deg, {colors.brand.700} 0%, {colors.brand.900} 100%)"
|
|
2828
|
+
}
|
|
2829
|
+
},
|
|
2820
2830
|
"action": {
|
|
2821
2831
|
"bg": "{colors.brand.800}",
|
|
2822
2832
|
"bgHover": "{colors.brand.900}",
|
|
@@ -4374,6 +4384,32 @@ var coreTokens = {
|
|
|
4374
4384
|
"800": "#2b251b",
|
|
4375
4385
|
"900": "#1f190e",
|
|
4376
4386
|
"950": "#0e0a05"
|
|
4387
|
+
},
|
|
4388
|
+
"bradpotts-teal": {
|
|
4389
|
+
"50": "#f1fdfc",
|
|
4390
|
+
"100": "#cef9f7",
|
|
4391
|
+
"200": "#9cf4f0",
|
|
4392
|
+
"300": "#5ae8e5",
|
|
4393
|
+
"400": "#34d1cf",
|
|
4394
|
+
"500": "#2db7b6",
|
|
4395
|
+
"600": "#249394",
|
|
4396
|
+
"700": "#1c7578",
|
|
4397
|
+
"800": "#165d61",
|
|
4398
|
+
"900": "#174d50",
|
|
4399
|
+
"950": "#092e31"
|
|
4400
|
+
},
|
|
4401
|
+
"bradpotts-ink": {
|
|
4402
|
+
"50": "#f7fafb",
|
|
4403
|
+
"100": "#f0f6f8",
|
|
4404
|
+
"200": "#dfe9ee",
|
|
4405
|
+
"300": "#c6d7df",
|
|
4406
|
+
"400": "#85a5b3",
|
|
4407
|
+
"500": "#557987",
|
|
4408
|
+
"600": "#395966",
|
|
4409
|
+
"700": "#244552",
|
|
4410
|
+
"800": "#0f2d38",
|
|
4411
|
+
"900": "#001b25",
|
|
4412
|
+
"950": "#00090f"
|
|
4377
4413
|
}
|
|
4378
4414
|
}
|
|
4379
4415
|
},
|
|
@@ -4459,7 +4495,8 @@ var coreTokens = {
|
|
|
4459
4495
|
"slow": "500ms",
|
|
4460
4496
|
"slower": "700ms",
|
|
4461
4497
|
"long": "1000ms",
|
|
4462
|
-
"slowest": "1200ms"
|
|
4498
|
+
"slowest": "1200ms",
|
|
4499
|
+
"ambient": "7000ms"
|
|
4463
4500
|
},
|
|
4464
4501
|
"easing": {
|
|
4465
4502
|
"linear": "linear",
|
|
@@ -4842,6 +4879,56 @@ var coreTokens = {
|
|
|
4842
4879
|
"zIndex": "{zIndex.modal}"
|
|
4843
4880
|
}
|
|
4844
4881
|
},
|
|
4882
|
+
"decorative": {
|
|
4883
|
+
"pattern": {
|
|
4884
|
+
"cell": {
|
|
4885
|
+
"sm": "{space.12}",
|
|
4886
|
+
"md": "{space.20}",
|
|
4887
|
+
"lg": "{space.32}",
|
|
4888
|
+
"xl": "{space.48}"
|
|
4889
|
+
},
|
|
4890
|
+
"dotRadius": {
|
|
4891
|
+
"sm": "{space.1}",
|
|
4892
|
+
"md": "{space.2}",
|
|
4893
|
+
"lg": "{space.4}"
|
|
4894
|
+
},
|
|
4895
|
+
"lineWeight": {
|
|
4896
|
+
"sm": "{space.1}",
|
|
4897
|
+
"md": "{space.2}",
|
|
4898
|
+
"lg": "{space.4}"
|
|
4899
|
+
},
|
|
4900
|
+
"opacity": {
|
|
4901
|
+
"subtle": "0.25",
|
|
4902
|
+
"muted": "0.5",
|
|
4903
|
+
"strong": "0.75"
|
|
4904
|
+
}
|
|
4905
|
+
},
|
|
4906
|
+
"fade": {
|
|
4907
|
+
"edge": {
|
|
4908
|
+
"solid": "0%",
|
|
4909
|
+
"clear": "100%"
|
|
4910
|
+
},
|
|
4911
|
+
"corner": {
|
|
4912
|
+
"solid": "0%",
|
|
4913
|
+
"clear": "50%"
|
|
4914
|
+
},
|
|
4915
|
+
"radial": {
|
|
4916
|
+
"solid": "25%",
|
|
4917
|
+
"clear": "75%"
|
|
4918
|
+
}
|
|
4919
|
+
},
|
|
4920
|
+
"shimmer": {
|
|
4921
|
+
"band": {
|
|
4922
|
+
"start": "35%",
|
|
4923
|
+
"peak": "50%",
|
|
4924
|
+
"end": "65%"
|
|
4925
|
+
},
|
|
4926
|
+
"travel": "60%"
|
|
4927
|
+
},
|
|
4928
|
+
"gradient": {
|
|
4929
|
+
"action": "linear-gradient(135deg, {colors.brand.500} 0%, {colors.brand.700} 100%)"
|
|
4930
|
+
}
|
|
4931
|
+
},
|
|
4845
4932
|
"font": {
|
|
4846
4933
|
"xs": {
|
|
4847
4934
|
"size": "0.75rem",
|
|
@@ -4926,7 +5013,9 @@ var coreTokens = {
|
|
|
4926
5013
|
"families": {
|
|
4927
5014
|
"sans": "system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",
|
|
4928
5015
|
"serif": "'Times New Roman', Times, serif",
|
|
4929
|
-
"mono": "'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace"
|
|
5016
|
+
"mono": "'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace",
|
|
5017
|
+
"heading": "{typography.families.sans}",
|
|
5018
|
+
"body": "{typography.families.sans}"
|
|
4930
5019
|
},
|
|
4931
5020
|
"scale": {
|
|
4932
5021
|
"xs": {
|
|
@@ -5010,42 +5099,42 @@ var coreTokens = {
|
|
|
5010
5099
|
},
|
|
5011
5100
|
"heading": {
|
|
5012
5101
|
"h1": {
|
|
5013
|
-
"fontFamily": "{typography.families.
|
|
5102
|
+
"fontFamily": "{typography.families.heading}",
|
|
5014
5103
|
"fontSize": "{typography.scale.4xl.fontSize}",
|
|
5015
5104
|
"lineHeight": "{typography.scale.4xl.lineHeight}",
|
|
5016
5105
|
"fontWeight": 800,
|
|
5017
5106
|
"letterSpacing": "{typography.scale.4xl.letterSpacing}"
|
|
5018
5107
|
},
|
|
5019
5108
|
"h2": {
|
|
5020
|
-
"fontFamily": "{typography.families.
|
|
5109
|
+
"fontFamily": "{typography.families.heading}",
|
|
5021
5110
|
"fontSize": "{typography.scale.3xl.fontSize}",
|
|
5022
5111
|
"lineHeight": "{typography.scale.3xl.lineHeight}",
|
|
5023
5112
|
"fontWeight": 700,
|
|
5024
5113
|
"letterSpacing": "{typography.scale.3xl.letterSpacing}"
|
|
5025
5114
|
},
|
|
5026
5115
|
"h3": {
|
|
5027
|
-
"fontFamily": "{typography.families.
|
|
5116
|
+
"fontFamily": "{typography.families.heading}",
|
|
5028
5117
|
"fontSize": "{typography.scale.2xl.fontSize}",
|
|
5029
5118
|
"lineHeight": "{typography.scale.2xl.lineHeight}",
|
|
5030
5119
|
"fontWeight": 700,
|
|
5031
5120
|
"letterSpacing": "{typography.scale.2xl.letterSpacing}"
|
|
5032
5121
|
},
|
|
5033
5122
|
"h4": {
|
|
5034
|
-
"fontFamily": "{typography.families.
|
|
5123
|
+
"fontFamily": "{typography.families.heading}",
|
|
5035
5124
|
"fontSize": "{typography.scale.xl.fontSize}",
|
|
5036
5125
|
"lineHeight": "{typography.scale.xl.lineHeight}",
|
|
5037
5126
|
"fontWeight": 600,
|
|
5038
5127
|
"letterSpacing": "{typography.scale.xl.letterSpacing}"
|
|
5039
5128
|
},
|
|
5040
5129
|
"h5": {
|
|
5041
|
-
"fontFamily": "{typography.families.
|
|
5130
|
+
"fontFamily": "{typography.families.heading}",
|
|
5042
5131
|
"fontSize": "{typography.scale.xl.fontSize}",
|
|
5043
5132
|
"lineHeight": "{typography.scale.xl.lineHeight}",
|
|
5044
5133
|
"fontWeight": 600,
|
|
5045
5134
|
"letterSpacing": "{typography.scale.xl.letterSpacing}"
|
|
5046
5135
|
},
|
|
5047
5136
|
"h6": {
|
|
5048
|
-
"fontFamily": "{typography.families.
|
|
5137
|
+
"fontFamily": "{typography.families.heading}",
|
|
5049
5138
|
"fontSize": "{typography.scale.xl.fontSize}",
|
|
5050
5139
|
"lineHeight": "{typography.scale.xl.lineHeight}",
|
|
5051
5140
|
"fontWeight": 600,
|
|
@@ -5053,7 +5142,7 @@ var coreTokens = {
|
|
|
5053
5142
|
}
|
|
5054
5143
|
},
|
|
5055
5144
|
"body": {
|
|
5056
|
-
"fontFamily": "{typography.families.
|
|
5145
|
+
"fontFamily": "{typography.families.body}",
|
|
5057
5146
|
"fontSize": "{typography.scale.md.fontSize}",
|
|
5058
5147
|
"lineHeight": "{typography.scale.md.lineHeight}",
|
|
5059
5148
|
"fontWeight": 400,
|
|
@@ -5061,42 +5150,42 @@ var coreTokens = {
|
|
|
5061
5150
|
},
|
|
5062
5151
|
"display": {
|
|
5063
5152
|
"1": {
|
|
5064
|
-
"fontFamily": "{typography.families.
|
|
5153
|
+
"fontFamily": "{typography.families.heading}",
|
|
5065
5154
|
"fontSize": "{typography.scale.4xl.fontSize}",
|
|
5066
5155
|
"lineHeight": "{typography.scale.4xl.lineHeight}",
|
|
5067
5156
|
"fontWeight": 800,
|
|
5068
5157
|
"letterSpacing": "{typography.scale.4xl.letterSpacing}"
|
|
5069
5158
|
},
|
|
5070
5159
|
"2": {
|
|
5071
|
-
"fontFamily": "{typography.families.
|
|
5160
|
+
"fontFamily": "{typography.families.heading}",
|
|
5072
5161
|
"fontSize": "{typography.scale.4xl.fontSize}",
|
|
5073
5162
|
"lineHeight": "{typography.scale.4xl.lineHeight}",
|
|
5074
5163
|
"fontWeight": 800,
|
|
5075
5164
|
"letterSpacing": "{typography.scale.4xl.letterSpacing}"
|
|
5076
5165
|
},
|
|
5077
5166
|
"3": {
|
|
5078
|
-
"fontFamily": "{typography.families.
|
|
5167
|
+
"fontFamily": "{typography.families.heading}",
|
|
5079
5168
|
"fontSize": "{typography.scale.4xl.fontSize}",
|
|
5080
5169
|
"lineHeight": "{typography.scale.4xl.lineHeight}",
|
|
5081
5170
|
"fontWeight": 700,
|
|
5082
5171
|
"letterSpacing": "{typography.scale.4xl.letterSpacing}"
|
|
5083
5172
|
},
|
|
5084
5173
|
"4": {
|
|
5085
|
-
"fontFamily": "{typography.families.
|
|
5174
|
+
"fontFamily": "{typography.families.heading}",
|
|
5086
5175
|
"fontSize": "{typography.scale.4xl.fontSize}",
|
|
5087
5176
|
"lineHeight": "{typography.scale.4xl.lineHeight}",
|
|
5088
5177
|
"fontWeight": 700,
|
|
5089
5178
|
"letterSpacing": "{typography.scale.4xl.letterSpacing}"
|
|
5090
5179
|
},
|
|
5091
5180
|
"5": {
|
|
5092
|
-
"fontFamily": "{typography.families.
|
|
5181
|
+
"fontFamily": "{typography.families.heading}",
|
|
5093
5182
|
"fontSize": "{typography.scale.3xl.fontSize}",
|
|
5094
5183
|
"lineHeight": "{typography.scale.3xl.lineHeight}",
|
|
5095
5184
|
"fontWeight": 600,
|
|
5096
5185
|
"letterSpacing": "{typography.scale.3xl.letterSpacing}"
|
|
5097
5186
|
},
|
|
5098
5187
|
"6": {
|
|
5099
|
-
"fontFamily": "{typography.families.
|
|
5188
|
+
"fontFamily": "{typography.families.heading}",
|
|
5100
5189
|
"fontSize": "{typography.scale.2xl.fontSize}",
|
|
5101
5190
|
"lineHeight": "{typography.scale.2xl.lineHeight}",
|
|
5102
5191
|
"fontWeight": 600,
|
|
@@ -5104,7 +5193,7 @@ var coreTokens = {
|
|
|
5104
5193
|
}
|
|
5105
5194
|
},
|
|
5106
5195
|
"lead": {
|
|
5107
|
-
"fontFamily": "{typography.families.
|
|
5196
|
+
"fontFamily": "{typography.families.body}",
|
|
5108
5197
|
"fontSize": "{typography.scale.xl.fontSize}",
|
|
5109
5198
|
"lineHeight": "{typography.scale.xl.lineHeight}",
|
|
5110
5199
|
"fontWeight": 400,
|
|
@@ -5436,8 +5525,12 @@ var createCssVariableMap = (tokens2, options = {}) => {
|
|
|
5436
5525
|
assign(toVariableName(prefix, "aspect-ratio", key), value);
|
|
5437
5526
|
});
|
|
5438
5527
|
}
|
|
5528
|
+
const familyReference = (value) => {
|
|
5529
|
+
const key = typeof value === "string" ? value.match(/^\{typography\.families\.([^}]+)\}$/)?.[1] : void 0;
|
|
5530
|
+
return key === void 0 ? void 0 : `var(${toVariableName(prefix, "font-family", key)})`;
|
|
5531
|
+
};
|
|
5439
5532
|
Object.entries(baseTokens.typography.families).forEach(([key, value]) => {
|
|
5440
|
-
assign(toVariableName(prefix, "font-family", key), value);
|
|
5533
|
+
assign(toVariableName(prefix, "font-family", key), familyReference(value) ?? value);
|
|
5441
5534
|
});
|
|
5442
5535
|
const typographyScale = baseTokens.typography?.scale ?? {};
|
|
5443
5536
|
const fontScale = baseTokens.font;
|
|
@@ -5460,7 +5553,8 @@ var createCssVariableMap = (tokens2, options = {}) => {
|
|
|
5460
5553
|
});
|
|
5461
5554
|
const assignRole = (rolePrefixParts, entry) => {
|
|
5462
5555
|
Object.entries(ROLE_FIELD_SUFFIXES).forEach(([field, suffix]) => {
|
|
5463
|
-
|
|
5556
|
+
const value = entry[field];
|
|
5557
|
+
assign(toVariableName(prefix, ...rolePrefixParts, suffix), field === "fontFamily" && familyReference(value) || value);
|
|
5464
5558
|
});
|
|
5465
5559
|
};
|
|
5466
5560
|
const heading = baseTokens.typography?.heading;
|
|
@@ -5510,6 +5604,17 @@ var createCssVariableMap = (tokens2, options = {}) => {
|
|
|
5510
5604
|
Object.entries(baseTokens.opacity).forEach(([key, value]) => {
|
|
5511
5605
|
assign(toVariableName(prefix, "opacity", key), value);
|
|
5512
5606
|
});
|
|
5607
|
+
const decorative = baseTokens.decorative;
|
|
5608
|
+
if (isPlainObject(decorative)) {
|
|
5609
|
+
const assignDecorative = (node, parts) => {
|
|
5610
|
+
if (!isPlainObject(node)) {
|
|
5611
|
+
assign(toVariableName(prefix, ...parts.map(kebabCase)), node);
|
|
5612
|
+
return;
|
|
5613
|
+
}
|
|
5614
|
+
Object.entries(node).forEach(([key, nested]) => assignDecorative(nested, [...parts, key]));
|
|
5615
|
+
};
|
|
5616
|
+
Object.entries(decorative).filter(([group]) => group !== "gradient").forEach(([group, node]) => assignDecorative(node, [group]));
|
|
5617
|
+
}
|
|
5513
5618
|
assign(toVariableName(prefix, "focus-ring-width"), baseTokens.accessibility.focusRing.width);
|
|
5514
5619
|
assign(toVariableName(prefix, "focus-ring-offset"), baseTokens.accessibility.focusRing.offset);
|
|
5515
5620
|
assign(toVariableName(prefix, "focus-ring-style"), baseTokens.accessibility.focusRing.style);
|
|
@@ -5655,6 +5760,23 @@ var generateCssVariables = (tokens2, options = {}) => {
|
|
|
5655
5760
|
addDark(varName, actionValue(getPath(darkAction, [key]) ?? value));
|
|
5656
5761
|
addHighContrast(varName, actionValue(getPath(highContrastAction, [key]) ?? value));
|
|
5657
5762
|
});
|
|
5763
|
+
const gradientValue = (value) => {
|
|
5764
|
+
const raw = isPlainObject(value) && "value" in value ? value.value : value;
|
|
5765
|
+
if (typeof raw !== "string") return pickSemantic(tokens2, value);
|
|
5766
|
+
return resolveValue(
|
|
5767
|
+
tokens2,
|
|
5768
|
+
raw.replace(/\{colors\.brand\.([^}]+)\}/g, (_, step) => `var(${toVariableName(prefix, "action", step)})`)
|
|
5769
|
+
);
|
|
5770
|
+
};
|
|
5771
|
+
const decorativeGradients = getPath(tokens2, ["decorative", "gradient"]);
|
|
5772
|
+
const darkGradients = getPath(darkMode, ["decorative", "gradient"]);
|
|
5773
|
+
const highContrastGradients = getPath(highContrastMode, ["decorative", "gradient"]);
|
|
5774
|
+
Object.entries(isPlainObject(decorativeGradients) ? decorativeGradients : {}).forEach(([key, value]) => {
|
|
5775
|
+
const varName = toVariableName(prefix, "gradient", kebabPathSegment(key));
|
|
5776
|
+
addBase(varName, gradientValue(value));
|
|
5777
|
+
addDark(varName, gradientValue(getPath(darkGradients, [key]) ?? value));
|
|
5778
|
+
addHighContrast(varName, gradientValue(getPath(highContrastGradients, [key]) ?? value));
|
|
5779
|
+
});
|
|
5658
5780
|
const addButtonOverrides = (mode, add) => {
|
|
5659
5781
|
const buttons = getPath(mode, ["buttons"]);
|
|
5660
5782
|
if (!isPlainObject(buttons)) return;
|