@epam/ai-dial-ui-kit 0.14.0-dev.48 → 0.14.0-dev.49

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.
@@ -1,107 +1,113 @@
1
- import { jsx as e, jsxs as s, Fragment as S } from "react/jsx-runtime";
2
- import { DialPopup as W } from "../../../Popup/Popup.js";
3
- import { DialFileManager as X } from "../../FileManager.js";
4
- import { PopupSize as Y } from "../../../../types/popup.js";
5
- import { DialPrimaryButton as b, DialNeutralButton as Z } from "../../../Button/ButtonWrappers.js";
6
- import { DialButton as $ } from "../../../Button/Button.js";
7
- import { ButtonAppearance as P } from "../../../../types/button.js";
8
- import { IconFolderPlus as w, IconEye as F, IconDotsVertical as L } from "@tabler/icons-react";
1
+ import { jsx as e, jsxs as s, Fragment as A } from "react/jsx-runtime";
2
+ import { DialPopup as Z } from "../../../Popup/Popup.js";
3
+ import { DialFileManager as $ } from "../../FileManager.js";
4
+ import { PopupSize as P } from "../../../../types/popup.js";
5
+ import { DialPrimaryButton as b, DialNeutralButton as F } from "../../../Button/ButtonWrappers.js";
6
+ import { DialButton as L } from "../../../Button/Button.js";
7
+ import { ButtonAppearance as ee } from "../../../../types/button.js";
8
+ import { IconFolderPlus as B, IconEye as ie, IconDotsVertical as oe } from "@tabler/icons-react";
9
9
  import { BASE_ICON_PROPS as r } from "../../../../constants/icon.js";
