@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
@@ -0,0 +1,62 @@
1
+ import { TemplateElement } from '@webtides/element-js';
2
+ /**
3
+ * A tree: entries that open and close, for folders, categories and a library beside the content.
4
+ * The tree is a list; every `el-tree-item` in it is an entry, and an entry holds the entries
5
+ * below it. An entry is a link, and one with entries below it has a button that opens and closes
6
+ * them.
7
+ *
8
+ * To assistive technology it is what it is in the markup: nested lists of links, each branch with
9
+ * a button that says whether it is open. It has no `role="tree"`: the links stay links, and they
10
+ * work before the script has run. The script adds the arrow keys of a tree.
11
+ *
12
+ * @element el-tree
13
+ *
14
+ * @slot - The entries of the first level: `el-tree-item` elements.
15
+ *
16
+ * @csspart base - The list of the first level (`role="list"`).
17
+ *
18
+ * @cssproperty --el-tree-indent - How far the entries of a level stand in from the ones of the
19
+ * level above. Unset, it is `--el-space-4`, and `1rem` without a theme. Read by the entries, so
20
+ * it can be set on the tree or for the page.
21
+ *
22
+ * @property {string} label - The name of the tree for assistive technology. Unset, the tree has
23
+ * none.
24
+ */
25
+ export default class Tree extends TemplateElement {
26
+ constructor();
27
+ properties(): {
28
+ label: string;
29
+ };
30
+ events(): {
31
+ this: {
32
+ keydown: (event: any) => void;
33
+ };
34
+ };
35
+ /**
36
+ * The entries that are shown, in their order: every entry that is in no closed branch. An
37
+ * entry is asked for the control the focus goes to, see `focusTarget` of `el-tree-item`; one
38
+ * that has none (a name without a link and without entries below it) is passed.
39
+ * @private
40
+ * @returns {HTMLElement[]}
41
+ */
42
+ private _shownItems;
43
+ /**
44
+ * The entry an entry is below, or `null` for one of the first level.
45
+ * @private
46
+ * @param {Element} item
47
+ * @returns {Element | null}
48
+ */
49
+ private _parentOf;
50
+ /**
51
+ * The keys of the WAI-ARIA tree view pattern. Up and down go to the entry before and after
52
+ * among the ones that are shown, Home and End to the first and the last. Right opens a branch,
53
+ * and goes to its first entry when it is open; left closes it, and goes to the entry above
54
+ * when it is closed or has nothing below it. In a text that runs from right to left, the two
55
+ * are the other way round.
56
+ * @private
57
+ * @param {KeyboardEvent} event
58
+ */
59
+ private _onKeydown;
60
+ template(): any;
61
+ }
62
+ export declare function define(): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -0,0 +1,106 @@
1
+ import { TemplateElement } from '@webtides/element-js';
2
+ import Events from './tree-item.events.js';
3
+ /**
4
+ * One entry of an `el-tree`, and the entries below it. It has the parts of a row of a list: an
5
+ * icon at the start, its name, a count at the end. With `href` the name is a link, and the whole
6
+ * row is its target. An entry with entries below it has a button that opens and closes them; its
7
+ * state is the `open` attribute, which the page can render.
8
+ *
9
+ * The entries below it are the `el-tree-item` elements the page writes into it.
10
+ *
11
+ * @element el-tree-item
12
+ *
13
+ * @fires {CustomEvent<{ open: boolean }>} tree-item-toggle - Fired when the user has opened or
14
+ * closed the entry, with its button or with the arrow keys. `detail.open` is the new state. Not
15
+ * fired when `open` is set from a script. It bubbles: an entry further up hears it as well, so
16
+ * look at `event.target`.
17
+ *
18
+ * @slot - The entries below this one: `el-tree-item` elements.
19
+ * @slot label - The name of the entry. Takes precedence over the `label` attribute.
20
+ * @slot start - What stands in front of the name: an icon.
21
+ * @slot end - What stands at the end of the row: a count. In an entry that is a link it is part
22
+ * of the target of the link.
23
+ *
24
+ * @csspart base - The entry: an item of the list it is in.
25
+ * @csspart row - The row of the entry: its button, its start, its name and its end.
26
+ * @csspart toggle - The button that opens and closes the entries below, present only with such
27
+ * entries.
28
+ * @csspart start - The region of the `start` slot.
29
+ * @csspart label - The name: an `<a>` with `href`; without, a `<button>` that opens and closes
30
+ * the entry when it has entries below it, and a `<span>` when it has none.
31
+ * @csspart end - The region of the `end` slot.
32
+ * @csspart children - The list of the entries below (`role="list"`).
33
+ *
34
+ * @cssproperty --el-tree-indent - How far the entries below stand in from this one. Unset, it is
35
+ * `--el-space-4`, and `1rem` without a theme.
36
+ *
37
+ * @property {string} label - The name of the entry.
38
+ * @property {string} href - The address the entry leads to. Unset, the entry is no link.
39
+ * @property {string} target - Where to open the address (only with `href`).
40
+ * @property {string} rel - `rel` attribute for the link, written when `target` is set. Default
41
+ * `'noreferrer noopener'`.
42
+ * @property {boolean} current - The entry is the one of the page the user is on: it gets
43
+ * `aria-current="page"` (`"true"` without `href`), a bar at its start and a heavier name.
44
+ * Default `false`.
45
+ * @property {boolean} open - Whether the entries below this one are shown. Reflected to the
46
+ * `open` attribute, which the stylesheet reads: an entry without `open="true"` is closed, before
47
+ * the element starts as well. Default `false`.
48
+ */
49
+ export default class TreeItem extends TemplateElement {
50
+ open: boolean;
51
+ constructor();
52
+ properties(): {
53
+ label: string;
54
+ href: string;
55
+ target: string;
56
+ rel: string;
57
+ current: boolean;
58
+ open: boolean;
59
+ };
60
+ events(): {
61
+ '[data-toggle]': {
62
+ click: () => void;
63
+ };
64
+ "[part~='base']": {
65
+ slotchange: () => any;
66
+ };
67
+ };
68
+ /**
69
+ * Whether the entry has entries below it. The children of the host are asked, not the slot:
70
+ * a template is rendered on a server too, where there are no slots to ask.
71
+ * @returns {boolean}
72
+ */
73
+ get hasItems(): boolean;
74
+ /**
75
+ * The control of the entry that the focus goes to: its link, or the button its name is when it
76
+ * has entries below it and no address. `null` for a name alone.
77
+ * @returns {HTMLElement | null}
78
+ */
79
+ get focusTarget(): HTMLElement | null;
80
+ /**
81
+ * Opens or closes the entry, as its button does, and says so with `tree-item-toggle`. An entry
82
+ * without entries below it stays as it is.
83
+ * @param {boolean} [open] - The state to go to. Left out, the entry goes to the other one.
84
+ * @returns {void}
85
+ */
86
+ toggle(open?: boolean): void;
87
+ /** @private */
88
+ private labelContent;
89
+ /**
90
+ * The name of the entry, and what it is: a link, the button of a branch that leads nowhere, or
91
+ * a text.
92
+ * @private
93
+ */
94
+ private labelTemplate;
95
+ /**
96
+ * The button that opens and closes the entries below: for an entry that is a link, which
97
+ * cannot do both. It is named by the name of the entry, and says whether the entry is open.
98
+ * @private
99
+ */
100
+ private toggleTemplate;
101
+ /** @private */
102
+ private chevronTemplate;
103
+ template(): any;
104
+ }
105
+ export declare function define(): void;
106
+ export { Events };
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ TOGGLE: string;
3
+ };
4
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: string;
2
+ export default _default;
@@ -16,3 +16,34 @@
16
16
  * @returns {string}
