@uni-design-system/uni-core 3.0.2 → 5.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.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/index.cjs +1490 -767
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/esm/index.js +1464 -768
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/types/concepts/color/color.factory.d.ts +48 -0
  7. package/dist/types/concepts/color/color.factory.d.ts.map +1 -0
  8. package/dist/types/concepts/color/color.helper.d.ts +15 -0
  9. package/dist/types/concepts/color/color.helper.d.ts.map +1 -1
  10. package/dist/types/concepts/color/color.records.d.ts +9 -0
  11. package/dist/types/concepts/color/color.records.d.ts.map +1 -1
  12. package/dist/types/concepts/color/color.types.d.ts +2 -2
  13. package/dist/types/concepts/color/color.types.d.ts.map +1 -1
  14. package/dist/types/concepts/color/color.utils.d.ts +17 -0
  15. package/dist/types/concepts/color/color.utils.d.ts.map +1 -1
  16. package/dist/types/concepts/color/index.d.ts +1 -0
  17. package/dist/types/concepts/color/index.d.ts.map +1 -1
  18. package/dist/types/concepts/component/component.types.d.ts +9 -3
  19. package/dist/types/concepts/component/component.types.d.ts.map +1 -1
  20. package/dist/types/concepts/generation/generation.spec.d.ts +2 -0
  21. package/dist/types/concepts/generation/generation.spec.d.ts.map +1 -0
  22. package/dist/types/concepts/generation/generation.types.d.ts +59 -0
  23. package/dist/types/concepts/generation/generation.types.d.ts.map +1 -0
  24. package/dist/types/concepts/generation/index.d.ts +6 -0
  25. package/dist/types/concepts/generation/index.d.ts.map +1 -0
  26. package/dist/types/concepts/generation/oklch.helper.d.ts +22 -0
  27. package/dist/types/concepts/generation/oklch.helper.d.ts.map +1 -0
  28. package/dist/types/concepts/generation/palette.factory.d.ts +23 -0
  29. package/dist/types/concepts/generation/palette.factory.d.ts.map +1 -0
  30. package/dist/types/concepts/generation/theme-file.emitter.d.ts +26 -0
  31. package/dist/types/concepts/generation/theme-file.emitter.d.ts.map +1 -0
  32. package/dist/types/concepts/generation/theme.generator.d.ts +30 -0
  33. package/dist/types/concepts/generation/theme.generator.d.ts.map +1 -0
  34. package/dist/types/concepts/index.d.ts +1 -0
  35. package/dist/types/concepts/index.d.ts.map +1 -1
  36. package/dist/types/concepts/size/size.types.d.ts +1 -0
  37. package/dist/types/concepts/size/size.types.d.ts.map +1 -1
  38. package/dist/types/concepts/style/index.d.ts +1 -0
  39. package/dist/types/concepts/style/index.d.ts.map +1 -1
  40. package/dist/types/concepts/style/inputs.constants.d.ts +3 -0
  41. package/dist/types/concepts/style/inputs.constants.d.ts.map +1 -0
  42. package/dist/types/concepts/style/style.types.d.ts +3 -1
  43. package/dist/types/concepts/style/style.types.d.ts.map +1 -1
  44. package/dist/types/concepts/theme/theme.model.d.ts +14 -14
  45. package/dist/types/concepts/theme/theme.model.d.ts.map +1 -1
  46. package/dist/types/concepts/theme/theme.types.d.ts +2 -0
  47. package/dist/types/concepts/theme/theme.types.d.ts.map +1 -1
  48. package/dist/types/concepts/theme/themes/base.theme.d.ts +44 -1
  49. package/dist/types/concepts/theme/themes/base.theme.d.ts.map +1 -1
  50. package/dist/types/concepts/theme/themes/dark.theme.d.ts +3 -2
  51. package/dist/types/concepts/theme/themes/dark.theme.d.ts.map +1 -1
  52. package/dist/types/concepts/theme/themes/light.theme.d.ts +1 -2
  53. package/dist/types/concepts/theme/themes/light.theme.d.ts.map +1 -1
  54. package/dist/types/concepts/typography/index.d.ts +1 -0
  55. package/dist/types/concepts/typography/index.d.ts.map +1 -1
  56. package/dist/types/concepts/typography/typeface.helpers.d.ts +9 -0
  57. package/dist/types/concepts/typography/typeface.helpers.d.ts.map +1 -0
  58. package/package.json +6 -2
  59. package/dist/types/concepts/theme/themes/square.theme.d.ts +0 -3
  60. package/dist/types/concepts/theme/themes/square.theme.d.ts.map +0 -1
