@gemeentenijmegen/web-components 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
function styleInject(css, ref) {
|
|
5
|
+
if ( ref === void 0 ) ref = {};
|
|
6
|
+
var insertAt = ref.insertAt;
|
|
7
|
+
|
|
8
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
9
|
+
|
|
10
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
11
|
+
var style = document.createElement('style');
|
|
12
|
+
style.type = 'text/css';
|
|
13
|
+
|
|
14
|
+
if (insertAt === 'top') {
|
|
15
|
+
if (head.firstChild) {
|
|
16
|
+
head.insertBefore(style, head.firstChild);
|
|
17
|
+
} else {
|
|
18
|
+
head.appendChild(style);
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
head.appendChild(style);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (style.styleSheet) {
|
|
25
|
+
style.styleSheet.cssText = css;
|
|
26
|
+
} else {
|
|
27
|
+
style.appendChild(document.createTextNode(css));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var css_248z = "/* stylelint-disable no-descending-specificity */\n/**\n * @license EUPL-1.2\n * Copyright (c) 2020-2024 Frameless B.V.\n * Copyright (c) 2021-2024 Gemeente Utrecht\n */\n/**\n * @license EUPL-1.2\n * Copyright (c) 2020-2024 Frameless B.V.\n * Copyright (c) 2021-2024 Gemeente Utrecht\n */\n/* stylelint-disable scss/no-global-function-names */\n/**\n * @license EUPL-1.2\n * Copyright (c) 2020-2024 Frameless B.V.\n * Copyright (c) 2021-2024 Gemeente Utrecht\n */\n/* stylelint-disable-next-line block-no-empty */\n/*\n\n# CSS implementation\n\n## `text-decoration-skip`\n\n`text-decoration-skip` can be helpful to avoid making some texts unreadable.\nFor example by obscuring Arabic diacritics.\n\nHowever, the combination of a greater thickness and skipping this thick underline\nleads to a very unappealing rendering of the underline. To avoid this,\n`text-decoration-skip` is disabled for interactive states.\n\nFor design token configurations that have identical thickness for normal and interactive\nstates, this will lead to the (undesirable) effect that the focus/hover effect is switching\nfrom an interrupted to an uninterrupted underline (for some texts).\n\nApart from making `skip-ink` configurable for normal/focus/hover, there is no good solution yet.\n\n---\n\nDisabling `text-decoration-skip` for interactive states obscures some texts, and we assume for now\nthat moving the pointer away from a link or having focus elsewhere first is simple enough to\nnot make this too inconvenient.\n\n---\n\nSome folks implement the underline of links using `border-bottom` or even using a finely crafted\n`linear-gradient()` with a solid color at the bottom and transparent behind the text. These approaches\nwould unfortunately not be able to provide the improved readability of `text-decoration-skip`.\n\n## `text-decoration-thickness`\n\nVarying `text-decoration-thickness` can be used to distinguish interactive states.\n\n---\n\n`text-decoration-thickness` appears to have rendering differences between Chrome and Safari.\nIn Safari the line becomes thicker with extra pixels added to the bottom, while in Chrome\nthe underline offset also seems to increase along with the thickness, which effectively means\nthe underline is closer to the next line than in Safari.\n\n---\n\nIt might be nice to use font-relative units for `text-decoration-thickness`, and that is why we\nuse the `max()` function to ensure the underline remains visible for every font size.\n\n## `transition`\n\n`text-decoration-thickness` could be a candidate for animating between interactive states,\nhowever browsers don't seem to have implemented great looking supixel tweening yet.\n\n`text-decoration-skip` also makes the transition more challenging to implement.\n\n*/\n/**\n * Simulate forced-colors mode.\n */\n/* stylelint-disable-next-line block-no-empty */\n/* stylelint-disable-next-line block-no-empty */\n/* stylelint-disable-next-line block-no-empty */\n/* stylelint-disable-next-line block-no-empty */\n/**\n * Link for elements such as `<img>` or `<article>`, that are not inline elements or plain text.\n * \n * Changing `display: inline` to `inline-block` ensures the focus outline is rendered around the entire box.\n */\n/**\n * @license EUPL-1.2\n * Copyright (c) 2020-2024 Frameless B.V.\n * Copyright (c) 2021-2024 Gemeente Utrecht\n */\n/* stylelint-disable-next-line block-no-empty */\n.nijmegen-progress-list,\nnijmegen-progress-list {\n /* Configure `box-sizing` and `text-align` for `--center` */\n box-sizing: border-box;\n font-family: var(--utrecht-document-font-family, inherit);\n font-size: var(--utrecht-unordered-list-font-size, var(--utrecht-document-font-size, inherit));\n line-height: var(--utrecht-unordered-list-line-height, var(--utrecht-document-line-height, inherit));\n margin-block-end: calc(var(--utrecht-space-around, 0) * var(--utrecht-unordered-list-margin-block-end, var(--utrecht-paragraph-margin-block-end, 0)));\n margin-block-start: calc(var(--utrecht-space-around, 0) * var(--utrecht-unordered-list-margin-block-start, var(--utrecht-paragraph-margin-block-start, 0)));\n padding-inline-start: var(--utrecht-unordered-list-padding-inline-start, 2ch);\n text-align: start;\n counter-reset: nijmegen-counter;\n list-style: none;\n padding-inline-start: 0;\n}\n\n.nijmegen-progress-list__header {\n height: 3rem; /* stylelint-disable-line property-disallowed-list */\n padding-block-start: var(--nijmegen-progress-list-step-heading-padding-block-start);\n padding-inline-start: var(--nijmegen-progress-list-step-meta-padding-inline-start);\n position: relative;\n}\n.nijmegen-progress-list__header span {\n font-family: var(--nijmegen-progress-list-step-marker-font-family);\n font-size: var(--nijmegen-progress-list-step-marker-font-size);\n font-weight: var(--nijmegen-progress-list-step-marker-font-weight);\n}\n.nijmegen-progress-list__header span.nijmegen-sr-only {\n clip: rect(0, 0, 0, 0);\n height: 1px; /* stylelint-disable-line property-disallowed-list */\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; /* stylelint-disable-line property-disallowed-list */\n}\n\n.nijmegen-progress-list__button {\n background-color: var(--nijmegen-progress-list-button-checked-background-color);\n background-color: var(--nijmegen-progress-list-button-current-background-color);\n border-color: var(--nijmegen-progress-list-button-current-border-color);\n border-radius: var(--nijmegen-progress-list-button-border-radius);\n border-width: var(--nijmegen-progress-list-button-border-width);\n cursor: pointer;\n display: inline-flex;\n font-family: var(--nijmegen-progress-list-step-marker-font-family);\n font-size: var(--nijmegen-progress-list-step-marker-font-size);\n font-weight: var(--nijmegen-progress-list-step-marker-font-weight);\n gap: var(--nijmegen-progress-list-button-column-gap);\n min-block-size: var(--nijmegen-progress-list-button-min-block-size);\n min-inline-size: var(--nijmegen-progress-list-button-min-inline-size);\n padding: 0; /* stylelint-disable-line property-disallowed-list */\n text-align: inherit;\n}\n.nijmegen-progress-list__button:hover {\n background-color: var(--nijmegen-progress-list-button-current-hover-background-color);\n border-color: var(--nijmegen-progress-list-button-current-hover-border-color);\n color: var(--nijmegen-progress-list-button-current-hover-color);\n}\n.nijmegen-progress-list__button:active {\n background-color: var(--nijmegen-progress-list-button-current-active-background-color);\n border-color: var(--nijmegen-progress-list-button-current-active-border-color);\n color: var(--nijmegen-progress-list-button-current-active-color);\n}\n.nijmegen-progress-list__button:focus-visible {\n --_utrecht-link-state-color: var(--utrecht-link-focus-color);\n background-color: var(--utrecht-link-focus-background-color, transparent);\n text-decoration-skip: none;\n text-decoration-skip-ink: none;\n /*\n * WCAG SC 2.4.12: Focus Not Obscured\n * Use `z-index` to ensure the focus ring is stacked above adjecent elements with a `background`\n */\n /* - The browser default focus ring should apply when these CSS custom properties are not set.\n * - Make the `box-shadow` value available, so components that have their own `box-shadow`\n * can combine it with the focus ring box shadow.\n */\n --_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0)\n var(--utrecht-focus-inverse-outline-color, transparent);\n box-shadow: var(--_utrecht-focus-ring-box-shadow);\n outline-color: var(--utrecht-focus-outline-color, revert);\n outline-offset: var(--utrecht-focus-outline-offset, revert);\n outline-style: var(--utrecht-focus-outline-style, revert);\n outline-width: var(--utrecht-focus-outline-width, revert);\n z-index: 1;\n /*\n * The following tokens are deprecated, but we keep them for backwards compatibility for now:\n * \n * `--utrecht-link-focus-text-decoration`\n * `--utrecht-link-focus-text-decoration-thickness`\n */\n --_utrecht-link-state-text-decoration: var(\n --utrecht-link-focus-visible-text-decoration,\n var(--utrecht-link-focus-text-decoration)\n );\n --_utrecht-link-state-text-decoration-thickness: var(\n --utrecht-link-focus-visible-text-decoration-thickness,\n var(--utrecht-link-focus-text-decoration-thickness)\n );\n z-index: var(--utrecht-stack-focus-z-index, 1);\n background-color: var(--nijmegen-progress-list-button-current-focus-visible-background-color);\n border-color: var(--nijmegen-progress-list-button-current-focus-visible-border-color);\n color: var(--nijmegen-progress-list-button-current-focus-visible-color);\n}\n.nijmegen-progress-list__button[aria-expanded=true] svg {\n transform: scaleY(-1);\n}\n\n.nijmegen-progress-list__step {\n counter-increment: nijmegen-counter;\n position: relative;\n}\n.nijmegen-progress-list__step:last-child:not(:has(.nijmegen-progress-list__details--active)) .nijmegen-progress-list__body::after {\n display: none;\n}\n.nijmegen-progress-list__step:last-child .nijmegen-progress-list__sub-step:last-child::after {\n display: none;\n}\n.nijmegen-progress-list__step::before {\n align-items: center;\n background-position: center;\n background-repeat: no-repeat;\n border-radius: var(--nijmegen-progress-list-step-marker-border-radius);\n border-style: solid;\n border-width: var(--nijmegen-progress-list-step-marker-border-width);\n box-sizing: border-box;\n display: flex;\n font-family: var(--nijmegen-progress-list-step-marker-font-family);\n font-size: var(--nijmegen-progress-list-step-marker-font-size);\n font-weight: var(--nijmegen-progress-list-step-marker-font-weight);\n height: var(--nijmegen-progress-list-step-marker-size); /* stylelint-disable-line property-disallowed-list */\n justify-content: space-around;\n line-height: var(--nijmegen-progress-list-step-marker-line-height);\n position: absolute;\n background-color: var(--nijmegen-progress-list-step-marker-not-checked-background-color);\n border-color: var(--nijmegen-progress-list-connector-not-checked-border-color);\n color: var(--nijmegen-progress-list-step-marker-not-checked-color);\n content: counter(nijmegen-counter);\n width: var(--nijmegen-progress-list-step-marker-size); /* stylelint-disable-line property-disallowed-list */\n}\n.nijmegen-progress-list__step--current::before {\n background-color: var(--nijmegen-progress-list-step-marker-current-background-color);\n border-color: var(--nijmegen-progress-list-step-marker-current-background-color);\n color: var(--nijmegen-progress-list-step-marker-current-color);\n}\n.nijmegen-progress-list__step--not-checked::before {\n background-color: var(--nijmegen-progress-list-step-marker-not-checked-background-color);\n border-color: var(--nijmegen-progress-list-connector-not-checked-border-color);\n color: var(--nijmegen-progress-list-step-marker-not-checked-color);\n}\n.nijmegen-progress-list__step--error::before {\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiA0QzcuNTgxNzIgNCA0IDcuNTgxNzIgNCAxMkM0IDE2LjQxODMgNy41ODE3MiAyMCAxMiAyMEMxNi40MTgzIDIwIDIwIDE2LjQxODMgMjAgMTJDMjAgNy41ODE3MiAxNi40MTgzIDQgMTIgNFpNMiAxMkMyIDYuNDc3MTUgNi40NzcxNSAyIDEyIDJDMTcuNTIyOCAyIDIyIDYuNDc3MTUgMjIgMTJDMjIgMTcuNTIyOCAxNy41MjI4IDIyIDEyIDIyQzYuNDc3MTUgMjIgMiAxNy41MjI4IDIgMTJaTTEyIDdDMTIuNTUyMyA3IDEzIDcuNDQ3NzIgMTMgOFYxMkMxMyAxMi41NTIzIDEyLjU1MjMgMTMgMTIgMTNDMTEuNDQ3NyAxMyAxMSAxMi41NTIzIDExIDEyVjhDMTEgNy40NDc3MiAxMS40NDc3IDcgMTIgN1pNMTEgMTZDMTEgMTUuNDQ3NyAxMS40NDc3IDE1IDEyIDE1SDEyLjAxQzEyLjU2MjMgMTUgMTMuMDEgMTUuNDQ3NyAxMy4wMSAxNkMxMy4wMSAxNi41NTIzIDEyLjU2MjMgMTcgMTIuMDEgMTdIMTJDMTEuNDQ3NyAxNyAxMSAxNi41NTIzIDExIDE2WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==\");\n content: \"\";\n background-color: var(--nijmegen-progress-list-step-marker-error-background-color);\n border-color: var(--nijmegen-progress-list-step-marker-error-border-color);\n color: var(--nijmegen-progress-list-step-marker-error-color);\n}\n.nijmegen-progress-list__step--error:has(.nijmegen-progress-list__body)::after,\n.nijmegen-progress-list__step--error:has(.nijmegen-progress-list__body) .nijmegen-progress-list__body::after {\n border-color: var(--nijmegen-progress-list-connector-error-border-color);\n border-inline-start-style: solid;\n}\n.nijmegen-progress-list__step--error:has(.nijmegen-progress-list__details) .nijmegen-progress-list__header::after {\n border-color: var(--nijmegen-progress-list-connector-error-border-color);\n border-inline-start-style: solid;\n}\n.nijmegen-progress-list__step--error .nijmegen-progress-list__button {\n background-color: var(--nijmegen-progress-list-button-error-background-color);\n border-color: var(--nijmegen-progress-list-button-error-border-color);\n}\n.nijmegen-progress-list__step--error .nijmegen-progress-list__button:hover {\n background-color: var(--nijmegen-progress-list-button-error-hover-background-color);\n border-color: var(--nijmegen-progress-list-button-error-hover-border-color);\n color: var(--nijmegen-progress-list-button-error-hover-color);\n}\n.nijmegen-progress-list__step--error .nijmegen-progress-list__button:active {\n background-color: var(--nijmegen-progress-list-button-error-active-background-color);\n border-color: var(--nijmegen-progress-list-button-error-active-border-color);\n color: var(--nijmegen-progress-list-button-error-active-color);\n}\n.nijmegen-progress-list__step--error .nijmegen-progress-list__button:focus-visible {\n --_utrecht-link-state-color: var(--utrecht-link-focus-color);\n background-color: var(--utrecht-link-focus-background-color, transparent);\n text-decoration-skip: none;\n text-decoration-skip-ink: none;\n /*\n * WCAG SC 2.4.12: Focus Not Obscured\n * Use `z-index` to ensure the focus ring is stacked above adjecent elements with a `background`\n */\n /* - The browser default focus ring should apply when these CSS custom properties are not set.\n * - Make the `box-shadow` value available, so components that have their own `box-shadow`\n * can combine it with the focus ring box shadow.\n */\n --_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0)\n var(--utrecht-focus-inverse-outline-color, transparent);\n box-shadow: var(--_utrecht-focus-ring-box-shadow);\n outline-color: var(--utrecht-focus-outline-color, revert);\n outline-offset: var(--utrecht-focus-outline-offset, revert);\n outline-style: var(--utrecht-focus-outline-style, revert);\n outline-width: var(--utrecht-focus-outline-width, revert);\n z-index: 1;\n /*\n * The following tokens are deprecated, but we keep them for backwards compatibility for now:\n * \n * `--utrecht-link-focus-text-decoration`\n * `--utrecht-link-focus-text-decoration-thickness`\n */\n --_utrecht-link-state-text-decoration: var(\n --utrecht-link-focus-visible-text-decoration,\n var(--utrecht-link-focus-text-decoration)\n );\n --_utrecht-link-state-text-decoration-thickness: var(\n --utrecht-link-focus-visible-text-decoration-thickness,\n var(--utrecht-link-focus-text-decoration-thickness)\n );\n z-index: var(--utrecht-stack-focus-z-index, 1);\n background-color: var(--nijmegen-progress-list-button-error-focus-visible-background-color);\n border-color: var(--nijmegen-progress-list-button-error-focus-visible-border-color);\n color: var(--nijmegen-progress-list-button-error-focus-visible-color);\n}\n.nijmegen-progress-list__step--warning::before {\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjM3MDI4IDMuNTA1NzdDOS45MDAwNCAyLjU1NjQ0IDEwLjkwMjIgMS45Njc3MSAxMS45OSAxLjk2NzcxQzEzLjA3NzcgMS45Njc3MSAxNC4wNzk5IDIuNTU2NDMgMTQuNjA5NiAzLjUwNTc1TDIxLjcwNTEgMTUuNzQ4QzIxLjcyODcgMTUuNzg4NyAyMS43NDk0IDE1LjgzMDkgMjEuNzY3IDE1Ljg3NDRDMjIuMTM5NyAxNi43OTU3IDIyLjAzMTkgMTcuODQxOCAyMS40NzkzIDE4LjY2NzhDMjAuOTI2NiAxOS40OTM4IDIwLjAwMDggMTkuOTkyNSAxOS4wMDcgMTkuOTk5NEwxOSAxOS45OTk1SDQuOTk5OTVDNC45ODE2OCAxOS45OTk1IDQuOTYzNTEgMTkuOTk5IDQuOTQ1NDggMTkuOTk4QzQuOTEwMjIgMTkuOTk5OSA0Ljg3NDUyIDIwIDQuODM4NDcgMTkuOTk4MUMzLjg2ODc3IDE5Ljk0ODEgMi45ODMyNCAxOS40MzE5IDIuNDYxOTQgMTguNjEyN0MxLjk0MDY1IDE3Ljc5MzYgMS44NDgwNiAxNi43NzI3IDIuMjEzNDcgMTUuODczMUMyLjIzMDk3IDE1LjgzMDEgMi4yNTE0NSAxNS43ODgyIDIuMjc0NzcgMTUuNzQ4TDkuMzcwMjggMy41MDU3N1pNNC45NDQ3MSAxOC4wMDFDNC45NjMgMTggNC45ODE0MiAxNy45OTk1IDQuOTk5OTUgMTcuOTk5NUgxOC45OTU5QzE5LjMyNiAxNy45OTYyIDE5LjYzMzQgMTcuODMwMSAxOS44MTcgMTcuNTU1NkMxOS45OTA0IDE3LjI5NjYgMjAuMDMyNCAxNi45NzI2IDE5LjkzMzMgMTYuNjc5NEwxMi44NzQ4IDQuNTAwOTJMMTIuODY1IDQuNDgzNTlDMTIuNjg4OCA0LjE2NTI3IDEyLjM1MzcgMy45Njc3MSAxMS45OSAzLjk2NzcxQzExLjYyNjIgMy45Njc3MSAxMS4yOTExIDQuMTY1MjcgMTEuMTE1IDQuNDgzNTlMMTEuMTA1MSA0LjUwMDkyTDQuMDQ2MiAxNi42ODAxQzMuOTQ4ODUgMTYuOTY2MiAzLjk4NTkxIDE3LjI4MjMgNC4xNDkyNyAxNy41MzlDNC4zMjMwMyAxNy44MTIxIDQuNjE4MjEgMTcuOTg0MSA0Ljk0MTQ0IDE4LjAwMDhDNC45NDI1MyAxOC4wMDA5IDQuOTQzNjIgMTguMDAwOSA0Ljk0NDcxIDE4LjAwMVpNMTIgNy45OTk0N0MxMi41NTIyIDcuOTk5NDcgMTMgOC40NDcxOCAxMyA4Ljk5OTQ3VjEwLjk5OTVDMTMgMTEuNTUxOCAxMi41NTIyIDExLjk5OTUgMTIgMTEuOTk5NUMxMS40NDc3IDExLjk5OTUgMTEgMTEuNTUxOCAxMSAxMC45OTk1VjguOTk5NDdDMTEgOC40NDcxOCAxMS40NDc3IDcuOTk5NDcgMTIgNy45OTk0N1pNMTEgMTQuOTk5NUMxMSAxNC40NDcyIDExLjQ0NzcgMTMuOTk5NSAxMiAxMy45OTk1SDEyLjAxQzEyLjU2MjIgMTMuOTk5NSAxMy4wMSAxNC40NDcyIDEzLjAxIDE0Ljk5OTVDMTMuMDEgMTUuNTUxOCAxMi41NjIyIDE1Ljk5OTUgMTIuMDEgMTUuOTk5NUgxMkMxMS40NDc3IDE1Ljk5OTUgMTEgMTUuNTUxOCAxMSAxNC45OTk1WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==\");\n content: \"\";\n background-color: var(--nijmegen-progress-list-step-marker-warning-background-color);\n border-color: var(--nijmegen-progress-list-step-marker-warning-border-color);\n color: var(--nijmegen-progress-list-step-marker-warning-color);\n}\n.nijmegen-progress-list__step--warning:has(.nijmegen-progress-list__body)::after,\n.nijmegen-progress-list__step--warning:has(.nijmegen-progress-list__body) .nijmegen-progress-list__body::after {\n border-color: var(--nijmegen-progress-list-connector-warning-border-color);\n border-inline-start-style: solid;\n}\n.nijmegen-progress-list__step--warning:has(.nijmegen-progress-list__details) .nijmegen-progress-list__header::after {\n border-color: var(--nijmegen-progress-list-connector-warning-border-color);\n border-inline-start-style: solid;\n}\n.nijmegen-progress-list__step--warning .nijmegen-progress-list__button {\n background-color: var(--nijmegen-progress-list-button-warning-background-color);\n border-color: var(--nijmegen-progress-list-button-warning-border-color);\n}\n.nijmegen-progress-list__step--warning .nijmegen-progress-list__button:hover {\n background-color: var(--nijmegen-progress-list-button-warning-hover-background-color);\n border-color: var(--nijmegen-progress-list-button-warning-hover-border-color);\n color: var(--nijmegen-progress-list-button-warning-hover-color);\n}\n.nijmegen-progress-list__step--warning .nijmegen-progress-list__button:active {\n background-color: var(--nijmegen-progress-list-button-warning-active-background-color);\n border-color: var(--nijmegen-progress-list-button-warning-active-border-color);\n color: var(--nijmegen-progress-list-button-warning-active-color);\n}\n.nijmegen-progress-list__step--warning .nijmegen-progress-list__button:focus-visible {\n --_utrecht-link-state-color: var(--utrecht-link-focus-color);\n background-color: var(--utrecht-link-focus-background-color, transparent);\n text-decoration-skip: none;\n text-decoration-skip-ink: none;\n /*\n * WCAG SC 2.4.12: Focus Not Obscured\n * Use `z-index` to ensure the focus ring is stacked above adjecent elements with a `background`\n */\n /* - The browser default focus ring should apply when these CSS custom properties are not set.\n * - Make the `box-shadow` value available, so components that have their own `box-shadow`\n * can combine it with the focus ring box shadow.\n */\n --_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0)\n var(--utrecht-focus-inverse-outline-color, transparent);\n box-shadow: var(--_utrecht-focus-ring-box-shadow);\n outline-color: var(--utrecht-focus-outline-color, revert);\n outline-offset: var(--utrecht-focus-outline-offset, revert);\n outline-style: var(--utrecht-focus-outline-style, revert);\n outline-width: var(--utrecht-focus-outline-width, revert);\n z-index: 1;\n /*\n * The following tokens are deprecated, but we keep them for backwards compatibility for now:\n * \n * `--utrecht-link-focus-text-decoration`\n * `--utrecht-link-focus-text-decoration-thickness`\n */\n --_utrecht-link-state-text-decoration: var(\n --utrecht-link-focus-visible-text-decoration,\n var(--utrecht-link-focus-text-decoration)\n );\n --_utrecht-link-state-text-decoration-thickness: var(\n --utrecht-link-focus-visible-text-decoration-thickness,\n var(--utrecht-link-focus-text-decoration-thickness)\n );\n z-index: var(--utrecht-stack-focus-z-index, 1);\n background-color: var(--nijmegen-progress-list-button-warning-focus-visible-background-color);\n border-color: var(--nijmegen-progress-list-button-warning-focus-visible-border-color);\n color: var(--nijmegen-progress-list-button-warning-focus-visible-color);\n}\n.nijmegen-progress-list__step--checked::before {\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMC43MDcxIDYuMjkyODlDMjEuMDk3NiA2LjY4MzQyIDIxLjA5NzYgNy4zMTY1OCAyMC43MDcxIDcuNzA3MTFMMTAuNzA3MSAxNy43MDcxQzEwLjMxNjYgMTguMDk3NiA5LjY4MzQyIDE4LjA5NzYgOS4yOTI4OSAxNy43MDcxTDQuMjkyODkgMTIuNzA3MUMzLjkwMjM3IDEyLjMxNjYgMy45MDIzNyAxMS42ODM0IDQuMjkyODkgMTEuMjkyOUM0LjY4MzQyIDEwLjkwMjQgNS4zMTY1OCAxMC45MDI0IDUuNzA3MTEgMTEuMjkyOUwxMCAxNS41ODU4TDE5LjI5MjkgNi4yOTI4OUMxOS42ODM0IDUuOTAyMzcgMjAuMzE2NiA1LjkwMjM3IDIwLjcwNzEgNi4yOTI4OVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=\");\n content: \"\";\n background-color: var(--nijmegen-progress-list-step-marker-checked-background-color);\n border-color: var(--nijmegen-progress-list-step-marker-checked-border-color);\n color: var(--nijmegen-progress-list-step-marker-checked-color);\n}\n.nijmegen-progress-list__step--checked:has(.nijmegen-progress-list__body)::after,\n.nijmegen-progress-list__step--checked:has(.nijmegen-progress-list__body) .nijmegen-progress-list__body::after {\n border-color: var(--nijmegen-progress-list-connector-checked-border-color);\n border-inline-start-style: solid;\n}\n.nijmegen-progress-list__step--checked:has(.nijmegen-progress-list__details) .nijmegen-progress-list__header::after {\n border-color: var(--nijmegen-progress-list-connector-checked-border-color);\n border-inline-start-style: solid;\n}\n.nijmegen-progress-list__step--checked .nijmegen-progress-list__button {\n background-color: var(--nijmegen-progress-list-button-checked-background-color);\n border-color: var(--nijmegen-progress-list-button-checked-border-color);\n}\n.nijmegen-progress-list__step--checked .nijmegen-progress-list__button:hover {\n background-color: var(--nijmegen-progress-list-button-checked-hover-background-color);\n border-color: var(--nijmegen-progress-list-button-checked-hover-border-color);\n color: var(--nijmegen-progress-list-button-checked-hover-color);\n}\n.nijmegen-progress-list__step--checked .nijmegen-progress-list__button:active {\n background-color: var(--nijmegen-progress-list-button-checked-active-background-color);\n border-color: var(--nijmegen-progress-list-button-checked-active-border-color);\n color: var(--nijmegen-progress-list-button-checked-active-color);\n}\n.nijmegen-progress-list__step--checked .nijmegen-progress-list__button:focus-visible {\n --_utrecht-link-state-color: var(--utrecht-link-focus-color);\n background-color: var(--utrecht-link-focus-background-color, transparent);\n text-decoration-skip: none;\n text-decoration-skip-ink: none;\n /*\n * WCAG SC 2.4.12: Focus Not Obscured\n * Use `z-index` to ensure the focus ring is stacked above adjecent elements with a `background`\n */\n /* - The browser default focus ring should apply when these CSS custom properties are not set.\n * - Make the `box-shadow` value available, so components that have their own `box-shadow`\n * can combine it with the focus ring box shadow.\n */\n --_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0)\n var(--utrecht-focus-inverse-outline-color, transparent);\n box-shadow: var(--_utrecht-focus-ring-box-shadow);\n outline-color: var(--utrecht-focus-outline-color, revert);\n outline-offset: var(--utrecht-focus-outline-offset, revert);\n outline-style: var(--utrecht-focus-outline-style, revert);\n outline-width: var(--utrecht-focus-outline-width, revert);\n z-index: 1;\n /*\n * The following tokens are deprecated, but we keep them for backwards compatibility for now:\n * \n * `--utrecht-link-focus-text-decoration`\n * `--utrecht-link-focus-text-decoration-thickness`\n */\n --_utrecht-link-state-text-decoration: var(\n --utrecht-link-focus-visible-text-decoration,\n var(--utrecht-link-focus-text-decoration)\n );\n --_utrecht-link-state-text-decoration-thickness: var(\n --utrecht-link-focus-visible-text-decoration-thickness,\n var(--utrecht-link-focus-text-decoration-thickness)\n );\n z-index: var(--utrecht-stack-focus-z-index, 1);\n background-color: var(--nijmegen-progress-list-button-checked-focus-visible-background-color);\n border-color: var(--nijmegen-progress-list-button-checked-focus-visible-border-color);\n color: var(--nijmegen-progress-list-button-checked-focus-visible-color);\n}\n\n.nijmegen-progress-list__body {\n margin-block-end: var(--nijmegen-progress-list-sub-step-margin-block-start);\n padding-inline-start: var(--nijmegen-progress-list-step-meta-padding-inline-start);\n position: relative;\n}\n.nijmegen-progress-list__body::after {\n border-inline-start-width: var(--nijmegen-progress-list-connector-border-width);\n content: \"\";\n inset-block-start: 0;\n inset-inline-start: var(--nijmegen-progress-list-connector-padding-inline-start);\n position: absolute;\n z-index: -1;\n border-color: var(--nijmegen-progress-list-connector-not-checked-border-color);\n border-inline-start-style: dashed;\n /* stylelint-disable-next-line property-disallowed-list */\n height: calc(100% + var(--nijmegen-progress-list-step-meta-padding-inline-start) + 0.5rem);\n inset-block-start: calc(-1 * var(--nijmegen-progress-list-sub-step-margin-block-start));\n}\n\n.nijmegen-progress-list__meta {\n display: flex;\n flex-direction: column;\n gap: var(--nijmegen-progress-list-step-body-row-gap);\n}\n.nijmegen-progress-list__meta .utrecht-paragraph {\n margin: 0; /* stylelint-disable-line property-disallowed-list */\n}\n.nijmegen-progress-list__meta .utrecht-paragraph--lead {\n font-size: 1.25rem;\n}\n.nijmegen-progress-list__step--toggle .nijmegen-progress-list__meta {\n display: none;\n}\n.nijmegen-progress-list__step--active .nijmegen-progress-list__meta {\n display: flex;\n}\n\n.nijmegen-progress-list__details {\n all: unset;\n display: flex;\n flex-direction: column;\n gap: var(--nijmegen-progress-list-step-body-row-gap);\n}\n.nijmegen-progress-list__step--toggle .nijmegen-progress-list__details {\n display: none;\n}\n.nijmegen-progress-list__step--active .nijmegen-progress-list__details {\n display: flex;\n}\n\n.nijmegen-progress-list__sub-step {\n margin-block-end: var(--nijmegen-progress-list-sub-step-margin-block-start);\n padding-inline-start: var(--nijmegen-progress-list-step-meta-padding-inline-start);\n position: relative;\n}\n.nijmegen-progress-list__sub-step::before {\n align-items: center;\n background-position: center;\n background-repeat: no-repeat;\n border-radius: var(--nijmegen-progress-list-step-marker-border-radius);\n border-style: solid;\n border-width: var(--nijmegen-progress-list-step-marker-border-width);\n box-sizing: border-box;\n display: flex;\n font-family: var(--nijmegen-progress-list-step-marker-font-family);\n font-size: var(--nijmegen-progress-list-step-marker-font-size);\n font-weight: var(--nijmegen-progress-list-step-marker-font-weight);\n height: var(--nijmegen-progress-list-step-marker-size); /* stylelint-disable-line property-disallowed-list */\n justify-content: space-around;\n line-height: var(--nijmegen-progress-list-step-marker-line-height);\n position: absolute;\n background-color: var(--nijmegen-progress-list-step-marker-not-checked-background-color);\n border-color: var(--nijmegen-progress-list-connector-not-checked-border-color);\n color: var(--nijmegen-progress-list-step-marker-not-checked-color);\n content: \"\";\n height: var(--nijmegen-progress-list-step-marker-nested-size); /* stylelint-disable-line property-disallowed-list */\n inset-block-start: var(--nijmegen-progress-list-step-marker-nested-inset-block-start);\n left: 0.55rem; /* stylelint-disable-line property-disallowed-list */\n width: var(--nijmegen-progress-list-step-marker-nested-size); /* stylelint-disable-line property-disallowed-list */\n}\n.nijmegen-progress-list__sub-step::after {\n border-inline-start-width: var(--nijmegen-progress-list-connector-border-width);\n content: \"\";\n inset-block-start: 0;\n inset-inline-start: var(--nijmegen-progress-list-connector-padding-inline-start);\n position: absolute;\n z-index: -1;\n border-color: var(--nijmegen-progress-list-connector-not-checked-border-color);\n border-inline-start-style: dashed;\n /* stylelint-disable-next-line property-disallowed-list */\n height: calc(100% + var(--nijmegen-progress-list-step-meta-padding-inline-start) - 0.5rem);\n inset-block-start: 0.5rem;\n}\n.nijmegen-progress-list__sub-step--current::before {\n background-color: var(--nijmegen-progress-list-step-marker-current-background-color);\n border-color: var(--nijmegen-progress-list-step-marker-current-background-color);\n color: var(--nijmegen-progress-list-step-marker-current-color);\n}\n.nijmegen-progress-list__sub-step--not-checked::before {\n background-color: var(--nijmegen-progress-list-step-marker-not-checked-background-color);\n border-color: var(--nijmegen-progress-list-connector-not-checked-border-color);\n color: var(--nijmegen-progress-list-step-marker-not-checked-color);\n}\n.nijmegen-progress-list__sub-step--error::before {\n background-color: var(--nijmegen-progress-list-step-marker-error-background-color);\n border-color: var(--nijmegen-progress-list-step-marker-error-border-color);\n color: var(--nijmegen-progress-list-step-marker-error-color);\n}\n.nijmegen-progress-list__sub-step--error::after {\n border-color: var(--nijmegen-progress-list-connector-error-border-color);\n border-inline-start-style: solid;\n}\n.nijmegen-progress-list__sub-step--warning::before {\n background-color: var(--nijmegen-progress-list-step-marker-warning-background-color);\n border-color: var(--nijmegen-progress-list-step-marker-warning-border-color);\n color: var(--nijmegen-progress-list-step-marker-warning-color);\n}\n.nijmegen-progress-list__sub-step--warning::after {\n border-color: var(--nijmegen-progress-list-connector-warning-border-color);\n border-inline-start-style: solid;\n}\n.nijmegen-progress-list__sub-step--checked::before {\n background-color: var(--nijmegen-progress-list-step-marker-checked-background-color);\n border-color: var(--nijmegen-progress-list-step-marker-checked-border-color);\n color: var(--nijmegen-progress-list-step-marker-checked-color);\n}\n.nijmegen-progress-list__sub-step--checked::after {\n border-color: var(--nijmegen-progress-list-connector-checked-border-color);\n border-inline-start-style: solid;\n}";
|
|
32
|
+
styleInject(css_248z);
|
|
33
|
+
|
|
34
|
+
var html = "<div>\n <slot></slot>\n</div>\n";
|
|
35
|
+
|
|
36
|
+
class NijmegenProgressList extends HTMLElement {
|
|
37
|
+
static get observedAttributes() {
|
|
38
|
+
return ['full'];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
const template = document.createElement('template');
|
|
44
|
+
template.innerHTML = html;
|
|
45
|
+
|
|
46
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
47
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
48
|
+
|
|
49
|
+
const stylesheet = new CSSStyleSheet();
|
|
50
|
+
stylesheet.replaceSync(css_248z);
|
|
51
|
+
shadowRoot.adoptedStyleSheets = [stylesheet];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
connectedCallback() {
|
|
55
|
+
Array.from(this.children).forEach((child) => {
|
|
56
|
+
child.addEventListener('click', (event) => {
|
|
57
|
+
const button = event.target.closest('.nijmegen-progress-list__button[aria-expanded]');
|
|
58
|
+
if (button) {
|
|
59
|
+
this.#handleToggle(button);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
#handleToggle(button) {
|
|
66
|
+
const isExpanded = button.getAttribute('aria-expanded') === 'true';
|
|
67
|
+
const step = button.closest('.nijmegen-progress-list__step');
|
|
68
|
+
|
|
69
|
+
button.setAttribute('aria-expanded', String(!isExpanded));
|
|
70
|
+
this.#updateAriaLabel(button, !isExpanded);
|
|
71
|
+
|
|
72
|
+
if (step) {
|
|
73
|
+
step.classList.toggle('nijmegen-progress-list__step--active', !isExpanded);
|
|
74
|
+
|
|
75
|
+
const meta = step.querySelector('.nijmegen-progress-list__meta');
|
|
76
|
+
if (meta) {
|
|
77
|
+
meta.hidden = isExpanded;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const details = step.querySelector('.nijmegen-progress-list__details');
|
|
81
|
+
if (details) {
|
|
82
|
+
details.hidden = isExpanded;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#updateAriaLabel(button, isExpanded) {
|
|
88
|
+
const baseText = button.textContent?.trim() || '';
|
|
89
|
+
|
|
90
|
+
if (isExpanded) {
|
|
91
|
+
button.setAttribute('aria-label', `${baseText} - Details verbergen`);
|
|
92
|
+
} else {
|
|
93
|
+
button.setAttribute('aria-label', `${baseText} - Details tonen`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
customElements.define('nijmegen-progress-list', NijmegenProgressList);
|
|
99
|
+
|
|
100
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.9",
|
|
3
3
|
"author": "gemeente Nijmegen",
|
|
4
4
|
"description": "Web components for the gemeente Nijmegen design system",
|
|
5
5
|
"license": "EUPL-1.2",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"clean": "rimraf dist"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gemeentenijmegen/components-css": "0.1.
|
|
29
|
+
"@gemeentenijmegen/components-css": "0.1.9",
|
|
30
30
|
"postcss-discard-duplicates": "7.0.1",
|
|
31
31
|
"rollup": "4.12.1",
|
|
32
32
|
"rollup-plugin-html": "0.2.1",
|
|
33
33
|
"rollup-plugin-node-resolve": "5.2.0",
|
|
34
34
|
"rollup-plugin-postcss": "4.0.2"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "0e863a185ca8b139ab59b1bd9677b76caadbe150"
|
|
37
37
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import style from '@gemeentenijmegen/components-css/progress-list/index.scss';
|
|
2
|
+
import html from './template.html';
|
|
3
|
+
|
|
4
|
+
class NijmegenProgressList extends HTMLElement {
|
|
5
|
+
static get observedAttributes() {
|
|
6
|
+
return ['full'];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
const template = document.createElement('template');
|
|
12
|
+
template.innerHTML = html;
|
|
13
|
+
|
|
14
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
15
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
16
|
+
|
|
17
|
+
const stylesheet = new CSSStyleSheet();
|
|
18
|
+
stylesheet.replaceSync(style);
|
|
19
|
+
shadowRoot.adoptedStyleSheets = [stylesheet];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
Array.from(this.children).forEach((child) => {
|
|
24
|
+
child.addEventListener('click', (event) => {
|
|
25
|
+
const button = event.target.closest('.nijmegen-progress-list__button[aria-expanded]');
|
|
26
|
+
if (button) {
|
|
27
|
+
this.#handleToggle(button);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#handleToggle(button) {
|
|
34
|
+
const isExpanded = button.getAttribute('aria-expanded') === 'true';
|
|
35
|
+
const step = button.closest('.nijmegen-progress-list__step');
|
|
36
|
+
|
|
37
|
+
button.setAttribute('aria-expanded', String(!isExpanded));
|
|
38
|
+
this.#updateAriaLabel(button, !isExpanded);
|
|
39
|
+
|
|
40
|
+
if (step) {
|
|
41
|
+
step.classList.toggle('nijmegen-progress-list__step--active', !isExpanded);
|
|
42
|
+
|
|
43
|
+
const meta = step.querySelector('.nijmegen-progress-list__meta');
|
|
44
|
+
if (meta) {
|
|
45
|
+
meta.hidden = isExpanded;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const details = step.querySelector('.nijmegen-progress-list__details');
|
|
49
|
+
if (details) {
|
|
50
|
+
details.hidden = isExpanded;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#updateAriaLabel(button, isExpanded) {
|
|
56
|
+
const baseText = button.textContent?.trim() || '';
|
|
57
|
+
|
|
58
|
+
if (isExpanded) {
|
|
59
|
+
button.setAttribute('aria-label', `${baseText} - Details verbergen`);
|
|
60
|
+
} else {
|
|
61
|
+
button.setAttribute('aria-label', `${baseText} - Details tonen`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
customElements.define('nijmegen-progress-list', NijmegenProgressList);
|