@altinn/altinn-components 0.44.4 → 0.45.1
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/ArrowUndo-hge1gMu8.js +24 -0
- package/dist/Button-B0t0vz2h.js +23 -0
- package/dist/Globe-BcPkcH4E.js +24 -0
- package/dist/Heading-By5DKz2H.js +12 -0
- package/dist/HeartFill-CYSrJ_xK.js +43 -0
- package/dist/PersonCircle-DlX_3kRO.js +24 -0
- package/dist/Spinner-BDXfwXIh.js +26 -0
- package/dist/assets/AccountMenuButton.css +1 -0
- package/dist/assets/AccountSelector.css +1 -0
- package/dist/assets/GlobalHeader.css +1 -0
- package/dist/assets/GlobalHeaderBase.css +1 -0
- package/dist/assets/GlobalMenuButton2.css +1 -0
- package/dist/assets/HeaderGroup2.css +1 -0
- package/dist/assets/HeaderLogo2.css +1 -0
- package/dist/assets/LayoutBody.css +1 -1
- package/dist/assets/NotificationItemBase.css +1 -0
- package/dist/assets/NotificationItemIcon.css +1 -0
- package/dist/assets/globalSearch.css +1 -0
- package/dist/components/Account/AccountListItemControls.js +22 -58
- package/dist/components/Account/AccountMenu.js +40 -36
- package/dist/components/Account/AccountMenuButton.js +131 -0
- package/dist/components/Account/AccountNotificationSettings.js +1 -1
- package/dist/components/Avatar/Avatar.js +23 -22
- package/dist/components/Bookmarks/BookmarksListItem.js +7 -9
- package/dist/components/Bookmarks/BookmarksSection.js +27 -23
- package/dist/components/Bookmarks/EditableBookmark.js +63 -78
- package/dist/components/Dashboard/DashboardHeader.js +1 -1
- package/dist/components/Dropdown/DrawerBase.js +17 -15
- package/dist/components/Dropdown/DropdownBase.js +14 -12
- package/dist/components/Dropdown/FloatingDropdown.js +6 -6
- package/dist/components/DsComponents/index.js +26 -22
- package/dist/components/Forms/Checkbox.js +1 -1
- package/dist/components/Forms/CheckboxOptions.js +1 -1
- package/dist/components/Forms/FieldBase.js +1 -1
- package/dist/components/Forms/FieldsetBase.js +1 -1
- package/dist/components/Forms/Radio.js +1 -1
- package/dist/components/Forms/RadioOptions.js +1 -1
- package/dist/components/Forms/SearchField.js +1 -1
- package/dist/components/Forms/SelectField.js +1 -1
- package/dist/components/Forms/Switch.js +1 -1
- package/dist/components/Forms/SwitchOptions.js +1 -1
- package/dist/components/Forms/TextField.js +1 -1
- package/dist/components/Forms/TextareaField.js +1 -1
- package/dist/components/GlobalHeader/AccountSelector.js +138 -0
- package/dist/components/GlobalHeader/DigdirLogomark.js +109 -0
- package/dist/components/GlobalHeader/GlobalHeader.js +117 -0
- package/dist/components/GlobalHeader/GlobalHeaderBase.js +22 -0
- package/dist/components/GlobalHeader/GlobalSearch.js +57 -0
- package/dist/components/GlobalHeader/GlobalSearchButton.js +53 -0
- package/dist/components/GlobalHeader/HeaderGroup.js +8 -0
- package/dist/components/GlobalHeader/HeaderLogo.js +17 -0
- package/dist/components/GlobalHeader/index.js +6 -0
- package/dist/components/GlobalMenu/BackButton.js +6 -24
- package/dist/components/GlobalMenu/EndUserLabel.js +10 -29
- package/dist/components/GlobalMenu/GlobalMenu.js +38 -61
- package/dist/components/GlobalMenu/GlobalMenuButton.js +69 -47
- package/dist/components/GlobalMenu/LocaleButton.js +12 -0
- package/dist/components/GlobalMenu/LocaleSwitcher.js +34 -0
- package/dist/components/GlobalMenu/index.js +6 -12
- package/dist/components/GlobalMenu_old/BackButton.js +11 -0
- package/dist/components/GlobalMenu_old/EndUserLabel.js +13 -0
- package/dist/components/GlobalMenu_old/GlobalMenu.js +75 -0
- package/dist/components/GlobalMenu_old/GlobalMenuBase.js +10 -0
- package/dist/components/GlobalMenu_old/GlobalMenuButton.js +58 -0
- package/dist/components/GlobalMenu_old/LogoutButton.js +14 -0
- package/dist/components/GlobalMenu_old/index.js +14 -0
- package/dist/components/Header/Header.js +25 -25
- package/dist/components/Header/LocaleButton.js +13 -30
- package/dist/components/Layout/Layout.js +25 -23
- package/dist/components/Layout/LayoutBody.js +1 -1
- package/dist/components/List/ListItemSelect.js +1 -1
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuSearch.js +2 -2
- package/dist/components/Notifications/NotificationItem.js +17 -0
- package/dist/components/Notifications/NotificationItemBase.js +86 -0
- package/dist/components/Notifications/NotificationItemControls.js +33 -0
- package/dist/components/Notifications/NotificationItemIcon.js +33 -0
- package/dist/components/Notifications/index.js +10 -0
- package/dist/components/RootProvider/RootProvider.js +42 -30
- package/dist/components/Searchbar/Searchbar.js +3 -3
- package/dist/components/Settings/BookmarksSettingsItem.js +1 -1
- package/dist/components/Settings/SettingsItem.js +22 -11
- package/dist/components/Toolbar/ToolbarAccountMenu.js +5 -5
- package/dist/components/Toolbar/ToolbarAdd.js +5 -5
- package/dist/components/Toolbar/ToolbarFilter.js +5 -5
- package/dist/components/Toolbar/ToolbarOptions.js +1 -1
- package/dist/components/Toolbar/ToolbarSearch.js +1 -1
- package/dist/components/index.js +305 -293
- package/dist/functions/date/date.js +16 -0
- package/dist/functions/date/date.spec.js +15 -0
- package/dist/functions/date/index.js +4 -0
- package/dist/functions/index.js +4 -2
- package/dist/globalSearch.module-Ejp7X0dO.js +9 -0
- package/dist/hooks/index.js +4 -2
- package/dist/hooks/useAccountSelector.js +214 -0
- package/dist/index-B6sKSsN9.js +2951 -0
- package/dist/index.js +304 -288
- package/dist/types/languageCode.js +1 -0
- package/dist/types/lib/components/Account/AccountMenu.d.ts +1 -1
- package/dist/types/lib/components/Account/AccountMenuButton.d.ts +11 -0
- package/dist/types/lib/components/Account/AccountMenuButton.stories.d.ts +31 -0
- package/dist/types/lib/components/Avatar/Avatar.d.ts +3 -1
- package/dist/types/lib/components/Avatar/Avatar.stories.d.ts +16 -1
- package/dist/types/lib/components/Bookmarks/BookmarksListItem.d.ts +1 -2
- package/dist/types/lib/components/Bookmarks/BookmarksListItem.stories.d.ts +1 -1
- package/dist/types/lib/components/Bookmarks/BookmarksSection.d.ts +3 -1
- package/dist/types/lib/components/Bookmarks/BookmarksSection.stories.d.ts +19 -1
- package/dist/types/lib/components/Bookmarks/EditableBookmark.d.ts +7 -3
- package/dist/types/lib/components/Dialog/SeenByLogItem.stories.d.ts +1 -0
- package/dist/types/lib/components/Dropdown/DrawerBase.d.ts +2 -1
- package/dist/types/lib/components/GlobalHeader/AccountSector.stories.d.ts +29 -0
- package/dist/types/lib/components/GlobalHeader/AccountSelector.d.ts +11 -0
- package/dist/types/lib/components/GlobalHeader/DigdirLogomark.d.ts +5 -0
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.d.ts +20 -0
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.stories.d.ts +27 -0
- package/dist/types/lib/components/GlobalHeader/GlobalHeaderBase.d.ts +9 -0
- package/dist/types/lib/components/GlobalHeader/GlobalSearch.d.ts +4 -0
- package/dist/types/lib/components/GlobalHeader/GlobalSearchButton.d.ts +4 -0
- package/dist/types/lib/components/GlobalHeader/HeaderGroup.d.ts +6 -0
- package/dist/types/lib/components/GlobalHeader/HeaderLogo.d.ts +10 -0
- package/dist/types/lib/components/GlobalHeader/index.d.ts +2 -0
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.d.ts +3 -5
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +6 -8
- package/dist/types/lib/components/GlobalMenu/GlobalMenuButton.d.ts +2 -3
- package/dist/types/lib/components/GlobalMenu/GlobalMenuButton.stories.d.ts +5 -9
- package/dist/types/lib/components/GlobalMenu/LocaleButton.d.ts +3 -0
- package/dist/types/lib/components/GlobalMenu/LocaleSwitcher.d.ts +7 -0
- package/dist/types/lib/components/GlobalMenu/index.d.ts +1 -4
- package/dist/types/lib/components/GlobalMenu_old/BackButton.d.ts +7 -0
- package/dist/types/lib/components/{GlobalMenu → GlobalMenu_old}/CurrentAccount.d.ts +1 -1
- package/dist/types/lib/components/GlobalMenu_old/EndUserLabel.d.ts +5 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenu.d.ts +18 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenu.stories.d.ts +30 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenuBase.d.ts +15 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenuButton.d.ts +13 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenuButton.stories.d.ts +19 -0
- package/dist/types/lib/components/GlobalMenu_old/LogoutButton.d.ts +7 -0
- package/dist/types/lib/components/GlobalMenu_old/index.d.ts +6 -0
- package/dist/types/lib/components/Header/Header.d.ts +2 -2
- package/dist/types/lib/components/Header/Header.stories.d.ts +2 -2
- package/dist/types/lib/components/Layout/Layout.d.ts +4 -2
- package/dist/types/lib/components/Layout/Layout.stories.d.ts +29 -5
- package/dist/types/lib/components/Notifications/NotificationItem.d.ts +7 -0
- package/dist/types/lib/components/Notifications/NotificationItemBase.d.ts +15 -0
- package/dist/types/lib/components/Notifications/NotificationItemControls.d.ts +10 -0
- package/dist/types/lib/components/Notifications/NotificationItemIcon.d.ts +11 -0
- package/dist/types/lib/components/Notifications/Notifications.stories.d.ts +10 -0
- package/dist/types/lib/components/Notifications/index.d.ts +4 -0
- package/dist/types/lib/components/RootProvider/RootProvider.d.ts +9 -4
- package/dist/types/lib/components/Settings/SettingsItem.d.ts +1 -1
- package/dist/types/lib/components/index.d.ts +2 -1
- package/dist/types/lib/functions/date/date.d.ts +6 -0
- package/dist/types/lib/functions/date/date.spec.d.ts +1 -0
- package/dist/types/lib/functions/date/index.d.ts +1 -0
- package/dist/types/lib/functions/index.d.ts +1 -0
- package/dist/types/lib/hooks/index.d.ts +1 -0
- package/dist/types/lib/hooks/useAccountSelector.d.ts +62 -0
- package/dist/types/lib/types/index.d.ts +1 -0
- package/dist/types/lib/types/languageCode.d.ts +1 -0
- package/dist/usePagination-cq1YWZkE.js +889 -0
- package/package.json +1 -1
- package/dist/usePagination-B24SmI8E.js +0 -3835
- /package/dist/components/{GlobalMenu → GlobalMenu_old}/CurrentAccount.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -6,7 +6,7 @@ export interface AccountSearchProps extends MenuSearchProps {
|
|
|
6
6
|
}
|
|
7
7
|
export interface AccountMenuItemProps extends MenuItemProps {
|
|
8
8
|
id: string;
|
|
9
|
-
type: 'person' | 'company' | 'group';
|
|
9
|
+
type: 'person' | 'company' | 'group' | 'subunit';
|
|
10
10
|
name: string;
|
|
11
11
|
}
|
|
12
12
|
export interface AccountMenuProps extends MenuProps {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AccountMenuItemProps, ButtonProps } from '..';
|
|
2
|
+
export interface AccountMenuButtonProps extends ButtonProps {
|
|
3
|
+
currentAccount?: AccountMenuItemProps;
|
|
4
|
+
className?: string;
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
/** Display the button as a minimized, mobile-friendly version */
|
|
7
|
+
minimized?: boolean;
|
|
8
|
+
tabIndex?: number;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const AccountMenuButton: ({ className, currentAccount, expanded, minimized, loading, ...buttonProps }: AccountMenuButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Account } from '..';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ className, currentAccount, expanded, minimized, loading, ...buttonProps }: import('./AccountMenuButton').AccountMenuButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
args: {
|
|
11
|
+
currentAccount: Account;
|
|
12
|
+
minimized: false;
|
|
13
|
+
expanded: false;
|
|
14
|
+
};
|
|
15
|
+
argTypes: {
|
|
16
|
+
minimized: {
|
|
17
|
+
control: "boolean";
|
|
18
|
+
};
|
|
19
|
+
expanded: {
|
|
20
|
+
control: "boolean";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
26
|
+
export declare const Login: Story;
|
|
27
|
+
export declare const Person: Story;
|
|
28
|
+
export declare const Company: Story;
|
|
29
|
+
export declare const Expanded: Story;
|
|
30
|
+
export declare const Loading: Story;
|
|
31
|
+
export declare const MinimizedForMobile: Story;
|
|
@@ -40,9 +40,11 @@ export interface AvatarProps {
|
|
|
40
40
|
style?: CSSProperties;
|
|
41
41
|
/** Whether the avatar is loading. */
|
|
42
42
|
loading?: boolean;
|
|
43
|
+
/** A string key to generate the avatar's color, as an alternative to the name prop. */
|
|
44
|
+
colorKey?: string;
|
|
43
45
|
}
|
|
44
46
|
export declare const isAvatarProps: (icon: unknown) => icon is AvatarProps;
|
|
45
47
|
/**
|
|
46
48
|
* Avatar component to display user or company avatars with various customization options.
|
|
47
49
|
*/
|
|
48
|
-
export declare const Avatar: ({ type, isParent, isDeleted, size, name, shape, color, variant, imageUrl, imageUrlAlt, customLabel, loading, className, style, }: AvatarProps) => ReactElement;
|
|
50
|
+
export declare const Avatar: ({ type, isParent, isDeleted, size, name, shape, color, variant, imageUrl, imageUrlAlt, customLabel, loading, className, colorKey, style, }: AvatarProps) => ReactElement;
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { AvatarProps } from '..';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ type, isParent, isDeleted, size, name, shape, color, variant, imageUrl, imageUrlAlt, customLabel, loading, className, style, }: AvatarProps) => React.ReactElement;
|
|
5
|
+
component: ({ type, isParent, isDeleted, size, name, shape, color, variant, imageUrl, imageUrlAlt, customLabel, loading, className, colorKey, style, }: AvatarProps) => React.ReactElement;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {
|
|
8
8
|
layout: string;
|
|
@@ -10,12 +10,27 @@ declare const meta: {
|
|
|
10
10
|
args: {
|
|
11
11
|
name: string;
|
|
12
12
|
type: "person";
|
|
13
|
+
size: "md";
|
|
13
14
|
style: {
|
|
14
15
|
fontSize: string;
|
|
15
16
|
width: string;
|
|
16
17
|
height: string;
|
|
17
18
|
};
|
|
18
19
|
};
|
|
20
|
+
argTypes: {
|
|
21
|
+
size: {
|
|
22
|
+
control: {
|
|
23
|
+
type: "select";
|
|
24
|
+
};
|
|
25
|
+
options: string[];
|
|
26
|
+
};
|
|
27
|
+
type: {
|
|
28
|
+
control: {
|
|
29
|
+
type: "select";
|
|
30
|
+
};
|
|
31
|
+
options: string[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
19
34
|
};
|
|
20
35
|
export default meta;
|
|
21
36
|
type Story = StoryObj<typeof meta>;
|
|
@@ -3,6 +3,5 @@ export interface BookmarksListItemProps extends ListItemProps {
|
|
|
3
3
|
/** Query params */
|
|
4
4
|
params?: QueryItemProps[];
|
|
5
5
|
ariaLabel?: string;
|
|
6
|
-
icon?: ListItemProps['icon'];
|
|
7
6
|
}
|
|
8
|
-
export declare const BookmarksListItem: ({ loading, title, ariaLabel, params,
|
|
7
|
+
export declare const BookmarksListItem: ({ loading, title, ariaLabel, params, ...rest }: BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ loading, title, ariaLabel, params,
|
|
4
|
+
component: ({ loading, title, ariaLabel, params, ...rest }: import('./BookmarksListItem').BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
7
|
args: {
|
|
@@ -5,6 +5,8 @@ export interface BookmarksSectionProps {
|
|
|
5
5
|
items: EditableBookmarkProps[];
|
|
6
6
|
untitled?: string;
|
|
7
7
|
titleField?: TextFieldProps;
|
|
8
|
+
expandedId?: string;
|
|
9
|
+
onToggle?: (id: string) => void;
|
|
8
10
|
loading?: boolean;
|
|
9
11
|
}
|
|
10
|
-
export declare const BookmarksSection: ({ loading, title, description, items, untitled, titleField, }: BookmarksSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const BookmarksSection: ({ loading, title, description, items, untitled, titleField, expandedId, onToggle, }: BookmarksSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { BookmarksSectionProps } from './BookmarksSection';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ loading, title, description, items, untitled, titleField, }: BookmarksSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
component: ({ loading, title, description, items, untitled, titleField, expandedId, onToggle, }: BookmarksSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {};
|
|
8
8
|
args: {
|
|
@@ -30,6 +30,7 @@ declare const meta: {
|
|
|
30
30
|
type: "filter";
|
|
31
31
|
label: string;
|
|
32
32
|
})[];
|
|
33
|
+
expandIconAltText: string;
|
|
33
34
|
} | {
|
|
34
35
|
id: string;
|
|
35
36
|
params: ({
|
|
@@ -46,6 +47,22 @@ declare const meta: {
|
|
|
46
47
|
label: string;
|
|
47
48
|
onClick: () => void;
|
|
48
49
|
};
|
|
50
|
+
expandIconAltText: string;
|
|
51
|
+
title?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
id: string;
|
|
54
|
+
params: {
|
|
55
|
+
type: "filter";
|
|
56
|
+
label: string;
|
|
57
|
+
}[];
|
|
58
|
+
saveButton: {
|
|
59
|
+
label: string;
|
|
60
|
+
};
|
|
61
|
+
removeButton: {
|
|
62
|
+
label: string;
|
|
63
|
+
onClick?: undefined;
|
|
64
|
+
};
|
|
65
|
+
expandIconAltText: string;
|
|
49
66
|
title?: undefined;
|
|
50
67
|
})[];
|
|
51
68
|
};
|
|
@@ -53,6 +70,7 @@ declare const meta: {
|
|
|
53
70
|
export default meta;
|
|
54
71
|
type Story = StoryObj<typeof meta>;
|
|
55
72
|
export declare const Default: Story;
|
|
73
|
+
export declare const ExpandedItem: Story;
|
|
56
74
|
export declare const ControlledState: (args: BookmarksSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
75
|
export declare const LoadingState: Story;
|
|
58
76
|
export declare const EmptyState: Story;
|
|
@@ -2,20 +2,24 @@ import { ButtonProps, TextFieldProps, BookmarksListItemProps, QueryItemProps } f
|
|
|
2
2
|
export interface EditableBookmarkProps extends BookmarksListItemProps {
|
|
3
3
|
/** Bookmark id */
|
|
4
4
|
id: string;
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/** discernible text for expand icon */
|
|
6
|
+
expandIconAltText: string;
|
|
7
7
|
/** Input value */
|
|
8
8
|
inputValue?: string;
|
|
9
9
|
/** On change */
|
|
10
10
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
11
|
/** Loading */
|
|
12
12
|
loading?: boolean;
|
|
13
|
+
/** Expanded */
|
|
14
|
+
expanded?: boolean;
|
|
13
15
|
/** Optional title */
|
|
14
16
|
title?: string;
|
|
15
17
|
/** Untitled */
|
|
16
18
|
untitled?: string;
|
|
17
19
|
/** Query params */
|
|
18
20
|
params?: QueryItemProps[];
|
|
21
|
+
/** Toggle function */
|
|
22
|
+
onToggle?: () => void;
|
|
19
23
|
/** Title field */
|
|
20
24
|
titleField?: TextFieldProps;
|
|
21
25
|
/** Save button */
|
|
@@ -25,4 +29,4 @@ export interface EditableBookmarkProps extends BookmarksListItemProps {
|
|
|
25
29
|
/** Render as **/
|
|
26
30
|
as?: React.ElementType;
|
|
27
31
|
}
|
|
28
|
-
export declare const EditableBookmark: ({ id, title, untitled, params, titleField, saveButton, removeButton, inputValue, onChange,
|
|
32
|
+
export declare const EditableBookmark: ({ id, title, untitled, params, expanded, onToggle, titleField, saveButton, removeButton, inputValue, onChange, expandIconAltText, ...rest }: EditableBookmarkProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,5 +6,6 @@ export interface DrawerBaseProps {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
as?: 'nav' | 'div';
|
|
9
|
+
dataLayout?: 'mobile' | 'desktop';
|
|
9
10
|
}
|
|
10
|
-
export declare const DrawerBase: ({ placement, open, className, children, as, }: DrawerBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const DrawerBase: ({ placement, open, className, children, as, dataLayout, }: DrawerBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AccountSelectorProps } from './AccountSelector';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ accountMenu, forceOpenFullScreen, className, loading }: AccountSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
args: {
|
|
10
|
+
accountMenu: undefined;
|
|
11
|
+
forceOpenFullScreen: undefined;
|
|
12
|
+
loading: false;
|
|
13
|
+
};
|
|
14
|
+
argTypes: {
|
|
15
|
+
accountMenu: {
|
|
16
|
+
control: "object";
|
|
17
|
+
};
|
|
18
|
+
forceOpenFullScreen: {
|
|
19
|
+
control: "boolean";
|
|
20
|
+
};
|
|
21
|
+
loading: {
|
|
22
|
+
control: "boolean";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
export declare const WithAccounts: (args: AccountSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const NoAccounts: (args: AccountSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const Loading: (args: AccountSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AccountMenuProps } from '../Account';
|
|
2
|
+
export interface AccountSelectorProps {
|
|
3
|
+
accountMenu: AccountMenuProps;
|
|
4
|
+
/** External control of fullscreen mode. When this flag is true, the account menu will open and cannot be minimized or closed.
|
|
5
|
+
* Otherwise, open state is handled internally and the user can toggle fullscreen mode via the button below the account list.
|
|
6
|
+
*/
|
|
7
|
+
forceOpenFullScreen?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const AccountSelector: ({ accountMenu, forceOpenFullScreen, className, loading }: AccountSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BadgeProps } from '../Badge/index.tsx';
|
|
2
|
+
import { GlobalMenuProps, LocaleSwitcherProps } from '../GlobalMenu/index.tsx';
|
|
3
|
+
import { MenuProps } from '../Menu/index.ts';
|
|
4
|
+
import { AccountSelectorProps } from './AccountSelector.tsx';
|
|
5
|
+
import { GlobalSearchProps } from './GlobalSearch.tsx';
|
|
6
|
+
import { HeaderLogoProps } from './HeaderLogo.tsx';
|
|
7
|
+
export interface GlobalHeaderProps {
|
|
8
|
+
globalMenu: GlobalMenuProps;
|
|
9
|
+
/** Use to override globalMenu.menu on desktop */
|
|
10
|
+
desktopMenu?: MenuProps;
|
|
11
|
+
/** Use to override globalMenu.menu on mobile */
|
|
12
|
+
mobileMenu?: MenuProps;
|
|
13
|
+
globalSearch?: GlobalSearchProps;
|
|
14
|
+
locale?: LocaleSwitcherProps;
|
|
15
|
+
accountSelector?: AccountSelectorProps;
|
|
16
|
+
badge?: BadgeProps | undefined;
|
|
17
|
+
logo?: HeaderLogoProps;
|
|
18
|
+
onLoginClick?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const GlobalHeader: ({ globalMenu, desktopMenu, mobileMenu, globalSearch, locale, accountSelector, logo, badge, onLoginClick, }: GlobalHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GlobalHeaderProps } from './';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ globalMenu, desktopMenu, mobileMenu, globalSearch, locale, accountSelector, logo, badge, onLoginClick, }: GlobalHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
args: {
|
|
10
|
+
globalMenu: import('..').GlobalMenuProps_old;
|
|
11
|
+
desktopMenu?: import('..').MenuProps;
|
|
12
|
+
mobileMenu?: import('..').MenuProps;
|
|
13
|
+
locale?: import('..').LocaleSwitcherProps;
|
|
14
|
+
search?: import('..').SearchbarProps;
|
|
15
|
+
currentAccount?: import('..').Account;
|
|
16
|
+
badge?: import('..').BadgeProps | undefined;
|
|
17
|
+
logo?: import('..').HeaderLogoProps;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
export declare const Login: () => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const LoggedIn: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const CompanyAccount: () => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const ForcedFullScreenAccountSelection: () => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const WithCustomBadge: () => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const LoadingWithForcedFullScreenAccountSelection: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface HeaderBaseProps {
|
|
3
|
+
currentId?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
openBackdrop?: boolean;
|
|
7
|
+
onCloseBackdrop?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const GlobalHeaderBase: ({ currentId, className, children, openBackdrop, onCloseBackdrop, }: HeaderBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ElementType, MouseEventHandler } from 'react';
|
|
2
|
+
import { BadgeProps } from '../Badge/Badge.tsx';
|
|
3
|
+
export interface HeaderLogoProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
as?: ElementType;
|
|
6
|
+
href?: string;
|
|
7
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
8
|
+
badge?: BadgeProps;
|
|
9
|
+
}
|
|
10
|
+
export declare const HeaderLogo: ({ className, as, href, badge }: HeaderLogoProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LocaleSwitcherProps } from '../Header';
|
|
2
2
|
import { MenuProps } from '../Menu';
|
|
3
3
|
import { LogoutButtonProps } from './LogoutButton';
|
|
4
4
|
export interface GlobalMenuProps {
|
|
5
|
-
accountMenu?: AccountMenuProps;
|
|
6
5
|
menu?: MenuProps;
|
|
7
6
|
menuLabel?: string;
|
|
8
7
|
backLabel?: string;
|
|
9
8
|
logoutButton?: LogoutButtonProps;
|
|
10
9
|
changeLabel?: string;
|
|
11
10
|
className?: string;
|
|
12
|
-
currentAccount?: Account;
|
|
13
11
|
currentEndUserLabel?: string;
|
|
14
|
-
onSelectAccount?: (id: string) => void;
|
|
15
12
|
onClose?: () => void;
|
|
16
13
|
ariaLabel?: string;
|
|
14
|
+
localeSwitcher?: LocaleSwitcherProps;
|
|
17
15
|
}
|
|
18
|
-
export declare const GlobalMenu: ({
|
|
16
|
+
export declare const GlobalMenu: ({ menu, backLabel, onClose, logoutButton, ariaLabel, localeSwitcher, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import {
|
|
3
|
-
import { GlobalMenuProps
|
|
2
|
+
import { MenuProps } from '../Menu';
|
|
3
|
+
import { GlobalMenuProps } from './GlobalMenu';
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: ({
|
|
6
|
+
component: ({ menu, backLabel, onClose, logoutButton, ariaLabel, localeSwitcher, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
tags: string[];
|
|
8
8
|
parameters: {};
|
|
9
9
|
args: {
|
|
@@ -11,10 +11,10 @@ declare const meta: {
|
|
|
11
11
|
menu?: MenuProps;
|
|
12
12
|
menuLabel?: string;
|
|
13
13
|
backLabel?: string;
|
|
14
|
-
logoutButton?: import('
|
|
14
|
+
logoutButton?: import('..').LogoutButtonProps;
|
|
15
15
|
changeLabel?: string;
|
|
16
16
|
className?: string;
|
|
17
|
-
currentAccount?: Account;
|
|
17
|
+
currentAccount?: import('..').Account;
|
|
18
18
|
currentEndUserLabel?: string;
|
|
19
19
|
onSelectAccount?: (id: string) => void;
|
|
20
20
|
onClose?: () => void;
|
|
@@ -23,9 +23,7 @@ declare const meta: {
|
|
|
23
23
|
};
|
|
24
24
|
export default meta;
|
|
25
25
|
type Story = StoryObj<typeof meta>;
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const CompanyAccount: (args: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const Desktop: (args: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
27
|
export declare const MobileMenu: (args: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export declare const SingleAccount: (args: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
28
|
export declare const Login: Story;
|
|
31
29
|
export declare const InterimMenu: (args: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonProps } from '../';
|
|
3
3
|
import { BadgeProps } from '../Badge';
|
|
4
4
|
export interface GlobalMenuButtonProps extends ButtonProps {
|
|
5
|
-
currentAccount?: Account;
|
|
6
5
|
label?: string;
|
|
7
6
|
as?: ElementType;
|
|
8
7
|
className?: string;
|
|
@@ -10,4 +9,4 @@ export interface GlobalMenuButtonProps extends ButtonProps {
|
|
|
10
9
|
badge?: BadgeProps | undefined;
|
|
11
10
|
tabIndex?: number;
|
|
12
11
|
}
|
|
13
|
-
export declare const GlobalMenuButton: ({ className, as, color, variant,
|
|
12
|
+
export declare const GlobalMenuButton: ({ className, as, color, variant, expanded, label, badge, ...buttonProps }: GlobalMenuButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Account } from '../';
|
|
3
2
|
declare const meta: {
|
|
4
3
|
title: string;
|
|
5
|
-
component: ({ className, as, color, variant,
|
|
4
|
+
component: ({ className, as, color, variant, expanded, label, badge, ...buttonProps }: import('./GlobalMenuButton').GlobalMenuButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
tags: string[];
|
|
7
6
|
parameters: {
|
|
8
7
|
layout: string;
|
|
9
8
|
};
|
|
10
|
-
args: {
|
|
11
|
-
currentAccount: Account;
|
|
12
|
-
};
|
|
9
|
+
args: {};
|
|
13
10
|
};
|
|
14
11
|
export default meta;
|
|
15
12
|
type Story = StoryObj<typeof meta>;
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const Expanded: Story;
|
|
13
|
+
export declare const Closed: Story;
|
|
14
|
+
export declare const Open: Story;
|
|
15
|
+
export declare const WithBadge: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MenuOptionProps } from '../Menu/index.ts';
|
|
2
|
+
export interface LocaleSwitcherProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
options: MenuOptionProps[];
|
|
5
|
+
onSelect?: (value: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const LocaleSwitcher: ({ title, options, onSelect }: LocaleSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Account, AccountMenuProps } from '..';
|
|
2
|
+
import { MenuProps } from '../Menu';
|
|
3
|
+
import { LogoutButtonProps } from './LogoutButton';
|
|
4
|
+
export interface GlobalMenuProps_old {
|
|
5
|
+
accountMenu?: AccountMenuProps;
|
|
6
|
+
menu?: MenuProps;
|
|
7
|
+
menuLabel?: string;
|
|
8
|
+
backLabel?: string;
|
|
9
|
+
logoutButton?: LogoutButtonProps;
|
|
10
|
+
changeLabel?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
currentAccount?: Account;
|
|
13
|
+
currentEndUserLabel?: string;
|
|
14
|
+
onSelectAccount?: (id: string) => void;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const GlobalMenu_old: ({ accountMenu, menu, backLabel, currentAccount, onSelectAccount, onClose, logoutButton, ariaLabel, }: GlobalMenuProps_old) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Account, GlobalMenuProps_old, MenuProps } from '..';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ accountMenu, menu, backLabel, currentAccount, onSelectAccount, onClose, logoutButton, ariaLabel, }: GlobalMenuProps_old) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {};
|
|
8
|
+
args: {
|
|
9
|
+
accountMenu?: import('..').AccountMenuProps;
|
|
10
|
+
menu?: MenuProps;
|
|
11
|
+
menuLabel?: string;
|
|
12
|
+
backLabel?: string;
|
|
13
|
+
logoutButton?: import('./LogoutButton').LogoutButtonProps;
|
|
14
|
+
changeLabel?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
currentAccount?: Account;
|
|
17
|
+
currentEndUserLabel?: string;
|
|
18
|
+
onSelectAccount?: (id: string) => void;
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
export declare const CurrentAccount: (args: GlobalMenuProps_old) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const CompanyAccount: (args: GlobalMenuProps_old) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const MobileMenu: (args: GlobalMenuProps_old) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const SingleAccount: (args: GlobalMenuProps_old) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const Login: Story;
|
|
30
|
+
export declare const InterimMenu: (args: GlobalMenuProps_old) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Color } from '..';
|
|
3
|
+
export type GlobalMenuBaseProps = {
|
|
4
|
+
color?: Color;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
} & React.HTMLAttributes<HTMLElement>;
|
|
7
|
+
export interface GlobalMenuHeaderProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface GlobalMenuFooterProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const GlobalMenuBase: ({ color, children, ...rest }: GlobalMenuBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const GlobalMenuHeader: ({ children }: GlobalMenuHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const GlobalMenuFooter: ({ children }: GlobalMenuFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { Account, ButtonProps } from '..';
|
|
3
|
+
import { BadgeProps } from '../Badge';
|
|
4
|
+
export interface GlobalMenuButtonProps_old extends ButtonProps {
|
|
5
|
+
currentAccount?: Account;
|
|
6
|
+
label?: string;
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
className?: string;
|
|
9
|
+
expanded?: boolean;
|
|
10
|
+
badge?: BadgeProps | undefined;
|
|
11
|
+
tabIndex?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const GlobalMenuButton_old: ({ className, as, color, variant, currentAccount, expanded, label, badge, ...buttonProps }: GlobalMenuButtonProps_old) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Account } from '..';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ className, as, color, variant, currentAccount, expanded, label, badge, ...buttonProps }: import('./GlobalMenuButton').GlobalMenuButtonProps_old) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
args: {
|
|
11
|
+
currentAccount: Account;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
export declare const Login: Story;
|
|
17
|
+
export declare const Person: Story;
|
|
18
|
+
export declare const Company: Story;
|
|
19
|
+
export declare const Expanded: Story;
|