@terrazzo/token-tools 0.0.6 → 0.0.7

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.
Files changed (76) hide show
  1. package/package.json +2 -2
  2. package/dist/color.d.ts +0 -25
  3. package/dist/color.js +0 -145
  4. package/dist/color.js.map +0 -1
  5. package/dist/css/boolean.d.ts +0 -6
  6. package/dist/css/boolean.js +0 -12
  7. package/dist/css/boolean.js.map +0 -1
  8. package/dist/css/border.d.ts +0 -13
  9. package/dist/css/border.js +0 -30
  10. package/dist/css/border.js.map +0 -1
  11. package/dist/css/color.d.ts +0 -13
  12. package/dist/css/color.js +0 -27
  13. package/dist/css/color.js.map +0 -1
  14. package/dist/css/cubic-bezier.d.ts +0 -8
  15. package/dist/css/cubic-bezier.js +0 -11
  16. package/dist/css/cubic-bezier.js.map +0 -1
  17. package/dist/css/dimension.d.ts +0 -6
  18. package/dist/css/dimension.js +0 -12
  19. package/dist/css/dimension.js.map +0 -1
  20. package/dist/css/duration.d.ts +0 -6
  21. package/dist/css/duration.js +0 -12
  22. package/dist/css/duration.js.map +0 -1
  23. package/dist/css/font-family.d.ts +0 -7
  24. package/dist/css/font-family.js +0 -22
  25. package/dist/css/font-family.js.map +0 -1
  26. package/dist/css/font-weight.d.ts +0 -6
  27. package/dist/css/font-weight.js +0 -9
  28. package/dist/css/font-weight.js.map +0 -1
  29. package/dist/css/gradient.d.ts +0 -9
  30. package/dist/css/gradient.js +0 -24
  31. package/dist/css/gradient.js.map +0 -1
  32. package/dist/css/index.d.ts +0 -31
  33. package/dist/css/index.js +0 -106
  34. package/dist/css/index.js.map +0 -1
  35. package/dist/css/lib.d.ts +0 -24
  36. package/dist/css/lib.js +0 -36
  37. package/dist/css/lib.js.map +0 -1
  38. package/dist/css/link.d.ts +0 -6
  39. package/dist/css/link.js +0 -9
  40. package/dist/css/link.js.map +0 -1
  41. package/dist/css/number.d.ts +0 -6
  42. package/dist/css/number.js +0 -6
  43. package/dist/css/number.js.map +0 -1
  44. package/dist/css/shadow.d.ts +0 -14
  45. package/dist/css/shadow.js +0 -42
  46. package/dist/css/shadow.js.map +0 -1
  47. package/dist/css/string.d.ts +0 -6
  48. package/dist/css/string.js +0 -8
  49. package/dist/css/string.js.map +0 -1
  50. package/dist/css/stroke-style.d.ts +0 -7
  51. package/dist/css/stroke-style.js +0 -9
  52. package/dist/css/stroke-style.js.map +0 -1
  53. package/dist/css/transition.d.ts +0 -14
  54. package/dist/css/transition.js +0 -21
  55. package/dist/css/transition.js.map +0 -1
  56. package/dist/css/typography.d.ts +0 -7
  57. package/dist/css/typography.js +0 -38
  58. package/dist/css/typography.js.map +0 -1
  59. package/dist/id.d.ts +0 -18
  60. package/dist/id.js +0 -44
  61. package/dist/id.js.map +0 -1
  62. package/dist/index.d.ts +0 -5
  63. package/dist/index.js +0 -30
  64. package/dist/index.js.map +0 -1
  65. package/dist/js/index.d.ts +0 -12
  66. package/dist/js/index.js +0 -16
  67. package/dist/js/index.js.map +0 -1
  68. package/dist/string.d.ts +0 -4
  69. package/dist/string.js +0 -26
  70. package/dist/string.js.map +0 -1
  71. package/dist/transform.d.ts +0 -6
  72. package/dist/transform.js +0 -17
  73. package/dist/transform.js.map +0 -1
  74. package/dist/types.d.ts +0 -387
  75. package/dist/types.js +0 -2
  76. package/dist/types.js.map +0 -1
