@norges-domstoler/dds-components 13.7.0 → 13.8.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/cjs/components/AppShell/AppShell.d.ts +20 -4
- package/dist/cjs/components/AppShell/AppShell.stories.d.ts +2 -2
- package/dist/cjs/components/AppShell/AppShell.tokens.d.ts +16 -0
- package/dist/cjs/components/AppShell/Navigation/EmbeteIcon.d.ts +7 -0
- package/dist/cjs/components/AppShell/Navigation/Navigation.d.ts +5 -1
- package/dist/cjs/components/AppShell/Navigation/NavigationLogo.d.ts +3 -0
- package/dist/cjs/components/AppShell/Navigation/TopBar.d.ts +22 -0
- package/dist/cjs/components/Button/Button.d.ts +1 -1
- package/dist/cjs/components/Button/Button.stories.d.ts +1 -1
- package/dist/cjs/components/Button/Button.types.d.ts +2 -2
- package/dist/cjs/index.js +2429 -2274
- package/dist/components/AppShell/AppShell.d.ts +20 -4
- package/dist/components/AppShell/AppShell.js +7 -3
- package/dist/components/AppShell/AppShell.stories.d.ts +2 -2
- package/dist/components/AppShell/AppShell.tokens.d.ts +16 -0
- package/dist/components/AppShell/AppShell.tokens.js +16 -3
- package/dist/components/AppShell/Navigation/EmbeteIcon.d.ts +7 -0
- package/dist/components/AppShell/Navigation/EmbeteIcon.js +21 -0
- package/dist/components/AppShell/Navigation/Navigation.d.ts +5 -1
- package/dist/components/AppShell/Navigation/Navigation.js +71 -37
- package/dist/components/AppShell/Navigation/NavigationItem.js +1 -1
- package/dist/components/AppShell/Navigation/NavigationLogo.d.ts +3 -0
- package/dist/components/AppShell/Navigation/NavigationLogo.js +34 -0
- package/dist/components/AppShell/Navigation/TopBar.d.ts +22 -0
- package/dist/components/AppShell/Navigation/TopBar.js +72 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.stories.d.ts +1 -1
- package/dist/components/Button/Button.types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { User } from './Navigation/TopBar';
|
|
3
|
+
import { OverflowMenuProps } from '../OverflowMenu';
|
|
2
4
|
export type AppShellProps = PropsWithChildren<{
|
|
3
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Versjon på appen på formatet 0.0.0
|
|
7
|
+
*/
|
|
4
8
|
version?: string;
|
|
5
9
|
navigation: AppShellNavigationProps;
|
|
10
|
+
/**
|
|
11
|
+
* Den innloggede brukeren.
|
|
12
|
+
*/
|
|
13
|
+
user: User;
|
|
14
|
+
/**
|
|
15
|
+
* Menyvalg som skal vises i OverflowMenu knyttet til "bruker"-knappen.
|
|
16
|
+
*/
|
|
17
|
+
userMenuItems?: OverflowMenuProps['items'];
|
|
6
18
|
}>;
|
|
7
19
|
export type AppShellNavigationProps = {
|
|
8
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Interne lenker i navigasjonen.
|
|
22
|
+
*/
|
|
9
23
|
internal?: ReactElement[];
|
|
10
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Eksterne lenker i navigasjonen.
|
|
26
|
+
*/
|
|
11
27
|
external?: ReactElement[];
|
|
12
28
|
};
|
|
13
|
-
export declare const AppShell: ({ children, version, navigation: { internal, external }, }: AppShellProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const AppShell: ({ children, version, navigation: { internal, external }, user, userMenuItems, }: AppShellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { ComponentProps } from 'react';
|
|
|
2
2
|
import { AppShell } from '.';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: (({ children, version, navigation: { internal, external }, }: import("./AppShell").AppShellProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
5
|
+
component: (({ children, version, navigation: { internal, external }, user, userMenuItems, }: import("./AppShell").AppShellProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
6
6
|
NavItem: {
|
|
7
7
|
<T extends import("@norges-domstoler/dds-core").As = "a">({ as: _as, active, icon, external, children, ...rest }: import("react").PropsWithoutRef<ComponentProps<T>> & {
|
|
8
8
|
as?: T | undefined;
|
|
@@ -20,4 +20,4 @@ declare const _default: {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
export default _default;
|
|
23
|
-
export declare const Default: (args: ComponentProps<typeof AppShell
|
|
23
|
+
export declare const Default: (args: Partial<ComponentProps<typeof AppShell>>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,6 +35,14 @@ export declare const appShellTokens: {
|
|
|
35
35
|
color: string;
|
|
36
36
|
logo: {
|
|
37
37
|
fontWeight: number;
|
|
38
|
+
small: {
|
|
39
|
+
fontWeight: number;
|
|
40
|
+
lineHeight: any;
|
|
41
|
+
fontSize: string;
|
|
42
|
+
letterSpacing: any;
|
|
43
|
+
fontFamily: any;
|
|
44
|
+
fontStyle: any;
|
|
45
|
+
};
|
|
38
46
|
lineHeight: any;
|
|
39
47
|
fontSize: string;
|
|
40
48
|
letterSpacing: any;
|
|
@@ -50,6 +58,12 @@ export declare const appShellTokens: {
|
|
|
50
58
|
fontStyle: any;
|
|
51
59
|
};
|
|
52
60
|
};
|
|
61
|
+
topBar: {
|
|
62
|
+
padding: string;
|
|
63
|
+
height: string;
|
|
64
|
+
buttonTextColor: string;
|
|
65
|
+
gap: string;
|
|
66
|
+
};
|
|
53
67
|
color: string;
|
|
54
68
|
backgroundColor: string;
|
|
55
69
|
gap: string;
|
|
@@ -57,6 +71,7 @@ export declare const appShellTokens: {
|
|
|
57
71
|
padding: string;
|
|
58
72
|
width: string;
|
|
59
73
|
mobile: {
|
|
74
|
+
breakpoint: string;
|
|
60
75
|
iconColors: string;
|
|
61
76
|
};
|
|
62
77
|
};
|
|
@@ -64,5 +79,6 @@ export declare const appShellTokens: {
|
|
|
64
79
|
gap: string;
|
|
65
80
|
textColor: string;
|
|
66
81
|
backgroundColor: string;
|
|
82
|
+
borderRadius: string;
|
|
67
83
|
};
|
|
68
84
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SvgProps } from '@norges-domstoler/dds-icons';
|
|
2
|
+
export type EmbeteType = 'jordskifterett' | 'tingrett' | 'lagmannsrett' | 'høyesterett';
|
|
3
|
+
type EmbeteIconProps = {
|
|
4
|
+
type?: EmbeteType;
|
|
5
|
+
} & SvgProps;
|
|
6
|
+
export declare const EmbeteIcon: ({ type, ...rest }: EmbeteIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
+
import { User } from './TopBar';
|
|
3
|
+
import { OverflowMenuProps } from '../../OverflowMenu';
|
|
2
4
|
export declare const NavigationItems: import("styled-components").StyledComponent<"nav", any, {}, never>;
|
|
3
5
|
export type NavigationProps = {
|
|
4
6
|
version: string;
|
|
5
7
|
internal: ReactElement[];
|
|
6
8
|
external: ReactElement[];
|
|
9
|
+
user: User;
|
|
10
|
+
userMenuItems?: OverflowMenuProps['items'];
|
|
7
11
|
};
|
|
8
|
-
export declare const Navigation: ({ version, internal, external, }: NavigationProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const Navigation: ({ version, user, userMenuItems, internal, external, }: NavigationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EmbeteType } from './EmbeteIcon';
|
|
2
|
+
import { OverflowMenuProps } from '../../OverflowMenu';
|
|
3
|
+
type TopBarProps = {
|
|
4
|
+
user: User;
|
|
5
|
+
userMenuItems?: OverflowMenuProps['items'];
|
|
6
|
+
isNavigationOpen: boolean;
|
|
7
|
+
onNavigationOpenChange: (isOpen: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
export type User = {
|
|
10
|
+
/**Brukerens fulle navn (for- og etternavn). */
|
|
11
|
+
name: string;
|
|
12
|
+
/**Det aktive embetet til brukeren. */
|
|
13
|
+
embete: Embete;
|
|
14
|
+
};
|
|
15
|
+
export type Embete = {
|
|
16
|
+
/**Navnet på embetet. */
|
|
17
|
+
name: string;
|
|
18
|
+
/**Hvilken instans embetet er. */
|
|
19
|
+
type: EmbeteType;
|
|
20
|
+
};
|
|
21
|
+
export declare const TopBar: ({ user, userMenuItems, isNavigationOpen, onNavigationOpenChange, }: TopBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Button: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "onClick" | "onFocus" | "onBlur" | "type">, "id" | "className"> & {
|
|
3
3
|
size?: import("./Button.types").ButtonSize | undefined;
|
|
4
|
-
label?: string | undefined;
|
|
4
|
+
label?: string | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
5
5
|
purpose?: import("./Button.types").ButtonPurpose | undefined;
|
|
6
6
|
iconPosition?: import("./Button.types").IconPosition | undefined;
|
|
7
7
|
appearance?: import("./Button.types").ButtonAppearance | undefined;
|
|
@@ -4,7 +4,7 @@ declare const _default: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "type" | "onFocus" | "onBlur" | "onClick">, "className" | "id"> & {
|
|
6
6
|
size?: import("./Button.types").ButtonSize | undefined;
|
|
7
|
-
label?: string | undefined;
|
|
7
|
+
label?: string | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
8
8
|
purpose?: import("./Button.types").ButtonPurpose | undefined;
|
|
9
9
|
iconPosition?: import("./Button.types").IconPosition | undefined;
|
|
10
10
|
appearance?: import("./Button.types").ButtonAppearance | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes } from 'react';
|
|
1
|
+
import { ButtonHTMLAttributes, ReactElement } from 'react';
|
|
2
2
|
import { BaseComponentProps } from '@norges-domstoler/dds-core';
|
|
3
3
|
import { SvgIcon } from '@norges-domstoler/dds-icons';
|
|
4
4
|
export type ButtonPurpose = 'primary' | 'secondary' | 'danger';
|
|
@@ -10,7 +10,7 @@ export type ButtonProps = BaseComponentProps<HTMLButtonElement, {
|
|
|
10
10
|
/**Størrelsen på knappen. */
|
|
11
11
|
size?: ButtonSize;
|
|
12
12
|
/**Tekst i knappen. */
|
|
13
|
-
label?: string;
|
|
13
|
+
label?: string | ReactElement;
|
|
14
14
|
/**Bestemmer farger basert på formål. */
|
|
15
15
|
purpose?: ButtonPurpose;
|
|
16
16
|
/** Posisjonen til ikonet i forhold til teksten.*/
|