@mappoh/nova 0.2.3 → 0.5.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.
- package/README.md +180 -30
- package/dist/a11y/index.d.ts +40 -0
- package/dist/a11y/index.d.ts.map +1 -0
- package/dist/a11y/index.js +162 -0
- package/dist/a11y/index.js.map +1 -0
- package/dist/alert/alert.d.ts +32 -0
- package/dist/alert/alert.d.ts.map +1 -0
- package/dist/alert/alert.js +307 -0
- package/dist/alert/alert.js.map +1 -0
- package/dist/alert/index.d.ts +3 -0
- package/dist/alert/index.d.ts.map +1 -0
- package/dist/alert/index.js +2 -0
- package/dist/alert/index.js.map +1 -0
- package/dist/animation/flip.d.ts +28 -0
- package/dist/animation/flip.d.ts.map +1 -0
- package/dist/animation/flip.js +113 -0
- package/dist/animation/flip.js.map +1 -0
- package/dist/animation/spring.d.ts +34 -0
- package/dist/animation/spring.d.ts.map +1 -0
- package/dist/animation/spring.js +86 -0
- package/dist/animation/spring.js.map +1 -0
- package/dist/animation/stagger.d.ts +43 -0
- package/dist/animation/stagger.d.ts.map +1 -0
- package/dist/animation/stagger.js +150 -0
- package/dist/animation/stagger.js.map +1 -0
- package/dist/avatar/avatar.d.ts +27 -0
- package/dist/avatar/avatar.d.ts.map +1 -0
- package/dist/avatar/avatar.js +132 -0
- package/dist/avatar/avatar.js.map +1 -0
- package/dist/avatar/index.d.ts +3 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/badge/badge.d.ts +27 -0
- package/dist/badge/badge.d.ts.map +1 -0
- package/dist/badge/badge.js +118 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/badge/index.d.ts +3 -0
- package/dist/badge/index.d.ts.map +1 -0
- package/dist/badge/index.js +2 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/cache/cache.d.ts +28 -0
- package/dist/cache/cache.d.ts.map +1 -0
- package/dist/cache/cache.js +67 -0
- package/dist/cache/cache.js.map +1 -0
- package/dist/cache/index.d.ts +3 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +2 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/chart/chart.d.ts +31 -0
- package/dist/chart/chart.d.ts.map +1 -0
- package/dist/chart/chart.js +372 -0
- package/dist/chart/chart.js.map +1 -0
- package/dist/chart/index.d.ts +3 -0
- package/dist/chart/index.d.ts.map +1 -0
- package/dist/chart/index.js +2 -0
- package/dist/chart/index.js.map +1 -0
- package/dist/color-picker/color-picker.d.ts +18 -0
- package/dist/color-picker/color-picker.d.ts.map +1 -0
- package/dist/color-picker/color-picker.js +243 -0
- package/dist/color-picker/color-picker.js.map +1 -0
- package/dist/color-picker/index.d.ts +3 -0
- package/dist/color-picker/index.d.ts.map +1 -0
- package/dist/color-picker/index.js +2 -0
- package/dist/color-picker/index.js.map +1 -0
- package/dist/combobox/combobox.d.ts +26 -0
- package/dist/combobox/combobox.d.ts.map +1 -0
- package/dist/combobox/combobox.js +262 -0
- package/dist/combobox/combobox.js.map +1 -0
- package/dist/combobox/index.d.ts +3 -0
- package/dist/combobox/index.d.ts.map +1 -0
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/command-palette/command-palette.d.ts +31 -0
- package/dist/command-palette/command-palette.d.ts.map +1 -0
- package/dist/command-palette/command-palette.js +590 -0
- package/dist/command-palette/command-palette.js.map +1 -0
- package/dist/command-palette/index.d.ts +3 -0
- package/dist/command-palette/index.d.ts.map +1 -0
- package/dist/command-palette/index.js +2 -0
- package/dist/command-palette/index.js.map +1 -0
- package/dist/component/component.d.ts +20 -2
- package/dist/component/component.d.ts.map +1 -1
- package/dist/component/component.js +115 -5
- package/dist/component/component.js.map +1 -1
- package/dist/component/connect.d.ts +50 -0
- package/dist/component/connect.d.ts.map +1 -1
- package/dist/component/connect.js +135 -0
- package/dist/component/connect.js.map +1 -1
- package/dist/component/directives.d.ts +20 -0
- package/dist/component/directives.d.ts.map +1 -0
- package/dist/component/directives.js +42 -0
- package/dist/component/directives.js.map +1 -0
- package/dist/component/html.d.ts +8 -0
- package/dist/component/html.d.ts.map +1 -1
- package/dist/component/html.js +11 -0
- package/dist/component/html.js.map +1 -1
- package/dist/component/index.d.ts +9 -3
- package/dist/component/index.d.ts.map +1 -1
- package/dist/component/index.js +6 -2
- package/dist/component/index.js.map +1 -1
- package/dist/component/portal.d.ts +32 -0
- package/dist/component/portal.d.ts.map +1 -0
- package/dist/component/portal.js +59 -0
- package/dist/component/portal.js.map +1 -0
- package/dist/component/ref.d.ts +18 -0
- package/dist/component/ref.d.ts.map +1 -0
- package/dist/component/ref.js +17 -0
- package/dist/component/ref.js.map +1 -0
- package/dist/component/slot-styles.d.ts +18 -0
- package/dist/component/slot-styles.d.ts.map +1 -0
- package/dist/component/slot-styles.js +47 -0
- package/dist/component/slot-styles.js.map +1 -0
- package/dist/component/template.d.ts +2 -0
- package/dist/component/template.d.ts.map +1 -1
- package/dist/component/template.js +122 -4
- package/dist/component/template.js.map +1 -1
- package/dist/context/context.d.ts +39 -0
- package/dist/context/context.d.ts.map +1 -0
- package/dist/context/context.js +111 -0
- package/dist/context/context.js.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +2 -0
- package/dist/context/index.js.map +1 -0
- package/dist/data-table/data-table.d.ts +34 -0
- package/dist/data-table/data-table.d.ts.map +1 -0
- package/dist/data-table/data-table.js +256 -0
- package/dist/data-table/data-table.js.map +1 -0
- package/dist/data-table/index.d.ts +3 -0
- package/dist/data-table/index.d.ts.map +1 -0
- package/dist/data-table/index.js +2 -0
- package/dist/data-table/index.js.map +1 -0
- package/dist/date-picker/date-picker.d.ts +22 -0
- package/dist/date-picker/date-picker.d.ts.map +1 -0
- package/dist/date-picker/date-picker.js +282 -0
- package/dist/date-picker/date-picker.js.map +1 -0
- package/dist/date-picker/index.d.ts +3 -0
- package/dist/date-picker/index.d.ts.map +1 -0
- package/dist/date-picker/index.js +2 -0
- package/dist/date-picker/index.js.map +1 -0
- package/dist/devtools/devtools.d.ts +54 -0
- package/dist/devtools/devtools.d.ts.map +1 -1
- package/dist/devtools/devtools.js +86 -0
- package/dist/devtools/devtools.js.map +1 -1
- package/dist/devtools/index.d.ts +2 -2
- package/dist/devtools/index.d.ts.map +1 -1
- package/dist/devtools/index.js +1 -1
- package/dist/devtools/index.js.map +1 -1
- package/dist/editor/editor.d.ts +40 -0
- package/dist/editor/editor.d.ts.map +1 -0
- package/dist/editor/editor.js +955 -0
- package/dist/editor/editor.js.map +1 -0
- package/dist/editor/index.d.ts +3 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +2 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/event-bus/event-bus.d.ts +20 -0
- package/dist/event-bus/event-bus.d.ts.map +1 -0
- package/dist/event-bus/event-bus.js +55 -0
- package/dist/event-bus/event-bus.js.map +1 -0
- package/dist/event-bus/index.d.ts +3 -0
- package/dist/event-bus/index.d.ts.map +1 -0
- package/dist/event-bus/index.js +2 -0
- package/dist/event-bus/index.js.map +1 -0
- package/dist/file-upload/file-upload.d.ts +24 -0
- package/dist/file-upload/file-upload.d.ts.map +1 -0
- package/dist/file-upload/file-upload.js +177 -0
- package/dist/file-upload/file-upload.js.map +1 -0
- package/dist/file-upload/index.d.ts +3 -0
- package/dist/file-upload/index.d.ts.map +1 -0
- package/dist/file-upload/index.js +2 -0
- package/dist/file-upload/index.js.map +1 -0
- package/dist/forms/form-engine.d.ts +19 -6
- package/dist/forms/form-engine.d.ts.map +1 -1
- package/dist/forms/form-engine.js +97 -11
- package/dist/forms/form-engine.js.map +1 -1
- package/dist/forms/validators.d.ts +4 -0
- package/dist/forms/validators.d.ts.map +1 -1
- package/dist/forms/validators.js +6 -0
- package/dist/forms/validators.js.map +1 -1
- package/dist/forms/wasm-validators.d.ts +19 -11
- package/dist/forms/wasm-validators.d.ts.map +1 -1
- package/dist/forms/wasm-validators.js +191 -31
- package/dist/forms/wasm-validators.js.map +1 -1
- package/dist/gesture/gesture.d.ts +2 -0
- package/dist/gesture/gesture.d.ts.map +1 -1
- package/dist/gesture/gesture.js +81 -0
- package/dist/gesture/gesture.js.map +1 -1
- package/dist/http/http.d.ts +8 -0
- package/dist/http/http.d.ts.map +1 -1
- package/dist/http/http.js +18 -4
- package/dist/http/http.js.map +1 -1
- package/dist/i18n/i18n.d.ts +6 -0
- package/dist/i18n/i18n.d.ts.map +1 -1
- package/dist/i18n/i18n.js +71 -9
- package/dist/i18n/i18n.js.map +1 -1
- package/dist/machine/index.d.ts +3 -0
- package/dist/machine/index.d.ts.map +1 -0
- package/dist/machine/index.js +2 -0
- package/dist/machine/index.js.map +1 -0
- package/dist/machine/machine.d.ts +26 -0
- package/dist/machine/machine.d.ts.map +1 -0
- package/dist/machine/machine.js +79 -0
- package/dist/machine/machine.js.map +1 -0
- package/dist/modal/modal.d.ts.map +1 -1
- package/dist/modal/modal.js +13 -29
- package/dist/modal/modal.js.map +1 -1
- package/dist/notification-center/index.d.ts +3 -0
- package/dist/notification-center/index.d.ts.map +1 -0
- package/dist/notification-center/index.js +2 -0
- package/dist/notification-center/index.js.map +1 -0
- package/dist/notification-center/notification-center.d.ts +55 -0
- package/dist/notification-center/notification-center.d.ts.map +1 -0
- package/dist/notification-center/notification-center.js +941 -0
- package/dist/notification-center/notification-center.js.map +1 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/index.d.ts.map +1 -0
- package/dist/pagination/index.js +2 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/pagination/pagination.d.ts +31 -0
- package/dist/pagination/pagination.d.ts.map +1 -0
- package/dist/pagination/pagination.js +213 -0
- package/dist/pagination/pagination.js.map +1 -0
- package/dist/progress/progress.d.ts.map +1 -1
- package/dist/progress/progress.js +5 -7
- package/dist/progress/progress.js.map +1 -1
- package/dist/query/index.d.ts +3 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +2 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/query.d.ts +31 -0
- package/dist/query/query.d.ts.map +1 -0
- package/dist/query/query.js +150 -0
- package/dist/query/query.js.map +1 -0
- package/dist/radio-group/index.d.ts +3 -0
- package/dist/radio-group/index.d.ts.map +1 -0
- package/dist/radio-group/index.js +2 -0
- package/dist/radio-group/index.js.map +1 -0
- package/dist/radio-group/radio-group.d.ts +37 -0
- package/dist/radio-group/radio-group.d.ts.map +1 -0
- package/dist/radio-group/radio-group.js +251 -0
- package/dist/radio-group/radio-group.js.map +1 -0
- package/dist/rating/index.d.ts +3 -0
- package/dist/rating/index.d.ts.map +1 -0
- package/dist/rating/index.js +2 -0
- package/dist/rating/index.js.map +1 -0
- package/dist/rating/rating.d.ts +31 -0
- package/dist/rating/rating.d.ts.map +1 -0
- package/dist/rating/rating.js +187 -0
- package/dist/rating/rating.js.map +1 -0
- package/dist/router/index.d.ts +1 -1
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +1 -1
- package/dist/router/index.js.map +1 -1
- package/dist/router/router.d.ts +30 -1
- package/dist/router/router.d.ts.map +1 -1
- package/dist/router/router.js +131 -16
- package/dist/router/router.js.map +1 -1
- package/dist/skeleton/index.d.ts +3 -0
- package/dist/skeleton/index.d.ts.map +1 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/skeleton/skeleton.d.ts +24 -0
- package/dist/skeleton/skeleton.d.ts.map +1 -0
- package/dist/skeleton/skeleton.js +91 -0
- package/dist/skeleton/skeleton.js.map +1 -0
- package/dist/slider/index.d.ts +3 -0
- package/dist/slider/index.d.ts.map +1 -0
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/slider.d.ts +33 -0
- package/dist/slider/slider.d.ts.map +1 -0
- package/dist/slider/slider.js +248 -0
- package/dist/slider/slider.js.map +1 -0
- package/dist/spinner/index.d.ts +3 -0
- package/dist/spinner/index.d.ts.map +1 -0
- package/dist/spinner/index.js +2 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/spinner/spinner.d.ts +23 -0
- package/dist/spinner/spinner.d.ts.map +1 -0
- package/dist/spinner/spinner.js +82 -0
- package/dist/spinner/spinner.js.map +1 -0
- package/dist/state/store.d.ts +4 -0
- package/dist/state/store.d.ts.map +1 -1
- package/dist/state/store.js +27 -7
- package/dist/state/store.js.map +1 -1
- package/dist/sw/sw.d.ts.map +1 -1
- package/dist/sw/sw.js +39 -7
- package/dist/sw/sw.js.map +1 -1
- package/dist/switch/index.d.ts +3 -0
- package/dist/switch/index.d.ts.map +1 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/switch/switch.d.ts +27 -0
- package/dist/switch/switch.d.ts.map +1 -0
- package/dist/switch/switch.js +163 -0
- package/dist/switch/switch.js.map +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/scale.d.ts +40 -0
- package/dist/theme/scale.d.ts.map +1 -0
- package/dist/theme/scale.js +62 -0
- package/dist/theme/scale.js.map +1 -0
- package/dist/tree-view/index.d.ts +3 -0
- package/dist/tree-view/index.d.ts.map +1 -0
- package/dist/tree-view/index.js +2 -0
- package/dist/tree-view/index.js.map +1 -0
- package/dist/tree-view/tree-view.d.ts +29 -0
- package/dist/tree-view/tree-view.d.ts.map +1 -0
- package/dist/tree-view/tree-view.js +273 -0
- package/dist/tree-view/tree-view.js.map +1 -0
- package/dist/utils/index.d.ts +29 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +114 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/websocket/index.d.ts +3 -0
- package/dist/websocket/index.d.ts.map +1 -0
- package/dist/websocket/index.js +2 -0
- package/dist/websocket/index.js.map +1 -0
- package/dist/websocket/websocket.d.ts +31 -0
- package/dist/websocket/websocket.d.ts.map +1 -0
- package/dist/websocket/websocket.js +164 -0
- package/dist/websocket/websocket.js.map +1 -0
- package/package.json +135 -2
package/README.md
CHANGED
|
@@ -1,46 +1,196 @@
|
|
|
1
|
-
# Nova
|
|
1
|
+
# Nova
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A lightweight web engine built on Web Components. Zero dependencies.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```
|
|
6
|
+
npm install @mappoh/nova
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Modules
|
|
10
|
+
|
|
11
|
+
### Core
|
|
6
12
|
|
|
7
13
|
| Module | Import | Description |
|
|
8
14
|
|--------|--------|-------------|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
| Component | `@mappoh/nova/component` | Web Components base class with reactive state, props, lifecycle hooks, and template engine |
|
|
16
|
+
| Router | `@mappoh/nova/router` | SPA router with path params, guards, layouts, loaders, and view transitions |
|
|
17
|
+
| Store | `@mappoh/nova/store` | Reactive signals, computed values, effects, and batched updates |
|
|
18
|
+
| Theme | `@mappoh/nova/theme` | CSS custom property management with dark/light mode switching |
|
|
19
|
+
|
|
20
|
+
### Component Utilities
|
|
21
|
+
|
|
22
|
+
All utilities auto-cleanup when the component disconnects.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import {
|
|
26
|
+
classMap, styleMap, // template helpers
|
|
27
|
+
createRef, // DOM refs
|
|
28
|
+
useComputed, // memoization
|
|
29
|
+
useInterval, // non-pausing interval
|
|
30
|
+
useScroll, // Shadow DOM scroll fix
|
|
31
|
+
afterRender, // post-paint callback
|
|
32
|
+
createPortal, usePortal,// render outside shadow root
|
|
33
|
+
slotStyles, // deep slot styling
|
|
34
|
+
} from '@mappoh/nova/component';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
| Utility | Description |
|
|
38
|
+
|---------|-------------|
|
|
39
|
+
| `classMap({ active: true })` | Build class strings from boolean maps |
|
|
40
|
+
| `styleMap({ fontSize: 16 })` | Build style strings with auto `px` and kebab-case |
|
|
41
|
+
| `createRef()` | DOM element ref that survives re-renders |
|
|
42
|
+
| `useComputed(this, fn, deps)` | Memoize expensive render calculations |
|
|
43
|
+
| `useInterval(this, fn, ms)` | Interval that keeps running when tab is hidden |
|
|
44
|
+
| `useScroll(this, selector)` | Fix wheel events for Shadow DOM scroll containers |
|
|
45
|
+
| `afterRender(this, fn)` | Callback after browser paint (via rAF) |
|
|
46
|
+
| `this.on(event, selector, handler)` | Declarative event delegation with auto-cleanup |
|
|
47
|
+
| `createPortal(content)` | Render outside shadow root (tooltips, dropdowns) |
|
|
48
|
+
| `slotStyles(this, css)` | Deep slot styling beyond `::slotted()` |
|
|
49
|
+
|
|
50
|
+
### Component Static Flags
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
class MyComponent extends Component {
|
|
54
|
+
static tag = 'my-component';
|
|
55
|
+
static scrollFix = true; // auto-fix wheel events in Shadow DOM
|
|
56
|
+
static debugRender = true; // log render triggers to console
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Data & State
|
|
18
61
|
|
|
19
|
-
|
|
62
|
+
| Module | Import | Description |
|
|
63
|
+
|--------|--------|-------------|
|
|
64
|
+
| Query | `@mappoh/nova/query` | SWR-style data fetching with stale-while-revalidate |
|
|
65
|
+
| State Machine | `@mappoh/nova/machine` | Finite state machine with enter/exit actions |
|
|
66
|
+
| WebSocket | `@mappoh/nova/websocket` | Reconnecting WebSocket with heartbeat and backoff |
|
|
67
|
+
| Event Bus | `@mappoh/nova/event-bus` | Typed publish/subscribe |
|
|
68
|
+
| Cache | `@mappoh/nova/cache` | LRU cache with optional TTL |
|
|
69
|
+
| Context | `@mappoh/nova/context` | Dependency injection via DOM events |
|
|
70
|
+
| HTTP | `@mappoh/nova/http` | Fetch wrapper with interceptors, retries, timeout |
|
|
71
|
+
| Persistent State | `@mappoh/nova/persistent-state` | IndexedDB-backed persistent store |
|
|
72
|
+
|
|
73
|
+
### UI Components
|
|
74
|
+
|
|
75
|
+
| Component | Import | Description |
|
|
76
|
+
|-----------|--------|-------------|
|
|
77
|
+
| Modal | `@mappoh/nova/modal` | Accessible dialog with focus trap and scroll lock |
|
|
78
|
+
| Toast | `@mappoh/nova/toast` | Notification toasts with auto-dismiss |
|
|
79
|
+
| Tooltip | `@mappoh/nova/tooltip` | Positioned tooltips with flip/shift |
|
|
80
|
+
| Popover | `@mappoh/nova/popover` | Positioned popovers with click/hover/focus triggers |
|
|
81
|
+
| Dropdown | `@mappoh/nova/dropdown` | Accessible dropdown menu |
|
|
82
|
+
| Accordion | `@mappoh/nova/accordion` | Collapsible panels with ARIA |
|
|
83
|
+
| Tabs | `@mappoh/nova/tabs` | Tab panel switcher with keyboard nav |
|
|
84
|
+
| Stepper | `@mappoh/nova/stepper` | Multi-step wizard with validation |
|
|
85
|
+
| Carousel | `@mappoh/nova/carousel` | CSS scroll-snap carousel with drag |
|
|
86
|
+
| Pagination | `@mappoh/nova/pagination` | Page navigation with ellipsis |
|
|
87
|
+
| Switch | `@mappoh/nova/switch` | Toggle switch |
|
|
88
|
+
| Radio Group | `@mappoh/nova/radio-group` | Radio group with roving tabindex |
|
|
89
|
+
| Slider | `@mappoh/nova/slider` | Custom slider with pointer drag |
|
|
90
|
+
| Rating | `@mappoh/nova/rating` | Star rating |
|
|
91
|
+
| Alert | `@mappoh/nova/alert` | Alert/banner with variants |
|
|
92
|
+
| Badge | `@mappoh/nova/badge` | Inline badge |
|
|
93
|
+
| Avatar | `@mappoh/nova/avatar` | Image with initials fallback |
|
|
94
|
+
| Progress | `@mappoh/nova/progress` | Linear and circular progress bars |
|
|
95
|
+
| Skeleton | `@mappoh/nova/skeleton` | Shimmer loading placeholder |
|
|
96
|
+
| Spinner | `@mappoh/nova/spinner` | Loading spinner |
|
|
97
|
+
| Breadcrumb | `@mappoh/nova/breadcrumb` | Navigation breadcrumbs |
|
|
98
|
+
| Command Palette | `@mappoh/nova/command-palette` | Cmd+K searchable command overlay |
|
|
99
|
+
| Editor | `@mappoh/nova/editor` | Markdown editor with split/write/preview modes |
|
|
100
|
+
| Notification Center | `@mappoh/nova/notification-center` | Notification drawer with badge count |
|
|
101
|
+
|
|
102
|
+
### Forms
|
|
103
|
+
|
|
104
|
+
| Module | Import | Description |
|
|
105
|
+
|--------|--------|-------------|
|
|
106
|
+
| Form Engine | `@mappoh/nova/forms` | Schema-driven forms with validation and touched/dirty tracking |
|
|
107
|
+
| WASM Validators | `@mappoh/nova/forms/wasm-validators` | Email, URL, credit card, IBAN validation (WASM + TS fallback) |
|
|
20
108
|
|
|
21
|
-
|
|
109
|
+
### Animation & Canvas
|
|
110
|
+
|
|
111
|
+
| Module | Import | Description |
|
|
112
|
+
|--------|--------|-------------|
|
|
113
|
+
| Spring | `@mappoh/nova/animation/spring` | Physics-based spring animation |
|
|
114
|
+
| Stagger | `@mappoh/nova/animation/stagger` | Staggered animations across element arrays |
|
|
115
|
+
| FLIP | `@mappoh/nova/animation/flip` | First-Last-Invert-Play layout transitions |
|
|
116
|
+
| Scroll Animate | `@mappoh/nova/animation/scroll-animate` | CSS `animation-timeline` with fallback |
|
|
117
|
+
| Parallax | `@mappoh/nova/animation/parallax` | Scroll-driven parallax layers |
|
|
118
|
+
| Text Reveal | `@mappoh/nova/text-reveal` | Staggered word/line entrance |
|
|
119
|
+
| Particles | `@mappoh/nova/canvas/particles` | 2D particle system |
|
|
120
|
+
| Dot Grid | `@mappoh/nova/canvas/dot-grid` | Interactive dot grid |
|
|
121
|
+
| Noise | `@mappoh/nova/canvas/noise` | Simplex/Perlin noise rendering |
|
|
122
|
+
| Virtual List | `@mappoh/nova/virtual-list` | DOM-recycling virtual scroller |
|
|
123
|
+
|
|
124
|
+
### i18n
|
|
125
|
+
|
|
126
|
+
| Module | Import | Description |
|
|
127
|
+
|--------|--------|-------------|
|
|
128
|
+
| i18n | `@mappoh/nova/i18n` | Reactive i18n with ICU pluralization, `formatNumber`, `formatDate`, `formatRelative` |
|
|
129
|
+
|
|
130
|
+
### Utilities
|
|
131
|
+
|
|
132
|
+
| Module | Import | Description |
|
|
133
|
+
|--------|--------|-------------|
|
|
134
|
+
| Utils | `@mappoh/nova/utils` | `debounce`, `throttle`, `deepEqual`, `clamp`, `lerp`, `remap`, `uniqueId` |
|
|
135
|
+
| A11y | `@mappoh/nova/a11y` | `trapFocus`, `rovingTabIndex`, `announce`, `skipLink` |
|
|
136
|
+
| Clipboard | `@mappoh/nova/clipboard` | Copy/read text and HTML |
|
|
137
|
+
| Search | `@mappoh/nova/search` | Full-text search with WASM fuzzy matching |
|
|
138
|
+
| Gesture | `@mappoh/nova/gesture` | Swipe, pinch, pan, long-press, tap with Pointer Events |
|
|
139
|
+
| Drag | `@mappoh/nova/drag` | Sortable lists with keyboard support |
|
|
140
|
+
| Shortcuts | `@mappoh/nova/shortcuts` | Keyboard shortcut registry |
|
|
141
|
+
| Lazy Load | `@mappoh/nova/lazy` | IntersectionObserver lazy loading |
|
|
142
|
+
| Infinite Scroll | `@mappoh/nova/infinite-scroll` | Infinite scroll loading |
|
|
143
|
+
| Scale | `@mappoh/nova/theme` | Mathematical type scale via CSS custom properties |
|
|
144
|
+
| Service Worker | `@mappoh/nova/sw` | SW generation with caching strategies |
|
|
145
|
+
| Devtools | `@mappoh/nova/devtools` | Component inspector and render debugging |
|
|
146
|
+
|
|
147
|
+
### WASM Accelerators
|
|
148
|
+
|
|
149
|
+
Optional Rust-compiled modules. Each has a pure TypeScript fallback.
|
|
22
150
|
|
|
23
151
|
| Module | Import | Description |
|
|
24
152
|
|--------|--------|-------------|
|
|
25
153
|
| Markdown | `@mappoh/nova/markdown/wasm` | CommonMark + GFM parser |
|
|
26
|
-
| Noise | `@mappoh/nova/canvas/noise-wasm` | Batch
|
|
27
|
-
| Validation | `@mappoh/nova/forms/wasm-validators` |
|
|
28
|
-
| Image | `@mappoh/nova/image/wasm` |
|
|
29
|
-
| Physics | `@mappoh/nova/canvas/physics-wasm` | 2D particle dynamics
|
|
30
|
-
| Crypto | `@mappoh/nova/security/wasm-crypto` | Argon2id, bcrypt, PBKDF2-SHA256
|
|
31
|
-
| Diff | `@mappoh/nova/component/diff-wasm` | LIS-based keyed list reconciliation
|
|
154
|
+
| Noise | `@mappoh/nova/canvas/noise-wasm` | Batch noise with FBM |
|
|
155
|
+
| Validation | `@mappoh/nova/forms/wasm-validators` | Email, credit card, IBAN, password strength |
|
|
156
|
+
| Image | `@mappoh/nova/image/wasm` | Grayscale, blur, sharpen, crop, rotate, resize |
|
|
157
|
+
| Physics | `@mappoh/nova/canvas/physics-wasm` | 2D particle dynamics |
|
|
158
|
+
| Crypto | `@mappoh/nova/security/wasm-crypto` | Argon2id, bcrypt, PBKDF2-SHA256 |
|
|
159
|
+
| Diff | `@mappoh/nova/component/diff-wasm` | LIS-based keyed list reconciliation |
|
|
160
|
+
|
|
161
|
+
## Quick Start
|
|
162
|
+
|
|
163
|
+
```ts
|
|
164
|
+
import { Component, html, classMap, createRef } from '@mappoh/nova/component';
|
|
165
|
+
import { createNovaStore } from '@mappoh/nova/store';
|
|
166
|
+
|
|
167
|
+
const { signal } = createNovaStore();
|
|
168
|
+
const count = signal(0);
|
|
32
169
|
|
|
33
|
-
|
|
170
|
+
class Counter extends Component {
|
|
171
|
+
static tag = 'my-counter';
|
|
172
|
+
static styles = `
|
|
173
|
+
button { padding: 8px 16px; border-radius: 6px; background: #333; color: #fff; }
|
|
174
|
+
.active { background: #0066ff; }
|
|
175
|
+
`;
|
|
34
176
|
|
|
35
|
-
|
|
36
|
-
- **Build scripts** — `npm run build:all` compiles WASM + TypeScript in one step
|
|
37
|
-
- **17 new package exports** — every module has a dedicated entry point
|
|
177
|
+
private ref = createRef<HTMLButtonElement>();
|
|
38
178
|
|
|
39
|
-
|
|
179
|
+
render() {
|
|
180
|
+
const value = count();
|
|
181
|
+
return html`
|
|
182
|
+
<button
|
|
183
|
+
ref=${this.ref}
|
|
184
|
+
class=${classMap({ active: value > 0 })}
|
|
185
|
+
@click=${() => count.update(n => n + 1)}
|
|
186
|
+
>
|
|
187
|
+
Count: ${value}
|
|
188
|
+
</button>
|
|
189
|
+
`;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
40
192
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- **Breadcrumb** — `href` sanitized against dangerous URIs; `icon` renders as text
|
|
44
|
-
- **Crypto WASM** — CSPRNG for salt generation; minimum parameter bounds on verify; defaults raised to OWASP recommendations
|
|
193
|
+
Counter.define();
|
|
194
|
+
```
|
|
45
195
|
|
|
46
|
-
See [CHANGELOG.md](./CHANGELOG.md) for
|
|
196
|
+
See [CHANGELOG.md](./CHANGELOG.md) for release notes.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nova Engine — Accessibility Utilities
|
|
3
|
+
*
|
|
4
|
+
* Reusable focus management, keyboard navigation,
|
|
5
|
+
* screen reader announcements, and ARIA helpers.
|
|
6
|
+
*/
|
|
7
|
+
/** Generate a unique ID for ARIA attribute linking. */
|
|
8
|
+
export declare function uniqueId(prefix?: string): string;
|
|
9
|
+
/** Check if user prefers reduced motion. */
|
|
10
|
+
export declare function prefersReducedMotion(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Trap focus within a container element.
|
|
13
|
+
* Pressing Tab/Shift+Tab cycles through focusable elements inside.
|
|
14
|
+
* Returns a cleanup function to remove the trap.
|
|
15
|
+
*/
|
|
16
|
+
export declare function trapFocus(container: HTMLElement): () => void;
|
|
17
|
+
export interface RovingOptions {
|
|
18
|
+
/** Arrow key orientation. Default: 'horizontal' */
|
|
19
|
+
orientation?: 'horizontal' | 'vertical' | 'both';
|
|
20
|
+
/** Wrap around at edges. Default: true */
|
|
21
|
+
wrap?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Set up roving tabindex keyboard navigation within a container.
|
|
25
|
+
* Items matching the selector get tabindex management and arrow key navigation.
|
|
26
|
+
* Returns a cleanup function.
|
|
27
|
+
*/
|
|
28
|
+
export declare function rovingTabIndex(container: HTMLElement, selector: string, options?: RovingOptions): () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Announce a message to screen readers via a live region.
|
|
31
|
+
* @param message Text to announce
|
|
32
|
+
* @param priority 'polite' (default) or 'assertive'
|
|
33
|
+
*/
|
|
34
|
+
export declare function announce(message: string, priority?: 'polite' | 'assertive'): void;
|
|
35
|
+
/**
|
|
36
|
+
* Create a skip-to-content link.
|
|
37
|
+
* Returns the anchor element — append it to the page.
|
|
38
|
+
*/
|
|
39
|
+
export declare function skipLink(targetId: string, label?: string): HTMLAnchorElement;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/a11y/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,uDAAuD;AACvD,wBAAgB,QAAQ,CAAC,MAAM,SAAS,GAAG,MAAM,CAEhD;AAED,4CAA4C;AAC5C,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,IAAI,CA8B5D;AAED,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;IACjD,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,WAAW,EACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,aAAkB,GAC1B,MAAM,IAAI,CA+CZ;AAID;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,QAAQ,GAAG,WAAsB,GAAG,IAAI,CA4B3F;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAoB,GAAG,iBAAiB,CAwBvF"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nova Engine — Accessibility Utilities
|
|
3
|
+
*
|
|
4
|
+
* Reusable focus management, keyboard navigation,
|
|
5
|
+
* screen reader announcements, and ARIA helpers.
|
|
6
|
+
*/
|
|
7
|
+
const FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
8
|
+
let idCounter = 0;
|
|
9
|
+
/** Generate a unique ID for ARIA attribute linking. */
|
|
10
|
+
export function uniqueId(prefix = 'nova') {
|
|
11
|
+
return `${prefix}-${++idCounter}`;
|
|
12
|
+
}
|
|
13
|
+
/** Check if user prefers reduced motion. */
|
|
14
|
+
export function prefersReducedMotion() {
|
|
15
|
+
return typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Trap focus within a container element.
|
|
19
|
+
* Pressing Tab/Shift+Tab cycles through focusable elements inside.
|
|
20
|
+
* Returns a cleanup function to remove the trap.
|
|
21
|
+
*/
|
|
22
|
+
export function trapFocus(container) {
|
|
23
|
+
function handleKeydown(e) {
|
|
24
|
+
if (e.key !== 'Tab')
|
|
25
|
+
return;
|
|
26
|
+
const focusable = Array.from(container.querySelectorAll(FOCUSABLE));
|
|
27
|
+
if (focusable.length === 0)
|
|
28
|
+
return;
|
|
29
|
+
const first = focusable[0];
|
|
30
|
+
const last = focusable[focusable.length - 1];
|
|
31
|
+
if (e.shiftKey) {
|
|
32
|
+
if (document.activeElement === first) {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
last.focus();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
if (document.activeElement === last) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
first.focus();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
container.addEventListener('keydown', handleKeydown);
|
|
45
|
+
// Focus first element on trap activation
|
|
46
|
+
const first = container.querySelector(FOCUSABLE);
|
|
47
|
+
first?.focus();
|
|
48
|
+
return () => container.removeEventListener('keydown', handleKeydown);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Set up roving tabindex keyboard navigation within a container.
|
|
52
|
+
* Items matching the selector get tabindex management and arrow key navigation.
|
|
53
|
+
* Returns a cleanup function.
|
|
54
|
+
*/
|
|
55
|
+
export function rovingTabIndex(container, selector, options = {}) {
|
|
56
|
+
const { orientation = 'horizontal', wrap = true } = options;
|
|
57
|
+
function getItems() {
|
|
58
|
+
return Array.from(container.querySelectorAll(selector));
|
|
59
|
+
}
|
|
60
|
+
function init() {
|
|
61
|
+
const items = getItems();
|
|
62
|
+
items.forEach((item, i) => {
|
|
63
|
+
item.setAttribute('tabindex', i === 0 ? '0' : '-1');
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function handleKeydown(e) {
|
|
67
|
+
const items = getItems();
|
|
68
|
+
const current = items.indexOf(e.target);
|
|
69
|
+
if (current === -1)
|
|
70
|
+
return;
|
|
71
|
+
let next = -1;
|
|
72
|
+
const prevKeys = orientation === 'vertical' ? ['ArrowUp'] : orientation === 'horizontal' ? ['ArrowLeft'] : ['ArrowUp', 'ArrowLeft'];
|
|
73
|
+
const nextKeys = orientation === 'vertical' ? ['ArrowDown'] : orientation === 'horizontal' ? ['ArrowRight'] : ['ArrowDown', 'ArrowRight'];
|
|
74
|
+
if (nextKeys.includes(e.key)) {
|
|
75
|
+
next = current + 1;
|
|
76
|
+
if (next >= items.length)
|
|
77
|
+
next = wrap ? 0 : current;
|
|
78
|
+
}
|
|
79
|
+
else if (prevKeys.includes(e.key)) {
|
|
80
|
+
next = current - 1;
|
|
81
|
+
if (next < 0)
|
|
82
|
+
next = wrap ? items.length - 1 : current;
|
|
83
|
+
}
|
|
84
|
+
else if (e.key === 'Home') {
|
|
85
|
+
next = 0;
|
|
86
|
+
}
|
|
87
|
+
else if (e.key === 'End') {
|
|
88
|
+
next = items.length - 1;
|
|
89
|
+
}
|
|
90
|
+
if (next !== -1 && next !== current) {
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
items[current].setAttribute('tabindex', '-1');
|
|
93
|
+
items[next].setAttribute('tabindex', '0');
|
|
94
|
+
items[next].focus();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
init();
|
|
98
|
+
container.addEventListener('keydown', handleKeydown);
|
|
99
|
+
return () => container.removeEventListener('keydown', handleKeydown);
|
|
100
|
+
}
|
|
101
|
+
let announceEl = null;
|
|
102
|
+
/**
|
|
103
|
+
* Announce a message to screen readers via a live region.
|
|
104
|
+
* @param message Text to announce
|
|
105
|
+
* @param priority 'polite' (default) or 'assertive'
|
|
106
|
+
*/
|
|
107
|
+
export function announce(message, priority = 'polite') {
|
|
108
|
+
if (typeof document === 'undefined')
|
|
109
|
+
return;
|
|
110
|
+
if (!announceEl) {
|
|
111
|
+
announceEl = document.createElement('div');
|
|
112
|
+
announceEl.setAttribute('aria-live', priority);
|
|
113
|
+
announceEl.setAttribute('aria-atomic', 'true');
|
|
114
|
+
Object.assign(announceEl.style, {
|
|
115
|
+
position: 'absolute',
|
|
116
|
+
width: '1px',
|
|
117
|
+
height: '1px',
|
|
118
|
+
padding: '0',
|
|
119
|
+
margin: '-1px',
|
|
120
|
+
overflow: 'hidden',
|
|
121
|
+
clip: 'rect(0,0,0,0)',
|
|
122
|
+
whiteSpace: 'nowrap',
|
|
123
|
+
border: '0',
|
|
124
|
+
});
|
|
125
|
+
document.body.appendChild(announceEl);
|
|
126
|
+
}
|
|
127
|
+
announceEl.setAttribute('aria-live', priority);
|
|
128
|
+
announceEl.textContent = '';
|
|
129
|
+
// Force screen reader to re-announce by clearing then setting
|
|
130
|
+
requestAnimationFrame(() => {
|
|
131
|
+
if (announceEl)
|
|
132
|
+
announceEl.textContent = message;
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Create a skip-to-content link.
|
|
137
|
+
* Returns the anchor element — append it to the page.
|
|
138
|
+
*/
|
|
139
|
+
export function skipLink(targetId, label = 'Skip to content') {
|
|
140
|
+
const link = document.createElement('a');
|
|
141
|
+
link.href = `#${targetId}`;
|
|
142
|
+
link.textContent = label;
|
|
143
|
+
link.className = 'nova-skip-link';
|
|
144
|
+
Object.assign(link.style, {
|
|
145
|
+
position: 'absolute',
|
|
146
|
+
top: '-100%',
|
|
147
|
+
left: '0',
|
|
148
|
+
zIndex: '10000',
|
|
149
|
+
padding: '0.5rem 1rem',
|
|
150
|
+
background: '#000',
|
|
151
|
+
color: '#fff',
|
|
152
|
+
textDecoration: 'none',
|
|
153
|
+
});
|
|
154
|
+
link.addEventListener('focus', () => {
|
|
155
|
+
link.style.top = '0';
|
|
156
|
+
});
|
|
157
|
+
link.addEventListener('blur', () => {
|
|
158
|
+
link.style.top = '-100%';
|
|
159
|
+
});
|
|
160
|
+
return link;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,SAAS,GAAG,sIAAsI,CAAC;AAEzJ,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB,uDAAuD;AACvD,MAAM,UAAU,QAAQ,CAAC,MAAM,GAAG,MAAM;IACtC,OAAO,GAAG,MAAM,IAAI,EAAE,SAAS,EAAE,CAAC;AACpC,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,oBAAoB;IAClC,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC,OAAO,CAAC;AACxG,CAAC;AAED;;;;GAIG;AAC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;QACZ,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,aAAa;QACtB,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,MAAM;QACb,cAAc,EAAE,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;QAClC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;IACvB,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;QACjC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nova Engine — Alert / Banner
|
|
3
|
+
*
|
|
4
|
+
* Accessible notification banners with type-based colour coding,
|
|
5
|
+
* inline SVG icons, optional auto-dismiss, and slide-in animation.
|
|
6
|
+
*/
|
|
7
|
+
export type AlertType = 'info' | 'success' | 'warning' | 'error';
|
|
8
|
+
export interface AlertOptions {
|
|
9
|
+
/** Alert variant. Default: 'info' */
|
|
10
|
+
type?: AlertType;
|
|
11
|
+
/** Main message text */
|
|
12
|
+
message: string;
|
|
13
|
+
/** Optional title / heading */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Show a dismiss button. Default: true */
|
|
16
|
+
dismissible?: boolean;
|
|
17
|
+
/** Callback when dismissed */
|
|
18
|
+
onDismiss?: () => void;
|
|
19
|
+
/** Show a type icon. Default: true */
|
|
20
|
+
icon?: boolean;
|
|
21
|
+
/** Auto-dismiss duration in ms. 0 = manual only. Default: 0 */
|
|
22
|
+
duration?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface AlertInstance {
|
|
25
|
+
/** Dismiss the alert (with exit animation) */
|
|
26
|
+
dismiss(): void;
|
|
27
|
+
/** Remove from DOM and clean up immediately */
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
30
|
+
/** Create an accessible alert banner. */
|
|
31
|
+
export declare function createAlert(container: string | HTMLElement, options: AlertOptions): AlertInstance;
|
|
32
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/alert/alert.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,OAAO,IAAI,IAAI,CAAC;IAChB,+CAA+C;IAC/C,OAAO,IAAI,IAAI,CAAC;CACjB;AA4MD,yCAAyC;AACzC,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,GAAG,WAAW,EAC/B,OAAO,EAAE,YAAY,GACpB,aAAa,CAoHf"}
|