@bubo-squared/ui-framework 0.2.36 → 0.2.37
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/index.cjs +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -581,12 +581,8 @@ var Accordion = React7.forwardRef(
|
|
|
581
581
|
bordered = false,
|
|
582
582
|
...rootProps
|
|
583
583
|
} = props;
|
|
584
|
-
const {
|
|
585
|
-
|
|
586
|
-
defaultValue,
|
|
587
|
-
onValueChange,
|
|
588
|
-
...restRootProps
|
|
589
|
-
} = rootProps;
|
|
584
|
+
const { value, defaultValue, onValueChange, ...restRootProps } = rootProps;
|
|
585
|
+
const [isDoneAnimating, setIsDoneAnimating] = React7.useState(defaultOpen);
|
|
590
586
|
const resolvedDefaultValue = value === void 0 && defaultValue === void 0 && defaultOpen ? "item" : defaultValue;
|
|
591
587
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
592
588
|
AccordionPrimitive.Root,
|
|
@@ -620,7 +616,18 @@ var Accordion = React7.forwardRef(
|
|
|
620
616
|
]
|
|
621
617
|
}
|
|
622
618
|
) }),
|
|
623
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
619
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
620
|
+
AccordionPrimitive.Content,
|
|
621
|
+
{
|
|
622
|
+
onAnimationStart: () => setIsDoneAnimating(false),
|
|
623
|
+
onAnimationEnd: () => setIsDoneAnimating(true),
|
|
624
|
+
className: cn(
|
|
625
|
+
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
626
|
+
!isDoneAnimating && "overflow-hidden"
|
|
627
|
+
),
|
|
628
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "pb-3", children })
|
|
629
|
+
}
|
|
630
|
+
)
|
|
624
631
|
]
|
|
625
632
|
}
|
|
626
633
|
)
|