@alixpartners/ui-components 2.5.7 → 2.6.0

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 (111) hide show
  1. package/README.md +97 -97
  2. package/dist/RichTextEditor-JH6YBGiw.js +541 -0
  3. package/dist/{ToastProvider-D5LImZ-Q.js → ToastProvider-DVycF0zU.js} +26 -26
  4. package/dist/assets/CorusHeader.css +1 -1
  5. package/dist/assets/Tab.css +1 -1
  6. package/dist/assets/Tag.css +1 -1
  7. package/dist/assets/ap-icons-types.d.ts +1 -1
  8. package/dist/assets/ap-icons.d.ts +1 -1
  9. package/dist/assets/main.css +1 -1
  10. package/dist/components/Banner/Banner.d.ts +1 -1
  11. package/dist/components/Banner/Banner.test.js +1 -1
  12. package/dist/components/Button/Button.d.ts +1 -1
  13. package/dist/components/Button/Button.test.js +2 -2
  14. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  15. package/dist/components/Checkbox/Checkbox.js +3 -3
  16. package/dist/components/Checkbox/Checkbox.test.js +1 -1
  17. package/dist/components/CorusHeader/CorusHeader.d.ts +1 -1
  18. package/dist/components/CorusHeader/CorusHeader.js +45 -44
  19. package/dist/components/CorusHeader/CorusHeader.types.d.ts +1 -0
  20. package/dist/components/CorusHeader/DropdownItemContent.d.ts +1 -1
  21. package/dist/components/CorusHeader/DropdownMenu.d.ts +2 -1
  22. package/dist/components/CorusHeader/DropdownMenu.js +6 -5
  23. package/dist/components/CorusHeader/MegaMenuContent.d.ts +2 -1
  24. package/dist/components/CorusHeader/MegaMenuContent.js +11 -10
  25. package/dist/components/CorusHeader/UserProfileIcon.d.ts +1 -1
  26. package/dist/components/Creatable/Creatable.d.ts +1 -1
  27. package/dist/components/Creatable/Creatable.js +1 -1
  28. package/dist/components/Datepicker/Datepicker.d.ts +1 -1
  29. package/dist/components/Datepicker/Datepicker.js +1 -1
  30. package/dist/components/Datepicker/Datepicker.test.js +1 -1
  31. package/dist/components/Dialog/Dialog.d.ts +1 -1
  32. package/dist/components/Dialog/Dialog.js +188 -214
  33. package/dist/components/Dialog/Dialog.test.js +1 -1
  34. package/dist/components/DragAndDrop/DragAndDrop.d.ts +1 -1
  35. package/dist/components/DragAndDrop/DragAndDrop.test.js +2 -2
  36. package/dist/components/Dropdown/Dropdown.d.ts +3 -1
  37. package/dist/components/Dropdown/Dropdown.js +179 -172
  38. package/dist/components/FilePicker/FilePicker.d.ts +9 -9
  39. package/dist/components/FilePicker/FilePicker.test.js +2 -2
  40. package/dist/components/Ghost/Ghost.d.ts +1 -1
  41. package/dist/components/Ghost/Ghost.test.js +1 -1
  42. package/dist/components/Icon/Icon.d.ts +1 -1
  43. package/dist/components/Icons/IconsGallery.d.ts +1 -1
  44. package/dist/components/Icons/IconsGallery.js +1 -1
  45. package/dist/components/Illustration/Illustration.d.ts +1 -1
  46. package/dist/components/Illustration/Illustration.test.js +1 -1
  47. package/dist/components/Input/Input.test.js +1 -1
  48. package/dist/components/Logo/Logo.d.ts +1 -1
  49. package/dist/components/Logos/LogosGallery.d.ts +1 -1
  50. package/dist/components/NavBar/NavBar.d.ts +1 -1
  51. package/dist/components/NavBar/NavBar.js +1 -1
  52. package/dist/components/Radio/Radio.d.ts +1 -1
  53. package/dist/components/Radio/Radio.js +9 -9
  54. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  55. package/dist/components/RadioGroup/RadioGroup.js +11 -11
  56. package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
  57. package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
  58. package/dist/components/RichTextEditor/RichTextEditor.js +2 -2
  59. package/dist/components/RichTextEditor/RichTextEditor.test.js +2 -2
  60. package/dist/components/Search/Search.d.ts +1 -1
  61. package/dist/components/Search/Search.test.js +1 -1
  62. package/dist/components/Spinner/Spinner.d.ts +1 -1
  63. package/dist/components/SplitButton/SplitButton.d.ts +1 -1
  64. package/dist/components/SplitButton/SplitButton.js +3 -3
  65. package/dist/components/SplitButton/SplitButton.test.js +1 -1
  66. package/dist/components/Tab/Tab.d.ts +5 -1
  67. package/dist/components/Tab/Tab.js +28 -24
  68. package/dist/components/TabNavigation/TabNavigation.d.ts +1 -1
  69. package/dist/components/Tag/Tag.d.ts +1 -1
  70. package/dist/components/Tag/Tag.js +1 -1
  71. package/dist/components/Tag/Tag.test.js +1 -1
  72. package/dist/components/TagsFields/TagsFields.d.ts +1 -1
  73. package/dist/components/TagsFields/TagsFields.js +1 -1
  74. package/dist/components/Textarea/Textarea.d.ts +1 -1
  75. package/dist/components/Textarea/Textarea.test.js +1 -1
  76. package/dist/components/Toast/Toast.test.js +1 -1
  77. package/dist/components/ToastProvider/ToastProvider.d.ts +2 -1
  78. package/dist/components/ToastProvider/ToastProvider.js +1 -1
  79. package/dist/components/ToastProvider/ToastProvider.test.js +4 -4
  80. package/dist/components/Toggle/Toggle.d.ts +1 -1
  81. package/dist/components/Toggle/Toggle.js +211 -126
  82. package/dist/components/Toggle/Toggle.test.js +1 -1
  83. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  84. package/dist/components/Tooltip/Tooltip.js +60 -61
  85. package/dist/{index-C2s_VtSb.js → index-6DGSlWJb.js} +3 -3
  86. package/dist/{index-Nyh2Wa71.js → index-6j3vTf--.js} +5 -5
  87. package/dist/index-B4szHVNJ.js +248 -0
  88. package/dist/{index-CFqDEbIR.js → index-BVZdJVFB.js} +192 -191
  89. package/dist/index-Bq1FiX6B.js +93 -0
  90. package/dist/index-CE9NpYQR.js +604 -0
  91. package/dist/index-CHy8gqvu.js +353 -0
  92. package/dist/index-CarlZuEo.js +1610 -0
  93. package/dist/{index-CCFDXH-J.js → index-CcsZYEYy.js} +29 -28
  94. package/dist/index-DH9SO8qV.js +221 -0
  95. package/dist/{index-D_L0ncPJ.js → index-IR8HlW5P.js} +4 -4
  96. package/dist/{index-DkTDHhag.js → index-banDzeKa.js} +1 -1
  97. package/dist/index-kgC_DL6e.js +216 -0
  98. package/dist/main.js +3 -3
  99. package/dist/storybook-docs-page.d.ts +1 -1
  100. package/dist/{useToast-Cz5MGKnw.js → useToast-CpwrYPvx.js} +1 -1
  101. package/dist/{vi.bdSIJ99Y-017e_Pkz.js → vi.bdSIJ99Y-DWCVXj6K.js} +3 -3
  102. package/dist/web.config +8 -8
  103. package/package.json +94 -94
  104. package/dist/RichTextEditor-kTQEDSL0.js +0 -477
  105. package/dist/index-C8H9A55g.js +0 -222
  106. package/dist/index-CCnm5-ML.js +0 -230
  107. package/dist/index-CfIcUHKK.js +0 -70
  108. package/dist/index-ChQc_Cm6.js +0 -1544
  109. package/dist/index-CmGGeUr0.js +0 -142
  110. package/dist/index-Ii4UOx3H.js +0 -599
  111. package/dist/index-z_kiwVc3.js +0 -237
