UNPKG

@peculiar/fortify-webcomponents

Version:

Web-components for creating CSR or Certificate and viewing certificates list using Fortify

32 lines (29 loc) 1.22 kB
/*! * © 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 */ /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 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', class: { button: true, // eslint-disable-next-line react/destructuring-assignment m_no_padding: children.length === 0, [classProp]: Boolean(classProp), }, onClick: onClick }, startIcon, children.length > 0 && (h(Typography, { variant: "b3", color: "black", component: "span" }, children)))); }; export { Button as B }; //# sourceMappingURL=button.js.map //# sourceMappingURL=button.js.map