@epam/ai-dial-ui-kit 0.15.0-dev.5 → 0.15.0-dev.7

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 (63) hide show
  1. package/README.md +139 -0
  2. package/dist/CHANGELOG.md +10 -0
  3. package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-4iMidqal.cjs} +26 -26
  4. package/dist/DateCellRenderer-CTTAnQjB.cjs +1 -0
  5. package/dist/components/Dropdown/Dropdown.js +70 -65
  6. package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
  7. package/dist/components/Dropdown/constants.js +14 -12
  8. package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
  9. package/dist/components/New/Accordion/Accordion.js +39 -37
  10. package/dist/components/New/ButtonDropdown/ButtonDropdown.js +7 -6
  11. package/dist/components/New/Calendar/Calendar.js +253 -222
  12. package/dist/components/New/CaptionText/CaptionText.js +18 -15
  13. package/dist/components/New/CardShell/CardShell.js +4 -2
  14. package/dist/components/New/Checkbox/Checkbox.js +67 -56
  15. package/dist/components/New/Checkbox/CheckboxBox.js +4 -2
  16. package/dist/components/New/CloseButton/CloseButton.js +18 -16
  17. package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
  18. package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +44 -39
  19. package/dist/components/New/Dropdown/Dropdown.js +101 -95
  20. package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +19 -17
  21. package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
  22. package/dist/components/New/FolderPath/FolderPath.js +29 -28
  23. package/dist/components/New/Highlight/Highlight.js +23 -30
  24. package/dist/components/New/InfoButton/InfoButton.js +12 -10
  25. package/dist/components/New/InlineSelect/InlineSelect.js +43 -41
  26. package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +40 -38
  27. package/dist/components/New/Label/Label.js +13 -8
  28. package/dist/components/New/MenuItem/MenuItem.js +29 -27
  29. package/dist/components/New/MenuItem/constants.js +9 -8
  30. package/dist/components/New/NoDataContent/NoDataContent.js +20 -18
  31. package/dist/components/New/Notification/Notification.js +28 -26
  32. package/dist/components/New/NumberInput/NumberInput.js +42 -33
  33. package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
  34. package/dist/components/New/Popup/Popup.js +45 -43
  35. package/dist/components/New/Radio/Radio.js +75 -64
  36. package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
  37. package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
  38. package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
  39. package/dist/components/New/Search/Search.js +28 -26
  40. package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
  41. package/dist/components/New/Select/Select.js +120 -109
  42. package/dist/components/New/Switch/Switch.js +69 -58
  43. package/dist/components/New/Tabs/Tabs.js +28 -22
  44. package/dist/components/New/Tag/Tag.js +42 -40
  45. package/dist/components/New/TagInput/TagInput.js +44 -42
  46. package/dist/components/New/ToggleIconButton/ToggleIconButton.js +25 -23
  47. package/dist/components/New/Tooltip/TooltipContent.js +10 -8
  48. package/dist/components/ProgressBar/ProgressBar.js +45 -33
  49. package/dist/components/Skeleton/Skeleton.js +25 -19
  50. package/dist/components/Spinner/Spinner.js +6 -4
  51. package/dist/components-manifest.json +7 -2
  52. package/dist/constants/public-class-names.js +152 -0
  53. package/dist/dial-ui-kit.cjs +2 -2
  54. package/dist/dial-ui-kit.js +203 -201
  55. package/dist/file-manager.cjs +1 -1
  56. package/dist/grid.cjs +1 -1
  57. package/dist/index.css +1 -1
  58. package/dist/src/constants/public-class-names.d.ts +143 -0
  59. package/dist/src/index.d.ts +1 -0
  60. package/dist/use-file-manager-tabs-DKmWaOlC.cjs +3 -0
  61. package/package.json +1 -1
  62. package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
  63. package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
