@alien6-studio/elea-tokens 0.0.0-stage → 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.
Files changed (45) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +272 -2
  3. package/dist/editions.css +1259 -0
  4. package/dist/elea.css +396 -0
  5. package/dist/fonts/ELEASans-Italic-Variable.woff2 +0 -0
  6. package/dist/fonts/ELEASans-Variable.woff2 +0 -0
  7. package/dist/fonts/elea-sans.css +19 -0
  8. package/dist/palette.css +236 -0
  9. package/dist/shadcn.css +22 -0
  10. package/dist/src/brand.d.ts +206 -0
  11. package/dist/src/brand.d.ts.map +1 -0
  12. package/dist/src/brand.js +446 -0
  13. package/dist/src/brand.js.map +1 -0
  14. package/dist/src/color-themes.d.ts +9 -0
  15. package/dist/src/color-themes.d.ts.map +1 -0
  16. package/dist/src/color-themes.js +30 -0
  17. package/dist/src/color-themes.js.map +1 -0
  18. package/dist/src/css.d.ts +58 -0
  19. package/dist/src/css.d.ts.map +1 -0
  20. package/dist/src/css.js +198 -0
  21. package/dist/src/css.js.map +1 -0
  22. package/dist/src/dtcg.d.ts +24 -0
  23. package/dist/src/dtcg.d.ts.map +1 -0
  24. package/dist/src/dtcg.js +56 -0
  25. package/dist/src/dtcg.js.map +1 -0
  26. package/dist/src/index.d.ts +14 -0
  27. package/dist/src/index.d.ts.map +1 -0
  28. package/dist/src/index.js +19 -0
  29. package/dist/src/index.js.map +1 -0
  30. package/dist/src/palette.d.ts +463 -0
  31. package/dist/src/palette.d.ts.map +1 -0
  32. package/dist/src/palette.js +215 -0
  33. package/dist/src/palette.js.map +1 -0
  34. package/dist/src/status.d.ts +26 -0
  35. package/dist/src/status.d.ts.map +1 -0
  36. package/dist/src/status.js +36 -0
  37. package/dist/src/status.js.map +1 -0
  38. package/dist/tailwind.d.ts +6 -0
  39. package/dist/tailwind.js +222 -0
  40. package/dist/theme.css +142 -0
  41. package/dist/tokens/elea.dark.tokens.json +114 -0
  42. package/dist/tokens/elea.tokens.json +190 -0
  43. package/package.json +77 -4
  44. package/tokens/elea.dark.tokens.json +114 -0
  45. package/tokens/elea.tokens.json +190 -0
