@altinn/altinn-components 0.56.20 → 0.56.21
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/assets/AccountSelector.css +1 -1
- package/dist/assets/AccountSelectorButton.css +1 -0
- package/dist/assets/Dropdown.css +1 -1
- package/dist/assets/GlobalHeader.css +1 -1
- package/dist/assets/GlobalMenuButton2.css +1 -1
- package/dist/assets/HeaderLogo2.css +1 -1
- package/dist/assets/LayoutGrid.css +1 -1
- package/dist/assets/ModalBase.css +1 -1
- package/dist/assets/ModalFooter.css +1 -0
- package/dist/assets/SettingsSection.css +1 -1
- package/dist/components/Account/AccountMenu.js +20 -20
- package/dist/components/Bookmarks/BookmarkSettingsList.js +41 -11
- package/dist/components/Dropdown/Dropdown.js +10 -10
- package/dist/components/DsComponents/index.js +20 -21
- package/dist/components/GlobalHeader/AccountSelector.js +64 -124
- package/dist/components/GlobalHeader/AccountSelectorButton.js +127 -0
- package/dist/components/GlobalHeader/DigdirLogomark.js +23 -109
- package/dist/components/GlobalHeader/GlobalHeader.js +84 -117
- package/dist/components/GlobalHeader/GlobalMenuButton.js +64 -0
- package/dist/components/GlobalHeader/HeaderLogo.js +20 -13
- package/dist/components/GlobalHeader/index.js +2 -2
- package/dist/components/GlobalMenu/GlobalMenu.js +11 -10
- package/dist/components/GlobalMenu/index.js +2 -4
- package/dist/components/Layout/Layout.js +30 -30
- package/dist/components/Layout/LayoutGrid.js +3 -3
- package/dist/components/Modal/ModalBase.js +35 -33
- package/dist/components/Modal/ModalFooter.js +7 -10
- package/dist/components/Modal/index.js +8 -6
- package/dist/components/Settings/SettingsItem.js +53 -35
- package/dist/components/Settings/SettingsItemBase.js +19 -20
- package/dist/components/Settings/SettingsSection.js +10 -10
- package/dist/components/index.js +89 -88
- package/dist/functions/index.js +6 -4
- package/dist/functions/orgno/index.js +4 -0
- package/dist/functions/orgno/orgno.js +4 -0
- package/dist/hooks/useAccountSelector.js +77 -75
- package/dist/index.js +88 -85
- package/dist/textfield-CNXt-27J.js +3403 -0
- package/dist/types/lib/components/Bookmarks/BookmarkSettingsItem.d.ts +2 -0
- package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.d.ts +7 -1
- package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.stories.d.ts +4 -1
- package/dist/types/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/types/lib/components/{Account/AccountMenuButton.d.ts → GlobalHeader/AccountSelectorButton.d.ts} +2 -2
- package/dist/types/lib/components/{Account/AccountMenuButton.stories.d.ts → GlobalHeader/AccountSelectorButton.stories.d.ts} +1 -1
- package/dist/types/lib/components/GlobalHeader/DigdirLogomark.d.ts +1 -2
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.d.ts +1 -3
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.stories.d.ts +1 -1
- package/dist/types/lib/components/{GlobalMenu → GlobalHeader}/GlobalMenuButton.d.ts +2 -2
- package/dist/types/lib/components/{GlobalMenu → GlobalHeader}/GlobalMenuButton.stories.d.ts +1 -1
- package/dist/types/lib/components/GlobalHeader/index.d.ts +1 -1
- package/dist/types/lib/components/GlobalMenu/index.d.ts +0 -1
- package/dist/types/lib/components/Modal/ModalBase.d.ts +2 -1
- package/dist/types/lib/components/Modal/ModalFooter.d.ts +3 -3
- package/dist/types/lib/components/Modal/index.d.ts +1 -0
- package/dist/types/lib/components/Settings/SettingsModal.stories.d.ts +2 -1
- package/dist/types/lib/functions/index.d.ts +1 -0
- package/dist/types/lib/functions/orgno/index.d.ts +1 -0
- package/dist/types/lib/functions/orgno/orgno.d.ts +1 -0
- package/package.json +1 -1
- package/dist/assets/AccountMenuButton.css +0 -1
- package/dist/assets/GlobalHeaderBase.css +0 -1
- package/dist/assets/HeaderGroup2.css +0 -1
- package/dist/assets/globalSearch.css +0 -1
- package/dist/components/Account/AccountMenuButton.js +0 -134
- package/dist/components/GlobalHeader/GlobalHeaderBase.js +0 -24
- package/dist/components/GlobalHeader/GlobalSearch.js +0 -62
- package/dist/components/GlobalHeader/GlobalSearchButton.js +0 -54
- package/dist/components/GlobalHeader/HeaderGroup.js +0 -8
- package/dist/components/GlobalMenu/GlobalMenuButton.js +0 -83
- package/dist/globalSearch.module-DziLSGZg.js +0 -9
- package/dist/index--jNxJmA8.js +0 -2000
- package/dist/textfield-Drdr9bio.js +0 -1439
- package/dist/types/lib/components/GlobalHeader/GlobalHeaderBase.d.ts +0 -9
- package/dist/types/lib/components/GlobalHeader/GlobalSearch.d.ts +0 -4
- package/dist/types/lib/components/GlobalHeader/GlobalSearchButton.d.ts +0 -6
- package/dist/types/lib/components/GlobalHeader/HeaderGroup.d.ts +0 -6
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { BookmarkSettingsItemProps } from '..';
|
|
3
|
+
export interface BookmarkSettingsGroupProps {
|
|
4
|
+
title?: string | ReactNode;
|
|
5
|
+
}
|
|
2
6
|
export interface BookmarkSettingsListProps {
|
|
3
7
|
items: BookmarkSettingsItemProps[];
|
|
8
|
+
groups?: Record<string, BookmarkSettingsGroupProps>;
|
|
9
|
+
sortGroupBy?: (a: [string, BookmarkSettingsItemProps[]], b: [string, BookmarkSettingsItemProps[]]) => number;
|
|
4
10
|
loading?: boolean;
|
|
5
11
|
}
|
|
6
|
-
export declare const BookmarkSettingsList: ({ loading, items }: BookmarkSettingsListProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export declare const BookmarkSettingsList: ({ loading, items, groups, sortGroupBy }: BookmarkSettingsListProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BookmarkSettingsListProps } from '..';
|
|
2
2
|
declare const meta: {
|
|
3
|
-
component: ({ loading, items }: BookmarkSettingsListProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
component: ({ loading, items, groups, sortGroupBy }: BookmarkSettingsListProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
title: string;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {
|
|
@@ -8,6 +8,8 @@ declare const meta: {
|
|
|
8
8
|
};
|
|
9
9
|
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react-vite').ReactRenderer, {
|
|
10
10
|
items: import('./BookmarkSettingsItem').BookmarkSettingsItemProps[];
|
|
11
|
+
groups?: Record<string, import('./BookmarkSettingsList').BookmarkSettingsGroupProps> | undefined;
|
|
12
|
+
sortGroupBy?: ((a: [string, import('./BookmarkSettingsItem').BookmarkSettingsItemProps[]], b: [string, import('./BookmarkSettingsItem').BookmarkSettingsItemProps[]]) => number) | undefined;
|
|
11
13
|
loading?: boolean | undefined;
|
|
12
14
|
}>, { args }: {
|
|
13
15
|
args: BookmarkSettingsListProps;
|
|
@@ -16,4 +18,5 @@ declare const meta: {
|
|
|
16
18
|
};
|
|
17
19
|
export default meta;
|
|
18
20
|
export declare const BookmarksList: () => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const GroupedBookmarksList: () => import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
export declare const BookmarksPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type DropdownSize = 'auto' | 'sm' | 'md' | 'lg';
|
|
3
3
|
export type DropdownPlacement = 'left' | 'right' | 'bottom' | 'top' | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
4
|
-
export type DropdownVariant = 'dropdown' | 'drawer' | 'drawer-dropdown';
|
|
4
|
+
export type DropdownVariant = 'dropdown' | 'drawer' | 'drawer-dropdown' | 'header-dropdown' | 'header';
|
|
5
5
|
export interface DropdownProps {
|
|
6
6
|
id?: string;
|
|
7
7
|
className?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccountMenuItemProps, ButtonProps } from '..';
|
|
2
|
-
export interface
|
|
2
|
+
export interface AccountSelectorButtonProps extends ButtonProps {
|
|
3
3
|
currentAccount?: AccountMenuItemProps;
|
|
4
4
|
className?: string;
|
|
5
5
|
expanded?: boolean;
|
|
@@ -8,4 +8,4 @@ export interface AccountMenuButtonProps extends ButtonProps {
|
|
|
8
8
|
tabIndex?: number;
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const AccountSelectorButton: ({ className, currentAccount, expanded, minimized, loading, ...buttonProps }: AccountSelectorButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ className, currentAccount, expanded, minimized, loading, ...buttonProps }: import('./
|
|
4
|
+
component: ({ className, currentAccount, expanded, minimized, loading, ...buttonProps }: import('./AccountSelectorButton').AccountSelectorButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export interface SymbolProps {
|
|
2
2
|
className?: string;
|
|
3
3
|
title?: string;
|
|
4
|
-
'aria-hidden'?: boolean;
|
|
5
4
|
}
|
|
6
|
-
export declare const DigdirLogomark: ({ className, title
|
|
5
|
+
export declare const DigdirLogomark: ({ className, title }: SymbolProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,6 @@ import { BadgeProps } from '../Badge';
|
|
|
2
2
|
import { GlobalMenuProps, LocaleSwitcherProps } from '../GlobalMenu';
|
|
3
3
|
import { MenuProps } from '../Menu';
|
|
4
4
|
import { AccountSelectorProps } from './AccountSelector.tsx';
|
|
5
|
-
import { GlobalSearchProps } from './GlobalSearch.tsx';
|
|
6
5
|
import { HeaderLogoProps } from './HeaderLogo.tsx';
|
|
7
6
|
export interface GlobalHeaderProps {
|
|
8
7
|
globalMenu: GlobalMenuProps;
|
|
@@ -10,11 +9,10 @@ export interface GlobalHeaderProps {
|
|
|
10
9
|
desktopMenu?: MenuProps;
|
|
11
10
|
/** Use to override globalMenu.menu on mobile */
|
|
12
11
|
mobileMenu?: MenuProps;
|
|
13
|
-
globalSearch?: GlobalSearchProps;
|
|
14
12
|
locale?: LocaleSwitcherProps;
|
|
15
13
|
accountSelector?: AccountSelectorProps;
|
|
16
14
|
badge?: BadgeProps | undefined;
|
|
17
15
|
logo?: HeaderLogoProps;
|
|
18
16
|
onLoginClick?: () => void;
|
|
19
17
|
}
|
|
20
|
-
export declare const GlobalHeader: ({ globalMenu, desktopMenu, mobileMenu,
|
|
18
|
+
export declare const GlobalHeader: ({ globalMenu, desktopMenu, mobileMenu, locale, accountSelector, logo, badge, onLoginClick, }: GlobalHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GlobalHeaderProps } from './';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ globalMenu, desktopMenu, mobileMenu,
|
|
4
|
+
component: ({ globalMenu, desktopMenu, mobileMenu, locale, accountSelector, logo, badge, onLoginClick, }: GlobalHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
|
-
import { ButtonProps } from '
|
|
2
|
+
import { ButtonProps } from '..';
|
|
3
3
|
import { BadgeProps } from '../Badge';
|
|
4
4
|
export interface GlobalMenuButtonProps extends ButtonProps {
|
|
5
5
|
label?: string;
|
|
@@ -9,4 +9,4 @@ export interface GlobalMenuButtonProps extends ButtonProps {
|
|
|
9
9
|
badge?: BadgeProps | undefined;
|
|
10
10
|
tabIndex?: number;
|
|
11
11
|
}
|
|
12
|
-
export declare const GlobalMenuButton: ({ className, as, color, variant, expanded, label, badge, ...buttonProps }: GlobalMenuButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const GlobalMenuButton: ({ className, as, color, variant, onClick, expanded, label, badge, ...buttonProps }: GlobalMenuButtonProps) => 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: ({ className, as, color, variant, expanded, label, badge, ...buttonProps }: import('./GlobalMenuButton').GlobalMenuButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ className, as, color, variant, onClick, expanded, label, badge, ...buttonProps }: import('./GlobalMenuButton').GlobalMenuButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './GlobalHeader';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './GlobalMenuButton';
|
|
@@ -6,9 +6,10 @@ export interface ModalBaseProps {
|
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
backdropColor?: BackdropColor;
|
|
8
8
|
variant?: 'default' | 'content' | 'full';
|
|
9
|
+
height?: 'auto' | 'full';
|
|
9
10
|
size?: SectionProps['size'];
|
|
10
11
|
color?: SectionProps['color'];
|
|
11
12
|
padding?: SectionProps['padding'];
|
|
12
13
|
spacing?: SectionProps['spacing'];
|
|
13
14
|
}
|
|
14
|
-
export declare const ModalBase: ({ open, onClose, closedBy, children, backdropColor, size, color, padding, spacing, variant, }: ModalBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const ModalBase: ({ open, onClose, closedBy, children, backdropColor, size, color, padding, spacing, height, variant, }: ModalBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface ModalFooterProps extends FlexProps {
|
|
2
|
+
export interface ModalFooterProps {
|
|
4
3
|
children?: ReactNode;
|
|
4
|
+
sticky?: boolean;
|
|
5
5
|
}
|
|
6
|
-
export declare const ModalFooter: ({ children, ...props }: ModalFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const ModalFooter: ({ children, sticky, ...props }: ModalFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -31,7 +31,7 @@ export interface AccountAlertsModalProps extends SettingsModalProps {
|
|
|
31
31
|
readOnly?: boolean;
|
|
32
32
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
33
33
|
}
|
|
34
|
-
export declare const AccountAlertsModal: ({ open,
|
|
34
|
+
export declare const AccountAlertsModal: ({ open, icon, title, description, phone, phoneLabel, email, emailLabel, smsAlerts, emailAlerts, readOnly, onChange, onClose, }: AccountAlertsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
export declare const UserAccountAlertsModal: ({ open, onClose, phone, email, ...props }: {
|
|
36
36
|
[x: string]: any;
|
|
37
37
|
open?: boolean | undefined;
|
|
@@ -57,3 +57,4 @@ interface LocaleSettingsModal extends SettingsModalProps {
|
|
|
57
57
|
value?: string;
|
|
58
58
|
}
|
|
59
59
|
export declare const LocaleSettingsModal: ({ open, onClose, value, onChange }: LocaleSettingsModal) => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
export declare const SingleServiceSettingsModal: ({ open, onClose, icon, title, description, }: SettingsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './orgno.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatOrgNo: (orgNo?: string | null) => string | undefined;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._button_9nzzi_1{flex-shrink:0;position:relative;display:inline-flex;align-items:center;column-gap:.1rem;padding:.625rem;border:none;border-radius:4px}@media(max-width:1023px){._button_9nzzi_1:focus-visible{outline-offset:-2px}}._label_9nzzi_18{font-size:1.125rem;font-weight:500;padding:.25rem}._avatarIcon_9nzzi_24,._loginIcon_9nzzi_25,._closeIcon_9nzzi_26{width:2.7em;height:2.7em;border-radius:2px;font-size:unset}._closeIcon_9nzzi_26{background-color:var(--ds-color-company-base-default);border-radius:50%;color:#fff}._loginIcon_9nzzi_25{background-color:#e0e2e4;border-radius:50%;color:#000}._avatar_9nzzi_24{font-size:2.6em}._icon_9nzzi_49{font-size:1.2em}._badge_9nzzi_53{position:absolute;top:0;right:0;margin-top:-.75rem;margin-right:-.75rem}._labelContainer_9nzzi_61{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2;color:var(--ds-color-company-text-default)}._description_9nzzi_69{font-size:.875rem;color:var(--ds-color-company-text-default)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._header_pafet_1{z-index:1;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem;padding:.7rem;background-color:#fff}._backdrop_pafet_12{display:none}._header_pafet_1[data-current-id=menu],._header_pafet_1[data-current-id=locale]{background-color:#fff}@media(min-width:1024px){._header_pafet_1[data-current-id=menu] ._backdrop_pafet_12,._header_pafet_1[data-current-id=locale] ._backdrop_pafet_12{display:block}}@media(max-width:1023px){._header_pafet_1{gap:0}}._header_pafet_1{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._group_o0h92_1{position:relative;display:flex;align-items:center;column-gap:1rem}@media(max-width:1023px){._group_o0h92_1{column-gap:.1rem}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._globalSearch_1symm_1{max-width:700px;margin:1rem auto;padding-bottom:.8rem}._searchInput_1symm_7{border:2px solid black}._searchInputButton_1symm_11{border:2px solid black;border-left:none}._searchButton_1symm_16{background-color:#e0e2e4;color:var(--ds-color-company-text-default)}._searchButton_1symm_16:hover{background-color:var(--ds-color-company-surface-hover)}._searchButton_1symm_16:active{background-color:var(--ds-color-company-surface-active)}@media(max-width:1023px){._searchButton_1symm_16{margin-right:.5rem}}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
3
|
-
import { c as d } from "../../index-p1eeF8LQ.js";
|
|
4
|
-
import f, { forwardRef as v, isValidElement as h } from "react";
|
|
5
|
-
import { Avatar as p } from "../Avatar/Avatar.js";
|
|
6
|
-
import { Button as g } from "../Button/Button.js";
|
|
7
|
-
import { ButtonIcon as u } from "../Button/ButtonIcon.js";
|
|
8
|
-
import { ButtonLabel as b } from "../Button/ButtonLabel.js";
|
|
9
|
-
import "react-dom";
|
|
10
|
-
import { useRootContext as y } from "../RootProvider/RootProvider.js";
|
|
11
|
-
import "../Snackbar/useSnackbar.js";
|
|
12
|
-
import { S as I } from "../../XMark-tKk6aExO.js";
|
|
13
|
-
import { u as z } from "../../useId-BVFxCjkq.js";
|
|
14
|
-
import '../../assets/AccountMenuButton.css';var N = function(t, i) {
|
|
15
|
-
var o = {};
|
|
16
|
-
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && i.indexOf(n) < 0 && (o[n] = t[n]);
|
|
17
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
18
|
-
for (var l = 0, n = Object.getOwnPropertySymbols(t); l < n.length; l++)
|
|
19
|
-
i.indexOf(n[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[l]) && (o[n[l]] = t[n[l]]);
|
|
20
|
-
return o;
|
|
21
|
-
};
|
|
22
|
-
const w = v((t, i) => {
|
|
23
|
-
var { title: o, titleId: n } = t, l = N(t, ["title", "titleId"]);
|
|
24
|
-
let r = z();
|
|
25
|
-
return r = o ? n || "title-" + r : void 0, f.createElement(
|
|
26
|
-
"svg",
|
|
27
|
-
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": r }, l),
|
|
28
|
-
o ? f.createElement("title", { id: r }, o) : null,
|
|
29
|
-
f.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M15.5 3.25a.75.75 0 0 0 0 1.5H19a.25.25 0 0 1 .25.25v14a.25.25 0 0 1-.25.25h-3.5a.75.75 0 0 0 0 1.5H19A1.75 1.75 0 0 0 20.75 19V5A1.75 1.75 0 0 0 19 3.25zM9.97 6.97a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H3.5a.75.75 0 0 1 0-1.5h9.69L9.97 8.03a.75.75 0 0 1 0-1.06", clipRule: "evenodd" })
|
|
30
|
-
);
|
|
31
|
-
}), O = "_button_9nzzi_1", x = "_avatarIcon_9nzzi_24", C = "_loginIcon_9nzzi_25", j = "_closeIcon_9nzzi_26", k = "_avatar_9nzzi_24", L = "_icon_9nzzi_49", E = "_labelContainer_9nzzi_61", B = "_description_9nzzi_69", e = {
|
|
32
|
-
button: O,
|
|
33
|
-
avatarIcon: x,
|
|
34
|
-
loginIcon: C,
|
|
35
|
-
closeIcon: j,
|
|
36
|
-
avatar: k,
|
|
37
|
-
icon: L,
|
|
38
|
-
labelContainer: E,
|
|
39
|
-
description: B
|
|
40
|
-
}, J = ({
|
|
41
|
-
className: t,
|
|
42
|
-
currentAccount: i,
|
|
43
|
-
expanded: o = !1,
|
|
44
|
-
minimized: n = !1,
|
|
45
|
-
loading: l = !1,
|
|
46
|
-
...r
|
|
47
|
-
}) => {
|
|
48
|
-
const { languageCode: _ } = y(), c = M(_);
|
|
49
|
-
if (l)
|
|
50
|
-
return /* @__PURE__ */ a(
|
|
51
|
-
g,
|
|
52
|
-
{
|
|
53
|
-
...r,
|
|
54
|
-
as: "button",
|
|
55
|
-
type: "button",
|
|
56
|
-
variant: "ghost",
|
|
57
|
-
color: "company",
|
|
58
|
-
className: d(e.button, e.loading, t),
|
|
59
|
-
disabled: !0,
|
|
60
|
-
"aria-label": "loading",
|
|
61
|
-
children: /* @__PURE__ */ a(u, { className: e.avatarIcon, icon: /* @__PURE__ */ a(p, { name: "loading", loading: !0, className: e.avatar }) })
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
if (i) {
|
|
65
|
-
let s = i.description;
|
|
66
|
-
return i.role === "subunit" && typeof s == "string" && s && (s = `${s.split(",")[0]}, ${c.subunit}`), /* @__PURE__ */ m(
|
|
67
|
-
g,
|
|
68
|
-
{
|
|
69
|
-
...r,
|
|
70
|
-
as: "button",
|
|
71
|
-
type: "button",
|
|
72
|
-
variant: "ghost",
|
|
73
|
-
color: "company",
|
|
74
|
-
className: d(e.button, t),
|
|
75
|
-
"aria-label": o ? c.close : i.name,
|
|
76
|
-
"aria-expanded": o,
|
|
77
|
-
children: [
|
|
78
|
-
!n && /* @__PURE__ */ a(b, { children: /* @__PURE__ */ m("div", { className: e.labelContainer, children: [
|
|
79
|
-
i.name,
|
|
80
|
-
/* @__PURE__ */ a("span", { className: e.description, children: typeof s == "string" || h(s) ? s : null })
|
|
81
|
-
] }) }),
|
|
82
|
-
o ? /* @__PURE__ */ a(u, { className: e.closeIcon, icon: /* @__PURE__ */ a(I, { className: e.icon, "aria-hidden": !0 }) }) : /* @__PURE__ */ a(
|
|
83
|
-
u,
|
|
84
|
-
{
|
|
85
|
-
className: e.avatarIcon,
|
|
86
|
-
icon: /* @__PURE__ */ a(p, { ...i?.icon, className: e.avatar })
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
return o ? null : /* @__PURE__ */ m(
|
|
94
|
-
g,
|
|
95
|
-
{
|
|
96
|
-
...r,
|
|
97
|
-
as: "button",
|
|
98
|
-
type: "button",
|
|
99
|
-
variant: "ghost",
|
|
100
|
-
color: "company",
|
|
101
|
-
"aria-label": c.login,
|
|
102
|
-
className: d(e.button, t),
|
|
103
|
-
"aria-expanded": o,
|
|
104
|
-
children: [
|
|
105
|
-
!n && /* @__PURE__ */ a(b, { children: c.login }),
|
|
106
|
-
/* @__PURE__ */ a(u, { className: e.loginIcon, icon: /* @__PURE__ */ a(w, { className: e.icon, "aria-hidden": !0 }) })
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
}, M = (t) => {
|
|
111
|
-
switch (t) {
|
|
112
|
-
case "nn":
|
|
113
|
-
return {
|
|
114
|
-
login: "Logg inn",
|
|
115
|
-
close: "Lukk kontomeny",
|
|
116
|
-
subunit: "undereining"
|
|
117
|
-
};
|
|
118
|
-
case "en":
|
|
119
|
-
return {
|
|
120
|
-
login: "Log in",
|
|
121
|
-
close: "Close Account Menu",
|
|
122
|
-
subunit: "subunit"
|
|
123
|
-
};
|
|
124
|
-
default:
|
|
125
|
-
return {
|
|
126
|
-
login: "Logg inn",
|
|
127
|
-
close: "Lukk kontomeny",
|
|
128
|
-
subunit: "underenhet"
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
export {
|
|
133
|
-
J as AccountMenuButton
|
|
134
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsxs as p, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { c as d } from "../../index-p1eeF8LQ.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import "../Button/Button.js";
|
|
5
|
-
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import "../Snackbar/useSnackbar.js";
|
|
7
|
-
import "react-dom";
|
|
8
|
-
import { Backdrop as m } from "../Dropdown/Backdrop.js";
|
|
9
|
-
import '../../assets/GlobalHeaderBase.css';const i = "_header_pafet_1", n = "_backdrop_pafet_12", r = {
|
|
10
|
-
header: i,
|
|
11
|
-
backdrop: n
|
|
12
|
-
}, u = ({
|
|
13
|
-
currentId: o,
|
|
14
|
-
className: a,
|
|
15
|
-
children: e,
|
|
16
|
-
openBackdrop: t,
|
|
17
|
-
onCloseBackdrop: c
|
|
18
|
-
}) => /* @__PURE__ */ p("header", { className: d(r.header, a), "data-current-id": o, children: [
|
|
19
|
-
t && /* @__PURE__ */ s(m, { className: r.backdrop, onClick: c, color: "transparent" }),
|
|
20
|
-
e
|
|
21
|
-
] });
|
|
22
|
-
export {
|
|
23
|
-
u as GlobalHeaderBase
|
|
24
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import { useState as d, useRef as g, useEffect as b } from "react";
|
|
3
|
-
import "../../index-p1eeF8LQ.js";
|
|
4
|
-
import { useIsDesktop as k } from "../../hooks/useIsDesktop.js";
|
|
5
|
-
import "../Button/Button.js";
|
|
6
|
-
import "react-dom";
|
|
7
|
-
import { useRootContext as v } from "../RootProvider/RootProvider.js";
|
|
8
|
-
import { s as o } from "../../globalSearch.module-DziLSGZg.js";
|
|
9
|
-
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { S as r } from "../../index--jNxJmA8.js";
|
|
11
|
-
import { S as x } from "../../MagnifyingGlass-bwVhw07z.js";
|
|
12
|
-
const z = ({ onSearch: t }) => {
|
|
13
|
-
const i = k(), [n, u] = d(""), { languageCode: m, closeAll: p, currentId: s } = v(), { search: h, placeholder: c } = y(m), f = () => {
|
|
14
|
-
t(n), p();
|
|
15
|
-
}, l = g(null);
|
|
16
|
-
return b(() => {
|
|
17
|
-
s === "search" && l.current?.focus();
|
|
18
|
-
}, [s]), /* @__PURE__ */ e(
|
|
19
|
-
"form",
|
|
20
|
-
{
|
|
21
|
-
onSubmit: (a) => {
|
|
22
|
-
a.preventDefault(), f();
|
|
23
|
-
},
|
|
24
|
-
children: /* @__PURE__ */ S(r, { className: o.globalSearch, "data-size": i ? "lg" : "md", children: [
|
|
25
|
-
/* @__PURE__ */ e(
|
|
26
|
-
r.Input,
|
|
27
|
-
{
|
|
28
|
-
ref: l,
|
|
29
|
-
placeholder: c,
|
|
30
|
-
onChange: (a) => u(a.target.value),
|
|
31
|
-
value: n,
|
|
32
|
-
"aria-label": c,
|
|
33
|
-
className: o.searchInput
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
/* @__PURE__ */ e(r.Clear, {}),
|
|
37
|
-
/* @__PURE__ */ e(r.Button, { variant: "secondary", icon: !0, "aria-label": h, className: o.searchInputButton, children: /* @__PURE__ */ e(x, {}) })
|
|
38
|
-
] })
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
}, y = (t) => {
|
|
42
|
-
switch (t) {
|
|
43
|
-
case "nn":
|
|
44
|
-
return {
|
|
45
|
-
search: "Søk",
|
|
46
|
-
placeholder: "Søk på altinn.no"
|
|
47
|
-
};
|
|
48
|
-
case "en":
|
|
49
|
-
return {
|
|
50
|
-
search: "Search",
|
|
51
|
-
placeholder: "Search on altinn.no"
|
|
52
|
-
};
|
|
53
|
-
default:
|
|
54
|
-
return {
|
|
55
|
-
search: "Søk",
|
|
56
|
-
placeholder: "Søk på altinn.no"
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
export {
|
|
61
|
-
z as GlobalSearch
|
|
62
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import "../../index-p1eeF8LQ.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { useIsDesktop as m } from "../../hooks/useIsDesktop.js";
|
|
6
|
-
import "../Button/Button.js";
|
|
7
|
-
import "react-dom";
|
|
8
|
-
import { useRootContext as l } from "../RootProvider/RootProvider.js";
|
|
9
|
-
import { s as u } from "../../globalSearch.module-DziLSGZg.js";
|
|
10
|
-
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { B as p } from "../../button-BB5sYVKY.js";
|
|
12
|
-
import { S as h } from "../../XMark-tKk6aExO.js";
|
|
13
|
-
import { S as f } from "../../MagnifyingGlass-bwVhw07z.js";
|
|
14
|
-
const L = ({ onClick: t, expanded: o, ...a }) => {
|
|
15
|
-
const { languageCode: n } = l(), { search: r, close: i } = k(n), e = m();
|
|
16
|
-
return /* @__PURE__ */ c(
|
|
17
|
-
p,
|
|
18
|
-
{
|
|
19
|
-
...a,
|
|
20
|
-
type: "button",
|
|
21
|
-
icon: !e,
|
|
22
|
-
title: o ? i : r,
|
|
23
|
-
onClick: t,
|
|
24
|
-
"data-color": "neutral",
|
|
25
|
-
className: u.searchButton,
|
|
26
|
-
"aria-expanded": o,
|
|
27
|
-
children: [
|
|
28
|
-
o ? /* @__PURE__ */ s(h, { "aria-hidden": "true" }) : /* @__PURE__ */ s(f, { "aria-hidden": "true" }),
|
|
29
|
-
e ? r : null
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
}, k = (t) => {
|
|
34
|
-
switch (t) {
|
|
35
|
-
case "nn":
|
|
36
|
-
return {
|
|
37
|
-
search: "Søk",
|
|
38
|
-
close: "Lukk"
|
|
39
|
-
};
|
|
40
|
-
case "en":
|
|
41
|
-
return {
|
|
42
|
-
search: "Search",
|
|
43
|
-
close: "Close"
|
|
44
|
-
};
|
|
45
|
-
default:
|
|
46
|
-
return {
|
|
47
|
-
search: "Søk",
|
|
48
|
-
close: "Lukk"
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
export {
|
|
53
|
-
L as GlobalSearchButton
|
|
54
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { c as p } from "../../index-p1eeF8LQ.js";
|
|
3
|
-
import '../../assets/HeaderGroup2.css';const t = "_group_o0h92_1", c = {
|
|
4
|
-
group: t
|
|
5
|
-
}, m = ({ className: o, children: r }) => /* @__PURE__ */ s("div", { className: p(c.group, o), children: r });
|
|
6
|
-
export {
|
|
7
|
-
m as HeaderGroup
|
|
8
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, jsx as o, Fragment as k } from "react/jsx-runtime";
|
|
2
|
-
import { c as d } from "../../index-p1eeF8LQ.js";
|
|
3
|
-
import { Badge as f } from "../Badge/Badge.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { useIsDesktop as x } from "../../hooks/useIsDesktop.js";
|
|
6
|
-
import { Button as _ } from "../Button/Button.js";
|
|
7
|
-
import { ButtonIcon as c } from "../Button/ButtonIcon.js";
|
|
8
|
-
import { ButtonLabel as h } from "../Button/ButtonLabel.js";
|
|
9
|
-
import "react-dom";
|
|
10
|
-
import { useRootContext as y } from "../RootProvider/RootProvider.js";
|
|
11
|
-
import "../Snackbar/useSnackbar.js";
|
|
12
|
-
import { S as g } from "../../XMark-tKk6aExO.js";
|
|
13
|
-
import { S as N } from "../../MenuHamburger-YjDC-ncP.js";
|
|
14
|
-
import '../../assets/GlobalMenuButton2.css';const B = "_button_rhdbs_1", S = "_icon_rhdbs_25", C = "_iconMobile_rhdbs_31", L = "_badge_rhdbs_37", t = {
|
|
15
|
-
button: B,
|
|
16
|
-
icon: S,
|
|
17
|
-
iconMobile: C,
|
|
18
|
-
badge: L
|
|
19
|
-
}, j = (e) => {
|
|
20
|
-
switch (e) {
|
|
21
|
-
case "nn":
|
|
22
|
-
return {
|
|
23
|
-
close: "Lukk meny"
|
|
24
|
-
};
|
|
25
|
-
case "en":
|
|
26
|
-
return {
|
|
27
|
-
close: "Close menu"
|
|
28
|
-
};
|
|
29
|
-
default:
|
|
30
|
-
return {
|
|
31
|
-
close: "Lukk Meny"
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}, E = ({
|
|
35
|
-
className: e,
|
|
36
|
-
as: i = "button",
|
|
37
|
-
color: a = "company",
|
|
38
|
-
variant: m = "solid",
|
|
39
|
-
expanded: l,
|
|
40
|
-
label: u = "Menu",
|
|
41
|
-
badge: n,
|
|
42
|
-
...b
|
|
43
|
-
}) => {
|
|
44
|
-
const r = x(), { languageCode: M } = y(), { close: p } = j(M);
|
|
45
|
-
return l ? /* @__PURE__ */ s(
|
|
46
|
-
_,
|
|
47
|
-
{
|
|
48
|
-
...b,
|
|
49
|
-
as: i,
|
|
50
|
-
type: "button",
|
|
51
|
-
variant: m,
|
|
52
|
-
color: a,
|
|
53
|
-
className: d(t.button, e),
|
|
54
|
-
"aria-expanded": l,
|
|
55
|
-
children: [
|
|
56
|
-
r && /* @__PURE__ */ s(k, { children: [
|
|
57
|
-
/* @__PURE__ */ o(c, { icon: /* @__PURE__ */ o(g, { className: t.icon, "aria-label": p }) }),
|
|
58
|
-
/* @__PURE__ */ o(h, { children: u })
|
|
59
|
-
] }),
|
|
60
|
-
!r && /* @__PURE__ */ o(c, { icon: /* @__PURE__ */ o(g, { className: t.iconMobile, "aria-label": p }) }),
|
|
61
|
-
n && /* @__PURE__ */ o(f, { ...n, className: t.badge })
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
) : /* @__PURE__ */ s(
|
|
65
|
-
_,
|
|
66
|
-
{
|
|
67
|
-
...b,
|
|
68
|
-
as: i,
|
|
69
|
-
type: "button",
|
|
70
|
-
variant: m,
|
|
71
|
-
color: a,
|
|
72
|
-
className: d(t.button, e),
|
|
73
|
-
children: [
|
|
74
|
-
r && /* @__PURE__ */ o(c, { icon: /* @__PURE__ */ o(N, { className: t.icon, "aria-hidden": !0 }) }),
|
|
75
|
-
/* @__PURE__ */ o(h, { children: u }),
|
|
76
|
-
n && /* @__PURE__ */ o(f, { ...n, className: t.badge })
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
export {
|
|
82
|
-
E as GlobalMenuButton
|
|
83
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import './assets/globalSearch.css';const t = "_globalSearch_1symm_1", s = "_searchInput_1symm_7", c = "_searchInputButton_1symm_11", n = "_searchButton_1symm_16", a = {
|
|
2
|
-
globalSearch: t,
|
|
3
|
-
searchInput: s,
|
|
4
|
-
searchInputButton: c,
|
|
5
|
-
searchButton: n
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
a as s
|
|
9
|
-
};
|