@webtides/element-library 0.3.1 → 0.4.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 (195) hide show
  1. package/CHANGELOG.md +193 -0
  2. package/README.md +72 -56
  3. package/all.js +16 -0
  4. package/catalog.js +17 -1
  5. package/custom-elements.json +14723 -10220
  6. package/package.json +1 -1
  7. package/src/components/accordion/accordion.changelog.md +11 -0
  8. package/src/components/accordion/accordion.js +15 -3
  9. package/src/components/accordion/accordion.readme.md +27 -1
  10. package/src/components/accordion/accordion.style.js +19 -0
  11. package/src/components/app-bar/app-bar.changelog.md +24 -0
  12. package/src/components/app-bar/app-bar.define.js +3 -0
  13. package/src/components/app-bar/app-bar.js +91 -0
  14. package/src/components/app-bar/app-bar.readme.md +130 -0
  15. package/src/components/app-bar/app-bar.style.js +103 -0
  16. package/src/components/app-frame/app-frame.changelog.md +45 -0
  17. package/src/components/app-frame/app-frame.define.js +3 -0
  18. package/src/components/app-frame/app-frame.events.js +6 -0
  19. package/src/components/app-frame/app-frame.js +1073 -0
  20. package/src/components/app-frame/app-frame.readme.md +416 -0
  21. package/src/components/app-frame/app-frame.style.js +527 -0
  22. package/src/components/button/button.changelog.md +15 -0
  23. package/src/components/button/button.events.js +3 -0
  24. package/src/components/button/button.js +145 -3
  25. package/src/components/button/button.readme.md +72 -4
  26. package/src/components/button/button.style.js +161 -7
  27. package/src/components/description-list/description-list.changelog.md +25 -0
  28. package/src/components/description-list/description-list.define.js +3 -0
  29. package/src/components/description-list/description-list.js +44 -0
  30. package/src/components/description-list/description-list.readme.md +135 -0
  31. package/src/components/description-list/description-list.style.js +140 -0
  32. package/src/components/dialog/dialog.changelog.md +7 -0
  33. package/src/components/dialog/dialog.readme.md +5 -0
  34. package/src/components/dialog/dialog.style.js +17 -2
  35. package/src/components/drawer/drawer.changelog.md +7 -0
  36. package/src/components/drawer/drawer.readme.md +7 -6
  37. package/src/components/drawer/drawer.style.js +35 -2
  38. package/src/components/dropdown/dropdown.readme.md +6 -1
  39. package/src/components/list/list.changelog.md +24 -0
  40. package/src/components/list/list.define.js +3 -0
  41. package/src/components/list/list.js +66 -0
  42. package/src/components/list/list.readme.md +122 -0
  43. package/src/components/list/list.style.js +56 -0
  44. package/src/components/list-item/list-item.changelog.md +24 -0
  45. package/src/components/list-item/list-item.define.js +3 -0
  46. package/src/components/list-item/list-item.js +128 -0
  47. package/src/components/list-item/list-item.readme.md +126 -0
  48. package/src/components/list-item/list-item.style.js +234 -0
  49. package/src/components/menu/menu.changelog.md +27 -0
  50. package/src/components/menu/menu.define.js +3 -0
  51. package/src/components/menu/menu.events.js +5 -0
  52. package/src/components/menu/menu.js +570 -0
  53. package/src/components/menu/menu.readme.md +272 -0
  54. package/src/components/menu/menu.style.js +55 -0
  55. package/src/components/menu-group/menu-group.changelog.md +20 -0
  56. package/src/components/menu-group/menu-group.define.js +3 -0
  57. package/src/components/menu-group/menu-group.js +44 -0
  58. package/src/components/menu-group/menu-group.readme.md +74 -0
  59. package/src/components/menu-group/menu-group.style.js +38 -0
  60. package/src/components/menu-item/menu-item.changelog.md +24 -0
  61. package/src/components/menu-item/menu-item.define.js +3 -0
  62. package/src/components/menu-item/menu-item.js +130 -0
  63. package/src/components/menu-item/menu-item.readme.md +94 -0
  64. package/src/components/menu-item/menu-item.style.js +87 -0
  65. package/src/components/nav/nav.changelog.md +35 -0
  66. package/src/components/nav/nav.define.js +3 -0
  67. package/src/components/nav/nav.js +212 -0
  68. package/src/components/nav/nav.readme.md +248 -0
  69. package/src/components/nav/nav.style.js +269 -0
  70. package/src/components/nav-item/nav-item.changelog.md +25 -0
  71. package/src/components/nav-item/nav-item.define.js +3 -0
  72. package/src/components/nav-item/nav-item.js +75 -0
  73. package/src/components/nav-item/nav-item.readme.md +111 -0
  74. package/src/components/nav-item/nav-item.style.js +159 -0
  75. package/src/components/pagination/pagination.changelog.md +8 -0
  76. package/src/components/pagination/pagination.js +123 -49
  77. package/src/components/pagination/pagination.readme.md +24 -6
  78. package/src/components/pagination/pagination.style.js +11 -1
  79. package/src/components/scroll-to-top/scroll-to-top.changelog.md +7 -5
  80. package/src/components/scroll-to-top/scroll-to-top.js +16 -12
  81. package/src/components/scroll-to-top/scroll-to-top.readme.md +2 -0
  82. package/src/components/segmented-field/segmented-field.changelog.md +27 -0
  83. package/src/components/segmented-field/segmented-field.define.js +3 -0
  84. package/src/components/segmented-field/segmented-field.js +175 -0
  85. package/src/components/segmented-field/segmented-field.readme.md +140 -0
  86. package/src/components/segmented-field/segmented-field.style.js +193 -0
  87. package/src/components/splitter/splitter.changelog.md +24 -0
  88. package/src/components/splitter/splitter.define.js +3 -0
  89. package/src/components/splitter/splitter.events.js +4 -0
  90. package/src/components/splitter/splitter.js +237 -0
  91. package/src/components/splitter/splitter.readme.md +164 -0
  92. package/src/components/splitter/splitter.style.js +100 -0
  93. package/src/components/status-bar/status-bar.changelog.md +25 -0
  94. package/src/components/status-bar/status-bar.define.js +3 -0
  95. package/src/components/status-bar/status-bar.js +74 -0
  96. package/src/components/status-bar/status-bar.readme.md +139 -0
  97. package/src/components/status-bar/status-bar.style.js +122 -0
  98. package/src/components/tab-group/tab-group.changelog.md +7 -0
  99. package/src/components/tab-group/tab-group.js +30 -9
  100. package/src/components/tab-group/tab-group.readme.md +14 -0
  101. package/src/components/toast/toast.changelog.md +6 -0
  102. package/src/components/toast/toast.readme.md +5 -3
  103. package/src/components/toast/toast.style.js +22 -6
  104. package/src/components/toolbar/toolbar.changelog.md +24 -0
  105. package/src/components/toolbar/toolbar.define.js +3 -0
  106. package/src/components/toolbar/toolbar.js +233 -0
  107. package/src/components/toolbar/toolbar.readme.md +156 -0
  108. package/src/components/toolbar/toolbar.style.js +49 -0
  109. package/src/components/tooltip/tooltip.changelog.md +11 -0
  110. package/src/components/tooltip/tooltip.js +51 -4
  111. package/src/components/tooltip/tooltip.readme.md +26 -1
  112. package/src/components/tree/tree.changelog.md +23 -0
  113. package/src/components/tree/tree.define.js +3 -0
  114. package/src/components/tree/tree.js +138 -0
  115. package/src/components/tree/tree.readme.md +119 -0
  116. package/src/components/tree/tree.style.js +16 -0
  117. package/src/components/tree-item/tree-item.changelog.md +23 -0
  118. package/src/components/tree-item/tree-item.define.js +3 -0
  119. package/src/components/tree-item/tree-item.events.js +3 -0
  120. package/src/components/tree-item/tree-item.js +246 -0
  121. package/src/components/tree-item/tree-item.readme.md +128 -0
  122. package/src/components/tree-item/tree-item.style.js +226 -0
  123. package/src/styles/appearance.style.js +47 -0
  124. package/src/styles/choice-group.style.js +1 -1
  125. package/src/styles/modal.style.js +14 -1
  126. package/src/styles/size.style.js +41 -0
  127. package/src/utils/focus.js +69 -0
  128. package/src/utils/scroll.js +24 -0
  129. package/types/all.d.ts +16 -0
  130. package/types/src/components/accordion/accordion.d.ts +3 -1
  131. package/types/src/components/app-bar/app-bar.d.ts +43 -0
  132. package/types/src/components/app-bar/app-bar.define.d.ts +1 -0
  133. package/types/src/components/app-bar/app-bar.style.d.ts +2 -0
  134. package/types/src/components/app-frame/app-frame.d.ts +491 -0
  135. package/types/src/components/app-frame/app-frame.define.d.ts +1 -0
  136. package/types/src/components/app-frame/app-frame.events.d.ts +7 -0
  137. package/types/src/components/app-frame/app-frame.style.d.ts +8 -0
  138. package/types/src/components/button/button.d.ts +61 -0
  139. package/types/src/components/button/button.events.d.ts +4 -0
  140. package/types/src/components/description-list/description-list.d.ts +29 -0
  141. package/types/src/components/description-list/description-list.define.d.ts +1 -0
  142. package/types/src/components/description-list/description-list.style.d.ts +2 -0
  143. package/types/src/components/list/list.d.ts +39 -0
  144. package/types/src/components/list/list.define.d.ts +1 -0
  145. package/types/src/components/list/list.style.d.ts +2 -0
  146. package/types/src/components/list-item/list-item.d.ts +62 -0
  147. package/types/src/components/list-item/list-item.define.d.ts +1 -0
  148. package/types/src/components/list-item/list-item.style.d.ts +2 -0
  149. package/types/src/components/menu/menu.d.ts +266 -0
  150. package/types/src/components/menu/menu.define.d.ts +1 -0
  151. package/types/src/components/menu/menu.events.d.ts +6 -0
  152. package/types/src/components/menu/menu.style.d.ts +2 -0
  153. package/types/src/components/menu-group/menu-group.d.ts +24 -0
  154. package/types/src/components/menu-group/menu-group.define.d.ts +1 -0
  155. package/types/src/components/menu-group/menu-group.style.d.ts +2 -0
  156. package/types/src/components/menu-item/menu-item.d.ts +59 -0
  157. package/types/src/components/menu-item/menu-item.define.d.ts +1 -0
  158. package/types/src/components/menu-item/menu-item.style.d.ts +2 -0
  159. package/types/src/components/nav/nav.d.ts +103 -0
  160. package/types/src/components/nav/nav.define.d.ts +1 -0
  161. package/types/src/components/nav/nav.style.d.ts +2 -0
  162. package/types/src/components/nav-item/nav-item.d.ts +39 -0
  163. package/types/src/components/nav-item/nav-item.define.d.ts +1 -0
  164. package/types/src/components/nav-item/nav-item.style.d.ts +2 -0
  165. package/types/src/components/pagination/pagination.d.ts +31 -2
  166. package/types/src/components/scroll-to-top/scroll-to-top.d.ts +6 -5
  167. package/types/src/components/segmented-field/segmented-field.d.ts +85 -0
  168. package/types/src/components/segmented-field/segmented-field.define.d.ts +1 -0
  169. package/types/src/components/segmented-field/segmented-field.style.d.ts +2 -0
  170. package/types/src/components/splitter/splitter.d.ts +127 -0
  171. package/types/src/components/splitter/splitter.define.d.ts +1 -0
  172. package/types/src/components/splitter/splitter.events.d.ts +5 -0
  173. package/types/src/components/splitter/splitter.style.d.ts +2 -0
  174. package/types/src/components/status-bar/status-bar.d.ts +44 -0
  175. package/types/src/components/status-bar/status-bar.define.d.ts +1 -0
  176. package/types/src/components/status-bar/status-bar.style.d.ts +2 -0
  177. package/types/src/components/tab-group/tab-group.d.ts +17 -0
  178. package/types/src/components/toolbar/toolbar.d.ts +96 -0
  179. package/types/src/components/toolbar/toolbar.define.d.ts +1 -0
  180. package/types/src/components/toolbar/toolbar.style.d.ts +2 -0
  181. package/types/src/components/tooltip/tooltip.d.ts +26 -0
  182. package/types/src/components/tree/tree.d.ts +62 -0
  183. package/types/src/components/tree/tree.define.d.ts +1 -0
  184. package/types/src/components/tree/tree.style.d.ts +2 -0
  185. package/types/src/components/tree-item/tree-item.d.ts +106 -0
  186. package/types/src/components/tree-item/tree-item.define.d.ts +1 -0
  187. package/types/src/components/tree-item/tree-item.events.d.ts +4 -0
  188. package/types/src/components/tree-item/tree-item.style.d.ts +2 -0
  189. package/types/src/styles/appearance.style.d.ts +31 -0
  190. package/types/src/styles/choice-group.style.d.ts +1 -1
  191. package/types/src/styles/modal.style.d.ts +5 -0
  192. package/types/src/styles/size.style.d.ts +24 -0
  193. package/types/src/utils/focus.d.ts +25 -0
  194. package/types/src/utils/scroll.d.ts +11 -0
  195. package/web-types.json +2530 -393