@@ -0,0 +1,59 @@
1
+ import { ColorCategory, ColorScheme } from '../color/color.types';
2
+ import { Colors, Radii, Shadows } from '../theme/theme.model';
3
+ /** Shape language for generated radii — see the PRD's radii presets. */
4
+ export type ThemeShape = 'sharp' | 'modern' | 'playful';
5
+ export interface GenerationInput {
6
+ /**
7
+ * Brand color(s): a single hex seed, or 2–3 hexes assigned to the
8
+ * primary/secondary/tertiary roles in order. Seeds are honored as closely
9
+ * as WCAG AA allows — the guard-rail may nudge lightness, never hue.
10
+ */
11
+ seed: string | string[];
12
+ /**
13
+ * Tonal character of the generated palette. Defaults to a category
14
+ * inferred from the seed's own chroma, so a vivid brand stays vivid and a
15
+ * muted brand stays muted.
16
+ */
17
+ vibe?: ColorCategory;
18
+ /** Override the hue-wheel relationship (auto-classified for multi-seed input). */
19
+ scheme?: ColorScheme;
20
+ /** Emit a {@link Radii} override matching this shape language. */
21
+ shape?: ThemeShape;
22
+ /** Display name for the generated themes. Defaults to "Brand". */
23
+ name?: string;
24
+ }
25
+ /** One WCAG 2.2 pair verified by the guard-rail, by token name. */
26
+ export interface ContrastCheck {
27
+ mode: 'light' | 'dark';
28
+ /** Content/border token name, e.g. 'on-primary'. */
29
+ foreground: string;
30
+ /** Surface token name it renders on, e.g. 'primary'. */
31
+ background: string;
32
+ foregroundColor: string;
33
+ backgroundColor: string;
34
+ /** Achieved contrast ratio (1–21). */
35
+ ratio: number;
36
+ /** Required ratio: 4.5 for content pairs, 3 for borders/outline. */
37
+ required: number;
38
+ pass: boolean;
39
+ level: 'AA' | 'AAA' | 'fail';
40
+ }
41
+ /** Machine-readable WCAG audit of a generated light+dark theme pair. */
42
+ export interface ContrastReport {
43
+ checks: ContrastCheck[];
44
+ /** Lowest ratio across all checks. */
45
+ worstRatio: number;
46
+ /** True when every checked pair meets its requirement. */
47
+ pass: boolean;
48
+ }
49
+ /** Output of {@link generateThemes} — plugs directly into `createTheme()`. */
50
+ export interface GeneratedThemeConfig {
51
+ lightColors: Colors;
52
+ darkColors: Colors;
53
+ /** Present when `shape` was provided. */
54
+ radii?: Radii;
55
+ /** Brand-tinted shadow overrides (reserved; not yet emitted). */
56
+ shadows?: Shadows;
57
+ report: ContrastReport;
58
+ }
59
+ //# sourceMappingURL=generation.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generation.types.d.ts","sourceRoot":"","sources":["../../../../src/concepts/generation/generation.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEnE,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,kFAAkF;IAClF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kEAAkE;IAClE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;CAC9B;AAED,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,IAAI,EAAE,OAAO,CAAC;CACf;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;CACxB"}
@@ -0,0 +1,6 @@
1
+ export * from './oklch.helper';
2
+ export * from './generation.types';
3
+ export * from './palette.factory';
4
+ export * from './theme.generator';
5
+ export * from './theme-file.emitter';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/generation/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A color in OKLCH: perceptual lightness `l` (0–1), chroma `c` (0 = grey,
3
+ * ~0.37 = max sRGB vividness) and hue angle `h` in degrees (0–360).
4
+ *
5
+ * Unlike HSL lightness, OKLCH `l` is perceptually uniform — a blue and a
6
+ * yellow at the same `l` *look* equally light — which is what makes derived
7
+ * tonal scales consistent across hues.
8
+ */
9
+ export interface Oklch {
10
+ l: number;
11
+ c: number;
12
+ h: number;
13
+ }
14
+ /** Parse a hex color (`#RGB` or `#RRGGBB`) into OKLCH. */
15
+ export declare const hexToOklch: (hex: string) => Oklch;
16
+ /**
17
+ * Render OKLCH as an sRGB hex string. Out-of-gamut colors are mapped back
18
+ * into sRGB by reducing chroma only — lightness and hue are preserved, so
19
+ * vivid seeds desaturate gracefully instead of shifting hue or clipping.
20
+ */
21
+ export declare const oklchToHex: (color: Oklch) => string;
22
+ //# sourceMappingURL=oklch.helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oklch.helper.d.ts","sourceRoot":"","sources":["../../../../src/concepts/generation/oklch.helper.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAwDD,0DAA0D;AAC1D,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,KAUxC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,KAAK,KAAG,MAgBzC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Colors } from '../theme/theme.model';
2
+ import { BrandRole, PaletteConfig } from '../color/color.factory';
3
+ import { ColorCategory } from '../color/color.types';
4
+ import { ContrastCheck } from './generation.types';
5
+ export interface GenerateColorsConfig extends PaletteConfig {
6
+ /**
7
+ * Soft brand anchors, per role: the palette starts from these exact colors
8
+ * but the WCAG guard-rail may adjust lightness (never hue) to reach AA.
9
+ * Contrast-safe counterpart to the hard `brand` pins, which are emitted
10
+ * verbatim even when they fail.
11
+ */
12
+ targets?: Partial<Record<BrandRole, string>>;
13
+ /** Sink for the contrast checks performed while building this palette. */
14
+ checks?: ContrastCheck[];
15
+ }
16
+ export declare const CategoryChroma: Record<ColorCategory, number>;
17
+ /**
18
+ * Generate a complete {@link Colors} token set in OKLCH. Same contract as
19
+ * `generatePalette` (which delegates here), plus soft brand targets and a
20
+ * contrast-check sink for {@link ContrastReport} consumers.
21
+ */
22
+ export declare const generateColors: (config: GenerateColorsConfig) => Colors;
23
+ //# sourceMappingURL=palette.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"palette.factory.d.ts","sourceRoot":"","sources":["../../../../src/concepts/generation/palette.factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,0EAA0E;IAC1E,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1B;AA8CD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAOxD,CAAC;AAkBF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,oBAAoB,KAAG,MA2U7D,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { ContrastReport, GenerationInput } from './generation.types';
2
+ export interface ThemeFileInput extends GenerationInput {
3
+ /** Emit the dark theme alongside the light one. Defaults to true. */
4
+ darkMode?: boolean;
5
+ }
6
+ /** A rendered static theme file plus everything a consumer needs to wire it. */
7
+ export interface EmittedThemeFile {
8
+ /** TypeScript source for a static `uni-theme.ts` — plain, reviewable data. */
9
+ content: string;
10
+ /** Registration snippet for the consumer's `app.config.ts`. */
11
+ providerSnippet: string;
12
+ report: ContrastReport;
13
+ /** One-line human summary of the contrast report. */
14
+ reportSummary: string;
15
+ }
16
+ /**
17
+ * Render a static `uni-theme.ts` from a brand seed — the file the `ng add`
18
+ * schematic writes and the MCP `generate_uni_theme` tool returns.
19
+ *
20
+ * The file is the system's **source of truth**: literal colors, the border
21
+ * primitives spelled out, and a sparse `components` override section — so a
22
+ * human (or an AI agent) can retheme by editing tokens in place, with no
23
+ * runtime generation. Deterministic: same input, same file.
24
+ */
25
+ export declare const emitThemeFile: (input: ThemeFileInput) => EmittedThemeFile;
26
+ //# sourceMappingURL=theme-file.emitter.d.ts.map
@@ -0,0 +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;AA8CD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,cAAc,KAAG,gBAyErD,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { ColorCategory, ColorScheme } from '../color/color.types';
2
+ import { Radii, UniTheme } from '../theme/theme.model';
3
+ import { GeneratedThemeConfig, GenerationInput, ThemeShape } from './generation.types';
4
+ /** Radii presets per shape language (PRD §3.5.A). Same keys as `BaseRadii`. */
5
+ export declare const ShapeRadii: Record<ThemeShape, Radii>;
6
+ /**
7
+ * Classify 2–3 brand hues against {@link ColorScheme} by their angular
8
+ * distances from the primary hue. Heuristic bands, widest match wins.
9
+ */
10
+ export declare const classifyScheme: (primaryHue: number, otherHues: number[]) => ColorScheme;
11
+ /**
12
+ * Infer a tonal category from the seed's own chroma, so an unstated "vibe"
13
+ * preserves the brand's character — vivid stays vivid, muted stays muted.
14
+ */
15
+ export declare const inferCategory: (seedHex: string) => ColorCategory;
16
+ /**
17
+ * The theme generation engine (PRD §3.3): brand seed(s) in, complete WCAG-AA
18
+ * light+dark {@link Colors} pair out, with a machine-readable contrast report.
19
+ * Pure and deterministic — identical input yields identical output.
20
+ */
21
+ export declare const generateThemes: (input: GenerationInput) => GeneratedThemeConfig;
22
+ /**
23
+ * Convenience wrapper: {@link generateThemes} piped through `createTheme()`,
24
+ * returning a registration-ready light/dark {@link UniTheme} pair.
25
+ */
26
+ export declare const generateUniThemes: (input: GenerationInput) => {
27
+ light: UniTheme;
28
+ dark: UniTheme;
29
+ };
30
+ //# sourceMappingURL=theme.generator.d.ts.map
@@ -0,0 +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;AAK5D,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,oBAiCvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,eAAe,KAAG;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAQ3F,CAAC"}
@@ -7,6 +7,7 @@ export * from './color';
7
7
  export * from './component';
