@pallasoft/ps-file-components 2.0.0 → 2.0.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.
@@ -4,5 +4,5 @@ exports.PsFileDeleteConfirm = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ps_core_components_1 = require("@pallasoft/ps-core-components");
6
6
  const ps_popovers_1 = require("@pallasoft/ps-popovers");
7
- const PsFileDeleteConfirm = ({ fileName, isDeleting, isOpen, labels, onCancel, onConfirm, }) => ((0, jsx_runtime_1.jsx)(ps_popovers_1.PsModal, { eyebrow: fileName, isOpen: isOpen, onClose: onCancel, size: 'sm', title: labels.deleteConfirm, children: (0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-col gap-5', children: [(0, jsx_runtime_1.jsxs)("p", { className: 'text-sm text-ink/70', children: [(0, jsx_runtime_1.jsx)("span", { className: 'font-medium text-ink', children: fileName }), " ", labels.deleteConfirmBody] }), (0, jsx_runtime_1.jsxs)("div", { className: 'flex justify-end gap-2 border-t border-line pt-4', children: [(0, jsx_runtime_1.jsx)(ps_core_components_1.PsButton, { disabled: isDeleting, onClick: onCancel, type: 'button', variant: 'ghost', children: labels.deleteCancel }), (0, jsx_runtime_1.jsx)(ps_core_components_1.PsButton, { isLoading: isDeleting, onClick: onConfirm, type: 'button', variant: 'danger', children: labels.delete })] })] }) }));
7
+ const PsFileDeleteConfirm = ({ fileName, isDeleting, isOpen, labels, onCancel, onConfirm, }) => ((0, jsx_runtime_1.jsx)(ps_popovers_1.PsModal, { eyebrow: fileName, footer: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ps_core_components_1.PsButton, { disabled: isDeleting, onClick: onCancel, type: 'button', variant: 'surface', children: labels.deleteCancel }), (0, jsx_runtime_1.jsx)(ps_core_components_1.PsButton, { isLoading: isDeleting, onClick: onConfirm, type: 'button', variant: 'danger', children: labels.delete })] }), isOpen: isOpen, onClose: onCancel, size: 'sm', title: labels.deleteConfirm, children: (0, jsx_runtime_1.jsxs)("p", { className: 'text-sm text-ink/70', children: [(0, jsx_runtime_1.jsx)("span", { className: 'font-medium text-ink', children: fileName }), " ", labels.deleteConfirmBody] }) }));
8
8
  exports.PsFileDeleteConfirm = PsFileDeleteConfirm;
@@ -11,6 +11,6 @@ const PsUploadModal = ({ isOpen, labels, onClose, queue }) => {
11
11
  const text = { ...ps_upload_labels_1.PsUploadLabels, ...labels };
12
12
  const summary = ps_upload_queue_service_1.PsUploadQueueService.summary(queue.items);
13
13
  const title = queue.isBusy ? text.title : summary.failed > 0 ? text.titleFailed : text.titleDone;
14
- return ((0, jsx_runtime_1.jsx)(ps_popovers_1.PsModal, { isOpen: isOpen, onClose: onClose, size: 'md', title: title, children: (0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-col gap-5', children: [(0, jsx_runtime_1.jsx)("ul", { className: 'flex max-h-[50vh] flex-col gap-2 overflow-y-auto', children: queue.items.map((item) => ((0, jsx_runtime_1.jsx)(ps_upload_row_1.PsUploadRow, { item: item, labels: text, onCancel: () => queue.cancel(item.id), onRemove: () => queue.remove(item.id), onRetry: () => queue.retry(item.id) }, item.id))) }), (0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-wrap items-center justify-end gap-2 border-t border-line pt-4', children: [queue.isBusy ? ((0, jsx_runtime_1.jsx)(ps_core_components_1.PsButton, { onClick: () => queue.items.forEach((item) => queue.cancel(item.id)), type: 'button', variant: 'ghost', children: text.cancelAll })) : null, (0, jsx_runtime_1.jsx)(ps_core_components_1.PsButton, { onClick: onClose, type: 'button', variant: 'primary', children: text.finish })] })] }) }));
14
+ return ((0, jsx_runtime_1.jsx)(ps_popovers_1.PsModal, { footer: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [queue.isBusy ? ((0, jsx_runtime_1.jsx)(ps_core_components_1.PsButton, { onClick: () => queue.items.forEach((item) => queue.cancel(item.id)), type: 'button', variant: 'surface', children: text.cancelAll })) : null, (0, jsx_runtime_1.jsx)(ps_core_components_1.PsButton, { onClick: onClose, type: 'button', variant: 'primary', children: text.finish })] }), isOpen: isOpen, onClose: onClose, size: 'md', title: title, children: (0, jsx_runtime_1.jsx)("ul", { className: 'flex flex-col gap-2', children: queue.items.map((item) => ((0, jsx_runtime_1.jsx)(ps_upload_row_1.PsUploadRow, { item: item, labels: text, onCancel: () => queue.cancel(item.id), onRemove: () => queue.remove(item.id), onRetry: () => queue.retry(item.id) }, item.id))) }) }));
15
15
  };
16
16
  exports.PsUploadModal = PsUploadModal;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { PsButton } from '@pallasoft/ps-core-components';
3
3
  import { PsModal } from '@pallasoft/ps-popovers';
