UNPKG

@workday/canvas-kit-labs-react

Version:

Canvas Kit Labs is an incubator for new and experimental components. Since we have a rather rigorous process for getting components in at a production level, it can be valuable to make them available earlier while we continuously iterate on the API/functi

22 lines (21 loc) 1.28 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExpandableAvatar = void 0; const react_1 = __importDefault(require("react")); 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 expandableAvatarStyles = (0, canvas_kit_styling_1.createStyles)({ name: "eyd62", styles: "margin-right:var(--cnvs-sys-space-x2);flex-shrink:0;" }); // 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 exports.ExpandableAvatar = (0, common_1.createComponent)('div')({ displayName: 'Expandable.Avatar', Component: ({ altText, ...elemProps }, ref, Element) => { return (react_1.default.createElement(avatar_1.Avatar, { cs: expandableAvatarStyles, as: Element, altText: altText, ref: ref, size: "medium", ...elemProps })); }, });