@a_ng_d/utils-ui-color-palette 1.10.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -0
- package/dist/formats/semantics/_helpers.d.ts +1 -0
- package/dist/formats/semantics/_helpers.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/modules/code/code.js +23 -19
- package/dist/modules/code/code.js.map +1 -1
- package/dist/modules/system/system.d.ts +1 -2
- package/dist/modules/system/system.d.ts.map +1 -1
- package/dist/modules/system/system.js +51 -72
- package/dist/modules/system/system.js.map +1 -1
- package/dist/types/system.types.d.ts +2 -5
- package/dist/types/system.types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,13 @@ UI Color Palette is available for:
|
|
|
42
42
|
- Automatic color relationship calculations
|
|
43
43
|
- Support for all major color harmony types
|
|
44
44
|
|
|
45
|
+
- **Color System & Semantic Tokens**:
|
|
46
|
+
|
|
47
|
+
- Build a semantic color system from a taxonomy schema and palette data
|
|
48
|
+
- Bind semantic tokens to primitive shades with optional per-theme overrides
|
|
49
|
+
- Exclude specific tokens from code generation via the `isExcluded` flag
|
|
50
|
+
- Generate semantic token files for CSS, SCSS, LESS, DTCG, Tailwind v3/v4, SwiftUI, UIKit, Compose, Native, Universal, CSV, Android Resources, and Style Dictionary v3
|
|
51
|
+
|
|
45
52
|
- **Palette Generation**:
|
|
46
53
|
- Create harmonious color schemes
|
|
47
54
|
- Generate accessible color combinations
|
|
@@ -320,6 +327,61 @@ paletteData.themes[0].colors[0].shades.forEach((shade) => {
|
|
|
320
327
|
})
|
|
321
328
|
```
|
|
322
329
|
|
|
330
|
+
### Color System & Semantic Tokens
|
|
331
|
+
|
|
332
|
+
```typescript
|
|
333
|
+
import { System, Code } from '@a_ng_d/utils-ui-color-palette'
|
|
334
|
+
|
|
335
|
+
// Define a taxonomy schema (groups of semantic dimensions)
|
|
336
|
+
const system = new System({
|
|
337
|
+
paletteData,
|
|
338
|
+
system: {
|
|
339
|
+
schema: {
|
|
340
|
+
groups: [
|
|
341
|
+
{
|
|
342
|
+
id: 'role',
|
|
343
|
+
name: 'Role',
|
|
344
|
+
members: [
|
|
345
|
+
{ id: 'brand', name: 'Brand' },
|
|
346
|
+
{ id: 'neutral', name: 'Neutral' },
|
|
347
|
+
],
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
id: 'prominence',
|
|
351
|
+
name: 'Prominence',
|
|
352
|
+
members: [
|
|
353
|
+
{ id: 'default', name: 'Default' },
|
|
354
|
+
{ id: 'subtle', name: 'Subtle' },
|
|
355
|
+
],
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
},
|
|
359
|
+
bindings: [
|
|
360
|
+
{
|
|
361
|
+
path: ['brand', 'default'],
|
|
362
|
+
description: 'Primary brand color',
|
|
363
|
+
ref: 'blue:500',
|
|
364
|
+
overrides: { dark: 'blue:400' }, // per-theme override
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
path: ['neutral', 'subtle'],
|
|
368
|
+
ref: 'gray:200',
|
|
369
|
+
isExcluded: true, // skip this token in code generation
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
},
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
// Resolve the system data (tokens + refs)
|
|
376
|
+
const systemData = system.makeSystemData()
|
|
377
|
+
|
|
378
|
+
// Generate semantic token files alongside primitives
|
|
379
|
+
const code = new Code({ paletteData, systemData })
|
|
380
|
+
const files = code.makeCssFiles()
|
|
381
|
+
// files[0].content includes both --color-blue-500 primitives
|
|
382
|
+
// and --brand-default / --neutral-default semantic custom properties
|
|
383
|
+
```
|
|
384
|
+
|
|
323
385
|
## Testing
|
|
324
386
|
|
|
325
387
|
```bash
|
|
@@ -21,5 +21,6 @@ export declare const resolveTokenPerTheme: (paletteData: PaletteData, token: Sys
|
|
|
21
21
|
export declare const partitionTokens: (paletteData: PaletteData, systemData: SystemData) => {
|
|
22
22
|
bound: Array<SystemDataToken>;
|
|
23
23
|
unbound: Array<SystemDataToken>;
|
|
24
|
+
excluded: Array<SystemDataToken>;
|
|
24
25
|
};
|
|
25
26
|
//# sourceMappingURL=_helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_helpers.d.ts","sourceRoot":"","sources":["../../../src/formats/semantics/_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEnE,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,YAAY,YAAa,MAAM,KAAG,SAAS,GAAG,IAM1D,CAAA;AAED,eAAO,MAAM,aAAa,gBACX,WAAW,WACf,MAAM,WACN,MAAM,KACd,MAAM,GAAG,IAIX,CAAA;AAED,eAAO,MAAM,aAAa,gBACX,WAAW,WACf,MAAM,KACd,MAAM,GAAG,IACoD,CAAA;AAEhE,eAAO,MAAM,aAAa,gBACX,WAAW,KACvB,KAAK,CAAC,oBAAoB,CAGoC,CAAA;AAEjE,eAAO,MAAM,aAAa,cAAe,MAAM,KAAG,OAC1B,CAAA;AAExB,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,oBAAoB,gBAClB,WAAW,SACjB,eAAe,KACrB,KAAK,CAAC,qBAAqB,CA0B1B,CAAA;AAEJ,eAAO,MAAM,eAAe,gBACb,WAAW,cACZ,UAAU,KACrB;IACD,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IAC7B,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"_helpers.d.ts","sourceRoot":"","sources":["../../../src/formats/semantics/_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEnE,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,YAAY,YAAa,MAAM,KAAG,SAAS,GAAG,IAM1D,CAAA;AAED,eAAO,MAAM,aAAa,gBACX,WAAW,WACf,MAAM,WACN,MAAM,KACd,MAAM,GAAG,IAIX,CAAA;AAED,eAAO,MAAM,aAAa,gBACX,WAAW,WACf,MAAM,KACd,MAAM,GAAG,IACoD,CAAA;AAEhE,eAAO,MAAM,aAAa,gBACX,WAAW,KACvB,KAAK,CAAC,oBAAoB,CAGoC,CAAA;AAEjE,eAAO,MAAM,aAAa,cAAe,MAAM,KAAG,OAC1B,CAAA;AAExB,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,oBAAoB,gBAClB,WAAW,SACjB,eAAe,KACrB,KAAK,CAAC,qBAAqB,CA0B1B,CAAA;AAEJ,eAAO,MAAM,eAAe,gBACb,WAAW,cACZ,UAAU,KACrB;IACD,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IAC7B,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IAC/B,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;CAejC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { HexModel, RgbModel, HslModel, Channel, ChannelWithAlpha, ImageData, DominantColorResult, DominantColorsOptions, HarmonyType, ColorHarmonyResult, ColorHarmonyOptions, } from './types/color.types';
|
|
2
2
|
export type { BaseConfiguration, SourceColorConfiguration, ExchangeConfiguration, ExtractOfBaseConfiguration, EasingConfiguration, PresetConfiguration, ShiftConfiguration, ScaleConfiguration, LockedSourceColorsConfiguration, ColorConfiguration, ThemeConfiguration, ExportConfiguration, ColorSpaceConfiguration, VisionSimulationModeConfiguration, TextColorsThemeConfiguration, ViewConfiguration, AlgorithmVersionConfiguration, DatesConfiguration, PublicationConfiguration, CreatorConfiguration, StatusConfiguration, UserConfiguration, MetaConfiguration, FullConfiguration, DocumentConfiguration, ThirdParty, } from './types/configuration.types';
|
|
3
3
|
export type { PaletteData, LibraryData, PaletteDataThemeItem, PaletteDataColorItem, PaletteDataShadeItem, ExternalPalettes, ColourLovers, } from './types/data.types';
|
|
4
|
-
export type { TaxonomyGroupMember, TaxonomyGroup,
|
|
4
|
+
export type { TaxonomyGroupMember, TaxonomyGroup, TaxonomySchema, TaxonomyBinding, SystemConfiguration, SystemData, SystemDataToken, SystemDataRef, } from './types/system.types';
|
|
5
5
|
export type { CodeFile } from './types/code.types';
|
|
6
6
|
export type { ColorFormat } from './types/model.types';
|
|
7
7
|
export { default as Color } from './modules/color/color';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,+BAA+B,EAC/B,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,iCAAiC,EACjC,4BAA4B,EAC5B,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,GACX,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,GACb,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,+BAA+B,EAC/B,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,iCAAiC,EACjC,4BAA4B,EAC5B,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,GACX,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,GACb,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,aAAa,GACd,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,0CAA0C,CAAA;AACpF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sCAAsC,CAAA"}
|
|
@@ -19,7 +19,7 @@ const j = (r) => {
|
|
|
19
19
|
}, F = (r, p) => {
|
|
20
20
|
var h;
|
|
21
21
|
return ((h = r.themes.find((c) => c.id === p)) == null ? void 0 : h.name) ?? null;
|
|
22
|
-
},
|
|
22
|
+
}, x = (r) => r.themes.filter((p) => p.type === "custom theme").length === 0 ? r.themes.filter((p) => p.type === "default theme") : r.themes.filter((p) => p.type === "custom theme"), g = (r, p) => p.refs.map((h) => {
|
|
23
23
|
if (h.shadeId === null)
|
|
24
24
|
return {
|
|
25
25
|
themeId: h.themeId,
|
|
@@ -42,13 +42,17 @@ const j = (r) => {
|
|
|
42
42
|
shadeName: null,
|
|
43
43
|
isUnbound: !0
|
|
44
44
|
};
|
|
45
|
-
}),
|
|
46
|
-
const h = [], c = [];
|
|
47
|
-
return p.tokens.forEach((
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
}), w = (r, p) => {
|
|
46
|
+
const h = [], c = [], m = [];
|
|
47
|
+
return p.tokens.forEach((i) => {
|
|
48
|
+
if (i.isExcluded) {
|
|
49
|
+
m.push(i);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
g(r, i).every((e) => e.isUnbound) ? c.push(i) : h.push(i);
|
|
53
|
+
}), { bound: h, unbound: c, excluded: m };
|
|
50
54
|
}, V = (r, p) => {
|
|
51
|
-
const { bound: h, unbound: c } =
|
|
55
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = m.filter((a) => a.type === "custom theme"), o = {};
|
|
52
56
|
c.length > 0 && (o._unbound = c.map((a) => a.pathNames.join(".")));
|
|
53
57
|
const e = (a, t, s) => {
|
|
54
58
|
let n = a;
|
|
@@ -71,7 +75,7 @@ const j = (r) => {
|
|
|
71
75
|
}), o[t] = s;
|
|
72
76
|
}), JSON.stringify(o, null, 2);
|
|
73
77
|
}, O = (r, p) => {
|
|
74
|
-
const { bound: h, unbound: c } =
|
|
78
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((t) => t.type === "default theme") ?? m[0], o = m.filter((t) => t.type === "custom theme"), e = ["import UIKit", ""];
|
|
75
79
|
c.length > 0 && (e.push("// Unbound semantic tokens"), c.forEach((t) => e.push(`// ${t.pathNames.join("-")}`)), e.push(""));
|
|
76
80
|
const u = (t) => new d(t.join(" ")).doCamelCase(), a = (t, s, n) => {
|
|
77
81
|
const l = new d(s).doCamelCase(), f = n === "source" ? "Source" : new d(n).doPascalCase();
|
|
@@ -93,7 +97,7 @@ const j = (r) => {
|
|
|
93
97
|
}), e.push("}"), e.join(`
|
|
94
98
|
`);
|
|
95
99
|
}, P = (r, p) => {
|
|
96
|
-
const { bound: h, unbound: c } =
|
|
100
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((t) => t.type === "default theme") ?? m[0], o = m.filter((t) => t.type === "custom theme"), e = ['@import "tailwindcss";', ""];
|
|
97
101
|
c.length > 0 && (e.push("/* Unbound semantic tokens */"), c.forEach((t) => e.push(`/* ${t.pathNames.join("-")} */`)), e.push(""));
|
|
98
102
|
const u = (t) => `--color-${t.map((s) => new d(s).doKebabCase()).join("-")}`, a = (t, s) => `var(--color-${new d(t).doKebabCase()}-${s})`;
|
|
99
103
|
return e.push("@theme {"), h.forEach((t) => {
|
|
@@ -112,7 +116,7 @@ const j = (r) => {
|
|
|
112
116
|
}), e.join(`
|
|
113
117
|
`);
|
|
114
118
|
}, H = (r, p) => {
|
|
115
|
-
const { bound: h, unbound: c } =
|
|
119
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((t) => t.type === "default theme") ?? m[0], o = m.filter((t) => t.type === "custom theme"), e = [];
|
|
116
120
|
e.push("// Semantic token map. Import alongside primitives.js:"), e.push("// const primitives = require('./primitives.js')"), e.push("// const semantics = require('./semantics.js')(primitives)"), e.push(""), c.length > 0 && (e.push("// Unbound semantic tokens"), c.forEach((t) => e.push(`// ${t.pathNames.join("-")}`)), e.push(""));
|
|
117
121
|
const u = (t) => `'${t.map((s) => new d(s).doKebabCase()).join("-")}'`, a = (t, s, n) => {
|
|
118
122
|
const l = new d(s).doKebabCase();
|
|
@@ -134,7 +138,7 @@ const j = (r) => {
|
|
|
134
138
|
}), e.push(" }"), e.push("}"), e.join(`
|
|
135
139
|
`);
|
|
136
140
|
}, B = (r, p) => {
|
|
137
|
-
const { bound: h, unbound: c } =
|
|
141
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((t) => t.type === "default theme") ?? m[0], o = m.filter((t) => t.type === "custom theme"), e = ["import SwiftUI", ""];
|
|
138
142
|
c.length > 0 && (e.push("// Unbound semantic tokens"), c.forEach((t) => e.push(`// ${t.pathNames.join("-")}`)), e.push(""));
|
|
139
143
|
const u = (t) => new d(t.join(" ")).doCamelCase(), a = (t, s, n) => {
|
|
140
144
|
const l = new d(s).doCamelCase(), f = n === "source" ? "Source" : new d(n).doPascalCase();
|
|
@@ -158,7 +162,7 @@ const j = (r) => {
|
|
|
158
162
|
}), e.push(" }"), e.push("}"), e.join(`
|
|
159
163
|
`);
|
|
160
164
|
}, G = (r, p) => {
|
|
161
|
-
const { bound: h, unbound: c } =
|
|
165
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((s) => s.type === "default theme") ?? m[0], o = m.filter((s) => s.type === "custom theme"), e = {};
|
|
162
166
|
c.length > 0 && (e._unbound = c.map((s) => s.pathNames.join(".")));
|
|
163
167
|
const u = (s, n, l) => {
|
|
164
168
|
let f = s;
|
|
@@ -190,7 +194,7 @@ const j = (r) => {
|
|
|
190
194
|
}), Object.keys(l).length > 0 && (e[n] = l);
|
|
191
195
|
}), JSON.stringify(e, null, 2);
|
|
192
196
|
}, A = (r, p) => {
|
|
193
|
-
const { bound: h, unbound: c } =
|
|
197
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((s) => s.type === "default theme") ?? m[0], o = m.filter((s) => s.type === "custom theme"), e = [];
|
|
194
198
|
c.length > 0 && (e.push("// Unbound semantic tokens"), c.forEach((s) => e.push(`// ${s.pathNames.join("-")}`)), e.push(""));
|
|
195
199
|
const u = (s) => s.map((n) => new d(n).doKebabCase()).join("-"), a = (s, n) => `$${new d(s).doKebabCase()}-${n}`, t = (s, n) => `var(--${new d(s).doKebabCase()}-${n})`;
|
|
196
200
|
return o.length === 0 ? (h.forEach((s) => {
|
|
@@ -213,7 +217,7 @@ const j = (r) => {
|
|
|
213
217
|
`).replace(/\n+$/, `
|
|
214
218
|
`));
|
|
215
219
|
}, _ = (r, p) => {
|
|
216
|
-
const { bound: h, unbound: c } =
|
|
220
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((t) => t.type === "default theme") ?? m[0], o = m.filter((t) => t.type === "custom theme"), e = [
|
|
217
221
|
'<?xml version="1.0" encoding="utf-8"?>',
|
|
218
222
|
"<resources>"
|
|
219
223
|
];
|
|
@@ -279,7 +283,7 @@ const j = (r) => {
|
|
|
279
283
|
});
|
|
280
284
|
}), JSON.stringify(i, null, " ");
|
|
281
285
|
}, J = (r, p) => {
|
|
282
|
-
const h = JSON.parse(S(r)), { bound: c, unbound: m } =
|
|
286
|
+
const h = JSON.parse(S(r)), { bound: c, unbound: m } = w(r, p), i = x(r), o = r.themes.find((n) => n.type === "default theme") ?? i[0], e = i.filter((n) => n.type === "custom theme"), u = r.name, a = (n, l) => `{${new d(n).doSnakeCase()}.${l}}`, t = e.length === 0 ? u : `${u}/semantic`;
|
|
283
287
|
h[t] = h[t] ?? {};
|
|
284
288
|
const s = h[t];
|
|
285
289
|
return c.forEach((n) => {
|
|
@@ -303,7 +307,7 @@ const j = (r) => {
|
|
|
303
307
|
}), Object.keys(f).length > 0 && (h[l] = f);
|
|
304
308
|
}), m.length > 0 && (h._unbound = m.map((n) => n.pathNames.join("."))), JSON.stringify(h, null, " ");
|
|
305
309
|
}, X = (r, p) => {
|
|
306
|
-
const { bound: h, unbound: c } =
|
|
310
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((t) => t.type === "default theme") ?? m[0], o = m.filter((t) => t.type === "custom theme"), e = [];
|
|
307
311
|
c.length > 0 && (e.push("// Unbound semantic tokens"), c.forEach((t) => e.push(`// ${t.pathNames.join("-")}`)), e.push(""));
|
|
308
312
|
const u = (t) => t.map((s) => new d(s).doKebabCase()).join("-"), a = (t, s) => `@${new d(t).doKebabCase()}-${s}`;
|
|
309
313
|
return o.length === 0 ? (h.forEach((t) => {
|
|
@@ -324,7 +328,7 @@ const j = (r) => {
|
|
|
324
328
|
`).replace(/\n+$/, `
|
|
325
329
|
`));
|
|
326
330
|
}, z = (r, p) => {
|
|
327
|
-
const { bound: h, unbound: c } =
|
|
331
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((t) => t.type === "default theme") ?? m[0], o = m.filter((t) => t.type === "custom theme"), e = {};
|
|
328
332
|
c.length > 0 && (e.$description = "Unbound semantic tokens (no resolution): " + c.map((t) => t.pathNames.join(".")).join(", "));
|
|
329
333
|
const u = (t, s, n) => {
|
|
330
334
|
let l = t;
|
|
@@ -371,7 +375,7 @@ const j = (r) => {
|
|
|
371
375
|
}), h.join(`
|
|
372
376
|
`);
|
|
373
377
|
}, q = (r, p) => {
|
|
374
|
-
const { bound: h, unbound: c } =
|
|
378
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((t) => t.type === "default theme") ?? m[0], o = [];
|
|
375
379
|
c.length > 0 && (o.push("/* Unbound semantic tokens */"), c.forEach((t) => o.push(`/* ${t.pathNames.join("-")} */`)), o.push(""));
|
|
376
380
|
const e = (t) => `--${t.map((s) => new d(s).doKebabCase()).join("-")}`, u = (t, s) => `var(--${new d(t).doKebabCase()}-${s})`, a = [];
|
|
377
381
|
return h.forEach((t) => {
|
|
@@ -390,7 +394,7 @@ const j = (r) => {
|
|
|
390
394
|
}), o.join(`
|
|
391
395
|
`);
|
|
392
396
|
}, W = (r, p) => {
|
|
393
|
-
const { bound: h, unbound: c } =
|
|
397
|
+
const { bound: h, unbound: c } = w(r, p), m = x(r), i = r.themes.find((t) => t.type === "default theme") ?? m[0], o = m.filter((t) => t.type === "custom theme"), e = ["import androidx.compose.ui.graphics.Color", ""];
|
|
394
398
|
c.length > 0 && (e.push("// Unbound semantic tokens"), c.forEach((t) => e.push(`// ${t.pathNames.join("-")}`)), e.push(""));
|
|
395
399
|
const u = (t) => t.map((s) => new d(s).doSnakeCase()).join("_"), a = (t, s, n) => {
|
|
396
400
|
const l = new d(s).doSnakeCase(), f = n === "source" ? "source" : n;
|