@nldd/design-system 0.12.0 → 0.13.0

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 (176) hide show
  1. package/custom-elements.json +556 -14
  2. package/dist/components/actions/button-group/button-group.d.ts +4 -3
  3. package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
  4. package/dist/components/actions/button-group/button-group.js +4 -3
  5. package/dist/components/actions/button-group/button-group.js.map +1 -1
  6. package/dist/components/actions/button-group/button-group.styles.d.ts.map +1 -1
  7. package/dist/components/actions/button-group/button-group.styles.js +6 -6
  8. package/dist/components/actions/button-group/button-group.styles.js.map +1 -1
  9. package/dist/components/actions/menu/menu.d.ts.map +1 -1
  10. package/dist/components/actions/menu/menu.js +3 -0
  11. package/dist/components/actions/menu/menu.js.map +1 -1
  12. package/dist/components/components.js +3307 -1742
  13. package/dist/components/content/avatar/avatar.d.ts +2 -1
  14. package/dist/components/content/avatar/avatar.d.ts.map +1 -1
  15. package/dist/components/content/avatar/avatar.js +12 -1
  16. package/dist/components/content/avatar/avatar.js.map +1 -1
  17. package/dist/components/content/avatar-group/avatar-group.d.ts +30 -2
  18. package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
  19. package/dist/components/content/avatar-group/avatar-group.i18n.d.ts +1 -0
  20. package/dist/components/content/avatar-group/avatar-group.i18n.d.ts.map +1 -1
  21. package/dist/components/content/avatar-group/avatar-group.i18n.js +1 -0
  22. package/dist/components/content/avatar-group/avatar-group.i18n.js.map +1 -1
  23. package/dist/components/content/avatar-group/avatar-group.js +96 -7
  24. package/dist/components/content/avatar-group/avatar-group.js.map +1 -1
  25. package/dist/components/content/avatar-group/avatar-group.styles.d.ts.map +1 -1
  26. package/dist/components/content/avatar-group/avatar-group.styles.js +35 -1
  27. package/dist/components/content/avatar-group/avatar-group.styles.js.map +1 -1
  28. package/dist/components/content/avatar-group/avatar-group.template.d.ts +1 -0
  29. package/dist/components/content/avatar-group/avatar-group.template.d.ts.map +1 -1
  30. package/dist/components/content/avatar-group/avatar-group.template.js +52 -29
  31. package/dist/components/content/avatar-group/avatar-group.template.js.map +1 -1
  32. package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
  33. package/dist/components/content/code-viewer/code-viewer.styles.js +46 -13
  34. package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
  35. package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
  36. package/dist/components/content/icon/icon-aliases.js +19 -0
  37. package/dist/components/content/icon/icon-aliases.js.map +1 -1
  38. package/dist/components/content/icon/icon-gallery-status.d.ts.map +1 -1
  39. package/dist/components/content/icon/icon-gallery-status.js +10 -0
  40. package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
  41. package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
  42. package/dist/components/content/icon/icon-registry.js +10 -2
  43. package/dist/components/content/icon/icon-registry.js.map +1 -1
  44. package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
  45. package/dist/components/content/tooltip/tooltip.js +2 -0
  46. package/dist/components/content/tooltip/tooltip.js.map +1 -1
  47. package/dist/components/{icon-DFhgRf3P.js → icon-BJHKWhY5.js} +21 -2
  48. package/dist/components/{icon-button-Sxkh5cVr.js → icon-button-DhBIq6lN.js} +75 -2
  49. package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
  50. package/dist/components/inputs/code-editor/code-editor.styles.js +36 -6
  51. package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
  52. package/dist/components/inputs/date-picker/date-picker.d.ts +2 -2
  53. package/dist/components/inputs/date-picker/date-picker.i18n.d.ts +1 -1
  54. package/dist/components/inputs/date-picker/date-picker.i18n.js +1 -1
  55. package/dist/components/inputs/date-picker/date-picker.i18n.js.map +1 -1
  56. package/dist/components/inputs/date-picker/date-picker.template.js +1 -1
  57. package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
  58. package/dist/components/inputs/file-field/file-field.d.ts +86 -10
  59. package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
  60. package/dist/components/inputs/file-field/file-field.drop.d.ts +34 -0
  61. package/dist/components/inputs/file-field/file-field.drop.d.ts.map +1 -0
  62. package/dist/components/inputs/file-field/file-field.drop.js +176 -0
  63. package/dist/components/inputs/file-field/file-field.drop.js.map +1 -0
  64. package/dist/components/inputs/file-field/file-field.i18n.d.ts +20 -1
  65. package/dist/components/inputs/file-field/file-field.i18n.d.ts.map +1 -1
  66. package/dist/components/inputs/file-field/file-field.i18n.js +20 -1
  67. package/dist/components/inputs/file-field/file-field.i18n.js.map +1 -1
  68. package/dist/components/inputs/file-field/file-field.js +283 -15
  69. package/dist/components/inputs/file-field/file-field.js.map +1 -1
  70. package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -1
  71. package/dist/components/inputs/file-field/file-field.styles.js +245 -10
  72. package/dist/components/inputs/file-field/file-field.styles.js.map +1 -1
  73. package/dist/components/inputs/file-field/file-field.template.d.ts +1 -0
  74. package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
  75. package/dist/components/inputs/file-field/file-field.template.js +167 -28
  76. package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
  77. package/dist/components/inputs/file-field/file-field.truncate.d.ts +22 -0
  78. package/dist/components/inputs/file-field/file-field.truncate.d.ts.map +1 -0
  79. package/dist/components/inputs/file-field/file-field.truncate.js +62 -0
  80. package/dist/components/inputs/file-field/file-field.truncate.js.map +1 -0
  81. package/dist/components/inputs/text-editor/text-editor.code-copy.d.ts +10 -0
  82. package/dist/components/inputs/text-editor/text-editor.code-copy.d.ts.map +1 -0
  83. package/dist/components/inputs/text-editor/text-editor.code-copy.js +141 -0
  84. package/dist/components/inputs/text-editor/text-editor.code-copy.js.map +1 -0
  85. package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
  86. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts.map +1 -1
  87. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js +55 -7
  88. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -1
  89. package/dist/components/inputs/text-editor/text-editor.i18n.d.ts +5 -0
  90. package/dist/components/inputs/text-editor/text-editor.i18n.d.ts.map +1 -1
  91. package/dist/components/inputs/text-editor/text-editor.i18n.js +7 -0
  92. package/dist/components/inputs/text-editor/text-editor.i18n.js.map +1 -1
  93. package/dist/components/inputs/text-editor/text-editor.js +34 -3
  94. package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
  95. package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
  96. package/dist/components/inputs/text-editor/text-editor.markdown.js +6 -2
  97. package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
  98. package/dist/components/inputs/text-editor/text-editor.selection.d.ts.map +1 -1
  99. package/dist/components/inputs/text-editor/text-editor.selection.js +11 -1
  100. package/dist/components/inputs/text-editor/text-editor.selection.js.map +1 -1
  101. package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
  102. package/dist/components/inputs/text-editor/text-editor.styles.js +130 -7
  103. package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
  104. package/dist/components/inputs/text-editor/text-editor.tasks.d.ts +17 -0
  105. package/dist/components/inputs/text-editor/text-editor.tasks.d.ts.map +1 -0
  106. package/dist/components/inputs/text-editor/text-editor.tasks.js +109 -0
  107. package/dist/components/inputs/text-editor/text-editor.tasks.js.map +1 -0
  108. package/dist/components/layout/page-sections/hero/hero-corner.styles.d.ts.map +1 -1
  109. package/dist/components/layout/page-sections/hero/hero-corner.styles.js +61 -0
  110. package/dist/components/layout/page-sections/hero/hero-corner.styles.js.map +1 -1
  111. package/dist/components/layout/page-sections/hero/hero.d.ts +1 -1
  112. package/dist/components/layout/page-sections/hero/hero.js +1 -1
  113. package/dist/components/layout/popover/popover.d.ts +6 -0
  114. package/dist/components/layout/popover/popover.d.ts.map +1 -1
  115. package/dist/components/layout/popover/popover.js +16 -0
  116. package/dist/components/layout/popover/popover.js.map +1 -1
  117. package/dist/components/layout/popover/popover.styles.d.ts.map +1 -1
  118. package/dist/components/layout/popover/popover.styles.js +13 -0
  119. package/dist/components/layout/popover/popover.styles.js.map +1 -1
  120. package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
  121. package/dist/components/navigation/document-tab-bar/document-tab-bar.js +5 -0
  122. package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
  123. package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
  124. package/dist/components/navigation/menu-bar/menu-bar.js +2 -0
  125. package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
  126. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
  127. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +3 -0
  128. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
  129. package/dist/components/status-and-feedback/banner/banner.d.ts +1 -1
  130. package/dist/components/status-and-feedback/banner/banner.js +2 -2
  131. package/dist/components/status-and-feedback/banner/banner.js.map +1 -1
  132. package/dist/components/status-and-feedback/notification/notification.d.ts +1 -1
  133. package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
  134. package/dist/components/status-and-feedback/notification/notification.js +4 -2
  135. package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
  136. package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.d.ts +1 -1
  137. package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.js +1 -1
  138. package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.js.map +1 -1
  139. package/dist/components/status-and-feedback/progress-bar/progress-bar.js +1 -1
  140. package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
  141. package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.d.ts +1 -1
  142. package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.js +1 -1
  143. package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.js.map +1 -1
  144. package/dist/components/status-and-feedback/progress-circle/progress-circle.js +1 -1
  145. package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
  146. package/dist/css/themes/donkergeel.css +5 -0
  147. package/dist/css/themes/geel.css +5 -0
  148. package/dist/css/themes.css +10 -0
  149. package/dist/css/variables.css +11 -11
  150. package/dist/nldd.min.js +1909 -1317
  151. package/dist/translations/en-US.d.ts.map +1 -1
  152. package/dist/translations/en-US.js +29 -4
  153. package/dist/translations/en-US.js.map +1 -1
  154. package/dist/translations/fy.d.ts.map +1 -1
  155. package/dist/translations/fy.js +29 -4
  156. package/dist/translations/fy.js.map +1 -1
  157. package/dist/translations/nl.generated.d.ts +29 -4
  158. package/dist/translations/nl.generated.d.ts.map +1 -1
  159. package/dist/translations/pap-AW.d.ts.map +1 -1
  160. package/dist/translations/pap-AW.js +29 -4
  161. package/dist/translations/pap-AW.js.map +1 -1
  162. package/dist/translations/pap-CW.d.ts.map +1 -1
  163. package/dist/translations/pap-CW.js +29 -4
  164. package/dist/translations/pap-CW.js.map +1 -1
  165. package/dist/types/vue.d.ts +12 -12
  166. package/dist/utilities/carried-context.d.ts +20 -0
  167. package/dist/utilities/carried-context.d.ts.map +1 -0
  168. package/dist/utilities/carried-context.js +76 -0
  169. package/dist/utilities/carried-context.js.map +1 -0
  170. package/dist/utilities/codemirror/languages.d.ts +5 -1
  171. package/dist/utilities/codemirror/languages.d.ts.map +1 -1
  172. package/dist/utilities/codemirror/languages.js +21 -1
  173. package/dist/utilities/codemirror/languages.js.map +1 -1
  174. package/dist/utilities/dismiss-from-title-bar.d.ts +1 -1
  175. package/dist/utilities/dismiss-from-title-bar.js +1 -1
  176. package/package.json +1 -1
