UNPKG

@peculiar/fortify-webcomponents

Version:

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

57 lines (54 loc) 1.73 kB
/*! * © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License */ import { h } from '@stencil/core/internal/client'; /*! * © 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. */ var __rest = (undefined && undefined.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; const variantMapping = { h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', s1: 'h6', s2: 'h6', b1: 'p', b2: 'p', b3: 'p', btn1: 'span', btn2: 'span', c1: 'p', c2: 'p', }; const Typography = (props, children) => { const { component: componentProp, variant = 'b2', color = 'black', class: classProp } = props, other = __rest(props, ["component", "variant", "color", "class"]); const Component = componentProp || variantMapping[variant] || 'p'; return (h(Component, Object.assign({}, other, { class: { typography: true, [`t-${variant}`]: true, [`c-${color}`]: true, [classProp]: Boolean(classProp), } }), children)); }; export { Typography as T }; //# sourceMappingURL=typography.js.map