@homebound/beam 2.210.2 → 2.211.0
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/components/ButtonModal.d.ts +1 -1
- package/dist/components/ButtonModal.js +1 -1
- package/dist/components/internal/ContextualModal.d.ts +1 -0
- package/dist/components/internal/ContextualModal.js +2 -2
- package/dist/components/internal/OverlayTrigger.js +1 -1
- package/dist/inputs/DateFields/DateFieldBase.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import { OverlayTriggerProps } from "./internal/OverlayTrigger";
|
|
3
3
|
import { ButtonVariant } from "./Button";
|
|
4
4
|
export interface ButtonModalProps extends Pick<OverlayTriggerProps, "trigger" | "placement" | "disabled" | "tooltip" | "showActiveBorder"> {
|
|
5
|
-
content: ReactNode;
|
|
5
|
+
content: ReactNode | ((close: () => void) => ReactNode);
|
|
6
6
|
title?: string;
|
|
7
7
|
variant?: ButtonVariant;
|
|
8
8
|
storybookDefaultOpen?: boolean;
|
|
@@ -14,6 +14,6 @@ function ButtonModal(props) {
|
|
|
14
14
|
const buttonRef = (0, react_1.useRef)(null);
|
|
15
15
|
const { menuTriggerProps } = (0, react_aria_1.useMenuTrigger)({ isDisabled: !!disabled }, state, buttonRef);
|
|
16
16
|
const tid = (0, utils_1.useTestIds)(props, (0, OverlayTrigger_1.isTextButton)(trigger) ? trigger.label : (0, OverlayTrigger_1.isIconButton)(trigger) ? trigger.icon : trigger.name);
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(OverlayTrigger_1.OverlayTrigger, Object.assign({}, props, { menuTriggerProps: menuTriggerProps, state: state, buttonRef: buttonRef }, tid, { children: (0, jsx_runtime_1.jsx)(ContextualModal_1.ContextualModal, { content: content, title: title }, void 0) }), void 0));
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(OverlayTrigger_1.OverlayTrigger, Object.assign({}, props, { menuTriggerProps: menuTriggerProps, state: state, buttonRef: buttonRef }, tid, { children: (0, jsx_runtime_1.jsx)(ContextualModal_1.ContextualModal, { content: content, title: title, close: state.close }, void 0) }), void 0));
|
|
18
18
|
}
|
|
19
19
|
exports.ButtonModal = ButtonModal;
|
|
@@ -6,8 +6,8 @@ const react_aria_1 = require("react-aria");
|
|
|
6
6
|
const Css_1 = require("../../Css");
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
8
|
function ContextualModal(props) {
|
|
9
|
-
const { content, title } = props;
|
|
9
|
+
const { content, title, close } = props;
|
|
10
10
|
const tid = (0, utils_1.useTestIds)(props, "popup");
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(react_aria_1.FocusScope, Object.assign({ restoreFocus: true, autoFocus: true }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.p3.df.fdc.gap3.bgWhite.bshModal.br4.maxh("inherit").overflowAuto.$ }, { children: [title && ((0, jsx_runtime_1.jsx)("div", Object.assign({ css: Css_1.Css.lg.tc.$ }, tid.title, { children: title }), void 0)), (0, jsx_runtime_1.jsx)("div", Object.assign({}, tid.content, { children: content }), void 0)] }), void 0) }), void 0));
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_1.FocusScope, Object.assign({ restoreFocus: true, autoFocus: true }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.p3.df.fdc.gap3.bgWhite.bshModal.br4.maxh("inherit").overflowAuto.$ }, tid, { children: [title && ((0, jsx_runtime_1.jsx)("div", Object.assign({ css: Css_1.Css.lg.tc.$ }, tid.title, { children: title }), void 0)), (0, jsx_runtime_1.jsx)("div", Object.assign({}, tid.content, { children: typeof content === "function" ? content(close) : content }), void 0)] }), void 0) }), void 0));
|
|
12
12
|
}
|
|
13
13
|
exports.ContextualModal = ContextualModal;
|
|
@@ -13,7 +13,7 @@ const Css_1 = require("../../Css");
|
|
|
13
13
|
const utils_1 = require("../../utils");
|
|
14
14
|
const defaultTestId_1 = require("../../utils/defaultTestId");
|
|
15
15
|
function OverlayTrigger(props) {
|
|
16
|
-
const { trigger, buttonRef, menuTriggerProps, placement, state, disabled, tooltip, children, variant, hideEndAdornment, showActiveBorder = false } = props;
|
|
16
|
+
const { trigger, buttonRef, menuTriggerProps, placement, state, disabled, tooltip, children, variant, hideEndAdornment, showActiveBorder = false, } = props;
|
|
17
17
|
const popoverRef = (0, react_1.useRef)(null);
|
|
18
18
|
const { overlayProps: positionProps } = (0, react_aria_1.useOverlayPosition)({
|
|
19
19
|
targetRef: buttonRef,
|
|
@@ -160,7 +160,7 @@ function DateFieldBase(props) {
|
|
|
160
160
|
} }, void 0)) }, void 0));
|
|
161
161
|
const calendarButton = ((0, jsx_runtime_1.jsx)("button", Object.assign({ ref: buttonRef }, buttonProps, { disabled: isDisabled, css: Css_1.Css.if(isDisabled).cursorNotAllowed.$, tabIndex: -1 }, tid.calendarButton, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "calendar", color: isDisabled ? Css_1.Palette.Gray400 : Css_1.Palette.Gray700 }, void 0) }), void 0));
|
|
162
162
|
const EndFieldButtons = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isRangeFilterField && clearButton, !hideCalendarIcon && calendarButton] }, void 0));
|
|
163
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, Object.assign({}, textFieldProps, { errorMsg: errorMsg, helperText: helperText, required: required, labelProps: labelProps, inputProps: { ...
|
|
163
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, Object.assign({}, textFieldProps, { errorMsg: errorMsg, helperText: helperText, required: required, labelProps: labelProps, inputProps: { ...inputProps, size: inputSize }, inputRef: inputRef, inputWrapRef: inputWrapRef, inlineLabel: inlineLabel, onChange: (v) => {
|
|
164
164
|
// hide the calendar if the user is manually entering the date
|
|
165
165
|
state.close();
|
|
166
166
|
if (v) {
|