@@ -1,5 +1,6 @@
1
1
  import { TemplateElement, defineElement, html, classMap, spreadAttributes } from '@webtides/element-js';
2
2
  import style from './button.style.js';
3
+ import Events from './button.events.js';
3
4
 
4
5
  /**
5
6
  * The ARIA attributes of the element that its control takes over. The control is what has the
@@ -54,8 +55,18 @@ const SUBMITTER_ATTRIBUTES = ['form', 'formaction', 'formenctype', 'formmethod',
54
55
  * what they do on a native button. A `click` listener of the page that calls `preventDefault()`
55
56
  * keeps the button from submitting or resetting.
56
57
  *
58
+ * In a container that gives its controls a size and an appearance, an `el-toolbar`, the button
59
+ * takes them from it, while the page has not set `size` or `appearance` on the button itself.
60
+ *
61
+ * With `toggle` the button stays pressed: a click flips `pressed`, the control says so to assistive
62
+ * technology (`aria-pressed`), and the button shows it. A `click` listener of the page that calls
63
+ * `preventDefault()` keeps the button from flipping, as it keeps it from submitting.
64
+ *
57
65
  * @element el-button
58
66
  *
67
+ * @fires {CustomEvent<{ pressed: boolean }>} button-toggle - Fired when a click has flipped a
68
+ * toggle button. `detail.pressed` is the new state. Not fired when `pressed` is set from a script.
69
+ *
59
70
  * @slot - The button's label.
60
71
  * @slot prefix - A presentational prefix icon or similar element.
61
72
  * @slot suffix - A presentational suffix icon or similar element.
@@ -80,6 +91,10 @@ const SUBMITTER_ATTRIBUTES = ['form', 'formaction', 'formenctype', 'formmethod',
80
91
  * @property {boolean} loading - Shows a spinner and blocks interaction.
81
92
  * @property {boolean} disabled - Disables the button. Reflected to the `disabled` attribute, which is
82
93
  * there while the button is disabled and gone while it is not.
94
+ * @property {boolean} toggle - The button is a toggle button: it stays pressed. A click flips
95
+ * `pressed`, and the control has `aria-pressed`. Ignored when `href` is set. Default `false`.
96
+ * @property {boolean} pressed - Whether a toggle button is pressed. Reflected to the `pressed`
97
+ * attribute of a toggle button. Without `toggle` it does nothing. Default `false`.
83
98
  * @property {'button'|'submit'|'reset'} type - Behaviour when activated. `submit` / `reset` act on
84
99
  * the form of the button: the nearest ancestor `<form>`, or the one its `form` attribute names.
85
100
  * Ignored when `href` is set. Default `'button'`.
@@ -99,7 +114,14 @@ export default class Button extends TemplateElement {
99
114
  static formAssociated = true;
100
115
 
101
116
  static get observedAttributes() {
102
- return [...ARIA_ATTRIBUTES, ...Object.keys(ARIA_RELATIONS), ...SUBMITTER_ATTRIBUTES, 'disabled'];
117
+ return [
118
+ ...ARIA_ATTRIBUTES,
119
+ ...Object.keys(ARIA_RELATIONS),
120
+ ...SUBMITTER_ATTRIBUTES,
121
+ 'disabled',
122
+ 'size',
123
+ 'appearance',
124
+ ];
103
125
  }
104
126
 
105
127
  /**
@@ -116,6 +138,19 @@ export default class Button extends TemplateElement {
116
138
  */