8
8
  export * from './container';
9
9
  export * from './elevation';
10
+ export * from './generation';
10
11
  export * from './gradient';
11
12
  export * from './iconography';
12
13
  export * from './layout';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/concepts/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/concepts/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export type Size = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
2
2
  export type NullableSize = Size | 'none';
3
3
  export type OptionalSize = NullableSize | undefined;
4
+ export type AbsoluteSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large' | 'xxx-large';
4
5
  //# sourceMappingURL=size.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"size.types.d.ts","sourceRoot":"","sources":["../../../../src/concepts/size/size.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AACpE,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,CAAC;AACzC,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"size.types.d.ts","sourceRoot":"","sources":["../../../../src/concepts/size/size.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AACpE,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,CAAC;AACzC,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,SAAS,CAAC;AAEpD,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,SAAS,GACT,OAAO,GACP,QAAQ,GACR,OAAO,GACP,SAAS,GACT,UAAU,GACV,WAAW,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './style.types';
2
+ export * from './inputs.constants';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/style/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,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"}
@@ -0,0 +1,3 @@
1
+ import { StyleExpression } from './style.types';
2
+ export declare const removeInputPlatformStyling: StyleExpression;
3
+ //# sourceMappingURL=inputs.constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputs.constants.d.ts","sourceRoot":"","sources":["../../../../src/concepts/style/inputs.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,eAAO,MAAM,0BAA0B,EAAE,eAQxC,CAAC"}
@@ -1,3 +1,5 @@
1
- export type StyleExpression = Record<string, string | number | undefined>;
1
+ export type StyleExpression = {
2
+ [key: string]: string | number | StyleExpression | undefined;
3
+ };
2
4
  export type NullableStyleExpression = StyleExpression | undefined;
