@wpmoo/ui 2.1.0 → 2.2.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/README.md +27 -2
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/certification.json +2 -1
- package/dist/assets/css/moo-ui.css +429 -1
- package/dist/assets/css/moo-ui.min.css +2 -2
- package/dist/assets/css/moo.css +349 -1
- package/dist/assets/css/moo.min.css +2 -2
- package/dist/js/chart.js +9 -1
- package/dist/js/chart.min.js +2 -2
- package/dist/js/combobox.js +17 -6
- package/dist/js/context-menu.js +8 -3
- package/dist/js/datatable.js +41 -19
- package/dist/js/datepicker.js +23 -9
- package/dist/js/datepicker.min.js +2 -2
- package/dist/js/floating-panel.js +1 -1
- package/dist/js/image-gallery.js +247 -0
- package/dist/js/moo-ui.js +360 -34
- package/dist/js/moo-ui.min.js +2 -2
- package/dist/js/overlay-scrollbar.js +1 -1
- package/dist/js/password-requirements.js +1 -1
- package/dist/js/sheet.js +1 -1
- package/dist/js/sidebar.js +42 -1
- package/dist/js/slider.js +1 -1
- package/dist/js/state.js +1 -1
- package/dist/js/table-of-contents.js +1 -1
- package/dist/js/toc.js +1 -1
- package/dist/release-manifest.json +4 -4
- package/package.json +3 -1
- package/scss/_components.scss +2 -0
- package/scss/components/_gallery.scss +73 -0
- package/scss/components/_item.scss +96 -0
- package/scss/foundations/_globals.scss +1 -0
- package/scss/foundations/_scope.scss +2 -0
- package/scss/mixins/_banner.scss +1 -1
- package/scss/moo-core.scss +1 -0
- package/scss/moo-ui.scss +2 -0
- package/scss/settings/_component_variables.scss +8 -0
- package/scss/utilities/_gallery.scss +25 -0
- package/scss/utilities/_motion.scss +5 -0
- package/scss/utilities/_motion_primitives.scss +10 -0
package/dist/js/sheet.js
CHANGED
package/dist/js/sidebar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Moo UI sidebar.js v2.
|
|
2
|
+
* Moo UI sidebar.js v2.2.0 (https://wpmoo.org/)
|
|
3
3
|
* Copyright 2026 WPMoo Authors
|
|
4
4
|
* Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
@@ -45,6 +45,14 @@ __name(ownerPortalRoot, "ownerPortalRoot");
|
|
|
45
45
|
|
|
46
46
|
// src/js/components/sidebar.js
|
|
47
47
|
var instances = /* @__PURE__ */ new WeakMap();
|
|
48
|
+
var FLYOUT_FOCUSABLE_SELECTOR = "a[href], button, input, select, textarea, [tabindex]";
|
|
49
|
+
function flyoutFocusables(flyout) {
|
|
50
|
+
const view = flyout.ownerDocument.defaultView;
|
|
51
|
+
return [...flyout.querySelectorAll(FLYOUT_FOCUSABLE_SELECTOR)].filter(
|
|
52
|
+
(element) => !element.matches(":disabled") && element.tabIndex >= 0 && !element.closest("[hidden], [inert]") && element.getClientRects().length > 0 && view.getComputedStyle(element).visibility === "visible"
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
__name(flyoutFocusables, "flyoutFocusables");
|
|
48
56
|
var _Sidebar = class _Sidebar {
|
|
49
57
|
static getInstance(element) {
|
|
50
58
|
return element?.nodeType === 1 ? instances.get(element) || null : null;
|
|
@@ -472,8 +480,38 @@ var _Sidebar = class _Sidebar {
|
|
|
472
480
|
this._closeFlyouts();
|
|
473
481
|
} else {
|
|
474
482
|
this._openFlyout(item);
|
|
483
|
+
if (event.detail === 0) {
|
|
484
|
+
if (this._flyout) {
|
|
485
|
+
flyoutFocusables(this._flyout)[0]?.focus();
|
|
486
|
+
}
|
|
487
|
+
}
|
|
475
488
|
}
|
|
476
489
|
}
|
|
490
|
+
// The flyout lives in a portal, away from its trigger, so Escape and Tab
|
|
491
|
+
// out of it return to the trigger instead of wandering. Tab between its
|
|
492
|
+
// items stays native; a key a flyout control already handled is left alone.
|
|
493
|
+
_handleFlyoutKeydown(event) {
|
|
494
|
+
const owner = this._flyoutOwner;
|
|
495
|
+
if (event.defaultPrevented || !this._flyout || !owner || !(event.key === "Escape" || event.key === "Tab")) {
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
498
|
+
const inFlyout = this._flyout.contains(event.target);
|
|
499
|
+
if (!inFlyout && !(event.key === "Escape" && owner.contains(event.target))) {
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
if (event.key === "Tab") {
|
|
503
|
+
const items = flyoutFocusables(this._flyout);
|
|
504
|
+
const edge = event.shiftKey ? items[0] : items[items.length - 1];
|
|
505
|
+
if (edge && event.target !== edge) {
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
event.preventDefault();
|
|
510
|
+
const trigger = owner.querySelector(":scope > .sidebar-menu-sub-trigger");
|
|
511
|
+
this._closeFlyouts();
|
|
512
|
+
trigger?.focus();
|
|
513
|
+
return true;
|
|
514
|
+
}
|
|
477
515
|
_handleOutsideFlyoutClick(event) {
|
|
478
516
|
if (!this._flyout) {
|
|
479
517
|
return;
|
|
@@ -485,6 +523,9 @@ var _Sidebar = class _Sidebar {
|
|
|
485
523
|
}
|
|
486
524
|
}
|
|
487
525
|
_handleShortcut(event) {
|
|
526
|
+
if (this._handleFlyoutKeydown(event)) {
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
488
529
|
const target = event.target;
|
|
489
530
|
const isEditable = target instanceof this._window.Element && (target.matches("input, textarea, select") || target.isContentEditable);
|
|
490
531
|
if (event.defaultPrevented || event.isComposing || isEditable || !this._config.keyboard || !(event.metaKey || event.ctrlKey) || event.key.toLowerCase() !== "b" || !this._isDesktop()) {
|
package/dist/js/slider.js
CHANGED
package/dist/js/state.js
CHANGED
package/dist/js/toc.js
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
{
|
|
4
4
|
"export": "./moo.css",
|
|
5
5
|
"path": "dist/assets/css/moo.css",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "622d934434519f4aff918247d08efda50512375c3183cf537a2b27863c3b43f5"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
"export": "./moo-ui.css",
|
|
10
10
|
"path": "dist/assets/css/moo-ui.css",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "b3e87c1c8f4df8103aec086d2e4ac90affe77ba08da6267070e0fe0d5b7cdf0f"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"export": "./state.js",
|
|
15
15
|
"path": "dist/js/state.js",
|
|
16
|
-
"sha256": "
|
|
16
|
+
"sha256": "aa74a99c881054f4bf7e9e09ca882c14dcf96d3befcd913c67b6701d0c22f335"
|
|
17
17
|
}
|
|
18
18
|
],
|
|
19
19
|
"package": {
|
|
20
20
|
"name": "@wpmoo/ui",
|
|
21
|
-
"version": "2.
|
|
21
|
+
"version": "2.2.0"
|
|
22
22
|
},
|
|
23
23
|
"schemaVersion": 1
|
|
24
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wpmoo/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
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)",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"./table-of-contents.js": "./dist/js/table-of-contents.js",
|
|
43
43
|
"./sheet.js": "./dist/js/sheet.js",
|
|
44
44
|
"./floating-panel.js": "./dist/js/floating-panel.js",
|
|
45
|
+
"./image-gallery.js": "./dist/js/image-gallery.js",
|
|
45
46
|
"./chart.js": "./dist/js/chart.js",
|
|
46
47
|
"./chart.min.js": "./dist/js/chart.min.js",
|
|
47
48
|
"./datepicker.js": "./dist/js/datepicker.js",
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
"dist/js/table-of-contents.js",
|
|
75
76
|
"dist/js/sheet.js",
|
|
76
77
|
"dist/js/floating-panel.js",
|
|
78
|
+
"dist/js/image-gallery.js",
|
|
77
79
|
"dist/js/chart.js",
|
|
78
80
|
"dist/js/chart.min.js",
|
|
79
81
|
"dist/js/datepicker.js",
|
package/scss/_components.scss
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
@import "components/toggle_group";
|
|
39
39
|
@import "components/card";
|
|
40
40
|
@import "components/empty";
|
|
41
|
+
@import "components/item";
|
|
41
42
|
@import "components/table";
|
|
42
43
|
@import "components/dropdown";
|
|
43
44
|
@import "components/menubar";
|
|
@@ -70,3 +71,4 @@
|
|
|
70
71
|
@import "components/combobox";
|
|
71
72
|
@import "components/context-menu";
|
|
72
73
|
@import "components/datatable";
|
|
74
|
+
@import "components/gallery";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.gallery-justified {
|
|
2
|
+
--moo-gallery-row-height: #{$moo-gallery-row-height};
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
|
|
6
|
+
@include media-breakpoint-up(md) {
|
|
7
|
+
--moo-gallery-row-height: #{$moo-gallery-row-height-md};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
> * {
|
|
11
|
+
flex: var(--moo-gallery-ratio, 1) 1 calc(var(--moo-gallery-ratio, 1) * var(--moo-gallery-row-height));
|
|
12
|
+
aspect-ratio: var(--moo-gallery-ratio, 1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&::after {
|
|
16
|
+
flex-grow: 1e9;
|
|
17
|
+
content: "";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.gallery-stage {
|
|
22
|
+
height: $moo-gallery-stage-height;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
$moo-gallery-strip-gutter: if($moo-gallery-strip-bleed, $moo-gallery-strip-bleed, $container-padding-x * .5);
|
|
26
|
+
|
|
27
|
+
@mixin moo-gallery-strip {
|
|
28
|
+
--moo-gallery-strip-height: #{$moo-gallery-strip-height};
|
|
29
|
+
flex-wrap: nowrap;
|
|
30
|
+
overflow-x: auto;
|
|
31
|
+
scroll-snap-type: x proximity;
|
|
32
|
+
contain: inline-size;
|
|
33
|
+
|
|
34
|
+
> * {
|
|
35
|
+
flex: none;
|
|
36
|
+
width: calc(var(--moo-gallery-ratio, 1) * var(--moo-gallery-strip-height));
|
|
37
|
+
max-width: 85%;
|
|
38
|
+
height: var(--moo-gallery-strip-height);
|
|
39
|
+
scroll-snap-align: start;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&::after {
|
|
43
|
+
content: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.gallery-strip-bleed {
|
|
47
|
+
margin-inline: calc(-1 * var(--moo-gallery-strip-bleed, #{$moo-gallery-strip-gutter}));
|
|
48
|
+
padding-inline: var(--moo-gallery-strip-bleed, #{$moo-gallery-strip-gutter});
|
|
49
|
+
scroll-padding-inline: var(--moo-gallery-strip-bleed, #{$moo-gallery-strip-gutter});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.gallery-strip {
|
|
54
|
+
display: flex;
|
|
55
|
+
@include moo-gallery-strip;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@each $breakpoint in map-keys($grid-breakpoints) {
|
|
59
|
+
@if $breakpoint != "xs" {
|
|
60
|
+
@include media-breakpoint-down($breakpoint) {
|
|
61
|
+
.gallery-strip-#{$breakpoint}-down {
|
|
62
|
+
@include moo-gallery-strip;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
$moo-gallery-progress-size: if($moo-gallery-progress-height, $moo-gallery-progress-height, $progress-height);
|
|
69
|
+
|
|
70
|
+
.gallery-progress {
|
|
71
|
+
--bs-progress-height: var(--moo-gallery-progress-height, #{$moo-gallery-progress-size});
|
|
72
|
+
opacity: var(--moo-gallery-progress-opacity, #{$moo-gallery-progress-opacity});
|
|
73
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
$item-title-line-height: $line-height-sm;
|
|
2
|
+
$item-description-line-height: $line-height-base;
|
|
3
|
+
$item-content-gap: $spacer * 0.25;
|
|
4
|
+
$item-media-size: ($font-size-sm * $item-title-line-height) + $item-content-gap + ($font-size-sm * $item-description-line-height);
|
|
5
|
+
|
|
6
|
+
/* Item */
|
|
7
|
+
.item {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: $spacer;
|
|
12
|
+
min-width: 0;
|
|
13
|
+
padding: ($spacer * 0.75) $spacer;
|
|
14
|
+
color: var(--bs-body-color);
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
border: var(--bs-border-width) solid transparent;
|
|
17
|
+
border-radius: var(--bs-border-radius-lg);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.item-outline {
|
|
21
|
+
border-color: var(--bs-border-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.item-muted {
|
|
25
|
+
background-color: var(--bs-tertiary-bg);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.item-sm {
|
|
29
|
+
gap: $spacer * 0.75;
|
|
30
|
+
padding: ($spacer * 0.5) ($spacer * 0.75);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
a.item:hover {
|
|
34
|
+
color: var(--bs-body-color);
|
|
35
|
+
background-color: var(--bs-tertiary-bg);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.item-media {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-self: flex-start;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.item-media-icon {
|
|
47
|
+
width: $item-media-size;
|
|
48
|
+
height: $item-media-size;
|
|
49
|
+
color: var(--bs-body-color);
|
|
50
|
+
background-color: var(--bs-tertiary-bg);
|
|
51
|
+
border: var(--bs-border-width) solid var(--bs-border-color);
|
|
52
|
+
border-radius: var(--bs-border-radius);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.item-media-icon > [data-icon] {
|
|
56
|
+
width: $spacer;
|
|
57
|
+
height: $spacer;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.item-content {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex: 1 1 0;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
gap: $item-content-gap;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.item-title {
|
|
69
|
+
margin: 0;
|
|
70
|
+
font-size: $font-size-sm;
|
|
71
|
+
font-weight: $font-weight-medium;
|
|
72
|
+
line-height: $item-title-line-height;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.item-description {
|
|
76
|
+
margin: 0;
|
|
77
|
+
font-size: $font-size-sm;
|
|
78
|
+
line-height: $item-description-line-height;
|
|
79
|
+
color: var(--bs-secondary-color);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.item-actions {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-wrap: wrap;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: $spacer * 0.5;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.item-group {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
gap: $spacer * 0.5;
|
|
93
|
+
padding: 0;
|
|
94
|
+
margin: 0;
|
|
95
|
+
list-style: none;
|
|
96
|
+
}
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
/* Utilities */
|
|
6
6
|
@import "../utilities/border";
|
|
7
7
|
@include moo-text-alignment-utilities;
|
|
8
|
+
@include moo-gallery-utilities;
|
|
8
9
|
@import "../utilities/scroll_fade";
|
|
9
10
|
@include moo-overlay-scrollbar;
|
|
10
11
|
@import "../utilities/scroll_smooth";
|
|
12
|
+
@import "../utilities/motion";
|
|
11
13
|
/* Application layout */
|
|
12
14
|
@import "../layouts/app";
|
|
13
15
|
@import "../layouts/page_grid";
|
package/scss/mixins/_banner.scss
CHANGED
package/scss/moo-core.scss
CHANGED
package/scss/moo-ui.scss
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
@import "bootstrap/scss/mixins";
|
|
10
10
|
@import "bootstrap/scss/utilities";
|
|
11
11
|
@import "utilities/text_alignment";
|
|
12
|
+
@import "utilities/gallery";
|
|
12
13
|
@import "utilities/overlay_scrollbar";
|
|
13
14
|
@import "themes/theme";
|
|
14
15
|
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
@import "bootstrap/scss/utilities/api";
|
|
53
54
|
|
|
54
55
|
@import "utilities/scroll_fade_primitives";
|
|
56
|
+
@import "utilities/motion_primitives";
|
|
55
57
|
@import "utilities/overlay_scrollbar_native";
|
|
56
58
|
@import "foundations/backdrop";
|
|
57
59
|
@import "foundations/scope";
|
|
@@ -245,3 +245,11 @@ $moo-toast-stack-enter-y: 150% !default;
|
|
|
245
245
|
$moo-toast-stack-transition-duration: .5s !default;
|
|
246
246
|
$moo-toast-stack-height-transition-duration: .15s !default;
|
|
247
247
|
$moo-toast-stack-transition-timing-function: cubic-bezier(.22, 1, .36, 1) !default;
|
|
248
|
+
|
|
249
|
+
$moo-gallery-row-height: 6rem !default;
|
|
250
|
+
$moo-gallery-row-height-md: 8rem !default;
|
|
251
|
+
$moo-gallery-stage-height: unquote("min(62svh, 38rem)") !default;
|
|
252
|
+
$moo-gallery-strip-height: 13rem !default;
|
|
253
|
+
$moo-gallery-strip-bleed: null !default;
|
|
254
|
+
$moo-gallery-progress-height: null !default;
|
|
255
|
+
$moo-gallery-progress-opacity: .08 !default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
$aspect-ratios: map-merge($aspect-ratios, ("3x2": calc(2 / 3 * 100%)));
|
|
2
|
+
$utilities: map-merge(
|
|
3
|
+
$utilities,
|
|
4
|
+
(
|
|
5
|
+
"column-count": (
|
|
6
|
+
responsive: true,
|
|
7
|
+
property: column-count,
|
|
8
|
+
class: columns,
|
|
9
|
+
values: (1: 1, 2: 2, 3: 3, 4: 4),
|
|
10
|
+
),
|
|
11
|
+
)
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
@mixin moo-gallery-utilities {
|
|
15
|
+
.ratio-3x2 {
|
|
16
|
+
--#{$prefix}aspect-ratio: #{map-get($aspect-ratios, "3x2")};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
$utility: map-get($utilities, "column-count");
|
|
20
|
+
@each $breakpoint in map-keys($grid-breakpoints) {
|
|
21
|
+
@include media-breakpoint-up($breakpoint) {
|
|
22
|
+
@include generate-utility($utility, breakpoint-infix($breakpoint, $grid-breakpoints));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|