UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

24 lines (23 loc) 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExpandableAvatar = exports.expandableAvatarStencil = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const common_1 = require("@workday/canvas-kit-react/common"); const avatar_1 = require("@workday/canvas-kit-react/avatar"); const canvas_tokens_web_1 = require("@workday/canvas-tokens-web"); const canvas_kit_styling_1 = require("@workday/canvas-kit-styling"); const layout_1 = require("@workday/canvas-kit-react/layout"); exports.expandableAvatarStencil = (0, canvas_kit_styling_1.createStencil)({ extends: avatar_1.avatarStencil, base: { name: "3995dc", styles: "box-sizing:border-box;margin-inline-end:var(--cnvs-sys-space-x2);flex-shrink:0;" } }, "expandable-avatar-d56832"); // When the component is created, it needs to be a button element to match AvatarProps. // Once Avatar becomes a `createComponent` we can default the element type to a `div` // and the types should be properly extracted // Setting altText prop to a default empty string for decorative purposes exports.ExpandableAvatar = (0, common_1.createComponent)('div')({ displayName: 'Expandable.Avatar', Component: ({ altText = '', ...elemProps }, ref, Element) => { return ((0, jsx_runtime_1.jsx)(avatar_1.Avatar, { as: Element, altText: altText, ref: ref, size: "medium", ...(0, layout_1.mergeStyles)(elemProps, (0, exports.expandableAvatarStencil)()) })); }, });