@multiplatform.one/components 7.7.3 → 7.7.6
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/dist/cjs/Accordion/index.cjs +4 -0
- package/dist/cjs/Accordion/index.native.js +4 -0
- package/dist/cjs/Accordion/index.native.js.map +1 -1
- package/dist/cjs/AnimateHeight/index.cjs +29 -2
- package/dist/cjs/AnimateHeight/index.native.js +30 -2
- package/dist/cjs/AnimateHeight/index.native.js.map +1 -1
- package/dist/cjs/Collapsible.cjs +48 -0
- package/dist/cjs/Collapsible.native.js +56 -0
- package/dist/cjs/Collapsible.native.js.map +1 -0
- package/dist/cjs/Pagination.cjs +28 -9
- package/dist/cjs/Pagination.native.js +28 -9
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/SheetModal/index.native.js +49 -25
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/Tabs/index.cjs +144 -91
- package/dist/cjs/Tabs/index.native.js +186 -123
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/knobImmuneExports.cjs +0 -1
- package/dist/cjs/knobImmuneExports.native.js +0 -1
- package/dist/cjs/knobImmuneExports.native.js.map +1 -1
- package/dist/cjs/tamagui.cjs +3 -2
- package/dist/cjs/tamagui.native.js +2 -1
- package/dist/cjs/tamagui.native.js.map +1 -1
- package/dist/esm/Accordion/index.mjs +4 -0
- package/dist/esm/Accordion/index.mjs.map +1 -1
- package/dist/esm/Accordion/index.native.js +4 -0
- package/dist/esm/Accordion/index.native.js.map +1 -1
- package/dist/esm/AnimateHeight/index.mjs +29 -2
- package/dist/esm/AnimateHeight/index.mjs.map +1 -1
- package/dist/esm/AnimateHeight/index.native.js +30 -2
- package/dist/esm/AnimateHeight/index.native.js.map +1 -1
- package/dist/esm/Collapsible.mjs +23 -0
- package/dist/esm/Collapsible.mjs.map +1 -0
- package/dist/esm/Collapsible.native.js +28 -0
- package/dist/esm/Collapsible.native.js.map +1 -0
- package/dist/esm/Pagination.mjs +28 -9
- package/dist/esm/Pagination.mjs.map +1 -1
- package/dist/esm/Pagination.native.js +28 -9
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/SheetModal/index.native.js +49 -25
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/Tabs/index.mjs +144 -91
- package/dist/esm/Tabs/index.mjs.map +1 -1
- package/dist/esm/Tabs/index.native.js +186 -123
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/knobImmuneExports.mjs +0 -1
- package/dist/esm/knobImmuneExports.mjs.map +1 -1
- package/dist/esm/knobImmuneExports.native.js +0 -1
- package/dist/esm/knobImmuneExports.native.js.map +1 -1
- package/dist/esm/tamagui.mjs +2 -1
- package/dist/esm/tamagui.mjs.map +1 -1
- package/dist/esm/tamagui.native.js +2 -1
- package/dist/esm/tamagui.native.js.map +1 -1
- package/dist/jsx/Accordion/index.mjs +4 -0
- package/dist/jsx/Accordion/index.mjs.map +1 -1
- package/dist/jsx/Accordion/index.native.js +4 -0
- package/dist/jsx/Accordion/index.native.js.map +1 -1
- package/dist/jsx/AnimateHeight/index.mjs +29 -2
- package/dist/jsx/AnimateHeight/index.mjs.map +1 -1
- package/dist/jsx/AnimateHeight/index.native.js +30 -2
- package/dist/jsx/AnimateHeight/index.native.js.map +1 -1
- package/dist/jsx/Collapsible.mjs +23 -0
- package/dist/jsx/Collapsible.mjs.map +1 -0
- package/dist/jsx/Collapsible.native.js +56 -0
- package/dist/jsx/Collapsible.native.js.map +1 -0
- package/dist/jsx/Pagination.mjs +28 -9
- package/dist/jsx/Pagination.mjs.map +1 -1
- package/dist/jsx/Pagination.native.js +28 -9
- package/dist/jsx/Pagination.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +49 -25
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/Tabs/index.mjs +144 -91
- package/dist/jsx/Tabs/index.mjs.map +1 -1
- package/dist/jsx/Tabs/index.native.js +186 -123
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/knobImmuneExports.mjs +0 -1
- package/dist/jsx/knobImmuneExports.mjs.map +1 -1
- package/dist/jsx/knobImmuneExports.native.js +0 -1
- package/dist/jsx/knobImmuneExports.native.js.map +1 -1
- package/dist/jsx/tamagui.mjs +2 -1
- package/dist/jsx/tamagui.mjs.map +1 -1
- package/dist/jsx/tamagui.native.js +2 -1
- package/dist/jsx/tamagui.native.js.map +1 -1
- package/package.json +9 -9
- package/src/Accordion/index.tsx +7 -1
- package/src/AnimateHeight/AnimateHeight.native.spec.tsx +51 -0
- package/src/AnimateHeight/index.tsx +30 -5
- package/src/Collapsible.tsx +23 -0
- package/src/Pagination.simple.spec.tsx +23 -0
- package/src/Pagination.stories.tsx +8 -0
- package/src/Pagination.tsx +27 -10
- package/src/SheetModal/SheetModal.native.spec.tsx +138 -0
- package/src/SheetModal/index.native.tsx +59 -26
- package/src/Tabs/Tabs.bandColor.spec.tsx +23 -0
- package/src/Tabs/Tabs.native.spec.tsx +35 -0
- package/src/Tabs/Tabs.spec.tsx +51 -1
- package/src/Tabs/Tabs.stories.tsx +27 -1
- package/src/Tabs/index.tsx +266 -187
- package/src/disclosureForm.spec.tsx +57 -0
- package/src/disclosureNativeProps.spec.tsx +35 -0
- package/src/knobImmuneExports.ts +0 -2
- package/src/primitives.spec.tsx +19 -4
- package/src/tamagui.ts +3 -1
- package/types/Accordion/index.d.ts +2 -0
- package/types/Accordion/index.d.ts.map +1 -1
- package/types/AnimateHeight/index.d.ts +3 -4
- package/types/AnimateHeight/index.d.ts.map +1 -1
- package/types/Collapsible.d.ts +19 -0
- package/types/Collapsible.d.ts.map +1 -0
- package/types/Pagination.d.ts +1 -1
- package/types/Pagination.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/Tabs/index.d.ts +7 -3
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/knobImmuneExports.d.ts.map +1 -1
- package/types/tamagui.d.ts +2 -1
- package/types/tamagui.d.ts.map +1 -1
package/dist/jsx/tamagui.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Circle","
|
|
1
|
+
{"version":3,"names":["Circle","Group","ListItem","ScrollView","Spacer","Square","Unspaced","View","VisuallyHidden","XGroup","XStack","YGroup","YStack","LinearGradient","AlertDialog","Dialog","Popover","Portal","PortalProvider","Sheet","AnimatePresence","TamaguiProvider","Theme","useControllableState","useDidFinishSSR","useEvent","useMedia","usePropsAndStyle","useTheme","useThemeName","createStyledContext","getToken","getTokens","getTokenValue","isClient","isWeb","styled","withStaticProperties","Button","Checkbox","Input","Label","Progress","RadioGroup","Select","Separator","Slider","Spinner","Switch","TextArea","ToggleGroup","Anchor","H1","H2","H3","H4","H5","H6","Heading","Paragraph","SizableText","Text","Collapsible"],"sources":["../../src/tamagui.ts"],"sourcesContent":[null],"mappings":"AA8BA,SACEA,MAAA,EACAC,KAAA,EACAC,QAAA,EACAC,UAAA,EACAC,MAAA,EACAC,MAAA,EACAC,QAAA,EACAC,IAAA,EACAC,cAAA,EACAC,MAAA,EACAC,MAAA,EACAC,MAAA,EACAC,MAAA,QACK;AAIP,SAASC,cAAA,QAAsB;AA6B/B,SAASC,WAAA,EAAaC,MAAA,EAAQC,OAAA,EAASC,MAAA,EAAQC,cAAA,EAAgBC,KAAA,QAAa;AAG5E,SAASC,eAAA,EAAiBC,eAAA,EAAiBC,KAAA,QAAa;AAGxD,SACEC,oBAAA,EACAC,eAAA,EACAC,QAAA,EACAC,QAAA,EACAC,gBAAA,EACAC,QAAA,EACAC,YAAA,QACK;AAGP,SACEC,mBAAA,EACAC,QAAA,EACAC,SAAA,EACAC,aAAA,EACAC,QAAA,EACAC,KAAA,EACAC,MAAA,EACAC,oBAAA,QACK;AAuCP,SACYC,MAAA,EACEC,QAAA,EACHC,KAAA,EACAC,KAAA,EACGC,QAAA,EACEC,UAAA,EACJC,MAAA,EACGC,SAAA,EACHC,MAAA,EACCC,OAAA,EACDC,MAAA,EACEC,QAAA,EACGC,WAAA,QACV;AAOP,SACYC,MAAA,EACJC,EAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,EACKC,OAAA,EACEC,SAAA,EACEC,WAAA,EACPC,IAAA,QACH;AAGP,SAASC,WAAA,QAAmB","ignoreList":[]}
|
|
@@ -27,7 +27,7 @@ __export(tamagui_exports, {
|
|
|
27
27
|
AlertDialog: () => import_tamagui2.AlertDialog,
|
|
28
28
|
AnimatePresence: () => import_tamagui3.AnimatePresence,
|
|
29
29
|
Circle: () => import_tamagui.Circle,
|
|
30
|
-
Collapsible: () =>
|
|
30
|
+
Collapsible: () => import_Collapsible.Collapsible,
|
|
31
31
|
Dialog: () => import_tamagui2.Dialog,
|
|
32
32
|
Group: () => import_tamagui.Group,
|
|
33
33
|
LinearGradient: () => import_linear_gradient.LinearGradient,
|
|
@@ -97,4 +97,5 @@ var import_tamagui4 = require("tamagui");
|
|
|
97
97
|
var import_tamagui5 = require("tamagui");
|
|
98
98
|
var import_tamagui6 = require("tamagui");
|
|
99
99
|
var import_tamagui7 = require("tamagui");
|
|
100
|
+
var import_Collapsible = require("./Collapsible.native.js");
|
|
100
101
|
//# sourceMappingURL=tamagui.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","tamagui_exports","AlertDialog","import_tamagui2","AnimatePresence","import_tamagui3","Circle","import_tamagui","Collapsible","Dialog","Group","LinearGradient","import_linear_gradient","ListItem","Popover","Portal","PortalProvider","ScrollView","Sheet","Spacer","Square","TamaguiAnchor","import_tamagui7","Anchor","TamaguiButton","import_tamagui6","Button","TamaguiCheckbox","Checkbox","TamaguiH1","H1","TamaguiH2","H2","TamaguiH3","H3","TamaguiH4","H4","TamaguiH5","H5","TamaguiH6","H6","TamaguiHeading","Heading","TamaguiInput","Input","TamaguiLabel","Label","TamaguiParagraph","Paragraph","TamaguiProgress","Progress","TamaguiProvider","TamaguiRadioGroup","RadioGroup","TamaguiSelect","Select","TamaguiSeparator","Separator","TamaguiSizableText","SizableText","TamaguiSlider","Slider","TamaguiSpinner","Spinner","TamaguiSwitch","Switch","TamaguiText","Text","TamaguiTextArea","TextArea","TamaguiToggleGroup","ToggleGroup","Theme","Unspaced","View","VisuallyHidden","XGroup","XStack"],"sources":["../../src/tamagui.ts"],"sourcesContent":[null],"mappings":"AA8BA;;AAAA,IACEA,SAAA,GAAAC,MAAA,CAAAC,cAAA;AAAA,IACAC,gBAAA,GAAAF,MAAA,CAAAG,wBAAA;AAAA,IACAC,iBAAA,GAAAJ,MAAA,CAAAK,mBAAA;AAAA,IACAC,YAAA,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AAAA,IACAC,QAAA,GAAAA,CAAAC,MAAA,EAAAC,GAAA;EACA,SAAAC,IAAA,IAAAD,GAAA,EACAZ,SAAA,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAAA;AACA,IACAC,WAAA,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;EACA,IAAAF,IAAA,WAAAA,IAAA,wBAAAA,IAAA;IACA,SAAAG,GAAA,IAAAhB,iBAAA,CAAAa,IAAA,GACA,KAAAX,YAAA,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EACAnB,SAAA,CAAAiB,EAAA,EAAAI,GAAA;MAAAP,GAAA,EAAAA,CAAA,KAAAI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAjB,gBAAA,CAAAe,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IAAA;
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","tamagui_exports","AlertDialog","import_tamagui2","AnimatePresence","import_tamagui3","Circle","import_tamagui","Collapsible","import_Collapsible","Dialog","Group","LinearGradient","import_linear_gradient","ListItem","Popover","Portal","PortalProvider","ScrollView","Sheet","Spacer","Square","TamaguiAnchor","import_tamagui7","Anchor","TamaguiButton","import_tamagui6","Button","TamaguiCheckbox","Checkbox","TamaguiH1","H1","TamaguiH2","H2","TamaguiH3","H3","TamaguiH4","H4","TamaguiH5","H5","TamaguiH6","H6","TamaguiHeading","Heading","TamaguiInput","Input","TamaguiLabel","Label","TamaguiParagraph","Paragraph","TamaguiProgress","Progress","TamaguiProvider","TamaguiRadioGroup","RadioGroup","TamaguiSelect","Select","TamaguiSeparator","Separator","TamaguiSizableText","SizableText","TamaguiSlider","Slider","TamaguiSpinner","Spinner","TamaguiSwitch","Switch","TamaguiText","Text","TamaguiTextArea","TextArea","TamaguiToggleGroup","ToggleGroup","Theme","Unspaced","View","VisuallyHidden","XGroup","XStack"],"sources":["../../src/tamagui.ts"],"sourcesContent":[null],"mappings":"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","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/components",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.6",
|
|
4
4
|
"description": "multiplatform.one ui components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"link": "^2.1.2",
|
|
76
76
|
"shiki": "^4.0.2",
|
|
77
77
|
"tamagui": "2.7.6",
|
|
78
|
-
"@multiplatform.one/forms": "7.7.
|
|
79
|
-
"@multiplatform.one/i18n": "7.7.
|
|
80
|
-
"@multiplatform.one/platform": "7.7.
|
|
81
|
-
"@multiplatform.one/router": "7.7.
|
|
82
|
-
"@multiplatform.one/theme": "7.7.
|
|
78
|
+
"@multiplatform.one/forms": "7.7.6",
|
|
79
|
+
"@multiplatform.one/i18n": "7.7.6",
|
|
80
|
+
"@multiplatform.one/platform": "7.7.6",
|
|
81
|
+
"@multiplatform.one/router": "7.7.6",
|
|
82
|
+
"@multiplatform.one/theme": "7.7.6"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@tamagui/build": "2.7.6",
|
|
@@ -99,9 +99,9 @@
|
|
|
99
99
|
"react-native-svg": "15.15.4",
|
|
100
100
|
"react-native-web": "^0.21.2",
|
|
101
101
|
"vitest": "^4.1.5",
|
|
102
|
-
"@multiplatform.one/config": "7.7.
|
|
103
|
-
"@multiplatform.one/
|
|
104
|
-
"@multiplatform.one/
|
|
102
|
+
"@multiplatform.one/config": "7.7.6",
|
|
103
|
+
"@multiplatform.one/storybook": "7.7.6",
|
|
104
|
+
"@multiplatform.one/test-utils": "7.7.6"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"@mdx-js/mdx": "^3.1.1",
|
package/src/Accordion/index.tsx
CHANGED
|
@@ -114,6 +114,8 @@ export interface AccordionItemProps extends StackProps {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
export interface AccordionTriggerProps extends Omit<StackProps, "children"> {
|
|
117
|
+
/** Web button intent; disclosure controls do not submit forms by default. */
|
|
118
|
+
type?: "button" | "submit" | "reset";
|
|
117
119
|
/** Header title (string or custom node) */
|
|
118
120
|
children?: ReactNode;
|
|
119
121
|
/** Secondary line under the title */
|
|
@@ -447,7 +449,10 @@ const AccordionItem = forwardRef<TamaguiElement, AccordionItemProps>(function Ac
|
|
|
447
449
|
// ── Trigger (header row) ──────────────────────────────────────
|
|
448
450
|
|
|
449
451
|
const AccordionTrigger = forwardRef<TamaguiElement, AccordionTriggerProps>(
|
|
450
|
-
function AccordionTrigger(
|
|
452
|
+
function AccordionTrigger(
|
|
453
|
+
{ children, description, icon, onFocus, onBlur, type = "button", ...props },
|
|
454
|
+
ref,
|
|
455
|
+
) {
|
|
451
456
|
const { knobProps, control, disabledState } = useAccordionKnobs();
|
|
452
457
|
const { headingLevel } = useContext(AccordionCtx);
|
|
453
458
|
const item = useContext(AccordionItemCtx);
|
|
@@ -502,6 +507,7 @@ const AccordionTrigger = forwardRef<TamaguiElement, AccordionTriggerProps>(
|
|
|
502
507
|
// role="heading" + aria-level for AT parity with an h3.
|
|
503
508
|
<View role="heading" aria-level={headingLevel} margin={0} width="100%">
|
|
504
509
|
<TamaguiAccordion.Trigger
|
|
510
|
+
{...(isWeb ? { type } : {})}
|
|
505
511
|
ref={ref}
|
|
506
512
|
unstyled
|
|
507
513
|
id={item.triggerId}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
+
import { createRef } from "react";
|
|
3
|
+
import { Text, type TamaguiElement } from "tamagui";
|
|
4
|
+
import { expect, it, vi } from "vitest";
|
|
5
|
+
import { AnimateHeight } from "./index";
|
|
6
|
+
|
|
7
|
+
vi.mock("@multiplatform.one/platform", async (original) => ({
|
|
8
|
+
...(await original<typeof import("@multiplatform.one/platform")>()),
|
|
9
|
+
isWeb: false,
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
it("opens native content intrinsically without waiting for layout or animation frames", () => {
|
|
13
|
+
const view = renderWithProviders(
|
|
14
|
+
<AnimateHeight open={false} testID="height">
|
|
15
|
+
<Text>Body</Text>
|
|
16
|
+
</AnimateHeight>,
|
|
17
|
+
);
|
|
18
|
+
expect(view.queryByText("Body")).toBeNull();
|
|
19
|
+
view.rerender(
|
|
20
|
+
<AnimateHeight open testID="height">
|
|
21
|
+
<Text>Body</Text>
|
|
22
|
+
</AnimateHeight>,
|
|
23
|
+
);
|
|
24
|
+
expect(view.getByText("Body")).toBeTruthy();
|
|
25
|
+
expect(getComputedStyle(view.getByTestId("height")).height).not.toBe("0px");
|
|
26
|
+
view.rerender(
|
|
27
|
+
<AnimateHeight open={false} testID="height">
|
|
28
|
+
<Text>Body</Text>
|
|
29
|
+
</AnimateHeight>,
|
|
30
|
+
);
|
|
31
|
+
expect(view.queryByText("Body")).toBeNull();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("keeps native follower updates intrinsic and preserves the outer ref and props", () => {
|
|
35
|
+
const ref = createRef<TamaguiElement>();
|
|
36
|
+
const view = renderWithProviders(
|
|
37
|
+
<AnimateHeight ref={ref} testID="height" padding={7}>
|
|
38
|
+
<Text>First</Text>
|
|
39
|
+
</AnimateHeight>,
|
|
40
|
+
);
|
|
41
|
+
expect(ref.current).toBe(view.getByTestId("height"));
|
|
42
|
+
expect(getComputedStyle(view.getByTestId("height")).padding).toBe("7px");
|
|
43
|
+
view.rerender(
|
|
44
|
+
<AnimateHeight ref={ref} testID="height" padding={7}>
|
|
45
|
+
<Text>Longer updated body</Text>
|
|
46
|
+
</AnimateHeight>,
|
|
47
|
+
);
|
|
48
|
+
expect(view.getByText("Longer updated body")).toBeTruthy();
|
|
49
|
+
expect(getComputedStyle(view.getByTestId("height")).height).not.toBe("0px");
|
|
50
|
+
expect(ref.current).toBe(view.getByTestId("height"));
|
|
51
|
+
});
|
|
@@ -14,10 +14,9 @@ import { View } from "tamagui";
|
|
|
14
14
|
* changes snap no matter what `transition` is set, because height never
|
|
15
15
|
* appears as an interpolable value. This container measures its content
|
|
16
16
|
* (ResizeObserver on web, onLayout on native) and drives a NUMERIC `height`
|
|
17
|
-
* through the house `transition` token. The
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* while mount/unmount sequencing still works on both platforms.
|
|
17
|
+
* through the house `transition` token on web. The RN driver cannot tween
|
|
18
|
+
* layout props (Axiom 4), so native uses intrinsic height while open and
|
|
19
|
+
* unmounts closed content immediately, without waiting for a measurement.
|
|
21
20
|
*
|
|
22
21
|
* Two modes:
|
|
23
22
|
* - follower (no `open` prop): always mounted; height tracks the content's
|
|
@@ -78,7 +77,7 @@ export function settleMs(transition: TransitionProp | undefined): number {
|
|
|
78
77
|
return (ms ?? 600) + 80;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
|
-
|
|
80
|
+
const WebAnimateHeight = forwardRef<TamaguiElement, AnimateHeightProps>(
|
|
82
81
|
function AnimateHeight({ open, children, transition: transitionProp, ...props }, ref) {
|
|
83
82
|
const { knobProps } = useResolvedKnobs();
|
|
84
83
|
// knob transition is undefined under reduced motion / animation="none"
|
|
@@ -235,3 +234,29 @@ export const AnimateHeight = forwardRef<TamaguiElement, AnimateHeightProps>(
|
|
|
235
234
|
);
|
|
236
235
|
},
|
|
237
236
|
);
|
|
237
|
+
|
|
238
|
+
/** Native layout has no height tween, so measurement must not gate visibility. */
|
|
239
|
+
const NativeAnimateHeight = forwardRef<TamaguiElement, AnimateHeightProps>(
|
|
240
|
+
function NativeAnimateHeight({ open, children, ...props }, ref) {
|
|
241
|
+
return (
|
|
242
|
+
<View
|
|
243
|
+
ref={ref}
|
|
244
|
+
overflow="hidden"
|
|
245
|
+
{...(open === false ? { display: "none" as const } : {})}
|
|
246
|
+
{...props}
|
|
247
|
+
>
|
|
248
|
+
{open !== false ? <View flexShrink={0}>{children}</View> : null}
|
|
249
|
+
</View>
|
|
250
|
+
);
|
|
251
|
+
},
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
export const AnimateHeight = forwardRef<TamaguiElement, AnimateHeightProps>(
|
|
255
|
+
function AnimateHeight(props, ref) {
|
|
256
|
+
return isWeb ? (
|
|
257
|
+
<WebAnimateHeight {...props} ref={ref} />
|
|
258
|
+
) : (
|
|
259
|
+
<NativeAnimateHeight {...props} ref={ref} />
|
|
260
|
+
);
|
|
261
|
+
},
|
|
262
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { forwardRef, type ComponentProps, type ComponentRef } from "react";
|
|
2
|
+
import { isWeb } from "@multiplatform.one/platform";
|
|
3
|
+
import { Collapsible as TamaguiCollapsible, withStaticProperties } from "tamagui";
|
|
4
|
+
|
|
5
|
+
export type CollapsibleTriggerProps = ComponentProps<typeof TamaguiCollapsible.Trigger> & {
|
|
6
|
+
/** Web button intent; disclosure controls do not submit forms by default. */
|
|
7
|
+
type?: "button" | "submit" | "reset";
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Trigger = TamaguiCollapsible.Trigger.styleable<CollapsibleTriggerProps>(
|
|
11
|
+
({ type = "button", ...props }, ref) => (
|
|
12
|
+
<TamaguiCollapsible.Trigger {...(isWeb ? { type } : {})} {...props} ref={ref} />
|
|
13
|
+
),
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
// A separate root keeps Tamagui's shared compound untouched while preserving
|
|
17
|
+
// its forwarded ref and content implementation.
|
|
18
|
+
export const Collapsible = withStaticProperties(
|
|
19
|
+
forwardRef<ComponentRef<typeof TamaguiCollapsible>, ComponentProps<typeof TamaguiCollapsible>>(
|
|
20
|
+
(props, ref) => <TamaguiCollapsible {...props} ref={ref} />,
|
|
21
|
+
),
|
|
22
|
+
{ Trigger, Content: TamaguiCollapsible.Content },
|
|
23
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
+
import { fireEvent, screen } from "@testing-library/react";
|
|
3
|
+
import { describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { Pagination } from "./Pagination";
|
|
5
|
+
|
|
6
|
+
describe("simple page navigation", () => {
|
|
7
|
+
it("keeps page context without a numbered window and navigates once", () => {
|
|
8
|
+
const change = vi.fn();
|
|
9
|
+
renderWithProviders(
|
|
10
|
+
<Pagination variant="simple" total={100} page={50} onPageChange={change} />,
|
|
11
|
+
);
|
|
12
|
+
expect(screen.getByText(/50.*100/)).toBeInTheDocument();
|
|
13
|
+
expect(screen.getAllByRole("button")).toHaveLength(2);
|
|
14
|
+
fireEvent.click(screen.getByLabelText("Go to next page"));
|
|
15
|
+
expect(change).toHaveBeenCalledExactlyOnceWith(51);
|
|
16
|
+
});
|
|
17
|
+
it("disables backward navigation on the first page and forward on the last", () => {
|
|
18
|
+
const { rerender } = renderWithProviders(<Pagination variant="simple" total={3} page={1} />);
|
|
19
|
+
expect(screen.getByLabelText("Go to previous page")).toHaveAttribute("aria-disabled", "true");
|
|
20
|
+
rerender(<Pagination variant="simple" total={3} page={3} />);
|
|
21
|
+
expect(screen.getByLabelText("Go to next page")).toHaveAttribute("aria-disabled", "true");
|
|
22
|
+
});
|
|
23
|
+
});
|
package/src/Pagination.tsx
CHANGED
|
@@ -118,7 +118,7 @@ export interface PaginationProps extends Omit<XStackProps, "children" | "onChang
|
|
|
118
118
|
* step) at the pager's large step — see `DotVariant` for the one rule that
|
|
119
119
|
* governs a strip mark's size.
|
|
120
120
|
*/
|
|
121
|
-
variant?: "dots" | "bars" | "numbered";
|
|
121
|
+
variant?: "dots" | "bars" | "numbered" | "simple";
|
|
122
122
|
/** Total number of items across all pages (numbered summary slot) */
|
|
123
123
|
totalItems?: number;
|
|
124
124
|
/** Items per page (numbered summary slot) */
|
|
@@ -235,17 +235,19 @@ export function Pagination({
|
|
|
235
235
|
...(kbFocus === id ? FOCUS_VISIBLE_RING : restRing),
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
+
const isSimple = variant === "simple";
|
|
238
239
|
const isNumbered = variant === "numbered";
|
|
240
|
+
const isPageNavigation = isNumbered || isSimple;
|
|
239
241
|
|
|
240
242
|
// The two idioms differ in which glyphs the controls take, whether the
|
|
241
243
|
// control is circular, and whether the last step submits — not in structure.
|
|
242
244
|
const canPrev = !disabled && index > 0;
|
|
243
|
-
const canNext =
|
|
245
|
+
const canNext = isPageNavigation
|
|
244
246
|
? !disabled && currentPage < total
|
|
245
247
|
: // dots/bars: an onSubmit makes the last step actionable, so the forward
|
|
246
248
|
// control is not dead there.
|
|
247
249
|
!(disabled || (!isLastStep && index >= total - 1 && !onSubmit));
|
|
248
|
-
const submits = !
|
|
250
|
+
const submits = !isPageNavigation && isLastStep;
|
|
249
251
|
|
|
250
252
|
const items = isNumbered
|
|
251
253
|
? getPaginationItems(total, currentPage, siblingCount, boundaryCount)
|
|
@@ -282,6 +284,7 @@ export function Pagination({
|
|
|
282
284
|
data-pad="panel"
|
|
283
285
|
{...knobProps.panelPadding}
|
|
284
286
|
{...knobProps.gap}
|
|
287
|
+
{...(isSimple ? { paddingHorizontal: 0, minWidth: 0, flexShrink: 1 } : undefined)}
|
|
285
288
|
{...stackProps}
|
|
286
289
|
>
|
|
287
290
|
{isNumbered && showFirstLast && (
|
|
@@ -299,19 +302,31 @@ export function Pagination({
|
|
|
299
302
|
|
|
300
303
|
<Button
|
|
301
304
|
size={knobProps.sizeToken}
|
|
302
|
-
circular={!
|
|
305
|
+
circular={!isPageNavigation}
|
|
303
306
|
chromeless
|
|
304
|
-
icon={
|
|
307
|
+
icon={isPageNavigation ? PrevIcon : PrevArrowIcon}
|
|
305
308
|
onPress={handlePrev}
|
|
306
309
|
disabled={!canPrev}
|
|
307
310
|
// LC-40: the Button's own disabled wash owns the treatment — the
|
|
308
311
|
// legacy opacity 0.3 dim stacked on top of it (double-dim).
|
|
309
|
-
aria-label={
|
|
312
|
+
aria-label={isPageNavigation ? t("Go to previous page") : t("Previous page")}
|
|
310
313
|
onKeyDown={activateOnEnterSpace(handlePrev, canPrev)}
|
|
311
314
|
{...pageControlProps("prev")}
|
|
312
315
|
/>
|
|
313
316
|
|
|
314
|
-
{
|
|
317
|
+
{isSimple ? (
|
|
318
|
+
<Text
|
|
319
|
+
{...knobProps.body}
|
|
320
|
+
color={componentColors.text.primary}
|
|
321
|
+
aria-live="polite"
|
|
322
|
+
userSelect="none"
|
|
323
|
+
numberOfLines={1}
|
|
324
|
+
flexShrink={1}
|
|
325
|
+
minWidth={0}
|
|
326
|
+
>
|
|
327
|
+
{bidiIsolate(withInterp(t("{{page}} of {{total}}"), { page: currentPage, total }))}
|
|
328
|
+
</Text>
|
|
329
|
+
) : isNumbered ? (
|
|
315
330
|
<XStack alignItems="center" {...knobProps.gap}>
|
|
316
331
|
{items.map((item) => {
|
|
317
332
|
if (typeof item !== "number") {
|
|
@@ -374,13 +389,15 @@ export function Pagination({
|
|
|
374
389
|
|
|
375
390
|
<Button
|
|
376
391
|
size={knobProps.sizeToken}
|
|
377
|
-
circular={!
|
|
392
|
+
circular={!isPageNavigation}
|
|
378
393
|
chromeless={!submits}
|
|
379
394
|
theme={submits ? "active" : undefined}
|
|
380
|
-
icon={
|
|
395
|
+
icon={isPageNavigation ? NextIcon : submits ? CheckIcon : NextArrowIcon}
|
|
381
396
|
onPress={handleNext}
|
|
382
397
|
disabled={!canNext}
|
|
383
|
-
aria-label={
|
|
398
|
+
aria-label={
|
|
399
|
+
isPageNavigation ? t("Go to next page") : submits ? t("Submit") : t("Next page")
|
|
400
|
+
}
|
|
384
401
|
onKeyDown={activateOnEnterSpace(handleNext, canNext)}
|
|
385
402
|
{...pageControlProps(submits ? "submit" : "next")}
|
|
386
403
|
/>
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
+
import { act } from "@testing-library/react";
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { Animated, PanResponder } from "react-native";
|
|
5
|
+
import { Text } from "tamagui";
|
|
6
|
+
import { SheetModal } from "./index.native";
|
|
7
|
+
|
|
8
|
+
const modal = vi.hoisted(() => ({ onShow: undefined as undefined | (() => void) }));
|
|
9
|
+
vi.mock("react-native-web", async (importOriginal) => ({
|
|
10
|
+
...(await importOriginal<typeof import("react-native")>()),
|
|
11
|
+
ActionSheetIOS: undefined,
|
|
12
|
+
Modal: ({ children, onShow }: { children: import("react").ReactNode; onShow?: () => void }) => {
|
|
13
|
+
modal.onShow = onShow;
|
|
14
|
+
return children;
|
|
15
|
+
},
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
const onOpenChange = vi.fn();
|
|
19
|
+
let dismissCompletion: (result: { finished: boolean }) => void;
|
|
20
|
+
let release: () => void;
|
|
21
|
+
let completions: Array<(result: { finished: boolean }) => void>;
|
|
22
|
+
beforeEach(() => {
|
|
23
|
+
vi.useFakeTimers();
|
|
24
|
+
completions = [];
|
|
25
|
+
modal.onShow = undefined;
|
|
26
|
+
onOpenChange.mockReset();
|
|
27
|
+
vi.spyOn(PanResponder, "create").mockImplementation((config) => {
|
|
28
|
+
release = () => config.onPanResponderRelease?.({} as never, { dy: 1000, vy: 2 } as never);
|
|
29
|
+
return { panHandlers: {} };
|
|
30
|
+
});
|
|
31
|
+
vi.spyOn(Animated, "spring").mockImplementation(() => ({
|
|
32
|
+
start: (callback) => {
|
|
33
|
+
if (callback) dismissCompletion = callback;
|
|
34
|
+
},
|
|
35
|
+
stop: vi.fn(),
|
|
36
|
+
reset: vi.fn(),
|
|
37
|
+
}));
|
|
38
|
+
vi.spyOn(Animated, "timing").mockImplementation(() => ({
|
|
39
|
+
start: (callback) => {
|
|
40
|
+
if (callback) completions.push(callback);
|
|
41
|
+
},
|
|
42
|
+
stop: vi.fn(),
|
|
43
|
+
reset: vi.fn(),
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
46
|
+
afterEach(() => {
|
|
47
|
+
vi.restoreAllMocks();
|
|
48
|
+
vi.useRealTimers();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
function panel(open: boolean) {
|
|
52
|
+
return (
|
|
53
|
+
<SheetModal open={open} onOpenChange={onOpenChange}>
|
|
54
|
+
<Text>row</Text>
|
|
55
|
+
</SheetModal>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
describe("SheetModal native presentation lifecycle", () => {
|
|
60
|
+
it("enters without onShow and ignores onShow for the same presentation", () => {
|
|
61
|
+
renderWithProviders(panel(true));
|
|
62
|
+
expect(Animated.timing).toHaveBeenCalledTimes(1);
|
|
63
|
+
expect(modal.onShow).toBeTypeOf("function");
|
|
64
|
+
act(() => modal.onShow?.());
|
|
65
|
+
expect(Animated.timing).toHaveBeenCalledTimes(1);
|
|
66
|
+
});
|
|
67
|
+
it("ignores onShow after the presentation closes", () => {
|
|
68
|
+
const { rerender } = renderWithProviders(panel(true));
|
|
69
|
+
const lateShow = modal.onShow;
|
|
70
|
+
rerender(panel(false));
|
|
71
|
+
const count = vi.mocked(Animated.timing).mock.calls.length;
|
|
72
|
+
act(() => lateShow?.());
|
|
73
|
+
expect(Animated.timing).toHaveBeenCalledTimes(count);
|
|
74
|
+
expect(vi.getTimerCount()).toBe(0);
|
|
75
|
+
});
|
|
76
|
+
it("ignores a completed entrance from an earlier presentation", () => {
|
|
77
|
+
const { rerender } = renderWithProviders(panel(true));
|
|
78
|
+
const oldCompletion = completions[0];
|
|
79
|
+
rerender(panel(false));
|
|
80
|
+
rerender(panel(true));
|
|
81
|
+
const writes = vi.spyOn(Animated.Value.prototype, "setValue");
|
|
82
|
+
act(() => oldCompletion({ finished: true }));
|
|
83
|
+
expect(writes).not.toHaveBeenCalled();
|
|
84
|
+
act(() => completions[1]({ finished: true }));
|
|
85
|
+
expect(writes).toHaveBeenCalledWith(0);
|
|
86
|
+
});
|
|
87
|
+
it("ignores callbacks after unmount and clears its timer", () => {
|
|
88
|
+
const { unmount } = renderWithProviders(panel(true));
|
|
89
|
+
const lateShow = modal.onShow;
|
|
90
|
+
const completion = completions[0];
|
|
91
|
+
const stop = vi.spyOn(Animated.Value.prototype, "stopAnimation");
|
|
92
|
+
unmount();
|
|
93
|
+
expect(stop).toHaveBeenCalled();
|
|
94
|
+
const writes = vi.spyOn(Animated.Value.prototype, "setValue");
|
|
95
|
+
const count = vi.mocked(Animated.timing).mock.calls.length;
|
|
96
|
+
act(() => {
|
|
97
|
+
lateShow?.();
|
|
98
|
+
completion({ finished: true });
|
|
99
|
+
});
|
|
100
|
+
expect(writes).not.toHaveBeenCalled();
|
|
101
|
+
expect(Animated.timing).toHaveBeenCalledTimes(count);
|
|
102
|
+
expect(vi.getTimerCount()).toBe(0);
|
|
103
|
+
});
|
|
104
|
+
it("does not let an earlier dismiss close a reopened presentation", () => {
|
|
105
|
+
const { rerender } = renderWithProviders(panel(true));
|
|
106
|
+
act(() => release());
|
|
107
|
+
const oldDismiss = dismissCompletion;
|
|
108
|
+
rerender(panel(false));
|
|
109
|
+
rerender(panel(true));
|
|
110
|
+
act(() => oldDismiss({ finished: true }));
|
|
111
|
+
expect(onOpenChange).not.toHaveBeenCalled();
|
|
112
|
+
});
|
|
113
|
+
it("closes only after a successful current dismiss", () => {
|
|
114
|
+
renderWithProviders(panel(true));
|
|
115
|
+
act(() => release());
|
|
116
|
+
act(() => dismissCompletion({ finished: false }));
|
|
117
|
+
expect(onOpenChange).not.toHaveBeenCalled();
|
|
118
|
+
act(() => release());
|
|
119
|
+
act(() => dismissCompletion({ finished: true }));
|
|
120
|
+
expect(onOpenChange).toHaveBeenCalledExactlyOnceWith(false);
|
|
121
|
+
});
|
|
122
|
+
it("owns only the current StrictMode effect presentation", () => {
|
|
123
|
+
renderWithProviders(panel(true), { reactStrictMode: true });
|
|
124
|
+
expect(completions.length).toBeGreaterThanOrEqual(2);
|
|
125
|
+
const writes = vi.spyOn(Animated.Value.prototype, "setValue");
|
|
126
|
+
act(() => completions[0]({ finished: true }));
|
|
127
|
+
expect(writes).not.toHaveBeenCalled();
|
|
128
|
+
act(() => completions[completions.length - 1]({ finished: true }));
|
|
129
|
+
expect(writes).toHaveBeenCalledWith(0);
|
|
130
|
+
});
|
|
131
|
+
it("keeps the measured JS-driver workaround", () => {
|
|
132
|
+
renderWithProviders(panel(true));
|
|
133
|
+
expect(Animated.timing).toHaveBeenCalledWith(
|
|
134
|
+
expect.anything(),
|
|
135
|
+
expect.objectContaining({ useNativeDriver: false }),
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
});
|