@multiplatform.one/theme 7.21.0 → 7.22.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/theme",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.22.0",
|
|
4
4
|
"description": "Tamagui theme system for multiplatform.one",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"multiplatform",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@multiplatform.one/platform": "7.
|
|
48
|
-
"@multiplatform.one/store": "7.
|
|
47
|
+
"@multiplatform.one/platform": "7.22.0",
|
|
48
|
+
"@multiplatform.one/store": "7.22.0",
|
|
49
49
|
"@tamagui/colors": "2.7.6",
|
|
50
50
|
"@tamagui/config": "2.7.6",
|
|
51
51
|
"@tamagui/get-token": "2.7.6",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"react-cookie": "^8.1.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@multiplatform.one/config": "7.
|
|
61
|
-
"@multiplatform.one/test-utils": "7.
|
|
60
|
+
"@multiplatform.one/config": "7.22.0",
|
|
61
|
+
"@multiplatform.one/test-utils": "7.22.0",
|
|
62
62
|
"@tamagui/animations-css": "2.7.6",
|
|
63
63
|
"@tamagui/animations-reanimated": "2.7.6",
|
|
64
64
|
"@tamagui/font-inter": "2.7.6",
|
|
@@ -577,6 +577,74 @@ describe("resolveKnobs", () => {
|
|
|
577
577
|
expect(knobProps.featureSurface.shadowRadius).toBe(12);
|
|
578
578
|
expect(knobProps.featureSurface).not.toHaveProperty("borderWidth");
|
|
579
579
|
});
|
|
580
|
+
|
|
581
|
+
it("featureSurface keeps $10 / $6 at the default knobs and every other stop moves them (MPO-21 GL-59)", () => {
|
|
582
|
+
expect(defaultKnobs.borderRadius).toBe("medium");
|
|
583
|
+
expect(defaultKnobs.space).toBe("medium");
|
|
584
|
+
for (const borderRadius of ["none", "small", "large", "full"] as const) {
|
|
585
|
+
expect(
|
|
586
|
+
resolveKnobs(knobsWith({ borderRadius })).knobProps.featureSurface.borderRadius,
|
|
587
|
+
borderRadius,
|
|
588
|
+
).not.toBe("$10");
|
|
589
|
+
}
|
|
590
|
+
for (const space of ["small", "large"] as const) {
|
|
591
|
+
expect(resolveKnobs(knobsWith({ space })).knobProps.featureSurface.padding, space).not.toBe(
|
|
592
|
+
"$6",
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
it("featureSurface radius follows the radius knob, one token per stop around $10, uncapped by space", () => {
|
|
598
|
+
const expected = {
|
|
599
|
+
none: "$0",
|
|
600
|
+
small: "$9",
|
|
601
|
+
medium: "$10",
|
|
602
|
+
large: "$11",
|
|
603
|
+
full: "$12",
|
|
604
|
+
} as const;
|
|
605
|
+
for (const [borderRadius, token] of Object.entries(expected)) {
|
|
606
|
+
for (const space of ["small", "medium", "large"] as const) {
|
|
607
|
+
expect(
|
|
608
|
+
resolveKnobs(knobsWith({ borderRadius: borderRadius as Knobs["borderRadius"], space }))
|
|
609
|
+
.knobProps.featureSurface.borderRadius,
|
|
610
|
+
`${borderRadius}/${space}`,
|
|
611
|
+
).toBe(token);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
it("featureSurface padding follows the space knob, one token per stop around $6", () => {
|
|
617
|
+
const expected = { small: "$5", medium: "$6", large: "$7" } as const;
|
|
618
|
+
for (const [space, token] of Object.entries(expected)) {
|
|
619
|
+
for (const borderRadius of ["none", "small", "medium", "large", "full"] as const) {
|
|
620
|
+
expect(
|
|
621
|
+
resolveKnobs(knobsWith({ borderRadius, space: space as Knobs["space"] })).knobProps
|
|
622
|
+
.featureSurface.padding,
|
|
623
|
+
`${borderRadius}/${space}`,
|
|
624
|
+
).toBe(token);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
it("compact density steps featureSurface padding through the space knob", () => {
|
|
630
|
+
const { knobProps } = resolveKnobs(applyDensity(knobsWith({ density: "compact" })));
|
|
631
|
+
expect(knobProps.featureSurface.padding).toBe("$5");
|
|
632
|
+
expect(knobProps.featureSurface.borderRadius).toBe("$10");
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
it("featureSurface never clips a child at its inset: padding >= radius x (1 - 1/sqrt 2) at every stop pair", () => {
|
|
636
|
+
for (const borderRadius of ["none", "small", "medium", "large", "full"] as const) {
|
|
637
|
+
for (const space of ["small", "medium", "large"] as const) {
|
|
638
|
+
const { featureSurface } = resolveKnobs(knobsWith({ borderRadius, space })).knobProps;
|
|
639
|
+
const radiusPx = (tokens.radius as any)[featureSurface.borderRadius.slice(1)]
|
|
640
|
+
.val as number;
|
|
641
|
+
const paddingPx = (tokens.space as any)[featureSurface.padding.slice(1)].val as number;
|
|
642
|
+
expect(paddingPx, `${borderRadius}/${space}`).toBeGreaterThanOrEqual(
|
|
643
|
+
radiusPx * (1 - Math.SQRT1_2),
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
});
|
|
580
648
|
});
|
|
581
649
|
|
|
582
650
|
// ── container radius cap (Axiom 1 CLIP) ──────────────────
|
|
@@ -695,7 +763,7 @@ describe("resolveKnobs", () => {
|
|
|
695
763
|
}
|
|
696
764
|
});
|
|
697
765
|
|
|
698
|
-
it("smooth × none: nothing to smooth
|
|
766
|
+
it("smooth × none: nothing to smooth, featureSurface included", () => {
|
|
699
767
|
const { knobProps } = resolveKnobs(
|
|
700
768
|
knobsWith({ cornerSmoothing: "smooth", borderRadius: "none" }),
|
|
701
769
|
);
|
|
@@ -705,9 +773,7 @@ describe("resolveKnobs", () => {
|
|
|
705
773
|
expect(knobProps.containerRadius).not.toHaveProperty("className");
|
|
706
774
|
expect(knobProps.cardSurface).not.toHaveProperty("className");
|
|
707
775
|
expect(knobProps.elevatedSurface).not.toHaveProperty("className");
|
|
708
|
-
|
|
709
|
-
// exists at every knob value, so it smooths.
|
|
710
|
-
expect(knobProps.featureSurface.className).toBe(cornerSmoothClassName);
|
|
776
|
+
expect(knobProps.featureSurface).not.toHaveProperty("className");
|
|
711
777
|
});
|
|
712
778
|
|
|
713
779
|
it("smooth × full: pill/circle identity fragments ignore smoothing (R-BINARY/R-PILL)", () => {
|
|
@@ -114,6 +114,24 @@ const panelPaddingMap = {
|
|
|
114
114
|
large: "$6",
|
|
115
115
|
} as const;
|
|
116
116
|
|
|
117
|
+
// Feature tier (SF-FEATURE, MPO-21 GL-59 ruling B): the Bento recipe's $10
|
|
118
|
+
// radius and $6 inset at the default stops, one token per stop either side.
|
|
119
|
+
// Uncapped by padding: the tightest pair (full 50 over small 24) still keeps
|
|
120
|
+
// a child corner at the inset inside the arc (padding >= radius x 0.29).
|
|
121
|
+
const featureRadiusMap = {
|
|
122
|
+
none: "$0",
|
|
123
|
+
small: "$9",
|
|
124
|
+
medium: "$10",
|
|
125
|
+
large: "$11",
|
|
126
|
+
full: "$12",
|
|
127
|
+
} as const;
|
|
128
|
+
|
|
129
|
+
const featurePaddingMap = {
|
|
130
|
+
small: "$5",
|
|
131
|
+
medium: "$6",
|
|
132
|
+
large: "$7",
|
|
133
|
+
} as const;
|
|
134
|
+
|
|
117
135
|
// ── Page-title step (D-11 hero-H1 dial) ───────────────────────
|
|
118
136
|
// The one canonical definition of how big a page title is. On the heading
|
|
119
137
|
// scale (1.4x Inter, defaults/fonts.ts) $8 = 32px and $10 = 64px, so
|
|
@@ -590,8 +608,7 @@ export function resolveKnobs(
|
|
|
590
608
|
// Capped container fragments stay plain arcs at every knob (the Axiom 1
|
|
591
609
|
// cap = padding px, which superellipse corners under-fill, so the cap
|
|
592
610
|
// remains a safe over-approximation) and smooth whenever a nonzero arc
|
|
593
|
-
// exists. featureSurface
|
|
594
|
-
// smooths whenever the knob says smooth.
|
|
611
|
+
// exists. featureSurface smooths on the same rule: `none` has no arc.
|
|
595
612
|
const smoothing = cornerSmoothingStyle[knobs.cornerSmoothing ?? "round"];
|
|
596
613
|
const scaleSmoothing =
|
|
597
614
|
knobs.borderRadius === "none" || knobs.borderRadius === "full" ? undefined : smoothing;
|
|
@@ -704,15 +721,15 @@ export function resolveKnobs(
|
|
|
704
721
|
},
|
|
705
722
|
featureSurface: {
|
|
706
723
|
backgroundColor: "$background",
|
|
707
|
-
borderRadius:
|
|
708
|
-
padding:
|
|
724
|
+
borderRadius: featureRadiusMap[knobs.borderRadius],
|
|
725
|
+
padding: featurePaddingMap[knobs.space],
|
|
709
726
|
// Bento marketing/auth card shadow: ~0px 9px 12px rgba(0,0,0,0.02) —
|
|
710
727
|
// softer/wider than any elevationMap token, so explicit shadow props.
|
|
711
728
|
shadowColor: "rgba(0,0,0,0.02)",
|
|
712
729
|
shadowOffset: { width: 0, height: 9 },
|
|
713
730
|
shadowOpacity: 1,
|
|
714
731
|
shadowRadius: 12,
|
|
715
|
-
...
|
|
732
|
+
...containerSmoothing,
|
|
716
733
|
},
|
|
717
734
|
inputSurface: { borderWidth: borderWidthValue },
|
|
718
735
|
panelPadding: { padding: paddingToken },
|
|
@@ -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,EAA8B,KAAK,EAAE,cAAc,EAAc,MAAM,SAAS,CAAC;AAE7F,OAAO,KAAK,EAOV,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,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