UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

20 lines (19 loc) 886 B
import React from 'react'; import { styled, createComponent, ellipsisStyles } from '@workday/canvas-kit-react/common'; import { Hyperlink } from '@workday/canvas-kit-react/button'; import { OverflowTooltip } from '@workday/canvas-kit-react/tooltip'; import { type } from '@workday/canvas-kit-react/tokens'; const { color, ...subtextLargeStyles } = type.levels.subtext.large; const StyledLink = styled(Hyperlink)({ ...subtextLargeStyles, }, ({ maxWidth }) => ({ ...ellipsisStyles, maxWidth, })); export const BreadcrumbsLink = createComponent('a')({ displayName: 'Breadcrumbs.Link', Component: ({ maxWidth = 350, href, tooltipProps = {}, children, ...props }) => { return (React.createElement(OverflowTooltip, { ...tooltipProps }, React.createElement(StyledLink, { maxWidth: maxWidth, href: href, role: "link", ...props }, children))); }, });