react-native-terra-ui 0.10.2 → 0.11.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +8 -4
  3. package/lib/module/components/badge/Badge.js +174 -0
  4. package/lib/module/components/badge/Badge.js.map +1 -0
  5. package/lib/module/components/badge/index.js +4 -0
  6. package/lib/module/components/badge/index.js.map +1 -0
  7. package/lib/module/components/badge/parts/BadgeIndicator.js +191 -0
  8. package/lib/module/components/badge/parts/BadgeIndicator.js.map +1 -0
  9. package/lib/module/components/badge/types.js +4 -0
  10. package/lib/module/components/badge/types.js.map +1 -0
  11. package/lib/module/components/badge/utils.js +25 -0
  12. package/lib/module/components/badge/utils.js.map +1 -0
  13. package/lib/module/components/index.js +1 -0
  14. package/lib/module/components/index.js.map +1 -1
  15. package/lib/module/context/ThemeProvider.js +5 -5
  16. package/lib/module/context/ThemeProvider.js.map +1 -1
  17. package/lib/module/theme/define-config.js +5 -5
  18. package/lib/module/theme/define-config.js.map +1 -1
  19. package/lib/module/theme/errors.js +1 -1
  20. package/lib/module/theme/index.js +2 -2
  21. package/lib/module/theme/index.js.map +1 -1
  22. package/lib/module/theme/registry.js +15 -21
  23. package/lib/module/theme/registry.js.map +1 -1
  24. package/lib/module/theme/resolve-config.js +68 -68
  25. package/lib/module/theme/resolve-config.js.map +1 -1
  26. package/lib/module/theme/runtime.js +11 -11
  27. package/lib/module/theme/runtime.js.map +1 -1
  28. package/lib/module/theme/selection-store.js +7 -7
  29. package/lib/module/theme/selection-store.js.map +1 -1
  30. package/lib/module/theme/unistyles-adapter.js +1 -1
  31. package/lib/module/utils/accent-utils.js +24 -24
  32. package/lib/module/utils/accent-utils.js.map +1 -1
  33. package/lib/typescript/src/components/badge/Badge.d.ts +16 -0
  34. package/lib/typescript/src/components/badge/Badge.d.ts.map +1 -0
  35. package/lib/typescript/src/components/badge/index.d.ts +3 -0
  36. package/lib/typescript/src/components/badge/index.d.ts.map +1 -0
  37. package/lib/typescript/src/components/badge/parts/BadgeIndicator.d.ts +19 -0
  38. package/lib/typescript/src/components/badge/parts/BadgeIndicator.d.ts.map +1 -0
  39. package/lib/typescript/src/components/badge/types.d.ts +48 -0
  40. package/lib/typescript/src/components/badge/types.d.ts.map +1 -0
  41. package/lib/typescript/src/components/badge/utils.d.ts +13 -0
  42. package/lib/typescript/src/components/badge/utils.d.ts.map +1 -0
  43. package/lib/typescript/src/components/index.d.ts +1 -0
  44. package/lib/typescript/src/components/index.d.ts.map +1 -1
  45. package/lib/typescript/src/context/ThemeProvider.d.ts +7 -7
  46. package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
  47. package/lib/typescript/src/theme/define-config.d.ts +11 -8
  48. package/lib/typescript/src/theme/define-config.d.ts.map +1 -1
  49. package/lib/typescript/src/theme/errors.d.ts +1 -1
  50. package/lib/typescript/src/theme/index.d.ts +3 -3
  51. package/lib/typescript/src/theme/index.d.ts.map +1 -1
  52. package/lib/typescript/src/theme/registry.d.ts +5 -5
  53. package/lib/typescript/src/theme/registry.d.ts.map +1 -1
  54. package/lib/typescript/src/theme/resolve-config.d.ts +25 -25
  55. package/lib/typescript/src/theme/resolve-config.d.ts.map +1 -1
  56. package/lib/typescript/src/theme/runtime.d.ts +5 -5
  57. package/lib/typescript/src/theme/runtime.d.ts.map +1 -1
  58. package/lib/typescript/src/theme/selection-store.d.ts +5 -5
  59. package/lib/typescript/src/theme/selection-store.d.ts.map +1 -1
  60. package/lib/typescript/src/theme/types.d.ts +20 -47
  61. package/lib/typescript/src/theme/types.d.ts.map +1 -1
  62. package/lib/typescript/src/theme/unistyles-adapter.d.ts +1 -1
  63. package/lib/typescript/src/utils/accent-utils.d.ts +6 -7
  64. package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -1
  65. package/package.json +1 -1
  66. package/src/components/badge/Badge.tsx +111 -0
  67. package/src/components/badge/index.ts +2 -0
  68. package/src/components/badge/parts/BadgeIndicator.tsx +166 -0
  69. package/src/components/badge/types.ts +58 -0
  70. package/src/components/badge/utils.ts +24 -0
  71. package/src/components/index.ts +1 -0
  72. package/src/context/ThemeProvider.tsx +10 -10
  73. package/src/theme/define-config.ts +12 -7
  74. package/src/theme/errors.ts +1 -1
  75. package/src/theme/index.ts +6 -8
  76. package/src/theme/registry.ts +15 -23
  77. package/src/theme/resolve-config.ts +88 -95
  78. package/src/theme/runtime.ts +11 -11
  79. package/src/theme/selection-store.ts +9 -9
  80. package/src/theme/types.ts +21 -47
  81. package/src/theme/unistyles-adapter.ts +1 -1
  82. package/src/utils/accent-utils.ts +25 -25
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { normalizeTokenOverride } from "../theme/legacy-tokens.js";
4
- import { normalizeAccentScheme } from "../theme/resolve-config.js";
4
+ import { normalizeThemeScheme } from "../theme/resolve-config.js";
5
5
  import { defaultDarkTheme, defaultLightTheme } from "../theme/theme.js";
