@homebound/beam 3.47.2 → 3.47.3

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
@@ -10873,11 +10873,13 @@ function NavLink(props) {
10873
10873
  active,
10874
10874
  variant,
10875
10875
  icon,
10876
+ nested = false,
10877
+ __storyState,
10876
10878
  ...otherProps
10877
10879
  } = props;
10878
10880
  const asLink = typeof onClick === "string";
10879
10881
  const isIconOnly = !!iconOnly && !!icon;
10880
- const labelContent = isIconOnly ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "absolute oh cli_inset_50 clp_none bd_0 h_1px m_neg1px w_1px p_0 wsnw o0", children: label }) : label;
10882
+ const labelContent = isIconOnly ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_aria13.VisuallyHidden, { children: label }) : label;
10881
10883
  const ariaProps = {
10882
10884
  children: labelContent,
10883
10885
  isDisabled,
@@ -10886,7 +10888,7 @@ function NavLink(props) {
10886
10888
  const ref = useGetRef(buttonRef);
10887
10889
  const {
10888
10890
  buttonProps,
10889
- isPressed
10891
+ isPressed: isPressedFromEvents
10890
10892
  } = (0, import_react_aria13.useButton)({
10891
10893
  ...ariaProps,
10892
10894
  onPress: asLink ? noop : (e) => {
@@ -10900,14 +10902,17 @@ function NavLink(props) {
10900
10902
  }, ref);
10901
10903
  const {
10902
10904
  hoverProps,
10903
- isHovered
10905
+ isHovered: isHoveredFromEvents
10904
10906
  } = (0, import_react_aria13.useHover)({
10905
10907
  isDisabled
10906
10908
  });
10907
10909
  const {
10908
- isFocusVisible,
10910
+ isFocusVisible: isFocusVisibleFromEvents,
10909
10911
  focusProps
10910
10912
  } = (0, import_react_aria13.useFocusRing)(ariaProps);
10913
+ const isPressed = __storyState?.pressed ?? isPressedFromEvents;
10914
+ const isHovered = __storyState?.hovered ?? isHoveredFromEvents;
10915
+ const isFocusVisible = __storyState?.focusVisible ?? isFocusVisibleFromEvents;
10911
10916
  const {
10912
10917
  baseStyles: baseStyles4,
10913
10918
  activeStyles: activeStyles3,
@@ -10915,7 +10920,7 @@ function NavLink(props) {
10915
10920
  hoverStyles: hoverStyles4,
10916
10921
  disabledStyles: disabledStyles3,
10917
10922
  pressedStyles: pressedStyles2
10918
- } = (0, import_react38.useMemo)(() => getNavLinkStyles(variant), [variant]);
10923
+ } = (0, import_react38.useMemo)(() => getNavLinkStyles(variant, nested), [variant, nested]);
10919
10924
  const linkAttributes = {
10920
10925
  ref,
10921
10926
  /** does not focus if disabled */
@@ -10944,22 +10949,34 @@ function NavLink(props) {
10944
10949
  className: navLink
10945
10950
  }, otherProps), openInNew);
10946
10951
  }
10947
- function getNavLinkStyles(variant) {
10948
- return navLinkVariantStyles[variant];
10952
+ function getNavLinkStyles(variant, nested) {
10953
+ const styles = navLinkVariantStyles[variant];
10954
+ return {
10955
+ ...styles,
10956
+ baseStyles: {
10957
+ ...styles.baseStyles,
10958
+ ...nested ? {
10959
+ paddingLeft: "pl3",
10960
+ fontWeight: "fw4",
10961
+ fontSize: "fz_14px",
10962
+ lineHeight: "lh_20px"
10963
+ } : {
10964
+ fontWeight: "fw6",
10965
+ fontSize: "fz_14px",
10966
+ lineHeight: "lh_20px"
10967
+ }
10968
+ }
10969
+ };
10949
10970
  }
10950
10971
  var baseStyles = {
10951
10972
  display: "df",
10952
10973
  gap: "gap1",
10953
10974
  alignItems: "aic",
10954
- height: "h_32px",
10955
10975
  paddingTop: "pt_6px",
10956
10976
  paddingBottom: "pb_6px",
10957
10977
  paddingLeft: "pl1",
10958
10978
  paddingRight: "pr1",
10959
10979
  borderRadius: "br4",
10960
- fontWeight: "fw6",
10961
- fontSize: "fz_14px",
10962
- lineHeight: "lh_20px",
10963
10980
  outline: "outline0"
10964
10981
  };
10965
10982
  var navLinkVariantStyles = {
@@ -10967,12 +10984,15 @@ var navLinkVariantStyles = {
10967
10984
  baseStyles: {
10968
10985
  ...baseStyles,
10969
10986
  ...{
10987
+ height: "h_40px",
10988
+ flexShrink: "fs0",
10970
10989
  color: ["color_var", {
10971
10990
  "--color": "var(--b-nav-text)"
10972
10991
  }]
10973
10992
  }
10974
10993
  },
10975
10994
  activeStyles: {
10995
+ fontWeight: "fw6",
10976
10996
  color: ["color_var", {
10977
10997
  "--color": "var(--b-nav-text-active)"
10978
10998
  }],
@@ -10987,12 +11007,6 @@ var navLinkVariantStyles = {
10987
11007
  cursor: "cursorNotAllowed"
10988
11008
  },
10989
11009
  focusRingStyles: {
10990
- color: ["color_var", {
10991
- "--color": "var(--b-nav-text-focus-visible)"
10992
- }],
10993
- backgroundColor: ["bgColor_var", {
10994
- "--backgroundColor": "var(--b-nav-item-bg-active)"
10995
- }],
10996
11010
  boxShadow: "bshFocus"
10997
11011
  },
10998
11012
  hoverStyles: {
@@ -11016,6 +11030,7 @@ var navLinkVariantStyles = {
11016
11030
  baseStyles: {
11017
11031
  ...baseStyles,
11018
11032
  ...{
11033
+ height: "h_32px",
11019
11034
  width: "width_max_content",
11020
11035
  color: "gray500"
11021
11036
  }
@@ -23358,7 +23373,8 @@ function AppNavGroupTrigger(props) {
23358
23373
  label,
23359
23374
  navGroupId,
23360
23375
  expanded,
23361
- onClick
23376
+ onClick,
23377
+ active = false
23362
23378
  } = props;
23363
23379
  const tid = useTestIds(props, "trigger");
23364
23380
  const ref = (0, import_react131.useRef)(null);
@@ -23391,11 +23407,17 @@ function AppNavGroupTrigger(props) {
23391
23407
  ...baseStyles4,
23392
23408
  ...isFocusVisible && focusRingStyles2,
23393
23409
  ...isHovered && hoverStyles4,
23394
- ...isPressed && pressedStyles2
23410
+ ...isPressed && pressedStyles2,
23411
+ // Denotes the active group (has a current-page child link)
23412
+ ...active && {
23413
+ color: ["color_var", {
23414
+ "--color": "var(--b-nav-text-active)"
23415
+ }]
23416
+ }
23395
23417
  })
23396
23418
  }), children: [
23397
23419
  label,
23398
- /* @__PURE__ */ (0, import_jsx_runtime180.jsx)("span", { ...(0, import_runtime103.trussProps)({
23420
+ /* @__PURE__ */ (0, import_jsx_runtime180.jsx)("div", { ...(0, import_runtime103.trussProps)({
23399
23421
  ...{
23400
23422
  display: "df",
23401
23423
  alignItems: "aic",
@@ -23592,14 +23614,16 @@ function AppNavGroupDisclosure(props) {
23592
23614
  onResize
23593
23615
  });
23594
23616
  return /* @__PURE__ */ (0, import_jsx_runtime181.jsxs)("div", { className: "df fdc", ...tid, children: [
23595
- /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(AppNavGroupTrigger, { label: linkGroup.label, navGroupId, expanded, onClick: onToggle, ...tid }),
23617
+ /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(AppNavGroupTrigger, { label: linkGroup.label, navGroupId, expanded, active: linkGroupHasActiveLink(linkGroup), onClick: onToggle, ...tid }),
23596
23618
  /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("div", { id: navGroupId, role: "region", "aria-hidden": !expanded, ...(0, import_runtime104.trussProps)({
23597
23619
  overflow: "oh",
23598
23620
  transition: "transitionHeight",
23599
23621
  height: ["h_var", {
23600
23622
  "--height": (0, import_runtime104.maybeCssVar)(__maybeInc19(contentHeight))
23601
23623
  }]
23602
- }), ...tid.panel, children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("div", { ref: setContentEl, className: "df fdc pl2", children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(AppNavItems, { items: linkGroup.items, panelCollapsed: false, ...tid }) }) })
23624
+ }), ...tid.panel, ...!expanded ? {
23625
+ inert: "true"
23626
+ } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("div", { ref: setContentEl, className: "df fdc", children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(AppNavItems, { items: linkGroup.items, panelCollapsed: false, nested: true, ...tid }) }) })
23603
23627
  ] });
23604
23628
  }
23605
23629
 
@@ -23632,6 +23656,7 @@ function AppNavSectionView(props) {
23632
23656
  section,
23633
23657
  variant,
23634
23658
  panelCollapsed,
23659
+ nested = false,
23635
23660
  showDivider,
23636
23661
  ...scopeProps
23637
23662
  } = props;
@@ -23644,7 +23669,7 @@ function AppNavSectionView(props) {
23644
23669
  "--borderColor": "var(--b-surface-separator)"
23645
23670
  }]
23646
23671
  } : {
23647
- paddingBottom: "pb2",
23672
+ paddingBottom: "pb_4px",
23648
23673
  borderBottomStyle: "bbs_solid",
23649
23674
  borderBottomWidth: "bbw_1px",
23650
23675
  borderColor: ["bc_var", {
@@ -23655,7 +23680,7 @@ function AppNavSectionView(props) {
23655
23680
  ...{
23656
23681
  display: "df",
23657
23682
  flexDirection: "fdc",
23658
- paddingTop: "pt2"
23683
+ paddingTop: "pt_4px"
23659
23684
  },
23660
23685
  ...showDivider ? dividerStyles : {}
23661
23686
  }), ...tid, children: [
@@ -23668,17 +23693,18 @@ function AppNavSectionView(props) {
23668
23693
  }],
23669
23694
  paddingLeft: "pl1",
23670
23695
  paddingRight: "pr1",
23696
+ paddingTop: "pt1",
23671
23697
  paddingBottom: "pb1",
23672
23698
  textTransform: "ttu"
23673
23699
  }), ...tid.label, children: section.label }),
23674
- /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(AppNavItems, { ...scopeProps, items: section.items, variant, panelCollapsed })
23700
+ /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(AppNavItems, { ...scopeProps, items: section.items, variant, panelCollapsed, nested })
23675
23701
  ] });
23676
23702
  }
23677
23703
 
23678
23704
  // src/components/AppNav/AppNavItems.tsx
23679
23705
  var import_jsx_runtime184 = require("react/jsx-runtime");
23680
23706
  function AppNavItems(props) {
23681
- const { items, variant = "side", panelCollapsed = false } = props;
23707
+ const { items, variant = "side", panelCollapsed = false, nested = false } = props;
23682
23708
  const tid = useTestIds(props, "appNav");
23683
23709
  return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(import_jsx_runtime184.Fragment, { children: items.map((item, idx) => {
23684
23710
  if (isAppNavLink(item)) {
@@ -23687,6 +23713,7 @@ function AppNavItems(props) {
23687
23713
  {
23688
23714
  variant,
23689
23715
  ...item,
23716
+ nested,
23690
23717
  iconOnly: item.iconOnly ?? (panelCollapsed && !!item.icon),
23691
23718
  ...tid[`link_${(0, import_change_case8.camelCase)(item.label)}`]
23692
23719
  },
@@ -23711,6 +23738,7 @@ function AppNavItems(props) {
23711
23738
  section: item,
23712
23739
  variant,
23713
23740
  panelCollapsed,
23741
+ nested,
23714
23742
  showDivider: idx < items.length - 1,
23715
23743
  ...tid.section
23716
23744
  },
@@ -23761,7 +23789,11 @@ function NavbarMobileMenu(props) {
23761
23789
  const close = () => setIsOpen(false);
23762
23790
  return /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)(import_jsx_runtime186.Fragment, { children: [
23763
23791
  /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(IconButton, { icon: isOpen ? "menuClose" : "menu", color: "--b-on-surface-muted" /* OnSurfaceMuted */, label: isOpen ? "Close navigation" : "Open navigation", onClick: () => setIsOpen((open) => !open), ...tid.mobileMenu }),
23764
- (0, import_react_dom6.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime186.jsx)(ContrastScope, { children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_framer_motion5.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(NavbarMobileDrawer, { items, onClose: close, tid }) }) }), document.body)
23792
+ (0, import_react_dom6.createPortal)(
23793
+ /* AnimatePresence keeps the drawer mounted through its slide/fade-out before unmounting.*/
23794
+ /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_framer_motion5.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(NavbarMobileDrawer, { items, onClose: close, tid }) }),
23795
+ document.body
23796
+ )
23765
23797
  ] });
23766
23798
  }
23767
23799
  function NavbarMobileDrawer({
@@ -23800,7 +23832,7 @@ function NavbarMobileDrawer({
23800
23832
  display: "df",
23801
23833
  flexDirection: "fdc",
23802
23834
  flexShrink: "fs0",
23803
- width: "w100",
23835
+ width: "w_260px",
23804
23836
  overflow: "oh",
23805
23837
  zIndex: ["z_var", {
23806
23838
  "--zIndex": (0, import_runtime106.maybeCssVar)(zIndices.navbarMobileMenu)
@@ -23818,11 +23850,25 @@ function NavbarMobileDrawer({
23818
23850
  ease: "linear",
23819
23851
  duration: 0.2
23820
23852
  }, onClick: (e) => e.stopPropagation(), ...tid.mobileMenuDrawer, children: [
23821
- /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("div", { className: "df aic jcfe pt2 pb2 pr2 pl2 fs0", children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(IconButton, { icon: "menuClose", color: "--b-on-surface-muted" /* OnSurfaceMuted */, label: "Close navigation", onClick: onClose, ...tid.mobileMenuClose }) }),
23853
+ /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("div", { ...(0, import_runtime106.trussProps)({
23854
+ display: "df",
23855
+ alignItems: "aic",
23856
+ justifyContent: "jcfe",
23857
+ paddingLeft: "pl3",
23858
+ paddingRight: "pr3",
23859
+ paddingTop: "pt_12px",
23860
+ paddingBottom: "pb_12px",
23861
+ flexShrink: "fs0",
23862
+ borderBottomStyle: "bbs_solid",
23863
+ borderBottomWidth: "bbw_1px",
23864
+ borderColor: ["bc_var", {
23865
+ "--borderColor": "var(--b-surface-separator)"
23866
+ }]
23867
+ }), children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(IconButton, { icon: "x", color: "--b-on-surface-muted" /* OnSurfaceMuted */, label: "Close navigation", onClick: onClose, ...tid.mobileMenuClose }) }),
23822
23868
  /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
23823
23869
  "nav",
23824
23870
  {
23825
- className: "fg1 oya pl2 pr2 pb3 df fdc gap1",
23871
+ className: "fg1 oya pl3 pr3 pb3 pt2 df fdc gap_4px",
23826
23872
  onClickCapture: (e) => {
23827
23873
  if (e.target.closest("a")) {
23828
23874
  onClose();