@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.
- package/dist/ap-logos-Cl1TR5nm.js +4 -0
- package/dist/assets/Banner.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/DragAndDrop.css +1 -1
- package/dist/assets/Dropdown.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/LogosGallery.css +1 -0
- package/dist/assets/NavBar.css +1 -1
- package/dist/assets/SplitButton.css +1 -1
- package/dist/assets/TabNavigation.css +1 -1
- package/dist/assets/Tag.css +1 -1
- package/dist/assets/Textarea.css +1 -1
- package/dist/assets/Toast.css +1 -1
- package/dist/assets/Tooltip.css +1 -1
- package/dist/assets/ap-icons-types.d.ts +1 -1
- package/dist/assets/ap-icons.d.ts +1 -1
- package/dist/assets/ap-logos-types.d.ts +1 -0
- package/dist/assets/ap-logos.d.ts +1 -0
- package/dist/assets/main.css +1 -1
- package/dist/components/Banner/Banner.d.ts +4 -2
- package/dist/components/Banner/Banner.js +23 -21
- package/dist/components/Button/Button.d.ts +13 -14
- package/dist/components/Button/Button.js +27 -25
- package/dist/components/Checkbox/Checkbox.d.ts +4 -2
- package/dist/components/Checkbox/Checkbox.js +141 -138
- package/dist/components/Creatable/Creatable.d.ts +6 -2
- package/dist/components/Creatable/Creatable.js +29 -14
- package/dist/components/Dialog/Dialog.d.ts +16 -4
- package/dist/components/Dialog/Dialog.js +58 -41
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +10 -5
- package/dist/components/DragAndDrop/DragAndDrop.js +81 -70
- package/dist/components/Dropdown/Dropdown.d.ts +11 -2
- package/dist/components/Dropdown/Dropdown.js +383 -345
- package/dist/components/Ghost/Ghost.d.ts +4 -2
- package/dist/components/Ghost/Ghost.js +18 -15
- package/dist/components/Icons/IconsGallery.js +1 -1
- package/dist/components/Input/Input.d.ts +25 -22
- package/dist/components/Input/Input.js +62 -58
- package/dist/components/Logo/Logo.d.ts +8 -0
- package/dist/components/Logo/Logo.js +57 -0
- package/dist/components/Logos/LogosGallery.d.ts +1 -0
- package/dist/components/Logos/LogosGallery.js +16 -0
- package/dist/components/NavBar/NavBar.d.ts +14 -5
- package/dist/components/NavBar/NavBar.js +241 -224
- package/dist/components/Radio/Radio.d.ts +3 -2
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +4 -2
- package/dist/components/RadioGroup/RadioGroup.js +14 -13
- package/dist/components/Search/Search.d.ts +6 -4
- package/dist/components/Search/Search.js +20 -18
- package/dist/components/SplitButton/SplitButton.d.ts +4 -2
- package/dist/components/SplitButton/SplitButton.js +115 -106
- package/dist/components/Tab/Tab.d.ts +4 -2
- package/dist/components/Tab/Tab.js +27 -24
- package/dist/components/TabNavigation/TabNavigation.d.ts +3 -1
- package/dist/components/TabNavigation/TabNavigation.js +15 -8
- package/dist/components/Tag/Tag.d.ts +2 -1
- package/dist/components/Tag/Tag.js +8 -8
- package/dist/components/TagsFields/TagsFields.d.ts +4 -2
- package/dist/components/TagsFields/TagsFields.js +7 -6
- package/dist/components/Textarea/Textarea.d.ts +7 -5
- package/dist/components/Textarea/Textarea.js +27 -25
- package/dist/components/Toast/Toast.d.ts +4 -2
- package/dist/components/Toast/Toast.js +23 -22
- package/dist/components/Toast/Toast.test.js +1 -1
- package/dist/components/Toggle/Toggle.d.ts +4 -2
- package/dist/components/Toggle/Toggle.js +80 -78
- package/dist/components/Tooltip/Tooltip.d.ts +2 -1
- package/dist/components/Tooltip/Tooltip.js +376 -123
- package/dist/index-2H7slGYV.js +23 -0
- package/dist/index-BGZDIjm9.js +674 -0
- package/dist/{index-snhwePGJ.js → index-BJXIvJs4.js} +3 -3
- package/dist/{index-DNvS1y4S.js → index-CVWHq7Pr.js} +33 -32
- package/dist/{index-DrL-TXFC.js → index-CjQV7MmW.js} +2 -2
- package/dist/index-DWydnyjJ.js +245 -0
- package/dist/index-DieLVN0p.js +1664 -0
- package/dist/{index-BvhDRUM9.js → index-DpfPnSMn.js} +1 -1
- package/dist/main.d.ts +10 -8
- package/dist/main.js +29 -25
- package/dist/storybook-docs-page.d.ts +4 -1
- package/dist/types/native-events.d.ts +80 -0
- package/package.json +1 -1
- package/dist/index-Bx8a_H5C.js +0 -2331
- package/dist/index-CVlmPg9Z.js +0 -239
- 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
|
|
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
|
|
5
|
-
root:
|
|
6
|
-
info:
|
|
7
|
-
lg:
|
|
8
|
-
md:
|
|
9
|
-
sm:
|
|
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:
|
|
12
|
-
error:
|
|
13
|
-
success:
|
|
14
|
-
ai:
|
|
15
|
-
inner:
|
|
16
|
-
icon:
|
|
17
|
-
closeIcon:
|
|
18
|
-
btnClose:
|
|
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
|
|
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
|
|
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__ */
|
|
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:
|
|
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
|
-
|
|
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
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
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:
|
|
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
|
|
26
|
-
type:
|
|
27
|
-
variant:
|
|
28
|
-
size:
|
|
29
|
-
icon:
|
|
30
|
-
disabled:
|
|
31
|
-
loading:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import * as
|
|
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
|
|
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-
|
|
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
|
|
18
|
+
var I = "Checkbox", [se, ke] = V(I), [ae, N] = se(I);
|
|
19
19
|
function de(t) {
|
|
20
20
|
const {
|
|
21
|
-
__scopeCheckbox:
|
|
22
|
-
checked:
|
|
23
|
-
children:
|
|
21
|
+
__scopeCheckbox: n,
|
|
22
|
+
checked: c,
|
|
23
|
+
children: s,
|
|
24
24
|
defaultChecked: r,
|
|
25
25
|
disabled: e,
|
|
26
|
-
form:
|
|
27
|
-
name:
|
|
28
|
-
onCheckedChange:
|
|
29
|
-
required:
|
|
30
|
-
value:
|
|
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:
|
|
33
|
-
} = t, [
|
|
34
|
-
prop:
|
|
32
|
+
internal_do_not_use_render: o
|
|
33
|
+
} = t, [u, v] = W({
|
|
34
|
+
prop: c,
|
|
35
35
|
defaultProp: r ?? !1,
|
|
36
|
-
onChange:
|
|
37
|
-
caller:
|
|
38
|
-
}), [_, x] =
|
|
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:
|
|
42
|
+
checked: u,
|
|
43
43
|
disabled: e,
|
|
44
44
|
setChecked: v,
|
|
45
45
|
control: _,
|
|
46
46
|
setControl: x,
|
|
47
|
-
name:
|
|
48
|
-
form:
|
|
49
|
-
value:
|
|
50
|
-
hasConsumerStoppedPropagationRef:
|
|
51
|
-
required:
|
|
52
|
-
defaultChecked:
|
|
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:
|
|
54
|
+
bubbleInput: y,
|
|
55
55
|
setBubbleInput: d
|
|
56
56
|
};
|
|
57
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ h(
|
|
58
58
|
ae,
|
|
59
59
|
{
|
|
60
|
-
scope:
|
|
60
|
+
scope: n,
|
|
61
61
|
...R,
|
|
62
|
-
children: ie(
|
|
62
|
+
children: ie(o) ? o(R) : s
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
({ __scopeCheckbox: t, onKeyDown:
|
|
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:
|
|
71
|
-
disabled:
|
|
72
|
-
checked:
|
|
73
|
-
required:
|
|
74
|
-
setControl:
|
|
75
|
-
setChecked:
|
|
76
|
-
hasConsumerStoppedPropagationRef:
|
|
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
|
-
} =
|
|
80
|
-
return
|
|
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
|
|
84
|
-
return d.addEventListener("reset",
|
|
83
|
+
const f = () => o(y.current);
|
|
84
|
+
return d.addEventListener("reset", f), () => d.removeEventListener("reset", f);
|
|
85
85
|
}
|
|
86
|
-
}, [e,
|
|
87
|
-
|
|
86
|
+
}, [e, o]), /* @__PURE__ */ h(
|
|
87
|
+
w.button,
|
|
88
88
|
{
|
|
89
89
|
type: "button",
|
|
90
90
|
role: "checkbox",
|
|
91
|
-
"aria-checked":
|
|
92
|
-
"aria-required":
|
|
93
|
-
"data-state":
|
|
94
|
-
"data-disabled":
|
|
95
|
-
disabled:
|
|
96
|
-
value:
|
|
97
|
-
...
|
|
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(
|
|
99
|
+
onKeyDown: g(n, (d) => {
|
|
100
100
|
d.key === "Enter" && d.preventDefault();
|
|
101
101
|
}),
|
|
102
|
-
onClick: g(
|
|
103
|
-
|
|
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 =
|
|
110
|
-
var H =
|
|
111
|
-
(t,
|
|
109
|
+
T.displayName = M;
|
|
110
|
+
var H = b.forwardRef(
|
|
111
|
+
(t, n) => {
|
|
112
112
|
const {
|
|
113
|
-
__scopeCheckbox:
|
|
114
|
-
name:
|
|
113
|
+
__scopeCheckbox: c,
|
|
114
|
+
name: s,
|
|
115
115
|
checked: r,
|
|
116
116
|
defaultChecked: e,
|
|
117
|
-
required:
|
|
118
|
-
disabled:
|
|
119
|
-
value:
|
|
120
|
-
onCheckedChange:
|
|
121
|
-
form:
|
|
122
|
-
...
|
|
117
|
+
required: p,
|
|
118
|
+
disabled: i,
|
|
119
|
+
value: a,
|
|
120
|
+
onCheckedChange: l,
|
|
121
|
+
form: m,
|
|
122
|
+
...o
|
|
123
123
|
} = t;
|
|
124
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ h(
|
|
125
125
|
de,
|
|
126
126
|
{
|
|
127
|
-
__scopeCheckbox:
|
|
127
|
+
__scopeCheckbox: c,
|
|
128
128
|
checked: r,
|
|
129
129
|
defaultChecked: e,
|
|
130
|
-
disabled:
|
|
131
|
-
required:
|
|
132
|
-
onCheckedChange:
|
|
133
|
-
name:
|
|
134
|
-
form:
|
|
135
|
-
value:
|
|
136
|
-
internal_do_not_use_render: ({ isFormControl:
|
|
137
|
-
/* @__PURE__ */
|
|
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
|
-
...
|
|
141
|
-
ref:
|
|
142
|
-
__scopeCheckbox:
|
|
140
|
+
...o,
|
|
141
|
+
ref: n,
|
|
142
|
+
__scopeCheckbox: c
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
u && /* @__PURE__ */ h(
|
|
146
|
+
K,
|
|
147
147
|
{
|
|
148
|
-
__scopeCheckbox:
|
|
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 =
|
|
157
|
-
var q = "CheckboxIndicator", A =
|
|
158
|
-
(t,
|
|
159
|
-
const { __scopeCheckbox:
|
|
160
|
-
return /* @__PURE__ */
|
|
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:
|
|
164
|
-
children: /* @__PURE__ */
|
|
165
|
-
|
|
163
|
+
present: s || k(e.checked) || e.checked === !0,
|
|
164
|
+
children: /* @__PURE__ */ h(
|
|
165
|
+
w.span,
|
|
166
166
|
{
|
|
167
|
-
"data-state":
|
|
167
|
+
"data-state": L(e.checked),
|
|
168
168
|
"data-disabled": e.disabled ? "" : void 0,
|
|
169
169
|
...r,
|
|
170
|
-
ref:
|
|
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",
|
|
180
|
-
({ __scopeCheckbox: t, ...
|
|
179
|
+
var F = "CheckboxBubbleInput", K = b.forwardRef(
|
|
180
|
+
({ __scopeCheckbox: t, ...n }, c) => {
|
|
181
181
|
const {
|
|
182
|
-
control:
|
|
182
|
+
control: s,
|
|
183
183
|
hasConsumerStoppedPropagationRef: r,
|
|
184
184
|
checked: e,
|
|
185
|
-
defaultChecked:
|
|
186
|
-
required:
|
|
187
|
-
disabled:
|
|
188
|
-
name:
|
|
189
|
-
value:
|
|
190
|
-
form:
|
|
191
|
-
bubbleInput:
|
|
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
|
-
} =
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
if (!
|
|
197
|
-
const E = window.HTMLInputElement.prototype,
|
|
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 &&
|
|
201
|
+
if (x !== e && S) {
|
|
202
202
|
const X = new Event("click", { bubbles: O });
|
|
203
|
-
|
|
203
|
+
f.indeterminate = k(e), S.call(f, k(e) ? !1 : e), f.dispatchEvent(X);
|
|
204
204
|
}
|
|
205
|
-
}, [
|
|
206
|
-
const d =
|
|
207
|
-
return /* @__PURE__ */
|
|
208
|
-
|
|
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:
|
|
213
|
-
required:
|
|
214
|
-
disabled:
|
|
215
|
-
name:
|
|
216
|
-
value:
|
|
217
|
-
form:
|
|
218
|
-
...
|
|
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
|
-
...
|
|
223
|
-
...
|
|
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
|
-
|
|
237
|
+
K.displayName = F;
|
|
238
238
|
function ie(t) {
|
|
239
239
|
return typeof t == "function";
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function k(t) {
|
|
242
242
|
return t === "indeterminate";
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
return
|
|
244
|
+
function L(t) {
|
|
245
|
+
return k(t) ? "indeterminate" : t ? "checked" : "unchecked";
|
|
246
246
|
}
|
|
247
247
|
function _e({
|
|
248
|
-
|
|
248
|
+
className: t,
|
|
249
|
+
label: n,
|
|
249
250
|
checked: c = !1,
|
|
250
|
-
disabled:
|
|
251
|
-
onChange:
|
|
251
|
+
disabled: s = !1,
|
|
252
|
+
onChange: r,
|
|
253
|
+
...e
|
|
252
254
|
}) {
|
|
253
|
-
const
|
|
255
|
+
const p = z(), [i, a] = G(c);
|
|
254
256
|
J(() => {
|
|
255
|
-
|
|
257
|
+
a(c);
|
|
256
258
|
}, [c]);
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
},
|
|
260
|
-
|
|
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,
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
|
|
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 {};
|