@uni-design-system/uni-core 7.2.0 → 8.0.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/cjs/index.cjs +462 -7
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +444 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/types/concepts/animation/duration.helpers.d.ts +25 -0
- package/dist/types/concepts/animation/duration.helpers.d.ts.map +1 -0
- package/dist/types/concepts/animation/duration.helpers.spec.d.ts +2 -0
- package/dist/types/concepts/animation/duration.helpers.spec.d.ts.map +1 -0
- package/dist/types/concepts/animation/index.d.ts +1 -0
- package/dist/types/concepts/animation/index.d.ts.map +1 -1
- package/dist/types/concepts/component/component.types.d.ts +1 -1
- package/dist/types/concepts/component/component.types.d.ts.map +1 -1
- package/dist/types/concepts/generation/theme-file.emitter.d.ts.map +1 -1
- package/dist/types/concepts/generation/theme.generator.d.ts +9 -2
- package/dist/types/concepts/generation/theme.generator.d.ts.map +1 -1
- package/dist/types/concepts/style/index.d.ts +1 -0
- package/dist/types/concepts/style/index.d.ts.map +1 -1
- package/dist/types/concepts/style/selectors.constants.d.ts +18 -0
- package/dist/types/concepts/style/selectors.constants.d.ts.map +1 -0
- package/dist/types/concepts/theme/index.d.ts +1 -0
- package/dist/types/concepts/theme/index.d.ts.map +1 -1
- package/dist/types/concepts/theme/theme.types.d.ts +7 -0
- package/dist/types/concepts/theme/theme.types.d.ts.map +1 -1
- package/dist/types/concepts/theme/theme.validation.d.ts +51 -0
- package/dist/types/concepts/theme/theme.validation.d.ts.map +1 -0
- package/dist/types/concepts/theme/theme.validation.spec.d.ts +2 -0
- package/dist/types/concepts/theme/theme.validation.spec.d.ts.map +1 -0
- package/dist/types/concepts/theme/themes/base.theme.d.ts +16 -0
- package/dist/types/concepts/theme/themes/base.theme.d.ts.map +1 -1
- package/dist/types/concepts/typography/typeface.helpers.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Duration (seconds) the default theme assigns `expand`'s `transitionSpeed`. */
|
|
2
|
+
export declare const EXPAND_DEFAULT_SPEED = 0.35;
|
|
3
|
+
/**
|
|
4
|
+
* Content height (px) at which a reveal runs at exactly its `transitionSpeed`.
|
|
5
|
+
* Roughly a few lines of card content — the size the default 0.35s was tuned on.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EXPAND_REFERENCE_HEIGHT = 240;
|
|
8
|
+
/**
|
|
9
|
+
* Duration envelope at the default speed. A tiny region never blinks past
|
|
10
|
+
* faster than the min; a full-page region never drags longer than the max.
|
|
11
|
+
* Expressed at `EXPAND_DEFAULT_SPEED` and applied as scale-factor clamps, so a
|
|
12
|
+
* theme that slows `transitionSpeed` down widens its envelope proportionally
|
|
13
|
+
* instead of being capped back to the stock feel.
|
|
14
|
+
*/
|
|
15
|
+
export declare const EXPAND_MIN_DURATION = 0.15;
|
|
16
|
+
export declare const EXPAND_MAX_DURATION = 0.6;
|
|
17
|
+
/**
|
|
18
|
+
* Size-aware reveal duration: `speed × √(height ÷ reference)`, clamped.
|
|
19
|
+
*
|
|
20
|
+
* A fixed duration reads as sluggish on a short region and rushed on a tall
|
|
21
|
+
* one; scaling by the square root of height keeps perceived speed steady —
|
|
22
|
+
* bigger reveals get more time, but sublinearly.
|
|
23
|
+
*/
|
|
24
|
+
export declare const expandDuration: (contentHeight: number, speed?: number) => number;
|
|
25
|
+
//# sourceMappingURL=duration.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.helpers.d.ts","sourceRoot":"","sources":["../../../../src/concepts/animation/duration.helpers.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAKvC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GACzB,eAAe,MAAM,EACrB,QAAO,MAA6B,KACnC,MAIF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.helpers.spec.d.ts","sourceRoot":"","sources":["../../../../src/concepts/animation/duration.helpers.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/animation/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/animation/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Size } from '../size';
|
|
2
2
|
import { Variant } from '../theme';
|
|
3
3
|
import { StyleExpression } from '../style';
|
|
4
|
-
export type ComponentName = 'undefined' | 'alert' | 'appBar' | 'avatar' | 'avatarGroup' | 'badge' | 'breadcrumb' | 'button' | 'buttonGroup' | 'card' | 'cardContent' | 'cardHeader' | 'checkbox' | 'dataSearch' | 'dataTable' | 'dialog' | 'dialogButtons' | 'dialogHeader' | 'drawer' | 'dropdown' | 'footer' | 'iconButton' | 'input' | 'multiSelectDropdown' | 'notificationBadge' | 'paginator' | 'radio' | 'searchInput' | 'select' | 'skeleton' | 'slider' | 'snackbar' | 'stat' | 'symbol' | 'progressBar' | 'progressGauge' | 'tabs' | 'textarea' | 'textButton' | 'toggle' | 'tooltip';
|
|
4
|
+
export type ComponentName = 'undefined' | 'alert' | 'appBar' | 'avatar' | 'avatarGroup' | 'badge' | 'breadcrumb' | 'button' | 'buttonGroup' | 'card' | 'cardContent' | 'cardHeader' | 'checkbox' | 'dataSearch' | 'dataTable' | 'dialog' | 'dialogButtons' | 'dialogHeader' | 'drawer' | 'dropdown' | 'expand' | 'footer' | 'iconButton' | 'input' | 'menu' | 'menuItem' | 'multiSelectDropdown' | 'notificationBadge' | 'paginator' | 'radio' | 'searchInput' | 'select' | 'skeleton' | 'slider' | 'snackbar' | 'stat' | 'symbol' | 'tag' | 'tagInput' | 'progressBar' | 'progressGauge' | 'tabs' | 'textarea' | 'textButton' | 'toggle' | 'tooltip';
|
|
5
5
|
export interface ComponentTheme<T = object> {
|
|
6
6
|
/** Style applied to every instance regardless of variant/size. */
|
|
7
7
|
fixed?: StyleExpression;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.types.d.ts","sourceRoot":"","sources":["../../../../src/concepts/component/component.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,aAAa,GACb,MAAM,GACN,aAAa,GACb,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,eAAe,GACf,cAAc,GACd,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,OAAO,GACP,qBAAqB,GACrB,mBAAmB,GACnB,WAAW,GACX,OAAO,GACP,aAAa,GACb,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,UAAU,GACV,MAAM,GACN,QAAQ,GACR,aAAa,GACb,eAAe,GACf,MAAM,GACN,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,MAAM;IACxC,kEAAkE;IAClE,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,CAAC;CACb;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"component.types.d.ts","sourceRoot":"","sources":["../../../../src/concepts/component/component.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,aAAa,GACb,MAAM,GACN,aAAa,GACb,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,eAAe,GACf,cAAc,GACd,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,OAAO,GACP,MAAM,GACN,UAAU,GACV,qBAAqB,GACrB,mBAAmB,GACnB,WAAW,GACX,OAAO,GACP,aAAa,GACb,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,UAAU,GACV,MAAM,GACN,QAAQ,GACR,KAAK,GACL,UAAU,GACV,aAAa,GACb,eAAe,GACf,MAAM,GACN,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,MAAM;IACxC,kEAAkE;IAClE,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,CAAC;CACb;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-file.emitter.d.ts","sourceRoot":"","sources":["../../../../src/concepts/generation/theme-file.emitter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1E,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;CACvB;AAwDD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,cAAc,KAAG,
|
|
1
|
+
{"version":3,"file":"theme-file.emitter.d.ts","sourceRoot":"","sources":["../../../../src/concepts/generation/theme-file.emitter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1E,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;CACvB;AAwDD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,cAAc,KAAG,gBAoIrD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ColorCategory, ColorScheme } from '../color/color.types';
|
|
2
2
|
import { Radii, UniTheme } from '../theme/theme.model';
|
|
3
|
-
import { GeneratedThemeConfig, GenerationInput, ThemeShape } from './generation.types';
|
|
3
|
+
import { ContrastReport, GeneratedThemeConfig, GenerationInput, ThemeShape } from './generation.types';
|
|
4
4
|
/** Radii presets per shape language (PRD §3.5.A). Same keys as `BaseRadii`. */
|
|
5
5
|
export declare const ShapeRadii: Record<ThemeShape, Radii>;
|
|
6
6
|
/**
|
|
@@ -19,12 +19,19 @@ export declare const inferCategory: (seedHex: string) => ColorCategory;
|
|
|
19
19
|
* Pure and deterministic — identical input yields identical output.
|
|
20
20
|
*/
|
|
21
21
|
export declare const generateThemes: (input: GenerationInput) => GeneratedThemeConfig;
|
|
22
|
+
/**
|
|
23
|
+
* One-line human summary of a {@link ContrastReport}. Shared so the generated
|
|
24
|
+
* theme file's header and the MCP's theme tools report identical wording.
|
|
25
|
+
*/
|
|
26
|
+
export declare const summarizeContrast: (report: ContrastReport) => string;
|
|
22
27
|
/**
|
|
23
28
|
* Convenience wrapper: {@link generateThemes} piped through `createTheme()`,
|
|
24
|
-
* returning a registration-ready light/dark {@link UniTheme} pair
|
|
29
|
+
* returning a registration-ready light/dark {@link UniTheme} pair alongside
|
|
30
|
+
* the contrast report the colors were audited against.
|
|
25
31
|
*/
|
|
26
32
|
export declare const generateUniThemes: (input: GenerationInput) => {
|
|
27
33
|
light: UniTheme;
|
|
28
34
|
dark: UniTheme;
|
|
35
|
+
report: ContrastReport;
|
|
29
36
|
};
|
|
30
37
|
//# sourceMappingURL=theme.generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.generator.d.ts","sourceRoot":"","sources":["../../../../src/concepts/generation/theme.generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAM5D,OAAO,KAAK,EAEV,oBAAoB,EACpB,eAAe,EACf,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B,+EAA+E;AAC/E,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,KAAK,CAIhD,CAAC;AAQF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,EAAE,WAAW,MAAM,EAAE,KAAG,WAQxE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,aAM/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,eAAe,KAAG,oBAmCvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,eAAe,
|
|
1
|
+
{"version":3,"file":"theme.generator.d.ts","sourceRoot":"","sources":["../../../../src/concepts/generation/theme.generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAM5D,OAAO,KAAK,EAEV,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B,+EAA+E;AAC/E,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,KAAK,CAIhD,CAAC;AAQF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,EAAE,WAAW,MAAM,EAAE,KAAG,WAQxE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,aAM/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,eAAe,KAAG,oBAmCvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,cAAc,KAAG,MAGvD,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,eAAe,KACrB;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAsB3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/style/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/style/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The highlight state for roving-focus composites (menus, and any other widget
|
|
3
|
+
* that moves focus programmatically): pointer hover, or focus the user drove
|
|
4
|
+
* from the keyboard.
|
|
5
|
+
*
|
|
6
|
+
* Why not plain `:focus` — a roving-focus composite calls `.focus()` on an item
|
|
7
|
+
* every time it opens, including pointer opens, and `:focus` would paint that
|
|
8
|
+
* as a highlight the mouse user never asked for, reading as a preselected
|
|
9
|
+
* item. `:focus-visible` excludes programmatic focus that follows a click while
|
|
10
|
+
* still matching keyboard navigation.
|
|
11
|
+
*
|
|
12
|
+
* Shared as a constant because Emotion merges styles by **exact selector
|
|
13
|
+
* text**: a component's base rule and any theme variant restyling that rule
|
|
14
|
+
* must key both with this value, or the variant silently fails to override and
|
|
15
|
+
* reintroduces the phantom highlight.
|
|
16
|
+
*/
|
|
17
|
+
export declare const HOVER_OR_KEYBOARD_FOCUS = "&:hover, &:focus-visible";
|
|
18
|
+
//# sourceMappingURL=selectors.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.constants.d.ts","sourceRoot":"","sources":["../../../../src/concepts/style/selectors.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
@@ -2,4 +2,11 @@ import { ContentColorToken } from '../color';
|
|
|
2
2
|
export type themes = 'uni' | 'carbon' | 'material' | 'bootstrap';
|
|
3
3
|
export type Variant = 'ghost' | 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'warn' | 'success' | 'disabled' | 'light' | 'onLight' | 'dark' | 'onDark';
|
|
4
4
|
export type TextColor = ContentColorToken | Variant;
|
|
5
|
+
/**
|
|
6
|
+
* A tag's style archetype, orthogonal to its {@link Variant} colour role: the
|
|
7
|
+
* variant says *which* colour, the tone says *how* it is applied. Themes express
|
|
8
|
+
* tones as nested `&.tone-*` selectors inside each variant, so both axes stay in
|
|
9
|
+
* one place.
|
|
10
|
+
*/
|
|
11
|
+
export type TagTone = 'soft' | 'solid' | 'outline';
|
|
5
12
|
//# sourceMappingURL=theme.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.types.d.ts","sourceRoot":"","sources":["../../../../src/concepts/theme/theme.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAEjE,MAAM,MAAM,OAAO,GACf,OAAO,GACP,SAAS,GACT,WAAW,GACX,UAAU,GACV,YAAY,GACZ,MAAM,GACN,SAAS,GACT,UAAU,GACV,OAAO,GACP,SAAS,GACT,MAAM,GACN,QAAQ,CAAC;AAEb,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"theme.types.d.ts","sourceRoot":"","sources":["../../../../src/concepts/theme/theme.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAEjE,MAAM,MAAM,OAAO,GACf,OAAO,GACP,SAAS,GACT,WAAW,GACX,UAAU,GACV,YAAY,GACZ,MAAM,GACN,SAAS,GACT,UAAU,GACV,OAAO,GACP,SAAS,GACT,MAAM,GACN,QAAQ,CAAC;AAEb,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,OAAO,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { UniTheme } from './theme.model';
|
|
2
|
+
import { TextRole } from '../typography';
|
|
3
|
+
/**
|
|
4
|
+
* Dependency-free structural validation for {@link UniTheme}.
|
|
5
|
+
*
|
|
6
|
+
* Every theme scale is `Partial<Record<…>>`, so a malformed theme — hand
|
|
7
|
+
* written, generated, or fetched as JSON — renders as silent `undefined` CSS.
|
|
8
|
+
* `parseTheme` is the acceptance/rejection-with-reasons contract that every
|
|
9
|
+
* theme write funnels through: the Angular `ThemeService`, the MCP theme
|
|
10
|
+
* tools, and any future runtime registry all share these rules. It collects
|
|
11
|
+
* every issue rather than failing fast, so a rejected theme comes back with
|
|
12
|
+
* the complete repair list.
|
|
13
|
+
*/
|
|
14
|
+
/** One reason a candidate theme was rejected, anchored to a dotted path. */
|
|
15
|
+
export interface ThemeIssue {
|
|
16
|
+
/** Dotted location, e.g. `colors.primary` or `typography.label.fontSize`. */
|
|
17
|
+
path: string;
|
|
18
|
+
message: string;
|
|
19
|
+
}
|
|
20
|
+
export type ThemeParseResult = {
|
|
21
|
+
success: true;
|
|
22
|
+
theme: UniTheme;
|
|
23
|
+
issues: [];
|
|
24
|
+
} | {
|
|
25
|
+
success: false;
|
|
26
|
+
theme?: undefined;
|
|
27
|
+
issues: ThemeIssue[];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Color tokens components cannot render without: the default variant pairs,
|
|
31
|
+
* the base surfaces, and the disabled/warn states. Themes may define any
|
|
32
|
+
* further tokens; these must exist.
|
|
33
|
+
*/
|
|
34
|
+
export declare const REQUIRED_COLOR_TOKENS: readonly ["primary", "on-primary", "primary-container", "on-primary-container", "primary-surface", "on-primary-surface", "surface", "on-surface", "background", "on-background", "warn", "on-warn", "disabled", "on-disabled", "outline", "transparent"];
|
|
35
|
+
/** The canonical type scale; every theme must style each role. */
|
|
36
|
+
export declare const REQUIRED_TEXT_ROLES: readonly TextRole[];
|
|
37
|
+
export declare const REQUIRED_SPACING_SIZES: readonly ["none", "xxs", "xs", "sm", "md", "lg", "xl"];
|
|
38
|
+
export declare const REQUIRED_RADII_SIZES: readonly ["none", "xxs", "xs", "sm", "md", "lg", "max"];
|
|
39
|
+
export declare const REQUIRED_SHADOWS: readonly ["raised", "menu", "dialog", "warn"];
|
|
40
|
+
export declare const REQUIRED_THICKNESSES: readonly ["thin", "standard", "thick"];
|
|
41
|
+
/**
|
|
42
|
+
* Validate a candidate theme, collecting every structural issue. Never
|
|
43
|
+
* throws; a failed result carries the complete repair list.
|
|
44
|
+
*/
|
|
45
|
+
export declare const parseTheme: (input: unknown) => ThemeParseResult;
|
|
46
|
+
/** Format issues for logs and error messages. */
|
|
47
|
+
export declare const formatThemeIssues: (issues: ThemeIssue[]) => string;
|
|
48
|
+
/** Validate or throw, with every reason in the error message. */
|
|
49
|
+
export declare const assertTheme: (input: unknown) => UniTheme;
|
|
50
|
+
export declare const isUniTheme: (input: unknown) => input is UniTheme;
|
|
51
|
+
//# sourceMappingURL=theme.validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.validation.d.ts","sourceRoot":"","sources":["../../../../src/concepts/theme/theme.validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;GAUG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,EAAE,CAAA;CAAE,GAC9C;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,0PAiBxB,CAAC;AAEX,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,EAAE,SAAS,QAAQ,EAuBzC,CAAC;AAEX,eAAO,MAAM,sBAAsB,wDAAyD,CAAC;AAC7F,eAAO,MAAM,oBAAoB,yDAA0D,CAAC;AAC5F,eAAO,MAAM,gBAAgB,+CAAgD,CAAC;AAC9E,eAAO,MAAM,oBAAoB,wCAAyC,CAAC;AA2G3E;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,gBA0B3C,CAAC;AAEF,iDAAiD;AACjD,eAAO,MAAM,iBAAiB,GAAI,QAAQ,UAAU,EAAE,KAAG,MAC8B,CAAC;AAExF,iEAAiE;AACjE,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,QAM5C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,QAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.validation.spec.d.ts","sourceRoot":"","sources":["../../../../src/concepts/theme/theme.validation.spec.ts"],"names":[],"mappings":""}
|
|
@@ -30,6 +30,22 @@ export interface ThemeConfig {
|
|
|
30
30
|
components?: ComponentThemes;
|
|
31
31
|
}
|
|
32
32
|
export declare const createTheme: ({ id, name, colors, icons, radii, shadows, borders, components, }: ThemeConfig) => UniTheme;
|
|
33
|
+
/**
|
|
34
|
+
* Re-attach the built-in icon set to a theme that traveled without it.
|
|
35
|
+
*
|
|
36
|
+
* A serialized theme is ~50 KB, ~71% of which is {@link BaseIcons} — bytes
|
|
37
|
+
* every uni-core consumer already ships. Transports (MCP tool results, theme
|
|
38
|
+
* JSON over HTTP) send the {@link dehydrateTheme} form and the receiver
|
|
39
|
+
* hydrates, applying exactly the `{...BaseIcons, ...icons}` contract
|
|
40
|
+
* {@link createTheme} applies at construction: the theme's own icons win,
|
|
41
|
+
* built-ins fill the rest.
|
|
42
|
+
*/
|
|
43
|
+
export declare const hydrateTheme: (theme: UniTheme) => UniTheme;
|
|
44
|
+
/**
|
|
45
|
+
* The wire form of a theme: icons identical to the built-in set are dropped,
|
|
46
|
+
* so only genuine overrides travel. Reverse with {@link hydrateTheme}.
|
|
47
|
+
*/
|
|
48
|
+
export declare const dehydrateTheme: (theme: UniTheme) => UniTheme;
|
|
33
49
|
/**
|
|
34
50
|
* Build a full {@link UniTheme} straight from a {@link PaletteConfig} — the
|
|
35
51
|
* one-call path a theme builder uses to turn a brand color (or a seed +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.theme.d.ts","sourceRoot":"","sources":["../../../../../src/concepts/theme/themes/base.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"base.theme.d.ts","sourceRoot":"","sources":["../../../../../src/concepts/theme/themes/base.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAK7E,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,KAAK,EACL,KAAK,EACL,OAAO,EAIP,QAAQ,EACT,MAAM,gBAAgB,CAAC;AA+pBxB,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,wEAAwE;IACxE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAcD,eAAO,MAAM,WAAW,GAAI,mEASzB,WAAW,KAAG,QAYf,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,QAAQ,KAAG,QAG7C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,QAAQ,KAAG,QAK/C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,oBAAoB,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,KAC1F,QAUF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAInF,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAmE,CAAC;AAE9F,eAAO,MAAM,SAAS,EAAE,QAItB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeface.helpers.d.ts","sourceRoot":"","sources":["../../../../src/concepts/typography/typeface.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,SAAS,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"typeface.helpers.d.ts","sourceRoot":"","sources":["../../../../src/concepts/typography/typeface.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,SAAS,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAW7E;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,SAAS,KAAG,kBAQ5C,CAAC;AAEH,eAAO,MAAM,WAAW,GACtB,YAAY,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,KACpC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAC8D,CAAC"}
|