@homebound/beam 2.141.0 → 2.141.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.
@@ -13,7 +13,7 @@ export interface NavLinkProps extends BeamFocusableProps {
13
13
  }
14
14
  declare type NavLinkVariant = "side" | "global";
15
15
  export declare function NavLink(props: NavLinkProps): import("@emotion/react/jsx-runtime").JSX.Element;
16
- export declare function getNavLinkStyles(variant: NavLinkVariant, contrast?: boolean): {
16
+ export declare function getNavLinkStyles(variant: NavLinkVariant, contrast: boolean): {
17
17
  baseStyles: {};
18
18
  hoverStyles: {};
19
19
  disabledStyles: {};
@@ -10,7 +10,7 @@ const Css_1 = require("../Css");
10
10
  const utils_1 = require("../utils");
11
11
  const Icon_1 = require("./Icon");
12
12
  function NavLink(props) {
13
- const { disabled: isDisabled, label, openInNew, ...otherProps } = props;
13
+ const { disabled: isDisabled, label, openInNew, contrast = false, ...otherProps } = props;
14
14
  const ariaProps = { children: label, isDisabled, ...otherProps };
15
15
  const { href, active = false, icon = false, variant } = ariaProps;
16
16
  const ref = (0, react_1.useRef)();
@@ -19,7 +19,7 @@ function NavLink(props) {
19
19
  const { type, ...otherButtonProps } = buttonProps;
20
20
  const { hoverProps, isHovered } = (0, react_aria_1.useHover)({ isDisabled });
21
21
  const { isFocusVisible, focusProps } = (0, react_aria_1.useFocusRing)(ariaProps);
22
- const { baseStyles, activeStyles, focusRingStyles, hoverStyles, disabledStyles, pressedStyles } = (0, react_1.useMemo)(() => getNavLinkStyles(variant), [variant]);
22
+ const { baseStyles, activeStyles, focusRingStyles, hoverStyles, disabledStyles, pressedStyles } = (0, react_1.useMemo)(() => getNavLinkStyles(variant, contrast), [variant, contrast]);
23
23
  const external = (0, utils_1.isAbsoluteUrl)(href) || openInNew;
24
24
  const linkAttributes = {
25
25
  className: components_1.navLink,
@@ -43,7 +43,7 @@ function NavLink(props) {
43
43
  return external ? ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: href }, (0, react_aria_1.mergeProps)(otherButtonProps, focusProps, hoverProps), linkAttributes, { children: linkContent }), void 0)) : ((0, jsx_runtime_1.jsx)(react_router_dom_1.Link, Object.assign({ to: href }, (0, react_aria_1.mergeProps)(otherButtonProps, focusProps, hoverProps), linkAttributes, { children: linkContent }), void 0));
44
44
  }
45
45
  exports.NavLink = NavLink;
46
- function getNavLinkStyles(variant, contrast = false) {
46
+ function getNavLinkStyles(variant, contrast) {
47
47
  return navLinkVariantStyles(contrast)[variant];
48
48
  }
49
49
  exports.getNavLinkStyles = getNavLinkStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.141.0",
3
+ "version": "2.141.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",