@arbeidstilsynet/design-react 0.7.0 → 0.8.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.
@@ -23,8 +23,33 @@ export interface HeaderMenuProps extends DefaultProps<HTMLDivElement>, HTMLAttri
23
23
  *
24
24
  * @example
25
25
  * ```tsx
26
- * <Header.Menu triggerContent="Ola Nordmann">
27
- * <ProfileMenuItem />
26
+ * <Header.Menu triggerContent="Ola Nordmann" closeButtonText="Lukk">
27
+ * <Header.MenuRow>
28
+ * <Link href="#">
29
+ * <Header.MenuIcon>
30
+ * <PersonCircleIcon aria-label="Profil ikon" />
31
+ * </Header.MenuIcon>
32
+ * <span>Profil</span>
33
+ * </Link>
34
+ * </Header.MenuRow>
35
+ * <Header.MenuRow>
36
+ * <Link href="#">
37
+ * <Header.MenuIcon>
38
+ * <InboxIcon aria-label="Innboks ikon" />
39
+ * </Header.MenuIcon>
40
+ * <span>Innboks</span>
41
+ * <Header.MenuBadge color="warning">19</Header.MenuBadge>
42
+ * </Link>
43
+ * </Header.MenuRow>
44
+ * <Header.MenuRow>
45
+ * <Link href="#">
46
+ * <Header.MenuIcon>
47
+ * <TasklistIcon aria-label="Gjøremål ikon" />
48
+ * </Header.MenuIcon>
49
+ * <span>Gjøremål</span>
50
+ * <Header.MenuBadge color="info">19</Header.MenuBadge>
51
+ * </Link>
52
+ * </Header.MenuRow>
28
53
  * <Divider />
29
54
  * <Switch label="Mørk modus" position="end" />
30
55
  * </Header.Menu>
@@ -47,8 +72,32 @@ export interface HeaderMenuProps extends DefaultProps<HTMLDivElement>, HTMLAttri
47
72
  * @example
48
73
  * ```tsx
49
74
  * <Header.Menu triggerContent="Ola Nordmann" closeButtonText="Lukk">
50
- * <ProfileLink />
51
- * <InboxLink />
75
+ * <Header.MenuRow>
76
+ * <Link href="#">
77
+ * <Header.MenuIcon>
78
+ * <PersonCircleIcon aria-label="Profil ikon" />
79
+ * </Header.MenuIcon>
80
+ * <span>Profil</span>
81
+ * </Link>
82
+ * </Header.MenuRow>
83
+ * <Header.MenuRow>
84
+ * <Link href="#">
85
+ * <Header.MenuIcon>
86
+ * <InboxIcon aria-label="Innboks ikon" />
87
+ * </Header.MenuIcon>
88
+ * <span>Innboks</span>
89
+ * <Header.MenuBadge color="warning">19</Header.MenuBadge>
90
+ * </Link>
91
+ * </Header.MenuRow>
92
+ * <Header.MenuRow>
93
+ * <Link href="#">
94
+ * <Header.MenuIcon>
95
+ * <TasklistIcon aria-label="Gjøremål ikon" />
96
+ * </Header.MenuIcon>
97
+ * <span>Gjøremål</span>
98
+ * <Header.MenuBadge color="info">19</Header.MenuBadge>
99
+ * </Link>
100
+ * </Header.MenuRow>
52
101
  * <Divider />
53
102
  * <Switch label="Mørk modus" position="end" />
54
103
  * </Header.Menu>
@@ -76,9 +76,7 @@ import { HeaderTitle } from './headerTitle';
76
76
  * </Link>
77
77
  * </Header.MenuRow>
78
78
  * <Divider />
79
- * <div style={{ padding: "var(--ds-size-2) var(--ds-size-4)" }}>
80
- * <Switch label="Mørk modus" position="end" />
81
- * </div>
79
+ * <Switch label="Mørk modus" position="end" />
82
80
  * </Header.Menu>
83
81
  * </Header>
