@tamagui/collapsible 3.0.7 → 3.0.9

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.
@@ -73,7 +73,7 @@ const CollapsibleTrigger = (0, import_core.createStyledHOC)(CollapsibleTriggerFr
73
73
  const { __scopeCollapsible, children, ...triggerProps } = props;
74
74
  const context = useCollapsibleContext(__scopeCollapsible);
75
75
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTriggerFrame, {
76
- "aria-controls": context.contentId,
76
+ "aria-controls": context.open ? context.contentId : void 0,
77
77
  "aria-expanded": context.open || false,
78
78
  "data-state": getState(context.open),
79
79
  "data-disabled": context.disabled ? "" : void 0,
@@ -93,6 +93,7 @@ const CollapsibleContent = (0, import_core.createStyledHOC)(CollapsibleContentFr
93
93
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
94
94
  ...contentProps,
95
95
  children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, {
96
+ id: context.contentId,
96
97
  ref: forwardedRef,
97
98
  ...contentProps,
98
99
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, { children })
@@ -79,7 +79,7 @@ var CollapsibleTrigger = (0, import_core.createStyledHOC)(CollapsibleTriggerFram
79
79
  var { __scopeCollapsible, children, ...triggerProps } = props;
80
80
  var context = useCollapsibleContext(__scopeCollapsible);
81
81
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTriggerFrame, {
82
- "aria-controls": context.contentId,
82
+ "aria-controls": context.open ? context.contentId : void 0,
83
83
  "aria-expanded": context.open || false,
84
84
  "data-state": getState(context.open),
85
85
  "data-disabled": context.disabled ? "" : void 0,
@@ -99,6 +99,7 @@ var CollapsibleContent = (0, import_core.createStyledHOC)(CollapsibleContentFram
99
99
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
100
100
  ...contentProps,
101
101
  children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, {
102
+ id: context.contentId,
102
103
  ref: forwardedRef,
103
104
  ...contentProps,
104
105
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, { children })
@@ -79,7 +79,7 @@ var CollapsibleTrigger = (0, import_core.createStyledHOC)(CollapsibleTriggerFram
79
79
  var { __scopeCollapsible, children, ...triggerProps } = props;
80
80
  var context = useCollapsibleContext(__scopeCollapsible);
81
81
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTriggerFrame, {
82
- "aria-controls": context.contentId,
82
+ "aria-controls": context.open ? context.contentId : void 0,
83
83
  "aria-expanded": context.open || false,
84
84
  "data-state": getState(context.open),
85
85
  "data-disabled": context.disabled ? "" : void 0,
@@ -99,6 +99,7 @@ var CollapsibleContent = (0, import_core.createStyledHOC)(CollapsibleContentFram
99
99
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
100
100
  ...contentProps,
101
101
  children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, {
102
+ id: context.contentId,
102
103
  ref: forwardedRef,
103
104
  ...contentProps,
104
105
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, { children })
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.native.js","names":[],"sources":["cjs/Collapsible.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Collapsible_exports = {};\n__export(Collapsible_exports, {\n Collapsible: () => Collapsible,\n CollapsibleContent: () => CollapsibleContent,\n CollapsibleContentFrame: () => CollapsibleContentFrame,\n CollapsibleTrigger: () => CollapsibleTrigger,\n CollapsibleTriggerFrame: () => CollapsibleTriggerFrame\n});\nmodule.exports = __toCommonJS(Collapsible_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_animate_presence = require(\"@tamagui/animate-presence\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar COLLAPSIBLE_NAME = \"Collapsible\";\nvar { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = (0, import_web.createStyledContext)();\nvar _Collapsible = (0, import_core.createRefComponent)(function(props, forwardedRef) {\n var { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;\n var [open = false, setOpen] = (0, import_use_controllable_state.useControllableState)({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleProvider, {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(function() {\n return setOpen(function(prevOpen) {\n return !prevOpen;\n });\n }, [\n setOpen\n ]),\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web.View, {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n })\n });\n});\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nvar TRIGGER_NAME = \"CollapsibleTrigger\";\nvar CollapsibleTriggerFrame = (0, import_web.styled)(import_web.View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nvar CollapsibleTrigger = (0, import_core.createStyledHOC)(CollapsibleTriggerFrame, function(props, forwardedRef) {\n var { __scopeCollapsible, children, ...triggerProps } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTriggerFrame, {\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({\n open: context.open\n }) : children\n });\n});\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"CollapsibleContent\";\nvar CollapsibleContentFrame = (0, import_web.styled)(import_web.View, {\n displayName: CONTENT_NAME\n});\nvar CollapsibleContent = (0, import_core.createStyledHOC)(CollapsibleContentFrame, function(props, forwardedRef) {\n var {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {\n ...contentProps,\n children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, {\n ref: forwardedRef,\n ...contentProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, {\n children\n })\n }) : null\n });\n});\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Collapsible = (0, import_helpers.withStaticProperties)(_Collapsible, {\n Trigger: CollapsibleTrigger,\n Content: CollapsibleContent\n});\n//# sourceMappingURL=Collapsible.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO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O,SAAS;AACzB;AACA,IAAI,eAAe,GAAG,eAAe,qBAAoB,CAAE,cAAc;CACvE,SAAS;CACT,SAAS;AACX,CAAC"}
1
+ {"version":3,"file":"Collapsible.native.js","names":[],"sources":["cjs/Collapsible.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Collapsible_exports = {};\n__export(Collapsible_exports, {\n Collapsible: () => Collapsible,\n CollapsibleContent: () => CollapsibleContent,\n CollapsibleContentFrame: () => CollapsibleContentFrame,\n CollapsibleTrigger: () => CollapsibleTrigger,\n CollapsibleTriggerFrame: () => CollapsibleTriggerFrame\n});\nmodule.exports = __toCommonJS(Collapsible_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_animate_presence = require(\"@tamagui/animate-presence\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar COLLAPSIBLE_NAME = \"Collapsible\";\nvar { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = (0, import_web.createStyledContext)();\nvar _Collapsible = (0, import_core.createRefComponent)(function(props, forwardedRef) {\n var { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;\n var [open = false, setOpen] = (0, import_use_controllable_state.useControllableState)({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleProvider, {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(function() {\n return setOpen(function(prevOpen) {\n return !prevOpen;\n });\n }, [\n setOpen\n ]),\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web.View, {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n })\n });\n});\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nvar TRIGGER_NAME = \"CollapsibleTrigger\";\nvar CollapsibleTriggerFrame = (0, import_web.styled)(import_web.View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nvar CollapsibleTrigger = (0, import_core.createStyledHOC)(CollapsibleTriggerFrame, function(props, forwardedRef) {\n var { __scopeCollapsible, children, ...triggerProps } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTriggerFrame, {\n // closed content is unmounted, so only name it while it exists\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({\n open: context.open\n }) : children\n });\n});\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"CollapsibleContent\";\nvar CollapsibleContentFrame = (0, import_web.styled)(import_web.View, {\n displayName: CONTENT_NAME\n});\nvar CollapsibleContent = (0, import_core.createStyledHOC)(CollapsibleContentFrame, function(props, forwardedRef) {\n var {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {\n ...contentProps,\n children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, {\n id: context.contentId,\n ref: forwardedRef,\n ...contentProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, {\n children\n })\n }) : null\n });\n});\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Collapsible = (0, import_helpers.withStaticProperties)(_Collapsible, {\n Trigger: CollapsibleTrigger,\n Content: CollapsibleContent\n});\n//# sourceMappingURL=Collapsible.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAA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aACf,CAAC;AACD,IAAI,sBAAsB,GAAG,YAAY,gBAAe,CAAE,yBAAyB,SAAS,OAAO,cAAc;CAC/G,IAAI,EACF,YACA,UAEA,oBACA,GAAG,iBACD;CACJ,IAAI,UAAU,sBAAsB,kBAAkB;CACtD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,wBAAwB,iBAAiB;EAC1F,GAAG;EACH,UAAU,cAAc,QAAQ,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,yBAAyB;GAC1G,IAAI,QAAQ;GACZ,KAAK;GACL,GAAG;GACH,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,wBAAwB,eAAe,EAC3F,SACF,CAAC;EACH,CAAC,IAAI;CACP,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,SAAS,SAAS,MAAM;CACtB,OAAO,OAAO,SAAS;AACzB;AACA,IAAI,eAAe,GAAG,eAAe,qBAAoB,CAAE,cAAc;CACvE,SAAS;CACT,SAAS;AACX,CAAC"}
@@ -39,7 +39,7 @@ const CollapsibleTrigger = createStyledHOC(CollapsibleTriggerFrame, (props, forw
39
39
  const { __scopeCollapsible, children, ...triggerProps } = props;
40
40
  const context = useCollapsibleContext(__scopeCollapsible);
41
41
  return /* @__PURE__ */ jsx(CollapsibleTriggerFrame, {
42
- "aria-controls": context.contentId,
42
+ "aria-controls": context.open ? context.contentId : void 0,
43
43
  "aria-expanded": context.open || false,
44
44
  "data-state": getState(context.open),
45
45
  "data-disabled": context.disabled ? "" : void 0,
@@ -59,6 +59,7 @@ const CollapsibleContent = createStyledHOC(CollapsibleContentFrame, (props, forw
59
59
  return /* @__PURE__ */ jsx(AnimatePresence, {
60
60
  ...contentProps,
61
61
  children: forceMount || context.open ? /* @__PURE__ */ jsx(CollapsibleContentFrame, {
62
+ id: context.contentId,
62
63
  ref: forwardedRef,
63
64
  ...contentProps,
64
65
  children: /* @__PURE__ */ jsx(ResetPresence, { children })
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.js","names":[],"sources":["esm/Collapsible.js"],"sourcesContent":["import { createStyledHOC, createRefComponent } from \"@tamagui/core\";\nimport { AnimatePresence, ResetPresence } from \"@tamagui/animate-presence\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { View, createStyledContext, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst COLLAPSIBLE_NAME = \"Collapsible\";\nconst { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = createStyledContext();\nconst _Collapsible = createRefComponent(\n (props, forwardedRef) => {\n const {\n __scopeCollapsible,\n open: openProp,\n defaultOpen,\n disabled,\n onOpenChange,\n ...collapsibleProps\n } = props;\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(\n CollapsibleProvider,\n {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(\n () => setOpen((prevOpen) => !prevOpen),\n [setOpen]\n ),\n children: /* @__PURE__ */ jsx(\n View,\n {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nconst TRIGGER_NAME = \"CollapsibleTrigger\";\nconst CollapsibleTriggerFrame = styled(View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nconst CollapsibleTrigger = createStyledHOC(\n CollapsibleTriggerFrame,\n (props, forwardedRef) => {\n const { __scopeCollapsible, children, ...triggerProps } = props;\n const context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ jsx(\n CollapsibleTriggerFrame,\n {\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: composeEventHandlers(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({ open: context.open }) : children\n }\n );\n }\n);\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nconst CONTENT_NAME = \"CollapsibleContent\";\nconst CollapsibleContentFrame = styled(View, {\n displayName: CONTENT_NAME\n});\nconst CollapsibleContent = createStyledHOC(\n CollapsibleContentFrame,\n (props, forwardedRef) => {\n const {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n const context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ jsx(AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ jsx(CollapsibleContentFrame, { ref: forwardedRef, ...contentProps, children: /* @__PURE__ */ jsx(ResetPresence, { children }) }) : null });\n }\n);\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nconst Collapsible = withStaticProperties(_Collapsible, {\n Trigger: CollapsibleTrigger,\n Content: CollapsibleContent\n});\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleContentFrame,\n CollapsibleTrigger,\n CollapsibleTriggerFrame\n};\n//# sourceMappingURL=Collapsible.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,mBAAmB;AACzB,MAAM,EAAE,UAAU,qBAAqB,kBAAkB,0BAA0B,oBAAoB;AACvG,MAAM,eAAe,oBAClB,OAAO,iBAAiB;CACvB,MAAM,EACJ,oBACA,MAAM,UACN,aACA,UACA,cACA,GAAG,qBACD;CACJ,MAAM,CAAC,OAAO,OAAO,WAAW,qBAAqB;EACnD,MAAM;EACN,aAAa;EACb,UAAU;CACZ,CAAC;CACD,OAAuB,oBACrB,qBACA;EACE,OAAO;EACP;EACA,WAAW,MAAM,MAAM;EACvB;EACA,cAAc,MAAM,kBACZ,SAAS,aAAa,CAAC,QAAQ,GACrC,CAAC,OAAO,CACV;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S;CACT,SAAS;AACX,CAAC"}
1
+ {"version":3,"file":"Collapsible.js","names":[],"sources":["esm/Collapsible.js"],"sourcesContent":["import { createStyledHOC, createRefComponent } from \"@tamagui/core\";\nimport { AnimatePresence, ResetPresence } from \"@tamagui/animate-presence\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { View, createStyledContext, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst COLLAPSIBLE_NAME = \"Collapsible\";\nconst { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = createStyledContext();\nconst _Collapsible = createRefComponent(\n (props, forwardedRef) => {\n const {\n __scopeCollapsible,\n open: openProp,\n defaultOpen,\n disabled,\n onOpenChange,\n ...collapsibleProps\n } = props;\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(\n CollapsibleProvider,\n {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(\n () => setOpen((prevOpen) => !prevOpen),\n [setOpen]\n ),\n children: /* @__PURE__ */ jsx(\n View,\n {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nconst TRIGGER_NAME = \"CollapsibleTrigger\";\nconst CollapsibleTriggerFrame = styled(View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nconst CollapsibleTrigger = createStyledHOC(\n CollapsibleTriggerFrame,\n (props, forwardedRef) => {\n const { __scopeCollapsible, children, ...triggerProps } = props;\n const context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ jsx(\n CollapsibleTriggerFrame,\n {\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: composeEventHandlers(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({ open: context.open }) : children\n }\n );\n }\n);\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nconst CONTENT_NAME = \"CollapsibleContent\";\nconst CollapsibleContentFrame = styled(View, {\n displayName: CONTENT_NAME\n});\nconst CollapsibleContent = createStyledHOC(\n CollapsibleContentFrame,\n (props, forwardedRef) => {\n const {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n const context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ jsx(AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ jsx(\n CollapsibleContentFrame,\n {\n id: context.contentId,\n ref: forwardedRef,\n ...contentProps,\n children: /* @__PURE__ */ jsx(ResetPresence, { children })\n }\n ) : null });\n }\n);\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nconst Collapsible = withStaticProperties(_Collapsible, {\n Trigger: CollapsibleTrigger,\n Content: CollapsibleContent\n});\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleContentFrame,\n CollapsibleTrigger,\n CollapsibleTriggerFrame\n};\n//# sourceMappingURL=Collapsible.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,mBAAmB;AACzB,MAAM,EAAE,UAAU,qBAAqB,kBAAkB,0BAA0B,oBAAoB;AACvG,MAAM,eAAe,oBAClB,OAAO,iBAAiB;CACvB,MAAM,EACJ,oBACA,MAAM,UACN,aACA,UACA,cACA,GAAG,qBACD;CACJ,MAAM,CAAC,OAAO,OAAO,WAAW,qBAAqB;EACnD,MAAM;EACN,aAAa;EACb,UAAU;CACZ,CAAC;CACD,OAAuB,oBACrB,qBACA;EACE,OAAO;EACP;EACA,WAAW,MAAM,MAAM;EAC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ACA,mBAAmB,cAAc;AACjC,SAAS,SAAS,MAAM;CACtB,OAAO,OAAO,SAAS;AACzB;AACA,MAAM,cAAc,qBAAqB,cAAc;CACrD,SAAS;CACT,SAAS;AACX,CAAC"}
@@ -43,7 +43,7 @@ var CollapsibleTrigger = createStyledHOC(CollapsibleTriggerFrame, function(props
43
43
  var { __scopeCollapsible, children, ...triggerProps } = props;
44
44
  var context = useCollapsibleContext(__scopeCollapsible);
45
45
  return /* @__PURE__ */ jsx(CollapsibleTriggerFrame, {
46
- "aria-controls": context.contentId,
46
+ "aria-controls": context.open ? context.contentId : void 0,
47
47
  "aria-expanded": context.open || false,
48
48
  "data-state": getState(context.open),
49
49
  "data-disabled": context.disabled ? "" : void 0,
@@ -63,6 +63,7 @@ var CollapsibleContent = createStyledHOC(CollapsibleContentFrame, function(props
63
63
  return /* @__PURE__ */ jsx(AnimatePresence, {
64
64
  ...contentProps,
65
65
  children: forceMount || context.open ? /* @__PURE__ */ jsx(CollapsibleContentFrame, {
66
+ id: context.contentId,
66
67
  ref: forwardedRef,
67
68
  ...contentProps,
68
69
  children: /* @__PURE__ */ jsx(ResetPresence, { children })
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.native.js","names":[],"sources":["esm/Collapsible.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createStyledHOC, createRefComponent } from \"@tamagui/core\";\nimport { AnimatePresence, ResetPresence } from \"@tamagui/animate-presence\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { View, createStyledContext, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nvar COLLAPSIBLE_NAME = \"Collapsible\";\nvar { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = createStyledContext();\nvar _Collapsible = createRefComponent(function(props, forwardedRef) {\n var { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;\n var [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ _jsx(CollapsibleProvider, {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(function() {\n return setOpen(function(prevOpen) {\n return !prevOpen;\n });\n }, [\n setOpen\n ]),\n children: /* @__PURE__ */ _jsx(View, {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n })\n });\n});\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nvar TRIGGER_NAME = \"CollapsibleTrigger\";\nvar CollapsibleTriggerFrame = styled(View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nvar CollapsibleTrigger = createStyledHOC(CollapsibleTriggerFrame, function(props, forwardedRef) {\n var { __scopeCollapsible, children, ...triggerProps } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ _jsx(CollapsibleTriggerFrame, {\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: composeEventHandlers(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({\n open: context.open\n }) : children\n });\n});\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"CollapsibleContent\";\nvar CollapsibleContentFrame = styled(View, {\n displayName: CONTENT_NAME\n});\nvar CollapsibleContent = createStyledHOC(CollapsibleContentFrame, function(props, forwardedRef) {\n var {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ _jsx(AnimatePresence, {\n ...contentProps,\n children: forceMount || context.open ? /* @__PURE__ */ _jsx(CollapsibleContentFrame, {\n ref: forwardedRef,\n ...contentProps,\n children: /* @__PURE__ */ _jsx(ResetPresence, {\n children\n })\n }) : null\n });\n});\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Collapsible = withStaticProperties(_Collapsible, {\n Trigger: CollapsibleTrigger,\n Content: CollapsibleContent\n});\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleContentFrame,\n CollapsibleTrigger,\n CollapsibleTriggerFrame\n};\n//# sourceMappingURL=Collapsible.js.map\n"],"mappings":";;;;;;;;;AAOA,IAAI,mBAAmB;AACvB,IAAI,EAAE,UAAU,qBAAqB,kBAAkB,0BAA0B,oBAAoB;AACrG,IAAI,eAAe,mBAAmB,SAAS,OAAO,cAAc;CAClE,IAAI,EAAE,oBAAoB,MAAM,UAAU,aAAa,UAAU,cAAc,GAAG,qBAAqB;CACvG,IAAI,CAAC,OAAO,OAAO,WAAW,qBAAqB;EACjD,MAAM;EACN,aAAa;EACb,UAAU;CACZ,CAAC;CACD,OAAuB,oBAAK,qBAAqB;EAC/C,OAAO;EACP;EACA,WAAW,MAAM,MAAM;EACvB;EACA,cAAc,MAAM,YAAY,WAAW;GACzC,OAAO,QAAQ,SAAS,UAAU;IAChC,OAAO,CAAC;GACV,CAAC;EACH,GAAG,CACD,OACF,CAAC;EACD,UAA0B,oBAAK,MAAM;GACnC,cAAc,SAAS,IAAI;GAC3B,iBAAiB,WAAW,KAAK,KAAK;GACtC,GAAG;GACH,KAAK;EACP,CAAC;CACH,CAAC;AACH,CAAC;AACD,aAAa,cAAc;AAC3B,IAAI,eAAe;AACnB,IAAI,0BAA0B,OAAO,MAAM;CACzC,aAAa;CACb,QAAQ;AACV,CAAC;AACD,IAAI,qBAAqB,gBAAgB,yBAAyB,SAAS,OAAO,cAAc;CAC9F,IAAI,EAAE,oBAAoB,UAAU,GAAG,iBAAiB;CACxD,IAAI,UAAU,sBAAsB,kBAAkB;CACtD,OAAuB,oBAAK,yBAAyB;EACnD,iBAAiB,QAAQ;EACzB,iBAAiB,QAAQ,QAAQ;EACjC,cAAc,SAAS,QAAQ,IAAI;EACnC,iBAAiB,QAAQ,WAAW,KAAK,KAAK;EAC9C,UAAU,QAAQ;EAClB,GAAG;EACH,KAAK;EACL,SAAS,qBAAqB,MAAM,SAAS,QAAQ,YAAY;EACjE,UAAU,OAAO,aAAa,aAAa,SAAS,EAClD,MAAM,QAAQ,KAChB,CAAC,IAAI;CACP,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,IAAI,eAAe;AACnB,IAAI,0BAA0B,OAAO,MAAM,EACzC,aAAa,aACf,CAAC;AACD,IAAI,qBAAqB,gBAAgB,yBAAyB,SAAS,OAAO,cAAc;CAC9F,IAAI,EACF,YACA,UAEA,oBACA,GAAG,iBACD;CACJ,IAAI,UAAU,sBAAsB,kBAAkB;CACtD,OAAuB,oBAAK,iBAAiB;EAC3C,GAAG;EACH,UAAU,cAAc,QAAQ,OAAuB,oBAAK,yBAAyB;GACnF,KAAK;GACL,GAAG;GACH,UAA0B,oBAAK,eAAe,EAC5C,SACF,CAAC;EACH,CAAC,IAAI;CACP,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,SAAS,SAAS,MAAM;CACtB,OAAO,OAAO,SAAS;AACzB;AACA,IAAI,cAAc,qBAAqB,cAAc;CACnD,SAAS;CACT,SAAS;AACX,CAAC"}
1
+ {"version":3,"file":"Collapsible.native.js","names":[],"sources":["esm/Collapsible.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createStyledHOC, createRefComponent } from \"@tamagui/core\";\nimport { AnimatePresence, ResetPresence } from \"@tamagui/animate-presence\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { View, createStyledContext, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nvar COLLAPSIBLE_NAME = \"Collapsible\";\nvar { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = createStyledContext();\nvar _Collapsible = createRefComponent(function(props, forwardedRef) {\n var { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;\n var [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ _jsx(CollapsibleProvider, {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(function() {\n return setOpen(function(prevOpen) {\n return !prevOpen;\n });\n }, [\n setOpen\n ]),\n children: /* @__PURE__ */ _jsx(View, {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n })\n });\n});\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nvar TRIGGER_NAME = \"CollapsibleTrigger\";\nvar CollapsibleTriggerFrame = styled(View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nvar CollapsibleTrigger = createStyledHOC(CollapsibleTriggerFrame, function(props, forwardedRef) {\n var { __scopeCollapsible, children, ...triggerProps } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ _jsx(CollapsibleTriggerFrame, {\n // closed content is unmounted, so only name it while it exists\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: composeEventHandlers(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({\n open: context.open\n }) : children\n });\n});\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"CollapsibleContent\";\nvar CollapsibleContentFrame = styled(View, {\n displayName: CONTENT_NAME\n});\nvar CollapsibleContent = createStyledHOC(CollapsibleContentFrame, function(props, forwardedRef) {\n var {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ _jsx(AnimatePresence, {\n ...contentProps,\n children: forceMount || context.open ? /* @__PURE__ */ _jsx(CollapsibleContentFrame, {\n id: context.contentId,\n ref: forwardedRef,\n ...contentProps,\n children: /* @__PURE__ */ _jsx(ResetPresence, {\n children\n })\n }) : null\n });\n});\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Collapsible = withStaticProperties(_Collapsible, {\n Trigger: CollapsibleTrigger,\n Content: CollapsibleContent\n});\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleContentFrame,\n CollapsibleTrigger,\n CollapsibleTriggerFrame\n};\n//# sourceMappingURL=Collapsible.js.map\n"],"mappings":";;;;;;;;;AAOA,IAAI,mBAAmB;AACvB,IAAI,EAAE,UAAU,qBAAqB,kBAAkB,0BAA0B,oBAAoB;AACrG,IAAI,eAAe,mBAAmB,SAAS,OAAO,cAAc;CAClE,IAAI,EAAE,oBAAoB,MAAM,UAAU,aAAa,UAAU,cAAc,GAAG,qBAAqB;CACvG,IAAI,CAAC,OAAO,OAAO,WAAW,qBAAqB;EACjD,MAAM;EACN,aAAa;EACb,UAAU;CACZ,CAAC;CACD,OAAuB,oBAAK,qBAAqB;EAC/C,OAAO;EACP;EACA,WAAW,MAAM,MAAM;EACvB;EACA,cAAc,MAAM,YAAY,WAAW;GACzC,OAAO,QAAQ,SAAS,UAAU;IAChC,OAAO,CAAC;GACV,CAAC;EACH,GAAG,CACD,OACF,CAAC;EACD,UAA0B,oBAAK,MAAM;GACnC,cAAc,SAAS,IAAI;GAC3B,iBAAiB,WAAW,KAAK,KAAK;GACtC,GAAG;GACH,KAAK;EACP,CAAC;CACH,CAAC;AACH,CAAC;AACD,aAAa,cAAc;AAC3B,IAAI,eAAe;AACnB,IAAI,0BAA0B,OAAO,MAAM;CACzC,aAAa;CACb,QAAQ;AACV,CAAC;AACD,IAAI,qBAAqB,gBAAgB,yBAAyB,SAAS,OAAO,cAAc;CAC9F,IAAI,EAAE,oBAAoB,UAAU,GAAG,iBAAiB;CACxD,IAAI,UAAU,sBAAsB,kBAAkB;CACtD,OAAuB,oBAAK,yBAAyB;EAEnD,iBAAiB,QAAQ,OAAO,QAAQ,YAAY,KAAK;EACzD,iBAAiB,QAAQ,QAAQ;EACjC,cAAc,SAAS,QAAQ,IAAI;EACnC,iBAAiB,QAAQ,WAAW,KAAK,KAAK;EAC9C,UAAU,QAAQ;EAClB,GAAG;EACH,KAAK;EACL,SAAS,qBAAqB,MAAM,SAAS,QAAQ,YAAY;EACjE,UAAU,OAAO,aAAa,aAAa,SAAS,EAClD,MAAM,QAAQ,KAChB,CAAC,IAAI;CACP,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,IAAI,eAAe;AACnB,IAAI,0BAA0B,OAAO,MAAM,EACzC,aAAa,aACf,CAAC;AACD,IAAI,qBAAqB,gBAAgB,yBAAyB,SAAS,OAAO,cAAc;CAC9F,IAAI,EACF,YACA,UAEA,oBACA,GAAG,iBACD;CACJ,IAAI,UAAU,sBAAsB,kBAAkB;CACtD,OAAuB,oBAAK,iBAAiB;EAC3C,GAAG;EACH,UAAU,cAAc,QAAQ,OAAuB,oBAAK,yBAAyB;GACnF,IAAI,QAAQ;GACZ,KAAK;GACL,GAAG;GACH,UAA0B,oBAAK,eAAe,EAC5C,SACF,CAAC;EACH,CAAC,IAAI;CACP,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,SAAS,SAAS,MAAM;CACtB,OAAO,OAAO,SAAS;AACzB;AACA,IAAI,cAAc,qBAAqB,cAAc;CACnD,SAAS;CACT,SAAS;AACX,CAAC"}
@@ -39,7 +39,7 @@ const CollapsibleTrigger = createStyledHOC(CollapsibleTriggerFrame, (props, forw
39
39
  const { __scopeCollapsible, children, ...triggerProps } = props;
40
40
  const context = useCollapsibleContext(__scopeCollapsible);
41
41
  return /* @__PURE__ */ jsx(CollapsibleTriggerFrame, {
42
- "aria-controls": context.contentId,
42
+ "aria-controls": context.open ? context.contentId : void 0,
43
43
  "aria-expanded": context.open || false,
44
44
  "data-state": getState(context.open),
45
45
  "data-disabled": context.disabled ? "" : void 0,
@@ -59,6 +59,7 @@ const CollapsibleContent = createStyledHOC(CollapsibleContentFrame, (props, forw
59
59
  return /* @__PURE__ */ jsx(AnimatePresence, {
60
60
  ...contentProps,
61
61
  children: forceMount || context.open ? /* @__PURE__ */ jsx(CollapsibleContentFrame, {
62
+ id: context.contentId,
62
63
  ref: forwardedRef,
63
64
  ...contentProps,
64
65
  children: /* @__PURE__ */ jsx(ResetPresence, { children })
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.js","names":[],"sources":["jsx/Collapsible.js"],"sourcesContent":["import { createStyledHOC, createRefComponent } from \"@tamagui/core\";\nimport { AnimatePresence, ResetPresence } from \"@tamagui/animate-presence\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { View, createStyledContext, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst COLLAPSIBLE_NAME = \"Collapsible\";\nconst { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = createStyledContext();\nconst _Collapsible = createRefComponent(\n (props, forwardedRef) => {\n const {\n __scopeCollapsible,\n open: openProp,\n defaultOpen,\n disabled,\n onOpenChange,\n ...collapsibleProps\n } = props;\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(\n CollapsibleProvider,\n {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(\n () => setOpen((prevOpen) => !prevOpen),\n [setOpen]\n ),\n children: /* @__PURE__ */ jsx(\n View,\n {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nconst TRIGGER_NAME = \"CollapsibleTrigger\";\nconst CollapsibleTriggerFrame = styled(View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nconst CollapsibleTrigger = createStyledHOC(\n CollapsibleTriggerFrame,\n (props, forwardedRef) => {\n const { __scopeCollapsible, children, ...triggerProps } = props;\n const context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ jsx(\n CollapsibleTriggerFrame,\n {\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: composeEventHandlers(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({ open: context.open }) : children\n }\n );\n }\n);\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nconst CONTENT_NAME = \"CollapsibleContent\";\nconst CollapsibleContentFrame = styled(View, {\n displayName: CONTENT_NAME\n});\nconst CollapsibleContent = createStyledHOC(\n CollapsibleContentFrame,\n (props, forwardedRef) => {\n const {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n const context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ jsx(AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ jsx(CollapsibleContentFrame, { ref: forwardedRef, ...contentProps, children: /* @__PURE__ */ jsx(ResetPresence, { children }) }) : null });\n }\n);\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nconst Collapsible = withStaticProperties(_Collapsible, {\n Trigger: CollapsibleTrigger,\n Content: CollapsibleContent\n});\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleContentFrame,\n CollapsibleTrigger,\n CollapsibleTriggerFrame\n};\n//# sourceMappingURL=Collapsible.js.map\n"],"mappings":";;;;;;;;;AAOA,M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iBAAiB;CACvB,MAAM,EACJ,YACA,UAEA,oBACA,GAAG,iBACD;CACJ,MAAM,UAAU,sBAAsB,kBAAkB;CACxD,OAAuB,oBAAI,iBAAiB;EAAE,GAAG;EAAc,UAAU,cAAc,QAAQ,OAAuB,oBAAI,yBAAyB;GAAE,KAAK;GAAc,GAAG;GAAc,UAA0B,oBAAI,eAAe,EAAE,SAAS,CAAC;EAAE,CAAC,IAAI;CAAK,CAAC;AACjQ,CACF;AACA,mBAAmB,cAAc;AACjC,SAAS,SAAS,MAAM;CACtB,OAAO,OAAO,SAAS;AACzB;AACA,MAAM,cAAc,qBAAqB,cAAc;CACrD,SAAS;CACT,SAAS;AACX,CAAC"}
1
+ {"version":3,"file":"Collapsible.js","names":[],"sources":["jsx/Collapsible.js"],"sourcesContent":["import { createStyledHOC, createRefComponent } from \"@tamagui/core\";\nimport { AnimatePresence, ResetPresence } from \"@tamagui/animate-presence\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport { View, createStyledContext, styled } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst COLLAPSIBLE_NAME = \"Collapsible\";\nconst { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = createStyledContext();\nconst _Collapsible = createRefComponent(\n (props, forwardedRef) => {\n const {\n __scopeCollapsible,\n open: openProp,\n defaultOpen,\n disabled,\n onOpenChange,\n ...collapsibleProps\n } = props;\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(\n CollapsibleProvider,\n {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(\n () => setOpen((prevOpen) => !prevOpen),\n [setOpen]\n ),\n children: /* @__PURE__ */ jsx(\n View,\n {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nconst TRIGGER_NAME = \"CollapsibleTrigger\";\nconst CollapsibleTriggerFrame = styled(View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nconst CollapsibleTrigger = createStyledHOC(\n CollapsibleTriggerFrame,\n (props, forwardedRef) => {\n const { __scopeCollapsible, children, ...triggerProps } = props;\n const context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ jsx(\n CollapsibleTriggerFrame,\n {\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: composeEventHandlers(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({ open: context.open }) : children\n }\n );\n }\n);\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nconst CONTENT_NAME = \"CollapsibleContent\";\nconst CollapsibleContentFrame = styled(View, {\n displayName: CONTENT_NAME\n});\nconst CollapsibleContent = createStyledHOC(\n CollapsibleContentFrame,\n (props, forwardedRef) => {\n const {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n const context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ jsx(AnimatePresence, { ...contentProps, children: forceMount || context.open ? /* @__PURE__ */ jsx(\n CollapsibleContentFrame,\n {\n id: context.contentId,\n ref: forwardedRef,\n ...contentProps,\n children: /* @__PURE__ */ jsx(ResetPresence, { children })\n }\n ) : null });\n }\n);\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nconst Collapsible = withStaticProperties(_Collapsible, {\n Trigger: CollapsibleTrigger,\n Content: CollapsibleContent\n});\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleContentFrame,\n CollapsibleTrigger,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,eAAe;AACrB,MAAM,0BAA0B,OAAO,MAAM,EAC3C,aAAa,aACf,CAAC;AACD,MAAM,qBAAqB,gBACzB,0BACC,OAAO,iBAAiB;CACvB,MAAM,EACJ,YACA,UAEA,oBACA,GAAG,iBACD;CACJ,MAAM,UAAU,sBAAsB,kBAAkB;CACxD,OAAuB,oBAAI,iBAAiB;EAAE,GAAG;EAAc,UAAU,cAAc,QAAQ,OAAuB,oBACpH,yBACA;GACE,IAAI,QAAQ;GACZ,KAAK;GACL,GAAG;GACH,UAA0B,oBAAI,eAAe,EAAE,SAAS,CAAC;EAC3D,CACF,IAAI;CAAK,CAAC;AACZ,CACF;AACA,mBAAmB,cAAc;AACjC,SAAS,SAAS,MAAM;CACtB,OAAO,OAAO,SAAS;AACzB;AACA,MAAM,cAAc,qBAAqB,cAAc;CACrD,SAAS;CACT,SAAS;AACX,CAAC"}
@@ -79,7 +79,7 @@ var CollapsibleTrigger = (0, import_core.createStyledHOC)(CollapsibleTriggerFram
79
79
  var { __scopeCollapsible, children, ...triggerProps } = props;
80
80
  var context = useCollapsibleContext(__scopeCollapsible);
81
81
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTriggerFrame, {
82
- "aria-controls": context.contentId,
82
+ "aria-controls": context.open ? context.contentId : void 0,
83
83
  "aria-expanded": context.open || false,
84
84
  "data-state": getState(context.open),
85
85
  "data-disabled": context.disabled ? "" : void 0,
@@ -99,6 +99,7 @@ var CollapsibleContent = (0, import_core.createStyledHOC)(CollapsibleContentFram
99
99
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
100
100
  ...contentProps,
101
101
  children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, {
102
+ id: context.contentId,
102
103
  ref: forwardedRef,
103
104
  ...contentProps,
104
105
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, { children })
@@ -79,7 +79,7 @@ var CollapsibleTrigger = (0, import_core.createStyledHOC)(CollapsibleTriggerFram
79
79
  var { __scopeCollapsible, children, ...triggerProps } = props;
80
80
  var context = useCollapsibleContext(__scopeCollapsible);
81
81
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTriggerFrame, {
82
- "aria-controls": context.contentId,
82
+ "aria-controls": context.open ? context.contentId : void 0,
83
83
  "aria-expanded": context.open || false,
84
84
  "data-state": getState(context.open),
85
85
  "data-disabled": context.disabled ? "" : void 0,
@@ -99,6 +99,7 @@ var CollapsibleContent = (0, import_core.createStyledHOC)(CollapsibleContentFram
99
99
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
100
100
  ...contentProps,
101
101
  children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, {
102
+ id: context.contentId,
102
103
  ref: forwardedRef,
103
104
  ...contentProps,
104
105
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, { children })
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.native.js","names":[],"sources":["jsx/Collapsible.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Collapsible_exports = {};\n__export(Collapsible_exports, {\n Collapsible: () => Collapsible,\n CollapsibleContent: () => CollapsibleContent,\n CollapsibleContentFrame: () => CollapsibleContentFrame,\n CollapsibleTrigger: () => CollapsibleTrigger,\n CollapsibleTriggerFrame: () => CollapsibleTriggerFrame\n});\nmodule.exports = __toCommonJS(Collapsible_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_animate_presence = require(\"@tamagui/animate-presence\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar COLLAPSIBLE_NAME = \"Collapsible\";\nvar { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = (0, import_web.createStyledContext)();\nvar _Collapsible = (0, import_core.createRefComponent)(function(props, forwardedRef) {\n var { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;\n var [open = false, setOpen] = (0, import_use_controllable_state.useControllableState)({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleProvider, {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(function() {\n return setOpen(function(prevOpen) {\n return !prevOpen;\n });\n }, [\n setOpen\n ]),\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web.View, {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n })\n });\n});\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nvar TRIGGER_NAME = \"CollapsibleTrigger\";\nvar CollapsibleTriggerFrame = (0, import_web.styled)(import_web.View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nvar CollapsibleTrigger = (0, import_core.createStyledHOC)(CollapsibleTriggerFrame, function(props, forwardedRef) {\n var { __scopeCollapsible, children, ...triggerProps } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTriggerFrame, {\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({\n open: context.open\n }) : children\n });\n});\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"CollapsibleContent\";\nvar CollapsibleContentFrame = (0, import_web.styled)(import_web.View, {\n displayName: CONTENT_NAME\n});\nvar CollapsibleContent = (0, import_core.createStyledHOC)(CollapsibleContentFrame, function(props, forwardedRef) {\n var {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {\n ...contentProps,\n children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, {\n ref: forwardedRef,\n ...contentProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, {\n children\n })\n }) : null\n });\n});\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Collapsible = (0, import_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CACtD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,yBAAyB;EAC1E,iBAAiB,QAAQ;EACzB,iBAAiB,QAAQ,QAAQ;EACjC,cAAc,SAAS,QAAQ,IAAI;EACnC,iBAAiB,QAAQ,WAAW,KAAK,KAAK;EAC9C,UAAU,QAAQ;EAClB,GAAG;EACH,KAAK;EACL,UAAU,GAAG,eAAe,qBAAoB,CAAE,MAAM,SAAS,QAAQ,YAAY;EACrF,UAAU,OAAO,aAAa,aAAa,SAAS,EAClD,MAAM,QAAQ,KAChB,CAAC,IAAI;CACP,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,IAAI,eAAe;AACnB,IAAI,2BAA2B,GAAG,WAAW,OAAM,CAAE,WAAW,MAAM,EACpE,aAAa,aACf,CAAC;AACD,IAAI,sBAAsB,GAAG,YAAY,gBAAe,CAAE,yBAAyB,SAAS,OAAO,cAAc;CAC/G,IAAI,EACF,YACA,UAEA,oBACA,GAAG,iBACD;CACJ,IAAI,UAAU,sBAAsB,kBAAkB;CACtD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,wBAAwB,iBAAiB;EAC1F,GAAG;EACH,UAAU,cAAc,QAAQ,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,yBAAyB;GAC1G,KAAK;GACL,GAAG;GACH,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,wBAAwB,eAAe,EAC3F,SACF,CAAC;EACH,CAAC,IAAI;CACP,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,SAAS,SAAS,MAAM;CACtB,OAAO,OAAO,SAAS;AACzB;AACA,IAAI,eAAe,GAAG,eAAe,qBAAoB,CAAE,cAAc;CACvE,SAAS;CACT,SAAS;AACX,CAAC"}
1
+ {"version":3,"file":"Collapsible.native.js","names":[],"sources":["jsx/Collapsible.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Collapsible_exports = {};\n__export(Collapsible_exports, {\n Collapsible: () => Collapsible,\n CollapsibleContent: () => CollapsibleContent,\n CollapsibleContentFrame: () => CollapsibleContentFrame,\n CollapsibleTrigger: () => CollapsibleTrigger,\n CollapsibleTriggerFrame: () => CollapsibleTriggerFrame\n});\nmodule.exports = __toCommonJS(Collapsible_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_animate_presence = require(\"@tamagui/animate-presence\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar COLLAPSIBLE_NAME = \"Collapsible\";\nvar { Provider: CollapsibleProvider, useStyledContext: useCollapsibleContext } = (0, import_web.createStyledContext)();\nvar _Collapsible = (0, import_core.createRefComponent)(function(props, forwardedRef) {\n var { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;\n var [open = false, setOpen] = (0, import_use_controllable_state.useControllableState)({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleProvider, {\n scope: __scopeCollapsible,\n disabled,\n contentId: React.useId(),\n open,\n onOpenToggle: React.useCallback(function() {\n return setOpen(function(prevOpen) {\n return !prevOpen;\n });\n }, [\n setOpen\n ]),\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web.View, {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n })\n });\n});\n_Collapsible.displayName = COLLAPSIBLE_NAME;\nvar TRIGGER_NAME = \"CollapsibleTrigger\";\nvar CollapsibleTriggerFrame = (0, import_web.styled)(import_web.View, {\n displayName: TRIGGER_NAME,\n render: \"button\"\n});\nvar CollapsibleTrigger = (0, import_core.createStyledHOC)(CollapsibleTriggerFrame, function(props, forwardedRef) {\n var { __scopeCollapsible, children, ...triggerProps } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleTriggerFrame, {\n // closed content is unmounted, so only name it while it exists\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle),\n children: typeof children === \"function\" ? children({\n open: context.open\n }) : children\n });\n});\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"CollapsibleContent\";\nvar CollapsibleContentFrame = (0, import_web.styled)(import_web.View, {\n displayName: CONTENT_NAME\n});\nvar CollapsibleContent = (0, import_core.createStyledHOC)(CollapsibleContentFrame, function(props, forwardedRef) {\n var {\n forceMount,\n children,\n // @ts-expect-error\n __scopeCollapsible,\n ...contentProps\n } = props;\n var context = useCollapsibleContext(__scopeCollapsible);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {\n ...contentProps,\n children: forceMount || context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollapsibleContentFrame, {\n id: context.contentId,\n ref: forwardedRef,\n ...contentProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, {\n children\n })\n }) : null\n });\n});\nCollapsibleContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Collapsible = (0, import_helpers.withStaticProperties)(_Collapsible, {\n Trigger: CollapsibleTrigger,\n Content: CollapsibleContent\n});\n//# sourceMappingURL=Collapsible.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,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,GAAG;EACH,UAAU,cAAc,QAAQ,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,yBAAyB;GAC1G,IAAI,QAAQ;GACZ,KAAK;GACL,GAAG;GACH,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,wBAAwB,eAAe,EAC3F,SACF,CAAC;EACH,CAAC,IAAI;CACP,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,SAAS,SAAS,MAAM;CACtB,OAAO,OAAO,SAAS;AACzB;AACA,IAAI,eAAe,GAAG,eAAe,qBAAoB,CAAE,cAAc;CACvE,SAAS;CACT,SAAS;AACX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/collapsible",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "license": "MIT",
5
5
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
6
6
  "source": "src/index.ts",
@@ -36,18 +36,18 @@
36
36
  "clean:build": "tamagui-build clean:build"
37
37
  },
38
38
  "dependencies": {
39
- "@tamagui/animate-presence": "3.0.7",
40
- "@tamagui/compose-refs": "3.0.7",
41
- "@tamagui/core": "3.0.7",
42
- "@tamagui/create-context": "3.0.7",
43
- "@tamagui/helpers": "3.0.7",
44
- "@tamagui/polyfill-dev": "3.0.7",
45
- "@tamagui/stacks": "3.0.7",
46
- "@tamagui/use-controllable-state": "3.0.7",
47
- "@tamagui/web": "3.0.7"
39
+ "@tamagui/animate-presence": "3.0.9",
40
+ "@tamagui/compose-refs": "3.0.9",
41
+ "@tamagui/core": "3.0.9",
42
+ "@tamagui/create-context": "3.0.9",
43
+ "@tamagui/helpers": "3.0.9",
44
+ "@tamagui/polyfill-dev": "3.0.9",
45
+ "@tamagui/stacks": "3.0.9",
46
+ "@tamagui/use-controllable-state": "3.0.9",
47
+ "@tamagui/web": "3.0.9"
48
48
  },
49
49
  "devDependencies": {
50
- "@tamagui/build": "3.0.7",
50
+ "@tamagui/build": "3.0.9",
51
51
  "react": "19.2.3"
52
52
  },
53
53
  "peerDependencies": {
@@ -59,5 +59,5 @@
59
59
  "url": "git+https://github.com/tamagui/tamagui.git",
60
60
  "directory": "code/ui/collapsible"
61
61
  },
62
- "releaseSourceCommit": "96f8bc1f222af0381729a2e2202370aa4a9808ef"
62
+ "releaseSourceCommit": "1971272fa9915450004c84ea48188100fdf278ff"
63
63
  }
@@ -95,7 +95,8 @@ const CollapsibleTrigger = createStyledHOC(
95
95
 
96
96
  return (
97
97
  <CollapsibleTriggerFrame
98
- aria-controls={context.contentId}
98
+ // closed content is unmounted, so only name it while it exists
99
+ aria-controls={context.open ? context.contentId : undefined}
99
100
  aria-expanded={context.open || false}
100
101
  data-state={getState(context.open)}
101
102
  data-disabled={context.disabled ? '' : undefined}
@@ -147,7 +148,11 @@ const CollapsibleContent = createStyledHOC(
147
148
  return (
148
149
  <AnimatePresence {...contentProps}>
149
150
  {forceMount || context.open ? (
150
- <CollapsibleContentFrame ref={forwardedRef} {...contentProps}>
151
+ <CollapsibleContentFrame
152
+ id={context.contentId}
153
+ ref={forwardedRef}
154
+ {...contentProps}
155
+ >
151
156
  <ResetPresence>{children}</ResetPresence>
152
157
  </CollapsibleContentFrame>
153
158
  ) : null}
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.d.ts","sourceRoot":"","sources":["../src/Collapsible.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,EAAE,IAAI,EAA+B,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAoB9B,UAAU,gBAAiB,SAAQ,SAAS;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,I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