@nldd/design-system 0.8.55 → 0.8.57

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 (203) hide show
  1. package/README.md +15 -0
  2. package/dist/components/actions/button/button.d.ts +13 -4
  3. package/dist/components/actions/button/button.d.ts.map +1 -1
  4. package/dist/components/actions/button/button.js +23 -3
  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 +269 -87
  8. package/dist/components/actions/button/button.styles.js.map +1 -1
  9. package/dist/components/actions/button/button.template.d.ts.map +1 -1
  10. package/dist/components/actions/button/button.template.js +33 -17
  11. package/dist/components/actions/button/button.template.js.map +1 -1
  12. package/dist/components/actions/button-bar/button-bar.d.ts +2 -2
  13. package/dist/components/actions/button-bar/button-bar.d.ts.map +1 -1
  14. package/dist/components/actions/button-bar/button-bar.js +3 -1
  15. package/dist/components/actions/button-bar/button-bar.js.map +1 -1
  16. package/dist/components/actions/button-bar/button-bar.styles.d.ts.map +1 -1
  17. package/dist/components/actions/button-bar/button-bar.styles.js +28 -4
  18. package/dist/components/actions/button-bar/button-bar.styles.js.map +1 -1
  19. package/dist/components/actions/icon-button/icon-button.d.ts +14 -4
  20. package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
  21. package/dist/components/actions/icon-button/icon-button.js +23 -3
  22. package/dist/components/actions/icon-button/icon-button.js.map +1 -1
  23. package/dist/components/actions/icon-button/icon-button.styles.d.ts.map +1 -1
  24. package/dist/components/actions/icon-button/icon-button.styles.js +127 -63
  25. package/dist/components/actions/icon-button/icon-button.styles.js.map +1 -1
  26. package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
  27. package/dist/components/actions/icon-button/icon-button.template.js +4 -2
  28. package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
  29. package/dist/components/actions/menu/menu.d.ts +9 -0
  30. package/dist/components/actions/menu/menu.d.ts.map +1 -1
  31. package/dist/components/actions/menu/menu.js +27 -2
  32. package/dist/components/actions/menu/menu.js.map +1 -1
  33. package/dist/components/actions/split-button/split-button.d.ts +30 -20
  34. package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
  35. package/dist/components/actions/split-button/split-button.js +73 -49
  36. package/dist/components/actions/split-button/split-button.js.map +1 -1
  37. package/dist/components/actions/split-button/split-button.styles.d.ts.map +1 -1
  38. package/dist/components/actions/split-button/split-button.styles.js +39 -3
  39. package/dist/components/actions/split-button/split-button.styles.js.map +1 -1
  40. package/dist/components/actions/split-button/split-button.template.d.ts.map +1 -1
  41. package/dist/components/actions/split-button/split-button.template.js +6 -1
  42. package/dist/components/actions/split-button/split-button.template.js.map +1 -1
  43. package/dist/components/actions/toolbar/toolbar.d.ts +91 -14
  44. package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
  45. package/dist/components/actions/toolbar/toolbar.js +299 -103
  46. package/dist/components/actions/toolbar/toolbar.js.map +1 -1
  47. package/dist/components/actions/toolbar/toolbar.styles.d.ts +2 -0
  48. package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
  49. package/dist/components/actions/toolbar/toolbar.styles.js +109 -41
  50. package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
  51. package/dist/components/actions/toolbar/toolbar.template.d.ts +7 -4
  52. package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
  53. package/dist/components/actions/toolbar/toolbar.template.js +22 -69
  54. package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
  55. package/dist/components/components.js +1 -1
  56. package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
  57. package/dist/components/content/code-viewer/code-viewer.styles.js +4 -0
  58. package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
  59. package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
  60. package/dist/components/content/icon/icon-aliases.js +48 -2
  61. package/dist/components/content/icon/icon-aliases.js.map +1 -1
  62. package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
  63. package/dist/components/content/icon/icon-registry.js +37 -2
  64. package/dist/components/content/icon/icon-registry.js.map +1 -1
  65. package/dist/components/content/image/image.d.ts +1 -1
  66. package/dist/components/content/image/image.d.ts.map +1 -1
  67. package/dist/components/content/image/image.i18n.d.ts +1 -1
  68. package/dist/components/content/image/image.i18n.js +1 -1
  69. package/dist/components/content/image/image.i18n.js.map +1 -1
  70. package/dist/components/content/image/image.js +7 -2
  71. package/dist/components/content/image/image.js.map +1 -1
  72. package/dist/components/content/image/image.styles.d.ts.map +1 -1
  73. package/dist/components/content/image/image.styles.js +21 -30
  74. package/dist/components/content/image/image.styles.js.map +1 -1
  75. package/dist/components/content/image/image.template.d.ts.map +1 -1
  76. package/dist/components/content/image/image.template.js +4 -11
  77. package/dist/components/content/image/image.template.js.map +1 -1
  78. package/dist/components/content/image/lqip-encoder-element.js +1 -1
  79. package/dist/components/{index-C3JellW2.js → index-DHU98C6V.js} +1561 -783
  80. package/dist/components/inputs/combo-box/combo-box.styles.js +1 -1
  81. package/dist/components/inputs/dropdown/dropdown.styles.d.ts.map +1 -1
  82. package/dist/components/inputs/dropdown/dropdown.styles.js +31 -18
  83. package/dist/components/inputs/dropdown/dropdown.styles.js.map +1 -1
  84. package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js +1 -1
  85. package/dist/components/inputs/password-field/password-field.styles.js +1 -1
  86. package/dist/components/inputs/search-field/search-field.styles.js +1 -1
  87. package/dist/components/inputs/segmented-control/segmented-control.d.ts +5 -4
  88. package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
  89. package/dist/components/inputs/segmented-control/segmented-control.js +4 -3
  90. package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
  91. package/dist/components/inputs/segmented-control/segmented-control.styles.d.ts.map +1 -1
  92. package/dist/components/inputs/segmented-control/segmented-control.styles.js +59 -9
  93. package/dist/components/inputs/segmented-control/segmented-control.styles.js.map +1 -1
  94. package/dist/components/inputs/segmented-control/segmented-control.template.js +3 -3
  95. package/dist/components/inputs/segmented-control/segmented-control.template.js.map +1 -1
  96. package/dist/components/inputs/stepper/stepper.styles.d.ts.map +1 -1
  97. package/dist/components/inputs/stepper/stepper.styles.js +16 -5
  98. package/dist/components/inputs/stepper/stepper.styles.js.map +1 -1
  99. package/dist/components/inputs/stepper/stepper.template.d.ts.map +1 -1
  100. package/dist/components/inputs/stepper/stepper.template.js +2 -0
  101. package/dist/components/inputs/stepper/stepper.template.js.map +1 -1
  102. package/dist/components/inputs/text-field/text-field.styles.js +1 -1
  103. package/dist/components/inputs/toggle-button/toggle-button.d.ts +4 -3
  104. package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
  105. package/dist/components/inputs/toggle-button/toggle-button.js +3 -2
  106. package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
  107. package/dist/components/inputs/toggle-button/toggle-button.styles.d.ts.map +1 -1
  108. package/dist/components/inputs/toggle-button/toggle-button.styles.js +53 -17
  109. package/dist/components/inputs/toggle-button/toggle-button.styles.js.map +1 -1
  110. package/dist/components/inputs/toggle-button/toggle-button.template.d.ts.map +1 -1
  111. package/dist/components/inputs/toggle-button/toggle-button.template.js +3 -4
  112. package/dist/components/inputs/toggle-button/toggle-button.template.js.map +1 -1
  113. package/dist/components/inputs/token/token.styles.d.ts.map +1 -1
  114. package/dist/components/inputs/token/token.styles.js +24 -7
  115. package/dist/components/inputs/token/token.styles.js.map +1 -1
  116. package/dist/components/inputs/token/token.template.d.ts.map +1 -1
  117. package/dist/components/inputs/token/token.template.js +1 -0
  118. package/dist/components/inputs/token/token.template.js.map +1 -1
  119. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +1 -1
  120. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
  121. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +0 -5
  122. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
  123. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +1 -0
  124. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
  125. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.d.ts.map +1 -1
  126. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js +5 -0
  127. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js.map +1 -1
  128. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.template.d.ts +1 -1
  129. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.template.d.ts.map +1 -1
  130. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.template.js +7 -3
  131. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.template.js.map +1 -1
  132. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +1 -0
  133. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
  134. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.d.ts.map +1 -1
  135. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js +5 -0
  136. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js.map +1 -1
  137. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.template.d.ts +1 -1
  138. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.template.d.ts.map +1 -1
  139. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.template.js +7 -3
  140. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.template.js.map +1 -1
  141. package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +1 -1
  142. package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
  143. package/dist/components/layout/page-sections/simple-section/simple-section.js +0 -5
  144. package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
  145. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +1 -0
  146. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
  147. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.d.ts.map +1 -1
  148. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js +5 -0
  149. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js.map +1 -1
  150. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.d.ts +1 -1
  151. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.d.ts.map +1 -1
  152. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.js +7 -3
  153. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.js.map +1 -1
  154. package/dist/components/lists-and-tables/table/table.styles.d.ts.map +1 -1
  155. package/dist/components/lists-and-tables/table/table.styles.js +7 -0
  156. package/dist/components/lists-and-tables/table/table.styles.js.map +1 -1
  157. package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +2 -22
  158. package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
  159. package/dist/components/navigation/breadcrumbs/breadcrumbs.i18n.d.ts +0 -1
  160. package/dist/components/navigation/breadcrumbs/breadcrumbs.i18n.d.ts.map +1 -1
  161. package/dist/components/navigation/breadcrumbs/breadcrumbs.i18n.js +0 -1
  162. package/dist/components/navigation/breadcrumbs/breadcrumbs.i18n.js.map +1 -1
  163. package/dist/components/navigation/breadcrumbs/breadcrumbs.js +2 -52
  164. package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  165. package/dist/components/navigation/breadcrumbs/breadcrumbs.styles.d.ts.map +1 -1
  166. package/dist/components/navigation/breadcrumbs/breadcrumbs.styles.js +1 -47
  167. package/dist/components/navigation/breadcrumbs/breadcrumbs.styles.js.map +1 -1
  168. package/dist/components/navigation/breadcrumbs/breadcrumbs.template.d.ts.map +1 -1
  169. package/dist/components/navigation/breadcrumbs/breadcrumbs.template.js +1 -17
  170. package/dist/components/navigation/breadcrumbs/breadcrumbs.template.js.map +1 -1
  171. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.d.ts.map +1 -1
  172. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js +39 -19
  173. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js.map +1 -1
  174. package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.d.ts.map +1 -1
  175. package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js +4 -0
  176. package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js.map +1 -1
  177. package/dist/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
  178. package/dist/components/navigation/pagination/pagination.styles.js +35 -15
  179. package/dist/components/navigation/pagination/pagination.styles.js.map +1 -1
  180. package/dist/components/navigation/pagination/pagination.template.d.ts.map +1 -1
  181. package/dist/components/navigation/pagination/pagination.template.js +2 -0
  182. package/dist/components/navigation/pagination/pagination.template.js.map +1 -1
  183. package/dist/components/navigation/tab-bar/tab-bar.d.ts +11 -4
  184. package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
  185. package/dist/components/navigation/tab-bar/tab-bar.js +17 -2
  186. package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
  187. package/dist/components/navigation/tab-bar/tab-bar.styles.d.ts.map +1 -1
  188. package/dist/components/navigation/tab-bar/tab-bar.styles.js +74 -18
  189. package/dist/components/navigation/tab-bar/tab-bar.styles.js.map +1 -1
  190. package/dist/components/navigation/tab-bar/tab-bar.template.d.ts.map +1 -1
  191. package/dist/components/navigation/tab-bar/tab-bar.template.js +4 -1
  192. package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
  193. package/dist/components/{prism-python-QiimuE8j.js → prism-python-9EoInm_N.js} +1 -1
  194. package/dist/components/{prism-rust-D4vfxUpk.js → prism-rust-Chzr6sBk.js} +1 -1
  195. package/dist/components/{prism-typescript-Dy2F4cF2.js → prism-typescript-DPJmu--x.js} +1 -1
  196. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.js +2 -2
  197. package/dist/css/rich-text.css +6 -1
  198. package/dist/css/settings.css +139 -35
  199. package/dist/utilities/page-section-mixin.d.ts +1 -0
  200. package/dist/utilities/page-section-mixin.d.ts.map +1 -1
  201. package/dist/utilities/page-section-mixin.js +9 -0
  202. package/dist/utilities/page-section-mixin.js.map +1 -1
  203. package/package.json +1 -1
