@arbeidstilsynet/design-react 0.10.4 → 0.11.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.js +157 -48
- package/dist/index.js.map +1 -1
- package/dist/src/components/filepicker/filepicker.d.ts +1 -1
- package/dist/src/components/filepicker/filepickerDropzone.d.ts +1 -1
- package/dist/src/components/filepicker/filepickerErrors.d.ts +1 -1
- package/dist/src/components/filepicker/filepickerFiles.d.ts +1 -1
- package/dist/src/components/header/header.d.ts +1 -1
- package/dist/src/components/header/headerIllustration.d.ts +1 -1
- package/dist/src/components/header/headerLogo.d.ts +1 -1
- package/dist/src/components/header/headerMenu.d.ts +1 -1
- package/dist/src/components/header/headerMenuRow.d.ts +3 -3
- package/dist/src/components/header/headerNavbar.d.ts +1 -1
- package/dist/src/components/header/headerTitle.d.ts +1 -1
- package/dist/src/components/header/stories-helpers/headerStoriesIllustration.d.ts +1 -1
- package/dist/src/components/header/stories-helpers/headerStoriesTitle.d.ts +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/lightdarkimage/index.d.ts +1 -1
- package/dist/src/components/logo/logoblack.d.ts +1 -1
- package/dist/src/components/logo/logogreen.d.ts +1 -1
- package/dist/src/components/logo/logowhite.d.ts +1 -1
- package/dist/src/components/steps/index.d.ts +60 -0
- package/dist/src/components/steps/steps.d.ts +27 -0
- package/dist/src/components/steps/stepsStep.d.ts +22 -0
- package/dist/src/components/steps/stepsStepDescription.d.ts +5 -0
- package/dist/src/components/steps/stepsStepDetails.d.ts +5 -0
- package/dist/src/components/steps/stepsStepMark.d.ts +25 -0
- package/dist/src/components/steps/stepsStepTitle.d.ts +5 -0
- package/dist/src/docs-components/CssVariables.d.ts +1 -1
- package/package.json +28 -34
|
@@ -15,4 +15,4 @@ export interface LightDarkImageProps extends DefaultProps<HTMLSpanElement>, Omit
|
|
|
15
15
|
* <LightDarkImage light={<LogoBlack />} dark={<LogoWhite />} />
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export declare function LightDarkImage({ className, light, dark, ...rest }: Readonly<LightDarkImageProps>): import("react
|
|
18
|
+
export declare function LightDarkImage({ className, light, dark, ...rest }: Readonly<LightDarkImageProps>): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
|
-
export declare const LogoBlack: ({ width }: SVGProps<SVGSVGElement>) => import("react
|
|
2
|
+
export declare const LogoBlack: ({ width }: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
|
-
export declare const LogoGreen: ({ width }: SVGProps<SVGSVGElement>) => import("react
|
|
2
|
+
export declare const LogoGreen: ({ width }: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
|
-
export declare const LogoWhite: ({ width }: SVGProps<SVGSVGElement>) => import("react
|
|
2
|
+
export declare const LogoWhite: ({ width }: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Steps as StepsParent } from './steps';
|
|
2
|
+
import { StepsStep } from './stepsStep';
|
|
3
|
+
import { StepsStepDescription } from './stepsStepDescription';
|
|
4
|
+
import { StepsStepDetails } from './stepsStepDetails';
|
|
5
|
+
import { StepsStepMark } from './stepsStepMark';
|
|
6
|
+
import { StepsStepTitle } from './stepsStepTitle';
|
|
7
|
+
export type { StepsProps } from './steps';
|
|
8
|
+
export type { StepsStepProps } from './stepsStep';
|
|
9
|
+
export type { StepsStepDescriptionProps } from './stepsStepDescription';
|
|
10
|
+
export type { StepsStepDetailsProps } from './stepsStepDetails';
|
|
11
|
+
export type { StepsStepMarkProps } from './stepsStepMark';
|
|
12
|
+
export type { StepsStepTitleProps } from './stepsStepTitle';
|
|
13
|
+
/**
|
|
14
|
+
* Compound component for displaying a step-by-step progress indicator.
|
|
15
|
+
*
|
|
16
|
+
* ## Subcomponents
|
|
17
|
+
*
|
|
18
|
+
* - `Steps.Step` — Individual step item (renders as `<li>`)
|
|
19
|
+
* - `Steps.StepMark` — Visual dot/icon for the step. Accepts an icon as child. Use `data-color` to override color.
|
|
20
|
+
* - `Steps.StepTitle` — Label for the step
|
|
21
|
+
* - `Steps.StepDescription` — Short secondary text below the title
|
|
22
|
+
* - `Steps.StepDetails` — Additional detail text (e.g. body copy inside a vertical step)
|
|
23
|
+
*
|
|
24
|
+
* ## Props
|
|
25
|
+
*
|
|
26
|
+
* - `data-direction` — Layout direction: `"right"` (default, horizontal), `"down"`, or `"up"` (vertical)
|
|
27
|
+
* - `data-fade` — Fades inactive steps: `"start"`, `"end"`, `"both"`, or `"none"`
|
|
28
|
+
* - `data-state` — Set to `"complete"` to mark all steps as finished
|
|
29
|
+
*
|
|
30
|
+
* Mark the active step with `aria-current="step"` on `Steps.Step`.
|
|
31
|
+
*
|
|
32
|
+
* ## Usage
|
|
33
|
+
*
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <Steps>
|
|
36
|
+
* <Steps.Step>
|
|
37
|
+
* <Steps.StepMark />
|
|
38
|
+
* <Steps.StepTitle>Steg 1</Steps.StepTitle>
|
|
39
|
+
* <Steps.StepDescription>Beskrivelse</Steps.StepDescription>
|
|
40
|
+
* <Steps.StepDetails>Detaljer</Steps.StepDetails>
|
|
41
|
+
* </Steps.Step>
|
|
42
|
+
* <Steps.Step aria-current="step">
|
|
43
|
+
* <Steps.StepMark />
|
|
44
|
+
* <Steps.StepTitle>Steg 2</Steps.StepTitle>
|
|
45
|
+
* </Steps.Step>
|
|
46
|
+
* <Steps.Step>
|
|
47
|
+
* <Steps.StepMark />
|
|
48
|
+
* <Steps.StepTitle>Steg 3</Steps.StepTitle>
|
|
49
|
+
* </Steps.Step>
|
|
50
|
+
* </Steps>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare const Steps: typeof StepsParent & {
|
|
54
|
+
Step: typeof StepsStep;
|
|
55
|
+
StepDescription: typeof StepsStepDescription;
|
|
56
|
+
StepDetails: typeof StepsStepDetails;
|
|
57
|
+
StepMark: typeof StepsStepMark;
|
|
58
|
+
StepTitle: typeof StepsStepTitle;
|
|
59
|
+
};
|
|
60
|
+
export { Steps, StepsStep, StepsStepDescription, StepsStepDetails, StepsStepMark, StepsStepTitle, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { DefaultProps } from '../../types';
|
|
3
|
+
export interface StepsProps extends DefaultProps<HTMLOListElement>, HTMLAttributes<HTMLOListElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Controls the direction of the progression line connecting steps.
|
|
6
|
+
*
|
|
7
|
+
* - `"right"` (default): horizontal layout, line runs left to right.
|
|
8
|
+
* - `"down"`: vertical layout, steps listed top to bottom.
|
|
9
|
+
* - `"up"`: vertical layout, steps listed bottom to top.
|
|
10
|
+
*/
|
|
11
|
+
"data-direction"?: "right" | "up" | "down";
|
|
12
|
+
/**
|
|
13
|
+
* Adds fade effect before first or after last step.
|
|
14
|
+
*
|
|
15
|
+
* - `"both"`: Apply fade effect before first step and after last step.
|
|
16
|
+
* - `"start"`: Apply fade effect before first step.
|
|
17
|
+
* - `"end"`: Apply fade effect after last step.
|
|
18
|
+
* - `"none"`: No fade effect is applied.
|
|
19
|
+
*/
|
|
20
|
+
"data-fade"?: "start" | "end" | "both" | "none";
|
|
21
|
+
/**
|
|
22
|
+
* Set to `"complete"` to mark all steps as completed.
|
|
23
|
+
* Useful for displaying a finished process.
|
|
24
|
+
*/
|
|
25
|
+
"data-state"?: "complete";
|
|
26
|
+
}
|
|
27
|
+
export declare function Steps({ className, ...rest }: Readonly<StepsProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { DefaultProps } from '../../types';
|
|
3
|
+
export interface StepsStepProps extends DefaultProps<HTMLLIElement>, HTMLAttributes<HTMLLIElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Marks this step as the current active step.
|
|
6
|
+
* Set to `"step"` to indicate the user's current position in the sequence.
|
|
7
|
+
* Steps before the current one are shown as completed; steps after are shown as upcoming.
|
|
8
|
+
*/
|
|
9
|
+
"aria-current"?: "step" | HTMLAttributes<HTMLLIElement>["aria-current"];
|
|
10
|
+
/**
|
|
11
|
+
* Controls the completion appearance of this step's mark, overriding
|
|
12
|
+
* automatic state derived from `aria-current`.
|
|
13
|
+
*
|
|
14
|
+
* - `"complete"`: Force the mark to appear checked (filled circle with
|
|
15
|
+
* checkmark), regardless of where the active step is.
|
|
16
|
+
* - `"incomplete"`: Force the mark to appear unchecked (empty circle),
|
|
17
|
+
* even when the step would normally be auto-completed because a later
|
|
18
|
+
* step carries `aria-current="step"`.
|
|
19
|
+
*/
|
|
20
|
+
"data-state"?: "complete" | "incomplete";
|
|
21
|
+
}
|
|
22
|
+
export declare function StepsStep({ className, ...rest }: Readonly<StepsStepProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { DefaultProps } from '../../types';
|
|
3
|
+
export interface StepsStepDescriptionProps extends DefaultProps<HTMLElement>, HTMLAttributes<HTMLElement> {
|
|
4
|
+
}
|
|
5
|
+
export declare function StepsStepDescription({ className, ...rest }: Readonly<StepsStepDescriptionProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { DefaultProps } from '../../types';
|
|
3
|
+
export interface StepsStepDetailsProps extends DefaultProps<HTMLElement>, HTMLAttributes<HTMLElement> {
|
|
4
|
+
}
|
|
5
|
+
export declare function StepsStepDetails({ className, ...rest }: Readonly<StepsStepDetailsProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { DefaultProps } from '../../types';
|
|
3
|
+
export interface StepsStepMarkProps extends DefaultProps<HTMLElement>, HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Sets the color and icon of the step mark.
|
|
6
|
+
*
|
|
7
|
+
* - `"danger"` or `"warning"`: shows a close (×) icon.
|
|
8
|
+
* - `"info"`: shows an info (!) icon.
|
|
9
|
+
* - Other values: uses the color palette's default filled style.
|
|
10
|
+
*/
|
|
11
|
+
"data-color"?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders the visual indicator (dot) for a step.
|
|
15
|
+
*
|
|
16
|
+
* Two usage modes:
|
|
17
|
+
* - **With children** — pass an icon element as children; it will be rendered
|
|
18
|
+
* inside the dot at the correct size and colour.
|
|
19
|
+
* - **Without children** — leave empty and control appearance with `data-color`:
|
|
20
|
+
* - No `data-color`: inherits the auto-state (empty dot, check when passed, etc.)
|
|
21
|
+
* - `"danger"` or `"warning"`: filled dot with a close (×) icon.
|
|
22
|
+
* - `"info"`: filled dot with an info (!) icon.
|
|
23
|
+
* - Any other palette value: filled dot in that colour with no icon.
|
|
24
|
+
*/
|
|
25
|
+
export declare function StepsStepMark({ className, ...rest }: Readonly<StepsStepMarkProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { DefaultProps } from '../../types';
|
|
3
|
+
export interface StepsStepTitleProps extends DefaultProps<HTMLElement>, HTMLAttributes<HTMLElement> {
|
|
4
|
+
}
|
|
5
|
+
export declare function StepsStepTitle({ className, ...rest }: Readonly<StepsStepTitleProps>): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type CssVariablesProps = {
|
|
2
2
|
css: string;
|
|
3
3
|
} & React.HTMLAttributes<HTMLTableElement>;
|
|
4
|
-
export declare function CssVariables({ css, className, ...rest }: CssVariablesProps): import("react
|
|
4
|
+
export declare function CssVariables({ css, className, ...rest }: CssVariablesProps): import("react").JSX.Element;
|
|
5
5
|
export {};
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbeidstilsynet/design-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "React implementation of Designsystemet",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"author": "Arbeidstilsynet",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/Arbeidstilsynet/design.git"
|
|
9
10
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
14
|
"type": "module",
|
|
15
15
|
"module": "dist/index.js",
|
|
16
16
|
"types": "dist/src/index.d.ts",
|
|
@@ -20,53 +20,47 @@
|
|
|
20
20
|
"default": "./dist/index.js"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
],
|
|
26
|
-
"peerDependencies": {
|
|
27
|
-
"react": "^19.1.0",
|
|
28
|
-
"react-dom": "^19.1.0"
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
29
25
|
},
|
|
30
26
|
"dependencies": {
|
|
31
|
-
"@digdir/designsystemet-react": "1.
|
|
32
|
-
"@digdir/designsystemet-types": "1.
|
|
33
|
-
"@navikt/aksel-icons": "^8.
|
|
34
|
-
"@radix-ui/react-slot": "^1.
|
|
27
|
+
"@digdir/designsystemet-react": "1.16.1",
|
|
28
|
+
"@digdir/designsystemet-types": "1.16.1",
|
|
29
|
+
"@navikt/aksel-icons": "^8.13.0",
|
|
30
|
+
"@radix-ui/react-slot": "^1.3.0",
|
|
35
31
|
"clsx": "^2.1.1",
|
|
36
32
|
"react-dropzone": "^15.0.0"
|
|
37
33
|
},
|
|
38
34
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@storybook/addon-
|
|
41
|
-
"@storybook/
|
|
42
|
-
"@storybook/react-vite": "10.3.5",
|
|
35
|
+
"@storybook/addon-docs": "10.4.6",
|
|
36
|
+
"@storybook/addon-vitest": "10.4.6",
|
|
37
|
+
"@storybook/react-vite": "10.4.6",
|
|
43
38
|
"@testing-library/dom": "10.4.1",
|
|
44
39
|
"@testing-library/jest-dom": "6.9.1",
|
|
45
40
|
"@testing-library/react": "16.3.2",
|
|
46
41
|
"@testing-library/user-event": "14.6.1",
|
|
47
|
-
"@types/
|
|
48
|
-
"@types/
|
|
49
|
-
"@types/react": "19.2.14",
|
|
42
|
+
"@types/node": "24.13.1",
|
|
43
|
+
"@types/react": "19.2.17",
|
|
50
44
|
"@types/react-dom": "19.2.3",
|
|
51
|
-
"eslint": "9.39.4",
|
|
52
|
-
"eslint-config-prettier": "10.1.8",
|
|
53
|
-
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
54
45
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
55
|
-
"eslint-plugin-storybook": "10.
|
|
56
|
-
"happy-dom": "20.
|
|
57
|
-
"react": "19.2.
|
|
58
|
-
"react-dom": "19.2.
|
|
46
|
+
"eslint-plugin-storybook": "10.4.6",
|
|
47
|
+
"happy-dom": "20.10.6",
|
|
48
|
+
"react": "19.2.7",
|
|
49
|
+
"react-dom": "19.2.7",
|
|
59
50
|
"typescript": "6.0.3",
|
|
60
|
-
"
|
|
61
|
-
"vite": "
|
|
62
|
-
"
|
|
63
|
-
|
|
51
|
+
"vite": "8.0.16",
|
|
52
|
+
"vite-plugin-dts": "5.0.2",
|
|
53
|
+
"@arbeidstilsynet/design-css": "0.11.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"react": "^19.1.0",
|
|
57
|
+
"react-dom": "^19.1.0"
|
|
64
58
|
},
|
|
65
59
|
"scripts": {
|
|
66
60
|
"build": "vite build",
|
|
67
61
|
"test": "vitest run",
|
|
68
62
|
"typecheck": "tsc --noEmit",
|
|
69
|
-
"lint": "
|
|
63
|
+
"lint": "oxlint src",
|
|
70
64
|
"circular": "pnpm dlx madge --circular --extensions \"js,jsx,ts,tsx\" --exclude \"\" ."
|
|
71
65
|
}
|
|
72
66
|
}
|