@peculiar/fortify-webcomponents
Version:
Web-components for creating CSR or Certificate and viewing certificates list using Fortify
24 lines (23 loc) • 1.09 kB
JavaScript
/*!
* © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License
*/
/**
* @license
* Copyright (c) Peculiar Ventures, LLC.
*
* This source code is licensed under the BSD 3-Clause license found in the
* LICENSE file in the root directory of this source tree.
*/
import { h } from "@stencil/core";
import { Typography } from "@peculiar/certificates-viewer";
export const FortifyButton = (props, children) => {
const { href, class: classProp, startIcon, disabled, variant = 'secondary', type = 'button', onClick, ref, } = props;
const isLink = !!href;
const TagType = isLink ? 'a' : 'button';
return (h(TagType, { ref: ref, type: !isLink && type, href: isLink && href, target: isLink && '_blank', rel: isLink && 'noreferrer noopener', onClick: onClick, class: {
button: true,
[`button_${variant}`]: true,
[classProp]: Boolean(classProp),
}, disabled: disabled }, startIcon, h(Typography, { variant: "btn1", component: "span", class: "button_child_text" }, children)));
};
//# sourceMappingURL=fortify-button.js.map