@ticketlayer/theme 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,354 @@
1
+ /* Generated from tokens.json by packages/theme/scripts/generate.mjs. Do not edit. */
2
+ /**
3
+ * Typed access to the token set. Generated from packages/theme/tokens.json;
4
+ * change a token there and regenerate.
5
+ */
6
+ /** Every token name, in declaration order. */
7
+ export const TOKEN_NAMES = [
8
+ 'primary',
9
+ 'primary-foreground',
10
+ 'secondary',
11
+ 'secondary-foreground',
12
+ 'accent',
13
+ 'accent-foreground',
14
+ 'background',
15
+ 'foreground',
16
+ 'card',
17
+ 'muted',
18
+ 'muted-foreground',
19
+ 'border',
20
+ 'border-hover',
21
+ 'input',
22
+ 'ring',
23
+ 'success',
24
+ 'success-foreground',
25
+ 'warning',
26
+ 'warning-foreground',
27
+ 'warning-bg',
28
+ 'error',
29
+ 'error-foreground',
30
+ 'error-bg',
31
+ 'font-family',
32
+ 'font-family-mono',
33
+ 'font-size-base',
34
+ 'font-scale',
35
+ 'radius-none',
36
+ 'radius-sm',
37
+ 'radius-md',
38
+ 'radius-lg',
39
+ 'radius-full',
40
+ 'spacing-1',
41
+ 'spacing-2',
42
+ 'spacing-3',
43
+ 'spacing-4',
44
+ 'spacing-5',
45
+ 'spacing-6',
46
+ 'spacing-8',
47
+ 'duration-fast',
48
+ 'duration-normal',
49
+ 'duration-slow',
50
+ 'easing-standard',
51
+ 'easing-emphasised',
52
+ ];
53
+ /** Alias name -> the token it resolves to. */
54
+ export const TOKEN_ALIASES = {
55
+ 'color-primary': 'primary',
56
+ 'color-primary-foreground': 'primary-foreground',
57
+ 'color-secondary': 'secondary',
58
+ 'color-secondary-foreground': 'secondary-foreground',
59
+ 'color-accent': 'accent',
60
+ 'color-accent-foreground': 'accent-foreground',
61
+ 'color-background': 'background',
62
+ 'color-foreground': 'foreground',
63
+ 'color-card': 'card',
64
+ 'color-muted': 'muted',
65
+ 'color-muted-foreground': 'muted-foreground',
66
+ 'color-border': 'border',
67
+ 'color-border-hover': 'border-hover',
68
+ 'color-input': 'input',
69
+ 'color-ring': 'ring',
70
+ 'color-success': 'success',
71
+ 'color-success-foreground': 'success-foreground',
72
+ 'color-warning': 'warning',
73
+ 'color-warning-foreground': 'warning-foreground',
74
+ 'color-warning-bg': 'warning-bg',
75
+ 'color-error': 'error',
76
+ 'destructive': 'error',
77
+ 'color-destructive': 'error',
78
+ 'color-error-foreground': 'error-foreground',
79
+ 'destructive-foreground': 'error-foreground',
80
+ 'color-destructive-foreground': 'error-foreground',
81
+ 'color-error-bg': 'error-bg',
82
+ 'destructive-bg': 'error-bg',
83
+ 'color-destructive-bg': 'error-bg',
84
+ 'base-size': 'font-size-base',
85
+ 'radius': 'radius-md',
86
+ };
87
+ /** The default (light) value of every token, by token name. */
88
+ export const TOKEN_DEFAULTS = {
89
+ 'primary': '#6366f1',
90
+ 'primary-foreground': '#ffffff',
91
+ 'secondary': '#f3f4f6',
92
+ 'secondary-foreground': '#111827',
93
+ 'accent': '#ec4899',
94
+ 'accent-foreground': '#ffffff',
95
+ 'background': '#ffffff',
96
+ 'foreground': '#111827',
97
+ 'card': '#ffffff',
98
+ 'muted': '#f9fafb',
99
+ 'muted-foreground': '#6b7280',
100
+ 'border': '#e5e7eb',
101
+ 'border-hover': '#9ca3af',
102
+ 'input': '#e5e7eb',
103
+ 'ring': '#6366f1',
104
+ 'success': '#10b981',
105
+ 'success-foreground': '#ffffff',
106
+ 'warning': '#f59e0b',
107
+ 'warning-foreground': '#ffffff',
108
+ 'warning-bg': '#fef3c7',
109
+ 'error': '#ef4444',
110
+ 'error-foreground': '#ffffff',
111
+ 'error-bg': '#fee2e2',
112
+ 'font-family': 'system-ui, -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif',
113
+ 'font-family-mono': 'ui-monospace, SFMono-Regular, \'SF Mono\', Menlo, monospace',
114
+ 'font-size-base': '16px',
115
+ 'font-scale': '1.25',
116
+ 'radius-none': '0px',
117
+ 'radius-sm': '0.25rem',
118
+ 'radius-md': '0.5rem',
119
+ 'radius-lg': '0.75rem',
120
+ 'radius-full': '9999px',
121
+ 'spacing-1': '0.25rem',
122
+ 'spacing-2': '0.5rem',
123
+ 'spacing-3': '0.75rem',
124
+ 'spacing-4': '1rem',
125
+ 'spacing-5': '1.25rem',
126
+ 'spacing-6': '1.5rem',
127
+ 'spacing-8': '2rem',
128
+ 'duration-fast': '120ms',
129
+ 'duration-normal': '200ms',
130
+ 'duration-slow': '320ms',
131
+ 'easing-standard': 'cubic-bezier(0.2, 0, 0, 1)',
132
+ 'easing-emphasised': 'cubic-bezier(0.3, 0, 0, 1)',
133
+ };
134
+ /** The dark value of every token that has one. */
135
+ export const TOKEN_DARK = {
136
+ 'primary': '#818cf8',
137
+ 'primary-foreground': '#111827',
138
+ 'secondary': '#1f2937',
139
+ 'secondary-foreground': '#f9fafb',
140
+ 'accent': '#f472b6',
141
+ 'accent-foreground': '#111827',
142
+ 'background': '#0b0f19',
143
+ 'foreground': '#f9fafb',
144
+ 'card': '#111827',
145
+ 'muted': '#111827',
146
+ 'muted-foreground': '#9ca3af',
147
+ 'border': '#374151',
148
+ 'border-hover': '#4b5563',
149
+ 'input': '#374151',
150
+ 'ring': '#818cf8',
151
+ 'success': '#34d399',
152
+ 'success-foreground': '#062a1d',
153
+ 'warning': '#fbbf24',
154
+ 'warning-foreground': '#2a1a02',
155
+ 'warning-bg': '#422006',
156
+ 'error': '#f87171',
157
+ 'error-foreground': '#2a0a0a',
158
+ 'error-bg': '#450a0a',
159
+ };
160
+ /** The theme-document key that feeds each token, for the tokens the theme API can set. */
161
+ export const TOKEN_THEME_KEYS = {
162
+ 'primary': 'colors.primary',
163
+ 'primary-foreground': 'colors.primaryForeground',
164
+ 'secondary': 'colors.secondary',
165
+ 'secondary-foreground': 'colors.secondaryForeground',
166
+ 'accent': 'colors.accent',
167
+ 'accent-foreground': 'colors.accentForeground',
168
+ 'background': 'colors.background',
169
+ 'foreground': 'colors.foreground',
170
+ 'muted': 'colors.muted',
171
+ 'muted-foreground': 'colors.mutedForeground',
172
+ 'border': 'colors.border',
173
+ 'input': 'colors.input',
174
+ 'ring': 'colors.ring',
175
+ 'success': 'colors.success',
176
+ 'success-foreground': 'colors.successForeground',
177
+ 'warning': 'colors.warning',
178
+ 'warning-foreground': 'colors.warningForeground',
179
+ 'error': 'colors.destructive',
180
+ 'error-foreground': 'colors.destructiveForeground',
181
+ 'font-family': 'typography.fontFamily',
182
+ 'font-family-mono': 'typography.fontFamilyMono',
183
+ 'font-size-base': 'typography.baseSize',
184
+ 'font-scale': 'typography.scaleRatio',
185
+ 'radius-none': 'shape.radiusNone',
186
+ 'radius-sm': 'shape.radiusSm',
187
+ 'radius-md': 'shape.radiusMd',
188
+ 'radius-lg': 'shape.radiusLg',
189
+ 'radius-full': 'shape.radiusFull',
190
+ };
191
+ /** The group each token belongs to. */
192
+ export const TOKEN_GROUPS = {
193
+ 'primary': 'color',
194
+ 'primary-foreground': 'color',
195
+ 'secondary': 'color',
196
+ 'secondary-foreground': 'color',
197
+ 'accent': 'color',
198
+ 'accent-foreground': 'color',
199
+ 'background': 'color',
200
+ 'foreground': 'color',
201
+ 'card': 'color',
202
+ 'muted': 'color',
203
+ 'muted-foreground': 'color',
204
+ 'border': 'color',
205
+ 'border-hover': 'color',
206
+ 'input': 'color',
207
+ 'ring': 'color',
208
+ 'success': 'color',
209
+ 'success-foreground': 'color',
210
+ 'warning': 'color',
211
+ 'warning-foreground': 'color',
212
+ 'warning-bg': 'color',
213
+ 'error': 'color',
214
+ 'error-foreground': 'color',
215
+ 'error-bg': 'color',
216
+ 'font-family': 'typography',
217
+ 'font-family-mono': 'typography',
218
+ 'font-size-base': 'typography',
219
+ 'font-scale': 'typography',
220
+ 'radius-none': 'radius',
221
+ 'radius-sm': 'radius',
222
+ 'radius-md': 'radius',
223
+ 'radius-lg': 'radius',
224
+ 'radius-full': 'radius',
225
+ 'spacing-1': 'spacing',
226
+ 'spacing-2': 'spacing',
227
+ 'spacing-3': 'spacing',
228
+ 'spacing-4': 'spacing',
229
+ 'spacing-5': 'spacing',
230
+ 'spacing-6': 'spacing',
231
+ 'spacing-8': 'spacing',
232
+ 'duration-fast': 'motion',
233
+ 'duration-normal': 'motion',
234
+ 'duration-slow': 'motion',
235
+ 'easing-standard': 'motion',
236
+ 'easing-emphasised': 'motion',
237
+ };
238
+ /**
239
+ * The typed theme object a native harness renders from: the same tokens, grouped,
240
+ * with camelCase keys and no CSS anywhere near them.
241
+ */
242
+ export const lightTheme = {
243
+ color: {
244
+ 'primary': '#6366f1',
245
+ 'primaryForeground': '#ffffff',
246
+ 'secondary': '#f3f4f6',
247
+ 'secondaryForeground': '#111827',
248
+ 'accent': '#ec4899',
249
+ 'accentForeground': '#ffffff',
250
+ 'background': '#ffffff',
251
+ 'foreground': '#111827',
252
+ 'card': '#ffffff',
253
+ 'muted': '#f9fafb',
254
+ 'mutedForeground': '#6b7280',
255
+ 'border': '#e5e7eb',
256
+ 'borderHover': '#9ca3af',
257
+ 'input': '#e5e7eb',
258
+ 'ring': '#6366f1',
259
+ 'success': '#10b981',
260
+ 'successForeground': '#ffffff',
261
+ 'warning': '#f59e0b',
262
+ 'warningForeground': '#ffffff',
263
+ 'warningBg': '#fef3c7',
264
+ 'error': '#ef4444',
265
+ 'errorForeground': '#ffffff',
266
+ 'errorBg': '#fee2e2',
267
+ },
268
+ typography: {
269
+ 'fontFamily': 'system-ui, -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif',
270
+ 'fontFamilyMono': 'ui-monospace, SFMono-Regular, \'SF Mono\', Menlo, monospace',
271
+ 'fontSizeBase': '16px',
272
+ 'fontScale': '1.25',
273
+ },
274
+ radius: {
275
+ 'none': '0px',
276
+ 'sm': '0.25rem',
277
+ 'md': '0.5rem',
278
+ 'lg': '0.75rem',
279
+ 'full': '9999px',
280
+ },
281
+ spacing: {
282
+ '1': '0.25rem',
283
+ '2': '0.5rem',
284
+ '3': '0.75rem',
285
+ '4': '1rem',
286
+ '5': '1.25rem',
287
+ '6': '1.5rem',
288
+ '8': '2rem',
289
+ },
290
+ motion: {
291
+ 'durationFast': '120ms',
292
+ 'durationNormal': '200ms',
293
+ 'durationSlow': '320ms',
294
+ 'easingStandard': 'cubic-bezier(0.2, 0, 0, 1)',
295
+ 'easingEmphasised': 'cubic-bezier(0.3, 0, 0, 1)',
296
+ },
297
+ };
298
+ export const darkTheme = {
299
+ color: {
300
+ 'primary': '#818cf8',
301
+ 'primaryForeground': '#111827',
302
+ 'secondary': '#1f2937',
303
+ 'secondaryForeground': '#f9fafb',
304
+ 'accent': '#f472b6',
305
+ 'accentForeground': '#111827',
306
+ 'background': '#0b0f19',
307
+ 'foreground': '#f9fafb',
308
+ 'card': '#111827',
309
+ 'muted': '#111827',
310
+ 'mutedForeground': '#9ca3af',
311
+ 'border': '#374151',
312
+ 'borderHover': '#4b5563',
313
+ 'input': '#374151',
314
+ 'ring': '#818cf8',
315
+ 'success': '#34d399',
316
+ 'successForeground': '#062a1d',
317
+ 'warning': '#fbbf24',
318
+ 'warningForeground': '#2a1a02',
319
+ 'warningBg': '#422006',
320
+ 'error': '#f87171',
321
+ 'errorForeground': '#2a0a0a',
322
+ 'errorBg': '#450a0a',
323
+ },
324
+ typography: {
325
+ 'fontFamily': 'system-ui, -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif',
326
+ 'fontFamilyMono': 'ui-monospace, SFMono-Regular, \'SF Mono\', Menlo, monospace',
327
+ 'fontSizeBase': '16px',
328
+ 'fontScale': '1.25',
329
+ },
330
+ radius: {
331
+ 'none': '0px',
332
+ 'sm': '0.25rem',
333
+ 'md': '0.5rem',
334
+ 'lg': '0.75rem',
335
+ 'full': '9999px',
336
+ },
337
+ spacing: {
338
+ '1': '0.25rem',
339
+ '2': '0.5rem',
340
+ '3': '0.75rem',
341
+ '4': '1rem',
342
+ '5': '1.25rem',
343
+ '6': '1.5rem',
344
+ '8': '2rem',
345
+ },
346
+ motion: {
347
+ 'durationFast': '120ms',
348
+ 'durationNormal': '200ms',
349
+ 'durationSlow': '320ms',
350
+ 'easingStandard': 'cubic-bezier(0.2, 0, 0, 1)',
351
+ 'easingEmphasised': 'cubic-bezier(0.3, 0, 0, 1)',
352
+ },
353
+ };
354
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/generated/tokens.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF;;;GAGG;AAEH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,oBAAoB;IACpB,WAAW;IACX,sBAAsB;IACtB,QAAQ;IACR,mBAAmB;IACnB,YAAY;IACZ,YAAY;IACZ,MAAM;IACN,OAAO;IACP,kBAAkB;IAClB,QAAQ;IACR,cAAc;IACd,OAAO;IACP,MAAM;IACN,SAAS;IACT,oBAAoB;IACpB,SAAS;IACT,oBAAoB;IACpB,YAAY;IACZ,OAAO;IACP,kBAAkB;IAClB,UAAU;IACV,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,WAAW;IACX,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,eAAe;IACf,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,mBAAmB;CACX,CAAC;AAKX,8CAA8C;AAC9C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,eAAe,EAAE,SAAS;IAC1B,0BAA0B,EAAE,oBAAoB;IAChD,iBAAiB,EAAE,WAAW;IAC9B,4BAA4B,EAAE,sBAAsB;IACpD,cAAc,EAAE,QAAQ;IACxB,yBAAyB,EAAE,mBAAmB;IAC9C,kBAAkB,EAAE,YAAY;IAChC,kBAAkB,EAAE,YAAY;IAChC,YAAY,EAAE,MAAM;I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QACpB,mBAAmB,EAAE,SAAS;QAC9B,SAAS,EAAE,SAAS;QACpB,mBAAmB,EAAE,SAAS;QAC9B,WAAW,EAAE,SAAS;QACtB,OAAO,EAAE,SAAS;QAClB,iBAAiB,EAAE,SAAS;QAC5B,SAAS,EAAE,SAAS;KACrB;IACD,UAAU,EAAE;QACV,YAAY,EAAE,gFAAgF;QAC9F,gBAAgB,EAAE,6DAA6D;QAC/E,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,MAAM;KACpB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,QAAQ;KACjB;IACD,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,MAAM;KACZ;IACD,MAAM,EAAE;QACN,cAAc,EAAE,OAAO;QACvB,gBAAgB,EAAE,OAAO;QACzB,cAAc,EAAE,OAAO;QACvB,gBAAgB,EAAE,4BAA4B;QAC9C,kBAAkB,EAAE,4BAA4B;KACjD;CACO,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * `@ticketlayer/theme`: the token set every Ticketlayer Live harness renders from.
3
+ *
4
+ * `tokens.json` is the source. Everything exported here, the `:root` stylesheet
5
+ * the Elements load, the JSON schema the theme editor and the sales-channel
6
+ * theme API validate against and `TOKENS.md` are generated from it by
7
+ * `scripts/generate.mjs`. There is exactly one place a token's default value is
8
+ * written down, and it is not this file.
9
+ *
10
+ * This package holds no runtime of its own: no DOM, no React, no network. The
11
+ * harness decides how to apply what it reads here. On the web that is
12
+ * `@ticketlayer/live`'s `applyTheme`, which turns a channel theme into the
13
+ * declarations `themeToCssVars` returns and writes them onto `:root`.
14
+ */
15
+ export { TOKEN_NAMES, TOKEN_ALIASES, TOKEN_DEFAULTS, TOKEN_DARK, TOKEN_THEME_KEYS, TOKEN_GROUPS, lightTheme, darkTheme, } from './generated/tokens.js';
16
+ export type { TokenName, TokenAlias, NativeTheme } from './generated/tokens.js';
17
+ /** The custom property a token name is written as: `primary` -> `--tl-primary`. */
18
+ export declare function cssVar(name: string): string;
19
+ /** The default value of a token, or of an alias, by name. */
20
+ export declare function tokenDefault(name: string): string | undefined;
21
+ /** Is this a token name, or an alias of one? */
22
+ export declare function isTokenName(name: string): boolean;
23
+ /**
24
+ * A theme document as `GET /sales/theme` returns it. Every section is loose on
25
+ * purpose: the schema is enforced by the API, and a client that refused an
26
+ * unknown key would break the next time a token was added.
27
+ */
28
+ export interface ThemeDocument {
29
+ colors?: Record<string, unknown>;
30
+ typography?: Record<string, unknown>;
31
+ shape?: Record<string, unknown>;
32
+ brand?: Record<string, unknown>;
33
+ design?: Record<string, unknown> | null;
34
+ }
35
+ /**
36
+ * Turn a channel theme into the custom properties that override the defaults.
37
+ *
38
+ * Only declared tokens are read, and every alias a token answers to is written
39
+ * out beside it, so a host that asks for `--tl-color-primary` or the theme
40
+ * editor's `--tl-base-size` gets the channel's value and not the default.
41
+ * Anything the theme carries that is not a token is ignored: the token set is
42
+ * the contract, and a new one is added in `tokens.json`.
43
+ */
44
+ export declare function themeToCssVars(theme: ThemeDocument | null | undefined): Record<string, string>;
45
+ /** The same declarations as the body of a CSS rule. */
46
+ export declare function themeToCssText(theme: ThemeDocument | null | undefined): string;
47
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAShF,mFAAmF;AACnF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,6DAA6D;AAC7D,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG7D;AAED,gDAAgD;AAChD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACzC;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiB9F;AAED,uDAAuD;AACvD,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAI9E"}
package/dist/index.js ADDED
@@ -0,0 +1,63 @@
1
+ /**
2
+ * `@ticketlayer/theme`: the token set every Ticketlayer Live harness renders from.
3
+ *
4
+ * `tokens.json` is the source. Everything exported here, the `:root` stylesheet
5
+ * the Elements load, the JSON schema the theme editor and the sales-channel
6
+ * theme API validate against and `TOKENS.md` are generated from it by
7
+ * `scripts/generate.mjs`. There is exactly one place a token's default value is
8
+ * written down, and it is not this file.
9
+ *
10
+ * This package holds no runtime of its own: no DOM, no React, no network. The
11
+ * harness decides how to apply what it reads here. On the web that is
12
+ * `@ticketlayer/live`'s `applyTheme`, which turns a channel theme into the
13
+ * declarations `themeToCssVars` returns and writes them onto `:root`.
14
+ */
15
+ export { TOKEN_NAMES, TOKEN_ALIASES, TOKEN_DEFAULTS, TOKEN_DARK, TOKEN_THEME_KEYS, TOKEN_GROUPS, lightTheme, darkTheme, } from './generated/tokens.js';
16
+ import { TOKEN_ALIASES, TOKEN_DEFAULTS, TOKEN_THEME_KEYS, } from './generated/tokens.js';
17
+ /** The custom property a token name is written as: `primary` -> `--tl-primary`. */
18
+ export function cssVar(name) {
19
+ return `--tl-${name}`;
20
+ }
21
+ /** The default value of a token, or of an alias, by name. */
22
+ export function tokenDefault(name) {
23
+ const resolved = TOKEN_ALIASES[name] ?? name;
24
+ return TOKEN_DEFAULTS[resolved];
25
+ }
26
+ /** Is this a token name, or an alias of one? */
27
+ export function isTokenName(name) {
28
+ return name in TOKEN_DEFAULTS || name in TOKEN_ALIASES;
29
+ }
30
+ /**
31
+ * Turn a channel theme into the custom properties that override the defaults.
32
+ *
33
+ * Only declared tokens are read, and every alias a token answers to is written
34
+ * out beside it, so a host that asks for `--tl-color-primary` or the theme
35
+ * editor's `--tl-base-size` gets the channel's value and not the default.
36
+ * Anything the theme carries that is not a token is ignored: the token set is
37
+ * the contract, and a new one is added in `tokens.json`.
38
+ */
39
+ export function themeToCssVars(theme) {
40
+ const vars = {};
41
+ if (!theme)
42
+ return vars;
43
+ for (const [token, themeKey] of Object.entries(TOKEN_THEME_KEYS)) {
44
+ const [section, key] = themeKey.split('.');
45
+ const value = theme[section]?.[key];
46
+ if (value === undefined || value === null || value === '')
47
+ continue;
48
+ vars[cssVar(token)] = String(value);
49
+ }
50
+ for (const [alias, token] of Object.entries(TOKEN_ALIASES)) {
51
+ const value = vars[cssVar(token)];
52
+ if (value !== undefined)
53
+ vars[cssVar(alias)] = value;
54
+ }
55
+ return vars;
56
+ }
57
+ /** The same declarations as the body of a CSS rule. */
58
+ export function themeToCssText(theme) {
59
+ return Object.entries(themeToCssVars(theme))
60
+ .map(([name, value]) => `${name}: ${value};`)
61
+ .join('\n');
62
+ }
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,GAEjB,MAAM,uBAAuB,CAAC;AAE/B,mFAAmF;AACnF,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,OAAO,QAAQ,IAAI,EAAE,CAAC;AACxB,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,QAAQ,GAAI,aAA2C,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IAC5E,OAAO,cAAc,CAAC,QAAqB,CAAC,CAAC;AAC/C,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,IAAI,IAAI,cAAc,IAAI,IAAI,IAAI,aAAa,CAAC;AACzD,CAAC;AAeD;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuC;IACpE,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,KAAK,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACjE,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAI,KAAoE,CAAC,OAAO,CAAC,EAAE,CAAC,GAA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