@revikornmann/muka-ui 0.7.0 → 0.8.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/dist/cjs/components/Alert/Alert.css +7 -0
- package/dist/cjs/components/DataPieChart/DataPieChart.css +29 -0
- package/dist/cjs/components/DataPieChart/DataPieChart.js +20 -3
- package/dist/cjs/components/DataPieChart/DataPieChart.js.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.js +64 -7
- package/dist/cjs/components/Dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/PhotoUploader/PhotoUploader.css +125 -0
- package/dist/cjs/components/PhotoUploader/PhotoUploader.js +257 -0
- package/dist/cjs/components/PhotoUploader/PhotoUploader.js.map +1 -0
- package/dist/cjs/components/PhotoUploader/index.js +6 -0
- package/dist/cjs/components/PhotoUploader/index.js.map +1 -0
- package/dist/cjs/components/ProgressAccordeon/ProgressAccordeon.css +32 -2
- package/dist/cjs/components/ProgressAccordeon/ProgressAccordeon.js +13 -2
- package/dist/cjs/components/ProgressAccordeon/ProgressAccordeon.js.map +1 -1
- package/dist/cjs/components/Thumbnail/Thumbnail.css +171 -0
- package/dist/cjs/components/Thumbnail/Thumbnail.js +55 -0
- package/dist/cjs/components/Thumbnail/Thumbnail.js.map +1 -0
- package/dist/cjs/components/Thumbnail/index.js +6 -0
- package/dist/cjs/components/Thumbnail/index.js.map +1 -0
- package/dist/cjs/components/index.js +5 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/esm/components/Alert/Alert.css +7 -0
- package/dist/esm/components/DataPieChart/DataPieChart.css +29 -0
- package/dist/esm/components/DataPieChart/DataPieChart.js +20 -3
- package/dist/esm/components/DataPieChart/DataPieChart.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +31 -7
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/PhotoUploader/PhotoUploader.css +125 -0
- package/dist/esm/components/PhotoUploader/PhotoUploader.js +254 -0
- package/dist/esm/components/PhotoUploader/PhotoUploader.js.map +1 -0
- package/dist/esm/components/PhotoUploader/index.js +2 -0
- package/dist/esm/components/PhotoUploader/index.js.map +1 -0
- package/dist/esm/components/ProgressAccordeon/ProgressAccordeon.css +32 -2
- package/dist/esm/components/ProgressAccordeon/ProgressAccordeon.js +13 -2
- package/dist/esm/components/ProgressAccordeon/ProgressAccordeon.js.map +1 -1
- package/dist/esm/components/Thumbnail/Thumbnail.css +171 -0
- package/dist/esm/components/Thumbnail/Thumbnail.js +52 -0
- package/dist/esm/components/Thumbnail/Thumbnail.js.map +1 -0
- package/dist/esm/components/Thumbnail/index.js +2 -0
- package/dist/esm/components/Thumbnail/index.js.map +1 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/styles/components/Alert.css +7 -0
- package/dist/styles/components/DataPieChart.css +29 -0
- package/dist/styles/components/PhotoUploader.css +125 -0
- package/dist/styles/components/ProgressAccordeon.css +32 -2
- package/dist/styles/components/Thumbnail.css +171 -0
- package/dist/styles/index.css +2726 -2358
- package/dist/styles/muka-dark.css +2726 -2358
- package/dist/styles/muka-light.css +2726 -2358
- package/dist/styles/wireframe-dark.css +2726 -2358
- package/dist/styles/wireframe-light.css +2726 -2358
- package/dist/types/components/DataPieChart/DataPieChart.d.ts +7 -0
- package/dist/types/components/DataPieChart/DataPieChart.d.ts.map +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/types/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/types/components/FileUpload/FileUploadItem.d.ts +1 -1
- package/dist/types/components/FileUpload/FileUploadItem.d.ts.map +1 -1
- package/dist/types/components/PhotoUploader/PhotoUploader.d.ts +71 -0
- package/dist/types/components/PhotoUploader/PhotoUploader.d.ts.map +1 -0
- package/dist/types/components/PhotoUploader/index.d.ts +2 -0
- package/dist/types/components/PhotoUploader/index.d.ts.map +1 -0
- package/dist/types/components/ProgressAccordeon/ProgressAccordeon.d.ts.map +1 -1
- package/dist/types/components/Thumbnail/Thumbnail.d.ts +77 -0
- package/dist/types/components/Thumbnail/Thumbnail.d.ts.map +1 -0
- package/dist/types/components/Thumbnail/index.d.ts +2 -0
- package/dist/types/components/Thumbnail/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -109,6 +109,13 @@
|
|
|
109
109
|
height: 100%;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
/* The leading icon and the dismiss (×) icon inherit the variant accent set on
|
|
113
|
+
their container, overriding the Icon component's default color. */
|
|
114
|
+
.muka-alert__icon .muka-icon,
|
|
115
|
+
.muka-alert__dismiss .muka-icon {
|
|
116
|
+
color: inherit;
|
|
117
|
+
}
|
|
118
|
+
|
|
112
119
|
/* Content */
|
|
113
120
|
.muka-alert__content {
|
|
114
121
|
flex: 1;
|
|
@@ -27,6 +27,35 @@
|
|
|
27
27
|
transition: stroke-dasharray 0.3s ease;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/* ─── Indeterminate (spinner) ─────────────────────────── */
|
|
31
|
+
/* A masked ring filled with an angular (conic) gradient that rotates. The mask
|
|
32
|
+
band matches the donut geometry (r=40, strokeWidth=16 → 64%–96% of radius) so
|
|
33
|
+
it swaps seamlessly with the value-based progress donut. */
|
|
34
|
+
.muka-data-pie-chart__spinner-track,
|
|
35
|
+
.muka-data-pie-chart__spinner {
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset: 0;
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
-webkit-mask: radial-gradient(farthest-side, transparent 63%, #000 65%, #000 95%, transparent 97%);
|
|
40
|
+
mask: radial-gradient(farthest-side, transparent 63%, #000 65%, #000 95%, transparent 97%);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.muka-data-pie-chart__spinner {
|
|
44
|
+
animation: muka-data-pie-chart-spin 0.9s linear infinite;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes muka-data-pie-chart-spin {
|
|
48
|
+
to {
|
|
49
|
+
transform: rotate(360deg);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media (prefers-reduced-motion: reduce) {
|
|
54
|
+
.muka-data-pie-chart__spinner {
|
|
55
|
+
animation-duration: 2.5s;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
30
59
|
.muka-data-pie-chart__value {
|
|
31
60
|
position: absolute;
|
|
32
61
|
inset: 0;
|
|
@@ -17,9 +17,14 @@ const GEOMETRY = {
|
|
|
17
17
|
*
|
|
18
18
|
* Variants: donut (default), pie
|
|
19
19
|
*/
|
|
20
|
-
const DataPieChart = ({ value, max = 100, variant = 'donut', size = 120, color
|
|
20
|
+
const DataPieChart = ({ value, max = 100, variant = 'donut', size = 120, color, trackColor = 'var(--color-surface-level0)', showValue = false, indeterminate = false, className = '', 'aria-label': ariaLabel, ...props }) => {
|
|
21
21
|
const { radius, strokeWidth } = GEOMETRY[variant];
|
|
22
22
|
const circumference = 2 * Math.PI * radius;
|
|
23
|
+
// Indeterminate is a donut-only spinner; ignore it for the pie variant.
|
|
24
|
+
const spinning = indeterminate && variant === 'donut';
|
|
25
|
+
// The determinate arc defaults to the accent; the indeterminate spinner
|
|
26
|
+
// defaults to a subtle grey (its angular gradient fades to this colour).
|
|
27
|
+
const resolvedColor = color ?? (spinning ? 'var(--color-icon-subtle-default)' : 'var(--color-action-default)');
|
|
23
28
|
const safeMax = max > 0 ? max : 1;
|
|
24
29
|
const fraction = Math.min(1, Math.max(0, value / safeMax));
|
|
25
30
|
const percent = Math.round(fraction * 100);
|
|
@@ -27,12 +32,24 @@ const DataPieChart = ({ value, max = 100, variant = 'donut', size = 120, color =
|
|
|
27
32
|
const chartClasses = [
|
|
28
33
|
'muka-data-pie-chart',
|
|
29
34
|
`muka-data-pie-chart--${variant}`,
|
|
35
|
+
spinning && 'muka-data-pie-chart--indeterminate',
|
|
30
36
|
className,
|
|
31
37
|
]
|
|
32
38
|
.filter(Boolean)
|
|
33
39
|
.join(' ');
|
|
34
|
-
const label = ariaLabel ??
|
|
35
|
-
|
|
40
|
+
const label = ariaLabel ??
|
|
41
|
+
(spinning
|
|
42
|
+
? 'Loading'
|
|
43
|
+
: `${variant === 'donut' ? 'Donut' : 'Pie'} chart: ${percent}%`);
|
|
44
|
+
// Indeterminate spinner: a masked ring with an angular (conic) gradient that
|
|
45
|
+
// fades from the track colour round to `resolvedColor`, rotating. Shares the
|
|
46
|
+
// donut footprint so it swaps seamlessly with a progress donut of the same size.
|
|
47
|
+
if (spinning) {
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: chartClasses, style: { width: size, height: size }, role: "img", "aria-label": label, ...props, children: [(0, jsx_runtime_1.jsx)("span", { className: "muka-data-pie-chart__spinner-track", "aria-hidden": "true", style: { background: trackColor } }), (0, jsx_runtime_1.jsx)("span", { className: "muka-data-pie-chart__spinner", "aria-hidden": "true", style: {
|
|
49
|
+
background: `conic-gradient(from 0deg, ${trackColor} 0deg, ${resolvedColor} 340deg, ${resolvedColor} 360deg)`,
|
|
50
|
+
} })] }));
|
|
51
|
+
}
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: chartClasses, style: { width: size, height: size }, role: "img", "aria-label": label, ...props, children: [(0, jsx_runtime_1.jsxs)("svg", { className: "muka-data-pie-chart__svg", viewBox: "0 0 100 100", "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("circle", { className: "muka-data-pie-chart__track", cx: 50, cy: 50, r: radius, strokeWidth: strokeWidth, stroke: trackColor }), fraction > 0 && ((0, jsx_runtime_1.jsx)("circle", { className: "muka-data-pie-chart__segment", cx: 50, cy: 50, r: radius, strokeWidth: strokeWidth, stroke: resolvedColor, strokeDasharray: `${arcLength} ${circumference - arcLength}`, strokeDashoffset: 0 }))] }), showValue && variant === 'donut' && ((0, jsx_runtime_1.jsxs)("span", { className: "muka-data-pie-chart__value", "aria-hidden": "true", children: [percent, "%"] }))] }));
|
|
36
53
|
};
|
|
37
54
|
exports.DataPieChart = DataPieChart;
|
|
38
55
|
exports.default = exports.DataPieChart;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataPieChart.js","sourceRoot":"","sources":["../../../../components/DataPieChart/DataPieChart.tsx"],"names":[],"mappings":";;;;AACA,8BAA4B;
|
|
1
|
+
{"version":3,"file":"DataPieChart.js","sourceRoot":"","sources":["../../../../components/DataPieChart/DataPieChart.tsx"],"names":[],"mappings":";;;;AACA,8BAA4B;AAuC5B,4EAA4E;AAC5E,MAAM,QAAQ,GAAG;IACf,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;IACtC,GAAG,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;CAC5B,CAAC;AAEX;;;;;;;;GAQG;AACI,MAAM,YAAY,GAAgC,CAAC,EACxD,KAAK,EACL,GAAG,GAAG,GAAG,EACT,OAAO,GAAG,OAAO,EACjB,IAAI,GAAG,GAAG,EACV,KAAK,EACL,UAAU,GAAG,6BAA6B,EAC1C,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,KAAK,EACrB,SAAS,GAAG,EAAE,EACd,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC;IAE3C,wEAAwE;IACxE,MAAM,QAAQ,GAAG,aAAa,IAAI,OAAO,KAAK,OAAO,CAAC;IAEtD,wEAAwE;IACxE,yEAAyE;IACzE,MAAM,aAAa,GACjB,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,kCAAkC,CAAC,C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ACE,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,iCACE,SAAS,EAAE,YAAY,EACvB,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EACpC,IAAI,EAAC,KAAK,gBACE,KAAK,KACb,KAAK,aAET,iCAAK,SAAS,EAAC,0BAA0B,EAAC,OAAO,EAAC,aAAa,iBAAa,MAAM,aAEhF,mCACE,SAAS,EAAC,4BAA4B,EACtC,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,UAAU,GAClB,EACD,QAAQ,GAAG,CAAC,IAAI,CACf,mCACE,SAAS,EAAC,8BAA8B,EACxC,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,aAAa,EACrB,eAAe,EAAE,GAAG,SAAS,IAAI,aAAa,GAAG,SAAS,EAAE,EAC5D,gBAAgB,EAAE,CAAC,GACnB,CACH,IACG,EACL,SAAS,IAAI,OAAO,KAAK,OAAO,IAAI,CACnC,kCAAM,SAAS,EAAC,4BAA4B,iBAAa,MAAM,aAC5D,OAAO,SACH,CACR,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AA9GW,QAAA,YAAY,gBA8GvB;AAEF,kBAAe,oBAAY,CAAC"}
|
|
@@ -1,9 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
37
|
exports.Dialog = void 0;
|
|
5
38
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const react_1 = require("react");
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
7
40
|
const TopBar_1 = require("../TopBar");
|
|
8
41
|
const BottomBar_1 = require("../BottomBar");
|
|
9
42
|
const Button_1 = require("../Button");
|
|
@@ -19,6 +52,25 @@ function getNearestSnap(height) {
|
|
|
19
52
|
const snaps = [SNAP_SM, SNAP_MD, snapLg];
|
|
20
53
|
return snaps.reduce((prev, curr) => Math.abs(curr - height) < Math.abs(prev - height) ? curr : prev);
|
|
21
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Clone the Dialog's action Buttons (including those wrapped in a Fragment) to
|
|
57
|
+
* force a size, so the TopBar/BottomBar buttons always match the design regardless
|
|
58
|
+
* of the size a consumer passes. Non-Button nodes are left untouched.
|
|
59
|
+
*/
|
|
60
|
+
function withButtonSize(node, size) {
|
|
61
|
+
return react_1.default.Children.map(node, (child) => {
|
|
62
|
+
if (!react_1.default.isValidElement(child))
|
|
63
|
+
return child;
|
|
64
|
+
if (child.type === react_1.default.Fragment) {
|
|
65
|
+
const fragment = child;
|
|
66
|
+
return react_1.default.cloneElement(fragment, {}, withButtonSize(fragment.props.children, size));
|
|
67
|
+
}
|
|
68
|
+
if (child.type === Button_1.Button) {
|
|
69
|
+
return react_1.default.cloneElement(child, { size });
|
|
70
|
+
}
|
|
71
|
+
return child;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
22
74
|
const Dialog = ({ open, onClose, children, size = 'sm', mobileHeight = 'full', modal = true, title, leading, trailing, footerActions, footerVariant = 'actions', mobileLeadingLabel, mobileTrailingLabel, onMobileLeadingClick, onMobileTrailingClick, 'aria-label': ariaLabel, surfaceLevel = 3, 'aria-describedby': ariaDescribedBy, className = '', }) => {
|
|
23
75
|
const dialogRef = (0, react_1.useRef)(null);
|
|
24
76
|
const surfaceRef = (0, react_1.useRef)(null);
|
|
@@ -158,17 +210,22 @@ const Dialog = ({ open, onClose, children, size = 'sm', mobileHeight = 'full', m
|
|
|
158
210
|
].filter(Boolean).join(' ');
|
|
159
211
|
// Non-modal on mobile gets drag handle via TopBar variant
|
|
160
212
|
const topBarVariant = !modal ? 'draggable' : 'default';
|
|
161
|
-
// Compute leading/trailing for TopBar — avoid always-truthy fragments
|
|
213
|
+
// Compute leading/trailing for TopBar — avoid always-truthy fragments.
|
|
214
|
+
// Per design, TopBar action buttons are `lg` on every viewport.
|
|
162
215
|
const topBarLeading = !modal
|
|
163
|
-
? leading
|
|
216
|
+
? withButtonSize(leading, 'lg')
|
|
164
217
|
: (mobileLeadingLabel && hasInputs)
|
|
165
|
-
? ((0, jsx_runtime_1.jsx)("span", { className: "muka-dialog__mobile-only", children: (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "tertiary", size: "
|
|
218
|
+
? ((0, jsx_runtime_1.jsx)("span", { className: "muka-dialog__mobile-only", children: (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "tertiary", size: "lg", onClick: onMobileLeadingClick, children: mobileLeadingLabel }) }))
|
|
166
219
|
: undefined;
|
|
167
220
|
const topBarTrailing = !modal
|
|
168
|
-
? trailing
|
|
221
|
+
? withButtonSize(trailing, 'lg')
|
|
169
222
|
: (mobileTrailingLabel && hasInputs)
|
|
170
|
-
? ((0, jsx_runtime_1.jsx)("span", { className: "muka-dialog__mobile-only", children: (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "primary", size: "
|
|
223
|
+
? ((0, jsx_runtime_1.jsx)("span", { className: "muka-dialog__mobile-only", children: (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "primary", size: "lg", onClick: onMobileTrailingClick || onClose, children: mobileTrailingLabel }) }))
|
|
171
224
|
: undefined;
|
|
225
|
+
// Per design, BottomBar action buttons are `lg`.
|
|
226
|
+
const sizedFooterActions = footerActions
|
|
227
|
+
? withButtonSize(footerActions, 'lg')
|
|
228
|
+
: undefined;
|
|
172
229
|
// Surface inline style for drag/snap
|
|
173
230
|
const surfaceStyle = isDragging && dragHeight !== null
|
|
174
231
|
? { height: `${dragHeight}px`, transition: 'none' }
|
|
@@ -179,7 +236,7 @@ const Dialog = ({ open, onClose, children, size = 'sm', mobileHeight = 'full', m
|
|
|
179
236
|
return (
|
|
180
237
|
// Native <dialog> is interactive and handles Escape natively; click handler closes on backdrop click.
|
|
181
238
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
182
|
-
(0, jsx_runtime_1.jsx)("dialog", { ref: dialogRef, className: dialogClasses, onClick: handleBackdropClick, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, children: (0, jsx_runtime_1.jsxs)("div", { ref: surfaceRef, className: "muka-dialog__surface", style: surfaceStyle, tabIndex: -1, children: [!modal ? ((0, jsx_runtime_1.jsx)("div", { className: "muka-dialog__drag-area", onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, onPointerCancel: handlePointerUp, style: { touchAction: 'none' }, children: topBar })) : (topBar), (0, jsx_runtime_1.jsx)("div", { ref: bodyRef, className: "muka-dialog__body", children: children }),
|
|
239
|
+
(0, jsx_runtime_1.jsx)("dialog", { ref: dialogRef, className: dialogClasses, onClick: handleBackdropClick, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, children: (0, jsx_runtime_1.jsxs)("div", { ref: surfaceRef, className: "muka-dialog__surface", style: surfaceStyle, tabIndex: -1, children: [!modal ? ((0, jsx_runtime_1.jsx)("div", { className: "muka-dialog__drag-area", onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, onPointerCancel: handlePointerUp, style: { touchAction: 'none' }, children: topBar })) : (topBar), (0, jsx_runtime_1.jsx)("div", { ref: bodyRef, className: "muka-dialog__body", children: children }), sizedFooterActions && ((0, jsx_runtime_1.jsx)("div", { className: "muka-dialog__footer", children: (0, jsx_runtime_1.jsx)(BottomBar_1.BottomBar, { variant: footerVariant, size: "lg", bordered: false, children: sizedFooterActions }) }))] }) }));
|
|
183
240
|
};
|
|
184
241
|
exports.Dialog = Dialog;
|
|
185
242
|
exports.default = exports.Dialog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../components/Dialog/Dialog.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../components/Dialog/Dialog.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+CAA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AAsG;IACtG,kHAAkH;IAClH,mCACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,mBAAmB,gBAChB,SAAS,sBACH,eAAe,YAEjC,iCACE,GAAG,EAAE,UAAU,EACf,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,CAAC,CAAC,aAEX,CAAC,KAAK,CAAC,CAAC,CAAC,CACR,gCACE,SAAS,EAAC,wBAAwB,EAClC,aAAa,EAAE,iBAAiB,EAChC,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,eAAe,EAC5B,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,YAE7B,MAAM,GACH,CACP,CAAC,CAAC,CAAC,CACF,MAAM,CACP,EAED,gCAAK,GAAG,EAAE,OAAO,EAAE,SAAS,EAAC,mBAAmB,YAC7C,QAAQ,GACL,EAEL,kBAAkB,IAAI,CACrB,gCAAK,SAAS,EAAC,qBAAqB,YAClC,uBAAC,qBAAS,IAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAC,IAAI,EAAC,QAAQ,EAAE,KAAK,YACzD,kBAAkB,GACT,GACR,CACP,IACG,GACC,CACV,CAAC;AACJ,CAAC,CAAC;AAhRW,QAAA,MAAM,UAgRjB;AAEF,kBAAe,cAAM,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/* PhotoUploader Component Styles - Using Muka Design Tokens */
|
|
2
|
+
|
|
3
|
+
.muka-photo-uploader {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: flex-start;
|
|
7
|
+
gap: var(--spacing-4);
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Visually-hidden native file input */
|
|
12
|
+
.muka-photo-uploader__input {
|
|
13
|
+
position: absolute;
|
|
14
|
+
width: 1px;
|
|
15
|
+
height: 1px;
|
|
16
|
+
padding: 0;
|
|
17
|
+
margin: -1px;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
clip: rect(0, 0, 0, 0);
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
border: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* ─── Error feedback alert ────────────────────────────── */
|
|
25
|
+
.muka-photo-uploader__alert {
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* ─── Thumbnail grid ──────────────────────────────────── */
|
|
30
|
+
.muka-photo-uploader__grid {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
gap: var(--spacing-3);
|
|
34
|
+
width: 100%;
|
|
35
|
+
margin: 0;
|
|
36
|
+
padding: 0;
|
|
37
|
+
list-style: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.muka-photo-uploader__grid-item {
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* ─── Drop zone card ──────────────────────────────────── */
|
|
46
|
+
.muka-photo-uploader__dropzone {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
gap: var(--spacing-4);
|
|
52
|
+
width: 100%;
|
|
53
|
+
padding: var(--card-padding-lg);
|
|
54
|
+
background-color: var(--card-color-default-background);
|
|
55
|
+
border: var(--border-width-regular, 1px) solid var(--card-color-default-border);
|
|
56
|
+
border-radius: var(--border-radius-lg);
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
text-align: center;
|
|
59
|
+
transition: background-color var(--motion-duration-micro) var(--motion-easing-enter),
|
|
60
|
+
border-color var(--motion-duration-micro) var(--motion-easing-enter);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.muka-photo-uploader__dropzone:hover,
|
|
64
|
+
.muka-photo-uploader__dropzone--active {
|
|
65
|
+
border-color: var(--color-border-focus);
|
|
66
|
+
background-color: var(--color-surface-level1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.muka-photo-uploader__dropzone:focus-visible {
|
|
70
|
+
outline: 2px solid var(--color-border-focus);
|
|
71
|
+
outline-offset: 2px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.muka-photo-uploader__dropzone-icon {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
color: var(--color-icon-subtle-default);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.muka-photo-uploader__dropzone-text {
|
|
82
|
+
font-family: var(--text-body-md-regular-fontFamily);
|
|
83
|
+
font-size: var(--text-body-md-regular-fontSize);
|
|
84
|
+
font-weight: var(--text-body-md-regular-fontWeight);
|
|
85
|
+
line-height: var(--text-body-md-regular-lineHeight);
|
|
86
|
+
color: var(--color-text-subtle-default);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* ─── Disabled ────────────────────────────────────────── */
|
|
90
|
+
.muka-photo-uploader--disabled .muka-photo-uploader__dropzone {
|
|
91
|
+
cursor: not-allowed;
|
|
92
|
+
opacity: 0.6;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.muka-photo-uploader--disabled .muka-photo-uploader__dropzone:hover {
|
|
96
|
+
border-color: var(--card-color-default-border);
|
|
97
|
+
background-color: var(--card-color-default-background);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* ─── Enlarged photo dialog ───────────────────────────── */
|
|
101
|
+
.muka-photo-uploader__preview {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
width: 100%;
|
|
106
|
+
height: 100%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Fits the dialog while preserving the photo's original aspect ratio. */
|
|
110
|
+
.muka-photo-uploader__preview-image {
|
|
111
|
+
display: block;
|
|
112
|
+
max-width: 100%;
|
|
113
|
+
max-height: 100%;
|
|
114
|
+
width: auto;
|
|
115
|
+
height: auto;
|
|
116
|
+
object-fit: contain;
|
|
117
|
+
border-radius: var(--border-radius-lg);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* ─── Reduced motion ──────────────────────────────────── */
|
|
121
|
+
@media (prefers-reduced-motion: reduce) {
|
|
122
|
+
.muka-photo-uploader__dropzone {
|
|
123
|
+
transition: none;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PhotoUploader = void 0;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const Button_1 = require("../Button");
|
|
8
|
+
const Icon_1 = require("../Icon");
|
|
9
|
+
const Dialog_1 = require("../Dialog");
|
|
10
|
+
const Alert_1 = require("../Alert");
|
|
11
|
+
const Thumbnail_1 = require("../Thumbnail");
|
|
12
|
+
require("./PhotoUploader.css");
|
|
13
|
+
function generateId() {
|
|
14
|
+
return `photo-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
15
|
+
}
|
|
16
|
+
function isImageFile(file) {
|
|
17
|
+
return file.type.startsWith('image/');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* PhotoUploader Component
|
|
21
|
+
*
|
|
22
|
+
* A photo-first uploader: a primary "choose photos" button, a grid of
|
|
23
|
+
* `Thumbnail` tiles for the selected photos, and a drop-zone card. Each
|
|
24
|
+
* thumbnail shows a progress donut while uploading, a remove (×) button once
|
|
25
|
+
* loaded, and — when `enableDialog` is set — opens the photo full-size in a
|
|
26
|
+
* `Dialog` (original aspect ratio preserved) on click.
|
|
27
|
+
*
|
|
28
|
+
* Photos can be supplied controlled (`files` + `onFilesChange`) or left
|
|
29
|
+
* uncontrolled. Provide `uploadFn` to drive per-photo upload progress.
|
|
30
|
+
*/
|
|
31
|
+
exports.PhotoUploader = (0, react_1.forwardRef)(({ accept = 'image/*', multiple = true, maxSize, maxFiles, disabled = false, files: controlledFiles, onFilesChange, onError, uploadFn, processFile, shape = '4:3', chooseLabel = 'Choose photos', dropzoneLabel = 'Or drag photos here', dialogTitle, enableDialog = true, dialogCloseButtonLabel = 'Close', dialogRemoveLabel = 'Delete photo', dialogCloseLabel = 'Close', showErrorAlert = true, errorAlertTitle = (count) => `${count} photo${count === 1 ? '' : 's'} couldn’t be added`, errorAlertMessage = 'Check if photos are fully downloaded and try again', className = '', 'aria-label': ariaLabel, ...props }, ref) => {
|
|
32
|
+
const [internalFiles, setInternalFiles] = (0, react_1.useState)([]);
|
|
33
|
+
const [isDragActive, setIsDragActive] = (0, react_1.useState)(false);
|
|
34
|
+
const [activeId, setActiveId] = (0, react_1.useState)(null);
|
|
35
|
+
const [alertDismissed, setAlertDismissed] = (0, react_1.useState)(false);
|
|
36
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
37
|
+
const files = controlledFiles ?? internalFiles;
|
|
38
|
+
// Latest-value ref so functional `setFiles` updates chain correctly across
|
|
39
|
+
// the awaits in `processFiles` (process → upload) without stale closures.
|
|
40
|
+
const filesRef = (0, react_1.useRef)(files);
|
|
41
|
+
filesRef.current = files;
|
|
42
|
+
const setFiles = (0, react_1.useCallback)((newFiles) => {
|
|
43
|
+
const updatedFiles = typeof newFiles === 'function' ? newFiles(filesRef.current) : newFiles;
|
|
44
|
+
filesRef.current = updatedFiles;
|
|
45
|
+
if (!controlledFiles) {
|
|
46
|
+
setInternalFiles(updatedFiles);
|
|
47
|
+
}
|
|
48
|
+
onFilesChange?.(updatedFiles);
|
|
49
|
+
}, [controlledFiles, onFilesChange]);
|
|
50
|
+
const validateFile = (0, react_1.useCallback)((file) => {
|
|
51
|
+
if (accept) {
|
|
52
|
+
const acceptedTypes = accept.split(',').map((t) => t.trim());
|
|
53
|
+
const isAccepted = acceptedTypes.some((type) => {
|
|
54
|
+
if (type.startsWith('.')) {
|
|
55
|
+
return file.name.toLowerCase().endsWith(type.toLowerCase());
|
|
56
|
+
}
|
|
57
|
+
if (type.endsWith('/*')) {
|
|
58
|
+
return file.type.startsWith(type.slice(0, -1));
|
|
59
|
+
}
|
|
60
|
+
return file.type === type;
|
|
61
|
+
});
|
|
62
|
+
if (!isAccepted) {
|
|
63
|
+
return { type: 'type', message: `File type not accepted: ${file.name}`, file };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (maxSize && file.size > maxSize) {
|
|
67
|
+
return { type: 'size', message: `File too large: ${file.name}`, file };
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}, [accept, maxSize]);
|
|
71
|
+
const processFiles = (0, react_1.useCallback)(async (selectedFiles) => {
|
|
72
|
+
const fileArray = Array.from(selectedFiles);
|
|
73
|
+
if (maxFiles && files.length + fileArray.length > maxFiles) {
|
|
74
|
+
onError?.({ type: 'count', message: `Maximum ${maxFiles} photos allowed` });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const newFiles = [];
|
|
78
|
+
for (const file of fileArray) {
|
|
79
|
+
const error = validateFile(file);
|
|
80
|
+
if (error) {
|
|
81
|
+
onError?.(error);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
newFiles.push({
|
|
85
|
+
file,
|
|
86
|
+
id: generateId(),
|
|
87
|
+
status: processFile ? 'processing' : uploadFn ? 'pending' : 'success',
|
|
88
|
+
previewUrl: isImageFile(file) ? URL.createObjectURL(file) : undefined,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (newFiles.length === 0)
|
|
92
|
+
return;
|
|
93
|
+
setFiles(multiple ? [...files, ...newFiles] : newFiles);
|
|
94
|
+
if (!processFile && !uploadFn)
|
|
95
|
+
return;
|
|
96
|
+
for (const fileWithStatus of newFiles) {
|
|
97
|
+
let currentFile = fileWithStatus.file;
|
|
98
|
+
// ─── Pre-upload transform (HEIC conversion / compression) ─────────
|
|
99
|
+
if (processFile) {
|
|
100
|
+
try {
|
|
101
|
+
currentFile = await processFile(currentFile);
|
|
102
|
+
const processed = currentFile;
|
|
103
|
+
// Regenerate the preview from the processed file (e.g. a HEIC
|
|
104
|
+
// original can't preview, but its converted JPEG can).
|
|
105
|
+
setFiles((prev) => prev.map((f) => {
|
|
106
|
+
if (f.id !== fileWithStatus.id)
|
|
107
|
+
return f;
|
|
108
|
+
if (f.previewUrl)
|
|
109
|
+
URL.revokeObjectURL(f.previewUrl);
|
|
110
|
+
return {
|
|
111
|
+
...f,
|
|
112
|
+
file: processed,
|
|
113
|
+
previewUrl: isImageFile(processed)
|
|
114
|
+
? URL.createObjectURL(processed)
|
|
115
|
+
: undefined,
|
|
116
|
+
};
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
setFiles((prev) => prev.map((f) => f.id === fileWithStatus.id
|
|
121
|
+
? {
|
|
122
|
+
...f,
|
|
123
|
+
status: 'error',
|
|
124
|
+
error: err instanceof Error ? err.message : 'Processing failed',
|
|
125
|
+
}
|
|
126
|
+
: f));
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// ─── Upload ───────────────────────────────────────────────────────
|
|
131
|
+
if (!uploadFn) {
|
|
132
|
+
setFiles((prev) => prev.map((f) => f.id === fileWithStatus.id ? { ...f, status: 'success' } : f));
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
setFiles((prev) => prev.map((f) => f.id === fileWithStatus.id
|
|
136
|
+
? { ...f, status: 'uploading', progress: 0 }
|
|
137
|
+
: f));
|
|
138
|
+
try {
|
|
139
|
+
const result = await uploadFn(currentFile, (progress) => {
|
|
140
|
+
setFiles((prev) => prev.map((f) => (f.id === fileWithStatus.id ? { ...f, progress } : f)));
|
|
141
|
+
});
|
|
142
|
+
setFiles((prev) => prev.map((f) => f.id === fileWithStatus.id
|
|
143
|
+
? {
|
|
144
|
+
...f,
|
|
145
|
+
status: result.success ? 'success' : 'error',
|
|
146
|
+
error: result.error,
|
|
147
|
+
progress: 100,
|
|
148
|
+
}
|
|
149
|
+
: f));
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
setFiles((prev) => prev.map((f) => f.id === fileWithStatus.id
|
|
153
|
+
? {
|
|
154
|
+
...f,
|
|
155
|
+
status: 'error',
|
|
156
|
+
error: err instanceof Error ? err.message : 'Upload failed',
|
|
157
|
+
}
|
|
158
|
+
: f));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}, [files, maxFiles, multiple, onError, setFiles, uploadFn, processFile, validateFile]);
|
|
162
|
+
const handleRemove = (0, react_1.useCallback)((id) => {
|
|
163
|
+
setFiles((prev) => {
|
|
164
|
+
const target = prev.find((f) => f.id === id);
|
|
165
|
+
if (target?.previewUrl) {
|
|
166
|
+
URL.revokeObjectURL(target.previewUrl);
|
|
167
|
+
}
|
|
168
|
+
return prev.filter((f) => f.id !== id);
|
|
169
|
+
});
|
|
170
|
+
}, [setFiles]);
|
|
171
|
+
const openPicker = (0, react_1.useCallback)(() => {
|
|
172
|
+
if (!disabled)
|
|
173
|
+
inputRef.current?.click();
|
|
174
|
+
}, [disabled]);
|
|
175
|
+
const handleInputChange = (0, react_1.useCallback)((e) => {
|
|
176
|
+
const selected = e.target.files;
|
|
177
|
+
if (selected && selected.length > 0) {
|
|
178
|
+
processFiles(selected);
|
|
179
|
+
}
|
|
180
|
+
e.target.value = '';
|
|
181
|
+
}, [processFiles]);
|
|
182
|
+
const handleDragEnter = (0, react_1.useCallback)((e) => {
|
|
183
|
+
e.preventDefault();
|
|
184
|
+
e.stopPropagation();
|
|
185
|
+
if (!disabled)
|
|
186
|
+
setIsDragActive(true);
|
|
187
|
+
}, [disabled]);
|
|
188
|
+
const handleDragLeave = (0, react_1.useCallback)((e) => {
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
e.stopPropagation();
|
|
191
|
+
setIsDragActive(false);
|
|
192
|
+
}, []);
|
|
193
|
+
const handleDragOver = (0, react_1.useCallback)((e) => {
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
e.stopPropagation();
|
|
196
|
+
if (!disabled)
|
|
197
|
+
setIsDragActive(true);
|
|
198
|
+
}, [disabled]);
|
|
199
|
+
const handleDrop = (0, react_1.useCallback)((e) => {
|
|
200
|
+
e.preventDefault();
|
|
201
|
+
e.stopPropagation();
|
|
202
|
+
setIsDragActive(false);
|
|
203
|
+
if (disabled)
|
|
204
|
+
return;
|
|
205
|
+
const dropped = e.dataTransfer.files;
|
|
206
|
+
if (dropped.length > 0)
|
|
207
|
+
processFiles(dropped);
|
|
208
|
+
}, [disabled, processFiles]);
|
|
209
|
+
const handleDropzoneKeyDown = (0, react_1.useCallback)((e) => {
|
|
210
|
+
if ((e.key === 'Enter' || e.key === ' ') && !disabled) {
|
|
211
|
+
e.preventDefault();
|
|
212
|
+
openPicker();
|
|
213
|
+
}
|
|
214
|
+
}, [disabled, openPicker]);
|
|
215
|
+
const closeDialog = (0, react_1.useCallback)(() => setActiveId(null), []);
|
|
216
|
+
const handleDialogRemove = (0, react_1.useCallback)(() => {
|
|
217
|
+
if (activeId) {
|
|
218
|
+
handleRemove(activeId);
|
|
219
|
+
setActiveId(null);
|
|
220
|
+
}
|
|
221
|
+
}, [activeId, handleRemove]);
|
|
222
|
+
const activePhoto = activeId ? files.find((f) => f.id === activeId) : undefined;
|
|
223
|
+
const errorCount = files.reduce((n, f) => (f.status === 'error' ? n + 1 : n), 0);
|
|
224
|
+
// Re-surface the Alert only when the failure count grows (a new failure),
|
|
225
|
+
// not while previously-failed photos merely persist after a dismissal.
|
|
226
|
+
const prevErrorCount = (0, react_1.useRef)(0);
|
|
227
|
+
(0, react_1.useEffect)(() => {
|
|
228
|
+
if (errorCount > prevErrorCount.current)
|
|
229
|
+
setAlertDismissed(false);
|
|
230
|
+
prevErrorCount.current = errorCount;
|
|
231
|
+
}, [errorCount]);
|
|
232
|
+
const showAlert = showErrorAlert && errorCount > 0 && !alertDismissed;
|
|
233
|
+
const classes = [
|
|
234
|
+
'muka-photo-uploader',
|
|
235
|
+
disabled && 'muka-photo-uploader--disabled',
|
|
236
|
+
className,
|
|
237
|
+
]
|
|
238
|
+
.filter(Boolean)
|
|
239
|
+
.join(' ');
|
|
240
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: classes, ...props, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "file", accept: accept, multiple: multiple, disabled: disabled, onChange: handleInputChange, className: "muka-photo-uploader__input", tabIndex: -1, "aria-hidden": "true" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "primary", size: "md", onClick: openPicker, disabled: disabled, iconLeft: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "add", variant: "line" }), children: chooseLabel }), showAlert && ((0, jsx_runtime_1.jsx)(Alert_1.Alert, { className: "muka-photo-uploader__alert", variant: "error", title: errorAlertTitle(errorCount), icon: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "alert", variant: "fill", size: "md" }), dismissible: true, onDismiss: () => setAlertDismissed(true), children: errorAlertMessage })), files.length > 0 && ((0, jsx_runtime_1.jsx)("ul", { className: "muka-photo-uploader__grid", "aria-label": "Selected photos", children: files.map((f) => {
|
|
241
|
+
const isProcessing = f.status === 'processing';
|
|
242
|
+
const isUploading = f.status === 'uploading' || f.status === 'pending';
|
|
243
|
+
const isError = f.status === 'error';
|
|
244
|
+
const isBusy = isProcessing || isUploading;
|
|
245
|
+
return ((0, jsx_runtime_1.jsx)("li", { className: "muka-photo-uploader__grid-item", children: (0, jsx_runtime_1.jsx)(Thumbnail_1.Thumbnail, { src: f.previewUrl ?? '', alt: f.file.name, shape: shape, processing: isProcessing, loading: isUploading, error: isError, caption: isError ? f.file.name : undefined, errorReason: f.error, progress: f.progress ?? 0, onRemove: disabled ? undefined : () => handleRemove(f.id), onClick: enableDialog && !isBusy && !isError && f.previewUrl
|
|
246
|
+
? () => setActiveId(f.id)
|
|
247
|
+
: undefined, viewLabel: `View ${f.file.name}`, removeLabel: `Remove ${f.file.name}` }) }, f.id));
|
|
248
|
+
}) })), (0, jsx_runtime_1.jsxs)("div", { className: [
|
|
249
|
+
'muka-photo-uploader__dropzone',
|
|
250
|
+
isDragActive && 'muka-photo-uploader__dropzone--active',
|
|
251
|
+
]
|
|
252
|
+
.filter(Boolean)
|
|
253
|
+
.join(' '), onClick: openPicker, onKeyDown: handleDropzoneKeyDown, onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop, role: "button", tabIndex: disabled ? -1 : 0, "aria-label": ariaLabel ?? 'Upload photos', "aria-disabled": disabled, "aria-dropeffect": "copy", children: [(0, jsx_runtime_1.jsx)("span", { className: "muka-photo-uploader__dropzone-icon", "aria-hidden": "true", children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "image", variant: "line", size: "lg", colorVariant: "subtle" }) }), (0, jsx_runtime_1.jsx)("span", { className: "muka-photo-uploader__dropzone-text", children: dropzoneLabel })] }), enableDialog && ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { open: Boolean(activePhoto), onClose: closeDialog, modal: false, size: "md", title: dialogTitle, "aria-label": dialogTitle ?? activePhoto?.file.name ?? 'Photo preview', trailing: (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "ghost", size: "sm", iconOnly: true, onClick: closeDialog, "aria-label": dialogCloseButtonLabel, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "close", variant: "line" }) }), footerActions: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "tertiary", size: "md", onClick: handleDialogRemove, children: dialogRemoveLabel }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "primary", size: "md", onClick: closeDialog, children: dialogCloseLabel })] }), children: activePhoto?.previewUrl && ((0, jsx_runtime_1.jsx)("div", { className: "muka-photo-uploader__preview", children: (0, jsx_runtime_1.jsx)("img", { className: "muka-photo-uploader__preview-image", src: activePhoto.previewUrl, alt: activePhoto.file.name }) })) }))] }));
|
|
254
|
+
});
|
|
255
|
+
exports.PhotoUploader.displayName = 'PhotoUploader';
|
|
256
|
+
exports.default = exports.PhotoUploader;
|
|
257
|
+
//# sourceMappingURL=PhotoUploader.js.map
|