@alexandragr/ui-kit
Advanced tools
Comparing version 1.0.0-beta.15 to 1.0.0-beta.16
@@ -8,3 +8,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; | ||
export const Breadcrumbs = memo(({ crumbs, onClick, onMouseEnter, appNamespace, arrowIconName, arrowIconPath, arrowIconVersion, }) => { | ||
const handleClick = useCallback(({ href }) => { | ||
const handleClick = useCallback(({ event, href, }) => { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
const selectedCrumb = crumbs.find((crumb) => crumb.href === href); | ||
@@ -11,0 +13,0 @@ if (selectedCrumb) { |
@@ -10,3 +10,6 @@ import { MouseEvent } from 'react'; | ||
color?: TextColorType; | ||
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void; | ||
onClick?: (params: { | ||
event: MouseEvent<HTMLAnchorElement>; | ||
href?: string; | ||
}) => void; | ||
onMouseEnter?: (event: MouseEvent<HTMLAnchorElement>) => void; | ||
@@ -13,0 +16,0 @@ isUnderlined?: boolean; |
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { memo } from 'react'; | ||
import { memo, useCallback } from 'react'; | ||
import clsx from 'clsx'; | ||
import styles from './link.module.scss'; | ||
export const Link = memo(({ href = '', target = '_blank', isUpperCase, pattern = 'h2_regular', color = 'black', isSelected, onMouseEnter, onClick, children, isUnderlined, isUnderlinedAlways, }) => { | ||
const handleClick = useCallback((event) => { | ||
onClick?.({ | ||
event, | ||
href, | ||
}); | ||
}, [href, onClick]); | ||
return (_jsx("a", { className: clsx(styles.Link, { | ||
@@ -14,3 +20,3 @@ [styles.Link_uppercase]: isUpperCase, | ||
[styles.Link_underlinedAlways]: isUnderlinedAlways, | ||
}), href: href, onClick: onClick, onMouseEnter: onMouseEnter, target: target, children: children })); | ||
}), href: href, onClick: handleClick, onMouseEnter: onMouseEnter, target: target, children: children })); | ||
}); |
{ | ||
"name": "@alexandragr/ui-kit", | ||
"version": "1.0.0-beta.15", | ||
"version": "1.0.0-beta.16", | ||
"homepage": ".", | ||
@@ -5,0 +5,0 @@ "description": "library of ui components", |
84730
1168