@homebound/beam 3.89.0 → 3.90.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.
- package/dist/index.cjs +50 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +49 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -137,6 +137,7 @@ __export(index_exports, {
|
|
|
137
137
|
Loader: () => Loader,
|
|
138
138
|
LoadingSkeleton: () => LoadingSkeleton,
|
|
139
139
|
MaxLines: () => MaxLines,
|
|
140
|
+
ModalBanner: () => ModalBanner,
|
|
140
141
|
ModalBody: () => ModalBody,
|
|
141
142
|
ModalFilterItem: () => ModalFilterItem,
|
|
142
143
|
ModalFooter: () => ModalFooter,
|
|
@@ -19534,7 +19535,7 @@ function AiLoadingPanel(props) {
|
|
|
19534
19535
|
return (
|
|
19535
19536
|
// `status` rather than `alert` so assistive tech waits for a pause instead of interrupting, and
|
|
19536
19537
|
// `aria-busy` so it knows the surrounding content is still settling.
|
|
19537
|
-
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(AiPanel, { role: "status", "aria-busy": true, ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "df fdc aic gap1 w100", children: [
|
|
19538
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(AiPanel, { role: "status", "aria-busy": true, ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "df fdc aic gap1 w100 pl1 pr1", children: [
|
|
19538
19539
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(AiLoader, {}),
|
|
19539
19540
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: "fw6 fz_18px lh_28px purple700 aiBoldBg bgcl_text WebkitBackgroundClip_text wktfc_transparent", ...tid.title, children: title }),
|
|
19540
19541
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { ...(0, import_runtime83.trussProps)({
|
|
@@ -19559,10 +19560,8 @@ function AiSlimBanner(props) {
|
|
|
19559
19560
|
action
|
|
19560
19561
|
} = props;
|
|
19561
19562
|
const tid = useTestIds(props, "aiSlimBanner");
|
|
19562
|
-
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "df
|
|
19563
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Icon, { icon: "aiStar", inc: 1.5
|
|
19564
|
-
flexShrink: "fs0"
|
|
19565
|
-
} }),
|
|
19563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "df ais gap2 w100 pl2 pr2 fw4 fz_12px lh_16px aiBackground", ...tid, children: [
|
|
19564
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "df aic fs0 pt1 pb1 h_32px", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Icon, { icon: "aiStar", inc: 1.5 }) }),
|
|
19566
19565
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "df aic jcsb gap2 fg1 mw0", children: [
|
|
19567
19566
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "fw6 fz_12px lh_16px purple700 aiBoldBg bgcl_text WebkitBackgroundClip_text wktfc_transparent pt1 pb1 mw0", ...tid.title, children: title }),
|
|
19568
19567
|
action && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: "fs0", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Button, { ...action, variant: "text" }) })
|
|
@@ -19785,11 +19784,13 @@ function Modal(props) {
|
|
|
19785
19784
|
forceScrolling,
|
|
19786
19785
|
api,
|
|
19787
19786
|
drawHeaderBorder = false,
|
|
19788
|
-
allowClosing = true
|
|
19787
|
+
allowClosing = true,
|
|
19788
|
+
aiMode = false
|
|
19789
19789
|
} = props;
|
|
19790
19790
|
const isFixedHeight = typeof size !== "string";
|
|
19791
19791
|
const ref = (0, import_react97.useRef)(null);
|
|
19792
19792
|
const {
|
|
19793
|
+
modalBannerDiv,
|
|
19793
19794
|
modalBodyDiv,
|
|
19794
19795
|
modalFooterDiv,
|
|
19795
19796
|
modalHeaderDiv
|
|
@@ -19819,6 +19820,7 @@ function Modal(props) {
|
|
|
19819
19820
|
role: "dialog"
|
|
19820
19821
|
}, ref);
|
|
19821
19822
|
const [[width2, height], setSize] = (0, import_react97.useState)(getSize(size));
|
|
19823
|
+
const modalBannerRef = (0, import_react97.useRef)(null);
|
|
19822
19824
|
const modalBodyRef = (0, import_react97.useRef)(null);
|
|
19823
19825
|
const modalFooterRef = (0, import_react97.useRef)(null);
|
|
19824
19826
|
const modalHeaderRef = (0, import_react97.useRef)(null);
|
|
@@ -19850,13 +19852,31 @@ function Modal(props) {
|
|
|
19850
19852
|
(0, import_react97.useEffect)(
|
|
19851
19853
|
() => {
|
|
19852
19854
|
modalHeaderRef.current.appendChild(modalHeaderDiv);
|
|
19855
|
+
modalBannerRef.current.appendChild(modalBannerDiv);
|
|
19853
19856
|
modalBodyRef.current.appendChild(modalBodyDiv);
|
|
19854
19857
|
modalFooterRef.current.appendChild(modalFooterDiv);
|
|
19855
19858
|
},
|
|
19856
19859
|
// TODO: validate this eslint-disable. It was automatically ignored as part of https://app.shortcut.com/homebound-team/story/40033/enable-react-hooks-exhaustive-deps-for-react-projects
|
|
19857
19860
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19858
|
-
[modalBodyRef, modalFooterRef, modalHeaderRef]
|
|
19861
|
+
[modalBannerRef, modalBodyRef, modalFooterRef, modalHeaderRef]
|
|
19859
19862
|
);
|
|
19863
|
+
const title = /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("h1", { ...(0, import_runtime86.trussProps)({
|
|
19864
|
+
flexGrow: "fg1",
|
|
19865
|
+
fontWeight: "fw6",
|
|
19866
|
+
fontSize: "fz_30px",
|
|
19867
|
+
lineHeight: "lh_36px",
|
|
19868
|
+
...aiMode ? {
|
|
19869
|
+
color: "purple700",
|
|
19870
|
+
backgroundImage: "aiBoldBg",
|
|
19871
|
+
backgroundClip: "bgcl_text",
|
|
19872
|
+
WebkitBackgroundClip: "WebkitBackgroundClip_text",
|
|
19873
|
+
WebkitTextFillColor: "wktfc_transparent"
|
|
19874
|
+
} : {
|
|
19875
|
+
color: ["color_var", {
|
|
19876
|
+
"--color": "var(--b-on-surface)"
|
|
19877
|
+
}]
|
|
19878
|
+
}
|
|
19879
|
+
}), ref: modalHeaderRef, ...titleProps, ...testId.title });
|
|
19860
19880
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ModalProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_react_aria50.OverlayContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(AutoSaveStatusProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { ...(0, import_runtime86.trussProps)({
|
|
19861
19881
|
position: "fixed",
|
|
19862
19882
|
top: "tp_0",
|
|
@@ -19915,16 +19935,12 @@ function Modal(props) {
|
|
|
19915
19935
|
} : {}
|
|
19916
19936
|
}), children: [
|
|
19917
19937
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "fs0 pl1", children: allowClosing && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(IconButton, { icon: "x", onClick: closeModal, ...testId.titleClose }) }),
|
|
19918
|
-
/* @__PURE__ */ (0, import_jsx_runtime115.
|
|
19919
|
-
|
|
19920
|
-
|
|
19921
|
-
|
|
19922
|
-
lineHeight: "lh_36px",
|
|
19923
|
-
color: ["color_var", {
|
|
19924
|
-
"--color": "var(--b-on-surface)"
|
|
19925
|
-
}]
|
|
19926
|
-
}), ref: modalHeaderRef, ...titleProps, ...testId.title })
|
|
19938
|
+
aiMode ? /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: "df fdc aifs gap_4px fg1 mw0", ...testId.aiTitle, children: [
|
|
19939
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(BlueprintAiLogo, { height: 2 }),
|
|
19940
|
+
title
|
|
19941
|
+
] }) : title
|
|
19927
19942
|
] }),
|
|
19943
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { ref: modalBannerRef, className: "fs0" }),
|
|
19928
19944
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("main", { ref: modalBodyRef, ...(0, import_runtime86.trussProps)({
|
|
19929
19945
|
flexGrow: "fg1",
|
|
19930
19946
|
overflowY: "oya",
|
|
@@ -19950,6 +19966,15 @@ function ModalHeader({
|
|
|
19950
19966
|
} = useBeamContext();
|
|
19951
19967
|
return (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_jsx_runtime115.Fragment, { children }), modalHeaderDiv);
|
|
19952
19968
|
}
|
|
19969
|
+
function ModalBanner({
|
|
19970
|
+
children
|
|
19971
|
+
}) {
|
|
19972
|
+
const {
|
|
19973
|
+
modalBannerDiv
|
|
19974
|
+
} = useBeamContext();
|
|
19975
|
+
const testId = useTestIds({}, testIdPrefix);
|
|
19976
|
+
return (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "mb3", ...testId.banner, children }), modalBannerDiv);
|
|
19977
|
+
}
|
|
19953
19978
|
function ModalBody({
|
|
19954
19979
|
children,
|
|
19955
19980
|
virtualized = false
|
|
@@ -23422,14 +23447,14 @@ var import_react119 = require("react");
|
|
|
23422
23447
|
var import_jsx_runtime172 = require("react/jsx-runtime");
|
|
23423
23448
|
function OpenModal(props) {
|
|
23424
23449
|
const { openModal } = useModal();
|
|
23425
|
-
const { size, children, keepOpen } = props;
|
|
23450
|
+
const { size, children, keepOpen, aiMode } = props;
|
|
23426
23451
|
(0, import_react119.useEffect)(() => {
|
|
23427
23452
|
if (!keepOpen) {
|
|
23428
|
-
openModal({ size, content: children });
|
|
23453
|
+
openModal({ size, content: children, aiMode });
|
|
23429
23454
|
}
|
|
23430
|
-
}, [keepOpen, openModal, size, children]);
|
|
23455
|
+
}, [keepOpen, openModal, size, children, aiMode]);
|
|
23431
23456
|
if (keepOpen) {
|
|
23432
|
-
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(Modal, { size, content: children });
|
|
23457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(Modal, { size, content: children, aiMode });
|
|
23433
23458
|
} else {
|
|
23434
23459
|
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { children: "dummy content" });
|
|
23435
23460
|
}
|
|
@@ -24509,6 +24534,7 @@ var BeamContext = (0, import_react129.createContext)({
|
|
|
24509
24534
|
modalState: new EmptyRef(),
|
|
24510
24535
|
modalCanCloseChecks: new EmptyRef(),
|
|
24511
24536
|
modalHeaderDiv: void 0,
|
|
24537
|
+
modalBannerDiv: void 0,
|
|
24512
24538
|
modalBodyDiv: void 0,
|
|
24513
24539
|
modalFooterDiv: void 0,
|
|
24514
24540
|
drawerContentStack: new EmptyRef(),
|
|
@@ -24520,6 +24546,7 @@ function BeamProvider({ children, documentTitleConfig, ...presentationProps }) {
|
|
|
24520
24546
|
const [, tick] = (0, import_react129.useReducer)((prev) => prev + 1, 0);
|
|
24521
24547
|
const modalRef = (0, import_react129.useRef)();
|
|
24522
24548
|
const modalHeaderDiv = (0, import_react129.useMemo)(() => document.createElement("div"), []);
|
|
24549
|
+
const modalBannerDiv = (0, import_react129.useMemo)(() => document.createElement("div"), []);
|
|
24523
24550
|
const modalBodyDiv = (0, import_react129.useMemo)(() => {
|
|
24524
24551
|
const el = document.createElement("div");
|
|
24525
24552
|
el.style.height = "100%";
|
|
@@ -24539,13 +24566,14 @@ function BeamProvider({ children, documentTitleConfig, ...presentationProps }) {
|
|
|
24539
24566
|
// The rest we don't need to re-render when these are mutated, so just expose as-is
|
|
24540
24567
|
modalCanCloseChecks: modalCanCloseChecksRef,
|
|
24541
24568
|
modalHeaderDiv,
|
|
24569
|
+
modalBannerDiv,
|
|
24542
24570
|
modalBodyDiv,
|
|
24543
24571
|
modalFooterDiv,
|
|
24544
24572
|
drawerCanCloseChecks,
|
|
24545
24573
|
drawerCanCloseDetailsChecks,
|
|
24546
24574
|
sdHeaderDiv
|
|
24547
24575
|
};
|
|
24548
|
-
}, [modalBodyDiv, modalFooterDiv, modalHeaderDiv, sdHeaderDiv]);
|
|
24576
|
+
}, [modalBannerDiv, modalBodyDiv, modalFooterDiv, modalHeaderDiv, sdHeaderDiv]);
|
|
24549
24577
|
const beamTree = /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(PresentationProvider, { ...presentationProps, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(RightPaneProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(AutoSaveStatusProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(SnackbarProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)(ToastProvider, { children: [
|
|
24550
24578
|
/* @__PURE__ */ (0, import_jsx_runtime189.jsxs)(import_react_aria56.OverlayProvider, { children: [
|
|
24551
24579
|
children,
|
|
@@ -28689,6 +28717,7 @@ function getInitialStep(steps, defaultStep) {
|
|
|
28689
28717
|
Loader,
|
|
28690
28718
|
LoadingSkeleton,
|
|
28691
28719
|
MaxLines,
|
|
28720
|
+
ModalBanner,
|
|
28692
28721
|
ModalBody,
|
|
28693
28722
|
ModalFilterItem,
|
|
28694
28723
|
ModalFooter,
|