@nldd/design-system 0.8.97 → 0.8.99

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.
Files changed (175) hide show
  1. package/custom-elements.json +192 -46
  2. package/dist/components/actions/menu/menu.d.ts +39 -5
  3. package/dist/components/actions/menu/menu.d.ts.map +1 -1
  4. package/dist/components/actions/menu/menu.js +120 -7
  5. package/dist/components/actions/menu/menu.js.map +1 -1
  6. package/dist/components/actions/menu/menu.template.d.ts +4 -3
  7. package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
  8. package/dist/components/actions/menu/menu.template.js +10 -5
  9. package/dist/components/actions/menu/menu.template.js.map +1 -1
  10. package/dist/components/actions/toolbar/toolbar.d.ts +14 -3
  11. package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
  12. package/dist/components/actions/toolbar/toolbar.js +45 -7
  13. package/dist/components/actions/toolbar/toolbar.js.map +1 -1
  14. package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
  15. package/dist/components/actions/toolbar/toolbar.styles.js +15 -1
  16. package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
  17. package/dist/components/components.js +1104 -186
  18. package/dist/components/content/code-viewer/code-viewer.d.ts +4 -1
  19. package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
  20. package/dist/components/content/code-viewer/code-viewer.js +43 -5
  21. package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
  22. package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
  23. package/dist/components/content/code-viewer/code-viewer.styles.js +22 -7
  24. package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
  25. package/dist/components/content/code-viewer/code-viewer.template.d.ts.map +1 -1
  26. package/dist/components/content/code-viewer/code-viewer.template.js +1 -0
  27. package/dist/components/content/code-viewer/code-viewer.template.js.map +1 -1
  28. package/dist/components/content/tooltip/tooltip.d.ts +7 -0
  29. package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
  30. package/dist/components/content/tooltip/tooltip.js +29 -2
  31. package/dist/components/content/tooltip/tooltip.js.map +1 -1
  32. package/dist/components/content/visually-hidden/visually-hidden.d.ts +35 -0
  33. package/dist/components/content/visually-hidden/visually-hidden.d.ts.map +1 -0
  34. package/dist/components/content/visually-hidden/visually-hidden.js +45 -0
  35. package/dist/components/content/visually-hidden/visually-hidden.js.map +1 -0
  36. package/dist/components/content/visually-hidden/visually-hidden.styles.d.ts +2 -0
  37. package/dist/components/content/visually-hidden/visually-hidden.styles.d.ts.map +1 -0
  38. package/dist/components/content/visually-hidden/visually-hidden.styles.js +27 -0
  39. package/dist/components/content/visually-hidden/visually-hidden.styles.js.map +1 -0
  40. package/dist/components/content/visually-hidden/visually-hidden.template.d.ts +3 -0
  41. package/dist/components/content/visually-hidden/visually-hidden.template.d.ts.map +1 -0
  42. package/dist/components/content/visually-hidden/visually-hidden.template.js +7 -0
  43. package/dist/components/content/visually-hidden/visually-hidden.template.js.map +1 -0
  44. package/dist/components/{dist-CH9m014O.js → dist-B2QcygzG.js} +1 -1
  45. package/dist/components/{dist-DMHTTJRJ.js → dist-BB5mlo7D.js} +2 -2
  46. package/dist/components/{dist-C3uWRipu.js → dist-Bo5Jeyfn.js} +1 -1
  47. package/dist/components/{dist-CpW8MF-L.js → dist-Bud_7w5g.js} +232 -214
  48. package/dist/components/{dist-CvL6_ezZ.js → dist-CA0yDFIt.js} +2 -2
  49. package/dist/components/{dist-DV6Mp5N1.js → dist-CaxHkqR2.js} +3 -3
  50. package/dist/components/{dist-BWRYv3Mp.js → dist-Ch3gNAuT.js} +1 -1
  51. package/dist/components/{dist-PlhQXXtE.js → dist-DbNhCpS5.js} +1 -1
  52. package/dist/components/{dist-DTOshgo1.js → dist-DkqAbJH8.js} +1 -1
  53. package/dist/components/{dist-BWEAw34D.js → dist-DnZmcpbQ.js} +1 -1
  54. package/dist/components/{dist-Bi4EHsFY.js → dist-iC2RTM0V.js} +2 -2
  55. package/dist/components/forms/validation-list/validation-list.d.ts +19 -9
  56. package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
  57. package/dist/components/forms/validation-list/validation-list.js +38 -12
  58. package/dist/components/forms/validation-list/validation-list.js.map +1 -1
  59. package/dist/components/{icon-button-NN0SrgS3.js → icon-button-CJIikwyu.js} +15 -2
  60. package/dist/components/index.d.ts +1 -0
  61. package/dist/components/index.d.ts.map +1 -1
  62. package/dist/components/index.js +1 -0
  63. package/dist/components/index.js.map +1 -1
  64. package/dist/components/inputs/segmented-control/segmented-control.d.ts +1 -1
  65. package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
  66. package/dist/components/inputs/segmented-control/segmented-control.js +1 -4
  67. package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
  68. package/dist/components/inputs/toggle-button/toggle-button.d.ts +1 -1
  69. package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
  70. package/dist/components/inputs/toggle-button/toggle-button.js +1 -4
  71. package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
  72. package/dist/components/layout/card/card.d.ts +12 -1
  73. package/dist/components/layout/card/card.d.ts.map +1 -1
  74. package/dist/components/layout/card/card.js +29 -2
  75. package/dist/components/layout/card/card.js.map +1 -1
  76. package/dist/components/layout/card/card.styles.js +2 -2
  77. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -1
  78. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +3 -1
  79. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -1
  80. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js +6 -6
  81. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js.map +1 -1
  82. package/dist/components/layout/popover/popover.styles.d.ts.map +1 -1
  83. package/dist/components/layout/popover/popover.styles.js +4 -0
  84. package/dist/components/layout/popover/popover.styles.js.map +1 -1
  85. package/dist/components/lists-and-tables/list/list.d.ts +6 -1
  86. package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
  87. package/dist/components/lists-and-tables/list/list.js +7 -2
  88. package/dist/components/lists-and-tables/list/list.js.map +1 -1
  89. package/dist/components/lists-and-tables/list-item/list-item.d.ts +16 -1
  90. package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
  91. package/dist/components/lists-and-tables/list-item/list-item.js +35 -4
  92. package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
  93. package/dist/components/lists-and-tables/list-item/list-item.template.d.ts +1 -1
  94. package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
  95. package/dist/components/lists-and-tables/list-item/list-item.template.js +7 -6
  96. package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
  97. package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +44 -1
  98. package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
  99. package/dist/components/navigation/document-tab-bar/document-tab-bar.js +132 -3
  100. package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
  101. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.d.ts.map +1 -1
  102. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js +21 -2
  103. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js.map +1 -1
  104. package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +1 -1
  105. package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
  106. package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
  107. package/dist/components/navigation/menu-bar/menu-bar.js +19 -2
  108. package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
  109. package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +6 -3
  110. package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
  111. package/dist/components/navigation/menu-bar-item/menu-bar-item.js +11 -3
  112. package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
  113. package/dist/components/navigation/menu-bar-item/menu-bar-item.template.d.ts +1 -0
  114. package/dist/components/navigation/menu-bar-item/menu-bar-item.template.d.ts.map +1 -1
  115. package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js +53 -32
  116. package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js.map +1 -1
  117. package/dist/components/navigation/skip-link/skip-link.d.ts +58 -5
  118. package/dist/components/navigation/skip-link/skip-link.d.ts.map +1 -1
  119. package/dist/components/navigation/skip-link/skip-link.js +148 -14
  120. package/dist/components/navigation/skip-link/skip-link.js.map +1 -1
  121. package/dist/components/navigation/skip-link/skip-link.template.d.ts.map +1 -1
  122. package/dist/components/navigation/skip-link/skip-link.template.js +1 -0
  123. package/dist/components/navigation/skip-link/skip-link.template.js.map +1 -1
  124. package/dist/components/navigation/tab-bar/tab-bar.d.ts +70 -1
  125. package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
  126. package/dist/components/navigation/tab-bar/tab-bar.i18n.d.ts +5 -0
  127. package/dist/components/navigation/tab-bar/tab-bar.i18n.d.ts.map +1 -0
  128. package/dist/components/navigation/tab-bar/tab-bar.i18n.js +4 -0
  129. package/dist/components/navigation/tab-bar/tab-bar.i18n.js.map +1 -0
  130. package/dist/components/navigation/tab-bar/tab-bar.js +213 -22
  131. package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
  132. package/dist/components/navigation/tab-bar/tab-bar.styles.d.ts.map +1 -1
  133. package/dist/components/navigation/tab-bar/tab-bar.styles.js +68 -3
  134. package/dist/components/navigation/tab-bar/tab-bar.styles.js.map +1 -1
  135. package/dist/components/navigation/tab-bar/tab-bar.template.d.ts.map +1 -1
  136. package/dist/components/navigation/tab-bar/tab-bar.template.js +36 -5
  137. package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
  138. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +7 -0
  139. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
  140. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +16 -0
  141. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
  142. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
  143. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +7 -0
  144. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
  145. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +8 -1
  146. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
  147. package/dist/components/navigation/top-title-bar/top-title-bar.js +8 -1
  148. package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
  149. package/dist/components/status-and-feedback/notification/notification.d.ts +62 -1
  150. package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
  151. package/dist/components/status-and-feedback/notification/notification.js +86 -2
  152. package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
  153. package/dist/components/status-and-feedback/notification/notifications-area.d.ts +6 -0
  154. package/dist/components/status-and-feedback/notification/notifications-area.d.ts.map +1 -1
  155. package/dist/components/status-and-feedback/notification/notifications-area.js +16 -0
  156. package/dist/components/status-and-feedback/notification/notifications-area.js.map +1 -1
  157. package/dist/nldd.min.js +799 -612
  158. package/dist/translations/en-US.d.ts.map +1 -1
  159. package/dist/translations/en-US.js +1 -0
  160. package/dist/translations/en-US.js.map +1 -1
  161. package/dist/translations/fy.d.ts.map +1 -1
  162. package/dist/translations/fy.js +1 -0
  163. package/dist/translations/fy.js.map +1 -1
  164. package/dist/translations/nl.generated.d.ts +1 -0
  165. package/dist/translations/nl.generated.d.ts.map +1 -1
  166. package/dist/translations/nl.generated.js +2 -0
  167. package/dist/translations/nl.generated.js.map +1 -1
  168. package/dist/translations/pap-AW.d.ts.map +1 -1
  169. package/dist/translations/pap-AW.js +1 -0
  170. package/dist/translations/pap-AW.js.map +1 -1
  171. package/dist/translations/pap-CW.d.ts.map +1 -1
  172. package/dist/translations/pap-CW.js +1 -0
  173. package/dist/translations/pap-CW.js.map +1 -1
  174. package/dist/types/vue.d.ts +40 -26
  175. package/package.json +6 -2
