@epam/ai-dial-ui-kit 0.16.0-dev.67 → 0.16.0-dev.69

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,63 +1,64 @@
1
- import { jsx as a, jsxs as c, Fragment as x } from "react/jsx-runtime";
2
- import { IconDots as A } from "@tabler/icons-react";
3
- import { useMemo as u, useCallback as B } from "react";
4
- import { Dropdown as D } from "../Dropdown/Dropdown.js";
5
- import { EllipsisTooltip as w } from "../EllipsisTooltip/EllipsisTooltip.js";
6
- import { DIAL_KIT_ICON_STROKE as F } from "../constants/icon.js";
7
- import { DIAL_ICON_SIZE as y } from "../../../constants/icon.js";
8
- import { DIAL_KIT_CLASS as b } from "../../../constants/public-class-names.js";
9
- import { BreadcrumbsSize as K } from "../../../types/breadcrumbs.js";
1
+ import { jsx as a, jsxs as i, Fragment as A } from "react/jsx-runtime";
2
+ import { IconDots as B } from "@tabler/icons-react";
3
+ import { useMemo as u, useCallback as D } from "react";
4
+ import { Dropdown as w } from "../Dropdown/Dropdown.js";
5
+ import { EllipsisTooltip as F } from "../EllipsisTooltip/EllipsisTooltip.js";
6
+ import { DIAL_KIT_ICON_STROKE as y } from "../constants/icon.js";
7
+ import { DIAL_ICON_SIZE as K } from "../../../constants/icon.js";
8
+ import { DIAL_KIT_CLASS as g } from "../../../constants/public-class-names.js";
9
+ import { BreadcrumbsSize as O } from "../../../types/breadcrumbs.js";
10
10
  import { mergeClasses as o } from "../../../utils/merge-classes.js";
