@epam/ai-dial-ui-kit 0.15.0-dev.19 → 0.15.0-dev.20
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/README.md +1 -0
- package/dist/CHANGELOG.md +2 -0
- package/dist/{DateCellRenderer-Cm8zyHcC.cjs → DateCellRenderer-CkFOYZGc.cjs} +1 -1
- package/dist/{DateCellRenderer-BZR0gzAZ.cjs → DateCellRenderer-ZLb4GAUV.cjs} +1 -1
- package/dist/JsonEditor-CpSpVa0v.cjs +1 -0
- package/dist/{MarkdownEditor-FVzYMdkC.cjs → MarkdownEditor-CPzMv3lE.cjs} +1 -1
- package/dist/{MarkdownEditor-C7BONfsl.cjs → MarkdownEditor-NYMcKLJy.cjs} +1 -1
- package/dist/MarkdownEditorContainer-DSL5-_hG.cjs +1 -0
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +18 -16
- package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
- package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
- package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
- package/dist/components/New/TransferQueue/constants.js +24 -0
- package/dist/components-manifest.json +210 -3
- package/dist/constants/public-class-names.js +2 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +227 -220
- package/dist/editor-Bc9xzKuR.cjs +1 -0
- package/dist/editors.cjs +1 -1
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/lazy-Cy9WobJf.cjs +1 -0
- package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
- package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
- package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
- package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
- package/dist/src/constants/public-class-names.d.ts +2 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/types/transfer-queue.d.ts +10 -0
- package/dist/types/transfer-queue.js +4 -0
- package/dist/{use-file-manager-tabs-wwM2gh2N.cjs → use-file-manager-tabs-4s-dbnmu.cjs} +1 -1
- package/package.json +1 -1
- package/dist/JsonEditor-BDe6elKO.cjs +0 -1
- package/dist/MarkdownEditorContainer-BA94ffC4.cjs +0 -1
- package/dist/lazy-BEsZqouS.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("./editor-Bc9xzKuR.cjs"),d=require("@monaco-editor/react");function f(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const m=f(d),b=({value:e,onChange:o,onValidateJSON:t,options:a,currentTheme:n,themesConfig:i=u.EDITOR_THEMES_CONFIG})=>{function s(r){r?.editor?.defineTheme(n,i[n]),r.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:[{uri:"http://custom-schema/object-required.json",fileMatch:["*"],schema:{type:"object",description:"Top-level value must be an object",additionalProperties:!0}}]})}const{Editor:l}=m;return c.jsx(l,{beforeMount:s,height:"100%",defaultLanguage:"json",value:e,onChange:o,theme:n,onValidate:t,options:{minimap:{enabled:!1},formatOnType:!0,formatOnPaste:!0,selectOnLineNumbers:!1,automaticLayout:!0,scrollBeyondLastLine:!1,wordWrap:"on",smoothScrolling:!0,overviewRulerLanes:0,scrollbar:{horizontal:"hidden",verticalScrollbarSize:4,verticalSliderSize:4},...a??{}}})};exports.DialJsonEditor=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@uiw/react-md-editor"),m=require("./lazy-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@uiw/react-md-editor"),m=require("./lazy-Cy9WobJf.cjs"),u=require("./merge-classes-BEJXjzkx.cjs"),x=({value:t,onChange:s,height:o=300,preview:i="edit",theme:a=m.EditorThemes.dark,className:n,placeholder:r})=>{const d=r!==void 0&&!t;return e.jsxs("div",{"data-color-mode":a,className:u.mergeClasses("relative",n),children:[e.jsx(c,{value:t,onChange:l=>s?.(l||""),height:o,preview:i}),d&&e.jsx("div",{className:"pointer-events-none absolute left-0 top-8 px-2 dial-small-text text-secondary opacity-40",children:r})]})};exports.DialMarkdownEditor=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-Cy9WobJf.cjs"),k=require("./merge-classes-BEJXjzkx.cjs"),o=require("@tabler/icons-react"),p=require("./icon-DhjrDQ8I.cjs"),f=require("./icon-CrGVkVpG.cjs");function E(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(i,r,c.get?c:{enumerable:!0,get:()=>n[r]})}}return i.default=n,Object.freeze(i)}const b=E(O),L=f.DIAL_ICON_SIZE.SM,t={size:L,stroke:p.DIAL_KIT_ICON_STROKE},s=(n,i)=>({...n,icon:i}),M=()=>{const{bold:n,code:i,divider:r,group:c,heading1:a,heading2:d,heading3:u,italic:l,link:m,orderedListCommand:I,quote:x,strikethrough:g,table:h,unorderedListCommand:C}=b;return[s(n,e.jsx(o.IconBold,{...t})),s(l,e.jsx(o.IconItalic,{...t})),s(g,e.jsx(o.IconStrikethrough,{...t})),r,c([a,d,u],{name:"heading",groupName:"heading",icon:e.jsx(o.IconTextSize,{...t}),buttonProps:{"aria-label":"Text style",title:"Text style"}}),r,s(C,e.jsx(o.IconList,{...t})),s(I,e.jsx(o.IconListNumbers,{...t})),r,s(x,e.jsx(o.IconQuote,{...t})),s(m,e.jsx(o.IconLink,{...t})),s(i,e.jsx(o.IconCode,{...t})),r,s(h,e.jsx(o.IconTable,{...t}))]},S=()=>{const{codeEdit:n,codeLive:i,codePreview:r,divider:c,fullscreen:a}=b;return[s(n,e.jsx(o.IconPencil,{...t})),s(i,e.jsx(o.IconLayoutColumns,{...t})),s(r,e.jsx(o.IconEye,{...t})),c,s(a,e.jsx(o.IconMaximize,{...t}))]},T=({value:n,onChange:i,height:r=300,theme:c=_.EditorThemes.light,className:a,placeholder:d,defaultPreview:u="edit",id:l,ariaLabel:m})=>{const I=j.useMemo(()=>M(),[]),x=j.useMemo(()=>S(),[]);return e.jsx("div",{"data-color-mode":c,className:k.mergeClasses("dial-kit-markdown-editor",a),children:e.jsx(O,{value:n,onChange:g=>i?.(g||""),height:r,preview:u,commands:I,extraCommands:x,textareaProps:{placeholder:d,id:l,"aria-label":m}})})};exports.MarkdownEditor=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react");require("./editor-Bc9xzKuR.cjs");const E=require("./lazy-Cy9WobJf.cjs");require("@monaco-editor/react");const m=require("./Switch-CfxMs3AZ.cjs"),N=require("./MarkdownEditor-CPzMv3lE.cjs"),b=({value:o,onChangeValue:l,label:i,headerContent:a,switcherLabel:d,height:c=300,theme:u=E.EditorThemes.dark,onValidateJSON:x,preview:j="edit"})=>{const w=n.useId(),[t,C]=n.useState(!1),[f,p]=n.useState(null);n.useEffect(()=>{t&&typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-CpSpVa0v.cjs")).then(s=>{p(()=>s.DialJsonEditor)})},[t]);const h=n.useCallback(s=>{l?.(s)},[l]),S=n.useCallback(s=>{x?.(s)},[x]),r=!!d;return e.jsx("div",{className:"size-full flex flex-col",children:e.jsx("div",{className:"flex flex-col gap-8",children:e.jsxs("div",{children:[(i||a||r)&&e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i&&e.jsx(m.DialLabel,{label:i}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 justify-end",children:[a,r&&e.jsx("label",{className:"flex items-center gap-2 cursor-pointer",children:e.jsx(m.DialSwitch,{isOn:t,label:d,switchId:w,onChange:s=>C(s)})})]})]}),r&&t?e.jsx("div",{className:"border border-primary rounded",style:{height:`${c}px`},children:f&&e.jsx(f,{value:o,onChange:h,onValidateJSON:S,currentTheme:u})}):e.jsx(N.DialMarkdownEditor,{value:o,onChange:h,height:c,preview:j,theme:u})]})})})};exports.DialMarkdownEditorContainer=b;
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { useId as g, useState as x, useEffect as J, useCallback as u } from "react";
|
|
3
|
-
import
|
|
4
|
-
import { EditorThemes as
|
|
3
|
+
import "../../constants/editor.js";
|
|
4
|
+
import { EditorThemes as S } from "../../types/editor.js";
|
|
5
|
+
import "@monaco-editor/react";
|
|
6
|
+
import { DialSwitch as b } from "../Switch/Switch.js";
|
|
5
7
|
import { DialMarkdownEditor as v } from "./MarkdownEditor.js";
|
|
6
8
|
import { DialLabel as y } from "../Label/Label.js";
|
|
7
|
-
const
|
|
9
|
+
const $ = ({
|
|
8
10
|
value: s,
|
|
9
11
|
onChangeValue: l,
|
|
10
|
-
label:
|
|
12
|
+
label: t,
|
|
11
13
|
headerContent: d,
|
|
12
14
|
switcherLabel: a,
|
|
13
15
|
height: c = 300,
|
|
14
|
-
theme: m =
|
|
16
|
+
theme: m = S.dark,
|
|
15
17
|
onValidateJSON: f,
|
|
16
18
|
preview: C = "edit"
|
|
17
19
|
}) => {
|
|
18
|
-
const N = g(), [
|
|
20
|
+
const N = g(), [i, w] = x(!1), [p, D] = x(null);
|
|
19
21
|
J(() => {
|
|
20
|
-
|
|
22
|
+
i && typeof window < "u" && import("../JsonEditor/JsonEditor.js").then((o) => {
|
|
21
23
|
D(() => o.DialJsonEditor);
|
|
22
24
|
});
|
|
23
|
-
}, [
|
|
25
|
+
}, [i]);
|
|
24
26
|
const h = u(
|
|
25
27
|
(o) => {
|
|
26
28
|
l?.(o);
|
|
@@ -31,16 +33,16 @@ const z = ({
|
|
|
31
33
|
f?.(o);
|
|
32
34
|
},
|
|
33
35
|
[f]
|
|
34
|
-
),
|
|
36
|
+
), n = !!a;
|
|
35
37
|
return /* @__PURE__ */ e("div", { className: "size-full flex flex-col", children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-8", children: /* @__PURE__ */ r("div", { children: [
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
+
(t || d || n) && /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-2", children: [
|
|
39
|
+
t && /* @__PURE__ */ e(y, { label: t }),
|
|
38
40
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 flex-1 justify-end", children: [
|
|
39
41
|
d,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
n && /* @__PURE__ */ e("label", { className: "flex items-center gap-2 cursor-pointer", children: /* @__PURE__ */ e(
|
|
43
|
+
b,
|
|
42
44
|
{
|
|
43
|
-
isOn:
|
|
45
|
+
isOn: i,
|
|
44
46
|
label: a,
|
|
45
47
|
switchId: N,
|
|
46
48
|
onChange: (o) => w(o)
|
|
@@ -48,7 +50,7 @@ const z = ({
|
|
|
48
50
|
) })
|
|
49
51
|
] })
|
|
50
52
|
] }),
|
|
51
|
-
|
|
53
|
+
n && i ? /* @__PURE__ */ e(
|
|
52
54
|
"div",
|
|
53
55
|
{
|
|
54
56
|
className: "border border-primary rounded",
|
|
@@ -76,5 +78,5 @@ const z = ({
|
|
|
76
78
|
] }) }) });
|
|
77
79
|
};
|
|
78
80
|
export {
|
|
79
|
-
|
|
81
|
+
$ as DialMarkdownEditorContainer
|
|
80
82
|
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { jsxs as b, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useId as Q, useCallback as m, useEffect as w } from "react";
|
|
3
|
+
import { ConfirmationPopup as D } from "../ConfirmationPopup/ConfirmationPopup.js";
|
|
4
|
+
import { ProgressBar as U } from "../../ProgressBar/ProgressBar.js";
|
|
5
|
+
import { DIAL_KIT_CLASS as F } from "../../../constants/public-class-names.js";
|
|
6
|
+
import { ConfirmationPopupVariant as R } from "../../../types/confirmation-popup.js";
|
|
7
|
+
import { ElementSize as N } from "../../../types/size.js";
|
|
8
|
+
import { TransferQueueItemStatus as l } from "../../../types/transfer-queue.js";
|
|
9
|
+
import { mergeClasses as T } from "../../../utils/merge-classes.js";
|
|
10
|
+
import { DEFAULT_TRANSFER_QUEUE_LABELS as O, TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS as y } from "./constants.js";
|
|
11
|
+
import { TransferQueueHeader as M } from "./TransferQueueHeader.js";
|
|
12
|
+
import { TransferQueueRow as j } from "./TransferQueueRow.js";
|
|
13
|
+
const q = (n) => Math.round(
|
|
14
|
+
n.reduce(
|
|
15
|
+
(e, r) => e + (r.percent ?? (r.status === l.InProgress ? 0 : 100)),
|
|
16
|
+
0
|
|
17
|
+
) / n.length
|
|
18
|
+
), z = (n, e, r) => n && e ? r.closeConfirmDescriptionMixed : e ? r.closeConfirmDescriptionFailed : r.closeConfirmDescriptionInProgress, ee = ({
|
|
19
|
+
title: n,
|
|
20
|
+
items: e,
|
|
21
|
+
onClose: r,
|
|
22
|
+
onCancelItem: E,
|
|
23
|
+
labels: S,
|
|
24
|
+
autoCloseDelay: i = y,
|
|
25
|
+
className: v,
|
|
26
|
+
bodyClassName: x
|
|
27
|
+
}) => {
|
|
28
|
+
const [c, I] = h(!1), [L, f] = h(!1), p = Q(), s = { ...O, ...S }, d = e.filter(
|
|
29
|
+
(o) => o.status === l.InProgress
|
|
30
|
+
).length, a = d > 0, g = e.filter(
|
|
31
|
+
(o) => o.status === l.Failed
|
|
32
|
+
).length, u = g > 0, C = e.length > 0 && e.every((o) => o.status === l.Success), P = m(() => {
|
|
33
|
+
a || u ? f(!0) : r();
|
|
34
|
+
}, [a, u, r]), A = m(() => {
|
|
35
|
+
f(!1), r();
|
|
36
|
+
}, [r]), _ = m(() => {
|
|
37
|
+
I((o) => !o);
|
|
38
|
+
}, []);
|
|
39
|
+
return w(() => {
|
|
40
|
+
if (!C || i <= 0) return;
|
|
41
|
+
const o = setTimeout(r, i);
|
|
42
|
+
return () => clearTimeout(o);
|
|
43
|
+
}, [C, i, r]), e.length === 0 ? null : /* @__PURE__ */ b(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
role: "status",
|
|
47
|
+
"aria-live": "polite",
|
|
48
|
+
className: T(
|
|
49
|
+
"w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",
|
|
50
|
+
v,
|
|
51
|
+
F.transferQueue
|
|
52
|
+
),
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ t(
|
|
55
|
+
M,
|
|
56
|
+
{
|
|
57
|
+
title: n,
|
|
58
|
+
failedCount: g,
|
|
59
|
+
isCollapsed: c,
|
|
60
|
+
itemsId: p,
|
|
61
|
+
labels: s,
|
|
62
|
+
onToggleCollapse: _,
|
|
63
|
+
onClose: P
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
c && a && /*
|
|
67
|
+
* Only while collapsed: expanded, every running row already shows its
|
|
68
|
+
* own spinner, so an aggregate bar would restate what is on screen.
|
|
69
|
+
*/
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
U,
|
|
72
|
+
{
|
|
73
|
+
value: q(e),
|
|
74
|
+
size: N.Small,
|
|
75
|
+
"aria-label": s.queueProgressAriaLabel,
|
|
76
|
+
"aria-valuetext": s.queueProgressValueText(
|
|
77
|
+
e.length - d,
|
|
78
|
+
e.length
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
!c && /* @__PURE__ */ t(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
id: p,
|
|
86
|
+
className: T(
|
|
87
|
+
"flex max-h-[40vh] flex-col overflow-y-auto py-1",
|
|
88
|
+
x
|
|
89
|
+
),
|
|
90
|
+
children: e.map((o) => /* @__PURE__ */ t(
|
|
91
|
+
j,
|
|
92
|
+
{
|
|
93
|
+
item: o,
|
|
94
|
+
labels: s,
|
|
95
|
+
onCancel: E
|
|
96
|
+
},
|
|
97
|
+
o.id
|
|
98
|
+
))
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ t(
|
|
102
|
+
D,
|
|
103
|
+
{
|
|
104
|
+
open: L,
|
|
105
|
+
header: s.closeConfirmHeader,
|
|
106
|
+
description: z(
|
|
107
|
+
a,
|
|
108
|
+
u,
|
|
109
|
+
s
|
|
110
|
+
),
|
|
111
|
+
confirmLabel: s.closeConfirmLabel,
|
|
112
|
+
cancelLabel: s.closeCancelLabel,
|
|
113
|
+
variant: R.Danger,
|
|
114
|
+
onConfirm: A,
|
|
115
|
+
onClose: () => f(!1)
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
export {
|
|
123
|
+
ee as TransferQueue
|
|
124
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { IconChevronUp as f, IconChevronDown as S, IconX as I } from "@tabler/icons-react";
|
|
3
|
+
import { GhostIconButton as t } from "../IconButton/IconButtonWrappers.js";
|
|
4
|
+
import { DIAL_KIT_ICON_STROKE as o } from "../constants/icon.js";
|
|
5
|
+
import { DIAL_ICON_SIZE as s } from "../../../constants/icon.js";
|
|
6
|
+
import { ElementSize as m } from "../../../types/size.js";
|
|
7
|
+
import { STATUS_SLOT_CLASS as c } from "./constants.js";
|
|
8
|
+
const k = ({
|
|
9
|
+
title: l,
|
|
10
|
+
failedCount: n,
|
|
11
|
+
isCollapsed: r,
|
|
12
|
+
itemsId: p,
|
|
13
|
+
labels: a,
|
|
14
|
+
onToggleCollapse: d,
|
|
15
|
+
onClose: x
|
|
16
|
+
}) => {
|
|
17
|
+
const h = r ? f : S;
|
|
18
|
+
return /* @__PURE__ */ i("div", { className: "mx-4 flex items-center justify-between border-b border-tertiary py-3", children: [
|
|
19
|
+
/* @__PURE__ */ i("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
20
|
+
/* @__PURE__ */ e("span", { className: "dial-small-paragraph-semi-text truncate text-primary", children: l }),
|
|
21
|
+
n > 0 && /*
|
|
22
|
+
* On the filled --bg-control-error swatch, so it takes the on-control
|
|
23
|
+
* token; --text-tertiary would contrast at under 2:1 over that fill.
|
|
24
|
+
*/
|
|
25
|
+
/* @__PURE__ */ e("span", { className: "dial-small-paragraph-semi-text inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-control-error px-1 text-control-permanent", children: n })
|
|
26
|
+
] }),
|
|
27
|
+
/* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
28
|
+
/* @__PURE__ */ e(
|
|
29
|
+
t,
|
|
30
|
+
{
|
|
31
|
+
"aria-label": r ? a.expandAriaLabel : a.collapseAriaLabel,
|
|
32
|
+
"aria-expanded": !r,
|
|
33
|
+
"aria-controls": p,
|
|
34
|
+
size: m.Small,
|
|
35
|
+
icon: /* @__PURE__ */ e(
|
|
36
|
+
h,
|
|
37
|
+
{
|
|
38
|
+
size: s.SM,
|
|
39
|
+
stroke: o,
|
|
40
|
+
className: "text-secondary",
|
|
41
|
+
"aria-hidden": !0
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
onClick: d,
|
|
45
|
+
className: c
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
|
+
t,
|
|
50
|
+
{
|
|
51
|
+
"aria-label": a.closeAriaLabel,
|
|
52
|
+
size: m.Small,
|
|
53
|
+
icon: /* @__PURE__ */ e(
|
|
54
|
+
I,
|
|
55
|
+
{
|
|
56
|
+
size: s.SM,
|
|
57
|
+
stroke: o,
|
|
58
|
+
className: "text-secondary",
|
|
59
|
+
"aria-hidden": !0
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
onClick: x,
|
|
63
|
+
className: c
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] })
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
k as TransferQueueHeader
|
|
71
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { IconX as d, IconCheck as u, IconAlertCircleFilled as f, IconAlertTriangleFilled as g } from "@tabler/icons-react";
|
|
3
|
+
import { EllipsisTooltip as I } from "../EllipsisTooltip/EllipsisTooltip.js";
|
|
4
|
+
import { FileIcon as h } from "../FileIcon/FileIcon.js";
|
|
5
|
+
import { GhostIconButton as S } from "../IconButton/IconButtonWrappers.js";
|
|
6
|
+
import { Tooltip as x } from "../Tooltip/Tooltip.js";
|
|
7
|
+
import { DIAL_KIT_ICON_STROKE as m } from "../constants/icon.js";
|
|
8
|
+
import { Spinner as y } from "../../Spinner/Spinner.js";
|
|
9
|
+
import { DIAL_ICON_SIZE as t } from "../../../constants/icon.js";
|
|
10
|
+
import { DialItemType as N } from "../../../types/item.js";
|
|
11
|
+
import { ElementSize as T } from "../../../types/size.js";
|
|
12
|
+
import { TransferQueueItemStatus as s } from "../../../types/transfer-queue.js";
|
|
13
|
+
import { mergeClasses as i } from "../../../utils/merge-classes.js";
|
|
14
|
+
import { STATUS_SLOT_CLASS as c } from "./constants.js";
|
|
15
|
+
const p = ({ message: e, isError: a }) => /* @__PURE__ */ r(x, { tooltip: e, asChild: !0, children: /* @__PURE__ */ r(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
className: c,
|
|
19
|
+
role: "img",
|
|
20
|
+
"aria-label": e,
|
|
21
|
+
tabIndex: 0,
|
|
22
|
+
children: /* @__PURE__ */ r(
|
|
23
|
+
a ? f : g,
|
|
24
|
+
{
|
|
25
|
+
size: t.SM,
|
|
26
|
+
className: a ? "text-error" : "text-warning-icon",
|
|
27
|
+
"aria-hidden": !0
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
) }), j = ({
|
|
32
|
+
item: e,
|
|
33
|
+
labels: a,
|
|
34
|
+
onCancel: o
|
|
35
|
+
}) => {
|
|
36
|
+
const n = e.status === s.Canceled;
|
|
37
|
+
return /* @__PURE__ */ l("div", { className: "group flex items-center gap-2 px-4 py-2", children: [
|
|
38
|
+
/* @__PURE__ */ r(
|
|
39
|
+
h,
|
|
40
|
+
{
|
|
41
|
+
type: N.File,
|
|
42
|
+
name: e.name,
|
|
43
|
+
size: t.MD,
|
|
44
|
+
className: i(n && "opacity-50"),
|
|
45
|
+
decorative: !0
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ r(
|
|
49
|
+
I,
|
|
50
|
+
{
|
|
51
|
+
text: e.name,
|
|
52
|
+
className: i(
|
|
53
|
+
"dial-small-text",
|
|
54
|
+
n ? "text-secondary" : "text-primary"
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
e.status === s.InProgress && /* @__PURE__ */ l("div", { className: i(c, "grid"), children: [
|
|
59
|
+
/* @__PURE__ */ r(
|
|
60
|
+
y,
|
|
61
|
+
{
|
|
62
|
+
size: t.SM,
|
|
63
|
+
ariaLabel: a.itemProgressAriaLabel(e.name),
|
|
64
|
+
className: i(
|
|
65
|
+
"pointer-events-none col-start-1 row-start-1 transition-opacity",
|
|
66
|
+
o && "group-focus-within:opacity-0 group-hover:opacity-0"
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
o && /* @__PURE__ */ r(
|
|
71
|
+
S,
|
|
72
|
+
{
|
|
73
|
+
"aria-label": a.cancelItemAriaLabel(e.name),
|
|
74
|
+
size: T.Small,
|
|
75
|
+
icon: /* @__PURE__ */ r(
|
|
76
|
+
d,
|
|
77
|
+
{
|
|
78
|
+
size: t.SM,
|
|
79
|
+
stroke: m,
|
|
80
|
+
className: "text-secondary",
|
|
81
|
+
"aria-hidden": !0
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
onClick: () => o(e.id),
|
|
85
|
+
className: "col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] }),
|
|
89
|
+
e.status === s.Success && /* @__PURE__ */ r(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: c,
|
|
93
|
+
role: "img",
|
|
94
|
+
"aria-label": a.successLabel,
|
|
95
|
+
children: /* @__PURE__ */ r(
|
|
96
|
+
u,
|
|
97
|
+
{
|
|
98
|
+
size: t.SM,
|
|
99
|
+
stroke: m,
|
|
100
|
+
className: "text-accent",
|
|
101
|
+
"aria-hidden": !0
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
e.status === s.Warning && /* @__PURE__ */ r(
|
|
107
|
+
p,
|
|
108
|
+
{
|
|
109
|
+
message: e.message || a.warningMessage,
|
|
110
|
+
isError: !1
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
e.status === s.Failed && /* @__PURE__ */ r(p, { message: e.message || a.failedMessage, isError: !0 }),
|
|
114
|
+
n && /* @__PURE__ */ r("span", { className: "dial-small-text shrink-0 text-secondary", children: a.canceledLabel })
|
|
115
|
+
] });
|
|
116
|
+
};
|
|
117
|
+
export {
|
|
118
|
+
j as TransferQueueRow
|
|
119
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const l = 8e3, a = "flex size-7 shrink-0 items-center justify-center", i = {
|
|
2
|
+
cancelItemAriaLabel: (e) => `Cancel "${e}"`,
|
|
3
|
+
itemProgressAriaLabel: (e) => `"${e}" in progress`,
|
|
4
|
+
successLabel: "Completed",
|
|
5
|
+
canceledLabel: "Canceled",
|
|
6
|
+
failedMessage: "Failed",
|
|
7
|
+
warningMessage: "Completed with warnings",
|
|
8
|
+
queueProgressAriaLabel: "Progress",
|
|
9
|
+
queueProgressValueText: (e, s) => `${e} of ${s}`,
|
|
10
|
+
collapseAriaLabel: "Collapse",
|
|
11
|
+
expandAriaLabel: "Expand",
|
|
12
|
+
closeAriaLabel: "Close",
|
|
13
|
+
closeConfirmHeader: "Close?",
|
|
14
|
+
closeConfirmDescriptionInProgress: "Some items are still in progress.",
|
|
15
|
+
closeConfirmDescriptionFailed: "Some items have failed.",
|
|
16
|
+
closeConfirmDescriptionMixed: "Some items are still in progress, and some have failed.",
|
|
17
|
+
closeConfirmLabel: "Close",
|
|
18
|
+
closeCancelLabel: "Cancel"
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
i as DEFAULT_TRANSFER_QUEUE_LABELS,
|
|
22
|
+
a as STATUS_SLOT_CLASS,
|
|
23
|
+
l as TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS
|
|
24
|
+
};
|