@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.d.cts
CHANGED
|
@@ -409,9 +409,11 @@ interface UploadQueueStripProps {
|
|
|
409
409
|
onDismiss: (localId: string) => void;
|
|
410
410
|
}
|
|
411
411
|
/**
|
|
412
|
-
* Strip of
|
|
413
|
-
*
|
|
414
|
-
*
|
|
412
|
+
* Strip of staged attachments shown above the composer — pending,
|
|
413
|
+
* uploading, ready (waiting for the user to hit send), or errored.
|
|
414
|
+
* Ready chips are the user's signal that "these will go out when I
|
|
415
|
+
* press send" — the composer parent sweeps them out only after the
|
|
416
|
+
* send completes successfully.
|
|
415
417
|
*/
|
|
416
418
|
declare function UploadQueueStrip({ items, onCancel, onDismiss }: UploadQueueStripProps): react_jsx_runtime.JSX.Element | null;
|
|
417
419
|
|
package/dist/index.d.ts
CHANGED
|
@@ -409,9 +409,11 @@ interface UploadQueueStripProps {
|
|
|
409
409
|
onDismiss: (localId: string) => void;
|
|
410
410
|
}
|
|
411
411
|
/**
|
|
412
|
-
* Strip of
|
|
413
|
-
*
|
|
414
|
-
*
|
|
412
|
+
* Strip of staged attachments shown above the composer — pending,
|
|
413
|
+
* uploading, ready (waiting for the user to hit send), or errored.
|
|
414
|
+
* Ready chips are the user's signal that "these will go out when I
|
|
415
|
+
* press send" — the composer parent sweeps them out only after the
|
|
416
|
+
* send completes successfully.
|
|
415
417
|
*/
|
|
416
418
|
declare function UploadQueueStrip({ items, onCancel, onDismiss }: UploadQueueStripProps): react_jsx_runtime.JSX.Element | null;
|
|
417
419
|
|
package/dist/index.js
CHANGED
|
@@ -336,6 +336,7 @@ function UploadChip({
|
|
|
336
336
|
}) {
|
|
337
337
|
const pct = item.byteSize > 0 ? Math.min(100, Math.round(item.loaded / item.byteSize * 100)) : 0;
|
|
338
338
|
const isError = item.status === "error";
|
|
339
|
+
const isReady = item.status === "ready";
|
|
339
340
|
const isInFlight = item.status === "pending" || item.status === "uploading";
|
|
340
341
|
return /* @__PURE__ */ jsxs(
|
|
341
342
|
"div",
|
|
@@ -343,10 +344,15 @@ function UploadChip({
|
|
|
343
344
|
className: `poolse-upload-chip poolse-upload-chip--${item.status}`,
|
|
344
345
|
"data-status": item.status,
|
|
345
346
|
children: [
|
|
346
|
-
/* @__PURE__ */ jsx("div", { className: "poolse-upload-chip__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(PoolseIcon, { name:
|
|
347
|
+
/* @__PURE__ */ jsx("div", { className: "poolse-upload-chip__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(PoolseIcon, { name: isReady ? "check" : "attachment", size: 18, label: null }) }),
|
|
347
348
|
/* @__PURE__ */ jsxs("div", { className: "poolse-upload-chip__body", children: [
|
|
348
349
|
/* @__PURE__ */ jsx("div", { className: "poolse-upload-chip__filename", title: item.filename, children: item.filename }),
|
|
349
|
-
isError ? /* @__PURE__ */ jsx("div", { className: "poolse-upload-chip__error", children: item.error?.message ?? "Upload failed" }) :
|
|
350
|
+
isError ? /* @__PURE__ */ jsx("div", { className: "poolse-upload-chip__error", children: item.error?.message ?? "Upload failed" }) : isReady ? (
|
|
351
|
+
// No progress bar once the upload is done — the chip itself
|
|
352
|
+
// is the "staged, waiting on send" signal. A short caption
|
|
353
|
+
// makes that explicit for screen-readers + glance-readers.
|
|
354
|
+
/* @__PURE__ */ jsx("div", { className: "poolse-upload-chip__ready-label", children: "Ready to send" })
|
|
355
|
+
) : /* @__PURE__ */ jsx(
|
|
350
356
|
"div",
|
|
351
357
|
{
|
|
352
358
|
className: "poolse-upload-chip__bar",
|
|
@@ -365,8 +371,8 @@ function UploadChip({
|
|
|
365
371
|
type: "button",
|
|
366
372
|
className: "poolse-upload-chip__action",
|
|
367
373
|
onClick: isInFlight ? onCancel : onDismiss,
|
|
368
|
-
"aria-label": isInFlight ? `Cancel upload of ${item.filename}` : `Dismiss ${item.filename}`,
|
|
369
|
-
title: isInFlight ? "Cancel" : "Dismiss",
|
|
374
|
+
"aria-label": isInFlight ? `Cancel upload of ${item.filename}` : isReady ? `Remove ${item.filename}` : `Dismiss ${item.filename}`,
|
|
375
|
+
title: isInFlight ? "Cancel" : isReady ? "Remove" : "Dismiss",
|
|
370
376
|
children: "\xD7"
|
|
371
377
|
}
|
|
372
378
|
)
|
|
@@ -429,9 +435,7 @@ var MentionInput = forwardRef(
|
|
|
429
435
|
const fileInputRef = useRef(null);
|
|
430
436
|
useAutogrow(taRef, value);
|
|
431
437
|
const { queue, uploadAll, cancel: cancelUpload, remove: removeUpload } = useAttachmentUpload();
|
|
432
|
-
const visibleUploads = queue.filter(
|
|
433
|
-
(it) => it.status === "pending" || it.status === "uploading" || it.status === "error"
|
|
434
|
-
);
|
|
438
|
+
const visibleUploads = queue.filter((it) => it.status !== "cancelled");
|
|
435
439
|
const readyCount = queue.filter((it) => it.status === "ready").length;
|
|
436
440
|
const uploading = queue.some((it) => it.status === "pending" || it.status === "uploading");
|
|
437
441
|
const addFiles = (files) => {
|
|
@@ -711,9 +715,7 @@ var MessageComposer = forwardRef(
|
|
|
711
715
|
cancel: cancelUpload,
|
|
712
716
|
remove: removeUpload
|
|
713
717
|
} = useAttachmentUpload();
|
|
714
|
-
const visibleUploads = queue.filter(
|
|
715
|
-
(it) => it.status === "pending" || it.status === "uploading" || it.status === "error"
|
|
716
|
-
);
|
|
718
|
+
const visibleUploads = queue.filter((it) => it.status !== "cancelled");
|
|
717
719
|
const readyCount = queue.filter((it) => it.status === "ready").length;
|
|
718
720
|
const uploading = queue.some(
|
|
719
721
|
(it) => it.status === "pending" || it.status === "uploading"
|