@@ -2,13 +2,29 @@
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 focuses the first element after
6
- * the skip link in the DOM (nextElementSibling). Make sure a focusable element
7
- * follows the component, otherwise the skip link has no effect.
5
+ * content in a default slot.
6
+ *
7
+ * Not only for the header of a page. Any block with many stops that someone
8
+ * on a keyboard often wants to get past can have one: a set of filters, a long
9
+ * toolbar, a table of contents. Keep it to blocks like that; a skip link before
10
+ * every section is one more stop on the way, not one less.
11
+ *
12
+ * Without href it moves focus to the first rendered element after the skip
13
+ * link, so the next Tab lands on the first link or button in it. An element
14
+ * that is not rendered, such as a `<noscript>`, a `<script>` or anything
15
+ * hidden, is passed over. Make sure a rendered element follows the component,
16
+ * otherwise the skip link has no effect.
17
+ *
18
+ * With an `href` that points at an id on the same page, the link scrolls to
19
+ * that element and moves focus to it too. The target needs no `tabindex` of
20
+ * its own. An href to another page is left to the browser.
21
+ *
22
+ * The component cannot know what it skips, so its default text only says
23
+ * "Sla over". Name it with `text`: "Sla navigatie over", "Sla filters over".
8
24
  *
9
25
  * @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 end of its own content.
