@almadar/ui 6.28.0 → 6.30.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.
- package/dist/{EntityBindingContext-C6FgxdfG.d.cts → EntityBindingContext-ChCONv2W.d.cts} +3 -39
- package/dist/{EntityBindingContext-C6FgxdfG.d.ts → EntityBindingContext-ChCONv2W.d.ts} +3 -39
- package/dist/avl/index.cjs +74 -48
- package/dist/avl/index.js +74 -48
- package/dist/components/index.cjs +54 -45
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +54 -45
- package/dist/context/index.cjs +135 -105
- package/dist/context/index.d.cts +2 -60
- package/dist/context/index.d.ts +2 -60
- package/dist/context/index.js +135 -105
- package/dist/lib/index.cjs +455 -0
- package/dist/lib/index.d.cts +42 -1
- package/dist/lib/index.d.ts +42 -1
- package/dist/lib/index.js +438 -1
- package/dist/marketing/index.cjs +4 -5
- package/dist/marketing/index.js +4 -5
- package/dist/providers/index.cjs +194 -156
- package/dist/providers/index.d.cts +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +194 -156
- package/dist/runtime/index.cjs +74 -48
- package/dist/runtime/index.d.cts +16 -2
- package/dist/runtime/index.d.ts +16 -2
- package/dist/runtime/index.js +74 -48
- package/dist/themeTokens-DVRwufw8.d.cts +112 -0
- package/dist/themeTokens-DVRwufw8.d.ts +112 -0
- package/package.json +7 -6
- package/scripts/audit-tailwind-safelist.ts +4 -0
- package/tailwind-preset.cjs +155 -28
- package/themes/almadar-website.css +37 -107
- package/themes/almadar.css +37 -108
- package/themes/atelier.css +145 -240
- package/themes/bloomberg-dense.css +145 -252
- package/themes/clay.css +39 -137
- package/themes/comic.css +39 -145
- package/themes/corporate.css +39 -131
- package/themes/game-adventure.css +22 -87
- package/themes/game-rpg.css +22 -84
- package/themes/game-sci-fi.css +22 -88
- package/themes/game-ui-pack.css +22 -85
- package/themes/gazette.css +43 -135
- package/themes/glass.css +39 -148
- package/themes/kiosk.css +51 -146
- package/themes/linear-clean.css +145 -215
- package/themes/minimalist.css +39 -125
- package/themes/neon.css +39 -132
- package/themes/notion-editorial.css +145 -215
- package/themes/prism.css +37 -100
- package/themes/retro.css +39 -130
- package/themes/terminal.css +61 -152
- package/themes/trait-wars.css +121 -285
- package/themes/wireframe.css +41 -128
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ThemeRef, ThemeDefinition, ThemeTokens, ThemeVariant, DensityTokens, ElevationTokens, GeometryTokens, IconographyTokens, MotionDurationKey, MotionEasingKey, MotionIntentMap, TypeScaleTokens, TypeIntentMap, TypeSizeKey } from '@almadar/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* themeTokens — runtime mirror of the orbital compiler's theme codegen.
|
|
5
|
+
*
|
|
6
|
+
* The compile path (orbital-rust/crates/orbital-shell-typescript/src/codegen/theme.rs)
|
|
7
|
+
* reads `OrbitalDefinition.theme.tokens` and emits CSS custom-property
|
|
8
|
+
* declarations into a `[data-theme="<name>-<mode>"]` block. The runtime
|
|
9
|
+
* does not parse compiled CSS — it reads the same `tokens` object directly
|
|
10
|
+
* and produces the same `{ '--color-primary': '…', '--radius-md': '…' }` map
|
|
11
|
+
* that the compiler emits.
|
|
12
|
+
*
|
|
13
|
+
* Keeping the two paths byte-identical at the variable level is the contract:
|
|
14
|
+
* editing tokens via the Studio Design System tab must produce the exact
|
|
15
|
+
* same rendered result as editing them in source and running `orbital
|
|
16
|
+
* compile`. The mapping rules here mirror `generate_tokens_css` /
|
|
17
|
+
* `generate_tokens_css_dark` (theme.rs:122–351).
|
|
18
|
+
*
|
|
19
|
+
* Compile vs runtime difference (intentional):
|
|
20
|
+
* - Compile emits the FULL set: schema overrides on top of defaults. This is
|
|
21
|
+
* needed because the compiled CSS replaces the theme entirely.
|
|
22
|
+
* - Runtime emits ONLY the keys present in `tokens` (and `variants.dark`).
|
|
23
|
+
* Missing keys cascade from the parent `[data-theme]` rule on the document
|
|
24
|
+
* element. The provider scopes overrides to an orbital subtree without
|
|
25
|
+
* shadowing inherited defaults.
|
|
26
|
+
*
|
|
27
|
+
* The per-axis var tables below (`DENSITY_SPACING_VARS`, `TYPE_INTENT_VARS`, …)
|
|
28
|
+
* are the ONE mapping between a typed-axis field and its CSS variable name.
|
|
29
|
+
* `themeTokensToCssVars` reads them forward (token → CSS); `almadar-core`'s
|
|
30
|
+
* one-time `scripts/migrate-css-themes.ts` reads them in reverse (CSS →
|
|
31
|
+
* token) to build `packages/almadar-core/themes/*.json` from the checked-in
|
|
32
|
+
* preset CSS — see that script for the inverse direction.
|
|
33
|
+
*
|
|
34
|
+
* @packageDocumentation
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/** Resolved color mode. Mirrors `ThemeContext.resolvedMode`. */
|
|
38
|
+
type ThemeMode = 'light' | 'dark';
|
|
39
|
+
/** The keys of `T` whose value is a plain (optional) string — excludes
|
|
40
|
+
* nested-object fields like `DensityTokens['spacing']` or
|
|
41
|
+
* `TypeScaleTokens['scale']`, which are never single CSS values. */
|
|
42
|
+
type StringValueKey<T> = {
|
|
43
|
+
[K in keyof T]-?: T[K] extends string | undefined ? K : never;
|
|
44
|
+
}[keyof T] & string;
|
|
45
|
+
/** One flat scalar field on an axis object and the CSS var name it maps to. */
|
|
46
|
+
interface FlatVarEntry<T> {
|
|
47
|
+
readonly cssVar: string;
|
|
48
|
+
readonly key: StringValueKey<T>;
|
|
49
|
+
}
|
|
50
|
+
/** Density axis — spacing scale steps (`density.spacing.space<N>` → `--space-<N>`). */
|
|
51
|
+
declare const DENSITY_SPACING_VARS: ReadonlyArray<FlatVarEntry<NonNullable<DensityTokens['spacing']>>>;
|
|
52
|
+
/** Density axis — per-element heights + paddings. */
|
|
53
|
+
declare const DENSITY_ELEMENT_VARS: ReadonlyArray<FlatVarEntry<DensityTokens>>;
|
|
54
|
+
/** Type axis — family triplet. */
|
|
55
|
+
declare const TYPE_FAMILY_VARS: ReadonlyArray<FlatVarEntry<TypeScaleTokens>>;
|
|
56
|
+
/** Type axis — size scale keys, ordered exactly as emitted. Each pairs `--text-<k>` / `--leading-<k>`. */
|
|
57
|
+
declare const TYPE_SIZE_KEYS: ReadonlyArray<TypeSizeKey>;
|
|
58
|
+
/** Type axis — intent names, ordered exactly as emitted. Each is 3 vars: `-size` / `-weight` / `-leading`. */
|
|
59
|
+
declare const TYPE_INTENT_VARS: ReadonlyArray<{
|
|
60
|
+
key: keyof TypeIntentMap & string;
|
|
61
|
+
cssName: string;
|
|
62
|
+
}>;
|
|
63
|
+
/** Motion axis — duration palette keys, ordered exactly as emitted. */
|
|
64
|
+
declare const MOTION_DURATION_KEYS: ReadonlyArray<MotionDurationKey>;
|
|
65
|
+
/** Motion axis — easing palette keys, ordered exactly as emitted. */
|
|
66
|
+
declare const MOTION_EASING_KEYS: ReadonlyArray<MotionEasingKey>;
|
|
67
|
+
/** Motion axis — intent names, ordered exactly as emitted. Each is 2 vars: `-duration` / `-easing`. */
|
|
68
|
+
declare const MOTION_INTENT_VARS: ReadonlyArray<{
|
|
69
|
+
key: keyof MotionIntentMap & string;
|
|
70
|
+
cssName: string;
|
|
71
|
+
}>;
|
|
72
|
+
/** Iconography axis — flat fields. */
|
|
73
|
+
declare const ICONOGRAPHY_VARS: ReadonlyArray<FlatVarEntry<IconographyTokens>>;
|
|
74
|
+
/** Elevation axis — flat fields. */
|
|
75
|
+
declare const ELEVATION_VARS: ReadonlyArray<FlatVarEntry<ElevationTokens>>;
|
|
76
|
+
/** Geometry axis — flat fields. */
|
|
77
|
+
declare const GEOMETRY_VARS: ReadonlyArray<FlatVarEntry<GeometryTokens>>;
|
|
78
|
+
/** Legacy free-form map prefixes (`ThemeTokens.colors`/`radii`/`spacing`/`shadows`). `typography` has no prefix — see below. */
|
|
79
|
+
declare const LEGACY_PREFIXES: {
|
|
80
|
+
readonly colors: "--color-";
|
|
81
|
+
readonly radii: "--radius-";
|
|
82
|
+
readonly spacing: "--space-";
|
|
83
|
+
readonly shadows: "--shadow-";
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Convert `ThemeTokens` (+ optional dark variant) into a CSS custom-property
|
|
87
|
+
* map keyed by variable name (e.g. `--color-primary`).
|
|
88
|
+
*
|
|
89
|
+
* Mapping rules (mirror theme.rs):
|
|
90
|
+
* - `tokens.colors.<k>` → `--color-<k>`
|
|
91
|
+
* - `tokens.radii.<k>` → `--radius-<k>`
|
|
92
|
+
* - `tokens.spacing.<k>` → `--space-<k>`
|
|
93
|
+
* - `tokens.typography.<k>` → `--<k>` (keys already include their `font-`/
|
|
94
|
+
* `letter-`/`line-` prefix)
|
|
95
|
+
* - `tokens.shadows.<k>` → `--shadow-<k>` (schema key has no prefix)
|
|
96
|
+
*
|
|
97
|
+
* In `'dark'` mode, the `darkVariant` overrides are merged on top of the
|
|
98
|
+
* base tokens per category — same precedence the Rust compiler uses
|
|
99
|
+
* (`generate_tokens_css_dark`). Categories not present in `darkVariant` fall
|
|
100
|
+
* back to the base tokens.
|
|
101
|
+
*/
|
|
102
|
+
declare function themeTokensToCssVars(tokens: ThemeTokens, mode?: ThemeMode, darkVariant?: ThemeVariant): Record<string, string>;
|
|
103
|
+
/**
|
|
104
|
+
* `ThemeRef` is `ThemeDefinition | string`. When it's a string, it's an
|
|
105
|
+
* unresolved import reference (e.g. `"Ocean.theme"`) that should have been
|
|
106
|
+
* inlined by the compiler's import phase before runtime. If we still see a
|
|
107
|
+
* string here, the upstream resolution path didn't run — return `undefined`
|
|
108
|
+
* rather than guess. `OrbitalThemeProvider` falls through to passthrough.
|
|
109
|
+
*/
|
|
110
|
+
declare function resolveThemeForRuntime(theme: ThemeRef | undefined): ThemeDefinition | undefined;
|
|
111
|
+
|
|
112
|
+
export { DENSITY_ELEMENT_VARS as D, ELEVATION_VARS as E, type FlatVarEntry as F, GEOMETRY_VARS as G, ICONOGRAPHY_VARS as I, LEGACY_PREFIXES as L, MOTION_DURATION_KEYS as M, type StringValueKey as S, type ThemeMode as T, DENSITY_SPACING_VARS as a, MOTION_EASING_KEYS as b, MOTION_INTENT_VARS as c, TYPE_FAMILY_VARS as d, TYPE_INTENT_VARS as e, TYPE_SIZE_KEYS as f, resolveThemeForRuntime as r, themeTokensToCssVars as t };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ThemeRef, ThemeDefinition, ThemeTokens, ThemeVariant, DensityTokens, ElevationTokens, GeometryTokens, IconographyTokens, MotionDurationKey, MotionEasingKey, MotionIntentMap, TypeScaleTokens, TypeIntentMap, TypeSizeKey } from '@almadar/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* themeTokens — runtime mirror of the orbital compiler's theme codegen.
|
|
5
|
+
*
|
|
6
|
+
* The compile path (orbital-rust/crates/orbital-shell-typescript/src/codegen/theme.rs)
|
|
7
|
+
* reads `OrbitalDefinition.theme.tokens` and emits CSS custom-property
|
|
8
|
+
* declarations into a `[data-theme="<name>-<mode>"]` block. The runtime
|
|
9
|
+
* does not parse compiled CSS — it reads the same `tokens` object directly
|
|
10
|
+
* and produces the same `{ '--color-primary': '…', '--radius-md': '…' }` map
|
|
11
|
+
* that the compiler emits.
|
|
12
|
+
*
|
|
13
|
+
* Keeping the two paths byte-identical at the variable level is the contract:
|
|
14
|
+
* editing tokens via the Studio Design System tab must produce the exact
|
|
15
|
+
* same rendered result as editing them in source and running `orbital
|
|
16
|
+
* compile`. The mapping rules here mirror `generate_tokens_css` /
|
|
17
|
+
* `generate_tokens_css_dark` (theme.rs:122–351).
|
|
18
|
+
*
|
|
19
|
+
* Compile vs runtime difference (intentional):
|
|
20
|
+
* - Compile emits the FULL set: schema overrides on top of defaults. This is
|
|
21
|
+
* needed because the compiled CSS replaces the theme entirely.
|
|
22
|
+
* - Runtime emits ONLY the keys present in `tokens` (and `variants.dark`).
|
|
23
|
+
* Missing keys cascade from the parent `[data-theme]` rule on the document
|
|
24
|
+
* element. The provider scopes overrides to an orbital subtree without
|
|
25
|
+
* shadowing inherited defaults.
|
|
26
|
+
*
|
|
27
|
+
* The per-axis var tables below (`DENSITY_SPACING_VARS`, `TYPE_INTENT_VARS`, …)
|
|
28
|
+
* are the ONE mapping between a typed-axis field and its CSS variable name.
|
|
29
|
+
* `themeTokensToCssVars` reads them forward (token → CSS); `almadar-core`'s
|
|
30
|
+
* one-time `scripts/migrate-css-themes.ts` reads them in reverse (CSS →
|
|
31
|
+
* token) to build `packages/almadar-core/themes/*.json` from the checked-in
|
|
32
|
+
* preset CSS — see that script for the inverse direction.
|
|
33
|
+
*
|
|
34
|
+
* @packageDocumentation
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/** Resolved color mode. Mirrors `ThemeContext.resolvedMode`. */
|
|
38
|
+
type ThemeMode = 'light' | 'dark';
|
|
39
|
+
/** The keys of `T` whose value is a plain (optional) string — excludes
|
|
40
|
+
* nested-object fields like `DensityTokens['spacing']` or
|
|
41
|
+
* `TypeScaleTokens['scale']`, which are never single CSS values. */
|
|
42
|
+
type StringValueKey<T> = {
|
|
43
|
+
[K in keyof T]-?: T[K] extends string | undefined ? K : never;
|
|
44
|
+
}[keyof T] & string;
|
|
45
|
+
/** One flat scalar field on an axis object and the CSS var name it maps to. */
|
|
46
|
+
interface FlatVarEntry<T> {
|
|
47
|
+
readonly cssVar: string;
|
|
48
|
+
readonly key: StringValueKey<T>;
|
|
49
|
+
}
|
|
50
|
+
/** Density axis — spacing scale steps (`density.spacing.space<N>` → `--space-<N>`). */
|
|
51
|
+
declare const DENSITY_SPACING_VARS: ReadonlyArray<FlatVarEntry<NonNullable<DensityTokens['spacing']>>>;
|
|
52
|
+
/** Density axis — per-element heights + paddings. */
|
|
53
|
+
declare const DENSITY_ELEMENT_VARS: ReadonlyArray<FlatVarEntry<DensityTokens>>;
|
|
54
|
+
/** Type axis — family triplet. */
|
|
55
|
+
declare const TYPE_FAMILY_VARS: ReadonlyArray<FlatVarEntry<TypeScaleTokens>>;
|
|
56
|
+
/** Type axis — size scale keys, ordered exactly as emitted. Each pairs `--text-<k>` / `--leading-<k>`. */
|
|
57
|
+
declare const TYPE_SIZE_KEYS: ReadonlyArray<TypeSizeKey>;
|
|
58
|
+
/** Type axis — intent names, ordered exactly as emitted. Each is 3 vars: `-size` / `-weight` / `-leading`. */
|
|
59
|
+
declare const TYPE_INTENT_VARS: ReadonlyArray<{
|
|
60
|
+
key: keyof TypeIntentMap & string;
|
|
61
|
+
cssName: string;
|
|
62
|
+
}>;
|
|
63
|
+
/** Motion axis — duration palette keys, ordered exactly as emitted. */
|
|
64
|
+
declare const MOTION_DURATION_KEYS: ReadonlyArray<MotionDurationKey>;
|
|
65
|
+
/** Motion axis — easing palette keys, ordered exactly as emitted. */
|
|
66
|
+
declare const MOTION_EASING_KEYS: ReadonlyArray<MotionEasingKey>;
|
|
67
|
+
/** Motion axis — intent names, ordered exactly as emitted. Each is 2 vars: `-duration` / `-easing`. */
|
|
68
|
+
declare const MOTION_INTENT_VARS: ReadonlyArray<{
|
|
69
|
+
key: keyof MotionIntentMap & string;
|
|
70
|
+
cssName: string;
|
|
71
|
+
}>;
|
|
72
|
+
/** Iconography axis — flat fields. */
|
|
73
|
+
declare const ICONOGRAPHY_VARS: ReadonlyArray<FlatVarEntry<IconographyTokens>>;
|
|
74
|
+
/** Elevation axis — flat fields. */
|
|
75
|
+
declare const ELEVATION_VARS: ReadonlyArray<FlatVarEntry<ElevationTokens>>;
|
|
76
|
+
/** Geometry axis — flat fields. */
|
|
77
|
+
declare const GEOMETRY_VARS: ReadonlyArray<FlatVarEntry<GeometryTokens>>;
|
|
78
|
+
/** Legacy free-form map prefixes (`ThemeTokens.colors`/`radii`/`spacing`/`shadows`). `typography` has no prefix — see below. */
|
|
79
|
+
declare const LEGACY_PREFIXES: {
|
|
80
|
+
readonly colors: "--color-";
|
|
81
|
+
readonly radii: "--radius-";
|
|
82
|
+
readonly spacing: "--space-";
|
|
83
|
+
readonly shadows: "--shadow-";
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Convert `ThemeTokens` (+ optional dark variant) into a CSS custom-property
|
|
87
|
+
* map keyed by variable name (e.g. `--color-primary`).
|
|
88
|
+
*
|
|
89
|
+
* Mapping rules (mirror theme.rs):
|
|
90
|
+
* - `tokens.colors.<k>` → `--color-<k>`
|
|
91
|
+
* - `tokens.radii.<k>` → `--radius-<k>`
|
|
92
|
+
* - `tokens.spacing.<k>` → `--space-<k>`
|
|
93
|
+
* - `tokens.typography.<k>` → `--<k>` (keys already include their `font-`/
|
|
94
|
+
* `letter-`/`line-` prefix)
|
|
95
|
+
* - `tokens.shadows.<k>` → `--shadow-<k>` (schema key has no prefix)
|
|
96
|
+
*
|
|
97
|
+
* In `'dark'` mode, the `darkVariant` overrides are merged on top of the
|
|
98
|
+
* base tokens per category — same precedence the Rust compiler uses
|
|
99
|
+
* (`generate_tokens_css_dark`). Categories not present in `darkVariant` fall
|
|
100
|
+
* back to the base tokens.
|
|
101
|
+
*/
|
|
102
|
+
declare function themeTokensToCssVars(tokens: ThemeTokens, mode?: ThemeMode, darkVariant?: ThemeVariant): Record<string, string>;
|
|
103
|
+
/**
|
|
104
|
+
* `ThemeRef` is `ThemeDefinition | string`. When it's a string, it's an
|
|
105
|
+
* unresolved import reference (e.g. `"Ocean.theme"`) that should have been
|
|
106
|
+
* inlined by the compiler's import phase before runtime. If we still see a
|
|
107
|
+
* string here, the upstream resolution path didn't run — return `undefined`
|
|
108
|
+
* rather than guess. `OrbitalThemeProvider` falls through to passthrough.
|
|
109
|
+
*/
|
|
110
|
+
declare function resolveThemeForRuntime(theme: ThemeRef | undefined): ThemeDefinition | undefined;
|
|
111
|
+
|
|
112
|
+
export { DENSITY_ELEMENT_VARS as D, ELEVATION_VARS as E, type FlatVarEntry as F, GEOMETRY_VARS as G, ICONOGRAPHY_VARS as I, LEGACY_PREFIXES as L, MOTION_DURATION_KEYS as M, type StringValueKey as S, type ThemeMode as T, DENSITY_SPACING_VARS as a, MOTION_EASING_KEYS as b, MOTION_INTENT_VARS as c, TYPE_FAMILY_VARS as d, TYPE_INTENT_VARS as e, TYPE_SIZE_KEYS as f, resolveThemeForRuntime as r, themeTokensToCssVars as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.30.0",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -118,11 +118,11 @@
|
|
|
118
118
|
"access": "public"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@almadar/core": "^10.
|
|
122
|
-
"@almadar/evaluator": "^2.
|
|
121
|
+
"@almadar/core": "^10.99.0",
|
|
122
|
+
"@almadar/evaluator": "^2.47.0",
|
|
123
123
|
"@almadar/logger": "^1.12.0",
|
|
124
|
-
"@almadar/runtime": "^6.
|
|
125
|
-
"@almadar/std": "^16.
|
|
124
|
+
"@almadar/runtime": "^6.84.0",
|
|
125
|
+
"@almadar/std": "^16.223.0",
|
|
126
126
|
"@almadar/syntax": "^1.17.0",
|
|
127
127
|
"@dnd-kit/core": "^6.3.1",
|
|
128
128
|
"@dnd-kit/sortable": "^10.0.0",
|
|
@@ -239,6 +239,7 @@
|
|
|
239
239
|
"build:watch": "tsup --watch",
|
|
240
240
|
"typecheck": "tsc --noEmit",
|
|
241
241
|
"lint": "eslint --no-warn-ignored --max-warnings 0 .",
|
|
242
|
-
"verify:themes": "node scripts/theme-contrast-audit.mjs"
|
|
242
|
+
"verify:themes": "node scripts/theme-contrast-audit.mjs",
|
|
243
|
+
"verify:safelist": "tsx scripts/audit-tailwind-safelist.ts"
|
|
243
244
|
}
|
|
244
245
|
}
|
|
@@ -234,4 +234,8 @@ if (fix) {
|
|
|
234
234
|
} else {
|
|
235
235
|
console.log();
|
|
236
236
|
console.log('Run with --fix to add missing classes to the preset.');
|
|
237
|
+
// A missing entry here means a component ships a class Tailwind will silently
|
|
238
|
+
// drop CSS for (the Gantt bar defect: axis rendered, bars were invisible on
|
|
239
|
+
// every reload) — CI must fail so it is caught at merge, not in production.
|
|
240
|
+
process.exit(1);
|
|
237
241
|
}
|
package/tailwind-preset.cjs
CHANGED
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
* presets: [require('@almadar/ui/tailwind-preset')]
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
// Tailwind can only apply an opacity modifier (`bg-primary/50`) to a color it
|
|
17
|
+
// can compute alpha for itself — a bare `var(--color-x)` string is opaque to
|
|
18
|
+
// it, so every semantic token below must resolve through this function or its
|
|
19
|
+
// `/NN` utilities silently generate no CSS rule at all (not even with the
|
|
20
|
+
// class safelisted — confirmed via a standalone `tailwindcss` CLI build).
|
|
21
|
+
function withOpacity(varName) {
|
|
22
|
+
return ({ opacityValue }) =>
|
|
23
|
+
opacityValue === undefined
|
|
24
|
+
? `var(${varName})`
|
|
25
|
+
: `color-mix(in srgb, var(${varName}) calc(${opacityValue} * 100%), transparent)`;
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
/** @type {import('tailwindcss').Config} */
|
|
17
29
|
module.exports = {
|
|
18
30
|
darkMode: 'class',
|
|
@@ -111,8 +123,7 @@ module.exports = {
|
|
|
111
123
|
'animate-[shake_0.3s_ease-in-out]',
|
|
112
124
|
'aspect-[3/4]',
|
|
113
125
|
'bg-[radial-gradient(circle_at_center,rgba(34,197,94,0.2),transparent_70%)]',
|
|
114
|
-
'bg-[radial-gradient(ellipse_at_top,var(--color-primary)/0.08,transparent_60%),',
|
|
115
|
-
'radial-gradient(ellipse_at_bottom_right,var(--color-accent)/0.06,transparent_50%)]',
|
|
126
|
+
'bg-[radial-gradient(ellipse_at_top,var(--color-primary)/0.08,transparent_60%),radial-gradient(ellipse_at_bottom_right,var(--color-accent)/0.06,transparent_50%)]',
|
|
116
127
|
'bg-[var(--color-background)]',
|
|
117
128
|
'bg-[var(--color-card)]',
|
|
118
129
|
'bg-[var(--color-table-header)]',
|
|
@@ -264,6 +275,122 @@ module.exports = {
|
|
|
264
275
|
'z-[1000]',
|
|
265
276
|
'z-[1001]',
|
|
266
277
|
'z-[60]',
|
|
278
|
+
|
|
279
|
+
// Auto-added by audit-tailwind-safelist.ts (2026-09-19)
|
|
280
|
+
'bg-[var(--color-border)]',
|
|
281
|
+
'bg-[var(--color-muted)]',
|
|
282
|
+
'bg-[var(--color-primary)]',
|
|
283
|
+
'bg-[var(--color-surface-subtle)]',
|
|
284
|
+
'bg-[var(--color-surface)]',
|
|
285
|
+
'bg-[var(--color-warning)]',
|
|
286
|
+
'bg-accent/15',
|
|
287
|
+
'bg-background/60',
|
|
288
|
+
'bg-background/95',
|
|
289
|
+
'bg-card/40',
|
|
290
|
+
'bg-card/50',
|
|
291
|
+
'bg-card/90',
|
|
292
|
+
'bg-card/95',
|
|
293
|
+
'bg-error/15',
|
|
294
|
+
'bg-error/70',
|
|
295
|
+
'bg-error/80',
|
|
296
|
+
'bg-foreground/40',
|
|
297
|
+
'bg-muted-foreground/50',
|
|
298
|
+
'bg-muted/10',
|
|
299
|
+
'bg-muted/40',
|
|
300
|
+
'bg-primary/15',
|
|
301
|
+
'bg-primary/80',
|
|
302
|
+
'bg-secondary/10',
|
|
303
|
+
'bg-success/15',
|
|
304
|
+
'bg-success/80',
|
|
305
|
+
'bg-warning/15',
|
|
306
|
+
'bg-warning/80',
|
|
307
|
+
'border-[length:var(--border-width-thick)]',
|
|
308
|
+
'border-[var(--color-primary)]',
|
|
309
|
+
'border-[var(--color-warning)]',
|
|
310
|
+
'border-border/10',
|
|
311
|
+
'border-border/20',
|
|
312
|
+
'border-border/50',
|
|
313
|
+
'border-error/40',
|
|
314
|
+
'border-error/70',
|
|
315
|
+
'border-info/70',
|
|
316
|
+
'border-l-[length:var(--border-width-thin)]',
|
|
317
|
+
'border-primary/20',
|
|
318
|
+
'border-primary/40',
|
|
319
|
+
'border-success/40',
|
|
320
|
+
'border-success/50',
|
|
321
|
+
'border-success/70',
|
|
322
|
+
'border-warning/40',
|
|
323
|
+
'border-warning/60',
|
|
324
|
+
'border-y-[length:var(--border-width)]',
|
|
325
|
+
'bottom-[15%]',
|
|
326
|
+
'data-[empty=true]',
|
|
327
|
+
'focus-visible:ring-[length:var(--focus-ring-width)]',
|
|
328
|
+
'focus-visible:ring-offset-[length:var(--focus-ring-offset)]',
|
|
329
|
+
'focus-within:border-[var(--color-primary)]',
|
|
330
|
+
'from-primary/90',
|
|
331
|
+
'group-hover:bg-[var(--color-surface-subtle)]',
|
|
332
|
+
'h-[1.25rem]',
|
|
333
|
+
'h-[1.5rem]',
|
|
334
|
+
'hover:bg-[var(--color-card-hover,transparent)]',
|
|
335
|
+
'hover:bg-[var(--color-muted)]',
|
|
336
|
+
'hover:bg-[var(--color-surface-subtle)]',
|
|
337
|
+
'hover:bg-[var(--color-surface)]',
|
|
338
|
+
'hover:bg-foreground/10',
|
|
339
|
+
'hover:bg-muted-foreground/70',
|
|
340
|
+
'hover:bg-muted/30',
|
|
341
|
+
'hover:bg-muted/40',
|
|
342
|
+
'hover:bg-primary-foreground/15',
|
|
343
|
+
'hover:bg-primary-foreground/20',
|
|
344
|
+
'hover:text-[var(--color-foreground)]',
|
|
345
|
+
'hover:text-info/80',
|
|
346
|
+
'hover:translate-y-[var(--hover-translate-y)]',
|
|
347
|
+
'left-[15%]',
|
|
348
|
+
'max-h-[36rem]',
|
|
349
|
+
'max-h-[60vh]',
|
|
350
|
+
'max-w-[calc(100vw-1.5rem)]',
|
|
351
|
+
'max-w-[calc(100vw-1rem)]',
|
|
352
|
+
'max-w-[calc(100vw-2rem)]',
|
|
353
|
+
'md:grid-cols-[var(--master-detail-cols)]',
|
|
354
|
+
'md:max-w-[50%]',
|
|
355
|
+
'md:min-w-[160px]',
|
|
356
|
+
'md:min-w-[45%]',
|
|
357
|
+
'min-h-[16rem]',
|
|
358
|
+
'min-h-[3rem]',
|
|
359
|
+
'min-h-[8rem]',
|
|
360
|
+
'min-w-[10rem]',
|
|
361
|
+
'min-w-[16rem]',
|
|
362
|
+
'min-w-[2px]',
|
|
363
|
+
'min-w-[400px]',
|
|
364
|
+
'min-w-[520px]',
|
|
365
|
+
'min-w-[600px]',
|
|
366
|
+
'min-w-[700px]',
|
|
367
|
+
'min-w-[8rem]',
|
|
368
|
+
'pt-[10vh]',
|
|
369
|
+
'py-[1px]',
|
|
370
|
+
'right-[15%]',
|
|
371
|
+
'ring-primary/40',
|
|
372
|
+
'scale-[var(--hover-scale)]',
|
|
373
|
+
'sm:min-w-[200px]',
|
|
374
|
+
'sm:min-w-[300px]',
|
|
375
|
+
'sm:w-[28rem]',
|
|
376
|
+
'sm:w-[340px]',
|
|
377
|
+
'sm:w-[480px]',
|
|
378
|
+
'sm:w-[640px]',
|
|
379
|
+
'text-[10px]',
|
|
380
|
+
'text-[11px]',
|
|
381
|
+
'text-[var(--color-danger)]',
|
|
382
|
+
'text-[var(--color-primary)]',
|
|
383
|
+
'text-[var(--color-success)]',
|
|
384
|
+
'text-[var(--color-warning-foreground)]',
|
|
385
|
+
'text-[var(--color-warning)]',
|
|
386
|
+
'text-foreground/50',
|
|
387
|
+
'top-[15%]',
|
|
388
|
+
'translate-x-[1.25rem]',
|
|
389
|
+
'w-[1.25rem]',
|
|
390
|
+
'w-[2.75rem]',
|
|
391
|
+
'w-[400px]',
|
|
392
|
+
'z-[1]',
|
|
393
|
+
'z-[45]',
|
|
267
394
|
],
|
|
268
395
|
theme: {
|
|
269
396
|
fontFamily: {
|
|
@@ -278,48 +405,48 @@ module.exports = {
|
|
|
278
405
|
extend: {
|
|
279
406
|
colors: {
|
|
280
407
|
primary: {
|
|
281
|
-
DEFAULT: '
|
|
282
|
-
foreground: '
|
|
283
|
-
hover: '
|
|
408
|
+
DEFAULT: withOpacity('--color-primary'),
|
|
409
|
+
foreground: withOpacity('--color-primary-foreground'),
|
|
410
|
+
hover: withOpacity('--color-primary-hover'),
|
|
284
411
|
},
|
|
285
412
|
secondary: {
|
|
286
|
-
DEFAULT: '
|
|
287
|
-
foreground: '
|
|
288
|
-
hover: '
|
|
413
|
+
DEFAULT: withOpacity('--color-secondary'),
|
|
414
|
+
foreground: withOpacity('--color-secondary-foreground'),
|
|
415
|
+
hover: withOpacity('--color-secondary-hover'),
|
|
289
416
|
},
|
|
290
417
|
muted: {
|
|
291
|
-
DEFAULT: '
|
|
292
|
-
foreground: '
|
|
418
|
+
DEFAULT: withOpacity('--color-muted'),
|
|
419
|
+
foreground: withOpacity('--color-muted-foreground'),
|
|
293
420
|
},
|
|
294
421
|
accent: {
|
|
295
|
-
DEFAULT: '
|
|
296
|
-
foreground: '
|
|
422
|
+
DEFAULT: withOpacity('--color-accent'),
|
|
423
|
+
foreground: withOpacity('--color-accent-foreground'),
|
|
297
424
|
},
|
|
298
|
-
background: '
|
|
299
|
-
foreground: '
|
|
425
|
+
background: withOpacity('--color-background'),
|
|
426
|
+
foreground: withOpacity('--color-foreground'),
|
|
300
427
|
card: {
|
|
301
|
-
DEFAULT: '
|
|
302
|
-
foreground: '
|
|
428
|
+
DEFAULT: withOpacity('--color-card'),
|
|
429
|
+
foreground: withOpacity('--color-card-foreground'),
|
|
303
430
|
},
|
|
304
|
-
surface: '
|
|
305
|
-
border: '
|
|
306
|
-
input: '
|
|
307
|
-
ring: '
|
|
431
|
+
surface: withOpacity('--color-surface'),
|
|
432
|
+
border: withOpacity('--color-border'),
|
|
433
|
+
input: withOpacity('--color-input'),
|
|
434
|
+
ring: withOpacity('--color-ring'),
|
|
308
435
|
error: {
|
|
309
|
-
DEFAULT: '
|
|
310
|
-
foreground: '
|
|
436
|
+
DEFAULT: withOpacity('--color-error'),
|
|
437
|
+
foreground: withOpacity('--color-error-foreground'),
|
|
311
438
|
},
|
|
312
439
|
success: {
|
|
313
|
-
DEFAULT: '
|
|
314
|
-
foreground: '
|
|
440
|
+
DEFAULT: withOpacity('--color-success'),
|
|
441
|
+
foreground: withOpacity('--color-success-foreground'),
|
|
315
442
|
},
|
|
316
443
|
warning: {
|
|
317
|
-
DEFAULT: '
|
|
318
|
-
foreground: '
|
|
444
|
+
DEFAULT: withOpacity('--color-warning'),
|
|
445
|
+
foreground: withOpacity('--color-warning-foreground'),
|
|
319
446
|
},
|
|
320
447
|
info: {
|
|
321
|
-
DEFAULT: '
|
|
322
|
-
foreground: '
|
|
448
|
+
DEFAULT: withOpacity('--color-info'),
|
|
449
|
+
foreground: withOpacity('--color-info-foreground'),
|
|
323
450
|
},
|
|
324
451
|
},
|
|
325
452
|
borderRadius: {
|