maverick-wave 4.27.0 → 4.28.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/.claude/skills/mw-maverick-wave/SKILL.md +5 -3
- package/.claude/skills/mw-maverick-wave/examples/static-landing-page.md +2 -2
- package/.claude/skills/mw-maverick-wave/references/components.md +48 -0
- package/.claude/skills/mw-maverick-wave/references/javascript.md +1 -0
- package/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/maverick-wave.min.css +2 -2
- package/maverick-wave.min.js +1 -1
- package/package.json +2 -2
- package/src/js/main.js +51 -0
- package/src/partials/header-utilities-container.html +192 -5
- package/src/scss/components/_flag.scss +309 -0
- package/src/scss/components/_index.scss +2 -0
- package/src/scss/components/_lang-switch.scss +116 -0
|
@@ -44,14 +44,14 @@ Load the one you need - do not read them all up front.
|
|
|
44
44
|
```html
|
|
45
45
|
<link
|
|
46
46
|
rel="stylesheet"
|
|
47
|
-
href="https://cdn.jsdelivr.net/npm/maverick-wave@4.
|
|
47
|
+
href="https://cdn.jsdelivr.net/npm/maverick-wave@4.28.0/maverick-wave.min.css"
|
|
48
48
|
/>
|
|
49
49
|
<link
|
|
50
50
|
rel="stylesheet"
|
|
51
51
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"
|
|
52
52
|
/>
|
|
53
53
|
...
|
|
54
|
-
<script src="https://cdn.jsdelivr.net/npm/maverick-wave@4.
|
|
54
|
+
<script src="https://cdn.jsdelivr.net/npm/maverick-wave@4.28.0/maverick-wave.min.js"></script>
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
Pin the version. The JS file is optional and only for server-rendered/static pages -
|
|
@@ -221,7 +221,9 @@ feature frame) ·
|
|
|
221
221
|
|
|
222
222
|
**Navigation** `mw-header` + `mw-navbar` · `mw-breadcrumbs` · `mw-pagination` ·
|
|
223
223
|
`mw-dropdown` (+ `-menu`, `-item`, `-item-danger`, `-divider`, `-label`,
|
|
224
|
-
`-caret`, `-end`, `-up`) · `mw-
|
|
224
|
+
`-caret`, `-end`, `-up`) · `mw-lang-switch` (+ `-code`, `-name`, `-check`,
|
|
225
|
+
`inverted`) · `mw-flag` (+ 23 country codes) ·
|
|
226
|
+
`mw-section-nav` (`references/layout.md`)
|
|
225
227
|
|
|
226
228
|
**Media & content** `mw-avatar` (+ `initials`, `group`) · `mw-gallery` ·
|
|
227
229
|
`mw-image-slider` · `mw-blog-post` · `mw-testimonial` (+ `-source`, `-detail`,
|
|
@@ -20,7 +20,7 @@ accordion FAQ.
|
|
|
20
20
|
|
|
21
21
|
<link
|
|
22
22
|
rel="stylesheet"
|
|
23
|
-
href="https://cdn.jsdelivr.net/npm/maverick-wave@4.
|
|
23
|
+
href="https://cdn.jsdelivr.net/npm/maverick-wave@4.28.0/maverick-wave.min.css"
|
|
24
24
|
/>
|
|
25
25
|
<link
|
|
26
26
|
rel="stylesheet"
|
|
@@ -479,7 +479,7 @@ accordion FAQ.
|
|
|
479
479
|
<div class="mw-modal-backdrop" onclick="closeModal('demo')"></div>
|
|
480
480
|
</div>
|
|
481
481
|
|
|
482
|
-
<script src="https://cdn.jsdelivr.net/npm/maverick-wave@4.
|
|
482
|
+
<script src="https://cdn.jsdelivr.net/npm/maverick-wave@4.28.0/maverick-wave.min.js"></script>
|
|
483
483
|
<script>
|
|
484
484
|
// The only thing the shipped script does not cover: opening a modal.
|
|
485
485
|
// Closing works through .mw-modal-close, the backdrop is wired above.
|
|
@@ -1170,6 +1170,54 @@ your own it is `:has(.mw-dropdown[open]) { overflow: visible }`.
|
|
|
1170
1170
|
On a coarse pointer the rows grow to 2.75rem and the menu takes at least the
|
|
1171
1171
|
trigger's full width.
|
|
1172
1172
|
|
|
1173
|
+
## Language switcher
|
|
1174
|
+
|
|
1175
|
+
A `mw-dropdown` with a quieter trigger: no fill and no border until it is
|
|
1176
|
+
hovered, so a header bar does not turn into a row of competing buttons.
|
|
1177
|
+
|
|
1178
|
+
```html
|
|
1179
|
+
<details class="mw-dropdown mw-dropdown-end mw-lang-switch">
|
|
1180
|
+
<summary aria-label="Language: Deutsch">
|
|
1181
|
+
<span class="mw-flag mw-flag-de"></span>
|
|
1182
|
+
<span class="mw-lang-switch-code">de</span>
|
|
1183
|
+
<i class="fas fa-chevron-down mw-dropdown-caret"></i>
|
|
1184
|
+
</summary>
|
|
1185
|
+
<div class="mw-dropdown-menu">
|
|
1186
|
+
<button
|
|
1187
|
+
type="button"
|
|
1188
|
+
class="mw-dropdown-item mw-active"
|
|
1189
|
+
aria-current="true"
|
|
1190
|
+
data-mw-lang="de"
|
|
1191
|
+
>
|
|
1192
|
+
<span class="mw-flag mw-flag-de"></span>
|
|
1193
|
+
<span class="mw-lang-switch-name" lang="de">Deutsch</span>
|
|
1194
|
+
<i class="fas fa-check mw-lang-switch-check"></i>
|
|
1195
|
+
</button>
|
|
1196
|
+
<button type="button" class="mw-dropdown-item" data-mw-lang="en">
|
|
1197
|
+
<span class="mw-flag mw-flag-gb"></span>
|
|
1198
|
+
<span class="mw-lang-switch-name" lang="en">English</span>
|
|
1199
|
+
<i class="fas fa-check mw-lang-switch-check"></i>
|
|
1200
|
+
</button>
|
|
1201
|
+
</div>
|
|
1202
|
+
</details>
|
|
1203
|
+
```
|
|
1204
|
+
|
|
1205
|
+
The two-letter code carries the state, not the flag: a flag is a country and
|
|
1206
|
+
never a language - no country stands for English. Write each language name in
|
|
1207
|
+
its own language and put `lang="fr"` on it, so a screen reader pronounces it
|
|
1208
|
+
instead of spelling it out.
|
|
1209
|
+
|
|
1210
|
+
Parts: `mw-lang-switch-code`, `-name`, `-check` (the tick, shown by `mw-active`
|
|
1211
|
+
on the item and kept in the layout while hidden). `mw-lang-switch-inverted` is
|
|
1212
|
+
for a dark bar built without `mw-header`; inside `mw-header` those colours apply
|
|
1213
|
+
on their own.
|
|
1214
|
+
|
|
1215
|
+
Flags: `mw-flag` plus `mw-flag-<iso>` for de, at, ch, gb, us, ie, fr, it, es,
|
|
1216
|
+
pt, nl, be, pl, hu, ro, bg, ua, se, dk, no, fi, tr and jp - CSS gradients, all
|
|
1217
|
+
in the same 4:3 box whatever the real ratio. Never an emoji flag: Windows ships
|
|
1218
|
+
no glyphs for them. Anything outside the set goes as an `<img>` or an inline
|
|
1219
|
+
`<svg>` inside `mw-flag`.
|
|
1220
|
+
|
|
1173
1221
|
## Keyboard keys
|
|
1174
1222
|
|
|
1175
1223
|
`<kbd>` is styled directly, so a shortcut in prose needs no class:
|
|
@@ -45,6 +45,7 @@ classes are the entire contract.
|
|
|
45
45
|
| Header login button | Swaps the FontAwesome lock icon | Bind the icon class |
|
|
46
46
|
| Color swatches | Showcase-only (prints computed hex values) | Not needed |
|
|
47
47
|
| Dropdown | Delegated to the document: closes the open `mw-dropdown` on Escape, on a click elsewhere and on a click on a `mw-dropdown-item`, and returns focus to the `summary` | The `<details>` does the opening, the keyboard and the state on its own. Rebuild only the two behaviours markup cannot express - or bind `[attr.open]` and keep them in the component |
|
|
48
|
+
| Language switcher | Keeps the trigger's flag and code in step with the chosen item, moves `mw-active` and `aria-current`, and fires `mw-language-change` (`detail: { lang, name }`) on the switcher | Bind the trigger from your locale signal and switch the language in your own i18n service; the menu itself is a `<details>` and needs nothing |
|
|
48
49
|
|
|
49
50
|
## A note on the state class
|
|
50
51
|
|
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ Patch releases are only for test purposes - here I only document major and minor
|
|
|
6
6
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
7
7
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## [4.28.0] - 2026-09-08
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- language switcher in header
|
|
14
|
+
|
|
9
15
|
## [4.27.0] - 2026-09-07
|
|
10
16
|
|
|
11
17
|
### Fixed
|
package/README.md
CHANGED
|
@@ -40,12 +40,12 @@ The result is a framework that balances utility with simplicity, offering develo
|
|
|
40
40
|
<title>My MaverickWave Project</title>
|
|
41
41
|
<link
|
|
42
42
|
rel="stylesheet"
|
|
43
|
-
href="https://cdn.jsdelivr.net/npm/maverick-wave@4.
|
|
43
|
+
href="https://cdn.jsdelivr.net/npm/maverick-wave@4.28.0/maverick-wave.min.css"
|
|
44
44
|
/>
|
|
45
45
|
</head>
|
|
46
46
|
<body>
|
|
47
47
|
<!-- Your content here -->
|
|
48
|
-
<script src="https://cdn.jsdelivr.net/npm/maverick-wave@4.
|
|
48
|
+
<script src="https://cdn.jsdelivr.net/npm/maverick-wave@4.28.0/maverick-wave.min.js"></script>
|
|
49
49
|
</body>
|
|
50
50
|
</html>
|
|
51
51
|
```
|