@@ -8,46 +8,164 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  * Nederlandse Digitale Dienst Toolbar Component (Lit + TypeScript)
9
9
  *
10
10
  * @element nldd-toolbar
11
- * @attr {string} size - Toolbar size, propagated to all child controls: 'sm' | 'md' (default: 'md')
11
+ * @attr {string} size - Toolbar size, propagated to all child controls: 'sm' | 'md' | 'lg' (default: 'md'). At 'lg' the overflow button (and lg-capable children like nldd-icon-button) stack their label below the icon.
12
12
  * @attr {boolean} show-item-labels - When true, shows a text label below each toolbar item and the overflow button
13
13
  * @attr {string} label - Accessible label for the toolbar. Only needed when multiple toolbars appear on the same page
14
14
  *
15
15
  * @slot start - nldd-toolbar-item and nldd-toolbar-title elements placed at the start
16
16
  * @slot center - nldd-toolbar-item and nldd-toolbar-title elements placed at the center
17
17
  * @slot end - nldd-toolbar-item and nldd-toolbar-title elements placed at the end
18
- * @slot overflow - nldd-menu-item and nldd-menu-divider elements always shown in the overflow menu
18
+ * @slot overflow - nldd-menu-item, nldd-menu-divider and nldd-menu-group elements always shown in the overflow menu
19
+ *
20
+ * ---
21
+ *
22
+ * @element nldd-toolbar-item
23
+ * @attr {string} width - Fluid width: a percentage (e.g. '40%') or any CSS length (e.g. '240px'). Setting it (or min-width or max-width) makes the item fluid so it grows to fill the available space.
24
+ * @attr {string} min-width - Minimum (fluid) width as a CSS length (e.g. '240px'). Setting it also makes the item fluid.
25
+ * @attr {string} max-width - Maximum (fluid) width as a CSS length (e.g. '480px'). Setting it also makes the item fluid.
26
+ * @attr {string} label - Text label shown below the item when the toolbar has show-item-labels.
27
+ * @attr {number} priority - Overflow order: items with a lower priority move into the overflow menu first (default 0). Items sharing a priority overflow together, regardless of position.
28
+ * @attr {boolean} fluid - Set by nldd-toolbar, not a consumer attribute: marks an item that grows or shrinks to fill space. Toggled synchronously during measurement, so it can appear or disappear between layout frames — do not style against it. It is not reflected as a JS property — read it with hasAttribute('fluid').
29
+ * @attr {boolean} solo-fluid - Set by nldd-toolbar, not a consumer attribute: the sole fluid item, allowed to shrink below its content. Same synchronous-toggle and property-read caveats as fluid.
30
+ * @attr {boolean} hidden - Set by nldd-toolbar, not a consumer attribute, when the item moves into the overflow menu. Same synchronous-toggle caveat.
31
+ *
32
+ * @slot - The control shown in the toolbar (e.g. nldd-icon-button)
33
+ * @slot overflow - nldd-menu-item / nldd-menu-divider / nldd-menu-group children, shown in the overflow menu when this item overflows
34
+ *
35
+ * ---
36
+ *
37
+ * @element nldd-toolbar-title
38
+ * @attr {string} text - Title text.
39
+ * @attr {string} supporting-text - Secondary supporting text shown below the title.
40
+ * @attr {string} align - Text alignment: 'left' | 'center' (default: 'left').
41
+ * @attr {string} width - Preferred (fluid) width as a CSS length or percentage; the title grows toward it and shrinks to min-width.
42
+ * @attr {string} min-width - Minimum width as a CSS length (e.g. '200px', default '200px').
43
+ * @attr {string} max-width - Maximum width as a CSS length (e.g. '480px').
19
44
  */
