UNPKG

@utrecht/web-component-library-stencil

Version:

Stencil component library bundle for the Municipality of Utrecht based on the NL Design System architecture

378 lines (347 loc) 18.7 kB
/** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ /* stylelint-disable-next-line block-no-empty */ /** @deprecated */ .utrecht-form-field { break-inside: avoid; font-family: var(--utrecht-document-font-family, inherit); margin-block-end: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-margin-block-end, 0)); margin-block-start: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-margin-block-start, 0)); } .utrecht-form-field--distanced { --utrecht-space-around: 1; } .utrecht-form-field--invalid { border-inline-start-color: var(--utrecht-form-field-invalid-border-inline-start-color); border-inline-start-style: solid; border-inline-start-width: var(--utrecht-form-field-invalid-border-inline-start-width, 0); padding-inline-start: var(--utrecht-form-field-invalid-padding-inline-start); } .utrecht-form-field--checkbox { display: grid; gap: 0 var(--utrecht-checkbox-margin-inline-end, 12px); grid-template-areas: "input label" "input description" "input error-message"; grid-template-columns: var(--utrecht-checkbox-size) 100fr; /* .utrecht-form-field__label .utrecht-form-field__input { margin-inline-start: calc( -1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px)) ); margin-inline-end: var(--utrecht-checkbox-margin-inline-end, 12px); } */ } .utrecht-form-field--checkbox .utrecht-form-field__label:has(.utrecht-form-field__input) { margin-inline-start: calc(-1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px))); } .utrecht-form-field--checkbox .utrecht-form-field__label .utrecht-form-field__input { margin-inline-end: var(--utrecht-checkbox-margin-inline-end, 12px); } .utrecht-form-field--radio { display: grid; gap: 0 var(--utrecht-radio-button-margin-inline-end, 12px); grid-template-areas: "input label" "input description" "input error-message"; grid-template-columns: var(--utrecht-radio-button-size) 100fr; /* .utrecht-form-field__label .utrecht-form-field__input { margin-inline-start: calc( -1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px)) ); margin-inline-end: var(--utrecht-checkbox-margin-inline-end, 12px); } */ } .utrecht-form-field--radio .utrecht-form-field__label:has(.utrecht-form-field__input) { margin-inline-start: calc(-1 * (var(--utrecht-radio-button-size) + var(--utrecht-radio-button-margin-inline-end, 12px))); } .utrecht-form-field--radio .utrecht-form-field__label .utrecht-form-field__input { margin-inline-end: var(--utrecht-radio-button-margin-inline-end, 12px); } .utrecht-form-field__input { margin-block-end: 0; margin-block-start: 0; grid-area: input; order: 5; } .utrecht-form-field__label { /* Assign the margin-block-end to padding instead, so the clickable area of the label increases and we avoid a small gap between the label and input that cannot be clicked to focus the input. */ grid-area: label; margin-block-end: var(--utrecht-form-field-label-margin-block-end); margin-block-start: 0; order: 1; } .utrecht-form-field .utrecht-form-field-description { grid-area: description; margin-block-end: var(--utrecht-form-field-description-margin-block-end); margin-block-start: var(--utrecht-form-field-description-margin-block-start); order: 2; } .utrecht-form-field .utrecht-form-field-description--invalid { grid-area: error-message; order: 3; } .utrecht-form-field__description { grid-area: description; margin-block-end: var(--utrecht-form-field-description-margin-block-end); margin-block-start: var(--utrecht-form-field-description-margin-block-start); order: 2; } .utrecht-form-field__description--before { grid-area: description-before; order: 4; } .utrecht-form-field__error-message { grid-area: error-message; order: 3; } /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ .utrecht-form-label { color: var(--utrecht-form-label-color); font-size: var(--utrecht-form-label-font-size); font-weight: var(--utrecht-form-label-font-weight); } .utrecht-form-label--checkbox { color: var(--utrecht-form-label-checkbox-color, var(--utrecht-form-label-color)); cursor: var(--utrecht-action-activate-cursor, revert); font-weight: var(--utrecht-form-label-checkbox-font-weight, var(--utrecht-form-label-font-weight)); } .utrecht-form-label--checked { font-weight: var(--utrecht-form-label-checked-font-weight, var(--utrecht-form-label-font-weight)); } .utrecht-form-label--disabled { color: var(--utrecht-form-label-disabled-color, var(--utrecht-form-label-color)); cursor: var(--utrecht-action-disabled-cursor, revert); } .utrecht-form-label--radio { color: var(--utrecht-form-label-checkbox-color, var(--utrecht-form-label-color)); cursor: var(--utrecht-action-activate-cursor, revert); font-weight: var(--utrecht-form-label-radio-font-weight, var(--utrecht-form-label-font-weight)); } /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ .utrecht-form-field-description { --utrecht-document-color: currentColor; color: var(--utrecht-form-field-description-color); font-family: var(--utrecht-document-font-family, inherit); font-size: var(--utrecht-form-field-description-font-size, inherit); font-style: var(--utrecht-form-field-description-font-style); line-height: var(--utrecht-form-field-description-line-height); margin-block-end: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-description-margin-block-end, var(--utrecht-paragraph-margin-block-end, 0))); margin-block-start: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-description-margin-block-start, var(--utrecht-paragraph-margin-block-start, 0))); } .utrecht-form-field-description > * { --utrecht-space-around: 1; } .utrecht-form-field-description--distanced { --utrecht-space-around: 1; } .utrecht-form-field-description--invalid { color: var(--utrecht-form-field-description-invalid-color, var(--utrecht-feedback-invalid-color, var(--utrecht-feedback-danger-color))); } .utrecht-form-field-description--valid { color: var(--utrecht-form-field-description-valid-color, var(--utrecht-feedback-valid-color, var(--utrecht-feedback-safe-color))); } .utrecht-form-field-description--warning { color: var(--utrecht-form-field-description-warning-color, var(--utrecht-feedback-warning-color)); } /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ /* stylelint-disable-next-line block-no-empty */ /* Override the browser focus ring with our own focus ring. * Use `:where()` so the CSS selector specificity is `0,0,0`. */ /* Override the browser focus ring with our own focus ring. * Use `:where()` so the CSS selector specificity is `0,0,0`. */ /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ /** * @license EUPL-1.2 * Copyright (c) 2020-2024 Frameless B.V. * Copyright (c) 2021-2024 Gemeente Utrecht */ /* TODO: Enable ordering properties when the plugin supports logical CSS properties * https://github.com/hudochenkov/stylelint-order/pull/162 */ /* stylelint-disable order/properties-alphabetical-order */ .utrecht-textarea { /* Fall back to `resize: vertical` for browsers that don't support `resize: block` */ border-color: var(--utrecht-textarea-border-color, var(--utrecht-form-control-border-color)); border-radius: var(--utrecht-textarea-border-radius, var(--utrecht-form-control-border-radius, 0)); border-style: solid; border-width: var(--utrecht-textarea-border-width, var(--utrecht-form-control-border-width)); border-block-end-width: var(--utrecht-textarea-border-block-end-width, var(--utrecht-textarea-border-width, var(--utrecht-form-control-border-width))); background-color: var(--utrecht-textarea-background-color, var(--utrecht-form-control-background-color)); block-size: initial; /* harden */ box-sizing: border-box; color: var(--utrecht-textarea-color, var(--utrecht-form-control-color)); font-family: var(--utrecht-textarea-font-family, var(--utrecht-form-control-font-family)); font-size: var(--utrecht-textarea-font-size, var(--utrecht-form-control-font-size, inherit)); font-weight: var(--utrecht-textarea-font-weight, var(--utrecht-form-control-font-weight, initial)); /* harden with `initial` */ inline-size: 100%; line-height: var(--utrecht-textarea-line-height, initial); max-inline-size: var(--utrecht-textarea-max-inline-size, var(--utrecht-form-control-max-inline-size)); min-block-size: var(--utrecht-textarea-min-block-size, var(--utrecht-pointer-target-min-size, 44px)); min-inline-size: var(--utrecht-pointer-target-min-size, 44px); padding-block-end: var(--utrecht-textarea-padding-block-end, var(--utrecht-form-control-padding-block-end, 0)); padding-block-start: var(--utrecht-textarea-padding-block-start, var(--utrecht-form-control-padding-block-start, 0)); padding-inline-end: var(--utrecht-textarea-padding-inline-end, var(--utrecht-form-control-padding-inline-end, initial)); padding-inline-start: var(--utrecht-textarea-padding-inline-start, var(--utrecht-form-control-padding-inline-start, initial)); resize: vertical; resize: block; } .utrecht-textarea--invalid { --_utrecht-textarea-border-width: var( --utrecht-textarea-invalid-border-width, var( --utrecht-form-control-invalid-border-width, var(--utrecht-textarea-border-width, var(--utrecht-form-control-border-width)) ) ); border-color: var(--utrecht-textarea-invalid-border-color, var(--utrecht-form-control-invalid-border-color, var(--utrecht-textarea-border-color, var(--utrecht-form-control-border-color)))); border-width: var(--_utrecht-textarea-border-width); border-block-end-width: var(--utrecht-textarea-invalid-border-block-end-width, var(--utrecht-form-control-invalid-border-block-end-width, var(--utrecht-textarea-border-block-end-width, var(--utrecht-form-control-border-block-end-width, var(--_utrecht-textarea-border-width))))); background-color: var(--utrecht-textarea-invalid-background-color, var(--utrecht-form-control-invalid-background-color, var(--utrecht-textarea-background-color, var(--utrecht-form-control-background-color)))); color: var(--utrecht-textarea-invalid-color, var(--utrecht-form-control-invalid-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); } .utrecht-textarea--disabled { background-color: var(--utrecht-textarea-disabled-background-color, var(--utrecht-form-control-disabled-background-color, var(--utrecht-textarea-background-color, var(--utrecht-form-control-background-color)))); border-color: var(--utrecht-textarea-disabled-border-color, var(--utrecht-form-control-disabled-border-color, var(--utrecht-textarea-border-color, var(--utrecht-form-control-border-color)))); color: var(--utrecht-textarea-disabled-color, var(--utrecht-form-control-disabled-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); cursor: var(--utrecht-action-disabled-cursor, not-allowed); } .utrecht-textarea--focus { background-color: var(--utrecht-textarea-focus-background-color, var(--utrecht-form-control-focus-background-color, var(--utrecht-textarea-background-color, var(--utrecht-form-control-background-color)))); border-color: var(--utrecht-textarea-focus-border-color, var(--utrecht-form-control-focus-border-color, var(--utrecht-textarea-border-color, var(--utrecht-form-control-border-color)))); color: var(--utrecht-textarea-focus-color, var(--utrecht-form-control-focus-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); } .utrecht-textarea--focus-visible { /* - The browser default focus ring should apply when these CSS custom properties are not set. * - Make the `box-shadow` value available, so components that have their own `box-shadow` * can combine it with the focus ring box shadow. */ --_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0) 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-textarea--read-only { background-color: var(--utrecht-textarea-read-only-background-color, var(--utrecht-form-control-read-only-background-color, var(--utrecht-textarea-background-color, var(--utrecht-form-control-background-color)))); border-color: var(--utrecht-textarea-read-only-border-color, var(--utrecht-form-control-read-only-border-color, var(--utrecht-textarea-border-color, var(--utrecht-form-control-border-color)))); color: var(--utrecht-textarea-read-only-color, var(--utrecht-form-control-read-only-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); } .utrecht-textarea__placeholder { color: var(--utrecht-textarea-placeholder-color, var(--utrecht-form-control-placeholder-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); font-style: var(--utrecht-form-control-placeholder-font-style); opacity: 100%; } .utrecht-textarea--html-textarea:focus { background-color: var(--utrecht-textarea-focus-background-color, var(--utrecht-form-control-focus-background-color, var(--utrecht-textarea-background-color, var(--utrecht-form-control-background-color)))); border-color: var(--utrecht-textarea-focus-border-color, var(--utrecht-form-control-focus-border-color, var(--utrecht-textarea-border-color, var(--utrecht-form-control-border-color)))); color: var(--utrecht-textarea-focus-color, var(--utrecht-form-control-focus-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); } .utrecht-textarea--html-textarea:focus-visible { /* - The browser default focus ring should apply when these CSS custom properties are not set. * - Make the `box-shadow` value available, so components that have their own `box-shadow` * can combine it with the focus ring box shadow. */ --_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0) 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-textarea--html-textarea:invalid, .utrecht-textarea--html-textarea[aria-invalid=true] { --_utrecht-textarea-border-width: var( --utrecht-textarea-invalid-border-width, var( --utrecht-form-control-invalid-border-width, var(--utrecht-textarea-border-width, var(--utrecht-form-control-border-width)) ) ); border-color: var(--utrecht-textarea-invalid-border-color, var(--utrecht-form-control-invalid-border-color, var(--utrecht-textarea-border-color, var(--utrecht-form-control-border-color)))); border-width: var(--_utrecht-textarea-border-width); border-block-end-width: var(--utrecht-textarea-invalid-border-block-end-width, var(--utrecht-form-control-invalid-border-block-end-width, var(--utrecht-textarea-border-block-end-width, var(--utrecht-form-control-border-block-end-width, var(--_utrecht-textarea-border-width))))); background-color: var(--utrecht-textarea-invalid-background-color, var(--utrecht-form-control-invalid-background-color, var(--utrecht-textarea-background-color, var(--utrecht-form-control-background-color)))); color: var(--utrecht-textarea-invalid-color, var(--utrecht-form-control-invalid-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); } .utrecht-textarea--html-textarea { /* The `textarea:read-only` pseudo selector applies to both `<textarea readonly>` and `<textarea disabled>` */ } .utrecht-textarea--html-textarea:read-only { background-color: var(--utrecht-textarea-read-only-background-color, var(--utrecht-form-control-read-only-background-color, var(--utrecht-textarea-background-color, var(--utrecht-form-control-background-color)))); border-color: var(--utrecht-textarea-read-only-border-color, var(--utrecht-form-control-read-only-border-color, var(--utrecht-textarea-border-color, var(--utrecht-form-control-border-color)))); color: var(--utrecht-textarea-read-only-color, var(--utrecht-form-control-read-only-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); } .utrecht-textarea--html-textarea { /* * The `textarea:disabled` pseudo selector applies to `<textarea disabled>`, but not to `<textarea aria-disabled="true">` * * We consider `disabled` more specific than `read-only`, so the `:disabled` selector should come after the `:read-only` selector. */ } .utrecht-textarea--html-textarea:disabled { background-color: var(--utrecht-textarea-disabled-background-color, var(--utrecht-form-control-disabled-background-color, var(--utrecht-textarea-background-color, var(--utrecht-form-control-background-color)))); border-color: var(--utrecht-textarea-disabled-border-color, var(--utrecht-form-control-disabled-border-color, var(--utrecht-textarea-border-color, var(--utrecht-form-control-border-color)))); color: var(--utrecht-textarea-disabled-color, var(--utrecht-form-control-disabled-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); cursor: var(--utrecht-action-disabled-cursor, not-allowed); } .utrecht-textarea--html-textarea::placeholder { color: var(--utrecht-textarea-placeholder-color, var(--utrecht-form-control-placeholder-color, var(--utrecht-textarea-color, var(--utrecht-form-control-color)))); font-style: var(--utrecht-form-control-placeholder-font-style); opacity: 100%; } :host { display: block; } :host([hidden]) { display: none !important; }