@homebound/beam 3.10.1 → 3.11.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.d.cts CHANGED
@@ -5758,9 +5758,9 @@ interface AvatarProps {
5758
5758
  name?: string;
5759
5759
  size?: AvatarSize;
5760
5760
  showName?: boolean;
5761
- disableTooltip?: boolean;
5761
+ preventTooltip?: boolean;
5762
5762
  }
5763
- declare function Avatar({ src, name, size, showName, disableTooltip, ...others }: AvatarProps): JSX.Element;
5763
+ declare function Avatar({ src, name, size, showName, preventTooltip, ...others }: AvatarProps): JSX.Element;
5764
5764
  type AvatarSize = "sm" | "md" | "lg" | "xl";
5765
5765
 
5766
5766
  /** Base Interfaced */
@@ -6033,6 +6033,11 @@ type IconButtonProps = {
6033
6033
  download?: boolean;
6034
6034
  /** Provides label for screen readers - Will become a required soon */
6035
6035
  label?: string;
6036
+ /**
6037
+ * By default the `label` is also surfaced as a hover tooltip. Set this to keep the `aria-label`
6038
+ * for screen readers without showing the tooltip. An explicit `tooltip` or disabled reason still shows.
6039
+ */
6040
+ preventTooltip?: boolean;
6036
6041
  } & BeamButtonProps & BeamFocusableProps;
6037
6042
  declare function IconButton(props: IconButtonProps): JSX.Element;
6038
6043
  declare const iconButtonStylesHover: Pick<Properties, never> & {
@@ -6096,7 +6101,7 @@ declare function NavGroup(props: NavGroupProps): JSX.Element;
6096
6101
 
6097
6102
  type TextButtonTriggerProps = Pick<ButtonProps, "label" | "variant" | "size" | "icon">;
6098
6103
  type IconButtonTriggerProps = Pick<IconButtonProps, "icon" | "color" | "compact" | "inc">;
6099
- type AvatarButtonTriggerProps = Pick<AvatarButtonProps, "src" | "name" | "size">;
6104
+ type AvatarButtonTriggerProps = Pick<AvatarButtonProps, "src" | "name" | "size" | "preventTooltip">;
6100
6105
  type NavLinkButtonTriggerProps = {
6101
6106
  navLabel: string;
6102
6107
  } & Pick<NavLinkProps, "active" | "variant" | "icon">;
package/dist/index.d.ts CHANGED
@@ -5758,9 +5758,9 @@ interface AvatarProps {
5758
5758
  name?: string;
5759
5759
  size?: AvatarSize;
5760
5760
  showName?: boolean;
5761
- disableTooltip?: boolean;
5761
+ preventTooltip?: boolean;
5762
5762
  }
5763
- declare function Avatar({ src, name, size, showName, disableTooltip, ...others }: AvatarProps): JSX.Element;
5763
+ declare function Avatar({ src, name, size, showName, preventTooltip, ...others }: AvatarProps): JSX.Element;
5764
5764
  type AvatarSize = "sm" | "md" | "lg" | "xl";
5765
5765
 
5766
5766
  /** Base Interfaced */
@@ -6033,6 +6033,11 @@ type IconButtonProps = {
6033
6033
  download?: boolean;
6034
6034
  /** Provides label for screen readers - Will become a required soon */
6035
6035
  label?: string;
6036
+ /**
6037
+ * By default the `label` is also surfaced as a hover tooltip. Set this to keep the `aria-label`
6038
+ * for screen readers without showing the tooltip. An explicit `tooltip` or disabled reason still shows.
6039
+ */
6040
+ preventTooltip?: boolean;
6036
6041
  } & BeamButtonProps & BeamFocusableProps;
6037
6042
  declare function IconButton(props: IconButtonProps): JSX.Element;
6038
6043
  declare const iconButtonStylesHover: Pick<Properties, never> & {
@@ -6096,7 +6101,7 @@ declare function NavGroup(props: NavGroupProps): JSX.Element;
6096
6101
 
6097
6102
  type TextButtonTriggerProps = Pick<ButtonProps, "label" | "variant" | "size" | "icon">;
6098
6103
  type IconButtonTriggerProps = Pick<IconButtonProps, "icon" | "color" | "compact" | "inc">;
6099
- type AvatarButtonTriggerProps = Pick<AvatarButtonProps, "src" | "name" | "size">;
6104
+ type AvatarButtonTriggerProps = Pick<AvatarButtonProps, "src" | "name" | "size" | "preventTooltip">;
6100
6105
  type NavLinkButtonTriggerProps = {
6101
6106
  navLabel: string;
6102
6107
  } & Pick<NavLinkProps, "active" | "variant" | "icon">;
package/dist/index.js CHANGED
@@ -5323,7 +5323,8 @@ function IconButton(props) {
5323
5323
  circle = false,
5324
5324
  download = false,
5325
5325
  forceFocusStyles = false,
5326
- label
5326
+ label,
5327
+ preventTooltip = false
5327
5328
  } = props;
5328
5329
  const isDisabled = !!disabled;
5329
5330
  const ariaProps = {
@@ -5374,7 +5375,7 @@ function IconButton(props) {
5374
5375
  };
5375
5376
  const buttonContent = /* @__PURE__ */ jsx11(Icon, { icon, color: color || (isDisabled ? "--b-text-disabled" /* TextDisabled */ : circle && (isHovered || active || isFocusVisible) ? defaultIconColor : iconColor), bgColor, inc: compact ? 2 : circle ? 2.5 : inc });
5376
5377
  return maybeTooltip({
5377
- title: resolveTooltip(disabled ?? label, tooltip),
5378
+ title: resolveTooltip(disabled ?? (preventTooltip ? void 0 : label), tooltip),
5378
5379
  placement: "top",
5379
5380
  children: getButtonOrLink(buttonContent, onPress, buttonAttrs, openInNew, download)
5380
5381
  });
@@ -8840,7 +8841,7 @@ function Avatar({
8840
8841
  name,
8841
8842
  size = "md",
8842
8843
  showName = false,
8843
- disableTooltip = false,
8844
+ preventTooltip = false,
8844
8845
  ...others
8845
8846
  }) {
8846
8847
  const tid = useTestIds(others, "avatar");
@@ -8888,7 +8889,7 @@ function Avatar({
8888
8889
  ...__typography4[sizeToTypeScale[size]] ?? {}
8889
8890
  }), children: name })
8890
8891
  ] }) : maybeTooltip({
8891
- title: disableTooltip ? void 0 : name,
8892
+ title: preventTooltip ? void 0 : name,
8892
8893
  children: img,
8893
8894
  placement: "top"
8894
8895
  });