20
45
  import { LitElement } from 'lit';
21
46
  import { customElement, property, state } from 'lit/decorators.js';
22
- import { toolbarStyles } from './toolbar.styles.js';
23
- import { template } from './toolbar.template.js';
47
+ import { toolbarStyles, toolbarItemStyles, toolbarTitleStyles } from './toolbar.styles.js';
48
+ import { template, toolbarItemTemplate, toolbarTitleTemplate } from './toolbar.template.js';
24
49
  import { nlddToolbarTranslations } from './toolbar.i18n.js';
25
- // # Marker elements
26
- if (!customElements.get('nldd-toolbar-item')) {
27
- customElements.define('nldd-toolbar-item', class extends HTMLElement {
28
- constructor() {
29
- super();
30
- this.attachShadow({ mode: 'open' }).innerHTML = '<slot></slot><slot name="overflow" style="display:none"></slot>';
50
+ // # nldd-toolbar-item
51
+ let NLDDToolbarItem = class NLDDToolbarItem extends LitElement {
52
+ constructor() {
53
+ super(...arguments);
54
+ this.width = '';
55
+ this.minWidth = '';
56
+ this.maxWidth = '';
57
+ this.label = '';
58
+ this.priority = 0;
59
+ /** Set by nldd-toolbar; not part of the public API. @internal */
60
+ this.size = 'md';
61
+ /** Set by nldd-toolbar; not part of the public API. @internal */
62
+ this.showItemLabels = false;
63
+ }
64
+ // Layout state — `fluid`, `solo-fluid` and `hidden` — is owned by
65
+ // nldd-toolbar and toggled directly as attributes during measurement
66
+ // (synchronous, so the host box reflows immediately). They are not
67
+ // reactive properties: Lit would reflect them asynchronously, which would
68
+ // desync the attribute from the synchronous getBoundingClientRect reads.
69
+ render() {
70
+ return toolbarItemTemplate(this);
71
+ }
72
+ };
73
+ NLDDToolbarItem.styles = toolbarItemStyles;
74
+ __decorate([
75
+ property({ type: String })
76
+ ], NLDDToolbarItem.prototype, "width", void 0);
77
+ __decorate([
78
+ property({ type: String, attribute: 'min-width' })
79
+ ], NLDDToolbarItem.prototype, "minWidth", void 0);
80
+ __decorate([
81
+ property({ type: String, attribute: 'max-width' })
82
+ ], NLDDToolbarItem.prototype, "maxWidth", void 0);
83
+ __decorate([
84
+ property({ type: String })
85
+ ], NLDDToolbarItem.prototype, "label", void 0);
86
+ __decorate([
87
+ property({ type: Number })
88
+ ], NLDDToolbarItem.prototype, "priority", void 0);
89
+ __decorate([
90
+ property({ type: String, reflect: true })
91
+ ], NLDDToolbarItem.prototype, "size", void 0);
92
+ __decorate([
93
+ property({ type: Boolean, reflect: true, attribute: 'show-item-labels' })
94
+ ], NLDDToolbarItem.prototype, "showItemLabels", void 0);
95
+ NLDDToolbarItem = __decorate([
96
+ customElement('nldd-toolbar-item')
97
+ ], NLDDToolbarItem);
98
+ export { NLDDToolbarItem };
99
+ // # nldd-toolbar-title
100
+ let NLDDToolbarTitle = class NLDDToolbarTitle extends LitElement {
101
+ constructor() {
102
+ super(...arguments);
103
+ this.text = '';
104
+ this.supportingText = '';
105
+ this.align = 'left';
106
+ this.width = '';
107
+ this.minWidth = '';
108
+ this.maxWidth = '';
109
+ /** Set by nldd-toolbar; not part of the public API. @internal */
110
+ this.size = 'md';
111
+ }
112
+ // Layout state — `solo-fluid` and `hidden` — is owned by nldd-toolbar and
113
+ // toggled directly as attributes during measurement (synchronous). Not a
114
+ // reactive property for the same reflection-timing reason as the item.
115
+ // willUpdate (not updated) so the size CSS variables are written before the
116
+ // toolbar measures the title with getBoundingClientRect() on the same frame.
117
+ willUpdate(changedProperties) {
118
+ if (changedProperties.has('minWidth'))
119
+ this._reflectSizeVar('--_title-group-min-width', this.minWidth);
120
+ if (changedProperties.has('width'))
121
+ this._reflectSizeVar('--_title-width', this.width);
122
+ if (changedProperties.has('maxWidth'))
123
+ this._reflectSizeVar('--_title-max-width', this.maxWidth);
124
+ }
125
+ _reflectSizeVar(prop, value) {
126
+ if (value) {
127
+ this.style.setProperty(prop, value);
31
128
  }
32
- });
33
- }
34
- if (!customElements.get('nldd-toolbar-title')) {
35
- customElements.define('nldd-toolbar-title', class extends HTMLElement {
36
- });
37
- }
129
+ else {
130
+ this.style.removeProperty(prop);
131
+ }
132
+ }
133
+ render() {
134
+ return toolbarTitleTemplate(this);
135
+ }
136
+ };
137
+ NLDDToolbarTitle.styles = toolbarTitleStyles;
138
+ __decorate([
139
+ property({ type: String })
140
+ ], NLDDToolbarTitle.prototype, "text", void 0);
141
+ __decorate([
142
+ property({ type: String, attribute: 'supporting-text' })
143
+ ], NLDDToolbarTitle.prototype, "supportingText", void 0);
144
+ __decorate([
145
+ property({ type: String, reflect: true })
146
+ ], NLDDToolbarTitle.prototype, "align", void 0);
147
+ __decorate([
148
+ property({ type: String })
149
+ ], NLDDToolbarTitle.prototype, "width", void 0);
150
+ __decorate([
151
+ property({ type: String, attribute: 'min-width' })
152
+ ], NLDDToolbarTitle.prototype, "minWidth", void 0);
153
+ __decorate([
154
+ property({ type: String, attribute: 'max-width' })
155
+ ], NLDDToolbarTitle.prototype, "maxWidth", void 0);
156
+ __decorate([
157
+ property({ type: String, reflect: true })
158
+ ], NLDDToolbarTitle.prototype, "size", void 0);
159
+ NLDDToolbarTitle = __decorate([
160
+ customElement('nldd-toolbar-title')
161
+ ], NLDDToolbarTitle);
162
+ export { NLDDToolbarTitle };
38
163
  // # Component
39
164
  let NLDDToolbar = class NLDDToolbar extends LitElement {
40
165
  constructor() {
41
166
  super(...arguments);
42
- /** Controls the size of toolbar items. Propagated automatically to all child controls. */
43
167
  this.size = 'md';
44
- /** When true, shows a text label below each toolbar item and the overflow button. */
45
168
  this.showItemLabels = false;
46
- /**
47
- * Accessible label for the toolbar, exposed as `aria-label` on the `role="toolbar"` container.
48
- * Only needed when multiple toolbars appear on the same page so screen readers can distinguish them.
49
- * @example `<nldd-toolbar label="Formatting">`
50
- */
51
169
  this.label = '';
52
170
  this.translations = {};
53
171
  this._menuOpen = false;
@@ -120,11 +238,11 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
120
238
  this._measureAndUpdate();
121
239
  });
122
240
  this._resizeObserver.observe(this);
123
- this._propagateSize();
241
+ this._syncHosts();
124
242
  }
