@epam/ai-dial-ui-kit 0.15.0-dev.31 → 0.15.0-dev.36
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 +4 -0
- package/dist/CHANGELOG.md +10 -0
- package/dist/{DateCellRenderer-J1V3xwF7.cjs → DateCellRenderer-DABG5c2F.cjs} +1 -1
- package/dist/{DateCellRenderer-BFEh4rXZ.cjs → DateCellRenderer-DB9p0E9c.cjs} +27 -27
- package/dist/components/New/Avatar/Avatar.js +70 -0
- package/dist/components/New/Badge/Badge.js +45 -0
- package/dist/components/New/BottomSheet/BottomSheet.js +128 -0
- package/dist/components/New/SideDrawer/SideDrawer.js +148 -0
- package/dist/components-manifest.json +451 -3
- package/dist/constants/public-class-names.js +8 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +149 -134
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/src/components/New/Avatar/Avatar.d.ts +55 -0
- package/dist/src/components/New/Badge/Badge.d.ts +47 -0
- package/dist/src/components/New/BottomSheet/BottomSheet.d.ts +84 -0
- package/dist/src/components/New/SideDrawer/SideDrawer.d.ts +100 -0
- package/dist/src/constants/public-class-names.d.ts +8 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/types/avatar.d.ts +7 -0
- package/dist/src/types/badge.d.ts +16 -0
- package/dist/src/utils/__tests__/avatar.spec.d.ts +1 -0
- package/dist/src/utils/avatar.d.ts +12 -0
- package/dist/types/avatar.js +4 -0
- package/dist/types/badge.js +5 -0
- package/dist/{use-file-manager-tabs-C0h1Sq5T.cjs → use-file-manager-tabs-BJP7po3N.cjs} +1 -1
- package/dist/utils/avatar.js +22 -0
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C } from "react";
|
|
3
|
+
import { DIAL_KIT_CLASS as b } from "../../../constants/public-class-names.js";
|
|
4
|
+
import { AvatarShape as d } from "../../../types/avatar.js";
|
|
5
|
+
import { pickAvatarColor as w, extractInitials as I } from "../../../utils/avatar.js";
|
|
6
|
+
import { mergeClasses as e } from "../../../utils/merge-classes.js";
|
|
7
|
+
const N = {
|
|
8
|
+
[d.Circle]: "rounded-full",
|
|
9
|
+
[d.Square]: "rounded-md"
|
|
10
|
+
}, E = ({
|
|
11
|
+
name: s,
|
|
12
|
+
initials: c,
|
|
13
|
+
src: r,
|
|
14
|
+
alt: t = "",
|
|
15
|
+
size: o = 32,
|
|
16
|
+
shape: f = d.Circle,
|
|
17
|
+
className: h,
|
|
18
|
+
textClassName: l,
|
|
19
|
+
onImageError: u
|
|
20
|
+
}) => {
|
|
21
|
+
const [S, p] = C(), v = !!r && S !== r, i = t !== "", m = (n) => e(
|
|
22
|
+
"inline-flex shrink-0 select-none items-center justify-center overflow-hidden",
|
|
23
|
+
N[f],
|
|
24
|
+
n,
|
|
25
|
+
h,
|
|
26
|
+
b.avatar
|
|
27
|
+
);
|
|
28
|
+
if (v)
|
|
29
|
+
return /* @__PURE__ */ a(
|
|
30
|
+
"img",
|
|
31
|
+
{
|
|
32
|
+
src: r,
|
|
33
|
+
alt: t,
|
|
34
|
+
width: o,
|
|
35
|
+
height: o,
|
|
36
|
+
className: e(m(), "object-cover"),
|
|
37
|
+
onError: (n) => {
|
|
38
|
+
p(r), u?.(n);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
const { background: g, foreground: A } = w(s);
|
|
43
|
+
return /* @__PURE__ */ a(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
role: i ? "img" : void 0,
|
|
47
|
+
"aria-label": i ? t : void 0,
|
|
48
|
+
"aria-hidden": i ? void 0 : !0,
|
|
49
|
+
className: m(e(g, A)),
|
|
50
|
+
style: {
|
|
51
|
+
width: o,
|
|
52
|
+
height: o,
|
|
53
|
+
fontSize: l ? void 0 : Math.round(o * 0.4)
|
|
54
|
+
},
|
|
55
|
+
children: /* @__PURE__ */ a(
|
|
56
|
+
"span",
|
|
57
|
+
{
|
|
58
|
+
className: e(
|
|
59
|
+
"leading-none",
|
|
60
|
+
l ?? "font-semibold"
|
|
61
|
+
),
|
|
62
|
+
children: c ?? I(s)
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
E as Avatar
|
|
70
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs as g, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { DIAL_KIT_CLASS as m } from "../../../constants/public-class-names.js";
|
|
3
|
+
import { BadgeVariant as t, BadgeColor as e } from "../../../types/badge.js";
|
|
4
|
+
import { mergeClasses as x } from "../../../utils/merge-classes.js";
|
|
5
|
+
const b = {
|
|
6
|
+
[e.Blue]: "bg-blue text-blue",
|
|
7
|
+
[e.Green]: "bg-green-2 text-green-1",
|
|
8
|
+
[e.Violet]: "bg-violet-2 text-violet-1",
|
|
9
|
+
[e.Indigo]: "bg-violet-1 text-violet-2",
|
|
10
|
+
[e.Brown]: "bg-brown text-brown-2",
|
|
11
|
+
[e.Red]: "bg-red text-red"
|
|
12
|
+
}, c = {
|
|
13
|
+
[t.Outlined]: "rounded-md border border-tertiary bg-layer-sunken text-secondary",
|
|
14
|
+
[t.Filled]: "rounded-full"
|
|
15
|
+
}, p = {
|
|
16
|
+
[t.Outlined]: "dial-tiny-text",
|
|
17
|
+
[t.Filled]: "dial-caption-lead-semi-text"
|
|
18
|
+
}, L = ({
|
|
19
|
+
label: n,
|
|
20
|
+
variant: r = t.Outlined,
|
|
21
|
+
color: d = e.Blue,
|
|
22
|
+
icon: l,
|
|
23
|
+
textClassName: o,
|
|
24
|
+
className: s,
|
|
25
|
+
...a
|
|
26
|
+
}) => /* @__PURE__ */ g(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
...a,
|
|
30
|
+
className: x(
|
|
31
|
+
"inline-flex h-6 w-fit shrink-0 items-center gap-1 whitespace-nowrap px-2",
|
|
32
|
+
c[r],
|
|
33
|
+
r === t.Filled && b[d],
|
|
34
|
+
s,
|
|
35
|
+
m.badge
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
l && /* @__PURE__ */ i("span", { className: "flex shrink-0 items-center", "aria-hidden": "true", children: l }),
|
|
39
|
+
/* @__PURE__ */ i("span", { className: o ?? p[r], children: n })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
export {
|
|
44
|
+
L as Badge
|
|
45
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useFloating as k, useRole as A, useDismiss as O, useInteractions as w, FloatingPortal as z, FloatingOverlay as D, FloatingFocusManager as T } from "@floating-ui/react";
|
|
3
|
+
import { IconArrowLeft as j } from "@tabler/icons-react";
|
|
4
|
+
import { useId as B } from "react";
|
|
5
|
+
import { CloseButton as E } from "../CloseButton/CloseButton.js";
|
|
6
|
+
import { DIAL_KIT_ICON_STROKE as K } from "../constants/icon.js";
|
|
7
|
+
import { GhostIconButton as P } from "../IconButton/IconButtonWrappers.js";
|
|
8
|
+
import { useThemeScope as G } from "../ThemeScope/ThemeScope.js";
|
|
9
|
+
import { DIAL_ICON_SIZE as R } from "../../../constants/icon.js";
|
|
10
|
+
import { DIAL_KIT_CLASS as M } from "../../../constants/public-class-names.js";
|
|
11
|
+
import { ElementSize as U } from "../../../types/size.js";
|
|
12
|
+
import { mergeClasses as o } from "../../../utils/merge-classes.js";
|
|
13
|
+
const te = ({
|
|
14
|
+
open: i,
|
|
15
|
+
onClose: a,
|
|
16
|
+
title: t,
|
|
17
|
+
ariaLabel: c,
|
|
18
|
+
onBack: s,
|
|
19
|
+
backAriaLabel: d = "Back",
|
|
20
|
+
closeAriaLabel: u = "Close",
|
|
21
|
+
closeOnOutsideClick: f = !0,
|
|
22
|
+
children: p,
|
|
23
|
+
className: h,
|
|
24
|
+
overlayClassName: b,
|
|
25
|
+
headerClassName: g,
|
|
26
|
+
style: x,
|
|
27
|
+
overlayStyle: I,
|
|
28
|
+
bodyClassName: S,
|
|
29
|
+
titleClassName: N,
|
|
30
|
+
portalId: v
|
|
31
|
+
}) => {
|
|
32
|
+
const y = G(), l = `bottom-sheet-title-${B()}`, { refs: n, context: r } = k({
|
|
33
|
+
open: i,
|
|
34
|
+
onOpenChange: (_) => {
|
|
35
|
+
_ || a();
|
|
36
|
+
}
|
|
37
|
+
}), F = A(r, { role: "dialog" }), C = O(r, { outsidePress: f }), { getFloatingProps: L } = w([F, C]);
|
|
38
|
+
return i ? /* @__PURE__ */ e(z, { id: v, children: /* @__PURE__ */ e(
|
|
39
|
+
D,
|
|
40
|
+
{
|
|
41
|
+
lockScroll: !0,
|
|
42
|
+
style: I,
|
|
43
|
+
className: o(
|
|
44
|
+
"z-popup flex items-end bg-backdrop",
|
|
45
|
+
y,
|
|
46
|
+
b
|
|
47
|
+
),
|
|
48
|
+
children: /* @__PURE__ */ e(T, { context: r, initialFocus: n.floating, children: /* @__PURE__ */ m(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
ref: n.setFloating,
|
|
52
|
+
...L(),
|
|
53
|
+
role: "dialog",
|
|
54
|
+
"aria-modal": "true",
|
|
55
|
+
"aria-labelledby": t ? l : void 0,
|
|
56
|
+
"aria-label": t ? void 0 : c,
|
|
57
|
+
style: x,
|
|
58
|
+
className: o(
|
|
59
|
+
"flex max-h-[85dvh] w-full flex-col rounded-t-lg bg-layer-raised outline-none",
|
|
60
|
+
"animate-slideUp motion-reduce:animate-none",
|
|
61
|
+
h,
|
|
62
|
+
M.bottomSheet
|
|
63
|
+
),
|
|
64
|
+
children: [
|
|
65
|
+
t && /* @__PURE__ */ m(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: o(
|
|
69
|
+
"relative flex h-[60px] shrink-0 items-center justify-center border-b border-tertiary px-14",
|
|
70
|
+
g
|
|
71
|
+
),
|
|
72
|
+
children: [
|
|
73
|
+
s && /* @__PURE__ */ e(
|
|
74
|
+
P,
|
|
75
|
+
{
|
|
76
|
+
"aria-label": d,
|
|
77
|
+
className: "absolute start-4",
|
|
78
|
+
onClick: s,
|
|
79
|
+
icon: /* @__PURE__ */ e(
|
|
80
|
+
j,
|
|
81
|
+
{
|
|
82
|
+
size: R.LG,
|
|
83
|
+
stroke: K,
|
|
84
|
+
className: "rtl:-scale-x-100",
|
|
85
|
+
"aria-hidden": "true"
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ e(
|
|
91
|
+
"h2",
|
|
92
|
+
{
|
|
93
|
+
id: l,
|
|
94
|
+
className: o(
|
|
95
|
+
"min-w-0 truncate text-primary",
|
|
96
|
+
N ?? "dial-body-semi-text"
|
|
97
|
+
),
|
|
98
|
+
children: t
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ e(
|
|
102
|
+
E,
|
|
103
|
+
{
|
|
104
|
+
ariaLabel: u,
|
|
105
|
+
onClose: a,
|
|
106
|
+
size: U.Standard,
|
|
107
|
+
className: "absolute end-4"
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ e(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
className: o("min-h-0 overflow-y-auto", S),
|
|
117
|
+
children: p
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
) })
|
|
123
|
+
}
|
|
124
|
+
) }) : null;
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
te as BottomSheet
|
|
128
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useFloating as A, useRole as E, useDismiss as K, useInteractions as P, FloatingPortal as j, FloatingOverlay as M, FloatingFocusManager as R } from "@floating-ui/react";
|
|
3
|
+
import { IconChevronLeft as B } from "@tabler/icons-react";
|
|
4
|
+
import { useId as G } from "react";
|
|
5
|
+
import { CloseButton as H } from "../CloseButton/CloseButton.js";
|
|
6
|
+
import { DIAL_KIT_ICON_STROKE as Z } from "../constants/icon.js";
|
|
7
|
+
import { GhostIconButton as $ } from "../IconButton/IconButtonWrappers.js";
|
|
8
|
+
import { useThemeScope as q } from "../ThemeScope/ThemeScope.js";
|
|
9
|
+
import { DIAL_ICON_SIZE as J } from "../../../constants/icon.js";
|
|
10
|
+
import { DIAL_KIT_CLASS as Q } from "../../../constants/public-class-names.js";
|
|
11
|
+
import { ElementSize as U } from "../../../types/size.js";
|
|
12
|
+
import { mergeClasses as r } from "../../../utils/merge-classes.js";
|
|
13
|
+
const ne = ({
|
|
14
|
+
open: t,
|
|
15
|
+
onClose: l,
|
|
16
|
+
header: o,
|
|
17
|
+
ariaLabel: f,
|
|
18
|
+
headerActions: p,
|
|
19
|
+
onBack: i,
|
|
20
|
+
backAriaLabel: u = "Back",
|
|
21
|
+
backDisabled: x = !1,
|
|
22
|
+
closeAriaLabel: g = "Close",
|
|
23
|
+
closeDisabled: b = !1,
|
|
24
|
+
hideClose: n = !1,
|
|
25
|
+
closeOnOutsideClick: h = !0,
|
|
26
|
+
children: y,
|
|
27
|
+
className: I,
|
|
28
|
+
overlayClassName: v,
|
|
29
|
+
headerClassName: S,
|
|
30
|
+
style: w,
|
|
31
|
+
overlayStyle: N,
|
|
32
|
+
bodyClassName: k,
|
|
33
|
+
titleClassName: F,
|
|
34
|
+
portalId: C
|
|
35
|
+
}) => {
|
|
36
|
+
const D = q(), d = `side-drawer-title-${G()}`, s = typeof o == "string", { refs: m, context: a } = A({
|
|
37
|
+
open: t,
|
|
38
|
+
onOpenChange: (z) => {
|
|
39
|
+
z || l();
|
|
40
|
+
}
|
|
41
|
+
}), _ = E(a, { role: "dialog" }), L = K(a, { outsidePress: h }), { getFloatingProps: T } = P([_, L]), O = o != null || i != null || !n;
|
|
42
|
+
return /* @__PURE__ */ e(j, { id: C, children: /* @__PURE__ */ e(
|
|
43
|
+
M,
|
|
44
|
+
{
|
|
45
|
+
lockScroll: t,
|
|
46
|
+
style: N,
|
|
47
|
+
className: r(
|
|
48
|
+
"z-popup bg-backdrop transition-opacity duration-300 motion-reduce:transition-none",
|
|
49
|
+
t ? "opacity-100" : "pointer-events-none opacity-0",
|
|
50
|
+
D,
|
|
51
|
+
v
|
|
52
|
+
),
|
|
53
|
+
children: /* @__PURE__ */ e(
|
|
54
|
+
R,
|
|
55
|
+
{
|
|
56
|
+
context: a,
|
|
57
|
+
disabled: !t,
|
|
58
|
+
initialFocus: m.floating,
|
|
59
|
+
children: /* @__PURE__ */ c(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
ref: m.setFloating,
|
|
63
|
+
...T(),
|
|
64
|
+
role: "dialog",
|
|
65
|
+
"aria-modal": "true",
|
|
66
|
+
"aria-labelledby": s ? d : void 0,
|
|
67
|
+
"aria-label": s ? void 0 : f,
|
|
68
|
+
inert: !t,
|
|
69
|
+
style: w,
|
|
70
|
+
className: r(
|
|
71
|
+
"fixed inset-y-0 end-0 flex w-full flex-col overflow-hidden bg-layer-raised outline-none",
|
|
72
|
+
"desktop:w-[540px] desktop:rounded-s-xl desktop:border-s desktop:border-secondary",
|
|
73
|
+
"transition-transform duration-300 motion-reduce:transition-none",
|
|
74
|
+
t ? "translate-x-0" : "translate-x-full rtl:-translate-x-full",
|
|
75
|
+
I,
|
|
76
|
+
Q.sideDrawer
|
|
77
|
+
),
|
|
78
|
+
children: [
|
|
79
|
+
O && /* @__PURE__ */ c(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: r(
|
|
83
|
+
"flex shrink-0 items-center gap-2 border-b border-tertiary px-6 py-3",
|
|
84
|
+
S
|
|
85
|
+
),
|
|
86
|
+
children: [
|
|
87
|
+
i && /* @__PURE__ */ e(
|
|
88
|
+
$,
|
|
89
|
+
{
|
|
90
|
+
"aria-label": u,
|
|
91
|
+
disabled: x,
|
|
92
|
+
onClick: i,
|
|
93
|
+
icon: /* @__PURE__ */ e(
|
|
94
|
+
B,
|
|
95
|
+
{
|
|
96
|
+
size: J.MD,
|
|
97
|
+
stroke: Z,
|
|
98
|
+
className: "rtl:-scale-x-100",
|
|
99
|
+
"aria-hidden": "true"
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
s ? /* @__PURE__ */ e(
|
|
105
|
+
"h2",
|
|
106
|
+
{
|
|
107
|
+
id: d,
|
|
108
|
+
className: r(
|
|
109
|
+
"min-w-0 flex-1 truncate text-primary",
|
|
110
|
+
F ?? "dial-h2-text"
|
|
111
|
+
),
|
|
112
|
+
children: o
|
|
113
|
+
}
|
|
114
|
+
) : /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: o }),
|
|
115
|
+
p,
|
|
116
|
+
!n && /* @__PURE__ */ e(
|
|
117
|
+
H,
|
|
118
|
+
{
|
|
119
|
+
ariaLabel: g,
|
|
120
|
+
onClose: l,
|
|
121
|
+
disabled: b,
|
|
122
|
+
size: U.Standard
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ e(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
className: r(
|
|
132
|
+
"min-h-0 flex-1 overflow-y-auto",
|
|
133
|
+
k
|
|
134
|
+
),
|
|
135
|
+
children: y
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
) });
|
|
145
|
+
};
|
|
146
|
+
export {
|
|
147
|
+
ne as SideDrawer
|
|
148
|
+
};
|