@epam/ai-dial-ui-kit 0.16.0-dev.55 → 0.16.0-dev.57
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 +2 -0
- package/dist/CHANGELOG.md +12 -0
- package/dist/{DateCellRenderer-D5FgkGHp.cjs → DateCellRenderer-CB2R7gM2.cjs} +28 -28
- package/dist/{MarkdownEditor-BtLY7OVq.cjs → MarkdownEditor-B-x8Ntfe.cjs} +1 -1
- package/dist/components/New/Dropdown/Dropdown.js +212 -203
- package/dist/components/New/Notification/Notification.js +51 -40
- package/dist/components/New/Notification/constants.js +26 -17
- package/dist/components/New/ToggleChip/ToggleChip.js +54 -0
- package/dist/components/New/ToggleChip/constants.js +11 -0
- package/dist/components/ProgressBar/ProgressBar.js +43 -38
- package/dist/components-manifest.json +144 -10
- package/dist/constants/public-class-names.js +2 -0
- package/dist/dial-ui-kit.cjs +3 -3
- package/dist/dial-ui-kit.js +375 -369
- package/dist/editors.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/{icon-D93YIwGJ.cjs → icon-4D9xu6E_.cjs} +1 -1
- package/dist/index.css +1 -1
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +53 -1
- package/dist/src/components/New/Notification/Notification.d.ts +21 -2
- package/dist/src/components/New/Notification/constants.d.ts +11 -0
- package/dist/src/components/New/ToggleChip/ToggleChip.d.ts +70 -0
- package/dist/src/components/New/ToggleChip/constants.d.ts +12 -0
- package/dist/src/components/ProgressBar/ProgressBar.d.ts +23 -3
- package/dist/src/constants/public-class-names.d.ts +2 -0
- package/dist/src/index.d.ts +5 -2
- package/dist/src/types/dropdown.d.ts +16 -0
- package/dist/src/types/notification.d.ts +11 -0
- package/dist/src/types/progress-bar.d.ts +13 -0
- package/dist/types/dropdown.js +5 -4
- package/dist/types/notification.js +3 -2
- package/dist/types/progress-bar.js +4 -0
- package/dist/utils/merge-classes.js +11 -8
- package/package.json +1 -1
|
@@ -1,65 +1,76 @@
|
|
|
1
1
|
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { DialIcon as
|
|
4
|
-
import { NotificationVariant as
|
|
5
|
-
import { mergeClasses as
|
|
6
|
-
import { CloseButton as
|
|
7
|
-
import { variantIcons as
|
|
8
|
-
import { DIAL_KIT_CLASS as
|
|
9
|
-
const
|
|
10
|
-
variant: e =
|
|
11
|
-
type:
|
|
12
|
-
|
|
2
|
+
import { useMemo as M } from "react";
|
|
3
|
+
import { DialIcon as S } from "../../Icon/Icon.js";
|
|
4
|
+
import { NotificationVariant as d, NotificationSurface as p, NotificationType as i } from "../../../types/notification.js";
|
|
5
|
+
import { mergeClasses as o } from "../../../utils/merge-classes.js";
|
|
6
|
+
import { CloseButton as T } from "../CloseButton/CloseButton.js";
|
|
7
|
+
import { variantIcons as v, notificationVariantRoleMap as L, notificationNeutralSurfaceIconClassNameMap as V, notificationNeutralSurfaceClassName as j, notificationVariantClassNameMap as y, alertBaseClassName as A } from "./constants.js";
|
|
8
|
+
import { DIAL_KIT_CLASS as B } from "../../../constants/public-class-names.js";
|
|
9
|
+
const G = ({
|
|
10
|
+
variant: e = d.Info,
|
|
11
|
+
type: s = i.Toast,
|
|
12
|
+
surface: N = p.Variant,
|
|
13
|
+
title: t,
|
|
13
14
|
message: l,
|
|
14
|
-
action:
|
|
15
|
-
className:
|
|
15
|
+
action: n,
|
|
16
|
+
className: x,
|
|
16
17
|
iconSize: m = 24,
|
|
17
|
-
iconStroke:
|
|
18
|
-
closable:
|
|
19
|
-
onClose:
|
|
20
|
-
children:
|
|
21
|
-
textClassName:
|
|
22
|
-
...
|
|
18
|
+
iconStroke: c = 2,
|
|
19
|
+
closable: h = !1,
|
|
20
|
+
onClose: u,
|
|
21
|
+
children: w,
|
|
22
|
+
textClassName: C,
|
|
23
|
+
...g
|
|
23
24
|
}) => {
|
|
24
|
-
const
|
|
25
|
+
const b = M(() => v({ size: m, stroke: c })[e], [e, m, c]), f = N === p.Neutral, k = C ?? (s === i.SectionMessage ? "flex-row flex-wrap items-baseline gap-x-1" : "flex-col");
|
|
25
26
|
return /* @__PURE__ */ r(
|
|
26
27
|
"div",
|
|
27
28
|
{
|
|
28
|
-
role:
|
|
29
|
-
...
|
|
30
|
-
className:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
role: L[e],
|
|
30
|
+
...g,
|
|
31
|
+
className: o(
|
|
32
|
+
A,
|
|
33
|
+
f ? j : y[e],
|
|
34
|
+
s === i.Toast && "min-w-[200px] max-w-[600px] shadow-lg",
|
|
35
|
+
s === i.SectionMessage && e === d.Loading && "border-secondary",
|
|
36
|
+
x,
|
|
37
|
+
B.notification
|
|
37
38
|
),
|
|
38
39
|
children: [
|
|
39
40
|
/* @__PURE__ */ r("div", { className: "flex items-start gap-3 flex-1 min-w-0", children: [
|
|
40
|
-
/* @__PURE__ */ a(
|
|
41
|
-
|
|
41
|
+
/* @__PURE__ */ a(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
className: o(
|
|
46
|
+
"flex shrink-0",
|
|
47
|
+
f && V[e]
|
|
48
|
+
),
|
|
49
|
+
children: /* @__PURE__ */ a(S, { icon: b })
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
t ? /* @__PURE__ */ r(
|
|
42
53
|
"div",
|
|
43
54
|
{
|
|
44
|
-
className:
|
|
55
|
+
className: o(
|
|
45
56
|
"flex min-w-0 text-primary break-words",
|
|
46
|
-
|
|
57
|
+
k
|
|
47
58
|
),
|
|
48
59
|
children: [
|
|
49
|
-
/* @__PURE__ */ a("div", { className: "dial-small-paragraph-semi-text min-w-0 break-words", children:
|
|
60
|
+
/* @__PURE__ */ a("div", { className: "dial-small-paragraph-semi-text min-w-0 break-words", children: t }),
|
|
50
61
|
/* @__PURE__ */ a("div", { className: "dial-small-paragraph-text min-w-0 break-words", children: l })
|
|
51
62
|
]
|
|
52
63
|
}
|
|
53
64
|
) : /* @__PURE__ */ a("div", { className: "dial-small-paragraph-text min-w-0 text-primary break-words", children: l })
|
|
54
65
|
] }),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
n != null && /* @__PURE__ */ a("div", { className: "flex shrink-0 items-center", children: n }),
|
|
67
|
+
w,
|
|
68
|
+
h && /* @__PURE__ */ a(
|
|
69
|
+
T,
|
|
59
70
|
{
|
|
60
71
|
className: "shrink-0 self-start",
|
|
61
72
|
ariaLabel: "Close notification",
|
|
62
|
-
onClose: (
|
|
73
|
+
onClose: (I) => u?.(I)
|
|
63
74
|
}
|
|
64
75
|
)
|
|
65
76
|
]
|
|
@@ -67,5 +78,5 @@ const R = ({
|
|
|
67
78
|
);
|
|
68
79
|
};
|
|
69
80
|
export {
|
|
70
|
-
|
|
81
|
+
G as Notification
|
|
71
82
|
};
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Spinner as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Spinner as n } from "../../Spinner/Spinner.js";
|
|
3
3
|
import { NotificationVariant as e } from "../../../types/notification.js";
|
|
4
|
-
import { IconCheck as
|
|
5
|
-
const
|
|
6
|
-
info: /* @__PURE__ */
|
|
7
|
-
error: /* @__PURE__ */
|
|
8
|
-
warning: /* @__PURE__ */
|
|
9
|
-
success: /* @__PURE__ */
|
|
10
|
-
loading: /* @__PURE__ */
|
|
11
|
-
general: /* @__PURE__ */ i
|
|
12
|
-
}),
|
|
4
|
+
import { IconCheck as i, IconCircleCheckFilled as a, IconAlertTriangleFilled as s, IconAlertCircleFilled as o, IconInfoCircleFilled as c } from "@tabler/icons-react";
|
|
5
|
+
const x = (t) => ({
|
|
6
|
+
info: /* @__PURE__ */ r(c, { size: t.size }),
|
|
7
|
+
error: /* @__PURE__ */ r(o, { size: t.size }),
|
|
8
|
+
warning: /* @__PURE__ */ r(s, { size: t.size }),
|
|
9
|
+
success: /* @__PURE__ */ r(a, { size: t.size }),
|
|
10
|
+
loading: /* @__PURE__ */ r(n, { size: t.size }),
|
|
11
|
+
general: /* @__PURE__ */ r(i, { size: t.size, stroke: t.stroke })
|
|
12
|
+
}), m = {
|
|
13
13
|
[e.Info]: "bg-info text-info",
|
|
14
14
|
[e.Success]: "bg-success text-success",
|
|
15
15
|
[e.Warning]: "bg-warning text-warning",
|
|
16
16
|
[e.Error]: "bg-error text-error",
|
|
17
17
|
[e.Loading]: "bg-layer-raised text-info",
|
|
18
18
|
[e.General]: "bg-layer-sunken text-primary"
|
|
19
|
-
}, z = {
|
|
19
|
+
}, d = "bg-layer-sunken text-primary", z = {
|
|
20
|
+
[e.Info]: "text-info",
|
|
21
|
+
[e.Success]: "text-success",
|
|
22
|
+
[e.Warning]: "text-warning-icon",
|
|
23
|
+
[e.Error]: "text-error",
|
|
24
|
+
[e.Loading]: "text-info",
|
|
25
|
+
[e.General]: "text-primary"
|
|
26
|
+
}, I = {
|
|
20
27
|
[e.Info]: "status",
|
|
21
28
|
[e.Success]: "status",
|
|
22
29
|
[e.Warning]: "alert",
|
|
23
30
|
[e.Error]: "alert",
|
|
24
31
|
[e.Loading]: "status",
|
|
25
32
|
[e.General]: "status"
|
|
26
|
-
},
|
|
33
|
+
}, b = "items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent";
|
|
27
34
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
z as
|
|
31
|
-
m as
|
|
35
|
+
b as alertBaseClassName,
|
|
36
|
+
d as notificationNeutralSurfaceClassName,
|
|
37
|
+
z as notificationNeutralSurfaceIconClassNameMap,
|
|
38
|
+
m as notificationVariantClassNameMap,
|
|
39
|
+
I as notificationVariantRoleMap,
|
|
40
|
+
x as variantIcons
|
|
32
41
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as g } from "react";
|
|
3
|
+
import { tagStateClassNames as h, tagInteractiveClassName as u, tagHoverClassName as N, tagBaseClassName as d } from "../Tag/constants.js";
|
|
4
|
+
import { DIAL_KIT_CLASS as x } from "../../../constants/public-class-names.js";
|
|
5
|
+
import { TagAppearance as b } from "../../../types/tag.js";
|
|
6
|
+
import { mergeClasses as k } from "../../../utils/merge-classes.js";
|
|
7
|
+
import { toggleChipDisabledClassNames as v, toggleChipLabelClassNames as A } from "./constants.js";
|
|
8
|
+
const B = ({
|
|
9
|
+
label: e,
|
|
10
|
+
icon: s,
|
|
11
|
+
isSelected: a = !1,
|
|
12
|
+
onToggle: r,
|
|
13
|
+
onClick: m,
|
|
14
|
+
disabled: o = !1,
|
|
15
|
+
className: p,
|
|
16
|
+
title: n,
|
|
17
|
+
...f
|
|
18
|
+
}) => {
|
|
19
|
+
const C = g(
|
|
20
|
+
(l) => {
|
|
21
|
+
m?.(l), !l.defaultPrevented && r?.(!a);
|
|
22
|
+
},
|
|
23
|
+
[m, r, a]
|
|
24
|
+
), t = a ? "selected" : "default";
|
|
25
|
+
return /* @__PURE__ */ c(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
...f,
|
|
29
|
+
type: "button",
|
|
30
|
+
"aria-pressed": a,
|
|
31
|
+
disabled: o,
|
|
32
|
+
title: n ?? (typeof e == "string" ? e : void 0),
|
|
33
|
+
onClick: C,
|
|
34
|
+
className: k(
|
|
35
|
+
d,
|
|
36
|
+
A[t],
|
|
37
|
+
o ? v[t] : [
|
|
38
|
+
h[b.Selectable][t],
|
|
39
|
+
u,
|
|
40
|
+
N
|
|
41
|
+
],
|
|
42
|
+
p,
|
|
43
|
+
x.toggleChip
|
|
44
|
+
),
|
|
45
|
+
children: [
|
|
46
|
+
s && /* @__PURE__ */ i("span", { className: "flex shrink-0 items-center", "aria-hidden": "true", children: s }),
|
|
47
|
+
/* @__PURE__ */ i("span", { className: "truncate", children: e })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
B as ToggleChip
|
|
54
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
default: "dial-tiny-text",
|
|
3
|
+
selected: "dial-tiny-semi-text"
|
|
4
|
+
}, t = {
|
|
5
|
+
default: "cursor-not-allowed text-control-disable-primary",
|
|
6
|
+
selected: "cursor-not-allowed bg-control-disable-primary text-control-disable-primary"
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
t as toggleChipDisabledClassNames,
|
|
10
|
+
e as toggleChipLabelClassNames
|
|
11
|
+
};
|
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { Label as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as s, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { useId as M } from "react";
|
|
3
|
+
import { Label as y } from "../New/Label/Label.js";
|
|
4
|
+
import { ProgressBarRole as i } from "../../types/progress-bar.js";
|
|
5
|
+
import { ElementSize as h } from "../../types/size.js";
|
|
6
|
+
import { resolveAccessibleName as S } from "../../utils/accessible-name.js";
|
|
7
|
+
import { mergeClasses as p } from "../../utils/merge-classes.js";
|
|
8
|
+
import { DIAL_KIT_CLASS as u } from "../../constants/public-class-names.js";
|
|
9
|
+
const C = {
|
|
10
|
+
[i.Progressbar]: "Progress",
|
|
11
|
+
[i.Meter]: "Meter"
|
|
12
|
+
}, k = ({
|
|
13
|
+
value: t,
|
|
10
14
|
max: l = 100,
|
|
11
|
-
size:
|
|
12
|
-
labelProps:
|
|
13
|
-
valueLabel:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
size: b = h.Standard,
|
|
16
|
+
labelProps: r,
|
|
17
|
+
valueLabel: e,
|
|
18
|
+
role: n = i.Progressbar,
|
|
19
|
+
id: x,
|
|
20
|
+
className: N,
|
|
21
|
+
"aria-label": v,
|
|
22
|
+
...w
|
|
18
23
|
}) => {
|
|
19
|
-
const
|
|
24
|
+
const A = M(), d = x ?? A, a = !!r?.label, m = a ? r?.id ?? `${d}-label` : void 0, o = l > 0 ? l : 0, B = Number.isFinite(t) ? t : 0, c = Math.min(Math.max(B, 0), o), I = o > 0 ? c / o * 100 : 0, f = /* @__PURE__ */ s(
|
|
20
25
|
"div",
|
|
21
26
|
{
|
|
22
|
-
...
|
|
23
|
-
id:
|
|
24
|
-
role:
|
|
25
|
-
"aria-valuenow":
|
|
27
|
+
...w,
|
|
28
|
+
id: d,
|
|
29
|
+
role: n,
|
|
30
|
+
"aria-valuenow": c,
|
|
26
31
|
"aria-valuemin": 0,
|
|
27
32
|
"aria-valuemax": o,
|
|
28
|
-
"aria-labelledby":
|
|
29
|
-
"aria-label":
|
|
30
|
-
|
|
31
|
-
a ? void 0 :
|
|
33
|
+
"aria-labelledby": m,
|
|
34
|
+
"aria-label": S(
|
|
35
|
+
v,
|
|
36
|
+
a ? void 0 : C[n]
|
|
32
37
|
),
|
|
33
|
-
className:
|
|
38
|
+
className: p(
|
|
34
39
|
"w-full overflow-hidden rounded-full bg-control-disable-primary",
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
b === h.Small ? "h-1" : "h-2",
|
|
41
|
+
N,
|
|
37
42
|
/* The track is the component's root when there is no label and no
|
|
38
43
|
readout to wrap it, and the public class belongs on whichever
|
|
39
44
|
element that is. */
|
|
40
|
-
!a && !
|
|
45
|
+
!a && !e && u.progressBar
|
|
41
46
|
),
|
|
42
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ s(
|
|
43
48
|
"div",
|
|
44
49
|
{
|
|
45
50
|
style: { width: `${I}%` },
|
|
@@ -48,23 +53,23 @@ const z = ({
|
|
|
48
53
|
)
|
|
49
54
|
}
|
|
50
55
|
);
|
|
51
|
-
return !a && !
|
|
56
|
+
return !a && !e ? f : /* @__PURE__ */ g(
|
|
52
57
|
"div",
|
|
53
58
|
{
|
|
54
|
-
className:
|
|
59
|
+
className: p(
|
|
55
60
|
"flex w-full flex-col gap-1",
|
|
56
|
-
|
|
61
|
+
u.progressBar
|
|
57
62
|
),
|
|
58
63
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
/* @__PURE__ */ g("div", { className: "flex items-baseline gap-2", children: [
|
|
65
|
+
r && /* @__PURE__ */ s(y, { ...r, id: m }),
|
|
66
|
+
e && /* @__PURE__ */ s("span", { className: "dial-tiny-text text-secondary ml-auto shrink-0", children: e })
|
|
62
67
|
] }),
|
|
63
|
-
|
|
68
|
+
f
|
|
64
69
|
]
|
|
65
70
|
}
|
|
66
71
|
);
|
|
67
72
|
};
|
|
68
73
|
export {
|
|
69
|
-
|
|
74
|
+
k as ProgressBar
|
|
70
75
|
};
|