84
82
  * ```
@@ -1,6 +1,6 @@
1
1
  export * from './filepicker';
2
2
  export * from './header';
3
- export { LightDarkLogo, type LightDarkLogoProps } from './logo/lightdarklogo';
3
+ export * from './lightdarkimage';
4
4
  export { LogoBlack } from './logo/logoblack';
5
5
  export { LogoGreen } from './logo/logogreen';
6
6
  export { LogoWhite } from './logo/logowhite';
@@ -0,0 +1,18 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { DefaultProps } from '../../types';
3
+ export interface LightDarkImageProps extends DefaultProps<HTMLSpanElement>, Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
4
+ /** Image to show in light mode */
5
+ light: React.ReactNode;
6
+ /** Image to show in dark mode */
7
+ dark: React.ReactNode;
8
+ }
9
+ /**
10
+ * Displays an image with automatic switching between
11
+ * light and dark variants based on the current color scheme.
12
+ *
13
+ * Usage:
14
+ * ```tsx
15
+ * <LightDarkImage light={<LogoBlack />} dark={<LogoWhite />} />
16
+ * ```
17
+ */
18
+ export declare function LightDarkImage({ className, light, dark, ...rest }: Readonly<LightDarkImageProps>): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbeidstilsynet/design-react",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "React implementation of Designsystemet",
5
5
  "author": "Arbeidstilsynet",
6
6
  "repository": {
@@ -30,25 +30,25 @@
30
30
  "react-dom": "^19.1.0"
31
31
  },
32
32
  "dependencies": {
33
- "@digdir/designsystemet-react": "1.11.0",
34
- "@digdir/designsystemet-types": "1.11.0",
35
- "@navikt/aksel-icons": "^7.40.0",
33
+ "@digdir/designsystemet-react": "1.11.1",
34
+ "@digdir/designsystemet-types": "1.11.1",
35
+ "@navikt/aksel-icons": "^8.3.0",
36
36
  "@radix-ui/react-slot": "^1.2.4",
37
37
  "clsx": "^2.1.1",
38
38
  "react-dropzone": "^14.4.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@eslint/js": "9.39.2",
42
- "@storybook/addon-docs": "10.2.4",
43
- "@storybook/addon-vitest": "10.2.4",
44
- "@storybook/react-vite": "10.2.4",
42
+ "@storybook/addon-docs": "10.2.8",
43
+ "@storybook/addon-vitest": "10.2.8",
44
+ "@storybook/react-vite": "10.2.8",
45
45
  "@testing-library/dom": "10.4.1",
46
46
  "@testing-library/jest-dom": "6.9.1",
47
47
  "@testing-library/react": "16.3.2",
48
48
  "@testing-library/user-event": "14.6.1",
49
49
  "@types/eslint-plugin-jsx-a11y": "6.10.1",
50
- "@types/node": "24.10.10",
51
- "@types/react": "19.2.10",
50
+ "@types/node": "24.10.12",
51
+ "@types/react": "19.2.13",
52
52
  "@types/react-dom": "19.2.3",
53
53
  "@vitejs/plugin-react": "5.1.3",
54
54
  "babel-plugin-react-compiler": "1.0.0",
@@ -56,7 +56,7 @@
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.2.4",
59
+ "eslint-plugin-storybook": "10.2.8",
60
60
  "jsdom": "28.0.0",
61
61
  "react": "19.2.4",
62
62
  "react-dom": "19.2.4",
@@ -64,7 +64,7 @@
64
64
  "typescript-eslint": "8.54.0",
65
65
  "vite": "7.3.1",
66
66
  "vite-plugin-dts": "4.5.4",
67
- "@arbeidstilsynet/design-css": "0.7.0"
67
+ "@arbeidstilsynet/design-css": "0.8.1"
68
68
  },
69
69
  "scripts": {
70
70
  "build": "vite build",
@@ -1,19 +0,0 @@
1
- import { SVGProps } from 'react';
2
- export interface LightDarkLogoProps extends SVGProps<SVGSVGElement> {
3
- /**
4
- * Width of the logo. Default is "100%".
5
- */
6
- width?: string | number;
7
- }
8
- /**
9
- * Displays the Arbeidstilsynet logo with automatic switching between
10
- * black and white variants based on the current color scheme.
11
- *
12
- * You can alternatively import `LogoBlack`, `LogoWhite` or `LogoGreen` directly.
13
- *
14
- * Usage:
15
- * ```tsx
16
- * <LightDarkLogo width="150px" />
17
- * ```
18
- */
19
- export declare function LightDarkLogo({ width, ...rest }: Readonly<LightDarkLogoProps>): import("react/jsx-runtime").JSX.Element;