UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

28 lines (27 loc) 1.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ButtonLabelIcon = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const common_1 = require("@workday/canvas-kit-react/common"); const icon_1 = require("@workday/canvas-kit-react/icon"); const canvas_kit_styling_1 = require("@workday/canvas-kit-styling"); const canvas_tokens_web_1 = require("@workday/canvas-tokens-web"); const buttonIconStencil = (0, canvas_kit_styling_1.createStencil)({ base: { name: "1fxl9u", styles: "box-sizing:border-box;display:inline-block;" }, modifiers: { size: { extraSmall: { name: "2jpmso", styles: "--size-svg-bca693:var(--cnvs-component-system-icon-size-xs, var(--cnvs-sys-space-x4, 1rem));" }, small: { name: "1aespu", styles: "--size-svg-bca693:var(--cnvs-component-system-icon-size-md, var(--cnvs-sys-space-x5, 1.25rem));" }, medium: { name: "3s0yd1", styles: "--size-svg-bca693:var(--cnvs-component-system-icon-size-md, var(--cnvs-sys-space-x5, 1.25rem));" }, large: { name: "2ye32e", styles: "--size-svg-bca693:var(--cnvs-component-system-icon-size-lg, var(--cnvs-sys-space-x6, 1.5rem));" } } } }, "button-icon-045c76"); exports.ButtonLabelIcon = (0, common_1.createComponent)('span')({ Component: ({ icon, size = 'medium', shouldMirrorIcon = false, shouldMirrorIconInRTL = false, ...elemProps }, ref, Element) => { if (icon === undefined) { return null; } return ((0, jsx_runtime_1.jsx)(icon_1.SystemIcon, { ref: ref, as: Element, icon: icon, shouldMirror: shouldMirrorIcon, shouldMirrorInRTL: shouldMirrorIconInRTL, ...(0, canvas_kit_styling_1.handleCsProp)(elemProps, buttonIconStencil({ size })) })); }, });