@wpmoo/ui 1.0.0-rc.4 → 1.0.0-rc.6

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Moo UI sidebar.js v1.0.0-rc.4 (https://ui.wpmoo.org/)
2
+ * Moo UI sidebar.js v1.0.0-rc.6 (https://ui.wpmoo.org/)
3
3
  * Copyright 2026 WPMoo (https://wpmoo.org)
4
4
  * Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
5
5
  */
@@ -230,7 +230,9 @@ export default class Sidebar {
230
230
  }
231
231
  delete item.dataset.sidebarDropdownPositioned;
232
232
  item.style.removeProperty("--moo-sidebar-dropdown-block-start");
233
+ item.style.removeProperty("--moo-sidebar-dropdown-block-end");
233
234
  item.style.removeProperty("--moo-sidebar-dropdown-inline-start");
235
+ item.style.removeProperty("--moo-sidebar-dropdown-inline-end");
234
236
  }
235
237
 
236
238
  _closeDropdowns(exceptControl = null) {
@@ -259,7 +261,10 @@ export default class Sidebar {
259
261
  const isHeaderWorkspace =
260
262
  control?.classList.contains("sidebar-menu-button--workspace") &&
261
263
  control.closest('[data-slot="sidebar-header"]');
262
- if (!control || !item || !isHeaderWorkspace || !this._isDesktop()) {
264
+ const isFooterAccount =
265
+ control?.classList.contains("sidebar-menu-button--account") &&
266
+ control.closest('[data-slot="sidebar-footer"]');
267
+ if (!control || !item || !(isHeaderWorkspace || isFooterAccount) || !this._isDesktop()) {
263
268
  this._clearDropdownPosition(control);
264
269
  return;
265
270
  }
@@ -267,18 +272,41 @@ export default class Sidebar {
267
272
  this._closeFlyouts();
268
273
  const rect = control.getBoundingClientRect();
269
274
  const gap = 4;
270
- const inlineStart =
271
- this._root.dir === "rtl"
275
+ const sidebar = control.closest('[data-slot="sidebar"]');
276
+ const side = sidebar?.dataset.side || "left";
277
+ const isRtl = this._root.dir === "rtl";
278
+ if (side === "right") {
279
+ const inlineEnd = isRtl
280
+ ? rect.right + gap
281
+ : this._window.innerWidth - rect.left + gap;
282
+ item.style.setProperty(
283
+ "--moo-sidebar-dropdown-inline-end",
284
+ `${Math.round(inlineEnd)}px`
285
+ );
286
+ item.style.removeProperty("--moo-sidebar-dropdown-inline-start");
287
+ } else {
288
+ const inlineStart = isRtl
272
289
  ? this._window.innerWidth - rect.left + gap
273
290
  : rect.right + gap;
274
- item.style.setProperty(
275
- "--moo-sidebar-dropdown-block-start",
276
- `${Math.round(rect.bottom + gap)}px`
277
- );
278
- item.style.setProperty(
279
- "--moo-sidebar-dropdown-inline-start",
280
- `${Math.round(inlineStart)}px`
281
- );
291
+ item.style.setProperty(
292
+ "--moo-sidebar-dropdown-inline-start",
293
+ `${Math.round(inlineStart)}px`
294
+ );
295
+ item.style.removeProperty("--moo-sidebar-dropdown-inline-end");
296
+ }
297
+ if (isHeaderWorkspace) {
298
+ item.style.setProperty(
299
+ "--moo-sidebar-dropdown-block-start",
300
+ `${Math.round(rect.bottom + gap)}px`
301
+ );
302
+ item.style.removeProperty("--moo-sidebar-dropdown-block-end");
303
+ } else {
304
+ item.style.setProperty(
305
+ "--moo-sidebar-dropdown-block-end",
306
+ `${Math.round(this._window.innerHeight - rect.top + gap)}px`
307
+ );
308
+ item.style.removeProperty("--moo-sidebar-dropdown-block-start");
309
+ }
282
310
  item.dataset.sidebarDropdownPositioned = "";
283
311
  }
284
312
 
package/dist/js/slider.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Moo UI slider.js v1.0.0-rc.4 (https://ui.wpmoo.org/)
2
+ * Moo UI slider.js v1.0.0-rc.6 (https://ui.wpmoo.org/)
3
3
  * Copyright 2026 WPMoo (https://wpmoo.org)
4
4
  * Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpmoo/ui",
3
- "version": "1.0.0-rc.4",
3
+ "version": "1.0.0-rc.6",
4
4
  "description": "Bootstrap markup. shadcn feel. A frontend-framework-free component system for server-rendered apps.",
5
5
  "license": "MIT",
6
6
  "author": "WPMoo (https://wpmoo.org)",
@@ -17,7 +17,11 @@
17
17
  "scripts": {
18
18
  "build": ".venv/bin/python build.py",
19
19
  "dev": ".venv/bin/python dev.py",
20
- "test": ".venv/bin/python -m unittest discover -s tests -v",
20
+ "test": ".venv/bin/python scripts/run-test-tier.py run release",
21
+ "test:quick": ".venv/bin/python scripts/run-test-tier.py run quick",
22
+ "test:browser-smoke": ".venv/bin/python scripts/run-test-tier.py run browser-smoke",
23
+ "test:browser-full": ".venv/bin/python scripts/run-test-tier.py run browser-full",
24
+ "test:release": ".venv/bin/python scripts/run-test-tier.py run release",
21
25
  "deploy": "wrangler deploy",
22
26
  "preview": "wrangler dev"
23
27
  },
@@ -94,7 +98,7 @@
94
98
  "devDependencies": {
95
99
  "axe-core": "4.13.0",
96
100
  "chart.js": "4.5.1",
97
- "esbuild": "0.28.1",
101
+ "esbuild": "0.28.2",
98
102
  "wrangler": "^4.120.0"
99
103
  }
100
104
  }
@@ -57,3 +57,9 @@
57
57
  .accordion-flush .accordion-button {
58
58
  font-weight: $font-weight-medium;
59
59
  }
60
+
61
+ // A card owns its own surface, so a nested accordion must let that surface
62
+ // show through instead of painting Bootstrap's body background on top of it.
63
+ .card .accordion {
64
+ --bs-accordion-bg: #{$moo-accordion-contained-bg};
65
+ }
@@ -12,6 +12,36 @@
12
12
  unicode-bidi: plaintext;
13
13
  }
14
14
 
15
+ // Bootstrap raises hovered, focused, and active group buttons above siblings
16
+ // so the current border wins the shared seam. In a mixed-emphasis group (for
17
+ // example primary + outline) pointer interaction paints one pixel into the
18
+ // neighbor and reads like a width jump. Keep keyboard focus, active classes,
19
+ // and checked inputs stacked, but let plain pointer hover/click use DOM order
20
+ // so the joined edge stays visually stable.
21
+ .btn-group > .btn:hover:not(:focus-visible):not(.active),
22
+ .btn-group > .btn:focus:not(:focus-visible):not(.active),
23
+ .btn-group > .btn:active:not(:focus-visible):not(.active),
24
+ .btn-group-vertical > .btn:hover:not(:focus-visible):not(.active),
25
+ .btn-group-vertical > .btn:focus:not(:focus-visible):not(.active),
26
+ .btn-group-vertical > .btn:active:not(:focus-visible):not(.active) {
27
+ z-index: auto;
28
+ }
29
+
30
+ .btn-group > .btn-check:checked + .btn:hover,
31
+ .btn-group > .btn-check:focus + .btn:hover,
32
+ .btn-group-vertical > .btn-check:checked + .btn:hover,
33
+ .btn-group-vertical > .btn-check:focus + .btn:hover {
34
+ z-index: 1;
35
+ }
36
+
37
+ // A button group is one compound control surface; pressing one segment should
38
+ // not translate that segment away from its joined border while siblings stay
39
+ // still. The active color change remains as the press affordance.
40
+ .btn-group > .btn:not(:disabled):not(.disabled):not([aria-disabled="true"]):active,
41
+ .btn-group-vertical > .btn:not(:disabled):not(.disabled):not([aria-disabled="true"]):active {
42
+ transform: none;
43
+ }
44
+
15
45
  // Icon buttons in button groups should stay square, not stretch to fill
16
46
  // the group width (Bootstrap's flex: 1 1 auto makes them rectangular).
17
47
  .btn-group > .btn-icon,
@@ -7,7 +7,7 @@
7
7
  .card {
8
8
  --bs-card-bg: color-mix(in srgb, var(--bs-secondary-bg) #{$moo-card-bg-mix}, var(--bs-body-bg));
9
9
  --bs-card-color: var(--moo-foreground);
10
- --bs-card-border-color: color-mix(in srgb, var(--bs-body-color) #{$moo-card-border-mix}, #{$moo-card-border-mix-base});
10
+ --bs-card-border-color: var(--moo-border);
11
11
  // The reference uses a 14px corner; Bootstrap's shared radius-xl is the
12
12
  // closest token and wins the delta (12px here) per the token-first rule.
13
13
  --bs-card-border-radius: var(--bs-border-radius-xl);
@@ -12,6 +12,7 @@
12
12
  // visible content changed.
13
13
  .datatable {
14
14
  --moo-datatable-min-width: #{$moo-datatable-min-width};
15
+ --moo-datatable-actions-cell-bg: #{$moo-datatable-actions-cell-bg};
15
16
  --moo-datatable-actions-cell-fade-width: #{$moo-datatable-actions-cell-fade-width};
16
17
  --moo-datatable-card-label-width: #{$moo-datatable-card-label-width};
17
18
  --moo-datatable-frame-header-min-height: #{$moo-datatable-frame-header-min-height};
@@ -24,6 +25,10 @@
24
25
  --moo-datatable-bulk-actions-bottom: #{$moo-datatable-bulk-actions-bottom};
25
26
  }
26
27
 
28
+ .card .datatable {
29
+ --moo-datatable-actions-cell-bg: var(--bs-card-bg);
30
+ }
31
+
27
32
  .datatable-table {
28
33
  table-layout: fixed;
29
34
  }
@@ -75,7 +80,7 @@
75
80
  background: linear-gradient(
76
81
  90deg,
77
82
  transparent 0,
78
- var(--bs-body-bg) var(--moo-datatable-actions-cell-fade-width)
83
+ var(--moo-datatable-actions-cell-bg) var(--moo-datatable-actions-cell-fade-width)
79
84
  );
80
85
  }
81
86
 
@@ -84,7 +89,7 @@
84
89
  background: linear-gradient(
85
90
  270deg,
86
91
  transparent 0,
87
- var(--bs-body-bg) var(--moo-datatable-actions-cell-fade-width)
92
+ var(--moo-datatable-actions-cell-bg) var(--moo-datatable-actions-cell-fade-width)
88
93
  );
89
94
  }
90
95
 
@@ -172,6 +177,15 @@
172
177
  width: 100%;
173
178
  }
174
179
 
180
+ // A filter menu is a direct child so Bootstrap can anchor it to the trigger.
181
+ // Clip the joined control while the menu is closed, matching the normal
182
+ // input-group surface; release that clipping only while the menu is open so
183
+ // the positioned dropdown can escape the control without leaking focus or
184
+ // child paint past its rounded border.
185
+ .datatable-searchbar:not(:has(> .dropdown-menu.show)) {
186
+ overflow: hidden;
187
+ }
188
+
175
189
  .datatable-searchbar .datatable-search {
176
190
  flex: 1 1 auto;
177
191
  max-width: none;
@@ -184,7 +198,9 @@
184
198
  position: absolute;
185
199
  inset-block-start: 50%;
186
200
  inset-inline-start: 0.625rem;
187
- z-index: 2;
201
+ // Bootstrap raises a focused form control to z-index: 5. Keep the
202
+ // decorative icon above that opaque surface so focus does not hide it.
203
+ z-index: 6;
188
204
  display: inline-flex;
189
205
  align-items: center;
190
206
  justify-content: center;
@@ -735,6 +751,14 @@
735
751
  background-color: var(--moo-muted-surface);
736
752
  }
737
753
 
754
+ // Sticky action cells paint a gradient instead of using the row's
755
+ // background-color, so selected rows need the same surface at the opaque end
756
+ // of that fade.
757
+ .datatable-row-selected > [data-datatable-column="actions"] {
758
+ --moo-datatable-actions-cell-bg: var(--moo-muted-surface);
759
+ background: var(--moo-muted-surface);
760
+ }
761
+
738
762
  .datatable-card.datatable-row-selected {
739
763
  border-color: var(--moo-border);
740
764
  background-color: var(--moo-muted-surface);
@@ -188,15 +188,55 @@
188
188
  }
189
189
  }
190
190
 
191
+ // The lg Offcanvas breakpoint still renders the sidebar as a drawer on
192
+ // tablets. Keep identity menus inside that drawer until the desktop fixed
193
+ // overlay contract becomes active.
194
+ @include media-breakpoint-between(sm, lg) {
195
+ [data-slot="sidebar-header"] .dropend > .dropdown-menu,
196
+ [data-slot="sidebar-footer"] .dropend > .dropdown-menu {
197
+ left: 0 !important;
198
+ right: 0 !important;
199
+ min-width: 100%;
200
+ margin: 0;
201
+ transform: none !important;
202
+ }
203
+
204
+ [data-slot="sidebar-header"] .dropend > .dropdown-menu {
205
+ top: calc(100% + #{$spacer * 0.25}) !important;
206
+ bottom: auto !important;
207
+ }
208
+
209
+ [data-slot="sidebar-footer"] .dropend > .dropdown-menu {
210
+ top: auto !important;
211
+ bottom: calc(100% + #{$spacer * 0.25}) !important;
212
+ }
213
+ }
214
+
191
215
  @include media-breakpoint-up(lg) {
192
- [data-slot="sidebar-header"] [data-sidebar-dropdown-positioned] > .dropdown-menu {
216
+ [data-slot="sidebar-header"] [data-sidebar-dropdown-positioned] > .dropdown-menu,
217
+ [data-slot="sidebar-footer"] [data-sidebar-dropdown-positioned] > .dropdown-menu {
193
218
  position: fixed !important;
194
219
  z-index: $zindex-dropdown;
195
- inset-block-start: var(--moo-sidebar-dropdown-block-start) !important;
196
- inset-inline-start: var(--moo-sidebar-dropdown-inline-start) !important;
220
+ inset-inline-start: var(--moo-sidebar-dropdown-inline-start, auto) !important;
221
+ inset-inline-end: auto !important;
197
222
  width: var(--moo-dropdown-sidebar-min-width);
198
223
  min-width: var(--moo-dropdown-sidebar-min-width);
199
224
  margin: 0;
200
225
  transform: none !important;
201
226
  }
227
+
228
+ [data-slot="sidebar-header"] [data-sidebar-dropdown-positioned] > .dropdown-menu {
229
+ inset-block-start: var(--moo-sidebar-dropdown-block-start) !important;
230
+ }
231
+
232
+ [data-slot="sidebar-footer"] [data-sidebar-dropdown-positioned] > .dropdown-menu {
233
+ inset-block-start: auto !important;
234
+ inset-block-end: var(--moo-sidebar-dropdown-block-end) !important;
235
+ }
236
+
237
+ [data-slot="sidebar"][data-side="right"] [data-slot="sidebar-header"] [data-sidebar-dropdown-positioned] > .dropdown-menu,
238
+ [data-slot="sidebar"][data-side="right"] [data-slot="sidebar-footer"] [data-sidebar-dropdown-positioned] > .dropdown-menu {
239
+ inset-inline-start: auto !important;
240
+ inset-inline-end: var(--moo-sidebar-dropdown-inline-end, auto) !important;
241
+ }
202
242
  }
@@ -102,7 +102,7 @@
102
102
  border-radius: var(--moo-input-group-border-radius);
103
103
  background-color: var(--moo-muted-surface);
104
104
  opacity: 0;
105
- transition: opacity $transition-fade;
105
+ transition: $transition-fade;
106
106
  }
107
107
 
108
108
  .input-group > .btn-ghost:hover::before,
@@ -1,3 +1,9 @@
1
+ .card .table {
2
+ // Keep the table surface transparent so a table composed inside a card
3
+ // inherits the card's light/dark surface.
4
+ --bs-table-bg: #{$moo-table-contained-bg};
5
+ }
6
+
1
7
  .table-responsive:not(.scroll-fade-x):has(.table-row-actions > [aria-expanded="true"]) {
2
8
  overflow: visible;
3
9
  }
@@ -37,6 +37,18 @@
37
37
  position: relative;
38
38
  }
39
39
 
40
+ .sidebar-wrapper:has([data-sidebar-dropdown-positioned] > .dropdown-menu.show) > .sidebar {
41
+ position: relative;
42
+ z-index: $zindex-dropdown;
43
+ }
44
+
45
+ // The sticky inner surface is its own stacking context. Elevate that
46
+ // context while an identity menu is open so the rail's hover indicator
47
+ // remains behind the fixed dropdown instead of painting across it.
48
+ .sidebar-wrapper:has([data-sidebar-dropdown-positioned] > .dropdown-menu.show) > .sidebar > .sidebar-inner {
49
+ z-index: $zindex-dropdown;
50
+ }
51
+
40
52
  .sidebar-wrapper[data-sidebar-state="collapsed"] .sidebar[data-collapsible="icon"] {
41
53
  flex-basis: var(--moo-sidebar-width-icon);
42
54
  width: var(--moo-sidebar-width-icon);
package/scss/moo-ui.scss CHANGED
@@ -13,6 +13,7 @@
13
13
 
14
14
  // Bootstrap layout and standalone-only components
15
15
  @import "bootstrap/scss/root";
16
+ @import "themes/standalone_root";
16
17
  @import "bootstrap/scss/reboot";
17
18
  @import "bootstrap/scss/type";
18
19
  @import "bootstrap/scss/images";
@@ -44,7 +45,6 @@
44
45
  // Bootstrap utilities
45
46
  @import "bootstrap/scss/utilities/api";
46
47
 
47
- @import "themes/standalone_root";
48
48
  @import "utilities/scroll_fade_primitives";
49
49
  @import "components";
50
50
  @import "foundations/overlay_backdrop";
@@ -150,6 +150,10 @@ $moo-switch-checked-bg-image-dark: url("data:image/svg+xml,<svg xmlns='http://ww
150
150
  // changes nothing but the chevron and revealed content.
151
151
  $accordion-button-active-bg: var(--bs-accordion-bg) !default;
152
152
  $accordion-button-active-color: var(--bs-accordion-color) !default;
153
+
154
+ // A nested accordion inherits its Card surface by default, while remaining
155
+ // configurable for Sass consumers that need a distinct contained surface.
156
+ $moo-accordion-contained-bg: transparent !default;
153
157
  // Bootstrap's pills nav has no shared-track concept, so the segmented
154
158
  // control's track padding/gap and trigger padding have no Bootstrap
155
159
  // variable to override — they are private knobs instead of literals in
@@ -182,13 +186,10 @@ $card-title-letter-spacing: -0.01em !default;
182
186
  $moo-card-spacing: 1rem !default;
183
187
  $moo-card-spacing-sm: 0.75rem !default;
184
188
 
185
- // Card surface and border blends: mix the muted surface over the base surface
186
- // (and foreground over a transparent base) so cards keep a subtle tint that
187
- // tracks the runtime theme without hardcoding a color.
189
+ // Card surface blends mix the muted surface over the base surface so cards keep
190
+ // a subtle tint that tracks the runtime theme without hardcoding a color.
188
191
  $moo-card-bg-mix: 5% !default;
189
192
  $moo-card-bg-mix-dark: 30% !default;
190
- $moo-card-border-mix: 10% !default;
191
- $moo-card-border-mix-base: transparent !default;
192
193
 
193
194
  // Bootstrap exposes one card-cap background for both headers and footers, but
194
195
  // the reference needs no header fill and a separately tuned footer surface.
@@ -305,7 +306,7 @@ $moo-form-focus-ring-color: var(--moo-ring) !default;
305
306
  // .offcanvas-backdrop selectors; Moo keeps their visual treatment aligned via
306
307
  // one token set instead of per-component backdrop rules.
307
308
  $moo-overlay-backdrop-opacity: 1 !default;
308
- $moo-overlay-backdrop-bg: color-mix(in srgb, var(--bs-black) 10%, transparent) !default;
309
+ $moo-overlay-backdrop-bg: color-mix(in srgb, #0a0a0a 10%, transparent) !default;
309
310
  $moo-overlay-backdrop-filter: blur(8px) !default;
310
311
 
311
312
  // A quieter elevation scale and the extra radius step, applied UI-wide through
@@ -399,6 +400,10 @@ $moo-datatable-bulk-actions-backdrop-blur: 8px !default;
399
400
  // chrome. Keep the default component position unchanged while giving host
400
401
  // surfaces a scoped override hook.
401
402
  $moo-datatable-bulk-actions-bottom: 1rem !default;
403
+ // Bootstrap's table surface is opaque by default and has no context-aware
404
+ // Card composition knob, so card-contained tables consume this scoped Sass
405
+ // setting instead of hardcoding their transparent surface in the partial.
406
+ $moo-table-contained-bg: transparent !default;
402
407
  // Bootstrap has no Data Table layout/card primitive, so these scoped knobs
403
408
  // describe the generated table/card frames without becoming global widths.
404
409
  $moo-datatable-min-width: 48rem !default;
@@ -408,6 +413,9 @@ $moo-datatable-card-label-width: 7rem !default;
408
413
  // Sticky row-action cells need just enough opaque surface for the trigger;
409
414
  // this fade prevents the pinned cell from reading as a dominant blank column.
410
415
  $moo-datatable-actions-cell-fade-width: 1.25rem !default;
416
+ // Bootstrap has no Data Table action-cell surface token; keep this scoped
417
+ // knob aligned with the native body surface and override it for Card context.
418
+ $moo-datatable-actions-cell-bg: var(--bs-body-bg) !default;
411
419
  // Bootstrap has no Data Table frame-header or layout-toggle row primitive, so
412
420
  // these scoped knobs align Moo's table/card header controls to Bootstrap inputs.
413
421
  $moo-datatable-frame-header-min-height: 2.78125rem !default;
@@ -62,6 +62,7 @@
62
62
  --bs-body-bg-rgb: #{to-rgb($moo-surface)};
63
63
  --bs-secondary-bg: var(--moo-muted-surface);
64
64
  --bs-secondary-bg-rgb: #{to-rgb($moo-muted-surface)};
65
+ --bs-border-color: var(--moo-border);
65
66
  --bs-tertiary-bg: #{$body-tertiary-bg};
66
67
  --bs-tertiary-bg-rgb: #{to-rgb($body-tertiary-bg)};
67
68
  --bs-tertiary-color: #{$body-tertiary-color};
@@ -108,6 +109,7 @@
108
109
  --bs-body-bg-rgb: #{to-rgb($moo-surface-dark)};
109
110
  --bs-secondary-bg: var(--moo-muted-surface);
110
111
  --bs-secondary-bg-rgb: #{to-rgb($moo-muted-surface-dark)};
112
+ --bs-border-color: var(--moo-border);
111
113
  --bs-tertiary-bg: #{$body-tertiary-bg-dark};
112
114
  --bs-tertiary-bg-rgb: #{to-rgb($body-tertiary-bg-dark)};
113
115
  --bs-tertiary-color: #{$body-tertiary-color-dark};