@tamagui/collapsible 1.88.1 → 1.88.2
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 +0 -8
- package/dist/cjs/index.js +0 -4
- package/dist/esm/Collapsible.native.js +47 -22
- package/dist/esm/Collapsible.native.js.map +1 -1
- package/dist/esm/index.native.js +19 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/jsx/Collapsible.js +38 -26
- package/dist/jsx/Collapsible.js.map +1 -1
- package/dist/jsx/Collapsible.native.js +78 -41
- package/dist/jsx/Collapsible.native.js.map +1 -1
- package/dist/jsx/index.native.js +19 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +10 -10
package/dist/cjs/Collapsible.js
CHANGED
|
@@ -106,12 +106,4 @@ const Collapsible = (0, import_helpers.withStaticProperties)(_Collapsible, {
|
|
|
106
106
|
Trigger: CollapsibleTrigger,
|
|
107
107
|
Content: CollapsibleContent
|
|
108
108
|
});
|
|
109
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
-
0 && (module.exports = {
|
|
111
|
-
Collapsible,
|
|
112
|
-
CollapsibleContent,
|
|
113
|
-
CollapsibleContentFrame,
|
|
114
|
-
CollapsibleTrigger,
|
|
115
|
-
CollapsibleTriggerFrame
|
|
116
|
-
});
|
|
117
109
|
//# sourceMappingURL=Collapsible.js.map
|
package/dist/cjs/index.js
CHANGED
|
@@ -12,8 +12,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0
|
|
|
12
12
|
var src_exports = {};
|
|
13
13
|
module.exports = __toCommonJS(src_exports);
|
|
14
14
|
__reExport(src_exports, require("./Collapsible"), module.exports);
|
|
15
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
16
|
-
0 && (module.exports = {
|
|
17
|
-
...require("./Collapsible")
|
|
18
|
-
});
|
|
19
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
+
var Collapsible_exports = {};
|
|
25
|
+
__export(Collapsible_exports, {
|
|
26
|
+
Collapsible: () => Collapsible,
|
|
27
|
+
CollapsibleContent: () => CollapsibleContent,
|
|
28
|
+
CollapsibleContentFrame: () => CollapsibleContentFrame,
|
|
29
|
+
CollapsibleTrigger: () => CollapsibleTrigger,
|
|
30
|
+
CollapsibleTriggerFrame: () => CollapsibleTriggerFrame
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(Collapsible_exports);
|
|
33
|
+
var import_animate_presence = require("@tamagui/animate-presence"), import_helpers = require("@tamagui/helpers"), import_use_controllable_state = require("@tamagui/use-controllable-state"), import_web = require("@tamagui/web"), React = __toESM(require("react")), import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
const COLLAPSIBLE_NAME = "Collapsible", { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = (0, import_web.createStyledContext)(), _Collapsible = React.forwardRef(
|
|
11
35
|
(props, forwardedRef) => {
|
|
12
36
|
const {
|
|
13
37
|
__scopeCollapsible,
|
|
@@ -16,12 +40,12 @@ const COLLAPSIBLE_NAME = "Collapsible", { Provider: CollapsibleProvider, useStyl
|
|
|
16
40
|
disabled,
|
|
17
41
|
onOpenChange,
|
|
18
42
|
...collapsibleProps
|
|
19
|
-
} = props, [open = !1, setOpen] = useControllableState({
|
|
43
|
+
} = props, [open = !1, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
20
44
|
prop: openProp,
|
|
21
45
|
defaultProp: defaultOpen,
|
|
22
46
|
onChange: onOpenChange
|
|
23
47
|
});
|
|
24
|
-
return /* @__PURE__ */ jsx(
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
25
49
|
CollapsibleProvider,
|
|
26
50
|
{
|
|
27
51
|
scope: __scopeCollapsible,
|
|
@@ -32,8 +56,8 @@ const COLLAPSIBLE_NAME = "Collapsible", { Provider: CollapsibleProvider, useStyl
|
|
|
32
56
|
() => setOpen((prevOpen) => !prevOpen),
|
|
33
57
|
[setOpen]
|
|
34
58
|
),
|
|
35
|
-
children: /* @__PURE__ */ jsx(
|
|
36
|
-
Stack,
|
|
59
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_web.Stack,
|
|
37
61
|
{
|
|
38
62
|
"data-state": getState(open),
|
|
39
63
|
"data-disabled": disabled ? "" : void 0,
|
|
@@ -46,13 +70,13 @@ const COLLAPSIBLE_NAME = "Collapsible", { Provider: CollapsibleProvider, useStyl
|
|
|
46
70
|
}
|
|
47
71
|
);
|
|
48
72
|
_Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
49
|
-
const TRIGGER_NAME = "CollapsibleTrigger", CollapsibleTriggerFrame = styled(Stack, {
|
|
73
|
+
const TRIGGER_NAME = "CollapsibleTrigger", CollapsibleTriggerFrame = (0, import_web.styled)(import_web.Stack, {
|
|
50
74
|
name: TRIGGER_NAME,
|
|
51
75
|
tag: "button"
|
|
52
76
|
}), CollapsibleTrigger = CollapsibleTriggerFrame.styleable(
|
|
53
77
|
(props, forwardedRef) => {
|
|
54
78
|
const { __scopeCollapsible, children, ...triggerProps } = props, context = useCollapsibleContext(__scopeCollapsible);
|
|
55
|
-
return /* @__PURE__ */ jsx(
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
80
|
CollapsibleTriggerFrame,
|
|
57
81
|
{
|
|
58
82
|
"aria-controls": context.contentId,
|
|
@@ -62,32 +86,33 @@ const TRIGGER_NAME = "CollapsibleTrigger", CollapsibleTriggerFrame = styled(Stac
|
|
|
62
86
|
disabled: context.disabled,
|
|
63
87
|
...triggerProps,
|
|
64
88
|
ref: forwardedRef,
|
|
65
|
-
onPress: composeEventHandlers(props.onPress, context.onOpenToggle),
|
|
89
|
+
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle),
|
|
66
90
|
children: typeof children == "function" ? children({ open: context.open }) : children
|
|
67
91
|
}
|
|
68
92
|
);
|
|
69
93
|
}
|
|
70
94
|
);
|
|
71
95
|
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
72
|
-
const CONTENT_NAME = "CollapsibleContent", CollapsibleContentFrame = styled(Stack, {
|
|
96
|
+
const CONTENT_NAME = "CollapsibleContent", CollapsibleContentFrame = (0, import_web.styled)(import_web.Stack, {
|
|
73
97
|
name: CONTENT_NAME
|
|
74
98
|
}), CollapsibleContent = CollapsibleContentFrame.styleable((props, forwardedRef) => {
|
|
75
99
|
const { forceMount, children, __scopeCollapsible, ...contentProps } = props, context = useCollapsibleContext(__scopeCollapsible);
|
|
76
|
-
return /* @__PURE__ */ jsx(AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ jsx(CollapsibleContentFrame, { ref: forwardedRef, ...contentProps, children: /* @__PURE__ */ jsx(ResetPresence, { children }) }) : null });
|
|
100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, { ref: forwardedRef, ...contentProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, { children }) }) : null });
|
|
77
101
|
});
|
|
78
102
|
CollapsibleContent.displayName = CONTENT_NAME;
|
|
79
103
|
function getState(open) {
|
|
80
104
|
return open ? "open" : "closed";
|
|
81
105
|
}
|
|
82
|
-
const Collapsible = withStaticProperties(_Collapsible, {
|
|
106
|
+
const Collapsible = (0, import_helpers.withStaticProperties)(_Collapsible, {
|
|
83
107
|
Trigger: CollapsibleTrigger,
|
|
84
108
|
Content: CollapsibleContent
|
|
85
109
|
});
|
|
86
|
-
export
|
|
110
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
111
|
+
0 && (module.exports = {
|
|
87
112
|
Collapsible,
|
|
88
113
|
CollapsibleContent,
|
|
89
114
|
CollapsibleContentFrame,
|
|
90
115
|
CollapsibleTrigger,
|
|
91
116
|
CollapsibleTriggerFrame
|
|
92
|
-
};
|
|
117
|
+
});
|
|
93
118
|
//# sourceMappingURL=Collapsible.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2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,UAAU,sBAAsB,kBAAkB;AAExD,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,GAAI;AAAA,QACL,KAAK;AAAA,QACL,aAAS,qCAAqB,MAAM,SAAgB,QAAQ,YAAY;AAAA,QAEvE,iBAAO,YAAa,aAAa,SAAS,EAAE,MAAM,QAAQ,KAAK,CAAC,IAAI;AAAA;AAAA,IACvE;AAAA,EAEJ;AACF;AAEA,mBAAmB,cAAc;AAcjC,MAAM,eAAe,sBAEf,8BAA0B,mBAAO,kBAAO;AAAA,EAC5C,MAAM;AACR,CAAC,GAEK,qBAAqB,wBAAwB,UAEjD,CAAC,OAAO,iBAAiB;AACzB,QAAM,EAAE,YAAY,UAAU,oBAAoB,GAAG,aAAa,IAAI,OAChE,UAAU,sBAAsB,kBAAkB;AAExD,SACE,4CAAC,2CAAiB,GAAG,cAClB,wBAAc,QAAQ,OACrB,4CAAC,2BAAwB,KAAK,cAAe,GAAG,cAC9C,sDAAC,yCAAe,UAAS,GAC3B,IACE,MACN;AAEJ,CAAC;AAED,mBAAmB,cAAc;AAIjC,SAAS,SAAS,MAAgB;AAChC,SAAO,OAAO,SAAS;AACzB;AAEA,MAAM,kBAAc,qCAAqB,cAAc;AAAA,EACrD,SAAS;AAAA,EACT,SAAS;AACX,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
return to;
|
|
11
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
12
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
+
var src_exports = {};
|
|
14
|
+
module.exports = __toCommonJS(src_exports);
|
|
15
|
+
__reExport(src_exports, require("./Collapsible"), module.exports);
|
|
16
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
17
|
+
0 && (module.exports = {
|
|
18
|
+
...require("./Collapsible")
|
|
19
|
+
});
|
|
2
20
|
//# sourceMappingURL=index.js.map
|
package/dist/jsx/Collapsible.js
CHANGED
|
@@ -6,6 +6,7 @@ import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
|
|
|
6
6
|
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
7
7
|
import { Stack, createStyledContext, styled } from "@tamagui/web";
|
|
8
8
|
import * as React from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
10
|
const COLLAPSIBLE_NAME = "Collapsible", { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = createStyledContext(), _Collapsible = React.forwardRef(
|
|
10
11
|
(props, forwardedRef) => {
|
|
11
12
|
const {
|
|
@@ -20,21 +21,28 @@ const COLLAPSIBLE_NAME = "Collapsible", { Provider: CollapsibleProvider, useStyl
|
|
|
20
21
|
defaultProp: defaultOpen,
|
|
21
22
|
onChange: onOpenChange
|
|
22
23
|
});
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
CollapsibleProvider,
|
|
26
|
+
{
|
|
27
|
+
scope: __scopeCollapsible,
|
|
28
|
+
disabled,
|
|
29
|
+
contentId: React.useId(),
|
|
30
|
+
open,
|
|
31
|
+
onOpenToggle: React.useCallback(
|
|
32
|
+
() => setOpen((prevOpen) => !prevOpen),
|
|
33
|
+
[setOpen]
|
|
34
|
+
),
|
|
35
|
+
children: /* @__PURE__ */ jsx(
|
|
36
|
+
Stack,
|
|
37
|
+
{
|
|
38
|
+
"data-state": getState(open),
|
|
39
|
+
"data-disabled": disabled ? "" : void 0,
|
|
40
|
+
...collapsibleProps,
|
|
41
|
+
ref: forwardedRef
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
38
46
|
}
|
|
39
47
|
);
|
|
40
48
|
_Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
@@ -44,16 +52,20 @@ const TRIGGER_NAME = "CollapsibleTrigger", CollapsibleTriggerFrame = styled(Stac
|
|
|
44
52
|
}), CollapsibleTrigger = CollapsibleTriggerFrame.styleable(
|
|
45
53
|
(props, forwardedRef) => {
|
|
46
54
|
const { __scopeCollapsible, children, ...triggerProps } = props, context = useCollapsibleContext(__scopeCollapsible);
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
CollapsibleTriggerFrame,
|
|
57
|
+
{
|
|
58
|
+
"aria-controls": context.contentId,
|
|
59
|
+
"aria-expanded": context.open || !1,
|
|
60
|
+
"data-state": getState(context.open),
|
|
61
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
62
|
+
disabled: context.disabled,
|
|
63
|
+
...triggerProps,
|
|
64
|
+
ref: forwardedRef,
|
|
65
|
+
onPress: composeEventHandlers(props.onPress, context.onOpenToggle),
|
|
66
|
+
children: typeof children == "function" ? children({ open: context.open }) : children
|
|
67
|
+
}
|
|
68
|
+
);
|
|
57
69
|
}
|
|
58
70
|
);
|
|
59
71
|
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
@@ -61,7 +73,7 @@ const CONTENT_NAME = "CollapsibleContent", CollapsibleContentFrame = styled(Stac
|
|
|
61
73
|
name: CONTENT_NAME
|
|
62
74
|
}), CollapsibleContent = CollapsibleContentFrame.styleable((props, forwardedRef) => {
|
|
63
75
|
const { forceMount, children, __scopeCollapsible, ...contentProps } = props, context = useCollapsibleContext(__scopeCollapsible);
|
|
64
|
-
return
|
|
76
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ jsx(CollapsibleContentFrame, { ref: forwardedRef, ...contentProps, children: /* @__PURE__ */ jsx(ResetPresence, { children }) }) : null });
|
|
65
77
|
});
|
|
66
78
|
CollapsibleContent.displayName = CONTENT_NAME;
|
|
67
79
|
function getState(open) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Collapsible.tsx"],
|
|
4
|
-
"mappings": "AAAA;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AACP,SAAS,sBAAsB,4BAA4B;AAE3D,SAAS,4BAA4B;AACrC,SAAmB,OAAmB,qBAAqB,cAAc;AACzE,YAAY,WAAW;
|
|
4
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AACP,SAAS,sBAAsB,4BAA4B;AAE3D,SAAS,4BAA4B;AACrC,SAAmB,OAAmB,qBAAqB,cAAc;AACzE,YAAY,WAAW;AAuDf;AAjDR,MAAM,mBAAmB,eAWnB,EAAE,UAAU,qBAA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BAAO,YAAa,aAAa,SAAS,EAAE,MAAM,QAAQ,KAAK,CAAC,IAAI;AAAA;AAAA,IACvE;AAAA,EAEJ;AACF;AAEA,mBAAmB,cAAc;AAcjC,MAAM,eAAe,sBAEf,0BAA0B,OAAO,OAAO;AAAA,EAC5C,MAAM;AACR,CAAC,GAEK,qBAAqB,wBAAwB,UAEjD,CAAC,OAAO,iBAAiB;AACzB,QAAM,EAAE,YAAY,UAAU,oBAAoB,GAAG,aAAa,IAAI,OAChE,UAAU,sBAAsB,kBAAkB;AAExD,SACE,oBAAC,mBAAiB,GAAG,cAClB,wBAAc,QAAQ,OACrB,oBAAC,2BAAwB,KAAK,cAAe,GAAG,cAC9C,8BAAC,iBAAe,UAAS,GAC3B,IACE,MACN;AAEJ,CAAC;AAED,mBAAmB,cAAc;AAIjC,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
|
}
|
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
+
var Collapsible_exports = {};
|
|
25
|
+
__export(Collapsible_exports, {
|
|
26
|
+
Collapsible: () => Collapsible,
|
|
27
|
+
CollapsibleContent: () => CollapsibleContent,
|
|
28
|
+
CollapsibleContentFrame: () => CollapsibleContentFrame,
|
|
29
|
+
CollapsibleTrigger: () => CollapsibleTrigger,
|
|
30
|
+
CollapsibleTriggerFrame: () => CollapsibleTriggerFrame
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(Collapsible_exports);
|
|
33
|
+
var import_animate_presence = require("@tamagui/animate-presence"), import_helpers = require("@tamagui/helpers"), import_use_controllable_state = require("@tamagui/use-controllable-state"), import_web = require("@tamagui/web"), React = __toESM(require("react")), import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
const COLLAPSIBLE_NAME = "Collapsible", { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = (0, import_web.createStyledContext)(), _Collapsible = React.forwardRef(
|
|
10
35
|
(props, forwardedRef) => {
|
|
11
36
|
const {
|
|
12
37
|
__scopeCollapsible,
|
|
@@ -15,67 +40,79 @@ const COLLAPSIBLE_NAME = "Collapsible", { Provider: CollapsibleProvider, useStyl
|
|
|
15
40
|
disabled,
|
|
16
41
|
onOpenChange,
|
|
17
42
|
...collapsibleProps
|
|
18
|
-
} = props, [open = !1, setOpen] = useControllableState({
|
|
43
|
+
} = props, [open = !1, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
19
44
|
prop: openProp,
|
|
20
45
|
defaultProp: defaultOpen,
|
|
21
46
|
onChange: onOpenChange
|
|
22
47
|
});
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
CollapsibleProvider,
|
|
50
|
+
{
|
|
51
|
+
scope: __scopeCollapsible,
|
|
52
|
+
disabled,
|
|
53
|
+
contentId: React.useId(),
|
|
54
|
+
open,
|
|
55
|
+
onOpenToggle: React.useCallback(
|
|
56
|
+
() => setOpen((prevOpen) => !prevOpen),
|
|
57
|
+
[setOpen]
|
|
58
|
+
),
|
|
59
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_web.Stack,
|
|
61
|
+
{
|
|
62
|
+
"data-state": getState(open),
|
|
63
|
+
"data-disabled": disabled ? "" : void 0,
|
|
64
|
+
...collapsibleProps,
|
|
65
|
+
ref: forwardedRef
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
);
|
|
38
70
|
}
|
|
39
71
|
);
|
|
40
72
|
_Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
41
|
-
const TRIGGER_NAME = "CollapsibleTrigger", CollapsibleTriggerFrame = styled(Stack, {
|
|
73
|
+
const TRIGGER_NAME = "CollapsibleTrigger", CollapsibleTriggerFrame = (0, import_web.styled)(import_web.Stack, {
|
|
42
74
|
name: TRIGGER_NAME,
|
|
43
75
|
tag: "button"
|
|
44
76
|
}), CollapsibleTrigger = CollapsibleTriggerFrame.styleable(
|
|
45
77
|
(props, forwardedRef) => {
|
|
46
78
|
const { __scopeCollapsible, children, ...triggerProps } = props, context = useCollapsibleContext(__scopeCollapsible);
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
+
CollapsibleTriggerFrame,
|
|
81
|
+
{
|
|
82
|
+
"aria-controls": context.contentId,
|
|
83
|
+
"aria-expanded": context.open || !1,
|
|
84
|
+
"data-state": getState(context.open),
|
|
85
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
86
|
+
disabled: context.disabled,
|
|
87
|
+
...triggerProps,
|
|
88
|
+
ref: forwardedRef,
|
|
89
|
+
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle),
|
|
90
|
+
children: typeof children == "function" ? children({ open: context.open }) : children
|
|
91
|
+
}
|
|
92
|
+
);
|
|
57
93
|
}
|
|
58
94
|
);
|
|
59
95
|
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
60
|
-
const CONTENT_NAME = "CollapsibleContent", CollapsibleContentFrame = styled(Stack, {
|
|
96
|
+
const CONTENT_NAME = "CollapsibleContent", CollapsibleContentFrame = (0, import_web.styled)(import_web.Stack, {
|
|
61
97
|
name: CONTENT_NAME
|
|
62
98
|
}), CollapsibleContent = CollapsibleContentFrame.styleable((props, forwardedRef) => {
|
|
63
99
|
const { forceMount, children, __scopeCollapsible, ...contentProps } = props, context = useCollapsibleContext(__scopeCollapsible);
|
|
64
|
-
return
|
|
100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, { ref: forwardedRef, ...contentProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, { children }) }) : null });
|
|
65
101
|
});
|
|
66
102
|
CollapsibleContent.displayName = CONTENT_NAME;
|
|
67
103
|
function getState(open) {
|
|
68
104
|
return open ? "open" : "closed";
|
|
69
105
|
}
|
|
70
|
-
const Collapsible = withStaticProperties(_Collapsible, {
|
|
106
|
+
const Collapsible = (0, import_helpers.withStaticProperties)(_Collapsible, {
|
|
71
107
|
Trigger: CollapsibleTrigger,
|
|
72
108
|
Content: CollapsibleContent
|
|
73
109
|
});
|
|
74
|
-
export
|
|
110
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
111
|
+
0 && (module.exports = {
|
|
75
112
|
Collapsible,
|
|
76
113
|
CollapsibleContent,
|
|
77
114
|
CollapsibleContentFrame,
|
|
78
115
|
CollapsibleTrigger,
|
|
79
116
|
CollapsibleTriggerFrame
|
|
80
|
-
};
|
|
117
|
+
});
|
|
81
118
|
//# sourceMappingURL=Collapsible.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Collapsible.tsx"],
|
|
4
|
-
"mappings": "AAAA;AAAA
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAIO,sCACP,iBAA2D,6BAE3D,gCAAqC,4CACrC,aAAyE,yBACzE,QAAuB,2BAuDf;AAjDR,MAAM,mBAAmB,eAWnB,EAAE,UAAU,qBAAqB,kBAAkB,sBAAsB,QAC7E,gCAA6C,GASzC,eAAe,MAAM;AAAA,EACzB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA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,MAAM;AACR,CAAC,GAEK,qBAAqB,wBAAwB,UAEjD,CAAC,OAAO,iBAAiB;AACzB,QAAM,EAAE,YAAY,UAAU,oBAAoB,GAAG,aAAa,IAAI,OAChE,UAAU,sBAAsB,kBAAkB;AAExD,SACE,4CAAC,2CAAiB,GAAG,cAClB,wBAAc,QAAQ,OACrB,4CAAC,2BAAwB,KAAK,cAAe,GAAG,cAC9C,sDAAC,yCAAe,UAAS,GAC3B,IACE,MACN;AAEJ,CAAC;AAED,mBAAmB,cAAc;AAIjC,SAAS,SAAS,MAAgB;AAChC,SAAO,OAAO,SAAS;AACzB;AAEA,MAAM,kBAAc,qCAAqB,cAAc;AAAA,EACrD,SAAS;AAAA,EACT,SAAS;AACX,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/jsx/index.native.js
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
return to;
|
|
11
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
12
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
+
var src_exports = {};
|
|
14
|
+
module.exports = __toCommonJS(src_exports);
|
|
15
|
+
__reExport(src_exports, require("./Collapsible"), module.exports);
|
|
16
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
17
|
+
0 && (module.exports = {
|
|
18
|
+
...require("./Collapsible")
|
|
19
|
+
});
|
|
2
20
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/collapsible",
|
|
3
|
-
"version": "1.88.
|
|
3
|
+
"version": "1.88.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -21,20 +21,20 @@
|
|
|
21
21
|
"clean:build": "tamagui-build clean:build"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@tamagui/animate-presence": "1.88.
|
|
25
|
-
"@tamagui/compose-refs": "1.88.
|
|
26
|
-
"@tamagui/core": "1.88.
|
|
27
|
-
"@tamagui/create-context": "1.88.
|
|
28
|
-
"@tamagui/helpers": "1.88.
|
|
29
|
-
"@tamagui/polyfill-dev": "1.88.
|
|
30
|
-
"@tamagui/stacks": "1.88.
|
|
31
|
-
"@tamagui/use-controllable-state": "1.88.
|
|
24
|
+
"@tamagui/animate-presence": "1.88.2",
|
|
25
|
+
"@tamagui/compose-refs": "1.88.2",
|
|
26
|
+
"@tamagui/core": "1.88.2",
|
|
27
|
+
"@tamagui/create-context": "1.88.2",
|
|
28
|
+
"@tamagui/helpers": "1.88.2",
|
|
29
|
+
"@tamagui/polyfill-dev": "1.88.2",
|
|
30
|
+
"@tamagui/stacks": "1.88.2",
|
|
31
|
+
"@tamagui/use-controllable-state": "1.88.2"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "*"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tamagui/build": "1.88.
|
|
37
|
+
"@tamagui/build": "1.88.2",
|
|
38
38
|
"react": "^18.2.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|