@alixpartners/ui-components 2.0.0-beta.8 → 2.0.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 (87) hide show
  1. package/dist/ap-logos-Cl1TR5nm.js +4 -0
  2. package/dist/assets/Banner.css +1 -1
  3. package/dist/assets/Button.css +1 -1
  4. package/dist/assets/Checkbox.css +1 -1
  5. package/dist/assets/Dialog.css +1 -1
  6. package/dist/assets/DragAndDrop.css +1 -1
  7. package/dist/assets/Dropdown.css +1 -1
  8. package/dist/assets/Input.css +1 -1
  9. package/dist/assets/LogosGallery.css +1 -0
  10. package/dist/assets/NavBar.css +1 -1
  11. package/dist/assets/SplitButton.css +1 -1
  12. package/dist/assets/TabNavigation.css +1 -1
  13. package/dist/assets/Tag.css +1 -1
  14. package/dist/assets/Textarea.css +1 -1
  15. package/dist/assets/Toast.css +1 -1
  16. package/dist/assets/Tooltip.css +1 -1
  17. package/dist/assets/ap-icons-types.d.ts +1 -1
  18. package/dist/assets/ap-icons.d.ts +1 -1
  19. package/dist/assets/ap-logos-types.d.ts +1 -0
  20. package/dist/assets/ap-logos.d.ts +1 -0
  21. package/dist/assets/main.css +1 -1
  22. package/dist/components/Banner/Banner.d.ts +4 -2
  23. package/dist/components/Banner/Banner.js +23 -21
  24. package/dist/components/Button/Button.d.ts +13 -14
  25. package/dist/components/Button/Button.js +27 -25
  26. package/dist/components/Checkbox/Checkbox.d.ts +4 -2
  27. package/dist/components/Checkbox/Checkbox.js +141 -138
  28. package/dist/components/Creatable/Creatable.d.ts +6 -2
  29. package/dist/components/Creatable/Creatable.js +29 -14
  30. package/dist/components/Dialog/Dialog.d.ts +16 -4
  31. package/dist/components/Dialog/Dialog.js +58 -41
  32. package/dist/components/DragAndDrop/DragAndDrop.d.ts +10 -5
  33. package/dist/components/DragAndDrop/DragAndDrop.js +81 -70
  34. package/dist/components/Dropdown/Dropdown.d.ts +11 -2
  35. package/dist/components/Dropdown/Dropdown.js +383 -345
  36. package/dist/components/Ghost/Ghost.d.ts +4 -2
  37. package/dist/components/Ghost/Ghost.js +18 -15
  38. package/dist/components/Icons/IconsGallery.js +1 -1
  39. package/dist/components/Input/Input.d.ts +25 -22
  40. package/dist/components/Input/Input.js +62 -58
  41. package/dist/components/Logo/Logo.d.ts +8 -0
  42. package/dist/components/Logo/Logo.js +57 -0
  43. package/dist/components/Logos/LogosGallery.d.ts +1 -0
  44. package/dist/components/Logos/LogosGallery.js +16 -0
  45. package/dist/components/NavBar/NavBar.d.ts +14 -5
  46. package/dist/components/NavBar/NavBar.js +241 -224
  47. package/dist/components/Radio/Radio.d.ts +3 -2
  48. package/dist/components/Radio/Radio.js +1 -1
  49. package/dist/components/RadioGroup/RadioGroup.d.ts +4 -2
  50. package/dist/components/RadioGroup/RadioGroup.js +14 -13
  51. package/dist/components/Search/Search.d.ts +6 -4
  52. package/dist/components/Search/Search.js +20 -18
  53. package/dist/components/SplitButton/SplitButton.d.ts +4 -2
  54. package/dist/components/SplitButton/SplitButton.js +115 -106
  55. package/dist/components/Tab/Tab.d.ts +4 -2
  56. package/dist/components/Tab/Tab.js +27 -24
  57. package/dist/components/TabNavigation/TabNavigation.d.ts +3 -1
  58. package/dist/components/TabNavigation/TabNavigation.js +15 -8
  59. package/dist/components/Tag/Tag.d.ts +2 -1
  60. package/dist/components/Tag/Tag.js +8 -8
  61. package/dist/components/TagsFields/TagsFields.d.ts +4 -2
  62. package/dist/components/TagsFields/TagsFields.js +7 -6
  63. package/dist/components/Textarea/Textarea.d.ts +7 -5
  64. package/dist/components/Textarea/Textarea.js +27 -25
  65. package/dist/components/Toast/Toast.d.ts +4 -2
  66. package/dist/components/Toast/Toast.js +23 -22
  67. package/dist/components/Toast/Toast.test.js +1 -1
  68. package/dist/components/Toggle/Toggle.d.ts +4 -2
  69. package/dist/components/Toggle/Toggle.js +80 -78
  70. package/dist/components/Tooltip/Tooltip.d.ts +2 -1
  71. package/dist/components/Tooltip/Tooltip.js +376 -123
  72. package/dist/index-2H7slGYV.js +23 -0
  73. package/dist/index-BGZDIjm9.js +674 -0
  74. package/dist/{index-snhwePGJ.js → index-BJXIvJs4.js} +3 -3
  75. package/dist/{index-DNvS1y4S.js → index-CVWHq7Pr.js} +33 -32
  76. package/dist/{index-DrL-TXFC.js → index-CjQV7MmW.js} +2 -2
  77. package/dist/index-DWydnyjJ.js +245 -0
  78. package/dist/index-DieLVN0p.js +1664 -0
  79. package/dist/{index-BvhDRUM9.js → index-DpfPnSMn.js} +1 -1
  80. package/dist/main.d.ts +10 -8
  81. package/dist/main.js +29 -25
  82. package/dist/storybook-docs-page.d.ts +4 -1
  83. package/dist/types/native-events.d.ts +80 -0
  84. package/package.json +1 -1
  85. package/dist/index-Bx8a_H5C.js +0 -2331
  86. package/dist/index-CVlmPg9Z.js +0 -239
  87. package/dist/index-k9IXwz5f.js +0 -23