3
5
  //# sourceMappingURL=style.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.types.d.ts","sourceRoot":"","sources":["../../../../src/concepts/style/style.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAC1E,MAAM,MAAM,uBAAuB,GAAG,eAAe,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"style.types.d.ts","sourceRoot":"","sources":["../../../../src/concepts/style/style.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,GAAG,SAAS,CAAC;CAC9D,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,eAAe,GAAG,SAAS,CAAC"}
@@ -1,7 +1,5 @@
1
1
  import { TextRole, TextStyle, TypeFaceDefinition } from '../typography';
2
2
  import { ColorToken } from '../color';
3
- import { Button, ButtonType } from '../button';
4
- import { Container, ContainerType } from '../container';
5
3
  import { ComponentThemes } from '../component';
6
4
  import { Variant } from './theme.types';
7
5
  import { NullableSize } from '../size';
@@ -12,13 +10,15 @@ export type OptionalColor = ColorKey | undefined;
12
10
  export type Spacing = Partial<Record<NullableSize, string | number>>;
13
11
  export type Orientation = 'horizontal' | 'vertical';
14
12
  export type LinearSpacing = Record<Orientation, Spacing>;
13
+ /**
14
+ * A theme's type scale. Keyed by the canonical {@link TextRole}s, with room
15
+ * for a few product-specific extras (badge, tag, input). This is the single
16
+ * source of type truth — CSS-ready `typefaces` are derived from it on read
17
+ * via `toTypefaces()`, never stored twice.
18
+ */
19
+ export type Typography = Record<TextRole, TextStyle> & Record<string, TextStyle>;
15
20
  export type Typefaces = Partial<Record<TextRole | string, TypeFaceDefinition>>;
16
21
  export type Typeface = keyof Typefaces;