10
- import { DialSwitch as ee } from "../../../Switch/Switch.js";
11
- import { useState as z, useRef as ie, useCallback as A, useMemo as B } from "react";
12
- import { DestinationFolderMode as R } from "../../../../types/file-manager.js";
13
- import { DialTooltip as oe } from "../../../Tooltip/Tooltip.js";
14
- import { mergeClasses as le } from "../../../../utils/merge-classes.js";
15
- import { DialNotification as ae } from "../../../Notification/Notification.js";
16
- import { DialDropdown as ne } from "../../../Dropdown/Dropdown.js";
17
- import { useIsMobileScreen as te } from "../../../../hooks/use-is-mobile-screen.js";
18
- const Oe = ({
19
- onClose: x,
20
- onConfirm: N,
21
- onFolderPopupPathChange: y,
10
+ import { DialSwitch as le } from "../../../Switch/Switch.js";
11
+ import { useState as R, useRef as ne, useMemo as x, useCallback as j } from "react";
12
+ import { DestinationFolderMode as T } from "../../../../types/file-manager.js";
13
+ import { DialTooltip as ae } from "../../../Tooltip/Tooltip.js";
14
+ import { mergeClasses as te } from "../../../../utils/merge-classes.js";
15
+ import { DialNotification as se } from "../../../Notification/Notification.js";
16
+ import { DialDropdown as re } from "../../../Dropdown/Dropdown.js";
17
+ import { useIsMobileScreen as ce } from "../../../../hooks/use-is-mobile-screen.js";
18
+ import { excludePathsFromTree as me } from "../../utils.js";
19
+ const we = ({
20
+ onClose: N,
21
+ onConfirm: y,
22
+ onFolderPopupPathChange: v,
22
23
  setDestinationFolderPath: C,
23
- open: j,
24
- copyLabel: v = "Copy",
25
- moveLabel: D = "Move",
24
+ open: E,
25
+ copyLabel: D = "Copy",
26
+ moveLabel: O = "Move",
26
27
  addFolderLabel: c = "Add folder",
27
- mode: m = R.Copy,
28
+ mode: m = T.Copy,
28
29
  hiddenFilesSwitcherLabel: f = "Show hidden files",
29
30
  showHiddenFileSwitcher: l = !0,
30
- showCreateFolderButton: a = !0,
31
- onUploadFiles: E,
32
- onValidateUpload: T,
33
- maxFileSize: _,
34
- header: G,
35
- sourceFolder: d,
36
- disabledPathTooltip: H = "Unavailable for the original path. Please select another folder",
37
- path: n,
38
- collapsedFileTree: U = !1,
39
- alertProps: O,
40
- processDestinationFolderPath: p,
31
+ showCreateFolderButton: n = !0,
32
+ onUploadFiles: _,
33
+ onValidateUpload: G,
34
+ maxFileSize: H,
35
+ header: U,
36
+ sourceFolder: p,
37
+ disabledPathTooltip: V = "Unavailable for the original path. Please select another folder",
38
+ path: a,
39
+ collapsedFileTree: q = !1,
40
+ alertProps: M,
41
+ processDestinationFolderPath: d,
42
+ excludedPaths: I,
43
+ items: k,
41
44
  ...o
42
45
  }) => {
43
- const [M, k] = z(!1), [V, h] = z(!1), u = ie(null), q = te(), I = A((i) => {
44
- k(i);
45
- }, []), J = B(() => {
46
+ const [S, w] = R(!1), [J, h] = R(!1), u = ne(null), K = ce(), Q = x(
47
+ () => me(k, I),
48
+ [k, I]
49
+ ), z = j((i) => {
50
+ w(i);
51
+ }, []), W = x(() => {
46
52
  const i = [];
47
- return a && i.push({
53
+ return n && i.push({
48
54
  key: "add-folder",
49
55
  label: c,
50
- icon: /* @__PURE__ */ e(w, { ...r, className: "text-secondary" }),
56
+ icon: /* @__PURE__ */ e(B, { ...r, className: "text-secondary" }),
51
57
  onClick: () => {
52
58
  u.current?.createFolder(), h(!1);
53
59
  }
54
60
  }), l && i.push({
55
61
  key: "show-hidden-files",
56
62
  label: f,
57
- icon: /* @__PURE__ */ e(F, { ...r, className: "text-secondary" }),
63
+ icon: /* @__PURE__ */ e(ie, { ...r, className: "text-secondary" }),
58
64
  onClick: () => {
59
- k((t) => !t), h(!1);
65
+ w((t) => !t), h(!1);
60
66
  }
61
67
  }), i;
62
68
  }, [
63
69
  c,
64
70
  f,
65
71
  l,
66
- a
67
- ]), K = A(
72
+ n
73
+ ]), X = j(
68
74
  (i) => {
69
75
  if (i) {
70
- let t = p ? p(i) : i;
71
- y?.(t), C?.(t);
76
+ let t = d ? d(i) : i;
77
+ v?.(t), C?.(t);
72
78
  }
73
79
  },
74
80
  [
75
- y,
81
+ v,
76
82
  C,
77
- p
83
+ d
78
84
  ]
79
- ), Q = m === R.Copy ? "Copy to" : "Move to", g = B(() => !n || !d ? !1 : d === n, [n, d]);
85
+ ), Y = m === T.Copy ? "Copy to" : "Move to", g = x(() => !a || !p ? !1 : p === a, [a, p]);
80
86
  return /* @__PURE__ */ e(
81
- W,
87
+ Z,
82
88
  {
83
- open: j,
89
+ open: E,
84
90
  onClose: () => {
85
- x();
91
+ N();
86
92
  },
87
- size: Y.Lg,
93
+ size: P.Lg,
88
94
  dividerFooter: !0,
89
95
  dividers: !1,
90
96
  className: "md:!h-[800px] !bg-layer-2",
91
97
  footer: /* @__PURE__ */ s("div", { className: "flex justify-between items-center gap-2 p-4 md:px-6", children: [
92
- /* @__PURE__ */ e("div", { className: "flex items-center gap-4 min-w-0", children: q ? /* @__PURE__ */ e(
93
- ne,
98
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-4 min-w-0", children: K ? /* @__PURE__ */ e(
99
+ re,
94
100
  {
95
- items: J,
96
- open: V,
101
+ items: W,
102
+ open: J,
97
103
  onOpenChange: h,
98
104
  children: /* @__PURE__ */ e(
99
- $,
105
+ L,
100
106
  {
101
107
  className: "size-9 shrink-0",
102
108
  "aria-label": "More options",
103
109
  iconBefore: /* @__PURE__ */ e(
104
- L,
110
+ oe,
105
111
  {
106
112
  ...r,
107
113
  className: "text-secondary"
@@ -110,67 +116,68 @@ const Oe = ({
110
116
  }
111
117
  )
112
118
  }
113
- ) : /* @__PURE__ */ s(S, { children: [
114
- a && /* @__PURE__ */ e(
119
+ ) : /* @__PURE__ */ s(A, { children: [
120
+ n && /* @__PURE__ */ e(
115
121
  b,
116
122
  {
117
123
  label: c,
118
- appearance: P.Ghost,
119
- iconBefore: /* @__PURE__ */ e(w, { ...r }),
124
+ appearance: ee.Ghost,
125
+ iconBefore: /* @__PURE__ */ e(B, { ...r }),
120
126
  onClick: () => {
121
127
  u.current?.createFolder();
122
128
  }
123
129
  }
124
130
  ),
125
- a && l && /* @__PURE__ */ e("div", { className: "w-px h-[26px] bg-controls-disable-accent my-2" }),
126
- l && /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e("div", { className: "inline-flex items-center cursor-pointer", children: /* @__PURE__ */ e(
127
- ee,
131
+ n && l && /* @__PURE__ */ e("div", { className: "w-px h-[26px] bg-controls-disable-accent my-2" }),
132
+ l && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e("div", { className: "inline-flex items-center cursor-pointer", children: /* @__PURE__ */ e(
133
+ le,
128
134
  {
129
135
  label: f,
130
- isOn: M,
131
- onChange: I,
136
+ isOn: S,
137
+ onChange: z,
132
138
  switchId: "hidden-files-switch-modal"
133
139
  }
134
140
  ) }) })
135
141
  ] }) }),
136
142
  /* @__PURE__ */ s("div", { className: "flex space-x-4 items-center", children: [
137
- /* @__PURE__ */ e(Z, { onClick: x, label: "Cancel" }),
138
- g ? /* @__PURE__ */ e(oe, { tooltip: H, children: /* @__PURE__ */ e(
143
+ /* @__PURE__ */ e(F, { onClick: N, label: "Cancel" }),
144
+ g ? /* @__PURE__ */ e(ae, { tooltip: V, children: /* @__PURE__ */ e(
139
145
  b,
140
146
  {
141
- onClick: N,
142
- label: m === "copy" ? v : D,
147
+ onClick: y,
148
+ label: m === "copy" ? D : O,
143
149
  disabled: g,
144
150
  "aria-disabled": g
145
151
  }
146
152
  ) }) : /* @__PURE__ */ e(
147
153
  b,
148
154
  {
149
- onClick: N,
150
- label: m === "copy" ? v : D
155
+ onClick: y,
156
+ label: m === "copy" ? D : O
151
157
  }
152
158
  )
153
159
  ] })
154
160
  ] }),
155
- header: G ?? Q,
161
+ header: U ?? Y,
156
162
  children: /* @__PURE__ */ s("div", { className: "bg-layer-2 h-full flex flex-col", children: [
157
- O && /* @__PURE__ */ e("div", { className: "px-6 mb-4 pt-4", children: /* @__PURE__ */ e(ae, { ...O }) }),
163
+ M && /* @__PURE__ */ e("div", { className: "px-6 mb-4 pt-4", children: /* @__PURE__ */ e(se, { ...M }) }),
158
164
  /* @__PURE__ */ e("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ e(
159
- X,
165
+ $,
160
166
  {
161
167
  ...o,
168
+ items: Q,
162
169
  gridClassName: "size-full",
163
- className: le(
170
+ className: te(
164
171
  o.className,
165
172
  "bg-layer-2 h-full flex pt-0"
166
173
  ),
167
174
  actionsRef: u,
168
- path: n,
169
- showHiddenFiles: M,
170
- onShowHiddenFilesChange: I,
175
+ path: a,
176
+ showHiddenFiles: S,
177
+ onShowHiddenFilesChange: z,
171
178
  treeOptions: {
172
179
  ...o.treeOptions,
173
- collapsed: U,
180
+ collapsed: q,
174
181
  expandedPaths: /* @__PURE__ */ new Set([o.rootItem?.path || "/"]),
175
182
  header: o.treeOptions?.header
176
183
  },
@@ -179,10 +186,10 @@ const Oe = ({
179
186
  elementId: "file-manager-destination-search",
180
187
  ...o.navigationPanelOptions
181
188
  },
182
- onUploadFiles: E,
183
- onValidateUpload: T,
184
- onPathChange: K,
185
- maxFileSize: _
189
+ onUploadFiles: _,
190
+ onValidateUpload: G,
191
+ onPathChange: X,
192
+ maxFileSize: H
186
193
  }
187
194
  ) })
188
195
  ] })
@@ -190,5 +197,5 @@ const Oe = ({
190
197
  );
191
198
  };
192
199
  export {
193
- Oe as DialDestinationFolderPopup
200
+ we as DialDestinationFolderPopup
194
201
  };
@@ -17,7 +17,7 @@ const u = (t, e) => {
17
17
  if (r.length <= 1) return t[0];
18
18
  const o = "/" + r.slice(0, r.length - 1).join("/");
19
19
  return u(t, o) ?? t[0];
20
- }, f = (t) => (t ?? "").toLowerCase(), D = (t) => f(t).replace(/^\./, ""), w = (t) => {
20
+ }, d = (t) => (t ?? "").toLowerCase(), w = (t) => d(t).replace(/^\./, ""), D = (t) => {
21
21
  if (!t) return [];
22
22
  const e = [], n = (r) => {
23
23
  const o = r.items ?? [];
@@ -25,11 +25,18 @@ const u = (t, e) => {
25
25
  e.push(s), s.nodeType === p.FOLDER && n(s);
26
26
  };
27
27
  return n(t), e;
28
- }, A = (t) => (t.name ?? t.path.split("/").pop() ?? "").startsWith("."), h = (t) => {
28
+ }, A = (t, e) => {
29
+ if (!t?.length) return [];
30
+ if (!e?.length) return t;
31
+ const n = new Set(e), r = (o) => o.filter((s) => !n.has(s.path)).map(
32
+ (s) => s.items?.length ? { ...s, items: r(s.items) } : s
33
+ );
34
+ return r(t);
35
+ }, E = (t) => (t.name ?? t.path.split("/").pop() ?? "").startsWith("."), h = (t) => {
29
36
  if (!t) return "0 bytes";
30
37
  const e = 1024, n = e * 1024;
31
38
  return t >= n ? `${(t / n).toFixed(1)} MB` : t >= e ? `${(t / e).toFixed(0)} KB` : `${t} bytes`;
32
- }, E = (t, e = "en-US", n = {
39
+ }, v = (t, e = "en-US", n = {
33
40
  year: "numeric",
34
41
  month: "short",
35
42
  day: "2-digit"
@@ -41,7 +48,7 @@ const u = (t, e) => {
41
48
  return t;
42
49
  }
43
50
  };
44
- function d(t, e, n) {
51
+ function f(t, e, n) {
45
52
  if (!t || t.includes("*/*"))
46
53
  return !0;
47
54
  const r = e.toLowerCase(), o = n && n.includes(".") ? `.${n.split(".").at(-1).toLowerCase()}` : void 0;
@@ -67,27 +74,27 @@ const g = (t) => t?.map((e) => e.endsWith("/*") ? e.replace("/*", "s") : F(e).fl
67
74
  const e = t.flags.replace(/[gy]/g, "");
68
75
  return new RegExp(t.source, e);
69
76
  };
70
- function v(t, e, n) {
77
+ function B(t, e, n) {
71
78
  if (e && T(e)?.test(t.name))
72
79
  return n ?? `This ${t.isFolder ? "folder" : "file"} contains forbidden characters in its name. Please rename it.`;
73
80
  }
74
- const B = (t) => {
81
+ const O = (t) => {
75
82
  const e = t.lastIndexOf("/");
76
83
  return e >= 0 ? {
77
84
  parent: t.slice(0, e),
78
85
  name: t.slice(e + 1)
79
86
  } : { parent: "", name: t };
80
- }, O = (t, e, n) => {
81
- const r = !t.contentLength || n == null || t.contentLength <= n, o = !t.contentType || d(e, t.contentType, t.name);
87
+ }, C = (t, e, n) => {
88
+ const r = !t.contentLength || n == null || t.contentLength <= n, o = !t.contentType || f(e, t.contentType, t.name);
82
89
  return r && o;
83
- }, C = (t, e, n, r, o) => {
90
+ }, N = (t, e, n, r, o) => {
84
91
  if (t.nodeType === p.FOLDER) return;
85
92
  const s = !t.contentLength || n == null || t.contentLength <= n;
86
- if (!(!t.contentType || d(e, t.contentType, t.name)))
93
+ if (!(!t.contentType || f(e, t.contentType, t.name)))
87
94
  return r ?? (e?.length ? `Unsupported file type. Supported types: ${g(e)}.` : "Unsupported file type.");
88
95
  if (!s)
89
96
  return o ?? `File is too large. Maximum size: ${h(n)}.`;
90
- }, N = (t) => t.replace(/\/+$/, "").split("/").filter(Boolean).length, M = (t) => {
97
+ }, M = (t) => t.replace(/\/+$/, "").split("/").filter(Boolean).length, R = (t) => {
91
98
  const e = `${m} `, n = new RegExp(`^${m} (\\d+)$`), r = new Set(
92
99
  t.map((c) => c.name.toLowerCase())
93
100
  ), o = t.map((c) => {
@@ -101,21 +108,22 @@ const B = (t) => {
101
108
  };
102
109
  export {
103
110
  T as cleanForbiddenSymbolsRegExp,
104
- w as collectAllDescendants,
111
+ D as collectAllDescendants,
112
+ A as excludePathsFromTree,
105
113
  x as findFolderForPath,
106
114
  u as findNodeByPath,
107
115
  g as formatAllowedFileTypesForTooltip,
108
116
  h as formatBytes,
109
- E as formatDate,
117
+ v as formatDate,
110
118
  F as getExtensionsListForMimeType,
111
- N as getFolderNestingDepth,
112
- v as getForbiddenSymbolsTooltip,
113
- M as getNextFolderName,
114
- C as getRowTooltip,
115
- d as isFileAccepted,
116
- O as isFileSelectable,
117
- A as isHiddenDotFile,
118
- D as normalizeExtensionWithoutDot,
119
- f as normalizeToLowerCase,
120
- B as splitPathAndName
119
+ M as getFolderNestingDepth,
120
+ B as getForbiddenSymbolsTooltip,
121
+ R as getNextFolderName,
122
+ N as getRowTooltip,
123
+ f as isFileAccepted,
124
+ C as isFileSelectable,
125
+ E as isHiddenDotFile,
126
+ w as normalizeExtensionWithoutDot,
127
+ d as normalizeToLowerCase,
128
+ O as splitPathAndName
121
129
  };
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.14.0-dev.48",
3
- "generatedAt": "2026-09-10T18:17:27.065Z",
2
+ "version": "0.14.0-dev.49",
3
+ "generatedAt": "2026-09-10T20:07:22.493Z",
4
4
  "kit": {
5
5
  "name": "@epam/ai-dial-ui-kit",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",