@arbeidstilsynet/design-react 0.3.10 → 0.4.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 +414 -311
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +422 -319
- package/dist/index.js.map +1 -1
- package/dist/src/components/filepicker/filepickerContext.d.ts +1 -1
- package/dist/src/components/header/headerDefaultLogo.d.ts +5 -0
- package/dist/src/components/header/headerTitle.d.ts +8 -4
- package/dist/src/components/header/headerTitleDropdown.d.ts +11 -0
- package/dist/src/components/header/headerTitleLinks.d.ts +10 -0
- package/dist/src/components/header/headerTitleLogo.d.ts +7 -0
- package/dist/src/components/header/index.d.ts +5 -15
- package/dist/src/types.d.ts +1 -1
- package/package.json +5 -4
- package/dist/src/components/header/headerLinks.d.ts +0 -13
- package/dist/src/components/header/headerSearch.d.ts +0 -6
|
@@ -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: React.Context<FilePickerContextValue<string | number>>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { DefaultProps } from '../../types';
|
|
3
|
+
import { LinkItem } from './headerTitleLinks';
|
|
3
4
|
export interface HeaderTitleProps extends DefaultProps<HTMLDivElement>, HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
logo?: ReactNode;
|
|
6
|
+
appName: string;
|
|
7
|
+
userName: string;
|
|
8
|
+
links?: LinkItem[];
|
|
9
|
+
controls?: ReactNode[];
|
|
6
10
|
}
|
|
7
|
-
export declare function HeaderTitle({ className,
|
|
11
|
+
export declare function HeaderTitle({ className, logo, appName, userName, links, controls, ...rest }: Readonly<HeaderTitleProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { DefaultProps } from '../../types';
|
|
3
|
+
export interface DropdownItem {
|
|
4
|
+
label: string;
|
|
5
|
+
href: string;
|
|
6
|
+
}
|
|
7
|
+
export interface HeaderTitleDropdownProps extends DefaultProps<HTMLDivElement>, HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
controls?: ReactNode[];
|
|
9
|
+
userName?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function HeaderTitleDropdown({ className, controls, userName, ...rest }: Readonly<HeaderTitleDropdownProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { DefaultProps } from '../../types';
|
|
3
|
+
export interface LinkItem {
|
|
4
|
+
label: string;
|
|
5
|
+
href: string;
|
|
6
|
+
}
|
|
7
|
+
export interface HeaderTitleLinksProps extends DefaultProps<HTMLDivElement>, HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
links?: LinkItem[];
|
|
9
|
+
}
|
|
10
|
+
export declare function HeaderTitleLinks({ className, links, ...rest }: Readonly<HeaderTitleLinksProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { DefaultProps } from '../../types';
|
|
3
|
+
export interface HeaderTitleLogoProps extends DefaultProps<HTMLDivElement>, HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
logo: ReactNode;
|
|
5
|
+
appName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function HeaderTitleLogo({ className, logo, appName, ...rest }: Readonly<HeaderTitleLogoProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
import { Header as HeaderParent } from './header';
|
|
2
2
|
import { HeaderTitle } from './headerTitle';
|
|
3
|
-
import { HeaderSearch } from './headerSearch';
|
|
4
|
-
import { HeaderLinks } from './headerLinks';
|
|
5
3
|
/**
|
|
6
4
|
* Header component for the design system.
|
|
7
|
-
* It includes
|
|
8
|
-
*
|
|
9
|
-
* Uses Radix UI's Slot for flexible link items.
|
|
10
|
-
* This means that you can pass any component as a child to `Header.Links.Item` and it will render correctly.
|
|
11
|
-
* The `asChild` prop must be set to `true` on `Header.Links.Item` to enable this behavior.
|
|
12
|
-
* Any className passed to `Header.Links.Item` will be applied to the child component.
|
|
5
|
+
* It includes the primary title section along with optional search and links sections.
|
|
13
6
|
*
|
|
7
|
+
* The primary Title section (`Header.Title`) displays the system name, user information, and navigation links.
|
|
8
|
+
* You can pass in a list of user controls (like a theme switcher) to be displayed in a dropdown.
|
|
14
9
|
*/
|
|
15
10
|
declare const Header: typeof HeaderParent & {
|
|
16
11
|
Title: typeof HeaderTitle;
|
|
17
|
-
Search: typeof HeaderSearch;
|
|
18
|
-
Links: (({ children, ...props }: import('./headerLinks').HeaderLinksProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
19
|
-
Item: ({ asChild, className, children, ...props }: import('./headerLinks').LinkItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
};
|
|
21
12
|
};
|
|
22
13
|
export type { HeaderProps } from './header';
|
|
23
|
-
export type { HeaderSearchProps } from './headerSearch';
|
|
24
|
-
export type { HeaderLinksProps, LinkItemProps } from './headerLinks';
|
|
25
14
|
export type { HeaderTitleProps } from './headerTitle';
|
|
26
|
-
export { Header, HeaderTitle
|
|
15
|
+
export { Header, HeaderTitle };
|
|
16
|
+
export { HeaderDefaultLogo } from './headerDefaultLogo';
|
package/dist/src/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbeidstilsynet/design-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "React implementation of Designsystemet",
|
|
5
5
|
"author": "Arbeidstilsynet",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"react-dom": "^19.1.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@digdir/designsystemet-react": "1.
|
|
33
|
+
"@digdir/designsystemet-react": "1.8.0",
|
|
34
|
+
"@digdir/designsystemet-types": "1.8.0",
|
|
34
35
|
"@navikt/aksel-icons": "^7.35.0",
|
|
35
36
|
"@radix-ui/react-slot": "^1.2.4",
|
|
36
37
|
"clsx": "^2.1.1",
|
|
@@ -61,9 +62,9 @@
|
|
|
61
62
|
"react-dom": "19.2.0",
|
|
62
63
|
"typescript": "5.9.3",
|
|
63
64
|
"typescript-eslint": "8.48.0",
|
|
64
|
-
"vite": "7.2.
|
|
65
|
+
"vite": "7.2.6",
|
|
65
66
|
"vite-plugin-dts": "4.5.4",
|
|
66
|
-
"@arbeidstilsynet/design-css": "0.
|
|
67
|
+
"@arbeidstilsynet/design-css": "0.4.0"
|
|
67
68
|
},
|
|
68
69
|
"scripts": {
|
|
69
70
|
"build": "vite build",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DefaultProps } from '../../types';
|
|
2
|
-
export type HeaderLinksProps = React.HtmlHTMLAttributes<HTMLDivElement> & {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
};
|
|
5
|
-
export declare const HeaderLinksRoot: ({ children, ...props }: HeaderLinksProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export interface LinkItemProps extends DefaultProps<HTMLDivElement>, React.HtmlHTMLAttributes<HTMLDivElement> {
|
|
7
|
-
asChild?: boolean;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare const HeaderLinkItem: ({ asChild, className, children, ...props }: LinkItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare const HeaderLinks: (({ children, ...props }: HeaderLinksProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
12
|
-
Item: ({ asChild, className, children, ...props }: LinkItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DefaultProps } from '../../types';
|
|
2
|
-
import { HTMLAttributes } from 'react';
|
|
3
|
-
export interface HeaderSearchProps extends DefaultProps<HTMLDivElement>, HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
text?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function HeaderSearch({ className, ...rest }: Readonly<HeaderSearchProps>): import("react/jsx-runtime").JSX.Element;
|