@homebound/beam 3.57.0 → 3.58.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.js CHANGED
@@ -8966,7 +8966,7 @@ function RowImpl(props) {
8966
8966
  "--width": maybeCssVar13(__maybeInc6(`calc(${columnSizes.slice(columnIndex, columnIndex + currentColspan).join(" + ")}${applyFirstContentColumnStyles && levelIndent ? ` - ${levelIndent}px` : ""})`))
8967
8967
  }]
8968
8968
  },
8969
- // Gutter columns are budgeted at 12px; strip cell padding so flex min-content does not exceed that width.
8969
+ // Gutter columns are budgeted at pageContentGutterPx; strip cell padding so flex min-content does not exceed that width.
8970
8970
  ...column2.isLayoutGutter && {
8971
8971
  paddingLeft: "pl0",
8972
8972
  paddingRight: "pr0",
@@ -15430,6 +15430,22 @@ function SelectToggle({ id, disabled }) {
15430
15430
  );
15431
15431
  }
15432
15432
 
15433
+ // src/layouts/layoutSpacing.ts
15434
+ var pageContentGutterPx = 12;
15435
+ var pageContentPaddingX = {
15436
+ paddingLeft: "pl3",
15437
+ paddingRight: "pr3"
15438
+ };
15439
+ function headerContentPaddingX(compact = false) {
15440
+ return compact ? {
15441
+ paddingLeft: "pl1",
15442
+ paddingRight: "pr1"
15443
+ } : {
15444
+ paddingLeft: "pl1 mdandup_pl5",
15445
+ paddingRight: "pr1 mdandup_pr5"
15446
+ };
15447
+ }
15448
+
15433
15449
  // src/components/Table/utils/columns.tsx
15434
15450
  import { jsx as jsx90 } from "react/jsx-runtime";
15435
15451
  function column(columnDef) {
@@ -15536,7 +15552,6 @@ function pinColumn(columnDef) {
15536
15552
  });
15537
15553
  });
15538
15554
  }
15539
- var columnGutterPx = 12;
15540
15555
  var layoutGutterLeftColumnId = "beamLayoutGutterLeft";
15541
15556
  var layoutGutterRightColumnId = "beamLayoutGutterRight";
15542
15557
  function isContentColumn(column2) {
@@ -15548,7 +15563,7 @@ function layoutGutterColumn(side) {
15548
15563
  ...nonKindDefaults(),
15549
15564
  id,
15550
15565
  clientSideSort: false,
15551
- w: `${columnGutterPx}px`,
15566
+ w: `${pageContentGutterPx}px`,
15552
15567
  wrapAction: false,
15553
15568
  isLayoutGutter: true,
15554
15569
  canHide: false,
@@ -20841,12 +20856,7 @@ function FilterPanelOpen({
20841
20856
  ...{
20842
20857
  flexWrap: "mdandup_fww"
20843
20858
  },
20844
- ...{
20845
- ...inDocumentScrollLayout ? {
20846
- paddingLeft: "pl3",
20847
- paddingRight: "pr3"
20848
- } : {}
20849
- }
20859
+ ...inDocumentScrollLayout ? pageContentPaddingX : void 0
20850
20860
  }), children: [
20851
20861
  groupBy && /* @__PURE__ */ jsx156(GroupByField, { ...groupBy }),
20852
20862
  filterControls,
@@ -20979,14 +20989,13 @@ function GridTableLayoutActionsComponent(props) {
20979
20989
  } : {}
20980
20990
  }), children: [
20981
20991
  /* @__PURE__ */ jsxs75("div", { ...trussProps78({
20982
- display: "df",
20983
- gap: "gap1",
20984
- justifyContent: "jcsb",
20985
- paddingTop: "pt3",
20986
- ...inDocumentScrollLayout ? {
20987
- paddingLeft: "pl3",
20988
- paddingRight: "pr3"
20989
- } : {}
20992
+ ...{
20993
+ display: "df",
20994
+ gap: "gap1",
20995
+ justifyContent: "jcsb",
20996
+ paddingTop: "pt3"
20997
+ },
20998
+ ...inDocumentScrollLayout ? pageContentPaddingX : void 0
20990
20999
  }), children: [
20991
21000
  /* @__PURE__ */ jsxs75("div", { className: "df gap_12px aic", children: [
20992
21001
  !sm && hasSearch && /* @__PURE__ */ jsx157("div", { className: "w_244px", children: searchTextField }),
@@ -21006,7 +21015,7 @@ function GridTableLayoutActionsComponent(props) {
21006
21015
  } })
21007
21016
  ] })
21008
21017
  ] }),
