@nldd/design-system 0.10.0 → 0.11.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 (143) hide show
  1. package/custom-elements.json +739 -6
  2. package/dist/components/actions/button/button.d.ts +10 -0
  3. package/dist/components/actions/button/button.d.ts.map +1 -1
  4. package/dist/components/actions/button/button.js +23 -0
  5. package/dist/components/actions/button/button.js.map +1 -1
  6. package/dist/components/actions/button/button.styles.d.ts.map +1 -1
  7. package/dist/components/actions/button/button.styles.js +22 -0
  8. package/dist/components/actions/button/button.styles.js.map +1 -1
  9. package/dist/components/actions/button/button.template.d.ts +1 -0
  10. package/dist/components/actions/button/button.template.d.ts.map +1 -1
  11. package/dist/components/actions/button/button.template.js +20 -2
  12. package/dist/components/actions/button/button.template.js.map +1 -1
  13. package/dist/components/actions/icon-button/icon-button.d.ts +10 -0
  14. package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
  15. package/dist/components/actions/icon-button/icon-button.js +23 -0
  16. package/dist/components/actions/icon-button/icon-button.js.map +1 -1
  17. package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
  18. package/dist/components/actions/icon-button/icon-button.template.js +10 -3
  19. package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
  20. package/dist/components/actions/menu/menu.styles.js +1 -1
  21. package/dist/components/actions/split-button/split-button.d.ts +8 -0
  22. package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
  23. package/dist/components/actions/split-button/split-button.js +20 -0
  24. package/dist/components/actions/split-button/split-button.js.map +1 -1
  25. package/dist/components/actions/split-button/split-button.template.d.ts.map +1 -1
  26. package/dist/components/actions/split-button/split-button.template.js +4 -0
  27. package/dist/components/actions/split-button/split-button.template.js.map +1 -1
  28. package/dist/components/components.js +381 -390
  29. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts +3 -3
  30. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts.map +1 -1
  31. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js +6 -21
  32. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
  33. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.d.ts.map +1 -1
  34. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js +3 -0
  35. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js.map +1 -1
  36. package/dist/components/content/tooltip/tooltip.d.ts +14 -0
  37. package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
  38. package/dist/components/content/tooltip/tooltip.js +45 -6
  39. package/dist/components/content/tooltip/tooltip.js.map +1 -1
  40. package/dist/components/content/tooltip/tooltip.styles.d.ts.map +1 -1
  41. package/dist/components/content/tooltip/tooltip.styles.js +13 -0
  42. package/dist/components/content/tooltip/tooltip.styles.js.map +1 -1
  43. package/dist/components/content/tooltip/tooltip.template.d.ts.map +1 -1
  44. package/dist/components/content/tooltip/tooltip.template.js +18 -2
  45. package/dist/components/content/tooltip/tooltip.template.js.map +1 -1
  46. package/dist/components/{icon-button-BVhiOwX9.js → icon-button-Cntrg4_E.js} +526 -61
  47. package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
  48. package/dist/components/inputs/code-editor/code-editor.styles.js +2 -1
  49. package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
  50. package/dist/components/inputs/date-picker/date-picker.styles.d.ts.map +1 -1
  51. package/dist/components/inputs/date-picker/date-picker.styles.js +29 -5
  52. package/dist/components/inputs/date-picker/date-picker.styles.js.map +1 -1
  53. package/dist/components/inputs/search-field/search-field.d.ts +11 -0
  54. package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
  55. package/dist/components/inputs/search-field/search-field.js +30 -1
  56. package/dist/components/inputs/search-field/search-field.js.map +1 -1
  57. package/dist/components/inputs/search-field/search-field.styles.d.ts.map +1 -1
  58. package/dist/components/inputs/search-field/search-field.styles.js +18 -0
  59. package/dist/components/inputs/search-field/search-field.styles.js.map +1 -1
  60. package/dist/components/inputs/search-field/search-field.template.d.ts.map +1 -1
  61. package/dist/components/inputs/search-field/search-field.template.js +12 -0
  62. package/dist/components/inputs/search-field/search-field.template.js.map +1 -1
  63. package/dist/components/inputs/segmented-control/segmented-control.d.ts +10 -0
  64. package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
  65. package/dist/components/inputs/segmented-control/segmented-control.js +25 -1
  66. package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
  67. package/dist/components/inputs/segmented-control/segmented-control.template.d.ts.map +1 -1
  68. package/dist/components/inputs/segmented-control/segmented-control.template.js +20 -3
  69. package/dist/components/inputs/segmented-control/segmented-control.template.js.map +1 -1
  70. package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
  71. package/dist/components/inputs/text-editor/text-editor.styles.js +13 -10
  72. package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
  73. package/dist/components/inputs/toggle-button/toggle-button.d.ts +10 -0
  74. package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
  75. package/dist/components/inputs/toggle-button/toggle-button.js +25 -1
  76. package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
  77. package/dist/components/inputs/toggle-button/toggle-button.template.d.ts.map +1 -1
  78. package/dist/components/inputs/toggle-button/toggle-button.template.js +21 -7
  79. package/dist/components/inputs/toggle-button/toggle-button.template.js.map +1 -1
  80. package/dist/components/layout/card/card.styles.js +4 -4
  81. package/dist/components/layout/container/container.d.ts +2 -0
  82. package/dist/components/layout/container/container.d.ts.map +1 -1
  83. package/dist/components/layout/container/container.js +9 -0
  84. package/dist/components/layout/container/container.js.map +1 -1
  85. package/dist/components/layout/container/container.styles.d.ts.map +1 -1
  86. package/dist/components/layout/container/container.styles.js +13 -0
  87. package/dist/components/layout/container/container.styles.js.map +1 -1
  88. package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.d.ts.map +1 -1
  89. package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.js +9 -5
  90. package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.js.map +1 -1
  91. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.d.ts.map +1 -1
  92. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js +16 -15
  93. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js.map +1 -1
  94. package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js +2 -2
  95. package/dist/components/navigation/tab-bar/tab-bar.styles.js +9 -9
  96. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +16 -9
  97. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts.map +1 -1
  98. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +16 -9
  99. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
  100. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.d.ts.map +1 -1
  101. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js +23 -18
  102. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js.map +1 -1
  103. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.d.ts.map +1 -1
  104. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js +19 -21
  105. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js.map +1 -1
  106. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.js +1 -1
  107. package/dist/components/status-and-feedback/notification/notification.styles.js +1 -1
  108. package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js +4 -4
  109. package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js +3 -3
  110. package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js +1 -1
  111. package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js.map +1 -1
  112. package/dist/components/status-and-feedback/step-bar/step-bar.styles.d.ts.map +1 -1
  113. package/dist/components/status-and-feedback/step-bar/step-bar.styles.js +7 -5
  114. package/dist/components/status-and-feedback/step-bar/step-bar.styles.js.map +1 -1
  115. package/dist/css/themes/bruin.css +108 -64
  116. package/dist/css/themes/donkerblauw.css +108 -64
  117. package/dist/css/themes/donkerbruin.css +88 -64
  118. package/dist/css/themes/donkergeel.css +145 -94
  119. package/dist/css/themes/donkergroen.css +93 -64
  120. package/dist/css/themes/geel.css +145 -94
  121. package/dist/css/themes/groen.css +108 -64
  122. package/dist/css/themes/hemelblauw.css +108 -64
  123. package/dist/css/themes/lichtblauw.css +111 -64
  124. package/dist/css/themes/mintgroen.css +111 -64
  125. package/dist/css/themes/mosgroen.css +108 -64
  126. package/dist/css/themes/oranje.css +162 -99
  127. package/dist/css/themes/paars.css +115 -64
  128. package/dist/css/themes/robijnrood.css +159 -96
  129. package/dist/css/themes/rood.css +159 -96
  130. package/dist/css/themes/roze.css +118 -64
  131. package/dist/css/themes/violet.css +93 -64
  132. package/dist/css/themes.css +2039 -1247
  133. package/dist/css/variables.css +132 -66
  134. package/dist/nldd.min.js +1077 -903
  135. package/dist/types/vue.d.ts +104 -2
  136. package/dist/utilities/codemirror/theme.js +1 -1
  137. package/dist/utilities/codemirror/theme.js.map +1 -1
  138. package/dist/utilities/shortcut.d.ts +50 -0
  139. package/dist/utilities/shortcut.d.ts.map +1 -0
  140. package/dist/utilities/shortcut.js +77 -0
  141. package/dist/utilities/shortcut.js.map +1 -0
  142. package/package.json +1 -1
  143. package/dist/components/{icon-D_ZGezHx.js → icon-zNX9A6d3.js} +1 -1
