@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.
Files changed (85) hide show
  1. package/dist/Autocomplete-BRGD9dSh.js +321 -0
  2. package/dist/Shadow-D2KoVwxD.js +57 -0
  3. package/dist/components/Autocomplete/Autocomplete.js +1 -1
  4. package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +1 -1
  5. package/dist/components/Autocomplete/index.js +2 -2
  6. package/dist/components/Field/Field.js +47 -47
  7. package/dist/components/Field/Field.styles.d.ts +1 -1
  8. package/dist/components/Field/Field.styles.js +6 -0
  9. package/dist/components/Field/components/FieldHint.js +27 -19
  10. package/dist/components/Field/index.d.ts +0 -2
  11. package/dist/components/Field/index.js +1 -3
  12. package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.js +9 -9
  13. package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.d.ts +1 -1
  14. package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.js +2 -2
  15. package/dist/components/FieldGroup/index.d.ts +2 -0
  16. package/dist/components/FieldGroup/index.js +3 -0
  17. package/dist/components/Input/Input.styles.d.ts +4 -4
  18. package/dist/components/Input/Input.styles.js +4 -4
  19. package/dist/components/Link/Link.styles.d.ts +1 -0
  20. package/dist/components/Link/Link.styles.js +4 -1
  21. package/dist/components/Menu/Menu.js +81 -77
  22. package/dist/components/Menu/Menu.styles.js +7 -0
  23. package/dist/components/Menu/MenuGroup/MenuGroup.d.ts +18 -3
  24. package/dist/components/Menu/MenuGroup/MenuGroup.js +38 -34
  25. package/dist/components/Menu/MenuHeading/MenuHeading.d.ts +20 -0
  26. package/dist/components/Menu/MenuHeading/MenuHeading.js +14 -0
  27. package/dist/components/Menu/MenuItem/MenuItem.styles.js +9 -0
  28. package/dist/components/Menu/MenuText/MenuText.d.ts +1 -5
  29. package/dist/components/Menu/MenuText/MenuText.js +11 -17
  30. package/dist/components/Menu/index.d.ts +1 -0
  31. package/dist/components/Menu/index.js +4 -3
  32. package/dist/components/Select/Select.js +1 -1
  33. package/dist/components/Select/SelectHeading/SelectHeading.js +5 -5
  34. package/dist/components/Select/SelectTags/SelectTags.js +15 -15
  35. package/dist/components/Select/components/SelectOptions.js +108 -95
  36. package/dist/components/Select/index.js +1 -1
  37. package/dist/components/Slideout/Slideout.styles.js +1 -0
  38. package/dist/components/TabSet/TabSet.d.ts +6 -1
  39. package/dist/components/TabSet/TabSet.js +34 -30
  40. package/dist/components/TabSet/TabSet.styles.d.ts +1 -1
  41. package/dist/components/TabSet/TabSet.styles.js +13 -1
  42. package/dist/components/Tag/Tag.styles.d.ts +14 -14
  43. package/dist/components/Tag/Tag.styles.js +16 -16
  44. package/dist/components/Tag/index.d.ts +0 -1
  45. package/dist/components/Tag/index.js +1 -2
  46. package/dist/components/{Tag/TagInput → TagInput}/TagInput.d.ts +1 -1
  47. package/dist/components/{Tag/TagInput → TagInput}/TagInput.js +7 -7
  48. package/dist/components/TagInput/TagInput.styles.d.ts +1 -0
  49. package/dist/components/{Tag/TagInput → TagInput}/TagInput.styles.js +2 -2
  50. package/dist/components/TagInput/index.d.ts +2 -0
  51. package/dist/components/TagInput/index.js +3 -0
  52. package/dist/components/Tooltip/Tooltip.d.ts +7 -2
  53. package/dist/components/Tooltip/Tooltip.js +48 -42
  54. package/dist/components/Tooltip/TooltipProvider.d.ts +27 -0
  55. package/dist/components/Tooltip/TooltipProvider.js +14 -0
  56. package/dist/components/Tooltip/hooks/useTooltipContainer.d.ts +17 -0
  57. package/dist/components/Tooltip/hooks/useTooltipContainer.js +5 -0
  58. package/dist/components/Tooltip/index.d.ts +4 -0
  59. package/dist/components/Tooltip/index.js +4 -2
  60. package/dist/components/ValidationMessage/ValidationMessage.js +2 -2
  61. package/dist/main.d.ts +2 -0
  62. package/dist/main.js +125 -121
  63. package/dist/patterns/DropdownMenu/DropdownMenu.js +113 -102
  64. package/dist/patterns/DropdownMenu/hooks/useDropdownMenuFlags.d.ts +1 -0
  65. package/dist/patterns/DropdownMenu/hooks/useDropdownMenuFlags.js +1 -0
  66. package/dist/patterns/Form/FormField/FormFieldset.d.ts +1 -1
  67. package/dist/patterns/Form/FormField/FormFieldset.js +1 -1
  68. package/dist/patterns/Form/FormValidationSummary/FormValidationSummary.js +1 -0
  69. package/dist/patterns/Form/components/LongForm.js +3 -1
  70. package/dist/patterns/Form/components/ShortForm.js +1 -0
  71. package/dist/patterns/Loading/Loading.styles.d.ts +3 -0
  72. package/dist/patterns/Loading/Loading.styles.js +4 -1
  73. package/dist/patterns/Loading/components/PageLoading.js +4 -4
  74. package/dist/patterns/Shadow/Shadow.js +1 -1
  75. package/dist/patterns/Shadow/index.js +1 -1
  76. package/dist/patterns/SideNav/SideNav.d.ts +6 -0
  77. package/dist/patterns/SideNav/SideNav.js +74 -68
  78. package/dist/patterns/SideNav/SideNav.styles.js +6 -2
  79. package/dist/style.css +1 -1
  80. package/dist/{useAutocompleteSearch-BJ_hhoKp.js → useAutocompleteSearch-DxKxs6HH.js} +29 -24
  81. package/package.json +1 -1
  82. package/dist/Autocomplete-CuUjmIAw.js +0 -308
  83. package/dist/Shadow-OHZiBoEb.js +0 -57
  84. package/dist/components/Tag/TagInput/TagInput.styles.d.ts +0 -1
  85. /package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.d.ts +0 -0
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../Autocomplete-CuUjmIAw.js";
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-BJ_hhoKp.js";
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-BJ_hhoKp.js";
3
- import { t as n } from "../../Autocomplete-CuUjmIAw.js";
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, FieldHintIcon as d } from "./components/FieldHint.js";
12
- import { isValidElement as f } from "react";
13
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
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 h = ({ children: h, className: g, "data-testid": _, error: v, errorMessages: y, hiddenLabel: b, hint: x, horizontal: S, label: C, labelWidth: w, required: T, readOnly: E, removeErrorMargin: D = !1, supplementary: O, ...k }) => {
16
- let { htmlFor: A } = k, j;
17
- j = A === void 0 && f(h) ? o(h)[0].props.id : A;
18
- let M = c.raw({
19
- hasError: !!v || !!y?.length,
20
- hasHint: !!x,
21
- hiddenLabel: b,
22
- horizontal: S,
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: D
25
- }), [N, P] = n(k), F = !!E, I = () => {
26
- let t = /* @__PURE__ */ m(s, {
27
- className: e(M.label),
28
- "data-testid": a(_, "label"),
29
- hiddenLabel: b,
30
- htmlFor: j,
31
- readOnly: E,
32
- required: F ? !1 : !!T,
33
- children: [C, S && x && /* @__PURE__ */ p(d, { hint: x })]
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 x ? /* @__PURE__ */ p(u, {
36
- hint: x,
37
- horizontal: S,
38
- hiddenLabel: b,
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__ */ m(r.div, {
44
- className: t(g, e(M.root, N), i.Field),
45
- style: { ...S && w && { gridTemplateColumns: `${w} 1fr` } },
46
- "data-testid": _,
47
- ...P,
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__ */ p(r.div, {
50
- className: e(M.labelContainer),
51
- children: I()
49
+ /* @__PURE__ */ f(r.div, {
50
+ className: e(j.labelContainer),
51
+ children: F()
52
52
  }),
53
- /* @__PURE__ */ p(r.div, {
54
- className: e(M.fieldContainer),
55
- children: /* @__PURE__ */ p("div", {
56
- className: e(M.element),
57
- children: h
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__ */ p(l, {
61
- className: e(M.footer),
62
- "data-testid": a(_, "error"),
63
- error: v,
64
- errorMessages: y,
65
- supplementary: O
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
- h.displayName = "IressField";
70
+ m.displayName = "IressField";
71
71
  //#endregion
72
- export { h as IressField };
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 { propagateTestid as r } from "../../../helpers/utility/propagateTestid.js";
5
- import { IressTooltip as i } from "../../Tooltip/Tooltip.js";
6
- import { field as a } from "../Field.styles.js";
7
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
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 l = ({ hint: n, horizontal: i, hiddenLabel: l, dataTestId: u, children: d }) => {
10
- let f = a.raw({
10
+ var u = ({ hint: n, horizontal: r, hiddenLabel: a, dataTestId: u, children: f }) => {
11
+ let p = o.raw({
11
12
  hasError: !1,
12
- hiddenLabel: l,
13
- horizontal: i,
13
+ hiddenLabel: a,
14
+ horizontal: r,
14
15
  multipleFields: !1
15
16
  });
16
- return i ? /* @__PURE__ */ s(o, { children: d }) : /* @__PURE__ */ c(o, { children: [d, /* @__PURE__ */ s(t.div, {
17
- className: e(f.hint),
18
- "data-testid": r(u, "hint"),
19
- srOnly: l,
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
- }, u = ({ hint: e }) => /* @__PURE__ */ s(i, {
26
+ }, d = ({ hint: e }) => /* @__PURE__ */ c(a, {
23
27
  tooltipText: typeof e == "string" ? e : "Additional information",
24
28
  align: "top",
25
- children: /* @__PURE__ */ s(n, {
26
- name: "info-circle",
27
- screenreaderText: "More information",
28
- ml: "spacing.1"
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
- l.displayName = "FieldHint";
39
+ u.displayName = "FieldHint";
32
40
  //#endregion
33
- export { l as FieldHint, u as FieldHintIcon };
41
+ export { u as FieldHint, d as FieldHintIcon };
@@ -1,4 +1,2 @@
1
1
  export * from './Field';
2
2
  export * from './Field.styles';
3
- export * from './FieldGroup/FieldGroup';
4
- export * from './FieldGroup/FieldGroup.styles';
@@ -1,5 +1,3 @@
1
1
  import { field as e } from "./Field.styles.js";
2
2
  import { IressField as t } from "./Field.js";
3
- import { fieldGroup as n } from "./FieldGroup/FieldGroup.styles.js";
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 "../../../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 "../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/Field/FieldGroup/FieldGroup.tsx
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('../../../styled-system/types').SlotRecipeRuntimeFn<"legend" | "hint" | "root" | "fields", {
1
+ export declare const fieldGroup: import('../../styled-system/types').SlotRecipeRuntimeFn<"legend" | "hint" | "root" | "fields", {
2
2
  hasError: {
3
3
  true: {
4
4
  root: {
@@ -1,5 +1,5 @@
1
- import { t as e } from "../../../sva-DOLIp5Dd.js";
2
- //#region src/components/Field/FieldGroup/FieldGroup.styles.ts
1
+ import { t as e } from "../../sva-DOLIp5Dd.js";
2
+ //#region src/components/FieldGroup/FieldGroup.styles.ts
3
3
  var t = e({
4
4
  slots: [
5
5
  "root",
@@ -0,0 +1,2 @@
1
+ export * from './FieldGroup';
2
+ export * from './FieldGroup.styles';
@@ -0,0 +1,3 @@
1
+ import { fieldGroup as e } from "./FieldGroup.styles.js";
2
+ import { IressFieldGroup as t } from "./FieldGroup.js";
3
+ export { t as IressFieldGroup, e as fieldGroup };
@@ -101,7 +101,7 @@ export declare const input: import('../../styled-system/types').SlotRecipeRuntim
101
101
  };
102
102
  '25%': {
103
103
  wrapper: {
104
- width: "3/12";
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
- width: "6/12";
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
- width: "9/12";
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
- width: "12/12";
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: { width: "3/12" },
145
+ wrapper: { maxWidth: "3/12" },
146
146
  formControl: { width: "12/12" }
147
147
  },
148
148
  "50%": {
149
- wrapper: { width: "6/12" },
149
+ wrapper: { maxWidth: "6/12" },
150
150
  formControl: { width: "12/12" }
151
151
  },
152
152
  "75%": {
153
- wrapper: { width: "9/12" },
153
+ wrapper: { maxWidth: "9/12" },
154
154
  formControl: { width: "12/12" }
155
155
  },
156
156
  "100%": {
157
- wrapper: { width: "12/12" },
157
+ wrapper: { maxWidth: "12/12" },
158
158
  formControl: { width: "12/12" }
159
159
  }
160
160
  },
@@ -15,6 +15,7 @@ export declare const link: import('../../styled-system/types').SlotRecipeRuntime
15
15
  true: {
16
16
  content: {
17
17
  _groupHover: {
18
+ cursor: "not-allowed";
18
19
  textDecoration: "underline";
19
20
  };
20
21
  };
@@ -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: { textDecoration: "underline" } },
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 { menu as c } from "./Menu.styles.js";
10
- import { createContext as l, useCallback as u, useEffect as d, useMemo as f } from "react";
11
- import { jsx as p } from "react/jsx-runtime";
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 m() {
14
- return l(void 0);
14
+ function v() {
15
+ return u(void 0);
15
16
  }
16
- function h() {
17
- return g;
17
+ function y() {
18
+ return b;
18
19
  }
19
- var g = m(), _ = ({ changeOnBlur: l, className: m, defaultSelected: g, fluid: _, id: v, layout: y = "stack", maxWidth: b = "12/12", multiSelect: x, noWrap: S, numbered: C, onChange: w, role: T = "list", selected: E, variant: D, ...O }) => {
20
- let k = a({ id: v }), A = s(), j = f(() => A?.type === "listbox" || A?.type === "menu" ? (A.setHasInnerRole(!0), A.type) : x ? "listbox" : T, [
21
- x,
22
- A,
23
- T
24
- ]), M = f(() => ({
25
- "aria-multiselectable": j === "listbox" && x ? !0 : void 0,
26
- "aria-orientation": j === "menu" ? y === "stack" ? "vertical" : "horizontal" : void 0
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
- y,
29
- x,
30
- j
31
- ]), N = f(() => j && ["menu", "listbox"].includes(j), [j]), P = f(() => !A && N, [A, N]), F = f(() => j === "listbox" || !!x, [j, x]), { toggleValue: I, value: L } = i({
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: g,
34
- multiple: x,
35
- onChange: w,
34
+ defaultValue: b,
35
+ multiple: T,
36
+ onChange: O,
36
37
  propName: "selected",
37
- value: E
38
- }), R = u((e) => !F || e === void 0 ? !1 : x ? r(L).includes(e) : L === e, [
39
- x,
40
- L,
41
- F
42
- ]), z = f(() => ({
43
- changeOnBlur: l && j === "listbox",
44
- hasArrowKeyNav: N,
45
- isComposite: P,
46
- isSelected: R,
47
- layout: y,
48
- multiSelect: x,
49
- noWrap: S,
50
- numbered: C,
51
- role: j,
52
- supportsSelection: F,
53
- toggle: I,
54
- variant: D
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
- l,
57
- N,
58
- P,
57
+ u,
59
58
  R,
60
- y,
61
- x,
62
- S,
59
+ z,
60
+ U,
63
61
  C,
64
- j,
65
- F,
62
+ T,
63
+ E,
64
+ D,
66
65
  I,
67
- D
66
+ B,
67
+ V,
68
+ j
68
69
  ]);
69
- d(() => (A?.toggleAriaControls && k && A.toggleAriaControls(k, !0), () => {
70
- A?.toggleAriaControls && k && A.toggleAriaControls(k, !1);
71
- }), [k, A]);
72
- let B = c({
73
- fluid: _,
74
- layout: y,
75
- noWrap: S,
76
- numbered: C,
77
- insidePopover: !!A,
78
- variant: D
79
- }), V = {
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
- className: e(m, B.root, n.Menu),
83
- id: k,
84
- role: j
85
- }, { Provider: H } = h();
86
- return /* @__PURE__ */ p(H, {
87
- value: z,
88
- children: P ? /* @__PURE__ */ p(o, {
89
- loop: j === "menu",
90
- render: /* @__PURE__ */ p(t.div, {
91
- ...V,
92
- maxWidth: b
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__ */ p(t.div, {
95
- ...V,
96
- maxWidth: b
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
- _.displayName = "IressMenu";
104
+ x.displayName = "IressMenu";
101
105
  //#endregion
102
- export { _ as IressMenu, g as MenuContext };
106
+ export { x as IressMenu, b as MenuContext };
@@ -50,6 +50,13 @@ var t = e({
50
50
  display: "flex",
51
51
  flexDirection: "column"
52
52
  } }
53
+ }, {
54
+ layout: "stack",
55
+ variant: ["rail", "side"],
56
+ css: { root: {
57
+ flexWrap: "nowrap",
58
+ scrollable: "y"
59
+ } }
53
60
  }],
54
61
  defaultVariants: { layout: "stack" }
55
62
  });
@@ -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 {};