@poolse/react-ui 1.0.5 → 1.0.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.
- package/dist/index.cjs +12 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/styles.css +17 -0
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -343,6 +343,7 @@ function UploadChip({
|
|
|
343
343
|
}) {
|
|
344
344
|
const pct = item.byteSize > 0 ? Math.min(100, Math.round(item.loaded / item.byteSize * 100)) : 0;
|
|
345
345
|
const isError = item.status === "error";
|
|
346
|
+
const isReady = item.status === "ready";
|
|
346
347
|
const isInFlight = item.status === "pending" || item.status === "uploading";
|
|
347
348
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
348
349
|
"div",
|
|
@@ -350,10 +351,15 @@ function UploadChip({
|
|
|
350
351
|
className: `poolse-upload-chip poolse-upload-chip--${item.status}`,
|
|
351
352
|
"data-status": item.status,
|
|
352
353
|
children: [
|
|
353
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-upload-chip__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name:
|
|
354
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-upload-chip__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: isReady ? "check" : "attachment", size: 18, label: null }) }),
|
|
354
355
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "poolse-upload-chip__body", children: [
|
|
355
356
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-upload-chip__filename", title: item.filename, children: item.filename }),
|
|
356
|
-
isError ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-upload-chip__error", children: item.error?.message ?? "Upload failed" }) :
|
|
357
|
+
isError ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-upload-chip__error", children: item.error?.message ?? "Upload failed" }) : isReady ? (
|
|
358
|
+
// No progress bar once the upload is done — the chip itself
|
|
359
|
+
// is the "staged, waiting on send" signal. A short caption
|
|
360
|
+
// makes that explicit for screen-readers + glance-readers.
|
|
361
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-upload-chip__ready-label", children: "Ready to send" })
|
|
362
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
357
363
|
"div",
|
|
358
364
|
{
|
|
359
365
|
className: "poolse-upload-chip__bar",
|
|
@@ -372,8 +378,8 @@ function UploadChip({
|
|
|
372
378
|
type: "button",
|
|
373
379
|
className: "poolse-upload-chip__action",
|
|
374
380
|
onClick: isInFlight ? onCancel : onDismiss,
|
|
375
|
-
"aria-label": isInFlight ? `Cancel upload of ${item.filename}` : `Dismiss ${item.filename}`,
|
|
376
|
-
title: isInFlight ? "Cancel" : "Dismiss",
|
|
381
|
+
"aria-label": isInFlight ? `Cancel upload of ${item.filename}` : isReady ? `Remove ${item.filename}` : `Dismiss ${item.filename}`,
|
|
382
|
+
title: isInFlight ? "Cancel" : isReady ? "Remove" : "Dismiss",
|
|
377
383
|
children: "\xD7"
|
|
378
384
|
}
|
|
379
385
|
)
|
|
@@ -436,9 +442,7 @@ var MentionInput = react.forwardRef(
|
|
|
436
442
|
const fileInputRef = react.useRef(null);
|
|
437
443
|
useAutogrow(taRef, value);
|
|
438
444
|
const { queue, uploadAll, cancel: cancelUpload, remove: removeUpload } = react$1.useAttachmentUpload();
|
|
439
|
-
const visibleUploads = queue.filter(
|
|
440
|
-
(it) => it.status === "pending" || it.status === "uploading" || it.status === "error"
|
|
441
|
-
);
|
|
445
|
+
const visibleUploads = queue.filter((it) => it.status !== "cancelled");
|
|
442
446
|
const readyCount = queue.filter((it) => it.status === "ready").length;
|
|
443
447
|
const uploading = queue.some((it) => it.status === "pending" || it.status === "uploading");
|
|
444
448
|
const addFiles = (files) => {
|
|
@@ -718,9 +722,7 @@ var MessageComposer = react.forwardRef(
|
|
|
718
722
|
cancel: cancelUpload,
|
|
719
723
|
remove: removeUpload
|
|
720
724
|
} = react$1.useAttachmentUpload();
|
|
721
|
-
const visibleUploads = queue.filter(
|
|
722
|
-
(it) => it.status === "pending" || it.status === "uploading" || it.status === "error"
|
|
723
|
-
);
|
|
725
|
+
const visibleUploads = queue.filter((it) => it.status !== "cancelled");
|
|
724
726
|
const readyCount = queue.filter((it) => it.status === "ready").length;
|
|
725
727
|
const uploading = queue.some(
|
|
726
728
|
(it) => it.status === "pending" || it.status === "uploading"
|