maverick-wave 3.11.0 → 4.1.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.
Files changed (58) hide show
  1. package/.claude/skills/maverick-wave/SKILL.md +59 -30
  2. package/.claude/skills/maverick-wave/examples/angular-form.md +1 -1
  3. package/.claude/skills/maverick-wave/examples/angular-services.md +15 -8
  4. package/.claude/skills/maverick-wave/examples/static-landing-page.md +4 -4
  5. package/.claude/skills/maverick-wave/references/components.md +269 -25
  6. package/.claude/skills/maverick-wave/references/forms.md +8 -4
  7. package/.claude/skills/maverick-wave/references/javascript.md +20 -8
  8. package/.claude/skills/maverick-wave/references/layout.md +48 -3
  9. package/.claude/skills/maverick-wave/references/theming.md +34 -25
  10. package/CHANGELOG.md +17 -26
  11. package/index.html +25 -0
  12. package/maverick-wave.min.css +2 -2
  13. package/maverick-wave.min.js +1 -1
  14. package/package.json +2 -2
  15. package/src/js/main.js +314 -20
  16. package/src/partials/accordions-container.html +2 -2
  17. package/src/partials/button-bar-container.html +4 -2
  18. package/src/partials/buttons-container.html +35 -0
  19. package/src/partials/calendar-container.html +205 -0
  20. package/src/partials/cards-container.html +43 -0
  21. package/src/partials/documentation-container.html +3 -0
  22. package/src/partials/form-container.html +1 -1
  23. package/src/partials/get-started-container.html +2 -2
  24. package/src/partials/kanban-container.html +680 -715
  25. package/src/partials/modals-container.html +5 -5
  26. package/src/partials/pagination-container.html +50 -13
  27. package/src/partials/segmented-container.html +66 -0
  28. package/src/partials/tables-container.html +96 -24
  29. package/src/partials/tabs-container.html +16 -6
  30. package/src/partials/tags-container.html +15 -0
  31. package/src/partials/timelines-container.html +2 -2
  32. package/src/partials/utilities-container.html +81 -0
  33. package/src/scss/abstracts/_mixins.scss +34 -0
  34. package/src/scss/abstracts/_variables.scss +4 -0
  35. package/src/scss/base/_base.scss +21 -0
  36. package/src/scss/components/_accordions.scss +2 -0
  37. package/src/scss/components/_button-bar.scss +6 -0
  38. package/src/scss/components/_buttons.scss +67 -0
  39. package/src/scss/components/_calendar.scss +290 -0
  40. package/src/scss/components/_content-slider.scss +1 -0
  41. package/src/scss/components/_index.scss +2 -0
  42. package/src/scss/components/_modals.scss +15 -4
  43. package/src/scss/components/_pagination.scss +68 -64
  44. package/src/scss/components/_segmented.scss +85 -0
  45. package/src/scss/components/_tables.scss +16 -0
  46. package/src/scss/components/_tabs.scss +15 -0
  47. package/src/scss/components/_tags.scss +16 -0
  48. package/src/scss/components/_theme-toggle.scss +2 -0
  49. package/src/scss/components/_timelines.scss +3 -0
  50. package/src/scss/form-elements/_form.scss +13 -7
  51. package/src/scss/layout/_header.scss +3 -0
  52. package/src/scss/layout/_main.scss +5 -1
  53. package/src/scss/layout/_section.scss +1 -1
  54. package/src/scss/utilities/_accessibility.scss +14 -0
  55. package/src/scss/utilities/_flex.scss +17 -0
  56. package/src/scss/utilities/_index.scss +2 -0
  57. package/src/scss/utilities/_text.scss +17 -5
  58. package/src/scss/utilities/_touch-targets.scss +54 -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@3.10.0/maverick-wave.min.css"
47
+ href="https://cdn.jsdelivr.net/npm/maverick-wave@4.0.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@3.10.0/maverick-wave.min.js"></script>
54
+ <script src="https://cdn.jsdelivr.net/npm/maverick-wave@4.0.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 -
@@ -99,30 +99,39 @@ bundled. Load it yourself or override the token.
99
99
  - Size variants: `-sm`, `-lg`, sometimes `-xs` / `-xl`. The unsuffixed class is
100
100
  the medium size.
101
101
 
