@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
|
@@ -4,152 +4,163 @@ import { n } from "../../is-valid-prop-BoZ7GJt2.js";
|
|
|
4
4
|
import { GlobalCSSClass as r } from "../../enums.js";
|
|
5
5
|
import { IressIcon as i } from "../../components/Icon/Icon.js";
|
|
6
6
|
import { t as a } from "../../Button-bZPKq0ue.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { IressText as o } from "../../components/Text/Text.js";
|
|
8
|
+
import { propagateTestid as s } from "../../helpers/utility/propagateTestid.js";
|
|
9
|
+
import { IressSpinner as ee } from "../../components/Spinner/Spinner.js";
|
|
10
|
+
import { toArray as te } from "../../helpers/formatting/toArray.js";
|
|
11
|
+
import { useControlledState as ne } from "../../hooks/useControlledState.js";
|
|
12
|
+
import { useIdIfNeeded as c } from "../../hooks/useIdIfNeeded.js";
|
|
11
13
|
import { IressPopover as l } from "../../components/Popover/Popover.js";
|
|
12
14
|
import { usePopoverItem as u } from "../../components/Popover/hooks/usePopoverItem.js";
|
|
13
|
-
import { t as
|
|
14
|
-
import { IressDivider as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
15
|
+
import { t as re } from "../../useAutocompleteSearch-DxKxs6HH.js";
|
|
16
|
+
import { IressDivider as ie } from "../../components/Divider/Divider.js";
|
|
17
|
+
import { IressInline as ae } from "../../components/Inline/Inline.js";
|
|
18
|
+
import { IressSelectMenu as d } from "../../components/Select/SelectMenu/SelectMenu.js";
|
|
19
|
+
import { IressSelectSearchInput as f } from "../../components/Select/SelectSearchInput/SelectSearchInput.js";
|
|
20
|
+
import { IressStyled as p } from "../../components/Styled/Styled.js";
|
|
21
|
+
import { dropdownMenu as m } from "./DropdownMenu.styles.js";
|
|
22
|
+
import { useDropdownMenuFlags as h } from "./hooks/useDropdownMenuFlags.js";
|
|
23
|
+
import { forwardRef as g, useImperativeHandle as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
24
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
22
25
|
//#region src/patterns/DropdownMenu/DropdownMenu.tsx
|
|
23
|
-
var
|
|
24
|
-
let n =
|
|
25
|
-
return
|
|
26
|
+
var oe = m.raw(), w = m(), se = g((e, t) => {
|
|
27
|
+
let n = y(null), { isActiveInPopover: r, ...i } = u();
|
|
28
|
+
return _(t, () => n.current), /* @__PURE__ */ S(a, {
|
|
26
29
|
...e,
|
|
27
30
|
...i,
|
|
28
|
-
className:
|
|
31
|
+
className: w.reset,
|
|
29
32
|
mode: "quaternary",
|
|
30
33
|
ref: (e) => {
|
|
31
34
|
n.current = e, i?.ref?.(n.current);
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
|
-
}),
|
|
37
|
+
}), T = g(({ activatorStyle: a = {}, align: u = "bottom-start", container: m, className: g, "data-testid": T, defaultSelected: ce, debounceThreshold: le, footer: ue, header: de, label: E, id: fe, initialOptions: pe, inputProps: D = {
|
|
35
38
|
clearable: !0,
|
|
36
|
-
prepend: /* @__PURE__ */
|
|
37
|
-
}, limitDesktop:
|
|
38
|
-
let
|
|
39
|
+
prepend: /* @__PURE__ */ S(i, { name: "search" })
|
|
40
|
+
}, limitDesktop: O = 12, limitMobile: k = 6, multiSelect: A, onChange: j, onReset: M, options: N, searchable: P, searchNoResultsText: F, selected: I, selectedOptionsText: L = " ({{numOptions}})", visibleResetButton: R, ...z }, B) => {
|
|
41
|
+
let V = c({ id: fe }), H = `${V}-sr-text`, U = y(null), W = v(() => P ?? typeof N == "function", [N, P]), me = {
|
|
39
42
|
clearable: !0,
|
|
40
|
-
prepend: /* @__PURE__ */
|
|
41
|
-
...
|
|
42
|
-
}, { value:
|
|
43
|
+
prepend: /* @__PURE__ */ S(i, { name: "search" }),
|
|
44
|
+
...D
|
|
45
|
+
}, { value: G, setValue: K } = ne({
|
|
43
46
|
component: "IressDropdownMenu",
|
|
44
|
-
defaultValue:
|
|
45
|
-
value:
|
|
46
|
-
}), [
|
|
47
|
+
defaultValue: ce,
|
|
48
|
+
value: I
|
|
49
|
+
}), [he, q] = b(""), [J, Y] = b(!1), [ge, _e] = v(() => n(z), [z]), [ve, ye] = v(() => n(a), [a]), be = (e) => {
|
|
47
50
|
q(e.target.value);
|
|
48
|
-
},
|
|
51
|
+
}, xe = () => {
|
|
49
52
|
q("");
|
|
50
|
-
},
|
|
51
|
-
e && (
|
|
52
|
-
},
|
|
53
|
-
|
|
53
|
+
}, Se = (e) => {
|
|
54
|
+
e && (j?.(e), K(e), A || Y(!1));
|
|
55
|
+
}, Ce = () => {
|
|
56
|
+
K(void 0), M?.(), A || Y(!1);
|
|
54
57
|
};
|
|
55
|
-
|
|
56
|
-
...
|
|
58
|
+
_(B, () => ({
|
|
59
|
+
...U.current,
|
|
57
60
|
clearSearch: () => q("")
|
|
58
61
|
}));
|
|
59
|
-
let { debouncedQuery:
|
|
60
|
-
debounceThreshold:
|
|
61
|
-
initialOptions:
|
|
62
|
-
options:
|
|
63
|
-
query:
|
|
64
|
-
}), $ =
|
|
65
|
-
debouncedQuery:
|
|
62
|
+
let { debouncedQuery: we, loading: X, results: Z, shouldShowInstructions: Te, shouldShowDebounceWaiting: Q, shouldShowNoResults: Ee } = re({
|
|
63
|
+
debounceThreshold: le,
|
|
64
|
+
initialOptions: pe ?? (typeof N == "function" ? void 0 : N),
|
|
65
|
+
options: N,
|
|
66
|
+
query: he
|
|
67
|
+
}), $ = h({
|
|
68
|
+
debouncedQuery: we,
|
|
66
69
|
loading: X,
|
|
67
70
|
results: Z,
|
|
68
|
-
searchable:
|
|
69
|
-
shouldShowInstructions:
|
|
70
|
-
shouldShowDebounceWaiting:
|
|
71
|
-
shouldShowNoResults:
|
|
72
|
-
visibleResetButton:
|
|
73
|
-
}),
|
|
74
|
-
let e =
|
|
75
|
-
return
|
|
71
|
+
searchable: W,
|
|
72
|
+
shouldShowInstructions: Te,
|
|
73
|
+
shouldShowDebounceWaiting: Q,
|
|
74
|
+
shouldShowNoResults: Ee,
|
|
75
|
+
visibleResetButton: R
|
|
76
|
+
}), De = v(() => {
|
|
77
|
+
let e = te(G);
|
|
78
|
+
return A ? /* @__PURE__ */ C(x, { children: [E, L.replace("{{numOptions}}", e.length.toString())] }) : e[0]?.label ?? E;
|
|
76
79
|
}, [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
]),
|
|
82
|
-
|
|
80
|
+
G,
|
|
81
|
+
A,
|
|
82
|
+
E,
|
|
83
|
+
L
|
|
84
|
+
]), Oe = v(() => X ? "loading" : J && !Z.length ? F : J && Z.length ? `${Z.length} results` : E, [
|
|
85
|
+
E,
|
|
83
86
|
X,
|
|
84
87
|
Z.length,
|
|
85
|
-
|
|
88
|
+
F,
|
|
86
89
|
J
|
|
87
90
|
]);
|
|
88
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C(l, {
|
|
89
92
|
matchActivatorWidth: !0,
|
|
90
|
-
...
|
|
91
|
-
activator: /* @__PURE__ */
|
|
92
|
-
...
|
|
93
|
-
"aria-describedby":
|
|
94
|
-
"data-testid": a?.["data-testid"] ??
|
|
93
|
+
..._e,
|
|
94
|
+
activator: /* @__PURE__ */ S("button", {
|
|
95
|
+
...ye,
|
|
96
|
+
"aria-describedby": H,
|
|
97
|
+
"data-testid": a?.["data-testid"] ?? s(T, "activator-button__button"),
|
|
95
98
|
onClick: () => Y(!0),
|
|
96
|
-
className: t(a?.className, e(
|
|
97
|
-
children:
|
|
99
|
+
className: t(a?.className, e(oe.activator, ve)),
|
|
100
|
+
children: De
|
|
98
101
|
}),
|
|
99
102
|
align: u,
|
|
100
|
-
className: t(
|
|
101
|
-
container:
|
|
103
|
+
className: t(g, e(ge), w.root, r.Filter),
|
|
104
|
+
container: m,
|
|
102
105
|
contentStyle: {
|
|
103
|
-
className:
|
|
106
|
+
className: w.popoverContent,
|
|
104
107
|
p: "none"
|
|
105
108
|
},
|
|
106
|
-
"data-testid":
|
|
107
|
-
id:
|
|
109
|
+
"data-testid": T,
|
|
110
|
+
id: V,
|
|
108
111
|
show: J,
|
|
109
112
|
onActivated: () => Y(!0),
|
|
110
113
|
onDeactivated: () => Y(!1),
|
|
111
|
-
ref:
|
|
114
|
+
ref: U,
|
|
112
115
|
type: "listbox",
|
|
113
116
|
children: [
|
|
114
|
-
|
|
115
|
-
$.showHeader && /* @__PURE__ */
|
|
116
|
-
className:
|
|
117
|
-
children: [
|
|
118
|
-
...
|
|
117
|
+
de,
|
|
118
|
+
$.showHeader && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C(p, {
|
|
119
|
+
className: w.searchHeader,
|
|
120
|
+
children: [W && /* @__PURE__ */ S(f, {
|
|
121
|
+
...me,
|
|
119
122
|
role: "searchbox",
|
|
120
|
-
className:
|
|
121
|
-
"data-testid":
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
children: typeof z == "string" ? z : "Reset filter"
|
|
123
|
+
className: w.searchInput,
|
|
124
|
+
"data-testid": s(T, "input"),
|
|
125
|
+
onChange: be,
|
|
126
|
+
onClear: xe
|
|
127
|
+
}), R && G && /* @__PURE__ */ S(se, {
|
|
128
|
+
"data-testid": s(T, "reset-button"),
|
|
129
|
+
onClick: Ce,
|
|
130
|
+
children: typeof R == "string" ? R : "Reset filter"
|
|
129
131
|
})]
|
|
130
|
-
}), $.showResults && /* @__PURE__ */
|
|
131
|
-
$.showResults && /* @__PURE__ */
|
|
132
|
-
className:
|
|
133
|
-
"data-testid":
|
|
132
|
+
}), $.showResults && /* @__PURE__ */ S(ie, {})] }),
|
|
133
|
+
$.showResults && /* @__PURE__ */ S(d, {
|
|
134
|
+
className: w.optionList,
|
|
135
|
+
"data-testid": s(T, "menu"),
|
|
134
136
|
items: Z,
|
|
135
|
-
limitDesktop:
|
|
136
|
-
limitMobile:
|
|
137
|
-
multiSelect:
|
|
138
|
-
onChange:
|
|
139
|
-
selected:
|
|
137
|
+
limitDesktop: O,
|
|
138
|
+
limitMobile: k,
|
|
139
|
+
multiSelect: A,
|
|
140
|
+
onChange: Se,
|
|
141
|
+
selected: G
|
|
142
|
+
}),
|
|
143
|
+
$.showLoading && /* @__PURE__ */ C(ae, {
|
|
144
|
+
gap: "sm",
|
|
145
|
+
verticalAlign: "middle",
|
|
146
|
+
p: "spacing.3",
|
|
147
|
+
children: [/* @__PURE__ */ S(ee, { color: "colour.neutral.70" }), /* @__PURE__ */ S(o, {
|
|
148
|
+
color: "colour.neutral.70",
|
|
149
|
+
children: "Loading results..."
|
|
150
|
+
})]
|
|
140
151
|
}),
|
|
141
|
-
$.showNoResults && /* @__PURE__ */
|
|
142
|
-
className:
|
|
143
|
-
children:
|
|
152
|
+
$.showNoResults && /* @__PURE__ */ S("div", {
|
|
153
|
+
className: w.noResults,
|
|
154
|
+
children: F
|
|
144
155
|
}),
|
|
145
|
-
|
|
156
|
+
ue
|
|
146
157
|
]
|
|
147
|
-
}), /* @__PURE__ */
|
|
158
|
+
}), /* @__PURE__ */ S(p, {
|
|
148
159
|
srOnly: !0,
|
|
149
|
-
id:
|
|
150
|
-
children:
|
|
160
|
+
id: H,
|
|
161
|
+
children: Oe
|
|
151
162
|
})] });
|
|
152
163
|
});
|
|
153
|
-
|
|
164
|
+
T.displayName = "IressDropdownMenu";
|
|
154
165
|
//#endregion
|
|
155
|
-
export {
|
|
166
|
+
export { T as IressDropdownMenu };
|
|
@@ -2,6 +2,7 @@ import { AutocompleteSearchHookReturn } from '../../../components/Autocomplete';
|
|
|
2
2
|
import { IressDropdownMenuProps } from '../DropdownMenu';
|
|
3
3
|
export declare const useDropdownMenuFlags: ({ debouncedQuery, loading, results, searchable, visibleResetButton, }: Omit<AutocompleteSearchHookReturn, "clearError" | "error" | "startSearch" | "stopSearch"> & Pick<IressDropdownMenuProps, "searchable" | "visibleResetButton">) => {
|
|
4
4
|
showHeader: string | boolean | undefined;
|
|
5
|
+
showLoading: boolean;
|
|
5
6
|
showNoResults: string | false;
|
|
6
7
|
showResults: boolean;
|
|
7
8
|
};
|
|
@@ -4,6 +4,7 @@ var t = ({ debouncedQuery: t, loading: n, results: r, searchable: i, visibleRese
|
|
|
4
4
|
let o = e(() => i || a, [i, a]), s = e(() => !!r.length, [r]);
|
|
5
5
|
return {
|
|
6
6
|
showHeader: o,
|
|
7
|
+
showLoading: e(() => n && !r.length, [n, r.length]),
|
|
7
8
|
showNoResults: e(() => r.length === 0 && !n && t, [
|
|
8
9
|
t,
|
|
9
10
|
n,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Control, FieldPath, FieldPathValue, FieldValues, UseControllerProps } from 'react-hook-form';
|
|
3
|
-
import { IressFieldGroupProps } from '../../../components/
|
|
3
|
+
import { IressFieldGroupProps } from '../../../components/FieldGroup';
|
|
4
4
|
import { CustomRules } from './helpers/transformCustomRulesToValidateRule';
|
|
5
5
|
import { FormFieldRenderProps } from './FormField';
|
|
6
6
|
export interface IressFormFieldsetProps<T extends FieldValues = FieldValues, TName extends FieldPath<T> = FieldPath<T>> extends Omit<IressFieldGroupProps, 'children' | 'htmlFor' | 'required' | 'join' | 'inline'>, Omit<UseControllerProps<T, FieldPath<T>>, 'disabled'> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormContext as e } from "../FormContext.js";
|
|
2
|
-
import { IressFieldGroup as t } from "../../../components/
|
|
2
|
+
import { IressFieldGroup as t } from "../../../components/FieldGroup/FieldGroup.js";
|
|
3
3
|
import { getErrorTypeMessage as n } from "./helpers/getErrorTypeMessage.js";
|
|
4
4
|
import { transformCustomRulesToValidateRule as r } from "./helpers/transformCustomRulesToValidateRule.js";
|
|
5
5
|
import { useFieldRenderProps as i } from "./hooks/useFieldRenderProps.js";
|
|
@@ -7,7 +7,7 @@ import { IressHookForm as a } from "../HookForm/HookForm.js";
|
|
|
7
7
|
import { forwardRef as o, useMemo as s } from "react";
|
|
8
8
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
import { useForm as u } from "react-hook-form";
|
|
10
|
-
var d = o(({ actions: o, alert: d, children: f, className: p, criteriaMode: m, context: h, defaultValues: g, delayError: _, footer: v, heading: y, mode: b = "onBlur", panelStyle: x = {
|
|
10
|
+
var d = o(({ actions: o, alert: d, children: f, className: p, criteriaMode: m, context: h, defaultValues: g, delayError: _, footer: v, heading: y, mode: b = "onBlur", panelStyle: x = { p: "spacing.0" }, progressive: S, resetOptions: C, resolver: w, reValidateMode: T = "onChange", shouldUseNativeValidation: E, shouldUnregister: D, sticky: O = !1, values: k, ...A }, j) => {
|
|
11
11
|
let M = u({
|
|
12
12
|
criteriaMode: m,
|
|
13
13
|
context: h,
|
|
@@ -40,6 +40,7 @@ var d = o(({ actions: o, alert: d, children: f, className: p, criteriaMode: m, c
|
|
|
40
40
|
horizontalAlign: "between",
|
|
41
41
|
verticalAlign: "bottom",
|
|
42
42
|
className: N.header,
|
|
43
|
+
noWrap: !0,
|
|
43
44
|
children: [P, /* @__PURE__ */ c("div", {
|
|
44
45
|
className: N.actions,
|
|
45
46
|
children: o
|
|
@@ -48,6 +49,7 @@ var d = o(({ actions: o, alert: d, children: f, className: p, criteriaMode: m, c
|
|
|
48
49
|
/* @__PURE__ */ l(n, {
|
|
49
50
|
...x,
|
|
50
51
|
className: e(N.children, x.className),
|
|
52
|
+
noBorder: !0,
|
|
51
53
|
children: [d, f]
|
|
52
54
|
}),
|
|
53
55
|
v && /* @__PURE__ */ c("div", {
|
|
@@ -22,6 +22,7 @@ var l = i(({ actions: i, alert: l, children: u, className: d, criteriaMode: f, c
|
|
|
22
22
|
values: w
|
|
23
23
|
}), O = n({ pattern: "short" }), k = a(() => typeof g == "string" ? /* @__PURE__ */ o(t, {
|
|
24
24
|
element: "h2",
|
|
25
|
+
mb: "spacing.4",
|
|
25
26
|
children: g
|
|
26
27
|
}) : g, [g]);
|
|
27
28
|
return /* @__PURE__ */ s(r, {
|
|
@@ -37,6 +37,9 @@ export declare const loading: import('../../styled-system/types').SlotRecipeRunt
|
|
|
37
37
|
opacity: number;
|
|
38
38
|
transition: "[opacity 0.3s ease-in-out]";
|
|
39
39
|
zIndex: "100";
|
|
40
|
+
display: "inline-flex";
|
|
41
|
+
alignItems: "center";
|
|
42
|
+
gap: "spacing.2";
|
|
40
43
|
};
|
|
41
44
|
overlay: {
|
|
42
45
|
position: "absolute";
|
|
@@ -37,7 +37,10 @@ var t = e({
|
|
|
37
37
|
borderRadius: "radius.system.tag",
|
|
38
38
|
opacity: 0,
|
|
39
39
|
transition: "[opacity 0.3s ease-in-out]",
|
|
40
|
-
zIndex: "100"
|
|
40
|
+
zIndex: "100",
|
|
41
|
+
display: "inline-flex",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
gap: "spacing.2"
|
|
41
44
|
},
|
|
42
45
|
overlay: {
|
|
43
46
|
position: "absolute",
|
|
@@ -2,8 +2,8 @@ import { t as e } from "../../../cx-CZ8IJJTy.js";
|
|
|
2
2
|
import { t } from "../../../factory-sKbby7-S.js";
|
|
3
3
|
import { propagateTestid as n } from "../../../helpers/utility/propagateTestid.js";
|
|
4
4
|
import { IressCard as r } from "../../../components/Card/Card.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { IressDivider as i } from "../../../components/Divider/Divider.js";
|
|
6
|
+
import { IressInline as a } from "../../../components/Inline/Inline.js";
|
|
7
7
|
import { IressCol as o } from "../../../components/Col/Col.js";
|
|
8
8
|
import { IressContainer as s } from "../../../components/Container/Container.js";
|
|
9
9
|
import { IressStack as c } from "../../../components/Stack/Stack.js";
|
|
@@ -75,7 +75,7 @@ var _ = () => /* @__PURE__ */ h(o, {
|
|
|
75
75
|
children: [/* @__PURE__ */ h(u, {
|
|
76
76
|
textStyle: "typography.heading.1",
|
|
77
77
|
width: "25%"
|
|
78
|
-
}), /* @__PURE__ */ g(
|
|
78
|
+
}), /* @__PURE__ */ g(a, {
|
|
79
79
|
gap: "lg",
|
|
80
80
|
children: [/* @__PURE__ */ h(u, {
|
|
81
81
|
textStyle: "typography.heading.4",
|
|
@@ -86,7 +86,7 @@ var _ = () => /* @__PURE__ */ h(o, {
|
|
|
86
86
|
})]
|
|
87
87
|
})]
|
|
88
88
|
}),
|
|
89
|
-
/* @__PURE__ */ h(
|
|
89
|
+
/* @__PURE__ */ h(i, {}),
|
|
90
90
|
/* @__PURE__ */ g(l, {
|
|
91
91
|
gutter: "lg",
|
|
92
92
|
children: [
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../Shadow-
|
|
1
|
+
import { t as e } from "../../Shadow-D2KoVwxD.js";
|
|
2
2
|
export { e as IressShadow };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../Shadow-
|
|
1
|
+
import { t as e } from "../../Shadow-D2KoVwxD.js";
|
|
2
2
|
export { e as IressShadow };
|
|
@@ -30,6 +30,12 @@ export interface SideNavSideMenuGroup {
|
|
|
30
30
|
children: SideNavSubItem[];
|
|
31
31
|
/** Whether this drawer is active/expanded. */
|
|
32
32
|
active?: boolean;
|
|
33
|
+
/** URL for the group activator link. */
|
|
34
|
+
href?: string;
|
|
35
|
+
/** Custom element type for third-party routing libraries. */
|
|
36
|
+
element?: ElementType;
|
|
37
|
+
/** Optional click handler for the group activator. */
|
|
38
|
+
onClick?: MouseEventHandler;
|
|
33
39
|
}
|
|
34
40
|
/**
|
|
35
41
|
* A panel content entry — either a flat item or a group of items.
|
|
@@ -11,104 +11,110 @@ import { IressMenuGroup as l } from "../../components/Menu/MenuGroup/MenuGroup.j
|
|
|
11
11
|
import { sideNav as u } from "./SideNav.styles.js";
|
|
12
12
|
import { useSideNavState as d } from "./hooks/useSideNavState.js";
|
|
13
13
|
import { isSideNavGroup as f } from "./SideNav.helpers.js";
|
|
14
|
-
import { useMemo as p } from "react";
|
|
15
|
-
import { jsx as
|
|
14
|
+
import { useMemo as p, useState as m } from "react";
|
|
15
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
16
16
|
//#region src/patterns/SideNav/SideNav.tsx
|
|
17
|
-
var
|
|
18
|
-
let [
|
|
19
|
-
items:
|
|
20
|
-
activeItemKey:
|
|
21
|
-
onActiveItemKeyChange:
|
|
22
|
-
sideMenuItems:
|
|
23
|
-
sideMenuLabel:
|
|
24
|
-
expanded:
|
|
25
|
-
defaultExpanded:
|
|
26
|
-
onExpandedChange:
|
|
27
|
-
}),
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
...
|
|
30
|
-
"aria-label":
|
|
31
|
-
className: t(e(
|
|
32
|
-
"data-testid":
|
|
17
|
+
var _ = ({ "aria-label": _ = "Side navigation", activeItemKey: v, className: y, collapseLabel: b = "Collapse navigation", "data-testid": x, defaultExpanded: S, expanded: C, expandLabel: w = "Expand navigation", footer: T, header: E, items: D, numbered: O = !1, onActiveItemKeyChange: k, onExpandedChange: A, sideMenuItems: j, sideMenuLabel: M, style: N, width: P, ...F }) => {
|
|
18
|
+
let [I, L] = p(() => n(F), [F]), R = typeof P == "number" ? `${P}px` : P, { isExpanded: z, toggleExpanded: B, resolvedActiveItemKey: V, setActiveItemKey: H, panelContent: U, panelLabel: W, hasPanelContent: G } = d({
|
|
19
|
+
items: D,
|
|
20
|
+
activeItemKey: v,
|
|
21
|
+
onActiveItemKeyChange: k,
|
|
22
|
+
sideMenuItems: j,
|
|
23
|
+
sideMenuLabel: M,
|
|
24
|
+
expanded: C,
|
|
25
|
+
defaultExpanded: S,
|
|
26
|
+
onExpandedChange: A
|
|
27
|
+
}), [K, q] = m(() => U.find((e) => f(e) && e.active)?.key), J = u({ expanded: z }), Y = u.raw({ expanded: z });
|
|
28
|
+
return /* @__PURE__ */ g(r.nav, {
|
|
29
|
+
...L,
|
|
30
|
+
"aria-label": _,
|
|
31
|
+
className: t(e(Y.root, I), y, i.SideNav),
|
|
32
|
+
"data-testid": x,
|
|
33
33
|
style: {
|
|
34
|
-
"--iress-width":
|
|
35
|
-
...
|
|
34
|
+
"--iress-width": R,
|
|
35
|
+
...N
|
|
36
36
|
},
|
|
37
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ g(s, {
|
|
38
38
|
variant: "rail",
|
|
39
|
-
"data-testid": o(
|
|
40
|
-
children: [
|
|
39
|
+
"data-testid": o(x, "rail"),
|
|
40
|
+
children: [D.map((e) => /* @__PURE__ */ h(c, {
|
|
41
41
|
icon: e.icon,
|
|
42
42
|
href: e.href,
|
|
43
43
|
element: e.element,
|
|
44
44
|
onClick: (t) => {
|
|
45
|
-
|
|
45
|
+
H(e.key), e.onClick?.(t);
|
|
46
46
|
},
|
|
47
47
|
"aria-label": e.ariaLabel ?? (typeof e.label == "string" ? e.label : void 0),
|
|
48
|
-
selected:
|
|
49
|
-
"data-testid": o(
|
|
48
|
+
selected: V === e.key,
|
|
49
|
+
"data-testid": o(x, `rail-item-${e.key}`),
|
|
50
50
|
divider: e.divider,
|
|
51
51
|
children: e.label
|
|
52
|
-
}, e.key)), /* @__PURE__ */
|
|
53
|
-
className:
|
|
54
|
-
listItemStyle: { className:
|
|
55
|
-
icon:
|
|
56
|
-
onClick:
|
|
57
|
-
"aria-expanded":
|
|
58
|
-
"aria-label":
|
|
59
|
-
"data-testid": o(
|
|
60
|
-
children:
|
|
52
|
+
}, e.key)), /* @__PURE__ */ h(c, {
|
|
53
|
+
className: J.toggle,
|
|
54
|
+
listItemStyle: { className: J.toggle },
|
|
55
|
+
icon: z ? "keyboard_double_arrow_left" : "keyboard_double_arrow_right",
|
|
56
|
+
onClick: B,
|
|
57
|
+
"aria-expanded": z,
|
|
58
|
+
"aria-label": z ? b : w,
|
|
59
|
+
"data-testid": o(x, "toggle"),
|
|
60
|
+
children: z ? b : w
|
|
61
61
|
})]
|
|
62
|
-
}), /* @__PURE__ */
|
|
63
|
-
className:
|
|
64
|
-
"data-testid": o(
|
|
65
|
-
"aria-hidden": !
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
className:
|
|
68
|
-
children: /* @__PURE__ */
|
|
69
|
-
className:
|
|
62
|
+
}), /* @__PURE__ */ h("div", {
|
|
63
|
+
className: J.panel,
|
|
64
|
+
"data-testid": o(x, "panel"),
|
|
65
|
+
"aria-hidden": !z,
|
|
66
|
+
children: /* @__PURE__ */ h("div", {
|
|
67
|
+
className: J.panelContent,
|
|
68
|
+
children: /* @__PURE__ */ g("div", {
|
|
69
|
+
className: J.panelContentInner,
|
|
70
70
|
children: [
|
|
71
|
-
|
|
72
|
-
className:
|
|
73
|
-
"data-testid": o(
|
|
74
|
-
children:
|
|
71
|
+
E && /* @__PURE__ */ h("div", {
|
|
72
|
+
className: J.header,
|
|
73
|
+
"data-testid": o(x, "header"),
|
|
74
|
+
children: E
|
|
75
75
|
}),
|
|
76
|
-
|
|
77
|
-
className:
|
|
76
|
+
W && /* @__PURE__ */ h(a, {
|
|
77
|
+
className: J.panelHeading,
|
|
78
78
|
element: "h2",
|
|
79
79
|
textStyle: "typography.heading.3",
|
|
80
|
-
"data-testid": o(
|
|
81
|
-
children:
|
|
80
|
+
"data-testid": o(x, "panel-heading"),
|
|
81
|
+
children: W
|
|
82
82
|
}),
|
|
83
|
-
|
|
83
|
+
G && /* @__PURE__ */ h(s, {
|
|
84
84
|
variant: "side",
|
|
85
|
-
numbered:
|
|
86
|
-
"data-testid": o(
|
|
87
|
-
children:
|
|
85
|
+
numbered: O,
|
|
86
|
+
"data-testid": o(x, "side-menu"),
|
|
87
|
+
children: U.map((e, t) => f(e) ? /* @__PURE__ */ h(l, {
|
|
88
88
|
label: e.label,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
href: e.href,
|
|
90
|
+
element: e.element,
|
|
91
|
+
onClick: e.onClick,
|
|
92
|
+
active: K === e.key,
|
|
93
|
+
onActiveChange: (t) => q(t ? e.key : void 0),
|
|
94
|
+
"data-testid": o(x, `side-group-${e.key ?? t}`),
|
|
95
|
+
children: e.children.map((e, t) => /* @__PURE__ */ h(c, {
|
|
92
96
|
href: e.href,
|
|
93
97
|
element: e.element,
|
|
94
98
|
onClick: e.onClick,
|
|
95
99
|
selected: e.active,
|
|
96
|
-
"data-testid": o(
|
|
100
|
+
"data-testid": o(x, `side-item-${e.key ?? t}`),
|
|
97
101
|
children: e.label
|
|
98
102
|
}, e.key ?? t))
|
|
99
|
-
}, e.key ?? t) : /* @__PURE__ */
|
|
103
|
+
}, e.key ?? t) : /* @__PURE__ */ h(c, {
|
|
100
104
|
href: e.href,
|
|
101
105
|
element: e.element,
|
|
102
|
-
onClick:
|
|
106
|
+
onClick: (t) => {
|
|
107
|
+
q(void 0), e.onClick?.(t);
|
|
108
|
+
},
|
|
103
109
|
selected: e.active,
|
|
104
|
-
"data-testid": o(
|
|
110
|
+
"data-testid": o(x, `side-item-${e.key ?? t}`),
|
|
105
111
|
children: e.label
|
|
106
112
|
}, e.key ?? t))
|
|
107
113
|
}),
|
|
108
|
-
|
|
109
|
-
className:
|
|
110
|
-
"data-testid": o(
|
|
111
|
-
children:
|
|
114
|
+
T && /* @__PURE__ */ h("div", {
|
|
115
|
+
className: J.footer,
|
|
116
|
+
"data-testid": o(x, "footer"),
|
|
117
|
+
children: T
|
|
112
118
|
})
|
|
113
119
|
]
|
|
114
120
|
})
|
|
@@ -116,6 +122,6 @@ var g = ({ "aria-label": g = "Side navigation", activeItemKey: _, className: v,
|
|
|
116
122
|
})]
|
|
117
123
|
});
|
|
118
124
|
};
|
|
119
|
-
|
|
125
|
+
_.displayName = "IressSideNav";
|
|
120
126
|
//#endregion
|
|
121
|
-
export {
|
|
127
|
+
export { _ as IressSideNav };
|
|
@@ -30,7 +30,10 @@ var t = e({
|
|
|
30
30
|
overflow: "hidden",
|
|
31
31
|
transition: "[max-width 0.3s ease-in-out]"
|
|
32
32
|
},
|
|
33
|
-
panelContent: {
|
|
33
|
+
panelContent: {
|
|
34
|
+
width: "var(--iress-width, 260px)",
|
|
35
|
+
height: "12/12"
|
|
36
|
+
},
|
|
34
37
|
panelContentInner: {
|
|
35
38
|
display: "flex",
|
|
36
39
|
flexDirection: "column",
|
|
@@ -38,7 +41,8 @@ var t = e({
|
|
|
38
41
|
borderRadius: "radius.system.layout",
|
|
39
42
|
m: "spacing.4",
|
|
40
43
|
boxShadow: "0 4px 20px #00327126",
|
|
41
|
-
pb: "spacing.2"
|
|
44
|
+
pb: "spacing.2",
|
|
45
|
+
maxHeight: "[calc(100% - ({spacing.spacing.4} * 2))]"
|
|
42
46
|
},
|
|
43
47
|
panelHeading: {
|
|
44
48
|
flexShrink: 0,
|