17
17
  */
18
18
  export default function appearanceStyle(surface: string, host?: string): string;
19
+ /**
20
+ * The appearance a container gives to the controls inside of it: a toolbar with
21
+ * `appearance="plain"` has plain buttons. The container declares `appearance` as a reflected
22
+ * property and composes this module; it sets one of two properties on the host, which are
23
+ * inherited at any depth and into shadow roots:
24
+ *
25
+ * - `--_el-context-appearance-outlined`
26
+ * - `--_el-context-appearance-plain`
27
+ *
28
+ * Each is a switch: it is set to nothing, or it is not set. A stylesheet cannot ask for the value
29
+ * of a property, so the control puts the switch in front of a value in a property of its own,
30
+ * which is valid only where the switch is set, and falls back from one to the next:
31
+ *
32
+ * --_el-button-if-plain: var(--_el-context-appearance-plain) transparent;
33
+ * background: var(--_el-button-if-plain, var(--_el-variant-fill));
34
+ *
35
+ * Outside of a container none of the switches is set, and the control paints what it painted
36
+ * before, with the same values. As with the size, the control only does so while the page has not
37
+ * given it an appearance of its own, and marks that from its template.
38
+ *
39
+ * `filled` sets nothing: it is the appearance a control has anyway.
40
+ *
41
+ * The appearance a container has without the attribute is given as `byDefault`. The rule for it
42
+ * selects a host that has no `appearance` attribute as well: element-js writes the default onto
43
+ * the element when it starts, and in server-rendered markup it is not there yet.
44
+ * @param {string} [host] - `':host'` (the default), or the tag of a component without a shadow root.
45
+ * @param {'filled'|'outlined'|'plain'} [byDefault] - The appearance of a container without the
46
+ * attribute. Default `'filled'`.
47
+ * @returns {string}
48
+ */
49
+ export declare function appearanceContextStyle(host?: string, byDefault?: 'filled' | 'outlined' | 'plain'): string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A group of choices in a field: a fieldset with a legend that holds the options, each of them a
3
3
  * label around a native radio or checkbox (`el-radio-field`, `el-checkbox-group-field`,
4
- * `el-rating-field`).
4
+ * `el-rating-field`, `el-segmented-field`).
5
5
  *