102
- ### State classes are not uniform - this is the single most common source of bugs
103
-
104
- | Component | State class |
105
- | ----------------------------------------------------------------- | ----------------------------------- |
106
- | Accordion header + content | `active` (no prefix) |
107
- | Tabs nav item + panel | `active` (no prefix) |
108
- | Navbar link | `active` (no prefix) |
109
- | Timeline step (`mw-timeline-big-step`, `mw-timeline-simple-step`) | `active` (no prefix) |
110
- | Image slider overlay image + control button | `active` (no prefix) |
111
- | Button, pressed/selected look | `active` (no prefix) |
112
- | Theme toggle | `active` (no prefix) |
113
- | Burger button + navbar drawer | `open` (no prefix) |
114
- | Gallery dot | `mw-active` |
115
- | Stepper indicator / label / connector / step | `mw-active`, `mw-done` |
116
- | Checkbox list item (`li`) | `mw-selected` |
117
- | Kanban composer (open) | `mw-active` |
118
- | Kanban ticket being edited | `mw-kanban-editing` |
119
- | Modal overlay | `mw-modal-open` |
120
- | Alert, after dismissal | `mw-alert-closed` (`display: none`) |
121
- | Field wrapper in error | `mw-field-has-error` |
122
- | Single form control in error | `mw-form-element-error` |
123
-
124
- Angular: `[class.active]="isOpen"` and `[class.mw-active]="i === current"` - the
125
- binding target must match the table exactly.
102
+ ### State classes
103
+
104
+ Since 4.0.0 there is one spelling for "this one is on": **`mw-active`**. It
105
+ works on every component that previously wanted a bare `active` - accordion,
106
+ tabs, navbar link, timeline step, image slider, button, theme toggle, segmented
107
+ control - alongside gallery dot, stepper and kanban composer, which used it all
108
+ along. Write `mw-active` and stop looking things up.
109
+
110
+ The unprefixed `active` is still styled everywhere it used to be, so existing
111
+ markup keeps working, but it is deprecated. The shipped `main.js` clears both
112
+ when it switches a state off, precisely so a stale `active` in the HTML cannot
113
+ leave a second tab lit.
114
+
115
+ The classes that mean something _other_ than "on" keep their own names:
116
+
117
+ | Component | State class |
118
+ | -------------------------------------------- | ----------------------------------- |
119
+ | Anything switchable, "on" | `mw-active` (`active` deprecated) |
120
+ | Burger button + navbar drawer | `open` (no prefix) |
121
+ | Stepper indicator / label / connector / step | `mw-active`, `mw-done` |
122
+ | Checkbox list item (`li`) | `mw-selected` |
123
+ | Calendar day, picked | `mw-selected` |
124
+ | Kanban ticket being edited | `mw-kanban-editing` |
125
+ | Modal overlay | `mw-modal-open` |
126
+ | Alert, after dismissal | `mw-alert-closed` (`display: none`) |
127
+ | Field wrapper in error | `mw-field-has-error` |
128
+ | Single form control in error | `mw-form-element-error` |
129
+
130
+ `mw-active` and `mw-selected` are not the same thing and not interchangeable:
131
+ active is the one of several that is currently showing, selected is a choice the
132
+ user made and can undo.
133
+
134
+ Angular: `[class.mw-active]="i === current"`.
126
135
 
127
136
  ## Scales
128
137
 
@@ -149,14 +158,16 @@ keys at all (negative gap is invalid CSS and is not generated).
149
158
  Everything below is documented in `references/components.md` unless marked otherwise.
150
159
 
151
160
  **Actions** `mw-btn` (+ `primary`, `secondary`, `danger`, `success`, `outline`,
152
- `link`, `link-muted`, `sm`, `lg`) · `mw-btn-mini` · `mw-button-bar`
161
+ `link`, `link-muted`, `plain`, `sm`, `lg`) · `mw-btn-mini` · `mw-button-bar`
162
+ (+ `left`, `right`, `center`, `between`) · `mw-segmented` · `mw-actions-note`
153
163
 
154
164
  **Containers** `mw-card` (+ `simple`, `lg`, `xl`, `stack`, badge, ribbon) ·
155
165
  `mw-panel` · `mw-tile` · `mw-accordion` · `mw-tabs` · `mw-modal` ·
156
166
  `mw-item-list` family
157
167
 
