@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
19 lines (18 loc) • 1.06 kB
JavaScript
import React from 'react';
import { xIcon } from '@workday/canvas-system-icons-web';
import { createSubcomponent } from '@workday/canvas-kit-react/common';
import { TertiaryButton } from '@workday/canvas-kit-react/button';
import { usePopupCloseButton, usePopupModel } from './hooks';
import { createStencil } from '@workday/canvas-kit-styling';
import { system } from '@workday/canvas-tokens-web';
import { mergeStyles } from '../../layout';
export const popupCloseIconStencil = createStencil({
base: { name: "m1sr2l", styles: "box-sizing:border-box;position:absolute;inset-inline-end:var(--cnvs-sys-space-x1);top:var(--cnvs-sys-space-x1);" }
}, "popup-close-icon-111273");
export const PopupCloseIcon = createSubcomponent('button')({
displayName: 'Popup.CloseIcon',
modelHook: usePopupModel,
elemPropsHook: usePopupCloseButton,
})(({ children, ...elemProps }, Element) => {
return (React.createElement(TertiaryButton, { as: Element, size: "medium", icon: xIcon, type: "button", ...mergeStyles(elemProps, popupCloseIconStencil()) }));
});