UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

23 lines (22 loc) 1.38 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { createComponent } from '@workday/canvas-kit-react/common'; import { createStencil, cssVar, handleCsProp, px2rem } from '@workday/canvas-kit-styling'; import { system } from '@workday/canvas-tokens-web'; import { SkeletonShape, skeletonSurfaceFillStencil } from './SkeletonShape'; export const skeletonHeaderStencil = createStencil({ extends: skeletonSurfaceFillStencil, vars: { width: '', height: '', backgroundColor: '', }, base: { name: "74fix", styles: "box-sizing:border-box;border-radius:var(--cnvs-sys-shape-sm, var(--cnvs-sys-shape-x1, 0.25rem));height:var(--height-skeleton-header-5b02f8, var(--cnvs-sys-size-xs, var(--cnvs-sys-space-x6, 1.5rem)));width:var(--width-skeleton-header-5b02f8);margin-block-end:var(--cnvs-sys-size-xxxs, var(--cnvs-sys-space-x4, 1rem));" } }, "skeleton-header-5b02f8"); export const SkeletonHeader = createComponent('div')({ displayName: 'Skeleton.Header', Component: ({ width = '100%', backgroundColor, height, ...elemProps }, ref, Element) => (_jsx(SkeletonShape, { ref: ref, as: Element, ...handleCsProp(elemProps, skeletonHeaderStencil({ width: typeof width === 'number' ? px2rem(width) : width, backgroundColor, height: typeof height === 'number' ? px2rem(height) : height, })) })), });