@watermarkinsights/ripple 5.32.1-alpha.0 → 5.32.1-alpha.2
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/dist/cjs/{app-globals-9419c1cd.js → app-globals-4ac5459c.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-navigation_3.cjs.entry.js +3 -3
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +25 -6
- package/dist/collection/components/wm-navigation/wm-navigation.js +90 -17
- package/dist/docs/docs.json +21 -9
- package/dist/docs/props-reference.json +2 -2
- package/dist/docs/skill/index.md +1 -0
- package/dist/docs/skill/wm-navigation-hamburger.md +23 -5
- package/dist/docs/skill/wm-navigation.md +79 -5
- package/dist/esm/{app-globals-12f21c79.js → app-globals-10d4c715.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-navigation_3.entry.js +3 -3
- package/dist/ripple/{p-a8da6480.js → p-5cf61da4.js} +1 -1
- package/dist/ripple/{p-6db681c8.entry.js → p-a4ce3157.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +24 -5
- package/dist/types/components/wm-navigation/wm-navigation.d.ts +88 -15
- package/dist/types/components.d.ts +388 -40
- package/package.json +2 -2
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-bb947bd5.js');
|
|
6
|
-
const appGlobals = require('./app-globals-
|
|
6
|
+
const appGlobals = require('./app-globals-4ac5459c.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
package/dist/cjs/ripple.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-bb947bd5.js');
|
|
6
|
-
const appGlobals = require('./app-globals-
|
|
6
|
+
const appGlobals = require('./app-globals-4ac5459c.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
Stencil Client Patch Browser v4.21.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -106,9 +106,9 @@ const Navigation = class {
|
|
|
106
106
|
} }));
|
|
107
107
|
}
|
|
108
108
|
render() {
|
|
109
|
-
return (index.h(index.Host, { key: '
|
|
109
|
+
return (index.h(index.Host, { key: '455ebcf50bec917e657714bb56cd72fc87f7212b', role: "navigation", "aria-expanded": this.ariaExpanded, "aria-label": this.mainNavigationMessage }, this.open ? this.renderOverlay() : "", this.isCollapsible && (index.h("div", { key: 'b9640ea2937c9ab2b33a5f2a287eb50a4678c7d5', class: "trapfocus", tabindex: this.open ? 0 : undefined, onFocus: () => this.focusLastItem() })), index.h("div", { key: '157f8f00912c6a35816e7f2aa93bff4e64abea0e', class: "tray" }, index.h("div", { key: 'a08e2258ee9bde6c00e7d59dc655f1b42f45d2ce', class: "toggle-wrapper" }, index.h("wm-button", { key: '72b866b11f2f3292201ed695c77f90ba689c3916', ref: (el) => (this.toggleEl = el), class: "toggle", "button-type": "navigational", icon: this.open ? "#close" : "#menu", "icon-size": "2rem", tooltip: this.open ? intl.globalMessages.close : intl.globalMessages.open, "tooltip-position": "right", tabIndex: this.open ? undefined : -1, onClick: () => {
|
|
110
110
|
this.open = !this.open;
|
|
111
|
-
} })), index.h("ul", { key: '
|
|
111
|
+
} })), index.h("ul", { key: '3f51e76d253adfc22c669d8e2a0675e6552077f7', class: "navlist" }, index.h("slot", { key: '1d150172af4888f51a71177a91c0b0069802f6de' }))), this.isCollapsible && (index.h("div", { key: '2526aebc0b57306d11cb1627e2db83db360f11fe', class: "trapfocus", tabindex: this.open ? 0 : undefined, onFocus: () => this.toggleEl.focus() }))));
|
|
112
112
|
}
|
|
113
113
|
static get delegatesFocus() { return true; }
|
|
114
114
|
get el() { return index.getElement(this); }
|
|
@@ -157,7 +157,7 @@ const NavigationHamburger = class {
|
|
|
157
157
|
this.wmNavigationHamburgerClicked.emit();
|
|
158
158
|
}
|
|
159
159
|
render() {
|
|
160
|
-
return (index.h(index.Host, { key: '
|
|
160
|
+
return (index.h(index.Host, { key: '7e1cb12ca9c50ce843f5ac08df000df0e641e492', class: `hamburger ${this.open ? "nav-open" : "nav-closed"}` }, index.h("button", { key: '2a385a09660705dfe0d2937d65ab4f527cbccf9d', "aria-expanded": this.open, "aria-label": this.showNavMessage, onMouseEnter: () => functions.showTooltip("right", this.el, this.showNavMessage), onMouseLeave: () => functions.hideTooltip(), onFocus: () => this.isTabbing && functions.showTooltip("right", this.el, this.showNavMessage), onBlur: () => functions.hideTooltip(), onClick: () => this.handleClick() }, index.h("span", { key: '6b644ad886eeb4f50741a85ee53c12e1abc81911', class: "svg-icon svg-menu" }))));
|
|
161
161
|
}
|
|
162
162
|
static get delegatesFocus() { return true; }
|
|
163
163
|
get el() { return index.getElement(this); }
|
|
@@ -2,8 +2,11 @@ import { h, Host } from "@stencil/core";
|
|
|
2
2
|
import { intl, showTooltip, hideTooltip } from "../../global/functions";
|
|
3
3
|
/**
|
|
4
4
|
* Toggle button for the collapsible wm-navigation sidebar. Renders a hamburger/menu icon
|
|
5
|
-
* button that communicates with wm-navigation via window
|
|
6
|
-
* the
|
|
5
|
+
* button that communicates with wm-navigation via a window event and a document-wide lookup,
|
|
6
|
+
* not DOM adjacency — place it wherever the page's header needs it, typically at the header's
|
|
7
|
+
* leading edge, before the logo.
|
|
8
|
+
*
|
|
9
|
+
* @category Navigation
|
|
7
10
|
*
|
|
8
11
|
* @keyboardInteraction
|
|
9
12
|
* - **Enter / Space**: Toggles the navigation open/closed.
|
|
@@ -15,15 +18,31 @@ import { intl, showTooltip, hideTooltip } from "../../global/functions";
|
|
|
15
18
|
*
|
|
16
19
|
* @usageNotes
|
|
17
20
|
* - `nav-id` is required; it must match the `id` on the associated wm-navigation element.
|
|
18
|
-
* -
|
|
21
|
+
* - Renders nothing and takes no layout space on viewports 1024px and wider (its internal
|
|
22
|
+
* button is hidden there). On narrower viewports the host is exactly a 60x60px box with the
|
|
23
|
+
* icon centered inside; that sizing already satisfies touch-target minimums, so don't add
|
|
24
|
+
* further leading margin or padding on the host for that — doing so stacks on top of the
|
|
25
|
+
* component's own and opens a visible gap at the header's outer edge. The box reserves no
|
|
26
|
+
* space on its trailing side, though — spacing between it and the next header element
|
|
27
|
+
* (typically a logo) is still up to the app's own header layout to provide.
|
|
28
|
+
* - The example below only illustrates the `nav-id`/`id` contract. For the full page
|
|
29
|
+
* placement — header, logo, and the `<main>` sidebar layout — see wm-navigation's
|
|
30
|
+
* "Basic navigation" example.
|
|
19
31
|
*
|
|
20
|
-
* @example {html}
|
|
32
|
+
* @example {html} nav-id / id pairing
|
|
21
33
|
* <wm-navigation-hamburger nav-id="main-nav"></wm-navigation-hamburger>
|
|
22
34
|
* <wm-navigation id="main-nav">...</wm-navigation>
|
|
23
35
|
*
|
|
24
|
-
* @example {react}
|
|
36
|
+
* @example {react} navId / id pairing
|
|
25
37
|
* <WmNavigationHamburger navId="main-nav" />
|
|
26
38
|
* <WmNavigation id="main-nav">...</WmNavigation>
|
|
39
|
+
*
|
|
40
|
+
* @requiredSetup
|
|
41
|
+
* - `wm-navigation` — required companion; this component's `nav-id` (required) must match
|
|
42
|
+
* that element's `id`. No handler is needed for the toggle itself — clicking this button
|
|
43
|
+
* emits `wmNavigationHamburgerClicked` on `window`, which wm-navigation listens for and
|
|
44
|
+
* toggles its own `open` state — but without a matching `nav-id`/`id` pair, `aria-controls`
|
|
45
|
+
* and the toggle both silently fail to connect.
|
|
27
46
|
*/
|
|
28
47
|
export class NavigationHamburger {
|
|
29
48
|
constructor() {
|
|
@@ -59,7 +78,7 @@ export class NavigationHamburger {
|
|
|
59
78
|
this.wmNavigationHamburgerClicked.emit();
|
|
60
79
|
}
|
|
61
80
|
render() {
|
|
62
|
-
return (h(Host, { key: '
|
|
81
|
+
return (h(Host, { key: '7e1cb12ca9c50ce843f5ac08df000df0e641e492', class: `hamburger ${this.open ? "nav-open" : "nav-closed"}` }, h("button", { key: '2a385a09660705dfe0d2937d65ab4f527cbccf9d', "aria-expanded": this.open, "aria-label": this.showNavMessage, onMouseEnter: () => showTooltip("right", this.el, this.showNavMessage), onMouseLeave: () => hideTooltip(), onFocus: () => this.isTabbing && showTooltip("right", this.el, this.showNavMessage), onBlur: () => hideTooltip(), onClick: () => this.handleClick() }, h("span", { key: '6b644ad886eeb4f50741a85ee53c12e1abc81911', class: "svg-icon svg-menu" }))));
|
|
63
82
|
}
|
|
64
83
|
static get is() { return "wm-navigation-hamburger"; }
|
|
65
84
|
static get encapsulation() { return "shadow"; }
|
|
@@ -4,7 +4,9 @@ import { globalMessages } from "../../global/intl";
|
|
|
4
4
|
/**
|
|
5
5
|
* Sidebar navigation that collapses into a hamburger menu on viewports narrower than 1024px.
|
|
6
6
|
* Contains wm-navigation-item children and works alongside an external wm-navigation-hamburger
|
|
7
|
-
* toggle.
|
|
7
|
+
* toggle. Render it as the first child of `<main>`, with the page's actual content in a sibling
|
|
8
|
+
* element — a flex or grid `<main>` lets the navigation sit alongside that content as a
|
|
9
|
+
* sidebar on viewports 1024px and wider, with no extra positioning needed.
|
|
8
10
|
*
|
|
9
11
|
* @category Navigation
|
|
10
12
|
*
|
|
@@ -23,29 +25,100 @@ import { globalMessages } from "../../global/intl";
|
|
|
23
25
|
* address bar via a `focus` listener on `document.body`.
|
|
24
26
|
*
|
|
25
27
|
* @usageNotes
|
|
26
|
-
* - Use `wm-navigation-hamburger` (a separate component) as the external toggle
|
|
27
|
-
* with wm-navigation via the `wmNavigationHamburgerClicked` window event
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* - Use `wm-navigation-hamburger` (a separate component) as the external toggle. It communicates
|
|
29
|
+
* with wm-navigation via the `wmNavigationHamburgerClicked` window event and a document-wide
|
|
30
|
+
* lookup, so it does not need to be a DOM sibling of wm-navigation — place it in the page
|
|
31
|
+
* header instead, at the leading edge before the logo. It already reserves its own
|
|
32
|
+
* touch-target padding on narrower viewports, so don't add further leading margin or padding
|
|
33
|
+
* on the host for that — but the gap between it and the logo is still the header's own layout
|
|
34
|
+
* to provide; the hamburger's box reserves no trailing space of its own (see
|
|
35
|
+
* wm-navigation-hamburger's docs).
|
|
36
|
+
* - `open` can be set initially to `true` to start the navigation expanded, in place of
|
|
37
|
+
* waiting for wm-navigation-hamburger's toggle.
|
|
30
38
|
*
|
|
31
39
|
* Required host setup:
|
|
32
40
|
* - Never set `display: none` or `visibility: hidden` on the host element or its wrapper
|
|
33
41
|
* container. The component manages its own visibility internally, and hiding the container
|
|
34
42
|
* from the outside blocks the overlay from appearing when the hamburger is triggered.
|
|
43
|
+
* - Give the element that wraps wm-navigation and the page content (commonly `<main>`) a flex
|
|
44
|
+
* or grid layout, and leave cross-axis alignment at its default (`align-items: stretch`,
|
|
45
|
+
* the default for both). This component's elevated surface, including its box-shadow, is
|
|
46
|
+
* sized to the host element's own height — overriding the default (e.g. `align-items:
|
|
47
|
+
* flex-start` or `center`) shrinks the host down to its item list's height, so the shadow
|
|
48
|
+
* clips partway down the page instead of running full height.
|
|
49
|
+
* - That flex/grid wrapper also needs a bounded height for real independent scrolling —
|
|
50
|
+
* `display: flex; align-items: stretch` alone does not create one, it only makes the
|
|
51
|
+
* navigation match whatever height the wrapper happens to end up. Give an ancestor
|
|
52
|
+
* (typically an app-shell wrapping the header and this wrapper) a fixed height such as
|
|
53
|
+
* `100vh`, make the wrapper itself `flex: 1; min-height: 0` within that shell, and give the
|
|
54
|
+
* actual content pane its own `overflow-y: auto; min-height: 0`. Skip the bounded height and
|
|
55
|
+
* the wrapper just grows to fit its tallest child — the whole document scrolls as one long
|
|
56
|
+
* page instead, and that also defeats this component's own item list, which needs that same
|
|
57
|
+
* constraint to scroll internally rather than just growing taller.
|
|
35
58
|
*
|
|
36
59
|
* @example {html} Basic navigation
|
|
37
|
-
* <
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
60
|
+
* <style>
|
|
61
|
+
* .app-shell {
|
|
62
|
+
* display: flex;
|
|
63
|
+
* flex-direction: column;
|
|
64
|
+
* height: 100vh;
|
|
65
|
+
* }
|
|
66
|
+
* .app-header {
|
|
67
|
+
* flex: 0 0 auto;
|
|
68
|
+
* }
|
|
69
|
+
* .app-main {
|
|
70
|
+
* display: flex;
|
|
71
|
+
* align-items: stretch;
|
|
72
|
+
* flex: 1 1 auto;
|
|
73
|
+
* min-height: 0;
|
|
74
|
+
* }
|
|
75
|
+
* .app-main__content {
|
|
76
|
+
* overflow-y: auto;
|
|
77
|
+
* min-height: 0;
|
|
78
|
+
* }
|
|
79
|
+
* </style>
|
|
80
|
+
* <div class="app-shell">
|
|
81
|
+
* <header class="app-header">
|
|
82
|
+
* <wm-navigation-hamburger nav-id="main-nav"></wm-navigation-hamburger>
|
|
83
|
+
* <a class="app-header__logo" href="/">App Name</a>
|
|
84
|
+
* </header>
|
|
85
|
+
* <main class="app-main">
|
|
86
|
+
* <wm-navigation id="main-nav">
|
|
87
|
+
* <wm-navigation-item href="/dashboard" text="Dashboard" active></wm-navigation-item>
|
|
88
|
+
* <wm-navigation-item href="/reports" text="Reports"></wm-navigation-item>
|
|
89
|
+
* </wm-navigation>
|
|
90
|
+
* <div class="app-main__content">Page content</div>
|
|
91
|
+
* </main>
|
|
92
|
+
* </div>
|
|
42
93
|
*
|
|
43
94
|
* @example {react} Basic navigation
|
|
44
|
-
* <
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
95
|
+
* <div style={{ display: "flex", flexDirection: "column", height: "100vh" }}>
|
|
96
|
+
* <header className="app-header">
|
|
97
|
+
* <WmNavigationHamburger navId="main-nav" />
|
|
98
|
+
* <a className="app-header__logo" href="/">App Name</a>
|
|
99
|
+
* </header>
|
|
100
|
+
* <main
|
|
101
|
+
* className="app-main"
|
|
102
|
+
* style={{ display: "flex", alignItems: "stretch", flex: "1 1 auto", minHeight: 0 }}
|
|
103
|
+
* >
|
|
104
|
+
* <WmNavigation id="main-nav">
|
|
105
|
+
* <WmNavigationItem href="/dashboard" text="Dashboard" active={true} />
|
|
106
|
+
* <WmNavigationItem href="/reports" text="Reports" />
|
|
107
|
+
* </WmNavigation>
|
|
108
|
+
* <div className="app-main__content" style={{ overflowY: "auto", minHeight: 0 }}>
|
|
109
|
+
* Page content
|
|
110
|
+
* </div>
|
|
111
|
+
* </main>
|
|
112
|
+
* </div>
|
|
113
|
+
*
|
|
114
|
+
* @requiredSetup
|
|
115
|
+
* - `wm-navigation-item` — slot at least one as a child; each supplies a link the collapsible
|
|
116
|
+
* menu and the persistent sidebar both render.
|
|
117
|
+
* - `wm-navigation-hamburger` — required for collapsible viewports; set its `nav-id` to match
|
|
118
|
+
* this component's `id`. No handler is needed for the pairing itself — wm-navigation listens
|
|
119
|
+
* for `wmNavigationHamburgerClicked` on `window` and toggles `open` itself — but without a
|
|
120
|
+
* matching `nav-id`/`id` pair, the hamburger's `aria-controls` and the toggle both silently
|
|
121
|
+
* fail to connect.
|
|
49
122
|
*
|
|
50
123
|
*/
|
|
51
124
|
export class Navigation {
|
|
@@ -143,9 +216,9 @@ export class Navigation {
|
|
|
143
216
|
} }));
|
|
144
217
|
}
|
|
145
218
|
render() {
|
|
146
|
-
return (h(Host, { key: '
|
|
219
|
+
return (h(Host, { key: '455ebcf50bec917e657714bb56cd72fc87f7212b', role: "navigation", "aria-expanded": this.ariaExpanded, "aria-label": this.mainNavigationMessage }, this.open ? this.renderOverlay() : "", this.isCollapsible && (h("div", { key: 'b9640ea2937c9ab2b33a5f2a287eb50a4678c7d5', class: "trapfocus", tabindex: this.open ? 0 : undefined, onFocus: () => this.focusLastItem() })), h("div", { key: '157f8f00912c6a35816e7f2aa93bff4e64abea0e', class: "tray" }, h("div", { key: 'a08e2258ee9bde6c00e7d59dc655f1b42f45d2ce', class: "toggle-wrapper" }, h("wm-button", { key: '72b866b11f2f3292201ed695c77f90ba689c3916', ref: (el) => (this.toggleEl = el), class: "toggle", "button-type": "navigational", icon: this.open ? "#close" : "#menu", "icon-size": "2rem", tooltip: this.open ? globalMessages.close : globalMessages.open, "tooltip-position": "right", tabIndex: this.open ? undefined : -1, onClick: () => {
|
|
147
220
|
this.open = !this.open;
|
|
148
|
-
} })), h("ul", { key: '
|
|
221
|
+
} })), h("ul", { key: '3f51e76d253adfc22c669d8e2a0675e6552077f7', class: "navlist" }, h("slot", { key: '1d150172af4888f51a71177a91c0b0069802f6de' }))), this.isCollapsible && (h("div", { key: '2526aebc0b57306d11cb1627e2db83db360f11fe', class: "trapfocus", tabindex: this.open ? 0 : undefined, onFocus: () => this.toggleEl.focus() }))));
|
|
149
222
|
}
|
|
150
223
|
static get is() { return "wm-navigation"; }
|
|
151
224
|
static get encapsulation() { return "shadow"; }
|
package/dist/docs/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-
|
|
2
|
+
"timestamp": "2026-09-08T16:58:32",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.21.0",
|
|
@@ -7663,7 +7663,7 @@
|
|
|
7663
7663
|
"filePath": "src/components/wm-navigation/wm-navigation.tsx",
|
|
7664
7664
|
"encapsulation": "shadow",
|
|
7665
7665
|
"tag": "wm-navigation",
|
|
7666
|
-
"docs": "Sidebar navigation that collapses into a hamburger menu on viewports narrower than 1024px.\nContains wm-navigation-item children and works alongside an external wm-navigation-hamburger\ntoggle.
|
|
7666
|
+
"docs": "Sidebar navigation that collapses into a hamburger menu on viewports narrower than 1024px.\nContains wm-navigation-item children and works alongside an external wm-navigation-hamburger\ntoggle. Render it as the first child of `<main>`, with the page's actual content in a sibling\nelement — a flex or grid `<main>` lets the navigation sit alongside that content as a\nsidebar on viewports 1024px and wider, with no extra positioning needed.",
|
|
7667
7667
|
"docsTags": [
|
|
7668
7668
|
{
|
|
7669
7669
|
"name": "category",
|
|
@@ -7683,15 +7683,19 @@
|
|
|
7683
7683
|
},
|
|
7684
7684
|
{
|
|
7685
7685
|
"name": "usageNotes",
|
|
7686
|
-
"text": "- Use `wm-navigation-hamburger` (a separate component) as the external toggle
|
|
7686
|
+
"text": "- Use `wm-navigation-hamburger` (a separate component) as the external toggle. It communicates\n with wm-navigation via the `wmNavigationHamburgerClicked` window event and a document-wide\n lookup, so it does not need to be a DOM sibling of wm-navigation — place it in the page\n header instead, at the leading edge before the logo. It already reserves its own\n touch-target padding on narrower viewports, so don't add further leading margin or padding\n on the host for that — but the gap between it and the logo is still the header's own layout\n to provide; the hamburger's box reserves no trailing space of its own (see\n wm-navigation-hamburger's docs).\n- `open` can be set initially to `true` to start the navigation expanded, in place of\n waiting for wm-navigation-hamburger's toggle.\n\nRequired host setup:\n- Never set `display: none` or `visibility: hidden` on the host element or its wrapper\n container. The component manages its own visibility internally, and hiding the container\n from the outside blocks the overlay from appearing when the hamburger is triggered.\n- Give the element that wraps wm-navigation and the page content (commonly `<main>`) a flex\n or grid layout, and leave cross-axis alignment at its default (`align-items: stretch`,\n the default for both). This component's elevated surface, including its box-shadow, is\n sized to the host element's own height — overriding the default (e.g. `align-items:\n flex-start` or `center`) shrinks the host down to its item list's height, so the shadow\n clips partway down the page instead of running full height.\n- That flex/grid wrapper also needs a bounded height for real independent scrolling —\n `display: flex; align-items: stretch` alone does not create one, it only makes the\n navigation match whatever height the wrapper happens to end up. Give an ancestor\n (typically an app-shell wrapping the header and this wrapper) a fixed height such as\n `100vh`, make the wrapper itself `flex: 1; min-height: 0` within that shell, and give the\n actual content pane its own `overflow-y: auto; min-height: 0`. Skip the bounded height and\n the wrapper just grows to fit its tallest child — the whole document scrolls as one long\n page instead, and that also defeats this component's own item list, which needs that same\n constraint to scroll internally rather than just growing taller."
|
|
7687
7687
|
},
|
|
7688
7688
|
{
|
|
7689
7689
|
"name": "example",
|
|
7690
|
-
"text": "{html} Basic navigation\n<wm-navigation-hamburger nav-id=\"main-nav\"></wm-navigation-hamburger>\n<wm-navigation id=\"main-nav\">\n<wm-navigation-item href=\"/dashboard\" text=\"Dashboard\" active></wm-navigation-item>\n<wm-navigation-item href=\"/reports\" text=\"Reports\"></wm-navigation-item>\n</wm-navigation>"
|
|
7690
|
+
"text": "{html} Basic navigation\n<style>\n.app-shell {\ndisplay: flex;\nflex-direction: column;\nheight: 100vh;\n}\n.app-header {\nflex: 0 0 auto;\n}\n.app-main {\ndisplay: flex;\nalign-items: stretch;\nflex: 1 1 auto;\nmin-height: 0;\n}\n.app-main__content {\noverflow-y: auto;\nmin-height: 0;\n}\n</style>\n<div class=\"app-shell\">\n<header class=\"app-header\">\n<wm-navigation-hamburger nav-id=\"main-nav\"></wm-navigation-hamburger>\n<a class=\"app-header__logo\" href=\"/\">App Name</a>\n</header>\n<main class=\"app-main\">\n<wm-navigation id=\"main-nav\">\n<wm-navigation-item href=\"/dashboard\" text=\"Dashboard\" active></wm-navigation-item>\n<wm-navigation-item href=\"/reports\" text=\"Reports\"></wm-navigation-item>\n</wm-navigation>\n<div class=\"app-main__content\">Page content</div>\n</main>\n</div>"
|
|
7691
7691
|
},
|
|
7692
7692
|
{
|
|
7693
7693
|
"name": "example",
|
|
7694
|
-
"text": "{react} Basic navigation\n<WmNavigationHamburger navId=\"main-nav\" />\n<WmNavigation id=\"main-nav\">\n<WmNavigationItem href=\"/dashboard\" text=\"Dashboard\" active={true} />\n<WmNavigationItem href=\"/reports\" text=\"Reports\" />\n</WmNavigation>"
|
|
7694
|
+
"text": "{react} Basic navigation\n<div style={{ display: \"flex\", flexDirection: \"column\", height: \"100vh\" }}>\n<header className=\"app-header\">\n<WmNavigationHamburger navId=\"main-nav\" />\n<a className=\"app-header__logo\" href=\"/\">App Name</a>\n</header>\n<main\nclassName=\"app-main\"\nstyle={{ display: \"flex\", alignItems: \"stretch\", flex: \"1 1 auto\", minHeight: 0 }}\n>\n<WmNavigation id=\"main-nav\">\n<WmNavigationItem href=\"/dashboard\" text=\"Dashboard\" active={true} />\n<WmNavigationItem href=\"/reports\" text=\"Reports\" />\n</WmNavigation>\n<div className=\"app-main__content\" style={{ overflowY: \"auto\", minHeight: 0 }}>\nPage content\n</div>\n</main>\n</div>"
|
|
7695
|
+
},
|
|
7696
|
+
{
|
|
7697
|
+
"name": "requiredSetup",
|
|
7698
|
+
"text": "- `wm-navigation-item` — slot at least one as a child; each supplies a link the collapsible\n menu and the persistent sidebar both render.\n- `wm-navigation-hamburger` — required for collapsible viewports; set its `nav-id` to match\n this component's `id`. No handler is needed for the pairing itself — wm-navigation listens\n for `wmNavigationHamburgerClicked` on `window` and toggles `open` itself — but without a\n matching `nav-id`/`id` pair, the hamburger's `aria-controls` and the toggle both silently\n fail to connect."
|
|
7695
7699
|
}
|
|
7696
7700
|
],
|
|
7697
7701
|
"usage": {},
|
|
@@ -7796,8 +7800,12 @@
|
|
|
7796
7800
|
"filePath": "src/components/wm-navigation/wm-navigation-hamburger.tsx",
|
|
7797
7801
|
"encapsulation": "shadow",
|
|
7798
7802
|
"tag": "wm-navigation-hamburger",
|
|
7799
|
-
"docs": "Toggle button for the collapsible wm-navigation sidebar. Renders a hamburger/menu icon\nbutton that communicates with wm-navigation via window
|
|
7803
|
+
"docs": "Toggle button for the collapsible wm-navigation sidebar. Renders a hamburger/menu icon\nbutton that communicates with wm-navigation via a window event and a document-wide lookup,\nnot DOM adjacency — place it wherever the page's header needs it, typically at the header's\nleading edge, before the logo.",
|
|
7800
7804
|
"docsTags": [
|
|
7805
|
+
{
|
|
7806
|
+
"name": "category",
|
|
7807
|
+
"text": "Navigation"
|
|
7808
|
+
},
|
|
7801
7809
|
{
|
|
7802
7810
|
"name": "keyboardInteraction",
|
|
7803
7811
|
"text": "- **Enter / Space**: Toggles the navigation open/closed."
|
|
@@ -7808,15 +7816,19 @@
|
|
|
7808
7816
|
},
|
|
7809
7817
|
{
|
|
7810
7818
|
"name": "usageNotes",
|
|
7811
|
-
"text": "- `nav-id` is required; it must match the `id` on the associated wm-navigation element.\n-
|
|
7819
|
+
"text": "- `nav-id` is required; it must match the `id` on the associated wm-navigation element.\n- Renders nothing and takes no layout space on viewports 1024px and wider (its internal\n button is hidden there). On narrower viewports the host is exactly a 60x60px box with the\n icon centered inside; that sizing already satisfies touch-target minimums, so don't add\n further leading margin or padding on the host for that — doing so stacks on top of the\n component's own and opens a visible gap at the header's outer edge. The box reserves no\n space on its trailing side, though — spacing between it and the next header element\n (typically a logo) is still up to the app's own header layout to provide.\n- The example below only illustrates the `nav-id`/`id` contract. For the full page\n placement — header, logo, and the `<main>` sidebar layout — see wm-navigation's\n \"Basic navigation\" example."
|
|
7812
7820
|
},
|
|
7813
7821
|
{
|
|
7814
7822
|
"name": "example",
|
|
7815
|
-
"text": "{html}
|
|
7823
|
+
"text": "{html} nav-id / id pairing\n<wm-navigation-hamburger nav-id=\"main-nav\"></wm-navigation-hamburger>\n<wm-navigation id=\"main-nav\">...</wm-navigation>"
|
|
7816
7824
|
},
|
|
7817
7825
|
{
|
|
7818
7826
|
"name": "example",
|
|
7819
|
-
"text": "{react}
|
|
7827
|
+
"text": "{react} navId / id pairing\n<WmNavigationHamburger navId=\"main-nav\" />\n<WmNavigation id=\"main-nav\">...</WmNavigation>"
|
|
7828
|
+
},
|
|
7829
|
+
{
|
|
7830
|
+
"name": "requiredSetup",
|
|
7831
|
+
"text": "- `wm-navigation` — required companion; this component's `nav-id` (required) must match\n that element's `id`. No handler is needed for the toggle itself — clicking this button\n emits `wmNavigationHamburgerClicked` on `window`, which wm-navigation listens for and\n toggles its own `open` state — but without a matching `nav-id`/`id` pair, `aria-controls`\n and the toggle both silently fail to connect."
|
|
7820
7832
|
}
|
|
7821
7833
|
],
|
|
7822
7834
|
"usage": {},
|
|
@@ -1085,7 +1085,7 @@
|
|
|
1085
1085
|
},
|
|
1086
1086
|
{
|
|
1087
1087
|
"tag": "wm-navigation",
|
|
1088
|
-
"description": "Sidebar navigation that collapses into a hamburger menu on viewports narrower than 1024px.\nContains wm-navigation-item children and works alongside an external wm-navigation-hamburger\ntoggle.
|
|
1088
|
+
"description": "Sidebar navigation that collapses into a hamburger menu on viewports narrower than 1024px.\nContains wm-navigation-item children and works alongside an external wm-navigation-hamburger\ntoggle. Render it as the first child of `<main>`, with the page's actual content in a sibling\nelement — a flex or grid `<main>` lets the navigation sit alongside that content as a\nsidebar on viewports 1024px and wider, with no extra positioning needed.",
|
|
1089
1089
|
"props": [
|
|
1090
1090
|
{
|
|
1091
1091
|
"name": "open",
|
|
@@ -1098,7 +1098,7 @@
|
|
|
1098
1098
|
},
|
|
1099
1099
|
{
|
|
1100
1100
|
"tag": "wm-navigation-hamburger",
|
|
1101
|
-
"description": "Toggle button for the collapsible wm-navigation sidebar. Renders a hamburger/menu icon\nbutton that communicates with wm-navigation via window
|
|
1101
|
+
"description": "Toggle button for the collapsible wm-navigation sidebar. Renders a hamburger/menu icon\nbutton that communicates with wm-navigation via a window event and a document-wide lookup,\nnot DOM adjacency — place it wherever the page's header needs it, typically at the header's\nleading edge, before the logo.",
|
|
1102
1102
|
"props": [
|
|
1103
1103
|
{
|
|
1104
1104
|
"name": "navId",
|
package/dist/docs/skill/index.md
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
| **Timepicker** | `wm-timepicker` | `wm-timepicker.md` | Form Inputs |
|
|
28
28
|
| **Uploader** | `wm-uploader` | `wm-uploader.md` | Form Inputs |
|
|
29
29
|
| **Navigation** | `wm-navigation` | `wm-navigation.md` | Navigation |
|
|
30
|
+
| **Navigation Hamburger** | `wm-navigation-hamburger` | `wm-navigation-hamburger.md` | Navigation |
|
|
30
31
|
| **Navigator** | `wm-navigator` | `wm-navigator.md` | Navigation |
|
|
31
32
|
| **Pagination** | `wm-pagination` | `wm-pagination.md` | Navigation |
|
|
32
33
|
| **Tabs** | `wm-tab-list` | `wm-tab-list.md` | Navigation |
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
- **Element:** `<wm-navigation-hamburger>`
|
|
3
3
|
|
|
4
4
|
**Purpose:** Toggle button for the collapsible wm-navigation sidebar. Renders a hamburger/menu icon
|
|
5
|
-
button that communicates with wm-navigation via window
|
|
6
|
-
the
|
|
5
|
+
button that communicates with wm-navigation via a window event and a document-wide lookup,
|
|
6
|
+
not DOM adjacency -- place it wherever the page's header needs it, typically at the header's
|
|
7
|
+
leading edge, before the logo.
|
|
7
8
|
|
|
8
9
|
**When to use:**
|
|
9
10
|
|
|
@@ -21,7 +22,16 @@ _None documented_
|
|
|
21
22
|
**Usage notes:**
|
|
22
23
|
|
|
23
24
|
- `nav-id` is required; it must match the `id` on the associated wm-navigation element.
|
|
24
|
-
-
|
|
25
|
+
- Renders nothing and takes no layout space on viewports 1024px and wider (its internal
|
|
26
|
+
button is hidden there). On narrower viewports the host is exactly a 60x60px box with the
|
|
27
|
+
icon centered inside; that sizing already satisfies touch-target minimums, so don't add
|
|
28
|
+
further leading margin or padding on the host for that -- doing so stacks on top of the
|
|
29
|
+
component's own and opens a visible gap at the header's outer edge. The box reserves no
|
|
30
|
+
space on its trailing side, though -- spacing between it and the next header element
|
|
31
|
+
(typically a logo) is still up to the app's own header layout to provide.
|
|
32
|
+
- The example below only illustrates the `nav-id`/`id` contract. For the full page
|
|
33
|
+
placement -- header, logo, and the `<main>` sidebar layout -- see wm-navigation's
|
|
34
|
+
"Basic navigation" example.
|
|
25
35
|
|
|
26
36
|
**Props:**
|
|
27
37
|
- `nav-id` -- The `id` of the associated wm-navigation element. Required for semantic
|
|
@@ -31,6 +41,14 @@ linking and for keeping `aria-expanded` in sync with the navigation's open state
|
|
|
31
41
|
- `wmNavigationHamburgerClicked` -- Fires when the button is clicked. Consumed by the associated wm-navigation
|
|
32
42
|
to toggle its `open` state -- not intended for direct application use.
|
|
33
43
|
|
|
44
|
+
**Required setup:**
|
|
45
|
+
|
|
46
|
+
- `wm-navigation` -- required companion; this component's `nav-id` (required) must match
|
|
47
|
+
that element's `id`. No handler is needed for the toggle itself -- clicking this button
|
|
48
|
+
emits `wmNavigationHamburgerClicked` on `window`, which wm-navigation listens for and
|
|
49
|
+
toggles its own `open` state -- but without a matching `nav-id`/`id` pair, `aria-controls`
|
|
50
|
+
and the toggle both silently fail to connect.
|
|
51
|
+
|
|
34
52
|
**Accessibility:**
|
|
35
53
|
|
|
36
54
|
- Rendered as a `<button>` with `aria-expanded` reflecting the navigation's open state.
|
|
@@ -46,14 +64,14 @@ to toggle its `open` state -- not intended for direct application use.
|
|
|
46
64
|
|
|
47
65
|
**Code example:**
|
|
48
66
|
|
|
49
|
-
|
|
67
|
+
_nav-id / id pairing_
|
|
50
68
|
|
|
51
69
|
```html
|
|
52
70
|
<wm-navigation-hamburger nav-id="main-nav"></wm-navigation-hamburger>
|
|
53
71
|
<wm-navigation id="main-nav">...</wm-navigation>
|
|
54
72
|
```
|
|
55
73
|
|
|
56
|
-
|
|
74
|
+
_navId / id pairing_
|
|
57
75
|
|
|
58
76
|
```react
|
|
59
77
|
<WmNavigationHamburger navId="main-nav" />
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
**Purpose:** Sidebar navigation that collapses into a hamburger menu on viewports narrower than 1024px.
|
|
5
5
|
Contains wm-navigation-item children and works alongside an external wm-navigation-hamburger
|
|
6
|
-
toggle.
|
|
6
|
+
toggle. Render it as the first child of `<main>`, with the page's actual content in a sibling
|
|
7
|
+
element -- a flex or grid `<main>` lets the navigation sit alongside that content as a
|
|
8
|
+
sidebar on viewports 1024px and wider, with no extra positioning needed.
|
|
7
9
|
|
|
8
10
|
**When to use:**
|
|
9
11
|
|
|
@@ -20,15 +22,36 @@ _None documented_
|
|
|
20
22
|
|
|
21
23
|
**Usage notes:**
|
|
22
24
|
|
|
23
|
-
- Use `wm-navigation-hamburger` (a separate component) as the external toggle
|
|
24
|
-
with wm-navigation via the `wmNavigationHamburgerClicked` window event
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
- Use `wm-navigation-hamburger` (a separate component) as the external toggle. It communicates
|
|
26
|
+
with wm-navigation via the `wmNavigationHamburgerClicked` window event and a document-wide
|
|
27
|
+
lookup, so it does not need to be a DOM sibling of wm-navigation -- place it in the page
|
|
28
|
+
header instead, at the leading edge before the logo. It already reserves its own
|
|
29
|
+
touch-target padding on narrower viewports, so don't add further leading margin or padding
|
|
30
|
+
on the host for that -- but the gap between it and the logo is still the header's own layout
|
|
31
|
+
to provide; the hamburger's box reserves no trailing space of its own (see
|
|
32
|
+
wm-navigation-hamburger's docs).
|
|
33
|
+
- `open` can be set initially to `true` to start the navigation expanded, in place of
|
|
34
|
+
waiting for wm-navigation-hamburger's toggle.
|
|
27
35
|
|
|
28
36
|
Required host setup:
|
|
29
37
|
- Never set `display: none` or `visibility: hidden` on the host element or its wrapper
|
|
30
38
|
container. The component manages its own visibility internally, and hiding the container
|
|
31
39
|
from the outside blocks the overlay from appearing when the hamburger is triggered.
|
|
40
|
+
- Give the element that wraps wm-navigation and the page content (commonly `<main>`) a flex
|
|
41
|
+
or grid layout, and leave cross-axis alignment at its default (`align-items: stretch`,
|
|
42
|
+
the default for both). This component's elevated surface, including its box-shadow, is
|
|
43
|
+
sized to the host element's own height -- overriding the default (e.g. `align-items:
|
|
44
|
+
flex-start` or `center`) shrinks the host down to its item list's height, so the shadow
|
|
45
|
+
clips partway down the page instead of running full height.
|
|
46
|
+
- That flex/grid wrapper also needs a bounded height for real independent scrolling --
|
|
47
|
+
`display: flex; align-items: stretch` alone does not create one, it only makes the
|
|
48
|
+
navigation match whatever height the wrapper happens to end up. Give an ancestor
|
|
49
|
+
(typically an app-shell wrapping the header and this wrapper) a fixed height such as
|
|
50
|
+
`100vh`, make the wrapper itself `flex: 1; min-height: 0` within that shell, and give the
|
|
51
|
+
actual content pane its own `overflow-y: auto; min-height: 0`. Skip the bounded height and
|
|
52
|
+
the wrapper just grows to fit its tallest child -- the whole document scrolls as one long
|
|
53
|
+
page instead, and that also defeats this component's own item list, which needs that same
|
|
54
|
+
constraint to scroll internally rather than just growing taller.
|
|
32
55
|
|
|
33
56
|
**Props:**
|
|
34
57
|
- `open` -- Controls the open/closed state of the collapsible navigation. Has no effect
|
|
@@ -41,6 +64,16 @@ on viewports wider than 1024px where the navigation is always visible. _(default
|
|
|
41
64
|
- `wmNavigationStateChanged` -- Fires when the collapsible navigation opens or closes. Consumed by
|
|
42
65
|
wm-navigation-hamburger to keep its `aria-expanded` state in sync.
|
|
43
66
|
|
|
67
|
+
**Required setup:**
|
|
68
|
+
|
|
69
|
+
- `wm-navigation-item` -- slot at least one as a child; each supplies a link the collapsible
|
|
70
|
+
menu and the persistent sidebar both render.
|
|
71
|
+
- `wm-navigation-hamburger` -- required for collapsible viewports; set its `nav-id` to match
|
|
72
|
+
this component's `id`. No handler is needed for the pairing itself -- wm-navigation listens
|
|
73
|
+
for `wmNavigationHamburgerClicked` on `window` and toggles `open` itself -- but without a
|
|
74
|
+
matching `nav-id`/`id` pair, the hamburger's `aria-controls` and the toggle both silently
|
|
75
|
+
fail to connect.
|
|
76
|
+
|
|
44
77
|
**Accessibility:**
|
|
45
78
|
|
|
46
79
|
- Rendered with `role="navigation"` and an `aria-label` of "Main".
|
|
@@ -64,19 +97,60 @@ wm-navigation-hamburger to keep its `aria-expanded` state in sync.
|
|
|
64
97
|
_Basic navigation_
|
|
65
98
|
|
|
66
99
|
```html
|
|
100
|
+
<style>
|
|
101
|
+
.app-shell {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
height: 100vh;
|
|
105
|
+
}
|
|
106
|
+
.app-header {
|
|
107
|
+
flex: 0 0 auto;
|
|
108
|
+
}
|
|
109
|
+
.app-main {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: stretch;
|
|
112
|
+
flex: 1 1 auto;
|
|
113
|
+
min-height: 0;
|
|
114
|
+
}
|
|
115
|
+
.app-main__content {
|
|
116
|
+
overflow-y: auto;
|
|
117
|
+
min-height: 0;
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
120
|
+
<div class="app-shell">
|
|
121
|
+
<header class="app-header">
|
|
67
122
|
<wm-navigation-hamburger nav-id="main-nav"></wm-navigation-hamburger>
|
|
123
|
+
<a class="app-header__logo" href="/">App Name</a>
|
|
124
|
+
</header>
|
|
125
|
+
<main class="app-main">
|
|
68
126
|
<wm-navigation id="main-nav">
|
|
69
127
|
<wm-navigation-item href="/dashboard" text="Dashboard" active></wm-navigation-item>
|
|
70
128
|
<wm-navigation-item href="/reports" text="Reports"></wm-navigation-item>
|
|
71
129
|
</wm-navigation>
|
|
130
|
+
<div class="app-main__content">Page content</div>
|
|
131
|
+
</main>
|
|
132
|
+
</div>
|
|
72
133
|
```
|
|
73
134
|
|
|
74
135
|
_Basic navigation_
|
|
75
136
|
|
|
76
137
|
```react
|
|
138
|
+
<div style={{ display: "flex", flexDirection: "column", height: "100vh" }}>
|
|
139
|
+
<header className="app-header">
|
|
77
140
|
<WmNavigationHamburger navId="main-nav" />
|
|
141
|
+
<a className="app-header__logo" href="/">App Name</a>
|
|
142
|
+
</header>
|
|
143
|
+
<main
|
|
144
|
+
className="app-main"
|
|
145
|
+
style={{ display: "flex", alignItems: "stretch", flex: "1 1 auto", minHeight: 0 }}
|
|
146
|
+
>
|
|
78
147
|
<WmNavigation id="main-nav">
|
|
79
148
|
<WmNavigationItem href="/dashboard" text="Dashboard" active={true} />
|
|
80
149
|
<WmNavigationItem href="/reports" text="Reports" />
|
|
81
150
|
</WmNavigation>
|
|
151
|
+
<div className="app-main__content" style={{ overflowY: "auto", minHeight: 0 }}>
|
|
152
|
+
Page content
|
|
153
|
+
</div>
|
|
154
|
+
</main>
|
|
155
|
+
</div>
|
|
82
156
|
```
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as bootstrapLazy } from './index-3425d80d.js';
|
|
2
2
|
export { s as setNonce } from './index-3425d80d.js';
|
|
3
|
-
import { g as globalScripts } from './app-globals-
|
|
3
|
+
import { g as globalScripts } from './app-globals-10d4c715.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
package/dist/esm/ripple.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as promiseResolve, b as bootstrapLazy } from './index-3425d80d.js';
|
|
2
2
|
export { s as setNonce } from './index-3425d80d.js';
|
|
3
|
-
import { g as globalScripts } from './app-globals-
|
|
3
|
+
import { g as globalScripts } from './app-globals-10d4c715.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v4.21.0 | MIT Licensed | https://stenciljs.com
|