@altinn/altinn-components 0.44.4 → 0.45.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/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/EditableBookmark.js +1 -1
- 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/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
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { LayoutProps } from '../';
|
|
2
|
+
interface LayoutStoryArgs extends LayoutProps {
|
|
3
|
+
forceOpenFullScreen?: boolean | undefined;
|
|
4
|
+
}
|
|
2
5
|
declare const meta: {
|
|
3
6
|
title: string;
|
|
4
|
-
component: ({ color, theme, header, footer, sidebar, content, children, skipLink, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
component: ({ color, theme, header, footer, sidebar, content, children, skipLink, useGlobalHeader, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
8
|
parameters: {
|
|
6
9
|
layout: string;
|
|
7
10
|
};
|
|
@@ -19,10 +22,31 @@ declare const meta: {
|
|
|
19
22
|
menu: import('..').MenuProps;
|
|
20
23
|
};
|
|
21
24
|
children: import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
useGlobalHeader: true;
|
|
26
|
+
color: "company";
|
|
27
|
+
forceOpenFullScreen: undefined;
|
|
28
|
+
};
|
|
29
|
+
argTypes: {
|
|
30
|
+
useGlobalHeader: {
|
|
31
|
+
control: {
|
|
32
|
+
type: "boolean";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
color: {
|
|
36
|
+
control: "select";
|
|
37
|
+
options: string[];
|
|
38
|
+
};
|
|
39
|
+
forceOpenFullScreen: {
|
|
40
|
+
control: "select";
|
|
41
|
+
options: (boolean | undefined)[];
|
|
42
|
+
};
|
|
22
43
|
};
|
|
23
44
|
};
|
|
24
45
|
export default meta;
|
|
25
|
-
export declare const Preview: (args:
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
28
|
-
export declare const
|
|
46
|
+
export declare const Preview: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare const UsingUseAccountHook: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare const LogInView: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare const WithEnglishLanguage: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare const StickySidebar: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare const HiddenSidebar: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare const Fullscreen: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NotificationItemBaseProps } from '..';
|
|
2
|
+
export interface NotificationItemProps extends NotificationItemBaseProps {
|
|
3
|
+
id: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const NotificationItem: ({ loading, id, icon, title, description, ...props }: NotificationItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ListItemBaseProps, ListItemLabelProps, ListItemLinkProps, NotificationItemIconProps, NotificationItemControlsProps } from '..';
|
|
3
|
+
export type NotificationItemVariant = 'default' | 'tinted';
|
|
4
|
+
export interface NotificationItemBaseProps extends ListItemBaseProps, ListItemLinkProps, ListItemLabelProps, NotificationItemControlsProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
groupId?: string;
|
|
7
|
+
icon?: NotificationItemIconProps['icon'];
|
|
8
|
+
iconBadge?: NotificationItemIconProps['badge'];
|
|
9
|
+
label?: ListItemLabelProps['children'];
|
|
10
|
+
title?: ListItemLabelProps['title'];
|
|
11
|
+
description?: ListItemLabelProps['description'];
|
|
12
|
+
variant?: NotificationItemVariant;
|
|
13
|
+
controls?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const NotificationItemBase: ({ as, href, ref, disabled, loading, onClick, onKeyPress, tabIndex, color, variant, icon, iconBadge, label, title, description, highlightWords, dismissable, dismissLabel, onDismiss, contextMenu, ...props }: NotificationItemBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ContextMenuProps } from '..';
|
|
2
|
+
export interface NotificationItemControlsProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
dismissable?: boolean;
|
|
6
|
+
dismissLabel?: string;
|
|
7
|
+
onDismiss?: () => void;
|
|
8
|
+
contextMenu?: ContextMenuProps;
|
|
9
|
+
}
|
|
10
|
+
export declare const NotificationItemControls: ({ className, loading, dismissable, dismissLabel, onDismiss, contextMenu, }: NotificationItemControlsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AvatarGroupProps, AvatarProps, BadgeProps, IconProps, SvgElement } from '..';
|
|
2
|
+
export interface NotificationItemBadgeProps {
|
|
3
|
+
color?: BadgeProps['color'];
|
|
4
|
+
label: BadgeProps['label'];
|
|
5
|
+
}
|
|
6
|
+
export interface NotificationItemIconProps {
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
icon?: IconProps | SvgElement | AvatarProps | AvatarGroupProps;
|
|
9
|
+
badge?: NotificationItemBadgeProps | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare const NotificationItemIcon: ({ loading, icon, badge }: NotificationItemIconProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const meta: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: ({ loading, id, icon, title, description, ...props }: import('./NotificationItem').NotificationItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
tags: string[];
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export declare const InboxNotification: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { LanguageCode } from '../../types';
|
|
3
|
+
type OpenElementId = 'search' | 'menu' | 'account' | 'fullscreenAccount' | string;
|
|
3
4
|
interface RootContextProvider {
|
|
4
5
|
currentId: OpenElementId;
|
|
5
6
|
previousId: OpenElementId;
|
|
6
7
|
toggleId: (elementId: OpenElementId) => void;
|
|
7
8
|
closeAll: () => void;
|
|
8
9
|
openId: (elementId: OpenElementId) => void;
|
|
10
|
+
languageCode?: LanguageCode;
|
|
9
11
|
}
|
|
10
12
|
interface RootContextInitialValue {
|
|
11
13
|
currentId: OpenElementId;
|
|
12
14
|
previousId: OpenElementId;
|
|
13
|
-
setCurrentId
|
|
14
|
-
setPreviousId
|
|
15
|
+
setCurrentId: (elementId: OpenElementId) => void;
|
|
16
|
+
setPreviousId: (elementId: OpenElementId) => void;
|
|
15
17
|
debug?: boolean;
|
|
18
|
+
languageCode?: LanguageCode;
|
|
16
19
|
}
|
|
17
20
|
interface ProviderProps {
|
|
18
21
|
children: ReactNode;
|
|
19
22
|
initialValue?: RootContextInitialValue;
|
|
20
23
|
debug?: boolean;
|
|
24
|
+
/** Specify the language to be used for common texts */
|
|
25
|
+
languageCode?: LanguageCode;
|
|
21
26
|
}
|
|
22
|
-
export declare const RootProvider: ({ children, initialValue, debug }: ProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const RootProvider: ({ children, initialValue, debug, languageCode }: ProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
28
|
export declare const useRootContext: () => RootContextProvider;
|
|
24
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputProps, SettingsItemBaseProps, SettingsModalProps } from '..';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
export type SettingsItemVariant = 'default' | 'modal' | 'switch';
|
|
3
|
+
export type SettingsItemVariant = 'default' | 'link' | 'modal' | 'switch';
|
|
4
4
|
export interface SettingsItemModalProps {
|
|
5
5
|
icon?: SettingsModalProps['icon'];
|
|
6
6
|
title?: SettingsModalProps['title'];
|
|
@@ -13,7 +13,7 @@ export * from './Dialog';
|
|
|
13
13
|
export * from './Divider';
|
|
14
14
|
export * from './Dropdown';
|
|
15
15
|
export * from './Footer';
|
|
16
|
-
export * from './
|
|
16
|
+
export * from './GlobalMenu_old';
|
|
17
17
|
export * from './Header';
|
|
18
18
|
export * from './Icon';
|
|
19
19
|
export * from './Layout';
|
|
@@ -21,6 +21,7 @@ export * from './LayoutAction';
|
|
|
21
21
|
export * from './List';
|
|
22
22
|
export * from './Menu';
|
|
23
23
|
export * from './Metadata';
|
|
24
|
+
export * from './Notifications';
|
|
24
25
|
export * from './RootProvider';
|
|
25
26
|
export * from './Search';
|
|
26
27
|
export * from './Searchbar';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a date string in ISO format (YYYY-MM-DD) to Norwegian standard format (DD.MM.YYYY)
|
|
3
|
+
* @param dateString - Date string in YYYY-MM-DD format
|
|
4
|
+
* @returns Formatted date string in standard Norwegian format
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatDate(dateString: string | undefined): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './date';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AccountSelectorProps } from '../components/GlobalHeader/AccountSelector';
|
|
2
|
+
/** The DTO for the authorized party endpoint */
|
|
3
|
+
export interface AuthorizedParty {
|
|
4
|
+
/** Unique identifier for the party */
|
|
5
|
+
partyUuid: string;
|
|
6
|
+
/** Display name of the party */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Organization number (for organizations only) */
|
|
9
|
+
organizationNumber?: string;
|
|
10
|
+
/** Date of birth in ISO format (for persons only) */
|
|
11
|
+
dateOfBirth?: string;
|
|
12
|
+
/** Legacy party identifier (deprecated) */
|
|
13
|
+
partyId: string;
|
|
14
|
+
/** Type of party - 'Person' or 'Organization' */
|
|
15
|
+
type?: string;
|
|
16
|
+
/** Specific unit type for organizations */
|
|
17
|
+
unitType?: string;
|
|
18
|
+
/** Whether the party has been deleted */
|
|
19
|
+
isDeleted: boolean;
|
|
20
|
+
/** Whether the user only has access to child-/subunits */
|
|
21
|
+
onlyHierarchyElementWithNoAccess: boolean;
|
|
22
|
+
/** List of authorized resource identifiers */
|
|
23
|
+
authorizedResources: string[];
|
|
24
|
+
/** List of authorized role identifiers */
|
|
25
|
+
authorizedRoles: string[];
|
|
26
|
+
/** Child subunits (for parent organizations) */
|
|
27
|
+
subunits?: AuthorizedParty[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Configuration props for the useAccountSelector hook.
|
|
31
|
+
*/
|
|
32
|
+
export interface useAccountSelectorProps {
|
|
33
|
+
/** UUID of the user's own personal account */
|
|
34
|
+
selfAccountUuid?: string;
|
|
35
|
+
/** Array of authorized parties that the user can act on behalf of */
|
|
36
|
+
partyListDTO?: AuthorizedParty[];
|
|
37
|
+
/** Array of parties (defined by their partyUUIDs) marked as favorites by the user */
|
|
38
|
+
favoriteAccountUuids?: string[];
|
|
39
|
+
/** UUID of the currently selected account */
|
|
40
|
+
currentAccountUuid?: string;
|
|
41
|
+
/** Whether account data is currently being loaded */
|
|
42
|
+
isLoading?: boolean;
|
|
43
|
+
/** Whether to use virtualization for large account lists */
|
|
44
|
+
isVirtualized?: boolean;
|
|
45
|
+
/** Callback triggered when a user selects an account */
|
|
46
|
+
onSelectAccount?: (accountId: string) => void;
|
|
47
|
+
/** Callback triggered when a user toggles an account's favorite status */
|
|
48
|
+
onToggleFavorite?: (accountId: string) => void;
|
|
49
|
+
/** Language code for localization ('nn', 'en', or 'nb'/default) */
|
|
50
|
+
languageCode?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* React hook that processes authorized party data and transforms it into
|
|
54
|
+
* a structured format suitable for the AccountSelector component.
|
|
55
|
+
*
|
|
56
|
+
* Handles account organization into groups (self, favorites, people, organizations),
|
|
57
|
+
* favorites management, localization, and hierarchical organization structures.
|
|
58
|
+
*
|
|
59
|
+
* @param props - Configuration object for the hook
|
|
60
|
+
* @returns AccountSelectorProps object with organized account data and handlers.
|
|
61
|
+
*/
|
|
62
|
+
export declare const useAccountSelector: ({ partyListDTO, favoriteAccountUuids, currentAccountUuid, selfAccountUuid, isLoading, onSelectAccount, isVirtualized, onToggleFavorite, languageCode, }: useAccountSelectorProps) => AccountSelectorProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type LanguageCode = 'nb' | 'nn' | 'en';
|