@arbeidstilsynet/design-react 0.4.1 → 0.5.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/index.cjs +229 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +236 -122
- package/dist/index.js.map +1 -1
- package/dist/src/components/filepicker/filepickerContext.d.ts +1 -1
- package/dist/src/components/header/headerTitle.d.ts +2 -1
- package/dist/src/components/header/headerTitleDropdown.d.ts +2 -1
- package/dist/src/components/header/headerTitleLinks.d.ts +3 -2
- package/dist/src/components/header/index.d.ts +19 -0
- package/dist/src/components/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/src/components/hooks/useMediaQuery.d.ts +6 -0
- package/package.json +19 -19
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FilePickerProps } from './types';
|
|
2
2
|
export type FilePickerContextValue<TFileId extends string | number> = Pick<FilePickerProps<TFileId>, "files" | "errors" | "disabled" | "isWaiting" | "onAdd" | "onRemove">;
|
|
3
|
-
export declare const FilePickerContext:
|
|
3
|
+
export declare const FilePickerContext: import('react').Context<FilePickerContextValue<string | number>>;
|
|
@@ -7,5 +7,6 @@ export interface HeaderTitleProps extends DefaultProps<HTMLDivElement>, HTMLAttr
|
|
|
7
7
|
userName: string;
|
|
8
8
|
links?: LinkItem[];
|
|
9
9
|
controls?: ReactNode[];
|
|
10
|
+
children?: ReactNode;
|
|
10
11
|
}
|
|
11
|
-
export declare function HeaderTitle({ className, logo, appName, userName, links, controls, ...rest }: Readonly<HeaderTitleProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function HeaderTitle({ className, logo, appName, userName, links, controls, children, ...rest }: Readonly<HeaderTitleProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,5 +9,6 @@ export interface HeaderTitleDropdownProps extends DefaultProps<HTMLDivElement>,
|
|
|
9
9
|
controls?: ReactNode[];
|
|
10
10
|
links?: LinkItem[];
|
|
11
11
|
userName?: string;
|
|
12
|
+
children?: ReactNode;
|
|
12
13
|
}
|
|
13
|
-
export declare function HeaderTitleDropdown({ className, controls, links, userName, ...rest }: Readonly<HeaderTitleDropdownProps>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function HeaderTitleDropdown({ className, controls, links, userName, children, ...rest }: Readonly<HeaderTitleDropdownProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { DefaultProps } from '../../types';
|
|
3
3
|
export interface LinkItem {
|
|
4
4
|
label: string;
|
|
@@ -6,5 +6,6 @@ export interface LinkItem {
|
|
|
6
6
|
}
|
|
7
7
|
export interface HeaderTitleLinksProps extends DefaultProps<HTMLDivElement>, HTMLAttributes<HTMLDivElement> {
|
|
8
8
|
links?: LinkItem[];
|
|
9
|
+
children?: ReactNode;
|
|
9
10
|
}
|
|
10
|
-
export declare function HeaderTitleLinks({ className, links, ...rest }: Readonly<HeaderTitleLinksProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function HeaderTitleLinks({ className, links, children, ...rest }: Readonly<HeaderTitleLinksProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,6 +6,25 @@ import { HeaderTitle } from './headerTitle';
|
|
|
6
6
|
*
|
|
7
7
|
* The primary Title section (`Header.Title`) displays the system name, user information, and navigation links.
|
|
8
8
|
* You can pass in a list of user controls (like a theme switcher) to be displayed in a dropdown.
|
|
9
|
+
*
|
|
10
|
+
* For the navigation links, you can either provide an array of link items via the `links` prop,
|
|
11
|
+
* or you can customize the links by passing your own components as children to `Header.Title`.
|
|
12
|
+
* Make sure that the children you provide are valid React elements and accept className props for proper styling.
|
|
13
|
+
*
|
|
14
|
+
* Example usage for Next.js Link components:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import Link from "next/link";
|
|
17
|
+
*
|
|
18
|
+
* <Header>
|
|
19
|
+
* <Header.Title
|
|
20
|
+
* appName="My Application"
|
|
21
|
+
* userName="John Doe"
|
|
22
|
+
* >
|
|
23
|
+
* <Link href="/">Home</Link>
|
|
24
|
+
* <Link href="/about">About</Link>
|
|
25
|
+
* </Header.Title>
|
|
26
|
+
* </Header>
|
|
27
|
+
* ```
|
|
9
28
|
*/
|
|
10
29
|
declare const Header: typeof HeaderParent & {
|
|
11
30
|
Title: typeof HeaderTitle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbeidstilsynet/design-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "React implementation of Designsystemet",
|
|
5
5
|
"author": "Arbeidstilsynet",
|
|
6
6
|
"repository": {
|
|
@@ -30,41 +30,41 @@
|
|
|
30
30
|
"react-dom": "^19.1.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@digdir/designsystemet-react": "1.
|
|
34
|
-
"@digdir/designsystemet-types": "1.
|
|
35
|
-
"@navikt/aksel-icons": "^7.
|
|
33
|
+
"@digdir/designsystemet-react": "1.9.0",
|
|
34
|
+
"@digdir/designsystemet-types": "1.9.0",
|
|
35
|
+
"@navikt/aksel-icons": "^7.37.0",
|
|
36
36
|
"@radix-ui/react-slot": "^1.2.4",
|
|
37
37
|
"clsx": "^2.1.1",
|
|
38
38
|
"react-dropzone": "^14.3.8"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@eslint/js": "9.39.
|
|
42
|
-
"@storybook/addon-docs": "10.1.
|
|
43
|
-
"@storybook/addon-vitest": "10.1.
|
|
44
|
-
"@storybook/react-vite": "10.1.
|
|
41
|
+
"@eslint/js": "9.39.2",
|
|
42
|
+
"@storybook/addon-docs": "10.1.11",
|
|
43
|
+
"@storybook/addon-vitest": "10.1.11",
|
|
44
|
+
"@storybook/react-vite": "10.1.11",
|
|
45
45
|
"@testing-library/dom": "10.4.1",
|
|
46
46
|
"@testing-library/jest-dom": "6.9.1",
|
|
47
|
-
"@testing-library/react": "16.3.
|
|
47
|
+
"@testing-library/react": "16.3.1",
|
|
48
48
|
"@testing-library/user-event": "14.6.1",
|
|
49
49
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
50
|
-
"@types/node": "24.10.
|
|
50
|
+
"@types/node": "24.10.4",
|
|
51
51
|
"@types/react": "19.2.7",
|
|
52
52
|
"@types/react-dom": "19.2.3",
|
|
53
|
-
"@vitejs/plugin-react": "5.1.
|
|
53
|
+
"@vitejs/plugin-react": "5.1.2",
|
|
54
54
|
"babel-plugin-react-compiler": "1.0.0",
|
|
55
|
-
"eslint": "9.39.
|
|
55
|
+
"eslint": "9.39.2",
|
|
56
56
|
"eslint-config-prettier": "10.1.8",
|
|
57
57
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
58
58
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
59
|
-
"eslint-plugin-storybook": "10.1.
|
|
60
|
-
"jsdom": "27.
|
|
61
|
-
"react": "19.2.
|
|
62
|
-
"react-dom": "19.2.
|
|
59
|
+
"eslint-plugin-storybook": "10.1.11",
|
|
60
|
+
"jsdom": "27.4.0",
|
|
61
|
+
"react": "19.2.3",
|
|
62
|
+
"react-dom": "19.2.3",
|
|
63
63
|
"typescript": "5.9.3",
|
|
64
|
-
"typescript-eslint": "8.
|
|
65
|
-
"vite": "7.
|
|
64
|
+
"typescript-eslint": "8.51.0",
|
|
65
|
+
"vite": "7.3.0",
|
|
66
66
|
"vite-plugin-dts": "4.5.4",
|
|
67
|
-
"@arbeidstilsynet/design-css": "0.
|
|
67
|
+
"@arbeidstilsynet/design-css": "0.5.0"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "vite build",
|