@homebound/beam 2.199.2 → 2.200.1

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.
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ import { OverlayTriggerProps } from "./internal/OverlayTrigger";
3
+ export interface ButtonModalProps extends Pick<OverlayTriggerProps, "trigger" | "placement" | "disabled" | "tooltip"> {
4
+ content: ReactNode;
5
+ title?: string;
6
+ storybookDefaultOpen?: boolean;
7
+ }
8
+ export declare function ButtonModal(props: ButtonModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonModal = void 0;
4
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const react_aria_1 = require("react-aria");
7
+ const react_stately_1 = require("react-stately");
8
+ const OverlayTrigger_1 = require("./internal/OverlayTrigger");
9
+ const utils_1 = require("../utils");
10
+ const ContextualModal_1 = require("./internal/ContextualModal");
11
+ function ButtonModal(props) {
12
+ const { storybookDefaultOpen, trigger, disabled, content, title } = props;
13
+ const state = (0, react_stately_1.useMenuTriggerState)({ isOpen: storybookDefaultOpen });
14
+ const buttonRef = (0, react_1.useRef)(null);
15
+ const { menuTriggerProps } = (0, react_aria_1.useMenuTrigger)({ isDisabled: !!disabled }, state, buttonRef);
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));
18
+ }
19
+ exports.ButtonModal = ButtonModal;
@@ -43,10 +43,11 @@ function RowImpl(props) {
43
43
  const rowStyle = rowStyles === null || rowStyles === void 0 ? void 0 : rowStyles[row.kind];
44
44
  const RowTag = as === "table" ? "tr" : "div";
45
45
  const revealOnRowHoverClass = "revealOnRowHover";
46
+ const showRowHoverColor = row.kind !== "totals" && row.kind !== "header" && !omitRowHover;
46
47
  const rowStyleCellCss = (0, utils_1.maybeApplyFunction)(row, rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.cellCss);
47
48
  const rowCss = {
48
49
  // Optionally include the row hover styles, by default they should be turned on.
49
- ...(!omitRowHover && {
50
+ ...(showRowHoverColor && {
50
51
  // Even though backgroundColor is set on the cellCss, the hover target is the row.
51
52
  "&:hover > *": Css_1.Css.bgColor((_a = style.rowHoverColor) !== null && _a !== void 0 ? _a : Css_1.Palette.LightBlue100).$,
52
53
  }),
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ export interface ContextualModalProps {
3
+ content: ReactNode;
4
+ title?: string;
5
+ }
6
+ export declare function ContextualModal(props: ContextualModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContextualModal = void 0;
4
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
+ const react_aria_1 = require("react-aria");
6
+ const Css_1 = require("../../Css");
7
+ const utils_1 = require("../../utils");
8
+ function ContextualModal(props) {
9
+ const { content, title } = props;
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));
12
+ }
13
+ exports.ContextualModal = ContextualModal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.199.2",
3
+ "version": "2.200.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",