@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
15 lines (14 loc) • 907 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { createSubcomponent } from '@workday/canvas-kit-react/common';
import { mergeStyles } from '@workday/canvas-kit-react/layout';
import { OverflowTooltip } from '@workday/canvas-kit-react/tooltip';
import { createStencil } from '@workday/canvas-kit-styling';
import { usePillModel } from './usePillModel';
export const pillLabelStencil = createStencil({
base: { name: "1ci79m", styles: "box-sizing:border-box;flex-shrink:1;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;" }
}, "pill-label-7611ba");
export const PillLabel = createSubcomponent('span')({
modelHook: usePillModel,
})(({ tooltipProps, children, ...elemProps }, Element, model) => {
return (_jsx(OverflowTooltip, { ...tooltipProps, children: _jsx(Element, { id: `label-${model.state.id}`, ...mergeStyles(elemProps, pillLabelStencil()), children: children }) }));
});