17
- export interface ThemeProps {
18
- themeId?: string;
19
- themes?: Record<string, UniTheme>;
20
- setTheme?: any;
21
- }
22
22
  export type Borders = Partial<Record<Variant | string, string>>;
23
23
  export type Border = keyof Borders;
24
24
  export type OptionalBorder = Border | undefined;
@@ -33,20 +33,20 @@ export type Thicknesses = Record<Thickness, string | number>;
33
33
  export type Icons = Record<string, string>;
34
34
  export type Icon = keyof Icons;
35
35
  export interface UniTheme {
36
- name: string;
37
36
  id: string;
37
+ name: string;
38
+ /** Sole color source of truth. Borders and component variants derive from it. */
38
39
  colors: Colors;
39
- typography: Record<TextRole, TextStyle>;
40
- buttons: Record<ButtonType, Button>;
41
- containers: Record<ContainerType, Container>;
40
+ /** Numeric type scale; CSS `typefaces` are derived on read. */
41
+ typography: Typography;
42
42
  borders: Borders;
43
- components: ComponentThemes;
44
- icons: Icons;
45
43
  radii: Radii;
46
44
  shadows: Shadows;
47
45
  spacing: Spacing;
48
46
  thicknesses: Thicknesses;
49
- typefaces: Typefaces;
47
+ icons: Icons;
48
+ /** Per-component theming: fixed base + state-aware variants + sizes + options. */
49
+ components: ComponentThemes;
50
50
  }
51
51
  export type Themes = Record<string, UniTheme>;
52
52
  export type ThemeName = keyof Themes;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.model.d.ts","sourceRoot":"","sources":["../../../../src/concepts/theme/theme.model.ts"],"names":[],"mappings":"AAAA,OAAO,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CAAC;AAE/B,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IAEb,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,UAAU,EAAE,UAAU,CAAC;IAGvB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IAEb,kFAAkF;IAClF,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC9C,MAAM,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC"}
@@ -1,3 +1,5 @@
1
+ import { ContentColorToken } from '../color';
1
2
  export type themes = 'uni' | 'carbon' | 'material' | 'bootstrap';
2
3
  export type Variant = 'ghost' | 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'warn' | 'success' | 'disabled' | 'light' | 'onLight' | 'dark' | 'onDark';
4
+ export type TextColor = ContentColorToken | Variant;
3
5
  //# 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,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"}
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,3 +1,46 @@
1
- import { UniTheme } from '../theme.model';
1
+ import { ComponentThemes } from '../../component';
2
+ import { PaletteConfig } from '../../color';
3
+ import { GenerateColorsConfig } from '../../generation/palette.factory';
4
+ import { Borders, Colors, Icons, Radii, Shadows, UniTheme } from '../theme.model';
5
+ export interface ThemeConfig {
6
+ id: string;
7
+ name: string;
8
+ colors: Colors;
9
+ icons?: Icons;
10
+ /** Override the radii scale, e.g. a generated shape-language preset. */
11
+ radii?: Radii;
12
+ /** Override the elevation shadows, e.g. brand-tinted generated stacks. */
13
+ shadows?: Shadows;
14
+ /**
15
+ * Named border primitives, merged over the derived defaults. New tokens may
16
+ * use any name — point component options (or `components` overrides) at
17
+ * them and every consumer of the shared token picks up the change.
18
+ */
19
+ borders?: Borders;
20
+ /**
21
+ * Sparse per-component overrides, deep-merged over the derived component
22
+ * themes: only the sections you provide (fixed/variants/sizes/options keys)
23
+ * are replaced; everything else keeps tracking the library defaults.
24
+ */
25
+ components?: ComponentThemes;
26
+ }
27
+ export declare const createTheme: ({ id, name, colors, icons, radii, shadows, borders, components, }: ThemeConfig) => UniTheme;
28
+ /**
29
+ * Build a full {@link UniTheme} straight from a {@link PaletteConfig} — the
30
+ * one-call path a theme builder uses to turn a brand color (or a seed +
31
+ * scheme + category) into a complete, ready-to-apply theme.
32
+ */
33
+ export declare const createThemeFromPalette: (config: GenerateColorsConfig & {
34
+ id?: string;
35
+ name?: string;
36
+ icons?: Icons;
37
+ }) => UniTheme;
38
+ /**
39
+ * Seed for the shipped Light/Dark themes. Swap these three values (or call
40
+ * `generatePalette` with your own) to reskin the entire system — every color
41
+ * token is derived, so there is nothing else to hand-author.
42
+ */
43
+ export declare const BASE_PALETTE_CONFIG: Pick<PaletteConfig, 'seed' | 'scheme' | 'category'>;
44
+ export declare const lightColors: Colors;
2
45
  export declare const BaseTheme: UniTheme;
