@elmethis/core 0.23.0 → 0.24.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/dist/a2ui/v0_9/notion_block_catalog.json +1 -1
- package/dist/design/dark/DESIGN.md +124 -0
- package/dist/design/light/DESIGN.md +124 -0
- package/dist/index.cjs +43 -11
- package/dist/index.d.cts +685 -2349
- package/dist/index.d.mts +685 -2349
- package/dist/index.mjs +48 -15
- package/dist/stylelint.cjs +32 -0
- package/dist/stylelint.d.cts +38 -0
- package/dist/stylelint.d.mts +39 -0
- package/dist/stylelint.mjs +32 -0
- package/dist/tokens.cjs +201 -0
- package/dist/tokens.css +48 -0
- package/dist/tokens.d.cts +140 -0
- package/dist/tokens.d.mts +140 -0
- package/dist/tokens.mjs +199 -0
- package/package.json +50 -23
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
//#region src/style/color-scale.d.ts
|
|
2
|
+
type ColorStep = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/style/token.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Design tokens for `@elmethis/core` — the single source of truth that the
|
|
7
|
+
* vanilla-extract build (`scripts/build-tokens.ts`) emits to `dist/tokens.css`
|
|
8
|
+
* as `--elmethis-*` custom properties: a primitive layer of concrete values
|
|
9
|
+
* and a semantic layer that references it, themed natively via `light-dark()`.
|
|
10
|
+
*/
|
|
11
|
+
/** A primitive token knows the custom property that defines it. */
|
|
12
|
+
export interface PrimitiveToken {
|
|
13
|
+
/** e.g. `--elmethis-primitive-color-blue-500` */
|
|
14
|
+
readonly property: string;
|
|
15
|
+
/** the literal value, e.g. `#68779f` */
|
|
16
|
+
readonly value: string;
|
|
17
|
+
/** a `var(--…)` reference for the semantic layer to consume */
|
|
18
|
+
readonly ref: string;
|
|
19
|
+
}
|
|
20
|
+
/** A semantic token is either theme-independent or a `light-dark()` pair. */
|
|
21
|
+
export type SemanticValue = {
|
|
22
|
+
readonly common: string;
|
|
23
|
+
} | {
|
|
24
|
+
readonly light: string;
|
|
25
|
+
readonly dark: string;
|
|
26
|
+
};
|
|
27
|
+
declare const PRIMITIVE_VALUES: {
|
|
28
|
+
readonly color: {
|
|
29
|
+
readonly red: Readonly<Record<ColorStep, string>>;
|
|
30
|
+
readonly orange: Readonly<Record<ColorStep, string>>;
|
|
31
|
+
readonly yellow: Readonly<Record<ColorStep, string>>;
|
|
32
|
+
readonly green: Readonly<Record<ColorStep, string>>;
|
|
33
|
+
readonly cyan: Readonly<Record<ColorStep, string>>;
|
|
34
|
+
readonly blue: Readonly<Record<ColorStep, string>>;
|
|
35
|
+
readonly purple: Readonly<Record<ColorStep, string>>;
|
|
36
|
+
readonly magenta: Readonly<Record<ColorStep, string>>;
|
|
37
|
+
readonly slate: {
|
|
38
|
+
readonly 100: "#d7d9e1";
|
|
39
|
+
readonly 200: "#b0b5be";
|
|
40
|
+
readonly 300: "#949ba7";
|
|
41
|
+
readonly 400: "#6c7483";
|
|
42
|
+
readonly 500: "#555b67";
|
|
43
|
+
readonly 600: "#40444c";
|
|
44
|
+
readonly 700: "#393e46";
|
|
45
|
+
readonly 800: "#31353a";
|
|
46
|
+
readonly 900: "#242629";
|
|
47
|
+
};
|
|
48
|
+
readonly gold: {
|
|
49
|
+
readonly 100: "#f7f5f4";
|
|
50
|
+
readonly 200: "#efecea";
|
|
51
|
+
readonly 300: "#d9d3cc";
|
|
52
|
+
readonly 400: "#cabfb2";
|
|
53
|
+
readonly 500: "#c6b5a2";
|
|
54
|
+
readonly 600: "#bda68b";
|
|
55
|
+
readonly 700: "#a68c70";
|
|
56
|
+
readonly 800: "#8e7356";
|
|
57
|
+
readonly 900: "#6e583f";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
readonly font: {
|
|
61
|
+
readonly family: {
|
|
62
|
+
readonly sans: "\"DM Sans\", \"Zen Kaku Gothic New\", -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic ProN\", Meiryo, sans-serif";
|
|
63
|
+
readonly monospace: "\"DM Mono\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", \"Zen Kaku Gothic New\", monospace";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
type PrimitiveTree<T> = { readonly [K in keyof T]: T[K] extends string ? PrimitiveToken : PrimitiveTree<T[K]>; };
|
|
68
|
+
/** Primitive tokens, addressable as `primitive.color.blue[500]`. */
|
|
69
|
+
export declare const primitive: PrimitiveTree<typeof PRIMITIVE_VALUES>;
|
|
70
|
+
/**
|
|
71
|
+
* Semantic tokens, keyed by the full kebab suffix that follows `--elmethis-`
|
|
72
|
+
* (so `"color-accent-info-surface"` emits `--elmethis-color-accent-info-surface`).
|
|
73
|
+
*
|
|
74
|
+
* Flat keys keep a 1:1 mapping to the emitted CSS and sidestep the
|
|
75
|
+
* leaf-vs-group ambiguity a nested tree creates for base/variant pairs — e.g.
|
|
76
|
+
* `color-neutral` coexisting with `color-neutral-weak`. References to the
|
|
77
|
+
* primitive layer are symbolic (`PrimitiveToken.ref`), never resolved values.
|
|
78
|
+
*/
|
|
79
|
+
export declare const semanticTokens: {
|
|
80
|
+
/**
|
|
81
|
+
* Vertical rhythm between stacked blocks. Applied as `gap` on an explicit
|
|
82
|
+
* flex-column "stack" container (e.g. each framework's `ElmA2ui` surface,
|
|
83
|
+
* `ElmMarkdown`, and container child slots like Callout/BlockQuote/Toggle/
|
|
84
|
+
* TabPanel) — never as a leading margin on individual leaf components.
|
|
85
|
+
* `gap` only ever applies between items, so there's no first-child case to
|
|
86
|
+
* special-case and no risk of a standalone/nested component floating an
|
|
87
|
+
* unexplained gap above it.
|
|
88
|
+
*/
|
|
89
|
+
"stack-gap": SemanticValue;
|
|
90
|
+
"box-shadow-small": SemanticValue;
|
|
91
|
+
"box-shadow-medium": SemanticValue;
|
|
92
|
+
"box-shadow-large": SemanticValue;
|
|
93
|
+
"font-family-sans": SemanticValue;
|
|
94
|
+
"font-family-monospace": SemanticValue;
|
|
95
|
+
"color-box-shadow": SemanticValue;
|
|
96
|
+
"color-accent-link-surface": SemanticValue;
|
|
97
|
+
"color-accent-link": SemanticValue;
|
|
98
|
+
"color-accent-link-visited": SemanticValue;
|
|
99
|
+
"color-accent-link-surface-visited": SemanticValue;
|
|
100
|
+
"color-accent-info": SemanticValue;
|
|
101
|
+
"color-accent-info-surface": SemanticValue;
|
|
102
|
+
"color-accent-success": SemanticValue;
|
|
103
|
+
"color-accent-success-surface": SemanticValue;
|
|
104
|
+
"color-accent-important": SemanticValue;
|
|
105
|
+
"color-accent-important-surface": SemanticValue;
|
|
106
|
+
"color-accent-warning": SemanticValue;
|
|
107
|
+
"color-accent-warning-surface": SemanticValue;
|
|
108
|
+
"color-accent-error": SemanticValue;
|
|
109
|
+
"color-accent-error-surface": SemanticValue;
|
|
110
|
+
"color-divider": SemanticValue;
|
|
111
|
+
"color-modal-backdrop": SemanticValue;
|
|
112
|
+
"color-surface-sunken": SemanticValue;
|
|
113
|
+
"color-surface-base": SemanticValue;
|
|
114
|
+
"color-surface-raised": SemanticValue;
|
|
115
|
+
"color-neutral": SemanticValue;
|
|
116
|
+
"color-neutral-weak": SemanticValue;
|
|
117
|
+
"color-neutral-strong": SemanticValue;
|
|
118
|
+
"color-primary": SemanticValue;
|
|
119
|
+
"color-primary-weak": SemanticValue;
|
|
120
|
+
"color-primary-strong": SemanticValue;
|
|
121
|
+
"color-primary-hover": SemanticValue;
|
|
122
|
+
"color-selection": SemanticValue;
|
|
123
|
+
"color-display-red": SemanticValue;
|
|
124
|
+
"color-display-red-surface": SemanticValue;
|
|
125
|
+
"color-display-orange": SemanticValue;
|
|
126
|
+
"color-display-orange-surface": SemanticValue;
|
|
127
|
+
"color-display-yellow": SemanticValue;
|
|
128
|
+
"color-display-yellow-surface": SemanticValue;
|
|
129
|
+
"color-display-green": SemanticValue;
|
|
130
|
+
"color-display-green-surface": SemanticValue;
|
|
131
|
+
"color-display-cyan": SemanticValue;
|
|
132
|
+
"color-display-cyan-surface": SemanticValue;
|
|
133
|
+
"color-display-blue": SemanticValue;
|
|
134
|
+
"color-display-blue-surface": SemanticValue;
|
|
135
|
+
"color-display-purple": SemanticValue;
|
|
136
|
+
"color-display-purple-surface": SemanticValue;
|
|
137
|
+
"color-display-magenta": SemanticValue;
|
|
138
|
+
"color-display-magenta-surface": SemanticValue;
|
|
139
|
+
};
|
|
140
|
+
//#endregion
|
package/dist/tokens.mjs
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
//#region src/style/color-scale.ts
|
|
2
|
+
const parseHex = (hex) => {
|
|
3
|
+
if (!/^#[\da-f]{6}$/i.test(hex)) throw new Error(`Expected a six-digit hex color, received ${hex}`);
|
|
4
|
+
return [
|
|
5
|
+
Number.parseInt(hex.slice(1, 3), 16) / 255,
|
|
6
|
+
Number.parseInt(hex.slice(3, 5), 16) / 255,
|
|
7
|
+
Number.parseInt(hex.slice(5, 7), 16) / 255
|
|
8
|
+
];
|
|
9
|
+
};
|
|
10
|
+
const srgbToLinear = (channel) => channel <= .04045 ? channel / 12.92 : ((channel + .055) / 1.055) ** 2.4;
|
|
11
|
+
const linearToSrgb = (channel) => channel <= .0031308 ? channel * 12.92 : 1.055 * channel ** (1 / 2.4) - .055;
|
|
12
|
+
const hexToOklab = (hex) => {
|
|
13
|
+
const [encodedRed, encodedGreen, encodedBlue] = parseHex(hex);
|
|
14
|
+
const red = srgbToLinear(encodedRed);
|
|
15
|
+
const green = srgbToLinear(encodedGreen);
|
|
16
|
+
const blue = srgbToLinear(encodedBlue);
|
|
17
|
+
const lightness = Math.cbrt(.4122214708 * red + .5363325363 * green + .0514459929 * blue);
|
|
18
|
+
const medium = Math.cbrt(.2119034982 * red + .6806995451 * green + .1073969566 * blue);
|
|
19
|
+
const short = Math.cbrt(.0883024619 * red + .2817188376 * green + .6299787005 * blue);
|
|
20
|
+
return [
|
|
21
|
+
.2104542553 * lightness + .793617785 * medium - .0040720468 * short,
|
|
22
|
+
1.9779984951 * lightness - 2.428592205 * medium + .4505937099 * short,
|
|
23
|
+
.0259040371 * lightness + .7827717662 * medium - .808675766 * short
|
|
24
|
+
];
|
|
25
|
+
};
|
|
26
|
+
const oklabToHex = ([lightness, a, b]) => {
|
|
27
|
+
const light = (lightness + .3963377774 * a + .2158037573 * b) ** 3;
|
|
28
|
+
const medium = (lightness - .1055613458 * a - .0638541728 * b) ** 3;
|
|
29
|
+
const short = (lightness - .0894841775 * a - 1.291485548 * b) ** 3;
|
|
30
|
+
return `#${[
|
|
31
|
+
4.0767416621 * light - 3.3077115913 * medium + .2309699292 * short,
|
|
32
|
+
-1.2684380046 * light + 2.6097574011 * medium - .3413193965 * short,
|
|
33
|
+
-.0041960863 * light - .7034186147 * medium + 1.707614701 * short
|
|
34
|
+
].map(linearToSrgb).map((channel) => Math.min(1, Math.max(0, channel))).map((channel) => Math.round(channel * 255).toString(16).padStart(2, "0")).join("")}`;
|
|
35
|
+
};
|
|
36
|
+
const interpolateOklab = (start, end, amount) => oklabToHex([
|
|
37
|
+
start[0] + (end[0] - start[0]) * amount,
|
|
38
|
+
start[1] + (end[1] - start[1]) * amount,
|
|
39
|
+
start[2] + (end[2] - start[2]) * amount
|
|
40
|
+
]);
|
|
41
|
+
/**
|
|
42
|
+
* Expands the authored 100/500/900 anchors into a perceptually even ramp.
|
|
43
|
+
* OKLab avoids the muddy midpoints produced by interpolating encoded sRGB.
|
|
44
|
+
*/
|
|
45
|
+
const createColorScale = (light, middle, dark) => {
|
|
46
|
+
const lightOklab = hexToOklab(light);
|
|
47
|
+
const middleOklab = hexToOklab(middle);
|
|
48
|
+
const darkOklab = hexToOklab(dark);
|
|
49
|
+
return {
|
|
50
|
+
100: light.toLowerCase(),
|
|
51
|
+
200: interpolateOklab(lightOklab, middleOklab, .25),
|
|
52
|
+
300: interpolateOklab(lightOklab, middleOklab, .5),
|
|
53
|
+
400: interpolateOklab(lightOklab, middleOklab, .75),
|
|
54
|
+
500: middle.toLowerCase(),
|
|
55
|
+
600: interpolateOklab(middleOklab, darkOklab, .25),
|
|
56
|
+
700: interpolateOklab(middleOklab, darkOklab, .5),
|
|
57
|
+
800: interpolateOklab(middleOklab, darkOklab, .75),
|
|
58
|
+
900: dark.toLowerCase()
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/style/token.ts
|
|
63
|
+
const PRIMITIVE_VALUES = {
|
|
64
|
+
color: {
|
|
65
|
+
red: createColorScale("#e9dddd", "#ae6e6e", "#291313"),
|
|
66
|
+
orange: createColorScale("#ebdfdb", "#b8816e", "#3f251c"),
|
|
67
|
+
yellow: createColorScale("#ebe6db", "#b09a66", "#332b19"),
|
|
68
|
+
green: createColorScale("#dde9e2", "#659878", "#15281d"),
|
|
69
|
+
cyan: createColorScale("#dde9e7", "#6091a0", "#203b37"),
|
|
70
|
+
blue: createColorScale("#dde2e9", "#68779f", "#242d3e"),
|
|
71
|
+
purple: createColorScale("#e3dde9", "#8d799f", "#271836"),
|
|
72
|
+
magenta: createColorScale("#eadce4", "#b17396", "#3c1f2f"),
|
|
73
|
+
slate: {
|
|
74
|
+
100: "#d7d9e1",
|
|
75
|
+
200: "#b0b5be",
|
|
76
|
+
300: "#949ba7",
|
|
77
|
+
400: "#6c7483",
|
|
78
|
+
500: "#555b67",
|
|
79
|
+
600: "#40444c",
|
|
80
|
+
700: "#393e46",
|
|
81
|
+
800: "#31353a",
|
|
82
|
+
900: "#242629"
|
|
83
|
+
},
|
|
84
|
+
gold: {
|
|
85
|
+
100: "#f7f5f4",
|
|
86
|
+
200: "#efecea",
|
|
87
|
+
300: "#d9d3cc",
|
|
88
|
+
400: "#cabfb2",
|
|
89
|
+
500: "#c6b5a2",
|
|
90
|
+
600: "#bda68b",
|
|
91
|
+
700: "#a68c70",
|
|
92
|
+
800: "#8e7356",
|
|
93
|
+
900: "#6e583f"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
font: { family: {
|
|
97
|
+
sans: "\"DM Sans\", \"Zen Kaku Gothic New\", -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic ProN\", Meiryo, sans-serif",
|
|
98
|
+
monospace: "\"DM Mono\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", \"Zen Kaku Gothic New\", monospace"
|
|
99
|
+
} }
|
|
100
|
+
};
|
|
101
|
+
const makePrimitive = (path, value) => {
|
|
102
|
+
const property = `--elmethis-primitive-${path.join("-")}`;
|
|
103
|
+
return {
|
|
104
|
+
property,
|
|
105
|
+
value,
|
|
106
|
+
ref: `var(${property})`
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const buildPrimitives = (values, path) => {
|
|
110
|
+
const out = {};
|
|
111
|
+
for (const [key, value] of Object.entries(values)) {
|
|
112
|
+
const next = [...path, key];
|
|
113
|
+
out[key] = typeof value === "string" ? makePrimitive(next, value) : buildPrimitives(value, next);
|
|
114
|
+
}
|
|
115
|
+
return out;
|
|
116
|
+
};
|
|
117
|
+
/** Primitive tokens, addressable as `primitive.color.blue[500]`. */
|
|
118
|
+
const primitive = buildPrimitives(PRIMITIVE_VALUES, []);
|
|
119
|
+
const resolve = (ref) => typeof ref === "string" ? ref : ref.ref;
|
|
120
|
+
/** A theme-independent semantic value. */
|
|
121
|
+
const common = (ref) => ({ common: resolve(ref) });
|
|
122
|
+
/** A native `light-dark()` semantic value. */
|
|
123
|
+
const theme = (light, dark) => ({
|
|
124
|
+
light: resolve(light),
|
|
125
|
+
dark: resolve(dark)
|
|
126
|
+
});
|
|
127
|
+
const { color, font } = primitive;
|
|
128
|
+
/**
|
|
129
|
+
* Semantic tokens, keyed by the full kebab suffix that follows `--elmethis-`
|
|
130
|
+
* (so `"color-accent-info-surface"` emits `--elmethis-color-accent-info-surface`).
|
|
131
|
+
*
|
|
132
|
+
* Flat keys keep a 1:1 mapping to the emitted CSS and sidestep the
|
|
133
|
+
* leaf-vs-group ambiguity a nested tree creates for base/variant pairs — e.g.
|
|
134
|
+
* `color-neutral` coexisting with `color-neutral-weak`. References to the
|
|
135
|
+
* primitive layer are symbolic (`PrimitiveToken.ref`), never resolved values.
|
|
136
|
+
*/
|
|
137
|
+
const semanticTokens = {
|
|
138
|
+
/**
|
|
139
|
+
* Vertical rhythm between stacked blocks. Applied as `gap` on an explicit
|
|
140
|
+
* flex-column "stack" container (e.g. each framework's `ElmA2ui` surface,
|
|
141
|
+
* `ElmMarkdown`, and container child slots like Callout/BlockQuote/Toggle/
|
|
142
|
+
* TabPanel) — never as a leading margin on individual leaf components.
|
|
143
|
+
* `gap` only ever applies between items, so there's no first-child case to
|
|
144
|
+
* special-case and no risk of a standalone/nested component floating an
|
|
145
|
+
* unexplained gap above it.
|
|
146
|
+
*/
|
|
147
|
+
"stack-gap": common("2rem"),
|
|
148
|
+
"box-shadow-small": common("0 0 1px var(--elmethis-color-box-shadow)"),
|
|
149
|
+
"box-shadow-medium": common("0 0 2px var(--elmethis-color-box-shadow)"),
|
|
150
|
+
"box-shadow-large": common("0 0 4px var(--elmethis-color-box-shadow)"),
|
|
151
|
+
"font-family-sans": common(font.family.sans),
|
|
152
|
+
"font-family-monospace": common(font.family.monospace),
|
|
153
|
+
"color-box-shadow": theme("oklch(from #3e434b l c h / 0.25)", color.slate[900]),
|
|
154
|
+
"color-accent-link-surface": theme(color.blue[100], color.blue[900]),
|
|
155
|
+
"color-accent-link": common(color.blue[500]),
|
|
156
|
+
"color-accent-link-visited": common(color.purple[500]),
|
|
157
|
+
"color-accent-link-surface-visited": theme(color.purple[100], color.purple[900]),
|
|
158
|
+
"color-accent-info": common(color.blue[500]),
|
|
159
|
+
"color-accent-info-surface": theme(color.blue[100], color.blue[900]),
|
|
160
|
+
"color-accent-success": common(color.green[500]),
|
|
161
|
+
"color-accent-success-surface": theme(color.green[100], color.green[900]),
|
|
162
|
+
"color-accent-important": common(color.purple[500]),
|
|
163
|
+
"color-accent-important-surface": theme(color.purple[100], color.purple[900]),
|
|
164
|
+
"color-accent-warning": common(color.yellow[500]),
|
|
165
|
+
"color-accent-warning-surface": theme(color.yellow[100], color.yellow[900]),
|
|
166
|
+
"color-accent-error": common(color.red[500]),
|
|
167
|
+
"color-accent-error-surface": theme(color.red[100], color.red[900]),
|
|
168
|
+
"color-divider": theme(color.gold[300], color.slate[800]),
|
|
169
|
+
"color-modal-backdrop": common("oklch(from black l c h / 50%)"),
|
|
170
|
+
"color-surface-sunken": theme(color.gold[300], color.slate[800]),
|
|
171
|
+
"color-surface-base": theme(color.gold[200], color.slate[700]),
|
|
172
|
+
"color-surface-raised": theme(color.gold[100], color.slate[600]),
|
|
173
|
+
"color-neutral": theme(color.slate[400], color.slate[200]),
|
|
174
|
+
"color-neutral-weak": common(color.slate[300]),
|
|
175
|
+
"color-neutral-strong": theme(color.slate[500], color.slate[100]),
|
|
176
|
+
"color-primary": theme(color.gold[700], color.gold[500]),
|
|
177
|
+
"color-primary-weak": common(color.gold[600]),
|
|
178
|
+
"color-primary-strong": theme(color.gold[800], color.gold[400]),
|
|
179
|
+
"color-primary-hover": common("oklch(from var(--elmethis-color-primary) l c h / 15%)"),
|
|
180
|
+
"color-selection": common("oklch(from var(--elmethis-color-primary) l c h / 25%)"),
|
|
181
|
+
"color-display-red": common(color.red[500]),
|
|
182
|
+
"color-display-red-surface": theme(color.red[100], color.red[900]),
|
|
183
|
+
"color-display-orange": common(color.orange[500]),
|
|
184
|
+
"color-display-orange-surface": theme(color.orange[100], color.orange[900]),
|
|
185
|
+
"color-display-yellow": common(color.yellow[500]),
|
|
186
|
+
"color-display-yellow-surface": theme(color.yellow[100], color.yellow[900]),
|
|
187
|
+
"color-display-green": common(color.green[500]),
|
|
188
|
+
"color-display-green-surface": theme(color.green[100], color.green[900]),
|
|
189
|
+
"color-display-cyan": common(color.cyan[500]),
|
|
190
|
+
"color-display-cyan-surface": theme(color.cyan[100], color.cyan[900]),
|
|
191
|
+
"color-display-blue": common(color.blue[500]),
|
|
192
|
+
"color-display-blue-surface": theme(color.blue[100], color.blue[900]),
|
|
193
|
+
"color-display-purple": common(color.purple[500]),
|
|
194
|
+
"color-display-purple-surface": theme(color.purple[100], color.purple[900]),
|
|
195
|
+
"color-display-magenta": common(color.magenta[500]),
|
|
196
|
+
"color-display-magenta-surface": theme(color.magenta[100], color.magenta[900])
|
|
197
|
+
};
|
|
198
|
+
//#endregion
|
|
199
|
+
export { primitive, semanticTokens };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elmethis/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Ikuma Yamashita",
|
|
6
6
|
"url": "https://www.ikuma.cloud/"
|
|
@@ -24,7 +24,29 @@
|
|
|
24
24
|
"default": "./dist/index.cjs"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
-
"./tokens
|
|
27
|
+
"./tokens": {
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/tokens.d.mts",
|
|
30
|
+
"default": "./dist/tokens.mjs"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./dist/tokens.d.cts",
|
|
34
|
+
"default": "./dist/tokens.cjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"./stylelint": {
|
|
38
|
+
"import": {
|
|
39
|
+
"types": "./dist/stylelint.d.mts",
|
|
40
|
+
"default": "./dist/stylelint.mjs"
|
|
41
|
+
},
|
|
42
|
+
"require": {
|
|
43
|
+
"types": "./dist/stylelint.d.cts",
|
|
44
|
+
"default": "./dist/stylelint.cjs"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"./tokens.css": "./dist/tokens.css",
|
|
48
|
+
"./design/light/DESIGN.md": "./dist/design/light/DESIGN.md",
|
|
49
|
+
"./design/dark/DESIGN.md": "./dist/design/dark/DESIGN.md"
|
|
28
50
|
},
|
|
29
51
|
"files": [
|
|
30
52
|
"dist"
|
|
@@ -37,42 +59,47 @@
|
|
|
37
59
|
],
|
|
38
60
|
"peerDependencies": {
|
|
39
61
|
"@a2ui/web_core": ">=0.10.0",
|
|
40
|
-
"zod": "^3"
|
|
62
|
+
"zod": "^3.25.76"
|
|
41
63
|
},
|
|
42
64
|
"dependencies": {
|
|
65
|
+
"stylelint-config-css-modules": "^4.6.0",
|
|
66
|
+
"stylelint-config-standard": "^40.0.0",
|
|
67
|
+
"stylelint-value-no-unknown-custom-properties": "^6.1.1",
|
|
43
68
|
"zod-to-json-schema": "^3.25.2"
|
|
44
69
|
},
|
|
45
70
|
"devDependencies": {
|
|
46
|
-
"@a2ui/web_core": "^0.
|
|
47
|
-
"@
|
|
48
|
-
"@types/node": "26.
|
|
49
|
-
"@vanilla-extract/css": "^1.21.
|
|
71
|
+
"@a2ui/web_core": "^0.13.0",
|
|
72
|
+
"@google/design.md": "0.4.0",
|
|
73
|
+
"@types/node": "26.6.4",
|
|
74
|
+
"@vanilla-extract/css": "^1.21.3",
|
|
50
75
|
"@vanilla-extract/esbuild-plugin": "^2.3.22",
|
|
51
|
-
"@vitest/coverage-v8": "^
|
|
76
|
+
"@vitest/coverage-v8": "^5.0.4",
|
|
52
77
|
"ajv": "^8.17.1",
|
|
53
78
|
"ajv-formats": "^3.0.1",
|
|
54
|
-
"concurrently": "^10.0.
|
|
55
|
-
"esbuild": "^0.28.
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"tsdown": "^0.
|
|
60
|
-
"tsx": "^4.23.
|
|
79
|
+
"concurrently": "^10.0.5",
|
|
80
|
+
"esbuild": "^0.28.2",
|
|
81
|
+
"oxfmt": "0.73.0",
|
|
82
|
+
"oxlint": "1.88.0",
|
|
83
|
+
"oxlint-tsgolint": "7.0.2004",
|
|
84
|
+
"tsdown": "^0.23.0",
|
|
85
|
+
"tsx": "^4.23.15",
|
|
61
86
|
"typescript": "5.9.3",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"zod": "^3"
|
|
87
|
+
"vitest": "^5.0.4",
|
|
88
|
+
"yaml": "2.9.1",
|
|
89
|
+
"zod": "^3.25.76"
|
|
65
90
|
},
|
|
66
91
|
"scripts": {
|
|
67
|
-
"build": "tsdown && tsx scripts/emit-catalog.ts && tsx scripts/build-tokens.ts",
|
|
92
|
+
"build": "tsdown && tsx scripts/emit-catalog.ts && tsx scripts/build-tokens.ts && tsx scripts/build-design-md.ts",
|
|
93
|
+
"build.design": "tsx scripts/build-design-md.ts",
|
|
68
94
|
"build.types": "exit 0",
|
|
69
95
|
"dev": "tsdown --watch",
|
|
70
|
-
"fmt": "
|
|
71
|
-
"fmt.check": "
|
|
72
|
-
"lint": "
|
|
96
|
+
"fmt": "oxfmt --write ./src",
|
|
97
|
+
"fmt.check": "oxfmt --check ./src",
|
|
98
|
+
"lint": "oxlint --type-aware --report-unused-disable-directives-severity=error --deny-warnings src",
|
|
73
99
|
"test.unit": "vitest --run",
|
|
100
|
+
"test.package": "node --test scripts/test-package.mjs",
|
|
74
101
|
"test.coverage": "vitest --run --coverage",
|
|
75
102
|
"check": "concurrently -g \"pnpm:fmt.check\" \"pnpm:lint\" \"pnpm:build.types\"",
|
|
76
|
-
"check.ci": "pnpm run check && pnpm run build && pnpm run test.coverage"
|
|
103
|
+
"check.ci": "pnpm run check && pnpm run build && pnpm run test.package && pnpm run test.coverage"
|
|
77
104
|
}
|
|
78
105
|
}
|