UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

18 lines (17 loc) 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PillLabel = exports.pillLabelStencil = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const common_1 = require("@workday/canvas-kit-react/common"); const layout_1 = require("@workday/canvas-kit-react/layout"); const tooltip_1 = require("@workday/canvas-kit-react/tooltip"); const canvas_kit_styling_1 = require("@workday/canvas-kit-styling"); const usePillModel_1 = require("./usePillModel"); exports.pillLabelStencil = (0, canvas_kit_styling_1.createStencil)({ base: { name: "d3kyo", styles: "box-sizing:border-box;flex-shrink:1;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;" } }, "pill-label-7611ba"); exports.PillLabel = (0, common_1.createSubcomponent)('span')({ modelHook: usePillModel_1.usePillModel, })(({ tooltipProps, children, ...elemProps }, Element, model) => { return ((0, jsx_runtime_1.jsx)(tooltip_1.OverflowTooltip, { ...tooltipProps, children: (0, jsx_runtime_1.jsx)(Element, { id: `label-${model.state.id}`, ...(0, layout_1.mergeStyles)(elemProps, (0, exports.pillLabelStencil)()), children: children }) })); });