@norges-domstoler/dds-components 8.0.0 → 9.0.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 +1 -0
- package/dist/cjs/components/Button/Button.stories.d.ts +3 -3
- package/dist/cjs/components/Checkbox/Checkbox.d.ts +1 -10
- package/dist/cjs/components/Checkbox/Checkbox.stories.d.ts +3 -12
- package/dist/cjs/components/Checkbox/Checkbox.types.d.ts +2 -3
- package/dist/cjs/components/OverflowMenu/OverflowMenu.tokens.d.ts +2 -2
- package/dist/cjs/components/Popover/Popover.d.ts +0 -4
- package/dist/cjs/components/Popover/Popover.stories.d.ts +0 -1
- package/dist/cjs/components/RadioButton/RadioButton.stories.d.ts +3 -3
- package/dist/cjs/components/RadioButton/RadioButtonGroup.d.ts +1 -1
- package/dist/cjs/components/TextArea/TextArea.d.ts +7 -0
- package/dist/cjs/components/TextArea/TextArea.stories.d.ts +51 -0
- package/dist/cjs/components/TextArea/TextArea.tokens.d.ts +5 -0
- package/dist/cjs/components/TextArea/index.d.ts +1 -0
- package/dist/cjs/components/TextInput/TextInput.d.ts +4 -10
- package/dist/cjs/components/TextInput/TextInput.stories.d.ts +4 -17
- package/dist/cjs/components/TextInput/TextInput.styles.d.ts +2 -5
- package/dist/cjs/components/TextInput/TextInput.types.d.ts +3 -6
- package/dist/cjs/components/ToggleButton/ToggleButton.d.ts +4 -15
- package/dist/cjs/components/ToggleButton/ToggleButton.stories.d.ts +3 -3
- package/dist/cjs/components/ToggleButton/ToggleButton.types.d.ts +10 -0
- package/dist/cjs/components/ToggleButton/index.d.ts +1 -0
- package/dist/cjs/components/Tooltip/Tooltip.stories.d.ts +2 -2
- package/dist/cjs/helpers/Input/Input.styles.d.ts +2 -2
- package/dist/cjs/helpers/Input/Input.types.d.ts +8 -5
- package/dist/cjs/helpers/Input/Input.utils.d.ts +2 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +508 -472
- package/dist/cjs/types/CheckboxPickedHTMLAttributes.d.ts +2 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumb.js +1 -0
- package/dist/components/Button/Button.stories.d.ts +3 -3
- package/dist/components/Card/CardAccordion/CardAccordionHeader.js +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -10
- package/dist/components/Checkbox/Checkbox.js +1 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +3 -12
- package/dist/components/Checkbox/Checkbox.types.d.ts +2 -3
- package/dist/components/Checkbox/CheckboxGroup.js +3 -11
- package/dist/components/Datepicker/Datepicker.js +2 -10
- package/dist/components/Drawer/Drawer.js +1 -0
- package/dist/components/GlobalMessage/GlobalMessage.js +1 -0
- package/dist/components/InternalHeader/InternalHeader.js +1 -0
- package/dist/components/LocalMessage/LocalMessage.js +1 -0
- package/dist/components/Modal/Modal.js +1 -0
- package/dist/components/OverflowMenu/OverflowMenu.tokens.d.ts +2 -2
- package/dist/components/OverflowMenu/OverflowMenu.tokens.js +3 -3
- package/dist/components/OverflowMenu/OverflowMenuItem.js +1 -1
- package/dist/components/Pagination/Pagination.js +1 -0
- package/dist/components/Popover/Popover.d.ts +0 -4
- package/dist/components/Popover/Popover.js +4 -6
- package/dist/components/Popover/Popover.stories.d.ts +0 -1
- package/dist/components/RadioButton/RadioButton.js +1 -0
- package/dist/components/RadioButton/RadioButton.stories.d.ts +3 -3
- package/dist/components/RadioButton/RadioButtonGroup.d.ts +1 -1
- package/dist/components/RadioButton/RadioButtonGroup.js +3 -12
- package/dist/components/Search/Search.js +2 -7
- package/dist/components/Select/Select.js +2 -11
- package/dist/components/Tag/Tag.js +1 -0
- package/dist/components/TextArea/TextArea.d.ts +7 -0
- package/dist/components/TextArea/TextArea.js +105 -0
- package/dist/components/TextArea/TextArea.stories.d.ts +51 -0
- package/dist/components/TextArea/TextArea.tokens.d.ts +5 -0
- package/dist/components/TextArea/TextArea.tokens.js +11 -0
- package/dist/components/TextArea/index.d.ts +1 -0
- package/dist/components/TextInput/CharCounter.js +1 -0
- package/dist/components/TextInput/TextInput.d.ts +4 -10
- package/dist/components/TextInput/TextInput.js +6 -49
- package/dist/components/TextInput/TextInput.stories.d.ts +4 -17
- package/dist/components/TextInput/TextInput.styles.d.ts +2 -5
- package/dist/components/TextInput/TextInput.styles.js +6 -12
- package/dist/components/TextInput/TextInput.types.d.ts +3 -6
- package/dist/components/ToggleBar/ToggleBar.js +1 -0
- package/dist/components/ToggleBar/ToggleRadio.js +1 -0
- package/dist/components/ToggleBar/ToggleRadio.styles.js +1 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +4 -15
- package/dist/components/ToggleButton/ToggleButton.js +1 -0
- package/dist/components/ToggleButton/ToggleButton.stories.d.ts +3 -3
- package/dist/components/ToggleButton/ToggleButton.types.d.ts +10 -0
- package/dist/components/ToggleButton/ToggleButtonGroup.js +1 -0
- package/dist/components/ToggleButton/index.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +2 -2
- package/dist/components/Typography/Label/Label.js +1 -0
- package/dist/helpers/Backdrop/Backdrop.utils.js +7 -2
- package/dist/helpers/Input/Input.styles.d.ts +2 -2
- package/dist/helpers/Input/Input.types.d.ts +8 -5
- package/dist/helpers/Input/Input.utils.d.ts +2 -0
- package/dist/helpers/Input/Input.utils.js +28 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/CheckboxPickedHTMLAttributes.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ButtonProps } from '.';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "onFocus" | "onBlur" | "onClick" | "type">, "id" | "className"> & {
|
|
5
5
|
size?: import("./Button.types").ButtonSize | undefined;
|
|
6
6
|
label?: string | undefined;
|
|
7
7
|
purpose?: import("./Button.types").ButtonPurpose | undefined;
|
|
@@ -13,12 +13,12 @@ declare const _default: {
|
|
|
13
13
|
href?: string | undefined;
|
|
14
14
|
target?: string | undefined;
|
|
15
15
|
} & {
|
|
16
|
-
type?: "button" | "submit" | "reset" | undefined;
|
|
17
16
|
onFocus?: import("react").FocusEventHandler<HTMLButtonElement> | undefined;
|
|
18
17
|
onBlur?: import("react").FocusEventHandler<HTMLButtonElement> | undefined;
|
|
19
18
|
onClick?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
19
|
+
type?: "button" | "submit" | "reset" | undefined;
|
|
20
20
|
} & {
|
|
21
|
-
htmlProps?: Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "
|
|
21
|
+
htmlProps?: Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "onFocus" | "onBlur" | "onClick" | "type"> | undefined;
|
|
22
22
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
23
23
|
argTypes: {
|
|
24
24
|
label: {
|
|
@@ -4,15 +4,6 @@ export declare const Checkbox: import("react").ForwardRefExoticComponent<Pick<Om
|
|
|
4
4
|
disabled?: boolean | undefined;
|
|
5
5
|
readOnly?: boolean | undefined;
|
|
6
6
|
indeterminate?: boolean | undefined;
|
|
7
|
-
} & {
|
|
8
|
-
'aria-describedby'?: string | undefined;
|
|
9
|
-
name?: string | undefined;
|
|
10
|
-
checked?: boolean | undefined;
|
|
11
|
-
defaultChecked?: boolean | undefined;
|
|
12
|
-
value?: string | number | readonly string[] | undefined;
|
|
13
|
-
defaultValue?: string | number | readonly string[] | undefined;
|
|
14
|
-
onChange?: import("react").ChangeEventHandler<HTMLInputElement> | undefined;
|
|
15
|
-
onBlur?: import("react").FocusEventHandler<HTMLInputElement> | undefined;
|
|
16
|
-
} & {
|
|
7
|
+
} & import("../../types").CheckboxPickedHTMLAttributes & {
|
|
17
8
|
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "aria-describedby" | "name" | "checked" | "defaultChecked" | "value" | "defaultValue" | "onChange" | "onBlur"> | undefined;
|
|
18
9
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import { CheckboxProps } from '.';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "defaultValue" | "aria-describedby" | "onBlur" | "onChange" | "name" | "value" | "checked">, "id" | "className"> & {
|
|
5
5
|
label?: string | undefined;
|
|
6
6
|
error?: boolean | undefined;
|
|
7
7
|
disabled?: boolean | undefined;
|
|
8
8
|
readOnly?: boolean | undefined;
|
|
9
9
|
indeterminate?: boolean | undefined;
|
|
10
|
-
} & {
|
|
11
|
-
|
|
12
|
-
defaultChecked?: boolean | undefined;
|
|
13
|
-
defaultValue?: string | number | readonly string[] | undefined;
|
|
14
|
-
'aria-describedby'?: string | undefined;
|
|
15
|
-
onBlur?: import("react").FocusEventHandler<HTMLInputElement> | undefined;
|
|
16
|
-
onChange?: import("react").ChangeEventHandler<HTMLInputElement> | undefined;
|
|
17
|
-
value?: string | number | readonly string[] | undefined;
|
|
18
|
-
checked?: boolean | undefined;
|
|
19
|
-
} & {
|
|
20
|
-
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "name" | "defaultChecked" | "defaultValue" | "aria-describedby" | "onBlur" | "onChange" | "value" | "checked"> | undefined;
|
|
10
|
+
} & import("../../types").CheckboxPickedHTMLAttributes & {
|
|
11
|
+
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "defaultValue" | "aria-describedby" | "onBlur" | "onChange" | "name" | "value" | "checked"> | undefined;
|
|
21
12
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
22
13
|
argTypes: {
|
|
23
14
|
label: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { BaseComponentProps } from '../../types';
|
|
3
|
-
|
|
3
|
+
import { CheckboxPickedHTMLAttributes } from '../../types/CheckboxPickedHTMLAttributes';
|
|
4
4
|
export declare type CheckboxProps = BaseComponentProps<HTMLInputElement, {
|
|
5
5
|
/** Ledetekst for inputelementet. */
|
|
6
6
|
label?: string;
|
|
@@ -12,5 +12,4 @@ export declare type CheckboxProps = BaseComponentProps<HTMLInputElement, {
|
|
|
12
12
|
readOnly?: boolean;
|
|
13
13
|
/**Brukes ved nøstet struktur der alle Checkbox som hører til en gruppe kan bli valgt ved å trykke på en forelder Checkbox. Hvis enkelte <Checkbox /> blir valgt men ikke alle skal forelder <Checkbox /> få tilstanden indeterminate - verken checked eller ikke. */
|
|
14
14
|
indeterminate?: boolean;
|
|
15
|
-
} &
|
|
16
|
-
export {};
|
|
15
|
+
} & CheckboxPickedHTMLAttributes, Omit<InputHTMLAttributes<HTMLInputElement>, keyof CheckboxPickedHTMLAttributes>>;
|
|
@@ -31,8 +31,6 @@ export declare type PopoverProps = BaseComponentPropsWithChildren<HTMLDivElement
|
|
|
31
31
|
sizeProps?: PopoverSizeProps;
|
|
32
32
|
/** **OBS!** Propen settes automatisk av `<PopoverGroup />`. Funksjon kjørt ved lukking. */
|
|
33
33
|
onClose?: () => void;
|
|
34
|
-
/**Spesifiserer hvilken DOM node `<Popover />` skal ha som forelder via React portal. Brukes med f.eks `document.getElementById("id")` (skaper ikke ny DOM node). */
|
|
35
|
-
parentElement?: HTMLElement;
|
|
36
34
|
}>;
|
|
37
35
|
export declare const Popover: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDivElement>, "className" | "id"> & {
|
|
38
36
|
/**Tittel. */
|
|
@@ -55,8 +53,6 @@ export declare const Popover: import("react").ForwardRefExoticComponent<Pick<imp
|
|
|
55
53
|
sizeProps?: PopoverSizeProps | undefined;
|
|
56
54
|
/** **OBS!** Propen settes automatisk av `<PopoverGroup />`. Funksjon kjørt ved lukking. */
|
|
57
55
|
onClose?: (() => void) | undefined;
|
|
58
|
-
/**Spesifiserer hvilken DOM node `<Popover />` skal ha som forelder via React portal. Brukes med f.eks `document.getElementById("id")` (skaper ikke ny DOM node). */
|
|
59
|
-
parentElement?: HTMLElement | undefined;
|
|
60
56
|
} & {
|
|
61
57
|
children?: ReactNode;
|
|
62
58
|
} & {
|
|
@@ -13,7 +13,6 @@ declare const _default: {
|
|
|
13
13
|
onBlur?: (() => void) | undefined;
|
|
14
14
|
sizeProps?: import("./Popover").PopoverSizeProps | undefined;
|
|
15
15
|
onClose?: (() => void) | undefined;
|
|
16
|
-
parentElement?: HTMLElement | undefined;
|
|
17
16
|
} & {
|
|
18
17
|
children?: import("react").ReactNode;
|
|
19
18
|
} & {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { RadioButtonProps } from '.';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "aria-describedby" | "onChange" | "name" | "value" | "checked" | "readOnly" | "required">, "id" | "className"> & {
|
|
5
5
|
label?: string | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
error?: boolean | undefined;
|
|
8
8
|
} & {
|
|
9
|
-
name?: string | undefined;
|
|
10
9
|
'aria-describedby'?: string | undefined;
|
|
11
10
|
onChange?: import("react").ChangeEventHandler<HTMLInputElement> | undefined;
|
|
11
|
+
name?: string | undefined;
|
|
12
12
|
value?: string | number | readonly string[] | undefined;
|
|
13
13
|
checked?: boolean | undefined;
|
|
14
14
|
readOnly?: boolean | undefined;
|
|
@@ -16,7 +16,7 @@ declare const _default: {
|
|
|
16
16
|
} & {
|
|
17
17
|
children?: import("react").ReactNode;
|
|
18
18
|
} & {
|
|
19
|
-
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "
|
|
19
|
+
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "aria-describedby" | "onChange" | "name" | "value" | "checked" | "readOnly" | "required"> | undefined;
|
|
20
20
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
21
21
|
argTypes: {
|
|
22
22
|
label: {
|
|
@@ -51,7 +51,7 @@ export declare const RadioButtonGroup: <T extends string | number = string>(prop
|
|
|
51
51
|
} & {
|
|
52
52
|
children?: import("react").ReactNode;
|
|
53
53
|
} & {
|
|
54
|
-
htmlProps?: Omit<HTMLAttributes<HTMLDivElement>, "onChange"> | undefined;
|
|
54
|
+
htmlProps?: Omit<HTMLAttributes<HTMLDivElement>, "onChange"> | undefined; /**Funksjonen for onChange-event for barna. */
|
|
55
55
|
} & {
|
|
56
56
|
ref?: Ref<HTMLDivElement> | undefined;
|
|
57
57
|
}) => ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { CommonInputProps } from '../../helpers/Input';
|
|
3
|
+
export declare const StyledTextArea: import("styled-components").StyledComponent<"input", any, Pick<import("../../helpers/Input").InputProps, "disabled" | "readOnly"> & {
|
|
4
|
+
hasErrorMessage: boolean;
|
|
5
|
+
} & Pick<import("../../helpers/Input").InputProps, "componentSize">, never>;
|
|
6
|
+
export declare type TextAreaProps = CommonInputProps & TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
7
|
+
export declare const TextArea: import("react").ForwardRefExoticComponent<CommonInputProps & TextareaHTMLAttributes<HTMLTextAreaElement> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { TextAreaProps } from '.';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<import("../../helpers").CommonInputProps & import("react").TextareaHTMLAttributes<HTMLTextAreaElement> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
5
|
+
argTypes: {
|
|
6
|
+
label: {
|
|
7
|
+
control: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
tip: {
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
errorMessage: {
|
|
17
|
+
control: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
width: {
|
|
22
|
+
control: {
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
required: {
|
|
27
|
+
control: {
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
disabled: {
|
|
32
|
+
control: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readOnly: {
|
|
37
|
+
control: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
parameters: {
|
|
43
|
+
controls: {
|
|
44
|
+
exclude: string[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export default _default;
|
|
49
|
+
export declare const Overview: (args: TextAreaProps) => JSX.Element;
|
|
50
|
+
export declare const Default: (args: TextAreaProps) => JSX.Element;
|
|
51
|
+
export declare const WithLabel: (args: TextAreaProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TextArea';
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputSize } from '../../helpers';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export declare const TextInput: React.ForwardRefExoticComponent<import("../../helpers").CommonInputProps & {
|
|
4
|
+
componentSize?: InputSize | undefined;
|
|
5
|
+
} & React.InputHTMLAttributes<HTMLInputElement> & {
|
|
6
6
|
withCharacterCounter?: boolean | undefined;
|
|
7
7
|
icon?: import("../../icons/utils").SvgIcon | undefined;
|
|
8
|
-
} &
|
|
9
|
-
label?: string | undefined;
|
|
10
|
-
componentSize?: InputSize | undefined;
|
|
11
|
-
width?: Property.Width<string> | undefined;
|
|
12
|
-
tip?: string | undefined;
|
|
13
|
-
errorMessage?: string | undefined;
|
|
14
|
-
} & React.InputHTMLAttributes<HTMLInputElement> & React.InputHTMLAttributes<HTMLTextAreaElement> & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { TextInputProps } from '.';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<{
|
|
5
|
-
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<import("../../helpers").CommonInputProps & {
|
|
5
|
+
componentSize?: import("../../helpers").InputSize | undefined;
|
|
6
|
+
} & import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
6
7
|
withCharacterCounter?: boolean | undefined;
|
|
7
8
|
icon?: import("../../icons/utils").SvgIcon | undefined;
|
|
8
|
-
} &
|
|
9
|
-
label?: string | undefined;
|
|
10
|
-
componentSize?: import("../../helpers").InputSize | undefined;
|
|
11
|
-
width?: import("csstype").Property.Width<string> | undefined;
|
|
12
|
-
tip?: string | undefined;
|
|
13
|
-
errorMessage?: string | undefined;
|
|
14
|
-
} & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLTextAreaElement> & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
15
10
|
argTypes: {
|
|
16
11
|
label: {
|
|
17
12
|
control: {
|
|
@@ -33,11 +28,6 @@ declare const _default: {
|
|
|
33
28
|
type: string;
|
|
34
29
|
};
|
|
35
30
|
};
|
|
36
|
-
multiline: {
|
|
37
|
-
control: {
|
|
38
|
-
type: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
31
|
required: {
|
|
42
32
|
control: {
|
|
43
33
|
type: string;
|
|
@@ -63,9 +53,6 @@ declare const _default: {
|
|
|
63
53
|
export default _default;
|
|
64
54
|
export declare const TextInputOverview: (args: TextInputProps) => JSX.Element;
|
|
65
55
|
export declare const TextInputOverviewSizes: () => JSX.Element;
|
|
66
|
-
export declare const TextareaOverview: (args: TextInputProps) => JSX.Element;
|
|
67
56
|
export declare const Default: (args: TextInputProps) => JSX.Element;
|
|
68
57
|
export declare const WithLabel: (args: TextInputProps) => JSX.Element;
|
|
69
58
|
export declare const WithCharacterCount: (args: TextInputProps) => JSX.Element;
|
|
70
|
-
export declare const Textarea: (args: TextInputProps) => JSX.Element;
|
|
71
|
-
export declare const TextareaWithLabel: (args: TextInputProps) => JSX.Element;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { InputSize } from '../../helpers';
|
|
2
2
|
import { Icon } from '../Icon';
|
|
3
|
-
export declare const TextArea: import("styled-components").StyledComponent<"input", any, Pick<import("../../helpers").InputProps, "disabled" | "readOnly" | "componentSize"> & {
|
|
4
|
-
hasErrorMessage: boolean;
|
|
5
|
-
} & StyledInputProps, never>;
|
|
6
3
|
export declare const MessageContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
4
|
declare type StyledIconProps = {
|
|
8
5
|
size: InputSize;
|
|
@@ -11,7 +8,7 @@ export declare const StyledIcon: import("styled-components").StyledComponent<typ
|
|
|
11
8
|
declare type StyledInputProps = {
|
|
12
9
|
hasIcon?: boolean;
|
|
13
10
|
};
|
|
14
|
-
export declare const StyledInput: import("styled-components").StyledComponent<"input", any, Pick<import("../../helpers").InputProps, "disabled" | "readOnly"
|
|
11
|
+
export declare const StyledInput: import("styled-components").StyledComponent<"input", any, Pick<import("../../helpers").InputProps, "disabled" | "readOnly"> & {
|
|
15
12
|
hasErrorMessage: boolean;
|
|
16
|
-
} & StyledInputProps, never>;
|
|
13
|
+
} & Pick<import("../../helpers").InputProps, "componentSize"> & StyledInputProps, never>;
|
|
17
14
|
export {};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { InputHTMLAttributes } from 'react';
|
|
2
1
|
import { InputProps } from '../../helpers';
|
|
3
2
|
import { SvgIcon } from '../../icons/utils';
|
|
4
|
-
export declare type TextInputProps = {
|
|
5
|
-
/**
|
|
6
|
-
multiline?: boolean;
|
|
7
|
-
/** Spesifiserer om tegntelleren skal vises. */
|
|
3
|
+
export declare type TextInputProps = InputProps & {
|
|
4
|
+
/** Spesifiserer om tegntelleren skal vises ved bruk av `maxLength` attributt. */
|
|
8
5
|
withCharacterCounter?: boolean;
|
|
9
6
|
/** Ikonet som vises i komponenten. */
|
|
10
7
|
icon?: SvgIcon;
|
|
11
|
-
}
|
|
8
|
+
};
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { BaseComponentProps } from '../../types';
|
|
3
|
-
import { SvgIcon } from '../../icons/utils';
|
|
4
|
-
export declare type ToggleButtonProps = BaseComponentProps<HTMLInputElement, {
|
|
5
|
-
/**Ledetekst for inputelementet. */
|
|
6
|
-
label?: string;
|
|
7
|
-
/** Ikon. */
|
|
8
|
-
icon?: SvgIcon;
|
|
9
|
-
}, InputHTMLAttributes<HTMLInputElement>>;
|
|
10
|
-
export declare const ToggleButton: import("react").ForwardRefExoticComponent<Pick<InputHTMLAttributes<HTMLInputElement>, "className" | "id"> & {
|
|
11
|
-
/**Ledetekst for inputelementet. */
|
|
1
|
+
export declare const ToggleButton: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "name" | "defaultChecked" | "defaultValue" | "aria-describedby" | "onBlur" | "onChange" | "checked" | "value">, "className" | "id"> & {
|
|
12
2
|
label?: string | undefined;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
htmlProps?: InputHTMLAttributes<HTMLInputElement> | undefined;
|
|
3
|
+
icon?: import("../../icons/utils").SvgIcon | undefined;
|
|
4
|
+
} & import("../../types").CheckboxPickedHTMLAttributes & {
|
|
5
|
+
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "name" | "defaultChecked" | "defaultValue" | "aria-describedby" | "onBlur" | "onChange" | "checked" | "value"> | undefined;
|
|
17
6
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ToggleButtonProps } from '.';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<Pick<import("react").InputHTMLAttributes<HTMLInputElement>, "id" | "className"> & {
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "defaultValue" | "aria-describedby" | "onBlur" | "onChange" | "name" | "value" | "checked">, "id" | "className"> & {
|
|
5
5
|
label?: string | undefined;
|
|
6
6
|
icon?: import("../../icons/utils").SvgIcon | undefined;
|
|
7
|
-
} & {
|
|
8
|
-
htmlProps?: import("react").InputHTMLAttributes<HTMLInputElement> | undefined;
|
|
7
|
+
} & import("../../types").CheckboxPickedHTMLAttributes & {
|
|
8
|
+
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "defaultValue" | "aria-describedby" | "onBlur" | "onChange" | "name" | "value" | "checked"> | undefined;
|
|
9
9
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
10
|
argTypes: {
|
|
11
11
|
label: {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { SvgIcon } from '../../icons/utils';
|
|
3
|
+
import { BaseComponentProps } from '../../types';
|
|
4
|
+
import { CheckboxPickedHTMLAttributes } from '../../types/CheckboxPickedHTMLAttributes';
|
|
5
|
+
export declare type ToggleButtonProps = BaseComponentProps<HTMLInputElement, {
|
|
6
|
+
/**Ledetekst for inputelementet. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Ikon. */
|
|
9
|
+
icon?: SvgIcon;
|
|
10
|
+
} & CheckboxPickedHTMLAttributes, Omit<InputHTMLAttributes<HTMLInputElement>, keyof CheckboxPickedHTMLAttributes>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TooltipProps } from '.';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").HTMLAttributes<HTMLDivElement>, "
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").HTMLAttributes<HTMLDivElement>, "children" | "style" | "onMouseLeave" | "onMouseOver">, "id" | "className"> & {
|
|
5
5
|
text: string;
|
|
6
6
|
placement?: import("../..").Placement | undefined;
|
|
7
7
|
children: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> & import("react").RefAttributes<HTMLElement>;
|
|
@@ -12,7 +12,7 @@ declare const _default: {
|
|
|
12
12
|
onMouseLeave?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
13
13
|
onMouseOver?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
14
14
|
} & {
|
|
15
|
-
htmlProps?: Omit<import("react").HTMLAttributes<HTMLDivElement>, "
|
|
15
|
+
htmlProps?: Omit<import("react").HTMLAttributes<HTMLDivElement>, "children" | "style" | "onMouseLeave" | "onMouseOver"> | undefined;
|
|
16
16
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
17
|
argTypes: {
|
|
18
18
|
text: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Property } from 'csstype';
|
|
2
2
|
export declare const Input: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
3
|
-
export declare const StatefulInput: import("styled-components").StyledComponent<"input", any, Pick<import("./Input.types").InputProps, "disabled" | "readOnly"
|
|
3
|
+
export declare const StatefulInput: import("styled-components").StyledComponent<"input", any, Pick<import("./Input.types").InputProps, "disabled" | "readOnly"> & {
|
|
4
4
|
hasErrorMessage: boolean;
|
|
5
|
-
}, never>;
|
|
5
|
+
} & Pick<import("./Input.types").InputProps, "componentSize">, never>;
|
|
6
6
|
declare type OuterInputContainerProps = {
|
|
7
7
|
width?: Property.Width<string>;
|
|
8
8
|
};
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { Property } from 'csstype';
|
|
3
|
-
export declare type
|
|
4
|
-
export declare type InputProps = {
|
|
3
|
+
export declare type CommonInputProps = {
|
|
5
4
|
/**Ledetekst for input. */
|
|
6
5
|
label?: string;
|
|
7
|
-
/**Størrelse på inputfeltet. */
|
|
8
|
-
componentSize?: InputSize;
|
|
9
6
|
/**Bredde for inputfeltet. */
|
|
10
7
|
width?: Property.Width<string>;
|
|
11
8
|
/**Hjelpetekst. */
|
|
12
9
|
tip?: string;
|
|
13
10
|
/**Feilmelding. Setter også error state. */
|
|
14
11
|
errorMessage?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare type InputSize = 'medium' | 'small' | 'tiny';
|
|
14
|
+
export declare type InputProps = CommonInputProps & {
|
|
15
|
+
/**Størrelse på inputfeltet. */
|
|
16
|
+
componentSize?: InputSize;
|
|
15
17
|
} & InputHTMLAttributes<HTMLInputElement>;
|
|
16
|
-
export declare type
|
|
18
|
+
export declare type StyledCommonInputProps = Pick<InputProps, 'readOnly' | 'disabled'> & {
|
|
17
19
|
hasErrorMessage: boolean;
|
|
18
20
|
};
|
|
21
|
+
export declare type StyledInputProps = StyledCommonInputProps & Pick<InputProps, 'componentSize'>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { IconSize } from '../../components/Icon';
|
|
2
2
|
import { InputSize } from './Input.types';
|
|
3
3
|
export declare const getFormInputIconSize: (componentSize: InputSize) => IconSize;
|
|
4
|
+
export declare function getDefaultText(value?: string | number | readonly string[], defaultValue?: string | number | readonly string[]): string;
|
|
5
|
+
export declare const renderInputMessage: (tip?: string, tipId?: string, errorMessage?: string, errorMessageId?: string) => JSX.Element;
|
package/dist/cjs/index.d.ts
CHANGED