@@ -1,159 +1,244 @@
1
- import { jsxs as k, jsx as d } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { useId as D, useEffect as M, useState as j } from "react";
4
- import { c as F } from "../../clsx-OuTLNxxd.js";
5
- import { d as y, u as H, P, c as K, b as A } from "../../index-z_kiwVc3.js";
6
- import { u as U } from "../../index-BZPx6jYI.js";
7
- import { u as q } from "../../index-Nyh2Wa71.js";
8
- import '../../assets/Toggle.css';var v = "Switch", [z] = A(v), [L, O] = z(v), T = m.forwardRef(
9
- (r, c) => {
1
+ import { jsx as i, jsxs as T, Fragment as K } from "react/jsx-runtime";
2
+ import * as f from "react";
3
+ import { useId as U, useEffect as z, useState as G } from "react";
4
+ import { c as L } from "../../clsx-OuTLNxxd.js";
5
+ import { P, u as O, a as E, c as W, b as X } from "../../index-B4szHVNJ.js";
6
+ import { u as Y } from "../../index-BZPx6jYI.js";
7
+ import { u as J } from "../../index-6j3vTf--.js";
8
+ import '../../assets/Toggle.css';var C = "Switch", [Q] = X(C), [V, R] = Q(C);
9
+ function Z(e) {
10
+ const {
11
+ __scopeSwitch: r,
12
+ checked: c,
13
+ children: a,
14
+ defaultChecked: t,
15
+ disabled: s,
16
+ form: n,
17
+ name: l,
18
+ onCheckedChange: u,
19
+ required: h,
20
+ value: d = "on",
21
+ // @ts-expect-error
22
+ internal_do_not_use_render: p
23
+ } = e, [o, m] = O({
24
+ prop: c,
25
+ defaultProp: t ?? !1,
26
+ onChange: u,
27
+ caller: C
28
+ }), [b, _] = f.useState(null), [g, S] = f.useState(null), k = f.useRef(!1), v = b ? !!n || !!b.closest("form") : (
29
+ // We set this to true by default so that events bubble to forms without JS (SSR)
30
+ !0
31
+ ), y = {
32
+ checked: o,
33
+ setChecked: m,
34
+ disabled: s,
35
+ control: b,
36
+ setControl: _,
37
+ name: l,
38
+ form: n,
39
+ value: d,
40
+ hasConsumerStoppedPropagationRef: k,
41
+ required: h,
42
+ defaultChecked: t,
43
+ isFormControl: v,
44
+ bubbleInput: g,
45
+ setBubbleInput: S
46
+ };
47
+ return /* @__PURE__ */ i(V, { scope: r, ...y, children: $(p) ? p(y) : a });
48
+ }
49
+ var N = "SwitchTrigger", x = f.forwardRef(
50
+ ({ __scopeSwitch: e, onClick: r, ...c }, a) => {
51
+ const {
52
+ value: t,
53
+ disabled: s,
54
+ checked: n,
55
+ required: l,
56
+ setControl: u,
57
+ setChecked: h,
58
+ hasConsumerStoppedPropagationRef: d,
59
+ isFormControl: p,
60
+ bubbleInput: o
61
+ } = R(N, e), m = E(a, u);
62
+ return /* @__PURE__ */ i(
63
+ P.button,
64
+ {
65
+ type: "button",
66
+ role: "switch",
67
+ "aria-checked": n,
68
+ "aria-required": l,
69
+ "data-state": j(n),
70
+ "data-disabled": s ? "" : void 0,
71
+ disabled: s,
72
+ value: t,
73
+ ...c,
74
+ ref: m,
75
+ onClick: W(r, (b) => {
76
+ h((_) => !_), o && p && (d.current = b.isPropagationStopped(), d.current || b.stopPropagation());
77
+ })
78
+ }
79
+ );
80
+ }
81
+ );
82
+ x.displayName = N;
83
+ var B = f.forwardRef(
84
+ (e, r) => {
10
85
  const {
11
- __scopeSwitch: e,
12
- name: n,
13
- checked: o,
14
- defaultChecked: p,
15
- required: s,
16
- disabled: a,
17
- value: i = "on",
86
+ __scopeSwitch: c,
87
+ name: a,
88
+ checked: t,
89
+ defaultChecked: s,
90
+ required: n,
91
+ disabled: l,
92
+ value: u,
18
93
  onCheckedChange: h,
19
- form: l,
20
- ..._
21
- } = r, [t, u] = m.useState(null), S = y(c, (w) => u(w)), C = m.useRef(!1), g = t ? l || !!t.closest("form") : !0, [b, I] = H({
22
- prop: o,
23
- defaultProp: p ?? !1,
24
- onChange: h,
25
- caller: v
26
- });
27
- return /* @__PURE__ */ k(L, { scope: e, checked: b, disabled: a, children: [
28
- /* @__PURE__ */ d(
29
- P.button,
30
- {
31
- type: "button",
32
- role: "switch",
33
- "aria-checked": b,
34
- "aria-required": s,
35
- "data-state": R(b),
36
- "data-disabled": a ? "" : void 0,
37
- disabled: a,
38
- value: i,
39
- ..._,
40
- ref: S,
41
- onClick: K(r.onClick, (w) => {
42
- I((B) => !B), g && (C.current = w.isPropagationStopped(), C.current || w.stopPropagation());
43
- })
44
- }
45
- ),
46
- g && /* @__PURE__ */ d(
47
- x,
48
- {
49
- control: t,
50
- bubbles: !C.current,
51
- name: n,
52
- value: i,
53
- checked: b,
54
- required: s,
55
- disabled: a,
56
- form: l,
57
- style: { transform: "translateX(-100%)" }
58
- }
59
- )
60
- ] });
94
+ form: d,
95
+ ...p
96
+ } = e;
97
+ return /* @__PURE__ */ i(
98
+ Z,
99
+ {
100
+ __scopeSwitch: c,
101
+ checked: t,
102
+ defaultChecked: s,
103
+ disabled: l,
104
+ required: n,
105
+ onCheckedChange: h,
106
+ name: a,
107
+ form: d,
108
+ value: u,
109
+ internal_do_not_use_render: ({ isFormControl: o }) => /* @__PURE__ */ T(K, { children: [
110
+ /* @__PURE__ */ i(
111
+ x,
112
+ {
113
+ ...p,
114
+ ref: r,
115
+ __scopeSwitch: c
116
+ }
117
+ ),
118
+ o && /* @__PURE__ */ i(
119
+ q,
120
+ {
121
+ __scopeSwitch: c
122
+ }
123
+ )
124
+ ] })
125
+ }
126
+ );
61
127
  }
62
128
  );
63
- T.displayName = v;
64
- var E = "SwitchThumb", N = m.forwardRef(
65
- (r, c) => {
66
- const { __scopeSwitch: e, ...n } = r, o = O(E, e);
67
- return /* @__PURE__ */ d(
129
+ B.displayName = C;
130
+ var F = "SwitchThumb", M = f.forwardRef(
131
+ (e, r) => {
132
+ const { __scopeSwitch: c, ...a } = e, t = R(F, c);
133
+ return /* @__PURE__ */ i(
68
134
  P.span,
69
135
  {
70
- "data-state": R(o.checked),
71
- "data-disabled": o.disabled ? "" : void 0,
72
- ...n,
73
- ref: c
136
+ "data-state": j(t.checked),
137
+ "data-disabled": t.disabled ? "" : void 0,
138
+ ...a,
139
+ ref: r
74
140
  }
75
141
  );
76
142
  }
77
143
  );
78
- N.displayName = E;
79
- var W = "SwitchBubbleInput", x = m.forwardRef(
80
- ({
81
- __scopeSwitch: r,
82
- control: c,
83
- checked: e,
84
- bubbles: n = !0,
85
- ...o
86
- }, p) => {
87
- const s = m.useRef(null), a = y(s, p), i = U(e), h = q(c);
88
- return m.useEffect(() => {
89
- const l = s.current;
90
- if (!l) return;
91
- const _ = window.HTMLInputElement.prototype, u = Object.getOwnPropertyDescriptor(
92
- _,
144
+ M.displayName = F;
145
+ var D = "SwitchBubbleInput", q = f.forwardRef(
146
+ ({ __scopeSwitch: e, ...r }, c) => {
147
+ const {
148
+ control: a,
149
+ hasConsumerStoppedPropagationRef: t,
150
+ checked: s,
151
+ defaultChecked: n,
152
+ required: l,
153
+ disabled: u,
154
+ name: h,
155
+ value: d,
156
+ form: p,
157
+ bubbleInput: o,
158
+ setBubbleInput: m
159
+ } = R(D, e), b = E(c, m), _ = Y(s), g = J(a);
160
+ f.useEffect(() => {
161
+ const k = o;
162
+ if (!k) return;
163
+ const v = window.HTMLInputElement.prototype, I = Object.getOwnPropertyDescriptor(
164
+ v,
93
165
  "checked"
94
- ).set;
95
- if (i !== e && u) {
96
- const S = new Event("click", { bubbles: n });
97
- u.call(l, e), l.dispatchEvent(S);
166
+ ).set, A = !t.current;
167
+ if (_ !== s && I) {
168
+ const H = new Event("click", { bubbles: A });
169
+ I.call(k, s), k.dispatchEvent(H);
98
170
  }
99
- }, [i, e, n]), /* @__PURE__ */ d(
100
- "input",
171
+ }, [o, _, s, t]);
172
+ const S = f.useRef(s);
173
+ return /* @__PURE__ */ i(
174
+ P.input,
101
175
  {
102
176
  type: "checkbox",
103
177
  "aria-hidden": !0,
104
- defaultChecked: e,
105
- ...o,
178
+ defaultChecked: n ?? S.current,
179
+ required: l,
180
+ disabled: u,
181
+ name: h,
182
+ value: d,
183
+ form: p,
184
+ ...r,
106
185
  tabIndex: -1,
107
- ref: a,
186
+ ref: b,
108
187
  style: {
109
- ...o.style,
110
- ...h,
188
+ ...r.style,
189
+ ...g,
111
190
  position: "absolute",
112
191
  pointerEvents: "none",
113
192
  opacity: 0,
114
- margin: 0
193
+ margin: 0,
194
+ // We transform because the input is absolutely positioned but we have
195
+ // rendered it **after** the button. This pulls it back to sit on top
196
+ // of the button.
197
+ transform: "translateX(-100%)"
115
198
  }
116
199
  }
117
200
  );
118
201
  }
119
202
  );
120
- x.displayName = W;
121
- function R(r) {
122
- return r ? "checked" : "unchecked";
203
+ q.displayName = D;
204
+ function $(e) {
205
+ return typeof e == "function";
206
+ }
207
+ function j(e) {
208
+ return e ? "checked" : "unchecked";
123
209
  }
124
- var X = T, Y = N;
125
- const G = "Toggle-module__wrapper___rjhvi", J = "Toggle-module__root___mhwY4", Q = "Toggle-module__thumb___mWKFb", V = "Toggle-module__label___DMfcr", Z = "Toggle-module__disabled___sxlCk", f = {
126
- wrapper: G,
127
- root: J,
128
- thumb: Q,
129
- label: V,
130
- disabled: Z
210
+ const ee = "Toggle-module__wrapper___rjhvi", te = "Toggle-module__root___mhwY4", oe = "Toggle-module__thumb___mWKFb", re = "Toggle-module__label___DMfcr", ce = "Toggle-module__disabled___sxlCk", w = {
211
+ wrapper: ee,
212
+ root: te,
213
+ thumb: oe,
214
+ label: re,
215
+ disabled: ce
131
216
  };
132
- function ae({
133
- label: r,
134
- checked: c = !1,
135
- disabled: e = !1,
136
- labelPosition: n = "left",
137
- onChange: o,
138
- className: p,
139
- ...s
217
+ function ue({
218
+ label: e,
219
+ checked: r = !1,
220
+ disabled: c = !1,
221
+ labelPosition: a = "left",
222
+ onChange: t,
223
+ className: s,
224
+ ...n
140
225
  }) {
141
- const a = D();
142
- M(() => {
143
- h(c);
144
- }, [c]);
145
- const [i, h] = j(c), l = (t) => {
146
- h(t), o == null || o(t);
147
- }, _ = (t) => {
148
- var u;
149
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), l(!i)), (u = s.onKeyDown) == null || u.call(s, t);
226
+ const l = U();
227
+ z(() => {
228
+ h(r);
229
+ }, [r]);
230
+ const [u, h] = G(r), d = (o) => {
231
+ h(o), t == null || t(o);
232
+ }, p = (o) => {
233
+ var m;
234
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), d(!u)), (m = n.onKeyDown) == null || m.call(n, o);
150
235
  };
151
- return /* @__PURE__ */ k("div", { className: F(f.wrapper, e && f.disabled, p), children: [
152
- n === "left" && /* @__PURE__ */ d("label", { className: f.label, htmlFor: a, children: r }),
153
- /* @__PURE__ */ d(X, { className: f.root, checked: i, disabled: e, onCheckedChange: l, id: a, onKeyDown: _, ...s, children: /* @__PURE__ */ d(Y, { className: f.thumb }) }),
154
- n === "right" && /* @__PURE__ */ d("label", { className: f.label, htmlFor: a, children: r })
236
+ return /* @__PURE__ */ T("div", { className: L(w.wrapper, c && w.disabled, s), children: [
237
+ a === "left" && /* @__PURE__ */ i("label", { className: w.label, htmlFor: l, children: e }),
238
+ /* @__PURE__ */ i(B, { className: w.root, checked: u, disabled: c, onCheckedChange: d, id: l, onKeyDown: p, ...n, children: /* @__PURE__ */ i(M, { className: w.thumb }) }),
239
+ a === "right" && /* @__PURE__ */ i("label", { className: w.label, htmlFor: l, children: e })
155
240
  ] });
156
241
  }
157
242
  export {
158
- ae as default
243
+ ue as default
159
244
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { d, i as n, r as g, g as t, s as l, v as b, f as r } from "../../vi.bdSIJ99Y-017e_Pkz.js";
2
+ import { d, i as n, r as g, g as t, s as l, v as b, f as r } from "../../vi.bdSIJ99Y-DWCVXj6K.js";
3
3
  import a from "./Toggle.js";
4
4
  d("Toggle", () => {
5
5
  d("Rendering", () => {
@@ -33,4 +33,4 @@ export type TooltipProps = {
33
33
  * @param {() => void} [props.onClose] - Callback fired when the tooltip is closed (only available for 'md' size)
34
34
  * @returns {JSX.Element} The rendered Tooltip component
35
35
  */
36
- export default function Tooltip({ children, content, disabled, 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.Element;