@utrecht/web-component-library-stencil
Version:
Stencil component library bundle for the Municipality of Utrecht based on the NL Design System architecture
50 lines (45 loc) • 20.3 kB
JavaScript
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { c as clsx } from './clsx.js';
const buttonLinkCss = ".utrecht-button-link{--_utrecht-button-background-color:var(\n --_utrecht-button-hint-background-color,\n var(--_utrecht-button-appearance-background-color, var(--utrecht-button-background-color))\n );--_utrecht-button-color:var(\n --_utrecht-button-hint-color,\n var(--_utrecht-button-appearance-color, var(--utrecht-button-color))\n );--_utrecht-button-border-color:var(\n --_utrecht-button-hint-border-color,\n var(--_utrecht-button-appearance-border-color, var(--utrecht-button-border-color, transparent))\n );--_utrecht-button-border-bottom-color:var(\n --_utrecht-button-hint-border-bottom-color,\n var(\n --_utrecht-button-hint-border-color,\n var(\n --_utrecht-button-appearance-border-bottom-color,\n var(\n --_utrecht-button-appearance-border-color,\n var(--utrecht-button-border-bottom-color, var(--utrecht-button-border-color, transparent))\n )\n )\n )\n );--_utrecht-button-disabled-background-color:var(\n --_utrecht-button-hint-disabled-background-color,\n var(\n --_utrecht-button-appearance-disabled-background-color,\n var(--utrecht-button-disabled-background-color, var(--utrecht-button-background-color))\n )\n );--_utrecht-button-disabled-border-color:var(\n --_utrecht-button-hint-disabled-border-color,\n var(\n --_utrecht-button-appearance-disabled-border-color,\n var(--utrecht-button-disabled-border-color, var(--utrecht-button-border-color))\n )\n );--_utrecht-button-disabled-color:var(\n --_utrecht-button-hint-disabled-color,\n var(--_utrecht-button-appearance-disabled-color, var(--utrecht-button-disabled-color, var(--utrecht-button-color)))\n );--_utrecht-button-pressed-background-color:var(\n --_utrecht-button-hint-pressed-background-color,\n var(\n --_utrecht-button-hint-background-color,\n var(\n --_utrecht-button-appearance-pressed-background-color,\n var(\n --_utrecht-button-appearance-background-color,\n var(--utrecht-button-pressed-background-color, var(--utrecht-button-background-color))\n )\n )\n )\n );--_utrecht-button-pressed-border-color:var(\n --_utrecht-button-hint-pressed-border-color,\n var(\n --_utrecht-button-hint-border-color,\n var(\n --_utrecht-button-appearance-pressed-border-color,\n var(\n --_utrecht-button-appearance-border-color,\n var(--utrecht-button-pressed-border-color, var(--utrecht-button-border-color))\n )\n )\n )\n );--_utrecht-button-pressed-color:var(\n --_utrecht-button-hint-pressed-color,\n var(\n --_utrecht-button-hint-color,\n var(\n --_utrecht-button-appearance-pressed-color,\n var(--_utrecht-button-appearance-color, var(--utrecht-button-pressed-color, var(--utrecht-button-color)))\n )\n )\n );--_utrecht-button-focus-background-color:var(\n --_utrecht-button-hint-focus-background-color,\n var(\n --_utrecht-button-hint-background-color,\n var(\n --_utrecht-button-appearance-focus-background-color,\n var(\n --_utrecht-button-appearance-background-color,\n var(--utrecht-button-focus-background-color, var(--utrecht-button-background-color))\n )\n )\n )\n );--_utrecht-button-focus-border-color:var(\n --_utrecht-button-hint-focus-border-color,\n var(\n --_utrecht-button-hint-border-color,\n var(\n --_utrecht-button-appearance-focus-border-color,\n var(\n --_utrecht-button-appearance-border-color,\n var(--utrecht-button-focus-border-color, var(--utrecht-button-border-color))\n )\n )\n )\n );--_utrecht-button-focus-color:var(\n --_utrecht-button-hint-focus-color,\n var(\n --_utrecht-button-hint-color,\n var(\n --_utrecht-button-appearance-focus-color,\n var(--_utrecht-button-appearance-color, var(--utrecht-button-focus-color, var(--utrecht-button-color)))\n )\n )\n );--_utrecht-button-hover-background-color:var(\n --_utrecht-button-hint-hover-background-color,\n var(\n --_utrecht-button-hint-background-color,\n var(\n --_utrecht-button-appearance-hover-background-color,\n var(\n --_utrecht-button-appearance-background-color,\n var(--utrecht-button-hover-background-color, var(--utrecht-button-background-color))\n )\n )\n )\n );--_utrecht-button-hover-border-color:var(\n --_utrecht-button-hint-hover-border-color,\n var(\n --_utrecht-button-hint-border-color,\n var(\n --_utrecht-button-appearance-hover-border-color,\n var(\n --_utrecht-button-appearance-border-color,\n var(--utrecht-button-hover-border-color, var(--utrecht-button-border-color))\n )\n )\n )\n );--_utrecht-button-hover-color:var(\n --_utrecht-button-hint-hover-color,\n var(\n --_utrecht-button-hint-color,\n var(\n --_utrecht-button-appearance-hover-color,\n var(--_utrecht-button-appearance-color, var(--utrecht-button-hover-color, var(--utrecht-button-color)))\n )\n )\n );--_utrecht-button-active-background-color:var(\n --_utrecht-button-hint-active-background-color,\n var(\n --_utrecht-button-hint-background-color,\n var(\n --_utrecht-button-appearance-active-background-color,\n var(\n --_utrecht-button-appearance-background-color,\n var(--utrecht-button-active-background-color, var(--utrecht-button-background-color))\n )\n )\n )\n );--_utrecht-button-active-border-color:var(\n --_utrecht-button-hint-active-border-color,\n var(\n --_utrecht-button-hint-border-color,\n var(\n --_utrecht-button-appearance-active-border-color,\n var(\n --_utrecht-button-appearance-border-color,\n var(--utrecht-button-active-border-color, var(--utrecht-button-border-color))\n )\n )\n )\n );--_utrecht-button-active-color:var(\n --_utrecht-button-hint-active-color,\n var(\n --_utrecht-button-hint-color,\n var(\n --_utrecht-button-appearance-active-color,\n var(--_utrecht-button-appearance-color, var(--utrecht-button-active-color, var(--utrecht-button-color)))\n )\n )\n );--_utrecht-button-border-width:var(--_utrecht-button-appearance-border-width, var(--utrecht-button-border-width, 0));--_utrecht-button-border-block-end-width:var(\n --utrecht-button-border-bottom-width,\n var(--_utrecht-button-border-width, 0)\n );--_utrecht-button-font-size:var(--_utrecht-button-appearance-font-size, var(--utrecht-button-font-size));--_utrecht-button-line-height:var(--_utrecht-button-appearance-line-height, var(--utrecht-button-line-height));--utrecht-icon-size:var(--utrecht-button-icon-size, 1em);align-items:center;background-color:var(--_utrecht-button-background-color);block-size:fit-content;border-block-end-color:var(--_utrecht-button-border-bottom-color);border-block-end-width:var(--_utrecht-button-border-block-end-width);border-color:var(--_utrecht-button-border-color);border-radius:var(--utrecht-button-border-radius);border-style:solid;border-width:var(--_utrecht-button-border-width);box-sizing:border-box;color:var(--_utrecht-button-color);column-gap:var(--utrecht-button-column-gap);cursor:var(--utrecht-action-activate-cursor, revert);display:inline-flex;font-family:var(--utrecht-button-font-family, var(--utrecht-document-font-family));font-size:var(--_utrecht-button-font-size, var(--utrecht-document-font-family, inherit));font-weight:var(--_utrecht-button-appearance-font-weight, var(--utrecht-button-font-weight));inline-size:var(--utrecht-button-inline-size, auto);justify-content:center;line-height:var(--_utrecht-button-line-height);max-inline-size:var(--utrecht-button-max-inline-size, fit-content);min-block-size:var(--utrecht-button-min-block-size, 44px);min-inline-size:var(--utrecht-button-min-inline-size, 44px);padding-block-end:var(--utrecht-button-padding-block-end);padding-block-start:var(--utrecht-button-padding-block-start);padding-inline-end:var(--utrecht-button-padding-inline-end);padding-inline-start:var(--utrecht-button-padding-inline-start);scale:1;text-transform:var(--utrecht-button-text-transform);-webkit-user-select:none;user-select:none;cursor:var(--utrecht-action-navigate-cursor, pointer);text-decoration:none}@media screen and (-ms-high-contrast: active), screen and (forced-colors: active){.utrecht-button-link{--_utrecht-button-disabled-border-color:GrayText;--_utrecht-button-disabled-color:GrayText;background-color:ButtonFace;border-color:buttonborder;color:ButtonText;}}.utrecht-button-link--active{background-color:var(--_utrecht-button-active-background-color);border-color:var(--_utrecht-button-active-border-color);color:var(--_utrecht-button-active-color)}.utrecht-button-link--hover{background-color:var(--_utrecht-button-hover-background-color);border-color:var(--_utrecht-button-hover-border-color);color:var(--_utrecht-button-hover-color);scale:var(--utrecht-button-hover-scale, 1)}.utrecht-button-link--focus{background-color:var(--_utrecht-button-focus-background-color);border-color:var(--_utrecht-button-focus-border-color);color:var(--_utrecht-button-focus-color);scale:var(--utrecht-button-focus-scale, 1)}.utrecht-button-link--focus-visible{--_utrecht-focus-ring-box-shadow:0 0 0 var(--utrecht-focus-outline-width, 0)\n var(--utrecht-focus-inverse-outline-color, transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color, revert);outline-offset:var(--utrecht-focus-outline-offset, revert);outline-style:var(--utrecht-focus-outline-style, revert);outline-width:var(--utrecht-focus-outline-width, revert);z-index:1}.utrecht-button-link--placeholder{background-color:var(--_utrecht-button-disabled-background-color);border-color:var(--_utrecht-button-disabled-border-color);color:var(--_utrecht-button-disabled-color);cursor:var(--utrecht-action-disabled-cursor, not-allowed)}.utrecht-button-link--html-a:focus{background-color:var(--_utrecht-button-focus-background-color);border-color:var(--_utrecht-button-focus-border-color);color:var(--_utrecht-button-focus-color);scale:var(--utrecht-button-focus-scale, 1)}.utrecht-button-link--html-a:focus-visible{--_utrecht-focus-ring-box-shadow:0 0 0 var(--utrecht-focus-outline-width, 0)\n var(--utrecht-focus-inverse-outline-color, transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color, revert);outline-offset:var(--utrecht-focus-outline-offset, revert);outline-style:var(--utrecht-focus-outline-style, revert);outline-width:var(--utrecht-focus-outline-width, revert);z-index:1}.utrecht-button-link--html-a:hover{background-color:var(--_utrecht-button-hover-background-color);border-color:var(--_utrecht-button-hover-border-color);color:var(--_utrecht-button-hover-color);scale:var(--utrecht-button-hover-scale, 1)}.utrecht-button-link--html-a:active{background-color:var(--_utrecht-button-active-background-color);border-color:var(--_utrecht-button-active-border-color);color:var(--_utrecht-button-active-color)}.utrecht-button-link--primary-action{--_utrecht-button-appearance-active-background-color:var(--utrecht-button-primary-action-active-background-color);--_utrecht-button-appearance-active-border-color:var(--utrecht-button-primary-action-active-border-color);--_utrecht-button-appearance-active-color:var(--utrecht-button-primary-action-active-color);--_utrecht-button-appearance-background-color:var(--utrecht-button-primary-action-background-color);--_utrecht-button-appearance-border-color:var(--utrecht-button-primary-action-border-color);--_utrecht-button-appearance-border-width:var(--utrecht-button-primary-action-border-width);--_utrecht-button-appearance-color:var(--utrecht-button-primary-action-color);--_utrecht-button-appearance-font-size:var(--utrecht-button-primary-action-font-size);--_utrecht-button-appearance-font-weight:var(--utrecht-button-primary-action-font-weight);--_utrecht-button-appearance-line-height:var(--utrecht-button-primary-action-line-height);--_utrecht-button-appearance-disabled-background-color:var(--utrecht-button-primary-action-disabled-background-color);--_utrecht-button-appearance-disabled-border-color:var(--utrecht-button-primary-action-disabled-border-color);--_utrecht-button-appearance-disabled-color:var(--utrecht-button-primary-action-disabled-color);--_utrecht-button-appearance-focus-background-color:var(--utrecht-button-primary-action-focus-background-color);--_utrecht-button-appearance-focus-border-color:var(--utrecht-button-primary-action-focus-border-color);--_utrecht-button-appearance-focus-color:var(--utrecht-button-primary-action-focus-color);--_utrecht-button-appearance-hover-background-color:var(--utrecht-button-primary-action-hover-background-color);--_utrecht-button-appearance-hover-border-color:var(--utrecht-button-primary-action-hover-border-color);--_utrecht-button-appearance-hover-color:var(--utrecht-button-primary-action-hover-color);--_utrecht-button-appearance-pressed-background-color:var(--utrecht-button-primary-action-pressed-background-color);--_utrecht-button-appearance-pressed-border-color:var(--utrecht-button-primary-action-pressed-border-color);--_utrecht-button-appearance-pressed-color:var(--utrecht-button-primary-action-pressed-color)}.utrecht-button-link--secondary-action{--_utrecht-button-appearance-active-background-color:var(--utrecht-button-secondary-action-active-background-color);--_utrecht-button-appearance-active-border-color:var(--utrecht-button-secondary-action-active-border-color);--_utrecht-button-appearance-active-color:var(--utrecht-button-secondary-action-active-color);--_utrecht-button-appearance-background-color:var(--utrecht-button-secondary-action-background-color);--_utrecht-button-appearance-border-color:var(--utrecht-button-secondary-action-border-color);--_utrecht-button-appearance-border-width:var(--utrecht-button-secondary-action-border-width);--_utrecht-button-appearance-color:var(--utrecht-button-secondary-action-color);--_utrecht-button-appearance-font-size:var(--utrecht-button-secondary-action-font-size);--_utrecht-button-appearance-font-weight:var(--utrecht-button-secondary-action-font-weight);--_utrecht-button-appearance-line-height:var(--utrecht-button-secondary-action-line-height);--_utrecht-button-appearance-disabled-background-color:var(--utrecht-button-secondary-action-disabled-background-color);--_utrecht-button-appearance-disabled-border-color:var(--utrecht-button-secondary-action-disabled-border-color);--_utrecht-button-appearance-disabled-color:var(--utrecht-button-secondary-action-disabled-color);--_utrecht-button-appearance-focus-background-color:var(--utrecht-button-secondary-action-focus-background-color);--_utrecht-button-appearance-focus-border-color:var(--utrecht-button-secondary-action-focus-border-color);--_utrecht-button-appearance-focus-color:var(--utrecht-button-secondary-action-focus-color);--_utrecht-button-appearance-hover-background-color:var(--utrecht-button-secondary-action-hover-background-color);--_utrecht-button-appearance-hover-border-color:var(--utrecht-button-secondary-action-hover-border-color);--_utrecht-button-appearance-hover-color:var(--utrecht-button-secondary-action-hover-color);--_utrecht-button-appearance-pressed-background-color:var(--utrecht-button-secondary-action-pressed-background-color);--_utrecht-button-appearance-pressed-border-color:var(--utrecht-button-secondary-action-pressed-border-color);--_utrecht-button-appearance-pressed-color:var(--utrecht-button-secondary-action-pressed-color)}.utrecht-button-link--subtle{--_utrecht-button-appearance-active-background-color:var(--utrecht-button-subtle-active-background-color);--_utrecht-button-appearance-active-border-color:var(--utrecht-button-subtle-active-border-color);--_utrecht-button-appearance-active-color:var(--utrecht-button-subtle-active-color);--_utrecht-button-appearance-background-color:var(--utrecht-button-subtle-background-color);--_utrecht-button-appearance-border-color:var(--utrecht-button-subtle-border-color);--_utrecht-button-appearance-border-width:var(--utrecht-button-subtle-border-width);--_utrecht-button-appearance-color:var(--utrecht-button-subtle-color);--_utrecht-button-appearance-font-size:var(--utrecht-button-subtle-font-size);--_utrecht-button-appearance-font-weight:var(--utrecht-button-subtle-font-weight);--_utrecht-button-appearance-line-height:var(--utrecht-button-subtle-line-height);--_utrecht-button-appearance-disabled-background-color:var(--utrecht-button-subtle-disabled-background-color);--_utrecht-button-appearance-disabled-border-color:var(--utrecht-button-subtle-disabled-border-color);--_utrecht-button-appearance-disabled-color:var(--utrecht-button-subtle-disabled-color);--_utrecht-button-appearance-focus-background-color:var(--utrecht-button-subtle-focus-background-color);--_utrecht-button-appearance-focus-border-color:var(--utrecht-button-subtle-focus-border-color);--_utrecht-button-appearance-focus-color:var(--utrecht-button-subtle-focus-color);--_utrecht-button-appearance-hover-background-color:var(--utrecht-button-subtle-hover-background-color);--_utrecht-button-appearance-hover-border-color:var(--utrecht-button-subtle-hover-border-color);--_utrecht-button-appearance-hover-color:var(--utrecht-button-subtle-hover-color);--_utrecht-button-appearance-pressed-background-color:var(--utrecht-button-subtle-pressed-background-color);--_utrecht-button-appearance-pressed-border-color:var(--utrecht-button-subtle-pressed-border-color);--_utrecht-button-appearance-pressed-color:var(--utrecht-button-subtle-pressed-color)}:host{display:inline-flex}:host([hidden]){display:none !important}";
const UtrechtButtonLinkStyle0 = buttonLinkCss;
const ButtonLink = /*@__PURE__*/ proxyCustomElement(class ButtonLink extends HTMLElement {
constructor() {
super();
this.__registerHost();
this.__attachShadow();
this.appearance = undefined;
this.download = undefined;
this.external = undefined;
this.href = undefined;
this.placeholder = undefined;
this.target = undefined;
}
render() {
return (h("a", { key: 'acf9dc165fd6e4906a5c94e5d7b1c53a90e29491', href: typeof this.href === 'string' && !this.placeholder ? this.href : undefined, class: clsx('utrecht-button-link', 'utrecht-button-link--html-a', this.external && 'utrecht-button-link--external', this.placeholder && 'utrecht-button-link--placeholder', this.appearance === 'primary-action-button' && 'utrecht-button-link--primary-action', this.appearance === 'secondary-action-button' && 'utrecht-button-link--secondary-action', this.appearance === 'subtle-button' && 'utrecht-button-link--subtle'), "aria-disabled": this.placeholder ? 'true' : undefined, download: typeof this.download === 'string' ? this.download : undefined, rel: this.external ? 'external noopener noreferrer' : undefined, role: this.placeholder ? 'link' : undefined, target: typeof this.target === 'string' ? this.target : undefined }, h("slot", { key: '48ca66293f8e887d97b8e62886cee423c4ee2117' })));
}
static get style() { return UtrechtButtonLinkStyle0; }
}, [1, "utrecht-button-link", {
"appearance": [1],
"download": [1],
"external": [4],
"href": [1],
"placeholder": [4],
"target": [1]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["utrecht-button-link"];
components.forEach(tagName => { switch (tagName) {
case "utrecht-button-link":
if (!customElements.get(tagName)) {
customElements.define(tagName, ButtonLink);
}
break;
} });
}
const UtrechtButtonLink = ButtonLink;
const defineCustomElement = defineCustomElement$1;
export { UtrechtButtonLink, defineCustomElement };
//# sourceMappingURL=utrecht-button-link.js.map