@multiplatform.one/theme 6.7.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -17
- package/src/dates.spec.ts +344 -1
- package/src/dates.ts +50 -3
- package/src/devWarn.ts +29 -1
- package/src/figma/figmaTokens.spec.ts +3 -3
- package/src/figma/figmaTokens.ts +6 -3
- package/src/keyboardFocusRing.ts +61 -5
- package/src/menuRow.spec.ts +2 -2
- package/src/menuRow.ts +5 -4
- package/src/theme/Surface.spec.tsx +146 -0
- package/src/theme/Surface.tsx +73 -0
- package/src/theme/createDefaultThemeConfig.spec.ts +152 -0
- package/src/theme/createDefaultThemeConfig.ts +47 -3
- package/src/theme/createThemes.ts +27 -4
- package/src/theme/devtools/ThemeDevtoolsPanel.tsx +6 -2
- package/src/theme/focusState.ts +9 -1
- package/src/theme/groupGeometry.spec.ts +108 -0
- package/src/theme/groupGeometry.ts +119 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/intent.spec.tsx +17 -0
- package/src/theme/knobs.ts +2 -2
- package/src/theme/layoutTokens.spec.ts +14 -0
- package/src/theme/layoutTokens.ts +29 -0
- package/src/theme/recipeInputs.ts +368 -0
- package/src/theme/recipes.ts +34 -0
- package/src/theme/resolveKnobs.spec.ts +91 -9
- package/src/theme/resolveKnobs.ts +55 -5
- package/src/theme/shared.tsx +11 -0
- package/src/theme/sizeRecipes.spec.ts +296 -0
- package/src/theme/sizeRecipes.ts +198 -0
- package/src/theme/useResolvedKnobs.ts +76 -24
- package/src/theme/useResolvedKnobsBehavior.spec.tsx +11 -3
- package/types/dates.d.ts +36 -2
- package/types/dates.d.ts.map +1 -1
- package/types/devWarn.d.ts +16 -1
- package/types/devWarn.d.ts.map +1 -1
- package/types/figma/figmaTokens.d.ts +1 -1
- package/types/figma/figmaTokens.d.ts.map +1 -1
- package/types/keyboardFocusRing.d.ts +19 -4
- package/types/keyboardFocusRing.d.ts.map +1 -1
- package/types/menuRow.d.ts +5 -4
- package/types/menuRow.d.ts.map +1 -1
- package/types/theme/Surface.d.ts +37 -0
- package/types/theme/Surface.d.ts.map +1 -0
- package/types/theme/createDefaultThemeConfig.d.ts +14 -3
- package/types/theme/createDefaultThemeConfig.d.ts.map +1 -1
- package/types/theme/createThemes.d.ts.map +1 -1
- package/types/theme/devtools/ThemeDevtoolsPanel.d.ts.map +1 -1
- package/types/theme/focusState.d.ts +8 -0
- package/types/theme/focusState.d.ts.map +1 -1
- package/types/theme/groupGeometry.d.ts +69 -0
- package/types/theme/groupGeometry.d.ts.map +1 -0
- package/types/theme/index.d.ts +3 -0
- package/types/theme/index.d.ts.map +1 -1
- package/types/theme/knobs.d.ts +2 -2
- package/types/theme/knobs.d.ts.map +1 -1
- package/types/theme/layoutTokens.d.ts +22 -0
- package/types/theme/layoutTokens.d.ts.map +1 -1
- package/types/theme/recipeInputs.d.ts +110 -0
- package/types/theme/recipeInputs.d.ts.map +1 -0
- package/types/theme/recipes.d.ts +47 -0
- package/types/theme/recipes.d.ts.map +1 -1
- package/types/theme/resolveKnobs.d.ts +7 -3
- package/types/theme/resolveKnobs.d.ts.map +1 -1
- package/types/theme/shared.d.ts +9 -0
- package/types/theme/shared.d.ts.map +1 -1
- package/types/theme/sizeRecipes.d.ts +68 -0
- package/types/theme/sizeRecipes.d.ts.map +1 -0
- package/types/theme/useResolvedKnobs.d.ts +10 -6
- package/types/theme/useResolvedKnobs.d.ts.map +1 -1
- package/src/audit/baselines/home-pokemon.json +0 -355
package/types/theme/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./defaults/index";
|
|
|
9
9
|
export * from "./devtools/ThemeDevtoolsPanel";
|
|
10
10
|
export * from "./focusState";
|
|
11
11
|
export * from "./FontKnobStyles";
|
|
12
|
+
export * from "./groupGeometry";
|
|
12
13
|
export * from "./hairline";
|
|
13
14
|
export * from "./Intent";
|
|
14
15
|
export * from "./intents";
|
|
@@ -23,6 +24,8 @@ export * from "./readableColor";
|
|
|
23
24
|
export * from "./recipes";
|
|
24
25
|
export * from "./resolveKnobs";
|
|
25
26
|
export * from "./shared";
|
|
27
|
+
export * from "./sizeRecipes";
|
|
28
|
+
export * from "./Surface";
|
|
26
29
|
export * from "./theme";
|
|
27
30
|
export * from "./Tint";
|
|
28
31
|
export * from "./useResolvedKnobs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,YAAY,EAAE,MAAM,IAAI,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACjF,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,YAAY,EAAE,MAAM,IAAI,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACjF,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAE1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
|
package/types/theme/knobs.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare const Size: {
|
|
|
52
52
|
readonly Large: "large";
|
|
53
53
|
};
|
|
54
54
|
export type Size = (typeof Size)[keyof typeof Size];
|
|
55
|
-
/** Global density mode — compact steps
|
|
55
|
+
/** Global density mode — compact steps space down one level; size is independent. */
|
|
56
56
|
export declare const Density: {
|
|
57
57
|
readonly Comfortable: "comfortable";
|
|
58
58
|
readonly Compact: "compact";
|
|
@@ -221,7 +221,7 @@ export interface Knobs {
|
|
|
221
221
|
elevation: Elevation;
|
|
222
222
|
space: Space;
|
|
223
223
|
size: Size;
|
|
224
|
-
/** Propagating density mode. Default comfortable; compact steps
|
|
224
|
+
/** Propagating density mode. Default comfortable; compact steps space only. */
|
|
225
225
|
density: Density;
|
|
226
226
|
textAccent: TextAccent;
|
|
227
227
|
headingFont: HeadingFont;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knobs.d.ts","sourceRoot":"","sources":["../../src/theme/knobs.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;CAAsD,CAAC;AAC7E,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAErF,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE,eAAO,MAAM,SAAS;;;;;CAKZ,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,eAAO,MAAM,KAAK;;;;CAIR,CAAC;AACX,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC;AAEvD,eAAO,MAAM,IAAI;;;;CAIP,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,OAAO,IAAI,CAAC,CAAC;AAEpD,
|
|
1
|
+
{"version":3,"file":"knobs.d.ts","sourceRoot":"","sources":["../../src/theme/knobs.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;CAAsD,CAAC;AAC7E,MAAM,MA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,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,0DAA0D;IAC1D,eAAe,EAAE,eAAe,CAAC;IACjC,4CAA4C;IAC5C,UAAU,EAAE,UAAU,CAAC;IACvB,8CAA8C;IAC9C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,mDAAmD;IACnD,cAAc,EAAE,cAAc,CAAC;IAC/B,gDAAgD;IAChD,cAAc,EAAE,cAAc,CAAC;IAC/B,oDAAoD;IACpD,aAAa,EAAE,aAAa,CAAC;IAC7B,0CAA0C;IAC1C,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,YAAY,EAAE,UAAU,CAAC;CAC1B;AAID,eAAO,MAAM,eAAe,EAAE,UAAe,CAAC;AAE9C,eAAO,MAAM,YAAY,EAAE,KA2B1B,CAAC"}
|
|
@@ -76,6 +76,8 @@ export type ReadingWidthStyle = {
|
|
|
76
76
|
export declare function readingWidthStyle(measure?: number | "none" | null): ReadingWidthStyle | Record<string, never>;
|
|
77
77
|
/** Platform floor for interactive targets (Fluent/HIG web+iOS 44; M3 48 on Android). */
|
|
78
78
|
export declare const MIN_PRESS_TARGET = 44;
|
|
79
|
+
/** Touch surfaces — native touchable or web touchable (LC-67). */
|
|
80
|
+
export declare function isTouchSurface(): boolean;
|
|
79
81
|
export type PressTargetStyle = {
|
|
80
82
|
minWidth: number;
|
|
81
83
|
minHeight: number;
|
|
@@ -89,6 +91,26 @@ export type HitSlopInsets = {
|
|
|
89
91
|
};
|
|
90
92
|
/** Expand hit area when the visual control is smaller than the floor. */
|
|
91
93
|
export declare function pressTargetHitSlop(visualSize: number, min?: number): HitSlopInsets;
|
|
94
|
+
/**
|
|
95
|
+
* House convention for every anchored overlay (Select/Combobox listboxes,
|
|
96
|
+
* DropdownMenu, Popover, Tooltip, FloatingPanel):
|
|
97
|
+
*
|
|
98
|
+
* - Anchored MENUS and SELECT LISTBOXES match the trigger width EXACTLY
|
|
99
|
+
* (min-width = trigger width — no oversize fudge). They may grow only
|
|
100
|
+
* wider when option content genuinely overflows, never narrower, and
|
|
101
|
+
* stay start-aligned (flush with the trigger's leading edge).
|
|
102
|
+
* - Pointer-positioned CONTEXT MENUS and free POPOVERS/TOOLTIPS size to
|
|
103
|
+
* content, start-aligned to their anchor.
|
|
104
|
+
* - All of them keep `OVERLAY_ANCHOR_GAP` px between trigger edge and
|
|
105
|
+
* overlay (floating-ui `offset` / tamagui Popover `offset`), and
|
|
106
|
+
* shift/flip at viewport edges instead of overflowing.
|
|
107
|
+
* - ONE SURFACE OWNER per overlay: the overlay frame draws the single
|
|
108
|
+
* border + radius. When a panel intentionally covers its trigger
|
|
109
|
+
* (Select's macOS-style aligned listbox), the covered trigger must not
|
|
110
|
+
* paint focus decorations — a focus ring outside the trigger's border
|
|
111
|
+
* box would ghost around the overlay's corners as a doubled edge.
|
|
112
|
+
*/
|
|
113
|
+
export declare const OVERLAY_ANCHOR_GAP = 4;
|
|
92
114
|
/**
|
|
93
115
|
* Semantic spacing roles map onto the space-knob recipes:
|
|
94
116
|
* `within-group` → `knobProps.gap`, `between-groups` → `knobProps.gapLg`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layoutTokens.d.ts","sourceRoot":"","sources":["../../src/theme/layoutTokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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MAAM,CAAC;CACf,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,MAAM,GAAG,MAAM,GAAG,IAAuB,GACjD,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAI3C;AAID,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,kEAAkE;AAClE,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAAyB,GAAG,gBAAgB,CAElF;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,yEAAyE;AACzE,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,GAAG,GAAE,MAAyB,GAC7B,aAAa,CAGf;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAIpC;;;GAGG;AACH,wBAAgB,eAAe,IAAI;IACjC,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7B,aAAa,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC,CAMA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size-recipe INPUTS (LC-70 RECIPE-INPUTS).
|
|
3
|
+
*
|
|
4
|
+
* Stored numbers are the source of truth. Tables (heights, recipes,
|
|
5
|
+
* box/type/icon variants, touch heights) are DERIVED — never handwritten.
|
|
6
|
+
* Radius is stored on inputs (`radiusPx`) and MUST NOT appear on recipes
|
|
7
|
+
* or variants; it stays on the borderRadius knob.
|
|
8
|
+
*
|
|
9
|
+
* Tamagui `createThemes` / theme-builder still emits COLOR palettes only.
|
|
10
|
+
* Do not stuff recipe keys into `getTheme()` / `themes`.
|
|
11
|
+
*
|
|
12
|
+
* DEFAULT uses `tokenHeights` so published px match today's lossless table
|
|
13
|
+
* ($4=32, $3=28, $5=40, $6=48). `{ baseHeight: 40 }` (no tokenHeights /
|
|
14
|
+
* sizeFactors) regenerates geometrically from `baseHeight * stepRatio ** step`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SIZE_RECIPE_TOKENS: readonly ["$1", "$1.5", "$2", "$2.5", "$3", "$3.5", "$4", "$true", "$5", "$6"];
|
|
17
|
+
export type SizeRecipeToken = (typeof SIZE_RECIPE_TOKENS)[number];
|
|
18
|
+
export type SizeRecipeFamilyName = "control" | "controlCompact";
|
|
19
|
+
/** @deprecated Use `SizeRecipeFamilyName`. */
|
|
20
|
+
export type RecipeFamilyName = SizeRecipeFamilyName;
|
|
21
|
+
export type SizeRecipeRatios = {
|
|
22
|
+
padX: number;
|
|
23
|
+
font: number;
|
|
24
|
+
icon: number;
|
|
25
|
+
gap: number;
|
|
26
|
+
};
|
|
27
|
+
export type SizeRecipeInputs = {
|
|
28
|
+
baseHeight: number;
|
|
29
|
+
stepRatio: number;
|
|
30
|
+
tokenSteps: Record<string, number>;
|
|
31
|
+
/** Absolute desktop px. When omitted, heights come from baseHeight * stepRatio ** step (or sizeFactors). */
|
|
32
|
+
tokenHeights?: Record<string, number>;
|
|
33
|
+
/**
|
|
34
|
+
* Optional per-token scale relative to `baseHeight`. Used only when
|
|
35
|
+
* `tokenHeights` is omitted. Factors are `stepRatio ** exponent` otherwise.
|
|
36
|
+
*/
|
|
37
|
+
sizeFactors?: Partial<Record<SizeRecipeToken, number>>;
|
|
38
|
+
ratios: SizeRecipeRatios;
|
|
39
|
+
compactRatios: SizeRecipeRatios;
|
|
40
|
+
radiusPx: number;
|
|
41
|
+
touchFloor: number;
|
|
42
|
+
};
|
|
43
|
+
/** @deprecated Use `SizeRecipeInputs`. */
|
|
44
|
+
export type RecipeInputs = SizeRecipeInputs;
|
|
45
|
+
export type SizeRecipe = {
|
|
46
|
+
height: number;
|
|
47
|
+
paddingHorizontal: number;
|
|
48
|
+
fontSize: number;
|
|
49
|
+
iconSize: number;
|
|
50
|
+
gap: number;
|
|
51
|
+
};
|
|
52
|
+
export type SizeRecipeBoxVariant = {
|
|
53
|
+
height: number;
|
|
54
|
+
paddingHorizontal: number;
|
|
55
|
+
gap: number;
|
|
56
|
+
};
|
|
57
|
+
export type SizeRecipeTypeVariant = {
|
|
58
|
+
fontSize: number;
|
|
59
|
+
};
|
|
60
|
+
export type SizeRecipeIconVariant = {
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
};
|
|
64
|
+
export type SizeRecipeTables = {
|
|
65
|
+
inputs: SizeRecipeInputs;
|
|
66
|
+
ratios: SizeRecipeRatios;
|
|
67
|
+
heights: Record<string, number>;
|
|
68
|
+
touchHeights: Record<string, number>;
|
|
69
|
+
recipes: Record<string, SizeRecipe>;
|
|
70
|
+
recipesTouch: Record<string, SizeRecipe>;
|
|
71
|
+
boxVariants: Record<string, SizeRecipeBoxVariant>;
|
|
72
|
+
typeVariants: Record<string, SizeRecipeTypeVariant>;
|
|
73
|
+
iconVariants: Record<string, SizeRecipeIconVariant>;
|
|
74
|
+
heightVariants: Record<string, {
|
|
75
|
+
height: number;
|
|
76
|
+
}>;
|
|
77
|
+
};
|
|
78
|
+
export type SizeRecipeFamily = SizeRecipeTables & {
|
|
79
|
+
name: SizeRecipeFamilyName;
|
|
80
|
+
};
|
|
81
|
+
export type RecipeFamilies = Record<SizeRecipeFamilyName, SizeRecipeFamily>;
|
|
82
|
+
export type GeneratedSizeRecipes = {
|
|
83
|
+
inputs: SizeRecipeInputs;
|
|
84
|
+
heights: Record<string, number>;
|
|
85
|
+
heightsTouch: Record<string, number>;
|
|
86
|
+
recipes: Record<string, SizeRecipe>;
|
|
87
|
+
recipesTouch: Record<string, SizeRecipe>;
|
|
88
|
+
boxVariants: Record<string, SizeRecipeBoxVariant>;
|
|
89
|
+
typeVariants: Record<string, SizeRecipeTypeVariant>;
|
|
90
|
+
iconVariants: Record<string, SizeRecipeIconVariant>;
|
|
91
|
+
families: RecipeFamilies;
|
|
92
|
+
};
|
|
93
|
+
export declare const SIZE_TOKEN_EXPONENTS: Record<SizeRecipeToken, number>;
|
|
94
|
+
/** Lossless relative table: today's 20/24/28/32/40/48 ramp at baseHeight 32. */
|
|
95
|
+
export declare const defaultSizeFactors: Record<SizeRecipeToken, number>;
|
|
96
|
+
export declare const DEFAULT_SIZE_RECIPE_INPUTS: SizeRecipeInputs;
|
|
97
|
+
export declare const defaultRecipeInputs: SizeRecipeInputs;
|
|
98
|
+
export declare const TOUCH_HEIGHT_FLOOR: number;
|
|
99
|
+
export declare function cloneSizeRecipeInputs(inputs: SizeRecipeInputs): SizeRecipeInputs;
|
|
100
|
+
/**
|
|
101
|
+
* Fill defaults. `{ baseHeight: 36 }` drops handwritten tokenHeights/sizeFactors
|
|
102
|
+
* so every token regenerates from stepRatio.
|
|
103
|
+
*/
|
|
104
|
+
export declare function resolveSizeRecipeInputs(partial?: Partial<SizeRecipeInputs>): SizeRecipeInputs;
|
|
105
|
+
export declare const mergeRecipeInputs: typeof resolveSizeRecipeInputs;
|
|
106
|
+
export declare function sizeRecipeFromHeight(height: number, ratios?: SizeRecipeRatios): SizeRecipe;
|
|
107
|
+
export declare function generateSizeRecipeTables(inputs: SizeRecipeInputs, ratios?: SizeRecipeRatios): SizeRecipeTables;
|
|
108
|
+
export declare function createRecipeFamilies(inputs?: SizeRecipeInputs | Partial<SizeRecipeInputs>): RecipeFamilies;
|
|
109
|
+
export declare function generateSizeRecipes(partial?: Partial<SizeRecipeInputs>): GeneratedSizeRecipes;
|
|
110
|
+
//# sourceMappingURL=recipeInputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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gB,mBAAmB,CAAC,OAAO,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,oBAAoB,CAejG"}
|
package/types/theme/recipes.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ColorTokens, FontSizeTokens, TransitionProp } from "tamagui";
|
|
2
2
|
import type { Knobs } from "./knobs";
|
|
3
|
+
import type { HitSlopInsets } from "./layoutTokens";
|
|
3
4
|
export interface ControlStateProps {
|
|
4
5
|
borderRadius?: string;
|
|
5
6
|
borderWidth?: number;
|
|
@@ -154,7 +155,53 @@ export interface KnobProps {
|
|
|
154
155
|
gapLg: {
|
|
155
156
|
gap: string;
|
|
156
157
|
};
|
|
158
|
+
/**
|
|
159
|
+
* Size-recipe KEY (string "$4"), not a height scalar. styled() variants
|
|
160
|
+
* switch on this token; control internals read `control` / `controlType` /
|
|
161
|
+
* `controlIcon` (LC-65). Radius is not on the recipe.
|
|
162
|
+
*/
|
|
157
163
|
sizeToken: string;
|
|
164
|
+
/**
|
|
165
|
+
* Control-chrome type (labels, calendar digits, weekday headers). Paired
|
|
166
|
+
* to `size` so nested surfaces can step type with density. NEVER pass
|
|
167
|
+
* `sizeToken` as `fontSize` — that token is a control HEIGHT ($4 = 44px
|
|
168
|
+
* box), not a type step ($4 font = 14px).
|
|
169
|
+
*/
|
|
170
|
+
label: {
|
|
171
|
+
fontSize: FontSizeTokens;
|
|
172
|
+
fontFamily: string;
|
|
173
|
+
fontWeight: string;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Nested hit-target (calendar days, overlay chips): visual box BELOW the
|
|
177
|
+
* 44px floor, press restored with `hitSlop` (LC-54 / LC-71). Spread the
|
|
178
|
+
* box onto the painted cell; pass `hitSlop` to the press handler.
|
|
179
|
+
*/
|
|
180
|
+
nestedControl: {
|
|
181
|
+
px: number;
|
|
182
|
+
width: number;
|
|
183
|
+
height: number;
|
|
184
|
+
minWidth: number;
|
|
185
|
+
maxWidth: number;
|
|
186
|
+
minHeight: number;
|
|
187
|
+
maxHeight: number;
|
|
188
|
+
hitSlop: HitSlopInsets;
|
|
189
|
+
};
|
|
190
|
+
/** Coordinated control box (height / padX / inner gap). Spread whole. */
|
|
191
|
+
control: {
|
|
192
|
+
height: number;
|
|
193
|
+
paddingHorizontal: number;
|
|
194
|
+
gap: number;
|
|
195
|
+
};
|
|
196
|
+
/** Coordinated control type. Spread whole. */
|
|
197
|
+
controlType: {
|
|
198
|
+
fontSize: number;
|
|
199
|
+
};
|
|
200
|
+
/** Coordinated control icon box. Spread whole. */
|
|
201
|
+
controlIcon: {
|
|
202
|
+
width: number;
|
|
203
|
+
height: number;
|
|
204
|
+
};
|
|
158
205
|
heading: {
|
|
159
206
|
fontFamily: string;
|
|
160
207
|
fontWeight: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../src/theme/recipes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../src/theme/recipes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAIpD,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,E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SAAS,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type { FontSizeTokens } from "tamagui";
|
|
2
2
|
import type { Knobs, PageTitleScale } from "./knobs";
|
|
3
3
|
import type { KnobPropsOverride, ResolvedKnobs } from "./recipes";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Size is no longer coupled to density (LC-76). Compact density
|
|
6
|
+
* steps space only. Kept exported because figmaTokens historically imported it.
|
|
7
|
+
*/
|
|
5
8
|
export declare const compactSizeMap: Record<Knobs["size"], Knobs["size"]>;
|
|
6
9
|
/** Step space down one level for compact density. */
|
|
7
10
|
export declare const compactSpaceMap: Record<Knobs["space"], Knobs["space"]>;
|
|
8
11
|
/**
|
|
9
12
|
* Apply density mode to knobs before token resolution.
|
|
10
13
|
*
|
|
11
|
-
* - `density: "compact"` steps
|
|
14
|
+
* - `density: "compact"` steps **space only** (`compactSpaceMap`). Size is an
|
|
15
|
+
* independent axis (LC-76) — compact must not shrink controls.
|
|
12
16
|
* - `compactOverride` wins over the density knob when provided:
|
|
13
|
-
* `true` forces compact stepping; `false` forces comfortable (no step).
|
|
17
|
+
* `true` forces compact space stepping; `false` forces comfortable (no step).
|
|
14
18
|
*/
|
|
15
19
|
export declare function applyDensity(knobs: Knobs, compactOverride?: boolean): Knobs;
|
|
16
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveKnobs.d.ts","sourceRoot":"","sources":["../../src/theme/resolveKnobs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,SAAS,CAAC;AAU9D,OAAO,KAAK,EAAmB,KAAK,EAAE,cAAc,EAAc,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"resolveKnobs.d.ts","sourceRoot":"","sources":["../../src/theme/resolveKnobs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,SAAS,CAAC;AAU9D,OAAO,KAAK,EAAmB,KAAK,EAAE,cAAc,EAAc,MAAM,SAAS,CAAC;AAElF,OAAO,KAAK,EAKV,iBAAiB,EAEjB,aAAa,EAEd,MAAM,WAAW,CAAC;AAKnB;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAI/D,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAIlE,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,CAU3E;AAyDD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAErF;AA0BD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,EACnC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,GACpB,MAAM,GAAG,MAAM,CAIjB;AAkMD,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,aAAa,CAsLtF"}
|
package/types/theme/shared.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CreateTamaguiProps, createTamagui } from "tamagui";
|
|
2
2
|
import type { Knobs } from "./knobs";
|
|
3
3
|
import type { Preset } from "./preset.types";
|
|
4
|
+
import type { RecipeFamilies, RecipeInputs } from "./recipeInputs";
|
|
4
5
|
export declare function registerPreset(name: string, preset: Preset): void;
|
|
5
6
|
/**
|
|
6
7
|
* Look up a registered preset by name.
|
|
@@ -32,9 +33,17 @@ export type ThemeConfig<T extends CreateTamaguiProps = CreateTamaguiProps> = {
|
|
|
32
33
|
* time so consumers don't need to introspect the Tamagui config.
|
|
33
34
|
*/
|
|
34
35
|
themeColors: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Size-recipe inputs + generated families (LC-70). Orthogonal to Tamagui
|
|
38
|
+
* `themes` (those are color palettes from createThemes / theme-builder).
|
|
39
|
+
*/
|
|
40
|
+
recipeInputs?: RecipeInputs;
|
|
41
|
+
recipeFamilies?: RecipeFamilies;
|
|
35
42
|
};
|
|
36
43
|
export declare function createThemeConfig<T extends CreateTamaguiProps>(tamagui: T, options?: {
|
|
37
44
|
presets?: Record<string, Preset>;
|
|
38
45
|
defaultPreset?: string;
|
|
46
|
+
recipeInputs?: RecipeInputs;
|
|
47
|
+
recipeFamilies?: RecipeFamilies;
|
|
39
48
|
}): ThemeConfig<T>;
|
|
40
49
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/theme/shared.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/theme/shared.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AASnE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,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
* must stay in ratio with height. Radius is excluded — it stays on the
|
|
6
|
+
* borderRadius knob and must never scale with size.
|
|
7
|
+
*
|
|
8
|
+
* Tables are GENERATED from `defaultRecipeInputs` at module eval (Tamagui
|
|
9
|
+
* 2.0.0-rc.41 flattens `styled(View, { variants: { size: tables } })` when
|
|
10
|
+
* the second arg is an object literal and generate ran at module eval).
|
|
11
|
+
* Do NOT pass a function as styled()'s second argument. Functional
|
|
12
|
+
* `"...size": (val) =>` stays runtime unless JSX flattens a static size —
|
|
13
|
+
* reserve it for non-enumerable values only. Do NOT put recipe tables on a
|
|
14
|
+
* `createStyledContext` primitive (`neverFlatten`).
|
|
15
|
+
*
|
|
16
|
+
* Reference md ($4 / $true): height 32, padX 12, font 14, icon 16, gap 6.
|
|
17
|
+
* `sizeToken` remains the recipe KEY (string "$4") so styled() variants
|
|
18
|
+
* can switch; it is not a height scalar.
|
|
19
|
+
*
|
|
20
|
+
* Families: `control` uses `inputs.ratios`. `controlCompact` uses
|
|
21
|
+
* `compactRatios` at the SAME heights (tighter pad/font/icon/gap).
|
|
22
|
+
*
|
|
23
|
+
* On touch (LC-67), `applyTouchFloor` / `sizeRecipeForToken(token, { touch: true })`
|
|
24
|
+
* lift painted height to ≥ 44 while pad/font/icon stay in ratio. Static
|
|
25
|
+
* `sizeRecipe*Variants` stay on the desktop table — runtime fragments
|
|
26
|
+
* carry the floor; consumers spread `knobProps.control` after `size`.
|
|
27
|
+
*/
|
|
28
|
+
export { DEFAULT_SIZE_RECIPE_INPUTS, SIZE_RECIPE_TOKENS, SIZE_TOKEN_EXPONENTS, TOUCH_HEIGHT_FLOOR, cloneSizeRecipeInputs, createRecipeFamilies, defaultRecipeInputs, defaultSizeFactors, generateSizeRecipeTables, generateSizeRecipes, mergeRecipeInputs, resolveSizeRecipeInputs, } from "./recipeInputs";
|
|
29
|
+
export type { GeneratedSizeRecipes, RecipeFamilies, RecipeFamilyName, RecipeInputs, SizeRecipe, SizeRecipeBoxVariant, SizeRecipeFamily, SizeRecipeFamilyName, SizeRecipeIconVariant, SizeRecipeInputs, SizeRecipeRatios, SizeRecipeTables, SizeRecipeToken, SizeRecipeTypeVariant, } from "./recipeInputs";
|
|
30
|
+
import { type GeneratedSizeRecipes, type RecipeFamilyName, type RecipeInputs, type SizeRecipe, type SizeRecipeFamily } from "./recipeInputs";
|
|
31
|
+
/**
|
|
32
|
+
* Module-eval default families. `styled()` variants MUST spread these
|
|
33
|
+
* objects (or `sizeRecipeBoxVariants`) — not a function — so rc.41 can flatten.
|
|
34
|
+
*/
|
|
35
|
+
export declare const recipeFamilies: import("./recipeInputs").RecipeFamilies;
|
|
36
|
+
/** Back-compat aliases of `recipeFamilies.control` (generated, not handwritten). */
|
|
37
|
+
export declare const sizeRecipes: Record<string, SizeRecipe>;
|
|
38
|
+
export declare const sizeRecipeBoxVariants: Record<string, import("./recipeInputs").SizeRecipeBoxVariant>;
|
|
39
|
+
export declare const sizeRecipeTypeVariants: Record<string, import("./recipeInputs").SizeRecipeTypeVariant>;
|
|
40
|
+
export declare const sizeRecipeIconVariants: Record<string, import("./recipeInputs").SizeRecipeIconVariant>;
|
|
41
|
+
export declare const SIZE_RECIPE_HEIGHTS: Record<string, number>;
|
|
42
|
+
export declare const SIZE_RECIPE_HEIGHTS_TOUCH: Record<string, number>;
|
|
43
|
+
export declare const SIZE_RECIPE_RATIOS: import("./recipeInputs").SizeRecipeRatios;
|
|
44
|
+
export declare const SIZE_RECIPE_COMPACT_RATIOS: import("./recipeInputs").SizeRecipeRatios;
|
|
45
|
+
export declare const SIZE_RECIPE_FAMILY_NAMES: readonly ["control", "controlCompact"];
|
|
46
|
+
/** Merge `partial` over defaultRecipeInputs (not the previous override) and rewrite live tables. */
|
|
47
|
+
export declare function setSizeRecipeInputs(partial?: Partial<RecipeInputs>): GeneratedSizeRecipes;
|
|
48
|
+
export declare function getSizeRecipeInputs(): RecipeInputs;
|
|
49
|
+
export declare function getGeneratedSizeRecipes(): GeneratedSizeRecipes;
|
|
50
|
+
export declare function getSizeRecipeFamily(name?: RecipeFamilyName): SizeRecipeFamily;
|
|
51
|
+
export declare function sizeRecipeFromHeight(height: number, ratios?: RecipeInputs["ratios"]): SizeRecipe;
|
|
52
|
+
export declare function applyTouchFloor(recipe: SizeRecipe, touch: boolean, family?: RecipeFamilyName | SizeRecipeFamily): SizeRecipe;
|
|
53
|
+
export declare function sizeRecipeForToken(token: string, options?: {
|
|
54
|
+
touch?: boolean;
|
|
55
|
+
family?: RecipeFamilyName | SizeRecipeFamily;
|
|
56
|
+
}): SizeRecipe;
|
|
57
|
+
/**
|
|
58
|
+
* Identity helper for the LC-65 SIZE-RECIPE ESCAPE lint
|
|
59
|
+
* (`scripts/lint-conventions.mjs`). Wrap a numeric height / minHeight /
|
|
60
|
+
* paddingHorizontal / fontSize that must stay a literal:
|
|
61
|
+
*
|
|
62
|
+
* height={sizeRecipeEscape(20)}
|
|
63
|
+
*
|
|
64
|
+
* Or comment `// size-recipe-escape:` on the previous line or same
|
|
65
|
+
* statement. Pilot: Button/, InputParts/, fields/Select/.
|
|
66
|
+
*/
|
|
67
|
+
export declare function sizeRecipeEscape<T>(value: T): T;
|
|
68
|
+
//# sourceMappingURL=sizeRecipes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizeRecipes.d.ts","sourceRoot":"","sources":["../../src/theme/sizeRecipes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB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AE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,CAAA;CAAE,GAC1E,UAAU,CAKZ;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAE/C"}
|
|
@@ -9,9 +9,11 @@ export interface UseResolvedKnobsOptions {
|
|
|
9
9
|
/** Override the size from knobs */
|
|
10
10
|
size?: SizeTokens;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Density-compact override (layout gaps only — does not step size).
|
|
13
|
+
* When set, wins over `knobs.density`:
|
|
14
|
+
* `true` forces compact density; `false` forces comfortable.
|
|
15
|
+
* Then re-clamped to the parent Surface ceiling (LC-68).
|
|
16
|
+
* When omitted, the density knob / Surface controls compact vs comfortable.
|
|
15
17
|
*/
|
|
16
18
|
compact?: boolean;
|
|
17
19
|
}
|
|
@@ -24,9 +26,11 @@ export declare const solidButtonIntents: Set<string>;
|
|
|
24
26
|
* 2. Merge intent-level overrides (if intent provided or from context)
|
|
25
27
|
* 3. Merge intent+component overrides (if both provided)
|
|
26
28
|
* 4. Apply size override if provided
|
|
27
|
-
* 5.
|
|
28
|
-
* 6.
|
|
29
|
-
* 7.
|
|
29
|
+
* 5. Clamp size/density to Surface context (step-down only, LC-68)
|
|
30
|
+
* 6. Apply density (space only; compact option wins when provided)
|
|
31
|
+
* 7. Re-clamp to Surface ceiling (compact option cannot exceed parent)
|
|
32
|
+
* 8. OS reduced-motion forces animation="none"
|
|
33
|
+
* 9. Call resolveKnobs(mergedKnobs, override) — override merges last
|
|
30
34
|
*/
|
|
31
35
|
export declare function useResolvedKnobs(options?: UseResolvedKnobsOptions): ResolvedKnobs;
|
|
32
36
|
//# sourceMappingURL=useResolvedKnobs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResolvedKnobs.d.ts","sourceRoot":"","sources":["../../src/theme/useResolvedKnobs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"useResolvedKnobs.d.ts","sourceRoot":"","sources":["../../src/theme/useResolvedKnobs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAWlE,eAAO,MAAM,aAAa,wCAAqC,CAAC;AAEhE,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAEhD;AAsDD,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,mCAAmC;IACnC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAYD,eAAO,MAAM,kBAAkB,aAA2C,CAAC;AAE3E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,aAAa,CAkGjF"}
|