@homebound/beam 2.416.1 → 2.416.3
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 +28 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +158 -144
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6964,6 +6964,19 @@ function OverlayTrigger(props) {
|
|
|
6964
6964
|
showActiveBorder = false,
|
|
6965
6965
|
contrast = false
|
|
6966
6966
|
} = props;
|
|
6967
|
+
const wrappedMenuTriggerProps = (0, import_react24.useMemo)(
|
|
6968
|
+
() => ({
|
|
6969
|
+
...menuTriggerProps,
|
|
6970
|
+
onPressStart: (e) => {
|
|
6971
|
+
if (e.pointerType !== "touch" && e.pointerType !== "keyboard") {
|
|
6972
|
+
state.toggle(e.pointerType === "virtual" ? "first" : null);
|
|
6973
|
+
} else {
|
|
6974
|
+
menuTriggerProps.onPressStart?.(e);
|
|
6975
|
+
}
|
|
6976
|
+
}
|
|
6977
|
+
}),
|
|
6978
|
+
[menuTriggerProps, state]
|
|
6979
|
+
);
|
|
6967
6980
|
const popoverRef = (0, import_react24.useRef)(null);
|
|
6968
6981
|
const { overlayProps: positionProps } = (0, import_react_aria8.useOverlayPosition)({
|
|
6969
6982
|
targetRef: buttonRef,
|
|
@@ -6985,12 +6998,12 @@ function OverlayTrigger(props) {
|
|
|
6985
6998
|
variant: variant ? variant : "secondary",
|
|
6986
6999
|
contrast,
|
|
6987
7000
|
...trigger,
|
|
6988
|
-
menuTriggerProps,
|
|
7001
|
+
menuTriggerProps: wrappedMenuTriggerProps,
|
|
6989
7002
|
buttonRef,
|
|
6990
7003
|
endAdornment: !hideEndAdornment ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { icon: state.isOpen ? "chevronUp" : "chevronDown" }) : null,
|
|
6991
7004
|
disabled,
|
|
6992
7005
|
tooltip,
|
|
6993
|
-
onClick:
|
|
7006
|
+
onClick: wrappedMenuTriggerProps.onPress ?? noop,
|
|
6994
7007
|
forceFocusStyles: showActiveBorder && state.isOpen,
|
|
6995
7008
|
...tid
|
|
6996
7009
|
}
|
|
@@ -7001,7 +7014,7 @@ function OverlayTrigger(props) {
|
|
|
7001
7014
|
label: trigger.navLabel,
|
|
7002
7015
|
disabled: !!disabled,
|
|
7003
7016
|
contrast,
|
|
7004
|
-
menuTriggerProps,
|
|
7017
|
+
menuTriggerProps: wrappedMenuTriggerProps,
|
|
7005
7018
|
buttonRef,
|
|
7006
7019
|
...tid
|
|
7007
7020
|
}
|
|
@@ -7009,24 +7022,24 @@ function OverlayTrigger(props) {
|
|
|
7009
7022
|
IconButton,
|
|
7010
7023
|
{
|
|
7011
7024
|
...trigger,
|
|
7012
|
-
menuTriggerProps,
|
|
7025
|
+
menuTriggerProps: wrappedMenuTriggerProps,
|
|
7013
7026
|
buttonRef,
|
|
7014
7027
|
...tid,
|
|
7015
7028
|
disabled,
|
|
7016
7029
|
tooltip,
|
|
7017
|
-
onClick:
|
|
7030
|
+
onClick: wrappedMenuTriggerProps.onPress ?? noop,
|
|
7018
7031
|
forceFocusStyles: showActiveBorder && state.isOpen
|
|
7019
7032
|
}
|
|
7020
7033
|
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7021
7034
|
AvatarButton,
|
|
7022
7035
|
{
|
|
7023
7036
|
...trigger,
|
|
7024
|
-
menuTriggerProps,
|
|
7037
|
+
menuTriggerProps: wrappedMenuTriggerProps,
|
|
7025
7038
|
buttonRef,
|
|
7026
7039
|
...tid,
|
|
7027
7040
|
disabled,
|
|
7028
7041
|
tooltip,
|
|
7029
|
-
onClick:
|
|
7042
|
+
onClick: wrappedMenuTriggerProps.onPress ?? noop,
|
|
7030
7043
|
forceFocusStyles: showActiveBorder && state.isOpen
|
|
7031
7044
|
}
|
|
7032
7045
|
),
|
|
@@ -14486,19 +14499,20 @@ function Accordion(props) {
|
|
|
14486
14499
|
const id = (0, import_utils68.useId)();
|
|
14487
14500
|
const [expanded, setExpanded] = (0, import_react75.useState)(defaultExpanded && !disabled);
|
|
14488
14501
|
const { isFocusVisible, focusProps } = (0, import_react_aria40.useFocusRing)();
|
|
14489
|
-
const
|
|
14502
|
+
const [contentEl, setContentEl] = (0, import_react75.useState)(null);
|
|
14503
|
+
const contentRef = (0, import_react75.useMemo)(() => ({ current: contentEl }), [contentEl]);
|
|
14490
14504
|
const [contentHeight, setContentHeight] = (0, import_react75.useState)(expanded ? "auto" : "0");
|
|
14491
14505
|
(0, import_react75.useEffect)(() => {
|
|
14492
14506
|
setExpanded(defaultExpanded && !disabled);
|
|
14493
14507
|
}, [defaultExpanded, disabled]);
|
|
14494
14508
|
(0, import_react75.useEffect)(() => {
|
|
14495
|
-
setContentHeight(expanded &&
|
|
14496
|
-
}, [expanded]);
|
|
14509
|
+
setContentHeight(expanded && contentEl ? `${contentEl.scrollHeight}px` : "0");
|
|
14510
|
+
}, [expanded, contentEl]);
|
|
14497
14511
|
const onResize = (0, import_react75.useCallback)(() => {
|
|
14498
|
-
if (
|
|
14499
|
-
setContentHeight(`${
|
|
14512
|
+
if (contentEl && expanded) {
|
|
14513
|
+
setContentHeight(`${contentEl.scrollHeight}px`);
|
|
14500
14514
|
}
|
|
14501
|
-
}, [expanded, setContentHeight]);
|
|
14515
|
+
}, [expanded, contentEl, setContentHeight]);
|
|
14502
14516
|
(0, import_utils68.useResizeObserver)({ ref: contentRef, onResize });
|
|
14503
14517
|
const toggle = (0, import_react75.useCallback)(() => {
|
|
14504
14518
|
setExpanded((prev) => !prev);
|
|
@@ -14560,7 +14574,7 @@ function Accordion(props) {
|
|
|
14560
14574
|
id,
|
|
14561
14575
|
"aria-hidden": !expanded,
|
|
14562
14576
|
css: Css.oh.h(contentHeight).add("transition", "height 250ms ease-in-out").$,
|
|
14563
|
-
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 })
|
|
14564
14578
|
}
|
|
14565
14579
|
)
|
|
14566
14580
|
]
|