@epam/ai-dial-ui-kit 0.16.0-dev.55 → 0.16.0-dev.56

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.
Files changed (34) hide show
  1. package/README.md +2 -0
  2. package/dist/CHANGELOG.md +12 -0
  3. package/dist/{DateCellRenderer-D5FgkGHp.cjs → DateCellRenderer-weXr7pb2.cjs} +28 -28
  4. package/dist/{MarkdownEditor-BtLY7OVq.cjs → MarkdownEditor-B-x8Ntfe.cjs} +1 -1
  5. package/dist/components/New/Dropdown/Dropdown.js +204 -195
  6. package/dist/components/New/Notification/Notification.js +51 -40
  7. package/dist/components/New/Notification/constants.js +26 -17
  8. package/dist/components/New/ToggleChip/ToggleChip.js +54 -0
  9. package/dist/components/New/ToggleChip/constants.js +11 -0
  10. package/dist/components/ProgressBar/ProgressBar.js +43 -38
  11. package/dist/components-manifest.json +144 -10
  12. package/dist/constants/public-class-names.js +2 -0
  13. package/dist/dial-ui-kit.cjs +3 -3
  14. package/dist/dial-ui-kit.js +375 -369
  15. package/dist/editors.cjs +1 -1
  16. package/dist/grid.cjs +1 -1
  17. package/dist/{icon-D93YIwGJ.cjs → icon-4D9xu6E_.cjs} +1 -1
  18. package/dist/index.css +1 -1
  19. package/dist/src/components/New/Dropdown/Dropdown.d.ts +53 -1
  20. package/dist/src/components/New/Notification/Notification.d.ts +21 -2
  21. package/dist/src/components/New/Notification/constants.d.ts +11 -0
  22. package/dist/src/components/New/ToggleChip/ToggleChip.d.ts +70 -0
  23. package/dist/src/components/New/ToggleChip/constants.d.ts +12 -0
  24. package/dist/src/components/ProgressBar/ProgressBar.d.ts +23 -3
  25. package/dist/src/constants/public-class-names.d.ts +2 -0
  26. package/dist/src/index.d.ts +5 -2
  27. package/dist/src/types/dropdown.d.ts +16 -0
  28. package/dist/src/types/notification.d.ts +11 -0
  29. package/dist/src/types/progress-bar.d.ts +13 -0
  30. package/dist/types/dropdown.js +5 -4
  31. package/dist/types/notification.js +3 -2
  32. package/dist/types/progress-bar.js +4 -0
  33. package/dist/utils/merge-classes.js +11 -8
  34. 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 k } from "react";