@@ -1,6 +1,8 @@
1
1
  import { ApIcon } from '../../assets/ap-icons-types';
2
2
  import { ReactNode } from 'react';
3
+ import { InteractiveEventHandlers } from '../../types/native-events';
3
4
  type BannerProps = {
5
+ className?: string;
4
6
  type: 'info' | 'success' | 'warning' | 'error' | 'ai';
5
7
  size: 'sm' | 'md' | 'lg';
6
8
  content?: string;
@@ -8,7 +10,7 @@ type BannerProps = {
8
10
  icon?: ApIcon;
9
11
  isFullWidth?: boolean;
10
12
  onClose?: () => void;
11
- };
13
+ } & InteractiveEventHandlers;
12
14
  /**
13
15
  * Banner component for displaying contextual messages such as info, success, warning, or error.
14
16
  *
@@ -22,5 +24,5 @@ type BannerProps = {
22
24
  * @param {() => void} [props.onClose] - Callback fired when the close button is clicked (renders close button if provided and size is not 'sm')
23
25
  * @returns {JSX.Element} The rendered Banner component
24
26
  */
25
- export default function Banner({ type, size, content, contentHTML, icon, isFullWidth, onClose }: BannerProps): import("react/jsx-runtime").JSX.Element;
27
+ export default function Banner({ type, size, content, contentHTML, icon, isFullWidth, onClose, className, ...props }: BannerProps): import("react/jsx-runtime").JSX.Element;
26
28
  export {};
@@ -1,40 +1,42 @@
1
- import { jsx as o, jsxs as u } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as B } from "react/jsx-runtime";
2
2
  import { c as l } from "../../clsx-OuTLNxxd.js";
3
3
  import a from "../Icon/Icon.js";
