@revikornmann/muka-ui 0.27.3 → 0.28.1
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/dist/cjs/components/DataPieChart/DataPieChart.css +4 -1
- package/dist/cjs/components/DataPieChart/DataPieChart.js +1 -1
- package/dist/cjs/components/DataPieChart/DataPieChart.js.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.css +3 -0
- package/dist/cjs/components/Dialog/Dialog.js +66 -3
- package/dist/cjs/components/Dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/Input/Input.css +21 -0
- package/dist/cjs/components/MediaViewer/MediaViewer.css +183 -0
- package/dist/cjs/components/MediaViewer/MediaViewer.js +273 -0
- package/dist/cjs/components/MediaViewer/MediaViewer.js.map +1 -0
- package/dist/cjs/components/MediaViewer/index.js +6 -0
- package/dist/cjs/components/MediaViewer/index.js.map +1 -0
- package/dist/cjs/components/MediaViewer/mediaViewerGestures.js +65 -0
- package/dist/cjs/components/MediaViewer/mediaViewerGestures.js.map +1 -0
- package/dist/cjs/components/Thumbnail/Thumbnail.css +11 -0
- package/dist/cjs/components/Thumbnail/Thumbnail.js +6 -2
- package/dist/cjs/components/Thumbnail/Thumbnail.js.map +1 -1
- package/dist/cjs/components/index.js +3 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/esm/components/DataPieChart/DataPieChart.css +4 -1
- package/dist/esm/components/DataPieChart/DataPieChart.js +1 -1
- package/dist/esm/components/DataPieChart/DataPieChart.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.css +3 -0
- package/dist/esm/components/Dialog/Dialog.js +66 -3
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Input/Input.css +21 -0
- package/dist/esm/components/MediaViewer/MediaViewer.css +183 -0
- package/dist/esm/components/MediaViewer/MediaViewer.js +269 -0
- package/dist/esm/components/MediaViewer/MediaViewer.js.map +1 -0
- package/dist/esm/components/MediaViewer/index.js +2 -0
- package/dist/esm/components/MediaViewer/index.js.map +1 -0
- package/dist/esm/components/MediaViewer/mediaViewerGestures.js +58 -0
- package/dist/esm/components/MediaViewer/mediaViewerGestures.js.map +1 -0
- package/dist/esm/components/Thumbnail/Thumbnail.css +11 -0
- package/dist/esm/components/Thumbnail/Thumbnail.js +6 -2
- package/dist/esm/components/Thumbnail/Thumbnail.js.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/styles/base.css +2 -0
- package/dist/styles/components/DataPieChart.css +4 -1
- package/dist/styles/components/Dialog.css +3 -0
- package/dist/styles/components/Input.css +21 -0
- package/dist/styles/components/MediaViewer.css +183 -0
- package/dist/styles/components/Thumbnail.css +11 -0
- package/dist/styles/index.css +1693 -1467
- package/dist/styles/muka-dark.css +1693 -1467
- package/dist/styles/muka-light.css +1693 -1467
- package/dist/styles/wireframe-dark.css +1693 -1467
- package/dist/styles/wireframe-light.css +1693 -1467
- package/dist/types/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/components/MediaViewer/MediaViewer.d.ts +88 -0
- package/dist/types/components/MediaViewer/MediaViewer.d.ts.map +1 -0
- package/dist/types/components/MediaViewer/index.d.ts +2 -0
- package/dist/types/components/MediaViewer/index.d.ts.map +1 -0
- package/dist/types/components/MediaViewer/mediaViewerGestures.d.ts +35 -0
- package/dist/types/components/MediaViewer/mediaViewerGestures.d.ts.map +1 -0
- package/dist/types/components/Thumbnail/Thumbnail.d.ts +21 -0
- package/dist/types/components/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure gesture maths for `MediaViewer`, kept out of the component so the
|
|
3
|
+
* swipe and dismiss decisions are unit-testable without pointer events.
|
|
4
|
+
*/
|
|
5
|
+
/** Movement (px) before a drag commits to an axis. */
|
|
6
|
+
export const AXIS_LOCK_DISTANCE = 8;
|
|
7
|
+
/** Fraction of the stage width a slow horizontal drag must pass to page. */
|
|
8
|
+
export const SWIPE_DISTANCE_RATIO = 0.25;
|
|
9
|
+
/** Velocity (px/ms) that pages even on a short horizontal flick. */
|
|
10
|
+
export const SWIPE_VELOCITY = 0.5;
|
|
11
|
+
/** Minimum distance (px) a flick must travel to count. */
|
|
12
|
+
export const FLICK_MIN_DISTANCE = 20;
|
|
13
|
+
/** Downward distance (px) that dismisses on a slow drag. */
|
|
14
|
+
export const DISMISS_DISTANCE = 120;
|
|
15
|
+
/** Downward velocity (px/ms) that dismisses on a short flick. */
|
|
16
|
+
export const DISMISS_VELOCITY = 0.5;
|
|
17
|
+
/**
|
|
18
|
+
* Decide which axis a drag belongs to, or null while it is still within the
|
|
19
|
+
* lock distance. Horizontal wins ties so a diagonal flick still pages.
|
|
20
|
+
*/
|
|
21
|
+
export function lockAxis(dx, dy) {
|
|
22
|
+
if (Math.max(Math.abs(dx), Math.abs(dy)) < AXIS_LOCK_DISTANCE)
|
|
23
|
+
return null;
|
|
24
|
+
return Math.abs(dx) >= Math.abs(dy) ? 'x' : 'y';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Clamp a horizontal drag so it cannot move past the first or last item:
|
|
28
|
+
* there is nothing to reveal there, so the image stays put (no rubber band).
|
|
29
|
+
*/
|
|
30
|
+
export function clampDragX(dx, hasPrevious, hasNext) {
|
|
31
|
+
if (dx > 0 && !hasPrevious)
|
|
32
|
+
return 0;
|
|
33
|
+
if (dx < 0 && !hasNext)
|
|
34
|
+
return 0;
|
|
35
|
+
return dx;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Where a released horizontal drag goes: `1` to the next item, `-1` to the
|
|
39
|
+
* previous one, `0` back to the current one. `dx` is already clamped.
|
|
40
|
+
*/
|
|
41
|
+
export function resolveSwipe(dx, velocityX, stageWidth) {
|
|
42
|
+
const far = stageWidth > 0 && Math.abs(dx) >= stageWidth * SWIPE_DISTANCE_RATIO;
|
|
43
|
+
const flick = Math.abs(velocityX) >= SWIPE_VELOCITY &&
|
|
44
|
+
Math.abs(dx) >= FLICK_MIN_DISTANCE &&
|
|
45
|
+
Math.sign(velocityX) === Math.sign(dx);
|
|
46
|
+
if (!far && !flick)
|
|
47
|
+
return 0;
|
|
48
|
+
return dx < 0 ? 1 : -1;
|
|
49
|
+
}
|
|
50
|
+
/** Whether a released downward drag dismisses the viewer. */
|
|
51
|
+
export function resolveDismiss(dy, velocityY) {
|
|
52
|
+
if (dy <= 0)
|
|
53
|
+
return false;
|
|
54
|
+
if (dy >= DISMISS_DISTANCE)
|
|
55
|
+
return true;
|
|
56
|
+
return velocityY >= DISMISS_VELOCITY && dy >= FLICK_MIN_DISTANCE;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=mediaViewerGestures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaViewerGestures.js","sourceRoot":"","sources":["../../../../components/MediaViewer/mediaViewerGestures.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sDAAsD;AACtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAEpC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,iEAAiE;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAIpC;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAU,EAAE,EAAU;IAC7C,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CA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ACxC,OAAO,SAAS,IAAI,gBAAgB,IAAI,EAAE,IAAI,kBAAkB,CAAC;AACnE,CAAC"}
|
|
@@ -33,6 +33,17 @@
|
|
|
33
33
|
height: 120px;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/* Fluid: fill the parent's width; the shape sets the height via aspect-ratio. */
|
|
37
|
+
.muka-thumbnail--fluid {
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: auto;
|
|
40
|
+
aspect-ratio: 1 / 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.muka-thumbnail--fluid.muka-thumbnail--4-3 {
|
|
44
|
+
aspect-ratio: 4 / 3;
|
|
45
|
+
}
|
|
46
|
+
|
|
36
47
|
.muka-thumbnail--ellipse .muka-thumbnail__frame {
|
|
37
48
|
border-radius: var(--border-radius-full);
|
|
38
49
|
}
|
|
@@ -19,12 +19,15 @@ import './Thumbnail.css';
|
|
|
19
19
|
* and clicking activates `onClick` (e.g. to enlarge in a dialog).
|
|
20
20
|
* - **removable** — a tertiary × button in the top-right corner calls
|
|
21
21
|
* `onRemove` to delete the photo.
|
|
22
|
+
* - **fluid** — fills its parent's width at the shape's aspect ratio, for
|
|
23
|
+
* responsive grids; **lazy** defers loading the image until it nears the
|
|
24
|
+
* viewport.
|
|
22
25
|
*
|
|
23
26
|
* Tokens used: border-radius-lg, color-black-alpha-3, dialog-color-backdrop,
|
|
24
27
|
* button-color-tertiary-*, alias-color-state-error-*, alert-color-error-accent,
|
|
25
28
|
* motion-duration-micro, motion-easing-enter.
|
|
26
29
|
*/
|
|
27
|
-
export const Thumbnail = forwardRef(({ src, alt = '', shape = '4:3', loading = false, progress = 0, processing = false, error = false, caption, errorReason, onRemove, onClick, removeLabel = 'Remove photo', viewLabel = 'View photo', className = '', ...props }, ref) => {
|
|
30
|
+
export const Thumbnail = forwardRef(({ src, alt = '', shape = '4:3', fluid = false, lazy = false, imgProps, loading = false, progress = 0, processing = false, error = false, caption, errorReason, onRemove, onClick, removeLabel = 'Remove photo', viewLabel = 'View photo', className = '', ...props }, ref) => {
|
|
28
31
|
const isBusy = loading || processing;
|
|
29
32
|
const isInteractive = !isBusy && !error && Boolean(onClick);
|
|
30
33
|
const showRemove = !isBusy && Boolean(onRemove);
|
|
@@ -32,6 +35,7 @@ export const Thumbnail = forwardRef(({ src, alt = '', shape = '4:3', loading = f
|
|
|
32
35
|
'muka-thumbnail',
|
|
33
36
|
// '4:3' → '--4-3', '1:1' → '--1-1', 'ellipse' → '--ellipse'
|
|
34
37
|
`muka-thumbnail--${shape.replace(':', '-')}`,
|
|
38
|
+
fluid && 'muka-thumbnail--fluid',
|
|
35
39
|
loading && 'muka-thumbnail--loading',
|
|
36
40
|
processing && 'muka-thumbnail--processing',
|
|
37
41
|
error && 'muka-thumbnail--error',
|
|
@@ -40,7 +44,7 @@ export const Thumbnail = forwardRef(({ src, alt = '', shape = '4:3', loading = f
|
|
|
40
44
|
]
|
|
41
45
|
.filter(Boolean)
|
|
42
46
|
.join(' ');
|
|
43
|
-
const image = _jsx("img", { className: "muka-thumbnail__image", src: src, alt: alt });
|
|
47
|
+
const image = (_jsx("img", { ...(lazy && { loading: 'lazy' }), decoding: "async", ...imgProps, className: "muka-thumbnail__image", src: src, alt: alt }));
|
|
44
48
|
const removeButton = showRemove ? (_jsx("button", { type: "button", className: "muka-thumbnail__remove", onClick: onRemove, "aria-label": removeLabel, children: _jsx(Icon, { name: "close", variant: "line", size: "xs" }) })) : null;
|
|
45
49
|
// The frame owns the shape's clip (border-radius + overflow), so the remove
|
|
46
50
|
// button — a sibling of the frame — is never clipped, even for the circle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thumbnail.js","sourceRoot":"","sources":["../../../../components/Thumbnail/Thumbnail.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/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AyB,YACtC,KAAC,YAAY,IACX,SAAS,EAAC,0BAA0B,EACpC,KAAK,EAAE,QAAQ,EACf,aAAa,EAAE,UAAU,EACzB,IAAI,EAAE,EAAE,EACR,OAAO,EAAC,OAAO,gBAEb,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAEnE,GACE,CACP,IACA,CACJ,CAAC;IAEF,OAAO,CACL,eAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,KAAM,KAAK,aAClF,cAAK,SAAS,EAAC,uBAAuB,YAAE,YAAY,GAAO,EAC1D,YAAY,IACT,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,eAAe,SAAS,CAAC"}
|
|
@@ -87,6 +87,7 @@ export { PullToRefresh } from './PullToRefresh';
|
|
|
87
87
|
export { LicensePlateInput, } from './LicensePlateInput';
|
|
88
88
|
export { SocialSignInButton, } from './SocialSignInButton';
|
|
89
89
|
export { Thumbnail } from './Thumbnail';
|
|
90
|
+
export { MediaViewer, } from './MediaViewer';
|
|
90
91
|
export { PhotoUploader, } from './PhotoUploader';
|
|
91
92
|
export { TextLink } from './TextLink';
|
|
92
93
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../components/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAsB,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAmB,MAAM,SAAS,CAAC;AACjD,OAAO,EACL,IAAI,EAEJ,OAAO,GAMR,MAAM,QAAQ,CAAC;AAChB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,GAGZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,GAEd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAsB,MAAM,YAAY,CAAC"}
|
package/dist/styles/base.css
CHANGED
|
@@ -116,4 +116,6 @@ body {
|
|
|
116
116
|
padding: 0;
|
|
117
117
|
/* Page background uses Muka surface token so it matches theme (e.g. dark for muka-dark, wireframe-dark) */
|
|
118
118
|
background-color: var(--color-surface-level3);
|
|
119
|
+
/* Default text color so bare text (h1–h6, p, span outside components) follows the theme instead of browser black */
|
|
120
|
+
color: var(--color-text-default-default);
|
|
119
121
|
}
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
fill: none;
|
|
25
25
|
/* Subtle lift on the filled segment, matching the Figma elevation */
|
|
26
26
|
filter: drop-shadow(0 2px 4px var(--color-black-alpha-5, rgba(0, 0, 0, 0.05)));
|
|
27
|
-
|
|
27
|
+
/* Butt caps keep the always-rendered 0% arc invisible (round caps would draw a dot) */
|
|
28
|
+
stroke-linecap: butt;
|
|
29
|
+
/* view duration (300ms) reads at the 24px size; tokens zero it for reduced motion */
|
|
30
|
+
transition: stroke-dasharray var(--motion-duration-view) var(--motion-easing-default);
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
/* ─── Indeterminate (spinner) ─────────────────────────── */
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
height: 100%;
|
|
39
39
|
max-width: 100vw;
|
|
40
40
|
max-height: 100vh;
|
|
41
|
+
max-height: 100dvh;
|
|
41
42
|
margin: 0;
|
|
42
43
|
display: flex;
|
|
43
44
|
flex-direction: column;
|
|
@@ -72,6 +73,8 @@
|
|
|
72
73
|
|
|
73
74
|
.muka-dialog--lg .muka-dialog__surface {
|
|
74
75
|
height: calc(100vh - var(--dialog-margin-top-mobile));
|
|
76
|
+
/* dvh tracks the visible area as mobile toolbars show and hide */
|
|
77
|
+
height: calc(100dvh - var(--dialog-margin-top-mobile));
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
/* Body */
|
|
@@ -192,6 +192,9 @@
|
|
|
192
192
|
flex-shrink: 0;
|
|
193
193
|
width: var(--size-2xl, 2rem);
|
|
194
194
|
height: var(--size-2xl, 2rem);
|
|
195
|
+
/* Bleed into the field's vertical padding: keeps the full hit area without
|
|
196
|
+
making a password or clearable field taller than a plain one. */
|
|
197
|
+
margin-block: calc(var(--input-field-padding-y) * -1);
|
|
195
198
|
padding: 0;
|
|
196
199
|
border: none;
|
|
197
200
|
background: transparent;
|
|
@@ -199,6 +202,24 @@
|
|
|
199
202
|
cursor: pointer;
|
|
200
203
|
}
|
|
201
204
|
|
|
205
|
+
/* The outermost button bleeds into the right padding by the same amount, so
|
|
206
|
+
its glyph sits as close to the edge as it does to the top and bottom. */
|
|
207
|
+
.muka-input__clear:last-child,
|
|
208
|
+
.muka-input__reveal:last-child {
|
|
209
|
+
margin-inline-end: calc(var(--input-field-padding-y) * -1);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* md: match the right gap to the gap above and below the vertically centred
|
|
213
|
+
button exactly, i.e. (field height − borders − button) / 2. Holds in the
|
|
214
|
+
focus/error state too, where border and padding trade 1px. */
|
|
215
|
+
.muka-input__field--md .muka-input__clear:last-child,
|
|
216
|
+
.muka-input__field--md .muka-input__reveal:last-child {
|
|
217
|
+
margin-inline-end: calc(
|
|
218
|
+
(var(--input-field-height-default) - 2 * var(--border-width-regular) - var(--size-2xl, 2rem)) / 2
|
|
219
|
+
- var(--input-field-padding-x)
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
202
223
|
.muka-input__field--sm .muka-input__clear,
|
|
203
224
|
.muka-input__field--sm .muka-input__reveal {
|
|
204
225
|
width: var(--size-xl, 1.5rem);
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/* MediaViewer Component Styles - Using Muka Design Tokens */
|
|
2
|
+
|
|
3
|
+
/* ─── Native dialog: full viewport ────────────────────── */
|
|
4
|
+
.muka-media-viewer {
|
|
5
|
+
position: fixed;
|
|
6
|
+
inset: 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
max-width: none;
|
|
10
|
+
max-height: none;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
border: none;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
overscroll-behavior: contain;
|
|
18
|
+
color: var(--color-text-default-default);
|
|
19
|
+
background-color: var(--color-black-alpha-12);
|
|
20
|
+
animation: muka-media-viewer-in var(--motion-duration-component) var(--motion-easing-enter);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.muka-media-viewer:not([open]) {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.muka-media-viewer::backdrop {
|
|
28
|
+
background-color: var(--color-black-alpha-12);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes muka-media-viewer-in {
|
|
32
|
+
from {
|
|
33
|
+
opacity: 0;
|
|
34
|
+
}
|
|
35
|
+
to {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ─── Chrome: TopBar and footer sit on a surface ──────── */
|
|
41
|
+
.muka-media-viewer__topbar {
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
background-color: var(--color-surface-level3);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.muka-media-viewer__live {
|
|
47
|
+
position: absolute;
|
|
48
|
+
width: 1px;
|
|
49
|
+
height: 1px;
|
|
50
|
+
padding: 0;
|
|
51
|
+
margin: -1px;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
clip: rect(0, 0, 0, 0);
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
border: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ─── Stage: the dark area the images slide across ────── */
|
|
59
|
+
.muka-media-viewer__stage {
|
|
60
|
+
position: relative;
|
|
61
|
+
flex: 1 1 auto;
|
|
62
|
+
min-height: 0;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
/* Gestures are handled in JS: no browser panning or pinch on the stage. */
|
|
65
|
+
touch-action: none;
|
|
66
|
+
user-select: none;
|
|
67
|
+
-webkit-user-select: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.muka-media-viewer__slide {
|
|
71
|
+
position: absolute;
|
|
72
|
+
inset: 0;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
padding: var(--spacing-4);
|
|
77
|
+
transition: transform var(--motion-duration-component) var(--motion-easing-default);
|
|
78
|
+
will-change: transform;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* While a finger drags, the image follows it without easing. */
|
|
82
|
+
.muka-media-viewer--dragging .muka-media-viewer__slide {
|
|
83
|
+
transition: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.muka-media-viewer__image {
|
|
87
|
+
display: block;
|
|
88
|
+
max-width: 100%;
|
|
89
|
+
max-height: 100%;
|
|
90
|
+
object-fit: contain;
|
|
91
|
+
/* The image takes touches, so a long press opens the OS menu (save, share,
|
|
92
|
+
copy). The swipe still works: pointer events bubble to the stage, and a
|
|
93
|
+
long press doesn't move far enough to start a drag. */
|
|
94
|
+
-webkit-touch-callout: default;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* ─── Previous / next: devices that can hover ─────────── */
|
|
98
|
+
.muka-media-viewer__nav {
|
|
99
|
+
position: absolute;
|
|
100
|
+
top: 50%;
|
|
101
|
+
display: none;
|
|
102
|
+
transform: translateY(-50%);
|
|
103
|
+
opacity: 0;
|
|
104
|
+
transition: opacity var(--motion-duration-micro) var(--motion-easing-enter);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.muka-media-viewer__nav--previous {
|
|
108
|
+
left: var(--spacing-4);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.muka-media-viewer__nav--next {
|
|
112
|
+
right: var(--spacing-4);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@media (hover: hover) and (pointer: fine) {
|
|
116
|
+
.muka-media-viewer__nav {
|
|
117
|
+
display: block;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.muka-media-viewer__stage:hover .muka-media-viewer__nav,
|
|
121
|
+
.muka-media-viewer__nav:focus-within {
|
|
122
|
+
opacity: 1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ─── Footer: caption, meta and actions ───────────────── */
|
|
127
|
+
.muka-media-viewer__footer {
|
|
128
|
+
flex-shrink: 0;
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
gap: var(--spacing-3);
|
|
132
|
+
padding: var(--spacing-4);
|
|
133
|
+
padding-bottom: calc(var(--spacing-4) + env(safe-area-inset-bottom, 0px));
|
|
134
|
+
background-color: var(--color-surface-level3);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.muka-media-viewer__details {
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: flex-start;
|
|
140
|
+
justify-content: space-between;
|
|
141
|
+
gap: var(--spacing-3);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.muka-media-viewer__caption {
|
|
145
|
+
min-width: 0;
|
|
146
|
+
color: var(--color-text-subtle-default);
|
|
147
|
+
font-family: var(--text-body-sm-regular-fontFamily);
|
|
148
|
+
font-size: var(--text-body-sm-regular-fontSize);
|
|
149
|
+
font-weight: var(--text-body-sm-regular-fontWeight);
|
|
150
|
+
line-height: var(--text-body-sm-regular-lineHeight);
|
|
151
|
+
overflow-wrap: anywhere;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.muka-media-viewer__meta {
|
|
155
|
+
flex-shrink: 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.muka-media-viewer__actions {
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-wrap: wrap;
|
|
161
|
+
gap: var(--spacing-2);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Mobile: actions stack full width, like Dialog footers. */
|
|
165
|
+
@media (max-width: 1023px) {
|
|
166
|
+
.muka-media-viewer__actions {
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.muka-media-viewer__actions > * {
|
|
171
|
+
width: 100%;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* ─── Reduced motion ──────────────────────────────────── */
|
|
176
|
+
@media (prefers-reduced-motion: reduce) {
|
|
177
|
+
.muka-media-viewer,
|
|
178
|
+
.muka-media-viewer__slide,
|
|
179
|
+
.muka-media-viewer__nav {
|
|
180
|
+
animation: none;
|
|
181
|
+
transition: none;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -33,6 +33,17 @@
|
|
|
33
33
|
height: 120px;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/* Fluid: fill the parent's width; the shape sets the height via aspect-ratio. */
|
|
37
|
+
.muka-thumbnail--fluid {
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: auto;
|
|
40
|
+
aspect-ratio: 1 / 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.muka-thumbnail--fluid.muka-thumbnail--4-3 {
|
|
44
|
+
aspect-ratio: 4 / 3;
|
|
45
|
+
}
|
|
46
|
+
|
|
36
47
|
.muka-thumbnail--ellipse .muka-thumbnail__frame {
|
|
37
48
|
border-radius: var(--border-radius-full);
|
|
38
49
|
}
|