26
+ * @attr {string} text - Text of the skip link. Name what is skipped. Falls back to the i18n default.
27
+ * @attr {string} href - Optional external target id. Without href it jumps to the first rendered element after the skip link.
12
28
  *
13
29
  * @slot - Content that can be skipped
14
30
  */
@@ -25,6 +41,43 @@ export declare class NLDDSkipLink extends NLDDSkipLink_base {
25
41
  href: string;
26
42
  get _text(): string;
27
43
  _handleClick: () => void;
44
+ /**
45
+ * With an href the browser scrolls to the target and updates the URL, and
46
+ * this moves focus there as well. Left to the browser, WebKit keeps focus
47
+ * on the link, so the next Tab starts from the top again.
48
+ */
49
+ _handleLinkClick: (event?: MouseEvent) => void;
50
+ /**
51
+ * The fragment of an href that stays on this page, or an empty string. An
52
+ * absolute URL to the page you are on counts too: a router or a CMS writes
53
+ * `/pagina#inhoud` as readily as `#inhoud`.
54
+ */
55
+ private _samePageHash;
56
+ private _focusTimer?;
57
+ private _restoreTarget?;
58
+ disconnectedCallback(): void;
59
+ /**
60
+ * Focuses the target and leaves it as it was once focus moves on.
61
+ *
62
+ * The tabindex is 0 and not -1, also when the target came with a -1 of its
63
+ * own. WebKit skips everything inside a shadow host that has a negative
64
+ * tabindex, slotted content included, so with -1 on an nldd-* section the
65
+ * next Tab left the page instead of reaching the first link in it.
66
+ */
67
+ private _focus;
68
+ /**
69
+ * The first following sibling that is rendered. `focus()` does nothing on
70
+ * an element without a box, and a `<noscript>` or a hidden element sitting
71
+ * between the skip link and the content left the button dead.
72
+ */
73
+ private _target;
74
+ /**
75
+ * The element itself when it has a box and can take focus. A `display:
76
+ * contents` wrapper has no box, yet its children are on screen, so the
77
+ * first rendered one of those stands in for it. An element that is
78
+ * `visibility: hidden` or inert does have a box and still refuses focus.
79
+ */
80
+ private _rendered;
28
81
  render(): import("lit-html").TemplateResult<1>;
29
82
  }