package/dist/types.d.ts DELETED
@@ -1,387 +0,0 @@
1
- import type { ObjectNode } from '@humanwhocodes/momoa';
2
- export interface TokenCore<E extends {} = Record<string, unknown>> {
3
- $description?: string;
4
- $extensions?: E;
5
- }
6
- export type Token = BooleanToken | BorderToken | ColorToken | CubicBezierToken | DimensionToken | DurationToken | FontFamilyToken | FontWeightToken | GradientToken | LinkToken | NumberToken | ShadowToken | StringToken | StringToken | TransitionToken | TypographyToken | StrokeStyleToken;
7
- export type AliasValue = string;
8
- /**
9
- * 8.? Boolean (beta)
10
- */
11
- export interface BooleanToken extends TokenCore {
12
- $type: 'boolean';
13
- $value: BooleanValue | AliasValue;
14
- }
15
- export type BooleanValue = boolean;
16
- /**
17
- * 9.3 Border
18
- */
19
- export interface BorderToken extends TokenCore {
20
- $type: 'border';
21
- $value: BorderValue | AliasValue;
22
- }
23
- export interface BorderValue {
24
- color: ColorValue | AliasValue;
25
- width: DimensionValue | AliasValue;
26
- style: StrokeStyleValue | AliasValue;
27
- }
28
- /**
29
- * 8.1 Color
30
- */
31
- export interface ColorToken extends TokenCore {
32
- $type: 'color';
33
- $value: ColorValue | AliasValue;
34
- }
35
- export type ColorValue = string | {
36
- colorSpace: ColorSpace;
37
- channels: [number, number, number];
38
- alpha?: number;
39
- hex?: string;
40
- };
41
- export interface CubicBezierToken extends TokenCore {
42
- $type: 'cubicBezier';
43
- $value: CubicBezierValue | AliasValue;
44
- }
45
- export type CubicBezierValue = [number, number, number, number];
46
- /**
47
- * 8.2 Dimension
48
- */
49
- export interface DimensionToken extends TokenCore {
50
- $type: 'dimension';
51
- $value: string | AliasValue;
52
- }
53
- export type DimensionValue = `${number}px` | `${number}em` | `${number}rem` | '0';
54
- /**
55
- * 8.5 Duration
56
- */
57
- export interface DurationToken extends TokenCore {
58
- $type: 'duration';
59
- $value: string | AliasValue;
60
- }
61
- export type DurationValue = `${number}ms` | `${number}s`;
62
- /**
63
- * 9.6 Gradient
64
- */
65
- export interface GradientToken extends TokenCore {
66
- $type: 'gradient';
67
- $value: GradientValue | AliasValue;
68
- }
69
- export type GradientValue = GradientStop[];
70
- export interface GradientStop {
71
- color: ColorValue | AliasValue;
72
- position: NumberValue | AliasValue;
73
- }
74
- /**
75
- * 8.3 Font Family
76
- */
77
- export interface FontFamilyToken extends TokenCore {
78
- $type: 'fontFamily';
79
- $value: FontFamilyValue | AliasValue;
80
- }
81
- export type FontFamilyValue = string | string[];
82
- /**
83
- * 8.4 Font Weight
84
- */
85
- export interface FontWeightToken extends TokenCore {
86
- $type: 'fontWeight';
87
- $value: FontWeightValue | AliasValue;
88
- }
89
- export type FontWeightValue = 'thin' | 'hairline' | 'extra-light' | 'ultra-light' | 'light' | 'normal' | 'regular' | 'book' | 'medium' | 'semi-bold' | 'demi-bold' | 'bold' | 'extra-bold' | 'ultra-bold' | 'black' | 'heavy' | 'extra-black' | 'ultra-black' | number;
90
- /**
91
- * 8.? Link (beta)
92
- */
93
- export interface LinkToken extends TokenCore {
94
- $type: 'link';
95
- $value: LinkValue | AliasValue;
96
- }
97
- export type LinkValue = string;
98
- /**
99
- * 8.7 Number
100
- */
101
- export interface NumberToken extends TokenCore {
102
- $type: 'number';
103
- $value: NumberValue | AliasValue;
104
- }
105
- export type NumberValue = number;
106
- /**
107
- * 8.? String (beta)
108
- */
109
- export interface StringToken extends TokenCore {
110
- $type: 'string';
111
- $value: StringValue | AliasValue;
112
- }
113
- export type StringValue = string;
114
- /**
115
- * 9.2 Stroke Style
116
- */
117
- export interface StrokeStyleToken extends TokenCore {
118
- $type: 'strokeStyle';
119
- $value: StrokeStyleValue | AliasValue;
120
- }
121
- export type StrokeStyleValue = 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'outset' | 'inset' | StrokeStyleValueExpanded;
122
- export interface StrokeStyleValueExpanded {
123
- dashArray: DimensionValue[];
124
- lineCap: 'round' | 'butt' | 'square';
125
- }
126
- /**
127
- * 9.5 Shadow
128
- */
129
- export interface ShadowToken extends TokenCore {
130
- $type: 'shadow';
131
- $value: ShadowValue | ShadowValue[] | AliasValue;
132
- }
133
- export interface ShadowValue {
134
- color: ColorValue | AliasValue;
135
- offsetX: DimensionValue | AliasValue;
136
- offsetY: DimensionValue | AliasValue;
137
- blur?: DimensionValue | AliasValue;
138
- spread?: DimensionValue | AliasValue;
139
- }
140
- /**
141
- * 9.4 Transition
142
- */
143
- export interface TransitionToken extends TokenCore {
144
- $type: 'transition';
145
- $value: TransitionValue | AliasValue;
146
- }
147
- export interface TransitionValue {
148
- duration: DurationValue | AliasValue;
149
- delay: DurationValue | AliasValue;
150
- timingFunction: CubicBezierValue | AliasValue;
151
- }
152
- /**
153
- * 9.7 Typography
154
- */
155
- export interface TypographyToken extends TokenCore {
156
- $type: 'typography';
157
- $value: TypographyValue | AliasValue;
158
- }
159
- export interface TypographyValue {
160
- fontFamily?: FontFamilyValue | AliasValue;
161
- fontSize?: DimensionValue | AliasValue;
162
- fontStyle?: string;
163
- fontVariant?: string;
164
- fontVariantAlternatives?: string;
165
- fontVariantCaps?: string;
166
- fontVariantEastAsian?: string;
167
- fontVariantEmoji?: string;
168
- fontVariantLigatures?: string;
169
- fontVariantNumeric?: string;
170
- fontVariantPosition?: string;
171
- fontVariationSettings?: string;
172
- fontWeight?: FontWeightValue | AliasValue;
173
- letterSpacing?: DimensionValue | AliasValue;
174
- lineHeight?: DimensionValue | NumberValue | AliasValue;
175
- textDecoration?: string;
176
- textTransform?: string;
177
- [key: string]: unknown;
178
- }
179
- export interface GroupCore {
180
- $description?: string;
181
- $type?: Token['$type'];
182
- $extensions?: Record<string, unknown>;
183
- }
184
- export type Group = GroupCore & {
185
- [key: string]: GroupOrToken;
186
- };
187
- export type GroupOrToken = Group | Token;
188
- export interface TokenNormalizedCore {
189
- $description?: string;
190
- $extensions?: Record<string, unknown>;
191
- id: string;
192
- source: {
193
- loc?: string;
194
- node: ObjectNode;
195
- };
196
- group: {
197
- $description?: string;
198
- $extensions?: Record<string, unknown>;
199
- id: string;
200
- /** IDs of all tokens contained in this group */
201
- tokens: string[];
202
- };
203
- }
204
- export type TokenNormalized = BooleanTokenNormalized | BorderTokenNormalized | ColorTokenNormalized | CubicBezierTokenNormalized | DimensionTokenNormalized | DurationTokenNormalized | FontFamilyTokenNormalized | FontWeightTokenNormalized | GradientTokenNormalized | LinkTokenNormalized | NumberTokenNormalized | ShadowTokenNormalized | StringTokenNormalized | StrokeStyleTokenNormalized | TransitionTokenNormalized | TypographyTokenNormalized;
205
- export interface BooleanTokenNormalized extends TokenNormalizedCore {
206
- $type: 'boolean';
207
- $value: BooleanValue;
208
- aliasOf?: string;
209
- partialAliasOf?: never;
210
- mode: Record<string, BooleanTokenNormalized | undefined>;
211
- originalValue: BooleanToken;
212
- }
213
- export interface BorderTokenNormalized extends TokenNormalizedCore {
214
- $type: 'border';
215
- $value: BorderValueNormalized;
216
- aliasOf?: string;
217
- partialAliasOf?: Partial<Record<keyof BorderValueNormalized, string>>;
218
- mode: Record<string, BorderTokenNormalized | undefined>;
219
- originalValue: BorderToken;
220
- }
221
- export interface BorderValueNormalized {
222
- color: ColorValueNormalized;
223
- width: DimensionValue;
224
- style: StrokeStyleValueExpanded;
225
- }
226
- export interface ColorTokenNormalized extends TokenNormalizedCore {
227
- $type: 'color';
228
- $value: ColorValueNormalized;
229
- aliasOf?: string;
230
- partialAliasOf?: never;
231
- mode: Record<string, ColorTokenNormalized | undefined>;
232
- originalValue: ColorToken;
233
- }
234
- export interface ColorValueNormalized {
235
- /** Colorspace (default: `srgb`) @see https://www.w3.org/TR/css-color-4/#predefined */
236
- colorSpace: ColorSpace;
237
- /** Color channels. Will be normalized to 1 unless the colorspace prevents it (e.g. XYZ, LAB) */
238
- channels: [number, number, number];
239
- /** Alpha channel, normalized from 0 – 1 */
240
- alpha: number;
241
- /** Hex fallback (for sRGB) */
242
- hex?: string;
243
- }
244
- export type ColorSpace = 'a98' | 'display-p3' | 'hsb' | 'hsl' | 'hsv' | 'hwb' | 'lab' | 'lch' | 'oklab' | 'oklch' | 'prophoto-rgb' | 'rec2020' | 'srgb-linear' | 'srgb' | 'xyz-d50' | 'xyz-d65';
245
- export interface CubicBezierTokenNormalized extends TokenNormalizedCore {
246
- $type: 'cubicBezier';
247
- $value: CubicBezierValue;
248
- aliasOf?: string;
249
- partialAliasOf?: [string | undefined, string | undefined, string | undefined, string | undefined];
250
- mode: Record<string, CubicBezierTokenNormalized | undefined>;
251
- originalValue: CubicBezierToken;
252
- }
253
- export interface DimensionTokenNormalized extends TokenNormalizedCore {
254
- $type: 'dimension';
255
- $value: DimensionValue;
256
- aliasOf?: string;
257
- partialAliasOf?: never;
258
- mode: Record<string, DimensionTokenNormalized | undefined>;
259
- originalValue: DimensionToken;
260
- }
261
- export interface DurationTokenNormalized extends TokenNormalizedCore {
262
- $type: 'duration';
263
- $value: DurationValue;
264
- aliasOf?: string;
265
- partialAliasOf?: never;
266
- mode: Record<string, DurationTokenNormalized | undefined>;
267
- originalValue: DurationToken;
268
- }
269
- export interface FontFamilyTokenNormalized extends TokenNormalizedCore {
270
- $type: 'fontFamily';
271
- $value: FontFamilyValueNormalized;
272
- aliasOf?: string;
273
- partialAliasOf?: never;
274
- mode: Record<string, FontFamilyTokenNormalized | undefined>;
275
- originalValue: FontFamilyToken;
276
- }
277
- export type FontFamilyValueNormalized = string[];
278
- export interface FontWeightTokenNormalized extends TokenNormalizedCore {
279
- $type: 'fontWeight';
280
- $value: FontWeightValueNormalized;
281
- aliasOf?: string;
282
- partialAliasOf?: never;
283
- mode: Record<string, FontWeightTokenNormalized | undefined>;
284
- originalValue: FontWeightToken;
285
- }
286
- export type FontWeightValueNormalized = number;
287
- export interface GradientTokenNormalized extends TokenNormalizedCore {
288
- $type: 'gradient';
289
- $value: GradientValueNormalized;
290
- aliasOf?: string;
291
- partialAliasOf?: Partial<Record<keyof GradientStopNormalized, string>>[];
292
- mode: Record<string, GradientTokenNormalized | undefined>;
293
- originalValue: GradientTokenNormalized;
294
- }
295
- export type GradientValueNormalized = GradientStopNormalized[];
296
- export interface GradientStopNormalized {
297
- color: ColorValueNormalized;
298
- position: number;
299
- }
300
- export interface LinkTokenNormalized extends TokenNormalizedCore {
301
- $type: 'link';
302
- $value: LinkValue;
303
- aliasOf?: string;
304
- partialAliasOf?: never;
305
- mode: Record<string, LinkTokenNormalized | undefined>;
306
- originalValue: LinkToken;
307
- }
308
- export interface NumberTokenNormalized extends TokenNormalizedCore {
309
- $type: 'number';
310
- $value: NumberValue;
311
- aliasOf?: string;
312
- partialAliasOf?: never;
313
- mode: Record<string, NumberTokenNormalized | undefined>;
314
- originalValue: NumberToken;
315
- }
316
- export interface ShadowTokenNormalized extends TokenNormalizedCore {
317
- $type: 'shadow';
318
- $value: ShadowValueNormalized[];
319
- aliasOf?: string;
320
- partialAliasOf?: Partial<Record<keyof ShadowValueNormalized, string>>[];
321
- mode: Record<string, ShadowTokenNormalized | undefined>;
322
- originalValue: ShadowToken;
323
- }
324
- export interface ShadowValueNormalized {
325
- color: ColorValueNormalized;
326
- offsetX: DimensionValue;
327
- offsetY: DimensionValue;
328
- blur: DimensionValue;
329
- spread: DimensionValue;
330
- }
331
- export interface StringTokenNormalized extends TokenNormalizedCore {
332
- $type: 'string';
333
- $value: StringValue;
334
- aliasOf?: string;
335
- partialAliasOf?: never;
336
- mode: Record<string, StringTokenNormalized | undefined>;
337
- originalValue: StringTokenNormalized;
338
- }
339
- export interface StrokeStyleTokenNormalized extends TokenNormalizedCore {
340
- $type: 'strokeStyle';
341
- $value: StrokeStyleValueExpanded;
342
- aliasOf?: string;
343
- partialAliasOf?: never;
344
- mode: Record<string, StrokeStyleTokenNormalized | undefined>;
345
- originalValue: StrokeStyleToken;
346
- }
347
- export interface TransitionTokenNormalized extends TokenNormalizedCore {
348
- $type: 'transition';
349
- $value: TransitionValueNormalized;
350
- aliasOf?: string;
351
- partialAliasOf?: Partial<Record<keyof TransitionValueNormalized, string>>;
352
- mode: Record<string, TransitionTokenNormalized | undefined>;
353
- originalValue: TransitionToken;
354
- }
355
- export interface TransitionValueNormalized {
356
- duration: DurationValue;
357
- delay: DurationValue;
358
- timingFunction: CubicBezierValue;
359
- }
360
- export interface TypographyTokenNormalized extends TokenNormalizedCore {
361
- $type: 'typography';
362
- $value: TypographyValueNormalized;
363
- aliasOf?: string;
364
- partialAliasOf?: Record<string, string>;
365
- mode: Record<string, TypographyTokenNormalized | undefined>;
366
- originalValue: TypographyToken;
367
- }
368
- export interface TypographyValueNormalized {
369
- fontFamily?: FontFamilyValue;
370
- fontSize?: DimensionValue;
371
- fontStyle?: string;
372
- fontVariant?: string;
373
- fontVariantAlternatives?: string;
374
- fontVariantCaps?: string;
375
- fontVariantEastAsian?: string;
376
- fontVariantEmoji?: string;
377
- fontVariantLigatures?: string;
378
- fontVariantNumeric?: string;
379
- fontVariantPosition?: string;
380
- fontVariationSettings?: string;
381
- fontWeight?: FontWeightValue;
382
- letterSpacing?: DimensionValue;
383
- lineHeight?: DimensionValue | NumberValue;
384
- textDecoration?: string;
385
- textTransform?: string;
386
- [key: string]: unknown;
387
- }
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}