@homebound/beam 2.416.2 → 2.416.4
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 +9 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -50
- package/dist/index.js.map +1 -1
- package/package.json +7 -13
package/dist/index.cjs
CHANGED
|
@@ -4446,7 +4446,7 @@ function Tooltip(props) {
|
|
|
4446
4446
|
...triggerProps,
|
|
4447
4447
|
...!state.isOpen && typeof title === "string" ? { title } : {},
|
|
4448
4448
|
...tid,
|
|
4449
|
-
css: Css.display("contents")
|
|
4449
|
+
css: Css.display("contents").$,
|
|
4450
4450
|
draggable: true,
|
|
4451
4451
|
onDragStart: (e) => e.preventDefault(),
|
|
4452
4452
|
children
|
|
@@ -14499,19 +14499,20 @@ function Accordion(props) {
|
|
|
14499
14499
|
const id = (0, import_utils68.useId)();
|
|
14500
14500
|
const [expanded, setExpanded] = (0, import_react75.useState)(defaultExpanded && !disabled);
|
|
14501
14501
|
const { isFocusVisible, focusProps } = (0, import_react_aria40.useFocusRing)();
|
|
14502
|
-
const
|
|
14502
|
+
const [contentEl, setContentEl] = (0, import_react75.useState)(null);
|
|
14503
|
+
const contentRef = (0, import_react75.useMemo)(() => ({ current: contentEl }), [contentEl]);
|
|
14503
14504
|
const [contentHeight, setContentHeight] = (0, import_react75.useState)(expanded ? "auto" : "0");
|
|
14504
14505
|
(0, import_react75.useEffect)(() => {
|
|
14505
14506
|
setExpanded(defaultExpanded && !disabled);
|
|
14506
14507
|
}, [defaultExpanded, disabled]);
|
|
14507
14508
|
(0, import_react75.useEffect)(() => {
|
|
14508
|
-
setContentHeight(expanded &&
|
|
14509
|
-
}, [expanded]);
|
|
14509
|
+
setContentHeight(expanded && contentEl ? `${contentEl.scrollHeight}px` : "0");
|
|
14510
|
+
}, [expanded, contentEl]);
|
|
14510
14511
|
const onResize = (0, import_react75.useCallback)(() => {
|
|
14511
|
-
if (
|
|
14512
|
-
setContentHeight(`${
|
|
14512
|
+
if (contentEl && expanded) {
|
|
14513
|
+
setContentHeight(`${contentEl.scrollHeight}px`);
|
|
14513
14514
|
}
|
|
14514
|
-
}, [expanded, setContentHeight]);
|
|
14515
|
+
}, [expanded, contentEl, setContentHeight]);
|
|
14515
14516
|
(0, import_utils68.useResizeObserver)({ ref: contentRef, onResize });
|
|
14516
14517
|
const toggle = (0, import_react75.useCallback)(() => {
|
|
14517
14518
|
setExpanded((prev) => !prev);
|
|
@@ -14573,7 +14574,7 @@ function Accordion(props) {
|
|
|
14573
14574
|
id,
|
|
14574
14575
|
"aria-hidden": !expanded,
|
|
14575
14576
|
css: Css.oh.h(contentHeight).add("transition", "height 250ms ease-in-out").$,
|
|
14576
|
-
children: expanded && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { css: Css.px2.pb2.pt1.if(omitPadding).p0.$, ref:
|
|
14577
|
+
children: expanded && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { css: Css.px2.pb2.pt1.if(omitPadding).p0.$, ref: setContentEl, ...tid.content, children })
|
|
14577
14578
|
}
|
|
14578
14579
|
)
|
|
14579
14580
|
]
|