@@ -1,54 +1,59 @@
1
- import { jsx as u, jsxs as k } from "react/jsx-runtime";
2
- import { useRef as g, useCallback as w } from "react";
1
+ import { jsx as u, jsxs as g } from "react/jsx-runtime";
2
+ import { useRef as A, useCallback as w } from "react";
3
3
  import { mergeClasses as f } from "../../../utils/merge-classes.js";
4
- const A = ["ArrowRight", "ArrowLeft", "Home", "End"], R = ({
4
+ import { DIAL_KIT_CLASS as m } from "../../../constants/public-class-names.js";
5
+ const I = ["ArrowRight", "ArrowLeft", "Home", "End"], R = ({
5
6
  tabs: n,
6
7
  activeTabId: i,
7
- onTabChange: o,
8
+ onTabChange: l,
8
9
  ariaLabel: x,
9
- className: m,
10
- tabClassName: b
10
+ className: b,
11
+ tabClassName: y
11
12
  }) => {
12
- const p = g({}), a = n.find((e) => e.id === i), y = a && !a.disabled ? a.id : n.find((e) => !e.disabled)?.id, h = w(
13
+ const p = A({}), a = n.find((e) => e.id === i), h = a && !a.disabled ? a.id : n.find((e) => !e.disabled)?.id, k = w(
13
14
  (e) => {
14
- if (!A.includes(e.key) || n.length === 0) return;
15
+ if (!I.includes(e.key) || n.length === 0) return;
15
16
  const r = n.filter((c) => !c.disabled);
16
17
  if (r.length === 0) return;
17
18
  const t = Math.max(
18
19
  r.findIndex((c) => c.id === i),
19
20
  0
20
21
  ), s = r.length - 1;
21
- let l = t;
22
+ let o = t;
22
23
  switch (e.key) {
23
24
  case "ArrowRight":
24
- l = t === s ? 0 : t + 1;
25
+ o = t === s ? 0 : t + 1;
25
26
  break;
26
27
  case "ArrowLeft":
27
- l = t === 0 ? s : t - 1;
28
+ o = t === 0 ? s : t - 1;
28
29
  break;
29
30
  case "Home":
30
- l = 0;
31
+ o = 0;
31
32
  break;
32
33
  case "End":
33
- l = s;
34
+ o = s;
34
35
  break;
35
36
  }
36
37
  e.preventDefault();
37
- const d = r[l];
38
- p.current[d.id]?.focus(), d.id !== i && o(d.id);
38
+ const d = r[o];
39
+ p.current[d.id]?.focus(), d.id !== i && l(d.id);
39
40
  },
40
- [n, i, o]
41
+ [n, i, l]
41
42
  );
42
43
  return /* @__PURE__ */ u(
43
44
  "div",
44
45
  {
45
46
  role: "tablist",
46
47
  "aria-label": x,
47
- onKeyDown: h,
48
- className: f("flex justify-start gap-1", m),
48
+ onKeyDown: k,
49
+ className: f(
50
+ m.tabs,
51
+ "flex justify-start gap-1",
52
+ b
53
+ ),
49
54
  children: n.map((e) => {
50
55
  const r = i === e.id, t = !!e.disabled;
51
- return /* @__PURE__ */ k(
56
+ return /* @__PURE__ */ g(
52
57
  "button",
53
58
  {
54
59
  ref: (s) => {
@@ -58,16 +63,17 @@ const A = ["ArrowRight", "ArrowLeft", "Home", "End"], R = ({
58
63
  role: "tab",
59
64
  "aria-selected": r,
60
65
  disabled: t,
61
- tabIndex: e.id === y ? 0 : -1,
62
- onClick: () => o(e.id),
66
+ tabIndex: e.id === h ? 0 : -1,
67
+ onClick: () => l(e.id),
63
68
  className: f(
69
+ m.tab,
64
70
  "dial-small-paragraph-semi-text dial-kit-enhanced-target",
65
71
  "border-b-2 border-transparent flex items-center gap-2 px-3 py-2 text-start",
66
72
  "transition-colors motion-reduce:transition-none",
67
73
  "focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus",
68
74
  t && "cursor-not-allowed border-control-disable-primary text-control-disable-primary",
69
75
  !t && (r ? "dial-kit-tab-selected-underline text-primary" : "border-transparent text-secondary"),
70
- b
76
+ y
71
77
  ),
72
78
  children: [
73
79
  /* @__PURE__ */ u("span", { children: e.label }),
@@ -1,64 +1,66 @@
1
- import { jsxs as C, jsx as r } from "react/jsx-runtime";
2
- import { IconX as S } from "@tabler/icons-react";
3
- import { DIAL_KIT_ICON_STROKE as y } from "../constants/icon.js";
4
- import { DIAL_ICON_SIZE as D } from "../../../constants/icon.js";
5
- import { ElementSize as T } from "../../../types/size.js";
1
+ import { jsxs as x, jsx as r } from "react/jsx-runtime";
2
+ import { IconX as C } from "@tabler/icons-react";
3
+ import { DIAL_KIT_ICON_STROKE as _ } from "../constants/icon.js";
4
+ import { DIAL_ICON_SIZE as y } from "../../../constants/icon.js";
5
+ import { ElementSize as D } from "../../../types/size.js";
6
6
  import { TagAppearance as d } from "../../../types/tag.js";
7
- import { mergeClasses as _ } from "../../../utils/merge-classes.js";
8
- import { GhostIconButton as w } from "../IconButton/IconButtonWrappers.js";
9
- import { tagInteractiveClassName as z, tagHoverClassName as E, tagStateClassNames as K, tagBaseClassName as O } from "./constants.js";
10
- const H = ({
7
+ import { mergeClasses as T } from "../../../utils/merge-classes.js";
8
+ import { GhostIconButton as A } from "../IconButton/IconButtonWrappers.js";
9
+ import { tagInteractiveClassName as K, tagHoverClassName as L, tagStateClassNames as w, tagBaseClassName as z } from "./constants.js";
10
+ import { DIAL_KIT_CLASS as E } from "../../../constants/public-class-names.js";
11
+ const X = ({
11
12
  label: o,
12
- icon: l,
13
- appearance: n = d.Outlined,
14
- selected: s = !1,
13
+ icon: m,
14
+ appearance: l = d.Outlined,
15
+ selected: i = !1,
15
16
  disabled: t = !1,
16
17
  closable: p = !1,
17
18
  removeLabel: u,
18
- className: h,
19
- title: I,
20
- onClick: m,
19
+ className: I,
20
+ title: g,
21
+ onClick: n,
21
22
  onRemove: c,
22
- onKeyDown: g,
23
- ...i
23
+ onKeyDown: h,
24
+ ...s
24
25
  }) => {
25
- const f = n === d.Selectable, a = !!m && !t, N = p && !!c && !t, k = f && s, x = (e) => {
26
- g?.(e), !(!a || e.defaultPrevented) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
26
+ const f = l === d.Selectable, a = !!n && !t, N = p && !!c && !t, S = f && i, k = (e) => {
27
+ h?.(e), !(!a || e.defaultPrevented) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
27
28
  };
28
- return /* @__PURE__ */ C(
29
+ return /* @__PURE__ */ x(
29
30
  "span",
30
31
  {
31
- ...i,
32
- role: a ? "button" : i.role,
33
- tabIndex: a ? 0 : i.tabIndex,
32
+ ...s,
33
+ role: a ? "button" : s.role,
34
+ tabIndex: a ? 0 : s.tabIndex,
34
35
  "aria-disabled": t || void 0,
35
- "aria-pressed": f && a ? s : void 0,
36
- onClick: t ? void 0 : m,
37
- onKeyDown: x,
38
- className: _(
39
- O,
40
- k ? "dial-tiny-semi-text" : "dial-tiny-text",
41
- K[n][s ? "selected" : "default"],
36
+ "aria-pressed": f && a ? i : void 0,
37
+ onClick: t ? void 0 : n,
38
+ onKeyDown: k,
39
+ className: T(
40
+ E.tag,
41
+ z,
42
+ S ? "dial-tiny-semi-text" : "dial-tiny-text",
43
+ w[l][i ? "selected" : "default"],
42
44
  // The design defines no disabled tag, so a disabled one keeps its
43
45
  // colours and only stops responding.
44
46
  t && "cursor-not-allowed",
45
- a && [z, E],
46
- h
47
+ a && [K, L],
48
+ I
47
49
  ),
48
50
  children: [
49
- l && /* @__PURE__ */ r("span", { className: "flex shrink-0 items-center", "aria-hidden": "true", children: l }),
50
- /* @__PURE__ */ r("span", { className: "truncate", title: I ?? o, children: o }),
51
+ m && /* @__PURE__ */ r("span", { className: "flex shrink-0 items-center", "aria-hidden": "true", children: m }),
52
+ /* @__PURE__ */ r("span", { className: "truncate", title: g ?? o, children: o }),
51
53
  N && /* @__PURE__ */ r(
52
- w,
54
+ A,
53
55
  {
54
56
  className: "size-[16px] shrink-0 dial-kit-minimum-target",
55
- size: T.Small,
57
+ size: D.Small,
56
58
  "aria-label": u ?? `Remove ${o}`,
57
59
  icon: /* @__PURE__ */ r(
58
- S,
60
+ C,
59
61
  {
60
- size: D.SM,
61
- stroke: y,
62
+ size: y.SM,
63
+ stroke: _,
62
64
  "aria-hidden": "true"
63
65
  }
64
66
  ),
@@ -72,5 +74,5 @@ const H = ({
72
74
  );
73
75
  };
74
76
  export {
75
- H as Tag
77
+ X as Tag
76
78
  };
@@ -1,48 +1,49 @@
1
1
  import { jsxs as D, jsx as a } from "react/jsx-runtime";
2
- import { useId as oe, useRef as R, useState as T, useCallback as v, useEffect as ae } from "react";
3
- import { ElementSize as L } from "../../../types/size.js";
2
+ import { useId as oe, useRef as T, useState as I, useCallback as R, useEffect as ae } from "react";
3
+ import { ElementSize as V } from "../../../types/size.js";
4
4
  import { mergeClasses as c } from "../../../utils/merge-classes.js";
5
5
  import { Input as le } from "../Input/Input.js";
6
6
  import { Tag as d } from "../Tag/Tag.js";
7
7
  import { getVisibleTagCount as ce } from "./utils.js";
8
- const me = 4, pe = 24, P = (r) => parseFloat(r) || 0, ue = (r) => {
8
+ import { DIAL_KIT_CLASS as me } from "../../../constants/public-class-names.js";
9
+ const pe = 4, ue = 24, A = (r) => parseFloat(r) || 0, fe = (r) => {
9
10
  let o = r.length;
10
11
  for (; o > 0 && r[o - 1] === ","; ) o--;
11
12
  return r.slice(0, o);
12
- }, fe = () => {
13
- }, Te = ({
13
+ }, de = () => {
14
+ }, ve = ({
14
15
  id: r,
15
16
  value: o,
16
- defaultValue: y,
17
- size: N = L.Standard,
18
- labelProps: j,
19
- placeholder: A,
17
+ defaultValue: P,
18
+ size: v = V.Standard,
19
+ labelProps: y,
20
+ placeholder: j,
20
21
  caption: B,
21
- error: M,
22
- invalid: G,
22
+ error: K,
23
+ invalid: M,
23
24
  disabled: m = !1,
24
25
  readOnly: p = !1,
25
26
  collapseTagOverflow: s = !1,
26
- ariaLabel: K,
27
+ ariaLabel: G,
27
28
  tagListLabel: U = "Tags",
28
29
  className: X,
29
30
  fieldClassName: $,
30
31
  tagClassName: u,
31
- onChange: I
32
+ onChange: N
32
33
  }) => {
33
- const z = oe(), F = r || z, q = N === L.Small, h = R(null), S = R([]), k = R(null), g = o !== void 0, [H, J] = T(
34
- y ?? []
35
- ), n = g ? o : H, i = n.length, [f, E] = T(""), [W, b] = T(i), l = !p && !m, w = v(
34
+ const z = oe(), F = r || z, q = v === V.Small, h = T(null), S = T([]), _ = T(null), g = o !== void 0, [H, J] = I(
35
+ P ?? []
36
+ ), n = g ? o : H, i = n.length, [f, k] = I(""), [E, b] = I(i), l = !p && !m, w = R(
36
37
  (e) => {
37
- g || J(e), I?.(e);
38
+ g || J(e), N?.(e);
38
39
  },
39
- [g, I]
40
- ), Q = v(
40
+ [g, N]
41
+ ), Q = R(
41
42
  (e) => (t) => {
42
43
  S.current[e] = t;
43
44
  },
44
45
  []
45
- ), x = v(() => {
46
+ ), x = R(() => {
46
47
  const e = h.current;
47
48
  if (!e || e.clientWidth === 0) {
48
49
  b(n.length);
@@ -51,12 +52,12 @@ const me = 4, pe = 24, P = (r) => parseFloat(r) || 0, ue = (r) => {
51
52
  const { paddingLeft: t, paddingRight: ie } = getComputedStyle(e);
52
53
  b(
53
54
  ce({
54
- availableWidth: e.clientWidth - P(t) - P(ie) - (p ? 0 : pe),
55
+ availableWidth: e.clientWidth - A(t) - A(ie) - (p ? 0 : ue),
55
56
  tagWidths: n.map(
56
- (de, re) => S.current[re]?.offsetWidth ?? 0
57
+ (he, re) => S.current[re]?.offsetWidth ?? 0
57
58
  ),
58
- overflowChipWidth: k.current?.offsetWidth ?? 0,
59
- gap: me
59
+ overflowChipWidth: _.current?.offsetWidth ?? 0,
60
+ gap: pe
60
61
  })
61
62
  );
62
63
  }, [p, n]);
@@ -76,23 +77,23 @@ const me = 4, pe = 24, P = (r) => parseFloat(r) || 0, ue = (r) => {
76
77
  s ? "shrink-0" : "min-w-0",
77
78
  u
78
79
  ), Z = (e) => {
79
- const t = ue(e.trim()).trim();
80
+ const t = fe(e.trim()).trim();
80
81
  !t || n.includes(t) || w([...n, t]);
81
82
  }, O = (e) => {
82
83
  w(n.filter((t) => t !== e));
83
- }, V = () => {
84
- Z(f), E("");
84
+ }, L = () => {
85
+ Z(f), k("");
85
86
  }, ee = (e) => {
86
87
  if (l) {
87
88
  if (e.key === "Enter" || e.key === ",") {
88
- e.preventDefault(), V();
89
+ e.preventDefault(), L();
89
90
  return;
90
91
  }
91
92
  e.key === "Backspace" && !f && i > 0 && (e.preventDefault(), w(n.slice(0, -1)));
92
93
  }
93
94
  }, te = () => {
94
- l && f.trim() && V();
95
- }, ne = s ? n.slice(0, W) : n, C = s ? n.slice(W) : [], _ = C.join(", "), se = i > 0 && /* @__PURE__ */ D(
95
+ l && f.trim() && L();
96
+ }, ne = s ? n.slice(0, E) : n, C = s ? n.slice(E) : [], W = C.join(", "), se = i > 0 && /* @__PURE__ */ D(
96
97
  "span",
97
98
  {
98
99
  role: "list",
@@ -119,8 +120,8 @@ const me = 4, pe = 24, P = (r) => parseFloat(r) || 0, ue = (r) => {
119
120
  {
120
121
  role: "listitem",
121
122
  label: `+${C.length}`,
122
- "aria-label": _,
123
- title: _,
123
+ "aria-label": W,
124
+ title: W,
124
125
  className: c("shrink-0", u),
125
126
  disabled: m
126
127
  }
@@ -143,13 +144,13 @@ const me = 4, pe = 24, P = (r) => parseFloat(r) || 0, ue = (r) => {
143
144
  className: u,
144
145
  disabled: m,
145
146
  closable: l,
146
- onRemove: l ? fe : void 0
147
+ onRemove: l ? de : void 0
147
148
  }
148
149
  )
149
150
  },
150
151
  e
151
152
  )),
152
- /* @__PURE__ */ a("span", { ref: k, className: "inline-flex", children: /* @__PURE__ */ a(d, { label: `+${i}`, className: u }) })
153
+ /* @__PURE__ */ a("span", { ref: _, className: "inline-flex", children: /* @__PURE__ */ a(d, { label: `+${i}`, className: u }) })
153
154
  ]
154
155
  }
155
156
  )
@@ -160,22 +161,23 @@ const me = 4, pe = 24, P = (r) => parseFloat(r) || 0, ue = (r) => {
160
161
  le,
161
162
  {
162
163
  id: F,
163
- size: N,
164
- labelProps: j,
164
+ size: v,
165
+ labelProps: y,
165
166
  caption: B,
166
- error: M,
167
- invalid: G,
167
+ error: K,
168
+ invalid: M,
168
169
  disabled: m,
169
170
  readOnly: p,
170
171
  value: f,
171
- placeholder: i > 0 ? void 0 : A,
172
- "aria-label": K,
172
+ placeholder: i > 0 ? void 0 : j,
173
+ "aria-label": G,
173
174
  wrapperRef: h,
174
- onChange: (e) => E(e ?? ""),
175
+ onChange: (e) => k(e ?? ""),
175
176
  onKeyDown: ee,
176
177
  onBlur: te,
177
178
  containerClassName: c("w-full", X),
178
179
  wrapperClassName: c(
180
+ me.tagInput,
179
181
  i > 0 && [
180
182
  "!h-auto",
181
183
  q ? "min-h-[24px] py-0.5" : "min-h-[40px] py-1.5",
@@ -193,5 +195,5 @@ const me = 4, pe = 24, P = (r) => parseFloat(r) || 0, ue = (r) => {
193
195
  );
194
196
  };
195
197
  export {
196
- Te as TagInput
198
+ ve as TagInput
197
199
  };
@@ -1,54 +1,56 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { useCallback as f } from "react";
3
- import { ButtonAppearance as b, ButtonVariant as B } from "../../../types/button.js";
3
+ import { ButtonAppearance as B, ButtonVariant as b } from "../../../types/button.js";
4
4
  import { ElementSize as C } from "../../../types/size.js";
5
- import { mergeClasses as h } from "../../../utils/merge-classes.js";
6
- import { resolveAccessibleName as v } from "../../../utils/accessible-name.js";
7
- import { IconButton as x } from "../IconButton/IconButton.js";
8
- import { Tooltip as g } from "../Tooltip/Tooltip.js";
9
- const E = ({
10
- icon: o,
5
+ import { mergeClasses as I } from "../../../utils/merge-classes.js";
6
+ import { resolveAccessibleName as g } from "../../../utils/accessible-name.js";
7
+ import { IconButton as A } from "../IconButton/IconButton.js";
8
+ import { Tooltip as h } from "../Tooltip/Tooltip.js";
9
+ import { DIAL_KIT_CLASS as v } from "../../../constants/public-class-names.js";
10
+ const y = ({
11
+ icon: t,
11
12
  selectedIcon: l,
12
- isSelected: r = !1,
13
- onToggle: t,
13
+ isSelected: o = !1,
14
+ onToggle: a,
14
15
  onClick: m,
15
- tooltipProps: a,
16
+ tooltipProps: r,
16
17
  size: s = C.Small,
17
18
  className: c,
18
19
  ...n
19
20
  }) => {
20
21
  const p = f(
21
22
  (u) => {
22
- m?.(u), t?.(!r);
23
+ m?.(u), a?.(!o);
23
24
  },
24
- [m, t, r]
25
+ [m, a, o]
25
26
  ), e = /* @__PURE__ */ i(
26
- x,
27
+ A,
27
28
  {
28
29
  ...n,
29
30
  size: s,
30
- variant: B.Primary,
31
- appearance: b.Ghost,
32
- icon: r ? l ?? o : o,
33
- "aria-pressed": r,
34
- "aria-label": v(
31
+ variant: b.Primary,
32
+ appearance: B.Ghost,
33
+ icon: o ? l ?? t : t,
34
+ "aria-pressed": o,
35
+ "aria-label": g(
35
36
  n["aria-label"],
36
- a?.tooltip
37
+ r?.tooltip
37
38
  ),
38
39
  onClick: p,
39
- className: h(
40
+ className: I(
41
+ v.toggleIconButton,
40
42
  "!rounded",
41
43
  // The glyph stays 16px at every size tier — only the tint square grows.
42
44
  // CSS outranks the width/height attributes Tabler renders, so callers
43
45
  // need not pass a size and the two icons can never disagree.
44
46
  "[&_svg]:size-4",
45
- r && "!text-accent",
47
+ o && "!text-accent",
46
48
  c
47
49
  )
48
50
  }
49
51
  );
50
- return a ? /* @__PURE__ */ i(g, { asChild: !0, ...a, children: e }) : e;
52
+ return r ? /* @__PURE__ */ i(h, { asChild: !0, ...r, children: e }) : e;
51
53
  };
52
54
  export {
53
- E as ToggleIconButton
55
+ y as ToggleIconButton
54
56
  };
@@ -1,20 +1,21 @@
1
- import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
- import { useMergeRefs as i, FloatingPortal as c, FloatingArrow as p } from "@floating-ui/react";
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import { useMergeRefs as i, FloatingPortal as p, FloatingArrow as c } from "@floating-ui/react";
3
3
  import f from "classnames";
4
4
  import { useRef as g } from "react";
5
5
  import { useThemeScope as u } from "../ThemeScope/ThemeScope.js";
6
6
  import { useHasHover as x } from "../../../hooks/use-has-hover.js";
7
7
  import { arrowClassName as d, tooltipClassName as h } from "./constants.js";
8
8
  import { useTooltipContext as N } from "./TooltipContext.js";
9
- const T = ({
9
+ import { DIAL_KIT_CLASS as C } from "../../../constants/public-class-names.js";
10
+ const j = ({
10
11
  style: r,
11
12
  ...t
12
13
  }) => {
13
- const o = N(), s = x(), l = u(), a = g(null), n = i([o.refs.setFloating, a]);
14
- return !o.open || !s ? null : /* @__PURE__ */ e(c, { id: "tooltip-portal", children: /* @__PURE__ */ m(
14
+ const o = N(), s = x(), l = u(), a = g(null), m = i([o.refs.setFloating, a]);
15
+ return !o.open || !s ? null : /* @__PURE__ */ e(p, { id: "tooltip-portal", children: /* @__PURE__ */ n(
15
16
  "div",
16
17
  {
17
- ref: n,
18
+ ref: m,
18
19
  "data-placement": o.placement,
19
20
  style: {
20
21
  ...o.floatingStyles,
@@ -22,6 +23,7 @@ const T = ({
22
23
  },
23
24
  ...o.getFloatingProps(t),
24
25
  className: f(
26
+ C.tooltip,
25
27
  h,
26
28
  l,
27
29
  o.getFloatingProps(t).className
@@ -29,7 +31,7 @@ const T = ({
29
31
  children: [
30
32
  t.children,
31
33
  /* @__PURE__ */ e(
32
- p,
34
+ c,
33
35
  {
34
36
  ref: o.arrowRef,
35
37
  context: o.context,
@@ -41,5 +43,5 @@ const T = ({
41
43
  ) });
42
44
  };
43
45
  export {
44
- T as TooltipContent
46
+ j as TooltipContent
45
47
  };
@@ -1,58 +1,70 @@
1
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import { useId as w } from "react";
3
- import { Label as y } from "../New/Label/Label.js";
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
4
  import { ElementSize as f } from "../../types/size.js";
5
- import { resolveAccessibleName as I } from "../../utils/accessible-name.js";
6
- import { mergeClasses as M } from "../../utils/merge-classes.js";
7
- const A = ({
8
- value: o,
9
- max: s = 100,
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,
10
+ max: l = 100,
10
11
  size: u = f.Standard,
11
12
  labelProps: e,
12
- valueLabel: i,
13
- id: h,
14
- className: b,
15
- "aria-label": p,
16
- ...g
13
+ valueLabel: r,
14
+ id: b,
15
+ className: g,
16
+ "aria-label": x,
17
+ ...v
17
18
  }) => {
18
- const x = w(), t = h ?? x, l = !!e?.label, n = l ? e?.id ?? `${t}-label` : void 0, a = s > 0 ? s : 0, v = Number.isFinite(o) ? o : 0, d = Math.min(Math.max(v, 0), a), N = a > 0 ? d / a * 100 : 0, c = /* @__PURE__ */ r(
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(
19
20
  "div",
20
21
  {
21
- ...g,
22
+ ...v,
22
23
  id: t,
23
24
  role: "progressbar",
24
25
  "aria-valuenow": d,
25
26
  "aria-valuemin": 0,
26
- "aria-valuemax": a,
27
+ "aria-valuemax": o,
27
28
  "aria-labelledby": n,
28
- "aria-label": I(
29
- p,
30
- l ? void 0 : "Progress"
29
+ "aria-label": B(
30
+ x,
31
+ a ? void 0 : "Progress"
31
32
  ),
32
- className: M(
33
+ className: h(
34
+ /* The track is the component's root when there is no label and no
35
+ readout to wrap it, and the public class belongs on whichever
36
+ element that is. */
37
+ !a && !r && p.progressBar,
33
38
  "w-full overflow-hidden rounded-full bg-control-disable-primary",
34
39
  u === f.Small ? "h-1" : "h-2",
35
- b
40
+ g
36
41
  ),
37
- children: /* @__PURE__ */ r(
42
+ children: /* @__PURE__ */ i(
38
43
  "div",
39
44
  {
40
- style: { width: `${N}%` },
45
+ style: { width: `${I}%` },
41
46
  className: "h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"
42
47
  }
43
48
  )
44
49
  }
45
50
  );
46
- return !l && !i ? c : /* @__PURE__ */ m("div", { className: "flex w-full flex-col gap-1", children: [
47
- /* @__PURE__ */ m("div", { className: "flex items-baseline gap-2", children: [
48
- e && /* @__PURE__ */ r(y, { ...e, id: n }),
49
- i && // `ml-auto` rather than `justify-between` so the readout still sits
50
- // at the end when there is no label beside it.
51
- /* @__PURE__ */ r("span", { className: "dial-tiny-text text-secondary ml-auto shrink-0", children: i })
52
- ] }),
53
- c
54
- ] });
51
+ return !a && !r ? m : /* @__PURE__ */ c(
52
+ "div",
53
+ {
54
+ className: h(
55
+ p.progressBar,
56
+ "flex w-full flex-col gap-1"
57
+ ),
58
+ 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 })
62
+ ] }),
63
+ m
64
+ ]
65
+ }
66
+ );
55
67
  };
56
68
  export {
57
- A as ProgressBar
69
+ z as ProgressBar
58
70
  };