11
- import { listClassName as O, overflowButtonClassName as j, defaultSeparator as z, separatorClassName as g, sizeClassName as I, itemClassName as S, navClassName as R, DEFAULT_MAX_VISIBLE_ITEMS as V, MIN_VISIBLE_ITEMS as W, linkSegmentClassName as P, staticSegmentClassName as U, currentSegmentClassName as X, currentSizeClassName as Z, segmentClassName as $, segmentWidthClassName as q } from "./constants.js";
12
- const te = ({
11
+ import { listClassName as R, focusRingClassName as b, overflowButtonClassName as j, defaultSeparator as V, separatorClassName as I, sizeClassName as S, itemClassName as k, navClassName as W, DEFAULT_MAX_VISIBLE_ITEMS as P, MIN_VISIBLE_ITEMS as U, linkSegmentClassName as X, staticSegmentClassName as Z, currentSegmentClassName as $, currentSizeClassName as q, segmentClassName as G, segmentWidthClassName as H } from "./constants.js";
12
+ const oe = ({
13
13
  items: s,
14
- maxVisibleItems: k = V,
15
- size: i = K.Small,
16
- separator: f = z,
17
- ariaLabel: _ = "Breadcrumb",
18
- overflowAriaLabel: M = "Show hidden path segments",
19
- className: E,
20
- itemClassName: L
14
+ maxVisibleItems: _ = P,
15
+ size: n = O.Small,
16
+ separator: p = V,
17
+ ariaLabel: M = "Breadcrumb",
18
+ overflowAriaLabel: E = "Show hidden path segments",
19
+ className: L,
20
+ itemClassName: T
21
21
  }) => {
22
- const m = Math.max(k, W), n = u(
22
+ const m = Math.max(_, U), t = u(
23
23
  () => s.length > m ? s.slice(1, -(m - 2)) : [],
24
24
  [s, m]
25
- ), T = u(
26
- () => n.map((e, l) => ({
25
+ ), v = u(
26
+ () => t.map((e, l) => ({
27
27
  key: String(l),
28
28
  label: e.label,
29
29
  icon: e.icon
30
30
  })),
31
- [n]
32
- ), v = B(
31
+ [t]
32
+ ), x = D(
33
33
  ({ key: e, domEvent: l }) => {
34
- const r = n[Number(e)];
34
+ const r = t[Number(e)];
35
35
  r && (r.onClick?.(l), !r.onClick && r.href && !l.defaultPrevented && (window.location.href = r.href));
36
36
  },
37
- [n]
37
+ [t]
38
38
  );
39
39
  if (s.length === 0) return null;
40
- const d = s.slice(n.length + 1), C = (e, {
40
+ const d = s.slice(t.length + 1), C = (e, {
41
41
  index: l,
42
42
  isFirst: r,
43
- isCurrent: t
43
+ isCurrent: c
44
44
  }) => {
45
- const N = !t && (!!e.href || !!e.onClick), h = o(
46
- $,
47
- N ? P : t ? o(X, Z[i]) : U,
48
- L,
49
- b.breadcrumbsItem
50
- ), p = /* @__PURE__ */ c(x, { children: [
45
+ const N = !c && (!!e.href || !!e.onClick), h = o(
46
+ G,
47
+ b[n],
48
+ N ? X : c ? o($, q[n]) : Z,
49
+ T,
50
+ g.breadcrumbsItem
51
+ ), f = /* @__PURE__ */ i(A, { children: [
51
52
  e.icon,
52
- /* @__PURE__ */ a(w, { text: e.label })
53
+ /* @__PURE__ */ a(F, { text: e.label })
53
54
  ] });
54
- return /* @__PURE__ */ c(
55
+ return /* @__PURE__ */ i(
55
56
  "li",
56
57
  {
57
58
  className: o(
58
- S,
59
- I[i],
60
- q[t ? "last" : r ? "first" : "middle"]
59
+ k,
60
+ S[n],
61
+ H[n][c ? "last" : r ? "first" : "middle"]
61
62
  ),
62
63
  children: [
63
64
  N ? e.href ? /* @__PURE__ */ a(
@@ -66,7 +67,7 @@ const te = ({
66
67
  href: e.href,
67
68
  onClick: e.onClick,
68
69
  className: h,
69
- children: p
70
+ children: f
70
71
  }
71
72
  ) : /* @__PURE__ */ a(
72
73
  "button",
@@ -74,17 +75,17 @@ const te = ({
74
75
  type: "button",
75
76
  onClick: e.onClick,
76
77
  className: h,
77
- children: p
78
+ children: f
78
79
  }
79
80
  ) : /* @__PURE__ */ a(
80
81
  "span",
81
82
  {
82
83
  className: h,
83
- "aria-current": t ? "page" : void 0,
84
- children: p
84
+ "aria-current": c ? "page" : void 0,
85
+ children: f
85
86
  }
86
87
  ),
87
- !t && /* @__PURE__ */ a("span", { className: g, "aria-hidden": "true", children: f })
88
+ !c && /* @__PURE__ */ a("span", { className: I, "aria-hidden": "true", children: p })
88
89
  ]
89
90
  },
90
91
  `segment-${l}`
@@ -93,45 +94,48 @@ const te = ({
93
94
  return /* @__PURE__ */ a(
94
95
  "nav",
95
96
  {
96
- "aria-label": _,
97
+ "aria-label": M,
97
98
  className: o(
98
- R,
99
- E,
100
- b.breadcrumbs
99
+ W[n],
100
+ L,
101
+ g.breadcrumbs
101
102
  ),
102
- children: /* @__PURE__ */ c("ol", { className: O, children: [
103
+ children: /* @__PURE__ */ i("ol", { className: R, children: [
103
104
  C(s[0], {
104
105
  index: 0,
105
106
  isFirst: !0,
106
107
  isCurrent: s.length === 1
107
108
  }),
108
- n.length > 0 && /* @__PURE__ */ c(
109
+ t.length > 0 && /* @__PURE__ */ i(
109
110
  "li",
110
111
  {
111
112
  className: o(
112
- S,
113
- I[i],
113
+ k,
114
+ S[n],
114
115
  "shrink-0"
115
116
  ),
116
117
  children: [
117
118
  /* @__PURE__ */ a(
118
- D,
119
+ w,
119
120
  {
120
- items: T,
121
- onItemClick: v,
121
+ items: v,
122
+ onItemClick: x,
122
123
  placement: "bottom-start",
123
124
  matchReferenceWidth: !1,
124
125
  children: /* @__PURE__ */ a(
125
126
  "button",
126
127
  {
127
128
  type: "button",
128
- "aria-label": M,
129
- className: j,
129
+ "aria-label": E,
130
+ className: o(
131
+ j,
132
+ b[n]
133
+ ),
130
134
  children: /* @__PURE__ */ a(
131
- A,
135
+ B,
132
136
  {
133
- size: y.SM,
134
- stroke: F,
137
+ size: K.SM,
138
+ stroke: y,
135
139
  "aria-hidden": "true"
136
140
  }
137
141
  )
@@ -139,7 +143,7 @@ const te = ({
139
143
  )
140
144
  }
141
145
  ),
142
- /* @__PURE__ */ a("span", { className: g, "aria-hidden": "true", children: f })
146
+ /* @__PURE__ */ a("span", { className: I, "aria-hidden": "true", children: p })
143
147
  ]
144
148
  }
145
149
  ),
@@ -155,5 +159,5 @@ const te = ({
155
159
  );
156
160
  };
157
161
  export {
158
- te as Breadcrumbs
162
+ oe as Breadcrumbs
159
163
  };
@@ -1,41 +1,60 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { IconChevronRight as s } from "@tabler/icons-react";
2
+ import { IconChevronRight as i } from "@tabler/icons-react";
3
3
  import { DIAL_KIT_ICON_STROKE as n } from "../constants/icon.js";
4
- import { DIAL_ICON_SIZE as i } from "../../../constants/icon.js";
4
+ import { DIAL_ICON_SIZE as a } from "../../../constants/icon.js";
5
5
  import { BreadcrumbsSize as e } from "../../../types/breadcrumbs.js";
6
- const c = "w-full overflow-hidden", f = "flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap", u = "flex min-w-0 items-center gap-2", d = {
6
+ const d = {
7
+ [e.Small]: "w-full overflow-hidden",
8
+ [e.Tiny]: "w-full",
9
+ [e.Heading]: "w-full overflow-hidden"
10
+ }, f = "flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap", u = "flex min-w-0 items-center gap-2", x = {
7
11
  [e.Small]: "dial-small-text",
12
+ [e.Tiny]: "dial-tiny-text",
8
13
  [e.Heading]: "dial-h2-text"
9
- }, x = {
14
+ }, h = {
10
15
  [e.Small]: "dial-small-semi-text",
16
+ [e.Tiny]: "dial-tiny-semi-text",
11
17
  [e.Heading]: "dial-h2-text"
12
- }, N = {
18
+ }, s = {
13
19
  first: "shrink-0",
14
20
  middle: "min-w-0 max-w-[30%] shrink",
15
21
  last: "min-w-0 max-w-[51%] shrink"
16
- }, p = "flex min-w-0 flex-1 items-center gap-1 rounded-xs transition-colors", C = "text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus", S = "cursor-default text-primary", h = "cursor-default text-secondary", I = "inline-flex flex-none items-center leading-none text-secondary", g = "dial-kit-minimum-target flex shrink-0 items-center rounded-xs text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus", w = 3, v = 4, _ = /* @__PURE__ */ t(
17
- s,
22
+ }, S = {
23
+ [e.Small]: s,
24
+ [e.Tiny]: {
25
+ first: "shrink-0",
26
+ middle: "min-w-12 shrink-[1000]",
27
+ last: "min-w-0 shrink"
28
+ },
29
+ [e.Heading]: s
30
+ }, g = {
31
+ [e.Small]: "rounded-xs focus-visible:outline-offset-2",
32
+ [e.Tiny]: "rounded focus-visible:outline-offset-1",
33
+ [e.Heading]: "rounded-xs focus-visible:outline-offset-2"
34
+ }, w = "flex min-w-0 flex-1 items-center gap-1 transition-colors", N = "text-secondary hover:text-accent focus-visible:outline focus-visible:outline-focus", p = "cursor-default text-primary", C = "cursor-default text-secondary", v = "inline-flex flex-none items-center leading-none text-secondary", I = "dial-kit-minimum-target flex shrink-0 items-center text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-focus", y = 3, k = 4, T = /* @__PURE__ */ t(
35
+ i,
18
36
  {
19
- size: i.SM,
37
+ size: a.SM,
20
38
  stroke: n,
21
39
  "aria-hidden": "true",
22
40
  className: "rtl:scale-x-[-1]"
23
41
  }
24
42
  );
25
43
  export {
26
- v as DEFAULT_MAX_VISIBLE_ITEMS,
27
- w as MIN_VISIBLE_ITEMS,
28
- S as currentSegmentClassName,
29
- x as currentSizeClassName,
30
- _ as defaultSeparator,
44
+ k as DEFAULT_MAX_VISIBLE_ITEMS,
45
+ y as MIN_VISIBLE_ITEMS,
46
+ p as currentSegmentClassName,
47
+ h as currentSizeClassName,
48
+ T as defaultSeparator,
49
+ g as focusRingClassName,
31
50
  u as itemClassName,
32
- C as linkSegmentClassName,
51
+ N as linkSegmentClassName,
33
52
  f as listClassName,
34
- c as navClassName,
35
- g as overflowButtonClassName,
36
- p as segmentClassName,
37
- N as segmentWidthClassName,
38
- I as separatorClassName,
39
- d as sizeClassName,
40
- h as staticSegmentClassName
53
+ d as navClassName,
54
+ I as overflowButtonClassName,
55
+ w as segmentClassName,
56
+ S as segmentWidthClassName,
57
+ v as separatorClassName,
58
+ x as sizeClassName,
59
+ C as staticSegmentClassName
41
60
  };