@iress-oss/ids-components 6.0.0 → 6.1.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/Autocomplete-BRGD9dSh.js +321 -0
- package/dist/Shadow-D2KoVwxD.js +57 -0
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +1 -1
- package/dist/components/Autocomplete/index.js +2 -2
- package/dist/components/Expander/Expander.styles.d.ts +4 -0
- package/dist/components/Expander/Expander.styles.js +5 -1
- package/dist/components/Field/Field.js +47 -47
- package/dist/components/Field/Field.styles.d.ts +2 -2
- package/dist/components/Field/Field.styles.js +8 -2
- package/dist/components/Field/components/FieldHint.js +27 -19
- package/dist/components/Field/index.d.ts +0 -2
- package/dist/components/Field/index.js +1 -3
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.js +10 -9
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.d.ts +8 -1
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.js +6 -4
- package/dist/components/FieldGroup/index.d.ts +2 -0
- package/dist/components/FieldGroup/index.js +3 -0
- package/dist/components/Input/Input.styles.d.ts +4 -4
- package/dist/components/Input/Input.styles.js +4 -4
- package/dist/components/Link/Link.styles.d.ts +1 -0
- package/dist/components/Link/Link.styles.js +4 -1
- package/dist/components/Menu/Menu.js +81 -77
- package/dist/components/Menu/Menu.styles.js +7 -0
- package/dist/components/Menu/MenuGroup/MenuGroup.d.ts +18 -3
- package/dist/components/Menu/MenuGroup/MenuGroup.js +38 -34
- package/dist/components/Menu/MenuHeading/MenuHeading.d.ts +20 -0
- package/dist/components/Menu/MenuHeading/MenuHeading.js +14 -0
- package/dist/components/Menu/MenuItem/MenuItem.styles.js +9 -0
- package/dist/components/Menu/MenuText/MenuText.d.ts +1 -5
- package/dist/components/Menu/MenuText/MenuText.js +11 -17
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/index.js +4 -3
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/SelectHeading/SelectHeading.js +5 -5
- package/dist/components/Select/SelectTags/SelectTags.js +15 -15
- package/dist/components/Select/components/SelectOptions.js +108 -95
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Slideout/Slideout.styles.js +1 -0
- package/dist/components/TabSet/TabSet.d.ts +6 -1
- package/dist/components/TabSet/TabSet.js +34 -30
- package/dist/components/TabSet/TabSet.styles.d.ts +1 -1
- package/dist/components/TabSet/TabSet.styles.js +13 -1
- package/dist/components/Tag/Tag.styles.d.ts +14 -14
- package/dist/components/Tag/Tag.styles.js +16 -16
- package/dist/components/Tag/index.d.ts +0 -1
- package/dist/components/Tag/index.js +1 -2
- package/dist/components/{Tag/TagInput → TagInput}/TagInput.d.ts +1 -1
- package/dist/components/{Tag/TagInput → TagInput}/TagInput.js +7 -7
- package/dist/components/TagInput/TagInput.styles.d.ts +1 -0
- package/dist/components/{Tag/TagInput → TagInput}/TagInput.styles.js +2 -2
- package/dist/components/TagInput/index.d.ts +2 -0
- package/dist/components/TagInput/index.js +3 -0
- package/dist/components/Tooltip/Tooltip.d.ts +7 -2
- package/dist/components/Tooltip/Tooltip.js +48 -42
- package/dist/components/Tooltip/TooltipProvider.d.ts +27 -0
- package/dist/components/Tooltip/TooltipProvider.js +14 -0
- package/dist/components/Tooltip/hooks/useTooltipContainer.d.ts +17 -0
- package/dist/components/Tooltip/hooks/useTooltipContainer.js +5 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/components/Tooltip/index.js +4 -2
- package/dist/components/ValidationMessage/ValidationMessage.js +2 -2
- package/dist/main.d.ts +2 -0
- package/dist/main.js +125 -121
- package/dist/patterns/DropdownMenu/DropdownMenu.js +113 -102
- package/dist/patterns/DropdownMenu/hooks/useDropdownMenuFlags.d.ts +1 -0
- package/dist/patterns/DropdownMenu/hooks/useDropdownMenuFlags.js +1 -0
- package/dist/patterns/Form/FormField/FormFieldset.d.ts +1 -1
- package/dist/patterns/Form/FormField/FormFieldset.js +1 -1
- package/dist/patterns/Form/FormValidationSummary/FormValidationSummary.js +1 -0
- package/dist/patterns/Form/components/LongForm.js +3 -1
- package/dist/patterns/Form/components/ShortForm.js +1 -0
- package/dist/patterns/Loading/Loading.styles.d.ts +3 -0
- package/dist/patterns/Loading/Loading.styles.js +4 -1
- package/dist/patterns/Loading/components/PageLoading.js +4 -4
- package/dist/patterns/Shadow/Shadow.js +1 -1
- package/dist/patterns/Shadow/index.js +1 -1
- package/dist/patterns/SideNav/SideNav.d.ts +6 -0
- package/dist/patterns/SideNav/SideNav.js +74 -68
- package/dist/patterns/SideNav/SideNav.styles.js +6 -2
- package/dist/style.css +1 -1
- package/dist/{useAutocompleteSearch-BJ_hhoKp.js → useAutocompleteSearch-DxKxs6HH.js} +29 -24
- package/package.json +1 -1
- package/dist/Autocomplete-CuUjmIAw.js +0 -308
- package/dist/Shadow-BL3YAhE_.js +0 -57
- package/dist/components/Tag/TagInput/TagInput.styles.d.ts +0 -1
- /package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ElementType, MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { TextElements } from '../../Text';
|
|
3
3
|
import { IressMenuTextProps } from '../MenuText/MenuText';
|
|
4
4
|
import { IressPopoverProps } from '../../Popover';
|
|
5
5
|
import { MenuVariants } from '../Menu';
|
|
6
|
-
type MenuGroupRestProps<TLabel extends TextElements = 'h2', TVariant extends MenuVariants = undefined> = TVariant extends 'subdraw' ? Omit<IressPopoverProps, 'children' | 'activator'> : Omit<IressMenuTextProps<TLabel>, 'children'>;
|
|
6
|
+
type MenuGroupRestProps<TLabel extends TextElements = 'h2', TVariant extends MenuVariants = undefined> = TVariant extends 'subdraw' ? Omit<IressPopoverProps, 'children' | 'activator'> : Omit<IressMenuTextProps<TLabel>, 'children' | 'element'>;
|
|
7
7
|
export type IressMenuGroupProps<TLabel extends TextElements = 'h2', TVariant extends MenuVariants = undefined> = MenuGroupRestProps<TLabel, TVariant> & {
|
|
8
8
|
/**
|
|
9
9
|
* Whether this header is active/expanded, revealing child drawer items.
|
|
@@ -32,11 +32,26 @@ export type IressMenuGroupProps<TLabel extends TextElements = 'h2', TVariant ext
|
|
|
32
32
|
* Adds a divider after the group.
|
|
33
33
|
*/
|
|
34
34
|
divider?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Custom element type for the activator (e.g. for third-party routing).
|
|
37
|
+
* Only used when parent Menu has variant="side".
|
|
38
|
+
*/
|
|
39
|
+
element?: ElementType;
|
|
40
|
+
/**
|
|
41
|
+
* URL for the group activator link.
|
|
42
|
+
* Only used when parent Menu has variant="side".
|
|
43
|
+
*/
|
|
44
|
+
href?: string;
|
|
35
45
|
/**
|
|
36
46
|
* Callback fired when the active/expanded state changes.
|
|
37
47
|
* Only used when parent Menu has variant="side".
|
|
38
48
|
*/
|
|
39
49
|
onActiveChange?: (active?: boolean) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Click handler for the group activator.
|
|
52
|
+
* Only used when parent Menu has variant="side".
|
|
53
|
+
*/
|
|
54
|
+
onClick?: MouseEventHandler;
|
|
40
55
|
/**
|
|
41
56
|
* Variant of the menu group.
|
|
42
57
|
* - `undefined` (default): Renders inline with label as heading and children below.
|
|
@@ -53,7 +68,7 @@ export type IressMenuGroupProps<TLabel extends TextElements = 'h2', TVariant ext
|
|
|
53
68
|
* a fly-over submenu containing the group's children.
|
|
54
69
|
*/
|
|
55
70
|
export declare const IressMenuGroup: {
|
|
56
|
-
<E extends TextElements = "div", TVariant extends MenuVariants = undefined>({ append, active: activeProp, children, className, defaultActive, divider, label, onActiveChange, variant: variantProp, "data-testid": dataTestId, ...restProps }: IressMenuGroupProps<E, TVariant>): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
<E extends TextElements = "div", TVariant extends MenuVariants = undefined>({ append, active: activeProp, children, className, defaultActive, divider, element, href, label, onActiveChange, onClick, variant: variantProp, "data-testid": dataTestId, ...restProps }: IressMenuGroupProps<E, TVariant>): import("react/jsx-runtime").JSX.Element;
|
|
57
72
|
displayName: string;
|
|
58
73
|
};
|
|
59
74
|
export {};
|
|
@@ -9,40 +9,44 @@ import { IressPopover as s } from "../../Popover/Popover.js";
|
|
|
9
9
|
import { IressMenu as c, MenuContext as l } from "../Menu.js";
|
|
10
10
|
import { menuGroup as u } from "./MenuGroup.styles.js";
|
|
11
11
|
import { IressMenuDivider as d } from "../MenuDivider/MenuDivider.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { IressMenuItem as f } from "../MenuItem/MenuItem.js";
|
|
13
|
+
import { IressMenuHeading as p } from "../MenuHeading/MenuHeading.js";
|
|
14
14
|
import { useContext as m } from "react";
|
|
15
15
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
16
16
|
//#region src/components/Menu/MenuGroup/MenuGroup.tsx
|
|
17
|
-
var v = ({ append: v, active: y, children: b, className: x, defaultActive: S, divider: C,
|
|
18
|
-
let
|
|
19
|
-
if (
|
|
20
|
-
let { value:
|
|
17
|
+
var v = ({ append: v, active: y, children: b, className: x, defaultActive: S, divider: C, element: w, href: T, label: E, onActiveChange: D, onClick: O, variant: k, "data-testid": A, ...j }) => {
|
|
18
|
+
let M = a(j), N = m(l), P = o(), F = k ?? N?.variant;
|
|
19
|
+
if (F && (P?.type === "listbox" || N?.role === "listbox")) throw Error("[IressMenuGroup] IressMenu with variants cannot be used within a Menu with role=\"listbox\" or Popover with type=\"listbox\", as it is not intended for that use case. Please unset the variant for grouping in listbox contexts.");
|
|
20
|
+
let { value: I, setValue: L } = i({
|
|
21
21
|
component: "IressMenuGroup",
|
|
22
22
|
defaultValue: S,
|
|
23
|
-
onChange:
|
|
23
|
+
onChange: D,
|
|
24
24
|
value: y
|
|
25
25
|
});
|
|
26
|
-
if (
|
|
26
|
+
if (F == "side") {
|
|
27
27
|
let n = u({
|
|
28
|
-
numbered:
|
|
29
|
-
open:
|
|
28
|
+
numbered: N?.numbered,
|
|
29
|
+
open: I
|
|
30
30
|
});
|
|
31
31
|
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
|
|
32
32
|
className: e(n.root, x),
|
|
33
|
-
...
|
|
34
|
-
"data-testid":
|
|
35
|
-
children: [/* @__PURE__ */ g(
|
|
33
|
+
...j,
|
|
34
|
+
"data-testid": A,
|
|
35
|
+
children: [/* @__PURE__ */ g(f, {
|
|
36
36
|
className: e(n.activator, t.MenuGroupActivator),
|
|
37
|
-
"data-testid": r(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
"data-testid": r(A, "activator"),
|
|
38
|
+
href: T,
|
|
39
|
+
element: w,
|
|
40
|
+
onClick: (e) => {
|
|
41
|
+
L(!I), O?.(e);
|
|
42
|
+
},
|
|
43
|
+
"aria-expanded": I,
|
|
44
|
+
id: M,
|
|
45
|
+
"aria-controls": `${M}-content`,
|
|
46
|
+
children: E
|
|
43
47
|
}), /* @__PURE__ */ g("div", {
|
|
44
48
|
className: e(n.wrapper, t.MenuGroup),
|
|
45
|
-
id: `${
|
|
49
|
+
id: `${M}-content`,
|
|
46
50
|
children: /* @__PURE__ */ g("div", {
|
|
47
51
|
className: n.content,
|
|
48
52
|
children: b
|
|
@@ -50,34 +54,34 @@ var v = ({ append: v, active: y, children: b, className: x, defaultActive: S, di
|
|
|
50
54
|
})]
|
|
51
55
|
}), C && /* @__PURE__ */ g(d, {})] });
|
|
52
56
|
}
|
|
53
|
-
return
|
|
57
|
+
return F == "subdraw" ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(s, {
|
|
54
58
|
align: "right-start",
|
|
55
59
|
nested: !0,
|
|
56
60
|
offset: {
|
|
57
61
|
mainAxis: 0,
|
|
58
62
|
crossAxis: 0
|
|
59
63
|
},
|
|
60
|
-
type:
|
|
61
|
-
virtualFocus:
|
|
64
|
+
type: N?.role === "list" ? void 0 : N?.role,
|
|
65
|
+
virtualFocus: P?.isVirtualFocus,
|
|
62
66
|
contentStyle: { p: "none" },
|
|
63
|
-
...
|
|
67
|
+
...j,
|
|
64
68
|
className: e(t.MenuGroup, x),
|
|
65
|
-
"data-testid": r(
|
|
66
|
-
activator: /* @__PURE__ */ g(
|
|
69
|
+
"data-testid": r(A, "subdraw"),
|
|
70
|
+
activator: /* @__PURE__ */ g(f, {
|
|
67
71
|
append: v ?? /* @__PURE__ */ g(n, { name: "keyboard_arrow_right" }),
|
|
68
72
|
className: t.MenuGroupActivator,
|
|
69
|
-
"data-testid": r(
|
|
70
|
-
children:
|
|
73
|
+
"data-testid": r(A, "subdraw__trigger"),
|
|
74
|
+
children: E
|
|
71
75
|
}),
|
|
72
76
|
children: /* @__PURE__ */ g(c, { children: b })
|
|
73
77
|
}), C && /* @__PURE__ */ g(d, {})] }) : /* @__PURE__ */ _(h, { children: [
|
|
74
|
-
/* @__PURE__ */ g(
|
|
75
|
-
"data-testid":
|
|
76
|
-
...
|
|
78
|
+
/* @__PURE__ */ g(p, {
|
|
79
|
+
"data-testid": A,
|
|
80
|
+
...j,
|
|
77
81
|
className: e(t.MenuGroup, x),
|
|
78
|
-
srOnly:
|
|
79
|
-
width:
|
|
80
|
-
children:
|
|
82
|
+
srOnly: F == "rail" ? !0 : void 0,
|
|
83
|
+
width: F == "rail" ? "auto" : void 0,
|
|
84
|
+
children: E
|
|
81
85
|
}),
|
|
82
86
|
b,
|
|
83
87
|
C && /* @__PURE__ */ g(d, {})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TextElements } from '../../Text';
|
|
2
|
+
import { IressMenuTextProps } from '../MenuText/MenuText';
|
|
3
|
+
export type { IressMenuTextProps as IressMenuHeadingProps } from '../MenuText/MenuText';
|
|
4
|
+
/**
|
|
5
|
+
* A heading element within a menu, used to label groups of menu items.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { IressMenu, IressMenuHeading, IressMenuItem } from '@iress-oss/ids-components';
|
|
10
|
+
*
|
|
11
|
+
* <IressMenu>
|
|
12
|
+
* <IressMenuHeading>Actions</IressMenuHeading>
|
|
13
|
+
* <IressMenuItem>Edit</IressMenuItem>
|
|
14
|
+
* </IressMenu>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const IressMenuHeading: {
|
|
18
|
+
<E extends TextElements = "h2">({ className, element, textStyle, ...restProps }: IressMenuTextProps<E>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as e } from "../../../cx-CZ8IJJTy.js";
|
|
2
|
+
import { GlobalCSSClass as t } from "../../../enums.js";
|
|
3
|
+
import { IressMenuText as n } from "../MenuText/MenuText.js";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Menu/MenuHeading/MenuHeading.tsx
|
|
6
|
+
var i = ({ className: i, element: a = "h2", textStyle: o = "typography.body.md.medium", ...s }) => /* @__PURE__ */ r(n, {
|
|
7
|
+
element: a,
|
|
8
|
+
textStyle: o,
|
|
9
|
+
...s,
|
|
10
|
+
className: e(i, t.MenuHeading)
|
|
11
|
+
});
|
|
12
|
+
i.displayName = "IressMenuHeading";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { i as IressMenuHeading };
|
|
@@ -194,6 +194,15 @@ var t = e({
|
|
|
194
194
|
"option"
|
|
195
195
|
],
|
|
196
196
|
css: { root: { focusable: "colour.primary.onFill" } }
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
variant: "side",
|
|
200
|
+
selected: !0,
|
|
201
|
+
css: { root: {
|
|
202
|
+
bg: "colour.neutral.20",
|
|
203
|
+
color: "colour.primary.text",
|
|
204
|
+
_after: { width: "menu.indicator" }
|
|
205
|
+
} }
|
|
197
206
|
}
|
|
198
207
|
],
|
|
199
208
|
defaultVariants: { layout: "stack" }
|
|
@@ -16,10 +16,6 @@ export type IressMenuTextProps<E extends TextElements = 'div'> = IressTextProps<
|
|
|
16
16
|
prepend?: ReactNode;
|
|
17
17
|
};
|
|
18
18
|
export declare const IressMenuText: {
|
|
19
|
-
<E extends TextElements = "div">({ append, children, className, "data-testid": dataTestid, divider, element, prepend, role, textStyle, ...restProps }: IressMenuTextProps<E>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
displayName: string;
|
|
21
|
-
};
|
|
22
|
-
export declare const IressMenuHeading: {
|
|
23
|
-
<E extends TextElements = "h2">({ className, element, textStyle, ...restProps }: IressMenuTextProps<E>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
<E extends TextElements = "div">({ append, children, className, "data-testid": dataTestid, divider, element, prepend, role, textStyle, width, ...restProps }: IressMenuTextProps<E>): import("react/jsx-runtime").JSX.Element;
|
|
24
20
|
displayName: string;
|
|
25
21
|
};
|
|
@@ -23,39 +23,33 @@ var p = (e, t) => (e && [
|
|
|
23
23
|
"typography.heading.3",
|
|
24
24
|
"typography.heading.4",
|
|
25
25
|
"typography.heading.5"
|
|
26
|
-
].includes(t)), m = ({ append: m, children: h, className: g, "data-testid": _, divider: v, element: y, prepend: b, role: x, textStyle: S,
|
|
27
|
-
let
|
|
28
|
-
layout:
|
|
26
|
+
].includes(t)), m = ({ append: m, children: h, className: g, "data-testid": _, divider: v, element: y, prepend: b, role: x, textStyle: S, width: C = "12/12", ...w }) => {
|
|
27
|
+
let T = l(a), E = c() ?? x, D = o.raw({
|
|
28
|
+
layout: T?.layout,
|
|
29
29
|
isHeading: p(y, S),
|
|
30
30
|
hasAppendOrPrepend: !!(m ?? b)
|
|
31
|
-
}), [
|
|
31
|
+
}), [O, k] = n(w);
|
|
32
32
|
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("div", {
|
|
33
|
-
className: t(g, e(
|
|
33
|
+
className: t(g, e(D.root, O, { width: C }), r.MenuText),
|
|
34
34
|
"data-testid": _,
|
|
35
|
-
role:
|
|
35
|
+
role: E,
|
|
36
36
|
children: [
|
|
37
37
|
b && /* @__PURE__ */ d("div", { children: b }),
|
|
38
38
|
/* @__PURE__ */ d(i, {
|
|
39
|
-
...
|
|
40
|
-
className: e(
|
|
39
|
+
...k,
|
|
40
|
+
className: e(D.contents),
|
|
41
41
|
element: y,
|
|
42
42
|
textStyle: S,
|
|
43
|
+
width: C,
|
|
43
44
|
children: h
|
|
44
45
|
}),
|
|
45
46
|
m && /* @__PURE__ */ d("div", {
|
|
46
|
-
className: e(
|
|
47
|
+
className: e(D.append),
|
|
47
48
|
children: m
|
|
48
49
|
})
|
|
49
50
|
]
|
|
50
51
|
}), v && /* @__PURE__ */ d(s, { mt: "spacing.1" })] });
|
|
51
52
|
};
|
|
52
53
|
m.displayName = "IressMenuText";
|
|
53
|
-
var h = ({ className: e, element: n = "h2", textStyle: i = "typography.body.md.medium", ...a }) => /* @__PURE__ */ d(m, {
|
|
54
|
-
element: n,
|
|
55
|
-
textStyle: i,
|
|
56
|
-
...a,
|
|
57
|
-
className: t(e, r.MenuHeading)
|
|
58
|
-
});
|
|
59
|
-
h.displayName = "IressMenuHeading";
|
|
60
54
|
//#endregion
|
|
61
|
-
export {
|
|
55
|
+
export { m as IressMenuText };
|
|
@@ -3,7 +3,8 @@ import { IressMenu as t } from "./Menu.js";
|
|
|
3
3
|
import { menuItem as n } from "./MenuItem/MenuItem.styles.js";
|
|
4
4
|
import { menuGroup as r } from "./MenuGroup/MenuGroup.styles.js";
|
|
5
5
|
import { IressMenuDivider as i } from "./MenuDivider/MenuDivider.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { IressMenuItem as a } from "./MenuItem/MenuItem.js";
|
|
7
|
+
import { IressMenuText as o } from "./MenuText/MenuText.js";
|
|
8
|
+
import { IressMenuHeading as s } from "./MenuHeading/MenuHeading.js";
|
|
8
9
|
import { IressMenuGroup as c } from "./MenuGroup/MenuGroup.js";
|
|
9
|
-
export { t as IressMenu, i as IressMenuDivider, c as IressMenuGroup,
|
|
10
|
+
export { t as IressMenu, i as IressMenuDivider, c as IressMenuGroup, s as IressMenuHeading, a as IressMenuItem, o as IressMenuText, e as menu, r as menuGroup, n as menuItem };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e } from "../../Autocomplete-
|
|
1
|
+
import { n as e } from "../../Autocomplete-BRGD9dSh.js";
|
|
2
2
|
export { e as IressSelect };
|
|
@@ -3,8 +3,8 @@ import { GlobalCSSClass as t } from "../../../enums.js";
|
|
|
3
3
|
import { t as n } from "../../../Button-bZPKq0ue.js";
|
|
4
4
|
import { usePopoverItem as r } from "../../Popover/hooks/usePopoverItem.js";
|
|
5
5
|
import { select as i } from "../Select.styles.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { IressMenuHeading as a } from "../../Menu/MenuHeading/MenuHeading.js";
|
|
7
|
+
import { IressInline as o } from "../../Inline/Inline.js";
|
|
8
8
|
import { forwardRef as s, useImperativeHandle as c, useRef as l } from "react";
|
|
9
9
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/Select/SelectHeading/SelectHeading.tsx
|
|
@@ -15,17 +15,17 @@ var f = i(), p = s((i, a) => {
|
|
|
15
15
|
...d,
|
|
16
16
|
className: e(f.dropdownClear, t.SelectClearButton),
|
|
17
17
|
active: s,
|
|
18
|
-
mode: "
|
|
18
|
+
mode: "quaternary",
|
|
19
19
|
ref: (e) => {
|
|
20
20
|
o.current = e, d?.ref?.(o.current);
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
}), m = ({ children: n, className: r, clearAll: i, onClearAll: s, textStyle: c = "typography.
|
|
23
|
+
}), m = ({ children: n, className: r, clearAll: i, onClearAll: s, textStyle: c = "typography.body.md.medium", ...l }) => /* @__PURE__ */ u(a, {
|
|
24
24
|
...l,
|
|
25
25
|
className: e(f.dropdownSelectedHeading, r, t.SelectHeading),
|
|
26
26
|
role: void 0,
|
|
27
27
|
textStyle: c,
|
|
28
|
-
children: /* @__PURE__ */ d(
|
|
28
|
+
children: /* @__PURE__ */ d(o, {
|
|
29
29
|
horizontalAlign: "between",
|
|
30
30
|
verticalAlign: "middle",
|
|
31
31
|
children: [n, i && /* @__PURE__ */ u(p, {
|
|
@@ -12,9 +12,9 @@ import { getFormControlValueAsStringIfDefined as u } from "../../../helpers/form
|
|
|
12
12
|
import { composeLabelValueDescriptor as d } from "../../../helpers/label-value/composeLabelValueDescriptor.js";
|
|
13
13
|
import { selectTags as f } from "./SelectTags.styles.js";
|
|
14
14
|
import { IressTag as p } from "../../Tag/Tag.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { IressMenu as m } from "../../Menu/Menu.js";
|
|
16
|
+
import { IressMenuItem as h } from "../../Menu/MenuItem/MenuItem.js";
|
|
17
|
+
import { IressInline as g } from "../../Inline/Inline.js";
|
|
18
18
|
import { useCallback as _, useMemo as v, useState as y } from "react";
|
|
19
19
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
20
20
|
//#region src/components/Select/SelectTags/SelectTags.tsx
|
|
@@ -26,17 +26,17 @@ var S = (e, t) => {
|
|
|
26
26
|
let e = r.indexOf(t.currentTarget), i = r.filter((e) => e !== t.currentTarget), a = Math.max(e - 1, 0);
|
|
27
27
|
!i[a] && i[0] ? i[0].focus() : i[0] ? i[a].focus() : n?.focus();
|
|
28
28
|
}
|
|
29
|
-
}, C = ({ "data-testid": e, limit: t = 5, onDelete: i, onDeleteAll: o, onToggleActions: s, selectedArray:
|
|
29
|
+
}, C = ({ "data-testid": e, limit: t = 5, onDelete: i, onDeleteAll: o, onToggleActions: s, selectedArray: g, selectedOptionsText: v }) => {
|
|
30
30
|
let [C, w] = y(!1), T = c(), E = f(), D = _((e, t) => {
|
|
31
|
-
i?.(
|
|
31
|
+
i?.(g.find((t) => t.label === e), t), t.stopPropagation(), S(T, t);
|
|
32
32
|
}, [
|
|
33
33
|
i,
|
|
34
34
|
T,
|
|
35
|
-
|
|
35
|
+
g
|
|
36
36
|
]), O = _((e) => {
|
|
37
37
|
o?.(e), T?.getFocusableActivator()?.focus();
|
|
38
38
|
}, [o, T]);
|
|
39
|
-
return C &&
|
|
39
|
+
return C && g.length || !t || g.length <= t ? g.map((t) => /* @__PURE__ */ b(p, {
|
|
40
40
|
className: E.tag,
|
|
41
41
|
"data-testid": a(e, "tag"),
|
|
42
42
|
deleteButtonText: `Delete ${t.label}`,
|
|
@@ -63,34 +63,34 @@ var S = (e, t) => {
|
|
|
63
63
|
align: "bottom-end",
|
|
64
64
|
contentStyle: { p: "none" },
|
|
65
65
|
virtualFocus: !0,
|
|
66
|
-
children: /* @__PURE__ */ x(
|
|
66
|
+
children: /* @__PURE__ */ x(m, { children: [/* @__PURE__ */ b(h, {
|
|
67
67
|
onClick: () => w(!0),
|
|
68
68
|
children: "Expand all"
|
|
69
|
-
}), /* @__PURE__ */ b(
|
|
69
|
+
}), /* @__PURE__ */ b(h, {
|
|
70
70
|
onClick: O,
|
|
71
71
|
children: "Delete all"
|
|
72
72
|
})] })
|
|
73
73
|
}),
|
|
74
74
|
compact: !0,
|
|
75
|
-
children: d(
|
|
75
|
+
children: d(g, v)
|
|
76
76
|
});
|
|
77
|
-
}, w = ({ append: n = "", className: r, "data-testid": a, id: s, limit: c = 5, onDelete: l, onDeleteAll: u, onToggleActions: d, placeholder: p, prepend:
|
|
78
|
-
let S = v(() => o(
|
|
77
|
+
}, w = ({ append: n = "", className: r, "data-testid": a, id: s, limit: c = 5, onDelete: l, onDeleteAll: u, onToggleActions: d, placeholder: p, prepend: m, selected: h, selectedOptionsText: _ = "{{numOptions}} selected", ...y }) => {
|
|
78
|
+
let S = v(() => o(h), [h]), w = !S.length && p, T = !!S.length, E = f({ showDefaultChevron: n == null || n === "" || !n });
|
|
79
79
|
return /* @__PURE__ */ x(i, {
|
|
80
80
|
...y,
|
|
81
81
|
id: s,
|
|
82
82
|
tabIndex: 0,
|
|
83
83
|
className: e(r, E.root, t.FormElementInner, t.SelectTags),
|
|
84
84
|
children: [
|
|
85
|
-
|
|
85
|
+
m && /* @__PURE__ */ b("span", {
|
|
86
86
|
className: E.prepend,
|
|
87
|
-
children:
|
|
87
|
+
children: m
|
|
88
88
|
}),
|
|
89
89
|
w && /* @__PURE__ */ b(i, {
|
|
90
90
|
className: E.placeholder,
|
|
91
91
|
children: p
|
|
92
92
|
}),
|
|
93
|
-
T && /* @__PURE__ */ b(
|
|
93
|
+
T && /* @__PURE__ */ b(g, {
|
|
94
94
|
gap: "sm",
|
|
95
95
|
className: E.tagsList,
|
|
96
96
|
children: /* @__PURE__ */ b(C, {
|