@phcdevworks/spectre-tokens 2.4.0 → 2.6.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 +172 -64
- package/dist/index.cjs +22 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -4
- package/dist/index.js +22 -22
- package/dist/index.js.map +1 -1
- package/package.json +15 -10
- package/tokens/components.json +33 -11
- package/tokens/modes.json +25 -9
- package/tokens/semantic-roles.json +69 -12
package/dist/index.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
--sp-surface-page: #f7f8fb;
|
|
3
3
|
--sp-surface-card: #ffffff;
|
|
4
4
|
--sp-surface-input: #ffffff;
|
|
5
|
-
--sp-surface-overlay: rgba(
|
|
5
|
+
--sp-surface-overlay: rgba(0, 0, 0, 0.6);
|
|
6
6
|
--sp-surface-alternate: #eef1f6;
|
|
7
7
|
--sp-surface-hero: linear-gradient(135deg, #5b6ee1 0%, #6f3fd7 100%);
|
|
8
8
|
--sp-text-on-page-default: #141b24;
|
|
@@ -294,9 +294,9 @@
|
|
|
294
294
|
--sp-button-cta-textdisabled: #8a96ad;
|
|
295
295
|
--sp-button-cta-shadow: 0 4px 14px 0 rgba(51, 109, 244, 0.39);
|
|
296
296
|
--sp-button-cta-focusring: rgba(51, 109, 244, 0.4);
|
|
297
|
-
--sp-button-accent-bg: #
|
|
298
|
-
--sp-button-accent-bghover: #
|
|
299
|
-
--sp-button-accent-bgactive: #
|
|
297
|
+
--sp-button-accent-bg: #5d28b8;
|
|
298
|
+
--sp-button-accent-bghover: #4d2393;
|
|
299
|
+
--sp-button-accent-bgactive: #401f75;
|
|
300
300
|
--sp-button-accent-bgdisabled: #ddccff;
|
|
301
301
|
--sp-button-accent-text: #ffffff;
|
|
302
302
|
--sp-button-accent-textdisabled: #8a96ad;
|
package/dist/index.js
CHANGED
|
@@ -126,9 +126,9 @@ var coreTokens = {
|
|
|
126
126
|
"focusRing": "{colors.brand.500} / 0.4"
|
|
127
127
|
},
|
|
128
128
|
"accent": {
|
|
129
|
-
"bg": "{colors.accent.
|
|
130
|
-
"bgHover": "{colors.accent.
|
|
131
|
-
"bgActive": "{colors.accent.
|
|
129
|
+
"bg": "{colors.accent.700}",
|
|
130
|
+
"bgHover": "{colors.accent.800}",
|
|
131
|
+
"bgActive": "{colors.accent.900}",
|
|
132
132
|
"bgDisabled": "{colors.accent.200}",
|
|
133
133
|
"text": "{colors.white}",
|
|
134
134
|
"textDisabled": "{colors.neutral.400}",
|
|
@@ -176,7 +176,7 @@ var coreTokens = {
|
|
|
176
176
|
"page": "{colors.neutral.50}",
|
|
177
177
|
"card": "{colors.white}",
|
|
178
178
|
"input": "{colors.white}",
|
|
179
|
-
"overlay": "{colors.
|
|
179
|
+
"overlay": "{colors.black} / 0.6",
|
|
180
180
|
"alternate": "{colors.neutral.100}",
|
|
181
181
|
"hero": "linear-gradient(135deg, {colors.indigo.500} 0%, {colors.violet.600} 100%)"
|
|
182
182
|
},
|
|
@@ -598,7 +598,7 @@ var coreTokens = {
|
|
|
598
598
|
"page": "{colors.neutral.50}",
|
|
599
599
|
"card": "{colors.white}",
|
|
600
600
|
"input": "{colors.white}",
|
|
601
|
-
"overlay": "{colors.
|
|
601
|
+
"overlay": "{colors.black} / 0.6"
|
|
602
602
|
},
|
|
603
603
|
"text": {
|
|
604
604
|
"onPage": {
|
|
@@ -820,6 +820,23 @@ var resolveValue = (tokens2, value) => {
|
|
|
820
820
|
str = str.replace(opacityRegex, (match, hex, opacity) => hexToRgba(hex, opacity));
|
|
821
821
|
return str;
|
|
822
822
|
};
|
|
823
|
+
var resolveSemanticValue = (value, tokens2) => {
|
|
824
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
825
|
+
return resolveValue(tokens2, value);
|
|
826
|
+
}
|
|
827
|
+
if (value && typeof value === "object" && "value" in value) {
|
|
828
|
+
return resolveValue(tokens2, value.value);
|
|
829
|
+
}
|
|
830
|
+
return void 0;
|
|
831
|
+
};
|
|
832
|
+
var getPath = (source, path) => path.reduce((acc, key) => acc && typeof acc === "object" ? acc[key] : void 0, source);
|
|
833
|
+
var pickSemantic = (tokens2, ...candidates) => {
|
|
834
|
+
for (const candidate of candidates) {
|
|
835
|
+
const resolved = resolveSemanticValue(candidate, tokens2);
|
|
836
|
+
if (resolved !== void 0) return resolved;
|
|
837
|
+
}
|
|
838
|
+
return void 0;
|
|
839
|
+
};
|
|
823
840
|
var createCssVariableMap = (tokens2, options = {}) => {
|
|
824
841
|
const prefix = options.prefix ?? DEFAULT_PREFIX;
|
|
825
842
|
const map = {};
|
|
@@ -968,23 +985,6 @@ var createCssVariableMap = (tokens2, options = {}) => {
|
|
|
968
985
|
}
|
|
969
986
|
return map;
|
|
970
987
|
};
|
|
971
|
-
var resolveSemanticValue = (value, tokens2) => {
|
|
972
|
-
if (typeof value === "string" || typeof value === "number") {
|
|
973
|
-
return resolveValue(tokens2, value);
|
|
974
|
-
}
|
|
975
|
-
if (value && typeof value === "object" && "value" in value) {
|
|
976
|
-
return resolveValue(tokens2, value.value);
|
|
977
|
-
}
|
|
978
|
-
return void 0;
|
|
979
|
-
};
|
|
980
|
-
var getPath = (source, path) => path.reduce((acc, key) => acc && typeof acc === "object" ? acc[key] : void 0, source);
|
|
981
|
-
var pickSemantic = (tokens2, ...candidates) => {
|
|
982
|
-
for (const candidate of candidates) {
|
|
983
|
-
const resolved = resolveSemanticValue(candidate, tokens2);
|
|
984
|
-
if (resolved !== void 0) return resolved;
|
|
985
|
-
}
|
|
986
|
-
return void 0;
|
|
987
|
-
};
|
|
988
988
|
var generateCssVariables = (tokens2, options = {}) => {
|
|
989
989
|
const selector = options.selector ?? DEFAULT_SELECTOR;
|
|
990
990
|
const prefix = options.prefix ?? DEFAULT_PREFIX;
|