@greensight/gts 1.0.0-beta.1 → 1.0.0-beta.11
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/classes/Config/index.d.ts.map +1 -1
- package/commands/generate/index.d.ts.map +1 -1
- package/index.cjs +35 -45
- package/index.mjs +589 -576
- package/modules/typography/typographyFromTokenManager/module.d.ts.map +1 -1
- package/modules/utilities/types.d.ts +32 -5
- package/modules/utilities/types.d.ts.map +1 -1
- package/modules/utilities/utils.d.ts +12 -22
- package/modules/utilities/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var de = (r, e, o) => e in r ? ue(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o;
|
|
3
|
+
var w = (r, e, o) => de(r, typeof e != "symbol" ? e + "" : e, o);
|
|
4
4
|
import k from "path";
|
|
5
|
-
import { tsImport as
|
|
6
|
-
import { existsSync as
|
|
7
|
-
import { readFile as V, mkdir as fe, writeFile as
|
|
8
|
-
import { resolve as
|
|
9
|
-
const
|
|
5
|
+
import { tsImport as ye } from "ts-import";
|
|
6
|
+
import { existsSync as M } from "node:fs";
|
|
7
|
+
import { readFile as V, mkdir as fe, writeFile as ge, rm as pe } from "node:fs/promises";
|
|
8
|
+
import { resolve as C } from "node:path";
|
|
9
|
+
const p = class p {
|
|
10
10
|
static resolveReadPath(e) {
|
|
11
11
|
if (!e || !e.trim())
|
|
12
12
|
throw new Error("File path must be a non-empty string");
|
|
13
|
-
return
|
|
13
|
+
return C(p.baseDir, e);
|
|
14
14
|
}
|
|
15
15
|
static resolveWritePath(e, o) {
|
|
16
|
-
const
|
|
16
|
+
const t = C(p.baseDir, o ?? "");
|
|
17
17
|
return {
|
|
18
|
-
targetDir:
|
|
19
|
-
targetPath:
|
|
18
|
+
targetDir: t,
|
|
19
|
+
targetPath: C(t, e)
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
static handleReadError(e, o) {
|
|
@@ -25,91 +25,92 @@ const h = class h {
|
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
static async read(e, o = "utf8") {
|
|
28
|
-
const
|
|
28
|
+
const t = p.resolveReadPath(e);
|
|
29
29
|
try {
|
|
30
|
-
return await V(
|
|
30
|
+
return await V(t, { encoding: o });
|
|
31
31
|
} catch (n) {
|
|
32
|
-
|
|
32
|
+
p.handleReadError(n, t);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
static async readBuffer(e) {
|
|
36
|
-
const o =
|
|
36
|
+
const o = p.resolveReadPath(e);
|
|
37
37
|
try {
|
|
38
38
|
return await V(o);
|
|
39
|
-
} catch (
|
|
40
|
-
|
|
39
|
+
} catch (t) {
|
|
40
|
+
p.handleReadError(t, o);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
static async readJson(e) {
|
|
44
|
-
const o =
|
|
44
|
+
const o = p.resolveReadPath(e);
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
46
|
+
const t = await V(o, { encoding: "utf8" });
|
|
47
47
|
try {
|
|
48
|
-
return JSON.parse(
|
|
48
|
+
return JSON.parse(t);
|
|
49
49
|
} catch (n) {
|
|
50
50
|
throw new Error(`Failed to parse JSON from "${o}": ${n.message}`);
|
|
51
51
|
}
|
|
52
|
-
} catch (
|
|
53
|
-
|
|
52
|
+
} catch (t) {
|
|
53
|
+
p.handleReadError(t, o);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
static async write(e, o = "",
|
|
57
|
-
const { directory: n, overwrite: s = !0 } =
|
|
58
|
-
if (!s &&
|
|
59
|
-
throw new Error(`File ${
|
|
60
|
-
return await fe(a, { recursive: !0 }), await
|
|
56
|
+
static async write(e, o = "", t = {}) {
|
|
57
|
+
const { directory: n, overwrite: s = !0 } = t, { targetDir: a, targetPath: i } = p.resolveWritePath(e, n);
|
|
58
|
+
if (!s && M(i))
|
|
59
|
+
throw new Error(`File ${i} already exists`);
|
|
60
|
+
return await fe(a, { recursive: !0 }), await ge(i, o, { encoding: "utf8" }), i;
|
|
61
61
|
}
|
|
62
|
-
static async writeWithExtension(e, o,
|
|
62
|
+
static async writeWithExtension(e, o, t = "", n) {
|
|
63
63
|
const s = o.startsWith(".") ? o : `.${o}`, a = `${e}${s}`;
|
|
64
|
-
return
|
|
64
|
+
return p.write(a, t, n);
|
|
65
65
|
}
|
|
66
66
|
static exists(e) {
|
|
67
|
-
const o =
|
|
68
|
-
return
|
|
67
|
+
const o = p.resolveReadPath(e);
|
|
68
|
+
return M(o);
|
|
69
69
|
}
|
|
70
70
|
static async delete(e, o) {
|
|
71
|
-
const { targetPath:
|
|
72
|
-
|
|
71
|
+
const { targetPath: t } = p.resolveWritePath(e, o);
|
|
72
|
+
M(t) && await pe(t, { recursive: !0, force: !0 });
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
|
|
76
|
-
let
|
|
75
|
+
w(p, "baseDir", process.cwd());
|
|
76
|
+
let y = p;
|
|
77
77
|
const $ = class $ {
|
|
78
78
|
static async create() {
|
|
79
|
-
if (
|
|
79
|
+
if (y.exists($.configFileName))
|
|
80
80
|
throw new Error("The file already exists");
|
|
81
|
-
await
|
|
81
|
+
await y.write($.configFileName, "", { overwrite: !1 });
|
|
82
82
|
}
|
|
83
83
|
async load() {
|
|
84
84
|
try {
|
|
85
|
-
const e = await
|
|
85
|
+
const e = await ye.compile(
|
|
86
86
|
`${k.resolve(process.cwd(), $.configFileName)}`
|
|
87
87
|
);
|
|
88
|
-
if (!e)
|
|
88
|
+
if (!e)
|
|
89
|
+
throw new Error("gts.config.ts must default-export a configuration object");
|
|
89
90
|
return e.default;
|
|
90
91
|
} catch (e) {
|
|
91
92
|
console.error("Cannot find module gts.config.ts", e);
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
};
|
|
95
|
-
|
|
96
|
-
let
|
|
97
|
-
const
|
|
96
|
+
w($, "configFileName", "gts.config.ts");
|
|
97
|
+
let v = $;
|
|
98
|
+
const he = (r) => {
|
|
98
99
|
const e = new URLSearchParams();
|
|
99
|
-
return Object.keys(
|
|
100
|
-
Array.isArray(
|
|
100
|
+
return Object.keys(r).forEach((o) => {
|
|
101
|
+
Array.isArray(r[o]) ? r[o].forEach((t) => e.append(`${o}[]`, t)) : e.append(o, r[o]);
|
|
101
102
|
}), e;
|
|
102
|
-
},
|
|
103
|
+
}, me = (r, e = 50) => {
|
|
103
104
|
const o = [];
|
|
104
|
-
for (let
|
|
105
|
-
o.push(
|
|
105
|
+
for (let t = 0; t < r.length; t += e)
|
|
106
|
+
o.push(r.slice(t, t + e));
|
|
106
107
|
return o;
|
|
107
108
|
};
|
|
108
|
-
class
|
|
109
|
+
class O {
|
|
109
110
|
constructor(e, o) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
w(this, "figmaToken");
|
|
112
|
+
w(this, "fileId");
|
|
113
|
+
w(this, "onTimeMeasureHandler");
|
|
113
114
|
this.figmaToken = e, this.fileId = o;
|
|
114
115
|
}
|
|
115
116
|
setOnTimeMeasureHandler(e) {
|
|
@@ -118,35 +119,35 @@ class P {
|
|
|
118
119
|
static async returnJSON(e) {
|
|
119
120
|
const o = await e.json();
|
|
120
121
|
if (!e.ok) {
|
|
121
|
-
let
|
|
122
|
-
throw new Error(
|
|
122
|
+
let t = "Request failed";
|
|
123
|
+
throw new Error(t);
|
|
123
124
|
}
|
|
124
125
|
return o;
|
|
125
126
|
}
|
|
126
|
-
async performControlledRequest(e, { params: o = {}, timeout:
|
|
127
|
-
var
|
|
127
|
+
async performControlledRequest(e, { params: o = {}, timeout: t = 3e4, abortController: n = new AbortController() } = {}) {
|
|
128
|
+
var m;
|
|
128
129
|
if (!this.figmaToken || !this.fileId)
|
|
129
|
-
throw new Error("
|
|
130
|
-
const s = Object.entries(o).reduce((
|
|
130
|
+
throw new Error("figmaToken and fileId are required in gts.config.ts");
|
|
131
|
+
const s = Object.entries(o).reduce((g, [h, b]) => typeof b < "u" ? { ...g, [h]: b } : g, {}), a = `https://api.figma.com/v1${e}${s && Object.keys(s).length ? `?${he(s)}` : ""}`;
|
|
131
132
|
console.log("endpoinWithParams=", a);
|
|
132
|
-
const
|
|
133
|
+
const i = setTimeout(() => n.abort(), t), l = {
|
|
133
134
|
"Content-Type": "application/json",
|
|
134
135
|
...this.figmaToken && { "X-Figma-Token": this.figmaToken }
|
|
135
136
|
}, c = {
|
|
136
137
|
method: "GET",
|
|
137
|
-
headers:
|
|
138
|
+
headers: l,
|
|
138
139
|
signal: n.signal
|
|
139
|
-
}, u = performance.now(),
|
|
140
|
-
clearTimeout(
|
|
141
|
-
const
|
|
142
|
-
return (
|
|
140
|
+
}, u = performance.now(), d = await fetch(`${a}`, c);
|
|
141
|
+
clearTimeout(i);
|
|
142
|
+
const f = performance.now() - u;
|
|
143
|
+
return (m = this.onTimeMeasureHandler) == null || m.call(this, a, l, f), d;
|
|
143
144
|
}
|
|
144
145
|
async request(e, o) {
|
|
145
146
|
var n;
|
|
146
|
-
const
|
|
147
|
+
const t = await this.performControlledRequest(e, {
|
|
147
148
|
...o
|
|
148
149
|
});
|
|
149
|
-
return (n =
|
|
150
|
+
return (n = t.headers.get("content-type")) != null && n.includes("application/json") ? O.returnJSON(t) : t;
|
|
150
151
|
}
|
|
151
152
|
async getComponents() {
|
|
152
153
|
return this.request(`/files/${this.fileId}/components`);
|
|
@@ -155,62 +156,62 @@ class P {
|
|
|
155
156
|
return this.request(`/files/${this.fileId}/styles`);
|
|
156
157
|
}
|
|
157
158
|
async getNodes(e) {
|
|
158
|
-
const o =
|
|
159
|
+
const o = me(e).map(
|
|
159
160
|
(s) => this.request(`/files/${this.fileId}/nodes`, { params: { ids: s.join(",") } })
|
|
160
|
-
),
|
|
161
|
+
), t = await Promise.all(o);
|
|
161
162
|
return {
|
|
162
|
-
...
|
|
163
|
-
nodes:
|
|
163
|
+
...t[0],
|
|
164
|
+
nodes: t.reduce((s, a) => ({ ...s, ...a.nodes }), {})
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
|
-
const q = (
|
|
168
|
+
const q = (r, e) => {
|
|
168
169
|
const o = Array.isArray(e) ? e : e.split(".");
|
|
169
|
-
let
|
|
170
|
+
let t = r;
|
|
170
171
|
for (const n of o) {
|
|
171
|
-
if (
|
|
172
|
-
|
|
172
|
+
if (t == null || typeof t != "object") return;
|
|
173
|
+
t = t[n];
|
|
173
174
|
}
|
|
174
|
-
return
|
|
175
|
-
}, H = (
|
|
176
|
-
if (!e || typeof e != "object") return
|
|
177
|
-
if (!
|
|
178
|
-
const o = { ...
|
|
179
|
-
for (const
|
|
180
|
-
e.hasOwnProperty(
|
|
175
|
+
return t;
|
|
176
|
+
}, H = (r, e) => {
|
|
177
|
+
if (!e || typeof e != "object") return r;
|
|
178
|
+
if (!r || typeof r != "object") return e;
|
|
179
|
+
const o = { ...r };
|
|
180
|
+
for (const t in e)
|
|
181
|
+
e.hasOwnProperty(t) && (typeof e[t] == "object" && e[t] !== null && typeof o[t] == "object" && o[t] !== null ? o[t] = H(o[t], e[t]) : o[t] = e[t]);
|
|
181
182
|
return o;
|
|
182
183
|
};
|
|
183
|
-
function x(
|
|
184
|
-
if (
|
|
184
|
+
function x(r, e) {
|
|
185
|
+
if (r === e)
|
|
185
186
|
return !0;
|
|
186
|
-
if (
|
|
187
|
-
return
|
|
188
|
-
if (typeof
|
|
187
|
+
if (r == null || e == null)
|
|
188
|
+
return r === e;
|
|
189
|
+
if (typeof r != typeof e)
|
|
189
190
|
return !1;
|
|
190
|
-
if (
|
|
191
|
-
return
|
|
192
|
-
if (
|
|
193
|
-
return
|
|
194
|
-
if (Array.isArray(
|
|
195
|
-
if (
|
|
191
|
+
if (r instanceof Date && e instanceof Date)
|
|
192
|
+
return r.getTime() === e.getTime();
|
|
193
|
+
if (r instanceof RegExp && e instanceof RegExp)
|
|
194
|
+
return r.toString() === e.toString();
|
|
195
|
+
if (Array.isArray(r) && Array.isArray(e)) {
|
|
196
|
+
if (r.length !== e.length)
|
|
196
197
|
return !1;
|
|
197
|
-
for (let o = 0; o <
|
|
198
|
-
if (!x(
|
|
198
|
+
for (let o = 0; o < r.length; o++)
|
|
199
|
+
if (!x(r[o], e[o]))
|
|
199
200
|
return !1;
|
|
200
201
|
return !0;
|
|
201
202
|
}
|
|
202
|
-
if (typeof
|
|
203
|
-
const o = Object.keys(
|
|
204
|
-
if (o.length !==
|
|
203
|
+
if (typeof r == "object" && typeof e == "object") {
|
|
204
|
+
const o = Object.keys(r), t = Object.keys(e);
|
|
205
|
+
if (o.length !== t.length)
|
|
205
206
|
return !1;
|
|
206
207
|
for (const n of o)
|
|
207
|
-
if (!
|
|
208
|
+
if (!t.includes(n) || !x(r[n], e[n]))
|
|
208
209
|
return !1;
|
|
209
210
|
return !0;
|
|
210
211
|
}
|
|
211
212
|
return !1;
|
|
212
213
|
}
|
|
213
|
-
const
|
|
214
|
+
const K = {
|
|
214
215
|
color: {},
|
|
215
216
|
effect: {},
|
|
216
217
|
text: {},
|
|
@@ -219,13 +220,13 @@ const R = {
|
|
|
219
220
|
class be {
|
|
220
221
|
constructor(e) {
|
|
221
222
|
// files
|
|
222
|
-
|
|
223
|
-
|
|
223
|
+
w(this, "tokensDir");
|
|
224
|
+
w(this, "manifestPath");
|
|
224
225
|
// result data
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
w(this, "variables");
|
|
227
|
+
w(this, "styles");
|
|
227
228
|
// flags
|
|
228
|
-
|
|
229
|
+
w(this, "loaded", !1);
|
|
229
230
|
this.tokensDir = e || "", this.manifestPath = k.join(this.tokensDir, "manifest.json");
|
|
230
231
|
}
|
|
231
232
|
isLoaded() {
|
|
@@ -234,9 +235,9 @@ class be {
|
|
|
234
235
|
/** to camelCase */
|
|
235
236
|
normalizeKey(e) {
|
|
236
237
|
const o = e.trim();
|
|
237
|
-
return o && o.replace(/[-_\s]+/g, " ").split(" ").filter((
|
|
238
|
-
const s =
|
|
239
|
-
return n === 0 ?
|
|
238
|
+
return o && o.replace(/[-_\s]+/g, " ").split(" ").filter((t) => t.length).map((t, n) => {
|
|
239
|
+
const s = t.charAt(0), a = t.slice(1);
|
|
240
|
+
return n === 0 ? t : s.toUpperCase() + a;
|
|
240
241
|
}).join("");
|
|
241
242
|
}
|
|
242
243
|
/**
|
|
@@ -244,9 +245,9 @@ class be {
|
|
|
244
245
|
*/
|
|
245
246
|
parseVariableString(e) {
|
|
246
247
|
if (typeof e != "string") return e;
|
|
247
|
-
const o = /^\{(.+)\}$/,
|
|
248
|
-
if (
|
|
249
|
-
const n =
|
|
248
|
+
const o = /^\{(.+)\}$/, t = e.match(o);
|
|
249
|
+
if (t) {
|
|
250
|
+
const n = t[1].trim();
|
|
250
251
|
return `{${this.normalizeKey(n)}}`;
|
|
251
252
|
}
|
|
252
253
|
return e;
|
|
@@ -256,7 +257,7 @@ class be {
|
|
|
256
257
|
*/
|
|
257
258
|
createVariableFileList(e) {
|
|
258
259
|
return Object.entries(e).flatMap(
|
|
259
|
-
([o,
|
|
260
|
+
([o, t]) => Object.entries(t.modes).flatMap(
|
|
260
261
|
([n, s]) => s.map((a) => ({
|
|
261
262
|
fileName: a,
|
|
262
263
|
modeName: this.normalizeKey(n.trim()),
|
|
@@ -266,20 +267,20 @@ class be {
|
|
|
266
267
|
);
|
|
267
268
|
}
|
|
268
269
|
parseValue(e) {
|
|
269
|
-
return e && (typeof e == "string" ? this.parseVariableString(e) : typeof e != "object" ? e : Array.isArray(e) ? e.map((o) => this.parseValue(o)) : Object.entries(e).reduce((o, [
|
|
270
|
+
return e && (typeof e == "string" ? this.parseVariableString(e) : typeof e != "object" ? e : Array.isArray(e) ? e.map((o) => this.parseValue(o)) : Object.entries(e).reduce((o, [t, n]) => ({ ...o, [t]: this.parseValue(n) }), {}));
|
|
270
271
|
}
|
|
271
272
|
getTokensFromFile(e, o) {
|
|
272
|
-
return Object.entries(e).reduce((
|
|
273
|
-
...
|
|
273
|
+
return Object.entries(e).reduce((t, [n, s]) => "$type" in s && "$value" in s ? {
|
|
274
|
+
...t,
|
|
274
275
|
[this.normalizeKey(n)]: {
|
|
275
276
|
type: s.$type,
|
|
276
277
|
description: s.$description,
|
|
277
278
|
value: o ? { [this.normalizeKey(o)]: this.parseValue(s.$value) } : this.parseValue(s.$value)
|
|
278
279
|
}
|
|
279
|
-
} : { ...
|
|
280
|
+
} : { ...t, [this.normalizeKey(n)]: this.getTokensFromFile(s, o) }, {});
|
|
280
281
|
}
|
|
281
|
-
processTokensFile(e, o,
|
|
282
|
-
const n = this.normalizeKey(
|
|
282
|
+
processTokensFile(e, o, t) {
|
|
283
|
+
const n = this.normalizeKey(t), s = this.getTokensFromFile(e, o);
|
|
283
284
|
return { [n]: s };
|
|
284
285
|
}
|
|
285
286
|
/**
|
|
@@ -287,10 +288,10 @@ class be {
|
|
|
287
288
|
*/
|
|
288
289
|
async loadVariableFiles(e) {
|
|
289
290
|
return Promise.all(
|
|
290
|
-
e.map(async ({ fileName: o, modeName:
|
|
291
|
+
e.map(async ({ fileName: o, modeName: t, collectionName: n }) => {
|
|
291
292
|
try {
|
|
292
|
-
const s = k.join(this.tokensDir, o), a = await
|
|
293
|
-
return this.processTokensFile(a,
|
|
293
|
+
const s = k.join(this.tokensDir, o), a = await y.readJson(s);
|
|
294
|
+
return this.processTokensFile(a, t, n);
|
|
294
295
|
} catch (s) {
|
|
295
296
|
return console.warn(`Failed to load variable file: ${k.join(this.tokensDir, o)}`, s), {};
|
|
296
297
|
}
|
|
@@ -298,15 +299,15 @@ class be {
|
|
|
298
299
|
);
|
|
299
300
|
}
|
|
300
301
|
mergeVariables(e) {
|
|
301
|
-
return e.reduce((o,
|
|
302
|
+
return e.reduce((o, t) => H(o, t), {});
|
|
302
303
|
}
|
|
303
304
|
/**
|
|
304
305
|
* Loads and processes all token variables from manifest collections
|
|
305
306
|
*/
|
|
306
307
|
async loadTokenVariables(e) {
|
|
307
308
|
try {
|
|
308
|
-
const o = this.createVariableFileList(e),
|
|
309
|
-
return this.mergeVariables(
|
|
309
|
+
const o = this.createVariableFileList(e), t = await this.loadVariableFiles(o);
|
|
310
|
+
return this.mergeVariables(t);
|
|
310
311
|
} catch (o) {
|
|
311
312
|
throw new Error(`Failed to load token variables from ${this.tokensDir}: ${o}`);
|
|
312
313
|
}
|
|
@@ -316,7 +317,7 @@ class be {
|
|
|
316
317
|
*/
|
|
317
318
|
createStyleFileList(e) {
|
|
318
319
|
return Object.entries(e).flatMap(
|
|
319
|
-
([o,
|
|
320
|
+
([o, t]) => (t == null ? void 0 : t.map((n) => ({
|
|
320
321
|
styleType: o,
|
|
321
322
|
fileName: n
|
|
322
323
|
}))) || []
|
|
@@ -327,18 +328,18 @@ class be {
|
|
|
327
328
|
*/
|
|
328
329
|
async loadStyleFiles(e) {
|
|
329
330
|
return (await Promise.all(
|
|
330
|
-
e.map(async ({ styleType:
|
|
331
|
+
e.map(async ({ styleType: t, fileName: n }) => {
|
|
331
332
|
try {
|
|
332
|
-
const s = k.join(this.tokensDir, n), a = await
|
|
333
|
-
return { styleType:
|
|
333
|
+
const s = k.join(this.tokensDir, n), a = await y.readJson(s);
|
|
334
|
+
return { styleType: t, styleTokens: a };
|
|
334
335
|
} catch (s) {
|
|
335
|
-
return console.warn(`Failed to load style file: ${k.join(this.tokensDir, n)}`, s), { styleType:
|
|
336
|
+
return console.warn(`Failed to load style file: ${k.join(this.tokensDir, n)}`, s), { styleType: t, styleTokens: {} };
|
|
336
337
|
}
|
|
337
338
|
})
|
|
338
339
|
)).reduce(
|
|
339
|
-
(
|
|
340
|
+
(t, n) => ({ ...t, [n.styleType]: this.getTokensFromFile(n.styleTokens, "") }),
|
|
340
341
|
{
|
|
341
|
-
...
|
|
342
|
+
...K
|
|
342
343
|
}
|
|
343
344
|
);
|
|
344
345
|
}
|
|
@@ -346,13 +347,13 @@ class be {
|
|
|
346
347
|
* Loads and processes all style tokens from manifest
|
|
347
348
|
*/
|
|
348
349
|
async loadStyles(e) {
|
|
349
|
-
if (!e) return { ...
|
|
350
|
+
if (!e) return { ...K };
|
|
350
351
|
const o = this.createStyleFileList(e);
|
|
351
352
|
return await this.loadStyleFiles(o);
|
|
352
353
|
}
|
|
353
354
|
async load() {
|
|
354
355
|
if (this.loaded) return;
|
|
355
|
-
const e = await
|
|
356
|
+
const e = await y.readJson(this.manifestPath);
|
|
356
357
|
if (!e)
|
|
357
358
|
throw new Error(`Failed to load manifest file from: ${this.manifestPath}`);
|
|
358
359
|
this.variables = await this.loadTokenVariables(e.collections), this.styles = await this.loadStyles(e.styles), this.loaded = !0;
|
|
@@ -397,9 +398,9 @@ class be {
|
|
|
397
398
|
*/
|
|
398
399
|
resolveVariableValue(e) {
|
|
399
400
|
if (typeof e == "object")
|
|
400
|
-
return Object.keys(e).reduce((o,
|
|
401
|
-
const n = e[
|
|
402
|
-
return s && (o[
|
|
401
|
+
return Object.keys(e).reduce((o, t) => {
|
|
402
|
+
const n = e[t], s = this.resolveVariableValueString(n, t);
|
|
403
|
+
return s && (o[t] = s), o;
|
|
403
404
|
}, {});
|
|
404
405
|
}
|
|
405
406
|
/**
|
|
@@ -410,7 +411,7 @@ class be {
|
|
|
410
411
|
*/
|
|
411
412
|
resolveVariableValueString(e, o) {
|
|
412
413
|
if (!this.isVariableReference(e)) return e;
|
|
413
|
-
const
|
|
414
|
+
const t = this.getVariablePath(e), n = this.getToken(t, o);
|
|
414
415
|
if (n)
|
|
415
416
|
return this.resolveVariableValueString(n, o);
|
|
416
417
|
}
|
|
@@ -422,8 +423,8 @@ class be {
|
|
|
422
423
|
getToken(e, o) {
|
|
423
424
|
if (!this.loaded || !this.variables)
|
|
424
425
|
throw new Error("Tokens not loaded. Call load() first.");
|
|
425
|
-
for (const
|
|
426
|
-
const n = q(
|
|
426
|
+
for (const t of Object.values(this.variables)) {
|
|
427
|
+
const n = q(t, e);
|
|
427
428
|
if (n != null && n.value && typeof n.value == "object") {
|
|
428
429
|
if (o) return n.value[o];
|
|
429
430
|
{
|
|
@@ -434,36 +435,38 @@ class be {
|
|
|
434
435
|
}
|
|
435
436
|
}
|
|
436
437
|
}
|
|
437
|
-
const
|
|
438
|
-
const e = await new
|
|
438
|
+
const It = async () => {
|
|
439
|
+
const e = await new v().load();
|
|
439
440
|
if (!e)
|
|
440
|
-
throw new Error(
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
},
|
|
444
|
-
await
|
|
445
|
-
},
|
|
441
|
+
throw new Error(
|
|
442
|
+
'Failed to load gts.config.ts. Run "npx gts-init" to create it, or ensure the file exists and default-exports a valid configuration.'
|
|
443
|
+
);
|
|
444
|
+
const { figmaToken: o, fileId: t, modules: n, manifest: s } = e, a = new O(o, t), i = new be(s);
|
|
445
|
+
s && y.exists(s) && await i.load(), await Promise.all(n.map((l) => l.executor({ figmaApiClient: a, tokenManagerClient: i })));
|
|
446
|
+
}, zt = async () => {
|
|
447
|
+
await v.create(), console.log("\x1B[32m%s\x1B[0m", "✔️ Configuration file created gts.config.ts");
|
|
448
|
+
}, we = ["xxxl", "xxl", "xl", "lg", "md", "sm", "xs", "xxs", "xxxs"], ke = (r) => parseInt(r.value, 10), $e = (r) => r.reduce(
|
|
446
449
|
(e, o) => ({
|
|
447
450
|
...e,
|
|
448
|
-
[o.name]:
|
|
451
|
+
[o.name]: ke(o)
|
|
449
452
|
}),
|
|
450
453
|
{}
|
|
451
|
-
),
|
|
452
|
-
await
|
|
453
|
-
},
|
|
454
|
-
await
|
|
455
|
-
},
|
|
456
|
-
await
|
|
457
|
-
},
|
|
458
|
-
const e =
|
|
454
|
+
), Se = async (r, e) => {
|
|
455
|
+
await y.delete(r, e);
|
|
456
|
+
}, Te = async (r, e, o) => {
|
|
457
|
+
await y.write(r, e, { directory: o });
|
|
458
|
+
}, F = async (r, e, o) => {
|
|
459
|
+
await Se(r, o), await Te(r, e, o);
|
|
460
|
+
}, je = (r) => {
|
|
461
|
+
const e = r.map(({ name: o, value: t }) => ` --${o}: ${t};`);
|
|
459
462
|
return e.length ? `.breakpoint-variables {
|
|
460
463
|
${e.join(`
|
|
461
464
|
`)}
|
|
462
465
|
}
|
|
463
466
|
` : "";
|
|
464
|
-
},
|
|
465
|
-
var
|
|
466
|
-
const e =
|
|
467
|
+
}, ve = (r) => {
|
|
468
|
+
var t;
|
|
469
|
+
const e = r.map(({ name: n, value: s }) => ` ${n}: ${s}`), o = (t = r.at(-1)) == null ? void 0 : t.name;
|
|
467
470
|
return !e.length || !o ? "" : `$breakpointList: (
|
|
468
471
|
${e.join(`,
|
|
469
472
|
`)}
|
|
@@ -471,8 +474,8 @@ ${e.join(`,
|
|
|
471
474
|
|
|
472
475
|
$defaultBreakpoint: '${o}';
|
|
473
476
|
`;
|
|
474
|
-
},
|
|
475
|
-
`const breakpoints = ${JSON.stringify(
|
|
477
|
+
}, Ne = (r) => [
|
|
478
|
+
`const breakpoints = ${JSON.stringify(r, null, 4)} as const;`,
|
|
476
479
|
"",
|
|
477
480
|
"const BREAKPOINTS_NAMES = Object.keys(breakpoints);",
|
|
478
481
|
"",
|
|
@@ -483,20 +486,20 @@ $defaultBreakpoint: '${o}';
|
|
|
483
486
|
"export type { BreakpointsKeysType, AllowMedia };",
|
|
484
487
|
""
|
|
485
488
|
].join(`
|
|
486
|
-
`), Me = async ({ breakpointTokens:
|
|
487
|
-
const o =
|
|
489
|
+
`), Me = async ({ breakpointTokens: r, dir: e }) => {
|
|
490
|
+
const o = $e(r), t = je(r), n = ve(r), s = Ne(o);
|
|
488
491
|
await Promise.all([
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
+
F("styles.css", t, e),
|
|
493
|
+
F("styles.scss", n, e),
|
|
494
|
+
F("index.ts", s, e)
|
|
492
495
|
]);
|
|
493
|
-
},
|
|
494
|
-
const o = Object.keys(
|
|
496
|
+
}, Ve = (r, e) => {
|
|
497
|
+
const o = Object.keys(r).filter((s) => !isNaN(Number(s))).sort((s, a) => Number(s) - Number(a));
|
|
495
498
|
if (o.length > e.length)
|
|
496
499
|
throw new Error(
|
|
497
500
|
`Not enough breakpoint names provided. Found ${o.length} breakpoints in data, but only ${e.length} names specified: ${e.join(", ")}`
|
|
498
501
|
);
|
|
499
|
-
const n = Object.keys(
|
|
502
|
+
const n = Object.keys(r).filter((s) => isNaN(Number(s)));
|
|
500
503
|
if (n.length > 0)
|
|
501
504
|
throw new Error(
|
|
502
505
|
`Found non-numeric breakpoint keys in grid data: ${n.join(", ")}. All breakpoint keys must be numeric values.`
|
|
@@ -505,22 +508,22 @@ $defaultBreakpoint: '${o}';
|
|
|
505
508
|
name: e[e.length - 1 - a] || `bp-${s}`,
|
|
506
509
|
value: s
|
|
507
510
|
}));
|
|
508
|
-
},
|
|
509
|
-
input:
|
|
511
|
+
}, Gt = ({
|
|
512
|
+
input: r = {},
|
|
510
513
|
output: { dir: e }
|
|
511
514
|
}) => ({
|
|
512
515
|
name: "breakpoints/tokenManager",
|
|
513
516
|
executor: async ({ tokenManagerClient: o }) => {
|
|
514
517
|
try {
|
|
515
518
|
console.log("[breakpoints/tokenManager] Generating breakpoints from TokenManager...");
|
|
516
|
-
const { names:
|
|
519
|
+
const { names: t = we } = r;
|
|
517
520
|
if (!o.isLoaded())
|
|
518
521
|
throw new Error("TokenManager is not loaded. Tokens must be loaded before using this module.");
|
|
519
522
|
const n = o.getStyles();
|
|
520
523
|
if (!n.grid)
|
|
521
524
|
throw new Error("No grid styles found in TokenManager. Grid tokens must be loaded.");
|
|
522
525
|
console.log("[breakpoints/tokenManager] Extracting breakpoints from grid styles...");
|
|
523
|
-
const s =
|
|
526
|
+
const s = Ve(n.grid, t);
|
|
524
527
|
if (!s.length) {
|
|
525
528
|
console.warn("[breakpoints/tokenManager] No breakpoints found in grid styles.");
|
|
526
529
|
return;
|
|
@@ -531,171 +534,171 @@ $defaultBreakpoint: '${o}';
|
|
|
531
534
|
breakpointTokens: s,
|
|
532
535
|
dir: e
|
|
533
536
|
}), console.log("[breakpoints/tokenManager] ✅ Successfully generated breakpoint files");
|
|
534
|
-
} catch (
|
|
535
|
-
const n =
|
|
536
|
-
throw console.error("[breakpoints/tokenManager] ❌ Failed to generate breakpoints:", n),
|
|
537
|
+
} catch (t) {
|
|
538
|
+
const n = t instanceof Error ? t.message : String(t);
|
|
539
|
+
throw console.error("[breakpoints/tokenManager] ❌ Failed to generate breakpoints:", n), t instanceof Error && t.stack && console.error("[breakpoints/tokenManager] Stack trace:", t.stack), t;
|
|
537
540
|
}
|
|
538
541
|
}
|
|
539
|
-
}),
|
|
542
|
+
}), Ce = "styles.css", Fe = "index.ts", A = (r, e) => {
|
|
540
543
|
if (!e.length) return "";
|
|
541
|
-
const o = e.map((
|
|
544
|
+
const o = e.map((t) => ` ${t}`).join(`
|
|
542
545
|
`);
|
|
543
|
-
return `${
|
|
546
|
+
return `${r} {
|
|
544
547
|
${o}
|
|
545
548
|
}`;
|
|
546
|
-
},
|
|
549
|
+
}, xe = (r) => `.${r.replace(/\s+/g, "-").toLowerCase()}`, Z = (r) => `--cl-${r}`, Pe = (r) => r.reduce(
|
|
547
550
|
(e, o) => {
|
|
548
|
-
const
|
|
551
|
+
const t = Z(o.name);
|
|
549
552
|
return typeof o.value == "object" ? Object.entries(o.value).forEach(([n, s]) => {
|
|
550
|
-
e[n] || (e[n] = []), e[n].push(`${
|
|
551
|
-
}) : e.root.push(`${
|
|
553
|
+
e[n] || (e[n] = []), e[n].push(`${t}: ${s};`);
|
|
554
|
+
}) : e.root.push(`${t}: ${o.value};`), e;
|
|
552
555
|
},
|
|
553
556
|
{ root: [] }
|
|
554
|
-
), Oe = (
|
|
555
|
-
const e = A(".color-variables",
|
|
556
|
-
if (n === "root" || !s.length) return
|
|
557
|
-
const a = A(
|
|
558
|
-
return a &&
|
|
557
|
+
), Oe = (r) => {
|
|
558
|
+
const e = A(".color-variables", r.root), o = Object.entries(r).reduce((t, [n, s]) => {
|
|
559
|
+
if (n === "root" || !s.length) return t;
|
|
560
|
+
const a = A(xe(`${n}-color-variables`), s);
|
|
561
|
+
return a && t.push(a), t;
|
|
559
562
|
}, []).join(`
|
|
560
563
|
|
|
561
564
|
`);
|
|
562
565
|
return [e, o].filter(Boolean).join(`
|
|
563
566
|
|
|
564
567
|
`);
|
|
565
|
-
},
|
|
566
|
-
${
|
|
568
|
+
}, Ee = (r) => `${`const colors = {
|
|
569
|
+
${r.map((t) => ` '${t.name}': 'var(${Z(t.name)})'`).join(`,
|
|
567
570
|
`)}
|
|
568
571
|
} as const;`}
|
|
569
572
|
|
|
570
573
|
type ColorsKeysType = keyof typeof colors;
|
|
571
574
|
|
|
572
575
|
export { colors, type ColorsKeysType };
|
|
573
|
-
`,
|
|
574
|
-
tsContent:
|
|
576
|
+
`, Be = async ({
|
|
577
|
+
tsContent: r,
|
|
575
578
|
cssContent: e,
|
|
576
579
|
dir: o
|
|
577
580
|
}) => {
|
|
578
|
-
await
|
|
579
|
-
const
|
|
580
|
-
await Promise.all([
|
|
581
|
-
},
|
|
582
|
-
const o =
|
|
583
|
-
await
|
|
584
|
-
},
|
|
585
|
-
const
|
|
586
|
-
return [...e, `${o.color}${
|
|
587
|
-
}, []).join(", "),
|
|
588
|
-
const e =
|
|
589
|
-
return `linear-gradient(${
|
|
590
|
-
},
|
|
591
|
-
const e =
|
|
592
|
-
return `conic-gradient(from ${
|
|
593
|
-
},
|
|
594
|
-
const e =
|
|
595
|
-
return `linear-gradient(${
|
|
596
|
-
},
|
|
597
|
-
(o,
|
|
598
|
-
const n = t
|
|
581
|
+
await y.delete(o);
|
|
582
|
+
const t = y.write(Fe, r, { directory: o }), n = y.write(Ce, e, { directory: o });
|
|
583
|
+
await Promise.all([t, n]);
|
|
584
|
+
}, Ke = async ({ colorTokens: r, dir: e }) => {
|
|
585
|
+
const o = Pe(r), t = Oe(o), n = Ee(r);
|
|
586
|
+
await Be({ tsContent: n, cssContent: t, dir: e });
|
|
587
|
+
}, N = (r) => r.reduce((e, o) => {
|
|
588
|
+
const t = Number((o.position * 100).toFixed(1));
|
|
589
|
+
return [...e, `${o.color}${t > 0 && t < 100 ? ` ${t}%` : ""}`];
|
|
590
|
+
}, []).join(", "), Ae = (r) => {
|
|
591
|
+
const e = N(r.stops);
|
|
592
|
+
return `linear-gradient(${r.angle}deg, ${e})`;
|
|
593
|
+
}, Re = (r) => `radial-gradient(circle, ${N(r.stops)})`, De = (r) => {
|
|
594
|
+
const e = N(r.stops);
|
|
595
|
+
return `conic-gradient(from ${r.angle}deg, ${e})`;
|
|
596
|
+
}, Ue = (r) => {
|
|
597
|
+
const e = N(r.stops);
|
|
598
|
+
return `linear-gradient(${r.angle}deg, ${e})`;
|
|
599
|
+
}, R = (r) => typeof r == "string" ? r : r.type === "linear" ? Ae(r) : r.type === "radial" ? Re(r) : r.type === "conic" ? De(r) : r.type === "diamond" ? Ue(r) : "", Q = (r, e) => Object.keys(r).reduce(
|
|
600
|
+
(o, t) => {
|
|
601
|
+
const n = r[t], s = e ? `${e}-${t}` : t;
|
|
599
602
|
if (n && typeof n == "object" && "type" in n && "value" in n) {
|
|
600
|
-
const
|
|
601
|
-
(
|
|
602
|
-
...
|
|
603
|
-
[
|
|
603
|
+
const i = Object.keys(n.value), l = i.length > 1 ? n.value : n.value[i[0]], c = typeof l == "object" ? Object.keys(l).reduce(
|
|
604
|
+
(d, f) => ({
|
|
605
|
+
...d,
|
|
606
|
+
[f]: R(l[f])
|
|
604
607
|
}),
|
|
605
608
|
{}
|
|
606
|
-
) :
|
|
609
|
+
) : R(l), u = { [s]: c };
|
|
607
610
|
return { ...o, ...u };
|
|
608
611
|
}
|
|
609
|
-
const a =
|
|
612
|
+
const a = Q(n, s);
|
|
610
613
|
return { ...o, ...a };
|
|
611
614
|
},
|
|
612
615
|
{}
|
|
613
|
-
), X = (
|
|
614
|
-
const n = t
|
|
616
|
+
), X = (r, e) => Object.keys(r).reduce((o, t) => {
|
|
617
|
+
const n = r[t];
|
|
615
618
|
if (n.type && n.type !== "color") return o;
|
|
616
619
|
if (n.type && n.value) {
|
|
617
|
-
const a = typeof n.value == "string" ? e.resolveVariableValueString(n.value,
|
|
618
|
-
return a ? { ...o, [
|
|
620
|
+
const a = typeof n.value == "string" ? e.resolveVariableValueString(n.value, t) : e.resolveVariableValue(n.value);
|
|
621
|
+
return a ? { ...o, [t]: { ...n, value: a } } : o;
|
|
619
622
|
}
|
|
620
623
|
const s = X(n, e);
|
|
621
|
-
return s ? { ...o, [
|
|
622
|
-
}, {}),
|
|
624
|
+
return s ? { ...o, [t]: s } : o;
|
|
625
|
+
}, {}), Jt = ({ input: r = {}, output: { dir: e } }) => ({
|
|
623
626
|
name: "colors/tokenManager",
|
|
624
627
|
executor: async ({ tokenManagerClient: o }) => {
|
|
625
628
|
try {
|
|
626
629
|
console.log("[colors/tokenManager] Generating colors from TokenManager...");
|
|
627
|
-
const { includeVariables:
|
|
628
|
-
if (!(
|
|
630
|
+
const { includeVariables: t, includeStyles: n = !0 } = r;
|
|
631
|
+
if (!(t != null && t.length) && !n)
|
|
629
632
|
throw new Error("Either includeVariables or includeStyles must be enabled");
|
|
630
633
|
if (!o.isLoaded())
|
|
631
634
|
throw new Error("TokenManager is not loaded. Tokens must be loaded before using this module.");
|
|
632
635
|
const s = [], a = o.getVariables();
|
|
633
636
|
if (n) {
|
|
634
|
-
const
|
|
635
|
-
console.log("[colors/tokenManager] Processing styles for colors..."),
|
|
637
|
+
const l = o.getStyles();
|
|
638
|
+
console.log("[colors/tokenManager] Processing styles for colors..."), l.color && s.push(l.color);
|
|
636
639
|
}
|
|
637
|
-
if (
|
|
638
|
-
console.log(`[colors/tokenManager] Processing ${
|
|
639
|
-
const
|
|
640
|
-
s.push(...
|
|
640
|
+
if (t != null && t.length) {
|
|
641
|
+
console.log(`[colors/tokenManager] Processing ${t.length} variable groups...`);
|
|
642
|
+
const l = t.map((c) => a[c]).filter(Boolean);
|
|
643
|
+
s.push(...l);
|
|
641
644
|
}
|
|
642
|
-
const
|
|
643
|
-
(
|
|
644
|
-
(c, [u,
|
|
645
|
+
const i = s.map((l) => X(l, o)).flatMap(
|
|
646
|
+
(l) => Object.entries(Q(l, "")).reduce(
|
|
647
|
+
(c, [u, d]) => [...c, { name: u, value: d }],
|
|
645
648
|
[]
|
|
646
649
|
)
|
|
647
650
|
);
|
|
648
|
-
if (
|
|
651
|
+
if (i.length === 0) {
|
|
649
652
|
console.warn("[colors/tokenManager] No color tokens generated");
|
|
650
653
|
return;
|
|
651
654
|
}
|
|
652
|
-
console.log(`[colors/tokenManager] Generated ${
|
|
653
|
-
colorTokens:
|
|
655
|
+
console.log(`[colors/tokenManager] Generated ${i.length} color tokens`), console.log(`[colors/tokenManager] Writing files to ${e}...`), await Ke({
|
|
656
|
+
colorTokens: i,
|
|
654
657
|
dir: e
|
|
655
658
|
}), console.log("[colors/tokenManager] ✅ Successfully generated color files");
|
|
656
|
-
} catch (
|
|
657
|
-
const n =
|
|
658
|
-
throw console.error("[colors/tokenManager] ❌ Failed to generate colors:", n),
|
|
659
|
+
} catch (t) {
|
|
660
|
+
const n = t instanceof Error ? t.message : String(t);
|
|
661
|
+
throw console.error("[colors/tokenManager] ❌ Failed to generate colors:", n), t instanceof Error && t.stack && console.error("[colors/tokenManager] Stack trace:", t.stack), t;
|
|
659
662
|
}
|
|
660
663
|
}
|
|
661
|
-
}), Le = (
|
|
664
|
+
}), Le = (r) => ` @media (width <= ${r.breakpoint}px) {
|
|
662
665
|
.container {
|
|
663
|
-
padding-left: ${
|
|
664
|
-
padding-right: ${
|
|
666
|
+
padding-left: ${r.offset};
|
|
667
|
+
padding-right: ${r.offset};
|
|
665
668
|
}
|
|
666
669
|
|
|
667
670
|
.containerTablet {
|
|
668
|
-
padding-left: ${
|
|
669
|
-
padding-right: ${
|
|
671
|
+
padding-left: ${r.offset};
|
|
672
|
+
padding-right: ${r.offset};
|
|
670
673
|
}
|
|
671
|
-
}`,
|
|
672
|
-
const o = e || "components",
|
|
674
|
+
}`, We = (r, e) => {
|
|
675
|
+
const o = e || "components", t = r.map((n) => Le(n)).join(`
|
|
673
676
|
|
|
674
677
|
`);
|
|
675
678
|
return `@layer ${o} {
|
|
676
|
-
${
|
|
679
|
+
${t}
|
|
677
680
|
}`;
|
|
678
|
-
},
|
|
681
|
+
}, Ie = () => `import styles from './styles.module.css';
|
|
679
682
|
|
|
680
|
-
export const
|
|
681
|
-
export const
|
|
682
|
-
`,
|
|
683
|
-
await
|
|
684
|
-
}, ze = async ({ containerTokens:
|
|
685
|
-
const
|
|
686
|
-
await
|
|
687
|
-
},
|
|
688
|
-
const e =
|
|
683
|
+
export const containerClassName = styles.container;
|
|
684
|
+
export const containerTabletClassName = styles.containerTablet;
|
|
685
|
+
`, D = async (r, e, o) => {
|
|
686
|
+
await y.delete(r, o), await y.write(r, e, { directory: o });
|
|
687
|
+
}, ze = async ({ containerTokens: r, dir: e, layer: o }) => {
|
|
688
|
+
const t = We(r, o), n = Ie();
|
|
689
|
+
await D("styles.module.css", t, e), await D("index.ts", n, e);
|
|
690
|
+
}, Ge = (r) => {
|
|
691
|
+
const e = r.trim().toLowerCase();
|
|
689
692
|
return e === "0" || e === "0px";
|
|
690
|
-
},
|
|
691
|
-
const
|
|
692
|
-
if (!
|
|
693
|
+
}, Je = (r, e) => Object.keys(r).filter((s) => !isNaN(Number(s))).sort((s, a) => Number(a) - Number(s)).reduce((s, a) => {
|
|
694
|
+
const i = r[a];
|
|
695
|
+
if (!i || !("value" in i) || !Array.isArray(i.value))
|
|
693
696
|
return s;
|
|
694
|
-
const
|
|
695
|
-
if (!(
|
|
697
|
+
const l = i.value.find((u) => u.pattern === "columns");
|
|
698
|
+
if (!(l != null && l.offset))
|
|
696
699
|
return s;
|
|
697
|
-
const c = e.resolveVariableValueString(
|
|
698
|
-
return !c || typeof c != "string" ||
|
|
700
|
+
const c = e.resolveVariableValueString(l.offset);
|
|
701
|
+
return !c || typeof c != "string" || Ge(c) ? s : [
|
|
699
702
|
...s,
|
|
700
703
|
{
|
|
701
704
|
breakpoint: Number(a),
|
|
@@ -703,24 +706,24 @@ export const conatinerTabletClassName = styles.containerTablet;
|
|
|
703
706
|
}
|
|
704
707
|
];
|
|
705
708
|
}, []).reduce((s, a) => {
|
|
706
|
-
const
|
|
707
|
-
return
|
|
708
|
-
}, []),
|
|
709
|
-
input:
|
|
709
|
+
const i = s[s.length - 1];
|
|
710
|
+
return i && x(i.offset, a.offset) || s.push(a), s;
|
|
711
|
+
}, []), qt = ({
|
|
712
|
+
input: r = {},
|
|
710
713
|
output: { dir: e }
|
|
711
714
|
}) => ({
|
|
712
715
|
name: "container/tokenManager",
|
|
713
716
|
executor: async ({ tokenManagerClient: o }) => {
|
|
714
717
|
try {
|
|
715
718
|
console.log("[container/tokenManager] Generating container styles...");
|
|
716
|
-
const { layer:
|
|
719
|
+
const { layer: t } = r;
|
|
717
720
|
if (!o.isLoaded())
|
|
718
721
|
throw new Error("TokenManager is not loaded. Tokens must be loaded before using this module.");
|
|
719
722
|
console.log("[container/tokenManager] Extracting container tokens...");
|
|
720
723
|
const n = o.getStyles();
|
|
721
724
|
if (!n.grid)
|
|
722
725
|
throw new Error("No grid styles found in TokenManager. Grid tokens must be loaded.");
|
|
723
|
-
const s =
|
|
726
|
+
const s = Je(n.grid, o);
|
|
724
727
|
if (!s.length) {
|
|
725
728
|
console.warn("[container/tokenManager] No container tokens found.");
|
|
726
729
|
return;
|
|
@@ -730,90 +733,90 @@ export const conatinerTabletClassName = styles.containerTablet;
|
|
|
730
733
|
), console.log(`[container/tokenManager] Writing files to ${e}...`), await ze({
|
|
731
734
|
containerTokens: s,
|
|
732
735
|
dir: e,
|
|
733
|
-
layer:
|
|
736
|
+
layer: t
|
|
734
737
|
}), console.log("[container/tokenManager] ✅ Successfully generated container files");
|
|
735
|
-
} catch (
|
|
736
|
-
const n =
|
|
737
|
-
throw console.error("[container/tokenManager] ❌ Failed to generate container:", n),
|
|
738
|
+
} catch (t) {
|
|
739
|
+
const n = t instanceof Error ? t.message : String(t);
|
|
740
|
+
throw console.error("[container/tokenManager] ❌ Failed to generate container:", n), t instanceof Error && t.stack && console.error("[container/tokenManager] Stack trace:", t.stack), t;
|
|
738
741
|
}
|
|
739
742
|
}
|
|
740
|
-
}),
|
|
743
|
+
}), qe = "styles.css", He = "index.ts", U = (r, e) => {
|
|
741
744
|
if (!e.length) return "";
|
|
742
|
-
const o = e.map((
|
|
745
|
+
const o = e.map((t) => ` ${t}`).join(`
|
|
743
746
|
`);
|
|
744
|
-
return `${
|
|
747
|
+
return `${r} {
|
|
745
748
|
${o}
|
|
746
749
|
}`;
|
|
747
|
-
},
|
|
750
|
+
}, Ze = (r) => `.${r.replace(/\s+/g, "-").toLowerCase()}`, Y = (r) => `--${r}`, Qe = ({ offsetX: r, offsetY: e, blur: o, spread: t, color: n }) => `${r} ${e} ${o} ${t} ${n}`, Xe = (r) => r.reduce(
|
|
748
751
|
(e, o) => {
|
|
749
|
-
const
|
|
750
|
-
return typeof o.value != "object" ? (e.root.push(`${
|
|
751
|
-
const
|
|
752
|
-
return { ...n, [s]: [...
|
|
752
|
+
const t = Y(o.name);
|
|
753
|
+
return typeof o.value != "object" ? (e.root.push(`${t}: ${o.value};`), e) : Object.entries(o.value).reduce((n, [s, a]) => {
|
|
754
|
+
const i = n[s] ?? [];
|
|
755
|
+
return { ...n, [s]: [...i, `${t}: ${a};`] };
|
|
753
756
|
}, e);
|
|
754
757
|
},
|
|
755
758
|
{ root: [] }
|
|
756
|
-
),
|
|
757
|
-
const e =
|
|
758
|
-
if (n === "root" || !s.length) return
|
|
759
|
-
const a =
|
|
760
|
-
return a &&
|
|
759
|
+
), Ye = (r) => {
|
|
760
|
+
const e = U(".shadow-variables", r.root), o = Object.entries(r).reduce((t, [n, s]) => {
|
|
761
|
+
if (n === "root" || !s.length) return t;
|
|
762
|
+
const a = U(Ze(`${n}-shadow-variables`), s);
|
|
763
|
+
return a && t.push(a), t;
|
|
761
764
|
}, []).join(`
|
|
762
765
|
|
|
763
766
|
`);
|
|
764
767
|
return [e, o].filter(Boolean).join(`
|
|
765
768
|
|
|
766
769
|
`);
|
|
767
|
-
},
|
|
768
|
-
${
|
|
770
|
+
}, _e = (r) => `${`const shadows = {
|
|
771
|
+
${r.map((t) => ` '${t.name}': 'var(${Y(t.name)})'`).join(`,
|
|
769
772
|
`)}
|
|
770
773
|
} as const;`}
|
|
771
774
|
|
|
772
775
|
type ShadowsKeysType = keyof typeof shadows;
|
|
773
776
|
|
|
774
777
|
export { shadows, type ShadowsKeysType };
|
|
775
|
-
`,
|
|
776
|
-
tsContent:
|
|
778
|
+
`, et = async ({
|
|
779
|
+
tsContent: r,
|
|
777
780
|
cssContent: e,
|
|
778
781
|
dir: o
|
|
779
782
|
}) => {
|
|
780
|
-
await
|
|
781
|
-
const
|
|
782
|
-
await Promise.all([
|
|
783
|
-
},
|
|
784
|
-
const o =
|
|
785
|
-
await
|
|
786
|
-
}, _ = (
|
|
787
|
-
(o,
|
|
788
|
-
const n = t
|
|
783
|
+
await y.delete(o);
|
|
784
|
+
const t = y.write(He, r, { directory: o }), n = y.write(qe, e, { directory: o });
|
|
785
|
+
await Promise.all([t, n]);
|
|
786
|
+
}, tt = async ({ shadowTokens: r, dir: e }) => {
|
|
787
|
+
const o = Xe(r), t = Ye(o), n = _e(r);
|
|
788
|
+
await et({ tsContent: n, cssContent: t, dir: e });
|
|
789
|
+
}, _ = (r, e) => Object.keys(r).reduce(
|
|
790
|
+
(o, t) => {
|
|
791
|
+
const n = r[t], s = e ? `${e}-${t}` : t;
|
|
789
792
|
if (n && typeof n == "object" && "type" in n && "value" in n) {
|
|
790
|
-
const
|
|
793
|
+
const i = {
|
|
791
794
|
[s]: n.value.map(Qe).join(", ")
|
|
792
795
|
};
|
|
793
|
-
return { ...o, ...
|
|
796
|
+
return { ...o, ...i };
|
|
794
797
|
}
|
|
795
798
|
const a = _(n, s);
|
|
796
799
|
return { ...o, ...a };
|
|
797
800
|
},
|
|
798
801
|
{}
|
|
799
|
-
),
|
|
802
|
+
), Ht = ({ input: r = {}, output: { dir: e } }) => ({
|
|
800
803
|
name: "shadows/tokenManager",
|
|
801
804
|
executor: async ({ tokenManagerClient: o }) => {
|
|
802
805
|
try {
|
|
803
806
|
console.log("[shadows/tokenManager] Generating shadows from TokenManager...");
|
|
804
|
-
const { includeStyles:
|
|
805
|
-
if (!
|
|
807
|
+
const { includeStyles: t = !0 } = r;
|
|
808
|
+
if (!t)
|
|
806
809
|
throw new Error("includeStyles must be enabled for shadows generation");
|
|
807
810
|
if (!o.isLoaded())
|
|
808
811
|
throw new Error("TokenManager is not loaded. Tokens must be loaded before using this module.");
|
|
809
812
|
const n = [];
|
|
810
|
-
if (
|
|
813
|
+
if (t) {
|
|
811
814
|
const a = o.getStyles();
|
|
812
815
|
console.log("[shadows/tokenManager] Processing styles for shadows..."), a.effect && n.push(a.effect);
|
|
813
816
|
}
|
|
814
817
|
const s = n.flatMap(
|
|
815
818
|
(a) => Object.entries(_(a, "")).reduce(
|
|
816
|
-
(
|
|
819
|
+
(i, [l, c]) => [...i, { name: l, value: c }],
|
|
817
820
|
[]
|
|
818
821
|
)
|
|
819
822
|
);
|
|
@@ -821,46 +824,46 @@ export { shadows, type ShadowsKeysType };
|
|
|
821
824
|
console.warn("[shadows/tokenManager] No shadow tokens generated");
|
|
822
825
|
return;
|
|
823
826
|
}
|
|
824
|
-
console.log(`[shadows/tokenManager] Generated ${s.length} shadow tokens`), console.log(`[shadows/tokenManager] Writing files to ${e}...`), await
|
|
827
|
+
console.log(`[shadows/tokenManager] Generated ${s.length} shadow tokens`), console.log(`[shadows/tokenManager] Writing files to ${e}...`), await tt({
|
|
825
828
|
shadowTokens: s,
|
|
826
829
|
dir: e
|
|
827
830
|
}), console.log("[shadows/tokenManager] ✅ Successfully generated shadow files");
|
|
828
|
-
} catch (
|
|
829
|
-
const n =
|
|
830
|
-
throw console.error("[shadows/tokenManager] ❌ Failed to generate shadows:", n),
|
|
831
|
+
} catch (t) {
|
|
832
|
+
const n = t instanceof Error ? t.message : String(t);
|
|
833
|
+
throw console.error("[shadows/tokenManager] ❌ Failed to generate shadows:", n), t instanceof Error && t.stack && console.error("[shadows/tokenManager] Stack trace:", t.stack), t;
|
|
831
834
|
}
|
|
832
835
|
}
|
|
833
|
-
}),
|
|
836
|
+
}), rt = "styles.module.css", ot = "index.ts", nt = "typography.ts", L = "sans-serif", W = (r, e) => {
|
|
834
837
|
if (!e.length) return "";
|
|
835
|
-
const o = e.map((
|
|
838
|
+
const o = e.map((t) => ` ${t}`).join(`
|
|
836
839
|
`);
|
|
837
|
-
return `${
|
|
840
|
+
return `${r} {
|
|
838
841
|
${o}
|
|
839
842
|
}`;
|
|
840
|
-
}, ee = (
|
|
841
|
-
if (typeof
|
|
842
|
-
const o = e[
|
|
843
|
-
return o.trim().toLowerCase().endsWith(
|
|
844
|
-
},
|
|
845
|
-
...
|
|
846
|
-
fontFamily: ee(
|
|
847
|
-
},
|
|
843
|
+
}, ee = (r, e) => {
|
|
844
|
+
if (typeof r != "string") return r;
|
|
845
|
+
const o = e[r] ?? r;
|
|
846
|
+
return o.trim().toLowerCase().endsWith(L) ? o : `${o}, ${L}`;
|
|
847
|
+
}, I = (r, e) => typeof r.fontFamily != "string" ? r : {
|
|
848
|
+
...r,
|
|
849
|
+
fontFamily: ee(r.fontFamily, e)
|
|
850
|
+
}, T = (r, e) => {
|
|
848
851
|
const o = {};
|
|
849
|
-
return Object.entries(
|
|
850
|
-
const s =
|
|
852
|
+
return Object.entries(r).forEach(([t, n]) => {
|
|
853
|
+
const s = t === "fontFamily" ? ee(n, e) : n, a = t.replace(/([A-Z])/g, "-$1");
|
|
851
854
|
o[a] = s;
|
|
852
855
|
}), o;
|
|
853
|
-
},
|
|
854
|
-
const
|
|
855
|
-
return
|
|
856
|
-
(s, a,
|
|
857
|
-
const
|
|
858
|
-
return
|
|
856
|
+
}, st = (r, e, o) => {
|
|
857
|
+
const t = Object.keys(r.breakpoints), n = T(r.base, o);
|
|
858
|
+
return t.reduce(
|
|
859
|
+
(s, a, i) => {
|
|
860
|
+
const l = T(r.breakpoints[a], o);
|
|
861
|
+
return i ? [...s, { breakpoint: Number(e[a]), css: l }] : [
|
|
859
862
|
{
|
|
860
863
|
breakpoint: null,
|
|
861
864
|
css: {
|
|
862
865
|
...n,
|
|
863
|
-
...
|
|
866
|
+
...l
|
|
864
867
|
}
|
|
865
868
|
}
|
|
866
869
|
];
|
|
@@ -875,86 +878,86 @@ ${o}
|
|
|
875
878
|
}, te = () => ({
|
|
876
879
|
base: {},
|
|
877
880
|
breakpoints: {}
|
|
878
|
-
}),
|
|
879
|
-
Object.keys(
|
|
880
|
-
...
|
|
881
|
-
...
|
|
881
|
+
}), P = (r, e, o, t) => {
|
|
882
|
+
Object.keys(t).length && (r.breakpoints[e] || (r.breakpoints[e] = {}), r.breakpoints[e][o] = {
|
|
883
|
+
...r.breakpoints[e][o],
|
|
884
|
+
...t
|
|
882
885
|
});
|
|
883
|
-
},
|
|
884
|
-
|
|
886
|
+
}, j = (r, e, o, t) => {
|
|
887
|
+
st(e.value, o, t).forEach(({ breakpoint: s, css: a }) => {
|
|
885
888
|
if (s === null) {
|
|
886
|
-
|
|
889
|
+
r.base[e.name] = a;
|
|
887
890
|
return;
|
|
888
891
|
}
|
|
889
|
-
|
|
892
|
+
P(r, s, e.name, a);
|
|
890
893
|
});
|
|
891
|
-
}, re = (
|
|
892
|
-
const e =
|
|
893
|
-
const s =
|
|
894
|
-
return
|
|
894
|
+
}, re = (r) => {
|
|
895
|
+
const e = z(r.base), o = Object.keys(r.breakpoints).map(Number).sort((t, n) => n - t).reduce((t, n) => {
|
|
896
|
+
const s = r.breakpoints[n];
|
|
897
|
+
return t + `@media (max-width: ${n}px) { ${z(s)} }`;
|
|
895
898
|
}, "");
|
|
896
899
|
return e + o;
|
|
897
|
-
},
|
|
898
|
-
const
|
|
899
|
-
return re(
|
|
900
|
-
},
|
|
901
|
-
const
|
|
900
|
+
}, at = (r, e, o) => {
|
|
901
|
+
const t = r.reduce((n, s) => (j(n, s, e, o), n), te());
|
|
902
|
+
return re(t);
|
|
903
|
+
}, z = (r) => Object.keys(r).reduce((e, o) => {
|
|
904
|
+
const t = r[o], n = Object.keys(t).map((s) => `${s}: ${t[s]}`).join(";");
|
|
902
905
|
return e + `.typo-${o} { ${n} }`;
|
|
903
|
-
}, ""), G = (
|
|
904
|
-
if (typeof
|
|
905
|
-
const e = Number.parseFloat(
|
|
906
|
+
}, ""), G = (r) => {
|
|
907
|
+
if (typeof r == "number") return Number.isFinite(r) ? r : null;
|
|
908
|
+
const e = Number.parseFloat(r);
|
|
906
909
|
return Number.isFinite(e) ? e : null;
|
|
907
|
-
}, J = (
|
|
908
|
-
if (typeof
|
|
909
|
-
const e =
|
|
910
|
+
}, J = (r) => {
|
|
911
|
+
if (typeof r == "number") return r / 16;
|
|
912
|
+
const e = r.trim().toLowerCase();
|
|
910
913
|
if (e.endsWith("rem")) return G(e);
|
|
911
914
|
if (e.endsWith("px")) {
|
|
912
915
|
const o = G(e);
|
|
913
916
|
return o === null ? null : o / 16;
|
|
914
917
|
}
|
|
915
918
|
return null;
|
|
916
|
-
},
|
|
917
|
-
const { minValueRem: e, maxValueRem: o, minVwRem:
|
|
918
|
-
return `calc(${e}rem + ((100vw - ${
|
|
919
|
-
},
|
|
920
|
-
const n = ["font-size", "line-height"], s = Object.entries(e.value.breakpoints).map(([
|
|
921
|
-
const
|
|
922
|
-
return { breakpointName:
|
|
923
|
-
}).filter((
|
|
919
|
+
}, it = (r) => {
|
|
920
|
+
const { minValueRem: e, maxValueRem: o, minVwRem: t, maxVwRem: n } = r, s = o - e;
|
|
921
|
+
return `calc(${e}rem + ((100vw - ${t}rem) / (${n}rem - ${t}rem)) * ${s}rem)`;
|
|
922
|
+
}, lt = (r, e, o, t) => {
|
|
923
|
+
const n = ["font-size", "line-height"], s = Object.entries(e.value.breakpoints).map(([g, h]) => {
|
|
924
|
+
const b = Number.parseInt(o[g], 10);
|
|
925
|
+
return { breakpointName: g, width: b, typography: h };
|
|
926
|
+
}).filter((g) => Number.isFinite(g.width)).sort((g, h) => h.width - g.width);
|
|
924
927
|
if (s.length < 2) {
|
|
925
|
-
|
|
928
|
+
j(r, e, o, t);
|
|
926
929
|
return;
|
|
927
930
|
}
|
|
928
|
-
const a = s[0],
|
|
929
|
-
if (a.width <=
|
|
930
|
-
|
|
931
|
+
const a = s[0], i = s[s.length - 1];
|
|
932
|
+
if (a.width <= i.width) {
|
|
933
|
+
j(r, e, o, t);
|
|
931
934
|
return;
|
|
932
935
|
}
|
|
933
|
-
const
|
|
934
|
-
if (
|
|
935
|
-
|
|
936
|
+
const l = T(e.value.base, t), c = T(a.typography, t), u = T(i.typography, t), d = a.width / 16, f = i.width / 16;
|
|
937
|
+
if (d === f) {
|
|
938
|
+
j(r, e, o, t);
|
|
936
939
|
return;
|
|
937
940
|
}
|
|
938
|
-
|
|
939
|
-
...
|
|
941
|
+
r.base[e.name] = {
|
|
942
|
+
...l,
|
|
940
943
|
...c
|
|
941
944
|
};
|
|
942
|
-
const
|
|
943
|
-
const
|
|
944
|
-
if (
|
|
945
|
-
return
|
|
946
|
-
const E = J(
|
|
947
|
-
return E === null || B === null ?
|
|
948
|
-
...
|
|
949
|
-
[
|
|
945
|
+
const m = n.reduce((g, h) => {
|
|
946
|
+
const b = c[h], S = u[h];
|
|
947
|
+
if (b === void 0 || S === void 0 || b === S)
|
|
948
|
+
return g;
|
|
949
|
+
const E = J(b), B = J(S);
|
|
950
|
+
return E === null || B === null ? g : {
|
|
951
|
+
...g,
|
|
952
|
+
[h]: it({ minValueRem: B, maxValueRem: E, minVwRem: f, maxVwRem: d })
|
|
950
953
|
};
|
|
951
954
|
}, {});
|
|
952
|
-
|
|
953
|
-
},
|
|
954
|
-
if (!
|
|
955
|
-
const n =
|
|
955
|
+
P(r, a.width, e.name, m), P(r, i.width, e.name, u);
|
|
956
|
+
}, ct = (r, e, o, t) => {
|
|
957
|
+
if (!t) return at(r, e, o);
|
|
958
|
+
const n = r.reduce((s, a) => (lt(s, a, e, o), s), te());
|
|
956
959
|
return re(n);
|
|
957
|
-
},
|
|
960
|
+
}, ut = (r) => r.length ? `import styles from './styles.module.css';
|
|
958
961
|
import { typography } from './typography';
|
|
959
962
|
|
|
960
963
|
type TypographyKeysType = keyof typeof typography;
|
|
@@ -962,16 +965,16 @@ type TypographyKeysType = keyof typeof typography;
|
|
|
962
965
|
const getTypographyClass = (typographyKey: TypographyKeysType) => styles[\`typo-\${typographyKey}\`];
|
|
963
966
|
|
|
964
967
|
export { typography, getTypographyClass, type TypographyKeysType };
|
|
965
|
-
` : "",
|
|
966
|
-
${
|
|
967
|
-
const n =
|
|
968
|
-
(a, [
|
|
968
|
+
` : "", dt = (r, e) => r.length ? `const typography = {
|
|
969
|
+
${r.map((t) => {
|
|
970
|
+
const n = I(t.value.base, e), s = Object.entries(t.value.breakpoints).reduce(
|
|
971
|
+
(a, [i, l]) => ({
|
|
969
972
|
...a,
|
|
970
|
-
[
|
|
973
|
+
[i]: I(l, e)
|
|
971
974
|
}),
|
|
972
975
|
{}
|
|
973
976
|
);
|
|
974
|
-
return ` '${
|
|
977
|
+
return ` '${t.name}': {
|
|
975
978
|
base: ${JSON.stringify(n, null, 8).replace(/\n/g, `
|
|
976
979
|
`)},
|
|
977
980
|
breakpoints: ${JSON.stringify(s, null, 8).replace(/\n/g, `
|
|
@@ -982,71 +985,71 @@ ${t.map((r) => {
|
|
|
982
985
|
} as const;
|
|
983
986
|
|
|
984
987
|
export { typography };
|
|
985
|
-
` : "",
|
|
986
|
-
indexTSContent:
|
|
988
|
+
` : "", yt = async ({
|
|
989
|
+
indexTSContent: r,
|
|
987
990
|
typographyTSContent: e,
|
|
988
991
|
cssContent: o,
|
|
989
|
-
dir:
|
|
992
|
+
dir: t
|
|
990
993
|
}) => {
|
|
991
|
-
await
|
|
992
|
-
const n =
|
|
994
|
+
await y.delete(t);
|
|
995
|
+
const n = y.write(ot, r, { directory: t }), s = y.write(nt, e, { directory: t }), a = y.write(rt, o, { directory: t });
|
|
993
996
|
await Promise.all([n, s, a]);
|
|
994
997
|
}, ft = async ({
|
|
995
|
-
typographyTokens:
|
|
998
|
+
typographyTokens: r,
|
|
996
999
|
dir: e,
|
|
997
1000
|
breakpoints: o,
|
|
998
|
-
fontFamily:
|
|
1001
|
+
fontFamily: t,
|
|
999
1002
|
fluid: n
|
|
1000
1003
|
}) => {
|
|
1001
|
-
const s =
|
|
1002
|
-
await
|
|
1003
|
-
}, oe = (
|
|
1004
|
-
const s =
|
|
1005
|
-
if (typeof s != "object" || Array.isArray(s)) return
|
|
1004
|
+
const s = ct(r, o, t, n), a = dt(r, t), i = ut(r);
|
|
1005
|
+
await yt({ indexTSContent: i, typographyTSContent: a, cssContent: s, dir: e });
|
|
1006
|
+
}, oe = (r, e, o) => Object.keys(r).reduce((t, n) => {
|
|
1007
|
+
const s = r[n];
|
|
1008
|
+
if (typeof s != "object" || Array.isArray(s)) return t;
|
|
1006
1009
|
if (!("type" in s) || !("value" in s))
|
|
1007
|
-
return { ...
|
|
1008
|
-
if (s.type !== "typography") return
|
|
1009
|
-
const a = s.value,
|
|
1010
|
-
(
|
|
1011
|
-
const
|
|
1012
|
-
if (
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1010
|
+
return { ...t, [n]: oe(s, e, o) };
|
|
1011
|
+
if (s.type !== "typography") return t;
|
|
1012
|
+
const a = s.value, i = Object.entries(a).reduce(
|
|
1013
|
+
(l, [c, u]) => {
|
|
1014
|
+
const d = Object.keys(o.breakpoints);
|
|
1015
|
+
if (d.length)
|
|
1016
|
+
d.forEach((f) => {
|
|
1017
|
+
const m = e.resolveVariableValueString(u, f);
|
|
1018
|
+
m && (m === u ? l.base = { ...l.base, [c]: m } : l.breakpoints[f] = { ...l.breakpoints[f], [c]: m });
|
|
1016
1019
|
});
|
|
1017
1020
|
else {
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1021
|
+
const f = e.resolveVariableValueString(u);
|
|
1022
|
+
f && (l.base = { ...l.base, [c]: f });
|
|
1020
1023
|
}
|
|
1021
|
-
return
|
|
1024
|
+
return l;
|
|
1022
1025
|
},
|
|
1023
1026
|
{ base: {}, breakpoints: {} }
|
|
1024
1027
|
);
|
|
1025
|
-
return { ...
|
|
1026
|
-
}, {}), ne = (
|
|
1027
|
-
const n = e ? `${e}-${
|
|
1028
|
+
return { ...t, [n]: { type: "typography", value: i } };
|
|
1029
|
+
}, {}), ne = (r, e) => Object.keys(r).reduce((o, t) => {
|
|
1030
|
+
const n = e ? `${e}-${t}` : t, s = r[t];
|
|
1028
1031
|
if (!("type" in s) || !("value" in s))
|
|
1029
1032
|
return { ...o, ...ne(s, n) };
|
|
1030
1033
|
const a = s.value;
|
|
1031
1034
|
return { ...o, [n]: a };
|
|
1032
|
-
}, {}),
|
|
1035
|
+
}, {}), Zt = ({ input: r, output: { dir: e } }) => ({
|
|
1033
1036
|
name: "typography/tokenManager",
|
|
1034
1037
|
executor: async ({ tokenManagerClient: o }) => {
|
|
1035
1038
|
try {
|
|
1036
1039
|
console.log("[typography/tokenManager] Generating typography from TokenManager...");
|
|
1037
|
-
const { breakpoints:
|
|
1040
|
+
const { breakpoints: t, fontFamily: n } = r, s = r.fluid ?? !0;
|
|
1038
1041
|
if (!o.isLoaded())
|
|
1039
1042
|
throw new Error("TokenManager is not loaded. Tokens must be loaded before using this module.");
|
|
1040
|
-
const a = [],
|
|
1041
|
-
console.log("[typography/tokenManager] Processing styles for typography..."),
|
|
1042
|
-
const
|
|
1043
|
-
(u,
|
|
1043
|
+
const a = [], i = o.getStyles();
|
|
1044
|
+
console.log("[typography/tokenManager] Processing styles for typography..."), i.text && a.push(i.text);
|
|
1045
|
+
const l = a.reduce(
|
|
1046
|
+
(u, d) => ({
|
|
1044
1047
|
...u,
|
|
1045
|
-
...oe(
|
|
1048
|
+
...oe(d, o, { breakpoints: r.breakpoints })
|
|
1046
1049
|
}),
|
|
1047
1050
|
{}
|
|
1048
|
-
), c = Object.entries(ne(
|
|
1049
|
-
([u,
|
|
1051
|
+
), c = Object.entries(ne(l)).map(
|
|
1052
|
+
([u, d]) => ({ name: u, value: d })
|
|
1050
1053
|
);
|
|
1051
1054
|
if (c.length === 0) {
|
|
1052
1055
|
console.warn("[typography/tokenManager] No typography tokens generated");
|
|
@@ -1055,41 +1058,41 @@ export { typography };
|
|
|
1055
1058
|
console.log(`[typography/tokenManager] Generated ${c.length} typography tokens`), console.log(`[typography/tokenManager] Writing files to ${e}...`), await ft({
|
|
1056
1059
|
typographyTokens: c,
|
|
1057
1060
|
dir: e,
|
|
1058
|
-
breakpoints:
|
|
1061
|
+
breakpoints: t,
|
|
1059
1062
|
fontFamily: n || {},
|
|
1060
1063
|
fluid: s
|
|
1061
1064
|
}), console.log("[typography/tokenManager] ✅ Successfully generated typography files");
|
|
1062
|
-
} catch (
|
|
1063
|
-
const n =
|
|
1064
|
-
throw console.error("[typography/tokenManager] ❌ Failed to generate typography:", n),
|
|
1065
|
+
} catch (t) {
|
|
1066
|
+
const n = t instanceof Error ? t.message : String(t);
|
|
1067
|
+
throw console.error("[typography/tokenManager] ❌ Failed to generate typography:", n), t instanceof Error && t.stack && console.error("[typography/tokenManager] Stack trace:", t.stack), t;
|
|
1065
1068
|
}
|
|
1066
1069
|
}
|
|
1067
|
-
}),
|
|
1070
|
+
}), gt = (r) => typeof r == "object" && r !== null && "type" in r && "value" in r, pt = (r) => typeof r == "object" && r !== null && !Array.isArray(r), se = (r) => r.trim().split(".").map((e) => e.trim()).filter(Boolean), ht = (r, e) => {
|
|
1068
1071
|
const o = se(e);
|
|
1069
1072
|
if (!o.length)
|
|
1070
1073
|
throw new Error("variablePath must contain at least one segment");
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
1074
|
+
const t = q(r, o);
|
|
1075
|
+
if (t === void 0)
|
|
1073
1076
|
throw new Error(`Variables subtree not found at path: ${o.join(".")}`);
|
|
1074
|
-
return
|
|
1075
|
-
}, ae = (
|
|
1076
|
-
if (!
|
|
1077
|
-
if (
|
|
1078
|
-
if (
|
|
1079
|
-
const
|
|
1080
|
-
const
|
|
1081
|
-
return { ...s, [a]:
|
|
1077
|
+
return t;
|
|
1078
|
+
}, ae = (r, e, o) => {
|
|
1079
|
+
if (!r) return [];
|
|
1080
|
+
if (gt(r)) {
|
|
1081
|
+
if (r.type !== "dimension") return [];
|
|
1082
|
+
const t = r.value, n = Object.keys(t).reduce((s, a) => {
|
|
1083
|
+
const i = t[a], l = o.resolveVariableValueString(i, a);
|
|
1084
|
+
return { ...s, [a]: l ?? i };
|
|
1082
1085
|
}, {});
|
|
1083
1086
|
return [{ flatName: e, resolvedByMode: n }];
|
|
1084
1087
|
}
|
|
1085
|
-
return
|
|
1086
|
-
const n = t
|
|
1088
|
+
return pt(r) ? Object.keys(r).flatMap((t) => {
|
|
1089
|
+
const n = r[t], s = e ? `${e}-${t}` : t;
|
|
1087
1090
|
return ae(n, s, o);
|
|
1088
1091
|
}) : [];
|
|
1089
|
-
},
|
|
1090
|
-
(o) => e.some((
|
|
1091
|
-
) :
|
|
1092
|
-
const e = se(
|
|
1092
|
+
}, mt = (r, e) => ae(r, "", e), bt = (r, e) => typeof e == "string" ? r === e : e.test(r), wt = (r, e) => e != null && e.length ? r.filter(
|
|
1093
|
+
(o) => e.some((t) => bt(o.flatName, t))
|
|
1094
|
+
) : r, kt = (r) => Object.keys(r).map((e) => ({ mode: e, widthPx: Number.parseInt(r[e], 10) })).filter((e) => Number.isFinite(e.widthPx)).sort((e, o) => o.widthPx - e.widthPx), ie = (r) => {
|
|
1095
|
+
const e = se(r);
|
|
1093
1096
|
if (!e.length)
|
|
1094
1097
|
throw new Error("variablePath must contain at least one segment");
|
|
1095
1098
|
const o = e[e.length - 1];
|
|
@@ -1097,152 +1100,162 @@ export { typography };
|
|
|
1097
1100
|
variablesClassName: `${o}-variables`,
|
|
1098
1101
|
variableNamePrefix: o
|
|
1099
1102
|
};
|
|
1100
|
-
},
|
|
1101
|
-
const
|
|
1103
|
+
}, $t = (r, e) => {
|
|
1104
|
+
const t = ie(r.variablePath).variableNamePrefix, n = e.variablesClassName ?? `${t}-variables`;
|
|
1102
1105
|
return {
|
|
1103
|
-
variableNamePrefix:
|
|
1104
|
-
variablesClassName:
|
|
1106
|
+
variableNamePrefix: t,
|
|
1107
|
+
variablesClassName: n
|
|
1105
1108
|
};
|
|
1106
|
-
},
|
|
1107
|
-
(
|
|
1108
|
-
|
|
1109
|
+
}, le = (r, e) => `${ie(r).variableNamePrefix}-${e}`, Qt = (r, e) => `--${le(r, e)}`, St = (r) => `--${r}`, ce = (r, e, o) => {
|
|
1110
|
+
const t = le(r.variablePath, o);
|
|
1111
|
+
if (!e.parseCssVariableName)
|
|
1112
|
+
return t;
|
|
1113
|
+
const n = e.parseCssVariableName({
|
|
1114
|
+
variablePath: r.variablePath,
|
|
1115
|
+
flatName: o,
|
|
1116
|
+
defaultName: t
|
|
1117
|
+
});
|
|
1118
|
+
return n.trim() ? n : t;
|
|
1119
|
+
}, Tt = (r, e) => Object.keys(e).reduce(
|
|
1120
|
+
(o, t) => {
|
|
1121
|
+
const n = Number(t);
|
|
1109
1122
|
return { ...o, [n]: { ...o[n], ...e[n] } };
|
|
1110
1123
|
},
|
|
1111
|
-
{ ...
|
|
1112
|
-
),
|
|
1113
|
-
const
|
|
1114
|
-
if (Object.keys(
|
|
1115
|
-
const
|
|
1116
|
-
return { base: { [
|
|
1124
|
+
{ ...r }
|
|
1125
|
+
), jt = (r, e, o) => {
|
|
1126
|
+
const { breakpoints: t } = e, n = ce(e, o, r.flatName), s = St(n), a = kt(t);
|
|
1127
|
+
if (Object.keys(t).length === 0 || a.length === 0) {
|
|
1128
|
+
const u = Object.values(r.resolvedByMode)[0] ?? "";
|
|
1129
|
+
return { base: { [s]: u }, byBreakpoint: {} };
|
|
1117
1130
|
}
|
|
1118
|
-
const
|
|
1119
|
-
if (
|
|
1120
|
-
const
|
|
1121
|
-
return { base: { [
|
|
1131
|
+
const i = a.filter((u) => u.mode in r.resolvedByMode);
|
|
1132
|
+
if (i.length === 0) {
|
|
1133
|
+
const u = Object.values(r.resolvedByMode)[0] ?? "";
|
|
1134
|
+
return { base: { [s]: u }, byBreakpoint: {} };
|
|
1122
1135
|
}
|
|
1123
|
-
if (
|
|
1124
|
-
const
|
|
1125
|
-
return { base: { [
|
|
1136
|
+
if (i.length === 1) {
|
|
1137
|
+
const u = i[0], d = r.resolvedByMode[u.mode] ?? "";
|
|
1138
|
+
return { base: { [s]: d }, byBreakpoint: {} };
|
|
1126
1139
|
}
|
|
1127
|
-
const
|
|
1128
|
-
const
|
|
1129
|
-
if (
|
|
1130
|
-
const
|
|
1131
|
-
return { ...
|
|
1140
|
+
const l = r.resolvedByMode[i[0].mode] ?? "", c = i.slice(1).reduce((u, d, f) => {
|
|
1141
|
+
const m = i[f].mode, g = r.resolvedByMode[m], h = r.resolvedByMode[d.mode];
|
|
1142
|
+
if (h === void 0 || h === g) return u;
|
|
1143
|
+
const b = d.widthPx, S = u[b] ?? {};
|
|
1144
|
+
return { ...u, [b]: { ...S, [s]: h } };
|
|
1132
1145
|
}, {});
|
|
1133
|
-
return { base: { [
|
|
1134
|
-
},
|
|
1135
|
-
(
|
|
1136
|
-
const { base: s, byBreakpoint: a } =
|
|
1146
|
+
return { base: { [s]: l }, byBreakpoint: c };
|
|
1147
|
+
}, vt = (r, e, o) => r.reduce(
|
|
1148
|
+
(t, n) => {
|
|
1149
|
+
const { base: s, byBreakpoint: a } = jt(n, e, o);
|
|
1137
1150
|
return {
|
|
1138
|
-
base: { ...
|
|
1139
|
-
breakpoints:
|
|
1151
|
+
base: { ...t.base, ...s },
|
|
1152
|
+
breakpoints: Tt(t.breakpoints, a)
|
|
1140
1153
|
};
|
|
1141
1154
|
},
|
|
1142
1155
|
{ base: {}, breakpoints: {} }
|
|
1143
|
-
),
|
|
1144
|
-
if (!
|
|
1145
|
-
const {
|
|
1146
|
-
const
|
|
1147
|
-
return `@media (max-width: ${
|
|
1148
|
-
${
|
|
1156
|
+
), Nt = (r, e, o) => {
|
|
1157
|
+
if (!r.length) return "";
|
|
1158
|
+
const { variablesClassName: t } = $t(e, o), n = vt(r, e, o), s = Object.keys(n.base).map((l) => ` ${l}: ${n.base[l]};`), a = W(`.${t}`, s), i = Object.keys(n.breakpoints).map(Number).sort((l, c) => c - l).map((l) => {
|
|
1159
|
+
const c = n.breakpoints[l], u = Object.keys(c).map((f) => ` ${f}: ${c[f]};`), d = W(`.${t}`, u);
|
|
1160
|
+
return `@media (max-width: ${l}px) {
|
|
1161
|
+
${d}
|
|
1149
1162
|
}`;
|
|
1150
1163
|
}).filter(Boolean).join(`
|
|
1151
1164
|
|
|
1152
1165
|
`);
|
|
1153
|
-
return i ? `${
|
|
1154
|
-
|
|
1155
|
-
${i}` : l;
|
|
1156
|
-
}, vt = (t, e) => {
|
|
1157
|
-
const o = t.resolvedByMode, r = ie(e), n = Object.keys(e).length > 0 && r.length > 0;
|
|
1158
|
-
return { breakpoints: (() => {
|
|
1159
|
-
if (!n)
|
|
1160
|
-
return Object.keys(o);
|
|
1161
|
-
const l = [], i = /* @__PURE__ */ new Set();
|
|
1162
|
-
return r.forEach(({ mode: c }) => {
|
|
1163
|
-
c in o && (l.push(c), i.add(c));
|
|
1164
|
-
}), Object.keys(o).forEach((c) => {
|
|
1165
|
-
i.has(c) || (l.push(c), i.add(c));
|
|
1166
|
-
}), l;
|
|
1167
|
-
})().reduce((l, i) => {
|
|
1168
|
-
const c = o[i];
|
|
1169
|
-
return c === void 0 ? l : { ...l, [i]: c };
|
|
1170
|
-
}, {}) };
|
|
1171
|
-
}, Mt = (t, e) => {
|
|
1172
|
-
const { breakpoints: o } = e;
|
|
1173
|
-
return t.length ? `const utilities = {
|
|
1174
|
-
${t.map((n) => {
|
|
1175
|
-
const s = vt(n, o), a = JSON.stringify(s, null, 8);
|
|
1176
|
-
return ` '${n.flatName}': ${a.replace(/\n/g, `
|
|
1177
|
-
`)}`;
|
|
1178
|
-
}).join(`,
|
|
1179
|
-
`)}
|
|
1180
|
-
} as const;
|
|
1181
|
-
|
|
1182
|
-
export { utilities };
|
|
1183
|
-
` : `const utilities = {} as const;
|
|
1166
|
+
return i ? `${a}
|
|
1184
1167
|
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1168
|
+
${i}` : a;
|
|
1169
|
+
}, Mt = (r) => {
|
|
1170
|
+
const e = r.split("-").map((o) => o.trim()).filter(Boolean);
|
|
1171
|
+
return e[e.length - 1] ?? r;
|
|
1172
|
+
}, Vt = (r, e, o) => {
|
|
1173
|
+
const t = Mt(o);
|
|
1174
|
+
if (!e.parseUtilityKey)
|
|
1175
|
+
return t;
|
|
1176
|
+
const n = e.parseUtilityKey({
|
|
1177
|
+
variablePath: r.variablePath,
|
|
1178
|
+
flatName: o,
|
|
1179
|
+
defaultKey: t
|
|
1180
|
+
});
|
|
1181
|
+
return n.trim() ? n : t;
|
|
1182
|
+
}, Ct = /^[A-Za-z_$][A-Za-z0-9_$]*$/, Ft = (r) => {
|
|
1183
|
+
var t;
|
|
1184
|
+
const o = ((t = r.utilityKeysTypeName) == null ? void 0 : t.trim()) || "UtilitiesKeysType";
|
|
1185
|
+
if (!Ct.test(o))
|
|
1186
|
+
throw new Error(
|
|
1187
|
+
`Invalid utilityKeysTypeName: "${o}". Expected a valid TypeScript identifier.`
|
|
1188
|
+
);
|
|
1189
|
+
return o;
|
|
1190
|
+
}, xt = (r, e, o) => r.reduce((t, n) => {
|
|
1191
|
+
const s = Vt(e, o, n.flatName), a = t[s];
|
|
1192
|
+
if (a && a !== n.flatName)
|
|
1193
|
+
throw new Error(
|
|
1194
|
+
`Utility key collision: "${s}" is generated for both "${a}" and "${n.flatName}"`
|
|
1195
|
+
);
|
|
1196
|
+
return {
|
|
1197
|
+
...t,
|
|
1198
|
+
[s]: n.flatName
|
|
1199
|
+
};
|
|
1200
|
+
}, {}), Pt = (r, e, o) => {
|
|
1201
|
+
var c;
|
|
1202
|
+
const t = xt(r, e, o), n = Object.keys(t).reduce((u, d) => {
|
|
1203
|
+
const f = t[d];
|
|
1204
|
+
return {
|
|
1205
|
+
...u,
|
|
1206
|
+
[d]: ce(e, o, f)
|
|
1207
|
+
};
|
|
1208
|
+
}, {}), s = JSON.stringify(n, null, 4), i = ((c = o.getUtilityCssVarFunctionName) == null ? void 0 : c.trim()) || "getUtilityCssVar", l = Ft(o);
|
|
1189
1209
|
return [
|
|
1190
|
-
|
|
1191
|
-
"",
|
|
1192
|
-
"type UtilitiesKeysType = keyof typeof utilities;",
|
|
1210
|
+
`const utilityVariableNameByKey = ${s} as const;`,
|
|
1193
1211
|
"",
|
|
1194
|
-
`
|
|
1212
|
+
`type ${l} = keyof typeof utilityVariableNameByKey;`,
|
|
1195
1213
|
"",
|
|
1196
|
-
|
|
1197
|
-
"
|
|
1198
|
-
" ? `--${utilityVariableNamePrefix}-${String(key)}`",
|
|
1199
|
-
" : `--${String(key)}`;",
|
|
1214
|
+
`const getUtilityCssVariableName = (key: ${l}): string =>`,
|
|
1215
|
+
" `--${utilityVariableNameByKey[key]}`;",
|
|
1200
1216
|
"",
|
|
1201
|
-
|
|
1217
|
+
`const ${i} = (key: ${l}): string =>`,
|
|
1202
1218
|
" `var(${getUtilityCssVariableName(key)})`;",
|
|
1203
1219
|
"",
|
|
1204
1220
|
"export {",
|
|
1205
|
-
" utilities,",
|
|
1206
1221
|
" getUtilityCssVariableName,",
|
|
1207
|
-
|
|
1208
|
-
|
|
1222
|
+
` ${i},`,
|
|
1223
|
+
` type ${l},`,
|
|
1209
1224
|
"};",
|
|
1210
1225
|
""
|
|
1211
1226
|
].join(`
|
|
1212
1227
|
`);
|
|
1213
|
-
},
|
|
1214
|
-
dir:
|
|
1228
|
+
}, Ot = "styles.css", Et = "index.ts", Bt = async ({
|
|
1229
|
+
dir: r,
|
|
1215
1230
|
globalCss: e,
|
|
1216
|
-
|
|
1217
|
-
indexTs: r
|
|
1231
|
+
indexTs: o
|
|
1218
1232
|
}) => {
|
|
1219
|
-
await
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
d.write(Nt, r, { directory: t })
|
|
1233
|
+
await y.delete(r), await Promise.all([
|
|
1234
|
+
y.write(Ot, e, { directory: r }),
|
|
1235
|
+
y.write(Et, o, { directory: r })
|
|
1223
1236
|
]);
|
|
1224
|
-
},
|
|
1225
|
-
tokens:
|
|
1237
|
+
}, Kt = async ({
|
|
1238
|
+
tokens: r,
|
|
1226
1239
|
input: e,
|
|
1227
1240
|
output: o
|
|
1228
1241
|
}) => {
|
|
1229
|
-
const { dir:
|
|
1230
|
-
await
|
|
1231
|
-
},
|
|
1242
|
+
const { dir: t } = o, n = Nt(r, e, o), s = Pt(r, e, o);
|
|
1243
|
+
await Bt({ dir: t, globalCss: n, indexTs: s });
|
|
1244
|
+
}, Xt = ({ input: r, output: e }) => ({
|
|
1232
1245
|
name: "utilities/tokenManager",
|
|
1233
1246
|
executor: async ({ tokenManagerClient: o }) => {
|
|
1234
|
-
var
|
|
1247
|
+
var t;
|
|
1235
1248
|
try {
|
|
1236
1249
|
if (console.log("[utilities/tokenManager] Generating utility classes from TokenManager..."), !o.isLoaded())
|
|
1237
1250
|
throw new Error("TokenManager is not loaded. Tokens must be loaded before using this module.");
|
|
1238
|
-
const n = o.getVariables(), s =
|
|
1239
|
-
if (!
|
|
1240
|
-
a.length && ((
|
|
1241
|
-
`[utilities/tokenManager] No tokens left after include filter (${a.length} at path "${
|
|
1242
|
-
) : console.warn(`[utilities/tokenManager] No dimension tokens found at path "${
|
|
1251
|
+
const n = o.getVariables(), s = ht(n, r.variablePath), a = mt(s, o), i = wt(a, r.include);
|
|
1252
|
+
if (!i.length) {
|
|
1253
|
+
a.length && ((t = r.include) != null && t.length) ? console.warn(
|
|
1254
|
+
`[utilities/tokenManager] No tokens left after include filter (${a.length} at path "${r.variablePath}")`
|
|
1255
|
+
) : console.warn(`[utilities/tokenManager] No dimension tokens found at path "${r.variablePath}"`);
|
|
1243
1256
|
return;
|
|
1244
1257
|
}
|
|
1245
|
-
console.log(`[utilities/tokenManager] Resolved ${
|
|
1258
|
+
console.log(`[utilities/tokenManager] Resolved ${i.length} utility token(s)`), console.log(`[utilities/tokenManager] Writing files to ${e.dir}...`), await Kt({ tokens: i, input: r, output: e }), console.log("[utilities/tokenManager] ✅ Successfully generated utility files");
|
|
1246
1259
|
} catch (n) {
|
|
1247
1260
|
const s = n instanceof Error ? n.message : String(n);
|
|
1248
1261
|
throw console.error("[utilities/tokenManager] ❌ Failed to generate utilities:", s), n instanceof Error && n.stack && console.error("[utilities/tokenManager] Stack trace:", n.stack), n;
|
|
@@ -1250,29 +1263,29 @@ export { utilities };
|
|
|
1250
1263
|
}
|
|
1251
1264
|
});
|
|
1252
1265
|
export {
|
|
1253
|
-
|
|
1266
|
+
we as BREAKPOINTS_NAMES,
|
|
1254
1267
|
be as TokenManager,
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
wt as
|
|
1262
|
-
|
|
1263
|
-
Kt as
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1268
|
+
Gt as breakpointsFromTokenManager,
|
|
1269
|
+
Nt as buildUtilitiesGlobalStylesCSS,
|
|
1270
|
+
Pt as buildUtilitiesIndexTSContent,
|
|
1271
|
+
Jt as colorsFromTokenManager,
|
|
1272
|
+
qt as containerFromTokenManager,
|
|
1273
|
+
ie as deriveUtilityNamingFromVariablePath,
|
|
1274
|
+
wt as filterResolvedUtilitiesByInclude,
|
|
1275
|
+
It as generate,
|
|
1276
|
+
Kt as generateUtilitiesFiles,
|
|
1277
|
+
kt as getSortedBreakpointModes,
|
|
1278
|
+
Qt as getUtilityCssVariableName,
|
|
1279
|
+
le as getUtilityCssVariableNameWithoutDashes,
|
|
1280
|
+
ht as getVariablesSubtree,
|
|
1281
|
+
zt as init,
|
|
1282
|
+
mt as resolveUtilitiesSubtree,
|
|
1283
|
+
ce as resolveUtilityCssVariableNameWithoutDashes,
|
|
1284
|
+
$t as resolveUtilityNaming,
|
|
1285
|
+
Ht as shadowsFromTokenManager,
|
|
1286
|
+
jt as splitUtilityTokenForMedia,
|
|
1287
|
+
Zt as typographyFromTokenManager,
|
|
1288
|
+
Xt as utilitiesFromTokenManager,
|
|
1275
1289
|
bt as utilityFlatNameMatchesIncludePattern,
|
|
1276
|
-
|
|
1277
|
-
xt as writeUtilitiesFiles
|
|
1290
|
+
Bt as writeUtilitiesFiles
|
|
1278
1291
|
};
|