30
83
  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;;;;;;;;;;;;;GAaG;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;IAEO,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gBAAgB,EAAE,YAAY,CAAC;KAC/B;CACD"}
1
+ {"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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,29 @@
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 focuses the first element after
6
- * the skip link in the DOM (nextElementSibling). Make sure a focusable element
7
- * follows the component, otherwise the skip link has no effect.
5
+ * content in a default slot.
6
+ *
7
+ * Not only for the header of a page. Any block with many stops that someone
8
+ * on a keyboard often wants to get past can have one: a set of filters, a long
9
+ * toolbar, a table of contents. Keep it to blocks like that; a skip link before
10
+ * every section is one more stop on the way, not one less.
11
+ *
12
+ * Without href it moves focus to the first rendered element after the skip
13
+ * link, so the next Tab lands on the first link or button in it. An element
14
+ * that is not rendered, such as a `<noscript>`, a `<script>` or anything
15
+ * hidden, is passed over. Make sure a rendered element follows the component,
16
+ * otherwise the skip link has no effect.
17
+ *
18
+ * With an `href` that points at an id on the same page, the link scrolls to
19
+ * that element and moves focus to it too. The target needs no `tabindex` of
20
+ * its own. An href to another page is left to the browser.
21
+ *
22
+ * The component cannot know what it skips, so its default text only says
23
+ * "Sla over". Name it with `text`: "Sla navigatie over", "Sla filters over".
8
24
  *
9
25
  * @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 end of its own content.
26
+ * @attr {string} text - Text of the skip link. Name what is skipped. Falls back to the i18n default.
27
+ * @attr {string} href - Optional external target id. Without href it jumps to the first rendered element after the skip link.
12
28
  *
13
29
  * @slot - Content that can be skipped
14
30
  */
@@ -31,22 +47,140 @@ let NLDDSkipLink = class NLDDSkipLink extends withTranslations(LitElement, nlddS
31
47
  this.text = '';
32
48
  this.href = '';
33
49
  this._handleClick = () => {
34
- const next = this.nextElementSibling;
35
- if (next) {
36
- const hadTabindex = next.hasAttribute('tabindex');
37
- if (!hadTabindex) {
38
- next.setAttribute('tabindex', '-1');
39
- next.addEventListener('blur', () => {
40
- next.removeAttribute('tabindex');
41
- }, { once: true });
50
+ const next = this._target();
51
+ if (!next) {
52
+ if (import.meta.env?.DEV) {
53
+ console.warn('<nldd-skip-link>: no rendered element follows the skip link, so it has nothing to move focus to. '
54
+ + 'Put the content it skips to right after it, or point `href` at the id of the target.');
42
55
  }
43
- next.focus();
56
+ return;
44
57
  }
58
+ this._focus(next);
59
+ };
60
+ /**
61
+ * With an href the browser scrolls to the target and updates the URL, and
62
+ * this moves focus there as well. Left to the browser, WebKit keeps focus
63
+ * on the link, so the next Tab starts from the top again.
64
+ */
65
+ this._handleLinkClick = (event) => {
66
+ const hash = this._samePageHash();
67
+ if (!hash)
68
+ return;
69
+ // A click that opens the link elsewhere (middle button, or with a
70
+ // modifier held) leaves this page where it is, focus included.
71
+ if (event && (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey))
72
+ return;
73
+ let id = hash.slice(1);
74
+ // A malformed escape throws; the raw id is then the best guess left.
75
+ try {
76
+ id = decodeURIComponent(id);
77
+ }
78
+ catch { /* keep the raw id */ }
79
+ const root = this.getRootNode();
80
+ const target = root.getElementById?.(id) ?? document.getElementById(id);
81
+ if (!target)
82
+ return;
83
+ // After the navigation the click is about to cause, not before it.
84
+ clearTimeout(this._focusTimer);
85
+ this._focusTimer = setTimeout(() => this._focus(target));
45
86
  };
46
87
  }
47
88
  get _text() {
48
89
  return this.text || this._t('components.skip-link.action');
49
90
  }
91
+ /**
92
+ * The fragment of an href that stays on this page, or an empty string. An
93
+ * absolute URL to the page you are on counts too: a router or a CMS writes
94
+ * `/pagina#inhoud` as readily as `#inhoud`.
95
+ */
96
+ _samePageHash() {
97
+ try {
98
+ const url = new URL(this.href, location.href);
99
+ const samePage = url.origin === location.origin
100
+ && url.pathname === location.pathname
101
+ && url.search === location.search;
102
+ return samePage ? url.hash : '';
103
+ }
104
+ catch {
105
+ return '';
106
+ }
107
+ }
108
+ disconnectedCallback() {
109
+ super.disconnectedCallback();
110
+ clearTimeout(this._focusTimer);
111
+ }
112
+ /**
113
+ * Focuses the target and leaves it as it was once focus moves on.
114
+ *
115
+ * The tabindex is 0 and not -1, also when the target came with a -1 of its
116
+ * own. WebKit skips everything inside a shadow host that has a negative
117
+ * tabindex, slotted content included, so with -1 on an nldd-* section the
118
+ * next Tab left the page instead of reaching the first link in it.
119
+ */
120
+ _focus(target) {
121
+ // A second run before the target has blurred would read the temporary 0
122
+ // as the original and put that back for good. Settle the first one first.
123
+ this._restoreTarget?.();
124
+ const previous = target.getAttribute('tabindex');
125
+ const restore = () => {
126
+ target.removeEventListener('blur', restore);
127
+ if (this._restoreTarget === restore)
128
+ this._restoreTarget = undefined;
129
+ if (previous === null)
130
+ target.removeAttribute('tabindex');
131
+ else
132
+ target.setAttribute('tabindex', previous);
133
+ };
134
+ this._restoreTarget = restore;
135
+ target.setAttribute('tabindex', '0');
136
+ target.addEventListener('blur', restore);
137
+ target.focus();
138
+ // Focus did not take (the target got hidden or went inert in between):
139
+ // no blur will follow, so the tab stop would stay behind for good.
140
+ if (target.getRootNode().activeElement !== target) {
141
+ restore();
142
+ if (import.meta.env?.DEV) {
143
+ console.warn('<nldd-skip-link>: the target did not take focus, so the skip link did nothing. It is probably hidden or inert.', target);
144
+ }
145
+ }
146
+ }
147
+ /**
148
+ * The first following sibling that is rendered. `focus()` does nothing on
149
+ * an element without a box, and a `<noscript>` or a hidden element sitting
150
+ * between the skip link and the content left the button dead.
151
+ */
152
+ _target() {
153
+ let next = this.nextElementSibling;
154
+ while (next) {
155
+ const rendered = this._rendered(next);
156
+ if (rendered)
157
+ return rendered;
158
+ next = next.nextElementSibling;
159
+ }
160
+ return null;
161
+ }
162
+ /**
163
+ * The element itself when it has a box and can take focus. A `display:
164
+ * contents` wrapper has no box, yet its children are on screen, so the
165
+ * first rendered one of those stands in for it. An element that is
166
+ * `visibility: hidden` or inert does have a box and still refuses focus.
167
+ */
168
+ _rendered(el) {
169
+ if (!(el instanceof HTMLElement))
170
+ return null;
171
+ if (el.getClientRects().length > 0) {
172
+ const reachable = getComputedStyle(el).visibility !== 'hidden' && !el.closest('[inert]');
173
+ return reachable ? el : null;
174
+ }
175
+ if (getComputedStyle(el).display !== 'contents')
176
+ return null;
177
+ for (const child of el.children) {
178
+ const rendered = this._rendered(child);
179
+ if (rendered)
180
+ return rendered;
181
+ }
182
+ return null;
183
+ }
50
184
  render() {
51
185
  return template(this);
52
186
  }
@@ -1 +1 @@
1
- {"version":3,"file":"skip-link.js","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAA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,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,wCAsB/C"}
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"}
@@ -7,6 +7,7 @@ export function template(component) {
7
7
  ${safeHref ? html `
8
8
  <a class="skip-link__control"
9
9
  href=${safeHref}
10
+ @click=${component._handleLinkClick}
10
11
  >
11
12
  ${component._text}
12
13
  </a>
@@ -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;;OAEb,SAAS,CAAC,KAAK;;IAElB,CAAC,CAAC,CAAC,IAAI,CAAA;;;cAGG,SAAS,CAAC,YAAY;;OAE7B,SAAS,CAAC,KAAK;;IAElB;;;EAGF,CAAC;AACH,CAAC"}
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"}
@@ -4,6 +4,19 @@
4
4
  * A horizontal navigation bar with mutually exclusive tabs.
5
5
  * Exports both NLDDTabBar and NLDDTabBarItem.
6
6
  *
7
+ * When the tabs do not fit, the ones that do not fit go behind a "Meer tabs"
8
+ * button at the end, in a menu. The current tab always stays in the bar: if it
9
+ * would fall in the part that does not fit, another tab goes to the menu in its
10
+ * place. While tabs are in the menu, the bar fills its container and the tabs in
11
+ * it share the width in proportion to their own. Choosing a tab in the bar
12
+ * changes nothing about what is shown; choosing one from the menu swaps it with
13
+ * the last tab in the bar, so the bar does not jump. `centered` has no effect
14
+ * then. In an nldd-toolbar the other items go to the toolbar's menu first, by
15
+ * their priority; when it is the bar's turn, it narrows down to the current tab
16
+ * beside its button, and only then moves into the toolbar's menu as a whole.
17
+ * Tabs are hidden, never moved, so a framework that renders them finds
18
+ * them where it put them. Only a tab that does not fit on its own is cut off.
19
+ *
7
20
  * @element nldd-tab-bar
8
21
  * @attr {string} variant - Visual mode: 'icon-and-text' | 'text' | 'icon'. When unset, the variant is inferred from each item's content. Drives the layout at every size.
9
22
  * @attr {string} size - Size: 'md' | 'lg' (default: 'md'). 'lg' enlarges the touch target; the per-variant layout is preserved (icon-and-text stacks the icon over the text, text renders large text, icon renders a larger icon-only control).
@@ -11,6 +24,7 @@
11
24
  * @attr {boolean} disabled - Disables the whole bar: dims it, blocks pointer interaction, and takes the tabs out of the tab order
12
25
  * @attr {boolean} centered - Centers the tabs in the container (host fills the row, tabs group in the middle)
13
26
  * @attr {string} accessible-label - Accessible name for the navigation region; defaults to 'Tabs'
27
+ * @attr {object} translations - Override translation keys (e.g. the overflow button label); unset keys fall back to Dutch.
14
28
  *
15
29
  * @slot - nldd-tab-bar-item elements
16
30
  *
@@ -30,6 +44,8 @@
30
44
  * @fires select - When the item is activated; detail: { item: NLDDTabBarItem }
31
45
  */
32
46
  import { LitElement } from 'lit';
47
+ import '../../actions/icon-button/icon-button.js';
48
+ import '../../actions/menu/menu.js';
33
49
  export declare class NLDDTabBarItem extends LitElement {
34
50
  static styles: import("lit").CSSResult;
35
51
  /** The item you are on. `aria-selected` in a tab bar that switches content,
@@ -61,7 +77,13 @@ export declare class NLDDTabBarItem extends LitElement {
61
77
  _handleClick(event: Event): void;
62
78
  render(): import("lit-html").TemplateResult;
63
79
  }
64
- export declare class NLDDTabBar extends LitElement {
80
+ declare const NLDDTabBar_base: (abstract new (...args: any[]) => LitElement & {
81
+ translations: Partial<{
82
+ 'components.tab-bar.overflow-action': string;
83
+ }>;
84
+ _t(key: "components.tab-bar.overflow-action", vars?: Record<string, string | number>): string;
85
+ }) & typeof LitElement;
86
+ export declare class NLDDTabBar extends NLDDTabBar_base {
65
87
  static styles: import("lit").CSSResult;
66
88
  /** Centers the tabs in the container (host fills the row, tabs group in the middle). */
67
89
  centered: boolean;
@@ -74,14 +96,60 @@ export declare class NLDDTabBar extends LitElement {
74
96
  disabled: boolean;
75
97
  accessibleLabel: string;
76
98
  private _hasCustomLabel;
99
+ /** @internal The tabs that do not fit, in order, listed in the overflow menu. */
100
+ _overflowItems: NLDDTabBarItem[];
101
+ private _resizeObserver;
102
+ private _itemObserver;
103
+ private _overflowFrame;
77
104
  connectedCallback(): void;
78
105
  disconnectedCallback(): void;
106
+ /** Whether the next pass may only swap the current tab in, rather than
107
+ * choose the whole set again. Cleared by anything that changes the room or
108
+ * the content. */
109
+ private _onlyCurrentChanged;
110
+ private _scheduleOverflow;
111
+ private _onItemsMutated;
112
+ /** Widths as the content wants them, and the room there is for them. */
113
+ private _measure;
114
+ /**
115
+ * @internal Read by nldd-toolbar, which gives an item holding this bar the
116
+ * room to show every tab, and lets it narrow down to the current tab beside
117
+ * the overflow button before the whole bar goes into the toolbar's menu.
118
+ */
119
+ _toolbarWidths(): {
120
+ preferred: number;
121
+ minimum: number;
122
+ } | null;
123
+ /**
124
+ * Decides which tabs stay in the bar and which go to the menu.
125
+ *
126
+ * Measured with the bar at the full width of its container and every tab at
127
+ * the width its content wants, all before the next paint.
128
+ *
129
+ * The set only changes when it has to. A different current tab that is
130
+ * already in the bar changes nothing; one picked from the menu swaps places
131
+ * with the last tab in the bar, so a single slot changes. Only a change in
132
+ * the room or the content chooses the whole set again: the current tab
133
+ * first, then the others in order, for as long as they fit next to the
134
+ * overflow button. Tabs stay where they are in the DOM and are only hidden.
135
+ */
136
+ _updateOverflow(swapOnly?: boolean): void;
137
+ /**
138
+ * Hides the tabs that go to the menu. With an overflow the bar fills its
139
+ * container and the tabs left in it share the room in proportion to the
140
+ * width they want, so the bar's edge and the overflow button stay put.
141
+ */
142
+ private _applyOverflow;
143
+ /** @internal A tab picked from the overflow menu. */
144
+ _selectFromOverflow(event: Event, item: NLDDTabBarItem): void;
79
145
  firstUpdated(): void;
80
146
  updated(changedProperties: Map<string, unknown>): void;
81
147
  private _getItems;
82
148
  private _syncItems;
83
149
  _onSlotChange(): void;
84
150
  private _handleItemSelect;
151
+ /** Makes a tab current (unless the bar navigates) and fires `tabchange`. */
152
+ private _activate;
85
153
  private _handleKeyDown;
86
154
  render(): import("lit-html").TemplateResult;
87
155
  }
@@ -91,4 +159,5 @@ declare global {
91
159
  'nldd-tab-bar-item': NLDDTabBarItem;
92
160
  }
93
161
  }
162
+ export {};
94
163
  //# sourceMappingURL=tab-bar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tab-bar.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/tab-bar/tab-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAUjC,qBACa,cAAe,SAAQ,UAAU;IAC7C,OAAgB,MAAM,0BAAoB;IAE1C;uDACmD;IAEnD,OAAO,UAAS;IAGhB,IAAI,SAAM;IAEV,uDAAuD;IAEvD,aAAa,EAAE,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,EAAE,CAAM;IAK3D,OAAO,CAAC,cAAc,CAA8C;IAGpE,IAAI,SAAM;IAEV;yEACqE;IAErE,IAAI,SAAM;IAEV,0GAA0G;IAE1G,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEzB,IAAI,iBAAiB,IAAI,eAAe,GAAG,MAAM,GAAG,MAAM,CAOzD;IAGD,YAAY,UAAS;IAErB,uDAAuD;IAEvD,WAAW,UAAS;IAEpB,+FAA+F;IAE/F,oBAAoB,UAAS;IAE7B;kDAC8C;IAE9C,cAAc,UAAS;IAEd,iBAAiB,IAAI,IAAI;IAazB,OAAO,IAAI,IAAI;IAIf,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IA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IACnB,OAAO,CAAC,mBAAmB,CAAQ;IAEnC,OAAO,CAAC,iBAAiB,CASvB;IAEF,OAAO,CAAC,eAAe,CAErB;IAEF,wEAAwE;IACxE,OAAO,CAAC,QAAQ;IAgBhB;;;;OAIG;IACH,cAAc,IAAI;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAW/D;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,QAAQ,UAAQ,GAAG,IAAI;IAgDvC;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAgBtB,qDAAqD;IACrD,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI;IAKpD,YAAY,IAAI,IAAI;IAOpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAY/D,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,UAAU;IAkBlB,aAAa,IAAI,IAAI;IAKrB,OAAO,CAAC,iBAAiB,CAGvB;IAEF,4EAA4E;IAC5E,OAAO,CAAC,SAAS;IAmBjB,OAAO,CAAC,cAAc,CA4CpB;IAEO,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,UAAU,CAAC;QAC3B,mBAAmB,EAAE,cAAc,CAAC;KACpC;CACD"}
@@ -0,0 +1,5 @@
1
+ export declare const nlddTabBarTranslations: {
2
+ 'components.tab-bar.overflow-action': string;
3
+ };
4
+ export type NLDDTabBarTranslations = typeof nlddTabBarTranslations;
5
+ //# sourceMappingURL=tab-bar.i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tab-bar.i18n.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/tab-bar/tab-bar.i18n.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB;;CAElC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export const nlddTabBarTranslations = {
2
+ 'components.tab-bar.overflow-action': 'Meer tabs',
3
+ };
4
+ //# sourceMappingURL=tab-bar.i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tab-bar.i18n.js","sourceRoot":"","sources":["../../../../src/components/navigation/tab-bar/tab-bar.i18n.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,oCAAoC,EAAE,WAAW;CACjD,CAAC"}