@shohojdhara/atomix 0.4.2 → 0.4.4

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/core.d.ts CHANGED
@@ -986,6 +986,10 @@ interface CardProps extends BaseComponentProps {
986
986
  * Card className
987
987
  */
988
988
  className?: string;
989
+ /**
990
+ * Optional custom link component (e.g., Next.js Link, React Router Link)
991
+ */
992
+ LinkComponent?: React.ElementType;
989
993
  /**
990
994
  * Optional click handler
991
995
  */
@@ -1300,7 +1304,7 @@ type ButtonAsProp = {
1300
1304
  as?: ElementType;
1301
1305
  to?: string;
1302
1306
  href?: string;
1303
- LinkComponent?: React$1.ComponentType<any>;
1307
+ LinkComponent?: React$1.ElementType;
1304
1308
  [key: string]: any;
1305
1309
  };
1306
1310
  declare const Button: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<Omit<ButtonProps & ButtonAsProp, "ref"> & React$1.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>>;
package/dist/core.js CHANGED
@@ -2111,17 +2111,9 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
2111
2111
  }) ]
2112
2112
  }), withBorder && jsxs(Fragment, {
2113
2113
  children: [ jsx("span", {
2114
- className: ATOMIX_GLASS.BORDER_1_CLASS,
2115
- style: {
2116
- width: glassSize.width,
2117
- height: glassSize.height
2118
- }
2114
+ className: ATOMIX_GLASS.BORDER_1_CLASS
2119
2115
  }), jsx("span", {
2120
- className: ATOMIX_GLASS.BORDER_2_CLASS,
2121
- style: {
2122
- width: glassSize.width,
2123
- height: glassSize.height
2124
- }
2116
+ className: ATOMIX_GLASS.BORDER_2_CLASS
2125
2117
  }) ]
2126
2118
  }) ]
2127
2119
  });
@@ -2528,9 +2520,12 @@ const BreadcrumbItem = forwardRef((({children: children, href: href, active: ac
2528
2520
  className: itemClasses,
2529
2521
  style: style,
2530
2522
  ...props,
2531
- children: href && !active ?
2532
- // @ts-ignore - Dynamic components are tricky in TS without stricter types
2533
- jsx(linkAs || "a", {
2523
+ children: href && !active ? linkAs && linkAs ? jsx(linkAs, {
2524
+ href: href,
2525
+ to: href,
2526
+ ...commonLinkProps,
2527
+ children: linkContent
2528
+ }) : jsx("a", {
2534
2529
  href: href,
2535
2530
  ...commonLinkProps,
2536
2531
  children: linkContent
@@ -2829,6 +2824,7 @@ const Button = React.memo( forwardRef((({label: label, children: children, onCl
2829
2824
  ref: ref,
2830
2825
  // LinkComponent usually forwards ref to anchor
2831
2826
  href: href,
2827
+ to: href,
2832
2828
  target: target,
2833
2829
  rel: "_blank" === target ? "noopener noreferrer" : void 0
2834
2830
  };
@@ -2886,6 +2882,8 @@ active: active = !1, disabled: disabled = !1, loading: loading = !1, selected: s
2886
2882
  header: header, image: image, imageAlt: imageAlt = "", title: title, text: text, actions: actions, icon: icon, footer: footer, children: children,
2887
2883
  // Interaction
2888
2884
  onClick: onClick, onHover: onHover, onFocus: onFocus, href: href, target: target,
2885
+ // Custom Link
2886
+ LinkComponent: LinkComponent,
2889
2887
  // Glass
2890
2888
  glass: glass,
2891
2889
  // Accessibility
@@ -2969,15 +2967,23 @@ className: className = "", style: style, ...rest}, ref) => {
2969
2967
  };
2970
2968
  // Render as anchor if href is provided
2971
2969
  if (href && !isDisabled) {
2972
- const anchorElement = jsx("a", {
2970
+ let anchorElement;
2971
+ return anchorElement = LinkComponent ? jsx(LinkComponent, {
2973
2972
  ...commonProps,
2974
2973
  ref: ref,
2975
2974
  href: href,
2975
+ to: href,
2976
2976
  target: target,
2977
2977
  rel: "_blank" === target ? "noopener noreferrer" : void 0,
2978
2978
  children: cardContent
2979
- });
2980
- return glass ? jsx(AtomixGlass, {
2979
+ }) : jsx("a", {
2980
+ ...commonProps,
2981
+ ref: ref,
2982
+ href: href,
2983
+ target: target,
2984
+ rel: "_blank" === target ? "noopener noreferrer" : void 0,
2985
+ children: cardContent
2986
+ }), glass ? jsx(AtomixGlass, {
2981
2987
  ...!0 === glass ? {} : glass,
2982
2988
  elasticity: 0,
2983
2989
  children: anchorElement