4
- import '../../assets/Banner.css';const f = "Banner-module__root___thkfk", B = "Banner-module__info___xuru-", h = "Banner-module__lg___3Ebme", b = "Banner-module__md___ClFFt", w = "Banner-module__sm___KWc4x", g = "Banner-module__warning___3hSt-", p = "Banner-module__error___b9QKF", k = "Banner-module__success___ZM5V0", x = "Banner-module__ai___RlIcg", I = "Banner-module__inner___S3o73", N = "Banner-module__icon___ZtVmk", j = "Banner-module__closeIcon___ON0vc", y = "Banner-module__btnClose___hjsC7", n = {
5
- root: f,
6
- info: B,
7
- lg: h,
8
- md: b,
9
- sm: w,
4
+ import '../../assets/Banner.css';const h = "Banner-module__root___thkfk", b = "Banner-module__info___xuru-", w = "Banner-module__lg___3Ebme", g = "Banner-module__md___ClFFt", p = "Banner-module__sm___KWc4x", k = "Banner-module__warning___3hSt-", x = "Banner-module__error___b9QKF", I = "Banner-module__success___ZM5V0", N = "Banner-module__ai___RlIcg", j = "Banner-module__inner___S3o73", y = "Banner-module__icon___ZtVmk", K = "Banner-module__closeIcon___ON0vc", D = "Banner-module__btnClose___hjsC7", n = {
5
+ root: h,
6
+ info: b,
7
+ lg: w,
8
+ md: g,
9
+ sm: p,
10
10
  "full-width": "Banner-module__full-width___qGjmw",
11
- warning: g,
12
- error: p,
13
- success: k,
14
- ai: x,
15
- inner: I,
16
- icon: N,
17
- closeIcon: j,
18
- btnClose: y
11
+ warning: k,
12
+ error: x,
13
+ success: I,
14
+ ai: N,
15
+ inner: j,
16
+ icon: y,
17
+ closeIcon: K,
18
+ btnClose: D
19
19
  };
20
- function v({
20
+ function E({
21
21
  type: c,
22
22
  size: e,
23
23
  content: t,
24
24
  contentHTML: s,
25
25
  icon: i = "ap-icon-info",
26
26
  isFullWidth: m,
27
- onClose: _
27
+ onClose: _,
28
+ className: d,
29
+ ...u
28
30
  }) {
29
- const d = (r) => {
31
+ const f = (r) => {
30
32
  (r.key === "Enter" || r.key === " ") && (r.preventDefault(), _ == null || _());
31
33
  };
32
- return /* @__PURE__ */ o("div", { className: l(n.root, n[c], n[e], m && n["full-width"]), role: "alert", children: /* @__PURE__ */ u("div", { className: l(n.inner, n[c], n[e]), children: [
34
+ return /* @__PURE__ */ o("div", { className: l(n.root, n[c], n[e], m && n["full-width"], d), role: "alert", ...u, children: /* @__PURE__ */ B("div", { className: l(n.inner, n[c], n[e]), children: [
33
35
  /* @__PURE__ */ o(a, { icon: i, className: n.icon }),
34
36
  /* @__PURE__ */ o("span", { children: s || t }),
35
- e !== "sm" && _ && /* @__PURE__ */ o("button", { onClick: _, onKeyDown: d, className: n.btnClose, "aria-label": "Close banner", children: /* @__PURE__ */ o(a, { icon: "ap-icon-close", className: n.closeIcon }) })
37
+ e !== "sm" && _ && /* @__PURE__ */ o("button", { onClick: _, onKeyDown: f, className: n.btnClose, "aria-label": "Close banner", children: /* @__PURE__ */ o(a, { icon: "ap-icon-close", className: n.closeIcon }) })
36
38
  ] }) });
37
39
  }
38
40
  export {
39
- v as default
41
+ E as default
40
42
  };
@@ -1,5 +1,17 @@
1
1
  import { ApIcon } from '../../assets/ap-icons-types';
2
2
  import { DataAttributes } from '../../types/data-attributes';
3
+ import { InteractiveEventHandlers } from '../../types/native-events';
4
+ export type ButtonProps = {
5
+ type: 'primary' | 'secondary' | 'tertiary';
6
+ variant: 'default' | 'danger' | 'cancel';
7
+ size: 'sm' | 'md';
8
+ icon?: ApIcon;
9
+ disabled?: boolean;
10
+ loading?: boolean;
11
+ children?: React.ReactNode;
12
+ className?: string;
13
+ iconClassName?: string;
14
+ } & DataAttributes & InteractiveEventHandlers;
3
15
  /**
4
16
  * A versatile button component that supports different types, variants, sizes, and states.
5
17
  * Used for user interactions and form submissions throughout the application.
@@ -15,17 +27,4 @@ import { DataAttributes } from '../../types/data-attributes';
15
27
  * @param {() => void} [props.onClick] - Callback fired when the button is clicked
16
28
  * @returns {JSX.Element} The rendered Button component
17
29
  */
18
- type ButtonProps = {
19
- type: 'primary' | 'secondary' | 'tertiary';
20
- variant: 'default' | 'danger' | 'cancel';
21
- size: 'sm' | 'md';
22
- icon?: ApIcon;
23
- disabled?: boolean;
24
- loading?: boolean;
25
- children?: React.ReactNode;
26
- onClick?: () => void;
27
- className?: string;
28
- iconClassName?: string;
29
- } & DataAttributes;
30
- export default function Button({ type, variant, size, icon, disabled, loading, onClick, children, className, iconClassName, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
31
- export {};
30
+ export default function Button({ type, variant, size, icon, disabled, loading, children, className, iconClassName, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { c as d } from "../../clsx-OuTLNxxd.js";
3
- import B from "../Spinner/Spinner.js";
4
- import '../../assets/Button.css';const p = "Button-module__btn___daEdK", g = "Button-module__loading___QfItr", t = {
5
- btn: p,
1
+ import { jsxs as y, jsx as b } from "react/jsx-runtime";
2
+ import { c as a } from "../../clsx-OuTLNxxd.js";
3
+ import f from "../Spinner/Spinner.js";
4
+ import g from "../Icon/Icon.js";
5
+ import '../../assets/Button.css';const w = "Button-module__btn___daEdK", x = "Button-module__loading___QfItr", t = {
6
+ btn: w,
6
7
  "btn-icon": "Button-module__btn-icon___G7m4S",
7
8
  "btn-icon-sm": "Button-module__btn-icon-sm___w7eg9",
8
9
  "btn-icon-md": "Button-module__btn-icon-md___8Ywy2",
@@ -15,32 +16,33 @@ import '../../assets/Button.css';const p = "Button-module__btn___daEdK", g = "Bu
15
16
  "btn-tertiary": "Button-module__btn-tertiary___G-7lD",
16
17
  "btn-disabled": "Button-module__btn-disabled___eg1uH",
17
18
  "btn-loading": "Button-module__btn-loading___vAg78",
18
- loading: g,
19
+ loading: x,
19
20
  "btn-sm": "Button-module__btn-sm___KNlkv",
20
21
  "btn-md": "Button-module__btn-md___C8vqh",
21
22
  "btn-text": "Button-module__btn-text___3ccH9"
22
- }, y = (n) => {
23
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), n.currentTarget.click());
24
23
  };
25
- function K({
26
- type: n,
27
- variant: a,
28
- size: _,
29
- icon: b,
30
- disabled: l = !1,
31
- loading: o = !1,
32
- onClick: m,
33
- children: u,
34
- className: s,
35
- iconClassName: r,
36
- ...c
24
+ function h({
25
+ type: c,
26
+ variant: i,
27
+ size: o,
28
+ icon: l,
29
+ disabled: u = !1,
30
+ loading: e = !1,
31
+ children: d,
32
+ className: r,
33
+ iconClassName: s,
34
+ ..._
37
35
  }) {
38
- return /* @__PURE__ */ i("button", { type: "button", className: d(t.btn, t[`btn-${n}`], t[`btn-${a}`], t[`btn-${_}`], l && t["btn-disabled"], s), disabled: l || o, onClick: m, onKeyDown: y, ...c, children: [
39
- !!b && !o && /* @__PURE__ */ e("span", { className: d(t["btn-icon"], t[`btn-icon-${_}`], b, r) }),
40
- o && /* @__PURE__ */ e(B, { size: _, color: "white", className: t["loading-spinner"] }),
41
- u && /* @__PURE__ */ e("span", { className: t["btn-text"], children: u })
36
+ const B = (n) => {
37
+ var m;
38
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), n.currentTarget.click()), (m = _.onKeyDown) == null || m.call(_, n);
39
+ };
40
+ return /* @__PURE__ */ y("button", { type: "button", className: a(t.btn, t[`btn-${c}`], t[`btn-${i}`], t[`btn-${o}`], u && t["btn-disabled"], r), disabled: u || e, onKeyDown: B, ..._, children: [
41
+ !!l && !e && /* @__PURE__ */ b(g, { icon: l, className: a(t["btn-icon"], t[`btn-icon-${o}`], s) }),
42
+ e && /* @__PURE__ */ b(f, { size: o, color: "white", className: t["loading-spinner"] }),
43
+ d && /* @__PURE__ */ b("span", { className: t["btn-text"], children: d })
42
44
  ] });
43
45
  }
44
46
  export {
45
- K as default
47
+ h as default
46
48
  };
@@ -1,11 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { CheckedState } from '@radix-ui/react-checkbox';
3
+ import { InteractiveEventHandlers } from '../../types/native-events';
3
4
  type CheckboxProps = {
5
+ className?: string;
4
6
  label: ReactNode;
5
7
  checked?: boolean;
6
8
  disabled?: boolean;
7
9
  onChange?: ((checked: CheckedState) => void) | undefined;
8
- };
10
+ } & InteractiveEventHandlers;
9
11
  /**
10
12
  * Checkboxes are used when there are multiple items to select in a list.
11
13
  *
@@ -16,5 +18,5 @@ type CheckboxProps = {
16
18
  * @param {(checked: CheckedState) => void} [props.onChange] - Callback fired when the checkbox state changes
17
19
  * @returns {JSX.Element} The rendered Checkbox component
18
20
  */
19
- export default function Checkbox({ label, checked, disabled, onChange, }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
21
+ export default function Checkbox({ className, label, checked, disabled, onChange, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
20
22
  export {};
@@ -1,11 +1,11 @@
1
- import { jsx as u, jsxs as B, Fragment as j } from "react/jsx-runtime";
2
- import * as p from "react";
1
+ import { jsx as h, jsxs as B, Fragment as j } from "react/jsx-runtime";
2
+ import * as b from "react";
3
3
  import { useId as z, useState as G, useEffect as J } from "react";
4
4
  import U from "../Icon/Icon.js";
5
5
  import { c as P } from "../../clsx-OuTLNxxd.js";
6
- import { c as V, P as N, u as W, d as M, a as g, e as $ } from "../../index-CVlmPg9Z.js";
6
+ import { c as V, P as w, u as W, d as D, a as g, e as $ } from "../../index-DWydnyjJ.js";
7
7
  import { u as Q } from "../../index-BZPx6jYI.js";
8
- import { P as Y } from "../../index-BvhDRUM9.js";
8
+ import { P as Y } from "../../index-DpfPnSMn.js";
9
9
  import '../../assets/Checkbox.css';const Z = "Checkbox-module__wrapper___rznMS", ee = "Checkbox-module__root___BS5dT", te = "Checkbox-module__indicator___HXLHH", oe = "Checkbox-module__checked___XfvkJ", re = "Checkbox-module__icon___VMxEf", ce = "Checkbox-module__label___JBaRm", ne = "Checkbox-module__disabled___WagIC", C = {
10
10
  wrapper: Z,
11
11
  root: ee,
@@ -15,137 +15,137 @@ import '../../assets/Checkbox.css';const Z = "Checkbox-module__wrapper___rznMS",
15
15
  label: ce,
16
16
  disabled: ne
17
17
  };
18
- var y = "Checkbox", [se, ke] = V(y), [ae, S] = se(y);
18
+ var I = "Checkbox", [se, ke] = V(I), [ae, N] = se(I);
19
19
  function de(t) {
20
20
  const {
21
- __scopeCheckbox: c,
22
- checked: o,
23
- children: n,
21
+ __scopeCheckbox: n,
22
+ checked: c,
23
+ children: s,
24
24
  defaultChecked: r,
25
25
  disabled: e,
26
- form: f,
27
- name: s,
28
- onCheckedChange: i,
29
- required: a,
30
- value: k = "on",
26
+ form: p,
27
+ name: i,
28
+ onCheckedChange: a,
29
+ required: l,
30
+ value: m = "on",
31
31
  // @ts-expect-error
32
- internal_do_not_use_render: h
33
- } = t, [b, v] = W({
34
- prop: o,
32
+ internal_do_not_use_render: o
33
+ } = t, [u, v] = W({
34
+ prop: c,
35
35
  defaultProp: r ?? !1,
36
- onChange: i,
37
- caller: y
38
- }), [_, x] = p.useState(null), [I, d] = p.useState(null), l = p.useRef(!1), E = _ ? !!f || !!_.closest("form") : (
36
+ onChange: a,
37
+ caller: I
38
+ }), [_, x] = b.useState(null), [y, d] = b.useState(null), f = b.useRef(!1), E = _ ? !!p || !!_.closest("form") : (
39
39
  // We set this to true by default so that events bubble to forms without JS (SSR)
40
40
  !0
41
41
  ), R = {
42
- checked: b,
42
+ checked: u,
43
43
  disabled: e,
44
44
  setChecked: v,
45
45
  control: _,
46
46
  setControl: x,
47
- name: s,
48
- form: f,
49
- value: k,
50
- hasConsumerStoppedPropagationRef: l,
51
- required: a,
52
- defaultChecked: m(r) ? !1 : r,
47
+ name: i,
48
+ form: p,
49
+ value: m,
50
+ hasConsumerStoppedPropagationRef: f,
51
+ required: l,
52
+ defaultChecked: k(r) ? !1 : r,
53
53
  isFormControl: E,
54
- bubbleInput: I,
54
+ bubbleInput: y,
55
55
  setBubbleInput: d
56
56
  };
57
- return /* @__PURE__ */ u(
57
+ return /* @__PURE__ */ h(
58
58
  ae,
59
59
  {
60
- scope: c,
60
+ scope: n,
61
61
  ...R,
62
- children: ie(h) ? h(R) : n
62
+ children: ie(o) ? o(R) : s
63
63
  }
64
64
  );
65
65
  }
66
- var D = "CheckboxTrigger", T = p.forwardRef(
67
- ({ __scopeCheckbox: t, onKeyDown: c, onClick: o, ...n }, r) => {
66
+ var M = "CheckboxTrigger", T = b.forwardRef(
67
+ ({ __scopeCheckbox: t, onKeyDown: n, onClick: c, ...s }, r) => {
68
68
  const {
69
69
  control: e,
70
- value: f,
71
- disabled: s,
72
- checked: i,
73
- required: a,
74
- setControl: k,
75
- setChecked: h,
76
- hasConsumerStoppedPropagationRef: b,
70
+ value: p,
71
+ disabled: i,
72
+ checked: a,
73
+ required: l,
74
+ setControl: m,
75
+ setChecked: o,
76
+ hasConsumerStoppedPropagationRef: u,
77
77
  isFormControl: v,
78
78
  bubbleInput: _
79
- } = S(D, t), x = M(r, k), I = p.useRef(i);
80
- return p.useEffect(() => {
79
+ } = N(M, t), x = D(r, m), y = b.useRef(a);
80
+ return b.useEffect(() => {
81
81
  const d = e == null ? void 0 : e.form;
82
82
  if (d) {
83
- const l = () => h(I.current);
84
- return d.addEventListener("reset", l), () => d.removeEventListener("reset", l);
83
+ const f = () => o(y.current);
84
+ return d.addEventListener("reset", f), () => d.removeEventListener("reset", f);
85
85
  }
86
- }, [e, h]), /* @__PURE__ */ u(
87
- N.button,
86
+ }, [e, o]), /* @__PURE__ */ h(
87
+ w.button,
88
88
  {
89
89
  type: "button",
90
90
  role: "checkbox",
91
- "aria-checked": m(i) ? "mixed" : i,
92
- "aria-required": a,
93
- "data-state": K(i),
94
- "data-disabled": s ? "" : void 0,
95
- disabled: s,
96
- value: f,
97
- ...n,
91
+ "aria-checked": k(a) ? "mixed" : a,
92
+ "aria-required": l,
93
+ "data-state": L(a),
94
+ "data-disabled": i ? "" : void 0,
95
+ disabled: i,
96
+ value: p,
97
+ ...s,
98
98
  ref: x,
99
- onKeyDown: g(c, (d) => {
99
+ onKeyDown: g(n, (d) => {
100
100
  d.key === "Enter" && d.preventDefault();
101
101
  }),
102
- onClick: g(o, (d) => {
103
- h((l) => m(l) ? !0 : !l), _ && v && (b.current = d.isPropagationStopped(), b.current || d.stopPropagation());
102
+ onClick: g(c, (d) => {
103
+ o((f) => k(f) ? !0 : !f), _ && v && (u.current = d.isPropagationStopped(), u.current || d.stopPropagation());
104
104
  })
105
105
  }
106
106
  );
107
107
  }
108
108
  );
109
- T.displayName = D;
110
- var H = p.forwardRef(
111
- (t, c) => {
109
+ T.displayName = M;
110
+ var H = b.forwardRef(
111
+ (t, n) => {
112
112
  const {
113
- __scopeCheckbox: o,
114
- name: n,
113
+ __scopeCheckbox: c,
114
+ name: s,
115
115
  checked: r,
116
116
  defaultChecked: e,
117
- required: f,
118
- disabled: s,
119
- value: i,
120
- onCheckedChange: a,
121
- form: k,
122
- ...h
117
+ required: p,
118
+ disabled: i,
119
+ value: a,
120
+ onCheckedChange: l,
121
+ form: m,
122
+ ...o
123
123
  } = t;
124
- return /* @__PURE__ */ u(
124
+ return /* @__PURE__ */ h(
125
125
  de,
126
126
  {
127
- __scopeCheckbox: o,
127
+ __scopeCheckbox: c,
128
128
  checked: r,
129
129
  defaultChecked: e,
130
- disabled: s,
131
- required: f,
132
- onCheckedChange: a,
133
- name: n,
134
- form: k,
135
- value: i,
136
- internal_do_not_use_render: ({ isFormControl: b }) => /* @__PURE__ */ B(j, { children: [
137
- /* @__PURE__ */ u(
130
+ disabled: i,
131
+ required: p,
132
+ onCheckedChange: l,
133
+ name: s,
134
+ form: m,
135
+ value: a,
136
+ internal_do_not_use_render: ({ isFormControl: u }) => /* @__PURE__ */ B(j, { children: [
137
+ /* @__PURE__ */ h(
138
138
  T,
139
139
  {
140
- ...h,
141
- ref: c,
142
- __scopeCheckbox: o
140
+ ...o,
141
+ ref: n,
142
+ __scopeCheckbox: c
143
143
  }
144
144
  ),
145
- b && /* @__PURE__ */ u(
146
- L,
145
+ u && /* @__PURE__ */ h(
146
+ K,
147
147
  {
148
- __scopeCheckbox: o
148
+ __scopeCheckbox: c
149
149
  }
150
150
  )
151
151
  ] })
@@ -153,21 +153,21 @@ var H = p.forwardRef(
153
153
  );
154
154
  }
155
155
  );
156
- H.displayName = y;
157
- var q = "CheckboxIndicator", A = p.forwardRef(
158
- (t, c) => {
159
- const { __scopeCheckbox: o, forceMount: n, ...r } = t, e = S(q, o);
160
- return /* @__PURE__ */ u(
156
+ H.displayName = I;
157
+ var q = "CheckboxIndicator", A = b.forwardRef(
158
+ (t, n) => {
159
+ const { __scopeCheckbox: c, forceMount: s, ...r } = t, e = N(q, c);
160
+ return /* @__PURE__ */ h(
161
161
  Y,
162
162
  {
163
- present: n || m(e.checked) || e.checked === !0,
164
- children: /* @__PURE__ */ u(
165
- N.span,
163
+ present: s || k(e.checked) || e.checked === !0,
164
+ children: /* @__PURE__ */ h(
165
+ w.span,
166
166
  {
167
- "data-state": K(e.checked),
167
+ "data-state": L(e.checked),
168
168
  "data-disabled": e.disabled ? "" : void 0,
169
169
  ...r,
170
- ref: c,
170
+ ref: n,
171
171
  style: { pointerEvents: "none", ...t.style }
172
172
  }
173
173
  )
@@ -176,51 +176,51 @@ var q = "CheckboxIndicator", A = p.forwardRef(
176
176
  }
177
177
  );
178
178
  A.displayName = q;
179
- var F = "CheckboxBubbleInput", L = p.forwardRef(
180
- ({ __scopeCheckbox: t, ...c }, o) => {
179
+ var F = "CheckboxBubbleInput", K = b.forwardRef(
180
+ ({ __scopeCheckbox: t, ...n }, c) => {
181
181
  const {
182
- control: n,
182
+ control: s,
183
183
  hasConsumerStoppedPropagationRef: r,
184
184
  checked: e,
185
- defaultChecked: f,
186
- required: s,
187
- disabled: i,
188
- name: a,
189
- value: k,
190
- form: h,
191
- bubbleInput: b,
185
+ defaultChecked: p,
186
+ required: i,
187
+ disabled: a,
188
+ name: l,
189
+ value: m,
190
+ form: o,
191
+ bubbleInput: u,
192
192
  setBubbleInput: v
193
- } = S(F, t), _ = M(o, v), x = Q(e), I = $(n);
194
- p.useEffect(() => {
195
- const l = b;
196
- if (!l) return;
197
- const E = window.HTMLInputElement.prototype, w = Object.getOwnPropertyDescriptor(
193
+ } = N(F, t), _ = D(c, v), x = Q(e), y = $(s);
194
+ b.useEffect(() => {
195
+ const f = u;
196
+ if (!f) return;
197
+ const E = window.HTMLInputElement.prototype, S = Object.getOwnPropertyDescriptor(
198
198
  E,
199
199
  "checked"
200
200
  ).set, O = !r.current;
201
- if (x !== e && w) {
201
+ if (x !== e && S) {
202
202
  const X = new Event("click", { bubbles: O });
203
- l.indeterminate = m(e), w.call(l, m(e) ? !1 : e), l.dispatchEvent(X);
203
+ f.indeterminate = k(e), S.call(f, k(e) ? !1 : e), f.dispatchEvent(X);
204
204
  }
205
- }, [b, x, e, r]);
206
- const d = p.useRef(m(e) ? !1 : e);
207
- return /* @__PURE__ */ u(
208
- N.input,
205
+ }, [u, x, e, r]);
206
+ const d = b.useRef(k(e) ? !1 : e);
207
+ return /* @__PURE__ */ h(
208
+ w.input,
209
209
  {
210
210
  type: "checkbox",
211
211
  "aria-hidden": !0,
212
- defaultChecked: f ?? d.current,
213
- required: s,
214
- disabled: i,
215
- name: a,
216
- value: k,
217
- form: h,
218
- ...c,
212
+ defaultChecked: p ?? d.current,
213
+ required: i,
214
+ disabled: a,
215
+ name: l,
216
+ value: m,
217
+ form: o,
218
+ ...n,
219
219
  tabIndex: -1,
220
220
  ref: _,
221
221
  style: {
222
- ...c.style,
223
- ...I,
222
+ ...n.style,
223
+ ...y,
224
224
  position: "absolute",
225
225
  pointerEvents: "none",
226
226
  opacity: 0,
@@ -234,34 +234,37 @@ var F = "CheckboxBubbleInput", L = p.forwardRef(
234
234
  );
235
235
  }
236
236
  );
237
- L.displayName = F;
237
+ K.displayName = F;
238
238
  function ie(t) {
239
239
  return typeof t == "function";
240
240
  }
241
- function m(t) {
241
+ function k(t) {
242
242
  return t === "indeterminate";
243
243
  }
244
- function K(t) {
245
- return m(t) ? "indeterminate" : t ? "checked" : "unchecked";
244
+ function L(t) {
245
+ return k(t) ? "indeterminate" : t ? "checked" : "unchecked";
246
246
  }
247
247
  function _e({
248
- label: t,
248
+ className: t,
249
+ label: n,
249
250
  checked: c = !1,
250
- disabled: o = !1,
251
- onChange: n
251
+ disabled: s = !1,
252
+ onChange: r,
253
+ ...e
252
254
  }) {
253
- const r = z(), [e, f] = G(c);
255
+ const p = z(), [i, a] = G(c);
254
256
  J(() => {
255
- f(c);
257
+ a(c);
256
258
  }, [c]);
257
- const s = (a) => {
258
- f(a), n == null || n(a);
259
- }, i = (a) => {
260
- !o && a.key === " " && (a.preventDefault(), s == null || s(!e));
259
+ const l = (o) => {
260
+ a(o), r == null || r(o);
261
+ }, m = (o) => {
262
+ var u;
263
+ !s && o.key === " " && (o.preventDefault(), l == null || l(!i)), (u = e.onKeyDown) == null || u.call(e, o);
261
264
  };
262
- return /* @__PURE__ */ B("div", { className: P(C.wrapper, o && C.disabled), children: [
263
- /* @__PURE__ */ u(H, { id: r, className: P(C.root, e && C.checked), checked: e, onCheckedChange: s, onKeyDown: i, disabled: o, children: /* @__PURE__ */ u(A, { className: P(C.indicator), children: /* @__PURE__ */ u(U, { icon: "ap-icon-check", className: C.icon }) }) }),
264
- t && /* @__PURE__ */ u("label", { className: C.label, htmlFor: r, children: t })
265
+ return /* @__PURE__ */ B("div", { className: P(C.wrapper, s && C.disabled, t), children: [
266
+ /* @__PURE__ */ h(H, { id: p, className: P(C.root, i && C.checked), checked: i, onCheckedChange: l, onKeyDown: m, disabled: s, ...e, children: /* @__PURE__ */ h(A, { className: P(C.indicator), children: /* @__PURE__ */ h(U, { icon: "ap-icon-check", className: C.icon }) }) }),
267
+ n && /* @__PURE__ */ h("label", { className: C.label, htmlFor: p, children: n })
265
268
  ] });
266
269
  }
267
270
  export {
@@ -1,6 +1,8 @@
1
1
  import { DataAttributes } from '../../types/data-attributes';
2
2
  import { DropdownOption } from '../Dropdown/Dropdown';
3
+ import { InteractiveEventHandlers } from '../../types/native-events';
3
4
  type CreatableProps = {
5
+ className?: string;
4
6
  label: string;
5
7
  required?: boolean;
6
8
  options: DropdownOption[];
@@ -10,9 +12,10 @@ type CreatableProps = {
10
12
  helpLink?: string;
11
13
  helpLinkText?: string;
12
14
  disabled?: boolean;
15
+ caseSensitive?: boolean;
13
16
  errorMessage?: string;
14
17
  onChange?: (selectedValues: string[]) => void;
15
- } & DataAttributes;
18
+ } & DataAttributes & InteractiveEventHandlers;
16
19
  /**
17
20
  * A dropdown input that lets users create new items on the fly.
18
21
  *
@@ -29,10 +32,11 @@ type CreatableProps = {
29
32
  * @param {[string]} [props.helpLink] - Optional URL for help link displayed with helper text
30
33
  * @param {[string]} [props.helpLinkText] - Optional help link label to display when `helpLink` is provided
31
34
  * @param {[boolean]} [props.disabled] - Whether the field is disabled
35
+ * @param {[boolean]} [props.caseSensitive] - Whether to perform case-sensitive matching when checking for existing options in creatable mode (defaults to false)
32
36
  * @param {[string]} [props.errorMessage] - Optional error message displayed below the field
33
37
  * @param {(selectedValues: string[]) => void} [props.onChange] - Callback fired when selection changes
34
38
  * @param {DataAttributes} [props.data-*] - Additional `data-` attributes forwarded to the root element
35
39
  * @returns {JSX.Element} The rendered Creatable component
36
40
  */
37
- export default function Creatable({ label, required, multiSelect, value, helpText, helpLink, helpLinkText, disabled, errorMessage, onChange, ...props }: CreatableProps): import("react/jsx-runtime").JSX.Element;
41
+ export default function Creatable({ className, label, required, multiSelect, value, helpText, helpLink, helpLinkText, disabled, caseSensitive, errorMessage, onChange, onClick, onDoubleClick, onMouseDown, onMouseUp, onMouseEnter, onMouseLeave, onMouseOver, onMouseOut, onMouseMove, onKeyDown, onKeyUp, onFocus, onBlur, ...props }: CreatableProps): import("react/jsx-runtime").JSX.Element;
38
42
  export {};