@altinn/altinn-components 0.26.0 → 0.27.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/FieldsetLegend-Dwb3U0vQ.js +10 -0
- package/dist/Input-B_w6SBmg.js +12 -0
- package/dist/Label-DjSEhgyW.js +11 -0
- package/dist/Paragraph-CFjOkbXa.js +11 -0
- package/dist/Textarea-BBstVlPT.js +10 -0
- package/dist/altinn-ds-overrides.css +2 -2
- package/dist/altinn-ds.css +47 -101
- package/dist/assets/Badge.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/ButtonBase.css +1 -1
- package/dist/assets/ButtonIcon.css +1 -1
- package/dist/assets/ButtonLabel.css +1 -1
- package/dist/assets/ComboButton.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/ListItemHeader.css +1 -1
- package/dist/assets/MenuItemLabel.css +1 -1
- package/dist/components/Badge/Badge.js +3 -3
- package/dist/components/Bookmarks/EditableBookmark.js +31 -30
- package/dist/components/Button/Button.js +41 -43
- package/dist/components/Button/ButtonBase.js +28 -26
- package/dist/components/Button/ButtonIcon.js +3 -3
- package/dist/components/Button/ButtonLabel.js +3 -3
- package/dist/components/Button/ComboButton.js +30 -28
- package/dist/components/Button/IconButton.js +24 -25
- package/dist/components/ContextMenu/ContextMenu.js +5 -6
- package/dist/components/Dialog/DialogActions.js +22 -21
- package/dist/components/DsComponents/index.js +23 -21
- package/dist/components/Forms/Checkbox.js +16 -0
- package/dist/components/Forms/CheckboxOptions.js +12 -0
- package/dist/components/Forms/Field.js +6 -0
- package/dist/components/Forms/FieldBase.js +17 -0
- package/dist/components/Forms/Fieldset.js +28 -0
- package/dist/components/Forms/FieldsetBase.js +15 -0
- package/dist/components/Forms/Input.js +14 -0
- package/dist/components/Forms/Label.js +6 -0
- package/dist/components/Forms/Legend.js +14 -0
- package/dist/components/Forms/OptionsBase.js +18 -0
- package/dist/components/Forms/Radio.js +16 -0
- package/dist/components/Forms/RadioOptions.js +12 -0
- package/dist/components/Forms/Select.js +25 -0
- package/dist/components/Forms/SelectField.js +12 -0
- package/dist/components/Forms/Switch.js +16 -0
- package/dist/components/Forms/SwitchOptions.js +12 -0
- package/dist/components/Forms/TextField.js +12 -0
- package/dist/components/Forms/Textarea.js +6 -0
- package/dist/components/Forms/TextareaField.js +12 -0
- package/dist/components/Forms/index.js +40 -0
- package/dist/components/GlobalMenu/AccountMenu.js +2 -2
- package/dist/components/GlobalMenu/GlobalMenu.js +72 -65
- package/dist/components/List/ListItemHeader.js +30 -30
- package/dist/components/Menu/Menu.js +42 -38
- package/dist/components/Menu/MenuItemLabel.js +10 -10
- package/dist/components/Menu/MenuItemsVirtual.js +28 -27
- package/dist/components/Page/DashboardCard.js +10 -9
- package/dist/components/Page/PageDetails.js +1 -1
- package/dist/components/Page/PageNav.js +6 -6
- package/dist/components/Toolbar/ToolbarButton.js +23 -21
- package/dist/components/Toolbar/ToolbarFilter.js +27 -26
- package/dist/components/index.js +147 -113
- package/dist/{floating-ui.react-BQwG1HOM.js → floating-ui.react-DpzNAs2N.js} +26 -31
- package/dist/{index-DcykCrjD.js → index-B7UjMwQm.js} +13 -12
- package/dist/index-Bq6w9CqA.js +81 -0
- package/dist/index.js +177 -143
- package/dist/lite-1fxw3LjI.js +7 -0
- package/dist/tokens/README.md +1 -1
- package/dist/tokens/altinn-ds.css +48 -102
- package/dist/tokens/design-tokens-build/altinn-ds.css +48 -102
- package/dist/types/fields.js +1 -0
- package/dist/types/lib/components/Bookmarks/BookmarksSection.stories.d.ts +0 -1
- package/dist/types/lib/components/Button/Button.d.ts +1 -2
- package/dist/types/lib/components/Button/Button.stories.d.ts +5 -1
- package/dist/types/lib/components/Button/ButtonBase.d.ts +3 -2
- package/dist/types/lib/components/Button/ComboButton.d.ts +1 -1
- package/dist/types/lib/components/Dialog/DialogActions.d.ts +2 -1
- package/dist/types/lib/components/Dialog/DialogActions.stories.d.ts +1 -1
- package/dist/types/lib/components/Forms/Checkbox.d.ts +7 -0
- package/dist/types/lib/components/Forms/Checkbox.stories.d.ts +15 -0
- package/dist/types/lib/components/Forms/CheckboxOptions.d.ts +5 -0
- package/dist/types/lib/components/Forms/CheckboxOptions.stories.d.ts +18 -0
- package/dist/types/lib/components/Forms/Field.d.ts +7 -0
- package/dist/types/lib/components/Forms/FieldBase.d.ts +8 -0
- package/dist/types/lib/components/Forms/Fieldset.d.ts +7 -0
- package/dist/types/lib/components/Forms/FieldsetBase.d.ts +8 -0
- package/dist/types/lib/components/Forms/Forms.stories.d.ts +7 -0
- package/dist/types/lib/components/Forms/Input.d.ts +10 -0
- package/dist/types/lib/components/Forms/Label.d.ts +7 -0
- package/dist/types/lib/components/Forms/Legend.d.ts +7 -0
- package/dist/types/lib/components/Forms/OptionsBase.d.ts +9 -0
- package/dist/types/lib/components/Forms/Radio.d.ts +7 -0
- package/dist/types/lib/components/Forms/Radio.stories.d.ts +15 -0
- package/dist/types/lib/components/Forms/RadioOptions.d.ts +6 -0
- package/dist/types/lib/components/Forms/RadioOptions.stories.d.ts +18 -0
- package/dist/types/lib/components/Forms/Select.d.ts +9 -0
- package/dist/types/lib/components/Forms/SelectField.d.ts +8 -0
- package/dist/types/lib/components/Forms/SelectField.stories.d.ts +14 -0
- package/dist/types/lib/components/Forms/Switch.d.ts +7 -0
- package/dist/types/lib/components/Forms/Switch.stories.d.ts +15 -0
- package/dist/types/lib/components/Forms/SwitchOptions.d.ts +6 -0
- package/dist/types/lib/components/Forms/SwitchOptions.stories.d.ts +18 -0
- package/dist/types/lib/components/Forms/TextField.d.ts +6 -0
- package/dist/types/lib/components/Forms/TextField.stories.d.ts +15 -0
- package/dist/types/lib/components/Forms/Textarea.d.ts +7 -0
- package/dist/types/lib/components/Forms/TextareaField.d.ts +6 -0
- package/dist/types/lib/components/Forms/TextareaField.stories.d.ts +15 -0
- package/dist/types/lib/components/Forms/index.d.ts +19 -0
- package/dist/types/lib/components/GlobalMenu/AccountMenu.d.ts +4 -2
- package/dist/types/lib/components/GlobalMenu/AccountMenu.stories.d.ts +3 -2
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.d.ts +1 -1
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +3 -2
- package/dist/types/lib/components/Header/Header.stories.d.ts +1 -0
- package/dist/types/lib/components/Menu/Examples.stories.d.ts +6 -6
- package/dist/types/lib/components/Menu/Menu.d.ts +3 -3
- package/dist/types/lib/components/Menu/Menu.stories.d.ts +1 -1
- package/dist/types/lib/components/Menu/MenuItems.d.ts +4 -0
- package/dist/types/lib/components/Menu/MenuItemsVirtual.d.ts +5 -1
- package/dist/types/lib/components/Page/DashboardHeader.stories.d.ts +12 -0
- package/dist/types/lib/components/Page/{Patterns.stories.d.ts → Examples.stories.d.ts} +2 -0
- package/dist/types/lib/components/Toolbar/ToolbarButton.d.ts +2 -1
- package/dist/types/lib/components/Toolbar/ToolbarButton.stories.d.ts +1 -1
- package/dist/types/lib/components/index.d.ts +1 -1
- package/dist/types/lib/types/fields.d.ts +2 -0
- package/dist/usePagination-B4GfH2GQ.js +1026 -0
- package/package.json +1 -1
- package/dist/assets/FieldBase.css +0 -1
- package/dist/assets/InputBase.css +0 -1
- package/dist/components/TextField/FieldBase.js +0 -16
- package/dist/components/TextField/InputBase.js +0 -33
- package/dist/components/TextField/TextField.js +0 -7
- package/dist/components/TextField/index.js +0 -8
- package/dist/types/lib/components/Button/Buttons.stories.d.ts +0 -18
- package/dist/types/lib/components/TextField/FieldBase.d.ts +0 -11
- package/dist/types/lib/components/TextField/InputBase.d.ts +0 -14
- package/dist/types/lib/components/TextField/TextField.d.ts +0 -7
- package/dist/types/lib/components/TextField/index.d.ts +0 -3
- package/dist/usePagination-BJD-uxk9.js +0 -1098
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import "../../index-L8X2o7IH.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../RootProvider/RootProvider.js";
|
|
5
|
+
import "../Search/AutocompleteBase.js";
|
|
6
|
+
import "../Snackbar/useSnackbar.js";
|
|
7
|
+
import { Switch as o } from "./Switch.js";
|
|
8
|
+
import { OptionsBase as s } from "./OptionsBase.js";
|
|
9
|
+
const S = ({ name: t, options: i = [], ...p }) => /* @__PURE__ */ m(s, { ...p, children: i.map((r, e) => /* @__PURE__ */ m(o, { name: (r == null ? void 0 : r.name) || t, ...r }, e)) });
|
|
10
|
+
export {
|
|
11
|
+
S as SwitchOptions
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "../../index-L8X2o7IH.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../RootProvider/RootProvider.js";
|
|
5
|
+
import "../Search/AutocompleteBase.js";
|
|
6
|
+
import "../Snackbar/useSnackbar.js";
|
|
7
|
+
import { Input as e } from "./Input.js";
|
|
8
|
+
import { FieldBase as n } from "./FieldBase.js";
|
|
9
|
+
const a = ({ size: o, color: t, label: i, helperText: m, ...p }) => /* @__PURE__ */ r(n, { size: o, color: t, label: i, helperText: m, children: /* @__PURE__ */ r(e, { ...p }) });
|
|
10
|
+
export {
|
|
11
|
+
a as TextField
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "../../index-L8X2o7IH.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../RootProvider/RootProvider.js";
|
|
5
|
+
import "../Search/AutocompleteBase.js";
|
|
6
|
+
import "../Snackbar/useSnackbar.js";
|
|
7
|
+
import { Textarea as p } from "./Textarea.js";
|
|
8
|
+
import { FieldBase as a } from "./FieldBase.js";
|
|
9
|
+
const T = ({ size: o, color: t, label: i, helperText: m, ...e }) => /* @__PURE__ */ r(a, { size: o, color: t, label: i, helperText: m, children: /* @__PURE__ */ r(p, { ...e }) });
|
|
10
|
+
export {
|
|
11
|
+
T as TextareaField
|
|
12
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Field as r } from "./Field.js";
|
|
2
|
+
import { Fieldset as p } from "./Fieldset.js";
|
|
3
|
+
import { Legend as f } from "./Legend.js";
|
|
4
|
+
import { Label as i } from "./Label.js";
|
|
5
|
+
import { Input as d } from "./Input.js";
|
|
6
|
+
import { Textarea as s } from "./Textarea.js";
|
|
7
|
+
import { Select as c } from "./Select.js";
|
|
8
|
+
import { Radio as h } from "./Radio.js";
|
|
9
|
+
import { Checkbox as S } from "./Checkbox.js";
|
|
10
|
+
import { Switch as B } from "./Switch.js";
|
|
11
|
+
import { FieldBase as k } from "./FieldBase.js";
|
|
12
|
+
import { TextField as C } from "./TextField.js";
|
|
13
|
+
import { TextareaField as R } from "./TextareaField.js";
|
|
14
|
+
import { SelectField as u } from "./SelectField.js";
|
|
15
|
+
import { FieldsetBase as j } from "./FieldsetBase.js";
|
|
16
|
+
import { OptionsBase as v } from "./OptionsBase.js";
|
|
17
|
+
import { RadioOptions as z } from "./RadioOptions.js";
|
|
18
|
+
import { SwitchOptions as D } from "./SwitchOptions.js";
|
|
19
|
+
import { CheckboxOptions as G } from "./CheckboxOptions.js";
|
|
20
|
+
export {
|
|
21
|
+
S as Checkbox,
|
|
22
|
+
G as CheckboxOptions,
|
|
23
|
+
r as Field,
|
|
24
|
+
k as FieldBase,
|
|
25
|
+
p as Fieldset,
|
|
26
|
+
j as FieldsetBase,
|
|
27
|
+
d as Input,
|
|
28
|
+
i as Label,
|
|
29
|
+
f as Legend,
|
|
30
|
+
v as OptionsBase,
|
|
31
|
+
h as Radio,
|
|
32
|
+
z as RadioOptions,
|
|
33
|
+
c as Select,
|
|
34
|
+
u as SelectField,
|
|
35
|
+
B as Switch,
|
|
36
|
+
D as SwitchOptions,
|
|
37
|
+
C as TextField,
|
|
38
|
+
s as Textarea,
|
|
39
|
+
R as TextareaField
|
|
40
|
+
};
|
|
@@ -12,7 +12,7 @@ const w = (d) => `${d} hits`, k = ({
|
|
|
12
12
|
accountSearch: s,
|
|
13
13
|
onSelectAccount: m,
|
|
14
14
|
currentAccount: p,
|
|
15
|
-
|
|
15
|
+
menuItemsVirtual: C
|
|
16
16
|
}) => {
|
|
17
17
|
var f;
|
|
18
18
|
const t = d.map((e) => ({
|
|
@@ -65,7 +65,7 @@ const w = (d) => `${d} hits`, k = ({
|
|
|
65
65
|
search: s && b,
|
|
66
66
|
groups: I,
|
|
67
67
|
items: h,
|
|
68
|
-
|
|
68
|
+
menuItemsVirtual: C
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
};
|
|
@@ -1,88 +1,95 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsxs as e, jsx as i, Fragment as g } from "react/jsx-runtime";
|
|
3
|
+
import { useState as w, useMemo as z } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { AccountMenu as
|
|
7
|
-
import { AccountButton as
|
|
8
|
-
import { BackButton as
|
|
9
|
-
import { LogoutButton as
|
|
10
|
-
import { EndUserLabel as
|
|
6
|
+
import { AccountMenu as D } from "./AccountMenu.js";
|
|
7
|
+
import { AccountButton as J } from "./AccountButton.js";
|
|
8
|
+
import { BackButton as K } from "./BackButton.js";
|
|
9
|
+
import { LogoutButton as v } from "./LogoutButton.js";
|
|
10
|
+
import { EndUserLabel as x } from "./EndUserLabel.js";
|
|
11
11
|
import "../Search/AutocompleteBase.js";
|
|
12
12
|
import "../Snackbar/useSnackbar.js";
|
|
13
|
-
import { MenuListItem as
|
|
14
|
-
import { Menu as
|
|
15
|
-
import { GlobalMenuBase as
|
|
16
|
-
const
|
|
17
|
-
accounts:
|
|
18
|
-
accountGroups:
|
|
19
|
-
accountSearch:
|
|
20
|
-
items:
|
|
21
|
-
groups:
|
|
22
|
-
changeLabel:
|
|
23
|
-
backLabel:
|
|
24
|
-
currentAccount:
|
|
25
|
-
currentEndUserLabel:
|
|
26
|
-
onSelectAccount:
|
|
27
|
-
onClose:
|
|
28
|
-
logoutButton:
|
|
29
|
-
|
|
13
|
+
import { MenuListItem as d } from "../Menu/MenuBase.js";
|
|
14
|
+
import { Menu as G } from "../Menu/Menu.js";
|
|
15
|
+
import { GlobalMenuBase as o, GlobalMenuHeader as L, GlobalMenuFooter as y } from "./GlobalMenuBase.js";
|
|
16
|
+
const U = ({
|
|
17
|
+
accounts: n = [],
|
|
18
|
+
accountGroups: B = {},
|
|
19
|
+
accountSearch: T,
|
|
20
|
+
items: c = [],
|
|
21
|
+
groups: k,
|
|
22
|
+
changeLabel: j = "Change",
|
|
23
|
+
backLabel: F = "Back",
|
|
24
|
+
currentAccount: p,
|
|
25
|
+
currentEndUserLabel: l = "Signed in",
|
|
26
|
+
onSelectAccount: f,
|
|
27
|
+
onClose: r,
|
|
28
|
+
logoutButton: t,
|
|
29
|
+
menuItemsVirtual: H
|
|
30
30
|
}) => {
|
|
31
|
-
const [
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
...
|
|
31
|
+
const [S, W] = w(!1), h = () => {
|
|
32
|
+
W((a) => !a);
|
|
33
|
+
}, q = (a) => {
|
|
34
|
+
h(), r == null || r(), f == null || f(a);
|
|
35
|
+
}, s = z(() => c.map((a) => ({
|
|
36
|
+
...a,
|
|
37
37
|
onClick: () => {
|
|
38
|
-
var
|
|
39
|
-
(
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
var m;
|
|
39
|
+
(m = a.onClick) == null || m.call(a), r == null || r();
|
|
40
|
+
},
|
|
41
|
+
items: Array.isArray(a.items) ? a.items.map((m) => ({
|
|
42
|
+
...m,
|
|
43
|
+
onClick: () => {
|
|
44
|
+
var M;
|
|
45
|
+
(M = m.onClick) == null || M.call(m), r == null || r();
|
|
46
|
+
}
|
|
47
|
+
})) : void 0
|
|
48
|
+
})), [c, r]);
|
|
49
|
+
return S ? /* @__PURE__ */ e(o, { children: [
|
|
50
|
+
/* @__PURE__ */ i(L, { children: /* @__PURE__ */ i(K, { onClick: h, label: F }) }),
|
|
51
|
+
/* @__PURE__ */ i(d, { as: "div", role: "separator" }),
|
|
45
52
|
/* @__PURE__ */ i(
|
|
46
|
-
|
|
53
|
+
D,
|
|
47
54
|
{
|
|
48
|
-
currentAccount:
|
|
49
|
-
accounts:
|
|
50
|
-
accountGroups:
|
|
51
|
-
accountSearch:
|
|
52
|
-
onSelectAccount:
|
|
53
|
-
|
|
55
|
+
currentAccount: p,
|
|
56
|
+
accounts: n,
|
|
57
|
+
accountGroups: B,
|
|
58
|
+
accountSearch: T,
|
|
59
|
+
onSelectAccount: q,
|
|
60
|
+
menuItemsVirtual: H
|
|
54
61
|
}
|
|
55
62
|
)
|
|
56
|
-
] }) :
|
|
63
|
+
] }) : p ? /* @__PURE__ */ e(o, { color: p == null ? void 0 : p.type, children: [
|
|
57
64
|
/* @__PURE__ */ i(
|
|
58
|
-
|
|
65
|
+
J,
|
|
59
66
|
{
|
|
60
|
-
account:
|
|
61
|
-
linkText:
|
|
62
|
-
multipleAccounts:
|
|
63
|
-
onClick:
|
|
67
|
+
account: p,
|
|
68
|
+
linkText: j,
|
|
69
|
+
multipleAccounts: n.length > 1,
|
|
70
|
+
onClick: h
|
|
64
71
|
}
|
|
65
72
|
),
|
|
66
|
-
/* @__PURE__ */ i(
|
|
67
|
-
/* @__PURE__ */ i(
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */ i(
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */ i(
|
|
73
|
+
/* @__PURE__ */ i(d, { as: "div", role: "separator" }),
|
|
74
|
+
/* @__PURE__ */ i(G, { groups: k, items: s, theme: "default" }),
|
|
75
|
+
t && /* @__PURE__ */ e(g, { children: [
|
|
76
|
+
/* @__PURE__ */ i(d, { as: "div", role: "separator" }),
|
|
77
|
+
/* @__PURE__ */ e(y, { children: [
|
|
78
|
+
l && /* @__PURE__ */ i(x, { children: l }),
|
|
79
|
+
/* @__PURE__ */ i(v, { ...t })
|
|
73
80
|
] })
|
|
74
81
|
] })
|
|
75
|
-
] }) : /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */ i(
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */ i(
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
/* @__PURE__ */ i(
|
|
82
|
+
] }) : /* @__PURE__ */ e(o, { children: [
|
|
83
|
+
/* @__PURE__ */ i(G, { groups: k, items: s }),
|
|
84
|
+
t && /* @__PURE__ */ e(g, { children: [
|
|
85
|
+
/* @__PURE__ */ i(d, { as: "div", role: "separator" }),
|
|
86
|
+
/* @__PURE__ */ e(y, { children: [
|
|
87
|
+
l && /* @__PURE__ */ i(x, { children: l }),
|
|
88
|
+
/* @__PURE__ */ i(v, { ...t })
|
|
82
89
|
] })
|
|
83
90
|
] })
|
|
84
91
|
] });
|
|
85
92
|
};
|
|
86
93
|
export {
|
|
87
|
-
|
|
94
|
+
U as GlobalMenu
|
|
88
95
|
};
|
|
@@ -14,7 +14,7 @@ import "../Snackbar/useSnackbar.js";
|
|
|
14
14
|
import { S as O } from "../../ChevronUp-H8Nuww4h.js";
|
|
15
15
|
import { S as P } from "../../ChevronDown-CRAwzuD3.js";
|
|
16
16
|
import { S as Q } from "../../ChevronRight-DUaHaWi-.js";
|
|
17
|
-
import '../../assets/ListItemHeader.css';const W = "
|
|
17
|
+
import '../../assets/ListItemHeader.css';const W = "_wrapper_e1z23_1", X = "_link_e1z23_5", Y = "_linkTitle_e1z23_10", Z = "_header_e1z23_16", $ = "_content_e1z23_54", t = {
|
|
18
18
|
wrapper: W,
|
|
19
19
|
link: X,
|
|
20
20
|
linkTitle: Y,
|
|
@@ -27,22 +27,22 @@ import '../../assets/ListItemHeader.css';const W = "_wrapper_1c93s_1", X = "_lin
|
|
|
27
27
|
theme: v,
|
|
28
28
|
loading: r,
|
|
29
29
|
disabled: k,
|
|
30
|
-
collapsible:
|
|
31
|
-
linkIcon:
|
|
32
|
-
expanded:
|
|
33
|
-
select:
|
|
34
|
-
href:
|
|
35
|
-
onClick:
|
|
36
|
-
onKeyPress:
|
|
37
|
-
tabIndex:
|
|
38
|
-
size:
|
|
39
|
-
title:
|
|
40
|
-
description:
|
|
41
|
-
icon:
|
|
30
|
+
collapsible: z,
|
|
31
|
+
linkIcon: L,
|
|
32
|
+
expanded: S,
|
|
33
|
+
select: l,
|
|
34
|
+
href: u,
|
|
35
|
+
onClick: x,
|
|
36
|
+
onKeyPress: N,
|
|
37
|
+
tabIndex: w,
|
|
38
|
+
size: s = "sm",
|
|
39
|
+
title: a,
|
|
40
|
+
description: b,
|
|
41
|
+
icon: y,
|
|
42
42
|
avatar: C,
|
|
43
|
-
active:
|
|
43
|
+
active: c,
|
|
44
44
|
avatarGroup: T,
|
|
45
|
-
badge:
|
|
45
|
+
badge: i,
|
|
46
46
|
controls: p,
|
|
47
47
|
className: j,
|
|
48
48
|
children: B,
|
|
@@ -55,7 +55,7 @@ import '../../assets/ListItemHeader.css';const W = "_wrapper_1c93s_1", X = "_lin
|
|
|
55
55
|
md: "lg",
|
|
56
56
|
lg: "lg",
|
|
57
57
|
xl: "xl"
|
|
58
|
-
}, d =
|
|
58
|
+
}, d = z ? S ? O : P : L ? Q : void 0, o = D[s], F = () => i && !r && typeof i == "object" && "label" in i ? /* @__PURE__ */ e(V, { ...i }) : R(i) ? i : null, h = M();
|
|
59
59
|
return /* @__PURE__ */ e("div", { className: t.wrapper, children: /* @__PURE__ */ n(
|
|
60
60
|
"header",
|
|
61
61
|
{
|
|
@@ -63,8 +63,8 @@ import '../../assets/ListItemHeader.css';const W = "_wrapper_1c93s_1", X = "_lin
|
|
|
63
63
|
"data-color": I,
|
|
64
64
|
"data-theme": v,
|
|
65
65
|
"data-interactive": m,
|
|
66
|
-
"data-size":
|
|
67
|
-
"data-has-active-child":
|
|
66
|
+
"data-size": s,
|
|
67
|
+
"data-has-active-child": c,
|
|
68
68
|
children: [
|
|
69
69
|
/* @__PURE__ */ e(
|
|
70
70
|
q,
|
|
@@ -72,25 +72,25 @@ import '../../assets/ListItemHeader.css';const W = "_wrapper_1c93s_1", X = "_lin
|
|
|
72
72
|
interactive: m,
|
|
73
73
|
className: f(t.link),
|
|
74
74
|
as: _,
|
|
75
|
-
href:
|
|
76
|
-
onClick:
|
|
77
|
-
onKeyPress:
|
|
78
|
-
tabIndex:
|
|
75
|
+
href: u,
|
|
76
|
+
onClick: x,
|
|
77
|
+
onKeyPress: N,
|
|
78
|
+
tabIndex: w,
|
|
79
79
|
loading: r,
|
|
80
80
|
disabled: k || r,
|
|
81
|
-
active:
|
|
81
|
+
active: c,
|
|
82
82
|
describedby: h,
|
|
83
|
-
children: /* @__PURE__ */ e("span", { className: t.linkTitle, children: E ||
|
|
83
|
+
children: /* @__PURE__ */ e("span", { className: t.linkTitle, children: E || a })
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
/* @__PURE__ */ n("div", { className: t.content, "data-size":
|
|
87
|
-
|
|
86
|
+
/* @__PURE__ */ n("div", { className: t.content, "data-size": s, children: [
|
|
87
|
+
l && /* @__PURE__ */ e(K, { ...l, className: t.select, size: o }),
|
|
88
88
|
/* @__PURE__ */ e(
|
|
89
89
|
G,
|
|
90
90
|
{
|
|
91
91
|
loading: r,
|
|
92
92
|
size: o,
|
|
93
|
-
icon:
|
|
93
|
+
icon: y,
|
|
94
94
|
avatar: C,
|
|
95
95
|
avatarGroup: T
|
|
96
96
|
}
|
|
@@ -98,10 +98,10 @@ import '../../assets/ListItemHeader.css';const W = "_wrapper_1c93s_1", X = "_lin
|
|
|
98
98
|
/* @__PURE__ */ e(
|
|
99
99
|
A,
|
|
100
100
|
{
|
|
101
|
-
size:
|
|
101
|
+
size: s,
|
|
102
102
|
loading: r,
|
|
103
|
-
title:
|
|
104
|
-
description:
|
|
103
|
+
title: a,
|
|
104
|
+
description: b,
|
|
105
105
|
id: h,
|
|
106
106
|
titleAs: g,
|
|
107
107
|
children: B
|
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { MenuBase as
|
|
3
|
-
import { MenuItems as
|
|
4
|
-
import { MenuItemsVirtual as
|
|
5
|
-
const
|
|
6
|
-
color:
|
|
7
|
-
theme:
|
|
8
|
-
defaultItemColor:
|
|
9
|
-
defaultItemTheme:
|
|
10
|
-
defaultItemSize:
|
|
11
|
-
defaultIconTheme:
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { MenuBase as R } from "./MenuBase.js";
|
|
3
|
+
import { MenuItems as B } from "./MenuItems.js";
|
|
4
|
+
import { MenuItemsVirtual as S } from "./MenuItemsVirtual.js";
|
|
5
|
+
const w = ({
|
|
6
|
+
color: i,
|
|
7
|
+
theme: n,
|
|
8
|
+
defaultItemColor: p,
|
|
9
|
+
defaultItemTheme: M,
|
|
10
|
+
defaultItemSize: c,
|
|
11
|
+
defaultIconTheme: f,
|
|
12
12
|
groups: s,
|
|
13
|
-
items:
|
|
14
|
-
search:
|
|
15
|
-
|
|
16
|
-
}) =>
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
13
|
+
items: x = [],
|
|
14
|
+
search: y,
|
|
15
|
+
menuItemsVirtual: r
|
|
16
|
+
}) => {
|
|
17
|
+
const { isVirtualized: j } = r || {};
|
|
18
|
+
return j ? /* @__PURE__ */ o(R, { color: i, theme: n, children: /* @__PURE__ */ o(
|
|
19
|
+
S,
|
|
20
|
+
{
|
|
21
|
+
search: y,
|
|
22
|
+
items: x,
|
|
23
|
+
groups: s,
|
|
24
|
+
defaultItemSize: c,
|
|
25
|
+
defaultItemColor: p,
|
|
26
|
+
defaultItemTheme: M,
|
|
27
|
+
defaultIconTheme: f,
|
|
28
|
+
scrollRefStyles: r == null ? void 0 : r.scrollRefStyles
|
|
29
|
+
}
|
|
30
|
+
) }) : /* @__PURE__ */ o(R, { color: i, theme: n, children: /* @__PURE__ */ o(
|
|
31
|
+
B,
|
|
32
|
+
{
|
|
33
|
+
search: y,
|
|
34
|
+
items: x,
|
|
35
|
+
groups: s,
|
|
36
|
+
defaultItemSize: c,
|
|
37
|
+
defaultItemColor: p,
|
|
38
|
+
defaultItemTheme: M,
|
|
39
|
+
defaultIconTheme: f
|
|
40
|
+
}
|
|
41
|
+
) });
|
|
42
|
+
};
|
|
39
43
|
export {
|
|
40
|
-
|
|
44
|
+
w as Menu
|
|
41
45
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e, jsxs as m, Fragment as d } from "react/jsx-runtime";
|
|
2
2
|
import { c as p } from "../../index-L8X2o7IH.js";
|
|
3
|
-
import '../../assets/MenuItemLabel.css';const _ = "
|
|
3
|
+
import '../../assets/MenuItemLabel.css';const _ = "_label_10xs5_1", x = "_title_10xs5_19", b = "_description_10xs5_42", s = {
|
|
4
4
|
label: _,
|
|
5
|
-
title:
|
|
5
|
+
title: x,
|
|
6
6
|
description: b
|
|
7
|
-
},
|
|
7
|
+
}, u = ({
|
|
8
8
|
className: l,
|
|
9
|
-
size:
|
|
9
|
+
size: t = "sm",
|
|
10
10
|
label: i,
|
|
11
11
|
title: n,
|
|
12
12
|
weight: c,
|
|
13
13
|
description: o,
|
|
14
14
|
children: a
|
|
15
15
|
}) => {
|
|
16
|
-
const r = c ||
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
16
|
+
const r = c || t === "lg" ? "medium" : "normal";
|
|
17
|
+
return /* @__PURE__ */ e("span", { className: p(s.label, l), "data-size": t, children: a || /* @__PURE__ */ m(d, { children: [
|
|
18
|
+
/* @__PURE__ */ e("strong", { className: s.title, "data-size": t, "data-weight": r, children: n || i }),
|
|
19
|
+
/* @__PURE__ */ e("span", { className: s.description, "data-size": t, children: o })
|
|
20
20
|
] }) });
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
u as MenuItemLabel
|
|
24
24
|
};
|
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as v, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { u as
|
|
4
|
-
import { useRef as
|
|
3
|
+
import { u as b } from "../../index-DyDqjche.js";
|
|
4
|
+
import { useRef as R, useEffect as T } from "react";
|
|
5
5
|
import "../../index-L8X2o7IH.js";
|
|
6
|
-
import { useMenu as
|
|
6
|
+
import { useMenu as V } from "../../hooks/useMenu.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { MenuItem as
|
|
9
|
-
import { MenuSearch as
|
|
10
|
-
import { MenuHeader as
|
|
11
|
-
import { MenuList as
|
|
8
|
+
import { MenuItem as $ } from "./MenuItem.js";
|
|
9
|
+
import { MenuSearch as j } from "./MenuSearch.js";
|
|
10
|
+
import { MenuHeader as k } from "./MenuHeader.js";
|
|
11
|
+
import { MenuList as N, MenuListItem as g } from "./MenuBase.js";
|
|
12
12
|
import "../Search/AutocompleteBase.js";
|
|
13
13
|
import "../Snackbar/useSnackbar.js";
|
|
14
|
-
import '../../assets/MenuItemsVirtual.css';const
|
|
15
|
-
virtualScrollRef:
|
|
16
|
-
virtualMenuListItem:
|
|
17
|
-
},
|
|
18
|
-
level:
|
|
14
|
+
import '../../assets/MenuItemsVirtual.css';const q = "_virtualScrollRef_12fdc_1", B = "_virtualMenuListItem_12fdc_6", y = {
|
|
15
|
+
virtualScrollRef: q,
|
|
16
|
+
virtualMenuListItem: B
|
|
17
|
+
}, W = ({
|
|
18
|
+
level: h = 0,
|
|
19
19
|
search: l,
|
|
20
20
|
items: I,
|
|
21
21
|
groups: M = {},
|
|
22
22
|
defaultItemSize: x,
|
|
23
23
|
defaultItemColor: S,
|
|
24
24
|
defaultItemTheme: P,
|
|
25
|
-
defaultIconTheme: L
|
|
25
|
+
defaultIconTheme: L,
|
|
26
|
+
scrollRefStyles: z
|
|
26
27
|
}) => {
|
|
27
|
-
const { menu:
|
|
28
|
+
const { menu: _ } = V({
|
|
28
29
|
items: I,
|
|
29
30
|
groups: M,
|
|
30
31
|
groupByKey: "groupId",
|
|
31
32
|
keyboardEvents: !1
|
|
32
|
-
}), m =
|
|
33
|
+
}), m = R(null), a = _.flatMap((t, e) => {
|
|
33
34
|
var u;
|
|
34
|
-
const
|
|
35
|
+
const E = (t == null ? void 0 : t.props) || {}, { title: c } = E, p = ((u = t == null ? void 0 : t.items) == null ? void 0 : u.filter((r) => {
|
|
35
36
|
var s;
|
|
36
37
|
return !((s = r.props) != null && s.hidden);
|
|
37
38
|
})) || [];
|
|
38
39
|
return [
|
|
39
|
-
...e > 0 ||
|
|
40
|
+
...e > 0 || h > 0 ? [{ type: "separator" }] : [],
|
|
40
41
|
...c ? [{ type: "title", title: c }] : [],
|
|
41
42
|
...p.map((r, s) => {
|
|
42
43
|
var d, f;
|
|
@@ -49,32 +50,32 @@ import '../../assets/MenuItemsVirtual.css';const g = "_virtualScrollRef_12fdc_1"
|
|
|
49
50
|
};
|
|
50
51
|
})
|
|
51
52
|
];
|
|
52
|
-
}), n =
|
|
53
|
+
}), n = b({
|
|
53
54
|
count: a.length,
|
|
54
55
|
gap: 8,
|
|
55
56
|
estimateSize: () => 44,
|
|
56
57
|
getScrollElement: () => m.current
|
|
57
58
|
}), o = n.getVirtualItems();
|
|
58
|
-
return
|
|
59
|
+
return T(() => {
|
|
59
60
|
for (const t of o) {
|
|
60
61
|
const e = document.querySelector(`[data-index="${t.index}"]`);
|
|
61
62
|
e && n.measureElement(e);
|
|
62
63
|
}
|
|
63
|
-
}, [o]), /* @__PURE__ */ v(
|
|
64
|
-
l && /* @__PURE__ */ i(
|
|
65
|
-
/* @__PURE__ */ i("div", { ref: m, className:
|
|
64
|
+
}, [o]), /* @__PURE__ */ v(N, { children: [
|
|
65
|
+
l && /* @__PURE__ */ i(j, { ...l }),
|
|
66
|
+
/* @__PURE__ */ i("div", { ref: m, className: y.virtualScrollRef, style: z, children: /* @__PURE__ */ i("div", { style: { position: "relative", height: `${n.getTotalSize()}px` }, children: o.map((t) => {
|
|
66
67
|
const e = a[t.index];
|
|
67
68
|
return e ? /* @__PURE__ */ v(
|
|
68
|
-
|
|
69
|
+
g,
|
|
69
70
|
{
|
|
70
71
|
dataIndex: t.index,
|
|
71
|
-
className:
|
|
72
|
+
className: y.virtualMenuListItem,
|
|
72
73
|
style: { transform: `translateY(${t.start}px)` },
|
|
73
74
|
role: e.type === "separator" ? "separator" : void 0,
|
|
74
75
|
children: [
|
|
75
|
-
e.type === "title" && /* @__PURE__ */ i(
|
|
76
|
+
e.type === "title" && /* @__PURE__ */ i(k, { title: e.title }),
|
|
76
77
|
e.type === "item" && /* @__PURE__ */ i(
|
|
77
|
-
|
|
78
|
+
$,
|
|
78
79
|
{
|
|
79
80
|
...e.itemProps,
|
|
80
81
|
size: e.itemProps.size || x,
|
|
@@ -93,5 +94,5 @@ import '../../assets/MenuItemsVirtual.css';const g = "_virtualScrollRef_12fdc_1"
|
|
|
93
94
|
] });
|
|
94
95
|
};
|
|
95
96
|
export {
|
|
96
|
-
|
|
97
|
+
W as MenuItemsVirtual
|
|
97
98
|
};
|