4
- export const PsFileDeleteConfirm = ({ fileName, isDeleting, isOpen, labels, onCancel, onConfirm, }) => (_jsx(PsModal, { eyebrow: fileName, isOpen: isOpen, onClose: onCancel, size: 'sm', title: labels.deleteConfirm, children: _jsxs("div", { className: 'flex flex-col gap-5', children: [_jsxs("p", { className: 'text-sm text-ink/70', children: [_jsx("span", { className: 'font-medium text-ink', children: fileName }), " ", labels.deleteConfirmBody] }), _jsxs("div", { className: 'flex justify-end gap-2 border-t border-line pt-4', children: [_jsx(PsButton, { disabled: isDeleting, onClick: onCancel, type: 'button', variant: 'ghost', children: labels.deleteCancel }), _jsx(PsButton, { isLoading: isDeleting, onClick: onConfirm, type: 'button', variant: 'danger', children: labels.delete })] })] }) }));
4
+ export const PsFileDeleteConfirm = ({ fileName, isDeleting, isOpen, labels, onCancel, onConfirm, }) => (_jsx(PsModal, { eyebrow: fileName, footer: _jsxs(_Fragment, { children: [_jsx(PsButton, { disabled: isDeleting, onClick: onCancel, type: 'button', variant: 'surface', children: labels.deleteCancel }), _jsx(PsButton, { isLoading: isDeleting, onClick: onConfirm, type: 'button', variant: 'danger', children: labels.delete })] }), isOpen: isOpen, onClose: onCancel, size: 'sm', title: labels.deleteConfirm, children: _jsxs("p", { className: 'text-sm text-ink/70', children: [_jsx("span", { className: 'font-medium text-ink', children: fileName }), " ", labels.deleteConfirmBody] }) }));
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { PsButton } from '@pallasoft/ps-core-components';
3
3
  import { PsModal } from '@pallasoft/ps-popovers';
4
4
  import { PsUploadLabels } from '../constants/ps-upload-labels';
@@ -8,5 +8,5 @@ export const PsUploadModal = ({ isOpen, labels, onClose, queue }) => {
8
8
  const text = { ...PsUploadLabels, ...labels };
9
9
  const summary = PsUploadQueueService.summary(queue.items);
10
10
  const title = queue.isBusy ? text.title : summary.failed > 0 ? text.titleFailed : text.titleDone;
11
- return (_jsx(PsModal, { isOpen: isOpen, onClose: onClose, size: 'md', title: title, children: _jsxs("div", { className: 'flex flex-col gap-5', children: [_jsx("ul", { className: 'flex max-h-[50vh] flex-col gap-2 overflow-y-auto', children: queue.items.map((item) => (_jsx(PsUploadRow, { item: item, labels: text, onCancel: () => queue.cancel(item.id), onRemove: () => queue.remove(item.id), onRetry: () => queue.retry(item.id) }, item.id))) }), _jsxs("div", { className: 'flex flex-wrap items-center justify-end gap-2 border-t border-line pt-4', children: [queue.isBusy ? (_jsx(PsButton, { onClick: () => queue.items.forEach((item) => queue.cancel(item.id)), type: 'button', variant: 'ghost', children: text.cancelAll })) : null, _jsx(PsButton, { onClick: onClose, type: 'button', variant: 'primary', children: text.finish })] })] }) }));
11
+ return (_jsx(PsModal, { footer: _jsxs(_Fragment, { children: [queue.isBusy ? (_jsx(PsButton, { onClick: () => queue.items.forEach((item) => queue.cancel(item.id)), type: 'button', variant: 'surface', children: text.cancelAll })) : null, _jsx(PsButton, { onClick: onClose, type: 'button', variant: 'primary', children: text.finish })] }), isOpen: isOpen, onClose: onClose, size: 'md', title: title, children: _jsx("ul", { className: 'flex flex-col gap-2', children: queue.items.map((item) => (_jsx(PsUploadRow, { item: item, labels: text, onCancel: () => queue.cancel(item.id), onRemove: () => queue.remove(item.id), onRetry: () => queue.retry(item.id) }, item.id))) }) }));
12
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pallasoft/ps-file-components",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -20,8 +20,6 @@
20
20
  "scripts": {
21
21
  "husky:prepare": "npx husky",
22
22
  "build": "tsc && tsc -p tsconfig.esm.json && node -e \"require('fs').writeFileSync('dist/esm/package.json', JSON.stringify({ type: 'module' }))\"",
23
- "setup:graphify": "sh scripts/graphify-setup.sh",
24
- "update:graphify": "sh scripts/graphify-update.sh",
25
23
  "lint": "npm run lint:eslint",
26
24
  "lint:fix": "npm run lint:eslint:fix",
27
25
  "format:check": "npx prettier --check --ignore-unknown \"src/**/*.{ts,tsx,json,md}\"",
@@ -32,9 +30,9 @@
32
30
  "test": "vitest run"
33
31
  },
34
32
  "dependencies": {
35
- "@pallasoft/ps-core-components": "^2.29.0",
33
+ "@pallasoft/ps-core-components": "^2.37.0",
36
34
  "@pallasoft/ps-icons": "^1.9.0",
37
- "@pallasoft/ps-popovers": "^1.10.2",
35
+ "@pallasoft/ps-popovers": "^1.13.0",
38
36
  "@pallasoft/ps-utilities": "^2.19.1",
39
37
  "pdfjs-dist": "^6.3.289"
40
38
  },