@epam/ai-dial-ui-kit 0.15.0-dev.23 → 0.15.0-dev.27

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 (27) hide show
  1. package/dist/CHANGELOG.md +7 -0
  2. package/dist/DateCellRenderer-BZ8vGglE.cjs +1 -0
  3. package/dist/components/FileManager/FileManager.js +373 -372
  4. package/dist/components/FileManager/FileManagerProvider.js +266 -264
  5. package/dist/components/FileManager/hooks/use-grid-context-menu.js +59 -59
  6. package/dist/components/New/Button/Button.js +32 -32
  7. package/dist/components/New/Button/utils.js +18 -8
  8. package/dist/components/New/IconButton/IconButton.js +30 -28
  9. package/dist/components/New/InlineSelect/InlineSelect.js +78 -66
  10. package/dist/components/SchemaRenderer/components/SchemaField.js +19 -19
  11. package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +18 -18
  12. package/dist/components/SchemaRenderer/utils.js +21 -19
  13. package/dist/components-manifest.json +29 -3
  14. package/dist/dial-ui-kit.cjs +2 -2
  15. package/dist/file-manager.cjs +1 -1
  16. package/dist/grid.cjs +1 -1
  17. package/dist/index.css +2 -2
  18. package/dist/src/components/FileManager/FileManager.d.ts +2 -0
  19. package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
  20. package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
  21. package/dist/src/components/New/Button/Button.d.ts +4 -1
  22. package/dist/src/components/New/Button/utils.d.ts +15 -0
  23. package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +8 -0
  24. package/dist/src/components/SchemaRenderer/utils.d.ts +5 -0
  25. package/dist/{use-file-manager-tabs-4s-dbnmu.cjs → use-file-manager-tabs-LWyTVrbO.cjs} +2 -2
  26. package/package.json +1 -1
  27. package/dist/DateCellRenderer-CkFOYZGc.cjs +0 -1
@@ -1,24 +1,24 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import { useMemo as F } from "react";
3
- import { DialFileNodeType as r, DialFilePermission as U } from "../../../models/file.js";
3
+ import { DialFileNodeType as i, DialFilePermission as X } from "../../../models/file.js";
4
4
  import { DialFileManagerActions as e } from "../../../types/file-manager.js";
5
- import { IconExternalLink as A, IconCopy as X, IconDownload as _, IconEye as j, IconTrashX as W, IconPencilMinus as $, IconInfoCircle as q, IconUserX as B } from "@tabler/icons-react";
6
- import H from "../../../assets/icons/copy-to.svg.js";
7
- import J from "../../../assets/icons/move-to.svg.js";
8
- import K from "../../../assets/icons/unshare.svg.js";
9
- import Q from "../../../assets/icons/add-child.svg.js";
10
- import V from "../../../assets/icons/add-sibling.svg.js";
5
+ import { IconExternalLink as O, IconCopy as _, IconDownload as j, IconEye as W, IconTrashX as $, IconPencilMinus as q, IconInfoCircle as B, IconUserX as H } from "@tabler/icons-react";
6
+ import J from "../../../assets/icons/copy-to.svg.js";
7
+ import K from "../../../assets/icons/move-to.svg.js";
8
+ import Q from "../../../assets/icons/unshare.svg.js";
9
+ import V from "../../../assets/icons/add-child.svg.js";
10
+ import Y from "../../../assets/icons/add-sibling.svg.js";
11
11
  import { BASE_ICON_PROPS as n } from "../../../constants/icon.js";
