@robert-stackflow/oneui 0.6.55 → 0.6.56
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/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/components/Lightbox.module.css +7 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -338,7 +338,7 @@ Menu 支持 iconOnly:`<Menu iconOnly label="更多操作" items={items} />`
|
|
|
338
338
|
|
|
339
339
|
`Lightbox` is a controlled image viewer: pass `open`, `items`, `index`, `onIndexChange` and `onClose`. Each item has a stable `id`, `src`, `alt` and optional `caption`, `thumbnailSrc`, `width` and `height`. The optional `sourceElement(item)` resolves the original image for Hero motion; `onLocate(item)` runs after exit and scroll unlocking. Supply `labels` for localization. Provide valid `width` and `height` for an aspect-correct loading skeleton fitted to the canvas; images without known dimensions use a compact loading indicator.
|
|
340
340
|
|
|
341
|
-
The viewer uses an opaque black canvas with light controls in both color modes. Opening focuses the header so keyboard navigation starts inside the dialog.
|
|
341
|
+
The viewer uses an opaque black canvas with light controls in both color modes. Opening focuses the header so keyboard navigation starts inside the dialog. Wide mouse layouts offer previous and next buttons anchored to the viewer, independent of caption height. Narrow and touch layouts use the thumbnail strip for direct navigation. On touch, the image follows horizontal swipes. Arrow keys, Escape, zoom, pinch, pan, captions and image retry work across layouts. A single image hides navigation. Only adjacent full images are preloaded. Native modal isolation and the shared focus lifecycle restore focus to the opener. Keep the component mounted through exit and retain the selected index.
|
|
342
342
|
|
|
343
343
|
Image changes retain the existing outgoing image for a directional fade/slide, without remounting it for the animation. Thumbnail selection uses a moving outline and a separate keyboard focus ring. Shared modal scroll locking preserves classic scrollbar space, nested lock ownership and original document styles.
|
|
344
344
|
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
}
|
|
56
56
|
.canvas {
|
|
57
57
|
flex: 1;
|
|
58
|
-
position: relative;
|
|
59
58
|
min-height: 0;
|
|
60
59
|
display: flex;
|
|
61
60
|
justify-content: center;
|
|
@@ -96,16 +95,17 @@
|
|
|
96
95
|
.previous,
|
|
97
96
|
.next {
|
|
98
97
|
position: absolute;
|
|
99
|
-
top:
|
|
98
|
+
top: 50%;
|
|
99
|
+
translate: 0 -50%;
|
|
100
100
|
z-index: 1;
|
|
101
101
|
border-radius: 50%;
|
|
102
102
|
background: color-mix(in srgb, var(--surface) 90%, transparent);
|
|
103
103
|
}
|
|
104
104
|
.previous {
|
|
105
|
-
left:
|
|
105
|
+
left: max(16px, env(safe-area-inset-left));
|
|
106
106
|
}
|
|
107
107
|
.next {
|
|
108
|
-
right:
|
|
108
|
+
right: max(16px, env(safe-area-inset-right));
|
|
109
109
|
}
|
|
110
110
|
.feedback {
|
|
111
111
|
position: absolute;
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
clip-path: inset(50%);
|
|
204
204
|
white-space: nowrap;
|
|
205
205
|
}
|
|
206
|
-
@media (
|
|
206
|
+
@media (width > 760px) and (pointer: fine) {
|
|
207
207
|
.canvas:has(.next) .stage {
|
|
208
208
|
margin-inline: 48px;
|
|
209
209
|
}
|
|
@@ -231,6 +231,8 @@
|
|
|
231
231
|
width: 44px;
|
|
232
232
|
height: 44px;
|
|
233
233
|
}
|
|
234
|
+
}
|
|
235
|
+
@media (width <= 760px), (pointer: coarse) {
|
|
234
236
|
.canvas :is(.previous, .next) {
|
|
235
237
|
display: none;
|
|
236
238
|
}
|