@watermarkinsights/ripple 5.32.1-alpha.1 → 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-6f8f7d34.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 +72 -32
- package/dist/docs/docs.json +16 -8
- package/dist/docs/props-reference.json +1 -1
- 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 +52 -12
- package/dist/esm/{app-globals-668b9d5c.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-44c372a6.js → p-5cf61da4.js} +1 -1
- package/dist/ripple/{p-b9a39381.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 +70 -30
- package/dist/types/components.d.ts +292 -68
- package/package.json +3 -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"; }
|
|
@@ -28,48 +28,88 @@ import { globalMessages } from "../../global/intl";
|
|
|
28
28
|
* - Use `wm-navigation-hamburger` (a separate component) as the external toggle. It communicates
|
|
29
29
|
* with wm-navigation via the `wmNavigationHamburgerClicked` window event and a document-wide
|
|
30
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
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
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.
|
|
35
38
|
*
|
|
36
39
|
* Required host setup:
|
|
37
40
|
* - Never set `display: none` or `visibility: hidden` on the host element or its wrapper
|
|
38
41
|
* container. The component manages its own visibility internally, and hiding the container
|
|
39
42
|
* from the outside blocks the overlay from appearing when the hamburger is triggered.
|
|
40
43
|
* - Give the element that wraps wm-navigation and the page content (commonly `<main>`) a flex
|
|
41
|
-
* or grid layout
|
|
42
|
-
*
|
|
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.
|
|
43
58
|
*
|
|
44
59
|
* @example {html} Basic navigation
|
|
45
|
-
* <
|
|
46
|
-
*
|
|
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">
|
|
47
82
|
* <wm-navigation-hamburger nav-id="main-nav"></wm-navigation-hamburger>
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* </
|
|
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>
|
|
58
93
|
*
|
|
59
94
|
* @example {react} Basic navigation
|
|
60
|
-
* <
|
|
61
|
-
* <
|
|
95
|
+
* <div style={{ display: "flex", flexDirection: "column", height: "100vh" }}>
|
|
96
|
+
* <header className="app-header">
|
|
62
97
|
* <WmNavigationHamburger navId="main-nav" />
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* <
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
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>
|
|
73
113
|
*
|
|
74
114
|
* @requiredSetup
|
|
75
115
|
* - `wm-navigation-item` — slot at least one as a child; each supplies a link the collapsible
|
|
@@ -176,9 +216,9 @@ export class Navigation {
|
|
|
176
216
|
} }));
|
|
177
217
|
}
|
|
178
218
|
render() {
|
|
179
|
-
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: () => {
|
|
180
220
|
this.open = !this.open;
|
|
181
|
-
} })), 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() }))));
|
|
182
222
|
}
|
|
183
223
|
static get is() { return "wm-navigation"; }
|
|
184
224
|
static get encapsulation() { return "shadow"; }
|
package/dist/docs/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-09-
|
|
2
|
+
"timestamp": "2026-09-08T16:58:32",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.21.0",
|
|
@@ -7683,15 +7683,15 @@
|
|
|
7683
7683
|
},
|
|
7684
7684
|
{
|
|
7685
7685
|
"name": "usageNotes",
|
|
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
|
|
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<header class=\"app-
|
|
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<
|
|
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
7695
|
},
|
|
7696
7696
|
{
|
|
7697
7697
|
"name": "requiredSetup",
|
|
@@ -7800,8 +7800,12 @@
|
|
|
7800
7800
|
"filePath": "src/components/wm-navigation/wm-navigation-hamburger.tsx",
|
|
7801
7801
|
"encapsulation": "shadow",
|
|
7802
7802
|
"tag": "wm-navigation-hamburger",
|
|
7803
|
-
"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.",
|
|
7804
7804
|
"docsTags": [
|
|
7805
|
+
{
|
|
7806
|
+
"name": "category",
|
|
7807
|
+
"text": "Navigation"
|
|
7808
|
+
},
|
|
7805
7809
|
{
|
|
7806
7810
|
"name": "keyboardInteraction",
|
|
7807
7811
|
"text": "- **Enter / Space**: Toggles the navigation open/closed."
|
|
@@ -7812,15 +7816,19 @@
|
|
|
7812
7816
|
},
|
|
7813
7817
|
{
|
|
7814
7818
|
"name": "usageNotes",
|
|
7815
|
-
"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."
|
|
7816
7820
|
},
|
|
7817
7821
|
{
|
|
7818
7822
|
"name": "example",
|
|
7819
|
-
"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>"
|
|
7820
7824
|
},
|
|
7821
7825
|
{
|
|
7822
7826
|
"name": "example",
|
|
7823
|
-
"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."
|
|
7824
7832
|
}
|
|
7825
7833
|
],
|
|
7826
7834
|
"usage": {},
|
|
@@ -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" />
|
|
@@ -25,18 +25,33 @@ _None documented_
|
|
|
25
25
|
- Use `wm-navigation-hamburger` (a separate component) as the external toggle. It communicates
|
|
26
26
|
with wm-navigation via the `wmNavigationHamburgerClicked` window event and a document-wide
|
|
27
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
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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.
|
|
32
35
|
|
|
33
36
|
Required host setup:
|
|
34
37
|
- Never set `display: none` or `visibility: hidden` on the host element or its wrapper
|
|
35
38
|
container. The component manages its own visibility internally, and hiding the container
|
|
36
39
|
from the outside blocks the overlay from appearing when the hamburger is triggered.
|
|
37
40
|
- Give the element that wraps wm-navigation and the page content (commonly `<main>`) a flex
|
|
38
|
-
or grid layout
|
|
39
|
-
|
|
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.
|
|
40
55
|
|
|
41
56
|
**Props:**
|
|
42
57
|
- `open` -- Controls the open/closed state of the collapsible navigation. Has no effect
|
|
@@ -82,10 +97,29 @@ wm-navigation-hamburger to keep its `aria-expanded` state in sync.
|
|
|
82
97
|
_Basic navigation_
|
|
83
98
|
|
|
84
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">
|
|
85
121
|
<header class="app-header">
|
|
86
|
-
<div class="app-header__hamburger">
|
|
87
122
|
<wm-navigation-hamburger nav-id="main-nav"></wm-navigation-hamburger>
|
|
88
|
-
</div>
|
|
89
123
|
<a class="app-header__logo" href="/">App Name</a>
|
|
90
124
|
</header>
|
|
91
125
|
<main class="app-main">
|
|
@@ -95,22 +129,28 @@ _Basic navigation_
|
|
|
95
129
|
</wm-navigation>
|
|
96
130
|
<div class="app-main__content">Page content</div>
|
|
97
131
|
</main>
|
|
132
|
+
</div>
|
|
98
133
|
```
|
|
99
134
|
|
|
100
135
|
_Basic navigation_
|
|
101
136
|
|
|
102
137
|
```react
|
|
138
|
+
<div style={{ display: "flex", flexDirection: "column", height: "100vh" }}>
|
|
103
139
|
<header className="app-header">
|
|
104
|
-
<div className="app-header__hamburger">
|
|
105
140
|
<WmNavigationHamburger navId="main-nav" />
|
|
106
|
-
</div>
|
|
107
141
|
<a className="app-header__logo" href="/">App Name</a>
|
|
108
142
|
</header>
|
|
109
|
-
<main
|
|
143
|
+
<main
|
|
144
|
+
className="app-main"
|
|
145
|
+
style={{ display: "flex", alignItems: "stretch", flex: "1 1 auto", minHeight: 0 }}
|
|
146
|
+
>
|
|
110
147
|
<WmNavigation id="main-nav">
|
|
111
148
|
<WmNavigationItem href="/dashboard" text="Dashboard" active={true} />
|
|
112
149
|
<WmNavigationItem href="/reports" text="Reports" />
|
|
113
150
|
</WmNavigation>
|
|
114
|
-
<div className="app-main__content"
|
|
151
|
+
<div className="app-main__content" style={{ overflowY: "auto", minHeight: 0 }}>
|
|
152
|
+
Page content
|
|
153
|
+
</div>
|
|
115
154
|
</main>
|
|
155
|
+
</div>
|
|
116
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
|
|
@@ -102,9 +102,9 @@ const Navigation = class {
|
|
|
102
102
|
} }));
|
|
103
103
|
}
|
|
104
104
|
render() {
|
|
105
|
-
return (h(Host, { key: '
|
|
105
|
+
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: () => {
|
|
106
106
|
this.open = !this.open;
|
|
107
|
-
} })), h("ul", { key: '
|
|
107
|
+
} })), 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() }))));
|
|
108
108
|
}
|
|
109
109
|
static get delegatesFocus() { return true; }
|
|
110
110
|
get el() { return getElement(this); }
|
|
@@ -153,7 +153,7 @@ const NavigationHamburger = class {
|
|
|
153
153
|
this.wmNavigationHamburgerClicked.emit();
|
|
154
154
|
}
|
|
155
155
|
render() {
|
|
156
|
-
return (h(Host, { key: '
|
|
156
|
+
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" }))));
|
|
157
157
|
}
|
|
158
158
|
static get delegatesFocus() { return true; }
|
|
159
159
|
get el() { return getElement(this); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./p-83c3db60.js";window.navigator.plugins.length>0&&console.log("%cRipple component library %c%s","color: #575195; font-weight: bold","font-weight: bold","5.32.1-alpha.
|
|
1
|
+
import"./p-83c3db60.js";window.navigator.plugins.length>0&&console.log("%cRipple component library %c%s","color: #575195; font-weight: bold","font-weight: bold","5.32.1-alpha.2"),window.addEventListener("keydown",(function(n){if("Tab"==n.key){var o=new Event("wmUserIsTabbing");window.dispatchEvent(o),document.querySelector("body").classList.add("wmcl-user-is-tabbing")}"ArrowLeft"!=n.key&&"ArrowUp"!=n.key&&"ArrowRight"!=n.key&&"ArrowDown"!=n.key||(o=new Event("wmUserIsKeying"),window.dispatchEvent(o),document.querySelector("body").classList.add("wmcl-user-is-keying"))})),window.addEventListener("mousedown",(function(){var n=new Event("wmUserIsNotTabbing");window.dispatchEvent(n),document.querySelector("body").classList.remove("wmcl-user-is-tabbing"),document.querySelector("body").classList.remove("wmcl-user-is-keying")}));const n=document.createElement("div");n.id="wm-tooltip-container";const o=document.createElement("div");o.id="wm-tooltip",o.classList.add("wm-tooltip"),o.setAttribute("popover","manual"),o.setAttribute("aria-hidden","true");const t=document.createElement("style");t.textContent="\n.wm-tooltip {\n position: fixed;\n overflow: hidden;\n pointer-events: none;\n line-height: normal;\n font-family: inherit;\n font-size: 0.875rem;\n text-transform: none;\n font-weight: normal;\n background: var(--wmcolor-tooltip-background);\n color: var(--wmcolor-tooltip-text);\n z-index: 999999;\n max-width: var(--wmTooltipMaxWidth, 13.75rem);\n margin-right: 1.5rem;\n padding: 0.375rem;\n transition-property: opacity;\n transition-delay: 0s;\n opacity: 0;\n inset: unset;\n top: 0;\n left: 0;\n transform: translateZ(0);\n will-change: transform;\n transform: translate(var(--wmTooltipLeft), var(--wmTooltipTop));\n border: none;\n}\n\n.wm-tooltip:popover-open {\n opacity: 0;\n}\n\n.wm-tooltip.show {\n transition-delay: 500ms;\n opacity: 1;\n}\n";const e=document.querySelector("body");e?(document.head.appendChild(t),n.appendChild(o),e.appendChild(n)):document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector("body");document.head.appendChild(t),n.appendChild(o),e.appendChild(n)}));const i=()=>{};export{i as g}
|