@dep-dio/dio-designsystem 0.3.0 → 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/README.md +33 -46
- package/dist/components/Alert/Alert.d.ts +8 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +18 -0
- package/dist/components/Button/Button.d.ts +12 -0
- package/dist/components/Button/ButtonClose.d.ts +8 -0
- package/dist/components/Button/ButtonLink.d.ts +10 -0
- package/dist/components/Card/Card.d.ts +20 -0
- package/dist/components/Checkbox/Checkbox.d.ts +17 -0
- package/dist/components/Checkbox/CheckboxFieldset.d.ts +10 -0
- package/dist/components/ControlGroup/ControlGroup.d.ts +7 -0
- package/dist/components/Details/Details.d.ts +18 -0
- package/dist/components/Dialog/Dialog.d.ts +30 -0
- package/dist/components/Dropdown/Dropdown.d.ts +19 -0
- package/dist/components/ErrorSummary/ErrorSummary.d.ts +27 -0
- package/dist/components/FeedbackBanner/FeedbackBanner.d.ts +9 -0
- package/dist/components/Form/Form.d.ts +6 -0
- package/dist/components/Label/Label.d.ts +9 -0
- package/dist/components/LinkList/LinkList.d.ts +11 -0
- package/dist/components/NavigationalLink/NavigationalLink.d.ts +8 -0
- package/dist/components/Pagination/Pagination.d.ts +15 -0
- package/dist/components/Radio/Radio.d.ts +9 -0
- package/dist/components/Radio/RadioFieldset.d.ts +10 -0
- package/dist/components/Select/Select.d.ts +25 -0
- package/dist/components/Spinner/Spinner.d.ts +8 -0
- package/dist/components/SvgIcon/SvgIcon.d.ts +10 -0
- package/dist/components/Switch/Switch.d.ts +9 -0
- package/dist/components/Tabs/Tabs.d.ts +13 -0
- package/dist/components/Tag/Tag.d.ts +7 -0
- package/dist/components/Textarea/Textarea.d.ts +16 -0
- package/dist/components/Textfield/Textfield.d.ts +15 -0
- package/dist/components/ValidationMessage/ValidationMessage.d.ts +3 -0
- package/dist/react.d.ts +31 -0
- package/dist/react.js +9842 -0
- package/dist/react.js.map +7 -0
- package/dist/styles/main.css +21 -2
- package/dist/theme-colors.d.ts +6 -0
- package/dist/types.d.ts +1 -1
- package/dist/web.d.ts +6 -6
- package/dist/web.js +6 -6
- package/dist/web.js.map +2 -2
- package/package.json +27 -9
- /package/dist/{carousel/Carousel.d.ts → web-components/Carousel/DioCarousel.d.ts} +0 -0
- /package/dist/{feedback-banner/FeedbackBanner.d.ts → web-components/FeedbackBanner/DioFeedbackBanner.d.ts} +0 -0
- /package/dist/{news-alert-subscribe/NewsAlertSubscribe.d.ts → web-components/NewsAlertSubscribe/DioNewsAlertSubscribe.d.ts} +0 -0
- /package/dist/{search-autocomplete/SearchAutocomplete.d.ts → web-components/SearchAutocomplete/DioSearchAutocomplete.d.ts} +0 -0
- /package/dist/{timeline/Timeline.d.ts → web-components/Timeline/DioTimeline.d.ts} +0 -0
- /package/dist/{to-top-of-page/ToTopOfPage.d.ts → web-components/ToTopOfPage/DioToTopOfPage.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -38,6 +38,14 @@ import "@dep-dio/dio-designsystem/web"
|
|
|
38
38
|
|
|
39
39
|
Registers Designsystemet web components and DIO custom elements.
|
|
40
40
|
|
|
41
|
+
### React components
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { Button } from "@dep-dio/dio-designsystem/react"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Use React components when the consuming application is built with React. For server-rendered HTML, CMS templates (for example Optimizely) and other stacks, use plain HTML markup with styles and web components instead.
|
|
48
|
+
|
|
41
49
|
### Nav icons (Aksel)
|
|
42
50
|
|
|
43
51
|
```ts
|
|
@@ -77,9 +85,7 @@ import "@dep-dio/dio-designsystem/svg-icons-register"
|
|
|
77
85
|
|
|
78
86
|
## Publishing
|
|
79
87
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
### Versioning
|
|
88
|
+
`@dep-dio/dio-designsystem` is published to [npm](https://www.npmjs.com/package/@dep-dio/dio-designsystem) as a public scoped package. Storybook (`@design/storybook`) is private and ignored by Changesets.
|
|
83
89
|
|
|
84
90
|
Versions follow [Semantic Versioning](https://semver.org/):
|
|
85
91
|
|
|
@@ -87,11 +93,11 @@ Versions follow [Semantic Versioning](https://semver.org/):
|
|
|
87
93
|
- **minor** — new components, new exports, backward-compatible features
|
|
88
94
|
- **major** — breaking API, class name, or markup changes for consumers
|
|
89
95
|
|
|
90
|
-
|
|
96
|
+
Changelog entries land in [`CHANGELOG.md`](./CHANGELOG.md) when the version is bumped.
|
|
91
97
|
|
|
92
|
-
###
|
|
98
|
+
### 1. Add a changeset (every PR that should release)
|
|
93
99
|
|
|
94
|
-
Releases use [Changesets](https://github.com/changesets/changesets).
|
|
100
|
+
Releases use [Changesets](https://github.com/changesets/changesets). On the feature branch:
|
|
95
101
|
|
|
96
102
|
```bash
|
|
97
103
|
npx changeset
|
|
@@ -99,55 +105,36 @@ npx changeset
|
|
|
99
105
|
|
|
100
106
|
1. Choose **@dep-dio/dio-designsystem**
|
|
101
107
|
2. Pick **patch**, **minor**, or **major**
|
|
102
|
-
3. Write a
|
|
103
|
-
|
|
104
|
-
This adds a markdown file under `.changeset/`. Commit it with the code change.
|
|
105
|
-
|
|
106
|
-
When changesets on `main` are ready to release:
|
|
107
|
-
|
|
108
|
-
1. **Version** — bump `package.json` and update changelogs:
|
|
108
|
+
3. Write the release note: a plain **summary** line first, then optional bullet **details**
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
npm run version-packages
|
|
112
|
-
```
|
|
110
|
+
The changelog prefixes the summary with the commit hash (`- abc1234: …`). Do not start the summary with `-`, or the first line looks mangled. Prefer:
|
|
113
111
|
|
|
114
|
-
|
|
112
|
+
```markdown
|
|
113
|
+
Typography, theme colors, SCSS utils, and new icons
|
|
115
114
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
npm run release
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
This runs `npm run build:package` then `changeset publish`. You need `npm login` or an `NPM_TOKEN` with publish access to the `@dep-dio` scope.
|
|
123
|
-
|
|
124
|
-
### Automated release (GitHub Actions)
|
|
125
|
-
|
|
126
|
-
The [Release workflow](../../.github/workflows/release.yml) uses [changesets/action](https://github.com/changesets/action). It is triggered manually (**Actions → Release → Run workflow**).
|
|
127
|
-
|
|
128
|
-
With pending changesets on `main`, the workflow either:
|
|
115
|
+
- Explicit DIO font-size overrides (small `1–4`, medium `1–5`)
|
|
116
|
+
- `./mixins` export replaced by `./scss-utils`
|
|
117
|
+
```
|
|
129
118
|
|
|
130
|
-
|
|
131
|
-
- runs `npm run release` and publishes to npm if versions were already bumped and no unpublished changesets remain
|
|
119
|
+
Edit the generated `.changeset/*.md` if the interactive prompt only captured a single line. Commit it with the code change, then merge the PR to `main`.
|
|
132
120
|
|
|
133
|
-
|
|
121
|
+
### 2. Release via GitHub Actions
|
|
134
122
|
|
|
135
|
-
|
|
136
|
-
2. Ensure GitHub Actions can create pull requests (default `GITHUB_TOKEN` is used by the action)
|
|
123
|
+
Publishing is done only through the [Release workflow](https://github.com/dss-web/dio-designsystemet/actions/workflows/release.yml) ([changesets/action](https://github.com/changesets/action)). It is **manual**: open that page → **Run workflow**.
|
|
137
124
|
|
|
138
|
-
|
|
125
|
+
Each run does **one** of these (never both):
|
|
139
126
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
| State on `main` | What the workflow does |
|
|
128
|
+
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
129
|
+
| Pending `.changeset/*.md` files | Opens or updates a **“chore: version packages”** PR (bumps version + changelog, removes consumed changesets) |
|
|
130
|
+
| No pending changesets, but a new version is unpublished | Builds and publishes that version to npm |
|
|
144
131
|
|
|
145
|
-
|
|
132
|
+
**Release steps:**
|
|
146
133
|
|
|
147
|
-
|
|
134
|
+
1. Merge feature PRs that include changeset files
|
|
135
|
+
2. Run **Release** → review and merge the version PR
|
|
136
|
+
3. Run **Release** again → publishes to npm
|
|
148
137
|
|
|
149
|
-
|
|
150
|
-
npm run build:package
|
|
151
|
-
```
|
|
138
|
+
You always need both workflow runs: version first, publish second.
|
|
152
139
|
|
|
153
|
-
|
|
140
|
+
**Repo setup (once):** add an `NPM_TOKEN` secret (npm automation token with publish rights for `@dep-dio/dio-designsystem`). The action uses the default `GITHUB_TOKEN` for the version PR.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AlertProps as DsAlertProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { SeverityColors } from "../../theme-colors";
|
|
3
|
+
export interface AlertProps extends DsAlertProps {
|
|
4
|
+
color?: SeverityColors;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Alert({ className, color, title, description, children, ...props }: AlertProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type BreadcrumbsProps as DsBreadcrumbsProps } from "@digdir/designsystemet-react";
|
|
2
|
+
export interface BreadcrumbItem {
|
|
3
|
+
href?: string;
|
|
4
|
+
label: string;
|
|
5
|
+
isCurrent?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface BreadcrumbsProps extends DsBreadcrumbsProps {
|
|
8
|
+
items?: BreadcrumbItem[];
|
|
9
|
+
}
|
|
10
|
+
export declare function Breadcrumbs({ items, className, children, "aria-label": ariaLabel, ...props }: BreadcrumbsProps): import("react").JSX.Element;
|
|
11
|
+
export declare namespace Breadcrumbs {
|
|
12
|
+
var Item: import("react").ForwardRefExoticComponent<import("@digdir/designsystemet-react").BreadcrumbsItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
13
|
+
var Link: import("react").ForwardRefExoticComponent<Omit<import("@digdir/designsystemet-react").DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "asChild" | "children"> & {
|
|
14
|
+
children: import("react").ReactNode;
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
17
|
+
var List: import("react").ForwardRefExoticComponent<import("@digdir/designsystemet-react").BreadcrumbsListProps & import("react").RefAttributes<HTMLOListElement>>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ButtonProps as DsButtonProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ThemeColor } from "../../theme-colors";
|
|
3
|
+
export interface ButtonProps extends Omit<DsButtonProps, "data-color" | "loading" | "disabled" | "aria-label"> {
|
|
4
|
+
color?: ThemeColor;
|
|
5
|
+
iconLeft?: string;
|
|
6
|
+
iconRight?: string;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
isLoading?: DsButtonProps["loading"];
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
}
|
|
12
|
+
export declare function Button({ className, color, iconLeft, iconRight, children, ariaLabel, isLoading, isDisabled, size, ...props }: ButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ButtonProps as DsButtonProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { MouseEventHandler } from "react";
|
|
3
|
+
export type ButtonCloseProps = Omit<DsButtonProps, "icon" | "children" | "aria-label"> & {
|
|
4
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
commandFor?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function ButtonClose({ className, onClick, ariaLabel, title, id, commandFor, variant, ...props }: ButtonCloseProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type LinkProps as DsLinkProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
|
3
|
+
export type ButtonLinkProps = Omit<DsLinkProps, "href" | "children" | "onClick" | "aria-label" | "asChild"> & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
iconLeft?: string;
|
|
6
|
+
iconRight?: string;
|
|
7
|
+
onClick?: ButtonHTMLAttributes<HTMLButtonElement>["onClick"];
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function ButtonLink({ className, children, iconLeft, iconRight, onClick, isDisabled, ...props }: ButtonLinkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type CardProps as DsCardProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { Color } from "../../theme-colors";
|
|
4
|
+
export type CardVariant = "default" | "tinted";
|
|
5
|
+
export type CardProps = Omit<DsCardProps, "children"> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
color?: Color;
|
|
11
|
+
variant?: CardVariant;
|
|
12
|
+
headingLevel?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
13
|
+
hasBlocks?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function Card({ title, href, description, color, variant, children, className, headingLevel, hasBlocks, ...props }: CardProps): import("react").JSX.Element;
|
|
16
|
+
export declare namespace Card {
|
|
17
|
+
var Block: import("react").ForwardRefExoticComponent<{
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
} & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CheckboxProps as DsCheckboxProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import { type ChangeEventHandler, type ReactNode } from "react";
|
|
3
|
+
export type CheckboxProps = Omit<DsCheckboxProps, "label" | "disabled" | "checked" | "required" | "defaultChecked" | "error" | "onChange"> & {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
controlClassName?: string;
|
|
7
|
+
isValid?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
isValidationVisible?: boolean;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
isChecked?: boolean;
|
|
12
|
+
isRequired?: boolean;
|
|
13
|
+
isDefaultChecked?: boolean;
|
|
14
|
+
requiredMessage?: string;
|
|
15
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
16
|
+
};
|
|
17
|
+
export declare function Checkbox({ className, controlClassName, label, description, isValid, errorMessage, isValidationVisible, isDisabled, isChecked, isRequired, isDefaultChecked, requiredMessage, onChange, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FieldsetProps as DsFieldsetProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
3
|
+
export interface CheckboxFieldsetProps extends DsFieldsetProps {
|
|
4
|
+
legend: string;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
direction?: "horizontal" | "vertical";
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare function CheckboxFieldset({ legend, description, children, direction, style, className, ...props }: CheckboxFieldsetProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface ControlGroupProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
}
|
|
7
|
+
export declare function ControlGroup({ children, className, orientation, }: ControlGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type DetailsProps as DsDetailsProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export type DetailsProps = Omit<DsDetailsProps, "children" | "open" | "onToggle" | "defaultOpen"> & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
trigger: string;
|
|
6
|
+
triggerExtraLabel?: ReactNode;
|
|
7
|
+
contentClassName?: string;
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
onToggle?: (event: Event) => void;
|
|
10
|
+
isDefaultOpen?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function Details({ children, trigger, triggerExtraLabel, contentClassName, className, isOpen, onToggle, isDefaultOpen, ...props }: DetailsProps): import("react").JSX.Element;
|
|
13
|
+
export declare namespace Details {
|
|
14
|
+
var Summary: import("react").ForwardRefExoticComponent<{
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
} & import("react").HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
|
|
17
|
+
var Content: import("react").ForwardRefExoticComponent<import("@digdir/designsystemet-react").DetailsContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type DialogProps as DsDialogProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export interface DialogProps extends Omit<DsDialogProps, "closeButton" | "open" | "modal"> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
id: string;
|
|
7
|
+
isInitialOpen?: boolean;
|
|
8
|
+
isModal?: boolean;
|
|
9
|
+
closeButtonText?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function Dialog({ children, className, placement, isModal, title, id, isInitialOpen, closeButtonText, onClose, ...props }: DialogProps): import("react").JSX.Element;
|
|
12
|
+
export declare namespace Dialog {
|
|
13
|
+
var Block: import("react").ForwardRefExoticComponent<{
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
} & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
var Trigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("@digdir/designsystemet-react").DefaultProps & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandFor" | "commandfor">, "asChild" | "command" | "commandFor" | "commandfor" | "icon" | "loading" | "type" | "variant"> & {
|
|
17
|
+
variant?: "primary" | "secondary" | "tertiary";
|
|
18
|
+
icon?: boolean;
|
|
19
|
+
loading?: boolean | import("react").ReactNode;
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
type?: import("react").ButtonHTMLAttributes<HTMLButtonElement>["type"];
|
|
22
|
+
command?: string;
|
|
23
|
+
commandfor?: string;
|
|
24
|
+
commandFor?: string;
|
|
25
|
+
} & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
var TriggerContext: {
|
|
27
|
+
(rest: import("@digdir/designsystemet-react").DialogTriggerContextProps): import("react").JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type DropdownProps as DsDropdownProps } from "@digdir/designsystemet-react";
|
|
2
|
+
export type DropdownProps = DsDropdownProps;
|
|
3
|
+
declare function DropdownRoot({ className, children, ...props }: DropdownProps): import("react").JSX.Element;
|
|
4
|
+
export declare const Dropdown: typeof DropdownRoot & {
|
|
5
|
+
TriggerContext: {
|
|
6
|
+
({ children }: import("@digdir/designsystemet-react").DropdownTriggerContextProps): import("react").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
Trigger: import("react").ForwardRefExoticComponent<import("@digdir/designsystemet-react").PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
Heading: import("react").ForwardRefExoticComponent<{
|
|
11
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
12
|
+
'data-size'?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
} & import("react").HTMLAttributes<HTMLHeadingElement> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
15
|
+
List: import("react").ForwardRefExoticComponent<import("@digdir/designsystemet-react").DropdownListProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
16
|
+
Item: import("react").ForwardRefExoticComponent<import("@digdir/designsystemet-react").DropdownItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
17
|
+
Button: import("react").ForwardRefExoticComponent<import("@digdir/designsystemet-react").DropdownButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ErrorSummaryProps as DsErrorSummaryProps } from "@digdir/designsystemet-react";
|
|
2
|
+
export interface ErrorSummaryItem {
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ErrorSummaryProps extends DsErrorSummaryProps {
|
|
7
|
+
title?: string;
|
|
8
|
+
errors?: ErrorSummaryItem[];
|
|
9
|
+
}
|
|
10
|
+
export declare function ErrorSummary({ title, errors, className, children, ...props }: ErrorSummaryProps): import("react").JSX.Element;
|
|
11
|
+
export declare namespace ErrorSummary {
|
|
12
|
+
var Heading: import("react").ForwardRefExoticComponent<{
|
|
13
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
14
|
+
'data-size'?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
} & import("react").HTMLAttributes<HTMLHeadingElement> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
17
|
+
var List: import("react").ForwardRefExoticComponent<{
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
} & import("@digdir/designsystemet-react").DefaultProps & Omit<import("react").HTMLAttributes<HTMLUListElement>, "size"> & import("react").RefAttributes<HTMLOListElement>>;
|
|
20
|
+
var Item: import("react").ForwardRefExoticComponent<{
|
|
21
|
+
asChild?: boolean;
|
|
22
|
+
} & import("react").LiHTMLAttributes<HTMLLIElement> & import("react").RefAttributes<HTMLLIElement>>;
|
|
23
|
+
var Link: import("react").ForwardRefExoticComponent<Omit<import("@digdir/designsystemet-react").DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "asChild" | "children"> & {
|
|
24
|
+
children: import("react").ReactNode;
|
|
25
|
+
asChild?: boolean;
|
|
26
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { SeverityColors } from "../../theme-colors";
|
|
3
|
+
export interface FeedbackBannerProps {
|
|
4
|
+
color?: SeverityColors;
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
closeLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function FeedbackBanner({ color, className, children, closeLabel, }: FeedbackBannerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export declare const DEFAULT_REQUIRED_MESSAGE = "M\u00E5 fylles ut";
|
|
3
|
+
export interface LabelProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
isRequired?: boolean;
|
|
5
|
+
isInvalid?: boolean;
|
|
6
|
+
requiredMessage?: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function Label({ className, children, isRequired, isInvalid, requiredMessage, ...props }: LabelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface LinkListItem {
|
|
2
|
+
href: string;
|
|
3
|
+
label: string;
|
|
4
|
+
target?: string;
|
|
5
|
+
rel?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LinkListProps {
|
|
8
|
+
links?: LinkListItem[];
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function LinkList({ links, className }: LinkListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type LinkProps as DsLinkProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export type NavigationalLinkProps = Omit<DsLinkProps, "children"> & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
iconLeft?: string;
|
|
6
|
+
iconRight?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function NavigationalLink({ children, className, iconLeft, iconRight, ...props }: NavigationalLinkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type PaginationProps as DsPaginationProps } from "@digdir/designsystemet-react";
|
|
2
|
+
export type PaginationProps = DsPaginationProps;
|
|
3
|
+
declare function PaginationRoot({ className, children, ...props }: PaginationProps): import("react").JSX.Element;
|
|
4
|
+
export declare const Pagination: typeof PaginationRoot & {
|
|
5
|
+
List: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
} & Omit<import("react").HTMLAttributes<HTMLUListElement>, "size"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
8
|
+
Item: import("react").ForwardRefExoticComponent<{
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
} & Omit<import("react").HTMLAttributes<HTMLLIElement>, "size"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
11
|
+
Button: import("react").ForwardRefExoticComponent<{
|
|
12
|
+
'aria-current'?: import("react").AriaAttributes["aria-current"];
|
|
13
|
+
} & Omit<import("@digdir/designsystemet-react").ButtonProps, "icon" | "loading"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RadioProps as DsRadioProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ChangeEventHandler } from "react";
|
|
3
|
+
export type RadioProps = Omit<DsRadioProps, "disabled" | "checked" | "required" | "defaultChecked" | "error" | "onChange"> & {
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
isChecked?: boolean;
|
|
6
|
+
isDefaultChecked?: boolean;
|
|
7
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
8
|
+
};
|
|
9
|
+
export declare function Radio({ className, isDisabled, isChecked, isDefaultChecked, onChange, ...props }: RadioProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FieldsetProps as DsFieldsetProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
3
|
+
export interface RadioFieldsetProps extends DsFieldsetProps {
|
|
4
|
+
legend: string;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
direction?: "horizontal" | "vertical";
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare function RadioFieldset({ legend, description, children, direction, style, className, ...props }: RadioFieldsetProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type SelectProps as DsSelectProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ChangeEventHandler, ReactNode } from "react";
|
|
3
|
+
export interface SelectProps extends Omit<DsSelectProps, "required" | "disabled" | "onChange"> {
|
|
4
|
+
controlClassName?: string;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
selectedValue?: string;
|
|
8
|
+
isValid?: boolean;
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
isValidationVisible?: boolean;
|
|
11
|
+
isRequired?: boolean;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
requiredMessage?: string;
|
|
14
|
+
onChange?: ChangeEventHandler<HTMLSelectElement>;
|
|
15
|
+
}
|
|
16
|
+
declare function SelectRoot({ className, controlClassName, label, description, id, isRequired, isDisabled, selectedValue, value, onChange, isValid, errorMessage, isValidationVisible, requiredMessage, children, ...props }: SelectProps): import("react").JSX.Element;
|
|
17
|
+
export declare const Select: typeof SelectRoot & {
|
|
18
|
+
Option: import("react").ForwardRefExoticComponent<{
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
} & import("react").OptionHTMLAttributes<HTMLOptionElement> & import("react").RefAttributes<HTMLOptionElement>>;
|
|
21
|
+
Optgroup: import("react").ForwardRefExoticComponent<{
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
} & import("react").OptgroupHTMLAttributes<HTMLOptGroupElement> & import("react").RefAttributes<HTMLOptGroupElement>>;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SpinnerProps as DsSpinnerProps } from "@digdir/designsystemet-react";
|
|
2
|
+
export interface SpinnerProps extends Omit<DsSpinnerProps, "data-size" | "aria-label"> {
|
|
3
|
+
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
4
|
+
textBefore?: string;
|
|
5
|
+
textAfter?: string;
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Spinner({ size, textBefore, textAfter, ariaLabel, className, ...props }: SpinnerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
export interface SvgIconProps {
|
|
3
|
+
name: string;
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare function SvgIcon({ name, width, height, className, label, style }: SvgIconProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SwitchProps as DsSwitchProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ChangeEventHandler } from "react";
|
|
3
|
+
export type SwitchProps = Omit<DsSwitchProps, "disabled" | "checked" | "required" | "defaultChecked" | "onChange"> & {
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
isChecked?: boolean;
|
|
6
|
+
isDefaultChecked?: boolean;
|
|
7
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
8
|
+
};
|
|
9
|
+
export declare function Switch({ className, isDisabled, isChecked, isDefaultChecked, onChange, ...props }: SwitchProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type TabsProps as DsTabsProps } from "@digdir/designsystemet-react";
|
|
2
|
+
export type TabsProps = DsTabsProps;
|
|
3
|
+
declare function TabsRoot({ className, children, ...props }: TabsProps): import("react").JSX.Element;
|
|
4
|
+
export declare const Tabs: typeof TabsRoot & {
|
|
5
|
+
List: import("react").ForwardRefExoticComponent<import("@digdir/designsystemet-react").TabsListProps & import("react").RefAttributes<import("@digdir/designsystemet-web").DSTabListElement>>;
|
|
6
|
+
Tab: import("react").ForwardRefExoticComponent<{
|
|
7
|
+
value: string;
|
|
8
|
+
} & Omit<import("react").HTMLAttributes<import("@digdir/designsystemet-web").DSTabElement>, "value"> & import("react").RefAttributes<import("@digdir/designsystemet-web").DSTabElement>>;
|
|
9
|
+
Panel: import("react").ForwardRefExoticComponent<{
|
|
10
|
+
value: string;
|
|
11
|
+
} & Omit<import("react").HTMLAttributes<import("@digdir/designsystemet-web").DSTabPanelElement>, "value"> & import("react").RefAttributes<import("@digdir/designsystemet-web").DSTabPanelElement>>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type TagProps as DsTagProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { Color } from "../../theme-colors";
|
|
3
|
+
interface TagProps extends DsTagProps {
|
|
4
|
+
color?: Color;
|
|
5
|
+
}
|
|
6
|
+
export declare function Tag({ className, color, children, ...props }: TagProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type TextareaProps as DsTextareaProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ChangeEventHandler, ReactNode } from "react";
|
|
3
|
+
export interface TextareaProps extends Omit<DsTextareaProps, "required" | "disabled" | "onChange"> {
|
|
4
|
+
controlClassName?: string;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
isValid?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
isValidationVisible?: boolean;
|
|
10
|
+
isRequired?: boolean;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
requiredMessage?: string;
|
|
13
|
+
value?: string;
|
|
14
|
+
onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
15
|
+
}
|
|
16
|
+
export declare function Textarea({ className, controlClassName, label, description, id, isValid, errorMessage, isValidationVisible, isRequired, isDisabled, requiredMessage, value, onChange, ...props }: TextareaProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type TextfieldProps as DsTextfieldProps } from "@digdir/designsystemet-react";
|
|
2
|
+
import type { ChangeEventHandler, ReactNode } from "react";
|
|
3
|
+
export type TextfieldProps = Omit<DsTextfieldProps, "label" | "error" | "required" | "disabled" | "onChange"> & {
|
|
4
|
+
isValid?: boolean;
|
|
5
|
+
isValidationVisible?: boolean;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
isRequired?: boolean;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
requiredMessage?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
onChange?: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
13
|
+
accept?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function Textfield({ className, isValid, isValidationVisible, errorMessage, isRequired, isDisabled, requiredMessage, label, value, onChange, ...props }: TextfieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ValidationMessageProps as DsValidationMessageProps } from "@digdir/designsystemet-react";
|
|
2
|
+
export type ValidationMessageProps = DsValidationMessageProps;
|
|
3
|
+
export declare function ValidationMessage({ className, children, ...props }: ValidationMessageProps): import("react").JSX.Element;
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { Alert, type AlertProps } from "./components/Alert/Alert";
|
|
2
|
+
export { Breadcrumbs, type BreadcrumbItem, type BreadcrumbsProps, } from "./components/Breadcrumbs/Breadcrumbs";
|
|
3
|
+
export { Button, type ButtonProps } from "./components/Button/Button";
|
|
4
|
+
export { ButtonClose, type ButtonCloseProps } from "./components/Button/ButtonClose";
|
|
5
|
+
export { ButtonLink, type ButtonLinkProps } from "./components/Button/ButtonLink";
|
|
6
|
+
export { Card, type CardProps, type CardVariant } from "./components/Card/Card";
|
|
7
|
+
export { Checkbox, type CheckboxProps } from "./components/Checkbox/Checkbox";
|
|
8
|
+
export { CheckboxFieldset, type CheckboxFieldsetProps, } from "./components/Checkbox/CheckboxFieldset";
|
|
9
|
+
export { ControlGroup, type ControlGroupProps } from "./components/ControlGroup/ControlGroup";
|
|
10
|
+
export { Details, type DetailsProps } from "./components/Details/Details";
|
|
11
|
+
export { Dialog, type DialogProps } from "./components/Dialog/Dialog";
|
|
12
|
+
export { Dropdown, type DropdownProps } from "./components/Dropdown/Dropdown";
|
|
13
|
+
export { ErrorSummary, type ErrorSummaryItem, type ErrorSummaryProps, } from "./components/ErrorSummary/ErrorSummary";
|
|
14
|
+
export { FeedbackBanner, type FeedbackBannerProps, } from "./components/FeedbackBanner/FeedbackBanner";
|
|
15
|
+
export { Form, type FormProps } from "./components/Form/Form";
|
|
16
|
+
export { DEFAULT_REQUIRED_MESSAGE, Label, type LabelProps, } from "./components/Label/Label";
|
|
17
|
+
export { LinkList, type LinkListItem, type LinkListProps } from "./components/LinkList/LinkList";
|
|
18
|
+
export { NavigationalLink, type NavigationalLinkProps, } from "./components/NavigationalLink/NavigationalLink";
|
|
19
|
+
export { Pagination, type PaginationProps } from "./components/Pagination/Pagination";
|
|
20
|
+
export { Radio, type RadioProps } from "./components/Radio/Radio";
|
|
21
|
+
export { RadioFieldset, type RadioFieldsetProps } from "./components/Radio/RadioFieldset";
|
|
22
|
+
export { Select, type SelectProps } from "./components/Select/Select";
|
|
23
|
+
export { Spinner, type SpinnerProps } from "./components/Spinner/Spinner";
|
|
24
|
+
export { SvgIcon, type SvgIconProps } from "./components/SvgIcon/SvgIcon";
|
|
25
|
+
export { Switch, type SwitchProps } from "./components/Switch/Switch";
|
|
26
|
+
export { Tabs, type TabsProps } from "./components/Tabs/Tabs";
|
|
27
|
+
export { Tag } from "./components/Tag/Tag";
|
|
28
|
+
export { Textarea, type TextareaProps } from "./components/Textarea/Textarea";
|
|
29
|
+
export { Textfield, type TextfieldProps } from "./components/Textfield/Textfield";
|
|
30
|
+
export { ValidationMessage, type ValidationMessageProps, } from "./components/ValidationMessage/ValidationMessage";
|
|
31
|
+
export { colors, severityColors, themeColors, type Color, type SeverityColors, type ThemeColor, } from "./theme-colors";
|