@@ -378,6 +378,20 @@ declare module 'vue' {
378
378
  'accessible-label'?: NLDDButton['accessibleLabel'];
379
379
  /** Accessible label for the button, overrides text for screen readers */
380
380
  'accessibleLabel'?: NLDDButton['accessibleLabel'];
381
+ /** Keyboard shortcut hint shown right after the text, e.g. 'Cmd+S'. Display only (rendered via nldd-keyboard-shortcut): it does not bind the key, wire up the handling in your app. Part of the accessible name, as in nldd-menu-item. Hidden on touch-only devices, where it isn't invokable. Keep it for the few main actions of a screen (save, search); a hint on every button is noise. */
382
+ 'shortcut'?: NLDDButton['shortcut'];
383
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
384
+ 'shortcut-mac'?: NLDDButton['shortcutMac'];
385
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
386
+ 'shortcutMac'?: NLDDButton['shortcutMac'];
387
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
388
+ 'shortcut-windows'?: NLDDButton['shortcutWindows'];
389
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
390
+ 'shortcutWindows'?: NLDDButton['shortcutWindows'];
391
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
392
+ 'shortcut-linux'?: NLDDButton['shortcutLinux'];
393
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
394
+ 'shortcutLinux'?: NLDDButton['shortcutLinux'];
381
395
  /** When set, renders an <a> element instead of <button> */
382
396
  'href'?: NLDDButton['href'];
383
397
  /** Link target (e.g. '_blank'); only used when href is set. With '_blank' the button adds a visually hidden "opens in new tab" announcement for screen readers (WCAG 2.1 SC 3.2.2). An `href` to another origin than the page (another website, a subdomain too) adds a visually hidden "andere website", in one sentence with the new-tab announcement when both apply; there is no way to switch it off. */
@@ -726,6 +740,10 @@ declare module 'vue' {
726
740
  'max-width'?: NLDDContainer['maxWidth'];
727
741
  /** Maximum width as a CSS length (e.g. '480px') */
728
742
  'maxWidth'?: NLDDContainer['maxWidth'];
743
+ /** Minimum height as a CSS length (e.g. '240px'), padding included. Reserves the room that content still on its way will take; vertical-alignment then places the children within it. */
744
+ 'min-height'?: NLDDContainer['minHeight'];
745
+ /** Minimum height as a CSS length (e.g. '240px'), padding included. Reserves the room that content still on its way will take; vertical-alignment then places the children within it. */
746
+ 'minHeight'?: NLDDContainer['minHeight'];
729
747
  /** Gap between children. One distance for all of them, so it fits children of one kind; for a stack of different kinds, space each seam with nldd-spacer instead. */
730
748
  'gap'?: NLDDContainer['gap'];
731
749
  /** Gap at sm breakpoint */
@@ -1330,6 +1348,20 @@ declare module 'vue' {
1330
1348
  'tooltip-timing'?: NLDDIconButton['tooltipTiming'];
1331
1349
  /** Forwarded to the inner nldd-tooltip's `timing`: 'delay' (the default, a 700 ms show-delay), 'instant', or 'never' (suppress the visual tooltip; screen readers still get the aria-label). Use 'never' when the surrounding context already explains the button (e.g. spin buttons in nldd-number-field, the chevron in nldd-split-button). */
1332
1350
  'tooltipTiming'?: NLDDIconButton['tooltipTiming'];
1351
+ /** Keyboard shortcut hint shown in the tooltip after the text, e.g. 'Alt+P'. Display only (rendered via nldd-keyboard-shortcut): it does not bind the key, wire up the handling in your app. Part of the accessible name ("Presentatiemodus Alt P"), as in nldd-menu-item. Hidden on touch-only devices, where it isn't invokable. */
1352
+ 'shortcut'?: NLDDIconButton['shortcut'];
1353
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
1354
+ 'shortcut-mac'?: NLDDIconButton['shortcutMac'];
1355
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
1356
+ 'shortcutMac'?: NLDDIconButton['shortcutMac'];
1357
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
1358
+ 'shortcut-windows'?: NLDDIconButton['shortcutWindows'];
1359
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
1360
+ 'shortcutWindows'?: NLDDIconButton['shortcutWindows'];
1361
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
1362
+ 'shortcut-linux'?: NLDDIconButton['shortcutLinux'];
1363
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
1364
+ 'shortcutLinux'?: NLDDIconButton['shortcutLinux'];
1333
1365
  /** When set, renders an <a> element instead of <button> */
1334
1366
  'href'?: NLDDIconButton['href'];
1335
1367
  /** Link target (e.g. '_blank'); only used when href is set. With '_blank' the "opens in new tab" announcement is folded into the aria-label for screen readers (WCAG 2.1 SC 3.2.2). An `href` to another origin than the page (another website, a subdomain too) adds a visually hidden "andere website", in one sentence with the new-tab announcement when both apply; there is no way to switch it off. */
@@ -1485,7 +1517,7 @@ declare module 'vue' {
1485
1517
  };
1486
1518
 
1487
1519
  type NLDDKeyboardShortcutProps = {
1488
- /** Keys separated by '+' (e.g. 'Cmd+K' or 'Ctrl+Shift+P'). Use '+++' for a literal '+' key: 'Ctrl+++' becomes 'Ctrl' + '+'. For more complex cases (a combo with several '+' keys, for instance) use the default slot with your own <kbd> elements instead of the keys attribute. */
1520
+ /** Keys separated by '+' (e.g. 'Cmd+K' or 'Ctrl+Shift+P'). End with '++' for a literal '+' key: 'Ctrl++' becomes 'Ctrl' + '+' ('Ctrl+++' works too). For more complex cases, such as a combo with several '+' keys, use the default slot with your own <kbd> elements instead of the keys attribute. */
1489
1521
  'keys'?: NLDDKeyboardShortcut['keys'];
1490
1522
  /** Optional override for macOS (iPhone/iPad/iPod included). */
1491
1523
  'mac-keys'?: NLDDKeyboardShortcut['macKeys'];
@@ -2443,6 +2475,20 @@ declare module 'vue' {
2443
2475
  'show-search-button'?: NLDDSearchField['showSearchButton'];
2444
2476
  /** When set, shows a search button on the right */
2445
2477
  'showSearchButton'?: NLDDSearchField['showSearchButton'];
2478
+ /** Keyboard shortcut hint shown at the right end of the empty field, e.g. 'Cmd+K' or '/'. Display only (rendered via nldd-keyboard-shortcut): it does not bind the key, wire up focusing the field in your app. Hidden while the field has focus or a value, and on touch-only devices. Joins the field's description for screen readers. */
2479
+ 'shortcut'?: NLDDSearchField['shortcut'];
2480
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
2481
+ 'shortcut-mac'?: NLDDSearchField['shortcutMac'];
2482
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
2483
+ 'shortcutMac'?: NLDDSearchField['shortcutMac'];
2484
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
2485
+ 'shortcut-windows'?: NLDDSearchField['shortcutWindows'];
2486
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
2487
+ 'shortcutWindows'?: NLDDSearchField['shortcutWindows'];
2488
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
2489
+ 'shortcut-linux'?: NLDDSearchField['shortcutLinux'];
2490
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
2491
+ 'shortcutLinux'?: NLDDSearchField['shortcutLinux'];
2446
2492
  /** Override translation keys; unset keys fall back to Dutch */
2447
2493
  'translations'?: NLDDSearchField['translations'];
2448
2494
  /** Marks the control as invalid. Announced with aria-invalid; nothing is drawn for it. */
@@ -2539,6 +2585,20 @@ declare module 'vue' {
2539
2585
  'text'?: NLDDSegmentedControlItem['text'];
2540
2586
  /** Icon name for nldd-icon */
2541
2587
  'icon'?: NLDDSegmentedControlItem['icon'];
2588
+ /** Keyboard shortcut hint shown in the tooltip, e.g. 'Cmd+B'. Display only (rendered via nldd-keyboard-shortcut): it does not bind the key, wire up the handling in your app. Part of the accessible name ("Vet Cmd B"), as in nldd-menu-item. Hidden on touch-only devices, where it isn't invokable. */
2589
+ 'shortcut'?: NLDDSegmentedControlItem['shortcut'];
2590
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
2591
+ 'shortcut-mac'?: NLDDSegmentedControlItem['shortcutMac'];
2592
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
2593
+ 'shortcutMac'?: NLDDSegmentedControlItem['shortcutMac'];
2594
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
2595
+ 'shortcut-windows'?: NLDDSegmentedControlItem['shortcutWindows'];
2596
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
2597
+ 'shortcutWindows'?: NLDDSegmentedControlItem['shortcutWindows'];
2598
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
2599
+ 'shortcut-linux'?: NLDDSegmentedControlItem['shortcutLinux'];
2600
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
2601
+ 'shortcutLinux'?: NLDDSegmentedControlItem['shortcutLinux'];
2542
2602
  /** When item is activated; detail: { value: string, checked: boolean } */
2543
2603
  'onItemChange'?: (event: CustomEvent) => void;
2544
2604
  };
@@ -2732,6 +2792,20 @@ declare module 'vue' {
2732
2792
  'width'?: NLDDSplitButton['width'];
2733
2793
  /** Button text for the primary action */
2734
2794
  'text'?: NLDDSplitButton['text'];
2795
+ /** Keyboard shortcut hint for the primary action, shown right after its text, e.g. 'Cmd+S'. Forwarded to the inner nldd-button; display only, wire up the handling in your app. */
2796
+ 'shortcut'?: NLDDSplitButton['shortcut'];
2797
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
2798
+ 'shortcut-mac'?: NLDDSplitButton['shortcutMac'];
2799
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
2800
+ 'shortcutMac'?: NLDDSplitButton['shortcutMac'];
2801
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
2802
+ 'shortcut-windows'?: NLDDSplitButton['shortcutWindows'];
2803
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
2804
+ 'shortcutWindows'?: NLDDSplitButton['shortcutWindows'];
2805
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
2806
+ 'shortcut-linux'?: NLDDSplitButton['shortcutLinux'];
2807
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
2808
+ 'shortcutLinux'?: NLDDSplitButton['shortcutLinux'];
2735
2809
  /** Icon name shown before the text on the primary action button */
2736
2810
  'icon'?: NLDDSplitButton['icon'];
2737
2811
  /** Translations; unset keys fall back to Dutch */
@@ -3406,6 +3480,20 @@ declare module 'vue' {
3406
3480
  'accessible-label'?: NLDDToggleButton['accessibleLabel'];
3407
3481
  /** Accessible label; required for icon-only usage */
3408
3482
  'accessibleLabel'?: NLDDToggleButton['accessibleLabel'];
3483
+ /** Keyboard shortcut hint shown in the tooltip, e.g. 'Cmd+B'. Display only (rendered via nldd-keyboard-shortcut): it does not bind the key, wire up the handling in your app. Part of the accessible name ("Vet Cmd B"), as in nldd-menu-item. Hidden on touch-only devices, where it isn't invokable. */
3484
+ 'shortcut'?: NLDDToggleButton['shortcut'];
3485
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
3486
+ 'shortcut-mac'?: NLDDToggleButton['shortcutMac'];
3487
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
3488
+ 'shortcutMac'?: NLDDToggleButton['shortcutMac'];
3489
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
3490
+ 'shortcut-windows'?: NLDDToggleButton['shortcutWindows'];
3491
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
3492
+ 'shortcutWindows'?: NLDDToggleButton['shortcutWindows'];
3493
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
3494
+ 'shortcut-linux'?: NLDDToggleButton['shortcutLinux'];
3495
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
3496
+ 'shortcutLinux'?: NLDDToggleButton['shortcutLinux'];
3409
3497
  /** Marks the control as invalid. Announced with aria-invalid; nothing is drawn for it. */
3410
3498
  'invalid'?: NLDDToggleButton['invalid'];
3411
3499
  /** Set by nldd-form-field. A consumer never writes this. */
@@ -3583,6 +3671,20 @@ declare module 'vue' {
3583
3671
  type NLDDTooltipProps = {
3584
3672
  /** Tooltip text */
3585
3673
  'text'?: NLDDTooltip['text'];
3674
+ /** Keyboard shortcut hint shown after the text, e.g. 'Cmd+P'. Display only (rendered via nldd-keyboard-shortcut): it does not bind the key. Joins the description of a light-DOM trigger. Hidden on touch-only devices, where it isn't invokable. */
3675
+ 'shortcut'?: NLDDTooltip['shortcut'];
3676
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
3677
+ 'shortcut-mac'?: NLDDTooltip['shortcutMac'];
3678
+ /** Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`). */
3679
+ 'shortcutMac'?: NLDDTooltip['shortcutMac'];
3680
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
3681
+ 'shortcut-windows'?: NLDDTooltip['shortcutWindows'];
3682
+ /** Override of `shortcut` on Windows (falls back to `shortcut`). */
3683
+ 'shortcutWindows'?: NLDDTooltip['shortcutWindows'];
3684
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
3685
+ 'shortcut-linux'?: NLDDTooltip['shortcutLinux'];
3686
+ /** Override of `shortcut` on Linux (falls back to `shortcut`). */
3687
+ 'shortcutLinux'?: NLDDTooltip['shortcutLinux'];
3586
3688
  /** Forces the tooltip visible, whatever hover or focus does. Use it for programmatic feedback ("Copied", for instance). Reset it to false to restore the hover behavior. */
3587
3689
  'open'?: NLDDTooltip['open'];
3588
3690
  /** Position: 'top' | 'bottom' | 'left' | 'right' (default: 'bottom'; automatically 'top' on touch devices) */
@@ -3790,7 +3892,7 @@ declare module 'vue' {
3790
3892
  };
3791
3893
 
3792
3894
  export interface GlobalComponents {
3793
- /** Layout placeholder that fills its parent and centers an indeterminate activity indicator. By default the indicator is held back for 1000ms so brief loading states don't flash; once the delay passes it fades in. Set `timing="instant"` to skip the delay (the fade-in still plays) — this is what embedding components such as `nldd-button` use for their loading state. The default indicator is a simple icon-sized circle that follows the shared `--context-content-color` channel (set by list-item / table / menu on their content), falling back to `currentColor` wherever that channel is unset (buttons, rich-text, standalone) — so a spinner inside a cell tracks the row's state-aware content color, while embedders relying on currentColor are unaffected. An optional label sits below (hidden unless `show-text` is set). Drop a `<nldd-progress-circle>`, `<nldd-progress-bar>` or any element in the `indicator` slot to override it. Icon alignment: the visible ring already sits at 5/6 of its box (the SVG's r=9 plus a 2-unit stroke in a 24 view-box, the same optical inset a filled icon glyph has), so a standalone spinner lines up with an icon or an `icon-aligned` `nldd-avatar` on the same grid — no extra option needed (unlike `nldd-avatar`, which fills edge-to-edge and opts in via `icon-aligned`). Overlay mode: put content in the default slot and the indicator wraps it — it becomes a `position: relative` container, renders the spinner over a dimming backdrop (opt out with `no-backdrop`), and makes the content `inert` so its controls can't be focused or clicked. Toggle loading with `complete` (`?complete=${!isLoading}`). With no slotted content it stays the standalone placeholder described above. Reconnect behavior: every `connectedCallback` resets the timer and hides the indicator again. If a consumer toggles the element via a conditional render (remove + re-insert) the indicator disappears and re-fades after another delay. Keep the element mounted and toggle visibility / `hidden` instead if you want the timer to run only once. Accessibility: while connected and not `complete` the host is a polite live region (`role="status"`). The label (`text`, or the translated "Laden" fallback) always renders as the region's content — visually hidden when `show-text` is off (the default) — so assistive tech announces the loading state when the indicator appears. Set `complete` (or unmount) to clear it. */
3895
+ /** Layout placeholder that fills its parent and centers an indeterminate activity indicator. By default the indicator is held back for 1000ms so brief loading states don't flash; once the delay passes it fades in. Set `timing="instant"` to skip the delay (the fade-in still plays) — this is what embedding components such as `nldd-button` use for their loading state. Sizing: fills its parent where the parent lets it (a flex column such as `nldd-container`, a grid, or a fixed height) and centers itself there. Where the parent has no height of its own, give it one: a `min-height` matching the content you expect, such as `<nldd-container min-height="240px">`. As a safety net the host already takes the indicator's size (circle, plus the label with `show-text`) during the delay, so nothing shifts when it fades in; once `complete` is set it gives that space up. Label size follows `size`, not the surrounding text, so the circle and its label keep the same proportion everywhere: body-xs at 16 and 20, body-sm at 24 and 28, body-md from 32. Keep the label short; a longer explanation belongs in the area as regular text. The default indicator is a simple icon-sized circle that follows the shared `--context-content-color` channel (set by list-item / table / menu on their content), falling back to `currentColor` wherever that channel is unset (buttons, rich-text, standalone) — so a spinner inside a cell tracks the row's state-aware content color, while embedders relying on currentColor are unaffected. An optional label sits below (hidden unless `show-text` is set). The indicator is always indeterminate; when you know the progress, show `nldd-progress-bar` or `nldd-progress-circle` instead. Icon alignment: the visible ring already sits at 5/6 of its box (the SVG's r=9 plus a 2-unit stroke in a 24 view-box, the same optical inset a filled icon glyph has), so a standalone spinner lines up with an icon or an `icon-aligned` `nldd-avatar` on the same grid — no extra option needed (unlike `nldd-avatar`, which fills edge-to-edge and opts in via `icon-aligned`). Overlay mode: put content in the default slot and the indicator wraps it — it becomes a `position: relative` container, renders the spinner over a dimming backdrop (opt out with `no-backdrop`), and makes the content `inert` so its controls can't be focused or clicked. Toggle loading with `complete` (`?complete=${!isLoading}`). With no slotted content it stays the standalone placeholder described above. Reconnect behavior: every `connectedCallback` resets the timer and hides the indicator again. If a consumer toggles the element via a conditional render (remove + re-insert) the indicator disappears and re-fades after another delay. Keep the element mounted and toggle visibility / `hidden` instead if you want the timer to run only once. Accessibility: while connected and not `complete` the host is a polite live region (`role="status"`). The label (`text`, or the translated "Laden" fallback) always renders as the region's content — visually hidden when `show-text` is off (the default) — so assistive tech announces the loading state when the indicator appears. Set `complete` (or unmount) to clear it. */
3794
3896
  'nldd-activity-indicator': DefineComponent<NLDDActivityIndicatorProps>;
3795
3897
  /** 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. */
3796
3898
  'nldd-avatar': DefineComponent<NLDDAvatarProps>;
@@ -41,7 +41,7 @@ const baseTheme = EditorView.theme({
41
41
  // equal specificity — otherwise CM's light base theme paints the focused
42
42
  // selection lavender, unreadable on a dark surface.
43
43
  '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
44
- backgroundColor: 'light-dark(var(--primitives-color-accent-150), var(--primitives-color-accent-250))',
44
+ backgroundColor: 'var(--semantics-text-selection-background-color)',
45
45
  },
46
46
  '.cm-gutters': {
47
47
  border: 'none',
@@ -1 +1 @@
1
- {"version":3,"file":"the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AC,CAAC,OAAO,EAAE,KAAK,EAAE,wCAAwC,EAAE;IACnE,EAAE,GAAG,EAAE,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,+CAA+C,EAAE;IACjF,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,6CAA6C,EAAE;IAC7E,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,6CAA6C,EAAE;IACvH,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,0CAA0C,EAAE;IACpE,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,wCAAwC,EAAE;IAC/D,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE;IACrC,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;CACxC,CAAC,CAAC;AAEH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAc,CAAC,SAAS,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ import type { OS } from './os.js';
3
+ /**
4
+ * The shortcut hint attributes that nldd-menu-item, nldd-tooltip, nldd-button,
5
+ * nldd-icon-button, nldd-toggle-button, nldd-segmented-control-item,
6
+ * nldd-split-button and nldd-search-field share: `shortcut` plus a per-OS
7
+ * override. Display only; the application binds the key.
8
+ */
9
+ export interface ShortcutHint {
10
+ shortcut: string;
11
+ shortcutMac: string;
12
+ shortcutWindows: string;
13
+ shortcutLinux: string;
14
+ }
15
+ export interface KeysPerOS {
16
+ keys: string;
17
+ macKeys: string;
18
+ windowsKeys: string;
19
+ linuxKeys: string;
20
+ }
21
+ export declare function hasShortcut(hint: ShortcutHint): boolean;
22
+ /** The key spec for this OS, with `keys` as the fallback. */
23
+ export declare function resolveKeys(spec: KeysPerOS, os: OS): string;
24
+ /** Splits 'Ctrl+Shift+P' into keys; a trailing '++' ('Ctrl++') or '+++' is a literal '+' key. */
25
+ export declare function parseKeys(spec: string): string[];
26
+ /** Whether a keyboard shortcut can be used on this device, so a hint for it is worth showing. */
27
+ export declare function shortcutsAvailable(): boolean;
28
+ /**
29
+ * Renders the host again when shortcuts become available or unavailable, such
30
+ * as when a pointer is attached or removed, so a shortcut in its accessible
31
+ * name follows the visible hint. Pass `onChange` for work that a render does
32
+ * not redo.
33
+ */
34
+ export declare class ShortcutAvailabilityController implements ReactiveController {
35
+ private _query;
36
+ private _onChange;
37
+ constructor(host: ReactiveControllerHost, onChange?: () => void);
38
+ private _handleChange;
39
+ hostConnected(): void;
40
+ hostDisconnected(): void;
41
+ }
42
+ /**
43
+ * The shortcut as words for an accessible name ("Ctrl Z"), matching how
44
+ * nldd-menu-item is announced. Empty without a shortcut, and where
45
+ * shortcutsAvailable() says the key cannot be pressed, as the hint is hidden
46
+ * there too. Read when the component renders; ShortcutAvailabilityController
47
+ * renders it again when that changes.
48
+ */
49
+ export declare function shortcutLabel(hint: ShortcutHint): string;
50
+ //# sourceMappingURL=shortcut.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortcut.d.ts","sourceRoot":"","sources":["../../src/utilities/shortcut.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAEtE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAElC;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAEvD;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,GAAG,MAAM,CAK3D;AAED,iGAAiG;AACjG,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAYhD;AAOD,iGAAiG;AACjG,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;;;GAKG;AACH,qBAAa,8BAA+B,YAAW,kBAAkB;IACxE,OAAO,CAAC,MAAM,CAA4E;IAC1F,OAAO,CAAC,SAAS,CAAa;gBAElB,IAAI,EAAE,sBAAsB,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI;IAK/D,OAAO,CAAC,aAAa,CAA0B;IAE/C,aAAa,IAAI,IAAI;IAIrB,gBAAgB,IAAI,IAAI;CAGxB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CASxD"}
@@ -0,0 +1,77 @@
1
+ import { detectOS } from './os.js';
2
+ export function hasShortcut(hint) {
3
+ return Boolean(hint.shortcut || hint.shortcutMac || hint.shortcutWindows || hint.shortcutLinux);
4
+ }
5
+ /** The key spec for this OS, with `keys` as the fallback. */
6
+ export function resolveKeys(spec, os) {
7
+ if (os === 'mac' && spec.macKeys)
8
+ return spec.macKeys;
9
+ if (os === 'windows' && spec.windowsKeys)
10
+ return spec.windowsKeys;
11
+ if (os === 'linux' && spec.linuxKeys)
12
+ return spec.linuxKeys;
13
+ return spec.keys;
14
+ }
15
+ /** Splits 'Ctrl+Shift+P' into keys; a trailing '++' ('Ctrl++') or '+++' is a literal '+' key. */
16
+ export function parseKeys(spec) {
17
+ if (!spec)
18
+ return [];
19
+ // Spaces around a '+' are spacing, not part of a key: 'Ctrl + +' is 'Ctrl++'.
20
+ const compact = spec.trim().replace(/\s*\+\s*/g, '+');
21
+ if (compact === '+')
22
+ return ['+'];
23
+ const MARKER = '\u0000';
24
+ return compact
25
+ .replace(/\+\+\+/g, `+${MARKER}+`)
26
+ .replace(/\+\+$/, `+${MARKER}`)
27
+ .split('+')
28
+ .map(k => k.trim().split(MARKER).join('+'))
29
+ .filter(Boolean);
30
+ }
31
+ // A browser cannot tell whether there is a keyboard. A device whose pointers
32
+ // cannot hover is touch-only and most likely has none; nldd-keyboard-shortcut
33
+ // hides itself on the same media query.
34
+ const NO_SHORTCUTS_QUERY = '(any-hover: none)';
35
+ /** Whether a keyboard shortcut can be used on this device, so a hint for it is worth showing. */
36
+ export function shortcutsAvailable() {
37
+ return typeof matchMedia !== 'function' || !matchMedia(NO_SHORTCUTS_QUERY).matches;
38
+ }
39
+ /**
40
+ * Renders the host again when shortcuts become available or unavailable, such
41
+ * as when a pointer is attached or removed, so a shortcut in its accessible
42
+ * name follows the visible hint. Pass `onChange` for work that a render does
43
+ * not redo.
44
+ */
45
+ export class ShortcutAvailabilityController {
46
+ constructor(host, onChange) {
47
+ this._query = typeof matchMedia === 'function' ? matchMedia(NO_SHORTCUTS_QUERY) : null;
48
+ this._handleChange = () => this._onChange();
49
+ this._onChange = onChange ?? (() => host.requestUpdate());
50
+ host.addController(this);
51
+ }
52
+ hostConnected() {
53
+ this._query?.addEventListener('change', this._handleChange);
54
+ }
55
+ hostDisconnected() {
56
+ this._query?.removeEventListener('change', this._handleChange);
57
+ }
58
+ }
59
+ /**
60
+ * The shortcut as words for an accessible name ("Ctrl Z"), matching how
61
+ * nldd-menu-item is announced. Empty without a shortcut, and where
62
+ * shortcutsAvailable() says the key cannot be pressed, as the hint is hidden
63
+ * there too. Read when the component renders; ShortcutAvailabilityController
64
+ * renders it again when that changes.
65
+ */
66
+ export function shortcutLabel(hint) {
67
+ if (!hasShortcut(hint) || !shortcutsAvailable())
68
+ return '';
69
+ const spec = resolveKeys({
70
+ keys: hint.shortcut,
71
+ macKeys: hint.shortcutMac,
72
+ windowsKeys: hint.shortcutWindows,
73
+ linuxKeys: hint.shortcutLinux,
74
+ }, detectOS());
75
+ return parseKeys(spec).join(' ');
76
+ }
77
+ //# sourceMappingURL=shortcut.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortcut.js","sourceRoot":"","sources":["../../src/utilities/shortcut.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAuBnC,MAAM,UAAU,WAAW,CAAC,IAAkB;IAC7C,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC;AACjG,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,WAAW,CAAC,IAAe,EAAE,EAAM;IAClD,IAAI,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtD,IAAI,EAAE,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC,WAAW,CAAC;IAClE,IAAI,EAAE,KAAK,OAAO,IAAI,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC;IAC5D,OAAO,IAAI,CAAC,IAAI,CAAC;AAClB,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,8EAA8E;IAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACtD,IAAI,OAAO,KAAK,GAAG;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,MAA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;IAChE,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,IAAkB;IAC/C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;QAAE,OAAO,EAAE,CAAC;IAC3D,MAAM,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,EAAE,IAAI,CAAC,QAAQ;QACnB,OAAO,EAAE,IAAI,CAAC,WAAW;QACzB,WAAW,EAAE,IAAI,CAAC,eAAe;QACjC,SAAS,EAAE,IAAI,CAAC,aAAa;KAC7B,EAAE,QAAQ,EAAE,CAAC,CAAC;IACf,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nldd/design-system",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Designsysteem voor de Nederlandse Digitale Dienst",
5
5
  "type": "module",
6
6
  "main": "dist/components/components.js",
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { t as __decorate } from "./decorate-CO88j7Lc.js";
3
2
  import { t as reflectNonDefault } from "./reflect-non-default-OLaK60rT.js";
3
+ import { t as __decorate } from "./decorate-CO88j7Lc.js";
4
4
  import { LitElement, css, html } from "lit";
5
5
  import { customElement, property, state } from "lit/decorators.js";
6
6
  import { unsafeHTML } from "lit/directives/unsafe-html.js";