@iress-oss/ids-components 6.0.1 → 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/Field/Field.js +47 -47
- package/dist/components/Field/Field.styles.d.ts +1 -1
- package/dist/components/Field/Field.styles.js +6 -0
- 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 +9 -9
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.d.ts +1 -1
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.js +2 -2
- 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-OHZiBoEb.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,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../Autocomplete-
|
|
1
|
+
import { t as e } from "../../Autocomplete-BRGD9dSh.js";
|
|
2
2
|
export { e as IressAutocomplete };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../useAutocompleteSearch-
|
|
1
|
+
import { t as e } from "../../../useAutocompleteSearch-DxKxs6HH.js";
|
|
2
2
|
export { e as useAutocompleteSearch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { autoComplete as e } from "./Autocomplete.styles.js";
|
|
2
|
-
import { t } from "../../useAutocompleteSearch-
|
|
3
|
-
import { t as n } from "../../Autocomplete-
|
|
2
|
+
import { t } from "../../useAutocompleteSearch-DxKxs6HH.js";
|
|
3
|
+
import { t as n } from "../../Autocomplete-BRGD9dSh.js";
|
|
4
4
|
export { n as IressAutocomplete, e as autoComplete, t as useAutocompleteSearch };
|
|
@@ -8,65 +8,65 @@ import { toArray as o } from "../../helpers/formatting/toArray.js";
|
|
|
8
8
|
import { IressLabel as s } from "../Label/Label.js";
|
|
9
9
|
import { field as c } from "./Field.styles.js";
|
|
10
10
|
import { FieldFooter as l } from "./components/FieldFooter.js";
|
|
11
|
-
import { FieldHint as u
|
|
12
|
-
import { isValidElement as
|
|
13
|
-
import { jsx as
|
|
11
|
+
import { FieldHint as u } from "./components/FieldHint.js";
|
|
12
|
+
import { isValidElement as d } from "react";
|
|
13
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/Field/Field.tsx
|
|
15
|
-
var
|
|
16
|
-
let { htmlFor:
|
|
17
|
-
|
|
18
|
-
let
|
|
19
|
-
hasError: !!
|
|
20
|
-
hasHint: !!
|
|
21
|
-
hiddenLabel:
|
|
22
|
-
horizontal:
|
|
15
|
+
var m = ({ children: m, className: h, "data-testid": g, error: _, errorMessages: v, hiddenLabel: y, hint: b, horizontal: x, label: S, labelWidth: C, required: w, readOnly: T, removeErrorMargin: E = !1, supplementary: D, ...O }) => {
|
|
16
|
+
let { htmlFor: k } = O, A;
|
|
17
|
+
A = k === void 0 && d(m) ? o(m)[0].props.id : k;
|
|
18
|
+
let j = c.raw({
|
|
19
|
+
hasError: !!_ || !!v?.length,
|
|
20
|
+
hasHint: !!b,
|
|
21
|
+
hiddenLabel: y,
|
|
22
|
+
horizontal: x,
|
|
23
23
|
multipleFields: !1,
|
|
24
|
-
removeErrorMargin:
|
|
25
|
-
}), [
|
|
26
|
-
let t = /* @__PURE__ */
|
|
27
|
-
className: e(
|
|
28
|
-
"data-testid": a(
|
|
29
|
-
hiddenLabel:
|
|
30
|
-
htmlFor:
|
|
31
|
-
readOnly:
|
|
32
|
-
required:
|
|
33
|
-
children:
|
|
24
|
+
removeErrorMargin: E
|
|
25
|
+
}), [M, N] = n(O), P = !!T, F = () => {
|
|
26
|
+
let t = /* @__PURE__ */ f(s, {
|
|
27
|
+
className: e(j.label),
|
|
28
|
+
"data-testid": a(g, "label"),
|
|
29
|
+
hiddenLabel: y,
|
|
30
|
+
htmlFor: A,
|
|
31
|
+
readOnly: T,
|
|
32
|
+
required: P ? !1 : !!w,
|
|
33
|
+
children: S
|
|
34
34
|
});
|
|
35
|
-
return
|
|
36
|
-
hint:
|
|
37
|
-
horizontal:
|
|
38
|
-
hiddenLabel:
|
|
39
|
-
dataTestId:
|
|
35
|
+
return b ? /* @__PURE__ */ f(u, {
|
|
36
|
+
hint: b,
|
|
37
|
+
horizontal: x,
|
|
38
|
+
hiddenLabel: y,
|
|
39
|
+
dataTestId: g,
|
|
40
40
|
children: t
|
|
41
41
|
}) : t;
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
className: t(
|
|
45
|
-
style: { ...
|
|
46
|
-
"data-testid":
|
|
47
|
-
...
|
|
43
|
+
return /* @__PURE__ */ p(r.div, {
|
|
44
|
+
className: t(h, e(j.root, M), i.Field),
|
|
45
|
+
style: { ...x && C && { gridTemplateColumns: `${C} 1fr` } },
|
|
46
|
+
"data-testid": g,
|
|
47
|
+
...N,
|
|
48
48
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
className: e(
|
|
51
|
-
children:
|
|
49
|
+
/* @__PURE__ */ f(r.div, {
|
|
50
|
+
className: e(j.labelContainer),
|
|
51
|
+
children: F()
|
|
52
52
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
className: e(
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
className: e(
|
|
57
|
-
children:
|
|
53
|
+
/* @__PURE__ */ f(r.div, {
|
|
54
|
+
className: e(j.fieldContainer),
|
|
55
|
+
children: /* @__PURE__ */ f("div", {
|
|
56
|
+
className: e(j.element),
|
|
57
|
+
children: m
|
|
58
58
|
})
|
|
59
59
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
className: e(
|
|
62
|
-
"data-testid": a(
|
|
63
|
-
error:
|
|
64
|
-
errorMessages:
|
|
65
|
-
supplementary:
|
|
60
|
+
/* @__PURE__ */ f(l, {
|
|
61
|
+
className: e(j.footer),
|
|
62
|
+
"data-testid": a(g, "error"),
|
|
63
|
+
error: _,
|
|
64
|
+
errorMessages: v,
|
|
65
|
+
supplementary: D
|
|
66
66
|
})
|
|
67
67
|
]
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
m.displayName = "IressField";
|
|
71
71
|
//#endregion
|
|
72
|
-
export {
|
|
72
|
+
export { m as IressField };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const field: import('../../styled-system/types').SlotRecipeRuntimeFn<"label" | "footer" | "hint" | "element" | "root" | "footerIcon" | "supplementary" | "labelContainer" | "fieldContainer", {
|
|
1
|
+
export declare const field: import('../../styled-system/types').SlotRecipeRuntimeFn<"label" | "footer" | "hint" | "element" | "root" | "horizontalLabelWithHint" | "footerIcon" | "supplementary" | "labelContainer" | "fieldContainer", {
|
|
2
2
|
horizontal: {
|
|
3
3
|
true: {
|
|
4
4
|
root: {
|
|
@@ -5,6 +5,7 @@ var t = e({
|
|
|
5
5
|
"root",
|
|
6
6
|
"hint",
|
|
7
7
|
"label",
|
|
8
|
+
"horizontalLabelWithHint",
|
|
8
9
|
"footer",
|
|
9
10
|
"footerIcon",
|
|
10
11
|
"supplementary",
|
|
@@ -34,6 +35,11 @@ var t = e({
|
|
|
34
35
|
footerIcon: { verticalAlign: "[-1.5px]" },
|
|
35
36
|
supplementary: { fontSize: "inherit" },
|
|
36
37
|
label: { mb: "spacing.2" },
|
|
38
|
+
horizontalLabelWithHint: {
|
|
39
|
+
display: "inline-flex",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
gap: "spacing.1"
|
|
42
|
+
},
|
|
37
43
|
labelContainer: {},
|
|
38
44
|
fieldContainer: { "& .ids-popover__content": { zIndex: "100" } }
|
|
39
45
|
},
|
|
@@ -1,33 +1,41 @@
|
|
|
1
1
|
import { t as e } from "../../../css-D3KwXbP0.js";
|
|
2
2
|
import { t } from "../../../factory-sKbby7-S.js";
|
|
3
3
|
import { IressIcon as n } from "../../Icon/Icon.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { t as r } from "../../../Button-bZPKq0ue.js";
|
|
5
|
+
import { propagateTestid as i } from "../../../helpers/utility/propagateTestid.js";
|
|
6
|
+
import { IressTooltip as a } from "../../Tooltip/Tooltip.js";
|
|
7
|
+
import { field as o } from "../Field.styles.js";
|
|
8
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/Field/components/FieldHint.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
10
|
+
var u = ({ hint: n, horizontal: r, hiddenLabel: a, dataTestId: u, children: f }) => {
|
|
11
|
+
let p = o.raw({
|
|
11
12
|
hasError: !1,
|
|
12
|
-
hiddenLabel:
|
|
13
|
-
horizontal:
|
|
13
|
+
hiddenLabel: a,
|
|
14
|
+
horizontal: r,
|
|
14
15
|
multipleFields: !1
|
|
15
16
|
});
|
|
16
|
-
return
|
|
17
|
-
className: e(
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
return r ? /* @__PURE__ */ l(t.div, {
|
|
18
|
+
className: e(p.horizontalLabelWithHint),
|
|
19
|
+
children: [f, /* @__PURE__ */ c(d, { hint: n })]
|
|
20
|
+
}) : /* @__PURE__ */ l(s, { children: [f, /* @__PURE__ */ c(t.div, {
|
|
21
|
+
className: e(p.hint),
|
|
22
|
+
"data-testid": i(u, "hint"),
|
|
23
|
+
srOnly: a,
|
|
20
24
|
children: n
|
|
21
25
|
})] });
|
|
22
|
-
},
|
|
26
|
+
}, d = ({ hint: e }) => /* @__PURE__ */ c(a, {
|
|
23
27
|
tooltipText: typeof e == "string" ? e : "Additional information",
|
|
24
28
|
align: "top",
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
children: /* @__PURE__ */ c(r, {
|
|
30
|
+
mode: "muted",
|
|
31
|
+
p: "none",
|
|
32
|
+
mb: "-spacing.1",
|
|
33
|
+
children: /* @__PURE__ */ c(n, {
|
|
34
|
+
name: "info-circle",
|
|
35
|
+
screenreaderText: "More information"
|
|
36
|
+
})
|
|
29
37
|
})
|
|
30
38
|
});
|
|
31
|
-
|
|
39
|
+
u.displayName = "FieldHint";
|
|
32
40
|
//#endregion
|
|
33
|
-
export {
|
|
41
|
+
export { u as FieldHint, d as FieldHintIcon };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { field as e } from "./Field.styles.js";
|
|
2
2
|
import { IressField as t } from "./Field.js";
|
|
3
|
-
|
|
4
|
-
import { IressFieldGroup as r } from "./FieldGroup/FieldGroup.js";
|
|
5
|
-
export { t as IressField, r as IressFieldGroup, e as field, n as fieldGroup };
|
|
3
|
+
export { t as IressField, e as field };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { t as e } from "
|
|
2
|
-
import { t } from "
|
|
3
|
-
import { n } from "
|
|
4
|
-
import { t as r } from "
|
|
5
|
-
import { GlobalCSSClass as i } from "
|
|
6
|
-
import { propagateTestid as a } from "
|
|
7
|
-
import { LabelBase as o } from "
|
|
8
|
-
import { FieldFooter as s } from "../components/FieldFooter.js";
|
|
1
|
+
import { t as e } from "../../css-D3KwXbP0.js";
|
|
2
|
+
import { t } from "../../cx-CZ8IJJTy.js";
|
|
3
|
+
import { n } from "../../is-valid-prop-BoZ7GJt2.js";
|
|
4
|
+
import { t as r } from "../../factory-sKbby7-S.js";
|
|
5
|
+
import { GlobalCSSClass as i } from "../../enums.js";
|
|
6
|
+
import { propagateTestid as a } from "../../helpers/utility/propagateTestid.js";
|
|
7
|
+
import { LabelBase as o } from "../Label/LabelBase/LabelBase.js";
|
|
8
|
+
import { FieldFooter as s } from "../Field/components/FieldFooter.js";
|
|
9
9
|
import { fieldGroup as c } from "./FieldGroup.styles.js";
|
|
10
10
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
|
-
//#region src/components/
|
|
11
|
+
//#region src/components/FieldGroup/FieldGroup.tsx
|
|
12
12
|
var d = ({ children: d, className: f, "data-testid": p, error: m, errorMessages: h, hiddenLabel: g, hint: _, inline: v, join: y, label: b, removeErrorMargin: x, required: S, supplementary: C, ...w }) => {
|
|
13
13
|
let T = c.raw({
|
|
14
14
|
hasError: !!m || !!h?.length,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const fieldGroup: import('
|
|
1
|
+
export declare const fieldGroup: import('../../styled-system/types').SlotRecipeRuntimeFn<"legend" | "hint" | "root" | "fields", {
|
|
2
2
|
hasError: {
|
|
3
3
|
true: {
|
|
4
4
|
root: {
|
|
@@ -101,7 +101,7 @@ export declare const input: import('../../styled-system/types').SlotRecipeRuntim
|
|
|
101
101
|
};
|
|
102
102
|
'25%': {
|
|
103
103
|
wrapper: {
|
|
104
|
-
|
|
104
|
+
maxWidth: "3/12";
|
|
105
105
|
};
|
|
106
106
|
formControl: {
|
|
107
107
|
width: "12/12";
|
|
@@ -109,7 +109,7 @@ export declare const input: import('../../styled-system/types').SlotRecipeRuntim
|
|
|
109
109
|
};
|
|
110
110
|
'50%': {
|
|
111
111
|
wrapper: {
|
|
112
|
-
|
|
112
|
+
maxWidth: "6/12";
|
|
113
113
|
};
|
|
114
114
|
formControl: {
|
|
115
115
|
width: "12/12";
|
|
@@ -117,7 +117,7 @@ export declare const input: import('../../styled-system/types').SlotRecipeRuntim
|
|
|
117
117
|
};
|
|
118
118
|
'75%': {
|
|
119
119
|
wrapper: {
|
|
120
|
-
|
|
120
|
+
maxWidth: "9/12";
|
|
121
121
|
};
|
|
122
122
|
formControl: {
|
|
123
123
|
width: "12/12";
|
|
@@ -125,7 +125,7 @@ export declare const input: import('../../styled-system/types').SlotRecipeRuntim
|
|
|
125
125
|
};
|
|
126
126
|
'100%': {
|
|
127
127
|
wrapper: {
|
|
128
|
-
|
|
128
|
+
maxWidth: "12/12";
|
|
129
129
|
};
|
|
130
130
|
formControl: {
|
|
131
131
|
width: "12/12";
|
|
@@ -142,19 +142,19 @@ var t = e({
|
|
|
142
142
|
formControl: { width: "input.16" }
|
|
143
143
|
},
|
|
144
144
|
"25%": {
|
|
145
|
-
wrapper: {
|
|
145
|
+
wrapper: { maxWidth: "3/12" },
|
|
146
146
|
formControl: { width: "12/12" }
|
|
147
147
|
},
|
|
148
148
|
"50%": {
|
|
149
|
-
wrapper: {
|
|
149
|
+
wrapper: { maxWidth: "6/12" },
|
|
150
150
|
formControl: { width: "12/12" }
|
|
151
151
|
},
|
|
152
152
|
"75%": {
|
|
153
|
-
wrapper: {
|
|
153
|
+
wrapper: { maxWidth: "9/12" },
|
|
154
154
|
formControl: { width: "12/12" }
|
|
155
155
|
},
|
|
156
156
|
"100%": {
|
|
157
|
-
wrapper: {
|
|
157
|
+
wrapper: { maxWidth: "12/12" },
|
|
158
158
|
formControl: { width: "12/12" }
|
|
159
159
|
}
|
|
160
160
|
},
|
|
@@ -33,7 +33,10 @@ var t = e({
|
|
|
33
33
|
variants: {
|
|
34
34
|
active: { true: { root: { borderBottom: "[1px dashed currentColor]" } } },
|
|
35
35
|
loading: { true: {
|
|
36
|
-
content: { _groupHover: {
|
|
36
|
+
content: { _groupHover: {
|
|
37
|
+
cursor: "not-allowed",
|
|
38
|
+
textDecoration: "underline"
|
|
39
|
+
} },
|
|
37
40
|
root: {
|
|
38
41
|
cursor: "not-allowed",
|
|
39
42
|
filter: "[saturate(0.25)]",
|
|
@@ -6,97 +6,101 @@ import { useControlledState as i } from "../../hooks/useControlledState.js";
|
|
|
6
6
|
import { useIdIfNeeded as a } from "../../hooks/useIdIfNeeded.js";
|
|
7
7
|
import { t as o } from "../../floating-ui.react-COiJC198.js";
|
|
8
8
|
import { usePopover as s } from "../Popover/hooks/usePopover.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { IressTooltipProvider as c } from "../Tooltip/TooltipProvider.js";
|
|
10
|
+
import { menu as l } from "./Menu.styles.js";
|
|
11
|
+
import { createContext as u, useCallback as d, useEffect as f, useMemo as p, useRef as m } from "react";
|
|
12
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
13
|
//#region src/components/Menu/Menu.tsx
|
|
13
|
-
function
|
|
14
|
-
return
|
|
14
|
+
function v() {
|
|
15
|
+
return u(void 0);
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
17
|
+
function y() {
|
|
18
|
+
return b;
|
|
18
19
|
}
|
|
19
|
-
var
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
]),
|
|
25
|
-
"aria-multiselectable":
|
|
26
|
-
"aria-orientation":
|
|
20
|
+
var b = v(), x = ({ changeOnBlur: u, className: v, defaultSelected: b, fluid: x, id: S, layout: C = "stack", maxWidth: w = "12/12", multiSelect: T, noWrap: E, numbered: D, onChange: O, role: k = "list", selected: A, variant: j, ...M }) => {
|
|
21
|
+
let N = a({ id: S }), P = s(), F = m(null), I = p(() => P?.type === "listbox" || P?.type === "menu" ? (P.setHasInnerRole(!0), P.type) : T ? "listbox" : k, [
|
|
22
|
+
T,
|
|
23
|
+
P,
|
|
24
|
+
k
|
|
25
|
+
]), L = p(() => ({
|
|
26
|
+
"aria-multiselectable": I === "listbox" && T ? !0 : void 0,
|
|
27
|
+
"aria-orientation": I === "menu" ? C === "stack" ? "vertical" : "horizontal" : void 0
|
|
27
28
|
}), [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]),
|
|
29
|
+
C,
|
|
30
|
+
T,
|
|
31
|
+
I
|
|
32
|
+
]), R = p(() => I && ["menu", "listbox"].includes(I), [I]), z = p(() => !P && R, [P, R]), B = p(() => I === "listbox" || !!T, [I, T]), { toggleValue: V, value: H } = i({
|
|
32
33
|
component: "IressMenu",
|
|
33
|
-
defaultValue:
|
|
34
|
-
multiple:
|
|
35
|
-
onChange:
|
|
34
|
+
defaultValue: b,
|
|
35
|
+
multiple: T,
|
|
36
|
+
onChange: O,
|
|
36
37
|
propName: "selected",
|
|
37
|
-
value:
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]),
|
|
43
|
-
changeOnBlur:
|
|
44
|
-
hasArrowKeyNav:
|
|
45
|
-
isComposite:
|
|
46
|
-
isSelected:
|
|
47
|
-
layout:
|
|
48
|
-
multiSelect:
|
|
49
|
-
noWrap:
|
|
50
|
-
numbered:
|
|
51
|
-
role:
|
|
52
|
-
supportsSelection:
|
|
53
|
-
toggle:
|
|
54
|
-
variant:
|
|
38
|
+
value: A
|
|
39
|
+
}), U = d((e) => !B || e === void 0 ? !1 : T ? r(H).includes(e) : H === e, [
|
|
40
|
+
T,
|
|
41
|
+
H,
|
|
42
|
+
B
|
|
43
|
+
]), W = p(() => ({
|
|
44
|
+
changeOnBlur: u && I === "listbox",
|
|
45
|
+
hasArrowKeyNav: R,
|
|
46
|
+
isComposite: z,
|
|
47
|
+
isSelected: U,
|
|
48
|
+
layout: C,
|
|
49
|
+
multiSelect: T,
|
|
50
|
+
noWrap: E,
|
|
51
|
+
numbered: D,
|
|
52
|
+
role: I,
|
|
53
|
+
supportsSelection: B,
|
|
54
|
+
toggle: V,
|
|
55
|
+
variant: j
|
|
55
56
|
}), [
|
|
56
|
-
|
|
57
|
-
N,
|
|
58
|
-
P,
|
|
57
|
+
u,
|
|
59
58
|
R,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
S,
|
|
59
|
+
z,
|
|
60
|
+
U,
|
|
63
61
|
C,
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
T,
|
|
63
|
+
E,
|
|
64
|
+
D,
|
|
66
65
|
I,
|
|
67
|
-
|
|
66
|
+
B,
|
|
67
|
+
V,
|
|
68
|
+
j
|
|
68
69
|
]);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}), [
|
|
72
|
-
let
|
|
73
|
-
fluid:
|
|
74
|
-
layout:
|
|
75
|
-
noWrap:
|
|
76
|
-
numbered:
|
|
77
|
-
insidePopover: !!
|
|
78
|
-
variant:
|
|
79
|
-
}),
|
|
80
|
-
...O,
|
|
70
|
+
f(() => (P?.toggleAriaControls && N && P.toggleAriaControls(N, !0), () => {
|
|
71
|
+
P?.toggleAriaControls && N && P.toggleAriaControls(N, !1);
|
|
72
|
+
}), [N, P]);
|
|
73
|
+
let G = l({
|
|
74
|
+
fluid: x,
|
|
75
|
+
layout: C,
|
|
76
|
+
noWrap: E,
|
|
77
|
+
numbered: D,
|
|
78
|
+
insidePopover: !!P,
|
|
79
|
+
variant: j
|
|
80
|
+
}), K = {
|
|
81
81
|
...M,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
value:
|
|
88
|
-
children:
|
|
89
|
-
loop:
|
|
90
|
-
render: /* @__PURE__ */
|
|
91
|
-
...
|
|
92
|
-
maxWidth:
|
|
82
|
+
...L,
|
|
83
|
+
className: e(v, G.root, n.Menu),
|
|
84
|
+
id: N,
|
|
85
|
+
role: I
|
|
86
|
+
}, { Provider: q } = y(), J = /* @__PURE__ */ g(q, {
|
|
87
|
+
value: W,
|
|
88
|
+
children: z ? /* @__PURE__ */ g(o, {
|
|
89
|
+
loop: I === "menu",
|
|
90
|
+
render: /* @__PURE__ */ g(t.div, {
|
|
91
|
+
...K,
|
|
92
|
+
maxWidth: w
|
|
93
93
|
})
|
|
94
|
-
}) : /* @__PURE__ */
|
|
95
|
-
...
|
|
96
|
-
maxWidth:
|
|
94
|
+
}) : /* @__PURE__ */ g(t.div, {
|
|
95
|
+
...K,
|
|
96
|
+
maxWidth: w
|
|
97
97
|
})
|
|
98
98
|
});
|
|
99
|
+
return j == "rail" ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(c, {
|
|
100
|
+
container: F,
|
|
101
|
+
children: J
|
|
102
|
+
}), /* @__PURE__ */ g("div", { ref: F })] }) : J;
|
|
99
103
|
};
|
|
100
|
-
|
|
104
|
+
x.displayName = "IressMenu";
|
|
101
105
|
//#endregion
|
|
102
|
-
export {
|
|
106
|
+
export { x as IressMenu, b as MenuContext };
|
|
@@ -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 {};
|