158
168
  **Data & status** `mw-table` (+ `subtle`, `sticky-head`, `cards`, `compact`,
159
- `hover`, responsive wrappers) · `mw-kanban` (+ `plain`, `compact`) · `mw-tag` /
169
+ `hover`, responsive wrappers) · `mw-kanban` (+ `plain`, `compact`) ·
170
+ `mw-calendar` (+ `compact`, `plain`) · `mw-tag` /
160
171
  `mw-tags` · `mw-info` / `mw-info-mini` / `mw-info-counter` · `mw-progress-bar` ·
161
172
  `mw-rating` · `mw-meta-header` · `mw-stepper` · `mw-timeline-big` /
162
173
  `mw-timeline-simple`
@@ -176,7 +187,12 @@ Everything below is documented in `references/components.md` unless marked other
176
187
  `mw-input-group` · `mw-form` / `mw-form-group` / `mw-form-actions` · `mw-login`
177
188
 
178
189
  **Layout** (`references/layout.md`) `mw-main` · `mw-container` · `mw-content` ·
179
- `mw-section` · `mw-page-header` · `mw-grid-*` · `mw-hero` · `mw-footer`
190
+ `mw-section` · `mw-page-header` · `mw-grid-*` · `mw-row-split` · `mw-hero` ·
191
+ `mw-footer`
192
+
193
+ **Utilities** (`references/layout.md`) `mw-sr-only` · `mw-row-split`
194
+ (+ `center`) · `mw-text-numeric` / `mw-text-currency` · spacing, flex, display,
195
+ text
180
196
 
181
197
  ## Pitfalls
182
198
 
@@ -213,7 +229,20 @@ Everything below is documented in `references/components.md` unless marked other
213
229
  set.
214
230
  10. **Browser floor: `color-mix()`** - Chrome 111+, Safari 16.2+, Firefox 113+.
215
231
  Older browsers get no colours at all, not merely worse ones.
216
- 11. **A component host between a container and its children breaks the layout,
232
+ 11. **Touch targets grow on their own.** On `pointer: coarse` or below 768px,
233
+ `mw-btn-sm`, `mw-input-sm`, `mw-select-sm` and `mw-textarea-sm` get a 2.5rem
234
+ minimum height, a tab 2.75rem, a calendar day 44px. `mw-btn-mini` keeps its
235
+ 18px circle - it sits in tag rows and table cells where a bigger one would
236
+ shift the layout - and grows its _hit area_ to 28px via a pseudo-element.
237
+ Nothing to switch on, and no reason to write the media query again in an app.
238
+ 12. **`mw-empty-state` has a `-desc`, not a `-text`.** The parts are
239
+ `mw-empty-state-icon`, `-title`, `-desc`, plus the size variant
240
+ `mw-empty-state-sm`. Invented names fail silently, as always.
241
+ 13. **`mw-text-numeric` gives digits, `mw-text-currency` gives a money column.**
242
+ The first is only `tabular-nums` - for a clock, a counter, an ID. The second
243
+ adds right alignment and `nowrap`. Before 4.0.0 the first did both, which
244
+ is why people wrote the declaration out by hand.
245
+ 14. **A component host between a container and its children breaks the layout,
217
246
  silently.** Every `mw-*` flex or grid container styles its _children_ -
218
247
  `mw-grid-*`, `mw-tags`, `mw-button-bar`, `mw-form-actions`, `mw-modal-footer`,
219
248
  `mw-toast-stack`. In plain HTML the children are right there; in a SPA a