6
6
  * - The fieldset is the column of the field. It loses the border and the padding of the browser
7
7
  * and stacks the legend, the help message, the options and the error message: all of them are
@@ -13,6 +13,11 @@
13
13
  * are different properties from the ones set here, so the order of the two stylesheets does not
14
14
  * decide anything.
15
15
  *
16
+ * A surface that reaches an edge of the screen keeps what is in it clear of the notch and the home
17
+ * indicator of a phone: the component says how much room each side needs
18
+ * (`--_el-modal-inset-block-start`, `-block-end`, `-inline-start`, `-inline-end`), and that room
19
+ * is the padding of the surface here.
20
+ *
16
21
  * The module takes no host: a dialog with slots needs a shadow root, and the host of one is
17
22
  * `:host`.
18
23
  * @returns {string}
@@ -18,3 +18,27 @@
18
18
  * @returns {string}
19
19
  */
20
20
  export default function sizeStyle(host?: string): string;
21
+ /**
22
+ * The size a container gives to the controls inside of it: a toolbar with `size="small"` has small
23
+ * controls. The container declares `size` as a reflected property and composes this module; it
24
+ * sets properties on the host that are inherited, at any depth and into shadow roots:
25
+ *
26
+ * - `--_el-context-size-height`, `--_el-context-size-padding-block`,
27
+ * `--_el-context-size-padding-inline`, `--_el-context-size-font-size`
28
+ *
29
+ * They are what `sizeStyle()` resolves a size to, under other names: a control declares the
30
+ * `--_el-size-` properties on its own host, so an inherited value of the same name would never
31
+ * reach it. A control that takes its size from a container reads the context first and its own
32
+ * size after it, on the element that it paints:
33
+ *
34
+ * min-height: var(--_el-context-size-height, var(--_el-size-height));
35
+ *
36
+ * It does so only while the page has not given it a size of its own. The stylesheet cannot ask
37
+ * that: element-js writes the default onto the element. So the control marks the element it paints
38
+ * from its template (`button--inherit-size` of `el-button`).
39
+ *
40
+ * `medium` sets nothing: it is the size a control has anyway.
41
+ * @param {string} [host] - `':host'` (the default), or the tag of a component without a shadow root.
42
+ * @returns {string}
43
+ */
44
+ export declare function sizeContextStyle(host?: string): string;
@@ -14,3 +14,28 @@
14
14
  * @returns {boolean}
15
15
  */
16
16
  export declare function focusLeft(group: Element, event: FocusEvent): boolean;
17
+ /**
18
+ * The element that has the focus, also when it is inside of a shadow root: `document.activeElement`
19
+ * stops at the element whose shadow root the focus is in.
20
+ * @returns {Element | null}
21
+ */
22
+ export declare function activeElement(): Element | null;
23
+ /**
24
+ * The elements inside of `root` that the user can move the focus to, in the order of the document:
25
+ * the controls of the page, and the ones inside of the shadow roots of custom elements, the
26
+ * `<button>` of an `el-button` for example. Left out are controls that are disabled, inert, not
27
+ * shown or taken out of the tab order (`tabindex="-1"`).
28
+ *
29
+ * Each radio of a group is one of them, also the ones that are not checked: the Tab key stops at
30
+ * a group once, the arrow keys of a toolbar at every radio.
31
+ * @param {Element} root
32
+ * @returns {HTMLElement[]}
33
+ */
34
+ export declare function focusableElements(root: Element): HTMLElement[];
35
+ /**
36
+ * Whether the user can move the focus to `root` or to an element inside of it, the ones in shadow
37
+ * roots included. It stops at the first one it finds, which `focusableElements()` does not.
38
+ * @param {Element} root
39
+ * @returns {boolean}
40
+ */
41
+ export declare function containsFocusable(root: Element): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The element that scrolls what an element is in, up and down: the nearest one around it that has
3
+ * more content than height and an overflow that scrolls. `null` where that is the document, which
4
+ * the window scrolls.
5
+ *
6
+ * The way up goes through slots and out of shadow roots: an element in the content of an
7
+ * `el-app-frame` is scrolled by a region in the shadow root of the frame.
8
+ * @param {Element} element
9
+ * @returns {HTMLElement | null}
10
+ */
11
+ export declare function scrollContainer(element: Element): HTMLElement | null;