@homebound/beam 3.89.0 → 3.90.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/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,
@@ -19785,11 +19786,13 @@ function Modal(props) {
19785
19786
  forceScrolling,
19786
19787
  api,
19787
19788
  drawHeaderBorder = false,
19788
- allowClosing = true
19789
+ allowClosing = true,
19790
+ aiMode = false
19789
19791
  } = props;
19790
19792
  const isFixedHeight = typeof size !== "string";
19791
19793
  const ref = (0, import_react97.useRef)(null);
19792
19794
  const {
19795
+ modalBannerDiv,
19793
19796
  modalBodyDiv,
19794
19797
  modalFooterDiv,
19795
19798
  modalHeaderDiv
@@ -19819,6 +19822,7 @@ function Modal(props) {
19819
19822
  role: "dialog"
19820
19823
  }, ref);
19821
19824
  const [[width2, height], setSize] = (0, import_react97.useState)(getSize(size));
19825
+ const modalBannerRef = (0, import_react97.useRef)(null);
19822
19826
  const modalBodyRef = (0, import_react97.useRef)(null);
19823
19827
  const modalFooterRef = (0, import_react97.useRef)(null);
19824
19828
  const modalHeaderRef = (0, import_react97.useRef)(null);
@@ -19850,13 +19854,31 @@ function Modal(props) {
19850
19854
  (0, import_react97.useEffect)(
19851
19855
  () => {
19852
19856
  modalHeaderRef.current.appendChild(modalHeaderDiv);
19857
+ modalBannerRef.current.appendChild(modalBannerDiv);
19853
19858
  modalBodyRef.current.appendChild(modalBodyDiv);
19854
19859
  modalFooterRef.current.appendChild(modalFooterDiv);
19855
19860
  },
19856
19861
  // 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
19862
  // eslint-disable-next-line react-hooks/exhaustive-deps
19858
- [modalBodyRef, modalFooterRef, modalHeaderRef]
19863
+ [modalBannerRef, modalBodyRef, modalFooterRef, modalHeaderRef]
19859
19864
  );
19865
+ const title = /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("h1", { ...(0, import_runtime86.trussProps)({
19866
+ flexGrow: "fg1",
19867
+ fontWeight: "fw6",
19868
+ fontSize: "fz_30px",
19869
+ lineHeight: "lh_36px",
19870
+ ...aiMode ? {
19871
+ color: "purple700",
19872
+ backgroundImage: "aiBoldBg",
19873
+ backgroundClip: "bgcl_text",
19874
+ WebkitBackgroundClip: "WebkitBackgroundClip_text",
19875
+ WebkitTextFillColor: "wktfc_transparent"
19876
+ } : {
19877
+ color: ["color_var", {
19878
+ "--color": "var(--b-on-surface)"
19879
+ }]
19880
+ }
19881
+ }), ref: modalHeaderRef, ...titleProps, ...testId.title });
19860
19882
  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
19883
  position: "fixed",
19862
19884
  top: "tp_0",
@@ -19915,16 +19937,12 @@ function Modal(props) {
19915
19937
  } : {}
19916
19938
  }), children: [
19917
19939
  /* @__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.jsx)("h1", { ...(0, import_runtime86.trussProps)({
19919
- flexGrow: "fg1",
19920
- fontWeight: "fw6",
19921
- fontSize: "fz_30px",
19922
- lineHeight: "lh_36px",
19923
- color: ["color_var", {
19924
- "--color": "var(--b-on-surface)"
19925
- }]
19926
- }), ref: modalHeaderRef, ...titleProps, ...testId.title })
19940
+ aiMode ? /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: "df fdc aifs gap_4px fg1 mw0", ...testId.aiTitle, children: [
19941
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(BlueprintAiLogo, { height: 2 }),
19942
+ title
19943
+ ] }) : title
19927
19944
  ] }),
19945
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { ref: modalBannerRef, className: "fs0" }),
19928
19946
  /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("main", { ref: modalBodyRef, ...(0, import_runtime86.trussProps)({
19929
19947
  flexGrow: "fg1",
19930
19948
  overflowY: "oya",
@@ -19950,6 +19968,15 @@ function ModalHeader({
19950
19968
  } = useBeamContext();
19951
19969
  return (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_jsx_runtime115.Fragment, { children }), modalHeaderDiv);
19952
19970
  }
19971
+ function ModalBanner({
19972
+ children
19973
+ }) {
19974
+ const {
19975
+ modalBannerDiv
19976
+ } = useBeamContext();
19977
+ const testId = useTestIds({}, testIdPrefix);
19978
+ return (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "mb3", ...testId.banner, children }), modalBannerDiv);
19979
+ }
19953
19980
  function ModalBody({
19954
19981
  children,
19955
19982
  virtualized = false
@@ -23422,14 +23449,14 @@ var import_react119 = require("react");
23422
23449
  var import_jsx_runtime172 = require("react/jsx-runtime");
23423
23450
  function OpenModal(props) {
23424
23451
  const { openModal } = useModal();
23425
- const { size, children, keepOpen } = props;
23452
+ const { size, children, keepOpen, aiMode } = props;
23426
23453
  (0, import_react119.useEffect)(() => {
23427
23454
  if (!keepOpen) {
23428
- openModal({ size, content: children });
23455
+ openModal({ size, content: children, aiMode });
23429
23456
  }
23430
- }, [keepOpen, openModal, size, children]);
23457
+ }, [keepOpen, openModal, size, children, aiMode]);
23431
23458
  if (keepOpen) {
23432
- return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(Modal, { size, content: children });
23459
+ return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(Modal, { size, content: children, aiMode });
23433
23460
  } else {
23434
23461
  return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { children: "dummy content" });
23435
23462
  }
@@ -24509,6 +24536,7 @@ var BeamContext = (0, import_react129.createContext)({
24509
24536
  modalState: new EmptyRef(),
24510
24537
  modalCanCloseChecks: new EmptyRef(),
24511
24538
  modalHeaderDiv: void 0,
24539
+ modalBannerDiv: void 0,
24512
24540
  modalBodyDiv: void 0,
24513
24541
  modalFooterDiv: void 0,
24514
24542
  drawerContentStack: new EmptyRef(),
@@ -24520,6 +24548,7 @@ function BeamProvider({ children, documentTitleConfig, ...presentationProps }) {
24520
24548
  const [, tick] = (0, import_react129.useReducer)((prev) => prev + 1, 0);
24521
24549
  const modalRef = (0, import_react129.useRef)();
24522
24550
  const modalHeaderDiv = (0, import_react129.useMemo)(() => document.createElement("div"), []);
24551
+ const modalBannerDiv = (0, import_react129.useMemo)(() => document.createElement("div"), []);
24523
24552
  const modalBodyDiv = (0, import_react129.useMemo)(() => {
24524
24553
  const el = document.createElement("div");
24525
24554
  el.style.height = "100%";
@@ -24539,13 +24568,14 @@ function BeamProvider({ children, documentTitleConfig, ...presentationProps }) {
24539
24568
  // The rest we don't need to re-render when these are mutated, so just expose as-is
24540
24569
  modalCanCloseChecks: modalCanCloseChecksRef,
24541
24570
  modalHeaderDiv,
24571
+ modalBannerDiv,
24542
24572
  modalBodyDiv,
24543
24573
  modalFooterDiv,
24544
24574
  drawerCanCloseChecks,
24545
24575
  drawerCanCloseDetailsChecks,
24546
24576
  sdHeaderDiv
24547
24577
  };
24548
- }, [modalBodyDiv, modalFooterDiv, modalHeaderDiv, sdHeaderDiv]);
24578
+ }, [modalBannerDiv, modalBodyDiv, modalFooterDiv, modalHeaderDiv, sdHeaderDiv]);
24549
24579
  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
24580
  /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)(import_react_aria56.OverlayProvider, { children: [
24551
24581
  children,
@@ -28689,6 +28719,7 @@ function getInitialStep(steps, defaultStep) {
28689
28719
  Loader,
28690
28720
  LoadingSkeleton,
28691
28721
  MaxLines,
28722
+ ModalBanner,
28692
28723
  ModalBody,
28693
28724
  ModalFilterItem,
28694
28725
  ModalFooter,