21009
- sm && showSearch && /* @__PURE__ */ jsx157("div", { className: "pl3 pr3", children: searchTextField }),
21018
+ sm && showSearch && /* @__PURE__ */ jsx157("div", { ...trussProps78(pageContentPaddingX), children: searchTextField }),
21010
21019
  hasFilterControls && !showInlineControl && /* @__PURE__ */ jsx157(FilterPanel, { isOpen: showFilters, groupBy, filterImpls, filter, setFilter, onClear: clearFilters })
21011
21020
  ] });
21012
21021
  }
@@ -22568,7 +22577,17 @@ function EnvironmentBanner(props) {
22568
22577
  }), role: "banner", ...tid, children: [
22569
22578
  getInvertedCorner("left", bgColorVar),
22570
22579
  getInvertedCorner("right", bgColorVar),
22571
- /* @__PURE__ */ jsxs86("div", { className: "relative z2 df aic jcsb h100 pl1 mdandup_pl5 pr1 mdandup_pr5", ...tid.content, children: [
22580
+ /* @__PURE__ */ jsxs86("div", { ...trussProps89({
22581
+ ...{
22582
+ position: "relative",
22583
+ zIndex: "z2",
22584
+ display: "df",
22585
+ alignItems: "aic",
22586
+ justifyContent: "jcsb",
22587
+ height: "h100"
22588
+ },
22589
+ ...headerContentPaddingX()
22590
+ }), ...tid.content, children: [
22572
22591
  /* @__PURE__ */ jsxs86("span", { className: "df aic gap2 fg1 mh0 oh", ...tid.left, children: [
22573
22592
  /* @__PURE__ */ jsx176(Tag, { text: badgeLabel, xss: {
22574
22593
  backgroundColor: "bgColor_FFFFFF90"
@@ -23565,24 +23584,36 @@ function NavbarMobileDrawer({
23565
23584
  duration: 0.2
23566
23585
  }, onClick: (e) => e.stopPropagation(), ...tid.mobileMenuDrawer, children: [
23567
23586
  /* @__PURE__ */ jsx189("div", { ...trussProps98({
23568
- display: "df",
23569
- alignItems: "aic",
23570
- justifyContent: "jcfe",
23571
- paddingLeft: "pl3",
23572
- paddingRight: "pr3",
23573
- paddingTop: "pt_12px",
23574
- paddingBottom: "pb_12px",
23575
- flexShrink: "fs0",
23576
- borderBottomStyle: "bbs_solid",
23577
- borderBottomWidth: "bbw_1px",
23578
- borderColor: ["bc_var", {
23579
- "--borderColor": "var(--b-surface-separator)"
23580
- }]
23587
+ ...{
23588
+ display: "df",
23589
+ alignItems: "aic",
23590
+ justifyContent: "jcfe",
23591
+ paddingTop: "pt_12px",
23592
+ paddingBottom: "pb_12px",
23593
+ flexShrink: "fs0",
23594
+ borderBottomStyle: "bbs_solid",
23595
+ borderBottomWidth: "bbw_1px",
23596
+ borderColor: ["bc_var", {
23597
+ "--borderColor": "var(--b-surface-separator)"
23598
+ }]
23599
+ },
23600
+ ...pageContentPaddingX
23581
23601
  }), children: /* @__PURE__ */ jsx189(IconButton, { icon: "x", color: "--b-on-surface-muted" /* OnSurfaceMuted */, label: "Close navigation", onClick: onClose, ...tid.mobileMenuClose }) }),
23582
23602
  /* @__PURE__ */ jsx189(
23583
23603
  "nav",
23584
23604
  {
23585
- className: "fg1 oya pl3 pr3 pb3 pt2 df fdc gap_4px",
23605
+ ...trussProps98({
23606
+ ...{
23607
+ flexGrow: "fg1",
23608
+ overflowY: "oya",
23609
+ paddingBottom: "pb3",
23610
+ paddingTop: "pt2",
23611
+ display: "df",
23612
+ flexDirection: "fdc",
23613
+ gap: "gap_4px"
23614
+ },
23615
+ ...pageContentPaddingX
23616
+ }),
23586
23617
  onClickCapture: (e) => {
23587
23618
  if (e.target.closest("a")) {
23588
23619
  onClose();
@@ -23618,23 +23649,20 @@ function Navbar(props) {
23618
23649
  } = useContentOverflow(!sm);
23619
23650
  const showMobile = sm || overflows;
23620
23651
  return /* @__PURE__ */ jsx190(ContrastScope, { children: /* @__PURE__ */ jsxs93("nav", { ...trussProps99({
23621
- backgroundColor: ["bgColor_var", {
23622
- "--backgroundColor": "var(--b-surface-raised)"
23623
- }],
23624
- flexShrink: "fs0",
23625
- display: "df",
23626
- alignItems: "aic",
23627
- justifyContent: "jcsb",
23628
- whiteSpace: "wsnw",
23629
- paddingLeft: "pl1",
23630
- paddingRight: "pr1",
23631
- paddingTop: "pt1",
23632
- paddingBottom: "pb1",
23633
- gap: "gap2",
23634
- ...!showMobile ? {
23635
- paddingLeft: "pl5",
23636
- paddingRight: "pr5"
23637
- } : {}
23652
+ ...{
23653
+ backgroundColor: ["bgColor_var", {
23654
+ "--backgroundColor": "var(--b-surface-raised)"
23655
+ }],
23656
+ flexShrink: "fs0",
23657
+ display: "df",
23658
+ alignItems: "aic",
23659
+ justifyContent: "jcsb",
23660
+ whiteSpace: "wsnw",
23661
+ paddingTop: "pt1",
23662
+ paddingBottom: "pb1",
23663
+ gap: "gap2"
23664
+ },
23665
+ ...headerContentPaddingX(showMobile)
23638
23666
  }), ...tid, children: [
23639
23667
  /* @__PURE__ */ jsxs93("div", { className: "df aic gap3 fg1 mw0", children: [
23640
23668
  /* @__PURE__ */ jsxs93("div", { className: "df aic fs0 gap2", children: [
@@ -25406,10 +25434,9 @@ function BaseHeader(props) {
25406
25434
  display: "df",
25407
25435
  justifyContent: "jcsb",
25408
25436
  width: "w100",
25409
- gap: "gap1",
25410
- paddingLeft: "pl3",
25411
- paddingRight: "pr3"
25437
+ gap: "gap1"
25412
25438
  },
25439
+ ...pageContentPaddingX,
25413
25440
  ...{
25414
25441
  ...!bottomSlot ? {
25415
25442
  marginBottom: "mb2"
@@ -25427,6 +25454,7 @@ function BaseHeader(props) {
25427
25454
  }
25428
25455
 
25429
25456
  // src/components/Headers/PageHeader.tsx
25457
+ import { trussProps as trussProps110 } from "@homebound/truss/runtime";
25430
25458
  import { jsx as jsx209 } from "react/jsx-runtime";
25431
25459
  function PageHeader2(props) {
25432
25460
  const {
@@ -25434,7 +25462,7 @@ function PageHeader2(props) {
25434
25462
  ...otherProps
25435
25463
  } = props;
25436
25464
  const tid = useTestIds(otherProps, "header");
25437
- return /* @__PURE__ */ jsx209(BaseHeader, { ...otherProps, bottomSlot: tabs && /* @__PURE__ */ jsx209("div", { className: "pl3 pr3", children: /* @__PURE__ */ jsx209(Tabs, { ...tabs, ...tid.tabs }) }) });
25465
+ return /* @__PURE__ */ jsx209(BaseHeader, { ...otherProps, bottomSlot: tabs && /* @__PURE__ */ jsx209("div", { ...trussProps110(pageContentPaddingX), children: /* @__PURE__ */ jsx209(Tabs, { ...tabs, ...tid.tabs }) }) });
25438
25466
  }
25439
25467
 
25440
25468
  // src/layouts/useBannerAndNavbarHeight.ts
@@ -25516,7 +25544,7 @@ function PageHeaderLayout(props) {
25516
25544
  }
25517
25545
 
25518
25546
  // src/layouts/WorkflowLayout/WorkflowLayout.tsx
25519
- import { useCallback as useCallback40, useLayoutEffect as useLayoutEffect10, useRef as useRef67 } from "react";
25547
+ import { useCallback as useCallback40, useLayoutEffect as useLayoutEffect10, useRef as useRef67, useState as useState59 } from "react";
25520
25548
 
25521
25549
  // src/components/Headers/WorkflowHeader.tsx
25522
25550
  import { jsx as jsx211 } from "react/jsx-runtime";
@@ -25538,36 +25566,40 @@ function WorkflowActions(props) {
25538
25566
  onSaveAndExit,
25539
25567
  completeLabel,
25540
25568
  onComplete,
25541
- onContinue
25569
+ onContinue,
25570
+ primaryDisabled
25542
25571
  } = props;
25543
25572
  return /* @__PURE__ */ jsxs109("div", { className: "df aic jcsb sm_w100", children: [
25544
25573
  /* @__PURE__ */ jsx212("div", { className: "df aic", children: !isFirstStep && (isMobile ? /* @__PURE__ */ jsx212(IconButton, { icon: "arrowBack", label: "Back", onClick: onBack }) : /* @__PURE__ */ jsx212(Button, { label: "Back", icon: "chevronLeft", variant: "tertiary", onClick: onBack })) }),
25545
25574
  /* @__PURE__ */ jsxs109("div", { className: "df aic gap1", children: [
25546
25575
  /* @__PURE__ */ jsx212(Button, { label: "Cancel", variant: "quaternary", onClick: onCancel }),
25547
25576
  onSaveAndExit && /* @__PURE__ */ jsx212(Button, { label: "Save & Exit", variant: "secondary", onClick: onSaveAndExit }),
25548
- isLastStep ? /* @__PURE__ */ jsx212(Button, { label: completeLabel, variant: "primary", onClick: onComplete }) : /* @__PURE__ */ jsx212(Button, { label: "Continue", variant: "primary", onClick: onContinue })
25577
+ isLastStep ? /* @__PURE__ */ jsx212(Button, { label: completeLabel, variant: "primary", onClick: onComplete, disabled: primaryDisabled }) : /* @__PURE__ */ jsx212(Button, { label: "Continue", variant: "primary", onClick: onContinue, disabled: primaryDisabled })
25549
25578
  ] })
25550
25579
  ] });
25551
25580
  }
25552
25581
 
25553
25582
  // src/layouts/WorkflowLayout/WorkflowLayout.tsx
25554
- import { trussProps as trussProps110, mergeProps as mergeProps37, maybeCssVar as maybeCssVar61 } from "@homebound/truss/runtime";
25583
+ import { trussProps as trussProps111, mergeProps as mergeProps37, maybeCssVar as maybeCssVar61 } from "@homebound/truss/runtime";
25555
25584
  import { jsx as jsx213, jsxs as jsxs110 } from "react/jsx-runtime";
25556
25585
  var __maybeInc26 = (inc) => {
25557
25586
  return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
25558
25587
  };
25559
25588
  function WorkflowLayout(props) {
25560
25589
  const {
25561
- children
25562
- } = props;
25563
- const {
25564
- stepperTabs,
25590
+ steps,
25591
+ defaultStep,
25565
25592
  onCancel,
25566
25593
  completeLabel,
25567
25594
  onComplete,
25568
25595
  onSaveAndExit,
25569
25596
  ...headerProps
25570
- } = props.workflowHeader;
25597
+ } = props;
25598
+ const tabSteps = steps.map((step) => ({
25599
+ ...step,
25600
+ value: defaultTestId(step.label)
25601
+ }));
25602
+ const [currentStep, setCurrentStep] = useState59(() => getInitialStep(tabSteps, defaultStep));
25571
25603
  const tid = useTestIds(props, "workflowLayout");
25572
25604
  const {
25573
25605
  sm: isMobile
@@ -25588,15 +25620,11 @@ function WorkflowLayout(props) {
25588
25620
  const cssVars = headerHeight > 0 ? {
25589
25621
  [beamPageHeaderLayoutHeightVar]: `${headerHeight}px`
25590
25622
  } : void 0;
25591
- const {
25592
- steps,
25593
- currentStep,
25594
- onChange
25595
- } = stepperTabs;
25596
- const currentIndex = steps.findIndex((step) => step.value === currentStep);
25623
+ const currentIndex = isValidStep(tabSteps, currentStep) ? tabSteps.findIndex((step) => step.value === currentStep) : 0;
25597
25624
  const isFirstStep = currentIndex <= 0;
25598
- const isLastStep = currentIndex === steps.length - 1;
25599
- const buttons = /* @__PURE__ */ jsx213(WorkflowActions, { isFirstStep, isLastStep, isMobile, onBack: () => onChange(steps[currentIndex - 1].value), onCancel, onSaveAndExit, completeLabel, onComplete, onContinue: () => onChange(steps[currentIndex + 1].value) });
25625
+ const isLastStep = currentIndex === tabSteps.length - 1;
25626
+ const activeStep = tabSteps[currentIndex];
25627
+ const buttons = /* @__PURE__ */ jsx213(WorkflowActions, { isFirstStep, isLastStep, isMobile, onBack: () => setCurrentStep(tabSteps[currentIndex - 1].value), onCancel, onSaveAndExit, completeLabel, onComplete, primaryDisabled: !activeStep?.completed, onContinue: () => setCurrentStep(tabSteps[currentIndex + 1].value) });
25600
25628
  const showFooter = isMobile;
25601
25629
  useLayoutEffect10(() => {
25602
25630
  const root = document.documentElement;
@@ -25611,7 +25639,9 @@ function WorkflowLayout(props) {
25611
25639
  };
25612
25640
  }, [showFooter]);
25613
25641
  const headerEl = /* @__PURE__ */ jsx213(WorkflowHeader, { ...headerProps, rightSlot: isMobile ? void 0 : buttons, stepperTabs: {
25614
- ...stepperTabs,
25642
+ steps: tabSteps,
25643
+ currentStep,
25644
+ onChange: setCurrentStep,
25615
25645
  collapsed
25616
25646
  } });
25617
25647
  return /* @__PURE__ */ jsx213(DocumentScrollLayoutProvider, { children: /* @__PURE__ */ jsxs110("div", { ...mergeProps37(void 0, cssVars, {
@@ -25624,7 +25654,7 @@ function WorkflowLayout(props) {
25624
25654
  }, {
25625
25655
  flexShrink: "fs0",
25626
25656
  width: "w100"
25627
- }), ...tid.spacer, children: /* @__PURE__ */ jsx213("div", { ref: headerMetricsRef, ...trussProps110({
25657
+ }), ...tid.spacer, children: /* @__PURE__ */ jsx213("div", { ref: headerMetricsRef, ...trussProps111({
25628
25658
  position: "fixed",
25629
25659
  width: ["w_var", {
25630
25660
  "--width": maybeCssVar61(__maybeInc26(headerWidth))
@@ -25636,44 +25666,51 @@ function WorkflowLayout(props) {
25636
25666
  "--top": maybeCssVar61(__maybeInc26(outerTop))
25637
25667
  }]
25638
25668
  }), ...tid.header, children: headerEl }) }),
25639
- /* @__PURE__ */ jsx213("div", { className: "df fdc fg1 mh0 w100", ...tid.body, children }),
25640
- showFooter && /* @__PURE__ */ jsx213("div", { ...trussProps110({
25669
+ /* @__PURE__ */ jsx213("div", { className: "df fdc fg1 mh0 w100", ...tid.body, children: activeStep?.content }),
25670
+ showFooter && /* @__PURE__ */ jsx213("div", { ...trussProps111({
25641
25671
  flexShrink: "fs0",
25642
25672
  width: "w100",
25643
25673
  height: ["h_var", {
25644
25674
  "--height": `${mobileFooterHeightPx}px`
25645
25675
  }]
25646
25676
  }) }),
25647
- showFooter && /* @__PURE__ */ jsx213("div", { ...trussProps110({
25648
- position: "fixed",
25649
- bottom: "bottom0",
25650
- width: ["w_var", {
25651
- "--width": maybeCssVar61(__maybeInc26(headerWidth))
25652
- }],
25653
- height: ["h_var", {
25654
- "--height": `${mobileFooterHeightPx}px`
25655
- }],
25656
- zIndex: ["z_var", {
25657
- "--zIndex": maybeCssVar61(zIndices.pageStickyFooter)
25658
- }],
25659
- display: "df",
25660
- alignItems: "aic",
25661
- justifyContent: "jcfe",
25662
- gap: "gap1",
25663
- paddingLeft: "pl3",
25664
- paddingRight: "pr3",
25665
- borderTopStyle: "bts_solid",
25666
- borderTopWidth: "btw_1px",
25667
- borderColor: ["bc_var", {
25668
- "--borderColor": "var(--b-surface-separator)"
25669
- }],
25670
- backgroundColor: ["bgColor_var", {
25671
- "--backgroundColor": "var(--b-surface)"
25672
- }]
25677
+ showFooter && /* @__PURE__ */ jsx213("div", { ...trussProps111({
25678
+ ...{
25679
+ position: "fixed",
25680
+ bottom: "bottom0",
25681
+ width: ["w_var", {
25682
+ "--width": maybeCssVar61(__maybeInc26(headerWidth))
25683
+ }],
25684
+ height: ["h_var", {
25685
+ "--height": `${mobileFooterHeightPx}px`
25686
+ }],
25687
+ zIndex: ["z_var", {
25688
+ "--zIndex": maybeCssVar61(zIndices.pageStickyFooter)
25689
+ }],
25690
+ display: "df",
25691
+ alignItems: "aic",
25692
+ justifyContent: "jcfe",
25693
+ gap: "gap1",
25694
+ borderTopStyle: "bts_solid",
25695
+ borderTopWidth: "btw_1px",
25696
+ borderColor: ["bc_var", {
25697
+ "--borderColor": "var(--b-surface-separator)"
25698
+ }],
25699
+ backgroundColor: ["bgColor_var", {
25700
+ "--backgroundColor": "var(--b-surface)"
25701
+ }]
25702
+ },
25703
+ ...pageContentPaddingX
25673
25704
  }), ...tid.footer, children: buttons })
25674
25705
  ] }) });
25675
25706
  }
25676
25707
  var mobileFooterHeightPx = 80;
25708
+ function isValidStep(steps, value) {
25709
+ return steps.some((step) => step.value === value);
25710
+ }
25711
+ function getInitialStep(steps, defaultStep) {
25712
+ return defaultStep !== void 0 && isValidStep(steps, defaultStep) ? defaultStep : steps[0]?.value;
25713
+ }
25677
25714
  export {
25678
25715
  ASC,
25679
25716
  Accordion,
@@ -25921,6 +25958,7 @@ export {
25921
25958
  getNavLinkStyles,
25922
25959
  getTableRefWidthStyles,
25923
25960
  getTableStyles,
25961
+ headerContentPaddingX,
25924
25962
  headerRenderFn,
25925
25963
  hoverStyles,
25926
25964
  increment,
@@ -25950,6 +25988,8 @@ export {
25950
25988
  nonKindGridColumnKeys,
25951
25989
  numberRangeFilter,
25952
25990
  numericColumn,
25991
+ pageContentGutterPx,
25992
+ pageContentPaddingX,
25953
25993
  parseDate,
25954
25994
  parseDateRange,
25955
25995
  parseWidthToPx,