inclusive-elements 0.6.0 → 0.7.0-beta.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.0-beta.1](https://github.com/tobyzerner/inclusive-elements/compare/v0.6.1...v0.7.0-beta.1) (2026-08-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * add combobox and migrate to Vite Plus ([a125405](https://github.com/tobyzerner/inclusive-elements/commit/a1254058569c252625b5b5f1269b1cc6cc4a8143))
9
+
10
+ ### [0.6.1](https://github.com/tobyzerner/inclusive-elements/compare/v0.6.0...v0.6.1) (2026-03-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **demo:** hide reactions menu ([df0afa8](https://github.com/tobyzerner/inclusive-elements/commit/df0afa896688cf342f7c3d7808296f881aaaa1a7))
16
+ * **menu:** return focus to root trigger on Escape and Tab ([9c9b28a](https://github.com/tobyzerner/inclusive-elements/commit/9c9b28ae181f42efd76abc10809ac1f4a7a6c9e6))
17
+ * **tabs:** prevent attribute observer loop ([48e2043](https://github.com/tobyzerner/inclusive-elements/commit/48e2043350267b3fc7aa7b649b235d74d25cbc07))
18
+
3
19
  ## [0.6.0](https://github.com/tobyzerner/inclusive-elements/compare/v0.5.5...v0.6.0) (2026-03-23)
4
20
 
5
21
  ### Overview
@@ -355,4 +371,4 @@ The runtime surface is now centered on `ui-alerts`, `ui-menu`, `ui-tabs`, `ui-to
355
371
  [0.1.0-beta.5]: https://github.com/tobyzerner/inclusive-elements/compare/v0.1.0-beta.4...v0.1.0-beta.5
356
372
  [0.1.0-beta.4]: https://github.com/tobyzerner/inclusive-elements/compare/v0.1.0-beta.3...v0.1.0-beta.4
357
373
  [0.1.0-beta.3]: https://github.com/tobyzerner/inclusive-elements/compare/v0.1.0-beta.2...v0.1.0-beta.3
358
- [0.1.0-beta.2]: https://github.com/tobyzerner/inclusive-elements/compare/v0.1.0-beta.1...v0.1.0-beta.2
374
+ [0.1.0-beta.2]: https://github.com/tobyzerner/inclusive-elements/compare/v0.1.0-beta.1...v0.1.0-beta.2
package/README.md CHANGED
@@ -6,36 +6,41 @@
6
6
 
7
7
  `inclusive-elements` is a set of documented patterns and lightweight supporting elements for implementing common interface patterns.
8
8
 
9
- - **🦮 Accessible.** Built around native semantics and established inclusive interaction patterns.
10
- - **🌳 Lightweight.** Prefer the platform first, and only add JS where it meaningfully helps.
11
- - **🎨 Unstyled.** Bring your own design without fighting defaults.
12
- - **🚀 Easy to use.** Straightforward markup, small APIs, and designed for modern browsers with the platform features each pattern depends on.
9
+ - **🦮 Accessible.** Built around native semantics and established inclusive interaction patterns.
10
+ - **🌳 Lightweight.** Prefer the platform first, and only add JS where it meaningfully helps.
11
+ - **🎨 Unstyled.** Bring your own design without fighting defaults.
12
+ - **🚀 Easy to use.** Straightforward markup, small APIs, and designed for modern browsers with the platform features each pattern depends on.
13
13
 
14
14
  Each pattern in this library starts from the same question: what is the simplest, most inclusive way to build this on the platform today? Sometimes the answer is fully native HTML. Sometimes it is native HTML plus a small supporting custom element. The docs and demo are organized around patterns so you can start with the UI you need and immediately see the recommended implementation path.
15
15
 
16
16
  Runtime elements are only shipped for the patterns that still need behavior the platform does not provide directly:
17
- `ui-alerts`, `ui-menu`, `ui-tabs`, `ui-toolbar`, and `ui-tooltip`.
17
+ `ui-alerts`, `ui-combobox`, `ui-menu`, `ui-tabs`, `ui-toolbar`, and `ui-tooltip`.
18
18
  The other pattern docs are native-first guidance, including the accessibility work authors still need to do in their own markup.
19
19
 
20
20
  ## Installation
21
21
 
22
22
  ```sh
23
- npm install inclusive-elements
23
+ npm install inclusive-elements --save
24
24
  ```
25
25
 
26
- Patterns in this package rely on modern browser features such as the Popover API, hint popovers, CSS anchor positioning, `<details name>`, and `<dialog>`.
27
-
28
26
  ## Patterns
29
27
 
30
- - [Accordion](src/accordion/README.md): native `<details name>` for grouped disclosure sections.
31
- - [Alerts](src/alerts/README.md): `<ui-alerts>` for polite or assertive announcements, timed dismissal, and animated stacking.
32
- - [Disclosure](src/disclosure/README.md): native `<details>` and `<summary>`.
33
- - [Menu](src/menu/README.md): native `popover` for the surface, plus `<ui-menu>` for keyboard navigation, typeahead, and submenu coordination.
34
- - [Dialog](src/dialog/README.md): native `<dialog>` for modality and focus handling.
35
- - [Popover](src/popover/README.md): native `popover` plus CSS anchor positioning.
36
- - [Tabs](src/tabs/README.md): `<ui-tabs>` for button-based tab selection and panel visibility.
37
- - [Toolbar](src/toolbar/README.md): `<ui-toolbar>` for arrow-key focus management.
38
- - [Tooltip](src/tooltip/README.md): native hint popovers, plus `<ui-tooltip>` for owner resolution and interaction behavior.
28
+ - [Accordion](src/accordion/README.md): native `<details name>` for grouped disclosure sections.
29
+ - [Alerts](src/alerts/README.md): `<ui-alerts>` for polite or assertive announcements, timed dismissal, and animated stacking.
30
+ - [Combobox](src/combobox/README.md): `<ui-combobox>` for progressively enhancing `<select>`, `<select multiple>`, and text-like `<input list>` controls.
31
+ - [Disclosure](src/disclosure/README.md): native `<details>` and `<summary>`.
32
+ - [Menu](src/menu/README.md): native `popover` for the surface, plus `<ui-menu>` for keyboard navigation, typeahead, and submenu coordination.
33
+ - [Dialog](src/dialog/README.md): native `<dialog>` for modality and focus handling.
34
+ - [Popover](src/popover/README.md): native `popover` plus CSS anchor positioning.
35
+ - [Tabs](src/tabs/README.md): `<ui-tabs>` for button-based tab selection and panel visibility.
36
+ - [Toolbar](src/toolbar/README.md): `<ui-toolbar>` for arrow-key focus management.
37
+ - [Tooltip](src/tooltip/README.md): native hint popovers, plus `<ui-tooltip>` for owner resolution and interaction behavior.
38
+
39
+ ## Browser Support
40
+
41
+ As of August 2026, full support across all patterns requires Chrome or Edge 151+, or Firefox 153+. This covers custom elements, the Popover API (including hint popovers), CSS anchor positioning, `<details name>`, and `<dialog>`.
42
+
43
+ Safari 26 supports everything except hint popovers. Tooltips still work through JavaScript, but without native hint-popover stacking. The library is safe to adopt if you target the latest evergreen browsers and can accept this Safari limitation; otherwise, review support pattern by pattern or provide fallbacks.
39
44
 
40
45
  ## Contributing
41
46
 
@@ -0,0 +1,230 @@
1
+ //#region src/alerts/alerts.d.ts
2
+ type AlertPoliteness = 'polite' | 'assertive';
3
+ type AlertOptions = {
4
+ key?: string;
5
+ duration?: number;
6
+ politeness?: AlertPoliteness;
7
+ };
8
+ declare class AlertsElement extends HTMLElement {
9
+ static duration: number;
10
+ static politeness: AlertPoliteness;
11
+ private timeouts;
12
+ private index;
13
+ connectedCallback(): void;
14
+ disconnectedCallback(): void;
15
+ show(el: HTMLElement, options?: AlertOptions): string;
16
+ dismiss(el: HTMLElement): void;
17
+ dismiss(key: string): void;
18
+ clear(): void;
19
+ speak(message: string, options?: AlertOptions): void;
20
+ private dismissAlert;
21
+ private leaveAlert;
22
+ private startTimeout;
23
+ private clearTimeout;
24
+ private pauseOnInteraction;
25
+ private resumeOnInteraction;
26
+ private handleInteraction;
27
+ private getAlerts;
28
+ private syncAlertPoliteness;
29
+ private getAuthoredPoliteness;
30
+ private getAlertFromTarget;
31
+ }
32
+ //#endregion
33
+ //#region src/combobox/combobox.d.ts
34
+ declare class ComboboxElement extends HTMLElement {
35
+ private idPrefix;
36
+ private suppressedListId;
37
+ private sync;
38
+ private observer;
39
+ private listeners?;
40
+ private sourceState?;
41
+ private control?;
42
+ private tokens?;
43
+ private input?;
44
+ private listbox?;
45
+ private activeIndex;
46
+ private labelledBy;
47
+ private generatedLabelIds;
48
+ connectedCallback(): void;
49
+ disconnectedCallback(): void;
50
+ refresh(): void;
51
+ private enhance;
52
+ private setupSource;
53
+ private observeSource;
54
+ private teardownSource;
55
+ private render;
56
+ private createGeneratedInput;
57
+ private createListbox;
58
+ private syncInputState;
59
+ private syncValidityState;
60
+ private addInputListeners;
61
+ private restoreInputAttributes;
62
+ private setInputAttribute;
63
+ private renderTokens;
64
+ private renderOptions;
65
+ private syncInputDisplay;
66
+ private onInput;
67
+ private onInputFocus;
68
+ private onInputClick;
69
+ private onKeyDown;
70
+ private onControlMouseDown;
71
+ private onControlClick;
72
+ private onWidgetKeyDown;
73
+ private onListboxClick;
74
+ private onFocusOut;
75
+ private onDocumentPointerDown;
76
+ private onLabelClick;
77
+ private onSourceUpdate;
78
+ private onFormReset;
79
+ private moveActive;
80
+ private showSuggestions;
81
+ private chooseOption;
82
+ private toggleOption;
83
+ private emitSourceUpdate;
84
+ private restoreCommittedText;
85
+ private open;
86
+ private close;
87
+ private dismiss;
88
+ private isOpen;
89
+ private get activeOption();
90
+ private syncActiveDescendant;
91
+ private scrollActiveOptionIntoView;
92
+ private enabledTokenButtons;
93
+ private optionForToken;
94
+ private filteredOptions;
95
+ private options;
96
+ private firstEnabledIndex;
97
+ private isOptionDisabled;
98
+ private optionLabel;
99
+ private isSelected;
100
+ private observeDatalist;
101
+ private discoverSource;
102
+ private isSupportedSource;
103
+ private get multiple();
104
+ private get editable();
105
+ private get sourceHidden();
106
+ private snapshotInputAttributes;
107
+ private createInputState;
108
+ }
109
+ //#endregion
110
+ //#region src/menu/menu.d.ts
111
+ declare class MenuElement extends HTMLElement {
112
+ static searchDelay: number;
113
+ static observedAttributes: string[];
114
+ private itemSync?;
115
+ private search;
116
+ private searchTimeout?;
117
+ connectedCallback(): void;
118
+ disconnectedCallback(): void;
119
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
120
+ private get horizontal();
121
+ private syncDocumentListeners;
122
+ private removeDocumentListeners;
123
+ private onDocumentClick;
124
+ private onDocumentKeyDown;
125
+ private onKeyDown;
126
+ private onClick;
127
+ private onMouseEnter;
128
+ private isActive;
129
+ private syncItems;
130
+ private getItems;
131
+ private getEnabledItems;
132
+ private isItemEnabled;
133
+ private belongsToThisMenu;
134
+ private getActiveItem;
135
+ private getItemForEvent;
136
+ private getRootTriggerForEvent;
137
+ private getTriggers;
138
+ private getParentMenuTrigger;
139
+ private getParentMenu;
140
+ private getSubmenu;
141
+ private openSubmenu;
142
+ private closeSubmenus;
143
+ private closeSelfAndDescendants;
144
+ private closeMenuTree;
145
+ private focusRootMenuTrigger;
146
+ private getRootMenuTrigger;
147
+ private handleTypeahead;
148
+ private updateTypeaheadSearch;
149
+ private findTypeaheadMatch;
150
+ private getItemLabel;
151
+ private showPopoverWithSource;
152
+ }
153
+ //#endregion
154
+ //#region src/tabs/tabs.d.ts
155
+ type SelectTabOptions = {
156
+ focus?: boolean;
157
+ emit?: boolean;
158
+ };
159
+ declare class TabsElement extends HTMLElement {
160
+ private idPrefix;
161
+ private structureSync?;
162
+ private managedPanelTabindex;
163
+ connectedCallback(): void;
164
+ disconnectedCallback(): void;
165
+ selectTab(index: number, options?: SelectTabOptions): boolean;
166
+ private onKeyDown;
167
+ private onClick;
168
+ private syncStructure;
169
+ private get vertical();
170
+ private get tablist();
171
+ private tabPairs;
172
+ private getSelectedIndex;
173
+ private getEventTabIndex;
174
+ private applySelection;
175
+ private syncPanelTabindex;
176
+ private hasAuthorManagedTabindex;
177
+ }
178
+ //#endregion
179
+ //#region src/toolbar/toolbar.d.ts
180
+ declare class ToolbarElement extends HTMLElement {
181
+ private structureSync?;
182
+ connectedCallback(): void;
183
+ disconnectedCallback(): void;
184
+ private onFocus;
185
+ private onKeyDown;
186
+ private syncControls;
187
+ private syncCurrentControl;
188
+ private get vertical();
189
+ private get controls();
190
+ }
191
+ //#endregion
192
+ //#region src/tooltip/tooltip.d.ts
193
+ declare class TooltipElement extends HTMLElement {
194
+ static delay: number;
195
+ static observedAttributes: string[];
196
+ private owner?;
197
+ private timeout?;
198
+ private sync;
199
+ private ownerObserver?;
200
+ private siblingObserver?;
201
+ private managedDescription?;
202
+ connectedCallback(): void;
203
+ disconnectedCallback(): void;
204
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
205
+ get disabled(): boolean;
206
+ set disabled(val: boolean);
207
+ show(owner?: HTMLElement | undefined): void;
208
+ hide(): void;
209
+ private onToggle;
210
+ private onDocumentKeyDown;
211
+ private syncOwner;
212
+ private resolveOwner;
213
+ private resolveExplicitOwner;
214
+ private setOwner;
215
+ private onOwnerFocusIn;
216
+ private onOwnerFocusOut;
217
+ private onOwnerPointerEnter;
218
+ private onTooltipPointerEnter;
219
+ private onInteractivePointerLeave;
220
+ private onOwnerClick;
221
+ private afterDelay;
222
+ private containsInteractiveTarget;
223
+ private updateManagedDescription;
224
+ private getDescriptionTokens;
225
+ private ensureTooltipId;
226
+ private supportsHoverInteraction;
227
+ private isOwnerDisabled;
228
+ }
229
+ //#endregion
230
+ export { type AlertOptions, type AlertPoliteness, AlertsElement, ComboboxElement, MenuElement, TabsElement, ToolbarElement, TooltipElement };