@@ -193,7 +193,7 @@ declare module 'vue' {
193
193
  'tooltip-timing'?: NLDDAvatar['tooltipTiming'];
194
194
  /** When the name appears as a tooltip on hover or focus: `delay` (the default, after 700ms), `instant`, or `never`. An avatar shows no text, so without a tooltip the name is readable by assistive software only. A `decorative` avatar shows none regardless: there the name already stands beside it as text */
195
195
  'tooltipTiming'?: NLDDAvatar['tooltipTiming'];
196
- /** Makes the avatar a link to this URL; the shape itself becomes the link, so the hit area and the focus ring follow it */
196
+ /** Makes the avatar a link to this URL; the shape itself becomes the link, so the hit area and the focus ring follow it. As a link or a button the avatar needs size 24 or larger (WCAG 2.5.8) */
197
197
  'href'?: NLDDAvatar['href'];
198
198
  /** Takes the control out of the tab order (tabindex="-1"), for an avatar that is a link or a button inside a roving container (a row of an nldd-list). Does nothing on a decorative avatar. */
199
199
  'no-tab'?: NLDDAvatar['noTab'];
@@ -218,7 +218,7 @@ declare module 'vue' {
218
218
  type NLDDAvatarGroupProps = {
219
219
  /** Diameter of each avatar in px (spacer-aligned: 16, 20, 24, 28, 32, 40, 44, 48, 56, 64, 80, 96); default 40 */
220
220
  'size'?: NLDDAvatarGroup['size'];
221
- /** Shows at most this many avatars; the rest go behind a "+N" button that opens them as a list of names */
221
+ /** Shows at most this many avatars; the rest go behind a "+N" button that opens them as a list of names. A longer number is set smaller, and where it no longer fits the disc the button shows an ellipsis with the count in a tooltip (a number shows from size 24 with one digit, 40 with two, 56 with three and 80 with four) */
222
222
  'max'?: NLDDAvatarGroup['max'];
223
223
  /** Describes the group as a whole (e.g. "Editors"); without a label the group is not a landmark of its own and the avatars speak for themselves */
224
224
  'accessible-label'?: NLDDAvatarGroup['accessibleLabel'];
@@ -260,7 +260,7 @@ declare module 'vue' {
260
260
  'variant'?: NLDDBanner['variant'];
261
261
  /** Banner size (default: 'md'). 'sm' tightens the padding to 8px, drops the icon to 24px and uses a smaller dismiss button — for a bar that sits between chrome and content rather than a standalone page-level notice. The typography is unchanged. */
262
262
  'size'?: NLDDBanner['size'];
263
- /** Icon override. Default per variant: neutral → info-circle-filled, accent → info-circle-filled, success → check-circle-filled, warning → exclamation-triangle-filled, critical → exclamation-circle-filled */
263
+ /** Icon override. Default per variant: neutral → info-circle-filled, accent → info-circle-filled, success → check-mark-circle-filled, warning → exclamation-triangle-filled, critical → exclamation-circle-filled */
264
264
  'icon'?: NLDDBanner['icon'];
265
265
  /** Main text (heading or paragraph, depending on heading-level) */
266
266
  'text'?: NLDDBanner['text'];
@@ -1207,7 +1207,7 @@ declare module 'vue' {
1207
1207
  type NLDDHeroProps = {
1208
1208
  /** Body max-width; 'full' removes the bound (section API) */
1209
1209
  'width'?: NLDDHero['width'];
1210
- /** Rounds one corner of the media area, in the shape language of the Rijkshuisstijl: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right', or empty (or 'auto') to let the hero choose a corner the panel leaves free. With media it applies with `layout="contained"` and the panel in a corner or along a side; with overlap or a centered panel the hero stays rectangular and says so in development. The panel stands against the edge of the image, so a `main-width` in percent (33.33%, 50%) is a share of the image, and gets a corner at half the radius, the one pointing into the image; a panel along a full side, a `main-width="full"` strip and the panel on mobile stay square. On mobile a bottom corner moves to the top. Without media the panel is the whole hero: the corner applies in every layout and position, at half the radius, and the hero chooses top-right, or top-left for a panel on the right. The radius comes from the ribbon width: 1.5X on sm, 2X on md and lg, and is never more than a third of the shortest side of the area it rounds, so a low hero keeps a corner rather than a drop. Says so in development when the chosen corner sits under the panel, or with `width="full"` */
1210
+ /** Rounds one corner of the media area, in the shape language of the Rijkshuisstijl: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right', or empty (or 'auto') to let the hero choose a corner the panel leaves free. With media it applies with `layout="contained"` and the panel in a corner or along a side; with overlap or a centered panel the hero stays rectangular and says so in development. The panel stands against the edge of the image, so a `main-width` in percent (33.33%, 50%) is a share of the image, and gets a corner at half the radius, the one pointing into the image, with more padding along its two sides so the content keeps its distance to the curve. A panel along the same edge as the rounded corner of the image stops before the curve, at the panel's padding from it; a panel along a full side, a `main-width="full"` strip and the panel on mobile stay square. On mobile a bottom corner moves to the top, and the panel stands under the image, as wide as it, instead of overlapping it. Without media the panel is the whole hero: the corner applies in every layout and position, at half the radius, and the hero chooses top-right, or top-left for a panel on the right. The radius comes from the ribbon width: 1.5X on sm, 2X on md and lg, and is never more than a third of the shortest side of the area it rounds, so a low hero keeps a corner rather than a drop. Says so in development when the chosen corner sits under the panel, or with `width="full"` */
1211
1211
  'corner'?: NLDDHero['corner'];
1212
1212
  /** How the panel relates to the image (default: 'overlap'). 'contained' keeps it on the image, in any of the eight positions; 'overlap' lets it fall `overlap-size` over the bottom of the image and run on below as far as its content needs, so the image keeps its height whatever the content. In 'overlap' the image has a fixed height (320px on md, 400px on lg) unless `media-height` or `media-aspect-ratio` is set, and only the horizontal side of `main-position` counts. A panel shorter than `overlap-size` ends inside the image and says so in development */
1213
1213
  'layout'?: NLDDHero['layout'];
@@ -1968,7 +1968,7 @@ declare module 'vue' {
1968
1968
  type NLDDNotificationProps = {
1969
1969
  /** What kind of message this is; sets the icon color and the ARIA role (default: 'neutral') */
1970
1970
  'variant'?: NLDDNotification['variant'];
1971
- /** Icon override. Default per variant: neutral → info-circle-filled, accent → info-circle-filled, success → check-circle-filled, warning → exclamation-triangle-filled, critical → exclamation-circle-filled */
1971
+ /** Icon override. Default per variant: neutral → info-circle-filled, accent → info-circle-filled, success → check-mark-circle-filled, warning → exclamation-triangle-filled, critical → exclamation-circle-filled */
1972
1972
  'icon'?: NLDDNotification['icon'];
1973
1973
  /** The message */
1974
1974
  'text'?: NLDDNotification['text'];
@@ -3171,11 +3171,11 @@ declare module 'vue' {
3171
3171
  'resize'?: NLDDTextEditor['resize'];
3172
3172
  /** 'simple' (default, bare) | 'input-field' (framed surface) */
3173
3173
  'appearance'?: NLDDTextEditor['appearance'];
3174
- /** 'visible' (default): every formatting mark stays in view, dimmed, a bullet as the character you typed (`-`, `*` or `+`). 'hidden': the marks of bold, italic, strikethrough, inline code, links and the `#` of a heading are hidden and come back where the caret or the selection touches that construct, so the text reads closer to the result while what you edit is still the markdown. A bullet reads as a dot, and shows its character on the line the caret is on. A quote reads as a line on the left; with the caret anywhere in it, its `>` marks show instead, in the same place. A `---` line reads as a divider until the caret is on it, and a code block loses its ``` fence lines until the caret is in it, since its own tint and edge already say what it is. The numbers of a numbered list stay: they are content. Read-only and disabled hide every mark, which makes a clean read view. The value is plain markdown either way. */
3174
+ /** 'visible' (default): every formatting mark stays in view, dimmed, a bullet as the character you typed (`-`, `*` or `+`). 'hidden': the marks of bold, italic, strikethrough, inline code, links and the `#` of a heading are hidden and come back where the caret or the selection touches that construct, so the text reads closer to the result while what you edit is still the markdown. A bullet reads as a dot, and shows its character on the line the caret is on. A quote reads as a line on the left; with the caret anywhere in it, its `>` marks show instead, in the same place. A `---` line reads as a divider until the caret is on it, and a code block loses its closing ``` line until the caret is in it, since its own tint and edge already say what it is. Its opening line stays as the head of the block, with only the backticks hidden: the language as a label on the left, the copy button on the right. The numbers of a numbered list stay, in the color of the text: they are content. Read-only and disabled hide every mark, which makes a clean read view. The value is plain markdown either way. */
3175
3175
  'syntax'?: NLDDTextEditor['syntax'];
3176
3176
  /** Enable the annotation overlay (off by default). Annotations only render when this is set. */
3177
3177
  'annotatable'?: NLDDTextEditor['annotatable'];
3178
- /** Override the editor's assistive-tech strings (the open-in-new-tab link badge and the annotation count badge). Unset keys fall back to Dutch. */
3178
+ /** Override the editor's assistive-tech strings (the open-in-new-tab link badge, the annotation count badge, the label of a task's box and the copy button of a code block). Unset keys fall back to Dutch. */
3179
3179
  'translations'?: NLDDTextEditor['translations'];
3180
3180
  /** Editor content (markdown) */
3181
3181
  'value'?: NLDDTextEditor['value'];
@@ -3900,7 +3900,7 @@ declare module 'vue' {
3900
3900
  'nldd-activity-indicator': DefineComponent<NLDDActivityIndicatorProps>;
3901
3901
  /** Shows one person or organization as a compact, round (person) or rounded (organization) representation. The content follows a fixed fallback chain: an image when `src` loads, otherwise the initials (from `initials` or derived from `name`), and otherwise a fallback icon. `type` sets both the shape and the fallback icon: `person` gives a circle with a person icon, `organization` a rounded square with a building icon. The shape belongs to the meaning and cannot be set on its own. Override the fallback icon with `icon` where that helps. Without `size` the avatar scales with its container, like `nldd-icon`; a fixed size (the same spacer-aligned scale, 16 through 96) is the exception. The initials and the icon scale along. Wide initials (WW, MMM) are scaled down automatically so they stay inside the shape. Accessibility: the host element carries the meaning. With a `name` (and without `decorative`) it gets `role="img"` with the name as its label. When the name already stands beside it as text, in an identity for instance, set `decorative` so the avatar stays hidden from assistive software. A dead `src` falls back to the initials or the icon, never to a broken-image icon. */
3902
3902
  'nldd-avatar': DefineComponent<NLDDAvatarProps>;
3903
- /** Shows several avatars as one group: they overlap, and each one gets a ring in the surface color so they stay apart where they meet. The ring uses the same mechanism as the badge, so on a colored surface you hand the color over through `--context-parent-background-color`. Slot `nldd-avatar` elements, not bare `img`. An avatar already knows what to do with a dead image, when to fall back to initials, and how to show its name as a tooltip; a loose image would have to reproduce all of that and cannot do the last one. Set `decorative` when the names already stand beside the group as text; otherwise give every avatar a name, because the group itself describes nobody. The size applies to the whole group: it is imposed on the avatars, a slotted `img` included. That keeps the row on one line whatever a consumer hands over. */
3903
+ /** Shows several avatars as one group: they overlap, and each one gets a ring in the surface color so they stay apart where they meet. The ring uses the same mechanism as the badge, so on a colored surface you hand the color over through `--context-parent-background-color`. Slot `nldd-avatar` elements, not bare `img`. An avatar already knows what to do with a dead image, when to fall back to initials, and how to show its name as a tooltip; a loose image would have to reproduce all of that and cannot do the last one. Set `decorative` when the names already stand beside the group as text; otherwise give every avatar a name, because the group itself describes nobody. The size applies to the whole group: it is imposed on the avatars, a slotted `img` included. That keeps the row on one line whatever a consumer hands over. Avatars that are links or buttons need size 32 or larger: they overlap, so each keeps only part of its width as a target (WCAG 2.5.8). On sm the list behind the button is a bottom sheet with a title bar, which names the group (its `accessible-label`) and closes it. The row never overflows its container. Where there is no room for every avatar, the group shows as many as fit and puts the rest behind the "+N" button, as `max` does; `max` is then the most it shows, not a fixed count. */
3904
3904
  'nldd-avatar-group': DefineComponent<NLDDAvatarGroupProps>;
3905
3905
  /** Shows the state of something, or how much of it there is: a status, a number of unread messages, a dot saying something is new. What it says is decided by the system, and it changes without anyone touching it. A badge is never interactive. It shows text, a number and/or an icon; with no content it becomes a dot. Put it in a corner of another element (an icon, for instance) or on its own. For a property someone assigns to something, such as a category, a role or a certification, use `nldd-tag`. For standalone data the user works with, such as a chosen person or an active filter, use `nldd-token`. */
3906
3906
  'nldd-badge': DefineComponent<NLDDBadgeProps>;
@@ -3920,7 +3920,7 @@ declare module 'vue' {
3920
3920
  /** A horizontal container for grouping buttons with a neutral background. Automatically propagates its size and appearance to all child nldd-button and nldd-icon-button elements. Renders nldd-button-bar-divider elements as internal dividers — no separate component needed. The bar is one surface for actions; on/off buttons do not go in it. For a row of toggles use nldd-toggle-button-group, and for one choice out of a few options on one surface nldd-segmented-control. An nldd-toggle-button placed here is shown as it is, and a warning says so in development. */
3921
3921
  'nldd-button-bar': DefineComponent<NLDDButtonBarProps>;
3922
3922
  'nldd-button-bar-divider': DefineComponent<anonymous_0Props>;
3923
- /** A container for grouping related buttons together, in a row or stacked. `auto`, the default, is a row on a container wide enough for one and a stack over the full width below the sm breakpoint, where two labels beside each other leave no room for either. The group is its own container, so it follows the width it was given rather than the width of the window: the same group is a row in a page and a stack in a sheet beside it. Being a container has one consequence to know: the width has to come from the parent, since a container may not size itself from what is inside it. In a parent that shrink-wraps its content (an inline-flex box, a float, a table cell, a flex item at `width: auto`) the group measures zero and its buttons are invisible. It says so once in development. Give the group or that parent a width. A stack fills the width with its buttons, except an `nldd-icon-button`, which keeps its own size: a bar with a single glyph in the middle is not a bigger target, only a wider one. */
3923
+ /** A container for grouping related buttons together, in a row or stacked. `auto`, the default, is a row, and a stack over the full width in a container of 30rem (480px) or less, the width of a phone, where two labels beside each other leave no room for either. A card or a dialog between 480px and the sm breakpoint keeps its row. The group is its own container, so it follows the width it was given rather than the width of the window: the same group is a row in a page and a stack in a sheet beside it. Being a container has one consequence to know: the width has to come from the parent, since a container may not size itself from what is inside it. In a parent that shrink-wraps its content (an inline-flex box, a float, a table cell, a flex item at `width: auto`) the group measures zero and its buttons are invisible. It says so once in development. Give the group or that parent a width. A stack fills the width with its buttons, except an `nldd-icon-button`, which keeps its own size: a bar with a single glyph in the middle is not a bigger target, only a wider one. */
3924
3924
  'nldd-button-group': DefineComponent<NLDDButtonGroupProps>;
3925
3925
  /** A visually bounded card with optional header, body and footer sections. The card is elevated by default. Padding is left to nested containers. With `href` the whole card becomes a link (an overlay anchor across the card), with `button` a button (an overlay button that fires a plain, composed `click`, so a click listener or htmx attribute on the card itself works directly, and Enter/Space work natively). `href` wins when both are set. Nested interactive content, footer buttons for instance, has to be lifted above it with `position: relative; z-index: 1` to stay clickable. A card that is a link or button steps its surface and border one shade up on hover and one more while pressed, as a neutral-base button does; content lifted above the overlay does not set it off. On a touch screen there is no hover, and a touch that turns into a scroll lets go of the pressed shade. */
3926
3926
  'nldd-card': DefineComponent<NLDDCardProps>;
@@ -3955,7 +3955,7 @@ declare module 'vue' {
3955
3955
  'nldd-drag-handle-cell': DefineComponent<NLDDDragHandleCellProps>;
3956
3956
  /** A visual wrapper around a native `<select>` element. The consumer provides a native `<select>` as a slotted child — this way the browser retains full control over form submission, accessibility and keyboard navigation, including `<optgroup>`, `data-*` attributes and dynamic changes to options. A dropdown hides its options, so it is the last resort for a choice from a fixed set. Show a handful of options with nldd-segmented-control, nldd-toggle-button-group or nldd-radio-button-group, and let the user type in nldd-combo-box when there are many, a list of countries included. The design guidelines explain the order. */
3957
3957
  'nldd-dropdown': DefineComponent<NLDDDropdownProps>;
3958
- /** A file picker that reads as one control: an nldd-button flush in the corner of a tinted surface, the chosen file next to it, and a dismiss button to clear it again. It wraps a hidden native `<input type="file">`, which is what makes the picker open at all — a file dialog only opens from a user gesture on a real input. The surface deliberately does not look like an input field. A border with field semantics promises you can type into it; here you can only press a button, so it uses button and surface colors instead of `--semantics-input-fields-*`. The button keeps its own tinted background and therefore sits a shade darker in the surface, which is what marks it as the thing to press. Several files are summarized, not listed: "3 bestanden" with a single cross that clears all of them. Every pick replaces the whole FileList, and rebuilding it to add or drop one file means going through DataTransfer, which does not deduplicate (even the same File object twice yields two entries) — and a File has no id, so deduplicating would come down to guessing from name, size and last-modified. A list with a cross per file would promise an edit the platform does not support. A page that does want to show the files renders its own list from the `File[]` in the change event. */
3958
+ /** A file picker that reads as one control. Empty, the whole tinted surface is one button with one sentence centered in it, "Bestand kiezen of sleep het hierheen", its first part accented, so a press anywhere on it opens the file dialog. Once a file is chosen, the surface shows it with the icon of its format, its name, a button to choose another and a dismiss button to clear it again. A long name is cut in the middle, so its start and its end stay in view ("Screenshot 20…at 13.12.21.png"); it then shows whole in a tooltip, and a screen reader reads it whole either way. It wraps a hidden native `<input type="file">`, which is what makes the picker open at all — a file dialog only opens from a user gesture on a real input. Files can be dropped on the whole field. A drop goes through the same input, so it fires the same `change` with the same detail and submits the same way as a pick. `accept` and `multiple` hold for a drop too, which the native input does not do: a drop that does not fit is refused as a whole, the previous choice stays, and the field says why for a few seconds: "Sleep één bestand", or what `accept` takes, named from it ("Het bestand moet een PDF zijn"; "Dit bestandstype past niet" where a type in it has no name). A dropped folder is refused as well ("Sleep een bestand, geen map"): it arrives as a file without a type that cannot be read, and only the drop tells it apart, not the drag. The message stays for a few seconds and then gives way to the field again. While files are dragged over the page, every field marks itself as a place to put them, and the field under the pointer says it will take them (a field with a file: that they replace it), or turns critical and refuses already when the number or the type rules them out. A file dropped next to a field no longer makes the browser open it and leave the page; a drop that another drop zone or an editable field takes is left alone. On a device without hover there is no dragging, so the field there drops the hint. The surface deliberately does not look like an input field. A border with field semantics promises you can type into it; here you can only press it or drop a file on it, so it has the border of a tinted surface instead of `--semantics-input-fields-*`. Several files are summarized, not listed: "3 bestanden" with a single cross that clears all of them. Every pick replaces the whole FileList, and rebuilding it to add or drop one file means going through DataTransfer, which does not deduplicate (even the same File object twice yields two entries) — and a File has no id, so deduplicating would come down to guessing from name, size and last-modified. A list with a cross per file would promise an edit the platform does not support. A page that does want to show the files renders its own list from the `File[]` in the change event. */
3959
3959
  'nldd-file-field': DefineComponent<NLDDFileFieldProps>;
3960
3960
  /** Nederlandse Digitale Dienst Form Component Plain custom element (extends HTMLElement, no Lit), required for light-DOM autofill. Renders a real <form> element in the LIGHT DOM around its children. Chrome's autofill engine looks for native <input> elements that have a <form> ancestor in the light DOM; with shadow-DOM inputs it can't find them, so we keep this component shadow-less. **Differs from other nldd-* components:** - No shadowRoot: all children live in the light DOM (inside the inner <form>) - No Lit: a plain HTMLElement with manual attribute mirroring - **Requires a global stylesheet import**: the vertical rhythm rules live in `dist/css/form.css` (or `global.css`), not in a component-specific shadow stylesheet. Import it as part of your app's global CSS bundle. **When a field turns red:** on submit the form marks every control the browser rejects with `invalid`, and clears it again once the value passes. Setting `invalid` yourself is fine, but do it on submit, not while someone is still typing, or a field turns red over a value that is not finished yet. **Two usage modes:** 1. **Auto-wrap** (default): write children directly. Component creates a `<form>` element and migrates children into it via MutationObserver. Simplest API. 2. **User-provided form** (framework-friendly): write your own `<form>` as direct child. Component detects it, takes over attribute mirroring, and skips the migration. Children stay where your framework puts them, so there is no DOM shuffling to conflict with React/Vue/Angular reconciliation. **Framework interop:** In auto-wrap mode every direct child is moved into the inner form through a MutationObserver. That works fine for most React/Vue use cases, because frameworks only mutate the DOM when their virtual DOM changes. For edge cases (animation libraries that track DOM position, SSR hydration mismatches, frameworks that actively check sibling positions) use **user-provided form** mode instead. For programmatic manipulation, use the `form` getter so you work with the inner `<form>` element directly: const inner = document.querySelector('nldd-form').form; inner.checkValidity(); inner.appendChild(myInput); // skips the migration overhead */
3961
3961
  'nldd-form': DefineComponent<NLDDFormProps>;
@@ -4030,7 +4030,7 @@ declare module 'vue' {
4030
4030
  'nldd-pagination': DefineComponent<NLDDPaginationProps>;
4031
4031
  /** A password input field with visibility toggle and validation states. */
4032
4032
  'nldd-password-field': DefineComponent<NLDDPasswordFieldProps>;
4033
- /** A non-modal floating panel anchored to a trigger element. Built on the native Popover API (popover="auto") with Floating UI for positioning. The browser handles opening, toggling and light dismiss; this component only handles positioning and focus. The recommended use is through popovertarget, so the browser owns the toggle: <nldd-button id="info-trigger" popovertarget="info-popover">Info</nldd-button> <nldd-popover id="info-popover" anchor="info-trigger" accessible-label="Info"> <nldd-container> <p>Content of the popover.</p> </nldd-container> </nldd-popover> To open it from your own state instead, bind `open` together with the close event: the popover clears `open` itself on light dismiss, Escape or a click on its anchor. It needs that anchor to open against. For a custom focus target inside the popover, put `autofocus` on the child you want. Without it the popover host itself takes focus. */
4033
+ /** A non-modal floating panel anchored to a trigger element. Built on the native Popover API (popover="auto") with Floating UI for positioning. The browser handles opening, toggling and light dismiss; this component only handles positioning and focus. The recommended use is through popovertarget, so the browser owns the toggle: <nldd-button id="info-trigger" popovertarget="info-popover">Info</nldd-button> <nldd-popover id="info-popover" anchor="info-trigger" accessible-label="Info"> <nldd-container> <p>Content of the popover.</p> </nldd-container> </nldd-popover> To open it from your own state instead, bind `open` together with the close event: the popover clears `open` itself on light dismiss, Escape or a click on its anchor. It needs that anchor to open against. For a custom focus target inside the popover, put `autofocus` on the child you want. Without it the popover host itself takes focus. On sm the popover is a bottom sheet that closes with Escape or a tap outside it. Where that is not enough, give its content a title bar of its own, as in a sheet: an nldd-page with an nldd-top-title-bar and a `dismiss-text`. The popover catches the dismiss of that bar and closes. It draws no bar itself. */
4034
4034
  'nldd-popover': DefineComponent<NLDDPopoverProps>;
4035
4035
  /** Exports both NLDDProgressBar and NLDDProgressBarSegmentIndicator. A progress bar that supports a single value (loading-style) or multiple segments (multi-stage progress, or distribution like storage usage). The consumer provides raw values; the component computes percentages from `max`. Two variants: - `progress` (default): segments sum toward `max`; remaining space is empty track. ARIA reads "X% voltooid". - `distribution`: segments fill the bar; ARIA enumerates segments. If the sum of segment values exceeds `max`, segments are normalized proportionally to fit and a warning is logged. */
4036
4036
  'nldd-progress-bar': DefineComponent<NLDDProgressBarProps>;
@@ -4101,7 +4101,7 @@ declare module 'vue' {
4101
4101
  'nldd-text': DefineComponent<NLDDTextProps>;
4102
4102
  /** A cell component for displaying text content in lists with configurable alignment, size and color. This is the most fundamental list cell component. `vertical-alignment="center"` (default) stretches the cell to fill the full row height and centers its content within that space. Use `min-height` to set a minimum centered region. For strict top alignment without a minimum height, use `vertical-alignment="top"`. Each text region (overline, main text, supporting text) accepts either a string attribute or slotted DOM content. The slot is the source of truth: if the consumer provides slotted content, it replaces the attribute-based render for that region. Use slots when you need inline elements like `<nldd-tag>`, `<a>` or `<nldd-icon>` mixed with text. Note that `query` highlighting and `**bold**` parsing only apply to the attribute path — slotted content is rendered as-is. */
4103
4103
  'nldd-text-cell': DefineComponent<NLDDTextCellProps>;
4104
- /** A hybrid markdown editor built on CodeMirror 6 (via NLDDCodeMirrorElement): the document stays plain markdown text, but formatting is shown inline (bold is bold, headings are larger, links are colored) while the syntax markers stay visible, only dimmed — the iA Writer / Kirby approach. No WYSIWYG tree, so the data stays portable. Default `appearance="simple"` is bare (no frame, no focus ring) for use inside a composition (e.g. a message field) that owns its chrome and focus; the caret is a prominent accent. `appearance="input-field"` adds a framed surface + focus Headless: there is no built-in toolbar. A consumer drives formatting via the command methods (toggleBold/toggleItalic/toggleInlineCode/toggleStrikethrough/ toggleHeading/toggleBulletList/toggleTaskList/toggleQuote/toggleLink/runCommand to toggle, and setHeading/setList for picker-style "set" semantics), reads the active formats with getState(), listens to the nldd-text-editor-state event to render toggle states, and forwards padding clicks with focusFromPoint(). Cmd/Ctrl+B/I/E/K are bound out of the box. Commands keep focus on the editor. An inline toggle wraps the selected text (whitespace at its edges stays outside the markers), unwraps a run the caret is in, and with the caret at the very end of a run steps out of it. Bold that a typed space has broken (`**woord **`) keeps its styling while the caret is inside; the space moves outside the markers when the caret leaves. insertAtCursor(text) puts text at the caret and replaceRange(from, to, text) writes at the same clean offsets getSelection() reads. An @-mention typeahead (mentionSource) collapses to an atomic token, further typeahead lists on their own trigger (typeaheads) write what you tell them to, and a W3C-style annotation overlay (annotations) marks ranges with a light tint and a count badge without touching the underlying text. To show the value, render the markdown into nldd-rich-text, which uses the same type, bold and code as the editor. A mention is stored as `[@Name](user:id)`: turn it into `<a href="…" data-mention>Name</a>` (or a `span` when there is no page for the person), without the `@`. A link reads as the same token there; a span keeps the color and the icon without the tint. */
4104
+ /** A hybrid markdown editor built on CodeMirror 6 (via NLDDCodeMirrorElement): the document stays plain markdown text, but formatting is shown inline (bold is bold, headings are larger, links are colored) while the syntax markers stay visible, only dimmed — the iA Writer / Kirby approach. No WYSIWYG tree, so the data stays portable. Default `appearance="simple"` is bare (no frame, no focus ring) for use inside a composition (e.g. a message field) that owns its chrome and focus; the caret is a prominent accent. `appearance="input-field"` adds a framed surface + focus Headless: there is no built-in toolbar. A consumer drives formatting via the command methods (toggleBold/toggleItalic/toggleInlineCode/toggleStrikethrough/ toggleHeading/toggleBulletList/toggleTaskList/toggleQuote/toggleLink/runCommand to toggle, and setHeading/setList for picker-style "set" semantics), reads the active formats with getState(), listens to the nldd-text-editor-state event to render toggle states, and forwards padding clicks with focusFromPoint(). Cmd/Ctrl+B/I/E/K are bound out of the box. With `syntax="hidden"` a task item (`- [ ]`, `- [x]`) reads as a box in the place of its bullet, and like every other mark shows its markdown on the line the caret is on. A click on the box checks or unchecks it without moving the caret. Cmd/Ctrl+Enter does the same for the tasks on the lines of the selection, in both syntax modes. The box is no tab stop: Tab leaves the editor. A screen reader reads "Taak, open" or "Taak, afgerond" in its place. A code block that names its language after the backticks is highlighted in it, as in nldd-code-viewer; the grammar loads with the first such block. Its opening line is the head of the block, with a "Kopieer" button at the right edge that copies the code without its fences and says "Gekopieerd" or "Kopiëren mislukt", as the code viewer does. In an editable editor the button is no tab stop (select and copy is the keyboard route); read-only or disabled it can be focused. Without a secure context there is no button. Commands keep focus on the editor. An inline toggle wraps the selected text (whitespace at its edges stays outside the markers), unwraps a run the caret is in, and with the caret at the very end of a run steps out of it. Bold that a typed space has broken (`**woord **`) keeps its styling while the caret is inside; the space moves outside the markers when the caret leaves. insertAtCursor(text) puts text at the caret and replaceRange(from, to, text) writes at the same clean offsets getSelection() reads. An @-mention typeahead (mentionSource) collapses to an atomic token, further typeahead lists on their own trigger (typeaheads) write what you tell them to, and a W3C-style annotation overlay (annotations) marks ranges with a light tint and a count badge without touching the underlying text. To show the value, render the markdown into nldd-rich-text, which uses the same type, bold and code as the editor. A mention is stored as `[@Name](user:id)`: turn it into `<a href="…" data-mention>Name</a>` (or a `span` when there is no page for the person), without the `@`. A link reads as the same token there; a span keeps the color and the icon without the tint. */
4105
4105
  'nldd-text-editor': DefineComponent<NLDDTextEditorProps>;
4106
4106
  'nldd-text-field': DefineComponent<NLDDTextFieldProps>;
4107
4107
  /** A text field for a time. The value is always 24-hour `HH:mm`, which is how Dutch shows it too, so unlike nldd-date-field there is nothing to convert. Typing is not masked: input is accepted generously and normalized only when the field is left. Error messages belong to nldd-form-field, not here. This field reflects only `invalid` / `valid`, like nldd-text-field. What you do in the picker is a preview until you leave it. The field shows the time right away but commits it on close. "Klaar" and Enter keep the choice, and so does a click outside once you have picked something. Cancel and Escape put the old time back. On an empty field the wheels open at `min`, or otherwise at the current time rounded to `step`, which does not fill in the field yet. */
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The color scheme and language an element had in its place on the page,
3
+ * carried along when a component moves it somewhere else: a submenu into
4
+ * `<body>` for a drill-in, an overflow menu or sheet that lives in `<body>`, a
5
+ * notification into the shared area.
6
+ *
7
+ * Both inherit, so a moved element takes those of its new parent. A submenu
8
+ * from a dark section of the page turns light, and a screen reader reads an
9
+ * English menu with Dutch pronunciation. A theme needs nothing: it sits on
10
+ * `:root`, which is the same everywhere.
11
+ *
12
+ * Only what this helper wrote itself is ever overwritten or taken back: a
13
+ * `lang` or `color-scheme` set on the element by its author stays.
14
+ */
15
+ /** Gives `element` the color scheme and language of `origin`. Call it each
16
+ * time the element shows, since the page around the origin may have changed. */
17
+ export declare function carryContext(element: HTMLElement, origin: Element | null): void;
18
+ /** Takes back what `carryContext` wrote, for an element returned to its place. */
19
+ export declare function releaseContext(element: HTMLElement): void;
20
+ //# sourceMappingURL=carried-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carried-context.d.ts","sourceRoot":"","sources":["../../src/utilities/carried-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAgBH;iFACiF;AACjF,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAgC/E;AAED,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAMzD"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * The color scheme and language an element had in its place on the page,
3
+ * carried along when a component moves it somewhere else: a submenu into
4
+ * `<body>` for a drill-in, an overflow menu or sheet that lives in `<body>`, a
5
+ * notification into the shared area.
6
+ *
7
+ * Both inherit, so a moved element takes those of its new parent. A submenu
8
+ * from a dark section of the page turns light, and a screen reader reads an
9
+ * English menu with Dutch pronunciation. A theme needs nothing: it sits on
10
+ * `:root`, which is the same everywhere.
11
+ *
12
+ * Only what this helper wrote itself is ever overwritten or taken back: a
13
+ * `lang` or `color-scheme` set on the element by its author stays.
14
+ */
15
+ const carried = new WeakMap();
16
+ /** The language of an element, looking past shadow roots to their hosts. */
17
+ function langOf(el) {
18
+ let node = el;
19
+ while (node) {
20
+ const owner = node.closest('[lang]');
21
+ if (owner)
22
+ return owner.getAttribute('lang');
23
+ const root = node.getRootNode();
24
+ node = root instanceof ShadowRoot ? root.host : null;
25
+ }
26
+ return null;
27
+ }
28
+ /** Gives `element` the color scheme and language of `origin`. Call it each
29
+ * time the element shows, since the page around the origin may have changed. */
30
+ export function carryContext(element, origin) {
31
+ if (!origin?.isConnected)
32
+ return;
33
+ const previous = carried.get(element) ?? { scheme: null, lang: null };
34
+ const next = { scheme: previous.scheme, lang: previous.lang };
35
+ const ownScheme = element.style.colorScheme;
36
+ if (!ownScheme || ownScheme === previous.scheme) {
37
+ const scheme = getComputedStyle(origin).colorScheme;
38
+ if (scheme && scheme !== 'normal') {
39
+ element.style.colorScheme = scheme;
40
+ // What the element reports back, not what was written: the two can be
41
+ // serialized differently, and the next call compares against this.
42
+ next.scheme = element.style.colorScheme;
43
+ }
44
+ else {
45
+ if (previous.scheme)
46
+ element.style.removeProperty('color-scheme');
47
+ next.scheme = null;
48
+ }
49
+ }
50
+ const ownLang = element.getAttribute('lang');
51
+ if (ownLang === null || ownLang === previous.lang) {
52
+ const lang = langOf(origin);
53
+ if (lang) {
54
+ element.setAttribute('lang', lang);
55
+ next.lang = lang;
56
+ }
57
+ else {
58
+ if (previous.lang)
59
+ element.removeAttribute('lang');
60
+ next.lang = null;
61
+ }
62
+ }
63
+ carried.set(element, next);
64
+ }
65
+ /** Takes back what `carryContext` wrote, for an element returned to its place. */
66
+ export function releaseContext(element) {
67
+ const previous = carried.get(element);
68
+ if (!previous)
69
+ return;
70
+ if (previous.scheme && element.style.colorScheme === previous.scheme)
71
+ element.style.removeProperty('color-scheme');
72
+ if (previous.lang && element.getAttribute('lang') === previous.lang)
73
+ element.removeAttribute('lang');
74
+ carried.delete(element);
75
+ }
76
+ //# sourceMappingURL=carried-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carried-context.js","sourceRoot":"","sources":["../../src/utilities/carried-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,OAAO,GAAG,IAAI,OAAO,EAA+D,CAAC;AAE3F,4EAA4E;AAC5E,SAAS,MAAM,CAAC,EAAW;IAC1B,IAAI,IAAI,GAAmB,EAAE,CAAC;IAC9B,OAAO,IAAI,EAAE,CAAC;QACb,MAAM,KAAK,GAAmB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAChC,IAAI,GAAG,IAAI,YAAY,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED;i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I,CAAC,IAAI,GAAG,IAAI,CAAC;QAClB,CAAC;aAAM,CAAC;YACP,IAAI,QAAQ,CAAC,IAAI;gBAAE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YACnD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAClB,CAAC;IACF,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,cAAc,CAAC,OAAoB;IAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtC,IAAI,CAAC,QAAQ;QAAE,OAAO;IACtB,IAAI,QAAQ,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,WAAW,KAAK,QAAQ,CAAC,MAAM;QAAE,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IACnH,IAAI,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,IAAI;QAAE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IACrG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC"}
@@ -1,4 +1,8 @@
1
- import { LanguageSupport } from '@codemirror/language';
1
+ import { LanguageDescription, LanguageSupport } from '@codemirror/language';
2
2
  export declare function isLanguageSupported(name: string): boolean;
3
3
  export declare function loadLanguage(name: string): Promise<LanguageSupport> | undefined;
4
+ /** The supported languages as CodeMirror language descriptions, for a parser
5
+ * that highlights code nested in another language (a code block in markdown).
6
+ * Each one loads its grammar only when a block names it. */
7
+ export declare const nestedLanguages: LanguageDescription[];
4
8
  //# sourceMappingURL=languages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/utilities/codemirror/languages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AA4BvE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,CAc/E"}
1
+ {"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/utilities/codemirror/languages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AA4B5F,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,CAc/E;AAeD;;6DAE6D;AAC7D,eAAO,MAAM,eAAe,EAAE,mBAAmB,EAI9C,CAAC"}
@@ -1,4 +1,4 @@
1
- import { LanguageSupport, StreamLanguage } from '@codemirror/language';
1
+ import { LanguageDescription, LanguageSupport, StreamLanguage } from '@codemirror/language';
2
2
  const loaders = {
3
3
  json: async () => (await import('@codemirror/lang-json')).json(),
4
4
  yaml: async () => (await import('@codemirror/lang-yaml')).yaml(),
@@ -36,4 +36,24 @@ export function loadLanguage(name) {
36
36
  }
37
37
  return pending;
38
38
  }
39
+ /** Other names a code block may give for a supported language, as people write
40
+ * them after the backticks. */
41
+ const ALIASES = {
42
+ javascript: ['js', 'jsx', 'mjs', 'cjs'],
43
+ typescript: ['ts', 'tsx'],
44
+ python: ['py'],
45
+ bash: ['sh', 'shell', 'zsh', 'console'],
46
+ yaml: ['yml'],
47
+ markdown: ['md'],
48
+ html: ['htm'],
49
+ rust: ['rs'],
50
+ };
51
+ /** The supported languages as CodeMirror language descriptions, for a parser
52
+ * that highlights code nested in another language (a code block in markdown).
53
+ * Each one loads its grammar only when a block names it. */
54
+ export const nestedLanguages = Object.keys(loaders).map((name) => LanguageDescription.of({
55
+ name,
56
+ alias: ALIASES[name] ?? [],
57
+ load: () => loadLanguage(name),
58
+ }));
39
59
  //# sourceMappingURL=languages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"languages.js","sourceRoot":"","sources":["../../../src/utilities/codemirror/languages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQvE,MAAM,OAAO,GAA2B;IACvC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,EAAE;IAChE,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,EAAE;IAChE,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC,UAAU,EAAE;IAClF,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IACtG,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,GAAG,EAAE;IAC7D,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,EAAE;IAChE,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,GAAG,EAAE;IAC7D,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,MAAM,EAAE;IACtE,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,IA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AAI,CAAC,CAAC;IAC9B,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,+DAA+D;QAC/D,4DAA4D;QAC5D,OAAO,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACnB,MAAM,GAAG,CAAC;QACX,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;gCACgC;AAChC,MAAM,OAAO,GAA6B;IACzC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IACvC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;IACzB,MAAM,EAAE,CAAC,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,IAAI,CAAC;IAChB,IAAI,EAAE,CAAC,KAAK,CAAC;IACb,IAAI,EAAE,CAAC,IAAI,CAAC;CACZ,CAAC;AAEF;;6DAE6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAA0B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC;IAC/G,IAAI;IACJ,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;IAC1B,IAAI,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAE;CAC/B,CAAC,CAAC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * True when a bubbling `dismiss` event originates from an `nldd-top-title-bar`'s
3
3
  * close button.
4
4
  *
5
- * Overlay containers (`nldd-sheet`, `nldd-window`) listen for bubbling `dismiss`
5
+ * Overlay containers (`nldd-sheet`, `nldd-window`, `nldd-popover`) listen for bubbling `dismiss`
6
6
  * events to close themselves. But nested components fire their own `dismiss` for
7
7
  * their own element — an `nldd-token`'s remove button, an `nldd-banner`, an
8
8
  * `nldd-document-tab-bar` — and those must NOT close the container. Only the
@@ -2,7 +2,7 @@
2
2
  * True when a bubbling `dismiss` event originates from an `nldd-top-title-bar`'s
3
3
  * close button.
4
4
  *
5
- * Overlay containers (`nldd-sheet`, `nldd-window`) listen for bubbling `dismiss`
5
+ * Overlay containers (`nldd-sheet`, `nldd-window`, `nldd-popover`) listen for bubbling `dismiss`
6
6
  * events to close themselves. But nested components fire their own `dismiss` for
7
7
  * their own element — an `nldd-token`'s remove button, an `nldd-banner`, an
8
8
  * `nldd-document-tab-bar` — and those must NOT close the container. Only the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nldd/design-system",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Designsysteem voor de Nederlandse Digitale Dienst",
5
5
  "type": "module",
6
6
  "main": "dist/components/components.js",