@norges-domstoler/dds-components 5.2.0 → 5.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/README.md +19 -5
- package/dist/cjs/components/Breadcrumbs/Breadcrumb.tokens.d.ts +14 -5
- package/dist/cjs/components/Checkbox/Checkbox.styles.d.ts +0 -3
- package/dist/cjs/components/InternalHeader/InternalHeader.styles.d.ts +1 -1
- package/dist/cjs/components/InternalHeader/InternalHeader.tokens.d.ts +39 -27
- package/dist/cjs/components/OverflowMenu/OverflowMenu.tokens.d.ts +25 -10
- package/dist/cjs/components/RadioButton/RadioButton.styles.d.ts +0 -3
- package/dist/cjs/components/Select/Select.tokens.d.ts +0 -3
- package/dist/cjs/components/ToggleBar/ToggleBar.context.d.ts +10 -0
- package/dist/cjs/components/ToggleBar/ToggleBar.d.ts +2 -0
- package/dist/cjs/components/ToggleBar/ToggleBar.stories.d.ts +20 -0
- package/dist/cjs/components/ToggleBar/ToggleBar.tokens.d.ts +111 -0
- package/dist/cjs/components/ToggleBar/ToggleBar.types.d.ts +19 -0
- package/dist/cjs/components/ToggleBar/ToggleRadio.d.ts +19 -0
- package/dist/cjs/components/ToggleBar/ToggleRadio.styles.d.ts +11 -0
- package/dist/cjs/components/ToggleBar/index.d.ts +3 -0
- package/dist/cjs/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/cjs/helpers/HiddenInput/HiddenInput.d.ts +1 -0
- package/dist/cjs/helpers/HiddenInput/index.d.ts +1 -0
- package/dist/cjs/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/styling/hideInput.d.ts +2 -2
- package/dist/cjs/helpers/styling/index.d.ts +1 -0
- package/dist/cjs/helpers/styling/selection.d.ts +4 -0
- package/dist/cjs/icons/tsx/closeSmall.d.ts +2 -0
- package/dist/cjs/icons/tsx/index.d.ts +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1400 -1229
- package/dist/components/Breadcrumbs/Breadcrumb.tokens.d.ts +14 -5
- package/dist/components/Breadcrumbs/Breadcrumb.tokens.js +11 -12
- package/dist/components/Breadcrumbs/Breadcrumbs.js +10 -14
- package/dist/components/Card/CardAccordion/CardAccordion.js +3 -8
- package/dist/components/Checkbox/Checkbox.js +7 -9
- package/dist/components/Checkbox/Checkbox.styles.d.ts +0 -3
- package/dist/components/Checkbox/Checkbox.styles.js +15 -26
- package/dist/components/Checkbox/CheckboxGroup.js +3 -7
- package/dist/components/Datepicker/Datepicker.js +3 -7
- package/dist/components/Drawer/Drawer.js +3 -7
- package/dist/components/Drawer/DrawerGroup.js +7 -12
- package/dist/components/InternalHeader/InternalHeader.js +2 -2
- package/dist/components/InternalHeader/InternalHeader.styles.d.ts +1 -1
- package/dist/components/InternalHeader/InternalHeader.styles.js +17 -11
- package/dist/components/InternalHeader/InternalHeader.tokens.d.ts +39 -27
- package/dist/components/InternalHeader/InternalHeader.tokens.js +48 -80
- package/dist/components/InternalHeader/NavigationItem.js +4 -2
- package/dist/components/Modal/Modal.js +3 -9
- package/dist/components/OverflowMenu/OverflowMenu.js +5 -3
- package/dist/components/OverflowMenu/OverflowMenu.tokens.d.ts +25 -10
- package/dist/components/OverflowMenu/OverflowMenu.tokens.js +33 -45
- package/dist/components/OverflowMenu/OverflowMenuGroup.js +3 -7
- package/dist/components/OverflowMenu/OverflowMenuItem.js +7 -3
- package/dist/components/Pagination/Pagination.js +3 -3
- package/dist/components/Popover/PopoverGroup.js +3 -7
- package/dist/components/RadioButton/RadioButton.js +8 -11
- package/dist/components/RadioButton/RadioButton.styles.d.ts +0 -3
- package/dist/components/RadioButton/RadioButton.styles.js +8 -19
- package/dist/components/RadioButton/RadioButtonGroup.js +5 -8
- package/dist/components/Search/Search.js +3 -7
- package/dist/components/Select/Select.js +41 -10
- package/dist/components/Select/Select.styles.js +4 -1
- package/dist/components/Select/Select.tokens.d.ts +0 -3
- package/dist/components/Select/Select.tokens.js +6 -18
- package/dist/components/Spinner/Spinner.js +3 -8
- package/dist/components/Table/SortCell.js +1 -1
- package/dist/components/Tabs/TabList.js +2 -5
- package/dist/components/Tabs/Tabs.js +11 -13
- package/dist/components/TextInput/CharCounter.js +3 -7
- package/dist/components/TextInput/TextInput.js +3 -6
- package/dist/components/ToggleBar/ToggleBar.context.d.ts +10 -0
- package/dist/components/ToggleBar/ToggleBar.context.js +10 -0
- package/dist/components/ToggleBar/ToggleBar.d.ts +2 -0
- package/dist/components/ToggleBar/ToggleBar.js +77 -0
- package/dist/components/ToggleBar/ToggleBar.stories.d.ts +20 -0
- package/dist/components/ToggleBar/ToggleBar.tokens.d.ts +111 -0
- package/dist/components/ToggleBar/ToggleBar.tokens.js +100 -0
- package/dist/components/ToggleBar/ToggleBar.types.d.ts +19 -0
- package/dist/components/ToggleBar/ToggleRadio.d.ts +19 -0
- package/dist/components/ToggleBar/ToggleRadio.js +80 -0
- package/dist/components/ToggleBar/ToggleRadio.styles.d.ts +11 -0
- package/dist/components/ToggleBar/ToggleRadio.styles.js +21 -0
- package/dist/components/ToggleBar/index.d.ts +3 -0
- package/dist/components/ToggleButton/ToggleButton.js +8 -16
- package/dist/components/ToggleButton/ToggleButtonGroup.js +3 -7
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +10 -14
- package/dist/helpers/HiddenInput/HiddenInput.d.ts +1 -0
- package/dist/helpers/HiddenInput/HiddenInput.js +8 -0
- package/dist/helpers/HiddenInput/index.d.ts +1 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/styling/hideInput.d.ts +2 -2
- package/dist/helpers/styling/index.d.ts +1 -0
- package/dist/helpers/styling/selection.d.ts +4 -0
- package/dist/helpers/styling/selection.js +9 -0
- package/dist/icons/tsx/closeSmall.d.ts +2 -0
- package/dist/icons/tsx/closeSmall.js +25 -0
- package/dist/icons/tsx/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/package.json +2 -2
- package/dist/helpers/styling/hideInput.js +0 -9
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@norges-domstoler/dds-components)
|
|
4
4
|
|
|
5
|
-
React UI komponenter til bruk i
|
|
5
|
+
React UI komponenter til bruk i domstolenes tjenester.
|
|
6
6
|
|
|
7
|
-
Sjekk ut [
|
|
7
|
+
Sjekk ut [Elsa - domstolenes designsystem](https://design.domstol.no/) og [ Elsa Storybook](https://domstolene.github.io/designsystem) for mer dokumentasjon og demoer.
|
|
8
8
|
|
|
9
9
|
## 📦 Installasjon
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ npm install @norges-domstoler/dds-components
|
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
18
|
import * as React from 'react';
|
|
19
|
-
import {
|
|
19
|
+
import { createRoot } from 'react-dom/client';
|
|
20
20
|
import { Button, TextInput } from '@norges-domstoler/dds-components';
|
|
21
21
|
|
|
22
22
|
const App = () => (
|
|
@@ -27,7 +27,9 @@ const App = () => (
|
|
|
27
27
|
</>
|
|
28
28
|
);
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
const root = createRoot(document.getElementById('root'));
|
|
31
|
+
|
|
32
|
+
root.render(<App />);
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
## 📃 Komponenter
|
|
@@ -40,24 +42,36 @@ Tilgjengelige komponenter:
|
|
|
40
42
|
- Button
|
|
41
43
|
- Card (inkludert CardAccordion)
|
|
42
44
|
- Checkbox
|
|
45
|
+
- Chip
|
|
43
46
|
- Datepicker
|
|
44
47
|
- DescriptionList
|
|
45
48
|
- Divider
|
|
49
|
+
- Drawer
|
|
46
50
|
- GlobalMessage
|
|
47
|
-
-
|
|
51
|
+
- Icon
|
|
52
|
+
- InputMessage
|
|
48
53
|
- InternaHeader
|
|
49
54
|
- List
|
|
50
55
|
- LocalMessage
|
|
56
|
+
- Modal
|
|
57
|
+
- OverflowMenu
|
|
51
58
|
- Pagination
|
|
52
59
|
- Popover
|
|
53
60
|
- RadioButton
|
|
61
|
+
- Scrollbar
|
|
54
62
|
- Search
|
|
55
63
|
- Select
|
|
56
64
|
- SkipToContent
|
|
57
65
|
- Spinner
|
|
58
66
|
- Table
|
|
67
|
+
- Tabs
|
|
68
|
+
- Tag
|
|
59
69
|
- TextInput
|
|
70
|
+
- ToggleBar
|
|
71
|
+
- ToggleButton
|
|
72
|
+
- Tooltip
|
|
60
73
|
- Typography
|
|
74
|
+
- VisuallyHidden
|
|
61
75
|
|
|
62
76
|
## ⏫ Release av ny versjon
|
|
63
77
|
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { CSSObject } from 'styled-components';
|
|
2
1
|
export declare const breadcrumbTokens: {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
list: {
|
|
3
|
+
gap: string;
|
|
4
|
+
};
|
|
5
|
+
listItem: {
|
|
6
|
+
font: {
|
|
7
|
+
lineHeight: any;
|
|
8
|
+
fontSize: string;
|
|
9
|
+
letterSpacing: any;
|
|
10
|
+
fontFamily: any;
|
|
11
|
+
fontWeight: any;
|
|
12
|
+
fontStyle: any;
|
|
13
|
+
};
|
|
14
|
+
gap: string;
|
|
5
15
|
};
|
|
6
16
|
icon: {
|
|
7
|
-
|
|
8
|
-
size: string;
|
|
17
|
+
color: string;
|
|
9
18
|
};
|
|
10
19
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { CheckboxProps } from './Checkbox.types';
|
|
2
2
|
export declare const CustomCheckbox: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
-
export declare const Input: import("styled-components").StyledComponent<"input", any, {
|
|
4
|
-
type: import("react").HTMLInputTypeAttribute;
|
|
5
|
-
}, "type">;
|
|
6
3
|
declare type ContainerProps = Pick<CheckboxProps, 'disabled' | 'readOnly' | 'error' | 'indeterminate' | 'label'>;
|
|
7
4
|
export declare const Container: import("styled-components").StyledComponent<"label", any, ContainerProps, never>;
|
|
8
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InternalHeaderProps } from './InternalHeader.types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const OuterContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
declare type BannerProps = {
|
|
4
4
|
hasContextMenu?: boolean;
|
|
5
5
|
};
|
|
@@ -1,40 +1,52 @@
|
|
|
1
|
-
import { CSSObject } from 'styled-components';
|
|
2
1
|
export declare const internalHeaderTokens: {
|
|
3
|
-
|
|
4
|
-
base:
|
|
2
|
+
navLink: {
|
|
3
|
+
base: {
|
|
4
|
+
color: string;
|
|
5
|
+
textDecoration: string;
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
padding: string;
|
|
8
|
+
font: {
|
|
9
|
+
lineHeight: any;
|
|
10
|
+
fontSize: string;
|
|
11
|
+
letterSpacing: any;
|
|
12
|
+
fontFamily: any;
|
|
13
|
+
fontWeight: any;
|
|
14
|
+
fontStyle: any;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
hover: {
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
active: {
|
|
21
|
+
color: string;
|
|
22
|
+
};
|
|
23
|
+
current: {
|
|
24
|
+
color: string;
|
|
25
|
+
backgroundColor: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
outerContainer: {
|
|
29
|
+
backgroundColor: string;
|
|
5
30
|
};
|
|
6
31
|
applicationNameWrapper: {
|
|
7
|
-
|
|
32
|
+
padding: string;
|
|
8
33
|
};
|
|
9
34
|
lovisaWrapper: {
|
|
10
|
-
|
|
35
|
+
padding: string;
|
|
36
|
+
borderRight: string;
|
|
11
37
|
};
|
|
12
38
|
banner: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
39
|
+
borderBottom: string;
|
|
40
|
+
paddingRight: string;
|
|
41
|
+
hasContextMenu: {
|
|
42
|
+
paddingRight: string;
|
|
43
|
+
};
|
|
18
44
|
};
|
|
19
45
|
navigation: {
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
navigationLink: {
|
|
23
|
-
base: CSSObject;
|
|
24
|
-
hover: {
|
|
25
|
-
base: CSSObject;
|
|
26
|
-
};
|
|
27
|
-
active: {
|
|
28
|
-
base: CSSObject;
|
|
29
|
-
};
|
|
30
|
-
focus: {
|
|
31
|
-
base: CSSObject;
|
|
32
|
-
};
|
|
33
|
-
current: {
|
|
34
|
-
base: CSSObject;
|
|
35
|
-
};
|
|
46
|
+
borderBottom: string;
|
|
36
47
|
};
|
|
37
48
|
contextGroup: {
|
|
38
|
-
|
|
49
|
+
right: string;
|
|
50
|
+
top: string;
|
|
39
51
|
};
|
|
40
52
|
};
|
|
@@ -1,22 +1,37 @@
|
|
|
1
|
-
import { CSSObject } from 'styled-components';
|
|
2
1
|
export declare const overflowMenuTokens: {
|
|
3
2
|
container: {
|
|
4
|
-
|
|
3
|
+
border: string;
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
borderRadius: string;
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
-
base:
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
element: {
|
|
8
|
+
base: {
|
|
9
|
+
color: string;
|
|
10
|
+
textDecoration: string;
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
padding: string;
|
|
13
|
+
gap: string;
|
|
14
|
+
font: {
|
|
15
|
+
lineHeight: any;
|
|
16
|
+
fontSize: string;
|
|
17
|
+
letterSpacing: any;
|
|
18
|
+
fontFamily: any;
|
|
19
|
+
fontWeight: any;
|
|
20
|
+
fontStyle: any;
|
|
21
|
+
};
|
|
10
22
|
};
|
|
23
|
+
};
|
|
24
|
+
link: {
|
|
11
25
|
hover: {
|
|
12
|
-
|
|
26
|
+
color: string;
|
|
13
27
|
};
|
|
14
|
-
|
|
15
|
-
|
|
28
|
+
active: {
|
|
29
|
+
color: string;
|
|
16
30
|
};
|
|
17
31
|
};
|
|
18
32
|
divider: {
|
|
19
|
-
|
|
33
|
+
marginRight: string;
|
|
34
|
+
marginLeft: string;
|
|
20
35
|
};
|
|
21
36
|
offset: number;
|
|
22
37
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { RadioButtonProps } from './RadioButton.types';
|
|
2
2
|
export declare const CustomRadioButton: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
-
export declare const Input: import("styled-components").StyledComponent<"input", any, {
|
|
4
|
-
type: import("react").HTMLInputTypeAttribute;
|
|
5
|
-
}, "type">;
|
|
6
3
|
declare type ContainerProps = Pick<RadioButtonProps, 'error' | 'disabled' | 'readOnly'>;
|
|
7
4
|
export declare const Container: import("styled-components").StyledComponent<"label", any, ContainerProps, never>;
|
|
8
5
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { ToggleBarSize, ToggleBarValue } from './ToggleBar.types';
|
|
3
|
+
export declare type ToggleBarContextType = {
|
|
4
|
+
size: ToggleBarSize;
|
|
5
|
+
name?: string;
|
|
6
|
+
value?: ToggleBarValue;
|
|
7
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const ToggleBarContext: import("react").Context<ToggleBarContextType>;
|
|
10
|
+
export declare const useToggleBarContext: () => ToggleBarContextType;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ToggleBarProps } from './ToggleBar.types';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: <T extends string | number = string>(props: ToggleBarProps<T>) => JSX.Element;
|
|
5
|
+
argTypes: {
|
|
6
|
+
label: {
|
|
7
|
+
control: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
export declare const Default: (args: ToggleBarProps<string>) => JSX.Element;
|
|
15
|
+
export declare const OverviewWithText: (args: ToggleBarProps<string>) => JSX.Element;
|
|
16
|
+
export declare const OverviewWithIcon: (args: ToggleBarProps<string>) => JSX.Element;
|
|
17
|
+
export declare const OverviewWithLabel: (args: ToggleBarProps<string>) => JSX.Element;
|
|
18
|
+
export declare const WithDefaultValue: (args: ToggleBarProps<string>) => JSX.Element;
|
|
19
|
+
export declare const WithLongWords: (args: ToggleBarProps<string>) => JSX.Element;
|
|
20
|
+
export declare const WithWidth: (args: ToggleBarProps<string>) => JSX.Element;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export declare const toggleBarTokens: {
|
|
2
|
+
outerContainer: {
|
|
3
|
+
gap: string;
|
|
4
|
+
};
|
|
5
|
+
content: {
|
|
6
|
+
base: {
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
};
|
|
9
|
+
active: {
|
|
10
|
+
color: string;
|
|
11
|
+
borderColor: string;
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
boxShadow: string;
|
|
14
|
+
};
|
|
15
|
+
size: {
|
|
16
|
+
tiny: {
|
|
17
|
+
justIcon: {
|
|
18
|
+
padding: string;
|
|
19
|
+
fontSize: string;
|
|
20
|
+
};
|
|
21
|
+
withText: {
|
|
22
|
+
padding: string;
|
|
23
|
+
font: {
|
|
24
|
+
lineHeight: any;
|
|
25
|
+
fontSize: string;
|
|
26
|
+
letterSpacing: any;
|
|
27
|
+
fontFamily: any;
|
|
28
|
+
fontWeight: any;
|
|
29
|
+
fontStyle: any;
|
|
30
|
+
};
|
|
31
|
+
gap: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
small: {
|
|
35
|
+
justIcon: {
|
|
36
|
+
padding: string;
|
|
37
|
+
fontSize: string;
|
|
38
|
+
};
|
|
39
|
+
withText: {
|
|
40
|
+
padding: string;
|
|
41
|
+
font: {
|
|
42
|
+
lineHeight: any;
|
|
43
|
+
fontSize: string;
|
|
44
|
+
letterSpacing: any;
|
|
45
|
+
fontFamily: any;
|
|
46
|
+
fontWeight: any;
|
|
47
|
+
fontStyle: any;
|
|
48
|
+
};
|
|
49
|
+
gap: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
medium: {
|
|
53
|
+
justIcon: {
|
|
54
|
+
padding: string;
|
|
55
|
+
fontSize: string;
|
|
56
|
+
};
|
|
57
|
+
withText: {
|
|
58
|
+
padding: string;
|
|
59
|
+
font: {
|
|
60
|
+
lineHeight: any;
|
|
61
|
+
fontSize: string;
|
|
62
|
+
letterSpacing: any;
|
|
63
|
+
fontFamily: any;
|
|
64
|
+
fontWeight: any;
|
|
65
|
+
fontStyle: any;
|
|
66
|
+
};
|
|
67
|
+
gap: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
large: {
|
|
71
|
+
justIcon: {
|
|
72
|
+
padding: string;
|
|
73
|
+
fontSize: string;
|
|
74
|
+
};
|
|
75
|
+
withText: {
|
|
76
|
+
padding: string;
|
|
77
|
+
font: {
|
|
78
|
+
lineHeight: any;
|
|
79
|
+
fontSize: string;
|
|
80
|
+
letterSpacing: any;
|
|
81
|
+
fontFamily: any;
|
|
82
|
+
fontWeight: any;
|
|
83
|
+
fontStyle: any;
|
|
84
|
+
};
|
|
85
|
+
gap: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
label: {
|
|
91
|
+
base: {
|
|
92
|
+
borderColor: string;
|
|
93
|
+
borderRight: string;
|
|
94
|
+
borderTop: string;
|
|
95
|
+
borderBottom: string;
|
|
96
|
+
};
|
|
97
|
+
hover: {
|
|
98
|
+
color: string;
|
|
99
|
+
borderColor: string;
|
|
100
|
+
};
|
|
101
|
+
firstChild: {
|
|
102
|
+
borderLeft: string;
|
|
103
|
+
borderTopLeftRadius: string;
|
|
104
|
+
borderBottomLeftRadius: string;
|
|
105
|
+
};
|
|
106
|
+
lastChild: {
|
|
107
|
+
borderTopRightRadius: string;
|
|
108
|
+
borderBottomRightRadius: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { BaseComponentPropsWithChildren } from '../../types';
|
|
3
|
+
import { Property } from 'csstype';
|
|
4
|
+
export declare type ToggleBarValue = string | number | null | undefined;
|
|
5
|
+
export declare type ToggleBarSize = 'tiny' | 'small' | 'medium' | 'large';
|
|
6
|
+
export declare type ToggleBarProps<T extends string | number> = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
7
|
+
/**Størrelse på komponenten. */
|
|
8
|
+
size?: ToggleBarSize;
|
|
9
|
+
/**Ledetekst for hele gruppen. */
|
|
10
|
+
label?: string;
|
|
11
|
+
/**Funksjonen for `onChange`-event for barna. */
|
|
12
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>, value?: T) => void;
|
|
13
|
+
/**Den valgte verdien i gruppen. Hvis satt ved innlastning blir en `<ToggleRadio />` forhåndsvalgt. */
|
|
14
|
+
value?: T;
|
|
15
|
+
/** Gir alle barna samme `name` prop.*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**Bredden til komponenten. Bredden fordeles likt mellom barna. */
|
|
18
|
+
width?: Property.Width;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { SvgIcon } from '../../icons/utils';
|
|
3
|
+
import { BaseComponentProps } from '../../types';
|
|
4
|
+
declare type PickedInputHTMLAttributes = Pick<InputHTMLAttributes<HTMLInputElement>, 'name' | 'checked' | 'value' | 'onChange' | 'aria-label' | 'aria-labelledby'>;
|
|
5
|
+
export declare type ToggleRadioProps = BaseComponentProps<HTMLInputElement, {
|
|
6
|
+
/**Ledetekst som vises i komponenten. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/**Ikonet som vises i komponenten. */
|
|
9
|
+
icon?: SvgIcon;
|
|
10
|
+
} & PickedInputHTMLAttributes, Omit<InputHTMLAttributes<HTMLInputElement>, keyof PickedInputHTMLAttributes>>;
|
|
11
|
+
export declare const ToggleRadio: import("react").ForwardRefExoticComponent<{
|
|
12
|
+
htmlProps?: Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "checked" | "value" | "onChange" | "aria-label" | "aria-labelledby"> | undefined;
|
|
13
|
+
} & Pick<Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "checked" | "value" | "onChange" | "aria-label" | "aria-labelledby">, "className" | "id"> & {
|
|
14
|
+
/**Ledetekst som vises i komponenten. */
|
|
15
|
+
label?: string | undefined;
|
|
16
|
+
/**Ikonet som vises i komponenten. */
|
|
17
|
+
icon?: SvgIcon | undefined;
|
|
18
|
+
} & PickedInputHTMLAttributes & import("react").RefAttributes<HTMLInputElement>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ToggleBarSize } from './ToggleBar.types';
|
|
2
|
+
declare type ContentProps = {
|
|
3
|
+
size: ToggleBarSize;
|
|
4
|
+
justIcon: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const Content: import("styled-components").StyledComponent<"span", any, ContentProps, never>;
|
|
7
|
+
declare type LabelProps = {
|
|
8
|
+
size: ToggleBarSize;
|
|
9
|
+
};
|
|
10
|
+
export declare const Label: import("styled-components").StyledComponent<"label", any, LabelProps, never>;
|
|
11
|
+
export {};
|
|
@@ -16,7 +16,7 @@ export declare type TooltipProps = BaseComponentProps<HTMLDivElement, {
|
|
|
16
16
|
tooltipId?: string;
|
|
17
17
|
} & PickedHTMLAttributes, Omit<HTMLAttributes<HTMLDivElement>, 'children' | keyof PickedHTMLAttributes>>;
|
|
18
18
|
export declare const Tooltip: React.ForwardRefExoticComponent<{
|
|
19
|
-
htmlProps?: Omit<React.HTMLAttributes<HTMLDivElement>, "style" | "onMouseLeave" | "onMouseOver" | "children"> | undefined;
|
|
19
|
+
htmlProps?: Omit<React.HTMLAttributes<HTMLDivElement>, "style" | "onMouseLeave" | "onMouseOver" | "children"> | undefined; /**`id` for tooltip. */
|
|
20
20
|
} & Pick<Omit<React.HTMLAttributes<HTMLDivElement>, "style" | "onMouseLeave" | "onMouseOver" | "children">, "className" | "id"> & {
|
|
21
21
|
/**Innhold i tooltip. */
|
|
22
22
|
text: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HiddenInput: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HiddenInput';
|
package/dist/cjs/index.d.ts
CHANGED