6
6
  import { ACCENT_SURFACE_ROLES, generateAccentColors } from "./accent-generator.js";
7
7
  /**
@@ -21,32 +21,33 @@ export function defaultAccentContext(scheme) {
21
21
  }
22
22
 
23
23
  /**
24
- * Generated accent colours for `seed` with `overrides` applied last. Within
25
- * the override patch canonical names beat their legacy aliases, while an
26
- * alias-only key still beats the generated canonical value.
24
+ * Generate a palette using the named theme's ordinary surface overrides. The
25
+ * rest of the patch passes through as authored, matching the unseeded branch —
26
+ * so `spacing.base` / `radius.base` stay pseudo-tokens here; only
27
+ * `applyThemeLayer` expands them into a scale.
27
28
  */
28
- function seedToColorPatch(seed, overrides, scheme) {
29
- const generated = generateAccentColors(seed, defaultAccentContext(scheme)).colors;
30
- const color = {
31
- ...generated
32
- };
33
- const normalized = normalizeTokenOverride({
34
- color: overrides
35
- })?.color;
36
- if (normalized) {
37
- for (const [key, value] of Object.entries(normalized)) {
38
- if (value !== undefined) color[key] = value;
39
- }
29
+ function seedToColorPatch(seed, patch, scheme) {
30
+ const normalized = normalizeTokenOverride(patch);
31
+ const context = defaultAccentContext(scheme);
32
+ for (const role of ACCENT_SURFACE_ROLES) {
33
+ const value = normalized?.color?.[role];
34
+ if (value !== undefined) context.surfaces[role] = value;
40
35
  }
36
+ context.pressedOpacity = normalized?.opacity?.pressed ?? context.pressedOpacity;
37
+ const generated = generateAccentColors(seed, context).colors;
41
38
  return {
42
- color
39
+ ...normalized,
40
+ color: {
41
+ ...generated,
42
+ ...normalized?.color
43
+ }
43
44
  };
44
45
  }
45
46
  function normalizeSchemeInput(input, scheme) {
46
- const normalized = normalizeAccentScheme(input, `accents.<accent>.${scheme}`);
47
+ const normalized = normalizeThemeScheme(input, `themes.<name>.${scheme}`);
47
48
  if (normalized.kind === "none") return {};
48
49
  if (normalized.kind === "seed") {
49
- return seedToColorPatch(normalized.seed, normalized.overrides, scheme);
50
+ return seedToColorPatch(normalized.seed, normalized.patch, scheme);
50
51
  }
51
52
  // Preserve the compatibility helper's identity contract for full patches;
52
53
  // the resolver itself uses the sanitized copy in `normalized.patch`.
@@ -54,11 +55,10 @@ function normalizeSchemeInput(input, scheme) {
54
55
  }
55
56
 
56
57
  /**
57
- * Compatibility wrapper: normalizes any accent input into per-scheme
58
- * partial-theme overrides. Strings and `{ seed, overrides }` are generated
59
- * against the DEFAULT themes' surfaces and pressed opacity (the resolver
60
- * pipeline uses the actual resolved surfaces instead); full theme patches
61
- * pass through unchanged. Pure and independent of the registry.
58
+ * @deprecated Prefer createTerraThemes for complete theme resolution.
59
+ * Generates per-scheme patches without shared config. Explicit unseeded patches
60
+ * pass through unchanged; seeded entries generate against their own surface and
61
+ * color tokens and carry the remainder of the patch through unresolved.
62
62
  */
63
63
  export function normalizeAccent(accent) {
64
64
  return {
@@ -1 +1 @@
1
- {"version":3,"names":["normalizeTokenOverride","normalizeAccentScheme","defaultDarkTheme","defaultLightTheme","ACCENT_SURFACE_ROLES","generateAccentColors","defaultAccentContext","scheme","theme","surfaces","role","color","pressedOpacity","opacity","pressed","seedToColorPatch","seed","overrides","generated","colors","normalized","key","value","Object","entries","undefined","normalizeSchemeInput","input","kind","normalizeAccent","accent","light","dark"],"sourceRoot":"../../../src","sources":["utils/accent-utils.ts"],"mappings":";;AAAA,SAASA,sBAAsB;AAC/B,SAASC,qBAAqB;AAC9B,SAASC,gBAAgB,EAAEC,iBAAiB;AAS5C,SACEC,oBAAoB,EAGpBC,oBAAoB;AAItB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,MAAc,EAA2B;EAC5E,MAAMC,KAAK,GAAGD,MAAM,KAAK,OAAO,GAAGJ,iBAAiB,GAAGD,gBAAgB;EACvE,MAAMO,QAAQ,GAAG,CAAC,CAAsC;EACxD,KAAK,MAAMC,IAAI,IAAIN,oBAAoB,EAAEK,QAAQ,CAACC,IAAI,CAAC,GAAGF,KAAK,CAACG,KAAK,CAACD,IAAI,CAAC;EAC3E,OAAO;IAAEH,MAAM;IAAEE,QAAQ;IAAEG,cAAc,EAAEJ,KAAK,CAACK,OAAO,CAACC;EAAQ,CAAC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACvBC,IAAY,EACZC,SAA0C,EAC1CV,MAAc,EACW;EACzB,MAAMW,SAAS,GAAGb,oBAAoB,CAACW,IAAI,EAAEV,oBAAoB,CAACC,MAAM,CAAC,CAAC,CAACY,MAAM;EACjF,MAAMR,KAA6B,GAAG;IAAE,GAAGO;EAAU,CAAC;EACtD,MAAME,UAAU,GAAGpB,sBAAsB,CAAC;IAAEW,KAAK,EAAEM;EAAU,CAAC,CAAC,EAAEN,KAAK;EACtE,IAAIS,UAAU,EAAE;IACd,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACJ,UAAU,CAAC,EAAE;MACrD,IAAIE,KAAK,KAAKG,SAAS,EAAEd,KAAK,CAACU,GAAG,CAAC,GAAGC,KAAe;IACvD;EACF;EACA,OAAO;IAAEX;EAAM,CAAC;AAClB;AAEA,SAASe,oBAAoBA,CAACC,KAAoC,EAAEpB,MAAc,EAA2B;EAC3G,MAAMa,UAAU,GAAGnB,qBAAqB,CAAC0B,KAAK,EAAE,oBAAoBpB,MAAM,EAAE,CAAC;EAC7E,IAAIa,UAAU,CAACQ,IAAI,KAAK,MAAM,EAAE,OAAO,CAAC,CAAC;EACzC,IAAIR,UAAU,CAACQ,IAAI,KAAK,MAAM,EAAE;IAC9B,OAAOb,gBAAgB,CAACK,UAAU,CAACJ,IAAI,EAAEI,UAAU,CAACH,SAAS,EAAEV,MAAM,CAAC;EACxE;EACA;EACA;EACA,OAAOoB,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,eAAeA,CAACC,MAAc,EAAoB;EAChE,OAAO;IACLC,KAAK,EAAEL,oBAAoB,CAACI,MAAM,CAACC,KAAK,EAAE,OAAO,CAAC;IAClDC,IAAI,EAAEN,oBAAoB,CAACI,MAAM,CAACE,IAAI,EAAE,MAAM;EAChD,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["normalizeTokenOverride","normalizeThemeScheme","defaultDarkTheme","defaultLightTheme","ACCENT_SURFACE_ROLES","generateAccentColors","defaultAccentContext","scheme","theme","surfaces","role","color","pressedOpacity","opacity","pressed","seedToColorPatch","seed","patch","normalized","context","value","undefined","generated","colors","normalizeSchemeInput","input","kind","normalizeAccent","accent","light","dark"],"sourceRoot":"../../../src","sources":["utils/accent-utils.ts"],"mappings":";;AAAA,SAASA,sBAAsB;AAC/B,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB,EAAEC,iBAAiB;AAS5C,SACEC,oBAAoB,EAGpBC,oBAAoB;AAItB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,MAAc,EAA2B;EAC5E,MAAMC,KAAK,GAAGD,MAAM,KAAK,OAAO,GAAGJ,iBAAiB,GAAGD,gBAAgB;EACvE,MAAMO,QAAQ,GAAG,CAAC,CAAsC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AAI,EAAEE,UAAU,CAACD,KAAK,EAAEV,MAAM,CAAC;EACpE;EACA;EACA;EACA,OAAOkB,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,eAAeA,CAACC,MAAkB,EAAoB;EACpE,OAAO;IACLC,KAAK,EAAEL,oBAAoB,CAACI,MAAM,CAACC,KAAK,EAAE,OAAO,CAAC;IAClDC,IAAI,EAAEN,oBAAoB,CAACI,MAAM,CAACE,IAAI,EAAE,MAAM;EAChD,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ import type { BadgeProps } from "./types.js";
2
+ /**
3
+ * Overlays a count or status indicator on one corner of the element it wraps.
4
+ *
5
+ * ```tsx
6
+ * <Badge placement="top-right" color="danger" label={3}>
7
+ * <Toolbar.Button icon="bell" accessibilityLabel="Notifications" />
8
+ * </Badge>
9
+ * ```
10
+ *
11
+ * The child renders untouched — `Badge` contributes the positioning context and
12
+ * the overlay, nothing else.
13
+ */
14
+ declare const Badge: import("react").ForwardRefExoticComponent<BadgeProps & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
15
+ export { Badge };
16
+ //# sourceMappingURL=Badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../../src/components/badge/Badge.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,KAAK,wLA4BT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Badge } from "./Badge.js";
2
+ export type { BadgeColor, BadgePlacement, BadgeProps, BadgeSize } from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { BadgeColor, BadgeSize } from "../types.js";
2
+ export interface BadgeIndicatorProps {
3
+ label?: string | number;
4
+ color: BadgeColor;
5
+ size: BadgeSize;
6
+ accessibilityLabel?: string;
7
+ }
8
+ /**
9
+ * The overlay itself: a dot, or a pill carrying the label. Owns the paint, the
10
+ * legibility ring, and the accessibility node — the wrapper owns only position.
11
+ *
12
+ * `useUnistyles` is called unconditionally, which is what subscribes this
13
+ * component to theme changes. The background below comes from a variant, which
14
+ * unistyles applies straight to the native node on a theme switch; without a
15
+ * re-render React would go on believing the node holds the previous theme's
16
+ * value. `Chip` documents the same hazard on its root.
17
+ */
18
+ export declare const BadgeIndicator: ({ label, color, size, accessibilityLabel }: BadgeIndicatorProps) => import("react").JSX.Element;
19
+ //# sourceMappingURL=BadgeIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BadgeIndicator.d.ts","sourceRoot":"","sources":["../../../../../../src/components/badge/parts/BadgeIndicator.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAU,CAAC;AAqBtD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAI,4CAA4C,mBAAmB,gCA0C7F,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { ReactNode } from "react";
2
+ import type { ViewProps } from "react-native";
3
+ /** Corner of the wrapped child the indicator is anchored to. */
4
+ export type BadgePlacement = "top-right" | "top-left" | "bottom-right" | "bottom-left";
5
+ /** Scale of the dot, pill, and label. */
6
+ export type BadgeSize = "sm" | "md";
7
+ /**
8
+ * Semantic color scheme, or a raw CSS color literal (`#fff`, `rgb(...)`, `hsl(...)`).
9
+ * A literal paints the indicator with that exact value and derives a readable
10
+ * foreground for the label.
11
+ */
12
+ export type BadgeColor = "primary" | "secondary" | "success" | "warning" | "danger" | (string & {});
13
+ export interface BadgeProps extends ViewProps {
14
+ /** The element being badged. Rendered untouched; `Badge` only adds the overlay. */
15
+ children: ReactNode;
16
+ /**
17
+ * Corner the indicator sits on. Defaults to `'top-right'`.
18
+ *
19
+ * The indicator overhangs the child, so an ancestor that clips — a `Surface`
20
+ * with a radius, or a `Screen` list row — will cut it off. Pad that container
21
+ * by the overhang, or lift the `Badge` outside it.
22
+ */
23
+ placement?: BadgePlacement;
24
+ /**
25
+ * Text in the indicator. Omit it (or pass an empty string) for a dot.
26
+ * `0` renders as a label — use `isVisible` to suppress a zero count.
27
+ */
28
+ label?: string | number;
29
+ /** Semantic scheme or raw color literal. Defaults to `'danger'`. */
30
+ color?: BadgeColor;
31
+ /** Scale of the indicator. Defaults to `'md'`. */
32
+ size?: BadgeSize;
33
+ /** Renders the indicator. The child renders either way. Defaults to `true`. */
34
+ isVisible?: boolean;
35
+ /**
36
+ * Stretches the wrapper along its parent's cross axis, so a child that
37
+ * stretches unwrapped keeps stretching. Defaults to `false`, which hugs the
38
+ * child — what an icon, avatar, or toolbar button needs. An explicit
39
+ * `alignSelf` in `style` beats both.
40
+ */
41
+ fullWidth?: boolean;
42
+ /**
43
+ * Announced in place of the label. Defaults to the label's own text; an
44
+ * unlabelled dot is hidden from assistive technology.
45
+ */
46
+ accessibilityLabel?: string;
47
+ }
48
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/badge/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,gEAAgE;AAChE,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,CAAC;AAEvF,yCAAyC;AACzC,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpC;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,GAER,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,mFAAmF;IACnF,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,oEAAoE;IACpE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,kDAAkD;IAClD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
@@ -0,0 +1,13 @@
1
+ export interface CustomBadgeColors {
2
+ bg: string;
3
+ fg: string;
4
+ }
5
+ /** The indicator's paint for a raw literal: the literal itself, plus a readable label. */
6
+ export declare function getCustomBadgeColors(literal: string): CustomBadgeColors;
7
+ /**
8
+ * `true` when `label` should render as a pill. An empty string and `undefined`
9
+ * are a dot; `0` is a label, since a caller suppressing a zero count uses
10
+ * `isVisible` rather than relying on falsiness.
11
+ */
12
+ export declare function hasLabel(label: string | number | undefined): label is string | number;
13
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/badge/utils.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,IAAI,MAAM,GAAG,MAAM,CAErF"}
@@ -1,4 +1,5 @@
1
1
  export * from "./avatar/index.js";
2
+ export * from "./badge/index.js";
2
3
  export * from "./box/index.js";
3
4
  export * from "./button/index.js";
4
5
  export * from "./chip/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAU,CAAC;AACzB,cAAc,gBAAO,CAAC;AACtB,cAAc,mBAAU,CAAC;AACzB,cAAc,iBAAQ,CAAC;AACvB,cAAc,oBAAW,CAAC;AAC1B,cAAc,wBAAe,CAAC;AAC9B,cAAc,mBAAU,CAAC;AACzB,cAAc,iBAAQ,CAAC;AACvB,cAAc,kBAAS,CAAC;AACxB,cAAc,2BAAkB,CAAC;AACjC,cAAc,mBAAU,CAAC;AACzB,cAAc,sBAAa,CAAC;AAC5B,cAAc,mBAAU,CAAC;AACzB,cAAc,iBAAQ,CAAC;AACvB,cAAc,oBAAW,CAAC;AAC1B,cAAc,oBAAW,CAAC;AAC1B,cAAc,iBAAQ,CAAC;AACvB,cAAc,kBAAS,CAAC;AACxB,cAAc,oBAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAU,CAAC;AACzB,cAAc,kBAAS,CAAC;AACxB,cAAc,gBAAO,CAAC;AACtB,cAAc,mBAAU,CAAC;AACzB,cAAc,iBAAQ,CAAC;AACvB,cAAc,oBAAW,CAAC;AAC1B,cAAc,wBAAe,CAAC;AAC9B,cAAc,mBAAU,CAAC;AACzB,cAAc,iBAAQ,CAAC;AACvB,cAAc,kBAAS,CAAC;AACxB,cAAc,2BAAkB,CAAC;AACjC,cAAc,mBAAU,CAAC;AACzB,cAAc,sBAAa,CAAC;AAC5B,cAAc,mBAAU,CAAC;AACzB,cAAc,iBAAQ,CAAC;AACvB,cAAc,oBAAW,CAAC;AAC1B,cAAc,oBAAW,CAAC;AAC1B,cAAc,iBAAQ,CAAC;AACvB,cAAc,kBAAS,CAAC;AACxB,cAAc,oBAAW,CAAC"}
@@ -20,13 +20,13 @@ export interface UseThemeResult {
20
20
  scheme: Scheme;
21
21
  /** Pin a scheme (stops following the system). Same as `setMode(scheme)`. */
22
22
  setScheme: (scheme: Scheme) => void;
23
- /** Applied accent name, or `undefined` for the base themes. */
24
- accent: string | undefined;
23
+ /** Applied theme name, or `undefined` for the base themes. */
24
+ themeName: string | undefined;
25
25
  /**
26
- * Apply a registered accent; `null` restores the base themes. An unknown
27
- * name warns in development and leaves the accent unchanged.
26
+ * Apply a registered theme; `null` restores the base themes. An unknown
27
+ * name warns in development and leaves the theme unchanged.
28
28
  */
29
- setAccent: (name: string | null) => void;
29
+ setTheme: (name: string | null) => void;
30
30
  /**
31
31
  * How the active scheme is chosen: `system` follows the OS appearance,
32
32
  * `light` / `dark` pin a scheme. A system appearance change updates
@@ -37,8 +37,8 @@ export interface UseThemeResult {
37
37
  setMode: (mode: ThemeMode) => void;
38
38
  }
39
39
  /**
40
- * Access the active theme and switch scheme / mode / accent. Selection state
41
- * comes from the runtime store, so changes made imperatively (`applyAccent`,
40
+ * Access the active theme and switch scheme / mode / theme. Selection state
41
+ * comes from the runtime store, so changes made imperatively (`setTheme`,
42
42
  * `setThemeMode`) and through this hook are observed by every consumer.
43
43
  */
44
44
  export declare function useTheme(): UseThemeResult;
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,OAAO,CAAC;AAarE,OAAO,EAAE,KAAK,qBAAqB,EAAwB,MAAM,4BAAyB,CAAC;AAC3F,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAgB,CAAC;AAOpE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,iBAAiB,gCAE9D,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,KAAK,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,+DAA+D;IAC/D,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;OAGG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC;;;;OAIG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,+EAA+E;IAC/E,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,cAAc,CAazC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAGxD;AAED,wCAAwC;AACxC,eAAO,MAAM,eAAe,yBAAmB,CAAC"}
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,OAAO,CAAC;AAarE,OAAO,EAAE,KAAK,qBAAqB,EAAwB,MAAM,4BAAyB,CAAC;AAC3F,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAgB,CAAC;AAOpE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,iBAAiB,gCAE9D,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,KAAK,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,8DAA8D;IAC9D,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B;;;OAGG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,+EAA+E;IAC/E,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,cAAc,CAazC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAGxD;AAED,wCAAwC;AACxC,eAAO,MAAM,eAAe,yBAAmB,CAAC"}
@@ -1,23 +1,26 @@
1
1
  import type { TerraConfig } from "./types.js";
2
- /** The literal accent names declared in `T.accents`, or `never` when none are declared. */
3
- type DeclaredAccentNames<T> = T extends {
4
- accents: infer A;
2
+ /** The literal theme names declared in `T.themes`, or `never` when none are declared. */
3
+ type DeclaredThemeNames<T> = T extends {
4
+ themes: infer A;
5
5
  } ? A extends Record<string, unknown> ? keyof A & string : never : never;
6
6
  /**
7
7
  * Identity helper for authoring a {@link TerraConfig} with contextual typing.
8
- * Has no side effects. With literal `accents`, `defaultAccent` must name one of
9
- * them; a dynamic `Record<string, Accent>` keeps `defaultAccent` as `string`
8
+ * Has no side effects. With literal `themes`, `defaultTheme` must name one of
9
+ * them; a dynamic `Record<string, NamedTheme>` keeps `defaultTheme` as `string`
10
10
  * and defers to runtime validation.
11
11
  *
12
12
  * @example
13
13
  * const config = defineTerraConfig({
14
- * accents: { indigo: { light: "#4f46e5", dark: "#818cf8" } },
15
- * defaultAccent: "indigo",
14
+ * themes: { indigo: { light: "#4f46e5", dark: "#818cf8" } },
15
+ * defaultTheme: "indigo",
16
16
  * });
17
17
  * configureTerraUI(config);
18
18
  */
19
19
  export declare function defineTerraConfig<const T extends TerraConfig>(config: T & {
20
- defaultAccent?: DeclaredAccentNames<T>;
20
+ defaultTheme?: DeclaredThemeNames<T>;
21
+ schemes?: never;
22
+ accents?: never;
23
+ defaultAccent?: never;
21
24
  }): T;
22
25
  export {};
23
26
  //# sourceMappingURL=define-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../../src/theme/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAS,CAAC;AAE3C,2FAA2F;AAC3F,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,CAAC,CAAA;CAAE,GACxD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,MAAM,CAAC,GAAG,MAAM,GAChB,KAAK,GACP,KAAK,CAAC;AAEV;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,EAC3D,MAAM,EAAE,CAAC,GAAG;IAAE,aAAa,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;CAAE,GACrD,CAAC,CAEH"}
1
+ {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../../src/theme/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAS,CAAC;AAE3C,yFAAyF;AACzF,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACtD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,MAAM,CAAC,GAAG,MAAM,GAChB,KAAK,GACP,KAAK,CAAC;AAEV;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,EAC3D,MAAM,EAAE,CAAC,GAAG;IACV,YAAY,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GACA,CAAC,CAEH"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Thrown for invalid pure configuration input — before any registry, selection,
3
3
  * or native state is touched. `path` points at the offending config entry, e.g.
4
- * `accents.indigo.dark.seed` or `defaultAccent`.
4
+ * `themes.indigo.dark.seed` or `defaultTheme`.
5
5
  */
6
6
  export declare class TerraConfigError extends Error {
7
7
  readonly path: string;
@@ -10,14 +10,14 @@ export type { AppBreakpoints, BreakpointName } from "./breakpoints.js";
10
10
  export { breakpoints, resolveBreakpointValue } from "./breakpoints.js";
11
11
  export { defineTerraConfig } from "./define-config.js";
12
12
  export { TerraConfigError } from "./errors.js";
13
- export { configureTerraUI, getAccentNames, getDefaultRadius, getIcon, getImageComponent, getIsConfigured, getRequiredIcon, getSurfaceElevation, resolveTheme, } from "./registry.js";
13
+ export { configureTerraUI, getDefaultRadius, getIcon, getImageComponent, getIsConfigured, getRequiredIcon, getSurfaceElevation, getThemeNames, resolveTheme, } from "./registry.js";
14
14
  export { createTerraThemes } from "./resolve-config.js";
15
15
  export type { ThemeSelection } from "./runtime.js";
16
- export { applyAccent, applyScheme, getCurrentAccent, getThemeMode, getThemeSelection, setThemeMode, } from "./runtime.js";
16
+ export { applyScheme, getCurrentTheme, getThemeMode, getThemeSelection, setTheme, setThemeMode, } from "./runtime.js";
17
17
  export type { ResolvedScreenMargin } from "./screen-margin.js";
18
18
  export { resolveScreenMargin } from "./screen-margin.js";
19
19
  export type { ResolvedScreenPadding } from "./screen-padding.js";
20
20
  export { resolveScreenPadding } from "./screen-padding.js";
21
21
  export { defaultDarkTheme, defaultLightTheme } from "./theme.js";
22
- export type { Accent, AccentColorToken, AccentOverride, AccentSchemeInput, AccentSeed, AccentShorthand, ActionColorToken, BackgroundColorToken, BorderColorToken, ButtonDefaults, CanonicalThemeColor, ColorToken, ComponentDefaults, ContentColorToken, CreateTerraThemesOptions, DefaultRadiusToken, ElevationKey, ElevationScale, ElevationStyle, FontWeightToken, LayoutTokens, NeutralColorToken, OpacityTokens, RadiusComponent, RadiusKey, Scheme, ScreenPaddingTokens, SpacingKey, StatusColorToken, SurfaceColorToken, SurfaceDefaults, TerraColorRegistry, TerraColorRegistryCollision, TerraConfig, TerraCustomColorName, TerraIconComponent, TerraIconName, TerraIconProps, TerraImageComponent, TerraImageContentFit, TerraImageProps, TerraSemanticIconName, TerraTheme, TerraThemeInput, TerraThemeOverride, TextColorToken, TextVariant, ThemeColor, ThemeMode, ThemeRadiusOverride, ThemeSpacingOverride, TypeStyle, Typography, } from "./types.js";
22
+ export type { AccentColorToken, ActionColorToken, BackgroundColorToken, BorderColorToken, ButtonDefaults, CanonicalThemeColor, ColorToken, ComponentDefaults, ContentColorToken, CreateTerraThemesOptions, DefaultRadiusToken, ElevationKey, ElevationScale, ElevationStyle, FontWeightToken, LayoutTokens, NamedTheme, NeutralColorToken, OpacityTokens, RadiusComponent, RadiusKey, Scheme, ScreenPaddingTokens, SpacingKey, StatusColorToken, SurfaceColorToken, SurfaceDefaults, TerraColorRegistry, TerraColorRegistryCollision, TerraConfig, TerraCustomColorName, TerraIconComponent, TerraIconName, TerraIconProps, TerraImageComponent, TerraImageContentFit, TerraImageProps, TerraSemanticIconName, TerraTheme, TerraThemeInput, TerraThemeOverride, TextColorToken, TextVariant, ThemeColor, ThemeMode, ThemeRadiusOverride, ThemeSchemeInput, ThemeSeed, ThemeSpacingOverride, TypeStyle, Typography, } from "./types.js";
23
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAQA,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEnE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAe,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,kBAAe,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAU,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,YAAY,GACb,MAAM,eAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAkB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,MAAM,cAAW,CAAC;AAChD,OAAO,EACL,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAW,CAAC;AACnB,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAiB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAiB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAkB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAkB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AAE9D,YAAY,EACV,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,SAAS,EACT,MAAM,EACN,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,2BAA2B,EAC3B,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,UAAU,GACX,MAAM,YAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAQA,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACj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AO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AAE9D,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,SAAS,EACT,MAAM,EACN,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,2BAA2B,EAC3B,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,UAAU,GACX,MAAM,YAAS,CAAC"}
@@ -6,8 +6,8 @@ declare module "react-native-unistyles" {
6
6
  }
7
7
  }
8
8
  export declare const getIsConfigured: () => boolean;
9
- /** Names of the registered accents, in declaration order. Returns a fresh array. */
10
- export declare const getAccentNames: () => string[];
9
+ /** Names of the registered themes, in declaration order. Returns a fresh array. */
10
+ export declare const getThemeNames: () => string[];
11
11
  export declare const getImageComponent: () => TerraImageComponent;
12
12
  export declare const getIcon: (name: string) => TerraIconComponent | undefined;
13
13
  export declare const getRequiredIcon: (name: TerraSemanticIconName) => TerraIconComponent;
@@ -23,12 +23,12 @@ export declare const getDefaultRadius: (component: RadiusComponent) => DefaultRa
23
23
  export declare const getSurfaceElevation: () => ElevationKey;
24
24
  /**
25
25
  * Resolves one scheme's theme from the installed configuration with the named
26
- * accent overlaid. Omitting `accentName` selects the base theme (no accent
27
- * not the configured `defaultAccent`). An unknown name warns in development
26
+ * theme selected. Omitting `name` selects the base theme (defaults + shared
27
+ * not the configured `defaultTheme`). An unknown name warns in development
28
28
  * and falls back to the base theme. Pure with respect to runtime state: it
29
29
  * never changes the applied selection.
30
30
  */
31
- export declare function resolveTheme(scheme: Scheme, accentName?: string): TerraTheme;
31
+ export declare function resolveTheme(scheme: Scheme, name?: string): TerraTheme;
32
32
  /**
33
33
  * Configure Terra UI's themes. Call ONCE, as early as possible — before any
34
34
  * component renders (e.g. top of the app entry, imported from
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/theme/registry.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAEV,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,MAAM,EACN,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,UAAU,EAGX,MAAM,YAAS,CAAC;AAmBjB,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAiB,eAAe;QAC9B,KAAK,EAAE,UAAU,CAAC;QAClB,IAAI,EAAE,UAAU,CAAC;KAClB;CACF;AA8BD,eAAO,MAAM,eAAe,QAAO,OAA0C,CAAC;AAE9E,oFAAoF;AACpF,eAAO,MAAM,cAAc,QAAO,MAAM,EAA2C,CAAC;AAEpF,eAAO,MAAM,iBAAiB,QAAO,mBAA8C,CAAC;AAEpF,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,KAAG,kBAAkB,GAAG,SACS,CAAC;AAEtE,eAAO,MAAM,eAAe,GAAI,MAAM,qBAAqB,KAAG,kBAClB,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,WAAW,eAAe,KAAG,kBAC3B,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,YAAyC,CAAC;AAEjF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAA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,IAAI,CAMvC"}
@@ -1,19 +1,19 @@
1
1
  /**
2
2
  * Pure theme resolution — normalization, layer processing, derived values and
3
- * theme creation. Shared by startup configuration, runtime accent changes and
3
+ * theme creation. Shared by startup configuration, runtime theme changes and
4
4
  * previews so every consumer sees the same colors for the same input.
5
5
  *
6
6
  * Precedence, identical for both schemes:
7
7
  *
8
- * default tokens → shared → schemes[scheme]
9
- * generated selected accent selected accent explicit overrides
8
+ * default tokens → shared → generated accent → selected theme tokens
9
+ * Generation uses the selected theme's resolved surfaces and pressed opacity.
10
10
  *
11
11
  * This module must stay free of registry, provider, Unistyles and renderer
12
12
  * imports so `createTerraThemes` works without any native configuration.
13
13
  */
14
14
  import { type ContrastDiagnostic } from "../utils/accent-generator";
15
15
  import { type ThemeSource } from "./theme.js";
16
- import type { AccentSchemeInput, CreateTerraThemesOptions, ElevationKey, Scheme, TerraTheme, TerraThemeInput, TerraThemeOverride, ThemeColor } from "./types.js";
16
+ import type { CreateTerraThemesOptions, ElevationKey, Scheme, TerraTheme, TerraThemeInput, TerraThemeOverride, ThemeSchemeInput } from "./types.js";
17
17
  /**
18
18
  * A theme mid-resolution: its source form plus provenance for every elevation
19
19
  * level whose `shadowColor` a layer pinned explicitly. Default shadow colors are
@@ -25,8 +25,8 @@ export interface ThemeLayerState {
25
25
  }
26
26
  /**
27
27
  * Applies one override layer onto `state` and returns the next state. Every
28
- * layer — shared, scheme, generated accent, accent overrides, or a full accent
29
- * patch — goes through here, so they all follow the same rules:
28
+ * layer — shared, generated accent, or selected theme tokens goes through
29
+ * here, so they all follow the same rules:
30
30
  * - deprecated names are normalized within the layer (canonical wins);
31
31
  * - `undefined`/`null` leaves are no override; arrays replace; objects merge;
32
32
  * - `spacing.base` / `radius.base` regenerate their scale, then that layer's
@@ -36,37 +36,37 @@ export interface ThemeLayerState {
36
36
  * Inputs are never mutated.
37
37
  */
38
38
  export declare function applyThemeLayer(state: ThemeLayerState, override?: TerraThemeOverride): ThemeLayerState;
39
- export type NormalizedAccentScheme = {
39
+ export type NormalizedThemeScheme = {
40
40
  readonly kind: "none";
41
41
  } | {
42
42
  readonly kind: "seed";
43
43
  readonly seed: string;
44
- readonly overrides?: Partial<ThemeColor>;
44
+ readonly patch?: TerraThemeOverride;
45
45
  } | {
46
46
  readonly kind: "patch";
47
47
  readonly patch: TerraThemeOverride;
48
48
  };
49
- interface NormalizedAccentEntry {
50
- readonly light: NormalizedAccentScheme;
51
- readonly dark: NormalizedAccentScheme;
49
+ interface NormalizedThemeEntry {
50
+ readonly light: NormalizedThemeScheme;
51
+ readonly dark: NormalizedThemeScheme;
52
52
  }
53
53
  /**
54
54
  * A validated, immutable theme configuration. `base` is the fully layered
55
- * `defaults → shared → scheme` state per scheme; every accent selection is
56
- * re-resolved from it rather than from a previously resolved accent.
55
+ * `defaults → shared` state per scheme; every theme selection is
56
+ * re-resolved from it rather than from a previously resolved theme.
57
57
  */
58
58
  export interface NormalizedThemeConfig {
59
- readonly accentNames: readonly string[];
60
- readonly defaultAccent: string | null;
61
- /** @internal Immutable `defaults → shared → scheme` state per scheme. */
59
+ readonly themeNames: readonly string[];
60
+ readonly defaultTheme: string | null;
61
+ /** @internal Immutable `defaults → shared` state per scheme. */
62
62
  readonly base: Readonly<Record<Scheme, ThemeLayerState>>;
63
- /** @internal Per-accent, per-scheme normalized inputs. */
64
- readonly accents: Readonly<Record<string, NormalizedAccentEntry>>;
63
+ /** @internal Per-theme, per-scheme normalized inputs. */
64
+ readonly themes: Readonly<Record<string, NormalizedThemeEntry>>;
65
65
  }
66
- export declare function normalizeAccentScheme(input: AccentSchemeInput | undefined, path: string): NormalizedAccentScheme;
66
+ export declare function normalizeThemeScheme(input: ThemeSchemeInput | undefined, path: string): NormalizedThemeScheme;
67
67
  /**
68
68
  * Validates a theme input and pre-computes the immutable per-scheme base
69
- * (`defaults → shared → scheme`). Throws {@link TerraConfigError} for invalid
69
+ * (`defaults → shared`). Throws {@link TerraConfigError} for invalid
70
70
  * input — before any state exists to mutate. Never mutates `input` or the
71
71
  * exported defaults.
72
72
  */
@@ -77,20 +77,20 @@ export interface ResolvedThemes {
77
77
  diagnostics: ContrastDiagnostic[];
78
78
  }
79
79
  /**
80
- * Resolves both schemes for `accent` from the config's immutable base. `null`
80
+ * Resolves both schemes for `themeName` from the config's immutable base. `null`
81
81
  * selects the base themes; an unknown name throws {@link TerraConfigError}.
82
82
  * Returned themes are freshly built and independently owned.
83
83
  */
84
- export declare function resolveThemes(config: NormalizedThemeConfig, accent: string | null): ResolvedThemes;
84
+ export declare function resolveThemes(config: NormalizedThemeConfig, themeName: string | null): ResolvedThemes;
85
85
  /** Resolves one scheme without generating and finalizing the other. */
86
- export declare function resolveThemeScheme(config: NormalizedThemeConfig, scheme: Scheme, accent: string | null): {
86
+ export declare function resolveThemeScheme(config: NormalizedThemeConfig, scheme: Scheme, themeName: string | null): {
87
87
  theme: TerraTheme;
88
88
  diagnostics: ContrastDiagnostic[];
89
89
  };
90
90
  /**
91
91
  * Pure theme creation — no Unistyles configuration or registry involved.
92
- * `options.accent` omitted → the input's `defaultAccent`; `null` → the base
93
- * themes. Invalid input and unknown accents throw {@link TerraConfigError}.
92
+ * `options.theme` omitted → the input's `defaultTheme`; `null` → the base
93
+ * themes. Invalid input and unknown themes throw {@link TerraConfigError}.
94
94
  * In development, contrast diagnostics are reported once each via
95
95
  * `console.warn`; requested colors are never altered.
96
96
  */
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-config.d.ts","sourceRoot":"","sources":["../../../../src/theme/resolve-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAGL,KAAK,kBAAkB,EAMxB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,YAAS,CAAC;AACjB,OAAO,KAAK,EAEV,iBAAiB,EACjB,wBAAwB,EACxB,YAAY,EACZ,MAAM,EACN,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,UAAU,EACX,MAAM,YAAS,C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qB,CA0CtF;AAID,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnC,yFAAyF;IACzF,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC;AA8DD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,CAYrG;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAG1D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAQ5B"}
@@ -2,16 +2,16 @@ import type { Scheme, ThemeMode } from "./types.js";
2
2
  export type { ThemeSelection } from "./selection-store.js";
3
3
  export { getThemeSelection, subscribeThemeSelection } from "./selection-store.js";
4
4
  /**
5
- * Apply a registered accent (`null` restores the base themes) by updating both
5
+ * Apply a registered theme (`null` restores the base themes) by updating both
6
6
  * registered themes. An unknown name warns in development and changes nothing.
7
7
  *
8
8
  * If the native update fails part-way (see `updateThemes` in the adapter), the
9
9
  * error propagates and the previous selection stays published; calling
10
- * `applyAccent(getCurrentAccent() ?? null)` rewrites both themes.
10
+ * `setTheme(getCurrentTheme() ?? null)` rewrites both themes.
11
11
  */
12
- export declare function applyAccent(name: string | null): void;
13
- /** The applied accent name, or `undefined` for the base themes. */
14
- export declare const getCurrentAccent: () => string | undefined;
12
+ export declare function setTheme(name: string | null): void;
13
+ /** The applied theme name, or `undefined` for the base themes. */
14
+ export declare const getCurrentTheme: () => string | undefined;
15
15
  /**
16
16
  * Choose how the active scheme is selected: `system` follows the OS appearance;
17
17
  * `light` / `dark` pin a scheme until the next call.
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/theme/runtime.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAGjD,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAmB,CAAC;AAE/E;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAarD;AAED,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,QAAO,MAAM,GAAG,SAAuC,CAAC;AAErF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAGlD;AAED,6EAA6E;AAC7E,eAAO,MAAM,YAAY,QAAO,SAAqC,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEhD"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/theme/runtime.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAGjD,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAmB,CAAC;AAE/E;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAalD;AAED,kEAAkE;AAClE,eAAO,MAAM,eAAe,QAAO,MAAM,GAAG,SAA0C,CAAC;AAEvF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAGlD;AAED,6EAA6E;AAC7E,eAAO,MAAM,YAAY,QAAO,SAAqC,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEhD"}
@@ -4,9 +4,9 @@
4
4
  * those has to import the other.
5
5
  *
6
6
  * Holds two things, both private to `theme/`:
7
- * - the installed {@link NormalizedThemeConfig} — immutable; every accent
7
+ * - the installed {@link NormalizedThemeConfig} — immutable; every theme
8
8
  * selection is re-resolved from it, never layered on a previous result;
9
- * - the selection snapshot (`accent`, `mode`) behind a `useSyncExternalStore`
9
+ * - the selection snapshot (`themeName`, `mode`) behind a `useSyncExternalStore`
10
10
  * compatible subscribe/get pair. The snapshot object keeps its identity until
11
11
  * a value actually changes, so subscribers only re-render on real changes.
12
12
  *
@@ -18,10 +18,10 @@ import type { ThemeMode } from "./types.js";
18
18
  export declare const getInstalledConfig: () => NormalizedThemeConfig;
19
19
  /** @internal Replaces the installed config; only `registry.ts` should call this. */
20
20
  export declare function setInstalledConfig(config: NormalizedThemeConfig): void;
21
- /** The current runtime selection: which accent is applied and how the scheme is chosen. */
21
+ /** The current runtime selection: which theme is applied and how the scheme is chosen. */
22
22
  export interface ThemeSelection {
23
- /** Applied accent name, or `undefined` for the base themes. */
24
- readonly accent: string | undefined;
23
+ /** Applied theme name, or `undefined` for the base themes. */
24
+ readonly themeName: string | undefined;
25
25
  /** `system` follows the OS appearance; `light` / `dark` pin a scheme. */
26
26
  readonly mode: ThemeMode;
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"selection-store.d.ts","sourceRoot":"","sources":["../../../../src/theme/selection-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,KAAK,qBAAqB,EAAuB,MAAM,qBAAkB,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAUzC,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,QAAO,qBAAwC,CAAC;AAE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