117
139
  _keydownRoot = undefined;
118
140
 
141
+ /**
142
+ * Which of `size` and `appearance` the page has set on the button itself, see `_isOwn()`.
143
+ * @private
144
+ * @type {Set<string> | undefined}
145
+ */
146
+ _ownLook = undefined;
147
+
148
+ /**
149
+ * Whether the button is writing a property to its attribute right now, see `reflectProperty()`.
150
+ * @private
151
+ */
152
+ _reflecting = false;
153
+
119
154
  constructor() {
120
155
  super({
121
156
  styles: [style],
@@ -130,6 +165,8 @@ export default class Button extends TemplateElement {
130
165
  size: { reflect: true },
131
166
  // For the platform the attribute is what disables the element, see `reflectProperty()`.
132
167
  disabled: { reflect: true },
168
+ // The attribute of a toggle button says whether it is pressed, see `reflectProperty()`.
169
+ pressed: { reflect: true },
133
170
  // What a form submits is text. element-js parses every attribute, so that text which
134
171
  // reads as a number arrives as one: "1.50" as 1.5.
135
172
  name: { parse: false },
@@ -148,6 +185,8 @@ export default class Button extends TemplateElement {
148
185
  caret: false,
149
186
  loading: false,
150
187
  disabled: false,
188
+ toggle: false,
189
+ pressed: false,
151
190
  type: 'button',
152
191
  name: '',
153
192
  value: '',
@@ -158,11 +197,58 @@ export default class Button extends TemplateElement {
158
197
  };
159
198
  }
160
199
 
200
+ connectedCallback() {
201
+ // Before element-js writes the defaults onto the element: after that, every button has a
202
+ // `size` and an `appearance` attribute, and nothing says who wrote them. A framework may
203
+ // have set them as properties before the element was connected.
204
+ this._ownLook ??= new Set(
205
+ ['size', 'appearance'].filter((name) => this.hasAttribute(name) || Object.hasOwn(this, name)),
206
+ );
207
+ super.connectedCallback();
208
+ }
209
+
210
+ /**
211
+ * Whether the page has given the button a `size` or an `appearance` of its own. A button
212
+ * without one takes it from a container that gives one to its controls, a toolbar. The
213
+ * template marks the control with the answer, and the stylesheet reads the mark.
214
+ *
215
+ * On the server no attribute has been written by the element: the ones that are there are
216
+ * the ones of the page.
217
+ * @private
218
+ * @param {'size' | 'appearance'} name
219
+ * @returns {boolean}
220
+ */
221
+ _isOwn(name) {
222
+ if (!this._ownLook) return !!this.hasAttribute?.(name);
223
+ // A value that is not the default was set by someone: the watcher has not run yet when the
224
+ // button renders with a value it has just got from a script.
225
+ return this._ownLook.has(name) || this[name] !== this.properties()[name];
226
+ }
227
+
161
228
  /** Whether the button renders as a link rather than a native button. */
162
229
  get isLink() {
163
230
  return !!this.href;
164
231
  }
165
232
 
233
+ /**
234
+ * Whether the button is a toggle button: one that stays pressed. A link leads somewhere, it
235
+ * has no state to stay in.
236
+ */
237
+ get isToggle() {
238
+ return !!this.toggle && !this.isLink;
239
+ }
240
+
241
+ watch() {
242
+ return {
243
+ // A button that becomes a toggle gets the attribute of its state.
244
+ toggle: () => this.reflectProperty({ property: 'pressed', newValue: this.pressed }),
245
+ // A size or an appearance that is set later, as an attribute or from a script, is the
246
+ // button's own from then on.
247
+ size: () => this._ownLook?.add('size'),
248
+ appearance: () => this._ownLook?.add('appearance'),
249
+ };
250
+ }
251
+
166
252
  /**
167
253
  * An ARIA attribute of the element, or one it shares with a native submit button, was set,
168
254
  * changed or removed. They are no properties of the component: the template and the submit
@@ -179,6 +265,16 @@ export default class Button extends TemplateElement {
179
265
  if (newValue === 'false' || newValue === '') this.removeAttribute('disabled');
180
266
  return;
181
267
  }
268
+ if (name === 'size' || name === 'appearance') {
269
+ // The page has written the attribute, after the button was connected: the size or the
270
+ // appearance is the button's own from now on, also when it is the default. The button
271
+ // writes the two itself as well, which says nothing.
272
+ if (this._ownLook && !this._reflecting && newValue !== null && !this._ownLook.has(name)) {
273
+ this._ownLook.add(name);
274
+ if (this.$refs?.control) this.requestUpdate();
275
+ }
276
+ return;
277
+ }
182
278
  if (oldValue !== newValue && this.$refs?.control) this.requestUpdate();
183
279
  }
184
280
 
@@ -196,8 +292,18 @@ export default class Button extends TemplateElement {
196
292
  * @param {{ property: string, newValue: unknown }} options
197
293
  */
198
294
  reflectProperty(options) {
295
+ if (options.property === 'pressed') {
296
+ this._reflectPressed(options.newValue);
297
+ return;
298
+ }
199
299
  if (options.property !== 'disabled') {
200
- super.reflectProperty(options);
300
+ // `attributeChangedCallback()` runs before `setAttribute()` returns.
301
+ this._reflecting = true;
302
+ try {
303
+ super.reflectProperty(options);
304
+ } finally {
305
+ this._reflecting = false;
306
+ }
201
307
  return;
202
308
  }
203
309
  if (!options.newValue) this.removeAttribute('disabled');
@@ -206,6 +312,24 @@ export default class Button extends TemplateElement {
206
312
  if (options.newValue === null) this.disabled = false;
207
313
  }
208
314
 
315
+ /**
316
+ * `pressed` is the attribute of a toggle button: `"true"` or `"false"`, so that the page can
317
+ * read the state and select by it. On a button that is no toggle the attribute says nothing,
318
+ * and the element does not write it there.
319
+ * @private
320
+ * @param {unknown} pressed
321
+ */
322
+ _reflectPressed(pressed) {
323
+ // element-js reads an attribute that is gone as `null`. The property stays a boolean.
324
+ if (pressed === null || pressed === undefined || pressed === '') {
325
+ this.pressed = false;
326
+ return;
327
+ }
328
+ if (!this.isToggle) return;
329
+ const text = pressed ? 'true' : 'false';
330
+ if (this.getAttribute('pressed') !== text) this.setAttribute('pressed', text);
331
+ }
332
+
209
333
  afterUpdate() {
210
334
  this._syncAriaRelations();
211
335
  this._syncSubmitter();
@@ -270,6 +394,14 @@ export default class Button extends TemplateElement {
270
394
  return;
271
395
  }
272
396
  if (this.isLink) return;
397
+ // A toggle flips once the page has had the click, and not when a listener has
398
+ // prevented it: as a native checkbox takes its check mark back then.
399
+ if (this.isToggle) {
400
+ this._afterListeners(event, () => {
401
+ this.pressed = !this.pressed;
402
+ this.dispatch(Events.TOGGLE, { pressed: this.pressed });
403
+ });
404
+ }
273
405
  // The control is in the shadow root, where it has no form. A submit goes through
274
406
  // the native submit button of the element, a reset to the form of the element.
275
407
  // Both are taken here, while the button is not disabled, and act once the page
@@ -391,7 +523,13 @@ export default class Button extends TemplateElement {
391
523
  * @returns {Object<string, string | undefined>}
392
524
  */
393
525
  _ariaAttributes() {
394
- return Object.fromEntries(ARIA_ATTRIBUTES.map((name) => [name, this.getAttribute(name) || undefined]));
526
+ const attributes = Object.fromEntries(
527
+ ARIA_ATTRIBUTES.map((name) => [name, this.getAttribute(name) || undefined]),
528
+ );
529
+ // The state of a toggle button is its own. Without `toggle` the `aria-pressed` of the page
530
+ // goes through as it is, and a button that has neither has no `aria-pressed`.
531
+ if (this.isToggle) attributes['aria-pressed'] = this.pressed ? 'true' : 'false';
532
+ return attributes;
395
533
  }
396
534
 
397
535
  /**
@@ -432,6 +570,8 @@ export default class Button extends TemplateElement {
432
570
  'button--circle': !!this.circle,
433
571
  'button--loading': !!this.loading,
434
572
  'button--caret': !!this.caret,
573
+ 'button--inherit-size': !this._isOwn('size'),
574
+ 'button--inherit-appearance': !this._isOwn('appearance'),
435
575
  };
436
576
  const disabled = this._isDisabled();
437
577
 
@@ -481,3 +621,5 @@ export default class Button extends TemplateElement {
481
621
  export function define() {
482
622
  defineElement('el-button', Button);
483
623
  }
624
+
625
+ export { Events };
@@ -51,6 +51,8 @@ import '@webtides/element-library/button/define';
51
51
  | `caret` | `boolean` | `false` | Appends a dropdown caret after the label. |
52
52
  | `loading` | `boolean` | `false` | Shows a spinner and blocks interaction. |
53
53
  | `disabled` | `boolean` | `false` | Disables the button. Reflected: the attribute is there while the button is disabled, see [In a form](#in-a-form). |
54
+ | `toggle` | `boolean` | `false` | The button is a toggle button: a click flips `pressed`, see [A toggle button](#a-toggle-button). Button-only. |
55
+ | `pressed` | `boolean` | `false` | Whether a toggle button is pressed. Reflected on a toggle button (`pressed="true"` / `"false"`). Without `toggle` it does nothing. |
54
56
  | `type` | `string` | `'button'` | `button`, `submit` or `reset`. `submit` / `reset` act on the form of the button, see [In a form](#in-a-form). Button-only. |
55
57
  | `name` | `string` | `''` | Name submitted with the form, when the form is submitted with this button. Button-only. |
56
58
  | `value` | `string` | `''` | Value submitted under that name. Button-only. |
@@ -71,7 +73,11 @@ The attributes `form`, `formaction`, `formenctype`, `formmethod`, `formnovalidat
71
73
 
72
74
  #### Events
73
75
 
74
- _None custom — native `click`, `focus` and `blur` behave as usual._
76
+ | Name | Detail | Description |
77
+ | --- | --- | --- |
78
+ | `button-toggle` | `{ pressed: boolean }` | Fired when a click has flipped a toggle button. `detail.pressed` is the new state. Not fired when `pressed` is set from a script. |
79
+
80
+ Native `click`, `focus` and `blur` behave as usual.
75
81
 
76
82
  #### Slots
77
83
 
@@ -122,6 +128,68 @@ The three properties are independent of each other, and every combination works.
122
128
 
123
129
  The `hidden` attribute hides the button.
124
130
 
131
+ ## In a toolbar
132
+
133
+ An [`el-toolbar`](../toolbar/toolbar.readme.md) gives its controls one size and one appearance. A button takes them from the toolbar while the page has not set `size` or `appearance` on the button itself:
134
+
135
+ ```html
136
+ <el-toolbar label="Message" size="small" appearance="outlined">
137
+ <el-button>Reply</el-button>
138
+ <!-- small, outlined -->
139
+ <el-button size="large">Archive</el-button>
140
+ <!-- large, outlined -->
141
+ <el-button variant="brand" appearance="filled">Send</el-button>
142
+ <!-- small, filled -->
143
+ </el-toolbar>
144
+ ```
145
+
146
+ - A button that names its own keeps it, also when that is the default: `appearance="filled"`, `size="medium"`. It counts as named when the page wrote the attribute, when a script set the property before the button was connected, or when either changes later.
147
+ - The toolbar does not write to the button. It says its size and its appearance in CSS properties that are inherited, and the button reads them in its stylesheet. The `size` and `appearance` attributes of the button keep their own values, `medium` and `filled` for a button that names none.
148
+ - It works at any depth: for a button in an `el-button-group` of the toolbar, and for the anchor of an `el-popover`.
149
+ - Outside of a toolbar nothing changes.
150
+
151
+ ## In the frame of an application
152
+
153
+ A button with `data-navigation-toggle` opens the navigation of an [`el-app-frame`](../app-frame/app-frame.readme.md) where the frame is narrow and the navigation is a drawer. Where the navigation is a column beside the content, there is nothing to open, and the button is not there. The frame says so in a CSS property that is inherited, and the button reads it in its own stylesheet: that holds before any script has run. Outside of a frame the attribute changes nothing.
154
+
155
+ ```html
156
+ <el-button data-navigation-toggle circle="true" aria-label="Navigation"><svg aria-hidden="true">…</svg></el-button>
157
+ ```
158
+
159
+ In an [`el-status-bar`](../status-bar/status-bar.readme.md) a button is as high as the bar and plain, and has its small text. Its focus ring is inside of it there: around the button there is the edge of the bar, and under the bar the edge of the screen. The bar says all of that in CSS properties that are inherited.
160
+
161
+ ## A toggle button
162
+
163
+ With `toggle` the button stays pressed: "Bold" in the toolbar of an editor, "Mute", a filter above a list, the star of a favourite.
164
+
165
+ ```html
166
+ <el-button toggle="true" appearance="outlined">Bold</el-button>
167
+ <el-button toggle="true" pressed="true" appearance="outlined">Italic</el-button>
168
+ <el-button toggle="true" appearance="plain" circle="true" aria-label="Favourite">★</el-button>
169
+ ```
170
+
171
+ ```js
172
+ button.addEventListener('button-toggle', (event) => {
173
+ editor.bold = event.detail.pressed;
174
+ });
175
+ ```
176
+
177
+ - **The state** is `pressed`, a property and an attribute (`pressed="true"`, `pressed="false"`). A toggle button writes the attribute itself, so a stylesheet can select it: `el-button[pressed='true']`.
178
+ - **A click flips it**, and so do the Space and the Enter key. Then the button fires `button-toggle`. A `click` listener of the page that calls `preventDefault()` keeps the button from flipping. Setting `pressed` from a script changes the state and fires nothing.
179
+ - **A screen reader** announces a toggle button with its state: the control has `aria-pressed="true"` or `"false"`. A button without `toggle` has no `aria-pressed`.
180
+ - **A pressed button shows it** with a ring inside of its edge, in the colour of its label, in every variant and appearance. An `outlined` and a `plain` button get a tint of their text colour as well; a fill is not changed, the label on it would lose contrast. The ring is a shape and a border: it tells the button apart without a colour, and stays where the user forces colours, a little wider. It is the `::before` of the control (`::part(base)::before`).
181
+ - **In an `el-button-group`** a pressed button keeps its joined corners and the line to its neighbour; the ring has the corners of the button.
182
+ - **In server-rendered markup** `aria-pressed` and the ring are there before the script has run. The click needs the script.
183
+
184
+ `aria-pressed` that the page sets itself, on a button without `toggle`, goes to the control as before, and no click changes it. Such a button shows the ring as well.
185
+
186
+ #### What it is not
187
+
188
+ - **Not a value of a form.** A toggle button submits nothing. A setting that is saved with a form is an [`el-switch-field`](../switch-field/switch-field.readme.md) or an [`el-checkbox-field`](../checkbox-field/checkbox-field.readme.md).
189
+ - **Not a button whose name changes with its state.** A button that reads "Mute" and then "Unmute" says its state with its name, and is no toggle: with `aria-pressed` on top a screen reader would announce "Unmute, pressed". Give a toggle button one name that stays ("Mute"), and let the state say the rest.
190
+ - **Not one choice of several.** A toggle button knows nothing of its neighbours: in a row of them, any number can be pressed. A row of which one is chosen at a time is an [`el-segmented-field`](../segmented-field/segmented-field.readme.md).
191
+ - **Not a link.** `toggle` is ignored on a button with `href`.
192
+
125
193
  ## In a form
126
194
 
127
195
  An `el-button` of the type `submit` submits its form as a native submit button does, and one of the type `reset` resets it.
@@ -184,8 +252,7 @@ The element itself has no role. What takes the focus and what a screen reader an
184
252
  <!-- An icon button gets its name -->
185
253
  <el-button circle="true" aria-label="Add">+</el-button>
186
254
 
187
- <!-- A toggle, a button that opens something -->
188
- <el-button aria-pressed="true">Bold</el-button>
255
+ <!-- A button that opens something -->
189
256
  <el-button aria-expanded="false" aria-controls="filters">Filters</el-button>
190
257
 
191
258
  <!-- Described by a text elsewhere in the page -->
@@ -198,7 +265,8 @@ The element itself has no role. What takes the focus and what a screen reader an
198
265
  | `aria-label`, `aria-description`, `aria-expanded`, `aria-haspopup`, `aria-pressed`, `aria-current` | As the same attribute, with every change. |
199
266
  | `aria-labelledby`, `aria-describedby`, `aria-controls` | As references to the elements they name. An id does not reach out of the shadow root the control is in. |
200
267
 
201
- - The attributes stay on the element as well, where a stylesheet can select them: `el-button[aria-pressed='true']`.
268
+ - The attributes stay on the element as well, where a stylesheet can select them: `el-button[aria-expanded='true']`.
269
+ - `aria-pressed` is the state of a button that stays pressed. With [`toggle`](#a-toggle-button) the button keeps that state itself, and an `aria-pressed` of the page gives way to it.
202
270
  - An empty attribute counts as not set.
203
271
  - `aria-disabled` and `aria-busy` are not passed on. The button sets them itself, from `disabled` and `loading`.
204
272
  - The elements behind an id are looked up in the document, or in the shadow root the button is used in, when the button renders. An element that comes into the page later is found once the attribute is set again.
@@ -11,6 +11,13 @@ const style = css`
11
11
  vertical-align: middle;
12
12
  }
13
13
 
14
+ /* The button that opens the navigation of an el-app-frame is not there where the navigation
15
+ is a column beside the content. The frame says so in a property that is inherited, so this
16
+ holds before any script has run. Outside of a frame the button is as any other. */
17
+ :host([data-navigation-toggle]) {
18
+ display: var(--_el-context-navigation-toggle-display, inline-block);
19
+ }
20
+
14
21
  /* ── Base control ─────────────────────────────────────────────────────── */
15
22
 
16
23
  .button {
@@ -23,8 +30,14 @@ const style = css`
23
30
  justify-content: center;
24
31
  gap: var(--el-space-2, 0.5em);
25
32
  width: 100%;
26
- min-height: var(--_el-size-height);
27
- padding: var(--_el-size-padding-block) var(--_el-size-padding-inline);
33
+ /* The size of the button: its own, from the size module. A button in a toolbar reads the
34
+ size of the toolbar first, see "In a container" below. */
35
+ --_el-button-height: var(--_el-size-height);
36
+ --_el-button-padding-block: var(--_el-size-padding-block);
37
+ --_el-button-padding-inline: var(--_el-size-padding-inline);
38
+ --_el-button-font-size: var(--_el-size-font-size);
39
+ min-height: var(--_el-button-height);
40
+ padding: var(--_el-button-padding-block) var(--_el-button-padding-inline);
28
41
  border: var(--el-border-width, 1px) solid transparent;
29
42
  /* The radius of the shape on all four corners. A row of joined buttons (el-button-group)
30
43
  takes it away from the corners that face a neighbour, with --_el-group-radius-start
@@ -35,7 +48,7 @@ const style = css`
35
48
  border-start-end-radius: var(--_el-group-radius-end, var(--_el-button-radius));
36
49
  border-end-end-radius: var(--_el-group-radius-end, var(--_el-button-radius));
37
50
  font-family: var(--el-font-family, inherit);
38
- font-size: var(--_el-size-font-size);
51
+ font-size: var(--_el-button-font-size);
39
52
  font-weight: 600;
40
53
  line-height: var(--el-line-height, 1.5);
41
54
  text-align: center;
@@ -82,7 +95,9 @@ const style = css`
82
95
  gives it one. */
83
96
  .button:focus-visible {
84
97
  outline: var(--el-focus-ring-width, 2px) solid var(--el-color-focus-ring, transparent);
85
- outline-offset: var(--el-focus-ring-offset, 2px);
98
+ /* A container that has the edge of the screen around it, an el-status-bar, says where the
99
+ ring is: inside of the button. */
100
+ outline-offset: var(--_el-context-focus-ring-offset, var(--el-focus-ring-offset, 2px));
86
101
  }
87
102
 
88
103
  /* Without a theme the ring is inside of the control, in the colour of the label. Nothing says
@@ -124,6 +139,54 @@ const style = css`
124
139
  text-decoration: underline;
125
140
  }
126
141
 
142
+ /* ── Pressed ──────────────────────────────────────────────────────────── */
143
+
144
+ /* A toggle button that is pressed (aria-pressed, from the toggle property or from the page)
145
+ has a ring inside of its edge, in the colour of its label. The ring is a shape, so it tells
146
+ the button apart in every variant and appearance, and without a colour to rely on: it is a
147
+ border, which forced colours keep. It has the corners of the button, the joined ones of a
148
+ group as well, and leaves the border of the button alone: the line to a neighbour stays. */
149
+ .button[aria-pressed='true']::before {
150
+ content: '';
151
+ position: absolute;
152
+ inset: 0;
153
+ border: 0.125rem solid currentColor;
154
+ border-radius: inherit;
155
+ pointer-events: none;
156
+ }
157
+
158
+ /* A button without a fill gets a tint of its text colour as well, one step more than under
159
+ the pointer. A fill is not changed: the text on it would lose contrast. */
160
+ :host([appearance='outlined']) .button[aria-pressed='true'],
161
+ :host([appearance='plain']) .button[aria-pressed='true'] {
162
+ background: color-mix(in srgb, currentColor 16%, transparent);
163
+ }
164
+
165
+ @media (hover: hover) {
166
+ :host([appearance='outlined']) .button[aria-pressed='true']:hover,
167
+ :host([appearance='plain']) .button[aria-pressed='true']:hover {
168
+ background: color-mix(in srgb, currentColor 20%, transparent);
169
+ }
170
+ }
171
+
172
+ :host([appearance='outlined']) .button[aria-pressed='true']:active,
173
+ :host([appearance='plain']) .button[aria-pressed='true']:active {
174
+ background: color-mix(in srgb, currentColor 28%, transparent);
175
+ }
176
+
177
+ /* Without a theme the focus ring is inside of the control as well. It moves further in, so a
178
+ pressed button with the focus shows two rings and not one that is a little wider. */
179
+ .button[aria-pressed='true']:focus-visible::after {
180
+ inset: calc(var(--el-border-width, 1px) + 0.25rem);
181
+ }
182
+
183
+ /* Forced colours leave the ring as the only mark: it is wider there. */
184
+ @media (forced-colors: active) {
185
+ .button[aria-pressed='true']::before {
186
+ border-width: 0.1875rem;
187
+ }
188
+ }
189
+
127
190
  /* ── Shapes ───────────────────────────────────────────────────────────── */
128
191
 
129
192
  .button--pill {
@@ -132,8 +195,8 @@ const style = css`
132
195
 
133
196
  .button--circle {
134
197
  --_el-button-radius: 50%;
135
- width: var(--_el-size-height);
136
- height: var(--_el-size-height);
198
+ width: var(--_el-button-height);
199
+ height: var(--_el-button-height);
137
200
  min-height: 0;
138
201
  padding: 0;
139
202
  aspect-ratio: 1;
@@ -151,6 +214,97 @@ const style = css`
151
214
  border-inline-start-color: var(--_el-group-divider, var(--_el-variant-fill-border));
152
215
  }
153
216
 
217
+ /* ── In a container ───────────────────────────────────────────────────── */
218
+
219
+ /* A container that gives its controls one size and one appearance, a toolbar, says so in
220
+ properties that are inherited (see sizeContextStyle() and appearanceContextStyle()). A
221
+ button reads them while the page has not set the attribute on the button itself: the
222
+ template marks the control then. Outside of such a container the properties are not set,
223
+ and every value below falls back to the one the button has without them. */
224
+
225
+ .button--inherit-size {
226
+ --_el-button-height: var(--_el-context-size-height, var(--_el-size-height));
227
+ --_el-button-padding-block: var(--_el-context-size-padding-block, var(--_el-size-padding-block));
228
+ --_el-button-padding-inline: var(--_el-context-size-padding-inline, var(--_el-size-padding-inline));
229
+ --_el-button-font-size: var(--_el-context-size-font-size, var(--_el-size-font-size));
230
+ }
231
+
232
+ /* The appearance of the container is a switch that is set or not. In front of a value it gives
233
+ a property that is valid only where the switch is set. */
234
+ .button--inherit-appearance {
235
+ --_el-button-if-plain: var(--_el-context-appearance-plain) transparent;
236
+ --_el-button-if-outlined: var(--_el-context-appearance-outlined) transparent;
237
+ --_el-button-if-outlined-border: var(--_el-context-appearance-outlined) var(--_el-variant-border);
238
+ --_el-button-if-plain-text: var(--_el-context-appearance-plain) var(--_el-variant-text);
239
+ --_el-button-if-outlined-text: var(--_el-context-appearance-outlined) var(--_el-variant-text);
240
+ --_el-button-if-plain-none: var(--_el-context-appearance-plain) none;
241
+ --_el-button-if-outlined-none: var(--_el-context-appearance-outlined) none;
242
+ }
243
+
244
+ /* The three colours of the appearance module, and the line to a neighbour in a group. The
245
+ rules weigh as much as the ones for a filled button and come after them. A button whose
246
+ appearance is its own has no mark, and keeps the rules of its attribute. */
247
+ :host .button--inherit-appearance {
248
+ background: var(--_el-button-if-plain, var(--_el-button-if-outlined, var(--_el-variant-fill)));
249
+ border-color: var(--_el-button-if-plain, var(--_el-button-if-outlined-border, var(--_el-variant-fill-border)));
250
+ border-inline-start-color: var(
251
+ --_el-button-if-plain,
252
+ var(--_el-button-if-outlined-border, var(--_el-group-divider, var(--_el-variant-fill-border)))
253
+ );
254
+ color: var(--_el-button-if-plain-text, var(--_el-button-if-outlined-text, var(--_el-variant-on-fill)));
255
+ }
256
+
257
+ /* Under the pointer and pressed down: a tint of the text colour where the button has no fill,
258
+ as an outlined button has. A plain button of a toolbar gets it as well: it is an icon as a
259
+ rule, and an icon has nothing to underline. */
260
+ @media (hover: hover) {
261
+ :host .button--inherit-appearance:hover {
262
+ --_el-button-if-plain-tint: var(--_el-context-appearance-plain)
263
+ color-mix(in srgb, currentColor 12%, transparent);
264
+ --_el-button-if-outlined-tint: var(--_el-context-appearance-outlined)
265
+ color-mix(in srgb, currentColor 12%, transparent);
266
+ background: var(--_el-button-if-plain-tint, var(--_el-button-if-outlined-tint, var(--_el-variant-fill)));
267
+ filter: var(--_el-button-if-plain-none, var(--_el-button-if-outlined-none, brightness(0.95)));
268
+ }
269
+ }
270
+
271
+ :host .button--inherit-appearance:active {
272
+ --_el-button-if-plain-tint: var(--_el-context-appearance-plain)
273
+ color-mix(in srgb, currentColor 24%, transparent);
274
+ --_el-button-if-outlined-tint: var(--_el-context-appearance-outlined)
275
+ color-mix(in srgb, currentColor 24%, transparent);
276
+ background: var(--_el-button-if-plain-tint, var(--_el-button-if-outlined-tint, var(--_el-variant-fill)));
277
+ filter: var(--_el-button-if-plain-none, var(--_el-button-if-outlined-none, brightness(0.88)));
278
+ }
279
+
280
+ /* A pressed toggle button: the tint of a button without a fill, one step more than under the
281
+ pointer. */
282
+ :host .button--inherit-appearance[aria-pressed='true'] {
283
+ --_el-button-if-plain-tint: var(--_el-context-appearance-plain)
284
+ color-mix(in srgb, currentColor 16%, transparent);
285
+ --_el-button-if-outlined-tint: var(--_el-context-appearance-outlined)
286
+ color-mix(in srgb, currentColor 16%, transparent);
287
+ background: var(--_el-button-if-plain-tint, var(--_el-button-if-outlined-tint, var(--_el-variant-fill)));
288
+ }
289
+
290
+ @media (hover: hover) {
291
+ :host .button--inherit-appearance[aria-pressed='true']:hover {
292
+ --_el-button-if-plain-tint: var(--_el-context-appearance-plain)
293
+ color-mix(in srgb, currentColor 20%, transparent);
294
+ --_el-button-if-outlined-tint: var(--_el-context-appearance-outlined)
295
+ color-mix(in srgb, currentColor 20%, transparent);
296
+ background: var(--_el-button-if-plain-tint, var(--_el-button-if-outlined-tint, var(--_el-variant-fill)));
297
+ }
298
+ }
299
+
300
+ :host .button--inherit-appearance[aria-pressed='true']:active {
301
+ --_el-button-if-plain-tint: var(--_el-context-appearance-plain)
302
+ color-mix(in srgb, currentColor 28%, transparent);
303
+ --_el-button-if-outlined-tint: var(--_el-context-appearance-outlined)
304
+ color-mix(in srgb, currentColor 28%, transparent);
305
+ background: var(--_el-button-if-plain-tint, var(--_el-button-if-outlined-tint, var(--_el-variant-fill)));
306
+ }
307
+
154
308
  /* ── Touch screens ────────────────────────────────────────────────────── */
155
309
 
156
310
  /* On a coarse pointer no size or shape falls below --el-touch-target in either direction.
@@ -158,7 +312,7 @@ const style = css`
158
312
  @media (any-pointer: coarse) {
159
313
  .button {
160
314
  min-width: var(--el-touch-target, auto);
161
- min-height: max(var(--_el-size-height), var(--el-touch-target, 0px));
315
+ min-height: max(var(--_el-button-height), var(--el-touch-target, 0px));
162
316
  }
163
317
 
164
318
  /* A circle has a fixed width and height. The minimum wins over both, so it stays round. */
@@ -0,0 +1,25 @@
1
+ # Change Log
2
+
3
+ All notable changes to this component live here. Versions refer to the parent `@webtides/element-library` release (see root [`CHANGELOG.md`](../../../CHANGELOG.md)); components no longer version independently.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/).
6
+
7
+ <!--
8
+ When your PR touches this component, add an entry under Unreleased and
9
+ mirror it (prefixed with the component name) in root CHANGELOG.md.
10
+ Uncomment headings as needed.
11
+ -->
12
+
13
+ ## Unreleased
14
+
15
+ ## [0.4.0] - 2026-11-27
16
+
17
+ ### Added
18
+
19
+ - Initial `el-description-list`: rows of a name and its value, for a settings page or the page of an entry. The element is the native `<dl>` (it is inside of the shadow root), and the page writes the names as `<dt>` and the values as `<dd>` into it. ([#195](https://github.com/webtides/element-library/issues/195))
20
+ - Below 30rem of its own width a name stands above its value; from 30rem the two stand side by side, with the values of all rows on one line. The list measures itself (a container query), not the viewport.
21
+ - `--el-description-list-term-width` sets the width of the column of the names. Unset, it is as wide as the longest name, and 40% of the list at most.
22
+ - A `<dd data-action>` ends its row in an action, a link or a small button: at the end of the row, in the middle of the first line of the value. A row with a button is as high as a row without one.
23
+ - A row has `--el-space-3` above and below, and a line in `--el-color-border` above every row but the first, over the whole width. The line is not a border, so a reset of the page that takes the border off every element leaves it. Where the user forces colours it is drawn in the text colour of the system.
24
+ - A long value breaks, inside of a word where it has to: the list is never wider than its place.
25
+ - The list runs no script: a server-rendered list is laid out before the element takes over, and looks the same after.
@@ -0,0 +1,3 @@
1
+ import { define } from './description-list.js';
2
+
3
+ define();
@@ -0,0 +1,44 @@
1
+ import { TemplateElement, defineElement, html } from '@webtides/element-js';
2
+ import style from './description-list.style.js';
3
+
4
+ /**
5
+ * Rows of a name and its value, for a settings page or the page of an entry: the address, the
6
+ * plan, the day it was created. The element is the native `<dl>`; the page writes the names as
7
+ * `<dt>` and the values as `<dd>` into it, as it would into a `<dl>`.
8
+ *
9
+ * In a narrow place a name stands above its value. From a width of 30rem, which the list measures
10
+ * on itself, the two stand side by side, and the values of all rows begin on one line. A row can
11
+ * end in an action: a `<dd data-action>` with a link or a button in it.
12
+ *
13
+ * Pure presentation: the list runs no script of its own, so a server-rendered list is complete
14
+ * before the element takes over.
15
+ *
16
+ * @element el-description-list
17
+ *
18
+ * @slot - The rows: for each one a `<dt>` with the name, a `<dd>` with the value (or several),
19
+ * and, to end the row in an action, a `<dd data-action>` with a link or a button.
20
+ *
21
+ * @csspart base - The `<dl>`.
22
+ *
23
+ * @cssproperty --el-description-list-term-width - The width of the column of the names while
24
+ * names and values stand side by side. Unset, the column is as wide as the longest name, and
25
+ * 40% of the list at most.
26
+ */
27
+ export default class DescriptionList extends TemplateElement {
28
+ constructor() {
29
+ super({
30
+ styles: [style],
31
+ shadowRender: true,
32
+ });
33
+ }
34
+
35
+ template() {
36
+ // The list is inside of the shadow root, and the names and values of the page are its
37
+ // children by way of the slot: that is part of the server-rendered markup, and needs no script.
38
+ return html`<dl part="base" class="list"><slot></slot></dl>`;
39
+ }
40
+ }
41
+
42
+ export function define() {
43
+ defineElement('el-description-list', DescriptionList);
44
+ }