@@ -0,0 +1,22 @@
1
+ :root, [data-theme], [data-elea-theme], [data-elea-appearance], .elea-precision, .elea-editorial, .elea-obsidian {
2
+ --background: var(--elea-color-surface-default);
3
+ --foreground: var(--elea-color-text-default);
4
+ --card: var(--elea-color-surface-default);
5
+ --card-foreground: var(--elea-color-text-default);
6
+ --popover: var(--elea-color-surface-default);
7
+ --popover-foreground: var(--elea-color-text-default);
8
+ --primary: var(--elea-color-action-primary);
9
+ --primary-foreground: var(--elea-color-action-primary-text);
10
+ --secondary: var(--elea-color-action-secondary);
11
+ --secondary-foreground: var(--elea-color-action-secondary-text);
12
+ --muted: var(--elea-color-surface-muted);
13
+ --muted-foreground: var(--elea-color-text-muted);
14
+ --accent: var(--elea-color-surface-muted);
15
+ --accent-foreground: var(--elea-color-text-default);
16
+ --destructive: var(--elea-color-action-danger, var(--elea-color-danger));
17
+ --destructive-foreground: var(--elea-color-action-danger-text, var(--elea-color-text-inverse));
18
+ --border: var(--elea-color-border-default);
19
+ --input: var(--elea-color-border-strong);
20
+ --ring: var(--elea-color-focus);
21
+ --radius: var(--elea-radius-lg);
22
+ }
@@ -0,0 +1,206 @@
1
+ import { type ColorFamily, type ColorStep, type SurfaceFamily, type ThemeProfileId } from "./palette.js";
2
+ export { brandColorRoles, type BrandColorRole } from "./palette.js";
3
+ export { applyColorTheme, createThemeProfile, matchingColorTheme } from "./color-themes.js";
4
+ declare const RADII: {
5
+ readonly Square: readonly ["0", "0", "0", "0"];
6
+ readonly Soft: readonly ["0.25rem", "0.375rem", "0.5rem", "0.75rem"];
7
+ readonly Round: readonly ["0.5rem", "0.875rem", "1.125rem", "1.5rem"];
8
+ };
9
+ export type Corners = keyof typeof RADII;
10
+ export declare const corners: readonly Corners[];
11
+ export declare const typeFamilies: {
12
+ readonly Sans: "var(--elea-font-family-sans)";
13
+ readonly Serif: "var(--elea-font-family-serif)";
14
+ readonly Mono: "var(--elea-font-family-mono)";
15
+ };
16
+ declare const READING: {
17
+ readonly Compact: {
18
+ readonly size: "1rem";
19
+ readonly leading: "1.45";
20
+ readonly measure: "58ch";
21
+ };
22
+ readonly Balanced: {
23
+ readonly size: "1.125rem";
24
+ readonly leading: "1.625";
25
+ readonly measure: "68ch";
26
+ };
27
+ readonly Airy: {
28
+ readonly size: "1.25rem";
29
+ readonly leading: "1.8";
30
+ readonly measure: "72ch";
31
+ };
32
+ };
33
+ export type Typeface = keyof typeof typeFamilies;
34
+ export type Rhythm = keyof typeof READING;
35
+ export declare const typefaces: readonly Typeface[];
36
+ export declare const rhythms: readonly Rhythm[];
37
+ export type Edition = "Precision" | "Editorial" | "Obsidian";
38
+ export type ControlTreatment = keyof typeof controlStyles;
39
+ export interface PaletteSelection {
40
+ family: ColorFamily;
41
+ step: ColorStep;
42
+ }
43
+ export type RoleAssignment = PaletteSelection | {
44
+ seed: string;
45
+ };
46
+ export interface BrandTheme {
47
+ /** Retains a built-in edition's surfaces and control treatment while customizing its identity. */
48
+ edition?: Edition | undefined;
49
+ /** Control surfaces, elevation, density and tab treatment. Overrides the edition's treatment. */
50
+ controls?: ControlTreatment | undefined;
51
+ /** Six hexadecimal digits prefixed by a hash. */
52
+ seed: string;
53
+ corner: Corners;
54
+ /** Profile-specific shapes apply at the profile's reference corner setting, unless a free radius is supplied. */
55
+ shape?: ThemeProfileId | undefined;
56
+ /** Use uniform Button radii (default), or scale the active profile's action shape for sm, md and lg. */
57
+ buttonRadiusScale?: "uniform" | "profile" | undefined;
58
+ typeface: Typeface;
59
+ rhythm: Rhythm;
60
+ /** The product's own interface font: any CSS font stack, `var(--font-inter), system-ui` included. */
61
+ font?: string | undefined;
62
+ /** A second brand colour, six hexadecimal digits; it drives the secondary ramp. */
63
+ accent?: string | undefined;
64
+ /** Exact reference shades for actions and an optional family for surfaces, text and borders. */
65
+ palette?: {
66
+ primary?: PaletteSelection | undefined;
67
+ secondary?: PaletteSelection | undefined;
68
+ neutral?: SurfaceFamily | undefined;
69
+ tertiary?: RoleAssignment | undefined;
70
+ success?: RoleAssignment | undefined;
71
+ info?: RoleAssignment | undefined;
72
+ warning?: RoleAssignment | undefined;
73
+ danger?: RoleAssignment | undefined;
74
+ } | undefined;
75
+ /** A free corner radius in `rem` or `px` for large surfaces; the other steps follow it and `corner` is ignored. */
76
+ radius?: string | undefined;
77
+ }
78
+ /** Primary and secondary seeds that can be applied to any edition. */
79
+ export declare const brandPalettes: {
80
+ readonly Emerald: {
81
+ readonly seed: "#08745e";
82
+ readonly accent: "#465451";
83
+ };
84
+ readonly Cobalt: {
85
+ readonly seed: "#2945c7";
86
+ readonly accent: "#454a70";
87
+ };
88
+ readonly Copper: {
89
+ readonly seed: "#a15f3e";
90
+ readonly accent: "#495060";
91
+ };
92
+ readonly Plum: {
93
+ readonly seed: "#873b76";
94
+ readonly accent: "#625078";
95
+ };
96
+ readonly Lagoon: {
97
+ readonly seed: "#096a88";
98
+ readonly accent: "#81542f";
99
+ };
100
+ };
101
+ export declare const editions: {
102
+ readonly Precision: {
103
+ readonly seed: "#08745e";
104
+ readonly accent: "#465451";
105
+ readonly edition: "Precision";
106
+ readonly corner: "Soft";
107
+ readonly typeface: "Sans";
108
+ readonly rhythm: "Balanced";
109
+ };
110
+ readonly Editorial: {
111
+ readonly seed: "#2945c7";
112
+ readonly accent: "#454a70";
113
+ readonly edition: "Editorial";
114
+ readonly corner: "Square";
115
+ readonly typeface: "Serif";
116
+ readonly rhythm: "Airy";
117
+ };
118
+ readonly Obsidian: {
119
+ readonly seed: "#a15f3e";
120
+ readonly accent: "#495060";
121
+ readonly edition: "Obsidian";
122
+ readonly corner: "Soft";
123
+ readonly radius: "0.375rem";
124
+ readonly typeface: "Sans";
125
+ readonly rhythm: "Compact";
126
+ };
127
+ };
128
+ declare const controlStyles: {
129
+ readonly raised: {
130
+ readonly _density: "0px";
131
+ readonly "_tabs-presentation": "segmented";
132
+ readonly "_control-fill": "100%";
133
+ readonly "_outline-tint": "15%";
134
+ readonly "_control-edge": "0 1px 2px rgb(0 0 0 / 0.12)";
135
+ readonly "_control-press-shadow": "inset 0 1px 3px rgb(0 0 0 / 0.22)";
136
+ readonly "_field-border-width": "1px";
137
+ readonly "_shadow-ambient": "initial";
138
+ readonly "shadow-sm": "0 1px 2px rgb(0 0 0 / 0.12)";
139
+ readonly "shadow-md": "0 1px 3px rgb(0 0 0 / 0.12), 0 8px 22px -10px rgb(0 0 0 / 0.24)";
140
+ };
141
+ readonly flat: {
142
+ readonly _density: "2px";
143
+ readonly "_tabs-presentation": "underline";
144
+ readonly "_control-fill": "100%";
145
+ readonly "_outline-tint": "0%";
146
+ readonly "_control-edge": "none";
147
+ readonly "_control-press-shadow": "inset 0 -2px rgb(0 0 0 / 0.23)";
148
+ readonly "_field-border-width": "1px 1px 2px";
149
+ readonly "_shadow-ambient": "0 7px 12px -9px rgb(0 0 0 / 0.24)";
150
+ readonly "shadow-sm": "0 1px rgb(0 0 0 / 0.14)";
151
+ readonly "shadow-md": "0 1px 0 1px rgb(0 0 0 / 0.12), var(--elea-_shadow-ambient)";
152
+ };
153
+ readonly inset: {
154
+ readonly _density: "-2px";
155
+ readonly "_tabs-presentation": "rail";
156
+ readonly "_control-fill": "0%";
157
+ readonly "_outline-tint": "100%";
158
+ readonly "_control-edge": "inset 0 1px rgb(255 255 255 / 0.18), inset 0 -1px rgb(0 0 0 / 0.15)";
159
+ readonly "_control-press-shadow": "inset 0 2px 4px rgb(0 0 0 / 0.32)";
160
+ readonly "_field-border-width": "1px";
161
+ readonly "_shadow-ambient": "0 1px 3px rgb(0 0 0 / 0.24), 0 12px 24px -10px rgb(0 0 0 / 0.35)";
162
+ readonly "shadow-sm": "0 1px 2px rgb(0 0 0 / 0.18)";
163
+ readonly "shadow-md": "inset 0 1px rgb(255 255 255 / 0.14), var(--elea-_shadow-ambient)";
164
+ };
165
+ };
166
+ type Swatch = {
167
+ step: ColorStep;
168
+ value: string;
169
+ };
170
+ /** Generate scoped CSS, colour roles and their tone scales. */
171
+ export declare function makeBrandTheme({ edition, controls, seed, corner, shape, buttonRadiusScale, typeface, rhythm, font, accent, palette, radius }: BrandTheme, className?: string): {
172
+ css: string;
173
+ colours: string[];
174
+ palettes: {
175
+ primary: {
176
+ readonly step: ColorStep;
177
+ readonly value: string;
178
+ }[];
179
+ secondary: {
180
+ readonly step: ColorStep;
181
+ readonly value: string;
182
+ }[];
183
+ };
184
+ roles: Partial<Record<"danger" | "info" | "primary" | "secondary" | "success" | "tertiary" | "warning", {
185
+ light: {
186
+ fill: string;
187
+ text: string;
188
+ hover: string;
189
+ pressed: string;
190
+ ink: string;
191
+ container: string;
192
+ onContainer: string;
193
+ };
194
+ dark: {
195
+ fill: string;
196
+ text: string;
197
+ hover: string;
198
+ pressed: string;
199
+ ink: string;
200
+ container: string;
201
+ onContainer: string;
202
+ };
203
+ }>>;
204
+ roleScales: Partial<Record<"danger" | "info" | "primary" | "secondary" | "success" | "tertiary" | "warning", readonly Readonly<Swatch>[]>>;
205
+ };
206
+ //# sourceMappingURL=brand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../src/brand.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0I,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAIjP,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5F,QAAA,MAAM,KAAK;aACT,MAAM,YAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;aAC3B,IAAI,YAAG,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS;aACjD,KAAK,YAAG,QAAQ,E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