3
46
  //# sourceMappingURL=base.theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.theme.d.ts","sourceRoot":"","sources":["../../../../../src/concepts/theme/themes/base.theme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAoB/C,eAAO,MAAM,SAAS,EAAE,QAqqBvB,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;AAE7E,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,KAAK,EACL,KAAK,EACL,OAAO,EAIP,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAwXxB,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,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;;;;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,CAAA;CAAE,KAC3E,QAMC,CAAC;AAEL;;;;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,3 +1,4 @@
1
- import { UniTheme } from '../theme.model';
2
- export declare const DarkTheme: UniTheme;
1
+ import { Colors } from '../theme.model';
2
+ export declare const darkColors: Colors;
3
+ export declare const DarkTheme: import('..').UniTheme;
3
4
  //# sourceMappingURL=dark.theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dark.theme.d.ts","sourceRoot":"","sources":["../../../../../src/concepts/theme/themes/dark.theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,eAAO,MAAM,SAAS,EAAE,QAmCvB,CAAC"}
1
+ {"version":3,"file":"dark.theme.d.ts","sourceRoot":"","sources":["../../../../../src/concepts/theme/themes/dark.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAI7C,eAAO,MAAM,UAAU,EAAE,MAAkE,CAAC;AAE5F,eAAO,MAAM,SAAS,uBAIpB,CAAC"}
@@ -1,3 +1,2 @@
1
- import { UniTheme } from '../theme.model';
2
- export declare const LightTheme: UniTheme;
1
+ export declare const LightTheme: import('..').UniTheme;
3
2
  //# sourceMappingURL=light.theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"light.theme.d.ts","sourceRoot":"","sources":["../../../../../src/concepts/theme/themes/light.theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,eAAO,MAAM,UAAU,EAAE,QAIxB,CAAC"}
1
+ {"version":3,"file":"light.theme.d.ts","sourceRoot":"","sources":["../../../../../src/concepts/theme/themes/light.theme.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,uBAIrB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './typography.types';
2
2
  export * from './text.model';
3
3
  export * from './typography.records';
4
+ export * from './typeface.helpers';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/typography/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/concepts/typography/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { TextStyle, TypeFaceDefinition } from './text.model';
2
+ /**
3
+ * Converts a TextStyle (numeric, design-token oriented) into a
4
+ * TypeFaceDefinition (CSS-ready) so a theme's `typefaces` map can be
5
+ * derived from its `typography` block instead of being duplicated.
6
+ */
7
+ export declare const toTypeface: (style: TextStyle) => TypeFaceDefinition;
8
+ export declare const toTypefaces: (typography: Record<string, TextStyle>) => Record<string, TypeFaceDefinition>;
9
+ //# sourceMappingURL=typeface.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeface.helpers.d.ts","sourceRoot":"","sources":["../../../../src/concepts/typography/typeface.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAIlE;;;;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"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@uni-design-system/uni-core",
3
- "version": "3.0.2",
3
+ "version": "5.0.0",
4
+ "license": "MIT",
4
5
  "repository": {
5
6
  "type": "git",
6
7
  "url": "https://github.com/uni-design-system/uni",
@@ -30,11 +31,14 @@
30
31
  "typescript": "^5.0.0",
31
32
  "vite": "^8.0.13",
32
33
  "vite-plugin-dts": "^5.0.0",
33
- "@uni-design-system/tsconfig": "0.0.0"
34
+ "vitest": "^4.1.6",
35
+ "@uni-design-system/tsconfig": "0.1.0"
34
36
  },
35
37
  "scripts": {
36
38
  "build": "vite build",
37
39
  "dev": "vite build --watch",
40
+ "test": "vitest run",
41
+ "test:watch": "vitest",
38
42
  "type-check": "tsc --noEmit"
39
43
  }
40
44
  }
@@ -1,3 +0,0 @@
1
- import { UniTheme } from '../theme.model';
2
- export declare const SquareTheme: UniTheme;
3
- //# sourceMappingURL=square.theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"square.theme.d.ts","sourceRoot":"","sources":["../../../../../src/concepts/theme/themes/square.theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAY/C,eAAO,MAAM,WAAW,EAAE,QA+CzB,CAAC"}