@@ -8937,6 +8938,7 @@ function AvatarButton(props) {
8937
8938
  openInNew,
8938
8939
  forceFocusStyles = false,
8939
8940
  __storyState,
8941
+ preventTooltip = false,
8940
8942
  ...avatarProps
8941
8943
  } = props;
8942
8944
  const isDisabled = !!disabled;
@@ -8983,12 +8985,11 @@ function AvatarButton(props) {
8983
8985
  ...mergeProps7(typeof onPress === "string" ? navLink : void 0, void 0, styles)
8984
8986
  };
8985
8987
  const content = /* @__PURE__ */ jsxs21(Fragment11, { children: [
8986
- /* @__PURE__ */ jsx34(Avatar, { ...avatarProps, ...tid, disableTooltip: true }),
8988
+ /* @__PURE__ */ jsx34(Avatar, { ...avatarProps, ...tid, preventTooltip: true }),
8987
8989
  isPressed && /* @__PURE__ */ jsx34("span", { ...trussProps23(pressedOverlayCss) })
8988
8990
  ] });
8989
8991
  return maybeTooltip({
8990
- // Default the tooltip to the avatar's name, if defined.
8991
- title: resolveTooltip(disabled, tooltip ?? avatarProps.name),
8992
+ title: resolveTooltip(disabled, tooltip ?? (preventTooltip ? void 0 : avatarProps.name)),
8992
8993
  placement: "top",
8993
8994
  // Disable the auto-tooltip in Avatar to prevent nested tooltips which can cause issues with interactions
8994
8995
  children: getButtonOrLink(content, onPress, buttonAttrs, openInNew)