@sps-woodland/tokens 7.2.8 → 7.2.9
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/config/config.js +15 -20
- package/config/config.js.map +1 -1
- package/config/formats/fontFace.js +7 -35
- package/config/formats/fontFace.js.map +1 -1
- package/config/formats/jsSimpleObject.js +6 -34
- package/config/formats/jsSimpleObject.js.map +1 -1
- package/config/formats/utility-class-builders/color.js +1 -4
- package/config/formats/utility-class-builders/color.js.map +1 -1
- package/config/formats/utility-class-builders/grid.js +1 -4
- package/config/formats/utility-class-builders/grid.js.map +1 -1
- package/config/formats/utility-class-builders/icon.js +4 -7
- package/config/formats/utility-class-builders/icon.js.map +1 -1
- package/config/formats/utility-class-builders/iconSize.js +1 -4
- package/config/formats/utility-class-builders/iconSize.js.map +1 -1
- package/config/formats/utility-class-builders/spacing.js +3 -6
- package/config/formats/utility-class-builders/spacing.js.map +1 -1
- package/config/formats/utility-class-builders/typeSize.js +1 -4
- package/config/formats/utility-class-builders/typeSize.js.map +1 -1
- package/config/formats/utility-class-builders/typeWeight.js +1 -4
- package/config/formats/utility-class-builders/typeWeight.js.map +1 -1
- package/config/formats/utilityClasses.js +20 -48
- package/config/formats/utilityClasses.js.map +1 -1
- package/config/formats/utils.js +2 -7
- package/config/formats/utils.js.map +1 -1
- package/config/formats/vanillaExtractSprinkleValues.js +5 -33
- package/config/formats/vanillaExtractSprinkleValues.js.map +1 -1
- package/config/transforms/attrFont.js +2 -7
- package/config/transforms/attrFont.js.map +1 -1
- package/config/transforms/attrGridColumns.js +2 -7
- package/config/transforms/attrGridColumns.js.map +1 -1
- package/config-src/config.ts +67 -65
- package/config-src/formats/fontFace.ts +1 -1
- package/config-src/formats/jsSimpleObject.ts +1 -1
- package/config-src/formats/utility-class-builders/color.ts +1 -1
- package/config-src/formats/utility-class-builders/grid.ts +1 -1
- package/config-src/formats/utility-class-builders/icon.ts +2 -2
- package/config-src/formats/utility-class-builders/iconSize.ts +1 -1
- package/config-src/formats/utility-class-builders/spacing.ts +2 -2
- package/config-src/formats/utility-class-builders/typeSize.ts +1 -1
- package/config-src/formats/utility-class-builders/typeWeight.ts +1 -1
- package/config-src/formats/utilityClasses.ts +9 -9
- package/config-src/formats/vanillaExtractSprinkleValues.ts +1 -1
- package/config-src/tsconfig.json +0 -1
- package/lib/css/tokens.css +1 -1
- package/lib/css/utils.css +1 -1
- package/lib/font.css +21 -21
- package/lib/scss/tokens.scss +1 -1
- package/lib/scss/utils.scss +1 -1
- package/package.json +3 -3
package/config/config.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
1
|
/* eslint-env node */
|
|
7
2
|
/* eslint-disable import/no-import-module-exports */
|
|
8
3
|
/* eslint-disable import/no-commonjs */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
import StyleDictionary from "style-dictionary";
|
|
5
|
+
import { config } from "dotenv";
|
|
6
|
+
import "./formats/fontFace.js";
|
|
7
|
+
import "./formats/jsSimpleObject.js";
|
|
8
|
+
import "./formats/utilityClasses.js";
|
|
9
|
+
import "./formats/vanillaExtractSprinkleValues.js";
|
|
10
|
+
import "./transforms/attrFont.js";
|
|
11
|
+
import "./transforms/attrGridColumns.js";
|
|
12
|
+
config({ path: "../../../.env" });
|
|
18
13
|
function configureTransforms(sdConfig) {
|
|
19
14
|
for (const platform of Object.values(sdConfig.platforms)) {
|
|
20
15
|
platform.transforms = [
|
|
@@ -26,7 +21,7 @@ function configureTransforms(sdConfig) {
|
|
|
26
21
|
}
|
|
27
22
|
return sdConfig;
|
|
28
23
|
}
|
|
29
|
-
|
|
24
|
+
StyleDictionary.extend(configureTransforms({
|
|
30
25
|
source: ["./src/tokens/**/*.json"],
|
|
31
26
|
platforms: {
|
|
32
27
|
"css-fonts": {
|
|
@@ -37,7 +32,7 @@ module.exports = configureTransforms({
|
|
|
37
32
|
destination: "font.css",
|
|
38
33
|
},
|
|
39
34
|
],
|
|
40
|
-
transforms:
|
|
35
|
+
transforms: StyleDictionary.transformGroup.css,
|
|
41
36
|
},
|
|
42
37
|
css: {
|
|
43
38
|
buildPath: "lib/css/",
|
|
@@ -51,7 +46,7 @@ module.exports = configureTransforms({
|
|
|
51
46
|
destination: "utils.css",
|
|
52
47
|
},
|
|
53
48
|
],
|
|
54
|
-
transforms:
|
|
49
|
+
transforms: StyleDictionary.transformGroup.css,
|
|
55
50
|
},
|
|
56
51
|
scss: {
|
|
57
52
|
buildPath: "lib/scss/",
|
|
@@ -65,7 +60,7 @@ module.exports = configureTransforms({
|
|
|
65
60
|
destination: "utils.scss",
|
|
66
61
|
},
|
|
67
62
|
],
|
|
68
|
-
transforms:
|
|
63
|
+
transforms: StyleDictionary.transformGroup.scss,
|
|
69
64
|
},
|
|
70
65
|
ts: {
|
|
71
66
|
files: [
|
|
@@ -82,8 +77,8 @@ module.exports = configureTransforms({
|
|
|
82
77
|
destination: "src/vanilla-extract/sprinkleValues.ts",
|
|
83
78
|
},
|
|
84
79
|
],
|
|
85
|
-
transforms:
|
|
80
|
+
transforms: StyleDictionary.transformGroup.js,
|
|
86
81
|
},
|
|
87
82
|
},
|
|
88
|
-
});
|
|
83
|
+
})).buildAllPlatforms();
|
|
89
84
|
//# sourceMappingURL=config.js.map
|
package/config/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../config-src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../config-src/config.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,oDAAoD;AACpD,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AAW;YACtB,KAAK,EAAE;gBACL;oBACE,MAAM,EAAE,gBAAgB;oBACxB,WAAW,EAAE,aAAa;iBAC3B;gBACD;oBACE,MAAM,EAAE,sBAAsB;oBAC9B,WAAW,EAAE,YAAY;iBAC1B;aACF;YACD,UAAU,EAAE,eAAe,CAAC,cAAc,CAAC,IAAI;SAChD;QACD,EAAE,EAAE;YACF,KAAK,EAAE;gBACL;oBACE,MAAM,EAAE,4BAA4B;oBACpC,WAAW,EAAE,mBAAmB;iBACjC;gBACD;oBACE,MAAM,EAAE,0BAA0B;oBAClC,WAAW,EAAE,eAAe;iBAC7B;gBACD;oBACE,MAAM,EAAE,iCAAiC;oBACzC,WAAW,EAAE,uCAAuC;iBACrD;aACF;YACD,UAAU,EAAE,eAAe,CAAC,cAAc,CAAC,EAAE;SAC9C;KACF;CACF,CAAC,CACH,CAAC,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,35 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
1
|
/* eslint-env node */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
import StyleDictionary from "style-dictionary";
|
|
3
|
+
import * as prettier from "prettier";
|
|
4
|
+
import { trim } from "./utils.js";
|
|
33
5
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src
|
|
34
6
|
const MAP_EXT_TO_FORMAT_NAME = {
|
|
35
7
|
woff2: "woff2",
|
|
@@ -42,17 +14,17 @@ const MAP_EXT_TO_FORMAT_NAME = {
|
|
|
42
14
|
function tokenIsFontAssetToken(token) {
|
|
43
15
|
return token.attributes.category === "asset" && token.attributes.type === "font";
|
|
44
16
|
}
|
|
45
|
-
|
|
17
|
+
StyleDictionary.registerFormat({
|
|
46
18
|
name: "font-face",
|
|
47
19
|
formatter: ({ dictionary: { allTokens }, file }) => {
|
|
48
20
|
const fontFaceRules = allTokens
|
|
49
21
|
.filter(tokenIsFontAssetToken)
|
|
50
22
|
.map((token) => {
|
|
51
23
|
const { attributes: { family, weight, style }, formats, value: path, } = token;
|
|
52
|
-
const urls = formats.map((extension) =>
|
|
24
|
+
const urls = formats.map((extension) => trim(`
|
|
53
25
|
url("${process.env.ASSETS_BASE_PATH}/${path}.${extension}") format("${MAP_EXT_TO_FORMAT_NAME[extension]}")
|
|
54
26
|
`)).join(",");
|
|
55
|
-
return
|
|
27
|
+
return trim(`
|
|
56
28
|
@font-face {
|
|
57
29
|
font-family: "${family}";
|
|
58
30
|
font-style: ${style};
|
|
@@ -64,7 +36,7 @@ style_dictionary_1.default.registerFormat({
|
|
|
64
36
|
})
|
|
65
37
|
.join("\n");
|
|
66
38
|
return prettier.format(`
|
|
67
|
-
${
|
|
39
|
+
${StyleDictionary.formatHelpers.fileHeader({ file })}
|
|
68
40
|
${fontFaceRules}
|
|
69
41
|
* { font-family: "Source Sans Pro", sans-serif; }
|
|
70
42
|
`, { parser: "css" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fontFace.js","sourceRoot":"","sources":["../../config-src/formats/fontFace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fontFace.js","sourceRoot":"","sources":["../../config-src/formats/fontFace.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,kEAAkE;AAClE,MAAM,sBAAsB,GAAG;IAC7B,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,mBAAmB;CACzB,CAAC;AAaF,SAAS,qBAAqB,CAAC,KAAuB;IACpD,OAAO,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,MAAM,CAAC;AACnF,CAAC;AAED,eAAe,CAAC,cAAc,CAAC;IAC7B,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACjD,MAAM,aAAa,GAAG,SAAS;aAC5B,MAAM,CAAC,qBAAqB,CAAC;aAC7B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACb,MAAM,EACJ,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EACrC,OAAO,EACP,KAAK,EAAE,IAAI,GACZ,GAAG,KAAK,CAAC;YAEV,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CACtB,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC;mBACX,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,IAAI,IAAI,SAAS,cAAc,sBAAsB,CAAC,SAAS,CAAC;WACxG,CAAC,CACH,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEZ,OAAO,IAAI,CAAC;;4BAEQ,MAAM;0BACR,KAAK;2BACJ,MAAM;mBACd,IAAI;;;SAGd,CAAC,CAAC;QACL,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,OAAO,QAAQ,CAAC,MAAM,CAAC;QACnB,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC;QAClD,aAAa;;KAEhB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,38 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const style_dictionary_1 = __importDefault(require("style-dictionary"));
|
|
30
|
-
const prettier = __importStar(require("prettier"));
|
|
31
|
-
const utils_1 = require("./utils");
|
|
32
|
-
style_dictionary_1.default.registerFormat({
|
|
1
|
+
import StyleDictionary from "style-dictionary";
|
|
2
|
+
import * as prettier from "prettier";
|
|
3
|
+
import { simplifyTokens } from "./utils.js";
|
|
4
|
+
StyleDictionary.registerFormat({
|
|
33
5
|
name: "javascript/simple-object",
|
|
34
6
|
formatter({ dictionary }) {
|
|
35
|
-
const tokens =
|
|
7
|
+
const tokens = simplifyTokens(dictionary.tokens);
|
|
36
8
|
return prettier.format(`
|
|
37
9
|
/* eslint-disable */
|
|
38
10
|
/**
|
|
@@ -43,7 +15,7 @@ style_dictionary_1.default.registerFormat({
|
|
|
43
15
|
`, { parser: "typescript" });
|
|
44
16
|
},
|
|
45
17
|
});
|
|
46
|
-
|
|
18
|
+
StyleDictionary.registerFormat({
|
|
47
19
|
name: "javascript/detailed-object",
|
|
48
20
|
formatter({ dictionary }) {
|
|
49
21
|
return prettier.format(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsSimpleObject.js","sourceRoot":"","sources":["../../config-src/formats/jsSimpleObject.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsSimpleObject.js","sourceRoot":"","sources":["../../config-src/formats/jsSimpleObject.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,eAAe,CAAC,cAAc,CAAC;IAC7B,IAAI,EAAE,0BAA0B;IAChC,SAAS,CAAC,EAAE,UAAU,EAAE;QACtB,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACjD,OAAO,QAAQ,CAAC,MAAM,CAAC;;;;;;4CAMiB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;KACtE,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,CAAC,cAAc,CAAC;IAC7B,IAAI,EAAE,4BAA4B;IAClC,SAAS,CAAC,EAAE,UAAU,EAAE;QACtB,OAAO,QAAQ,CAAC,MAAM,CAAC;;;;;;gDAMqB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;KAC9E,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.colorClasses = void 0;
|
|
4
|
-
exports.colorClasses = {
|
|
1
|
+
export const colorClasses = {
|
|
5
2
|
appliesTo: (token) => token.attributes.category === "color",
|
|
6
3
|
build(token, dictionary) {
|
|
7
4
|
const { type: tType, item: tItem } = token.attributes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/color.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/color.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAwB;IAC/C,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,OAAO;IAC3D,KAAK,CAAC,KAAK,EAAE,UAAU;QACrB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC;QACtD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAG,GAAG,KAAK,GAAG,SAAS,EAAE,CAAC;QAEzC,OAAO;SACF,SAAS;iBACD,KAAK,CAAC,iBAAiB;;YAE5B,SAAS;4BACO,KAAK,CAAC,iBAAiB;;gBAEnC,SAAS;wBACD,KAAK,CAAC,iBAAiB;;wBAEvB,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,iBAAiB;;KAEjF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gridClasses = void 0;
|
|
4
|
-
exports.gridClasses = {
|
|
1
|
+
export const gridClasses = {
|
|
5
2
|
appliesTo: (token) => token.attributes.category === "grid"
|
|
6
3
|
&& token.attributes.type === "columns",
|
|
7
4
|
build(token, dictionary) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/grid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/grid.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAwB;IAC9C,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,MAAM;WACrD,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS;IACxC,KAAK,CAAC,KAAK,EAAE,UAAU;QACrB;;;WAGG;QACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;QACtD,MAAM,iBAAiB,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;aAC7C,IAAI,CAAC,IAAI,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;gBACT,KAAK,GAAG,CAAC;8BACK,KAAK,GAAG,CAAC;;OAEhC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,OAAO;;;iCAGsB,mBAAmB;eACrC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB;;QAE3D,iBAAiB;KACpB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.iconClasses = void 0;
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
exports.iconClasses = {
|
|
1
|
+
import { trim } from "../utils.js";
|
|
2
|
+
export const iconClasses = {
|
|
6
3
|
appliesTo: (token) => token.attributes.category === "icon"
|
|
7
4
|
&& token.attributes.item === "character",
|
|
8
5
|
build(token, dictionary) {
|
|
@@ -10,13 +7,13 @@ exports.iconClasses = {
|
|
|
10
7
|
let colorRule = "";
|
|
11
8
|
const colorToken = dictionary.tokens.icon[token.attributes.type].color;
|
|
12
9
|
if (colorToken) {
|
|
13
|
-
colorRule =
|
|
10
|
+
colorRule = trim(`
|
|
14
11
|
${className} {
|
|
15
12
|
color: ${colorToken.variableReference} !important;
|
|
16
13
|
}
|
|
17
14
|
`);
|
|
18
15
|
}
|
|
19
|
-
return
|
|
16
|
+
return trim(`${colorRule}
|
|
20
17
|
${className}::before {
|
|
21
18
|
content: ${token.variableReference} !important;
|
|
22
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/icon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,MAAM,CAAC,MAAM,WAAW,GAAwB;IAC9C,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,MAAM;WACrD,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,WAAW;IAC1C,KAAK,CAAC,KAAK,EAAE,UAAU;QACrB,MAAM,SAAS,GAAG,SAAS,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QAEnD,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;QACvE,IAAI,UAAU,EAAE;YACd,SAAS,GAAG,IAAI,CAAC;UACb,SAAS;mBACA,UAAU,CAAC,iBAAiB;;OAExC,CAAC,CAAC;SACJ;QAED,OAAO,IAAI,CAAC,GAAG,SAAS;QACpB,SAAS;mBACE,KAAK,CAAC,iBAAiB;;KAErC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.iconSizeClasses = void 0;
|
|
4
|
-
exports.iconSizeClasses = {
|
|
1
|
+
export const iconSizeClasses = {
|
|
5
2
|
appliesTo: (token) => token.attributes.category === "size"
|
|
6
3
|
&& token.attributes.type === "icon",
|
|
7
4
|
build(token) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconSize.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/iconSize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"iconSize.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/iconSize.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAwB;IAClD,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,MAAM;WACrD,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,MAAM;IACrC,KAAK,CAAC,KAAK;QACT,OAAO;mBACQ,KAAK,CAAC,UAAU,CAAC,IAAI;qBACnB,KAAK,CAAC,iBAAiB;;KAEvC,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.spacingClasses = void 0;
|
|
4
|
-
const utils_1 = require("../utils");
|
|
1
|
+
import { trim } from "../utils.js";
|
|
5
2
|
function buildClasses(item, value) {
|
|
6
3
|
return ["margin", "padding"].map((prop) => {
|
|
7
4
|
const p = prop.charAt(0);
|
|
8
|
-
return
|
|
5
|
+
return trim(`
|
|
9
6
|
.${p}-${item} {
|
|
10
7
|
${prop}: ${value} !important;
|
|
11
8
|
}
|
|
@@ -32,7 +29,7 @@ function buildClasses(item, value) {
|
|
|
32
29
|
`);
|
|
33
30
|
}).join("\n");
|
|
34
31
|
}
|
|
35
|
-
|
|
32
|
+
export const spacingClasses = {
|
|
36
33
|
appliesTo: (token) => token.attributes.category === "size"
|
|
37
34
|
&& token.attributes.type === "spacing",
|
|
38
35
|
build(token) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spacing.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/spacing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spacing.js","sourceRoot":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KAAK,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;CAChE,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.typeSizeClasses = void 0;
|
|
4
|
-
exports.typeSizeClasses = {
|
|
1
|
+
export const typeSizeClasses = {
|
|
5
2
|
appliesTo: (token) => token.attributes.category === "size"
|
|
6
3
|
&& token.attributes.type === "type",
|
|
7
4
|
build(token, dictionary) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeSize.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/typeSize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeSize.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/typeSize.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAwB;IAClD,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,MAAM;WACrD,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,MAAM;IACrC,KAAK,CAAC,KAAK,EAAE,UAAU;QACrB,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG;YACrB,IAAI,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC;YACzB,IAAI,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC;SAC5B,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAE5B,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,KAAK,MAAM,EAAE;YACvC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;YACxE,SAAS,GAAG;gBACF,KAAK,CAAC,UAAU,CAAC,IAAI;uBACd,KAAK,CAAC,iBAAiB;yBACrB,OAAO,CAAC,iBAAiB;;OAE3C,CAAC;SACH;QAED,OAAO;SACF,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI;UAC9B,IAAI,KAAK,KAAK,CAAC,iBAAiB;;QAElC,SAAS;KACZ,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.typeWeightClasses = void 0;
|
|
4
|
-
exports.typeWeightClasses = {
|
|
1
|
+
export const typeWeightClasses = {
|
|
5
2
|
appliesTo: (token) => token.attributes.category === "type"
|
|
6
3
|
&& token.attributes.type === "weight",
|
|
7
4
|
build(token) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeWeight.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/typeWeight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeWeight.js","sourceRoot":"","sources":["../../../config-src/formats/utility-class-builders/typeWeight.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAwB;IACpD,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,MAAM;WACrD,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,QAAQ;IACvC,KAAK,CAAC,KAAK;QACT,OAAO;YACC,KAAK,CAAC,UAAU,CAAC,IAAI;uBACV,KAAK,CAAC,iBAAiB;;KAEzC,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,49 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const style_dictionary_1 = __importDefault(require("style-dictionary"));
|
|
30
|
-
const prettier = __importStar(require("prettier"));
|
|
31
|
-
const utils_1 = require("./utils");
|
|
32
|
-
const color_1 = require("./utility-class-builders/color");
|
|
33
|
-
const grid_1 = require("./utility-class-builders/grid");
|
|
34
|
-
const icon_1 = require("./utility-class-builders/icon");
|
|
35
|
-
const iconSize_1 = require("./utility-class-builders/iconSize");
|
|
36
|
-
const spacing_1 = require("./utility-class-builders/spacing");
|
|
37
|
-
const typeSize_1 = require("./utility-class-builders/typeSize");
|
|
38
|
-
const typeWeight_1 = require("./utility-class-builders/typeWeight");
|
|
1
|
+
import StyleDictionary from "style-dictionary";
|
|
2
|
+
import * as prettier from "prettier";
|
|
3
|
+
import { trim } from "./utils.js";
|
|
4
|
+
import { colorClasses } from "./utility-class-builders/color.js";
|
|
5
|
+
import { gridClasses } from "./utility-class-builders/grid.js";
|
|
6
|
+
import { iconClasses } from "./utility-class-builders/icon.js";
|
|
7
|
+
import { iconSizeClasses } from "./utility-class-builders/iconSize.js";
|
|
8
|
+
import { spacingClasses } from "./utility-class-builders/spacing.js";
|
|
9
|
+
import { typeSizeClasses } from "./utility-class-builders/typeSize.js";
|
|
10
|
+
import { typeWeightClasses } from "./utility-class-builders/typeWeight.js";
|
|
39
11
|
const classBuilders = [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
12
|
+
colorClasses,
|
|
13
|
+
gridClasses,
|
|
14
|
+
iconClasses,
|
|
15
|
+
iconSizeClasses,
|
|
16
|
+
spacingClasses,
|
|
17
|
+
typeSizeClasses,
|
|
18
|
+
typeWeightClasses,
|
|
47
19
|
];
|
|
48
20
|
function variableReference(varName, format) {
|
|
49
21
|
switch (format) {
|
|
@@ -63,13 +35,13 @@ function addVariableReferences(allTokens, format) {
|
|
|
63
35
|
function buildClasses(token, dictionary) {
|
|
64
36
|
const applicableBuilder = classBuilders.find((builder) => builder.appliesTo(token));
|
|
65
37
|
if (applicableBuilder) {
|
|
66
|
-
return
|
|
38
|
+
return trim(applicableBuilder.build(token, dictionary));
|
|
67
39
|
}
|
|
68
40
|
// console.log("unhandled:", token);
|
|
69
41
|
return "";
|
|
70
42
|
}
|
|
71
43
|
["css", "scss"].forEach((lang) => {
|
|
72
|
-
|
|
44
|
+
StyleDictionary.registerFormat({
|
|
73
45
|
name: `${lang}/utility-classes`,
|
|
74
46
|
formatter({ file, dictionary }) {
|
|
75
47
|
addVariableReferences(dictionary.allTokens, lang);
|
|
@@ -81,7 +53,7 @@ function buildClasses(token, dictionary) {
|
|
|
81
53
|
.filter(Boolean)
|
|
82
54
|
.join("\n");
|
|
83
55
|
return prettier.format(`
|
|
84
|
-
${
|
|
56
|
+
${StyleDictionary.formatHelpers.fileHeader({ file })}
|
|
85
57
|
${builtClasses}
|
|
86
58
|
${staticClasses}
|
|
87
59
|
`, { parser: lang });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilityClasses.js","sourceRoot":"","sources":["../../config-src/formats/utilityClasses.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utilityClasses.js","sourceRoot":"","sources":["../../config-src/formats/utilityClasses.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAG3E,MAAM,aAAa,GAA0B;IAC3C,YAAY;IACZ,WAAW;IACX,WAAW;IACX,eAAe;IACf,cAAc;IACd,eAAe;IACf,iBAAiB;CAClB,CAAC;AAEF,SAAS,iBAAiB,CAAC,OAAe,EAAE,MAAc;IACxD,QAAQ,MAAM,EAAE;QACd,KAAK,KAAK;YACR,OAAO,SAAS,OAAO,GAAG,CAAC;QAE7B,KAAK,MAAM;YACT,OAAO,IAAI,OAAO,EAAE,CAAC;QAEvB;YACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;KAChD;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,SAA6B,EAAE,MAAc;IAC1E,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE;QAC7B,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KACjE;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAuB,EAAE,UAAsB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{ value: true });
|
|
3
|
-
exports.trim = exports.simplifyTokens = void 0;
|
|
4
|
-
function simplifyTokens(tokens) {
|
|
1
|
+
export function simplifyTokens(tokens) {
|
|
5
2
|
if (tokens.hasOwnProperty("value")) {
|
|
6
3
|
return tokens.value;
|
|
7
4
|
}
|
|
@@ -11,9 +8,7 @@ function simplifyTokens(tokens) {
|
|
|
11
8
|
return acc;
|
|
12
9
|
}, {});
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
function trim(str) {
|
|
11
|
+
export function trim(str) {
|
|
16
12
|
return str.replace(/^\s+/gm, "").trim();
|
|
17
13
|
}
|
|
18
|
-
exports.trim = trim;
|
|
19
14
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../config-src/formats/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../config-src/formats/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,MAAW;IACxC,IAAI,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;QAClC,OAAO,MAAM,CAAC,KAAK,CAAC;KACrB;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;SACvB,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACnB,GAAG,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACvC,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAW;IAC9B,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
2
|
var t = {};
|
|
27
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -33,17 +9,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
33
9
|
}
|
|
34
10
|
return t;
|
|
35
11
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const style_dictionary_1 = __importDefault(require("style-dictionary"));
|
|
41
|
-
const prettier = __importStar(require("prettier"));
|
|
42
|
-
const utils_1 = require("./utils");
|
|
43
|
-
style_dictionary_1.default.registerFormat({
|
|
12
|
+
import StyleDictionary from "style-dictionary";
|
|
13
|
+
import * as prettier from "prettier";
|
|
14
|
+
import { simplifyTokens } from "./utils.js";
|
|
15
|
+
StyleDictionary.registerFormat({
|
|
44
16
|
name: "vanilla-extract/sprinkle-values",
|
|
45
17
|
formatter({ dictionary }) {
|
|
46
|
-
const _a =
|
|
18
|
+
const _a = simplifyTokens(dictionary.tokens), { color: colorTokens, size: sizeTokens } = _a, otherTokens = __rest(_a, ["color", "size"]);
|
|
47
19
|
const { type: typeSizeTokens, spacing: spacingSizeTokens } = sizeTokens, otherSizeTokens = __rest(sizeTokens, ["type", "spacing"]);
|
|
48
20
|
const colors = Object.keys(colorTokens)
|
|
49
21
|
.reduce((acc, key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vanillaExtractSprinkleValues.js","sourceRoot":"","sources":["../../config-src/formats/vanillaExtractSprinkleValues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vanillaExtractSprinkleValues.js","sourceRoot":"","sources":["../../config-src/formats/vanillaExtractSprinkleValues.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,eAAe,CAAC,cAAc,CAAC;IAC7B,IAAI,EAAE,iCAAiC;IACvC,SAAS,CAAC,EAAE,UAAU,EAAE;QACtB,MAAM,KAIF,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,EAJ/B,EACJ,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,UAAU,OAEmB,EADhC,WAAW,cAHV,iBAIL,CAAoC,CAAC;QACtC,MAAM,EACJ,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,iBAAiB,KAExB,UAAU,EADT,eAAe,UAChB,UAAU,EAJR,mBAIL,CAAa,CAAC;QAEf,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;aACpC,MAAM,CAAC,C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AM,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;aAClD;iBAAM;gBACL,MAAM,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;aACpC;SACF;QAED,OAAO,QAAQ,CAAC,MAAM,CAAC;;;;;;oDAMyB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;KAC9E,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const style_dictionary_1 = __importDefault(require("style-dictionary"));
|
|
7
|
-
style_dictionary_1.default.registerTransform({
|
|
1
|
+
import StyleDictionary from "style-dictionary";
|
|
2
|
+
StyleDictionary.registerTransform({
|
|
8
3
|
name: "attribute/font",
|
|
9
4
|
type: "attribute",
|
|
10
5
|
matcher: (token) => token.attributes.category === "asset"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attrFont.js","sourceRoot":"","sources":["../../config-src/transforms/attrFont.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"attrFont.js","sourceRoot":"","sources":["../../config-src/transforms/attrFont.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAE/C,eAAe,CAAC,iBAAiB,CAAC;IAChC,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,OAAO;WACpD,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,MAAM;IACrC,WAAW,CAAC,KAAK;QACf,MAAM,CACJ,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACN,GAAG,KAAK,CAAC,IAAI,CAAC;QACf,OAAO;YACL,QAAQ;YACR,IAAI;YACJ,MAAM;YACN,MAAM;YACN,KAAK;SACN,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const style_dictionary_1 = __importDefault(require("style-dictionary"));
|
|
7
|
-
style_dictionary_1.default.registerTransform({
|
|
1
|
+
import StyleDictionary from "style-dictionary";
|
|
2
|
+
StyleDictionary.registerTransform({
|
|
8
3
|
name: "attribute/grid-columns",
|
|
9
4
|
type: "attribute",
|
|
10
5
|
matcher: (token) => token.attributes.category === "grid"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attrGridColumns.js","sourceRoot":"","sources":["../../config-src/transforms/attrGridColumns.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"attrGridColumns.js","sourceRoot":"","sources":["../../config-src/transforms/attrGridColumns.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAE/C,eAAe,CAAC,iBAAiB,CAAC;IAChC,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,MAAM;WACnD,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS;IACxC,WAAW,CAAC,KAAK;QACf,OAAO;YACL,QAAQ,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;iBAC7B,IAAI,CAAC,KAAK,CAAC;iBACX,IAAI,CAAC,GAAG,CAAC;SACb,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/config-src/config.ts
CHANGED
|
@@ -5,13 +5,13 @@ import StyleDictionary from "style-dictionary";
|
|
|
5
5
|
import type { Config } from "style-dictionary";
|
|
6
6
|
import { config } from "dotenv";
|
|
7
7
|
|
|
8
|
-
import "./formats/fontFace";
|
|
9
|
-
import "./formats/jsSimpleObject";
|
|
10
|
-
import "./formats/utilityClasses";
|
|
11
|
-
import "./formats/vanillaExtractSprinkleValues";
|
|
8
|
+
import "./formats/fontFace.js";
|
|
9
|
+
import "./formats/jsSimpleObject.js";
|
|
10
|
+
import "./formats/utilityClasses.js";
|
|
11
|
+
import "./formats/vanillaExtractSprinkleValues.js";
|
|
12
12
|
|
|
13
|
-
import "./transforms/attrFont";
|
|
14
|
-
import "./transforms/attrGridColumns";
|
|
13
|
+
import "./transforms/attrFont.js";
|
|
14
|
+
import "./transforms/attrGridColumns.js";
|
|
15
15
|
|
|
16
16
|
config({ path: "../../../.env" });
|
|
17
17
|
|
|
@@ -27,63 +27,65 @@ function configureTransforms(sdConfig: Config): Config {
|
|
|
27
27
|
return sdConfig;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
StyleDictionary.extend(
|
|
31
|
+
configureTransforms({
|
|
32
|
+
source: ["./src/tokens/**/*.json"],
|
|
33
|
+
platforms: {
|
|
34
|
+
"css-fonts": {
|
|
35
|
+
buildPath: "lib/",
|
|
36
|
+
files: [
|
|
37
|
+
{
|
|
38
|
+
format: "font-face",
|
|
39
|
+
destination: "font.css",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
transforms: StyleDictionary.transformGroup.css,
|
|
43
|
+
},
|
|
44
|
+
css: {
|
|
45
|
+
buildPath: "lib/css/",
|
|
46
|
+
files: [
|
|
47
|
+
{
|
|
48
|
+
format: "css/variables",
|
|
49
|
+
destination: "tokens.css",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
format: "css/utility-classes",
|
|
53
|
+
destination: "utils.css",
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
transforms: StyleDictionary.transformGroup.css,
|
|
57
|
+
},
|
|
58
|
+
scss: {
|
|
59
|
+
buildPath: "lib/scss/",
|
|
60
|
+
files: [
|
|
61
|
+
{
|
|
62
|
+
format: "scss/variables",
|
|
63
|
+
destination: "tokens.scss",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
format: "scss/utility-classes",
|
|
67
|
+
destination: "utils.scss",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
transforms: StyleDictionary.transformGroup.scss,
|
|
71
|
+
},
|
|
72
|
+
ts: {
|
|
73
|
+
files: [
|
|
74
|
+
{
|
|
75
|
+
format: "javascript/detailed-object",
|
|
76
|
+
destination: "src/dictionary.ts",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
format: "javascript/simple-object",
|
|
80
|
+
destination: "src/tokens.ts",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
format: "vanilla-extract/sprinkle-values",
|
|
84
|
+
destination: "src/vanilla-extract/sprinkleValues.ts",
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
transforms: StyleDictionary.transformGroup.js,
|
|
88
|
+
},
|
|
42
89
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
files: [
|
|
46
|
-
{
|
|
47
|
-
format: "css/variables",
|
|
48
|
-
destination: "tokens.css",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
format: "css/utility-classes",
|
|
52
|
-
destination: "utils.css",
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
transforms: StyleDictionary.transformGroup.css,
|
|
56
|
-
},
|
|
57
|
-
scss: {
|
|
58
|
-
buildPath: "lib/scss/",
|
|
59
|
-
files: [
|
|
60
|
-
{
|
|
61
|
-
format: "scss/variables",
|
|
62
|
-
destination: "tokens.scss",
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
format: "scss/utility-classes",
|
|
66
|
-
destination: "utils.scss",
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
transforms: StyleDictionary.transformGroup.scss,
|
|
70
|
-
},
|
|
71
|
-
ts: {
|
|
72
|
-
files: [
|
|
73
|
-
{
|
|
74
|
-
format: "javascript/detailed-object",
|
|
75
|
-
destination: "src/dictionary.ts",
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
format: "javascript/simple-object",
|
|
79
|
-
destination: "src/tokens.ts",
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
format: "vanilla-extract/sprinkle-values",
|
|
83
|
-
destination: "src/vanilla-extract/sprinkleValues.ts",
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
transforms: StyleDictionary.transformGroup.js,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
+
})
|
|
91
|
+
).buildAllPlatforms();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import StyleDictionary from "style-dictionary";
|
|
3
3
|
import type { TransformedToken } from "style-dictionary";
|
|
4
4
|
import * as prettier from "prettier";
|
|
5
|
-
import { trim } from "./utils";
|
|
5
|
+
import { trim } from "./utils.js";
|
|
6
6
|
|
|
7
7
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src
|
|
8
8
|
const MAP_EXT_TO_FORMAT_NAME = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { trim } from "../utils";
|
|
2
|
-
import type { UtilityClassBuilder } from "./UtilityClassBuilder";
|
|
1
|
+
import { trim } from "../utils.js";
|
|
2
|
+
import type { UtilityClassBuilder } from "./UtilityClassBuilder.js";
|
|
3
3
|
|
|
4
4
|
export const iconClasses: UtilityClassBuilder = {
|
|
5
5
|
appliesTo: (token) => token.attributes.category === "icon"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { trim } from "../utils";
|
|
2
|
-
import type { UtilityClassBuilder } from "./UtilityClassBuilder";
|
|
1
|
+
import { trim } from "../utils.js";
|
|
2
|
+
import type { UtilityClassBuilder } from "./UtilityClassBuilder.js";
|
|
3
3
|
|
|
4
4
|
function buildClasses(item: string, value: string): string {
|
|
5
5
|
return ["margin", "padding"].map((prop) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import StyleDictionary from "style-dictionary";
|
|
2
2
|
import type { Dictionary, TransformedToken } from "style-dictionary";
|
|
3
3
|
import * as prettier from "prettier";
|
|
4
|
-
import { trim } from "./utils";
|
|
4
|
+
import { trim } from "./utils.js";
|
|
5
5
|
|
|
6
|
-
import { colorClasses } from "./utility-class-builders/color";
|
|
7
|
-
import { gridClasses } from "./utility-class-builders/grid";
|
|
8
|
-
import { iconClasses } from "./utility-class-builders/icon";
|
|
9
|
-
import { iconSizeClasses } from "./utility-class-builders/iconSize";
|
|
10
|
-
import { spacingClasses } from "./utility-class-builders/spacing";
|
|
11
|
-
import { typeSizeClasses } from "./utility-class-builders/typeSize";
|
|
12
|
-
import { typeWeightClasses } from "./utility-class-builders/typeWeight";
|
|
13
|
-
import type { UtilityClassBuilder } from "./utility-class-builders/UtilityClassBuilder";
|
|
6
|
+
import { colorClasses } from "./utility-class-builders/color.js";
|
|
7
|
+
import { gridClasses } from "./utility-class-builders/grid.js";
|
|
8
|
+
import { iconClasses } from "./utility-class-builders/icon.js";
|
|
9
|
+
import { iconSizeClasses } from "./utility-class-builders/iconSize.js";
|
|
10
|
+
import { spacingClasses } from "./utility-class-builders/spacing.js";
|
|
11
|
+
import { typeSizeClasses } from "./utility-class-builders/typeSize.js";
|
|
12
|
+
import { typeWeightClasses } from "./utility-class-builders/typeWeight.js";
|
|
13
|
+
import type { UtilityClassBuilder } from "./utility-class-builders/UtilityClassBuilder.js";
|
|
14
14
|
|
|
15
15
|
const classBuilders: UtilityClassBuilder[] = [
|
|
16
16
|
colorClasses,
|
package/config-src/tsconfig.json
CHANGED
package/lib/css/tokens.css
CHANGED
package/lib/css/utils.css
CHANGED
package/lib/font.css
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Mon, 20 Mar 2023 17:06:06 GMT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
@font-face {
|
|
7
7
|
font-family: "Source Sans Pro";
|
|
8
8
|
font-style: normal;
|
|
9
9
|
font-weight: 400;
|
|
10
|
-
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
10
|
+
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-sans-pro-v9-latin-regular.woff2")
|
|
11
11
|
format("woff2"),
|
|
12
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
12
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-sans-pro-v9-latin-regular.woff")
|
|
13
13
|
format("woff");
|
|
14
14
|
font-display: fallback;
|
|
15
15
|
}
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
font-family: "Source Sans Pro";
|
|
18
18
|
font-style: italic;
|
|
19
19
|
font-weight: 400;
|
|
20
|
-
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
20
|
+
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-sans-pro-v9-latin-italic.woff2")
|
|
21
21
|
format("woff2"),
|
|
22
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
22
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-sans-pro-v9-latin-italic.woff")
|
|
23
23
|
format("woff");
|
|
24
24
|
font-display: fallback;
|
|
25
25
|
}
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
font-family: "Source Sans Pro";
|
|
28
28
|
font-style: normal;
|
|
29
29
|
font-weight: 600;
|
|
30
|
-
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
30
|
+
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-sans-pro-v9-latin-600.woff2")
|
|
31
31
|
format("woff2"),
|
|
32
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
32
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-sans-pro-v9-latin-600.woff")
|
|
33
33
|
format("woff");
|
|
34
34
|
font-display: fallback;
|
|
35
35
|
}
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
font-family: "Source Sans Pro";
|
|
38
38
|
font-style: italic;
|
|
39
39
|
font-weight: 600;
|
|
40
|
-
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
40
|
+
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-sans-pro-v9-latin-600italic.woff2")
|
|
41
41
|
format("woff2"),
|
|
42
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
42
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-sans-pro-v9-latin-600italic.woff")
|
|
43
43
|
format("woff");
|
|
44
44
|
font-display: fallback;
|
|
45
45
|
}
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
font-family: "Source Code Pro";
|
|
48
48
|
font-style: normal;
|
|
49
49
|
font-weight: 400;
|
|
50
|
-
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
50
|
+
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-code-pro-v6-latin-regular.woff2")
|
|
51
51
|
format("woff2"),
|
|
52
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
52
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-code-pro-v6-latin-regular.woff")
|
|
53
53
|
format("woff");
|
|
54
54
|
font-display: fallback;
|
|
55
55
|
}
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
font-family: "Source Code Pro";
|
|
58
58
|
font-style: italic;
|
|
59
59
|
font-weight: 400;
|
|
60
|
-
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
60
|
+
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-code-pro-v6-latin-italic.woff2")
|
|
61
61
|
format("woff2"),
|
|
62
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
62
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-code-pro-v6-latin-italic.woff")
|
|
63
63
|
format("woff");
|
|
64
64
|
font-display: fallback;
|
|
65
65
|
}
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
font-family: "Source Code Pro";
|
|
68
68
|
font-style: normal;
|
|
69
69
|
font-weight: 600;
|
|
70
|
-
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
70
|
+
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-code-pro-v6-latin-600.woff2")
|
|
71
71
|
format("woff2"),
|
|
72
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
72
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-code-pro-v6-latin-600.woff")
|
|
73
73
|
format("woff");
|
|
74
74
|
font-display: fallback;
|
|
75
75
|
}
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
font-family: "Source Code Pro";
|
|
78
78
|
font-style: italic;
|
|
79
79
|
font-weight: 600;
|
|
80
|
-
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
80
|
+
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-code-pro-v6-latin-600italic.woff2")
|
|
81
81
|
format("woff2"),
|
|
82
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
82
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/source-code-pro-v6-latin-600italic.woff")
|
|
83
83
|
format("woff");
|
|
84
84
|
font-display: fallback;
|
|
85
85
|
}
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
font-family: "SPS-Icons";
|
|
88
88
|
font-style: normal;
|
|
89
89
|
font-weight: 400;
|
|
90
|
-
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
90
|
+
src: url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/icomoon-sps-icons.svg")
|
|
91
91
|
format("svg"),
|
|
92
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
92
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/icomoon-sps-icons.truetype")
|
|
93
93
|
format("undefined"),
|
|
94
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
94
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/icomoon-sps-icons.woff")
|
|
95
95
|
format("woff"),
|
|
96
|
-
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.
|
|
96
|
+
url("https://cdn.dev.spsc.io/web/framework/design-system/ds/7.2.9/assets/fonts/icomoon-sps-icons.woff2")
|
|
97
97
|
format("woff2");
|
|
98
98
|
font-display: fallback;
|
|
99
99
|
}
|
package/lib/scss/tokens.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// Do not edit directly
|
|
3
|
-
// Generated on
|
|
3
|
+
// Generated on Mon, 20 Mar 2023 17:06:07 GMT
|
|
4
4
|
|
|
5
5
|
$asset-font-source-sans-pro-400-normal: "fonts/source-sans-pro-v9-latin-regular";
|
|
6
6
|
$asset-font-source-sans-pro-400-italic: "fonts/source-sans-pro-v9-latin-italic";
|
package/lib/scss/utils.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/tokens",
|
|
3
3
|
"description": "SPS Design System design tokens",
|
|
4
|
-
"version": "7.2.
|
|
4
|
+
"version": "7.2.9",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/tokens",
|
|
8
8
|
"homepage": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/tokens#readme",
|
|
9
|
+
"type": "module",
|
|
9
10
|
"module": "./lib/index.es.js",
|
|
10
11
|
"main": "./lib/index.es.js",
|
|
11
12
|
"types": "./lib/index.d.ts",
|
|
12
|
-
"comments": "switching to `type` module breaks the build process so leaving it as default (commonjs)",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
15
|
"require": "./lib/index.cjs.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "pnpm build:tokens && (pnpm build:js && pnpm build:types) && pnpm build:move-ve-css",
|
|
45
|
-
"build:tokens": "tsc -p config-src/tsconfig.json &&
|
|
45
|
+
"build:tokens": "tsc -p config-src/tsconfig.json && node ./config/config.js",
|
|
46
46
|
"build:js": "vite build",
|
|
47
47
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
48
48
|
"build:move-ve-css": "mv lib/style.css lib/vanilla-extract/",
|