@compa11y/web 0.1.5 → 0.1.8

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.
@@ -0,0 +1,23 @@
1
+ import { Compa11yElement } from '../utils/base-element';
2
+
3
+ export declare class A11yAlert extends Compa11yElement {
4
+ private _closeButton;
5
+ static get observedAttributes(): string[];
6
+ private get alertType();
7
+ /**
8
+ * Determine the ARIA role based on alert type.
9
+ * error/warning → role="alert" (assertive)
10
+ * info/success → role="status" (polite)
11
+ */
12
+ private get alertRole();
13
+ protected setupAccessibility(): void;
14
+ protected render(): void;
15
+ protected setupEventListeners(): void;
16
+ protected cleanupEventListeners(): void;
17
+ private handleDismiss;
18
+ protected onAttributeChange(name: string, _oldValue: string | null, _newValue: string | null): void;
19
+ /**
20
+ * Programmatically dismiss the alert
21
+ */
22
+ dismiss(): void;
23
+ }
@@ -0,0 +1,11 @@
1
+ import { Compa11yElement } from '../utils/base-element';
2
+
3
+ export declare class A11ySkipLink extends Compa11yElement {
4
+ static get observedAttributes(): string[];
5
+ protected setupAccessibility(): void;
6
+ protected render(): void;
7
+ protected setupEventListeners(): void;
8
+ protected cleanupEventListeners(): void;
9
+ private handleClick;
10
+ protected onAttributeChange(name: string, _oldValue: string | null, _newValue: string | null): void;
11
+ }
@@ -32,7 +32,7 @@ export declare class A11yToast extends Compa11yElement {
32
32
  /**
33
33
  * Remove a toast by ID.
34
34
  */
35
- remove(id: string): void;
35
+ removeToast(id: string): void;
36
36
  /**
37
37
  * Remove all toasts.
38
38
  */
@@ -0,0 +1,9 @@
1
+ import { Compa11yElement } from '../utils/base-element';
2
+
3
+ export declare class A11yVisuallyHidden extends Compa11yElement {
4
+ static get observedAttributes(): string[];
5
+ protected setupAccessibility(): void;
6
+ protected render(): void;
7
+ protected setupEventListeners(): void;
8
+ protected cleanupEventListeners(): void;
9
+ }
package/dist/index.d.ts CHANGED
@@ -11,7 +11,10 @@ import { A11yListbox, A11yOption, A11yOptgroup } from './components/listbox';
11
11
  import { A11yCheckbox, A11yCheckboxGroup } from './components/checkbox';
12
12
  import { A11yRadioGroup, A11yRadio } from './components/radio-group';
13
13
  import { A11yToast } from './components/toast';
14
+ import { A11yVisuallyHidden } from './components/visually-hidden';
15
+ import { A11ySkipLink } from './components/skip-link';
16
+ import { A11yAlert } from './components/alert';
14
17
  import { initAnnouncer, announce, announcePolite, announceAssertive, announceStatus, announceError, initFocusVisible, createFocusTrap, createFocusScope, createRovingTabindex, createKeyboardManager, KeyboardPatterns, createTypeAhead, aria, buildAriaProps, hasAccessibleName, isBrowser, prefersReducedMotion, prefersHighContrast, prefersDarkMode } from '@compa11y/core';
15
18
 
16
- export { A11yDialog, A11yMenu, A11yTabs, A11yCombobox, A11ySwitch, A11ySelect, A11yInput, A11yTextarea, A11yButton, A11yListbox, A11yOption, A11yOptgroup, A11yCheckbox, A11yCheckboxGroup, A11yRadioGroup, A11yRadio, A11yToast, };
19
+ export { A11yDialog, A11yMenu, A11yTabs, A11yCombobox, A11ySwitch, A11ySelect, A11yInput, A11yTextarea, A11yButton, A11yListbox, A11yOption, A11yOptgroup, A11yCheckbox, A11yCheckboxGroup, A11yRadioGroup, A11yRadio, A11yToast, A11yVisuallyHidden, A11ySkipLink, A11yAlert, };
17
20
  export { initAnnouncer, announce, announcePolite, announceAssertive, announceStatus, announceError, initFocusVisible, createFocusTrap, createFocusScope, createRovingTabindex, createKeyboardManager, KeyboardPatterns, createTypeAhead, aria, buildAriaProps, hasAccessibleName, isBrowser, prefersReducedMotion, prefersHighContrast, prefersDarkMode, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compa11y/web",
3
- "version": "0.1.5",
3
+ "version": "0.1.8",
4
4
  "description": "Accessible Web Components for any HTML page - CDN ready",
5
5
  "author": "Ivan Trajkovski",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  "main": "./dist/index.js",
12
12
  "module": "./dist/index.mjs",
13
13
  "types": "./dist/index.d.ts",
14
- "homepage": "https://github.com/trajkovskiivan/compa11y#readme",
14
+ "homepage": "https://compa11y.org",
15
15
  "bugs": {
16
16
  "url": "https://github.com/trajkovskiivan/compa11y/issues"
17
17
  },
@@ -83,7 +83,7 @@
83
83
  "LICENSE"
84
84
  ],
85
85
  "dependencies": {
86
- "@compa11y/core": "0.1.5"
86
+ "@compa11y/core": "0.1.8"
87
87
  },
88
88
  "devDependencies": {
89
89
  "@types/node": "^20.11.0",