@peculiar/fortify-webcomponents
Version:
Web-components for creating CSR or Certificate and viewing certificates list using Fortify
24 lines (21 loc) • 992 B
JavaScript
/*!
* © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License
*/
import { h } from '@stencil/core/internal/client';
import { T as Typography } from './typography.js';
/*!
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
*/
const Button = (props, children) => {
const { href, class: classProp, startIcon, onClick, } = props;
const isLink = !!href;
const TagType = isLink ? 'a' : 'button';
return (h(TagType, { type: !isLink && 'button', href: isLink && href, target: isLink && '_blank', rel: isLink && 'noreferrer noopener', onClick: onClick, class: {
button: true,
// eslint-disable-next-line react/destructuring-assignment
m_no_padding: children.length === 0,
[classProp]: Boolean(classProp),
} }, startIcon, children.length > 0 && (h(Typography, { variant: "b3", color: "black", component: "span" }, children))));
};
export { Button as B };
//# sourceMappingURL=button.js.map