@tamagui/collapsible 1.40.0 → 1.41.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/dist/cjs/Collapsible.js +114 -3
- package/dist/cjs/Collapsible.js.map +1 -1
- package/dist/esm/Collapsible.js +103 -2
- package/dist/esm/Collapsible.js.map +1 -1
- package/dist/jsx/Collapsible.js +91 -2
- package/dist/jsx/Collapsible.js.map +1 -1
- package/dist/jsx/Collapsible.mjs +91 -2
- package/dist/jsx/Collapsible.mjs.map +1 -1
- package/package.json +8 -8
- package/src/Collapsible.tsx +177 -248
- package/types/Collapsible.d.ts +220 -1
- package/types/Collapsible.d.ts.map +1 -1
package/dist/cjs/Collapsible.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,15 +17,124 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var Collapsible_exports = {};
|
|
20
30
|
__export(Collapsible_exports, {
|
|
21
|
-
Collapsible: () => Collapsible
|
|
31
|
+
Collapsible: () => Collapsible,
|
|
32
|
+
CollapsibleContent: () => CollapsibleContent,
|
|
33
|
+
CollapsibleContentFrame: () => CollapsibleContentFrame,
|
|
34
|
+
CollapsibleTrigger: () => CollapsibleTrigger,
|
|
35
|
+
CollapsibleTriggerFrame: () => CollapsibleTriggerFrame,
|
|
36
|
+
createCollapsibleScope: () => createCollapsibleScope
|
|
22
37
|
});
|
|
23
38
|
module.exports = __toCommonJS(Collapsible_exports);
|
|
24
|
-
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
var import_create_context = require("@tamagui/create-context");
|
|
41
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
42
|
+
var import_web = require("@tamagui/web");
|
|
43
|
+
var React = __toESM(require("react"));
|
|
44
|
+
var import_tamagui = require("tamagui");
|
|
45
|
+
const COLLAPSIBLE_NAME = "Collapsible";
|
|
46
|
+
const [createCollapsibleContext, createCollapsibleScope] = (0, import_create_context.createContextScope)(COLLAPSIBLE_NAME);
|
|
47
|
+
const [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
48
|
+
const _Collapsible = React.forwardRef(
|
|
49
|
+
(props, forwardedRef) => {
|
|
50
|
+
const {
|
|
51
|
+
__scopeCollapsible,
|
|
52
|
+
open: openProp,
|
|
53
|
+
defaultOpen,
|
|
54
|
+
disabled,
|
|
55
|
+
onOpenChange,
|
|
56
|
+
...collapsibleProps
|
|
57
|
+
} = props;
|
|
58
|
+
const [open = false, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
59
|
+
prop: openProp,
|
|
60
|
+
defaultProp: defaultOpen,
|
|
61
|
+
onChange: onOpenChange
|
|
62
|
+
});
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
CollapsibleProvider,
|
|
65
|
+
{
|
|
66
|
+
scope: __scopeCollapsible,
|
|
67
|
+
disabled,
|
|
68
|
+
contentId: React.useId(),
|
|
69
|
+
open,
|
|
70
|
+
onOpenToggle: React.useCallback(
|
|
71
|
+
() => setOpen((prevOpen) => !prevOpen),
|
|
72
|
+
[setOpen]
|
|
73
|
+
),
|
|
74
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
+
import_web.Stack,
|
|
76
|
+
{
|
|
77
|
+
"data-state": getState(open),
|
|
78
|
+
"data-disabled": disabled ? "" : void 0,
|
|
79
|
+
...collapsibleProps,
|
|
80
|
+
ref: forwardedRef
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
_Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
88
|
+
const TRIGGER_NAME = "CollapsibleTrigger";
|
|
89
|
+
const CollapsibleTriggerFrame = (0, import_web.styled)(import_web.Stack, {
|
|
90
|
+
name: TRIGGER_NAME,
|
|
91
|
+
tag: "button"
|
|
92
|
+
});
|
|
93
|
+
const CollapsibleTrigger = CollapsibleTriggerFrame.styleable(
|
|
94
|
+
(props, forwardedRef) => {
|
|
95
|
+
const { __scopeCollapsible, children, ...triggerProps } = props;
|
|
96
|
+
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
|
+
CollapsibleTriggerFrame,
|
|
99
|
+
{
|
|
100
|
+
"aria-controls": context.contentId,
|
|
101
|
+
"aria-expanded": context.open || false,
|
|
102
|
+
"data-state": getState(context.open),
|
|
103
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
104
|
+
disabled: context.disabled,
|
|
105
|
+
...triggerProps,
|
|
106
|
+
ref: forwardedRef,
|
|
107
|
+
onPress: (0, import_web.composeEventHandlers)(props.onPress, context.onOpenToggle),
|
|
108
|
+
children: typeof children === "function" ? children({ open: context.open }) : children
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
114
|
+
const CONTENT_NAME = "CollapsibleContent";
|
|
115
|
+
const CollapsibleContentFrame = (0, import_web.styled)(import_web.Stack, {
|
|
116
|
+
name: CONTENT_NAME
|
|
117
|
+
});
|
|
118
|
+
const CollapsibleContent = CollapsibleContentFrame.styleable((props, forwardedRef) => {
|
|
119
|
+
const { forceMount, children, __scopeCollapsible, ...contentProps } = props;
|
|
120
|
+
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, { ref: forwardedRef, ...contentProps, children }) : null });
|
|
122
|
+
});
|
|
123
|
+
CollapsibleContent.displayName = CONTENT_NAME;
|
|
124
|
+
function getState(open) {
|
|
125
|
+
return open ? "open" : "closed";
|
|
126
|
+
}
|
|
127
|
+
const Collapsible = (0, import_web.withStaticProperties)(_Collapsible, {
|
|
128
|
+
Trigger: CollapsibleTrigger,
|
|
129
|
+
Content: CollapsibleContent
|
|
130
|
+
});
|
|
25
131
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
132
|
0 && (module.exports = {
|
|
27
|
-
Collapsible
|
|
133
|
+
Collapsible,
|
|
134
|
+
CollapsibleContent,
|
|
135
|
+
CollapsibleContentFrame,
|
|
136
|
+
CollapsibleTrigger,
|
|
137
|
+
CollapsibleTriggerFrame,
|
|
138
|
+
createCollapsibleScope
|
|
28
139
|
});
|
|
29
140
|
//# sourceMappingURL=Collapsible.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
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,CAAC,OAA6C,iBAAiB;AAC7D,UAAM,EAAE,oBAAoB,UAAU,GAAG,aAAa,IAAI;AAC1D,UAAM,UAAU,sBAAsB,cAAc,kBAAkB;AAEtE,WACE;AAAA,MAAC;AAAA;AAAA,QACC,iBAAe,QAAQ;AAAA,QACvB,iBAAe,QAAQ,QAAQ;AAAA,QAC/B,cAAY,SAAS,QAAQ,IAAI;AAAA,QACjC,iBAAe,QAAQ,WAAW,KAAK;AAAA,QACvC,UAAU,QAAQ;AAAA,QACjB,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,aAAS,iCAAqB,MAAM,SAAgB,QAAQ,YAAY;AAAA,QAEvE,iBAAO,aAAa,aAAa,SAAS,EAAE,MAAM,QAAQ,KAAK,CAAC,IAAI;AAAA;AAAA,IACvE;AAAA,EAEJ;AACF;AAEA,mBAAmB,cAAc;AAcjC,MAAM,eAAe;AAErB,MAAM,8BAA0B,mBAAO,kBAAO;AAAA,EAC5C,MAAM;AACR,CAAC;AAED,MAAM,qBAAqB,wBAAwB,UAEjD,CAAC,OAAO,iBAAiB;AACzB,QAAM,EAAE,YAAY,UAAU,oBAAoB,GAAG,aAAa,IAAI;AACtE,QAAM,UAAU,sBAAsB,cAAc,kBAAkB;AAEtE,SACE,4CAAC,kCAAiB,GAAG,cAClB,wBAAc,QAAQ,OACrB,4CAAC,2BAAwB,KAAK,cAAe,GAAG,cAC7C,UACH,IACE,MACN;AAEJ,CAAC;AAED,mBAAmB,cAAc;AAGjC,SAAS,SAAS,MAAgB;AAChC,SAAO,OAAO,SAAS;AACzB;AAEA,MAAM,kBAAc,iCAAqB,cAAc;AAAA,EACrD,SAAS;AAAA,EACT,SAAS;AACX,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/Collapsible.js
CHANGED
|
@@ -1,5 +1,106 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContextScope } from "@tamagui/create-context";
|
|
3
|
+
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
4
|
+
import {
|
|
5
|
+
Stack,
|
|
6
|
+
composeEventHandlers,
|
|
7
|
+
styled,
|
|
8
|
+
withStaticProperties
|
|
9
|
+
} from "@tamagui/web";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { AnimatePresence } from "tamagui";
|
|
12
|
+
const COLLAPSIBLE_NAME = "Collapsible";
|
|
13
|
+
const [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
14
|
+
const [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
15
|
+
const _Collapsible = React.forwardRef(
|
|
16
|
+
(props, forwardedRef) => {
|
|
17
|
+
const {
|
|
18
|
+
__scopeCollapsible,
|
|
19
|
+
open: openProp,
|
|
20
|
+
defaultOpen,
|
|
21
|
+
disabled,
|
|
22
|
+
onOpenChange,
|
|
23
|
+
...collapsibleProps
|
|
24
|
+
} = props;
|
|
25
|
+
const [open = false, setOpen] = useControllableState({
|
|
26
|
+
prop: openProp,
|
|
27
|
+
defaultProp: defaultOpen,
|
|
28
|
+
onChange: onOpenChange
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
CollapsibleProvider,
|
|
32
|
+
{
|
|
33
|
+
scope: __scopeCollapsible,
|
|
34
|
+
disabled,
|
|
35
|
+
contentId: React.useId(),
|
|
36
|
+
open,
|
|
37
|
+
onOpenToggle: React.useCallback(
|
|
38
|
+
() => setOpen((prevOpen) => !prevOpen),
|
|
39
|
+
[setOpen]
|
|
40
|
+
),
|
|
41
|
+
children: /* @__PURE__ */ jsx(
|
|
42
|
+
Stack,
|
|
43
|
+
{
|
|
44
|
+
"data-state": getState(open),
|
|
45
|
+
"data-disabled": disabled ? "" : void 0,
|
|
46
|
+
...collapsibleProps,
|
|
47
|
+
ref: forwardedRef
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
_Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
55
|
+
const TRIGGER_NAME = "CollapsibleTrigger";
|
|
56
|
+
const CollapsibleTriggerFrame = styled(Stack, {
|
|
57
|
+
name: TRIGGER_NAME,
|
|
58
|
+
tag: "button"
|
|
59
|
+
});
|
|
60
|
+
const CollapsibleTrigger = CollapsibleTriggerFrame.styleable(
|
|
61
|
+
(props, forwardedRef) => {
|
|
62
|
+
const { __scopeCollapsible, children, ...triggerProps } = props;
|
|
63
|
+
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
CollapsibleTriggerFrame,
|
|
66
|
+
{
|
|
67
|
+
"aria-controls": context.contentId,
|
|
68
|
+
"aria-expanded": context.open || false,
|
|
69
|
+
"data-state": getState(context.open),
|
|
70
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
71
|
+
disabled: context.disabled,
|
|
72
|
+
...triggerProps,
|
|
73
|
+
ref: forwardedRef,
|
|
74
|
+
onPress: composeEventHandlers(props.onPress, context.onOpenToggle),
|
|
75
|
+
children: typeof children === "function" ? children({ open: context.open }) : children
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
81
|
+
const CONTENT_NAME = "CollapsibleContent";
|
|
82
|
+
const CollapsibleContentFrame = styled(Stack, {
|
|
83
|
+
name: CONTENT_NAME
|
|
84
|
+
});
|
|
85
|
+
const CollapsibleContent = CollapsibleContentFrame.styleable((props, forwardedRef) => {
|
|
86
|
+
const { forceMount, children, __scopeCollapsible, ...contentProps } = props;
|
|
87
|
+
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
|
|
88
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ jsx(CollapsibleContentFrame, { ref: forwardedRef, ...contentProps, children }) : null });
|
|
89
|
+
});
|
|
90
|
+
CollapsibleContent.displayName = CONTENT_NAME;
|
|
91
|
+
function getState(open) {
|
|
92
|
+
return open ? "open" : "closed";
|
|
93
|
+
}
|
|
94
|
+
const Collapsible = withStaticProperties(_Collapsible, {
|
|
95
|
+
Trigger: CollapsibleTrigger,
|
|
96
|
+
Content: CollapsibleContent
|
|
97
|
+
});
|
|
2
98
|
export {
|
|
3
|
-
Collapsible
|
|
99
|
+
Collapsible,
|
|
100
|
+
CollapsibleContent,
|
|
101
|
+
CollapsibleContentFrame,
|
|
102
|
+
CollapsibleTrigger,
|
|
103
|
+
CollapsibleTriggerFrame,
|
|
104
|
+
createCollapsibleScope
|
|
4
105
|
};
|
|
5
106
|
//# sourceMappingURL=Collapsible.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Collapsible.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAuEQ;AArER,SAAS,0BAA0B;AAEnC,SAAS,4BAA4B;AACrC;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAMhC,MAAM,mBAAmB;AAGzB,MAAM,CAAC,0BAA0B,sBAAsB,IACrD,mBAAmB,gBAAgB;AASrC,MAAM,CAAC,qBAAqB,qBAAqB,IAC/C,yBAAkD,gBAAgB;AASpE,MAAM,eAAe,MAAM;AAAA,EACzB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AAEJ,UAAM,CAAC,OAAO,OAAO,OAAO,IAAI,qBAAqB;AAAA,MACnD,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ,CAAC;AAED,WACE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oB,GAAG,aAAa,IAAI;AACtE,QAAM,UAAU,sBAAsB,cAAc,kBAAkB;AAEtE,SACE,oBAAC,mBAAiB,GAAG,cAClB,wBAAc,QAAQ,OACrB,oBAAC,2BAAwB,KAAK,cAAe,GAAG,cAC7C,UACH,IACE,MACN;AAEJ,CAAC;AAED,mBAAmB,cAAc;AAGjC,SAAS,SAAS,MAAgB;AAChC,SAAO,OAAO,SAAS;AACzB;AAEA,MAAM,cAAc,qBAAqB,cAAc;AAAA,EACrD,SAAS;AAAA,EACT,SAAS;AACX,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/jsx/Collapsible.js
CHANGED
|
@@ -1,5 +1,94 @@
|
|
|
1
|
-
|
|
1
|
+
import { createContextScope } from "@tamagui/create-context";
|
|
2
|
+
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
3
|
+
import {
|
|
4
|
+
Stack,
|
|
5
|
+
composeEventHandlers,
|
|
6
|
+
styled,
|
|
7
|
+
withStaticProperties
|
|
8
|
+
} from "@tamagui/web";
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { AnimatePresence } from "tamagui";
|
|
11
|
+
const COLLAPSIBLE_NAME = "Collapsible";
|
|
12
|
+
const [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
13
|
+
const [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
14
|
+
const _Collapsible = React.forwardRef(
|
|
15
|
+
(props, forwardedRef) => {
|
|
16
|
+
const {
|
|
17
|
+
__scopeCollapsible,
|
|
18
|
+
open: openProp,
|
|
19
|
+
defaultOpen,
|
|
20
|
+
disabled,
|
|
21
|
+
onOpenChange,
|
|
22
|
+
...collapsibleProps
|
|
23
|
+
} = props;
|
|
24
|
+
const [open = false, setOpen] = useControllableState({
|
|
25
|
+
prop: openProp,
|
|
26
|
+
defaultProp: defaultOpen,
|
|
27
|
+
onChange: onOpenChange
|
|
28
|
+
});
|
|
29
|
+
return <CollapsibleProvider
|
|
30
|
+
scope={__scopeCollapsible}
|
|
31
|
+
disabled={disabled}
|
|
32
|
+
contentId={React.useId()}
|
|
33
|
+
open={open}
|
|
34
|
+
onOpenToggle={React.useCallback(
|
|
35
|
+
() => setOpen((prevOpen) => !prevOpen),
|
|
36
|
+
[setOpen]
|
|
37
|
+
)}
|
|
38
|
+
><Stack
|
|
39
|
+
data-state={getState(open)}
|
|
40
|
+
data-disabled={disabled ? "" : void 0}
|
|
41
|
+
{...collapsibleProps}
|
|
42
|
+
ref={forwardedRef}
|
|
43
|
+
/></CollapsibleProvider>;
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
_Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
47
|
+
const TRIGGER_NAME = "CollapsibleTrigger";
|
|
48
|
+
const CollapsibleTriggerFrame = styled(Stack, {
|
|
49
|
+
name: TRIGGER_NAME,
|
|
50
|
+
tag: "button"
|
|
51
|
+
});
|
|
52
|
+
const CollapsibleTrigger = CollapsibleTriggerFrame.styleable(
|
|
53
|
+
(props, forwardedRef) => {
|
|
54
|
+
const { __scopeCollapsible, children, ...triggerProps } = props;
|
|
55
|
+
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
|
|
56
|
+
return <CollapsibleTriggerFrame
|
|
57
|
+
aria-controls={context.contentId}
|
|
58
|
+
aria-expanded={context.open || false}
|
|
59
|
+
data-state={getState(context.open)}
|
|
60
|
+
data-disabled={context.disabled ? "" : void 0}
|
|
61
|
+
disabled={context.disabled}
|
|
62
|
+
{...triggerProps}
|
|
63
|
+
ref={forwardedRef}
|
|
64
|
+
onPress={composeEventHandlers(props.onPress, context.onOpenToggle)}
|
|
65
|
+
>{typeof children === "function" ? children({ open: context.open }) : children}</CollapsibleTriggerFrame>;
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
69
|
+
const CONTENT_NAME = "CollapsibleContent";
|
|
70
|
+
const CollapsibleContentFrame = styled(Stack, {
|
|
71
|
+
name: CONTENT_NAME
|
|
72
|
+
});
|
|
73
|
+
const CollapsibleContent = CollapsibleContentFrame.styleable((props, forwardedRef) => {
|
|
74
|
+
const { forceMount, children, __scopeCollapsible, ...contentProps } = props;
|
|
75
|
+
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
|
|
76
|
+
return <AnimatePresence {...contentProps}>{forceMount || context.open ? <CollapsibleContentFrame ref={forwardedRef} {...contentProps}>{children}</CollapsibleContentFrame> : null}</AnimatePresence>;
|
|
77
|
+
});
|
|
78
|
+
CollapsibleContent.displayName = CONTENT_NAME;
|
|
79
|
+
function getState(open) {
|
|
80
|
+
return open ? "open" : "closed";
|
|
81
|
+
}
|
|
82
|
+
const Collapsible = withStaticProperties(_Collapsible, {
|
|
83
|
+
Trigger: CollapsibleTrigger,
|
|
84
|
+
Content: CollapsibleContent
|
|
85
|
+
});
|
|
2
86
|
export {
|
|
3
|
-
Collapsible
|
|
87
|
+
Collapsible,
|
|
88
|
+
CollapsibleContent,
|
|
89
|
+
CollapsibleContentFrame,
|
|
90
|
+
CollapsibleTrigger,
|
|
91
|
+
CollapsibleTriggerFrame,
|
|
92
|
+
createCollapsibleScope
|
|
4
93
|
};
|
|
5
94
|
//# sourceMappingURL=Collapsible.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Collapsible.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAEA,SAAS,0BAA0B;AAEnC,SAAS,4BAA4B;AACrC;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAMhC,MAAM,mBAAmB;AAGzB,MAAM,CAAC,0BAA0B,sBAAsB,IACrD,mBAAmB,gBAAgB;AASrC,MAAM,CAAC,qBAAqB,qBAAqB,IAC/C,y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,QAAQ,KAAK,CAAC,IAAI,SACvE,EAXC;AAAA,EAaL;AACF;AAEA,mBAAmB,cAAc;AAcjC,MAAM,eAAe;AAErB,MAAM,0BAA0B,OAAO,OAAO;AAAA,EAC5C,MAAM;AACR,CAAC;AAED,MAAM,qBAAqB,wBAAwB,UAEjD,CAAC,OAAO,iBAAiB;AACzB,QAAM,EAAE,YAAY,UAAU,oBAAoB,GAAG,aAAa,IAAI;AACtE,QAAM,UAAU,sBAAsB,cAAc,kBAAkB;AAEtE,SACE,CAAC,oBAAoB,eAClB,cAAc,QAAQ,OACrB,CAAC,wBAAwB,KAAK,kBAAkB,eAC7C,SACH,EAFC,2BAGC,KACN,EANC;AAQL,CAAC;AAED,mBAAmB,cAAc;AAGjC,SAAS,SAAS,MAAgB;AAChC,SAAO,OAAO,SAAS;AACzB;AAEA,MAAM,cAAc,qBAAqB,cAAc;AAAA,EACrD,SAAS;AAAA,EACT,SAAS;AACX,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/jsx/Collapsible.mjs
CHANGED
|
@@ -1,5 +1,94 @@
|
|
|
1
|
-
|
|
1
|
+
import { createContextScope } from "@tamagui/create-context";
|
|
2
|
+
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
3
|
+
import {
|
|
4
|
+
Stack,
|
|
5
|
+
composeEventHandlers,
|
|
6
|
+
styled,
|
|
7
|
+
withStaticProperties
|
|
8
|
+
} from "@tamagui/web";
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { AnimatePresence } from "tamagui";
|
|
11
|
+
const COLLAPSIBLE_NAME = "Collapsible";
|
|
12
|
+
const [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
13
|
+
const [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
14
|
+
const _Collapsible = React.forwardRef(
|
|
15
|
+
(props, forwardedRef) => {
|
|
16
|
+
const {
|
|
17
|
+
__scopeCollapsible,
|
|
18
|
+
open: openProp,
|
|
19
|
+
defaultOpen,
|
|
20
|
+
disabled,
|
|
21
|
+
onOpenChange,
|
|
22
|
+
...collapsibleProps
|
|
23
|
+
} = props;
|
|
24
|
+
const [open = false, setOpen] = useControllableState({
|
|
25
|
+
prop: openProp,
|
|
26
|
+
defaultProp: defaultOpen,
|
|
27
|
+
onChange: onOpenChange
|
|
28
|
+
});
|
|
29
|
+
return <CollapsibleProvider
|
|
30
|
+
scope={__scopeCollapsible}
|
|
31
|
+
disabled={disabled}
|
|
32
|
+
contentId={React.useId()}
|
|
33
|
+
open={open}
|
|
34
|
+
onOpenToggle={React.useCallback(
|
|
35
|
+
() => setOpen((prevOpen) => !prevOpen),
|
|
36
|
+
[setOpen]
|
|
37
|
+
)}
|
|
38
|
+
><Stack
|
|
39
|
+
data-state={getState(open)}
|
|
40
|
+
data-disabled={disabled ? "" : void 0}
|
|
41
|
+
{...collapsibleProps}
|
|
42
|
+
ref={forwardedRef}
|
|
43
|
+
/></CollapsibleProvider>;
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
_Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
47
|
+
const TRIGGER_NAME = "CollapsibleTrigger";
|
|
48
|
+
const CollapsibleTriggerFrame = styled(Stack, {
|
|
49
|
+
name: TRIGGER_NAME,
|
|
50
|
+
tag: "button"
|
|
51
|
+
});
|
|
52
|
+
const CollapsibleTrigger = CollapsibleTriggerFrame.styleable(
|
|
53
|
+
(props, forwardedRef) => {
|
|
54
|
+
const { __scopeCollapsible, children, ...triggerProps } = props;
|
|
55
|
+
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
|
|
56
|
+
return <CollapsibleTriggerFrame
|
|
57
|
+
aria-controls={context.contentId}
|
|
58
|
+
aria-expanded={context.open || false}
|
|
59
|
+
data-state={getState(context.open)}
|
|
60
|
+
data-disabled={context.disabled ? "" : void 0}
|
|
61
|
+
disabled={context.disabled}
|
|
62
|
+
{...triggerProps}
|
|
63
|
+
ref={forwardedRef}
|
|
64
|
+
onPress={composeEventHandlers(props.onPress, context.onOpenToggle)}
|
|
65
|
+
>{typeof children === "function" ? children({ open: context.open }) : children}</CollapsibleTriggerFrame>;
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
69
|
+
const CONTENT_NAME = "CollapsibleContent";
|
|
70
|
+
const CollapsibleContentFrame = styled(Stack, {
|
|
71
|
+
name: CONTENT_NAME
|
|
72
|
+
});
|
|
73
|
+
const CollapsibleContent = CollapsibleContentFrame.styleable((props, forwardedRef) => {
|
|
74
|
+
const { forceMount, children, __scopeCollapsible, ...contentProps } = props;
|
|
75
|
+
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
|
|
76
|
+
return <AnimatePresence {...contentProps}>{forceMount || context.open ? <CollapsibleContentFrame ref={forwardedRef} {...contentProps}>{children}</CollapsibleContentFrame> : null}</AnimatePresence>;
|
|
77
|
+
});
|
|
78
|
+
CollapsibleContent.displayName = CONTENT_NAME;
|
|
79
|
+
function getState(open) {
|
|
80
|
+
return open ? "open" : "closed";
|
|
81
|
+
}
|
|
82
|
+
const Collapsible = withStaticProperties(_Collapsible, {
|
|
83
|
+
Trigger: CollapsibleTrigger,
|
|
84
|
+
Content: CollapsibleContent
|
|
85
|
+
});
|
|
2
86
|
export {
|
|
3
|
-
Collapsible
|
|
87
|
+
Collapsible,
|
|
88
|
+
CollapsibleContent,
|
|
89
|
+
CollapsibleContentFrame,
|
|
90
|
+
CollapsibleTrigger,
|
|
91
|
+
CollapsibleTriggerFrame,
|
|
92
|
+
createCollapsibleScope
|
|
4
93
|
};
|
|
5
94
|
//# sourceMappingURL=Collapsible.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Collapsible.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAEA,SAAS,0B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,eAAe,QAAQ,QAAQ;AAAA,MAC/B,YAAY,SAAS,QAAQ,IAAI;AAAA,MACjC,eAAe,QAAQ,WAAW,KAAK;AAAA,MACvC,UAAU,QAAQ;AAAA,UACd;AAAA,MACJ,KAAK;AAAA,MACL,SAAS,qBAAqB,MAAM,SAAgB,QAAQ,YAAY;AAAA,MAEvE,OAAO,aAAa,aAAa,SAAS,EAAE,MAAM,QAAQ,KAAK,CAAC,IAAI,SACvE,EAXC;AAAA,EAaL;AACF;AAEA,mBAAmB,cAAc;AAcjC,MAAM,eAAe;AAErB,MAAM,0BAA0B,OAAO,OAAO;AAAA,EAC5C,MAAM;AACR,CAAC;AAED,MAAM,qBAAqB,wBAAwB,UAEjD,CAAC,OAAO,iBAAiB;AACzB,QAAM,EAAE,YAAY,UAAU,oBAAoB,GAAG,aAAa,IAAI;AACtE,QAAM,UAAU,sBAAsB,cAAc,kBAAkB;AAEtE,SACE,CAAC,oBAAoB,eAClB,cAAc,QAAQ,OACrB,CAAC,wBAAwB,KAAK,kBAAkB,eAC7C,SACH,EAFC,2BAGC,KACN,EANC;AAQL,CAAC;AAED,mBAAmB,cAAc;AAGjC,SAAS,SAAS,MAAgB;AAChC,SAAO,OAAO,SAAS;AACzB;AAEA,MAAM,cAAc,qBAAqB,cAAc;AAAA,EACrD,SAAS;AAAA,EACT,SAAS;AACX,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/collapsible",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"watch": "tamagui-build --watch"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@tamagui/compose-refs": "1.
|
|
21
|
-
"@tamagui/core": "1.
|
|
22
|
-
"@tamagui/create-context": "1.
|
|
23
|
-
"@tamagui/polyfill-dev": "1.
|
|
24
|
-
"@tamagui/stacks": "1.
|
|
25
|
-
"@tamagui/use-controllable-state": "1.
|
|
20
|
+
"@tamagui/compose-refs": "1.41.0",
|
|
21
|
+
"@tamagui/core": "1.41.0",
|
|
22
|
+
"@tamagui/create-context": "1.41.0",
|
|
23
|
+
"@tamagui/polyfill-dev": "1.41.0",
|
|
24
|
+
"@tamagui/stacks": "1.41.0",
|
|
25
|
+
"@tamagui/use-controllable-state": "1.41.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "*"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@tamagui/build": "1.
|
|
31
|
+
"@tamagui/build": "1.41.0",
|
|
32
32
|
"react": "^18.2.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
package/src/Collapsible.tsx
CHANGED
|
@@ -1,248 +1,177 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
// // animationFillMode: node.style.animationFillMode,
|
|
179
|
-
// // }
|
|
180
|
-
// // // block any animations/transitions so the element renders at its full dimensions
|
|
181
|
-
// // node.style.transitionDuration = '0s'
|
|
182
|
-
// // node.style.animationDuration = '0s'
|
|
183
|
-
// // node.style.animationFillMode = 'none'
|
|
184
|
-
|
|
185
|
-
// // // get width and height from full dimensions
|
|
186
|
-
// // const rect = node.getBoundingClientRect()
|
|
187
|
-
// // heightRef.current = rect.height
|
|
188
|
-
// // widthRef.current = rect.width
|
|
189
|
-
|
|
190
|
-
// // // kick off any animations/transitions that were originally set up if it isn't the initial mount
|
|
191
|
-
// // if (!isMountAnimationPreventedRef.current) {
|
|
192
|
-
// // node.style.transitionDuration = originalStylesRef.current.transitionDuration
|
|
193
|
-
// // node.style.animationDuration = originalStylesRef.current.animationDuration
|
|
194
|
-
// // node.style.animationFillMode = originalStylesRef.current.animationFillMode
|
|
195
|
-
// // }
|
|
196
|
-
|
|
197
|
-
// // setIsPresent(present)
|
|
198
|
-
// // }
|
|
199
|
-
// // /**
|
|
200
|
-
// // * depends on `context.open` because it will change to `false`
|
|
201
|
-
// // * when a close is triggered but `present` will be `false` on
|
|
202
|
-
// // * animation end (so when close finishes). This allows us to
|
|
203
|
-
// // * retrieve the dimensions *before* closing.
|
|
204
|
-
// // */
|
|
205
|
-
// // }, [context.open, present])
|
|
206
|
-
|
|
207
|
-
// return (
|
|
208
|
-
// <Stack
|
|
209
|
-
// data-state={getState(context.open)}
|
|
210
|
-
// data-disabled={context.disabled ? '' : undefined}
|
|
211
|
-
// id={context.contentId}
|
|
212
|
-
// hidden={!isOpen}
|
|
213
|
-
// {...contentProps}
|
|
214
|
-
// // @ts-expect-error
|
|
215
|
-
// ref={composedRefs}
|
|
216
|
-
// // style={{
|
|
217
|
-
// // [`--radix-collapsible-content-height` as any]: height ? `${height}px` : undefined,
|
|
218
|
-
// // [`--radix-collapsible-content-width` as any]: width ? `${width}px` : undefined,
|
|
219
|
-
// // ...props.style,
|
|
220
|
-
// // }}
|
|
221
|
-
// >
|
|
222
|
-
// {isOpen && children}
|
|
223
|
-
// </Stack>
|
|
224
|
-
// )
|
|
225
|
-
// })
|
|
226
|
-
|
|
227
|
-
// /* -----------------------------------------------------------------------------------------------*/
|
|
228
|
-
|
|
229
|
-
// function getState(open?: boolean) {
|
|
230
|
-
// return open ? 'open' : 'closed'
|
|
231
|
-
// }
|
|
232
|
-
|
|
233
|
-
// const Root = Collapsible
|
|
234
|
-
// const Trigger = CollapsibleTrigger
|
|
235
|
-
// const Content = CollapsibleContent
|
|
236
|
-
|
|
237
|
-
// export {
|
|
238
|
-
// createCollapsibleScope,
|
|
239
|
-
// //
|
|
240
|
-
// Collapsible,
|
|
241
|
-
// CollapsibleTrigger,
|
|
242
|
-
// CollapsibleContent,
|
|
243
|
-
// //
|
|
244
|
-
// Root,
|
|
245
|
-
// Trigger,
|
|
246
|
-
// Content,
|
|
247
|
-
// }
|
|
248
|
-
// export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps }
|
|
1
|
+
import { AnimatePresenceProps } from '@tamagui/animate-presence/types/types'
|
|
2
|
+
import type { Scope } from '@tamagui/create-context'
|
|
3
|
+
import { createContextScope } from '@tamagui/create-context'
|
|
4
|
+
import { ThemeableStackProps } from '@tamagui/stacks'
|
|
5
|
+
import { useControllableState } from '@tamagui/use-controllable-state'
|
|
6
|
+
import {
|
|
7
|
+
GetProps,
|
|
8
|
+
Stack,
|
|
9
|
+
StackProps,
|
|
10
|
+
composeEventHandlers,
|
|
11
|
+
styled,
|
|
12
|
+
withStaticProperties,
|
|
13
|
+
} from '@tamagui/web'
|
|
14
|
+
import * as React from 'react'
|
|
15
|
+
import { AnimatePresence } from 'tamagui'
|
|
16
|
+
|
|
17
|
+
/* -------------------------------------------------------------------------------------------------
|
|
18
|
+
* Collapsible
|
|
19
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
20
|
+
|
|
21
|
+
const COLLAPSIBLE_NAME = 'Collapsible'
|
|
22
|
+
|
|
23
|
+
type ScopedProps<P> = P & { __scopeCollapsible?: Scope }
|
|
24
|
+
const [createCollapsibleContext, createCollapsibleScope] =
|
|
25
|
+
createContextScope(COLLAPSIBLE_NAME)
|
|
26
|
+
|
|
27
|
+
type CollapsibleContextValue = {
|
|
28
|
+
contentId: string
|
|
29
|
+
disabled?: boolean
|
|
30
|
+
open: boolean
|
|
31
|
+
onOpenToggle(): void
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const [CollapsibleProvider, useCollapsibleContext] =
|
|
35
|
+
createCollapsibleContext<CollapsibleContextValue>(COLLAPSIBLE_NAME)
|
|
36
|
+
|
|
37
|
+
interface CollapsibleProps extends StackProps {
|
|
38
|
+
defaultOpen?: boolean
|
|
39
|
+
open?: boolean
|
|
40
|
+
disabled?: boolean
|
|
41
|
+
onOpenChange?(open: boolean): void
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const _Collapsible = React.forwardRef<Stack, ScopedProps<CollapsibleProps>>(
|
|
45
|
+
(props, forwardedRef) => {
|
|
46
|
+
const {
|
|
47
|
+
__scopeCollapsible,
|
|
48
|
+
open: openProp,
|
|
49
|
+
defaultOpen,
|
|
50
|
+
disabled,
|
|
51
|
+
onOpenChange,
|
|
52
|
+
...collapsibleProps
|
|
53
|
+
} = props
|
|
54
|
+
|
|
55
|
+
const [open = false, setOpen] = useControllableState({
|
|
56
|
+
prop: openProp,
|
|
57
|
+
defaultProp: defaultOpen!,
|
|
58
|
+
onChange: onOpenChange,
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<CollapsibleProvider
|
|
63
|
+
scope={__scopeCollapsible}
|
|
64
|
+
disabled={disabled}
|
|
65
|
+
contentId={React.useId()}
|
|
66
|
+
open={open}
|
|
67
|
+
onOpenToggle={React.useCallback(
|
|
68
|
+
() => setOpen((prevOpen) => !prevOpen),
|
|
69
|
+
[setOpen]
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
<Stack
|
|
73
|
+
data-state={getState(open)}
|
|
74
|
+
data-disabled={disabled ? '' : undefined}
|
|
75
|
+
{...collapsibleProps}
|
|
76
|
+
ref={forwardedRef}
|
|
77
|
+
/>
|
|
78
|
+
</CollapsibleProvider>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
_Collapsible.displayName = COLLAPSIBLE_NAME
|
|
84
|
+
|
|
85
|
+
/* -------------------------------------------------------------------------------------------------
|
|
86
|
+
* CollapsibleTrigger
|
|
87
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
88
|
+
|
|
89
|
+
const TRIGGER_NAME = 'CollapsibleTrigger'
|
|
90
|
+
|
|
91
|
+
type CollapsibleTriggerProps = GetProps<typeof Stack>
|
|
92
|
+
|
|
93
|
+
const CollapsibleTriggerFrame = styled(Stack, {
|
|
94
|
+
name: TRIGGER_NAME,
|
|
95
|
+
tag: 'button',
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const CollapsibleTrigger = CollapsibleTriggerFrame.styleable<CollapsibleTriggerProps>(
|
|
99
|
+
(props: ScopedProps<CollapsibleTriggerProps>, forwardedRef) => {
|
|
100
|
+
const { __scopeCollapsible, children, ...triggerProps } = props
|
|
101
|
+
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible)
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<CollapsibleTriggerFrame
|
|
105
|
+
aria-controls={context.contentId}
|
|
106
|
+
aria-expanded={context.open || false}
|
|
107
|
+
data-state={getState(context.open)}
|
|
108
|
+
data-disabled={context.disabled ? '' : undefined}
|
|
109
|
+
disabled={context.disabled}
|
|
110
|
+
{...triggerProps}
|
|
111
|
+
ref={forwardedRef}
|
|
112
|
+
onPress={composeEventHandlers(props.onPress as any, context.onOpenToggle)}
|
|
113
|
+
>
|
|
114
|
+
{typeof children === 'function' ? children({ open: context.open }) : children}
|
|
115
|
+
</CollapsibleTriggerFrame>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
CollapsibleTrigger.displayName = TRIGGER_NAME
|
|
121
|
+
|
|
122
|
+
/* -------------------------------------------------------------------------------------------------
|
|
123
|
+
* CollapsibleContent
|
|
124
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
125
|
+
|
|
126
|
+
interface CollapsibleContentProps extends AnimatePresenceProps, ThemeableStackProps {
|
|
127
|
+
/**
|
|
128
|
+
* Used to force mounting when more control is needed. Useful when
|
|
129
|
+
* controlling animation with React animation libraries.
|
|
130
|
+
*/
|
|
131
|
+
forceMount?: true
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const CONTENT_NAME = 'CollapsibleContent'
|
|
135
|
+
|
|
136
|
+
const CollapsibleContentFrame = styled(Stack, {
|
|
137
|
+
name: CONTENT_NAME,
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
const CollapsibleContent = CollapsibleContentFrame.styleable<
|
|
141
|
+
ScopedProps<CollapsibleContentProps>
|
|
142
|
+
>((props, forwardedRef) => {
|
|
143
|
+
const { forceMount, children, __scopeCollapsible, ...contentProps } = props
|
|
144
|
+
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible)
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<AnimatePresence {...contentProps}>
|
|
148
|
+
{forceMount || context.open ? (
|
|
149
|
+
<CollapsibleContentFrame ref={forwardedRef} {...contentProps}>
|
|
150
|
+
{children}
|
|
151
|
+
</CollapsibleContentFrame>
|
|
152
|
+
) : null}
|
|
153
|
+
</AnimatePresence>
|
|
154
|
+
)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
CollapsibleContent.displayName = CONTENT_NAME
|
|
158
|
+
|
|
159
|
+
/* -----------------------------------------------------------------------------------------------*/
|
|
160
|
+
function getState(open?: boolean) {
|
|
161
|
+
return open ? 'open' : 'closed'
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const Collapsible = withStaticProperties(_Collapsible, {
|
|
165
|
+
Trigger: CollapsibleTrigger,
|
|
166
|
+
Content: CollapsibleContent,
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
export {
|
|
170
|
+
Collapsible,
|
|
171
|
+
CollapsibleContent,
|
|
172
|
+
CollapsibleContentFrame,
|
|
173
|
+
CollapsibleTrigger,
|
|
174
|
+
CollapsibleTriggerFrame,
|
|
175
|
+
createCollapsibleScope,
|
|
176
|
+
}
|
|
177
|
+
export type { CollapsibleContentProps, CollapsibleProps, CollapsibleTriggerProps }
|
package/types/Collapsible.d.ts
CHANGED
|
@@ -1,2 +1,221 @@
|
|
|
1
|
-
|
|
1
|
+
import { AnimatePresenceProps } from '@tamagui/animate-presence/types/types';
|
|
2
|
+
import type { Scope } from '@tamagui/create-context';
|
|
3
|
+
import { ThemeableStackProps } from '@tamagui/stacks';
|
|
4
|
+
import { GetProps, Stack, StackProps } from '@tamagui/web';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
declare const createCollapsibleScope: import("tamagui").CreateScope;
|
|
7
|
+
interface CollapsibleProps extends StackProps {
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
open?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onOpenChange?(open: boolean): void;
|
|
12
|
+
}
|
|
13
|
+
type CollapsibleTriggerProps = GetProps<typeof Stack>;
|
|
14
|
+
declare const CollapsibleTriggerFrame: import("tamagui").TamaguiComponent<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
15
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
16
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
17
|
+
[x: string]: undefined;
|
|
18
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
19
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
20
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
21
|
+
[x: string]: undefined;
|
|
22
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
23
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
24
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
25
|
+
[x: string]: undefined;
|
|
26
|
+
}>>), import("tamagui").TamaguiElement, import("tamagui").StackPropsBase, {} | {
|
|
27
|
+
[x: string]: undefined;
|
|
28
|
+
}, {
|
|
29
|
+
displayName: string | undefined;
|
|
30
|
+
__baseProps: import("tamagui").StackPropsBase;
|
|
31
|
+
__variantProps: {};
|
|
32
|
+
}>;
|
|
33
|
+
declare const CollapsibleTrigger: import("@tamagui/web").ReactComponentWithRef<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
34
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
35
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>>> & import("@tamagui/web").MediaProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>>>> & Omit<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
36
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
37
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
38
|
+
[x: string]: undefined;
|
|
39
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
40
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
41
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
42
|
+
[x: string]: undefined;
|
|
43
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
44
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
45
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
46
|
+
[x: string]: undefined;
|
|
47
|
+
}>>), "style" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-labelledby" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-live" | "aria-modal" | "accessibilityLiveRegion" | "accessibilityLabelledBy" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | `$${string}` | `$${number}` | keyof {
|
|
48
|
+
columnGap?: import("@tamagui/web").SpaceValue | undefined;
|
|
49
|
+
contain?: import("csstype").Property.Contain | undefined;
|
|
50
|
+
cursor?: import("csstype").Property.Cursor | undefined;
|
|
51
|
+
display?: "flex" | "none" | "inherit" | "inline" | "block" | "contents" | "inline-flex" | undefined;
|
|
52
|
+
gap?: import("@tamagui/web").SpaceValue | undefined;
|
|
53
|
+
outlineColor?: import("csstype").Property.OutlineColor | undefined;
|
|
54
|
+
outlineOffset?: import("@tamagui/web").SpaceValue | undefined;
|
|
55
|
+
outlineStyle?: import("csstype").Property.OutlineStyle | undefined;
|
|
56
|
+
outlineWidth?: import("@tamagui/web").SpaceValue | undefined;
|
|
57
|
+
pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined;
|
|
58
|
+
rowGap?: import("@tamagui/web").SpaceValue | undefined;
|
|
59
|
+
space?: import("@tamagui/web").SpaceValue | undefined;
|
|
60
|
+
spaceDirection?: import("@tamagui/web").SpaceDirection | undefined;
|
|
61
|
+
separator?: React.ReactNode;
|
|
62
|
+
animation?: import("@tamagui/web").AnimationProp | null | undefined;
|
|
63
|
+
animateOnly?: string[] | undefined;
|
|
64
|
+
userSelect?: import("csstype").Property.UserSelect | undefined;
|
|
65
|
+
} | "backgroundColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderBottomColor" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderColor" | "borderCurve" | "borderEndColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderLeftColor" | "borderRadius" | "borderRightColor" | "borderStartColor" | "borderStartEndRadius" | "borderStartStartRadius" | "borderStyle" | "borderTopColor" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "opacity" | "alignContent" | "alignItems" | "alignSelf" | "aspectRatio" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "borderWidth" | "bottom" | "end" | "flex" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "left" | "margin" | "marginBottom" | "marginEnd" | "marginHorizontal" | "marginLeft" | "marginRight" | "marginStart" | "marginTop" | "marginVertical" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "overflow" | "padding" | "paddingBottom" | "paddingEnd" | "paddingHorizontal" | "paddingLeft" | "paddingRight" | "paddingStart" | "paddingTop" | "paddingVertical" | "position" | "right" | "start" | "top" | "width" | "zIndex" | "direction" | "shadowColor" | "shadowOffset" | "shadowOpacity" | "shadowRadius" | "transform" | "transformMatrix" | "rotation" | "translateX" | "translateY" | keyof import("tamagui").TransformStyleProps | keyof import("tamagui").TamaguiComponentPropsBase | keyof import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>>>>, import("tamagui").TamaguiElement> & {
|
|
66
|
+
staticConfig: import("tamagui").StaticConfigParsed;
|
|
67
|
+
styleable: import("tamagui").Styleable<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
68
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
69
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
70
|
+
[x: string]: undefined;
|
|
71
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
72
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
73
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
74
|
+
[x: string]: undefined;
|
|
75
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
76
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
77
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
78
|
+
[x: string]: undefined;
|
|
79
|
+
}>>), import("tamagui").TamaguiElement>;
|
|
80
|
+
};
|
|
81
|
+
interface CollapsibleContentProps extends AnimatePresenceProps, ThemeableStackProps {
|
|
82
|
+
/**
|
|
83
|
+
* Used to force mounting when more control is needed. Useful when
|
|
84
|
+
* controlling animation with React animation libraries.
|
|
85
|
+
*/
|
|
86
|
+
forceMount?: true;
|
|
87
|
+
}
|
|
88
|
+
declare const CollapsibleContentFrame: import("tamagui").TamaguiComponent<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
89
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
90
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
91
|
+
[x: string]: undefined;
|
|
92
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
93
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
94
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
95
|
+
[x: string]: undefined;
|
|
96
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
97
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
98
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
99
|
+
[x: string]: undefined;
|
|
100
|
+
}>>), import("tamagui").TamaguiElement, import("tamagui").StackPropsBase, {} | {
|
|
101
|
+
[x: string]: undefined;
|
|
102
|
+
}, {
|
|
103
|
+
displayName: string | undefined;
|
|
104
|
+
__baseProps: import("tamagui").StackPropsBase;
|
|
105
|
+
__variantProps: {};
|
|
106
|
+
}>;
|
|
107
|
+
declare const CollapsibleContent: import("@tamagui/web").ReactComponentWithRef<CollapsibleContentProps & {
|
|
108
|
+
__scopeCollapsible?: Scope;
|
|
109
|
+
} & Omit<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
110
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
111
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
112
|
+
[x: string]: undefined;
|
|
113
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
114
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
115
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
116
|
+
[x: string]: undefined;
|
|
117
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
118
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
119
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
120
|
+
[x: string]: undefined;
|
|
121
|
+
}>>), "__scopeCollapsible" | keyof CollapsibleContentProps>, import("tamagui").TamaguiElement> & {
|
|
122
|
+
staticConfig: import("tamagui").StaticConfigParsed;
|
|
123
|
+
styleable: import("tamagui").Styleable<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
124
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
125
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
126
|
+
[x: string]: undefined;
|
|
127
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
128
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
129
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
130
|
+
[x: string]: undefined;
|
|
131
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
132
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
133
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
134
|
+
[x: string]: undefined;
|
|
135
|
+
}>>), import("tamagui").TamaguiElement>;
|
|
136
|
+
};
|
|
137
|
+
declare const Collapsible: React.ForwardRefExoticComponent<CollapsibleProps & {
|
|
138
|
+
__scopeCollapsible?: Scope;
|
|
139
|
+
} & React.RefAttributes<import("tamagui").TamaguiElement>> & {
|
|
140
|
+
Trigger: import("@tamagui/web").ReactComponentWithRef<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
141
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
142
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>>> & import("@tamagui/web").MediaProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>>>> & Omit<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
143
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
144
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
145
|
+
[x: string]: undefined;
|
|
146
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
147
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
148
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
149
|
+
[x: string]: undefined;
|
|
150
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
151
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
152
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
153
|
+
[x: string]: undefined;
|
|
154
|
+
}>>), "style" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-labelledby" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-live" | "aria-modal" | "accessibilityLiveRegion" | "accessibilityLabelledBy" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | `$${string}` | `$${number}` | keyof {
|
|
155
|
+
columnGap?: import("@tamagui/web").SpaceValue | undefined;
|
|
156
|
+
contain?: import("csstype").Property.Contain | undefined;
|
|
157
|
+
cursor?: import("csstype").Property.Cursor | undefined;
|
|
158
|
+
display?: "flex" | "none" | "inherit" | "inline" | "block" | "contents" | "inline-flex" | undefined;
|
|
159
|
+
gap?: import("@tamagui/web").SpaceValue | undefined;
|
|
160
|
+
outlineColor?: import("csstype").Property.OutlineColor | undefined;
|
|
161
|
+
outlineOffset?: import("@tamagui/web").SpaceValue | undefined;
|
|
162
|
+
outlineStyle?: import("csstype").Property.OutlineStyle | undefined;
|
|
163
|
+
outlineWidth?: import("@tamagui/web").SpaceValue | undefined;
|
|
164
|
+
pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined;
|
|
165
|
+
rowGap?: import("@tamagui/web").SpaceValue | undefined;
|
|
166
|
+
space?: import("@tamagui/web").SpaceValue | undefined;
|
|
167
|
+
spaceDirection?: import("@tamagui/web").SpaceDirection | undefined;
|
|
168
|
+
separator?: React.ReactNode;
|
|
169
|
+
animation?: import("@tamagui/web").AnimationProp | null | undefined;
|
|
170
|
+
animateOnly?: string[] | undefined;
|
|
171
|
+
userSelect?: import("csstype").Property.UserSelect | undefined;
|
|
172
|
+
} | "backgroundColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderBottomColor" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderColor" | "borderCurve" | "borderEndColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderLeftColor" | "borderRadius" | "borderRightColor" | "borderStartColor" | "borderStartEndRadius" | "borderStartStartRadius" | "borderStyle" | "borderTopColor" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "opacity" | "alignContent" | "alignItems" | "alignSelf" | "aspectRatio" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "borderWidth" | "bottom" | "end" | "flex" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "left" | "margin" | "marginBottom" | "marginEnd" | "marginHorizontal" | "marginLeft" | "marginRight" | "marginStart" | "marginTop" | "marginVertical" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "overflow" | "padding" | "paddingBottom" | "paddingEnd" | "paddingHorizontal" | "paddingLeft" | "paddingRight" | "paddingStart" | "paddingTop" | "paddingVertical" | "position" | "right" | "start" | "top" | "width" | "zIndex" | "direction" | "shadowColor" | "shadowOffset" | "shadowOpacity" | "shadowRadius" | "transform" | "transformMatrix" | "rotation" | "translateX" | "translateY" | keyof import("tamagui").TransformStyleProps | keyof import("tamagui").TamaguiComponentPropsBase | keyof import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>>>>, import("tamagui").TamaguiElement> & {
|
|
173
|
+
staticConfig: import("tamagui").StaticConfigParsed;
|
|
174
|
+
styleable: import("tamagui").Styleable<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
175
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
176
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
177
|
+
[x: string]: undefined;
|
|
178
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
179
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
180
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
181
|
+
[x: string]: undefined;
|
|
182
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
183
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
184
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
185
|
+
[x: string]: undefined;
|
|
186
|
+
}>>), import("tamagui").TamaguiElement>;
|
|
187
|
+
};
|
|
188
|
+
Content: import("@tamagui/web").ReactComponentWithRef<CollapsibleContentProps & {
|
|
189
|
+
__scopeCollapsible?: Scope;
|
|
190
|
+
} & Omit<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
191
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
192
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
193
|
+
[x: string]: undefined;
|
|
194
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
195
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
196
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
197
|
+
[x: string]: undefined;
|
|
198
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
199
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
200
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
201
|
+
[x: string]: undefined;
|
|
202
|
+
}>>), "__scopeCollapsible" | keyof CollapsibleContentProps>, import("tamagui").TamaguiElement> & {
|
|
203
|
+
staticConfig: import("tamagui").StaticConfigParsed;
|
|
204
|
+
styleable: import("tamagui").Styleable<StackProps | (Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
205
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
206
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
207
|
+
[x: string]: undefined;
|
|
208
|
+
} & import("@tamagui/web").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
209
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
210
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
211
|
+
[x: string]: undefined;
|
|
212
|
+
}>> & import("@tamagui/web").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers) | "style"> & import("@tamagui/web").ExtendBaseStackProps & import("tamagui").TamaguiComponentPropsBase & {
|
|
213
|
+
style?: import("@tamagui/web").StyleProp<import("react-native").ViewStyle | React.CSSProperties | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
214
|
+
} & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStylePropsBase>> & Omit<{}, string | number> & {
|
|
215
|
+
[x: string]: undefined;
|
|
216
|
+
}>>), import("tamagui").TamaguiElement>;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
export { Collapsible, CollapsibleContent, CollapsibleContentFrame, CollapsibleTrigger, CollapsibleTriggerFrame, createCollapsibleScope, };
|
|
220
|
+
export type { CollapsibleContentProps, CollapsibleProps, CollapsibleTriggerProps };
|
|
2
221
|
//# sourceMappingURL=Collapsible.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collapsible.d.ts","sourceRoot":"","sources":["../src/Collapsible.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Collapsible.d.ts","sourceRoot":"","sources":["../src/Collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,EACL,QAAQ,EACR,KAAK,EACL,UAAU,EAIX,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAU9B,QAAA,MAAiC,sBAAsB,+BACjB,CAAA;AAYtC,UAAU,gBAAiB,SAAQ,UAAU;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YA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