@altinn/altinn-components 0.24.4 → 0.24.6
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/README.md +16 -2
- package/dist/PersonCircle-DMwECpgW.js +25 -0
- package/dist/assets/AccountButton.css +1 -0
- package/dist/assets/EndUserLabel.css +1 -0
- package/dist/assets/GlobalMenuBase.css +1 -1
- package/dist/assets/MenuItemBase.css +1 -1
- package/dist/assets/MenuItemLabel.css +1 -1
- package/dist/components/Dropdown/DrawerBase.js +15 -8
- package/dist/components/Dropdown/DropdownBase.js +21 -21
- package/dist/components/GlobalMenu/AccountButton.js +34 -12
- package/dist/components/GlobalMenu/EndUserLabel.js +13 -0
- package/dist/components/GlobalMenu/GlobalMenu.js +68 -60
- package/dist/components/GlobalMenu/GlobalMenuBase.js +9 -9
- package/dist/components/GlobalMenu/index.js +10 -8
- package/dist/components/Header/LocaleSwitcher.js +24 -10
- package/dist/components/Menu/MenuItemBase.js +5 -5
- package/dist/components/Menu/MenuItemLabel.js +21 -10
- package/dist/components/Menu/MenuItems.js +24 -23
- package/dist/components/Toolbar/Toolbar.js +32 -31
- package/dist/components/index.js +252 -250
- package/dist/index.js +260 -258
- package/dist/types/lib/components/Dropdown/DrawerBase.d.ts +2 -1
- package/dist/types/lib/components/Dropdown/DropdownBase.d.ts +2 -1
- package/dist/types/lib/components/GlobalMenu/EndUserLabel.d.ts +5 -0
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.d.ts +2 -1
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +3 -1
- package/dist/types/lib/components/GlobalMenu/GlobalMenuBase.d.ts +3 -1
- package/dist/types/lib/components/GlobalMenu/index.d.ts +1 -0
- package/dist/types/lib/components/Menu/Examples.stories.d.ts +4 -0
- package/dist/types/lib/components/Menu/MenuItemLabel.d.ts +2 -1
- package/dist/types/lib/components/Menu/MenuItems.d.ts +3 -1
- package/package.json +1 -1
- package/dist/userMenuItems-vSWEGGu2.js +0 -84
|
@@ -11,7 +11,8 @@ export interface GlobalMenuProps extends AccountMenuProps {
|
|
|
11
11
|
changeLabel?: string;
|
|
12
12
|
className?: string;
|
|
13
13
|
currentAccount?: Account;
|
|
14
|
+
currentEndUserLabel?: string;
|
|
14
15
|
onSelectAccount?: (id: string) => void;
|
|
15
16
|
onClose?: () => void;
|
|
16
17
|
}
|
|
17
|
-
export declare const GlobalMenu: ({ accounts, accountGroups, accountSearch, items, groups, changeLabel, backLabel, currentAccount, onSelectAccount, onClose, logoutButton, isVirtualized, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const GlobalMenu: ({ accounts, accountGroups, accountSearch, items, groups, changeLabel, backLabel, currentAccount, currentEndUserLabel, onSelectAccount, onClose, logoutButton, isVirtualized, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { Account } from './AccountButton.tsx';
|
|
|
3
3
|
import { GlobalMenuProps } from './GlobalMenu';
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: ({ accounts, accountGroups, accountSearch, items, groups, changeLabel, backLabel, currentAccount, onSelectAccount, onClose, logoutButton, isVirtualized, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
component: ({ accounts, accountGroups, accountSearch, items, groups, changeLabel, backLabel, currentAccount, currentEndUserLabel, onSelectAccount, onClose, logoutButton, isVirtualized, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
tags: string[];
|
|
8
8
|
parameters: {};
|
|
9
9
|
args: {
|
|
@@ -15,6 +15,7 @@ declare const meta: {
|
|
|
15
15
|
changeLabel?: string;
|
|
16
16
|
className?: string;
|
|
17
17
|
currentAccount?: Account;
|
|
18
|
+
currentEndUserLabel?: string;
|
|
18
19
|
onSelectAccount?: (id: string) => void;
|
|
19
20
|
onClose?: () => void;
|
|
20
21
|
accounts?: import('./AccountMenu.tsx').AccountMenuItem[];
|
|
@@ -26,4 +27,5 @@ declare const meta: {
|
|
|
26
27
|
export default meta;
|
|
27
28
|
type Story = StoryObj<typeof meta>;
|
|
28
29
|
export declare const Default: (args: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const Company: (args: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
31
|
export declare const Login: Story;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { Color } from '../';
|
|
2
3
|
export interface GlobalMenuBaseProps {
|
|
4
|
+
color?: Color;
|
|
3
5
|
children: ReactNode;
|
|
4
6
|
}
|
|
5
7
|
export interface GlobalMenuHeaderProps {
|
|
@@ -8,6 +10,6 @@ export interface GlobalMenuHeaderProps {
|
|
|
8
10
|
export interface GlobalMenuFooterProps {
|
|
9
11
|
children: ReactNode;
|
|
10
12
|
}
|
|
11
|
-
export declare const GlobalMenuBase: ({ children }: GlobalMenuBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const GlobalMenuBase: ({ color, children }: GlobalMenuBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export declare const GlobalMenuHeader: ({ children }: GlobalMenuHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export declare const GlobalMenuFooter: ({ children }: GlobalMenuFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -22,6 +22,7 @@ export declare const CompanyInboxMenu: {
|
|
|
22
22
|
defaultItemColor?: import('./MenuItemBase').MenuItemColor;
|
|
23
23
|
defaultItemTheme?: import('./MenuItemBase').MenuItemTheme;
|
|
24
24
|
defaultIconTheme?: import('..').IconTheme;
|
|
25
|
+
as?: React.ElementType;
|
|
25
26
|
};
|
|
26
27
|
};
|
|
27
28
|
export declare const PersonInboxMenu: {
|
|
@@ -38,6 +39,7 @@ export declare const PersonInboxMenu: {
|
|
|
38
39
|
defaultItemColor?: import('./MenuItemBase').MenuItemColor;
|
|
39
40
|
defaultItemTheme?: import('./MenuItemBase').MenuItemTheme;
|
|
40
41
|
defaultIconTheme?: import('..').IconTheme;
|
|
42
|
+
as?: React.ElementType;
|
|
41
43
|
};
|
|
42
44
|
};
|
|
43
45
|
export declare const CompanyMenu: Story;
|
|
@@ -55,6 +57,7 @@ export declare const NeutralCompanyMenu: {
|
|
|
55
57
|
defaultItemColor?: import('./MenuItemBase').MenuItemColor;
|
|
56
58
|
defaultItemTheme?: import('./MenuItemBase').MenuItemTheme;
|
|
57
59
|
defaultIconTheme?: import('..').IconTheme;
|
|
60
|
+
as?: React.ElementType;
|
|
58
61
|
};
|
|
59
62
|
};
|
|
60
63
|
export declare const PersonMenu: Story;
|
|
@@ -72,5 +75,6 @@ export declare const NeutralPersonMenu: {
|
|
|
72
75
|
defaultItemColor?: import('./MenuItemBase').MenuItemColor;
|
|
73
76
|
defaultItemTheme?: import('./MenuItemBase').MenuItemTheme;
|
|
74
77
|
defaultIconTheme?: import('..').IconTheme;
|
|
78
|
+
as?: React.ElementType;
|
|
75
79
|
};
|
|
76
80
|
};
|
|
@@ -5,7 +5,8 @@ export interface MenuItemLabelProps {
|
|
|
5
5
|
size?: MenuItemSize;
|
|
6
6
|
label?: string;
|
|
7
7
|
title?: string;
|
|
8
|
+
weight?: 'medium' | 'normal';
|
|
8
9
|
description?: string;
|
|
9
10
|
children?: ReactNode;
|
|
10
11
|
}
|
|
11
|
-
export declare const MenuItemLabel: ({ className, size, label, title, description, children }: MenuItemLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const MenuItemLabel: ({ className, size, label, title, weight, description, children, }: MenuItemLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
1
2
|
import { IconTheme, MenuItemColor, MenuItemProps, MenuItemSize, MenuItemTheme } from '../';
|
|
2
3
|
import { MenuSearchProps } from './MenuSearch';
|
|
3
4
|
export interface MenuGroupProps {
|
|
@@ -19,5 +20,6 @@ export interface MenuItemsProps {
|
|
|
19
20
|
defaultItemColor?: MenuItemColor;
|
|
20
21
|
defaultItemTheme?: MenuItemTheme;
|
|
21
22
|
defaultIconTheme?: IconTheme;
|
|
23
|
+
as?: ElementType;
|
|
22
24
|
}
|
|
23
|
-
export declare const MenuItems: ({ level, expanded, search, items, groups, defaultItemSize, defaultItemColor, defaultItemTheme, defaultIconTheme, }: MenuItemsProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const MenuItems: ({ level, expanded, search, items, groups, defaultItemSize, defaultItemColor, defaultItemTheme, defaultIconTheme, as, }: MenuItemsProps) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as n from "react";
|
|
3
|
-
import { forwardRef as a } from "react";
|
|
4
|
-
import { u as d } from "./useId-CsCRkvK3.js";
|
|
5
|
-
import { S as c } from "./Handshake-Bz9FuL-x.js";
|
|
6
|
-
import { S as f } from "./Bookmark-85oKfr9m.js";
|
|
7
|
-
import { S as s } from "./ClockDashed-PQgzLSPC.js";
|
|
8
|
-
var u = function(t, i) {
|
|
9
|
-
var l = {};
|
|
10
|
-
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && i.indexOf(e) < 0 && (l[e] = t[e]);
|
|
11
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
12
|
-
for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
|
|
13
|
-
i.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (l[e[r]] = t[e[r]]);
|
|
14
|
-
return l;
|
|
15
|
-
};
|
|
16
|
-
const p = a((t, i) => {
|
|
17
|
-
var { title: l, titleId: e } = t, r = u(t, ["title", "titleId"]);
|
|
18
|
-
let o = d();
|
|
19
|
-
return o = l ? e || "title-" + o : void 0, n.createElement(
|
|
20
|
-
"svg",
|
|
21
|
-
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: i, "aria-labelledby": o }, r),
|
|
22
|
-
l ? n.createElement("title", { id: o }, l) : null,
|
|
23
|
-
n.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12.75 2.5a.75.75 0 0 0-1.5 0v1.273c-2.222.14-3.655.92-4.499 2.186-.887 1.33-1.001 3.04-1.001 4.541v3c0 .809-.424 1.92-.92 2.915a18 18 0 0 1-.936 1.641l-.014.022-.004.006A.75.75 0 0 0 4.5 19.25h4.338a3.25 3.25 0 0 0 6.324 0H19.5a.75.75 0 0 0 .624-1.166l-.004-.006-.014-.022-.06-.091c-.05-.081-.125-.2-.215-.35-.18-.301-.42-.722-.66-1.2-.497-.994-.921-2.106-.921-2.915v-3c0-1.501-.114-3.21-1.001-4.541-.844-1.266-2.277-2.046-4.499-2.186zM12 5.25c-2.345 0-3.436.694-4.001 1.541-.613.92-.749 2.21-.749 3.709v3c0 1.191-.576 2.58-1.08 3.585q-.178.358-.349.665H18.18a19 19 0 0 1-.35-.665c-.503-1.006-1.079-2.394-1.079-3.585v-3c0-1.499-.136-2.79-.749-3.709C15.436 5.944 14.345 5.25 12 5.25m-1.237 14.487a1.8 1.8 0 0 1-.344-.487h3.162a1.75 1.75 0 0 1-1.581 1 1.75 1.75 0 0 1-1.237-.513", clipRule: "evenodd" })
|
|
24
|
-
);
|
|
25
|
-
});
|
|
26
|
-
var g = function(t, i) {
|
|
27
|
-
var l = {};
|
|
28
|
-
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && i.indexOf(e) < 0 && (l[e] = t[e]);
|
|
29
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
30
|
-
for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
|
|
31
|
-
i.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (l[e[r]] = t[e[r]]);
|
|
32
|
-
return l;
|
|
33
|
-
};
|
|
34
|
-
const m = a((t, i) => {
|
|
35
|
-
var { title: l, titleId: e } = t, r = g(t, ["title", "titleId"]);
|
|
36
|
-
let o = d();
|
|
37
|
-
return o = l ? e || "title-" + o : void 0, n.createElement(
|
|
38
|
-
"svg",
|
|
39
|
-
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: i, "aria-labelledby": o }, r),
|
|
40
|
-
l ? n.createElement("title", { id: o }, l) : null,
|
|
41
|
-
n.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12 3.75a8.25 8.25 0 0 0-5.144 14.7 5.25 5.25 0 0 1 10.288 0A8.25 8.25 0 0 0 12 3.75m3.747 15.602a3.75 3.75 0 0 0-7.494 0A8.2 8.2 0 0 0 12 20.25c1.35 0 2.623-.324 3.747-.898M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12M12 7.25a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M8.25 9.5a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0", clipRule: "evenodd" })
|
|
42
|
-
);
|
|
43
|
-
}), I = [
|
|
44
|
-
{
|
|
45
|
-
id: "user",
|
|
46
|
-
groupId: "1",
|
|
47
|
-
size: "lg",
|
|
48
|
-
title: "Din profil"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: "settings",
|
|
52
|
-
groupId: "2",
|
|
53
|
-
icon: m,
|
|
54
|
-
title: "Innstillinger"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: "accounts",
|
|
58
|
-
groupId: "3",
|
|
59
|
-
icon: c,
|
|
60
|
-
title: "Tilganger"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: "notifications",
|
|
64
|
-
groupId: "3",
|
|
65
|
-
icon: p,
|
|
66
|
-
title: "Varslinger"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: "favourites",
|
|
70
|
-
groupId: "3",
|
|
71
|
-
icon: f,
|
|
72
|
-
title: "Favoritter"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: "log",
|
|
76
|
-
groupId: "5",
|
|
77
|
-
icon: s,
|
|
78
|
-
title: "Aktivitetslogg"
|
|
79
|
-
}
|
|
80
|
-
];
|
|
81
|
-
export {
|
|
82
|
-
m as S,
|
|
83
|
-
I as u
|
|
84
|
-
};
|