12
- import { DropdownItemType as Y } from "../../../types/dropdown.js";
13
- import { cleanForbiddenSymbolsRegExp as Z } from "../utils.js";
14
- const de = ({
12
+ import { DropdownItemType as Z } from "../../../types/dropdown.js";
13
+ import { cleanForbiddenSymbolsRegExp as G } from "../utils.js";
14
+ const ye = ({
15
15
  actionLabels: s,
16
16
  onDuplicate: u,
17
17
  onCopy: a,
18
18
  onMove: k,
19
19
  onDownload: l,
20
- onRename: C,
21
- onDelete: T,
20
+ onRename: T,
21
+ onDelete: C,
22
22
  onInfo: I,
23
23
  onUnshare: x,
24
24
  onRemoveAccess: c,
@@ -31,62 +31,61 @@ const de = ({
31
31
  isRenameFileAvailable: v = !0,
32
32
  isDuplicateFolderAvailable: E = !0,
33
33
  forbiddenSymbolsRegExp: z,
34
- onGridCreateSiblingFolder: w,
35
- onGridCreateChildFolder: M
34
+ skipForbiddenSymbolsCheckForActions: w,
35
+ onGridCreateSiblingFolder: M,
36
+ onGridCreateChildFolder: R
36
37
  }) => F(() => (o) => {
37
38
  const t = [];
38
39
  if (!s)
39
40
  return t;
40
- const p = Z(
41
- z
42
- )?.test(o.name);
43
- s[e.AddSibling] && o.nodeType === r.FOLDER && t.push({
41
+ const p = !w && G(z)?.test(o.name);
42
+ s[e.AddSibling] && o.nodeType === i.FOLDER && t.push({
44
43
  key: "addSibling",
45
44
  label: s[e.AddSibling],
46
- icon: /* @__PURE__ */ i(
47
- V,
45
+ icon: /* @__PURE__ */ r(
46
+ Y,
48
47
  {
49
48
  width: n.size,
50
49
  height: n.size,
51
50
  className: "text-secondary"
52
51
  }
53
52
  ),
54
- onClick: () => w([o])
55
- }), s[e.AddChild] && o.nodeType === r.FOLDER && !p && t.push(
53
+ onClick: () => M([o])
54
+ }), s[e.AddChild] && o.nodeType === i.FOLDER && !p && t.push(
56
55
  {
57
56
  key: "addChild",
58
57
  label: s[e.AddChild],
59
- icon: /* @__PURE__ */ i(
60
- Q,
58
+ icon: /* @__PURE__ */ r(
59
+ V,
61
60
  {
62
61
  width: n.size,
63
62
  height: n.size,
64
63
  className: "text-secondary"
65
64
  }
66
65
  ),
67
- onClick: () => M([o])
66
+ onClick: () => R([o])
68
67
  },
69
68
  {
70
69
  key: "divider",
71
- type: Y.Divider
70
+ type: Z.Divider
72
71
  }
73
- ), s[e.OpenInNewTab] && typeof y == "function" && o.nodeType === r.ITEM && !p && t.push({
72
+ ), s[e.OpenInNewTab] && typeof y == "function" && o.nodeType === i.ITEM && !p && t.push({
74
73
  key: e.OpenInNewTab,
75
74
  label: s[e.OpenInNewTab],
76
- icon: /* @__PURE__ */ i(A, { ...n, className: "text-secondary" }),
75
+ icon: /* @__PURE__ */ r(O, { ...n, className: "text-secondary" }),
77
76
  onClick: () => y?.(o)
78
77
  });
79
- const O = o.nodeType === r.ITEM || o.nodeType === r.FOLDER && E;
80
- s[e.Duplicate] && O && !p && t.push({
78
+ const P = o.nodeType === i.ITEM || o.nodeType === i.FOLDER && E;
79
+ s[e.Duplicate] && P && !p && t.push({
81
80
  key: e.Duplicate,
82
81
  label: s[e.Duplicate],
83
- icon: /* @__PURE__ */ i(X, { ...n, className: "text-secondary" }),
82
+ icon: /* @__PURE__ */ r(_, { ...n, className: "text-secondary" }),
84
83
  onClick: () => u(o)
85
84
  }), s[e.Copy] && !p && t.push({
86
85
  key: e.Copy,
87
86
  label: s[e.Copy],
88
- icon: /* @__PURE__ */ i(
89
- H,
87
+ icon: /* @__PURE__ */ r(
88
+ J,
90
89
  {
91
90
  width: n.size,
92
91
  height: n.size,
@@ -97,8 +96,8 @@ const de = ({
97
96
  }), s[e.Move] && !p && t.push({
98
97
  key: e.Move,
99
98
  label: s[e.Move],
100
- icon: /* @__PURE__ */ i(
101
- J,
99
+ icon: /* @__PURE__ */ r(
100
+ K,
102
101
  {
103
102
  width: n.size,
104
103
  height: n.size,
@@ -109,44 +108,44 @@ const de = ({
109
108
  }), s[e.Download] && !p && t.push({
110
109
  key: e.Download,
111
110
  label: s[e.Download],
112
- icon: /* @__PURE__ */ i(_, { ...n, className: "text-secondary" }),
111
+ icon: /* @__PURE__ */ r(j, { ...n, className: "text-secondary" }),
113
112
  onClick: () => l(o)
114
- }), s[e.ManagePermissions] && typeof m == "function" && o.nodeType === r.FOLDER && !p && t.push({
113
+ }), s[e.ManagePermissions] && typeof m == "function" && o.nodeType === i.FOLDER && !p && t.push({
115
114
  key: e.ManagePermissions,
116
115
  label: s[e.ManagePermissions],
117
- icon: /* @__PURE__ */ i(A, { ...n, className: "text-secondary" }),
116
+ icon: /* @__PURE__ */ r(O, { ...n, className: "text-secondary" }),
118
117
  onClick: () => m?.(o.path)
119
118
  });
120
- const h = o.name.split("."), R = h.length > 1 ? h[h.length - 1] : "", P = R && D?.includes(`.${R}`);
121
- s[e.Preview] && typeof d == "function" && o.nodeType === r.ITEM && P && !p && t.push({
119
+ const h = o.name.split("."), S = h.length > 1 ? h[h.length - 1] : "", f = S && D?.includes(`.${S}`);
120
+ s[e.Preview] && typeof d == "function" && o.nodeType === i.ITEM && f && !p && t.push({
122
121
  key: e.Preview,
123
122
  label: s[e.Preview],
124
- icon: /* @__PURE__ */ i(j, { ...n, className: "text-secondary" }),
123
+ icon: /* @__PURE__ */ r(W, { ...n, className: "text-secondary" }),
125
124
  onClick: () => d?.(o.path)
126
125
  });
127
- const S = !o.permissions || o.permissions.includes(U.WRITE);
128
- s[e.Delete] && S && t.push({
126
+ const A = !o.permissions || o.permissions.includes(X.WRITE);
127
+ s[e.Delete] && A && t.push({
129
128
  key: e.Delete,
130
129
  label: s[e.Delete],
131
- icon: /* @__PURE__ */ i(W, { ...n, className: "text-secondary" }),
132
- onClick: () => T(o, o.parentPath ?? "")
130
+ icon: /* @__PURE__ */ r($, { ...n, className: "text-secondary" }),
131
+ onClick: () => C(o, o.parentPath ?? "")
133
132
  });
134
- const f = o.nodeType === r.FOLDER || o.nodeType === r.ITEM && v;
135
- return s[e.Rename] && f && S && t.push({
133
+ const U = o.nodeType === i.FOLDER || o.nodeType === i.ITEM && v;
134
+ return s[e.Rename] && U && A && t.push({
136
135
  key: e.Rename,
137
136
  label: s[e.Rename],
138
- icon: /* @__PURE__ */ i($, { ...n, className: "text-secondary" }),
139
- onClick: () => C(o.path)
140
- }), s[e.Info] && o.nodeType === r.ITEM && !p && t.push({
137
+ icon: /* @__PURE__ */ r(q, { ...n, className: "text-secondary" }),
138
+ onClick: () => T(o.path)
139
+ }), s[e.Info] && o.nodeType === i.ITEM && !p && t.push({
141
140
  key: e.Info,
142
141
  label: s[e.Info],
143
- icon: /* @__PURE__ */ i(q, { ...n, className: "text-secondary" }),
142
+ icon: /* @__PURE__ */ r(B, { ...n, className: "text-secondary" }),
144
143
  onClick: () => I(o)
145
144
  }), s[e.Unshare] && N?.includes(o.path) && t.push({
146
145
  key: e.Unshare,
147
146
  label: s[e.Unshare],
148
- icon: /* @__PURE__ */ i(
149
- K,
147
+ icon: /* @__PURE__ */ r(
148
+ Q,
150
149
  {
151
150
  width: n.size,
152
151
  height: n.size,
@@ -157,7 +156,7 @@ const de = ({
157
156
  }), s[e.RemoveAccess] && g?.has(o.path) && c && t.push({
158
157
  key: e.RemoveAccess,
159
158
  label: s[e.RemoveAccess],
160
- icon: /* @__PURE__ */ i(B, { size: n.size, className: "text-secondary" }),
159
+ icon: /* @__PURE__ */ r(H, { size: n.size, className: "text-secondary" }),
161
160
  onClick: () => c(o)
162
161
  }), t;
163
162
  }, [
@@ -166,8 +165,8 @@ const de = ({
166
165
  a,
167
166
  k,
168
167
  l,
169
- T,
170
168
  C,
169
+ T,
171
170
  I,
172
171
  x,
173
172
  c,
@@ -180,9 +179,10 @@ const de = ({
180
179
  v,
181
180
  E,
182
181
  z,
183
- M,
184
- w
182
+ w,
183
+ R,
184
+ M
185
185
  ]);
186
186
  export {
187
- de as useGridContextMenu
187
+ ye as useGridContextMenu
188
188
  };
@@ -1,76 +1,76 @@
1
1
  import { jsx as t, jsxs as I, Fragment as j } from "react/jsx-runtime";
2
- import { DialIcon as u } from "../../Icon/Icon.js";
3
- import { ButtonAppearance as s } from "../../../types/button.js";
2
+ import { DialIcon as f } from "../../Icon/Icon.js";
3
+ import { ButtonAppearance as c } from "../../../types/button.js";
4
4
  import { ElementSize as o } from "../../../types/size.js";
5
5
  import { mergeClasses as y } from "../../../utils/merge-classes.js";
6
6
  import { resolveAccessibleName as A } from "../../../utils/accessible-name.js";
7
- import { Tooltip as F } from "../Tooltip/Tooltip.js";
8
- import { getButtonClassNames as L } from "./utils.js";
9
- const J = ({
7
+ import { Tooltip as D } from "../Tooltip/Tooltip.js";
8
+ import { getButtonClassNames as F, getDisabledButtonProps as L } from "./utils.js";
9
+ const K = ({
10
10
  label: a,
11
- variant: c,
12
- appearance: l = s.Solid,
11
+ variant: s,
12
+ appearance: r = c.Solid,
13
13
  size: n = o.Standard,
14
14
  className: k,
15
- textClassName: S,
16
- iconAfter: g,
15
+ textClassName: g,
16
+ iconAfter: S,
17
17
  iconBefore: v,
18
- type: N = "button",
19
- tooltipProps: r,
18
+ type: C = "button",
19
+ tooltipProps: l,
20
20
  href: d,
21
- target: p,
22
- rel: C,
21
+ target: b,
22
+ rel: N,
23
23
  disabled: i,
24
24
  ...e
25
25
  }) => {
26
26
  const h = y(
27
27
  "dial-kit-base-button",
28
- c && L(c, l),
28
+ s && F(s, r),
29
29
  n === o.Small ? "dial-tiny-semi-text" : "dial-small-paragraph-semi-text",
30
30
  n === o.Small ? "h-[24px] gap-1" : "h-[40px] gap-2",
31
31
  // Corner radius is themable per size — see the radius tokens in
32
32
  // `buttons.scss`; the standard radius comes from `dial-kit-base-button`.
33
33
  n === o.Small && "dial-kit-base-button-small",
34
- l !== s.Link && (n === o.Small ? "px-2" : "px-4"),
34
+ r !== c.Link && (n === o.Small ? "px-2" : "px-4"),
35
35
  // A link-appearance button sits inline in text, where WCAG 2.5.5 exempts
36
36
  // it and an expanded target would overlap the surrounding copy.
37
- n !== o.Small && l !== s.Link && "dial-kit-enhanced-target",
37
+ n !== o.Small && r !== c.Link && "dial-kit-enhanced-target",
38
38
  k
39
- ), B = a ? void 0 : r?.tooltip, x = A(
39
+ ), B = a ? void 0 : l?.tooltip, p = A(
40
40
  typeof a == "string" ? a : void 0,
41
41
  e["aria-label"],
42
42
  B
43
- ), b = /* @__PURE__ */ I(j, { children: [
44
- /* @__PURE__ */ t(u, { icon: v }),
45
- a && /* @__PURE__ */ t("span", { className: S, children: a }),
46
- /* @__PURE__ */ t(u, { icon: g })
47
- ] }), m = e, f = d !== void 0 ? /* @__PURE__ */ t(
43
+ ), u = /* @__PURE__ */ I(j, { children: [
44
+ /* @__PURE__ */ t(f, { icon: v }),
45
+ a && /* @__PURE__ */ t("span", { className: g, children: a }),
46
+ /* @__PURE__ */ t(f, { icon: S })
47
+ ] }), m = e, x = d !== void 0 ? /* @__PURE__ */ t(
48
48
  "a",
49
49
  {
50
50
  ...m,
51
51
  href: i ? void 0 : d,
52
- target: p,
53
- rel: C ?? (p === "_blank" ? "noopener noreferrer" : void 0),
52
+ target: b,
53
+ rel: N ?? (b === "_blank" ? "noopener noreferrer" : void 0),
54
54
  "aria-disabled": i || void 0,
55
55
  tabIndex: i ? -1 : m.tabIndex,
56
56
  onClick: i ? void 0 : m.onClick,
57
57
  className: h,
58
- "aria-label": x,
59
- children: b
58
+ "aria-label": p,
59
+ children: u
60
60
  }
61
61
  ) : /* @__PURE__ */ t(
62
62
  "button",
63
63
  {
64
64
  ...e,
65
- type: N,
66
- disabled: i,
65
+ ...L(i, l, e.onClick),
66
+ type: C,
67
67
  className: h,
68
- "aria-label": x,
69
- children: b
68
+ "aria-label": p,
69
+ children: u
70
70
  }
71
71
  );
72
- return r ? /* @__PURE__ */ t(F, { asChild: !0, ...r, children: f }) : f;
72
+ return l ? /* @__PURE__ */ t(D, { asChild: !0, ...l, children: x }) : x;
73
73
  };
74
74
  export {
75
- J as Button
75
+ K as Button
76
76
  };
@@ -1,11 +1,21 @@
1
- import { ButtonVariant as o, ButtonAppearance as a } from "../../../types/button.js";
2
- import { variantClassMap as i } from "./constants.js";
3
- const l = (t = o.Primary, r = a.Solid) => {
4
- const n = i[t]?.[r];
5
- return n || (console.warn(
6
- `Could not find Button styles for variant: ${t} and appearance: ${r}. Using default primary solid button styles.`
7
- ), i[o.Primary][a.Solid]);
1
+ import { ButtonVariant as o, ButtonAppearance as r } from "../../../types/button.js";
2
+ import { variantClassMap as a } from "./constants.js";
3
+ const l = (t) => {
4
+ t.preventDefault();
5
+ }, d = (t, n, i) => {
6
+ const e = n != null && !n.hideTooltip && n.tooltip != null && n.tooltip !== "";
7
+ return t && e ? {
8
+ disabled: void 0,
9
+ "aria-disabled": !0,
10
+ onClick: l
11
+ } : { disabled: t, onClick: i };
12
+ }, c = (t = o.Primary, n = r.Solid) => {
13
+ const i = a[t]?.[n];
14
+ return i || (console.warn(
15
+ `Could not find Button styles for variant: ${t} and appearance: ${n}. Using default primary solid button styles.`
16
+ ), a[o.Primary][r.Solid]);
8
17
  };
9
18
  export {
10
- l as getButtonClassNames
19
+ c as getButtonClassNames,
20
+ d as getDisabledButtonProps
11
21
  };
@@ -1,46 +1,48 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { ButtonAppearance as b } from "../../../types/button.js";
3
- import { mergeClasses as u } from "../../../utils/merge-classes.js";
4
- import { resolveAccessibleName as p } from "../../../utils/accessible-name.js";
5
- import { ElementSize as t } from "../../../types/size.js";
6
- import { Tooltip as S } from "../Tooltip/Tooltip.js";
7
- import { getButtonClassNames as f } from "../Button/utils.js";
8
- const g = {
9
- [t.Small]: "size-[24px]",
10
- [t.Standard]: "size-[40px] dial-kit-enhanced-target",
11
- [t.Large]: "size-[48px] dial-kit-enhanced-target"
12
- }, B = ({
13
- variant: a,
14
- appearance: n = b.Solid,
15
- size: l = t.Standard,
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { ButtonAppearance as u } from "../../../types/button.js";
3
+ import { mergeClasses as S } from "../../../utils/merge-classes.js";
4
+ import { resolveAccessibleName as f } from "../../../utils/accessible-name.js";
5
+ import { ElementSize as e } from "../../../types/size.js";
6
+ import { Tooltip as g } from "../Tooltip/Tooltip.js";
7
+ import { getButtonClassNames as p, getDisabledButtonProps as C } from "../Button/utils.js";
8
+ const h = {
9
+ [e.Small]: "size-[24px]",
10
+ [e.Standard]: "size-[40px] dial-kit-enhanced-target",
11
+ [e.Large]: "size-[48px] dial-kit-enhanced-target"
12
+ }, I = ({
13
+ variant: i,
14
+ appearance: r = u.Solid,
15
+ size: l = e.Standard,
16
16
  className: m,
17
17
  icon: s,
18
- tooltipProps: e,
18
+ tooltipProps: t,
19
19
  type: c = "button",
20
- ...o
20
+ disabled: d,
21
+ ...a
21
22
  }) => {
22
- const d = u(
23
+ const b = S(
23
24
  "dial-kit-base-icon-button dial-kit-base-button",
24
- a && f(a, n),
25
+ i && p(i, r),
25
26
  // 24px is below the AAA target size, so only the larger tiers get the
26
27
  // enhanced pointer target — see the accessibility rules in AGENTS.md.
27
- g[l],
28
+ h[l],
28
29
  m
29
- ), i = /* @__PURE__ */ r(
30
+ ), n = /* @__PURE__ */ o(
30
31
  "button",
31
32
  {
32
- ...o,
33
+ ...a,
34
+ ...C(d, t, a.onClick),
33
35
  type: c,
34
- className: d,
35
- "aria-label": p(
36
- o["aria-label"],
37
- e?.tooltip
36
+ className: b,
37
+ "aria-label": f(
38
+ a["aria-label"],
39
+ t?.tooltip
38
40
  ),
39
41
  children: s
40
42
  }
41
43
  );
42
- return e ? /* @__PURE__ */ r(S, { asChild: !0, ...e, children: i }) : i;
44
+ return t ? /* @__PURE__ */ o(g, { asChild: !0, ...t, children: n }) : n;
43
45
  };
44
46
  export {
45
- B as IconButton
47
+ I as IconButton
46
48
  };
@@ -1,98 +1,110 @@
1
- import { jsx as s, jsxs as y } from "react/jsx-runtime";
2
- import { IconChevronDown as _ } from "@tabler/icons-react";
3
- import { useState as p, useMemo as D, useCallback as N } from "react";
4
- import { Dropdown as K } from "../Dropdown/Dropdown.js";
5
- import { DIAL_KIT_ICON_STROKE as O } from "../constants/icon.js";
6
- import { DIAL_ICON_SIZE as A } from "../../../constants/icon.js";
7
- import { mergeClasses as f } from "../../../utils/merge-classes.js";
8
- import { ElementSize as L } from "../../../types/size.js";
9
- import { DIAL_KIT_CLASS as T } from "../../../constants/public-class-names.js";
10
- const E = ({
1
+ import { jsx as i, jsxs as O } from "react/jsx-runtime";
2
+ import { IconChevronDown as A } from "@tabler/icons-react";
3
+ import { useState as u, useCallback as h, useMemo as L } from "react";
4
+ import { Dropdown as T } from "../Dropdown/Dropdown.js";
5
+ import { DIAL_KIT_ICON_STROKE as E } from "../constants/icon.js";
6
+ import { DIAL_ICON_SIZE as j } from "../../../constants/icon.js";
7
+ import { mergeClasses as b } from "../../../utils/merge-classes.js";
8
+ import { ElementSize as w } from "../../../types/size.js";
9
+ import { DIAL_KIT_CLASS as z } from "../../../constants/public-class-names.js";
10
+ const M = ({
11
11
  label: e,
12
- size: n,
13
- isOpen: r = !1,
14
- "aria-label": t,
15
- ...a
12
+ size: o,
13
+ isOpen: l = !1,
14
+ labelClassName: n,
15
+ className: s,
16
+ "aria-label": a,
17
+ ...c
16
18
  }) => {
17
- const l = n === L.Small ? "h-[32px]" : "h-[40px] dial-kit-enhanced-target";
18
- return /* @__PURE__ */ y(
19
+ const m = o === w.Small ? "h-[32px]" : "h-[40px] dial-kit-enhanced-target";
20
+ return /* @__PURE__ */ O(
19
21
  "button",
20
22
  {
21
23
  type: "button",
24
+ ...c,
22
25
  "aria-haspopup": "menu",
23
- "aria-expanded": r,
24
- "aria-label": t ? `${t} ${e}` : void 0,
25
- className: f(
26
+ "aria-expanded": l,
27
+ "aria-label": a ? `${a} ${e}` : void 0,
28
+ className: b(
26
29
  "dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus",
27
30
  "flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary",
28
31
  "hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",
29
- l,
30
- a.className,
31
- T.inlineSelect
32
+ m,
33
+ s,
34
+ z.inlineSelect
32
35
  ),
33
- ...a,
34
36
  children: [
35
- e,
36
- /* @__PURE__ */ s(
37
- _,
37
+ /* @__PURE__ */ i("span", { className: n, children: e }),
38
+ /* @__PURE__ */ i(
39
+ A,
38
40
  {
39
- size: A.MD,
40
- stroke: O,
41
+ size: j.MD,
42
+ stroke: E,
41
43
  "aria-hidden": !0,
42
- className: f("transition-transform", r && "rotate-180")
44
+ className: b("transition-transform", l && "rotate-180")
43
45
  }
44
46
  )
45
47
  ]
46
48
  }
47
49
  );
48
- }, B = ({
50
+ }, J = ({
49
51
  items: e,
50
- selectedKey: n,
51
- defaultSelectedKey: r,
52
- onSelect: t,
53
- size: a,
54
- disabled: l,
55
- placement: d = "bottom-end",
56
- matchReferenceWidth: u = !1,
57
- listClassName: b,
58
- ariaLabel: h
52
+ selectedKey: o,
53
+ defaultSelectedKey: l,
54
+ onSelect: n,
55
+ size: s,
56
+ disabled: a,
57
+ placement: c = "bottom-end",
58
+ matchReferenceWidth: m = !1,
59
+ listClassName: I,
60
+ ariaLabel: v,
61
+ triggerClassName: S,
62
+ triggerLabelClassName: x,
63
+ onOpenChange: d
59
64
  }) => {
60
- const [I, v] = p(!1), [S, x] = p(
61
- r ?? e[0]?.key
62
- ), c = n !== void 0, m = c ? n : S, g = D(() => {
63
- const o = e.find((i) => i.key === m);
64
- return o?.label ? String(o.label) : "";
65
- }, [e, m]), C = N(
66
- ({ key: o }) => {
67
- const i = e.find((k) => k.key === o);
68
- i && (c || x(o), t?.(i));
65
+ const [C, g] = u(!1), N = h(
66
+ (t) => {
67
+ g(t), d?.(t);
69
68
  },
70
- [e, c, t]
69
+ [d]
70
+ ), [k, y] = u(
71
+ l ?? e[0]?.key
72
+ ), p = o !== void 0, f = p ? o : k, _ = L(() => {
73
+ const t = e.find((r) => r.key === f);
74
+ return t?.label ? String(t.label) : "";
75
+ }, [e, f]), D = h(
76
+ ({ key: t }) => {
77
+ const r = e.find((K) => K.key === t);
78
+ r && (p || y(t), n?.(r));
79
+ },
80
+ [e, p, n]
71
81
  );
72
- return /* @__PURE__ */ s(
73
- K,
82
+ return /* @__PURE__ */ i(
83
+ T,
74
84
  {
75
85
  items: e,
76
- placement: d,
77
- matchReferenceWidth: u,
78
- listClassName: b,
79
- disabled: l,
80
- onOpenChange: v,
81
- onItemClick: C,
82
- children: /* @__PURE__ */ s(
83
- E,
86
+ placement: c,
87
+ matchReferenceWidth: m,
88
+ listClassName: I,
89
+ disabled: a,
90
+ onOpenChange: N,
91
+ onItemClick: D,
92
+ children: /* @__PURE__ */ i(
93
+ M,
84
94
  {
85
- label: g,
86
- size: a,
87
- isOpen: I,
88
- disabled: l,
89
- "aria-label": h
95
+ label: _,
96
+ size: s,
97
+ isOpen: C,
98
+ disabled: a,
99
+ "aria-label": v,
100
+ className: S,
101
+ labelClassName: x
90
102
  }
91
103
  )
92
104
  }
93
105
  );
94
106
  };
95
107
  export {
96
- B as InlineSelect,
97
- E as InlineSelectTrigger
108
+ J as InlineSelect,
109
+ M as InlineSelectTrigger
98
110
  };