@alixpartners/ui-components 2.4.2 → 2.4.3

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,51 +1,51 @@
1
- import { jsx as a, jsxs as h } from "react/jsx-runtime";
2
- import { c as R } from "../../clsx-OuTLNxxd.js";
3
- import z from "../Button/Button.js";
4
- import * as d from "react";
5
- import { useRef as W, useState as N, useEffect as U } from "react";
6
- import $ from "../Icon/Icon.js";
1
+ import { jsx as a, jsxs as R } from "react/jsx-runtime";
2
+ import { c as M } from "../../clsx-OuTLNxxd.js";
3
+ import W from "../Button/Button.js";
4
+ import * as p from "react";
5
+ import { useRef as U, useState as I, useEffect as $ } from "react";
6
+ import K from "../Icon/Icon.js";
7
7
  import "../Input/Input.js";
8
- import { u as K, P as H, c as M, a as j, b as F } from "../../index-DM51yNMI.js";
9
- import { R as V, A as X, P as q, C as J, I as Q, c as C, G as Y, L as Z, a as oo, b as eo, d as no, e as to, S as ro, f as ao, g as io, h as po } from "../../index-D_3jWVyV.js";
10
- import { u as I } from "../../index-7CBv-Jx6.js";
11
- import '../../assets/SplitButton.css';var v = "DropdownMenu", [so] = F(
12
- v,
8
+ import { u as j, P as H, c as v, a as F, b as V } from "../../index-DM51yNMI.js";
9
+ import { R as X, A as q, P as J, C as Q, I as Y, c as C, G as Z, L as ee, a as oe, b as ne, d as te, e as re, S as ae, f as ie, g as de, h as pe } from "../../index-D_3jWVyV.js";
10
+ import { u as y } from "../../index-7CBv-Jx6.js";
11
+ import '../../assets/SplitButton.css';var D = "DropdownMenu", [se] = V(
12
+ D,
13
13
  [C]
14
- ), s = C(), [uo, y] = so(v), x = (o) => {
14
+ ), s = C(), [ue, x] = se(D), P = (e) => {
15
15
  const {
16
16
  __scopeDropdownMenu: t,
17
- children: e,
17
+ children: o,
18
18
  dir: n,
19
19
  open: r,
20
20
  defaultOpen: i,
21
- onOpenChange: c,
22
- modal: p = !0
23
- } = o, l = s(t), _ = d.useRef(null), [w, f] = K({
21
+ onOpenChange: m,
22
+ modal: d = !0
23
+ } = e, c = s(t), _ = p.useRef(null), [w, f] = j({
24
24
  prop: r,
25
25
  defaultProp: i ?? !1,
26
- onChange: c,
27
- caller: v
26
+ onChange: m,
27
+ caller: D
28
28
  });
29
29
  return /* @__PURE__ */ a(
30
- uo,
30
+ ue,
31
31
  {
32
32
  scope: t,
33
- triggerId: I(),
33
+ triggerId: y(),
34
34
  triggerRef: _,
35
- contentId: I(),
35
+ contentId: y(),
36
36
  open: w,
37
37
  onOpenChange: f,
38
- onOpenToggle: d.useCallback(() => f((g) => !g), [f]),
39
- modal: p,
40
- children: /* @__PURE__ */ a(V, { ...l, open: w, onOpenChange: f, dir: n, modal: p, children: e })
38
+ onOpenToggle: p.useCallback(() => f((b) => !b), [f]),
39
+ modal: d,
40
+ children: /* @__PURE__ */ a(X, { ...c, open: w, onOpenChange: f, dir: n, modal: d, children: o })
41
41
  }
42
42
  );
43
43
  };
44
- x.displayName = v;
45
- var P = "DropdownMenuTrigger", E = d.forwardRef(
46
- (o, t) => {
47
- const { __scopeDropdownMenu: e, disabled: n = !1, ...r } = o, i = y(P, e), c = s(e);
48
- return /* @__PURE__ */ a(X, { asChild: !0, ...c, children: /* @__PURE__ */ a(
44
+ P.displayName = D;
45
+ var E = "DropdownMenuTrigger", A = p.forwardRef(
46
+ (e, t) => {
47
+ const { __scopeDropdownMenu: o, disabled: n = !1, ...r } = e, i = x(E, o), m = s(o);
48
+ return /* @__PURE__ */ a(q, { asChild: !0, ...m, children: /* @__PURE__ */ a(
49
49
  H.button,
50
50
  {
51
51
  type: "button",
@@ -57,44 +57,44 @@ var P = "DropdownMenuTrigger", E = d.forwardRef(
57
57
  "data-disabled": n ? "" : void 0,
58
58
  disabled: n,
59
59
  ...r,
60
- ref: j(t, i.triggerRef),
61
- onPointerDown: M(o.onPointerDown, (p) => {
62
- !n && p.button === 0 && p.ctrlKey === !1 && (i.onOpenToggle(), i.open || p.preventDefault());
60
+ ref: F(t, i.triggerRef),
61
+ onPointerDown: v(e.onPointerDown, (d) => {
62
+ !n && d.button === 0 && d.ctrlKey === !1 && (i.onOpenToggle(), i.open || d.preventDefault());
63
63
  }),
64
- onKeyDown: M(o.onKeyDown, (p) => {
65
- n || (["Enter", " "].includes(p.key) && i.onOpenToggle(), p.key === "ArrowDown" && i.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(p.key) && p.preventDefault());
64
+ onKeyDown: v(e.onKeyDown, (d) => {
65
+ n || (["Enter", " "].includes(d.key) && i.onOpenToggle(), d.key === "ArrowDown" && i.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault());
66
66
  })
67
67
  }
68
68
  ) });
69
69
  }
70
70
  );
71
- E.displayName = P;
72
- var lo = "DropdownMenuPortal", A = (o) => {
73
- const { __scopeDropdownMenu: t, ...e } = o, n = s(t);
74
- return /* @__PURE__ */ a(q, { ...n, ...e });
71
+ A.displayName = E;
72
+ var le = "DropdownMenuPortal", O = (e) => {
73
+ const { __scopeDropdownMenu: t, ...o } = e, n = s(t);
74
+ return /* @__PURE__ */ a(J, { ...n, ...o });
75
75
  };
76
- A.displayName = lo;
77
- var O = "DropdownMenuContent", B = d.forwardRef(
78
- (o, t) => {
79
- const { __scopeDropdownMenu: e, ...n } = o, r = y(O, e), i = s(e), c = d.useRef(!1);
76
+ O.displayName = le;
77
+ var B = "DropdownMenuContent", T = p.forwardRef(
78
+ (e, t) => {
79
+ const { __scopeDropdownMenu: o, ...n } = e, r = x(B, o), i = s(o), m = p.useRef(!1);
80
80
  return /* @__PURE__ */ a(
81
- J,
81
+ Q,
82
82
  {
83
83
  id: r.contentId,
84
84
  "aria-labelledby": r.triggerId,
85
85
  ...i,
86
86
  ...n,
87
87
  ref: t,
88
- onCloseAutoFocus: M(o.onCloseAutoFocus, (p) => {
89
- var l;
90
- c.current || (l = r.triggerRef.current) == null || l.focus(), c.current = !1, p.preventDefault();
88
+ onCloseAutoFocus: v(e.onCloseAutoFocus, (d) => {
89
+ var c;
90
+ m.current || (c = r.triggerRef.current) == null || c.focus(), m.current = !1, d.preventDefault();
91
91
  }),
92
- onInteractOutside: M(o.onInteractOutside, (p) => {
93
- const l = p.detail.originalEvent, _ = l.button === 0 && l.ctrlKey === !0, w = l.button === 2 || _;
94
- (!r.modal || w) && (c.current = !0);
92
+ onInteractOutside: v(e.onInteractOutside, (d) => {
93
+ const c = d.detail.originalEvent, _ = c.button === 0 && c.ctrlKey === !0, w = c.button === 2 || _;
94
+ (!r.modal || w) && (m.current = !0);
95
95
  }),
96
96
  style: {
97
- ...o.style,
97
+ ...e.style,
98
98
  "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
99
99
  "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
100
100
  "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
@@ -105,75 +105,75 @@ var O = "DropdownMenuContent", B = d.forwardRef(
105
105
  );
106
106
  }
107
107
  );
108
- B.displayName = O;
109
- var co = "DropdownMenuGroup", mo = d.forwardRef(
110
- (o, t) => {
111
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
112
- return /* @__PURE__ */ a(Y, { ...r, ...n, ref: t });
108
+ T.displayName = B;
109
+ var ce = "DropdownMenuGroup", me = p.forwardRef(
110
+ (e, t) => {
111
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
112
+ return /* @__PURE__ */ a(Z, { ...r, ...n, ref: t });
113
113
  }
114
114
  );
115
- mo.displayName = co;
116
- var _o = "DropdownMenuLabel", wo = d.forwardRef(
117
- (o, t) => {
118
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
119
- return /* @__PURE__ */ a(Z, { ...r, ...n, ref: t });
115
+ me.displayName = ce;
116
+ var _e = "DropdownMenuLabel", we = p.forwardRef(
117
+ (e, t) => {
118
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
119
+ return /* @__PURE__ */ a(ee, { ...r, ...n, ref: t });
120
120
  }
121
121
  );
122
- wo.displayName = _o;
123
- var fo = "DropdownMenuItem", T = d.forwardRef(
124
- (o, t) => {
125
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
126
- return /* @__PURE__ */ a(Q, { ...r, ...n, ref: t });
122
+ we.displayName = _e;
123
+ var fe = "DropdownMenuItem", k = p.forwardRef(
124
+ (e, t) => {
125
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
126
+ return /* @__PURE__ */ a(Y, { ...r, ...n, ref: t });
127
127
  }
128
128
  );
129
- T.displayName = fo;
130
- var go = "DropdownMenuCheckboxItem", bo = d.forwardRef((o, t) => {
131
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
132
- return /* @__PURE__ */ a(oo, { ...r, ...n, ref: t });
129
+ k.displayName = fe;
130
+ var be = "DropdownMenuCheckboxItem", ge = p.forwardRef((e, t) => {
131
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
132
+ return /* @__PURE__ */ a(oe, { ...r, ...n, ref: t });
133
133
  });
134
- bo.displayName = go;
135
- var Mo = "DropdownMenuRadioGroup", vo = d.forwardRef((o, t) => {
136
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
137
- return /* @__PURE__ */ a(eo, { ...r, ...n, ref: t });
134
+ ge.displayName = be;
135
+ var Me = "DropdownMenuRadioGroup", ve = p.forwardRef((e, t) => {
136
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
137
+ return /* @__PURE__ */ a(ne, { ...r, ...n, ref: t });
138
138
  });
139
- vo.displayName = Mo;
140
- var Do = "DropdownMenuRadioItem", ho = d.forwardRef((o, t) => {
141
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
142
- return /* @__PURE__ */ a(no, { ...r, ...n, ref: t });
139
+ ve.displayName = Me;
140
+ var De = "DropdownMenuRadioItem", he = p.forwardRef((e, t) => {
141
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
142
+ return /* @__PURE__ */ a(te, { ...r, ...n, ref: t });
143
143
  });
144
- ho.displayName = Do;
145
- var Ro = "DropdownMenuItemIndicator", So = d.forwardRef((o, t) => {
146
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
147
- return /* @__PURE__ */ a(to, { ...r, ...n, ref: t });
144
+ he.displayName = De;
145
+ var Se = "DropdownMenuItemIndicator", Re = p.forwardRef((e, t) => {
146
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
147
+ return /* @__PURE__ */ a(re, { ...r, ...n, ref: t });
148
148
  });
149
- So.displayName = Ro;
150
- var No = "DropdownMenuSeparator", Io = d.forwardRef((o, t) => {
151
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
152
- return /* @__PURE__ */ a(ro, { ...r, ...n, ref: t });
149
+ Re.displayName = Se;
150
+ var Ne = "DropdownMenuSeparator", Ie = p.forwardRef((e, t) => {
151
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
152
+ return /* @__PURE__ */ a(ae, { ...r, ...n, ref: t });
153
153
  });
154
- Io.displayName = No;
155
- var Co = "DropdownMenuArrow", yo = d.forwardRef(
156
- (o, t) => {
157
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
158
- return /* @__PURE__ */ a(ao, { ...r, ...n, ref: t });
154
+ Ie.displayName = Ne;
155
+ var ye = "DropdownMenuArrow", Ce = p.forwardRef(
156
+ (e, t) => {
157
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
158
+ return /* @__PURE__ */ a(ie, { ...r, ...n, ref: t });
159
159
  }
160
160
  );
161
- yo.displayName = Co;
162
- var xo = "DropdownMenuSubTrigger", Po = d.forwardRef((o, t) => {
163
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
164
- return /* @__PURE__ */ a(io, { ...r, ...n, ref: t });
161
+ Ce.displayName = ye;
162
+ var xe = "DropdownMenuSubTrigger", Pe = p.forwardRef((e, t) => {
163
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
164
+ return /* @__PURE__ */ a(de, { ...r, ...n, ref: t });
165
165
  });
166
- Po.displayName = xo;
167
- var Eo = "DropdownMenuSubContent", Ao = d.forwardRef((o, t) => {
168
- const { __scopeDropdownMenu: e, ...n } = o, r = s(e);
166
+ Pe.displayName = xe;
167
+ var Ee = "DropdownMenuSubContent", Ae = p.forwardRef((e, t) => {
168
+ const { __scopeDropdownMenu: o, ...n } = e, r = s(o);
169
169
  return /* @__PURE__ */ a(
170
- po,
170
+ pe,
171
171
  {
172
172
  ...r,
173
173
  ...n,
174
174
  ref: t,
175
175
  style: {
176
- ...o.style,
176
+ ...e.style,
177
177
  "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
178
178
  "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
179
179
  "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
@@ -183,15 +183,16 @@ var Eo = "DropdownMenuSubContent", Ao = d.forwardRef((o, t) => {
183
183
  }
184
184
  );
185
185
  });
186
- Ao.displayName = Eo;
187
- var Oo = x, Bo = E, To = A, ko = B, Go = T;
188
- const u = {
186
+ Ae.displayName = Ee;
187
+ var Oe = P, Be = A, Te = O, ke = T, Ge = k;
188
+ const l = {
189
189
  "split-button-container": "SplitButton-module__split-button-container___Pt3u6",
190
190
  "split-button-action-trigger": "SplitButton-module__split-button-action-trigger___dRgWH",
191
191
  "split-button-dropdown-trigger": "SplitButton-module__split-button-dropdown-trigger___kVFdu",
192
192
  "split-button-container-trigger-single": "SplitButton-module__split-button-container-trigger-single___LHqLO",
193
193
  "split-button-container-trigger-split": "SplitButton-module__split-button-container-trigger-split___vMf3J",
194
194
  "split-button-dropdown-menu": "SplitButton-module__split-button-dropdown-menu___VM6wC",
195
+ "split-button-dropdown-item-disabled": "SplitButton-module__split-button-dropdown-item-disabled___0DjMv",
195
196
  "split-button-container-type-primary": "SplitButton-module__split-button-container-type-primary___rvgCN",
196
197
  "split-button-container-disabled": "SplitButton-module__split-button-container-disabled___EO8ba",
197
198
  "split-button-container-type-secondary": "SplitButton-module__split-button-container-type-secondary___bkeij",
@@ -201,45 +202,49 @@ const u = {
201
202
  "split-button-dropdown-menu-size-sm": "SplitButton-module__split-button-dropdown-menu-size-sm___xlVmW",
202
203
  "split-button-dropdown-arrow": "SplitButton-module__split-button-dropdown-arrow___-Pf9C"
203
204
  };
204
- function Vo({
205
- type: o = "primary",
205
+ function Ve({
206
+ type: e = "primary",
206
207
  trigger: t = "single",
207
- size: e = "md",
208
+ size: o = "md",
208
209
  actionOptions: n,
209
210
  disabled: r,
210
211
  loading: i,
211
- buttonLabel: c,
212
- className: p,
213
- ...l
212
+ buttonLabel: m,
213
+ className: d,
214
+ ...c
214
215
  }) {
215
- const _ = W(null), [w, f] = N(0), [g, S] = N(!1);
216
- U(() => {
217
- var b;
218
- const m = (b = _.current) == null ? void 0 : b.getBoundingClientRect().width;
219
- m && f(m);
220
- }, [e]);
221
- const k = () => {
222
- S(!g);
216
+ const _ = U(null), [w, f] = I(0), [b, N] = I(!1);
217
+ $(() => {
218
+ var g;
219
+ const u = (g = _.current) == null ? void 0 : g.getBoundingClientRect().width;
220
+ u && f(u);
221
+ }, [o]);
222
+ const G = () => {
223
+ N(!b);
223
224
  }, {
224
- onClick: D,
225
- ...G
226
- } = l, L = (m) => {
227
- t === "single" ? k() : n[0].action(), D == null || D(m);
225
+ onClick: h,
226
+ ...L
227
+ } = c, z = (u) => {
228
+ t === "single" ? G() : n[0].action(), h == null || h(u);
228
229
  };
229
- return /* @__PURE__ */ h("div", { ref: _, className: R(u["split-button-container"], u[`split-button-container-type-${o}`], u[`split-button-container-trigger-${t}`], u[`split-button-container-size-${e}`], (r || i) && u["split-button-container-disabled"], p), children: [
230
- /* @__PURE__ */ a(z, { type: o, variant: "default", size: e, onClick: L, className: u["split-button-action-trigger"], disabled: r, loading: i, ...G, children: t === "single" ? c : n[0].label }),
231
- /* @__PURE__ */ h(Oo, { open: g, onOpenChange: S, children: [
232
- /* @__PURE__ */ a(Bo, { disabled: r || i, className: u["split-button-dropdown-trigger"], children: /* @__PURE__ */ a($, { icon: "ap-icon-expand-more", className: R(u["split-button-dropdown-arrow"]) }) }),
233
- /* @__PURE__ */ a(To, { children: /* @__PURE__ */ h(ko, { align: "end", sideOffset: 5, style: {
230
+ return /* @__PURE__ */ R("div", { ref: _, className: M(l["split-button-container"], l[`split-button-container-type-${e}`], l[`split-button-container-trigger-${t}`], l[`split-button-container-size-${o}`], (r || i) && l["split-button-container-disabled"], d), children: [
231
+ /* @__PURE__ */ a(W, { type: e, variant: "default", size: o, onClick: z, className: l["split-button-action-trigger"], disabled: r, loading: i, ...L, children: t === "single" ? m : n[0].label }),
232
+ /* @__PURE__ */ R(Oe, { open: b, onOpenChange: N, children: [
233
+ /* @__PURE__ */ a(Be, { disabled: r || i, className: l["split-button-dropdown-trigger"], children: /* @__PURE__ */ a(K, { icon: "ap-icon-expand-more", className: M(l["split-button-dropdown-arrow"]) }) }),
234
+ /* @__PURE__ */ a(Te, { children: /* @__PURE__ */ R(ke, { align: "end", sideOffset: 5, style: {
234
235
  minWidth: w,
235
236
  zIndex: 9999
236
237
  }, children: [
237
238
  " ",
238
- /* @__PURE__ */ a("div", { className: R(u["split-button-dropdown-menu"], u[`split-button-dropdown-menu-size-${e}`], (r || i) && u["split-button-dropdown-menu-disabled"]), children: n.map((m, b) => t === "split" && b === 0 ? null : /* @__PURE__ */ a(Go, { title: m.label, onClick: () => m.action(), children: /* @__PURE__ */ a("button", { children: m.label }) }, m.value)) })
239
+ /* @__PURE__ */ a("div", { className: M(l["split-button-dropdown-menu"], l[`split-button-dropdown-menu-size-${o}`], (r || i) && l["split-button-dropdown-menu-disabled"]), children: n.map((u, g) => t === "split" && g === 0 ? null : /* @__PURE__ */ a(Ge, { title: u.label, onClick: (S) => {
240
+ u.disabled ? S.preventDefault() : u.action();
241
+ }, onSelect: (S) => {
242
+ u.disabled && S.preventDefault();
243
+ }, disabled: u.disabled, className: M(u.disabled && l["split-button-dropdown-item-disabled"]), children: /* @__PURE__ */ a("button", { type: "button", disabled: u.disabled, children: u.label }) }, u.value)) })
239
244
  ] }) })
240
245
  ] })
241
246
  ] });
242
247
  }
243
248
  export {
244
- Vo as default
249
+ Ve as default
245
250
  };
@@ -2,6 +2,7 @@ export type TooltipProps = {
2
2
  className?: string;
3
3
  children: React.ReactNode;
4
4
  content: React.ReactNode;
5
+ disabled?: boolean;
5
6
  size?: 'md' | 'sm';
6
7
  theme?: 'dark' | 'light';
7
8
  tipSide?: 'top' | 'bottom' | 'left' | 'right';
@@ -22,6 +23,7 @@ export type TooltipProps = {
22
23
  * @param {object} props - Tooltip component props
23
24
  * @param {React.ReactNode} props.children - The trigger element that will show the tooltip on hover/focus
24
25
  * @param {React.ReactNode} props.content - The content to display inside the tooltip
26
+ * @param {boolean} [props.disabled=false] - When true, no tooltip is shown and children are rendered as-is with no wrapper
25
27
  * @param {'md' | 'sm'} [props.size='md'] - The size of the tooltip (affects padding and close button visibility)
26
28
  * @param {'dark' | 'light'} [props.theme='dark'] - The visual theme of the tooltip (affects colors and styling)
27
29
  * @param {'top' | 'bottom' | 'left' | 'right'} [props.tipSide='top'] - The side where the tooltip arrow points
@@ -31,4 +33,4 @@ export type TooltipProps = {
31
33
  * @param {() => void} [props.onClose] - Callback fired when the tooltip is closed (only available for 'md' size)
32
34
  * @returns {JSX.Element} The rendered Tooltip component
33
35
  */
34
- export default function Tooltip({ children, content, size, theme, tipSide, tipAlignment, keepVisible, startVisible, onClose, className, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
36
+ export default function Tooltip({ children, content, disabled, size, theme, tipSide, tipAlignment, keepVisible, startVisible, onClose, className, }: TooltipProps): import("react/jsx-runtime").JSX.Element;