@homebound/beam 3.85.0 → 3.85.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/README.md CHANGED
@@ -10,6 +10,8 @@ _To see the latest designs, check out the [Figma](https://www.figma.com/file/aWU
10
10
 
11
11
  Standard **app shell** composition (global nav + body, sidebar + content, page header + body) is implemented as **`NavbarLayout`**, **`SideNavLayout`**, and **`PageHeaderLayout`** from this package. Source lives in **`src/layouts/`** (sibling of `src/components/`). Full setup and composition rules: [`docs/layouts.md`](docs/layouts.md) — also published in the npm package at `node_modules/@homebound/beam/docs/layouts.md`.
12
12
 
13
+ Component file structure (imports, props types, implementation, module helpers): [`docs/components.md`](docs/components.md).
14
+
13
15
  ## Getting Started
14
16
 
15
17
  ```bash
package/dist/Css.json CHANGED
@@ -913,7 +913,7 @@
913
913
  "br24": {"kind":"static","defs":{"borderRadius":"24px"}},
914
914
  "brt4": {"kind":"static","defs":{"borderTopRightRadius":"4px","borderTopLeftRadius":"4px"}},
915
915
  "brb4": {"kind":"static","defs":{"borderBottomRightRadius":"4px","borderBottomLeftRadius":"4px"}},
916
- "layoutContainer": {"kind":"static","defs":{"width":"min(100%, calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)))","left":"var(--beam-side-nav-layout-width, 0px)","position":"sticky"}},
916
+ "layoutContainer": {"kind":"static","defs":{"width":"min(100%, calc(calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)) - 2 * var(--beam-layout-content-padding-x, 0px)))","left":"calc(var(--beam-side-nav-layout-width, 0px) + var(--beam-layout-content-padding-x, 0px))","position":"sticky"}},
917
917
  "transition": {"kind":"static","defs":{"transition":"background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), border-color 200ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1), left 200ms cubic-bezier(0.4, 0, 0.2, 1), right 200ms cubic-bezier(0.4, 0, 0.2, 1), margin 200ms cubic-bezier(0.4, 0, 0.2, 1), width 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
918
918
  "transitionWidth": {"kind":"static","defs":{"transition":"width 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
919
919
  "transitionOpacity": {"kind":"static","defs":{"transition":"opacity 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
package/dist/index.cjs CHANGED
@@ -213,6 +213,7 @@ __export(index_exports, {
213
213
  bannerAndNavbarChromeTop: () => bannerAndNavbarChromeTop,
214
214
  beamEnvironmentBannerLayoutHeightVar: () => beamEnvironmentBannerLayoutHeightVar,
215
215
  beamFloatingRightOffsetVar: () => beamFloatingRightOffsetVar,
216
+ beamLayoutContentPaddingXVar: () => beamLayoutContentPaddingXVar,
216
217
  beamLayoutViewportHeightVar: () => beamLayoutViewportHeightVar,
217
218
  beamLayoutViewportWidthVar: () => beamLayoutViewportWidthVar,
218
219
  beamNavbarLayoutHeightVar: () => beamNavbarLayoutHeightVar,
@@ -269,6 +270,8 @@ __export(index_exports, {
269
270
  defaultTestId: () => defaultTestId,
270
271
  documentScrollChromeLeft: () => documentScrollChromeLeft,
271
272
  documentScrollChromeWidth: () => documentScrollChromeWidth,
273
+ documentScrollContentLeft: () => documentScrollContentLeft,
274
+ documentScrollContentWidth: () => documentScrollContentWidth,
272
275
  documentScrollRightPaneHeight: () => documentScrollRightPaneHeight,
273
276
  documentScrollRightPaneWidth: () => documentScrollRightPaneWidth,
274
277
  dragHandleColumn: () => dragHandleColumn,
@@ -4274,12 +4277,15 @@ var CssBuilder = class _CssBuilder {
4274
4277
  return this.add("fontFamily", value);
4275
4278
  }
4276
4279
  // layoutContainer
4277
- /** Sets `width: "min(100%, calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)))"; left: "var(--beam-side-nav-layout-width, 0px)"; position: "sticky"`. */
4280
+ /** Sets `width: "min(100%, calc(calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)) - 2 * var(--beam-layout-content-padding-x, 0px)))"; left: "calc(var(--beam-side-nav-layout-width, 0px) + var(--beam-layout-content-padding-x, 0px))"; position: "sticky"`. */
4278
4281
  get layoutContainer() {
4279
4282
  return this.add(
4280
4283
  "width",
4281
- "min(100%, calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)))"
4282
- ).add("left", "var(--beam-side-nav-layout-width, 0px)").add("position", "sticky");
4284
+ "min(100%, calc(calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)) - 2 * var(--beam-layout-content-padding-x, 0px)))"
4285
+ ).add("left", "calc(var(--beam-side-nav-layout-width, 0px) + var(--beam-layout-content-padding-x, 0px))").add(
4286
+ "position",
4287
+ "sticky"
4288
+ );
4283
4289
  }
4284
4290
  // animation
4285
4291
  /** Sets `transition: "background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), border-color 200ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1), left 200ms cubic-bezier(0.4, 0, 0.2, 1), right 200ms cubic-bezier(0.4, 0, 0.2, 1), margin 200ms cubic-bezier(0.4, 0, 0.2, 1), width 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms cubic-bezier(0.4, 0, 0.2, 1)"`. */
@@ -6604,6 +6610,7 @@ var beamPageHeaderLayoutHeightVar = "--beam-page-header-layout-height";
6604
6610
  var beamLayoutViewportWidthVar = "--beam-layout-viewport-width";
6605
6611
  var beamLayoutViewportHeightVar = "--beam-layout-viewport-height";
6606
6612
  var beamSideNavLayoutWidthVar = "--beam-side-nav-layout-width";
6613
+ var beamLayoutContentPaddingXVar = "--beam-layout-content-padding-x";
6607
6614
  var beamTableActionsHeightVar = "--beam-table-actions-height";
6608
6615
  var beamRightPaneWidthVar = "--beam-right-pane-width";
6609
6616
  var beamFloatingRightOffsetVar = "--beam-floating-right-offset";
@@ -6614,6 +6621,12 @@ function documentScrollChromeLeft() {
6614
6621
  function documentScrollChromeWidth() {
6615
6622
  return `calc(var(${beamLayoutViewportWidthVar}, 100vw) - var(${beamSideNavLayoutWidthVar}, 0px))`;
6616
6623
  }
6624
+ function documentScrollContentLeft() {
6625
+ return `calc(${documentScrollChromeLeft()} + var(${beamLayoutContentPaddingXVar}, 0px))`;
6626
+ }
6627
+ function documentScrollContentWidth() {
6628
+ return `calc(${documentScrollChromeWidth()} - 2 * var(${beamLayoutContentPaddingXVar}, 0px))`;
6629
+ }
6617
6630
  function documentScrollRightPaneHeight() {
6618
6631
  return `calc(var(${beamLayoutViewportHeightVar}, 100vh) - ${stickyTableHeaderOffset()})`;
6619
6632
  }
@@ -7040,7 +7053,8 @@ function getTableRefWidthStyles(isVirtual, inDocumentScrollLayout = false) {
7040
7053
  return {
7041
7054
  width: ["w_var", {
7042
7055
  "--width": (0, import_runtime12.maybeCssVar)(__maybeInc4(`min(100%, ${documentScrollChromeWidth()})`))
7043
- }]
7056
+ }],
7057
+ minWidth: "mw0"
7044
7058
  };
7045
7059
  }
7046
7060
  if (isVirtual) {
@@ -16729,7 +16743,7 @@ function resolveTableContentWidth(tableWidth, columnSizes, minWidthPx = 0) {
16729
16743
  }
16730
16744
  const sum = sumColumnSizesPx(columnSizes, tableWidth);
16731
16745
  if (sum === null) return void 0;
16732
- return Math.max(tableWidth, sum, minWidthPx);
16746
+ return Math.max(minWidthPx, sum);
16733
16747
  }
16734
16748
  function calcColumnSizes(columns, tableWidth, tableMinWidthPx = 0, expandedColumnIds, resizedWidths) {
16735
16749
  const {
@@ -17913,6 +17927,9 @@ function GridTable(props) {
17913
17927
  columnGutter = false
17914
17928
  } = props;
17915
17929
  const inDocumentScrollLayout = useDocumentScrollLayout();
17930
+ const tid = useTestIds({
17931
+ "data-testid": id
17932
+ }, "gridTable");
17916
17933
  const columnsWithIds = (0, import_react88.useMemo)(() => {
17917
17934
  const columns2 = columnGutter && inDocumentScrollLayout ? withColumnGutters(_columns) : _columns;
17918
17935
  return assignDefaultColumnIds(columns2);
@@ -18173,7 +18190,7 @@ function GridTable(props) {
18173
18190
  return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridTableEmptyState, { ...emptyState });
18174
18191
  }
18175
18192
  return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TableStateContext.Provider, { value: rowStateContext, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(PresentationProvider, { fieldProps, wrap: style?.presentationSettings?.wrap, children: [
18176
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { ref: resizeRef, ...(0, import_runtime71.trussProps)(getTableRefWidthStyles(as === "virtual", inDocumentScrollLayout)) }),
18193
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { ref: resizeRef, ...(0, import_runtime71.trussProps)(getTableRefWidthStyles(as === "virtual", inDocumentScrollLayout)), ...tid.probe }),
18177
18194
  as === "card" ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(CardView, { cardRows: visibleDataRows, id, virtuosoRangeRef, infiniteScroll, persistScrollPosition }) : _as === "virtual" ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(VirtualGridTableView, { style: tableStyle, id, columns, visibleDataRows, keptSelectedRows, pinnedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, stickyOffset, infiniteScroll, persistScrollPosition }) : renders[_as](tableStyle, id, columns, visibleDataRows, keptSelectedRows, pinnedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, stickyOffset, infiniteScroll, tableContainerRef, persistScrollPosition)
18178
18195
  ] }) });
18179
18196
  }
@@ -24985,9 +25002,10 @@ function ContentHeader(props) {
24985
25002
  display: "df",
24986
25003
  flexDirection: "fdc",
24987
25004
  gap: "gap_12px",
24988
- width: "w_min_100_calc_var_beam_layout_viewport_width_100vw_var_beam_side_nav_layout_width_0px",
24989
- left: "l_var_beam_side_nav_layout_width_0px",
25005
+ width: "w_min_100_calc_calc_var_beam_layout_viewport_width_100vw_var_beam_side_nav_layout_width_0px_2_var_beam_layout_content_padding_x_0px",
25006
+ left: "l_calc_var_beam_side_nav_layout_width_0px_var_beam_layout_content_padding_x_0px",
24990
25007
  position: "sticky",
25008
+ minWidth: "mw0",
24991
25009
  backgroundColor: ["bgColor_var", {
24992
25010
  "--backgroundColor": "var(--b-surface)"
24993
25011
  }]
@@ -27338,9 +27356,8 @@ function SideNavLayoutContent(props) {
27338
27356
  // src/layouts/CenteredLayout/CenteredLayout.tsx
27339
27357
  var import_runtime139 = require("@homebound/truss/runtime");
27340
27358
  var import_jsx_runtime219 = require("react/jsx-runtime");
27341
- var centeredMaxWidthPx = {
27342
- sm: 768,
27343
- lg: 1440
27359
+ var __maybeInc28 = (inc) => {
27360
+ return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
27344
27361
  };
27345
27362
  function CenteredLayout(props) {
27346
27363
  const {
@@ -27348,22 +27365,48 @@ function CenteredLayout(props) {
27348
27365
  children
27349
27366
  } = props;
27350
27367
  const tid = useTestIds(props, "centeredLayout");
27351
- return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("div", { ...(0, import_runtime139.trussProps)({
27352
- width: "w100",
27353
- maxWidth: ["maxw_var", {
27354
- "--maxWidth": `${centeredMaxWidthPx[size]}px`
27355
- }],
27356
- marginLeft: "mla",
27357
- marginRight: "mra",
27358
- paddingLeft: "pl_12px mdandup_pl3",
27359
- paddingRight: "pr_12px mdandup_pr3"
27368
+ const {
27369
+ mdAndUp
27370
+ } = useBreakpoint();
27371
+ return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("div", { ...(0, import_runtime139.mergeProps)(void 0, {
27372
+ // layoutContainer descendants (e.g. ContentHeader) read this to inset sticky horizontal chrome within the shell padding.
27373
+ [beamLayoutContentPaddingXVar]: mdAndUp ? mdAndUpContentPaddingX : smContentPaddingX
27374
+ }, {
27375
+ ...{
27376
+ width: "w100",
27377
+ maxWidth: ["maxw_var", {
27378
+ "--maxWidth": `${centeredShellMaxPx[size]}px`
27379
+ }],
27380
+ marginLeft: "mla",
27381
+ marginRight: "mra"
27382
+ },
27383
+ ...centeredPaddingX
27360
27384
  }), ...tid, children });
27361
27385
  }
27386
+ var centeredContentMaxPx = {
27387
+ sm: 720,
27388
+ lg: 1392
27389
+ };
27390
+ var mdContentPaddingPx = parseInt(pageContentPaddingXValue, 10);
27391
+ var centeredShellMaxPx = {
27392
+ sm: centeredContentMaxPx.sm + mdContentPaddingPx * 2,
27393
+ lg: centeredContentMaxPx.lg + mdContentPaddingPx * 2
27394
+ };
27395
+ var smContentPaddingX = "12px";
27396
+ var mdAndUpContentPaddingX = pageContentPaddingXValue;
27397
+ var centeredPaddingX = {
27398
+ paddingLeft: ["px_var mdandup_pl3", {
27399
+ "--paddingLeft": (0, import_runtime139.maybeCssVar)(__maybeInc28(smContentPaddingX))
27400
+ }],
27401
+ paddingRight: ["px_var mdandup_pr3", {
27402
+ "--paddingRight": (0, import_runtime139.maybeCssVar)(__maybeInc28(smContentPaddingX))
27403
+ }]
27404
+ };
27362
27405
 
27363
27406
  // src/layouts/EnvironmentBannerLayout/EnvironmentBannerLayout.tsx
27364
27407
  var import_runtime140 = require("@homebound/truss/runtime");
27365
27408
  var import_jsx_runtime220 = require("react/jsx-runtime");
27366
- var __maybeInc28 = (inc) => {
27409
+ var __maybeInc29 = (inc) => {
27367
27410
  return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
27368
27411
  };
27369
27412
  function EnvironmentBannerLayout(props) {
@@ -27397,7 +27440,7 @@ function EnvironmentBannerLayout(props) {
27397
27440
  "--zIndex": (0, import_runtime140.maybeCssVar)(zIndices.environmentBanner)
27398
27441
  }],
27399
27442
  width: ["w_var", {
27400
- "--width": (0, import_runtime140.maybeCssVar)(__maybeInc28(innerWidth))
27443
+ "--width": (0, import_runtime140.maybeCssVar)(__maybeInc29(innerWidth))
27401
27444
  }]
27402
27445
  }), ...tid.bannerSticky, children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(EnvironmentBanner, { ...environmentBanner, ...tid.environmentBanner }) }) }),
27403
27446
  children
@@ -27566,7 +27609,7 @@ function useNavbarLayoutHeight() {
27566
27609
 
27567
27610
  // src/layouts/NavbarLayout/NavbarLayout.tsx
27568
27611
  var import_jsx_runtime223 = require("react/jsx-runtime");
27569
- var __maybeInc29 = (inc) => {
27612
+ var __maybeInc30 = (inc) => {
27570
27613
  return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
27571
27614
  };
27572
27615
  function NavbarLayout(props) {
@@ -27597,7 +27640,7 @@ function NavbarLayout(props) {
27597
27640
  "--zIndex": (0, import_runtime142.maybeCssVar)(zIndices.navbar)
27598
27641
  }],
27599
27642
  width: ["w_var", {
27600
- "--width": (0, import_runtime142.maybeCssVar)(__maybeInc29(innerWidth))
27643
+ "--width": (0, import_runtime142.maybeCssVar)(__maybeInc30(innerWidth))
27601
27644
  }]
27602
27645
  }
27603
27646
  ) : (
@@ -27609,7 +27652,7 @@ function NavbarLayout(props) {
27609
27652
  "--zIndex": (0, import_runtime142.maybeCssVar)(zIndices.navbar)
27610
27653
  }],
27611
27654
  width: ["w_var", {
27612
- "--width": (0, import_runtime142.maybeCssVar)(__maybeInc29(innerWidth))
27655
+ "--width": (0, import_runtime142.maybeCssVar)(__maybeInc30(innerWidth))
27613
27656
  }],
27614
27657
  transition: "transitionTop"
27615
27658
  }
@@ -27717,7 +27760,7 @@ function useBannerAndNavbarHeight() {
27717
27760
  // src/layouts/PageHeaderLayout/PageHeaderLayout.tsx
27718
27761
  var import_runtime145 = require("@homebound/truss/runtime");
27719
27762
  var import_jsx_runtime226 = require("react/jsx-runtime");
27720
- var __maybeInc30 = (inc) => {
27763
+ var __maybeInc31 = (inc) => {
27721
27764
  return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
27722
27765
  };
27723
27766
  function PageHeaderLayout(props) {
@@ -27747,10 +27790,10 @@ function PageHeaderLayout(props) {
27747
27790
  const innerCss = autoHideState === "static" ? {
27748
27791
  position: "sticky",
27749
27792
  left: ["left_var", {
27750
- "--left": (0, import_runtime145.maybeCssVar)(__maybeInc30(headerLeft))
27793
+ "--left": (0, import_runtime145.maybeCssVar)(__maybeInc31(headerLeft))
27751
27794
  }],
27752
27795
  width: ["w_var", {
27753
- "--width": (0, import_runtime145.maybeCssVar)(__maybeInc30(headerWidth))
27796
+ "--width": (0, import_runtime145.maybeCssVar)(__maybeInc31(headerWidth))
27754
27797
  }],
27755
27798
  zIndex: ["z_var", {
27756
27799
  "--zIndex": (0, import_runtime145.maybeCssVar)(zIndices.pageStickyHeader)
@@ -27758,10 +27801,10 @@ function PageHeaderLayout(props) {
27758
27801
  } : {
27759
27802
  position: "fixed",
27760
27803
  left: ["left_var", {
27761
- "--left": (0, import_runtime145.maybeCssVar)(__maybeInc30(headerLeft))
27804
+ "--left": (0, import_runtime145.maybeCssVar)(__maybeInc31(headerLeft))
27762
27805
  }],
27763
27806
  width: ["w_var", {
27764
- "--width": (0, import_runtime145.maybeCssVar)(__maybeInc30(headerWidth))
27807
+ "--width": (0, import_runtime145.maybeCssVar)(__maybeInc31(headerWidth))
27765
27808
  }],
27766
27809
  zIndex: ["z_var", {
27767
27810
  "--zIndex": (0, import_runtime145.maybeCssVar)(zIndices.pageStickyHeader)
@@ -27871,7 +27914,7 @@ function WorkflowActions(props) {
27871
27914
  // src/layouts/WorkflowLayout/WorkflowLayout.tsx
27872
27915
  var import_runtime146 = require("@homebound/truss/runtime");
27873
27916
  var import_jsx_runtime230 = require("react/jsx-runtime");
27874
- var __maybeInc31 = (inc) => {
27917
+ var __maybeInc32 = (inc) => {
27875
27918
  return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
27876
27919
  };
27877
27920
  function WorkflowLayout(props) {
@@ -27956,13 +27999,13 @@ function WorkflowLayout(props) {
27956
27999
  position: "sticky",
27957
28000
  left: "left0",
27958
28001
  width: ["w_var", {
27959
- "--width": (0, import_runtime146.maybeCssVar)(__maybeInc31(headerWidth))
28002
+ "--width": (0, import_runtime146.maybeCssVar)(__maybeInc32(headerWidth))
27960
28003
  }],
27961
28004
  zIndex: ["z_var", {
27962
28005
  "--zIndex": (0, import_runtime146.maybeCssVar)(zIndices.pageStickyHeader)
27963
28006
  }],
27964
28007
  top: ["top_var", {
27965
- "--top": (0, import_runtime146.maybeCssVar)(__maybeInc31(outerTop))
28008
+ "--top": (0, import_runtime146.maybeCssVar)(__maybeInc32(outerTop))
27966
28009
  }]
27967
28010
  }), ...tid.header, children: headerEl }),
27968
28011
  /* @__PURE__ */ (0, import_jsx_runtime230.jsx)("div", { className: "df fdc fg1 mh0 w100", ...tid.body, children: activeStep?.content }),
@@ -27977,7 +28020,7 @@ function WorkflowLayout(props) {
27977
28020
  position: "fixed",
27978
28021
  bottom: "bottom0",
27979
28022
  width: ["w_var", {
27980
- "--width": (0, import_runtime146.maybeCssVar)(__maybeInc31(headerWidth))
28023
+ "--width": (0, import_runtime146.maybeCssVar)(__maybeInc32(headerWidth))
27981
28024
  }],
27982
28025
  height: ["h_var", {
27983
28026
  "--height": `${mobileFooterHeightPx}px`
@@ -28196,6 +28239,7 @@ function getInitialStep(steps, defaultStep) {
28196
28239
  bannerAndNavbarChromeTop,
28197
28240
  beamEnvironmentBannerLayoutHeightVar,
28198
28241
  beamFloatingRightOffsetVar,
28242
+ beamLayoutContentPaddingXVar,
28199
28243
  beamLayoutViewportHeightVar,
28200
28244
  beamLayoutViewportWidthVar,
28201
28245
  beamNavbarLayoutHeightVar,
@@ -28252,6 +28296,8 @@ function getInitialStep(steps, defaultStep) {
28252
28296
  defaultTestId,
28253
28297
  documentScrollChromeLeft,
28254
28298
  documentScrollChromeWidth,
28299
+ documentScrollContentLeft,
28300
+ documentScrollContentWidth,
28255
28301
  documentScrollRightPaneHeight,
28256
28302
  documentScrollRightPaneWidth,
28257
28303
  dragHandleColumn,