@multiplatform.one/theme 7.4.1 → 7.5.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/README.md +2 -1
- package/package.json +5 -5
- package/src/figma/figmaTokens.spec.ts +25 -21
- package/src/figma/figmaTokens.ts +2 -2
- package/src/font.ts +6 -19
- package/src/keyboardFocusRing.ts +12 -6
- package/src/theme/FontKnobStyles.tsx +5 -3
- package/src/theme/Tint.tsx +3 -2
- package/src/theme/animations/css.ts +14 -1
- package/src/theme/colorRules.spec.ts +233 -2
- package/src/theme/colorRules.ts +118 -0
- package/src/theme/cornerSmoothing.native.ts +39 -2
- package/src/theme/cornerSmoothing.spec.ts +213 -3
- package/src/theme/cornerSmoothing.ts +132 -10
- package/src/theme/createDefaultThemeConfig.spec.ts +107 -1
- package/src/theme/createDefaultThemeConfig.ts +27 -8
- package/src/theme/defaults/builderOptions.ts +23 -10
- package/src/theme/defaults/categoryFonts.ts +21 -0
- package/src/theme/defaults/fonts.spec.ts +93 -10
- package/src/theme/defaults/fonts.theme.spec.tsx +128 -0
- package/src/theme/defaults/fonts.ts +155 -27
- package/src/theme/defaults/index.ts +1 -0
- package/src/theme/devtools/ThemeDevtoolsPanel.tsx +0 -11
- package/src/theme/focusState.spec.ts +110 -1
- package/src/theme/focusState.ts +32 -7
- package/src/theme/fontCategoryStacks.ts +24 -0
- package/src/theme/fontKnobStyles.spec.ts +15 -2
- package/src/theme/glyphPaint.spec.ts +26 -0
- package/src/theme/glyphPaint.ts +46 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/knobs.ts +18 -2
- package/src/theme/layoutTokens.spec.ts +3 -1
- package/src/theme/layoutTokens.ts +47 -4
- package/src/theme/mpo13Proof.spec.ts +3 -3
- package/src/theme/mpo19Proof.spec.ts +285 -0
- package/src/theme/presets.ts +1 -1
- package/src/theme/radiusClass.spec.ts +394 -0
- package/src/theme/radiusClass.ts +203 -4
- package/src/theme/radiusClassTable.generated.ts +121 -0
- package/src/theme/recipeInputs.ts +223 -36
- package/src/theme/recipes.ts +68 -4
- package/src/theme/resolveKnobs.spec.ts +139 -11
- package/src/theme/resolveKnobs.ts +190 -25
- package/src/theme/sizeLadder.spec.ts +84 -0
- package/src/theme/sizeRecipes.spec.ts +19 -6
- package/src/theme/sizeRecipes.ts +43 -13
- package/src/theme/theme.native.tsx +2 -0
- package/src/theme/theme.provider.spec.ts +9 -0
- package/src/theme/theme.tsx +6 -3
- package/src/theme/tint.spec.tsx +36 -35
- package/src/theme/useResolvedKnobs.ts +6 -3
- package/types/figma/figmaTokens.d.ts +1 -1
- package/types/figma/figmaTokens.d.ts.map +1 -1
- package/types/font.d.ts.map +1 -1
- package/types/keyboardFocusRing.d.ts +11 -5
- package/types/keyboardFocusRing.d.ts.map +1 -1
- package/types/theme/FontKnobStyles.d.ts +2 -1
- package/types/theme/FontKnobStyles.d.ts.map +1 -1
- package/types/theme/Tint.d.ts +2 -1
- package/types/theme/Tint.d.ts.map +1 -1
- package/types/theme/animations/css.d.ts +15 -2
- package/types/theme/animations/css.d.ts.map +1 -1
- package/types/theme/colorRules.d.ts +59 -1
- package/types/theme/colorRules.d.ts.map +1 -1
- package/types/theme/cornerSmoothing.d.ts +42 -20
- package/types/theme/cornerSmoothing.d.ts.map +1 -1
- package/types/theme/cornerSmoothing.native.d.ts +22 -2
- package/types/theme/cornerSmoothing.native.d.ts.map +1 -1
- package/types/theme/createDefaultThemeConfig.d.ts +21 -3
- package/types/theme/createDefaultThemeConfig.d.ts.map +1 -1
- package/types/theme/defaults/builderOptions.d.ts.map +1 -1
- package/types/theme/defaults/categoryFonts.d.ts +19 -0
- package/types/theme/defaults/categoryFonts.d.ts.map +1 -0
- package/types/theme/defaults/fonts.d.ts +135 -2
- package/types/theme/defaults/fonts.d.ts.map +1 -1
- 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.map +1 -1
- package/types/theme/focusState.d.ts +32 -6
- package/types/theme/focusState.d.ts.map +1 -1
- package/types/theme/fontCategoryStacks.d.ts +11 -0
- package/types/theme/fontCategoryStacks.d.ts.map +1 -0
- package/types/theme/glyphPaint.d.ts +16 -0
- package/types/theme/glyphPaint.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 +10 -2
- package/types/theme/knobs.d.ts.map +1 -1
- package/types/theme/layoutTokens.d.ts +46 -4
- package/types/theme/layoutTokens.d.ts.map +1 -1
- package/types/theme/radiusClass.d.ts +96 -4
- package/types/theme/radiusClass.d.ts.map +1 -1
- package/types/theme/radiusClassTable.generated.d.ts +146 -0
- package/types/theme/radiusClassTable.generated.d.ts.map +1 -0
- package/types/theme/recipeInputs.d.ts +85 -14
- package/types/theme/recipeInputs.d.ts.map +1 -1
- package/types/theme/recipes.d.ts +78 -4
- package/types/theme/recipes.d.ts.map +1 -1
- package/types/theme/resolveKnobs.d.ts +12 -1
- package/types/theme/resolveKnobs.d.ts.map +1 -1
- package/types/theme/sizeRecipes.d.ts +27 -14
- package/types/theme/sizeRecipes.d.ts.map +1 -1
- package/types/theme/theme.d.ts.map +1 -1
- package/types/theme/theme.native.d.ts.map +1 -1
- package/types/theme/useResolvedKnobs.d.ts +2 -2
- package/types/theme/useResolvedKnobs.d.ts.map +1 -1
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"knobs.d.ts","sourceRoot":"","sources":["../../src/theme/knobs.ts"],"names":[],"mappings":"AAEA,sHAAsH;AACtH,eAAO,MAAM,SAAS;;;CAAsD,CAAC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IAClC,WAAW,EAAE,WAAW,CAAC;IACzB,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"}
|
|
@@ -31,20 +31,46 @@
|
|
|
31
31
|
* (840→860). Fluent sm=640 matches medium; Fluent lg=1024 matches large.
|
|
32
32
|
*/
|
|
33
33
|
export type LayoutSizeClass = "compact" | "medium" | "expanded" | "large" | "xl";
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Named min-widths. Prefer these over literals in layout code.
|
|
36
|
+
*
|
|
37
|
+
* MPO-19 X11: the four names below used to be the whole table, so a
|
|
38
|
+
* responsive design authored in Tamagui idiom named three breakpoints mpo
|
|
39
|
+
* layout code could not — `xs` 460, `md` 768 and `xxl` 1536 simply had no
|
|
40
|
+
* spelling here. The 860 pane threshold has an argument behind it and stays;
|
|
41
|
+
* the MISSING names had no argument at all, which is why they are added
|
|
42
|
+
* unconditionally and the pivot question is not settled here.
|
|
43
|
+
*
|
|
44
|
+
* The Tamagui-named entries carry Tamagui's numbers, exactly. A shared name
|
|
45
|
+
* meaning a different width is the failure this table is supposed to prevent.
|
|
46
|
+
*/
|
|
35
47
|
export declare const layoutBreakpoints: {
|
|
48
|
+
/** Tamagui `$xxs`. Smallest phones. */
|
|
49
|
+
readonly xxs: 340;
|
|
50
|
+
/** Tamagui `$xs`. */
|
|
51
|
+
readonly xs: 460;
|
|
36
52
|
/**
|
|
37
53
|
* End of compact / DeskShell narrow drawer threshold (Tamagui `$sm`).
|
|
38
54
|
* Also the overlay sheet↔float pivot and the DataTable card↔grid pivot —
|
|
39
55
|
* one idiom flip per viewport (MPO-13 C5).
|
|
40
56
|
*/
|
|
41
57
|
readonly medium: 640;
|
|
58
|
+
/**
|
|
59
|
+
* Tamagui `$md` — the width `<Adapt when="maxMd">` pivots on. Whether the
|
|
60
|
+
* overlay pivot should MOVE here from `medium`, and `expanded` be deleted,
|
|
61
|
+
* is the open half of X11; it decides together with GL-47 / MPO-21, so it
|
|
62
|
+
* is not decided here. Naming it costs nothing and is what lets that
|
|
63
|
+
* question be asked in code.
|
|
64
|
+
*/
|
|
65
|
+
readonly md: 768;
|
|
42
66
|
/** Two-pane budget threshold (~M3 expanded 840). Not an overlay pivot. */
|
|
43
67
|
readonly expanded: 860;
|
|
44
68
|
/** Tamagui `$lg`. */
|
|
45
69
|
readonly large: 1024;
|
|
46
70
|
/** Tamagui `$xl`. */
|
|
47
71
|
readonly xl: 1280;
|
|
72
|
+
/** Tamagui `$xxl`. */
|
|
73
|
+
readonly xxl: 1536;
|
|
48
74
|
};
|
|
49
75
|
export type LayoutBreakpointName = keyof typeof layoutBreakpoints;
|
|
50
76
|
/**
|
|
@@ -113,9 +139,9 @@ export declare function pressTargetHitSlop(visualSize: number, min?: number): Hi
|
|
|
113
139
|
* stay start-aligned (flush with the trigger's leading edge).
|
|
114
140
|
* - Pointer-positioned CONTEXT MENUS and free POPOVERS/TOOLTIPS size to
|
|
115
141
|
* content, start-aligned to their anchor.
|
|
116
|
-
* -
|
|
117
|
-
*
|
|
118
|
-
* shift/flip at viewport edges instead of overflowing.
|
|
142
|
+
* - FREE overlays (tooltips, pointer-positioned context menus, popovers with
|
|
143
|
+
* no owning control) keep `OVERLAY_ANCHOR_GAP` px between anchor edge and
|
|
144
|
+
* overlay, and shift/flip at viewport edges instead of overflowing.
|
|
119
145
|
* - ONE SURFACE OWNER per overlay: the overlay frame draws the single
|
|
120
146
|
* border + radius. When a panel intentionally covers its trigger
|
|
121
147
|
* (Select's macOS-style aligned listbox), the covered trigger must not
|
|
@@ -123,6 +149,22 @@ export declare function pressTargetHitSlop(visualSize: number, min?: number): Hi
|
|
|
123
149
|
* box would ghost around the overlay's corners as a doubled edge.
|
|
124
150
|
*/
|
|
125
151
|
export declare const OVERLAY_ANCHOR_GAP = 4;
|
|
152
|
+
/**
|
|
153
|
+
* Clay's FloatingPanel ruling, 2026-08-28 (MPO-38). COVER is the defining
|
|
154
|
+
* behaviour of the FloatingPanel family: a panel attaches to the trigger it
|
|
155
|
+
* was opened from and does not float clear of it. Floating 4px below is the
|
|
156
|
+
* EXCEPTION, not the rule, and no member takes it unless Clay rules it.
|
|
157
|
+
*
|
|
158
|
+
* So the family anchors at zero: the panel's top edge coincides with the
|
|
159
|
+
* trigger's bottom edge (or, for the covering members — Select and
|
|
160
|
+
* single-value Combobox — with the trigger's own top edge). `OVERLAY_ANCHOR_GAP`
|
|
161
|
+
* stays 4 for FREE overlays, which have no trigger to attach to.
|
|
162
|
+
*
|
|
163
|
+
* Measured before this landed (playwright, 1440x900 DPR 2, real components):
|
|
164
|
+
* DropdownMenu 3.96, DatePicker 4.00, TimePicker 4.00, ColorPicker 4.00 px of
|
|
165
|
+
* daylight between trigger bottom and panel top.
|
|
166
|
+
*/
|
|
167
|
+
export declare const OVERLAY_ATTACH_GAP = 0;
|
|
126
168
|
/**
|
|
127
169
|
* Semantic spacing roles map onto the space-knob recipes:
|
|
128
170
|
* `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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AASH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC;AAEjF
|
|
1
|
+
{"version":3,"file":"layoutTokens.d.ts","sourceRoot":"","sources":["../../src/theme/layoutTokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AASH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC;AAEjF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB;IAC5B,uCAAuC;;IAEvC,qBAAqB;;IAErB;;;;OAIG;;IAEH;;;;;;OAMG;;IAEH,0EAA0E;;IAE1E,qBAAqB;;IAErB,qBAAqB;;IAErB,sBAAsB;;CAEd,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAElE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,KAA2B,CAAC;AAE3D,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,KAA2B,CAAC;AAE1D,eAAO,MAAM,uBAAuB,EAAE,SAAS,eAAe,EAMpD,CAAC;AAEX,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MA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EAAE,MAAM,EAClB,GAAG,GAAE,MAAyB,GAC7B,aAAa,CAGf;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;;;;;;;;;;GAcG;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"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Radius-class declarations (D-09 / LC-60)
|
|
2
|
+
* Radius-class declarations (D-09 / LC-60) and the radius RESOLUTION resolver
|
|
3
|
+
* (DG-RAD-01..05, Clay ruling 2026-08-28).
|
|
4
|
+
*
|
|
5
|
+
* Two axes live here, and they COMPOSE rather than replace each other:
|
|
6
|
+
*
|
|
7
|
+
* 1. Knob-IMMUNITY (`R-PILL` / `R-IDENTITY`, LC-60/D-09): the knob does not
|
|
8
|
+
* reach the part at all — roundness is the part's identity, so it stays
|
|
9
|
+
* round at every stop including `none`. Declared via `radiusClassProps`,
|
|
10
|
+
* registered in `docs/theme-propagation-spec.md` § Radius.
|
|
11
|
+
* 2. RESOLUTION (DG-RAD, `docs/design-guidelines.md` §13): given that a part
|
|
12
|
+
* listens to the knob, what a stop resolves to. Four classes (DEFAULT /
|
|
13
|
+
* CIRCULAR-AT-FULL / BINARY / CONTAINER-CAP), with a per-component
|
|
14
|
+
* override layer on top where meaning demands it (DG-RAD-05 — Checkbox
|
|
15
|
+
* never becomes a circle; the Radio disc never stops being one).
|
|
16
|
+
*
|
|
17
|
+
* `resolveRadiusForPart` layers them in doctrine order: immunity wins, then a
|
|
18
|
+
* declared override, then the class. The tables are GENERATED from the DG-RAD
|
|
19
|
+
* doctrine section (`scripts/radius-class-registry.mjs` --emit/--check), so
|
|
20
|
+
* code and doctrine cannot drift — the same contract the immunity axis has
|
|
21
|
+
* with `scripts/radius-identity-registry.mjs`.
|
|
3
22
|
*
|
|
4
23
|
* Most parts prove they obey the radius knob by simply going square at
|
|
5
24
|
* `borderRadius:none`. A few legitimately do not — an ornamental dot has no
|
|
@@ -14,13 +33,17 @@
|
|
|
14
33
|
* spell, or an R-IDENTITY part the spec never adjudicated, still fails. This
|
|
15
34
|
* module is the writing end; `docs/theme-propagation-spec.md` is the registry.
|
|
16
35
|
*/
|
|
36
|
+
import type { BorderRadius } from "./knobs";
|
|
37
|
+
import { RADIUS_RESOLUTION_COMPOSITION, type RadiusOverrideEntry, type RadiusResolutionClass } from "./radiusClassTable.generated";
|
|
17
38
|
/**
|
|
18
39
|
* The radius classes whose parts stay round at `borderRadius:none`.
|
|
19
40
|
*
|
|
20
41
|
* - `R-PILL` — a pill/circle at every radius value (ornamental dots, badge
|
|
21
|
-
* indicators
|
|
22
|
-
*
|
|
23
|
-
*
|
|
42
|
+
* indicators). Size still tracks the size knob. Icon wells are DEFAULT,
|
|
43
|
+
* not R-PILL (R2e) — unless the well IS a count badge.
|
|
44
|
+
* - `R-IDENTITY` — the shape IS the part's identity (Avatar, brand marks,
|
|
45
|
+
* Radio disc). Membership is enumerated in the spec table and enforced
|
|
46
|
+
* per part.
|
|
24
47
|
*/
|
|
25
48
|
export type KnobImmuneRadiusClass = "R-PILL" | "R-IDENTITY";
|
|
26
49
|
export interface RadiusClassDeclaration {
|
|
@@ -41,4 +64,73 @@ export interface RadiusClassDeclaration {
|
|
|
41
64
|
* <Frame {...radiusClassProps("R-IDENTITY", "Avatar")} circular />
|
|
42
65
|
*/
|
|
43
66
|
export declare function radiusClassProps(radiusClass: KnobImmuneRadiusClass, part: string): RadiusClassDeclaration;
|
|
67
|
+
/**
|
|
68
|
+
* The geometry a doctrine cell may need. `h/2` cells need the part's own
|
|
69
|
+
* painted height (shorter edge); CONTAINER-CAP cells need the container's own
|
|
70
|
+
* padding at the current space stop (13/18/32 — `panelPaddingPxMap`).
|
|
71
|
+
*/
|
|
72
|
+
export interface RadiusClassGeometry {
|
|
73
|
+
heightPx?: number;
|
|
74
|
+
paddingPx?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Resolve one radius-resolution class at one knob stop to px (DG-RAD-01..04).
|
|
78
|
+
*
|
|
79
|
+
* This is the CLASS layer only — the doctrine's DEFAULT resolution. Parts with
|
|
80
|
+
* a declared per-component override or a knob-immunity declaration resolve
|
|
81
|
+
* through `resolveRadiusForPart`, which layers all three.
|
|
82
|
+
*
|
|
83
|
+
* Fails loudly on anything the doctrine table cannot spell: an unknown class,
|
|
84
|
+
* an unknown stop, or an `h/2`/padding cell without its geometry. Silent
|
|
85
|
+
* defaults are how tables widen.
|
|
86
|
+
*/
|
|
87
|
+
export declare function resolveRadiusClass(radiusClass: RadiusResolutionClass, stop: BorderRadius, geometry?: RadiusClassGeometry): number;
|
|
88
|
+
/**
|
|
89
|
+
* Look up a part's declared per-component override (DG-RAD-05), if any.
|
|
90
|
+
* Matching is by the doctrine's component name, case-insensitive — the same
|
|
91
|
+
* contract the R-IDENTITY membership registry uses. Sweeps use this to PASS a
|
|
92
|
+
* declared override instead of reporting it as a violation.
|
|
93
|
+
*/
|
|
94
|
+
export declare function radiusOverrideFor(part: string): RadiusOverrideEntry | undefined;
|
|
95
|
+
export type ResolvedRadiusSource = (typeof RADIUS_RESOLUTION_COMPOSITION)[number];
|
|
96
|
+
export interface ResolveRadiusForPartOptions extends RadiusClassGeometry {
|
|
97
|
+
/** the knob stop being resolved */
|
|
98
|
+
stop: BorderRadius;
|
|
99
|
+
/**
|
|
100
|
+
* the part's resolution class as doctrine assigns it — DEFAULT unless
|
|
101
|
+
* assigned otherwise (knobs-enumerated.md Part 2b / DG-RAD)
|
|
102
|
+
*/
|
|
103
|
+
radiusClass?: RadiusResolutionClass;
|
|
104
|
+
/**
|
|
105
|
+
* the part name as the doctrine's override table spells it (`Checkbox`,
|
|
106
|
+
* `Radio disc`) — enables the DG-RAD-05 override lookup
|
|
107
|
+
*/
|
|
108
|
+
part?: string;
|
|
109
|
+
/**
|
|
110
|
+
* the part's declared knob-immunity (`R-PILL` / `R-IDENTITY`, LC-60/D-09),
|
|
111
|
+
* if it carries one. Immunity COMPOSES above both other layers: the knob
|
|
112
|
+
* never reaches the part, so it stays round at every stop including `none`.
|
|
113
|
+
*/
|
|
114
|
+
immunity?: KnobImmuneRadiusClass;
|
|
115
|
+
}
|
|
116
|
+
export interface ResolvedPartRadius {
|
|
117
|
+
px: number;
|
|
118
|
+
/** which layer resolved it: declared immunity > declared override > class */
|
|
119
|
+
source: ResolvedRadiusSource;
|
|
120
|
+
/** the class the part would resolve by, for sweeps that report both */
|
|
121
|
+
radiusClass: RadiusResolutionClass;
|
|
122
|
+
/** the recorded DG-RAD-05 reason, when an override won */
|
|
123
|
+
overrideWhy?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Resolve a part's radius at a knob stop through all three doctrine layers,
|
|
127
|
+
* in doctrine order (DG-RAD-05 composition note): a declared knob-immunity
|
|
128
|
+
* wins, then a declared per-component override, then the resolution class.
|
|
129
|
+
*
|
|
130
|
+
* A declared immunity is COMPOSED with, never replaced: even at `none` the
|
|
131
|
+
* part measures h/2, because roundness is its identity, not a radius (Clay
|
|
132
|
+
* 2026-08-28 resolving R2a — badge count pill, status dots, DotIndicator
|
|
133
|
+
* marks, presence pip stay round in the square world).
|
|
134
|
+
*/
|
|
135
|
+
export declare function resolveRadiusForPart(options: ResolveRadiusForPartOptions): ResolvedPartRadius;
|
|
44
136
|
//# sourceMappingURL=radiusClass.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radiusClass.d.ts","sourceRoot":"","sources":["../../src/theme/radiusClass.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"radiusClass.d.ts","sourceRoot":"","sources":["../../src/theme/radiusClass.ts"],"names":[],"mappings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,MAAM,CAAC;IACX,6EAA6E;IAC7E,MAAM,EAAE,oBAAoB,CAAC;IAC7B,uEAAuE;IACvE,WAAW,EAAE,qBAAqB,CAAC;IACnC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,kBAAkB,CAkC7F"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED from docs/design-guidelines.md §13 "Radius resolution" (DG-RAD-01..05)
|
|
3
|
+
* by scripts/radius-class-registry.mjs — DO NOT EDIT BY HAND.
|
|
4
|
+
*
|
|
5
|
+
* Regenerate: node scripts/radius-class-registry.mjs --emit
|
|
6
|
+
* Verify: node scripts/radius-class-registry.mjs --check
|
|
7
|
+
*
|
|
8
|
+
* The doctrine is the source; this module is the resolver's copy of it. Editing the
|
|
9
|
+
* resolution here instead of in the doctrine is exactly the drift the generator exists
|
|
10
|
+
* to prevent (the same contract as scripts/radius-identity-registry.mjs).
|
|
11
|
+
*/
|
|
12
|
+
export declare const RADIUS_RESOLUTION_STOPS: readonly ["none", "small", "medium", "large", "full"];
|
|
13
|
+
/** The `borderRadius` knob stops as the doctrine table spells them. */
|
|
14
|
+
export type RadiusResolutionStop = (typeof RADIUS_RESOLUTION_STOPS)[number];
|
|
15
|
+
/**
|
|
16
|
+
* One doctrine table cell. `px` is a literal resolved radius; `half-height` is the
|
|
17
|
+
* part's own painted height over two (a true circle/pill); `min-token-padding` and
|
|
18
|
+
* `padding` are the CONTAINER-CAP spellings (Axiom 1 CLIP: never exceed own padding).
|
|
19
|
+
*/
|
|
20
|
+
export type RadiusResolutionCell = {
|
|
21
|
+
readonly kind: "px";
|
|
22
|
+
readonly px: number;
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: "half-height";
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: "min-token-padding";
|
|
27
|
+
readonly tokenPx: number;
|
|
28
|
+
} | {
|
|
29
|
+
readonly kind: "padding";
|
|
30
|
+
};
|
|
31
|
+
export type RadiusResolutionRow = Readonly<Record<RadiusResolutionStop, RadiusResolutionCell>>;
|
|
32
|
+
/** DG-RAD-01..04 — resolved radius per class per stop. */
|
|
33
|
+
export declare const RADIUS_RESOLUTION_TABLE: {
|
|
34
|
+
readonly DEFAULT: {
|
|
35
|
+
readonly none: {
|
|
36
|
+
readonly kind: "px";
|
|
37
|
+
readonly px: 0;
|
|
38
|
+
};
|
|
39
|
+
readonly small: {
|
|
40
|
+
readonly kind: "px";
|
|
41
|
+
readonly px: 5;
|
|
42
|
+
};
|
|
43
|
+
readonly medium: {
|
|
44
|
+
readonly kind: "px";
|
|
45
|
+
readonly px: 9;
|
|
46
|
+
};
|
|
47
|
+
readonly large: {
|
|
48
|
+
readonly kind: "px";
|
|
49
|
+
readonly px: 16;
|
|
50
|
+
};
|
|
51
|
+
readonly full: {
|
|
52
|
+
readonly kind: "px";
|
|
53
|
+
readonly px: 50;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
readonly "CIRCULAR-AT-FULL": {
|
|
57
|
+
readonly none: {
|
|
58
|
+
readonly kind: "px";
|
|
59
|
+
readonly px: 0;
|
|
60
|
+
};
|
|
61
|
+
readonly small: {
|
|
62
|
+
readonly kind: "px";
|
|
63
|
+
readonly px: 5;
|
|
64
|
+
};
|
|
65
|
+
readonly medium: {
|
|
66
|
+
readonly kind: "px";
|
|
67
|
+
readonly px: 9;
|
|
68
|
+
};
|
|
69
|
+
readonly large: {
|
|
70
|
+
readonly kind: "px";
|
|
71
|
+
readonly px: 16;
|
|
72
|
+
};
|
|
73
|
+
readonly full: {
|
|
74
|
+
readonly kind: "half-height";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly BINARY: {
|
|
78
|
+
readonly none: {
|
|
79
|
+
readonly kind: "px";
|
|
80
|
+
readonly px: 0;
|
|
81
|
+
};
|
|
82
|
+
readonly small: {
|
|
83
|
+
readonly kind: "half-height";
|
|
84
|
+
};
|
|
85
|
+
readonly medium: {
|
|
86
|
+
readonly kind: "half-height";
|
|
87
|
+
};
|
|
88
|
+
readonly large: {
|
|
89
|
+
readonly kind: "half-height";
|
|
90
|
+
};
|
|
91
|
+
readonly full: {
|
|
92
|
+
readonly kind: "half-height";
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
readonly "CONTAINER-CAP": {
|
|
96
|
+
readonly none: {
|
|
97
|
+
readonly kind: "px";
|
|
98
|
+
readonly px: 0;
|
|
99
|
+
};
|
|
100
|
+
readonly small: {
|
|
101
|
+
readonly kind: "min-token-padding";
|
|
102
|
+
readonly tokenPx: 5;
|
|
103
|
+
};
|
|
104
|
+
readonly medium: {
|
|
105
|
+
readonly kind: "min-token-padding";
|
|
106
|
+
readonly tokenPx: 9;
|
|
107
|
+
};
|
|
108
|
+
readonly large: {
|
|
109
|
+
readonly kind: "min-token-padding";
|
|
110
|
+
readonly tokenPx: 16;
|
|
111
|
+
};
|
|
112
|
+
readonly full: {
|
|
113
|
+
readonly kind: "padding";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
/** A part is in exactly one class; DEFAULT unless the doctrine assigns otherwise. */
|
|
118
|
+
export type RadiusResolutionClass = keyof typeof RADIUS_RESOLUTION_TABLE;
|
|
119
|
+
export interface RadiusOverrideEntry {
|
|
120
|
+
/** the component name as the doctrine's override table spells it */
|
|
121
|
+
readonly component: string;
|
|
122
|
+
readonly cells: RadiusResolutionRow;
|
|
123
|
+
/** the recorded reason the class would destroy meaning (the DG-RAD-05 bar) */
|
|
124
|
+
readonly why: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* DG-RAD-05 — declared per-component overrides. A row here WINS over the part's
|
|
128
|
+
* resolution class, and sweeps PASS these measurements instead of flagging them.
|
|
129
|
+
*/
|
|
130
|
+
export declare const RADIUS_OVERRIDE_TABLE: readonly RadiusOverrideEntry[];
|
|
131
|
+
/**
|
|
132
|
+
* The resolver's layering, as doctrine spells it: a declared knob-immunity
|
|
133
|
+
* (R-PILL / R-IDENTITY, LC-60/D-09) wins, then a declared override, then the class.
|
|
134
|
+
*/
|
|
135
|
+
export declare const RADIUS_RESOLUTION_COMPOSITION: readonly ["immunity", "override", "class"];
|
|
136
|
+
export interface OpenRadiusAdjudication {
|
|
137
|
+
readonly id: string;
|
|
138
|
+
readonly text: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Adjudications still open (MPO-56 AC-6): sweeps must EXCLUDE these parts
|
|
142
|
+
* from cell assertions and REPORT the exclusion — never silently skip it.
|
|
143
|
+
* An empty list is the closed state (R2 leftovers closed by RULINGS-2026-08-28).
|
|
144
|
+
*/
|
|
145
|
+
export declare const OPEN_RADIUS_ADJUDICATIONS: readonly OpenRadiusAdjudication[];
|
|
146
|
+
//# sourceMappingURL=radiusClassTable.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radiusClassTable.generated.d.ts","sourceRoot":"","sources":["../../src/theme/radiusClassTable.generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,uBAAuB,uDAAwD,CAAC;AAE7F,uEAAuE;AACvE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;CAAE,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAEjC,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAAC;AAE/F,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BoB,CAAC;AAEzD,qFAAqF;AACrF,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AAEzE,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;IACpC,8EAA8E;IAC9E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,mBAAmB,EAuB/D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,4CAA6C,CAAC;AAExF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,sBAAsB,EAEtE,CAAC"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Size-recipe INPUTS (LC-
|
|
2
|
+
* Size-recipe INPUTS (LC-80 RECIPE-INPUTS).
|
|
3
3
|
*
|
|
4
|
-
* Stored numbers are the source of truth.
|
|
5
|
-
* box/type/icon variants, touch heights) are
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Stored numbers are the source of truth. Derived projections (heights,
|
|
5
|
+
* recipes, box/type/icon variants, touch heights, radii) are never
|
|
6
|
+
* handwritten at a call site. The DEFAULT ladder is the measured Tamagui
|
|
7
|
+
* v5 table (`tokenTable`): padX / font / icon / radius per size token,
|
|
8
|
+
* gap == radius at every stop. A linear ratio is only the fallback when
|
|
9
|
+
* a theme sets `{ baseHeight }` and drops the table — it is not the
|
|
10
|
+
* default ladder and is not a signed-off divergence (MPO-46 / R6).
|
|
11
|
+
*
|
|
12
|
+
* Radius steps with the size token. The borderRadius knob is an override
|
|
13
|
+
* that retargets gap through `applyRadiusStop` (gap == radius at every
|
|
14
|
+
* knob stop too). `radiusPx` on inputs is the $4 / medium default (9).
|
|
8
15
|
*
|
|
9
16
|
* Tamagui `createThemes` / theme-builder still emits COLOR palettes only.
|
|
10
17
|
* Do not stuff recipe keys into `getTheme()` / `themes`.
|
|
11
|
-
*
|
|
12
|
-
* DEFAULT uses `tokenHeights` pinned to the stock Tamagui `$size` scale as
|
|
13
|
-
* measured on tamagui.dev ($4=44, $3=36, $5=52, $6=64 — MPO-13 C1/C2: the
|
|
14
|
-
* recipe key and the raw token now agree). `{ baseHeight: 40 }` (no
|
|
15
|
-
* tokenHeights / sizeFactors) regenerates geometrically from
|
|
16
|
-
* `baseHeight * stepRatio ** step`.
|
|
17
18
|
*/
|
|
18
19
|
import { type TileSizeInputs, type TileSizeLadder } from "./tileSizes";
|
|
19
20
|
export declare const SIZE_RECIPE_TOKENS: readonly ["$1", "$1.5", "$2", "$2.5", "$3", "$3.5", "$4", "$true", "$5", "$6"];
|
|
@@ -27,6 +28,27 @@ export type SizeRecipeRatios = {
|
|
|
27
28
|
icon: number;
|
|
28
29
|
gap: number;
|
|
29
30
|
};
|
|
31
|
+
/** Per-token channels on the measured ladder. Gap is not stored — it equals `radius`. */
|
|
32
|
+
export type SizeRecipeTokenChannels = {
|
|
33
|
+
paddingHorizontal: number;
|
|
34
|
+
fontSize: number;
|
|
35
|
+
iconSize: number;
|
|
36
|
+
radius: number;
|
|
37
|
+
};
|
|
38
|
+
export type SizeRecipeTokenTable = Partial<Record<SizeRecipeToken, SizeRecipeTokenChannels>>;
|
|
39
|
+
/**
|
|
40
|
+
* borderRadius knob stops (px). Mirrors the v5 radius tokens the knob
|
|
41
|
+
* already resolves ($0/$2/$4/$6/$12 = 0/5/9/16/50). `applyRadiusStop`
|
|
42
|
+
* retargets recipe.gap to the same number so gap == radius at every stop.
|
|
43
|
+
*/
|
|
44
|
+
export declare const SIZE_RECIPE_RADIUS_STOPS: {
|
|
45
|
+
readonly none: 0;
|
|
46
|
+
readonly small: 5;
|
|
47
|
+
readonly medium: 9;
|
|
48
|
+
readonly large: 16;
|
|
49
|
+
readonly full: 50;
|
|
50
|
+
};
|
|
51
|
+
export type SizeRecipeRadiusStop = keyof typeof SIZE_RECIPE_RADIUS_STOPS;
|
|
30
52
|
export type SizeRecipeInputs = {
|
|
31
53
|
baseHeight: number;
|
|
32
54
|
stepRatio: number;
|
|
@@ -38,6 +60,21 @@ export type SizeRecipeInputs = {
|
|
|
38
60
|
* `tokenHeights` is omitted. Factors are `stepRatio ** exponent` otherwise.
|
|
39
61
|
*/
|
|
40
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;
|
|
72
|
+
/**
|
|
73
|
+
* Input padX (one space half-step below the button at the same token).
|
|
74
|
+
* $4 = 16 vs the button's 18. Stored on inputs so the generator remains
|
|
75
|
+
* the single writer; Input consumes this, not a second handwritten map.
|
|
76
|
+
*/
|
|
77
|
+
inputPadX?: Partial<Record<SizeRecipeToken, number>>;
|
|
41
78
|
ratios: SizeRecipeRatios;
|
|
42
79
|
compactRatios: SizeRecipeRatios;
|
|
43
80
|
radiusPx: number;
|
|
@@ -82,6 +119,8 @@ export type SizeRecipeTables = {
|
|
|
82
119
|
heightVariants: Record<string, {
|
|
83
120
|
height: number;
|
|
84
121
|
}>;
|
|
122
|
+
/** Size-stepped radius (px). Gap on the matching recipe equals this value. */
|
|
123
|
+
radii: Record<string, number>;
|
|
85
124
|
};
|
|
86
125
|
export type SizeRecipeFamily = SizeRecipeTables & {
|
|
87
126
|
name: SizeRecipeFamilyName;
|
|
@@ -96,6 +135,7 @@ export type GeneratedSizeRecipes = {
|
|
|
96
135
|
boxVariants: Record<string, SizeRecipeBoxVariant>;
|
|
97
136
|
typeVariants: Record<string, SizeRecipeTypeVariant>;
|
|
98
137
|
iconVariants: Record<string, SizeRecipeIconVariant>;
|
|
138
|
+
radii: Record<string, number>;
|
|
99
139
|
families: RecipeFamilies;
|
|
100
140
|
/** Tile-size ladder (MPO-31) — derived from `inputs.tile` over the measured defaults. */
|
|
101
141
|
tiles: TileSizeLadder;
|
|
@@ -103,18 +143,49 @@ export type GeneratedSizeRecipes = {
|
|
|
103
143
|
export declare const SIZE_TOKEN_EXPONENTS: Record<SizeRecipeToken, number>;
|
|
104
144
|
/** Lossless relative table: the stock Tamagui 20/24/28/32/36/40/44/52/64 ramp at baseHeight 44. */
|
|
105
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>;
|
|
106
172
|
export declare const DEFAULT_SIZE_RECIPE_INPUTS: SizeRecipeInputs;
|
|
107
173
|
export declare const defaultRecipeInputs: SizeRecipeInputs;
|
|
108
174
|
export declare const TOUCH_HEIGHT_FLOOR: number;
|
|
109
175
|
export declare function cloneSizeRecipeInputs(inputs: SizeRecipeInputs): SizeRecipeInputs;
|
|
110
176
|
/**
|
|
111
|
-
* Fill defaults. `{ baseHeight: 36 }` drops handwritten tokenHeights/
|
|
112
|
-
* so every token regenerates from stepRatio.
|
|
177
|
+
* Fill defaults. `{ baseHeight: 36 }` drops handwritten tokenHeights /
|
|
178
|
+
* sizeFactors / token tables so every token regenerates from stepRatio.
|
|
113
179
|
*/
|
|
114
180
|
export declare function resolveSizeRecipeInputs(partial?: Partial<SizeRecipeInputs>): SizeRecipeInputs;
|
|
115
181
|
export declare const mergeRecipeInputs: typeof resolveSizeRecipeInputs;
|
|
116
182
|
export declare function sizeRecipeFromHeight(height: number, ratios?: SizeRecipeRatios): SizeRecipe;
|
|
117
|
-
export declare function
|
|
183
|
+
export declare function recipeFromTokenChannels(height: number, channels: SizeRecipeTokenChannels): SizeRecipe;
|
|
184
|
+
/** Retarget inner gap to a borderRadius knob stop so gap == that stop's radius. */
|
|
185
|
+
export declare function applyRadiusStop<T extends {
|
|
186
|
+
gap: number;
|
|
187
|
+
}>(recipe: T, stop: SizeRecipeRadiusStop): T;
|
|
188
|
+
export declare function generateSizeRecipeTables(inputs: SizeRecipeInputs, ratios?: SizeRecipeRatios, table?: SizeRecipeTokenTable | undefined): SizeRecipeTables;
|
|
118
189
|
export declare function createRecipeFamilies(inputs?: SizeRecipeInputs | Partial<SizeRecipeInputs>): RecipeFamilies;
|
|
119
190
|
export declare function generateSizeRecipes(partial?: Partial<SizeRecipeInputs>): GeneratedSizeRecipes;
|
|
120
191
|
//# sourceMappingURL=recipeInputs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipeInputs.d.ts","sourceRoot":"","sources":["../../src/theme/recipeInputs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"recipeInputs.d.ts","sourceRoot":"","sources":["../../src/theme/recipeInputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,kBAAkB,gFAWrB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAChE,8CAA8C;AAC9C,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG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