@nldd/design-system 0.8.96 → 0.8.98
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.
- package/README.md +14 -10
- package/custom-elements.json +528 -107
- package/dist/components/components.js +894 -267
- package/dist/components/content/code-viewer/code-viewer.d.ts +4 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +43 -5
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js +11 -0
- package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.js +1 -0
- package/dist/components/content/code-viewer/code-viewer.template.js.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +1 -1
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.d.ts.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.js +15 -4
- package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
- package/dist/components/content/icon/icon-registry.js +12 -12
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/image/image.d.ts +19 -3
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +25 -4
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/image/image.styles.d.ts.map +1 -1
- package/dist/components/content/image/image.styles.js +36 -0
- package/dist/components/content/image/image.styles.js.map +1 -1
- package/dist/components/content/image/image.template.d.ts.map +1 -1
- package/dist/components/content/image/image.template.js +13 -1
- package/dist/components/content/image/image.template.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +25 -12
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +25 -12
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +7 -0
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +29 -2
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/{dist-CH9m014O.js → dist-B2QcygzG.js} +1 -1
- package/dist/components/{dist-DMHTTJRJ.js → dist-BB5mlo7D.js} +2 -2
- package/dist/components/{dist-C3uWRipu.js → dist-Bo5Jeyfn.js} +1 -1
- package/dist/components/{dist-CpW8MF-L.js → dist-Bud_7w5g.js} +232 -214
- package/dist/components/{dist-CvL6_ezZ.js → dist-CA0yDFIt.js} +2 -2
- package/dist/components/{dist-DV6Mp5N1.js → dist-CaxHkqR2.js} +3 -3
- package/dist/components/{dist-BWRYv3Mp.js → dist-Ch3gNAuT.js} +1 -1
- package/dist/components/{dist-PlhQXXtE.js → dist-DbNhCpS5.js} +1 -1
- package/dist/components/{dist-DTOshgo1.js → dist-DkqAbJH8.js} +1 -1
- package/dist/components/{dist-BWEAw34D.js → dist-DnZmcpbQ.js} +1 -1
- package/dist/components/{dist-Bi4EHsFY.js → dist-iC2RTM0V.js} +2 -2
- package/dist/components/forms/validation-list/validation-list.d.ts +19 -9
- package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.js +38 -12
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/{icon-DQHT2C7z.js → icon-D_ZGezHx.js} +13 -13
- package/dist/components/{icon-button-mevRsl4C.js → icon-button-CJIikwyu.js} +16 -3
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +1 -4
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +1 -4
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/layout/box/box.d.ts +1 -1
- package/dist/components/layout/box/box.js +1 -1
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +2 -1
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +9 -3
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +36 -13
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page/page.styles.js +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +2 -0
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +3 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js +5 -0
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +57 -11
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +158 -15
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.js +95 -41
- package/dist/components/layout/page-sections/hero/hero.styles.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +4 -0
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js +8 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js +13 -0
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +4 -0
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +8 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js +17 -0
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/page-section-controls.d.ts +11 -1
- package/dist/components/layout/page-sections/page-section-controls.d.ts.map +1 -1
- package/dist/components/layout/page-sections/page-section-controls.js +11 -2
- package/dist/components/layout/page-sections/page-section-controls.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +5 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +6 -2
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +13 -10
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js +6 -6
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +2 -0
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.js +3 -2
- package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.js +2 -2
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +4 -0
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +8 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js +17 -0
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js.map +1 -1
- package/dist/components/layout/sheet/sheet.js +1 -1
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/{app-view/app-view.d.ts → shell/shell.d.ts} +11 -11
- package/dist/components/layout/shell/shell.d.ts.map +1 -0
- package/dist/components/layout/{app-view/app-view.js → shell/shell.js} +24 -24
- package/dist/components/layout/shell/shell.js.map +1 -0
- package/dist/components/layout/shell/shell.styles.d.ts +2 -0
- package/dist/components/layout/shell/shell.styles.d.ts.map +1 -0
- package/dist/components/layout/{app-view/app-view.styles.js → shell/shell.styles.js} +8 -8
- package/dist/components/layout/shell/shell.styles.js.map +1 -0
- package/dist/components/layout/shell/shell.template.d.ts +4 -0
- package/dist/components/layout/shell/shell.template.d.ts.map +1 -0
- package/dist/components/layout/shell/shell.template.js +9 -0
- package/dist/components/layout/shell/shell.template.js.map +1 -0
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +2 -0
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +2 -0
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +6 -1
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +7 -2
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +31 -6
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +55 -11
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.js +7 -6
- package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +4 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +8 -2
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +19 -2
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +7 -2
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +15 -3
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js +12 -2
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.d.ts +1 -0
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js +55 -40
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.d.ts +50 -4
- package/dist/components/navigation/skip-link/skip-link.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.js +140 -13
- package/dist/components/navigation/skip-link/skip-link.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.template.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.template.js +1 -0
- package/dist/components/navigation/skip-link/skip-link.template.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +8 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +9 -2
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +10 -0
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.js +21 -0
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/css/document-reset.css +3 -3
- package/dist/css/rich-text.css +36 -90
- package/dist/nldd.min.js +912 -736
- package/dist/types/vue.d.ts +85 -38
- package/dist/utilities/page-section-mixin.d.ts +5 -0
- package/dist/utilities/page-section-mixin.d.ts.map +1 -1
- package/dist/utilities/page-section-mixin.js +10 -1
- package/dist/utilities/page-section-mixin.js.map +1 -1
- package/dist/utilities/scroll-mode-controller.d.ts +29 -13
- package/dist/utilities/scroll-mode-controller.d.ts.map +1 -1
- package/dist/utilities/scroll-mode-controller.js +48 -13
- package/dist/utilities/scroll-mode-controller.js.map +1 -1
- package/package.json +5 -5
- package/dist/components/layout/app-view/app-view.d.ts.map +0 -1
- package/dist/components/layout/app-view/app-view.js.map +0 -1
- package/dist/components/layout/app-view/app-view.styles.d.ts +0 -2
- package/dist/components/layout/app-view/app-view.styles.d.ts.map +0 -1
- package/dist/components/layout/app-view/app-view.styles.js.map +0 -1
- package/dist/components/layout/app-view/app-view.template.d.ts +0 -4
- package/dist/components/layout/app-view/app-view.template.d.ts.map +0 -1
- package/dist/components/layout/app-view/app-view.template.js +0 -9
- package/dist/components/layout/app-view/app-view.template.js.map +0 -1
- package/dist/components/palettes.html +0 -245
- package/dist/components/sample-images/butterfly-1200.jpg +0 -0
- package/dist/components/sample-images/butterfly-1600.jpg +0 -0
- package/dist/components/sample-images/butterfly-480.jpg +0 -0
- package/dist/components/sample-images/butterfly-960.jpg +0 -0
- package/dist/palettes.html +0 -245
- package/dist/sample-images/butterfly-1200.jpg +0 -0
- package/dist/sample-images/butterfly-1600.jpg +0 -0
- package/dist/sample-images/butterfly-480.jpg +0 -0
- package/dist/sample-images/butterfly-960.jpg +0 -0
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
* Nederlandse Digitale Dienst Skip Link Component (Lit + TypeScript)
|
|
3
3
|
*
|
|
4
4
|
* Accessibility pattern that lets keyboard users skip past content. Wraps
|
|
5
|
-
* content in a default slot. Without href it
|
|
6
|
-
* the skip link
|
|
5
|
+
* content in a default slot. Without href it moves focus to the first rendered
|
|
6
|
+
* element after the skip link, so the next Tab lands on the first link or
|
|
7
|
+
* button in it. An element that is not rendered, such as a `<noscript>`, a
|
|
8
|
+
* `<script>` or anything hidden, is passed over. Make sure a rendered element
|
|
7
9
|
* follows the component, otherwise the skip link has no effect.
|
|
8
10
|
*
|
|
11
|
+
* With an `href` that points at an id on the same page, the link scrolls to
|
|
12
|
+
* that element and moves focus to it too. The target needs no `tabindex` of
|
|
13
|
+
* its own. An href to another page is left to the browser.
|
|
14
|
+
*
|
|
15
|
+
* The component cannot know what it skips, so its default text only says
|
|
16
|
+
* "Sla over". Name it with `text`: "Sla navigatie over", "Sla filters over".
|
|
17
|
+
*
|
|
9
18
|
* @element nldd-skip-link
|
|
10
|
-
* @attr {string} text - Text of the skip link. Falls back to the i18n default.
|
|
11
|
-
* @attr {string} href - Optional external target id. Without href it jumps to the
|
|
19
|
+
* @attr {string} text - Text of the skip link. Name what is skipped. Falls back to the i18n default.
|
|
20
|
+
* @attr {string} href - Optional external target id. Without href it jumps to the first rendered element after the skip link.
|
|
12
21
|
*
|
|
13
22
|
* @slot - Content that can be skipped
|
|
14
23
|
*/
|
|
@@ -25,6 +34,43 @@ export declare class NLDDSkipLink extends NLDDSkipLink_base {
|
|
|
25
34
|
href: string;
|
|
26
35
|
get _text(): string;
|
|
27
36
|
_handleClick: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* With an href the browser scrolls to the target and updates the URL, and
|
|
39
|
+
* this moves focus there as well. Left to the browser, WebKit keeps focus
|
|
40
|
+
* on the link, so the next Tab starts from the top again.
|
|
41
|
+
*/
|
|
42
|
+
_handleLinkClick: (event?: MouseEvent) => void;
|
|
43
|
+
/**
|
|
44
|
+
* The fragment of an href that stays on this page, or an empty string. An
|
|
45
|
+
* absolute URL to the page you are on counts too: a router or a CMS writes
|
|
46
|
+
* `/pagina#inhoud` as readily as `#inhoud`.
|
|
47
|
+
*/
|
|
48
|
+
private _samePageHash;
|
|
49
|
+
private _focusTimer?;
|
|
50
|
+
private _restoreTarget?;
|
|
51
|
+
disconnectedCallback(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Focuses the target and leaves it as it was once focus moves on.
|
|
54
|
+
*
|
|
55
|
+
* The tabindex is 0 and not -1, also when the target came with a -1 of its
|
|
56
|
+
* own. WebKit skips everything inside a shadow host that has a negative
|
|
57
|
+
* tabindex, slotted content included, so with -1 on an nldd-* section the
|
|
58
|
+
* next Tab left the page instead of reaching the first link in it.
|
|
59
|
+
*/
|
|
60
|
+
private _focus;
|
|
61
|
+
/**
|
|
62
|
+
* The first following sibling that is rendered. `focus()` does nothing on
|
|
63
|
+
* an element without a box, and a `<noscript>` or a hidden element sitting
|
|
64
|
+
* between the skip link and the content left the button dead.
|
|
65
|
+
*/
|
|
66
|
+
private _target;
|
|
67
|
+
/**
|
|
68
|
+
* The element itself when it has a box and can take focus. A `display:
|
|
69
|
+
* contents` wrapper has no box, yet its children are on screen, so the
|
|
70
|
+
* first rendered one of those stands in for it. An element that is
|
|
71
|
+
* `visibility: hidden` or inert does have a box and still refuses focus.
|
|
72
|
+
*/
|
|
73
|
+
private _rendered;
|
|
28
74
|
render(): import("lit-html").TemplateResult<1>;
|
|
29
75
|
}
|
|
30
76
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;;;;;;;AAQjC,qBACa,YAAa,SAAQ,iBAAsD;IACvF,OAAgB,MAAM,0BAAkB;IAGxC,IAAI,SAAM;IAGV,IAAI,SAAM;IAEV,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,QAAO,IAAI,CAYrB;IAEF;;;;OAIG;IACH,gBAAgB,GAAI,QAAQ,UAAU,KAAG,IAAI,CAe3C;IAEF;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,WAAW,CAAC,CAAgC;IACpD,OAAO,CAAC,cAAc,CAAC,CAAa;IAE3B,oBAAoB,IAAI,IAAI;IAKrC;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM;IAyBd;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAUf;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAcR,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gBAAgB,EAAE,YAAY,CAAC;KAC/B;CACD"}
|
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
* Nederlandse Digitale Dienst Skip Link Component (Lit + TypeScript)
|
|
3
3
|
*
|
|
4
4
|
* Accessibility pattern that lets keyboard users skip past content. Wraps
|
|
5
|
-
* content in a default slot. Without href it
|
|
6
|
-
* the skip link
|
|
5
|
+
* content in a default slot. Without href it moves focus to the first rendered
|
|
6
|
+
* element after the skip link, so the next Tab lands on the first link or
|
|
7
|
+
* button in it. An element that is not rendered, such as a `<noscript>`, a
|
|
8
|
+
* `<script>` or anything hidden, is passed over. Make sure a rendered element
|
|
7
9
|
* follows the component, otherwise the skip link has no effect.
|
|
8
10
|
*
|
|
11
|
+
* With an `href` that points at an id on the same page, the link scrolls to
|
|
12
|
+
* that element and moves focus to it too. The target needs no `tabindex` of
|
|
13
|
+
* its own. An href to another page is left to the browser.
|
|
14
|
+
*
|
|
15
|
+
* The component cannot know what it skips, so its default text only says
|
|
16
|
+
* "Sla over". Name it with `text`: "Sla navigatie over", "Sla filters over".
|
|
17
|
+
*
|
|
9
18
|
* @element nldd-skip-link
|
|
10
|
-
* @attr {string} text - Text of the skip link. Falls back to the i18n default.
|
|
11
|
-
* @attr {string} href - Optional external target id. Without href it jumps to the
|
|
19
|
+
* @attr {string} text - Text of the skip link. Name what is skipped. Falls back to the i18n default.
|
|
20
|
+
* @attr {string} href - Optional external target id. Without href it jumps to the first rendered element after the skip link.
|
|
12
21
|
*
|
|
13
22
|
* @slot - Content that can be skipped
|
|
14
23
|
*/
|
|
@@ -31,22 +40,140 @@ let NLDDSkipLink = class NLDDSkipLink extends withTranslations(LitElement, nlddS
|
|
|
31
40
|
this.text = '';
|
|
32
41
|
this.href = '';
|
|
33
42
|
this._handleClick = () => {
|
|
34
|
-
const next = this.
|
|
35
|
-
if (next) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
next.addEventListener('blur', () => {
|
|
40
|
-
next.removeAttribute('tabindex');
|
|
41
|
-
}, { once: true });
|
|
43
|
+
const next = this._target();
|
|
44
|
+
if (!next) {
|
|
45
|
+
if (import.meta.env?.DEV) {
|
|
46
|
+
console.warn('<nldd-skip-link>: no rendered element follows the skip link, so it has nothing to move focus to. '
|
|
47
|
+
+ 'Put the content it skips to right after it, or point `href` at the id of the target.');
|
|
42
48
|
}
|
|
43
|
-
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this._focus(next);
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* With an href the browser scrolls to the target and updates the URL, and
|
|
55
|
+
* this moves focus there as well. Left to the browser, WebKit keeps focus
|
|
56
|
+
* on the link, so the next Tab starts from the top again.
|
|
57
|
+
*/
|
|
58
|
+
this._handleLinkClick = (event) => {
|
|
59
|
+
const hash = this._samePageHash();
|
|
60
|
+
if (!hash)
|
|
61
|
+
return;
|
|
62
|
+
// A click that opens the link elsewhere (middle button, or with a
|
|
63
|
+
// modifier held) leaves this page where it is, focus included.
|
|
64
|
+
if (event && (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey))
|
|
65
|
+
return;
|
|
66
|
+
let id = hash.slice(1);
|
|
67
|
+
// A malformed escape throws; the raw id is then the best guess left.
|
|
68
|
+
try {
|
|
69
|
+
id = decodeURIComponent(id);
|
|
44
70
|
}
|
|
71
|
+
catch { /* keep the raw id */ }
|
|
72
|
+
const root = this.getRootNode();
|
|
73
|
+
const target = root.getElementById?.(id) ?? document.getElementById(id);
|
|
74
|
+
if (!target)
|
|
75
|
+
return;
|
|
76
|
+
// After the navigation the click is about to cause, not before it.
|
|
77
|
+
clearTimeout(this._focusTimer);
|
|
78
|
+
this._focusTimer = setTimeout(() => this._focus(target));
|
|
45
79
|
};
|
|
46
80
|
}
|
|
47
81
|
get _text() {
|
|
48
82
|
return this.text || this._t('components.skip-link.action');
|
|
49
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* The fragment of an href that stays on this page, or an empty string. An
|
|
86
|
+
* absolute URL to the page you are on counts too: a router or a CMS writes
|
|
87
|
+
* `/pagina#inhoud` as readily as `#inhoud`.
|
|
88
|
+
*/
|
|
89
|
+
_samePageHash() {
|
|
90
|
+
try {
|
|
91
|
+
const url = new URL(this.href, location.href);
|
|
92
|
+
const samePage = url.origin === location.origin
|
|
93
|
+
&& url.pathname === location.pathname
|
|
94
|
+
&& url.search === location.search;
|
|
95
|
+
return samePage ? url.hash : '';
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return '';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
disconnectedCallback() {
|
|
102
|
+
super.disconnectedCallback();
|
|
103
|
+
clearTimeout(this._focusTimer);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Focuses the target and leaves it as it was once focus moves on.
|
|
107
|
+
*
|
|
108
|
+
* The tabindex is 0 and not -1, also when the target came with a -1 of its
|
|
109
|
+
* own. WebKit skips everything inside a shadow host that has a negative
|
|
110
|
+
* tabindex, slotted content included, so with -1 on an nldd-* section the
|
|
111
|
+
* next Tab left the page instead of reaching the first link in it.
|
|
112
|
+
*/
|
|
113
|
+
_focus(target) {
|
|
114
|
+
// A second run before the target has blurred would read the temporary 0
|
|
115
|
+
// as the original and put that back for good. Settle the first one first.
|
|
116
|
+
this._restoreTarget?.();
|
|
117
|
+
const previous = target.getAttribute('tabindex');
|
|
118
|
+
const restore = () => {
|
|
119
|
+
target.removeEventListener('blur', restore);
|
|
120
|
+
if (this._restoreTarget === restore)
|
|
121
|
+
this._restoreTarget = undefined;
|
|
122
|
+
if (previous === null)
|
|
123
|
+
target.removeAttribute('tabindex');
|
|
124
|
+
else
|
|
125
|
+
target.setAttribute('tabindex', previous);
|
|
126
|
+
};
|
|
127
|
+
this._restoreTarget = restore;
|
|
128
|
+
target.setAttribute('tabindex', '0');
|
|
129
|
+
target.addEventListener('blur', restore);
|
|
130
|
+
target.focus();
|
|
131
|
+
// Focus did not take (the target got hidden or went inert in between):
|
|
132
|
+
// no blur will follow, so the tab stop would stay behind for good.
|
|
133
|
+
if (target.getRootNode().activeElement !== target) {
|
|
134
|
+
restore();
|
|
135
|
+
if (import.meta.env?.DEV) {
|
|
136
|
+
console.warn('<nldd-skip-link>: the target did not take focus, so the skip link did nothing. It is probably hidden or inert.', target);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The first following sibling that is rendered. `focus()` does nothing on
|
|
142
|
+
* an element without a box, and a `<noscript>` or a hidden element sitting
|
|
143
|
+
* between the skip link and the content left the button dead.
|
|
144
|
+
*/
|
|
145
|
+
_target() {
|
|
146
|
+
let next = this.nextElementSibling;
|
|
147
|
+
while (next) {
|
|
148
|
+
const rendered = this._rendered(next);
|
|
149
|
+
if (rendered)
|
|
150
|
+
return rendered;
|
|
151
|
+
next = next.nextElementSibling;
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The element itself when it has a box and can take focus. A `display:
|
|
157
|
+
* contents` wrapper has no box, yet its children are on screen, so the
|
|
158
|
+
* first rendered one of those stands in for it. An element that is
|
|
159
|
+
* `visibility: hidden` or inert does have a box and still refuses focus.
|
|
160
|
+
*/
|
|
161
|
+
_rendered(el) {
|
|
162
|
+
if (!(el instanceof HTMLElement))
|
|
163
|
+
return null;
|
|
164
|
+
if (el.getClientRects().length > 0) {
|
|
165
|
+
const reachable = getComputedStyle(el).visibility !== 'hidden' && !el.closest('[inert]');
|
|
166
|
+
return reachable ? el : null;
|
|
167
|
+
}
|
|
168
|
+
if (getComputedStyle(el).display !== 'contents')
|
|
169
|
+
return null;
|
|
170
|
+
for (const child of el.children) {
|
|
171
|
+
const rendered = this._rendered(child);
|
|
172
|
+
if (rendered)
|
|
173
|
+
return rendered;
|
|
174
|
+
}
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
50
177
|
render() {
|
|
51
178
|
return template(this);
|
|
52
179
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-link.js","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"skip-link.js","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAA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CAAC;QAC9C,IAAI,EAAE,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,MAAM,SAAS,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YACzF,OAAO,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9B,CAAC;QACD,IAAI,gBAAgB,CAAC,EAAE,CAAC,CAAC,OAAO,KAAK,UAAU;YAAE,OAAO,IAAI,CAAC;QAC7D,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;YACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACvC,IAAI,QAAQ;gBAAE,OAAO,QAAQ,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAEQ,MAAM;QACd,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;;AA/Ie,mBAAM,GAAG,cAAc,AAAjB,CAAkB;AAGxC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;0CAC5D;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACjB;AAPE,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAiJxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-link.template.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,wBAAgB,QAAQ,CAAC,SAAS,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"skip-link.template.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,wBAAgB,QAAQ,CAAC,SAAS,EAAE,YAAY,wCAuB/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-link.template.js","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,MAAM,UAAU,QAAQ,CAAC,SAAuB;IAC/C,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAE7C,OAAO,IAAI,CAAA;;KAEP,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAA;;YAER,QAAQ;;
|
|
1
|
+
{"version":3,"file":"skip-link.template.js","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,MAAM,UAAU,QAAQ,CAAC,SAAuB;IAC/C,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAE7C,OAAO,IAAI,CAAA;;KAEP,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAA;;YAER,QAAQ;cACN,SAAS,CAAC,gBAAgB;;OAEjC,SAAS,CAAC,KAAK;;IAElB,CAAC,CAAC,CAAC,IAAI,CAAA;;;cAGG,SAAS,CAAC,YAAY;;OAE7B,SAAS,CAAC,KAAK;;IAElB;;;EAGF,CAAC;AACH,CAAC"}
|
|
@@ -25,9 +25,16 @@
|
|
|
25
25
|
* everyone. Anchor at the heading, then, and not at some other element that
|
|
26
26
|
* happens to sit at the right height: the bar hands its title over to it.
|
|
27
27
|
*
|
|
28
|
+
* The title stays on one line and is cut off with an ellipsis when it does not
|
|
29
|
+
* fit, which on a narrow screen or at 400% zoom is soon. The bar is therefore
|
|
30
|
+
* not the place for the full title: put that in an `nldd-title` at the top of
|
|
31
|
+
* the content, which wraps and always fits, and point `collapse-anchor` at it.
|
|
32
|
+
* A bar without an anchor holds the only copy of its title, so keep that one to
|
|
33
|
+
* a word or two.
|
|
34
|
+
*
|
|
28
35
|
* @element nldd-top-title-bar
|
|
29
36
|
*
|
|
30
|
-
* @attr {string} text - Title of the bar, rendered as the heading in the title group.
|
|
37
|
+
* @attr {string} text - Title of the bar, rendered as the heading in the title group. One line, cut off with an ellipsis when it does not fit; see above for a title that can run long.
|
|
31
38
|
* @attr {string} supporting-text - Text under the title.
|
|
32
39
|
* @attr {1|2|3|4|5|6} heading-level - Heading level of the title: 1–6 (default: 1). Lower it where the bar is not the top of the page, such as a pane beside content that already has its h1.
|
|
33
40
|
* @attr {string} collapse-anchor - Id of the element whose top edge triggers the compact state on scroll. Without it the state is static (see above).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-title-bar.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/top-title-bar/top-title-bar.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"top-title-bar.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/top-title-bar/top-title-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAOjC,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE1C,qBACa,eAAgB,SAAQ,UAAU;IAC9C,OAAgB,MAAM,0BAAqB;IAG3C,IAAI,SAAM;IAGV,cAAc,SAAM;IAGpB,YAAY,EAAE,YAAY,CAAK;IAG/B,cAAc,SAAM;IAGpB,QAAQ,SAAM;IAGd,QAAQ,SAAM;IAGd,WAAW,SAAM;IAGjB,gBAAgB,UAAS;IAEzB,OAAO,CAAC,YAAY,CAAwB;IAE5C;;;wBAGoB;IAEpB,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,mBAAmB,CAA4B;IACvD,OAAO,CAAC,0BAA0B,CAAiC;IACnE,OAAO,CAAC,iBAAiB,CAAiC;IAC1D,OAAO,CAAC,qBAAqB,CAA+B;IAC5D,OAAO,CAAC,qBAAqB,CAAiC;IAC9D,OAAO,CAAC,cAAc,CAA6B;IAE1C,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAK5B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAiBrD,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,YAAY;IAgBpB,gBAAgB;IAChB,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,OAAO,CAAC,cAAc;IA+CtB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,iBAAiB;IA6BzB,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,SAAS;IAmBjB,oBAAoB,GAAI,GAAG,KAAK,UAG9B;IAEF,WAAW,IAAI,IAAI;IAKnB,cAAc,IAAI,IAAI;IAIb,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,oBAAoB,EAAE,eAAe,CAAC;KACtC;CACD"}
|
|
@@ -25,9 +25,16 @@
|
|
|
25
25
|
* everyone. Anchor at the heading, then, and not at some other element that
|
|
26
26
|
* happens to sit at the right height: the bar hands its title over to it.
|
|
27
27
|
*
|
|
28
|
+
* The title stays on one line and is cut off with an ellipsis when it does not
|
|
29
|
+
* fit, which on a narrow screen or at 400% zoom is soon. The bar is therefore
|
|
30
|
+
* not the place for the full title: put that in an `nldd-title` at the top of
|
|
31
|
+
* the content, which wraps and always fits, and point `collapse-anchor` at it.
|
|
32
|
+
* A bar without an anchor holds the only copy of its title, so keep that one to
|
|
33
|
+
* a word or two.
|
|
34
|
+
*
|
|
28
35
|
* @element nldd-top-title-bar
|
|
29
36
|
*
|
|
30
|
-
* @attr {string} text - Title of the bar, rendered as the heading in the title group.
|
|
37
|
+
* @attr {string} text - Title of the bar, rendered as the heading in the title group. One line, cut off with an ellipsis when it does not fit; see above for a title that can run long.
|
|
31
38
|
* @attr {string} supporting-text - Text under the title.
|
|
32
39
|
* @attr {1|2|3|4|5|6} heading-level - Heading level of the title: 1–6 (default: 1). Lower it where the bar is not the top of the page, such as a pane beside content that already has its h1.
|
|
33
40
|
* @attr {string} collapse-anchor - Id of the element whose top edge triggers the compact state on scroll. Without it the state is static (see above).
|
|
@@ -144,7 +151,7 @@ let NLDDTopTitleBar = class NLDDTopTitleBar extends LitElement {
|
|
|
144
151
|
}
|
|
145
152
|
this._wireScrollTarget();
|
|
146
153
|
// The page's scroll target flips when it switches scroll mode (nested
|
|
147
|
-
// inner scroller <-> the document, derived on resize by nldd-
|
|
154
|
+
// inner scroller <-> the document, derived on resize by nldd-shell).
|
|
148
155
|
// Re-wire onto the new target whenever the page reflects a new
|
|
149
156
|
// [data-scroll], so the collapse keeps tracking the live scroller.
|
|
150
157
|
if (this._pageElement) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-title-bar.js","sourceRoot":"","sources":["../../../../src/components/navigation/top-title-bar/top-title-bar.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"top-title-bar.js","sourceRoot":"","sources":["../../../../src/components/navigation/top-title-bar/top-title-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EA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AS,EAAE,CAAC,EAAE,CAAC;uDAChF;AAGpB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,iBAAiB,CAAe,CAAC,CAAC,EAAE,CAAC;qDACxE;AAG/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;uDACrC;AAGpB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;iDAChF;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;iDACrC;AAGd;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;oDAChF;AAGjB;IADC,KAAK,EAAE;yDACiB;AASjB;IADP,KAAK,EAAE;uDACsC;AAlClC,eAAe;IAD3B,aAAa,CAAC,oBAAoB,CAAC;GACvB,eAAe,CA8O3B"}
|
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
* action per bar at most; several actions, or links in running text, belong in
|
|
21
21
|
* nldd-banner.
|
|
22
22
|
*
|
|
23
|
+
* ## Placement
|
|
24
|
+
* The bar is the first thing on the screen: above nldd-top-navigation-bar or
|
|
25
|
+
* nldd-top-title-bar, across the whole app, also when a split view shows
|
|
26
|
+
* several panes. It reports the state of the service, not of one page, so it
|
|
27
|
+
* never sits inside the content or below a top bar. Below a top bar it says so
|
|
28
|
+
* in development.
|
|
29
|
+
*
|
|
23
30
|
* ## ARIA
|
|
24
31
|
* role and aria-live are set automatically from the variant:
|
|
25
32
|
* - critical → role="alert" (implies aria-live="assertive"; interrupts the screen reader)
|
|
@@ -52,6 +59,9 @@ export declare class NLDDStatusBar extends LitElement {
|
|
|
52
59
|
rel: string;
|
|
53
60
|
button: boolean;
|
|
54
61
|
connectedCallback(): void;
|
|
62
|
+
firstUpdated(): void;
|
|
63
|
+
/** DEV-only: warns when a top bar comes before the status bar. Top bars in an overlay are left out, since a sheet or dialog has its own. */
|
|
64
|
+
private _checkPlacement;
|
|
55
65
|
updated(changed: Map<string, unknown>): void;
|
|
56
66
|
private _applyAriaForVariant;
|
|
57
67
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-bar.d.ts","sourceRoot":"","sources":["../../../../src/components/status-and-feedback/status-bar/status-bar.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"status-bar.d.ts","sourceRoot":"","sources":["../../../../src/components/status-and-feedback/status-bar/status-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAKjC,OAAO,4BAA4B,CAAC;AAEpC,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAEzF,qBACa,aAAc,SAAQ,UAAU;IAC5C,OAAgB,MAAM,0BAAmB;IAGzC,OAAO,EAAE,gBAAgB,CAAa;IAGtC,IAAI,SAAM;IAGV,IAAI,SAAM;IAEV,+DAA+D;IAE/D,MAAM,SAAM;IAEZ,sDAAsD;IAEtD,GAAG,SAAM;IAGT,MAAM,UAAS;IAEN,iBAAiB,IAAI,IAAI;IAYzB,YAAY,IAAI,IAAI;IAI7B,4IAA4I;IAC5I,OAAO,CAAC,eAAe;IAWd,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIrD,OAAO,CAAC,oBAAoB;IAmBnB,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,iBAAiB,EAAE,aAAa,CAAC;KACjC;CACD"}
|
|
@@ -26,6 +26,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
26
26
|
* action per bar at most; several actions, or links in running text, belong in
|
|
27
27
|
* nldd-banner.
|
|
28
28
|
*
|
|
29
|
+
* ## Placement
|
|
30
|
+
* The bar is the first thing on the screen: above nldd-top-navigation-bar or
|
|
31
|
+
* nldd-top-title-bar, across the whole app, also when a split view shows
|
|
32
|
+
* several panes. It reports the state of the service, not of one page, so it
|
|
33
|
+
* never sits inside the content or below a top bar. Below a top bar it says so
|
|
34
|
+
* in development.
|
|
35
|
+
*
|
|
29
36
|
* ## ARIA
|
|
30
37
|
* role and aria-live are set automatically from the variant:
|
|
31
38
|
* - critical → role="alert" (implies aria-live="assertive"; interrupts the screen reader)
|
|
@@ -73,6 +80,20 @@ let NLDDStatusBar = class NLDDStatusBar extends LitElement {
|
|
|
73
80
|
// on later variant changes.
|
|
74
81
|
this._applyAriaForVariant(this.variant);
|
|
75
82
|
}
|
|
83
|
+
firstUpdated() {
|
|
84
|
+
if (import.meta.env?.DEV)
|
|
85
|
+
this._checkPlacement();
|
|
86
|
+
}
|
|
87
|
+
/** DEV-only: warns when a top bar comes before the status bar. Top bars in an overlay are left out, since a sheet or dialog has its own. */
|
|
88
|
+
_checkPlacement() {
|
|
89
|
+
const root = this.getRootNode();
|
|
90
|
+
const above = [...root.querySelectorAll('nldd-top-navigation-bar, nldd-top-title-bar')].some((bar) => !bar.closest('nldd-sheet, nldd-modal-dialog, nldd-popover, dialog')
|
|
91
|
+
&& (bar.compareDocumentPosition(this) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0
|
|
92
|
+
&& !bar.contains(this));
|
|
93
|
+
if (above) {
|
|
94
|
+
console.warn('<nldd-status-bar>: The status bar sits below a top bar. It belongs above it, as the first thing on the screen.', this);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
76
97
|
updated(changed) {
|
|
77
98
|
if (changed.has('variant'))
|
|
78
99
|
this._applyAriaForVariant(this.variant);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-bar.js","sourceRoot":"","sources":["../../../../src/components/status-and-feedback/status-bar/status-bar.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"status-bar.js","sourceRoot":"","sources":["../../../../src/components/status-and-feedback/status-bar/status-bar.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,4BAA4B,CAAC;AAK7B,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAIN,YAAO,GAAqB,SAAS,CAAC;QAGtC,SAAI,GAAG,EAAE,CAAC;QAGV,SAAI,GAAG,EAAE,CAAC;QAEV,+DAA+D;QAE/D,WAAM,GAAG,EAAE,CAAC;QAEZ,sDAAsD;QAEtD,QAAG,GAAG,EAAE,CAAC;QAGT,WAAM,GAAG,KAAK,CAAC;IAwDhB,CAAC;IAtDS,iBAAiB;QACzB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,wEAAwE;QACxE,uEAAuE;QACvE,4EAA4E;QAC5E,4EAA4E;QAC5E,4EAA4E;QAC5E,6EAA6E;QAC7E,4BAA4B;QAC5B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEQ,YAAY;QACpB,IAAI,MAAM,CAAC,IA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,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEQ,MAAM;QACd,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;;AA3Ee,oBAAM,GAAG,eAAe,AAAlB,CAAmB;AAGzC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAmB,SAAS,CAAC,EAAE,CAAC;8CACjD;AAGtC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;2CAC5D;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACjB;AAIV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACf;AAIZ;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAClB;AAGT;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAC5B;AArBH,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA6EzB"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
text-size-adjust: 100%;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
html:has(nldd-
|
|
10
|
-
html:has(nldd-
|
|
9
|
+
html:has(nldd-shell),
|
|
10
|
+
html:has(nldd-shell) body {
|
|
11
11
|
margin: 0;
|
|
12
12
|
height: 100%;
|
|
13
13
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
consumer writes in the light DOM fell back to the browser default, so every
|
|
17
17
|
app solved it with its own `body { font: … }`, each one slightly different.
|
|
18
18
|
Inside @layer reset, so any consumer rule beats it without effort. */
|
|
19
|
-
html:has(nldd-
|
|
19
|
+
html:has(nldd-shell) body {
|
|
20
20
|
font: var(--primitives-font-body-md-regular-snug);
|
|
21
21
|
color: var(--semantics-content-color);
|
|
22
22
|
}
|