UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

23 lines (22 loc) 1.44 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-preview-react/avatar"); 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: "2nuesb", styles: "box-sizing:border-box;flex-shrink:0;" } }, "expandable-avatar-4eeed1"); // 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 isDecorative prop to true by default since avatars in expandable headers are typically decorative exports.ExpandableAvatar = (0, common_1.createComponent)('div')({ displayName: 'Expandable.Avatar', Component: ({ name = '', isDecorative = true, ...elemProps }, ref, Element) => { return ((0, jsx_runtime_1.jsx)(avatar_1.Avatar, { as: Element, name: name, isDecorative: isDecorative, ref: ref, size: "extraSmall", ...(0, layout_1.mergeStyles)(elemProps, (0, exports.expandableAvatarStencil)()) })); }, });