@zentrades-ui/tokens 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,4 @@
1
+ import tokens from "../tokens.json";
2
+ import type { Tokens } from "./schema";
3
+
4
+ export const defaultTokens: Tokens = tokens as Tokens;
package/src/index.ts ADDED
@@ -0,0 +1,65 @@
1
+ export type {
2
+ Tokens,
3
+ ColorTokens,
4
+ SpacingTokens,
5
+ BorderTokens,
6
+ ShadowTokens,
7
+ TypographyTokens,
8
+ BreakpointsTokens,
9
+ ThemeTokens,
10
+ TokenScale
11
+ } from "./schema";
12
+ export { defaultTokens } from "./default-tokens";
13
+
14
+ // Token constants for use in vanilla-extract CSS files
15
+ export {
16
+ // Spacing
17
+ SPACING_STEPS,
18
+ SPACING_UNITS,
19
+ SPACING_TOKENS,
20
+ SEMANTIC_SPACING,
21
+ pxToRem,
22
+ // Colors
23
+ COLORS,
24
+ themedColorVars,
25
+ // Typography
26
+ FONT_FAMILIES,
27
+ FONT_WEIGHTS,
28
+ FONT_SIZES,
29
+ LINE_HEIGHTS,
30
+ LETTER_SPACINGS,
31
+ TYPOGRAPHY_STYLES,
32
+ LABEL_FONT_SIZES,
33
+ LABEL_LINE_HEIGHTS,
34
+ // Border
35
+ BORDER_RADIUS,
36
+ BORDER_WIDTH,
37
+ // Shadow
38
+ SHADOW_LAYERS,
39
+ // Breakpoints
40
+ BREAKPOINTS,
41
+ // Z-Index
42
+ Z_INDEX,
43
+ } from "./constants";
44
+
45
+ export type {
46
+ SpacingStep,
47
+ SpacingToken,
48
+ SemanticSpacing,
49
+ ThemedColorName,
50
+ ThemedColorVariant,
51
+ FontFamily,
52
+ FontWeight,
53
+ FontSize,
54
+ LineHeight,
55
+ LetterSpacing,
56
+ BorderRadiusToken,
57
+ BorderWidthToken,
58
+ ShadowLayer,
59
+ Breakpoint,
60
+ HeadingSize,
61
+ TextSize,
62
+ LabelSize,
63
+ ZIndexKey,
64
+ ZIndexValue,
65
+ } from "./constants";
package/src/schema.ts ADDED
@@ -0,0 +1,65 @@
1
+ export type TokenScale<T = string> = Record<string, T>;
2
+
3
+ export type PrimitivePalette = Record<string, TokenScale>;
4
+
5
+ export type ThemedColorVar = {
6
+ light: string;
7
+ dark: string;
8
+ };
9
+
10
+ export type ColorTokens = {
11
+ palette: PrimitivePalette;
12
+ themed: Record<string, ThemedColorVar>;
13
+ };
14
+
15
+ export type SpacingTokens = {
16
+ steps: number[];
17
+ units: Record<string, number>;
18
+ tokens: Record<string, string>;
19
+ semantic: Record<string, string>;
20
+ };
21
+
22
+ export type BorderTokens = {
23
+ radius: TokenScale;
24
+ width: TokenScale;
25
+ };
26
+
27
+ export type ShadowTokens = {
28
+ layers: TokenScale;
29
+ };
30
+
31
+ export type TypographyTokens = {
32
+ fontFamilies: Record<string, string[]>;
33
+ fontWeights: Record<string, number>;
34
+ fontSizes: TokenScale;
35
+ lineHeights: TokenScale;
36
+ letterSpacings: TokenScale;
37
+ labelFontSizes: TokenScale;
38
+ labelLineHeights: TokenScale;
39
+ styles: Record<string, unknown>;
40
+ };
41
+
42
+ export type BreakpointsTokens = Record<string, Record<string, string>>;
43
+
44
+ export type ThemeTokens = {
45
+ modes: {
46
+ light: Record<string, string>;
47
+ dark: Record<string, string>;
48
+ };
49
+ transparent: string;
50
+ };
51
+
52
+ export type Tokens = {
53
+ meta: {
54
+ name: string;
55
+ version: number;
56
+ };
57
+ color: ColorTokens;
58
+ spacing: SpacingTokens;
59
+ border: BorderTokens;
60
+ shadow: ShadowTokens;
61
+ typography: TypographyTokens;
62
+ breakpoints: BreakpointsTokens;
63
+ zIndex: Record<string, number>;
64
+ theme: ThemeTokens;
65
+ };