3
- import { DialIcon as u } from "../../Icon/Icon.js";
4
- import { NotificationVariant as c, NotificationType as s } from "../../../types/notification.js";
5
- import { mergeClasses as d } from "../../../utils/merge-classes.js";
6
- import { CloseButton as v } from "../CloseButton/CloseButton.js";
7
- import { variantIcons as I, notificationVariantRoleMap as M, notificationVariantClassNameMap as T, alertBaseClassName as L } from "./constants.js";
8
- import { DIAL_KIT_CLASS as V } from "../../../constants/public-class-names.js";
9
- const R = ({
10
- variant: e = c.Info,
11
- type: i = s.Toast,
12
- title: o,
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: t,
15
- className: f,
15
+ action: n,
16
+ className: x,
16
17
  iconSize: m = 24,
17
- iconStroke: n = 2,
18
- closable: p = !1,
19
- onClose: x,
20
- children: h,
21
- textClassName: N,
22
- ...w
18
+ iconStroke: c = 2,
19
+ closable: h = !1,
20
+ onClose: u,
21
+ children: w,
22
+ textClassName: C,
23
+ ...g
23
24
  }) => {
24
- const g = k(() => I({ size: m, stroke: n })[e], [e, m, n]), C = N ?? (i === s.SectionMessage ? "flex-row flex-wrap items-baseline gap-x-1" : "flex-col");
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: M[e],
29
- ...w,
30
- className: d(
31
- L,
32
- T[e],
33
- i === s.Toast && "min-w-[200px] max-w-[600px] shadow-lg",
34
- i === s.SectionMessage && e === c.Loading && "border-secondary",
35
- f,
36
- V.notification
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("span", { "aria-hidden": "true", className: "flex shrink-0", children: /* @__PURE__ */ a(u, { icon: g }) }),
41
- o ? /* @__PURE__ */ r(
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: d(
55
+ className: o(
45
56
  "flex min-w-0 text-primary break-words",
46
- C
57
+ k
47
58
  ),
48
59
  children: [
49
- /* @__PURE__ */ a("div", { className: "dial-small-paragraph-semi-text min-w-0 break-words", children: o }),
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
- t != null && /* @__PURE__ */ a("div", { className: "flex shrink-0 items-center", children: t }),
56
- h,
57
- p && /* @__PURE__ */ a(
58
- v,
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: (b) => x?.(b)
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
- R as Notification
81
+ G as Notification
71
82
  };
@@ -1,32 +1,41 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { Spinner as t } from "../../Spinner/Spinner.js";
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 n, IconCircleCheckFilled as a, IconAlertTriangleFilled as s, IconAlertCircleFilled as o, IconInfoCircleFilled as c } from "@tabler/icons-react";
5
- const m = (r) => ({
6
- info: /* @__PURE__ */ i(c, { size: r.size }),
7
- error: /* @__PURE__ */ i(o, { size: r.size }),
8
- warning: /* @__PURE__ */ i(s, { size: r.size }),
9
- success: /* @__PURE__ */ i(a, { size: r.size }),
10
- loading: /* @__PURE__ */ i(t, { size: r.size }),
11
- general: /* @__PURE__ */ i(n, { size: r.size, stroke: r.stroke })
12
- }), u = {
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
- }, x = "items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent";
33
+ }, b = "items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent";
27
34
  export {
28
- x as alertBaseClassName,
29
- u as notificationVariantClassNameMap,
30
- z as notificationVariantRoleMap,
31
- m as variantIcons
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 i, jsxs as c } from "react/jsx-runtime";
2
- import { useId as y } from "react";
3
- import { Label as S } from "../New/Label/Label.js";
4
- import { ElementSize as f } from "../../types/size.js";
5
- import { resolveAccessibleName as B } from "../../utils/accessible-name.js";
6
- import { mergeClasses as h } from "../../utils/merge-classes.js";
7
- import { DIAL_KIT_CLASS as p } from "../../constants/public-class-names.js";
8
- const z = ({
9
- value: s,
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: u = f.Standard,
12
- labelProps: e,
13
- valueLabel: r,
14
- id: b,
15
- className: g,
16
- "aria-label": x,
17
- ...v
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 N = y(), t = b ?? N, a = !!e?.label, n = a ? e?.id ?? `${t}-label` : void 0, o = l > 0 ? l : 0, w = Number.isFinite(s) ? s : 0, d = Math.min(Math.max(w, 0), o), I = o > 0 ? d / o * 100 : 0, m = /* @__PURE__ */ i(
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
- ...v,
23
- id: t,
24
- role: "progressbar",
25
- "aria-valuenow": d,
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": n,
29
- "aria-label": B(
30
- x,
31
- a ? void 0 : "Progress"
33
+ "aria-labelledby": m,
34
+ "aria-label": S(
35
+ v,
36
+ a ? void 0 : C[n]
32
37
  ),
33
- className: h(
38
+ className: p(
34
39
  "w-full overflow-hidden rounded-full bg-control-disable-primary",
35
- u === f.Small ? "h-1" : "h-2",
36
- g,
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 && !r && p.progressBar
45
+ !a && !e && u.progressBar
41
46
  ),
42
- children: /* @__PURE__ */ i(
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 && !r ? m : /* @__PURE__ */ c(
56
+ return !a && !e ? f : /* @__PURE__ */ g(
52
57
  "div",
53
58
  {
54
- className: h(
59
+ className: p(
55
60
  "flex w-full flex-col gap-1",
56
- p.progressBar
61
+ u.progressBar
57
62
  ),
58
63
  children: [
59
- /* @__PURE__ */ c("div", { className: "flex items-baseline gap-2", children: [
60
- e && /* @__PURE__ */ i(S, { ...e, id: n }),
61
- r && /* @__PURE__ */ i("span", { className: "dial-tiny-text text-secondary ml-auto shrink-0", children: r })
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
- m
68
+ f
64
69
  ]
65
70
  }
66
71
  );
67
72
  };
68
73
  export {
69
- z as ProgressBar
74
+ k as ProgressBar
70
75
  };