@multiplatform.one/theme 6.1.0 → 6.4.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 (187) hide show
  1. package/README.md +73 -0
  2. package/package.json +22 -9
  3. package/src/dates.spec.ts +75 -0
  4. package/src/dates.ts +130 -0
  5. package/src/devWarn.spec.ts +144 -0
  6. package/src/devWarn.ts +235 -0
  7. package/src/figma/figmaTokens.spec.ts +244 -0
  8. package/src/figma/figmaTokens.ts +503 -0
  9. package/src/font.ts +6 -8
  10. package/src/fonts/createFontLoader.web.ts +15 -4
  11. package/src/index.ts +7 -0
  12. package/src/keyboardFocusRing.ts +45 -0
  13. package/src/menuRow.spec.ts +32 -0
  14. package/src/menuRow.ts +31 -0
  15. package/src/theme/FontKnobStyles.native.tsx +24 -0
  16. package/src/theme/FontKnobStyles.tsx +256 -0
  17. package/src/theme/animations/reactNative.ts +6 -1
  18. package/src/theme/chartPalette.spec.ts +159 -0
  19. package/src/theme/chartPalette.ts +170 -0
  20. package/src/theme/colorRules.ts +33 -1
  21. package/src/theme/cookies.spec.ts +32 -0
  22. package/src/theme/cookiesPersistence.spec.ts +86 -0
  23. package/src/theme/cornerSmoothing.native.ts +16 -0
  24. package/src/theme/cornerSmoothing.spec.ts +27 -0
  25. package/src/theme/cornerSmoothing.ts +46 -0
  26. package/src/theme/createDefaultThemeConfig.ts +32 -8
  27. package/src/theme/createThemeConfig.spec.ts +137 -0
  28. package/src/theme/createThemes.ts +77 -2
  29. package/src/theme/defaults/accent.ts +39 -0
  30. package/src/theme/defaults/base.ts +63 -0
  31. package/src/theme/defaults/builderOptions.ts +174 -0
  32. package/src/theme/defaults/fonts.spec.ts +87 -0
  33. package/src/theme/defaults/fonts.ts +89 -0
  34. package/src/theme/defaults/index.ts +4 -0
  35. package/src/theme/devtools/ThemeDevtoolsPanel.tsx +196 -2
  36. package/src/theme/devtools/buildSnapshot.ts +11 -0
  37. package/src/theme/devtools/knobIcons.tsx +141 -0
  38. package/src/theme/devtools/vizConstants.ts +1 -1
  39. package/src/theme/focusState.spec.ts +174 -0
  40. package/src/theme/focusState.ts +112 -0
  41. package/src/theme/fontKnobStyles.spec.ts +98 -0
  42. package/src/theme/hairline.native.ts +43 -0
  43. package/src/theme/hairline.spec.ts +63 -0
  44. package/src/theme/hairline.ts +101 -0
  45. package/src/theme/index.ts +8 -0
  46. package/src/theme/intent.spec.tsx +2 -2
  47. package/src/theme/intents.ts +6 -2
  48. package/src/theme/knobs.ts +134 -2
  49. package/src/theme/layoutTokens.spec.ts +75 -0
  50. package/src/theme/layoutTokens.ts +213 -0
  51. package/src/theme/layoutTokensHooks.spec.tsx +157 -0
  52. package/src/theme/presets.spec.ts +17 -0
  53. package/src/theme/presets.ts +22 -2
  54. package/src/theme/readableColor.ts +101 -0
  55. package/src/theme/recipes.ts +130 -7
  56. package/src/theme/resolveKnobs.spec.ts +560 -21
  57. package/src/theme/resolveKnobs.ts +267 -23
  58. package/src/theme/shared.tsx +26 -2
  59. package/src/theme/useResolvedKnobs.ts +67 -26
  60. package/src/theme/useResolvedKnobsBehavior.spec.tsx +166 -0
  61. package/types/audit/constraintAudit.d.ts +83 -0
  62. package/types/audit/constraintAudit.d.ts.map +1 -0
  63. package/types/audit/diffReport.d.ts +45 -0
  64. package/types/audit/diffReport.d.ts.map +1 -0
  65. package/types/audit/index.d.ts +5 -0
  66. package/types/audit/index.d.ts.map +1 -0
  67. package/types/dates.d.ts +52 -0
  68. package/types/dates.d.ts.map +1 -0
  69. package/types/devWarn.d.ts +104 -0
  70. package/types/devWarn.d.ts.map +1 -0
  71. package/types/figma/figmaTokens.d.ts +168 -0
  72. package/types/figma/figmaTokens.d.ts.map +1 -0
  73. package/types/font.d.ts +5 -0
  74. package/types/font.d.ts.map +1 -0
  75. package/types/fonts/createFontLoader.d.ts +3 -0
  76. package/types/fonts/createFontLoader.d.ts.map +1 -0
  77. package/types/fonts/createFontLoader.web.d.ts +3 -0
  78. package/types/fonts/createFontLoader.web.d.ts.map +1 -0
  79. package/types/fonts/index.d.ts +3 -0
  80. package/types/fonts/index.d.ts.map +1 -0
  81. package/types/fonts/types.d.ts +12 -0
  82. package/types/fonts/types.d.ts.map +1 -0
  83. package/types/index.d.ts +9 -0
  84. package/types/index.d.ts.map +1 -0
  85. package/types/keyboardFocusRing.d.ts +32 -0
  86. package/types/keyboardFocusRing.d.ts.map +1 -0
  87. package/types/menuRow.d.ts +32 -0
  88. package/types/menuRow.d.ts.map +1 -0
  89. package/types/theme/FontKnobStyles.d.ts +49 -0
  90. package/types/theme/FontKnobStyles.d.ts.map +1 -0
  91. package/types/theme/FontKnobStyles.native.d.ts +12 -0
  92. package/types/theme/FontKnobStyles.native.d.ts.map +1 -0
  93. package/types/theme/Intent.d.ts +20 -0
  94. package/types/theme/Intent.d.ts.map +1 -0
  95. package/types/theme/Preset.d.ts +15 -0
  96. package/types/theme/Preset.d.ts.map +1 -0
  97. package/types/theme/PresetContext.d.ts +18 -0
  98. package/types/theme/PresetContext.d.ts.map +1 -0
  99. package/types/theme/Tint.d.ts +19 -0
  100. package/types/theme/Tint.d.ts.map +1 -0
  101. package/types/theme/animations/css.d.ts +24 -0
  102. package/types/theme/animations/css.d.ts.map +1 -0
  103. package/types/theme/animations/index.d.ts +2 -0
  104. package/types/theme/animations/index.d.ts.map +1 -0
  105. package/types/theme/animations/index.web.d.ts +2 -0
  106. package/types/theme/animations/index.web.d.ts.map +1 -0
  107. package/types/theme/animations/reactNative.d.ts +104 -0
  108. package/types/theme/animations/reactNative.d.ts.map +1 -0
  109. package/types/theme/chartPalette.d.ts +62 -0
  110. package/types/theme/chartPalette.d.ts.map +1 -0
  111. package/types/theme/colorRules.d.ts +69 -0
  112. package/types/theme/colorRules.d.ts.map +1 -0
  113. package/types/theme/cookies.d.ts +76 -0
  114. package/types/theme/cookies.d.ts.map +1 -0
  115. package/types/theme/cornerSmoothing.d.ts +31 -0
  116. package/types/theme/cornerSmoothing.d.ts.map +1 -0
  117. package/types/theme/cornerSmoothing.native.d.ts +14 -0
  118. package/types/theme/cornerSmoothing.native.d.ts.map +1 -0
  119. package/types/theme/createDefaultThemeConfig.d.ts +37 -0
  120. package/types/theme/createDefaultThemeConfig.d.ts.map +1 -0
  121. package/types/theme/createThemes.d.ts +38 -0
  122. package/types/theme/createThemes.d.ts.map +1 -0
  123. package/types/theme/defaults/accent.d.ts +3 -0
  124. package/types/theme/defaults/accent.d.ts.map +1 -0
  125. package/types/theme/defaults/base.d.ts +3 -0
  126. package/types/theme/defaults/base.d.ts.map +1 -0
  127. package/types/theme/defaults/builderOptions.d.ts +3 -0
  128. package/types/theme/defaults/builderOptions.d.ts.map +1 -0
  129. package/types/theme/defaults/fonts.d.ts +7 -0
  130. package/types/theme/defaults/fonts.d.ts.map +1 -0
  131. package/types/theme/defaults/index.d.ts +5 -0
  132. package/types/theme/defaults/index.d.ts.map +1 -0
  133. package/types/theme/devtools/ColorLineVisualizer.d.ts +17 -0
  134. package/types/theme/devtools/ColorLineVisualizer.d.ts.map +1 -0
  135. package/types/theme/devtools/ThemeDevtoolsPanel.d.ts +87 -0
  136. package/types/theme/devtools/ThemeDevtoolsPanel.d.ts.map +1 -0
  137. package/types/theme/devtools/buildSnapshot.d.ts +12 -0
  138. package/types/theme/devtools/buildSnapshot.d.ts.map +1 -0
  139. package/types/theme/devtools/knobIcons.d.ts +33 -0
  140. package/types/theme/devtools/knobIcons.d.ts.map +1 -0
  141. package/types/theme/devtools/vizConstants.d.ts +5 -0
  142. package/types/theme/devtools/vizConstants.d.ts.map +1 -0
  143. package/types/theme/focusState.d.ts +42 -0
  144. package/types/theme/focusState.d.ts.map +1 -0
  145. package/types/theme/hairline.d.ts +88 -0
  146. package/types/theme/hairline.d.ts.map +1 -0
  147. package/types/theme/hairline.native.d.ts +42 -0
  148. package/types/theme/hairline.native.d.ts.map +1 -0
  149. package/types/theme/index.d.ts +29 -0
  150. package/types/theme/index.d.ts.map +1 -0
  151. package/types/theme/intents.d.ts +3 -0
  152. package/types/theme/intents.d.ts.map +1 -0
  153. package/types/theme/knobs.d.ts +236 -0
  154. package/types/theme/knobs.d.ts.map +1 -0
  155. package/types/theme/layoutTokens.d.ts +104 -0
  156. package/types/theme/layoutTokens.d.ts.map +1 -0
  157. package/types/theme/preset.types.d.ts +21 -0
  158. package/types/theme/preset.types.d.ts.map +1 -0
  159. package/types/theme/presets.d.ts +4 -0
  160. package/types/theme/presets.d.ts.map +1 -0
  161. package/types/theme/readableColor.d.ts +17 -0
  162. package/types/theme/readableColor.d.ts.map +1 -0
  163. package/types/theme/recipes.d.ts +200 -0
  164. package/types/theme/recipes.d.ts.map +1 -0
  165. package/types/theme/resolveKnobs.d.ts +22 -0
  166. package/types/theme/resolveKnobs.d.ts.map +1 -0
  167. package/types/theme/shared.d.ts +40 -0
  168. package/types/theme/shared.d.ts.map +1 -0
  169. package/types/theme/theme.d.ts +19 -0
  170. package/types/theme/theme.d.ts.map +1 -0
  171. package/types/theme/theme.native.d.ts +10 -0
  172. package/types/theme/theme.native.d.ts.map +1 -0
  173. package/types/theme/useColorScale.d.ts +7 -0
  174. package/types/theme/useColorScale.d.ts.map +1 -0
  175. package/types/theme/useColorScale.native.d.ts +6 -0
  176. package/types/theme/useColorScale.native.d.ts.map +1 -0
  177. package/types/theme/useResolvedKnobs.d.ts +32 -0
  178. package/types/theme/useResolvedKnobs.d.ts.map +1 -0
  179. package/types/theme/useTheme.d.ts +31 -0
  180. package/types/theme/useTheme.d.ts.map +1 -0
  181. package/types/theme/useTheme.native.d.ts +10 -0
  182. package/types/theme/useTheme.native.d.ts.map +1 -0
  183. package/CHANGELOG.md +0 -53
  184. package/src/theme/__snapshots__/resolveKnobs.spec.ts.snap +0 -69
  185. package/src/theme/pokemonScreen.spec.ts +0 -109
  186. package/tsconfig.json +0 -11
  187. package/vitest.config.mjs +0 -9
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Cookie utilities for the semantic component theming system.
3
+ *
4
+ * Uses two cookie families:
5
+ * - `mp.preset` — preset name string
6
+ * - `mp.ov.0`, `mp.ov.1`, … — JSON of only changed knobs (partial Knobs),
7
+ * chunked to stay under 4 KB per cookie
8
+ *
9
+ * Old cookie formats (`mp.overrides`, `mp.overrides0`, …) are NOT migrated —
10
+ * stale cookies are silently ignored/overwritten.
11
+ */
12
+ import type { Knobs } from "./knobs";
13
+ /** Cookie key for the active preset name. */
14
+ export declare const cookiePreset = "mp.preset";
15
+ /** Cookie key prefix for knob overrides (chunked). */
16
+ export declare const cookieOverridesPrefix = "mp.ov";
17
+ /**
18
+ * Split a cookie value string into chunks if it exceeds the threshold.
19
+ * Returns an array of chunks — if the value is small enough, the array
20
+ * contains a single element.
21
+ */
22
+ export declare function splitCookieValue(value: string): string[];
23
+ /**
24
+ * Reconstruct a cookie value from its split chunks.
25
+ */
26
+ export declare function joinSplitCookieValues(chunks: string[]): string;
27
+ /**
28
+ * Read the overrides cookie value, handling chunked cookies.
29
+ * Accepts the cookies object from `useCookies()`.
30
+ */
31
+ export declare function readOverridesCookie(cookies: Record<string, string | undefined>): Partial<Knobs>;
32
+ /**
33
+ * Read the preset name from the cookie.
34
+ */
35
+ export declare function readPresetCookie(cookies: Record<string, string | undefined>): string | undefined;
36
+ /**
37
+ * Write the preset name cookie.
38
+ * Returns the cookie key and value for the caller to pass to setCookie.
39
+ */
40
+ export declare function writePresetCookie(presetName: string): {
41
+ key: string;
42
+ value: string;
43
+ };
44
+ /**
45
+ * Write overrides cookie, splitting if necessary.
46
+ * Returns an array of { key, value } pairs for the caller to pass to setCookie.
47
+ * Also returns keys to remove (old split cookies that are no longer needed).
48
+ */
49
+ export declare function writeOverridesCookie(overrides: Partial<Knobs>): {
50
+ toSet: Array<{
51
+ key: string;
52
+ value: string;
53
+ }>;
54
+ toRemove: string[];
55
+ };
56
+ /**
57
+ * Compute the diff between a base knobs object and the current knobs to
58
+ * produce minimal overrides. Only includes keys where the value differs.
59
+ */
60
+ export declare function computeOverrides(base: Knobs, current: Knobs): Partial<Knobs>;
61
+ /**
62
+ * Build the list of cookie keys to watch for react-cookie.
63
+ */
64
+ export declare function getCookieWatchList(): string[];
65
+ /**
66
+ * Persist knob overrides to document cookies directly (no react-cookie).
67
+ * Useful outside of React component trees.
68
+ */
69
+ export declare function persistPresetOverrides(overrides: Partial<Knobs>): void;
70
+ /**
71
+ * Load knob overrides from document cookies directly (no react-cookie).
72
+ * Useful outside of React component trees and during SSR when given raw
73
+ * cookie headers.
74
+ */
75
+ export declare function loadPresetOverrides(rawCookies?: Record<string, string | undefined>): Partial<Knobs>;
76
+ //# sourceMappingURL=cookies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/theme/cookies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAMrC,6CAA6C;AAC7C,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC,sDAAsD;AACtD,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAY7C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CASxD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAE9D;AAeD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAiB/F;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAEhG;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAEpF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG;IAC/D,KAAK,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAgBA;AAMD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAQ5E;AAMD;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAM7C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAQtE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAC9C,OAAO,CAAC,KAAK,CAAC,CAGhB"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * OPTICS corner smoothing (Axiom 15): `cornerSmoothing: "smooth"` upgrades
3
+ * circular-arc corners to continuous curvature — CSS
4
+ * `corner-shape: squircle` (≡ `superellipse(2)`, ≈ Apple's continuous
5
+ * corners / Figma smoothing 0.6) — as a WEB PROGRESSIVE ENHANCEMENT.
6
+ * Chromium 139+ paints it; every other engine drops the unknown declaration
7
+ * and keeps today's plain `border-radius` arc, so no `@supports` gate is
8
+ * needed for correctness.
9
+ *
10
+ * Delivery is a class + one mounted stylesheet (the hairline pattern):
11
+ * Tamagui strips unknown keys from the `style` prop (`style` is in
12
+ * skipProps and `cornerShape` is not a valid style key), but merges
13
+ * `className` into its atomic classes — so `resolveKnobs` attaches
14
+ * `className: cornerSmoothClassName` to every radius-bearing fragment when
15
+ * the knob is `smooth`, and this module owns the CSS those classes resolve
16
+ * against.
17
+ *
18
+ * Native twin: `cornerSmoothing.native.ts` (no CSS classes — native resolves
19
+ * to `round` until a SquircleView adoption lands, phase 2).
20
+ */
21
+ /** Class attached to radius-bearing knob fragments at `cornerSmoothing: "smooth"`. */
22
+ export declare const cornerSmoothClassName = "mp-corner-smooth";
23
+ /**
24
+ * The squircle declaration. `corner-shape` composes with the element's
25
+ * existing `border-radius` (it reshapes the same corner box), so the
26
+ * fallback in non-supporting engines is automatic. Exported for unit tests.
27
+ */
28
+ export declare const cornerSmoothingCss = ".mp-corner-smooth { corner-shape: squircle; }";
29
+ /** Idempotently mount the corner-smoothing stylesheet (no-op off-DOM). */
30
+ export declare function ensureCornerSmoothingStyles(): void;
31
+ //# sourceMappingURL=cornerSmoothing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cornerSmoothing.d.ts","sourceRoot":"","sources":["../../src/theme/cornerSmoothing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAIxD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,kDAA0D,CAAC;AAE1F,0EAA0E;AAC1E,wBAAgB,2BAA2B,IAAI,IAAI,CAOlD"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * OPTICS corner smoothing (Axiom 15) — native twin of `cornerSmoothing.ts`.
3
+ *
4
+ * React Native has no `corner-shape`; native resolves `cornerSmoothing` to
5
+ * `round` (resolveKnobs emits no class on native) until a SquircleView
6
+ * adoption lands (phase 2). Exports stay shape-compatible for shared code.
7
+ */
8
+ /** Class attached on web only — never emitted into native fragments. */
9
+ export declare const cornerSmoothClassName = "mp-corner-smooth";
10
+ /** Web-only stylesheet — empty on native. */
11
+ export declare const cornerSmoothingCss = "";
12
+ /** Web-only stylesheet mount — no-op on native. */
13
+ export declare function ensureCornerSmoothingStyles(): void;
14
+ //# sourceMappingURL=cornerSmoothing.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cornerSmoothing.native.d.ts","sourceRoot":"","sources":["../../src/theme/cornerSmoothing.native.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD,6CAA6C;AAC7C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,mDAAmD;AACnD,wBAAgB,2BAA2B,IAAI,IAAI,CAAG"}
@@ -0,0 +1,37 @@
1
+ import type { CreateTamaguiProps, GenericFont } from "tamagui";
2
+ import { type BaseThemeBuilderDefinition, type CreateThemesBuilderOptions, type ThemeBuilderDefinition } from "./createThemes";
3
+ import type { Preset } from "./preset.types";
4
+ import { type ThemeConfig } from "./shared";
5
+ export interface CreateDefaultThemeConfigOptions {
6
+ /** Base theme palette (dark/light with optional shadows; defaults to the built-in neutral ramps) */
7
+ base?: BaseThemeBuilderDefinition;
8
+ /** Accent theme palette (defaults to the built-in accent ramps) */
9
+ accent?: ThemeBuilderDefinition;
10
+ /** Map of extra named themes with their palettes */
11
+ additionalThemes?: Record<string, ThemeBuilderDefinition>;
12
+ /** Font definitions (merged over the default heading/body fonts) */
13
+ fonts?: Record<string, GenericFont>;
14
+ /** Animation config (defaults to framework reanimated animations) */
15
+ animations?: CreateTamaguiProps["animations"];
16
+ /** Options for the theme builder (grandChildrenThemes, getTheme) */
17
+ builderOptions?: CreateThemesBuilderOptions;
18
+ /** Override tamagui settings */
19
+ settings?: Partial<NonNullable<CreateTamaguiProps["settings"]>>;
20
+ /** Override any top-level tamagui config property */
21
+ tamagui?: Partial<CreateTamaguiProps>;
22
+ /** Named theme presets for the preset system */
23
+ presets?: Record<string, Preset>;
24
+ /** Default preset name to use when no `mp.preset` cookie is set */
25
+ defaultPreset?: string;
26
+ }
27
+ /**
28
+ * Builds a complete Tamagui theme config with batteries included: calling it
29
+ * with zero options yields the framework's polished defaults — the neutral
30
+ * Radix-mauve-curve base ramps, the solid-surface brand accent ramps, Inter
31
+ * heading/body fonts and the interaction-ramp `getTheme` theme builder.
32
+ * Every option overrides its piece independently: `base`, `accent` and
33
+ * `builderOptions` each replace their default, while `fonts` are spread OVER
34
+ * the defaults so a partial font map keeps the default heading/body.
35
+ */
36
+ export declare function createDefaultThemeConfig(options?: CreateDefaultThemeConfigOptions): ThemeConfig;
37
+ //# sourceMappingURL=createDefaultThemeConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDefaultThemeConfig.d.ts","sourceRoot":"","sources":["../../src/theme/createDefaultThemeConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAE5B,MAAM,gBAAgB,CAAC;AAKxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,+BAA+B;IAC9C,oGAAoG;IACpG,IAAI,CAAC,EAAE,0BAA0B,CAAC;IAClC,mEAAmE;IACnE,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,oDAAoD;IACpD,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC1D,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACpC,qEAAqE;IACrE,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC9C,oEAAoE;IACpE,cAAc,CAAC,EAAE,0BAA0B,CAAC;IAC5C,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChE,qDAAqD;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACtC,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,+BAAoC,GAC5C,WAAW,CAyDb"}
@@ -0,0 +1,38 @@
1
+ import { type CreateThemesProps } from "@tamagui/theme-builder";
2
+ export interface Shadows {
3
+ shadow1: string;
4
+ shadow2: string;
5
+ shadow3: string;
6
+ shadow4: string;
7
+ shadow5: string;
8
+ shadow6: string;
9
+ }
10
+ export interface ThemeBuilderDefinition<DarkPalette extends string[] = string[], LightPalette extends string[] = string[]> {
11
+ darkPalette: DarkPalette;
12
+ lightPalette: LightPalette;
13
+ }
14
+ export interface BaseThemeBuilderDefinition<DarkPalette extends string[] = string[], LightPalette extends string[] = string[], DarkShadows extends Shadows = Shadows, LightShadows extends Shadows = Shadows> extends ThemeBuilderDefinition<DarkPalette, LightPalette> {
15
+ darkShadows?: DarkShadows;
16
+ lightShadows?: LightShadows;
17
+ }
18
+ export interface GetThemeProps {
19
+ name: string;
20
+ theme: Record<string, string>;
21
+ scheme?: "light" | "dark";
22
+ parentName: string;
23
+ parentNames: string[];
24
+ level: number;
25
+ palette?: string[];
26
+ }
27
+ export interface CreateThemesBuilderOptions {
28
+ grandChildrenThemes?: CreateThemesProps["grandChildrenThemes"];
29
+ getTheme?: (props: GetThemeProps) => Record<string, string | number>;
30
+ }
31
+ export declare const tintHueNames: Set<string>;
32
+ export declare function createThemesBuilder(baseTheme: BaseThemeBuilderDefinition, accentTheme: ThemeBuilderDefinition, options?: CreateThemesBuilderOptions): {
33
+ themes(): Record<string, Record<string, string>>;
34
+ addTheme<K extends string>(name: K, theme: ThemeBuilderDefinition): Record<`dark_${K}` | `light_${K}`, {
35
+ [x: string]: string;
36
+ } & Record<string, string>>;
37
+ };
38
+ //# sourceMappingURL=createThemes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createThemes.d.ts","sourceRoot":"","sources":["../../src/theme/createThemes.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAchC,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB,CACrC,WAAW,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,EACvC,YAAY,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE;IAExC,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA0B,CACzC,WAAW,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,EACvC,YAAY,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,EACxC,WAAW,SAAS,OAAO,GAAG,OAAO,EACrC,YAAY,SAAS,OAAO,GAAG,OAAO,CACtC,SAAQ,sBAAsB,CAAC,WAAW,EAAE,YAAY,CAAC;IACzD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,mBAAmB,CAAC,EAAE,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;IAC/D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACtE;AAQD,eAAO,MAAM,YAAY,aA6BvB,CAAC;AA0DH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,0BAA0B,EACrC,WAAW,EAAE,sBAAsB,EACnC,OAAO,CAAC,EAAE,0BAA0B;;aAkLzB,CAAC,SAAS,MAAM,QAAQ,CAAC,SAAS,sBAAsB,GAuB1D,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE;;+BAAkC;EAG7E"}
@@ -0,0 +1,3 @@
1
+ import type { ThemeBuilderDefinition } from "../createThemes";
2
+ export declare const defaultAccentTheme: ThemeBuilderDefinition;
3
+ //# sourceMappingURL=accent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accent.d.ts","sourceRoot":"","sources":["../../../src/theme/defaults/accent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,eAAO,MAAM,kBAAkB,EAAE,sBAoChC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { BaseThemeBuilderDefinition } from "../createThemes";
2
+ export declare const defaultBaseTheme: BaseThemeBuilderDefinition;
3
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/theme/defaults/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAElE,eAAO,MAAM,gBAAgB,EAAE,0BA4D9B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CreateThemesBuilderOptions } from "../createThemes";
2
+ export declare const defaultBuilderOptions: CreateThemesBuilderOptions;
3
+ //# sourceMappingURL=builderOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builderOptions.d.ts","sourceRoot":"","sources":["../../../src/theme/defaults/builderOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAiB,MAAM,iBAAiB,CAAC;AA+GjF,eAAO,MAAM,qBAAqB,EAAE,0BA8DnC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Inter dynamic tracking for a rendered `sizePx`, in em. */
2
+ export declare function interTrackingEm(sizePx: number): number;
3
+ /** Inter dynamic tracking for a rendered `sizePx`, in px (2-decimal). */
4
+ export declare function interTrackingPx(sizePx: number): number;
5
+ export declare const defaultHeadingFont: import("@tamagui/web").FillInFont<import("tamagui").GenericFont, 1 | 12 | 5 | 2 | 11 | 13 | 14 | 15 | 16 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | "true">;
6
+ export declare const defaultBodyFont: import("@tamagui/web").FillInFont<import("tamagui").GenericFont, 1 | 12 | 5 | 2 | 11 | 13 | 14 | 15 | 16 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | "true">;
7
+ //# sourceMappingURL=fonts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/theme/defaults/fonts.ts"],"names":[],"mappings":"AAuBA,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD;AAkCD,eAAO,MAAM,kBAAkB,iJAW9B,CAAC;AAEF,eAAO,MAAM,eAAe,iJAU3B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./accent";
2
+ export * from "./base";
3
+ export * from "./builderOptions";
4
+ export * from "./fonts";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/defaults/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Color palette visualizer for devtools.
3
+ *
4
+ * Shows the 12-step color scale with semantic group brackets (Background,
5
+ * UI Background, Border, Primary, Text) all on a single row above the bar.
6
+ */
7
+ import type { Knobs } from "../knobs";
8
+ export interface ColorLineVisualizerProps {
9
+ knobs: Knobs;
10
+ isDark: boolean;
11
+ themeColors?: string[];
12
+ oppositeThemeColors?: string[];
13
+ accentColors?: string[];
14
+ oppositeAccentColors?: string[];
15
+ }
16
+ export declare function ColorLineVisualizer({ knobs: _knobs, isDark, themeColors: propColors, oppositeThemeColors: propOppositeColors, accentColors: propAccentColors, oppositeAccentColors: propOppositeAccentColors, }: ColorLineVisualizerProps): import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=ColorLineVisualizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorLineVisualizer.d.ts","sourceRoot":"","sources":["../../../src/theme/devtools/ColorLineVisualizer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AA+LtC,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EAAE,MAAM,EACb,MAAM,EACN,WAAW,EAAE,UAAU,EACvB,mBAAmB,EAAE,kBAAkB,EACvC,YAAY,EAAE,gBAAgB,EAC9B,oBAAoB,EAAE,wBAAwB,GAC/C,EAAE,wBAAwB,2CA4C1B"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * TanStack Devtools plugin panel for controlling theme knobs at runtime.
3
+ * TODO(native): This panel is web-only for now. TanStack Devtools does not yet
4
+ * support React Native; when it does, revisit this panel for native compatibility.
5
+ *
6
+ * Controls:
7
+ * - Color scheme (system / light / dark) via @vxrn/color-scheme
8
+ * - Preset picker (using registered presets)
9
+ * - All knobs: fillStyle, borderRadius, cornerSmoothing, borderWidth,
10
+ * elevation, space, size, density, textAccent, headingFont, bodyFont,
11
+ * fontWeight, animation,
12
+ * plus house decisions (fieldLabelPlacement, requiredMarking, tableZebra,
13
+ * bulkBarPlacement, selectAllScope, timestampStyle, disabledStyle,
14
+ * formAutofocus)
15
+ *
16
+ * This panel is rendered *inside* the TanStack Devtools shell so it shares
17
+ * the same React tree and can call hooks like `useTheme` / `useUserScheme`.
18
+ *
19
+ * ---------------------------------------------------------------------------
20
+ * Theme sync (devtools panel ↔ website)
21
+ * ---------------------------------------------------------------------------
22
+ * The TanStack Devtools shell has its own "Choose theme" setting (light/dark)
23
+ * stored in shared storage under `tanstack_devtools_settings`. This panel keeps
24
+ * the devtools chrome theme and the website color scheme in sync:
25
+ *
26
+ * - Devtools → Website: When the user changes the devtools panel theme, the
27
+ * `devtoolsTheme` prop (passed via the render function callback) updates.
28
+ * A `useEffect` detects the change and calls `scheme.set()`.
29
+ *
30
+ * - Website → Devtools: When the user changes the color scheme via this
31
+ * panel's controls, a `useEffect` writes the resolved scheme value to the
32
+ * `tanstack_devtools_settings` storage entry. The devtools chrome
33
+ * picks this up on its next initialization (page reload).
34
+ *
35
+ * ---------------------------------------------------------------------------
36
+ * Cookie / SSR verification
37
+ * ---------------------------------------------------------------------------
38
+ * 1. On every control change, the panel calls `setKnobs(...)` from `useTheme`.
39
+ * 2. `setKnobs` in theme.tsx automatically writes the updated knobs to
40
+ * `mp.preset` + `mp.ov.*` cookies.
41
+ * 3. On page refresh, SSR reads the cookie from request headers and renders
42
+ * with the persisted theme — no flash, no hydration mismatch.
43
+ */
44
+ type SchemeHook = {
45
+ setting: "system" | "light" | "dark";
46
+ value: "light" | "dark";
47
+ set: (s: "system" | "light" | "dark") => void;
48
+ };
49
+ export interface ThemeDevtoolsPanelProps {
50
+ /**
51
+ * Pass `useUserScheme` from `one` or `@vxrn/color-scheme` so the panel can
52
+ * control light/dark/system without importing `one` directly in the theme package.
53
+ */
54
+ useUserScheme?: () => SchemeHook;
55
+ /**
56
+ * The current TanStack Devtools panel chrome theme (`"light"` or `"dark"`).
57
+ * Passed automatically when the plugin `render` is a function callback.
58
+ * Used for bidirectional theme syncing and adapting panel styles.
59
+ */
60
+ devtoolsTheme?: "light" | "dark";
61
+ /**
62
+ * Additional preset names beyond those registered via `registerPreset()`.
63
+ * Merged with auto-discovered presets from the registry.
64
+ */
65
+ extraPresets?: string[];
66
+ /**
67
+ * Available theme color names (e.g. `["blue", "green", "purple", ...]`).
68
+ * When provided, a "Theme" dropdown is shown and colors are included in
69
+ * the randomize action.
70
+ */
71
+ themeColors?: string[];
72
+ /** The currently active theme color name (e.g. `"blue"` or `""`). */
73
+ currentThemeColor?: string;
74
+ /** Callback invoked when the user picks a different theme color. */
75
+ onThemeColorChange?: (color: string) => void;
76
+ /**
77
+ * The Tamagui config object (from `createTamagui()`). When provided, the
78
+ * panel extracts live `$color1`–`$color12` values from the config's themes
79
+ * and passes them to the ColorLineVisualizer. This avoids relying on DOM
80
+ * CSS variable reading which doesn't work inside shadow DOM / isolated
81
+ * rendering contexts like TanStack Devtools.
82
+ */
83
+ tamaguiConfig?: unknown;
84
+ }
85
+ export declare function ThemeDevtoolsPanel({ useUserScheme, extraPresets, devtoolsTheme, themeColors, currentThemeColor, onThemeColorChange, tamaguiConfig, }: ThemeDevtoolsPanelProps): import("react/jsx-runtime").JSX.Element;
86
+ export {};
87
+ //# sourceMappingURL=ThemeDevtoolsPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeDevtoolsPanel.d.ts","sourceRoot":"","sources":["../../../src/theme/devtools/ThemeDevtoolsPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAyMH,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACrC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;CAC/C,CAAC;AAkiBF,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,UAAU,CAAC;IAEjC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEjC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEvB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAmDD,wBAAgB,kBAAkB,CAAC,EACjC,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACd,EAAE,uBAAuB,2CA67BzB"}
@@ -0,0 +1,12 @@
1
+ export interface SnapshotInput {
2
+ knobValues: Record<string, string | undefined>;
3
+ activePreset?: string;
4
+ activeProfile?: string;
5
+ schemeSetting?: string;
6
+ schemeValue?: string;
7
+ currentColor?: string;
8
+ lightColors: string[];
9
+ darkColors: string[];
10
+ }
11
+ export declare function buildSnapshot(input: SnapshotInput): string;
12
+ //# sourceMappingURL=buildSnapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSnapshot.d.ts","sourceRoot":"","sources":["../../../src/theme/devtools/buildSnapshot.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAyE1D"}
@@ -0,0 +1,33 @@
1
+ import { type ReactNode } from "react";
2
+ /**
3
+ * Shared icon renderers for theme knob controls.
4
+ *
5
+ * Each icon function accepts a pre-resolved foreground `color` string so
6
+ * that both the TanStack Devtools panel and the Storybook addon can use
7
+ * the same rendering logic with their own color schemes.
8
+ *
9
+ * TanStack: `ic(active, isDark)` → theme-adaptive foreground
10
+ * Storybook: `ic(active)` → purple accent for active, gray for inactive
11
+ */
12
+ export declare function fillIcon(value: string, color: string): ReactNode;
13
+ export declare function spaceIcon(value: string, color: string): ReactNode;
14
+ export declare function sizeIcon(value: string, color: string): ReactNode;
15
+ export declare function densityIcon(value: string, color: string): ReactNode;
16
+ export declare function borderRadiusIcon(value: string, color: string): ReactNode;
17
+ export declare function cornerSmoothingIcon(value: string, color: string): ReactNode;
18
+ export declare function borderWidthIcon(value: string, color: string): ReactNode;
19
+ export declare function elevationIcon(value: string, color: string, _isDark: boolean): ReactNode;
20
+ export declare function textAccentIcon(value: string, color: string): ReactNode;
21
+ export declare function headingFontIcon(value: string, color: string): ReactNode;
22
+ export declare function bodyFontIcon(value: string, color: string): ReactNode;
23
+ export declare function fontWeightIcon(value: string, color: string): ReactNode;
24
+ export declare function modeIcon(value: "system" | "light" | "dark", color: string): ReactNode;
25
+ export declare function fieldLabelPlacementIcon(value: string, color: string): ReactNode;
26
+ export declare function requiredMarkingIcon(value: string, color: string): ReactNode;
27
+ export declare function tableZebraIcon(value: string, color: string): ReactNode;
28
+ export declare function bulkBarPlacementIcon(value: string, color: string): ReactNode;
29
+ export declare function selectAllScopeIcon(value: string, color: string): ReactNode;
30
+ export declare function timestampStyleIcon(value: string, color: string): ReactNode;
31
+ export declare function disabledStyleIcon(value: string, color: string): ReactNode;
32
+ export declare function formAutofocusIcon(value: string, color: string): ReactNode;
33
+ //# sourceMappingURL=knobIcons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knobIcons.d.ts","sourceRoot":"","sources":["../../../src/theme/devtools/knobIcons.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C;;;;;;;;;GASG;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAKhE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAGjE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAGhE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAWnE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAMxE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAkB3E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAUvE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,CAqDvF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAiBtE;AAsBD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAiBvE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAiBpE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAetE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAiBrF;AAoBD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAI/E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAI3E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAStE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAkB5E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAW1E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAE1E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAazE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAazE"}
@@ -0,0 +1,5 @@
1
+ export declare function contrastTextFor(bgColor: string): string;
2
+ export declare function fallbackGray(step: number): string;
3
+ export declare const cellSize = 32;
4
+ export declare function stepToPx(step: number): number;
5
+ //# sourceMappingURL=vizConstants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vizConstants.d.ts","sourceRoot":"","sources":["../../../src/theme/devtools/vizConstants.ts"],"names":[],"mappings":"AAaA,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C"}
@@ -0,0 +1,42 @@
1
+ import type { ControlStateProps } from "./recipes";
2
+ /**
3
+ * DG-A11Y-01 — keyboard focus-visible ring.
4
+ * Width ≥2px; color is the theme `$outlineColor` token (scheme-aware, ≥3:1
5
+ * against adjacent surface in both light and dark).
6
+ */
7
+ export declare const FOCUS_RING_MIN_WIDTH = 2;
8
+ export declare const FOCUS_RING_MIN_CONTRAST = 3;
9
+ /**
10
+ * VERIFY helper (DG-A11Y-01 / Axiom 12): does a *resolved* ring color clear
11
+ * the ≥3:1 contrast floor against a given surface? Both args are CSS color
12
+ * strings (hex/hsl/named). Returns false when either can't be parsed (e.g. an
13
+ * alpha-blended color that can't be reduced to a single hue) so callers treat
14
+ * unresolved rings as failing.
15
+ */
16
+ export declare function focusRingColorMeetsContrast(ringColor: string, surfaceColor: string): boolean;
17
+ export declare const FOCUS_VISIBLE_RING: {
18
+ outlineWidth: number;
19
+ outlineStyle: "solid";
20
+ outlineColor: string;
21
+ outlineOffset: number;
22
+ };
23
+ /**
24
+ * DG-STATE-01 — Material-style state layers as theme tokens.
25
+ * Ramp lives in `defaults/builderOptions` (hover/press background steps);
26
+ * recipes overlay those tokens rather than inventing a second channel.
27
+ */
28
+ export declare const STATE_LAYER_HOVER: {
29
+ backgroundColor: string;
30
+ };
31
+ export declare const STATE_LAYER_PRESS: {
32
+ backgroundColor: string;
33
+ };
34
+ /**
35
+ * Merge + clamp so variants/knobs cannot remove the focus-visible ring.
36
+ * Transparent / none / sub-2px outlines are restored to the baseline token.
37
+ * Extra style keys (e.g. `borderColor`) are preserved for consumer merges.
38
+ */
39
+ export declare function ensureFocusVisibleRing<T extends ControlStateProps>(override?: (T & ControlStateProps) | null): T & ControlStateProps;
40
+ /** Apply default hover/press state-layer fill when knobs left background unset. */
41
+ export declare function withDefaultStateLayer(control: ControlStateProps, layer: ControlStateProps): ControlStateProps;
42
+ //# sourceMappingURL=focusState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusState.d.ts","sourceRoot":"","sources":["../../src/theme/focusState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAuBzC;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAO5F;AAED,eAAO,MAAM,kBAAkB;;;;;CAKF,CAAC;AAE9B;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;CAED,CAAC;AAE9B,eAAO,MAAM,iBAAiB;;CAED,CAAC;AAE9B;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,iBAAiB,EAChE,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAAC,GAAG,IAAI,GACxC,CAAC,GAAG,iBAAiB,CAyBvB;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,iBAAiB,GACvB,iBAAiB,CAKnB"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * OPTICS hairline (Axiom 15): a divider means "one device pixel", not "one
3
+ * CSS pixel". On high-DPI web screens a 1px CSS divider paints 2–3 device
4
+ * pixels and reads heavy; 0.5px paints a single device pixel on 2x displays.
5
+ *
6
+ * Engine notes (probed against Chromium 147 / WebKit / Gecko):
7
+ * - Blink floors sub-1px BORDER widths up to 1 CSS px, but honors fractional
8
+ * HEIGHT/WIDTH — so standalone rules use the filled `line`/`vline`
9
+ * treatments (crisp everywhere), while container-owned edge borders
10
+ * (`bottom`/`top`/`right`/`left`) render true hairlines on WebKit/Gecko
11
+ * and gracefully stay 1px on Blink.
12
+ * - Low-DPI screens (1dppx) get a 1px fallback via the resolution media
13
+ * query below, so hairlines never fade or vanish there.
14
+ *
15
+ * Scope: DIVIDERS ONLY — separators between rows/sections, menu separators,
16
+ * table head rules, full-bleed panel rules. Control borders (inputs,
17
+ * buttons, control groups) keep the knob-driven `borderWidth` semantics
18
+ * from `resolveKnobs` and MUST NOT use this token.
19
+ *
20
+ * Native twin: `hairline.native.ts` (react-native StyleSheet.hairlineWidth,
21
+ * no CSS classes).
22
+ */
23
+ /** Divider line width: half a CSS pixel = one device pixel on 2x displays. */
24
+ export declare const hairlineWidth: number;
25
+ /**
26
+ * Spreadable divider treatments. Each entry pairs the 0.5px style with the
27
+ * fallback class the low-DPI media query targets:
28
+ *
29
+ * <Separator {...hairline.line} /> // horizontal rule element
30
+ * <Separator vertical {...hairline.vline} /> // vertical rule element
31
+ * <View {...hairline.height} /> // already-filled 1px line
32
+ * <YStack {...hairline.bottom} /> // container-owned edge rule
33
+ */
34
+ export declare const hairline: {
35
+ /**
36
+ * Standalone horizontal rule as a FILLED line (tamagui Separator draws a
37
+ * border, which Blink cannot paint below 1 CSS px — flip it to a filled
38
+ * fractional-height line, crisp in every engine). Consumers may override
39
+ * `backgroundColor` after the spread for non-default divider colors.
40
+ */
41
+ readonly line: {
42
+ readonly height: number;
43
+ readonly maxHeight: number;
44
+ readonly flexBasis: number;
45
+ readonly borderBottomWidth: 0;
46
+ readonly backgroundColor: "$borderColor";
47
+ readonly className: "mp-hairline-h";
48
+ };
49
+ /** Standalone vertical rule as a filled line (see `line`). */
50
+ readonly vline: {
51
+ readonly width: number;
52
+ readonly maxWidth: number;
53
+ readonly flexBasis: number;
54
+ readonly borderRightWidth: 0;
55
+ readonly backgroundColor: "$borderColor";
56
+ readonly className: "mp-hairline-w";
57
+ };
58
+ /** Already-filled 1px line elements (e.g. menu separator views). */
59
+ readonly height: {
60
+ readonly height: number;
61
+ readonly className: "mp-hairline-h";
62
+ };
63
+ readonly bottom: {
64
+ readonly borderBottomWidth: number;
65
+ readonly className: "mp-hairline-b";
66
+ };
67
+ readonly top: {
68
+ readonly borderTopWidth: number;
69
+ readonly className: "mp-hairline-t";
70
+ };
71
+ readonly right: {
72
+ readonly borderRightWidth: number;
73
+ readonly className: "mp-hairline-r";
74
+ };
75
+ readonly left: {
76
+ readonly borderLeftWidth: number;
77
+ readonly className: "mp-hairline-l";
78
+ };
79
+ };
80
+ /**
81
+ * 1px fallback for screens where 0.5px cannot map to a whole device pixel.
82
+ * (`-webkit-max-device-pixel-ratio` covers Safari versions without
83
+ * `resolution` media-query support.) Exported for unit tests.
84
+ */
85
+ export declare const hairlineFallbackCss = "@media (max-resolution: 1.49dppx), (-webkit-max-device-pixel-ratio: 1.49) {\n .mp-hairline-b { border-bottom-width: 1px !important; }\n .mp-hairline-t { border-top-width: 1px !important; }\n .mp-hairline-r { border-right-width: 1px !important; }\n .mp-hairline-l { border-left-width: 1px !important; }\n .mp-hairline-h { height: 1px !important; max-height: 1px !important; flex-basis: 1px !important; }\n .mp-hairline-w { width: 1px !important; max-width: 1px !important; flex-basis: 1px !important; }\n .mp-hairline-ie { border-inline-end-width: 1px !important; }\n}";
86
+ /** Idempotently mount the low-DPI fallback stylesheet (no-op off-DOM). */
87
+ export declare function ensureHairlineFallback(): void;
88
+ //# sourceMappingURL=hairline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hairline.d.ts","sourceRoot":"","sources":["../../src/theme/hairline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,aAAa,EAAE,MAAY,CAAC;AAEzC;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ;IACnB;;;;;OAKG;;;;;;;;;IAWH,8DAA8D;;;;;;;;;IAS9D,oEAAoE;;;;;;;;;;;;;;;;;;;;;CAQ5D,CAAC;AAIX;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,mkBAQ9B,CAAC;AAEH,0EAA0E;AAC1E,wBAAgB,sBAAsB,IAAI,IAAI,CAO7C"}