@multiplatform.one/theme 7.34.4 → 7.35.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 +20 -5
- package/src/audit/constraintAudit.spec.ts +274 -87
- package/src/audit/constraintAudit.ts +135 -120
- package/src/audit/constraintScope.spec.ts +1 -1
- package/src/audit/designTokens.ts +42 -0
- package/src/audit/themeMatrix.spec.ts +83 -2
- package/src/audit/themeMatrix.ts +33 -1
- package/src/figma/figmaTokens.spec.ts +26 -34
- package/src/figma/figmaTokens.ts +26 -50
- package/src/fonts/createFontLoader.ts +4 -1
- package/src/menuRow.ts +4 -1
- package/src/theme/FontKnobStyles.tsx +2 -1
- package/src/theme/Preset.stories.tsx +0 -1
- package/src/theme/Preset.tsx +6 -1
- package/src/theme/PresetContext.ts +4 -0
- package/src/theme/Surface.spec.tsx +114 -67
- package/src/theme/Surface.stories.tsx +8 -25
- package/src/theme/Surface.tsx +87 -43
- package/src/theme/accentFloor.spec.ts +37 -11
- package/src/theme/activateThemeConfig.ts +22 -6
- package/src/theme/animations/animations.spec.ts +62 -0
- package/src/theme/animations/css.ts +9 -35
- package/src/theme/animations/reactNative.ts +98 -25
- package/src/theme/boundaryFloor.spec.ts +57 -0
- package/src/theme/chartPalette.spec.ts +56 -27
- package/src/theme/chartPalette.ts +33 -28
- package/src/theme/colorRules.spec.ts +32 -72
- package/src/theme/cookies.spec.ts +49 -18
- package/src/theme/cookies.ts +36 -7
- package/src/theme/cookiesPersistence.spec.ts +5 -5
- package/src/theme/createDefaultThemeConfig.spec.ts +182 -20
- package/src/theme/createDefaultThemeConfig.ts +34 -28
- package/src/theme/createThemes.ts +169 -218
- package/src/theme/defaults/accent.ts +3 -35
- package/src/theme/defaults/base.ts +14 -53
- package/src/theme/defaults/builderOptions.ts +68 -85
- package/src/theme/defaults/categoryFonts.ts +10 -0
- package/src/theme/defaults/fonts.spec.ts +84 -4
- package/src/theme/defaults/fonts.ts +166 -124
- package/src/theme/defaults/house.ts +48 -0
- package/src/theme/defaults/index.ts +1 -0
- package/src/theme/defaults/neutralRamp.spec.ts +52 -47
- package/src/theme/devtools/ColorLineVisualizer.tsx +6 -6
- package/src/theme/devtools/ThemeDevtoolsPanel.setMarkers.spec.tsx +13 -6
- package/src/theme/devtools/ThemeDevtoolsPanel.tsx +14 -77
- package/src/theme/devtools/animationOptions.spec.ts +23 -37
- package/src/theme/devtools/animationOptions.ts +4 -6
- package/src/theme/devtools/buildSnapshot.ts +0 -3
- package/src/theme/devtools/knobIcons.tsx +4 -24
- package/src/theme/focusState.spec.ts +9 -30
- package/src/theme/index.ts +17 -0
- package/src/theme/intentFill.spec.ts +42 -0
- package/src/theme/knobs.ts +14 -42
- package/src/theme/layoutTokens.ts +15 -1
- package/src/theme/layoutTokensHooks.spec.tsx +8 -4
- package/src/theme/mergedTokens.ts +20 -0
- package/src/theme/motion.spec.ts +84 -0
- package/src/theme/motion.ts +53 -0
- package/src/theme/motionStops.ts +17 -0
- package/src/theme/motionTiming.ts +59 -0
- package/src/theme/mpo13Proof.spec.ts +43 -46
- package/src/theme/mpo19Proof.spec.ts +13 -14
- package/src/theme/namedInkFloor.spec.ts +60 -0
- package/src/theme/overlaySurfaces.tsx +330 -0
- package/src/theme/preset.types.ts +16 -0
- package/src/theme/presetPreview.ts +32 -0
- package/src/theme/presetRoot.spec.tsx +89 -0
- package/src/theme/presetStore.persistence.spec.ts +141 -0
- package/src/theme/presetStore.spec.ts +205 -0
- package/src/theme/presetStore.ts +286 -0
- package/src/theme/presetUserSync.spec.tsx +168 -0
- package/src/theme/presetUserSync.ts +47 -0
- package/src/theme/presets.spec.ts +22 -15
- package/src/theme/presets.ts +22 -10
- package/src/theme/radiusClass.spec.ts +60 -41
- package/src/theme/radiusClass.ts +17 -4
- package/src/theme/radiusClassTable.generated.ts +3 -3
- package/src/theme/readableColor.spec.ts +59 -152
- package/src/theme/readableColor.ts +34 -174
- package/src/theme/recipeInputs.ts +153 -295
- package/src/theme/recipes.ts +58 -18
- package/src/theme/resolveKnobs.spec.ts +528 -588
- package/src/theme/resolveKnobs.ts +250 -325
- package/src/theme/scale/ScaleStyles.native.tsx +19 -0
- package/src/theme/scale/ScaleStyles.tsx +48 -0
- package/src/theme/scale/activeScale.ts +30 -0
- package/src/theme/scale/deriveRecipeInputs.ts +110 -0
- package/src/theme/scale/generateScale.spec.ts +260 -0
- package/src/theme/scale/generateScale.ts +147 -0
- package/src/theme/scale/index.ts +54 -0
- package/src/theme/scale/installScaleConfig.native.spec.ts +77 -0
- package/src/theme/scale/installScaleConfig.native.ts +57 -0
- package/src/theme/scale/installScaleConfig.ts +7 -0
- package/src/theme/scale/scaleAttribute.ts +21 -0
- package/src/theme/scale/scaleCss.probe.spec.tsx +64 -0
- package/src/theme/scale/scaleCss.spec.ts +132 -0
- package/src/theme/scale/scaleCss.ts +95 -0
- package/src/theme/scale/scaleFonts.ts +106 -0
- package/src/theme/scale/scaleInputs.ts +322 -0
- package/src/theme/scale/themeScales.ts +181 -0
- package/src/theme/scale/useActiveScale.spec.tsx +129 -0
- package/src/theme/scale/useActiveScale.ts +95 -0
- package/src/theme/schemeStore.spec.ts +81 -0
- package/src/theme/schemeStore.ts +67 -0
- package/src/theme/shared.spec.ts +7 -6
- package/src/theme/shared.tsx +37 -3
- package/src/theme/sizeLadder.spec.ts +37 -36
- package/src/theme/sizeRecipes.spec.ts +179 -85
- package/src/theme/sizeRecipes.ts +48 -25
- package/src/theme/subsetThemes.spec.ts +9 -3
- package/src/theme/switchThumb.spec.ts +69 -0
- package/src/theme/syntaxFloor.spec.ts +11 -8
- package/src/theme/theme.hydration.native.spec.tsx +51 -0
- package/src/theme/theme.native.tsx +59 -21
- package/src/theme/theme.palette.spec.tsx +76 -0
- package/src/theme/theme.preset.native.spec.tsx +73 -0
- package/src/theme/theme.provider.spec.ts +143 -1
- package/src/theme/theme.tsx +61 -25
- package/src/theme/tileSizes.ts +6 -7
- package/src/theme/transitionProps.native.ts +25 -2
- package/src/theme/transitionProps.spec.ts +34 -0
- package/src/theme/transitionProps.ts +26 -2
- package/src/theme/usePresetSwitch.native.spec.tsx +68 -0
- package/src/theme/usePresetSwitch.native.ts +32 -0
- package/src/theme/usePresetSwitch.spec.tsx +103 -0
- package/src/theme/usePresetSwitch.ts +54 -0
- package/src/theme/useResolvedKnobs.hydration.spec.tsx +2 -2
- package/src/theme/useResolvedKnobs.ts +23 -90
- package/src/theme/useResolvedKnobsBehavior.spec.tsx +25 -30
- package/src/theme/useSchemePreference.native.ts +33 -0
- package/src/theme/useSchemePreference.spec.tsx +51 -0
- package/src/theme/useSchemePreference.ts +32 -0
- package/src/theme/useSchemePreference.web.spec.tsx +32 -0
- package/src/theme/useTheme.native.spec.tsx +68 -0
- package/src/theme/useTheme.native.ts +49 -24
- package/src/theme/useTheme.ts +7 -4
- package/types/audit/constraintAudit.d.ts +6 -5
- package/types/audit/constraintAudit.d.ts.map +1 -1
- package/types/audit/designTokens.d.ts +13 -0
- package/types/audit/designTokens.d.ts.map +1 -0
- package/types/audit/themeMatrix.d.ts +10 -0
- package/types/audit/themeMatrix.d.ts.map +1 -1
- package/types/figma/figmaTokens.d.ts +11 -28
- package/types/figma/figmaTokens.d.ts.map +1 -1
- package/types/fonts/createFontLoader.d.ts.map +1 -1
- package/types/menuRow.d.ts +4 -1
- package/types/menuRow.d.ts.map +1 -1
- package/types/theme/FontKnobStyles.d.ts.map +1 -1
- package/types/theme/Preset.d.ts.map +1 -1
- package/types/theme/PresetContext.d.ts +4 -0
- package/types/theme/PresetContext.d.ts.map +1 -1
- package/types/theme/Surface.d.ts +57 -26
- package/types/theme/Surface.d.ts.map +1 -1
- package/types/theme/activateThemeConfig.d.ts +5 -3
- package/types/theme/activateThemeConfig.d.ts.map +1 -1
- package/types/theme/animations/css.d.ts +27 -34
- package/types/theme/animations/css.d.ts.map +1 -1
- package/types/theme/animations/reactNative.d.ts +196 -45
- package/types/theme/animations/reactNative.d.ts.map +1 -1
- package/types/theme/chartPalette.d.ts +11 -3
- package/types/theme/chartPalette.d.ts.map +1 -1
- package/types/theme/colorRules.d.ts +1 -1
- package/types/theme/cookies.d.ts +12 -1
- package/types/theme/cookies.d.ts.map +1 -1
- package/types/theme/createDefaultThemeConfig.d.ts +13 -13
- package/types/theme/createDefaultThemeConfig.d.ts.map +1 -1
- package/types/theme/createThemes.d.ts +58 -2
- package/types/theme/createThemes.d.ts.map +1 -1
- package/types/theme/defaults/accent.d.ts.map +1 -1
- package/types/theme/defaults/base.d.ts.map +1 -1
- package/types/theme/defaults/builderOptions.d.ts.map +1 -1
- package/types/theme/defaults/categoryFonts.d.ts +10 -0
- package/types/theme/defaults/categoryFonts.d.ts.map +1 -1
- package/types/theme/defaults/fonts.d.ts +330 -30
- package/types/theme/defaults/fonts.d.ts.map +1 -1
- package/types/theme/defaults/house.d.ts +8 -0
- package/types/theme/defaults/house.d.ts.map +1 -0
- package/types/theme/defaults/index.d.ts +1 -0
- package/types/theme/defaults/index.d.ts.map +1 -1
- package/types/theme/devtools/ThemeDevtoolsPanel.d.ts +3 -3
- package/types/theme/devtools/ThemeDevtoolsPanel.d.ts.map +1 -1
- package/types/theme/devtools/animationOptions.d.ts.map +1 -1
- package/types/theme/devtools/buildSnapshot.d.ts.map +1 -1
- package/types/theme/devtools/knobIcons.d.ts +0 -3
- package/types/theme/devtools/knobIcons.d.ts.map +1 -1
- package/types/theme/index.d.ts +11 -0
- package/types/theme/index.d.ts.map +1 -1
- package/types/theme/knobs.d.ts +8 -36
- package/types/theme/knobs.d.ts.map +1 -1
- package/types/theme/layoutTokens.d.ts +13 -1
- package/types/theme/layoutTokens.d.ts.map +1 -1
- package/types/theme/mergedTokens.d.ts +11 -0
- package/types/theme/mergedTokens.d.ts.map +1 -0
- package/types/theme/motion.d.ts +17 -0
- package/types/theme/motion.d.ts.map +1 -0
- package/types/theme/motionStops.d.ts +3 -0
- package/types/theme/motionStops.d.ts.map +1 -0
- package/types/theme/motionTiming.d.ts +36 -0
- package/types/theme/motionTiming.d.ts.map +1 -0
- package/types/theme/overlaySurfaces.d.ts +70 -0
- package/types/theme/overlaySurfaces.d.ts.map +1 -0
- package/types/theme/preset.types.d.ts +16 -0
- package/types/theme/preset.types.d.ts.map +1 -1
- package/types/theme/presetPreview.d.ts +14 -0
- package/types/theme/presetPreview.d.ts.map +1 -0
- package/types/theme/presetStore.d.ts +40 -0
- package/types/theme/presetStore.d.ts.map +1 -0
- package/types/theme/presetUserSync.d.ts +7 -0
- package/types/theme/presetUserSync.d.ts.map +1 -0
- package/types/theme/presets.d.ts +12 -4
- package/types/theme/presets.d.ts.map +1 -1
- package/types/theme/radiusClass.d.ts +5 -2
- package/types/theme/radiusClass.d.ts.map +1 -1
- package/types/theme/radiusClassTable.generated.d.ts +3 -3
- package/types/theme/readableColor.d.ts +11 -49
- package/types/theme/readableColor.d.ts.map +1 -1
- package/types/theme/recipeInputs.d.ts +39 -70
- package/types/theme/recipeInputs.d.ts.map +1 -1
- package/types/theme/recipes.d.ts +79 -18
- package/types/theme/recipes.d.ts.map +1 -1
- package/types/theme/resolveKnobs.d.ts +64 -32
- package/types/theme/resolveKnobs.d.ts.map +1 -1
- package/types/theme/scale/ScaleStyles.d.ts +18 -0
- package/types/theme/scale/ScaleStyles.d.ts.map +1 -0
- package/types/theme/scale/ScaleStyles.native.d.ts +10 -0
- package/types/theme/scale/ScaleStyles.native.d.ts.map +1 -0
- package/types/theme/scale/activeScale.d.ts +13 -0
- package/types/theme/scale/activeScale.d.ts.map +1 -0
- package/types/theme/scale/deriveRecipeInputs.d.ts +10 -0
- package/types/theme/scale/deriveRecipeInputs.d.ts.map +1 -0
- package/types/theme/scale/generateScale.d.ts +38 -0
- package/types/theme/scale/generateScale.d.ts.map +1 -0
- package/types/theme/scale/index.d.ts +17 -0
- package/types/theme/scale/index.d.ts.map +1 -0
- package/types/theme/scale/installScaleConfig.d.ts +4 -0
- package/types/theme/scale/installScaleConfig.d.ts.map +1 -0
- package/types/theme/scale/installScaleConfig.native.d.ts +13 -0
- package/types/theme/scale/installScaleConfig.native.d.ts.map +1 -0
- package/types/theme/scale/scaleAttribute.d.ts +14 -0
- package/types/theme/scale/scaleAttribute.d.ts.map +1 -0
- package/types/theme/scale/scaleCss.d.ts +25 -0
- package/types/theme/scale/scaleCss.d.ts.map +1 -0
- package/types/theme/scale/scaleFonts.d.ts +16 -0
- package/types/theme/scale/scaleFonts.d.ts.map +1 -0
- package/types/theme/scale/scaleInputs.d.ts +66 -0
- package/types/theme/scale/scaleInputs.d.ts.map +1 -0
- package/types/theme/scale/themeScales.d.ts +52 -0
- package/types/theme/scale/themeScales.d.ts.map +1 -0
- package/types/theme/scale/useActiveScale.d.ts +31 -0
- package/types/theme/scale/useActiveScale.d.ts.map +1 -0
- package/types/theme/schemeStore.d.ts +6 -0
- package/types/theme/schemeStore.d.ts.map +1 -0
- package/types/theme/shared.d.ts +18 -0
- package/types/theme/shared.d.ts.map +1 -1
- package/types/theme/sizeRecipes.d.ts +20 -15
- package/types/theme/sizeRecipes.d.ts.map +1 -1
- package/types/theme/theme.d.ts +2 -1
- package/types/theme/theme.d.ts.map +1 -1
- package/types/theme/theme.native.d.ts +10 -1
- package/types/theme/theme.native.d.ts.map +1 -1
- package/types/theme/tileSizes.d.ts +6 -7
- package/types/theme/tileSizes.d.ts.map +1 -1
- package/types/theme/transitionProps.d.ts +3 -1
- package/types/theme/transitionProps.d.ts.map +1 -1
- package/types/theme/transitionProps.native.d.ts +3 -1
- package/types/theme/transitionProps.native.d.ts.map +1 -1
- package/types/theme/usePresetSwitch.d.ts +10 -0
- package/types/theme/usePresetSwitch.d.ts.map +1 -0
- package/types/theme/usePresetSwitch.native.d.ts +10 -0
- package/types/theme/usePresetSwitch.native.d.ts.map +1 -0
- package/types/theme/useResolvedKnobs.d.ts +13 -13
- package/types/theme/useResolvedKnobs.d.ts.map +1 -1
- package/types/theme/useSchemePreference.d.ts +8 -0
- package/types/theme/useSchemePreference.d.ts.map +1 -0
- package/types/theme/useSchemePreference.native.d.ts +8 -0
- package/types/theme/useSchemePreference.native.d.ts.map +1 -0
- package/types/theme/useTheme.d.ts +4 -2
- package/types/theme/useTheme.d.ts.map +1 -1
- package/types/theme/useTheme.native.d.ts +10 -1
- package/types/theme/useTheme.native.d.ts.map +1 -1
|
@@ -3,23 +3,24 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Stored numbers are the source of truth. Derived projections (heights,
|
|
5
5
|
* recipes, box/type/icon variants, touch heights, radii) are never
|
|
6
|
-
* handwritten at a call site. The
|
|
7
|
-
*
|
|
8
|
-
* gap
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* handwritten at a call site. The default inputs are READ off the generated
|
|
7
|
+
* token scale (`scale/generateScale.ts`): height = `$size`, padX = `$space`,
|
|
8
|
+
* radius (and gap) = `$radius` at the same key, so a raw `$size`/`$space`
|
|
9
|
+
* prop and the recipe at that key are the same number. `{ control }` (and
|
|
10
|
+
* `{ type }`) regenerate every table from a new scale.
|
|
11
11
|
*
|
|
12
12
|
* Radius steps with the size token. The borderRadius knob overrides the
|
|
13
13
|
* painted corners while internal gap stays on the size recipe. `radiusPx`
|
|
14
|
-
* on inputs is the $4 / medium default
|
|
14
|
+
* on inputs is `$radius.true`, the $4 / medium default.
|
|
15
15
|
*
|
|
16
16
|
* Tamagui `createThemes` / theme-builder still emits COLOR palettes only.
|
|
17
17
|
* Do not stuff recipe keys into `getTheme()` / `themes`.
|
|
18
18
|
*/
|
|
19
|
+
import { type SizeRecipeToken } from "./scale/scaleInputs";
|
|
19
20
|
import { type TileSizeInputs, type TileSizeLadder } from "./tileSizes";
|
|
20
|
-
export
|
|
21
|
-
export type SizeRecipeToken
|
|
22
|
-
export type SizeRecipeFamilyName = "control" | "
|
|
21
|
+
export { SIZE_RECIPE_TOKENS, SIZE_TOKEN_EXPONENTS } from "./scale/scaleInputs";
|
|
22
|
+
export type { SizeRecipeToken } from "./scale/scaleInputs";
|
|
23
|
+
export type SizeRecipeFamilyName = "control" | "chip" | "menuRow" | "tab";
|
|
23
24
|
/** @deprecated Use `SizeRecipeFamilyName`. */
|
|
24
25
|
export type RecipeFamilyName = SizeRecipeFamilyName;
|
|
25
26
|
export type SizeRecipeRatios = {
|
|
@@ -37,46 +38,39 @@ export type SizeRecipeTokenChannels = {
|
|
|
37
38
|
};
|
|
38
39
|
export type SizeRecipeTokenTable = Partial<Record<SizeRecipeToken, SizeRecipeTokenChannels>>;
|
|
39
40
|
/**
|
|
40
|
-
* borderRadius knob stops (px)
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* borderRadius knob stops (px): the `$radius` tokens the knob resolves
|
|
42
|
+
* ($0/$2/$4/$6/$12). These shape overrides do not retarget the control's
|
|
43
|
+
* internal gap.
|
|
43
44
|
*/
|
|
44
45
|
export declare const SIZE_RECIPE_RADIUS_STOPS: {
|
|
45
|
-
readonly none:
|
|
46
|
-
readonly small:
|
|
47
|
-
readonly medium:
|
|
48
|
-
readonly large:
|
|
49
|
-
readonly full:
|
|
46
|
+
readonly none: number;
|
|
47
|
+
readonly small: number;
|
|
48
|
+
readonly medium: number;
|
|
49
|
+
readonly large: number;
|
|
50
|
+
readonly full: number;
|
|
50
51
|
};
|
|
51
52
|
export type SizeRecipeRadiusStop = keyof typeof SIZE_RECIPE_RADIUS_STOPS;
|
|
52
53
|
export type SizeRecipeInputs = {
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
/** `$size.$4` px of the scale the tables were generated from (`ScaleInputs.control`). */
|
|
55
|
+
control: number;
|
|
56
|
+
/** Body `$true` px of that scale (`ScaleInputs.type`); the label/icon ladders follow it. */
|
|
57
|
+
type: number;
|
|
55
58
|
tokenSteps: Record<string, number>;
|
|
56
|
-
/**
|
|
57
|
-
tokenHeights
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
sizeFactors?: Partial<Record<SizeRecipeToken, number>>;
|
|
63
|
-
/**
|
|
64
|
-
* Measured per-token channels (padX / font / icon / radius). When
|
|
65
|
-
* present, enumerable recipes read this table and set gap = radius.
|
|
66
|
-
* `{ baseHeight }` without an explicit tokenTable drops it so the
|
|
67
|
-
* geometric fallback can run.
|
|
68
|
-
*/
|
|
69
|
-
tokenTable?: SizeRecipeTokenTable;
|
|
70
|
-
/** Same-height tighter family (Chip / `recipeFamily="controlCompact"`). */
|
|
71
|
-
compactTokenTable?: SizeRecipeTokenTable;
|
|
59
|
+
/** Desktop px per recipe key: `$size` at the key. */
|
|
60
|
+
tokenHeights: Record<string, number>;
|
|
61
|
+
/** Per-token channels (padX / font / icon / radius); recipes set gap = radius. */
|
|
62
|
+
tokenTable: SizeRecipeTokenTable;
|
|
63
|
+
/** Same-height tighter family (Chip / `recipeFamily="chip"`). */
|
|
64
|
+
chipTokenTable: SizeRecipeTokenTable;
|
|
72
65
|
/**
|
|
73
66
|
* Input padX (one space half-step below the button at the same token).
|
|
74
|
-
* $4 =
|
|
67
|
+
* $4 = 14 vs the button's 16. Stored on inputs so the generator remains
|
|
75
68
|
* the single writer; Input consumes this, not a second handwritten map.
|
|
76
69
|
*/
|
|
77
|
-
inputPadX
|
|
70
|
+
inputPadX: Partial<Record<SizeRecipeToken, number>>;
|
|
71
|
+
/** Channel / height at $4; sizes recipes for heights off the table (touch, numeric `size`). */
|
|
78
72
|
ratios: SizeRecipeRatios;
|
|
79
|
-
|
|
73
|
+
chipRatios: SizeRecipeRatios;
|
|
80
74
|
radiusPx: number;
|
|
81
75
|
touchFloor: number;
|
|
82
76
|
/**
|
|
@@ -140,42 +134,13 @@ export type GeneratedSizeRecipes = {
|
|
|
140
134
|
/** Tile-size ladder (MPO-31) — derived from `inputs.tile` over the measured defaults. */
|
|
141
135
|
tiles: TileSizeLadder;
|
|
142
136
|
};
|
|
143
|
-
export declare const SIZE_TOKEN_EXPONENTS: Record<SizeRecipeToken, number>;
|
|
144
|
-
/** Lossless relative table: the stock Tamagui 20/24/28/32/36/40/44/52/64 ramp at baseHeight 44. */
|
|
145
|
-
export declare const defaultSizeFactors: Record<SizeRecipeToken, number>;
|
|
146
|
-
/**
|
|
147
|
-
* Measured Tamagui v5 Button ladder (rendered reference §6.1) plus the
|
|
148
|
-
* integer token-scale fills for stops the site did not photograph.
|
|
149
|
-
*
|
|
150
|
-
* padX = `$space` at the same key (2/4/7/10/13/16/18/24/32).
|
|
151
|
-
* radius = `$radius` at the same key (3/5/7/9/10/16); half-steps sit
|
|
152
|
-
* halfway on that scale (4/6/8) because v5 has no $1.5/$2.5/$3.5 radius.
|
|
153
|
-
* font = Inter body at the same key (11/12/13/14/16/18); half-steps take
|
|
154
|
-
* the next integer stop.
|
|
155
|
-
* icon steps with size and keeps the existing $4 = 16 contract.
|
|
156
|
-
* $2/$3/$4/$6 padX / font / radius are the photographed values (7/13/18/32,
|
|
157
|
-
* 12/13/14/18, 5/7/9/16).
|
|
158
|
-
*/
|
|
159
|
-
export declare const TAMAGUI_CONTROL_SIZE_TABLE: Record<SizeRecipeToken, SizeRecipeTokenChannels>;
|
|
160
|
-
/**
|
|
161
|
-
* Input padX — `getSpace(val, { shift: -1 })` on the v5 space scale
|
|
162
|
-
* (rendered reference §6.2). $2/$3/$4 are the photographed 4/10/16;
|
|
163
|
-
* $4 is 16 against the button's 18.
|
|
164
|
-
*/
|
|
165
|
-
export declare const TAMAGUI_INPUT_PADX: Record<SizeRecipeToken, number>;
|
|
166
|
-
/**
|
|
167
|
-
* controlCompact: same height / radius (so gap == radius) as control;
|
|
168
|
-
* padX is the Input table (one space half-step tighter); font/icon sit
|
|
169
|
-
* one type step below the control table.
|
|
170
|
-
*/
|
|
171
|
-
export declare const TAMAGUI_COMPACT_SIZE_TABLE: Record<SizeRecipeToken, SizeRecipeTokenChannels>;
|
|
172
137
|
export declare const DEFAULT_SIZE_RECIPE_INPUTS: SizeRecipeInputs;
|
|
173
138
|
export declare const defaultRecipeInputs: SizeRecipeInputs;
|
|
174
139
|
export declare const TOUCH_HEIGHT_FLOOR: number;
|
|
175
140
|
export declare function cloneSizeRecipeInputs(inputs: SizeRecipeInputs): SizeRecipeInputs;
|
|
176
141
|
/**
|
|
177
|
-
* Fill defaults. `{
|
|
178
|
-
*
|
|
142
|
+
* Fill defaults. `{ control }` / `{ type }` regenerate every table from a
|
|
143
|
+
* new scale; explicit tables, heights and ratios then merge over it per row.
|
|
179
144
|
*/
|
|
180
145
|
export declare function resolveSizeRecipeInputs(partial?: Partial<SizeRecipeInputs>): SizeRecipeInputs;
|
|
181
146
|
export declare const mergeRecipeInputs: typeof resolveSizeRecipeInputs;
|
|
@@ -204,7 +169,11 @@ export declare function resolveControlRadius(recipe: SizeRecipe, stop?: SizeReci
|
|
|
204
169
|
radius: number;
|
|
205
170
|
gap: number;
|
|
206
171
|
};
|
|
207
|
-
export declare function generateSizeRecipeTables(inputs: SizeRecipeInputs, ratios?: SizeRecipeRatios, table?: SizeRecipeTokenTable | undefined): SizeRecipeTables;
|
|
172
|
+
export declare function generateSizeRecipeTables(inputs: SizeRecipeInputs, ratios?: SizeRecipeRatios, table?: SizeRecipeTokenTable | undefined, heightOf?: (token: SizeRecipeToken) => number): SizeRecipeTables;
|
|
173
|
+
/** The recipe key one step below `token` on the ladder ($4 / $true -> $3.5, floor $1). */
|
|
174
|
+
export declare function recipeKeyBelow(token: SizeRecipeToken): SizeRecipeToken;
|
|
175
|
+
/** The recipe key one step above `token` on the ladder ($4 / $true -> $5, ceiling $6). */
|
|
176
|
+
export declare function recipeKeyAbove(token: SizeRecipeToken): SizeRecipeToken;
|
|
208
177
|
export declare function createRecipeFamilies(inputs?: SizeRecipeInputs | Partial<SizeRecipeInputs>): RecipeFamilies;
|
|
209
178
|
export declare function generateSizeRecipes(partial?: Partial<SizeRecipeInputs>): GeneratedSizeRecipes;
|
|
210
179
|
//# sourceMappingURL=recipeInputs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipeInputs.d.ts","sourceRoot":"","sources":["../../src/theme/recipeInputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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,eAAe,KAAK,MAAiD,GACtF,gBAAgB,CAmDlB;AAKD,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAGtE;AAED,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAGtE;AAsCD,wBAAgB,oBAAoB,CAClC,MAAM,GAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAM,GACxD,cAAc,CAyBhB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,oBAAoB,CAiBjG"}
|
package/types/theme/recipes.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MotionRole, MotionRoleName } from "./motion";
|
|
1
2
|
import type { ColorTokens, FontSizeTokens, TransitionProp } from "tamagui";
|
|
2
3
|
import type { Knobs } from "./knobs";
|
|
3
4
|
import type { HitSlopInsets } from "./layoutTokens";
|
|
@@ -5,7 +6,6 @@ export interface ControlStateProps {
|
|
|
5
6
|
borderRadius?: string;
|
|
6
7
|
borderWidth?: number;
|
|
7
8
|
backgroundColor?: string;
|
|
8
|
-
padding?: string;
|
|
9
9
|
/** Focus-visible ring (DG-A11Y-01); always ≥2 via `ensureFocusVisibleRing`. */
|
|
10
10
|
outlineWidth?: number;
|
|
11
11
|
outlineStyle?: "solid" | "none";
|
|
@@ -26,7 +26,7 @@ export interface ElevationPaintProps {
|
|
|
26
26
|
};
|
|
27
27
|
shadowOpacity?: number;
|
|
28
28
|
shadowRadius?: number;
|
|
29
|
-
/** Web:
|
|
29
|
+
/** Web: size-formula shadow with var(--shadowColor), matching the shadow props. */
|
|
30
30
|
style?: {
|
|
31
31
|
boxShadow: string;
|
|
32
32
|
};
|
|
@@ -43,7 +43,7 @@ export interface ElevationStateProps extends ElevationPaintProps {
|
|
|
43
43
|
* `inputBackground`; overlays read `elevatedSurface.backgroundColor`.
|
|
44
44
|
*/
|
|
45
45
|
export interface ElevationChromeProps extends ElevationPaintProps {
|
|
46
|
-
/** Android dp
|
|
46
|
+
/** Android dp is twice the size-formula offsetY. */
|
|
47
47
|
elevation?: number;
|
|
48
48
|
}
|
|
49
49
|
/** Text-bearing control chrome (Button, Chip, Input.Box): muted fill/border, no opacity. */
|
|
@@ -164,12 +164,15 @@ export interface KnobProps {
|
|
|
164
164
|
};
|
|
165
165
|
/**
|
|
166
166
|
* Axiom 1 child-clip cap for padded containers (Card/Panel/DialogContent):
|
|
167
|
-
*
|
|
167
|
+
* two radius keys above the control, or the padding px once it would exceed
|
|
168
168
|
* the container's own inset. Spread after the radius-bearing fragment.
|
|
169
169
|
*/
|
|
170
170
|
containerRadius: {
|
|
171
171
|
borderRadius: string | number;
|
|
172
172
|
} & CornerSmoothingCarrier;
|
|
173
|
+
fieldRadius: {
|
|
174
|
+
borderRadius: string | number;
|
|
175
|
+
} & CornerSmoothingCarrier;
|
|
173
176
|
/** Size token on web ("$1"); numeric tokens.size value on native (RN-safe). */
|
|
174
177
|
elevation: string | number | undefined;
|
|
175
178
|
/**
|
|
@@ -180,9 +183,10 @@ export interface KnobProps {
|
|
|
180
183
|
overlayElevation: string | number | undefined;
|
|
181
184
|
/**
|
|
182
185
|
* Complete shadow fragment for E-CONTROL / wrapper Views. Spread whole.
|
|
183
|
-
* Empty when `elevation=none`. Android `elevation` here is
|
|
186
|
+
* Empty when `elevation=none`. Android `elevation` here is twice the size-formula offsetY.
|
|
184
187
|
*/
|
|
185
188
|
elevationChrome: ElevationChromeProps;
|
|
189
|
+
thumbShadow: ElevationChromeProps;
|
|
186
190
|
/** Resolved scheme the fragments were built for (LC-85). */
|
|
187
191
|
scheme: "light" | "dark";
|
|
188
192
|
surface: {
|
|
@@ -220,31 +224,38 @@ export interface KnobProps {
|
|
|
220
224
|
inputSurface: {
|
|
221
225
|
borderWidth: number;
|
|
222
226
|
};
|
|
227
|
+
/** Container inset role (SP-GAP): `$space.$4` of the active scale. */
|
|
223
228
|
panelPadding: {
|
|
224
229
|
padding: string;
|
|
225
230
|
};
|
|
231
|
+
/** Tight role (SP-GAP): label to control, chip to chip, icon to text. `$space.$2`. */
|
|
232
|
+
gapSm: {
|
|
233
|
+
gap: string;
|
|
234
|
+
};
|
|
235
|
+
/** Within-group role (SP-GAP): field to field, row to row. `$space.$3`. */
|
|
226
236
|
gap: {
|
|
227
237
|
gap: string;
|
|
228
238
|
};
|
|
239
|
+
/** Between-groups role (SP-GAP): section to section. `$space.$5`. */
|
|
229
240
|
gapLg: {
|
|
230
241
|
gap: string;
|
|
231
242
|
};
|
|
232
243
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* `
|
|
244
|
+
* The size token this subtree renders controls at: Tamagui's own `size`
|
|
245
|
+
* key ("$4", "$3"), from a `size` prop or a `<Surface size>` ceiling,
|
|
246
|
+
* `$true` by default. styled() variants switch on it; control internals
|
|
247
|
+
* read `control` / `controlType` / `controlIcon` (LC-65).
|
|
236
248
|
*/
|
|
237
249
|
sizeToken: string;
|
|
238
250
|
/**
|
|
239
|
-
* Control-chrome type (labels, calendar digits, weekday headers)
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
* box), not a type step ($4 font = 14px).
|
|
251
|
+
* Control-chrome type (labels, calendar digits, weekday headers): the body
|
|
252
|
+
* key one below `sizeToken`. NEVER pass `sizeToken` as `fontSize`: that
|
|
253
|
+
* token is a control HEIGHT ($4 = 40px box), not a type step.
|
|
243
254
|
*/
|
|
244
255
|
label: {
|
|
245
256
|
fontSize: FontSizeTokens;
|
|
246
257
|
fontFamily: string;
|
|
247
|
-
fontWeight
|
|
258
|
+
fontWeight?: string;
|
|
248
259
|
};
|
|
249
260
|
/**
|
|
250
261
|
* Nested hit-target (calendar days, overlay chips): visual box BELOW the
|
|
@@ -276,9 +287,49 @@ export interface KnobProps {
|
|
|
276
287
|
width: number;
|
|
277
288
|
height: number;
|
|
278
289
|
};
|
|
290
|
+
/**
|
|
291
|
+
* Menu / listbox / command row box from the `menuRow` family: one size key
|
|
292
|
+
* below the control token (36 at default), padX `$3`, 44 on touch.
|
|
293
|
+
* Spread whole onto the row; Select reads `minHeight` as its row pitch.
|
|
294
|
+
*/
|
|
295
|
+
menuRow: {
|
|
296
|
+
minHeight: number;
|
|
297
|
+
paddingHorizontal: number;
|
|
298
|
+
gap: number;
|
|
299
|
+
};
|
|
300
|
+
/** Menu row type: the control token's own label size. Spread whole. */
|
|
301
|
+
menuRowType: {
|
|
302
|
+
fontSize: number;
|
|
303
|
+
};
|
|
304
|
+
/** Tab box from the `tab` family: height and padX one key below the control token, 44 on touch. */
|
|
305
|
+
tab: {
|
|
306
|
+
height: number;
|
|
307
|
+
paddingHorizontal: number;
|
|
308
|
+
gap: number;
|
|
309
|
+
};
|
|
310
|
+
/** Tab type: the control token's own label size. Spread whole. */
|
|
311
|
+
tabType: {
|
|
312
|
+
fontSize: number;
|
|
313
|
+
};
|
|
314
|
+
/** Press-target extension that lifts the painted tab to the 44 press target (zero once it paints 44). */
|
|
315
|
+
tabHitSlop: HitSlopInsets;
|
|
316
|
+
/**
|
|
317
|
+
* Top-bar fragment (Navbar, DeskShell, BackofficeShell, Awesomebar): spread
|
|
318
|
+
* `frame` onto the bar row and render bar controls at `sizeToken` (wrap
|
|
319
|
+
* them in `<Surface size={bar.sizeToken}>`). `frame.minHeight` is the
|
|
320
|
+
* default control height plus the vertical padding, 52 at default.
|
|
321
|
+
*/
|
|
322
|
+
bar: {
|
|
323
|
+
frame: {
|
|
324
|
+
paddingVertical: string;
|
|
325
|
+
paddingHorizontal: string;
|
|
326
|
+
minHeight: number;
|
|
327
|
+
};
|
|
328
|
+
sizeToken: "$3";
|
|
329
|
+
};
|
|
279
330
|
heading: {
|
|
280
331
|
fontFamily: string;
|
|
281
|
-
fontWeight
|
|
332
|
+
fontWeight?: string;
|
|
282
333
|
};
|
|
283
334
|
/**
|
|
284
335
|
* Page-title type step (D-11 hero-H1 dial) — the complete size fragment for
|
|
@@ -295,19 +346,29 @@ export interface KnobProps {
|
|
|
295
346
|
fontWeight: string;
|
|
296
347
|
color?: ColorTokens;
|
|
297
348
|
};
|
|
349
|
+
typography: {
|
|
350
|
+
mutedMono: {
|
|
351
|
+
fontFamily: "$mono";
|
|
352
|
+
color: string;
|
|
353
|
+
};
|
|
354
|
+
tabular: {
|
|
355
|
+
fontVariant?: ["tabular-nums"];
|
|
356
|
+
style?: {
|
|
357
|
+
fontVariantNumeric: "tabular-nums";
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
};
|
|
298
361
|
textWeight: {
|
|
299
362
|
fontWeight: string;
|
|
300
363
|
};
|
|
364
|
+
motion: Record<MotionRoleName, MotionRole>;
|
|
365
|
+
/** @deprecated read a role from knobProps.motion */
|
|
301
366
|
transition: TransitionProp | undefined;
|
|
302
367
|
outlined: boolean;
|
|
303
368
|
pointy: boolean;
|
|
304
369
|
textAccent: string;
|
|
305
370
|
textAccentColor: string;
|
|
306
371
|
inputBackground: string;
|
|
307
|
-
space: string;
|
|
308
|
-
size: string;
|
|
309
|
-
/** Effective density mode after compact override resolution. */
|
|
310
|
-
density: string;
|
|
311
372
|
/** House decision knobs — pass-through for consumers (forms/tables). */
|
|
312
373
|
fieldLabelPlacement: string;
|
|
313
374
|
requiredMarking: 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;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
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SAAS,CAAC;IACrB,OAAO,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACvC,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IACjC,SAAS,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAC3C,mFAAmF;IACnF,aAAa,EAAE,cAAc,CAAC;CAC/B;AAED,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
import type { FontSizeTokens } from "tamagui";
|
|
2
|
-
import type { Knobs, PageTitleScale } from "./knobs";
|
|
2
|
+
import type { Elevation, Knobs, PageTitleScale } from "./knobs";
|
|
3
|
+
import { type SizeKey } from "./scale/scaleInputs";
|
|
3
4
|
import type { KnobPropsOverride, ResolvedKnobs } from "./recipes";
|
|
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
|
-
*/
|
|
8
|
-
export declare const compactSizeMap: Record<Knobs["size"], Knobs["size"]>;
|
|
9
|
-
/** Step space down one level for compact density. */
|
|
10
|
-
export declare const compactSpaceMap: Record<Knobs["space"], Knobs["space"]>;
|
|
11
|
-
/**
|
|
12
|
-
* Apply density mode to knobs before token resolution.
|
|
13
|
-
*
|
|
14
|
-
* - `density: "compact"` steps **space only** (`compactSpaceMap`). Size is an
|
|
15
|
-
* independent axis (LC-76) — compact must not shrink controls.
|
|
16
|
-
* - `compactOverride` wins over the density knob when provided:
|
|
17
|
-
* `true` forces compact space stepping; `false` forces comfortable (no step).
|
|
18
|
-
*/
|
|
19
|
-
export declare function applyDensity(knobs: Knobs, compactOverride?: boolean): Knobs;
|
|
20
5
|
export declare const borderRadiusMap: {
|
|
21
6
|
readonly none: "$0";
|
|
22
7
|
readonly small: "$2";
|
|
@@ -24,6 +9,20 @@ export declare const borderRadiusMap: {
|
|
|
24
9
|
readonly large: "$6";
|
|
25
10
|
readonly full: "$12";
|
|
26
11
|
};
|
|
12
|
+
export declare const containerRadiusMap: {
|
|
13
|
+
readonly none: "$0";
|
|
14
|
+
readonly small: "$4";
|
|
15
|
+
readonly medium: "$6";
|
|
16
|
+
readonly large: "$8";
|
|
17
|
+
readonly full: "$12";
|
|
18
|
+
};
|
|
19
|
+
export declare const spacingRoles: {
|
|
20
|
+
readonly gapSm: "$2";
|
|
21
|
+
readonly gap: "$3";
|
|
22
|
+
readonly gapLg: "$5";
|
|
23
|
+
readonly panelPadding: "$4";
|
|
24
|
+
readonly featurePadding: "$6";
|
|
25
|
+
};
|
|
27
26
|
/**
|
|
28
27
|
* Resolve a page-title scale to its complete size fragment (D-11).
|
|
29
28
|
*
|
|
@@ -34,12 +33,15 @@ export declare const borderRadiusMap: {
|
|
|
34
33
|
export declare function resolvePageTitleScale(scale: PageTitleScale): {
|
|
35
34
|
size: FontSizeTokens;
|
|
36
35
|
};
|
|
36
|
+
/** The installed scale's `panelPadding` role in px. */
|
|
37
|
+
export declare function panelPaddingPx(): number;
|
|
37
38
|
/**
|
|
38
39
|
* Cap a container's radius at its own padding (Axiom 1 CLIP: "my children's
|
|
39
40
|
* pixel clips first → cap at padding"). Returns the radius token untouched
|
|
40
41
|
* while it fits, or the padding px number once the token would exceed it.
|
|
41
42
|
*/
|
|
42
|
-
export declare function capContainerRadius(borderRadius: Knobs["borderRadius"]
|
|
43
|
+
export declare function capContainerRadius(borderRadius: Knobs["borderRadius"]): string | number;
|
|
44
|
+
export declare function capFieldRadius(borderRadius: Knobs["borderRadius"]): string | number;
|
|
43
45
|
/**
|
|
44
46
|
* The borderRadius knob stop a `borderRadiusMap` token came from, so a part
|
|
45
47
|
* can resolve its DG-RAD class at that stop. Undefined for any value the
|
|
@@ -51,32 +53,62 @@ export declare function radiusStopFromToken(token: unknown): Knobs["borderRadius
|
|
|
51
53
|
* `StackedRow` is one row of a vertical stack: it also carries
|
|
52
54
|
* `data-stack-position`, and only its outer corners take the cap.
|
|
53
55
|
* `OwnInset` pads with a fixed token instead of panelPadding, so the audit
|
|
54
|
-
* caps it at its measured padding
|
|
56
|
+
* caps it at its measured padding.
|
|
55
57
|
*/
|
|
56
58
|
export type CappedContainer = "PageSection" | "TextArea" | "StackedRow" | "OwnInset";
|
|
57
59
|
export interface ContainerCapDeclaration {
|
|
58
60
|
"data-constraint-container": CappedContainer;
|
|
59
61
|
"data-radius-knob": Knobs["borderRadius"];
|
|
60
|
-
"data-space-knob": Knobs["space"];
|
|
61
62
|
}
|
|
62
63
|
/**
|
|
63
|
-
* Declare a container that spreads `containerRadius`, with the knob
|
|
64
|
+
* Declare a container that spreads `containerRadius`, with the knob stop it
|
|
64
65
|
* resolved, so the constraint audit checks its painted corners against
|
|
65
|
-
* `capContainerRadius` for
|
|
66
|
-
*
|
|
67
|
-
* Returns nothing when `radiusToken` is not a
|
|
68
|
-
* `
|
|
66
|
+
* `capContainerRadius` for that stop on the page's scale, or `capFieldRadius`
|
|
67
|
+
* for TextArea's `fieldRadius`. The input is always the CONTROL token. The cap is a
|
|
68
|
+
* padding px value, not a radius token. Returns nothing when `radiusToken` is not a
|
|
69
|
+
* `borderRadiusMap` token: a part whose radius did not come from the knob
|
|
69
70
|
* makes no claim.
|
|
70
71
|
*
|
|
71
72
|
* @example
|
|
72
|
-
* <YStack {...knobProps.containerRadius} {...containerCapProps("PageSection", knobProps.borderRadius.borderRadius
|
|
73
|
+
* <YStack {...knobProps.containerRadius} {...containerCapProps("PageSection", knobProps.borderRadius.borderRadius)} />
|
|
74
|
+
*/
|
|
75
|
+
export declare function containerCapProps(container: CappedContainer, radiusToken: unknown): ContainerCapDeclaration | undefined;
|
|
76
|
+
/** `sizeToken` when it is a `$size` key, else `$true`. */
|
|
77
|
+
export declare function normalizeSizeToken(sizeToken: string | undefined): SizeKey;
|
|
78
|
+
/** Painted px of a nested hit-target (calendar days) at `sizeToken`: 32/44 of the token's `$size`. */
|
|
79
|
+
export declare function nestedControlPx(sizeToken: string): number;
|
|
80
|
+
/**
|
|
81
|
+
* The whole key one below a size key ($4 / $true -> $3, $3 -> $2,
|
|
82
|
+
* $3.5 -> $3, floor $1). Parts drawn one step under their control (tags,
|
|
83
|
+
* avatars) read it.
|
|
73
84
|
*/
|
|
74
|
-
export declare function
|
|
75
|
-
|
|
76
|
-
export declare
|
|
77
|
-
|
|
85
|
+
export declare function sizeKeyBelow(sizeToken: string): `$${number}`;
|
|
86
|
+
/** The body font key at the size key; half steps round up, and `$true` stays `$true`. */
|
|
87
|
+
export declare function labelFontSizeFor(sizeToken: string): FontSizeTokens;
|
|
88
|
+
export declare function getHeadingFontFamily(category: Knobs["headingFont"]): string;
|
|
89
|
+
export declare const elevationMap: Record<Elevation, SizeKey | undefined>;
|
|
90
|
+
export declare const overlayElevationMap: Record<Elevation, SizeKey | undefined>;
|
|
78
91
|
export type ColorScheme = "light" | "dark";
|
|
79
|
-
export declare function
|
|
92
|
+
export declare function sizedElevation(px: number): {
|
|
93
|
+
offsetY: number;
|
|
94
|
+
radius: number;
|
|
95
|
+
android: number;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* A content card on a painted parent sits one ramp step off it, so the box
|
|
99
|
+
* reads without a shadow (nested surfaces never re-elevate).
|
|
100
|
+
*/
|
|
101
|
+
export declare const paintedCardFill = "$color2";
|
|
102
|
+
/** What the subtree supplies beyond knobs: the pointer surface and the control size token. */
|
|
103
|
+
export interface ResolveKnobsEnvironment {
|
|
80
104
|
touch?: boolean;
|
|
81
|
-
|
|
105
|
+
/** Tamagui size key the controls render at. Default `$true`. */
|
|
106
|
+
sizeToken?: string;
|
|
107
|
+
/**
|
|
108
|
+
* An ancestor already paints a surface box: `elevatedSurface` goes border
|
|
109
|
+
* only (no second shadow) and `cardSurface` steps one fill off the parent.
|
|
110
|
+
*/
|
|
111
|
+
painted?: boolean;
|
|
112
|
+
}
|
|
113
|
+
export declare function resolveKnobs(knobs: Knobs, override?: KnobPropsOverride, scheme?: ColorScheme, environment?: ResolveKnobsEnvironment): ResolvedKnobs;
|
|
82
114
|
//# sourceMappingURL=resolveKnobs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveKnobs.d.ts","sourceRoot":"","sources":["../../src/theme/resolveKnobs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveKnobs.d.ts","sourceRoot":"","sources":["../../src/theme/resolveKnobs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAY9C,OAAO,KAAK,EAAmB,SAAS,EAAE,KAAK,EAAE,cAAc,EAAc,MAAM,SAAS,CAAC;AAG7F,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAOV,iBAAiB,EAEjB,aAAa,EAEd,MAAM,WAAW,CAAC;AAKnB,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AAuCX,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAqBX;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAErF;AAiBD,uDAAuD;AACvD,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,MAAM,GAAG,MAAM,CAIvF;AAED,wBAAgB,cAAc,CAAC,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,MAAM,GAAG,MAAM,CAKnF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,SAAS,CAIrF;AAED;;;;;;GAMG;AACH,MAAM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C,EAAE,OAAO,CAAC;IAChB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,MAAM,GAAE,WAAqB,EAC7B,WAAW,CAAC,EAAE,uBAAuB,GACpC,aAAa,CAmPf"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ScaleSource } from "./useActiveScale";
|
|
2
|
+
/** Every registered scale's repaint block, default first (it has none). */
|
|
3
|
+
export declare function scaleStyleSheet(scales: ScaleSource["scales"]): string;
|
|
4
|
+
/** The `data-mp-scale` value for a preset name; no name leaves the attribute off. */
|
|
5
|
+
export declare function scaleAttributeValue(presetName?: string): string | undefined;
|
|
6
|
+
export interface ScaleStylesProps {
|
|
7
|
+
config?: ScaleSource;
|
|
8
|
+
presetName?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Web scale repaint: one hoisted stylesheet with every registered scale's
|
|
12
|
+
* `:root[data-mp-scale=…]` block (server-rendered, so first paint is
|
|
13
|
+
* right), and the `<html>` attribute that selects the active one. Switching
|
|
14
|
+
* presets flips the attribute and every token-driven style repaints through
|
|
15
|
+
* its CSS variable with no re-render.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ScaleStyles({ config, presetName }: ScaleStylesProps): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
//# sourceMappingURL=ScaleStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScaleStyles.d.ts","sourceRoot":"","sources":["../../../src/theme/scale/ScaleStyles.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAKrE;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE3E;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,gBAAgB,kDAiBnE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ScaleSource } from "./useActiveScale";
|
|
2
|
+
export declare function scaleStyleSheet(_scales: ScaleSource["scales"]): string;
|
|
3
|
+
export declare function scaleAttributeValue(presetName?: string): string | undefined;
|
|
4
|
+
export interface ScaleStylesProps {
|
|
5
|
+
config?: ScaleSource;
|
|
6
|
+
presetName?: string;
|
|
7
|
+
}
|
|
8
|
+
/** Native has no CSS variables; a scale switch remounts the provider subtree instead. */
|
|
9
|
+
export declare function ScaleStyles(_props: ScaleStylesProps): null;
|
|
10
|
+
//# sourceMappingURL=ScaleStyles.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScaleStyles.native.d.ts","sourceRoot":"","sources":["../../../src/theme/scale/ScaleStyles.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAEtE;AAED,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE3E;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,MAAM,EAAE,gBAAgB,QAEnD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ScaleTokens } from "./generateScale";
|
|
2
|
+
/** The token values of the installed scale (the default scale until a preset switches it). */
|
|
3
|
+
export declare function getActiveScaleTokens(): ScaleTokens;
|
|
4
|
+
/** Called by `applyThemeScale`; px readers below follow it on their next render. */
|
|
5
|
+
export declare function setActiveScaleTokens(tokens: ScaleTokens): void;
|
|
6
|
+
/**
|
|
7
|
+
* The installed scale's radius for a px literal written against the default
|
|
8
|
+
* scale: the value
|
|
9
|
+
* at the same `$radius` key. A px that is not a default radius token passes
|
|
10
|
+
* through unchanged.
|
|
11
|
+
*/
|
|
12
|
+
export declare function scaleRadiusPx(defaultPx: number): number;
|
|
13
|
+
//# sourceMappingURL=activeScale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activeScale.d.ts","sourceRoot":"","sources":["../../../src/theme/scale/activeScale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAOlE,8FAA8F;AAC9F,wBAAgB,oBAAoB,IAAI,WAAW,CAElD;AAED,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAMvD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SizeRecipeInputs } from "../recipeInputs";
|
|
2
|
+
import type { ScaleCore } from "./generateScale";
|
|
3
|
+
/**
|
|
4
|
+
* Size-recipe inputs read off a generated scale: height = `$size`, button
|
|
5
|
+
* padX = `$space` at the same key, input/chip padX one half step below,
|
|
6
|
+
* radius (and so gap, LC-75) = `$radius`, label from body type and icon from
|
|
7
|
+
* the type-relative control ladder. Nothing here is a second px source.
|
|
8
|
+
*/
|
|
9
|
+
export declare function deriveRecipeInputs(scale: ScaleCore): SizeRecipeInputs;
|
|
10
|
+
//# sourceMappingURL=deriveRecipeInputs.d.ts.map
|