@@ -216,7 +216,7 @@ export class ProjectFormComponent {
216
216
  </div>
217
217
 
218
218
  <div class="mw-form-actions">
219
- <p class="mw-form-actions-hint">Fields marked with * are required.</p>
219
+ <p class="mw-actions-note">Fields marked with * are required.</p>
220
220
  <button type="button" class="mw-btn mw-btn-outline" (click)="form.reset()">
221
221
  Reset
222
222
  </button>
@@ -37,7 +37,7 @@ The framework's own toggle markup, driven by the service:
37
37
  ```html
38
38
  <div
39
39
  class="mw-theme-toggle"
40
- [class.active]="theme.light()"
40
+ [class.mw-active]="theme.light()"
41
41
  (click)="theme.toggle()"
42
42
  >
43
43
  <div class="mw-theme-toggle-slider">
@@ -205,13 +205,16 @@ export class ConfirmDialogComponent {
205
205
  <div class="mw-accordion-item">
206
206
  <div
207
207
  class="mw-accordion-header"
208
- [class.active]="openIndex() === i"
208
+ [class.mw-active]="openIndex() === i"
209
209
  (click)="toggle(i)"
210
210
  >
211
211
  <h3>{{ item.question }}</h3>
212
212
  <i class="fas fa-chevron-down mw-accordion-icon"></i>
213
213
  </div>
214
- <div class="mw-accordion-content" [class.active]="openIndex() === i">
214
+ <div
215
+ class="mw-accordion-content"
216
+ [class.mw-active]="openIndex() === i"
217
+ >
215
218
  <div class="mw-accordion-content-inner">{{ item.answer }}</div>
216
219
  </div>
217
220
  </div>
@@ -241,7 +244,7 @@ export class FaqComponent {
241
244
  @for (tab of tabs; track tab.key) {
242
245
  <div
243
246
  class="mw-tabs-nav-item"
244
- [class.active]="active() === tab.key"
247
+ [class.mw-active]="active() === tab.key"
245
248
  (click)="active.set(tab.key)"
246
249
  >
247
250
  {{ tab.label }}
@@ -249,8 +252,12 @@ export class FaqComponent {
249
252
  }
250
253
  </div>
251
254
  <div class="mw-tabs-content">
252
- <div class="mw-tabs-panel" [class.active]="active() === 'details'">…</div>
253
- <div class="mw-tabs-panel" [class.active]="active() === 'history'">…</div>
255
+ <div class="mw-tabs-panel" [class.mw-active]="active() === 'details'">
256
+
257
+ </div>
258
+ <div class="mw-tabs-panel" [class.mw-active]="active() === 'history'">
259
+
260
+ </div>
254
261
  </div>
255
262
  </div>
256
263
  ```
@@ -281,7 +288,7 @@ on every navigation.
281
288
  <a
282
289
  class="mw-navbar-link"
283
290
  [routerLink]="item.path"
284
- routerLinkActive="active"
291
+ routerLinkActive="mw-active"
285
292
  >
286
293
  {{ item.label }}
287
294
  </a>
@@ -324,7 +331,7 @@ export class HeaderComponent {
324
331
  }
325
332
  ```
326
333
 
327
- `routerLinkActive="active"` replaces the scroll spy - the framework only cares
334
+ `routerLinkActive="mw-active"` replaces the scroll spy - the framework only cares
328
335
  about the class name.
329
336
 
330
337
  ## Progress bar
@@ -15,7 +15,7 @@ wired up by hand.
15
15
 
16
16
  <link
17
17
  rel="stylesheet"
18
- href="https://cdn.jsdelivr.net/npm/maverick-wave@3.10.0/maverick-wave.min.css"
18
+ href="https://cdn.jsdelivr.net/npm/maverick-wave@4.0.0/maverick-wave.min.css"
19
19
  />
20
20
  <link
21
21
  rel="stylesheet"
@@ -234,11 +234,11 @@ wired up by hand.
234
234
 
235
235
  <div class="mw-accordion">
236
236
  <div class="mw-accordion-item">
237
- <div class="mw-accordion-header active">
237
+ <div class="mw-accordion-header mw-active">
238
238
  <h3>Where is the data stored?</h3>
239
239
  <i class="fas fa-chevron-down mw-accordion-icon"></i>
240
240
  </div>
241
- <div class="mw-accordion-content active">
241
+ <div class="mw-accordion-content mw-active">
242
242
  <div class="mw-accordion-content-inner">
243
243
  <p>In Frankfurt, in our own data centre.</p>
244
244
  </div>
@@ -332,7 +332,7 @@ wired up by hand.
332
332
  <div class="mw-modal-backdrop" onclick="closeModal('demo')"></div>
333
333
  </div>
334
334
 
335
- <script src="https://cdn.jsdelivr.net/npm/maverick-wave@3.10.0/maverick-wave.min.js"></script>
335
+ <script src="https://cdn.jsdelivr.net/npm/maverick-wave@4.0.0/maverick-wave.min.js"></script>
336
336
  <script>
337
337
  // The only thing the shipped script does not cover: opening a modal.
338
338
  // Closing works through .mw-modal-close, the backdrop is wired above.