125
243
  updated(changedProperties) {
126
- if (changedProperties.has('size')) {
127
- this._propagateSize();
244
+ if (changedProperties.has('size') || changedProperties.has('showItemLabels')) {
245
+ this._syncHosts();
128
246
  }
129
247
  if (changedProperties.has('_startChildren') ||
130
248
  changedProperties.has('_centerChildren') ||
@@ -208,13 +326,49 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
208
326
  });
209
327
  }
210
328
  }
211
- _propagateSize() {
212
- Array.from(this.querySelectorAll('nldd-toolbar-item')).forEach(item => {
213
- Array.from(item.children).forEach(child => {
214
- if (child.getAttribute('slot') !== 'overflow') {
215
- child.setAttribute('size', this.size);
329
+ /**
330
+ * Syncs declarative state onto the slotted item and title hosts: size,
331
+ * show-item-labels, the base fluid flag and the fluid width custom
332
+ * properties. The parent owns layout decisions; each host owns its own box
333
+ * and rendering. Attributes are set directly (not via reactive properties)
334
+ * so the host box reflows synchronously before the next measurement.
335
+ */
336
+ _syncHosts() {
337
+ this._allHostChildren().forEach(child => {
338
+ if (child.type === 'item') {
339
+ const host = child.element;
340
+ host.setAttribute('size', this.size);
341
+ host.toggleAttribute('show-item-labels', this.showItemLabels);
342
+ host.toggleAttribute('fluid', child.isFluid);
343
+ if (child.isFluid && child.minWidth) {
344
+ host.style.setProperty('--_item-min-width', child.minWidth);
216
345
  }
217
- });
346
+ else {
347
+ host.style.removeProperty('--_item-min-width');
348
+ }
349
+ if (child.isFluid && child.width) {
350
+ host.style.setProperty('--_item-width', child.width);
351
+ }
352
+ else {
353
+ host.style.removeProperty('--_item-width');
354
+ }
355
+ if (child.isFluid && child.maxWidth) {
356
+ host.style.setProperty('--_item-max-width', child.maxWidth);
357
+ }
358
+ else {
359
+ host.style.removeProperty('--_item-max-width');
360
+ }
361
+ // Forward size to the inner control(s).
362
+ Array.from(host.children).forEach(inner => {
363
+ if (inner.getAttribute('slot') !== 'overflow') {
364
+ inner.setAttribute('size', this.size);
365
+ }
366
+ });
367
+ }
368
+ else if (child.type === 'title') {
369
+ const host = child.element;
370
+ host.setAttribute('size', this.size);
371
+ }
218
372
  });
219
373
  }
220
374
  _getPrioritizedItems() {
@@ -242,11 +396,21 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
242
396
  this._prioritizedItemsCache = result;
243
397
  return result;
244
398
  }
399
+ _allHostChildren() {
400
+ return [...this._startChildren, ...this._centerChildren, ...this._endChildren];
401
+ }
402
+ _hostFor(id) {
403
+ const child = this._allHostChildren().find(c => c.id === id);
404
+ return (child && (child.type === 'item' || child.type === 'title'))
405
+ ? child.element
406
+ : null;
407
+ }
245
408
  _measureItemWidths() {
246
- const measurableEls = Array.from(this.shadowRoot?.querySelectorAll('.toolbar__item[data-child-id], .toolbar__title-group[data-child-id]') ?? []);
247
- measurableEls.forEach(el => {
248
- const id = Number(el.dataset.childId);
249
- this._itemWidths.set(id, el.getBoundingClientRect().width);
409
+ this._allHostChildren().forEach(child => {
410
+ if (child.type === 'item' || child.type === 'title') {
411
+ const host = child.element;
412
+ this._itemWidths.set(child.id, host.getBoundingClientRect().width);
413
+ }
250
414
  });
251
415
  }
252
416
  _computeAreaWidth(children, itemGap) {
@@ -311,25 +475,26 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
311
475
  }
312
476
  _measureOverflow(itemsEl) {
313
477
  const overflowButtonEl = this.shadowRoot?.querySelector('.toolbar__overflow-button');
314
- const allItemEls = Array.from(this.shadowRoot?.querySelectorAll('.toolbar__item[data-child-id]') ?? []);
315
- const allTitleGroupEls = Array.from(this.shadowRoot?.querySelectorAll('.toolbar__title-group[data-child-id]') ?? []);
316
- const allChildren = [...this._startChildren, ...this._centerChildren, ...this._endChildren];
317
- // Show all items, reset solo-fluid to is-fluid with min-width restored
318
- allItemEls.forEach(el => {
319
- el.classList.remove('is-hidden');
320
- if (el.classList.contains('is-solo-fluid')) {
321
- el.classList.replace('is-solo-fluid', 'is-fluid');
322
- const id = Number(el.dataset.childId);
323
- const child = allChildren.find(c => c.id === id);
324
- if (child?.type === 'item' && child.minWidth) {
325
- el.style.setProperty('--_item-min-width', child.minWidth);
478
+ const allChildren = this._allHostChildren();
479
+ const itemChildren = allChildren.filter((c) => c.type === 'item');
480
+ const titleChildren = allChildren.filter((c) => c.type === 'title');
481
+ // Show all items, reset solo-fluid to fluid with min-width restored.
482
+ itemChildren.forEach(child => {
483
+ const host = child.element;
484
+ host.hidden = false;
485
+ if (host.hasAttribute('solo-fluid')) {
486
+ host.removeAttribute('solo-fluid');
487
+ host.toggleAttribute('fluid', child.isFluid);
488
+ if (child.isFluid && child.minWidth) {
489
+ host.style.setProperty('--_item-min-width', child.minWidth);
326
490
  }
327
491
  }
328
492
  });
329
- allTitleGroupEls.forEach(el => {
330
- if (el.classList.contains('is-solo-fluid')) {
331
- el.classList.remove('is-solo-fluid');
332
- el.style.removeProperty('min-width');
493
+ titleChildren.forEach(child => {
494
+ const host = child.element;
495
+ if (host.hasAttribute('solo-fluid')) {
496
+ host.removeAttribute('solo-fluid');
497
+ host.style.removeProperty('min-width');
333
498
  }
334
499
  });
335
500
  if (this._pinnedOverflowItems.length > 0) {
@@ -339,11 +504,15 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
339
504
  overflowButtonEl?.classList.add('is-hidden');
340
505
  }
341
506
  void itemsEl.offsetWidth;
507
+ const centerOnly = this._startChildren.length === 0
508
+ && this._endChildren.length === 0
509
+ && this._centerChildren.length > 0;
342
510
  const isOverflowing = () => itemsEl.scrollWidth > itemsEl.clientWidth + 1;
343
511
  if (!isOverflowing()) {
344
512
  if (this._overflowIds.size > 0) {
345
513
  this._overflowIds = new Set();
346
514
  }
515
+ this._promoteSoloFluid(itemsEl, itemChildren, titleChildren, centerOnly);
347
516
  this._measureItemWidths();
348
517
  this._updateAreaVars();
349
518
  return;
@@ -352,36 +521,32 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
352
521
  void itemsEl.offsetWidth;
353
522
  const prioritized = this._getPrioritizedItems();
354
523
  const newOverflowIds = new Set();
355
- for (const child of prioritized) {
524
+ const priorityGroups = groupForOverflow(prioritized);
525
+ for (const group of priorityGroups) {
356
526
  if (!isOverflowing())
357
527
  break;
358
- if (child.isFluid) {
359
- const remainingVisible = allItemEls.filter(el => !el.classList.contains('is-hidden') &&
360
- !el.classList.contains('is-fluid') &&
361
- !el.classList.contains('is-solo-fluid'));
362
- if (remainingVisible.length === 0)
528
+ // Fluid-guard (per group): never hide the last fluid fallback. If
529
+ // hiding this group would leave no non-fluid item visible, stop and
530
+ // let a remaining fluid item shrink (solo-fluid) instead.
531
+ if (group.some(c => c.isFluid)) {
532
+ const groupIds = new Set(group.map(c => c.id));
533
+ const nonFluidVisibleOutside = itemChildren.filter(c => {
534
+ const host = c.element;
535
+ return !host.hidden && !host.hasAttribute('fluid') && !host.hasAttribute('solo-fluid') && !groupIds.has(c.id);
536
+ });
537
+ if (nonFluidVisibleOutside.length === 0)
363
538
  break;
364
539
  }
365
- newOverflowIds.add(child.id);
366
- const el = this.shadowRoot?.querySelector(`.toolbar__item[data-child-id="${child.id}"]`);
367
- el?.classList.add('is-hidden');
540
+ for (const child of group) {
541
+ newOverflowIds.add(child.id);
542
+ child.element.hidden = true;
543
+ }
368
544
  void itemsEl.offsetWidth;
369
545
  }
370
546
  if (newOverflowIds.size === 0 && this._pinnedOverflowItems.length === 0) {
371
547
  overflowButtonEl?.classList.add('is-hidden');
372
548
  }
373
- const remainingVisible = allItemEls.filter(el => !el.classList.contains('is-hidden'));
374
- if (remainingVisible.length === 1 && remainingVisible[0].classList.contains('is-fluid')) {
375
- remainingVisible[0].classList.replace('is-fluid', 'is-solo-fluid');
376
- remainingVisible[0].style.removeProperty('--_item-min-width');
377
- void itemsEl.offsetWidth;
378
- }
379
- const remainingTitleGroups = allTitleGroupEls.filter(el => !el.classList.contains('is-hidden'));
380
- if (remainingVisible.length === 0 && remainingTitleGroups.length === 1) {
381
- remainingTitleGroups[0].classList.add('is-solo-fluid');
382
- remainingTitleGroups[0].style.setProperty('min-width', '0px');
383
- void itemsEl.offsetWidth;
384
- }
549
+ this._promoteSoloFluid(itemsEl, itemChildren, titleChildren, centerOnly);
385
550
  const changed = newOverflowIds.size !== this._overflowIds.size ||
386
551
  [...newOverflowIds].some(id => !this._overflowIds.has(id));
387
552
  if (changed) {
@@ -390,6 +555,29 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
390
555
  this._measureItemWidths();
391
556
  this._updateAreaVars();
392
557
  }
558
+ /**
559
+ * Promotes a lone remaining fluid item — or a lone title when no items are
560
+ * visible — to the solo-fluid state so it grows to fill the row. In
561
+ * center-only mode the center-fill wrapper already grows the items, so item
562
+ * promotion is skipped there (matching the previous template behaviour).
563
+ */
564
+ _promoteSoloFluid(itemsEl, itemChildren, titleChildren, centerOnly) {
565
+ const remainingVisible = itemChildren.filter(c => !c.element.hidden);
566
+ if (!centerOnly && remainingVisible.length === 1 && remainingVisible[0].element.hasAttribute('fluid')) {
567
+ const host = remainingVisible[0].element;
568
+ host.removeAttribute('fluid');
569
+ host.setAttribute('solo-fluid', '');
570
+ host.style.removeProperty('--_item-min-width');
571
+ void itemsEl.offsetWidth;
572
+ }
573
+ const remainingTitles = titleChildren.filter(c => !c.element.hidden);
574
+ if (remainingVisible.length === 0 && remainingTitles.length === 1) {
575
+ const host = remainingTitles[0].element;
576
+ host.setAttribute('solo-fluid', '');
577
+ host.style.setProperty('min-width', '0px');
578
+ void itemsEl.offsetWidth;
579
+ }
580
+ }
393
581
  _buildChildrenForSlot(slotName) {
394
582
  return Array.from(this.children)
395
583
  .filter(el => el.getAttribute('slot') === slotName)
@@ -397,13 +585,9 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
397
585
  const tag = el.tagName.toLowerCase();
398
586
  if (tag === 'nldd-toolbar-title') {
399
587
  const id = this._getId(el);
400
- el.dataset.toolbarSlot = slotName;
401
- el.setAttribute('slot', `child-${id}`);
402
588
  return {
403
589
  type: 'title',
404
- title: el.getAttribute('text') ?? '',
405
- supportingText: el.getAttribute('supporting-text') ?? '',
406
- align: el.getAttribute('align') ?? 'left',
590
+ element: el,
407
591
  minWidth: el.getAttribute('min-width') ?? '200px',
408
592
  id,
409
593
  };
@@ -412,26 +596,19 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
412
596
  const id = this._getId(el);
413
597
  const label = el.getAttribute('label') ?? '';
414
598
  const priority = parseInt(el.getAttribute('priority') ?? '0', 10);
599
+ const hasPriority = el.hasAttribute('priority');
415
600
  const minWidth = el.getAttribute('min-width') ?? '';
601
+ const maxWidth = el.getAttribute('max-width') ?? '';
416
602
  const width = el.getAttribute('width') ?? '';
417
- const isFluid = !!(minWidth || width);
418
- Array.from(el.children).forEach(child => {
419
- if (child.getAttribute('slot') !== 'overflow') {
420
- child.setAttribute('size', this.size);
421
- }
422
- });
423
- el.dataset.toolbarSlot = slotName;
424
- el.setAttribute('slot', `child-${id}`);
603
+ const isFluid = !!(minWidth || maxWidth || width);
425
604
  const overflowItems = Array.from(el.children).filter(child => {
426
605
  const childTag = child.tagName.toLowerCase();
427
- return childTag === 'nldd-menu-item' || childTag === 'nldd-menu-divider';
606
+ return childTag === 'nldd-menu-item' || childTag === 'nldd-menu-divider' || childTag === 'nldd-menu-group';
428
607
  });
429
608
  overflowItems.forEach(child => child.setAttribute('slot', 'overflow'));
430
- return { type: 'item', element: el, label, id, priority, overflowItems, minWidth, width, isFluid };
609
+ return { type: 'item', element: el, label, id, priority, hasPriority, overflowItems, minWidth, maxWidth, width, isFluid };
431
610
  }
432
611
  const id = this._getId(el);
433
- el.dataset.toolbarSlot = slotName;
434
- el.setAttribute('slot', `child-${id}`);
435
612
  return { type: 'other', element: el, id };
436
613
  });
437
614
  }
@@ -439,15 +616,7 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
439
616
  this._pinnedOverflowItems = Array.from(this.children).filter(el => {
440
617
  const tag = el.tagName.toLowerCase();
441
618
  return el.getAttribute('slot') === 'overflow' &&
442
- (tag === 'nldd-menu-item' || tag === 'nldd-menu-divider');
443
- });
444
- }
445
- _restoreSlots() {
446
- Array.from(this.children)
447
- .filter((el) => el instanceof HTMLElement && !!el.dataset.toolbarSlot)
448
- .forEach(el => {
449
- el.setAttribute('slot', el.dataset.toolbarSlot);
450
- delete el.dataset.toolbarSlot;
619
+ (tag === 'nldd-menu-item' || tag === 'nldd-menu-divider' || tag === 'nldd-menu-group');
451
620
  });
452
621
  }
453
622
  _buildChildren() {
@@ -455,22 +624,22 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
455
624
  return;
456
625
  this._isBuilding = true;
457
626
  this._observer?.disconnect();
458
- this._restoreSlots();
459
627
  this._startChildren = this._buildChildrenForSlot('start');
460
628
  this._centerChildren = this._buildChildrenForSlot('center');
461
629
  this._endChildren = this._buildChildrenForSlot('end');
462
630
  this._buildPinnedOverflowItems();
463
631
  this._prioritizedItemsCache = null;
464
- const itemAttributeFilter = ['label', 'priority', 'min-width', 'width', 'text', 'disabled', 'selected', 'type'];
632
+ this._syncHosts();
633
+ const itemAttributeFilter = ['label', 'priority', 'min-width', 'max-width', 'width', 'text', 'disabled', 'selected', 'type'];
465
634
  this._observer?.observe(this, { childList: true, attributes: true, subtree: true, attributeFilter: itemAttributeFilter });
466
635
  this._isBuilding = false;
467
636
  }
468
637
  render() {
469
- const allChildren = [...this._startChildren, ...this._centerChildren, ...this._endChildren];
638
+ const allChildren = this._allHostChildren();
470
639
  const visibleNonDivider = allChildren.filter(c => !this._overflowIds.has(c.id));
471
640
  const isSoloFluid = visibleNonDivider.length === 1 && (visibleNonDivider[0].type === 'title' ||
472
641
  (visibleNonDivider[0].type === 'item' && visibleNonDivider[0].isFluid));
473
- return template(this._startChildren, this._centerChildren, this._endChildren, this._overflowIds, this.size, this._centerChildren.length > 0, this._leftSpacerZero, this._rightSpacerZero, isSoloFluid, this._pinnedOverflowItems.length > 0 || this._overflowIds.size > 0, this._menuOpen, this.label, this._startChildren.length === 0 && this._endChildren.length === 0 && this._centerChildren.length > 0, (key) => this._t(key));
642
+ return template(this, this._centerChildren.length > 0, this._leftSpacerZero, this._rightSpacerZero, isSoloFluid, this._pinnedOverflowItems.length > 0 || this._overflowIds.size > 0, this._menuOpen, this.label, this._startChildren.length === 0 && this._endChildren.length === 0 && this._centerChildren.length > 0, (key) => this._t(key));
474
643
  }
475
644
  };
476
645
  NLDDToolbar.styles = toolbarStyles;
@@ -514,4 +683,31 @@ NLDDToolbar = __decorate([
514
683
  customElement('nldd-toolbar')
515
684
  ], NLDDToolbar);
516
685
  export { NLDDToolbar };
686
+ /**
687
+ * Groups prioritized items for overflow. Items with an explicit priority that
688
+ * share a value form one group and overflow together regardless of their
689
+ * position; items without a priority attribute each form their own group
690
+ * (they overflow individually).
691
+ *
692
+ * @internal Exported for unit tests only; not part of the public API.
693
+ */
694
+ export function groupForOverflow(items) {
695
+ const groups = [];
696
+ const byPriority = new Map();
697
+ for (const child of items) {
698
+ if (!child.hasPriority) {
699
+ groups.push([child]);
700
+ continue;
701
+ }
702
+ const existing = byPriority.get(child.priority);
703
+ if (existing) {
704
+ existing.push(child);
705
+ continue;
706
+ }
707
+ const group = [child];
708
+ byPriority.set(child.priority, group);
709
+ groups.push(group);
710
+ }
711
+ return groups;
712
+ }
517
713
  //# sourceMappingURL=toolbar.js.map