@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
|
@@ -7,6 +7,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
7
7
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
8
8
|
import '../../helpers/Input/Input.styles.js';
|
|
9
9
|
import '../../helpers/Input/Input.tokens.js';
|
|
10
|
+
import '../InputMessage/InputMessage.js';
|
|
10
11
|
import '../../helpers/Paper/Paper.js';
|
|
11
12
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
12
13
|
import '../Typography/Link/Link.js';
|
|
@@ -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: {
|
|
@@ -8,6 +8,7 @@ import { AnimatedChevronUpDown } from '../../../helpers/Chevron/AnimatedChevronU
|
|
|
8
8
|
import '../../../helpers/HiddenInput/HiddenInput.js';
|
|
9
9
|
import '../../../helpers/Input/Input.styles.js';
|
|
10
10
|
import '../../../helpers/Input/Input.tokens.js';
|
|
11
|
+
import '../../InputMessage/InputMessage.js';
|
|
11
12
|
import '../../../helpers/Paper/Paper.js';
|
|
12
13
|
import '../../../helpers/RequiredMarker/RequiredMarker.js';
|
|
13
14
|
import { removeButtonStyling } from '../../../helpers/styling/removeButtonStyling.js';
|
|
@@ -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>>;
|
|
@@ -7,6 +7,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
7
7
|
import { HiddenInput } from '../../helpers/HiddenInput/HiddenInput.js';
|
|
8
8
|
import '../../helpers/Input/Input.styles.js';
|
|
9
9
|
import '../../helpers/Input/Input.tokens.js';
|
|
10
|
+
import '../InputMessage/InputMessage.js';
|
|
10
11
|
import '../../helpers/Paper/Paper.js';
|
|
11
12
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
12
13
|
import { joinClassNames, getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
@@ -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>>;
|
|
@@ -7,9 +7,9 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
7
7
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
8
8
|
import '../../helpers/Input/Input.styles.js';
|
|
9
9
|
import '../../helpers/Input/Input.tokens.js';
|
|
10
|
+
import { renderInputMessage } from '../../helpers/Input/Input.utils.js';
|
|
10
11
|
import '../../helpers/Paper/Paper.js';
|
|
11
12
|
import { RequiredMarker } from '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
12
|
-
import { InputMessage } from '../InputMessage/InputMessage.js';
|
|
13
13
|
import { checkboxGroupTokens } from './CheckboxGroup.tokens.js';
|
|
14
14
|
import { CheckboxGroupContext } from './CheckboxGroupContext.js';
|
|
15
15
|
import { Typography } from '../Typography/Typography/Typography.js';
|
|
@@ -68,11 +68,7 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
68
68
|
id: uniqueGroupId
|
|
69
69
|
}, {
|
|
70
70
|
children: [label, " ", showRequiredMarker && jsx(RequiredMarker, {})]
|
|
71
|
-
})), tip
|
|
72
|
-
messageType: "tip",
|
|
73
|
-
message: tip,
|
|
74
|
-
id: tipId
|
|
75
|
-
}), jsx(CheckboxGroupContext.Provider, Object.assign({
|
|
71
|
+
})), renderInputMessage(tip, tipId), jsx(CheckboxGroupContext.Provider, Object.assign({
|
|
76
72
|
value: Object.assign({}, contextProps)
|
|
77
73
|
}, {
|
|
78
74
|
children: jsx(GroupContainer, Object.assign({
|
|
@@ -83,11 +79,7 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
83
79
|
}, {
|
|
84
80
|
children: children
|
|
85
81
|
}))
|
|
86
|
-
})),
|
|
87
|
-
messageType: "error",
|
|
88
|
-
message: errorMessage,
|
|
89
|
-
id: errorMessageId
|
|
90
|
-
})]
|
|
82
|
+
})), renderInputMessage(undefined, undefined, errorMessage, errorMessageId)]
|
|
91
83
|
}));
|
|
92
84
|
};
|
|
93
85
|
|
|
@@ -2,12 +2,12 @@ import { defineProperty as _defineProperty } from '../../_virtual/_rollupPluginB
|
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { forwardRef, useId } from 'react';
|
|
5
|
-
import { InputMessage } from '../InputMessage/InputMessage.js';
|
|
6
5
|
import '../../helpers/Backdrop/Backdrop.js';
|
|
7
6
|
import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
8
7
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
9
8
|
import { StatefulInput, OuterInputContainer } from '../../helpers/Input/Input.styles.js';
|
|
10
9
|
import '../../helpers/Input/Input.tokens.js';
|
|
10
|
+
import { renderInputMessage } from '../../helpers/Input/Input.utils.js';
|
|
11
11
|
import '../../helpers/Paper/Paper.js';
|
|
12
12
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
13
13
|
import styled, { css } from 'styled-components';
|
|
@@ -85,15 +85,7 @@ var Datepicker = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
85
85
|
showRequiredStyling: showRequiredStyling
|
|
86
86
|
}, {
|
|
87
87
|
children: label
|
|
88
|
-
})), jsx(StyledInput, Object.assign({}, inputProps)),
|
|
89
|
-
message: errorMessage,
|
|
90
|
-
id: errorMessageId,
|
|
91
|
-
messageType: "error"
|
|
92
|
-
}), tip && !hasErrorMessage && jsx(InputMessage, {
|
|
93
|
-
message: tip,
|
|
94
|
-
id: tipId,
|
|
95
|
-
messageType: "tip"
|
|
96
|
-
})]
|
|
88
|
+
})), jsx(StyledInput, Object.assign({}, inputProps)), renderInputMessage(tip, tipId, errorMessage, errorMessageId)]
|
|
97
89
|
}));
|
|
98
90
|
});
|
|
99
91
|
|
|
@@ -10,6 +10,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
10
10
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
11
11
|
import '../../helpers/Input/Input.styles.js';
|
|
12
12
|
import '../../helpers/Input/Input.tokens.js';
|
|
13
|
+
import '../InputMessage/InputMessage.js';
|
|
13
14
|
import { Paper } from '../../helpers/Paper/Paper.js';
|
|
14
15
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
15
16
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
@@ -12,6 +12,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
12
12
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
13
13
|
import '../../helpers/Input/Input.styles.js';
|
|
14
14
|
import '../../helpers/Input/Input.tokens.js';
|
|
15
|
+
import '../InputMessage/InputMessage.js';
|
|
15
16
|
import '../../helpers/Paper/Paper.js';
|
|
16
17
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
17
18
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
@@ -8,6 +8,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
8
8
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
9
9
|
import '../../helpers/Input/Input.styles.js';
|
|
10
10
|
import '../../helpers/Input/Input.tokens.js';
|
|
11
|
+
import '../InputMessage/InputMessage.js';
|
|
11
12
|
import '../../helpers/Paper/Paper.js';
|
|
12
13
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
13
14
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
@@ -12,6 +12,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
12
12
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
13
13
|
import '../../helpers/Input/Input.styles.js';
|
|
14
14
|
import '../../helpers/Input/Input.tokens.js';
|
|
15
|
+
import '../InputMessage/InputMessage.js';
|
|
15
16
|
import '../../helpers/Paper/Paper.js';
|
|
16
17
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
17
18
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
@@ -20,6 +20,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
20
20
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
21
21
|
import '../../helpers/Input/Input.styles.js';
|
|
22
22
|
import '../../helpers/Input/Input.tokens.js';
|
|
23
|
+
import '../InputMessage/InputMessage.js';
|
|
23
24
|
import '../../helpers/Paper/Paper.js';
|
|
24
25
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
25
26
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
@@ -10,17 +10,17 @@ var element = {
|
|
|
10
10
|
color: colors.DdsColorNeutralsGray9,
|
|
11
11
|
textDecoration: 'none',
|
|
12
12
|
backgroundColor: colors.DdsColorNeutralsWhite,
|
|
13
|
-
padding: "".concat(spacing.SizesDdsSpacingLocalX075, " ").concat(spacing.
|
|
13
|
+
padding: "".concat(spacing.SizesDdsSpacingLocalX075, " ").concat(spacing.SizesDdsSpacingLocalX1),
|
|
14
14
|
gap: spacing.SizesDdsSpacingLocalX025,
|
|
15
15
|
font: fontPackages.body_sans_01.base
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
var link = {
|
|
19
19
|
hover: {
|
|
20
|
-
|
|
20
|
+
backgroundColor: colors.DdsColorInteractiveLightest
|
|
21
21
|
},
|
|
22
22
|
active: {
|
|
23
|
-
|
|
23
|
+
backgroundColor: colors.DdsColorInteractiveLightest
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
var container = {
|
|
@@ -25,7 +25,7 @@ var Span = styled.span.withConfig({
|
|
|
25
25
|
var Link = styled.a.withConfig({
|
|
26
26
|
displayName: "OverflowMenuItem__Link",
|
|
27
27
|
componentId: "sc-1ka2asi-1"
|
|
28
|
-
})(["user-select:text;border:none;cursor:pointer;outline:inherit;width:100%;", " @media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}&:hover{color:", ";}&:active{color:", ";}&:focus-visible,&.focus-visible{", "}"], elementBaseCSS, link.hover.
|
|
28
|
+
})(["user-select:text;border:none;cursor:pointer;outline:inherit;width:100%;", " @media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}&:hover{background-color:", ";}&:active{background-color:", ";}&:focus-visible,&.focus-visible{", "}"], elementBaseCSS, link.hover.backgroundColor, link.active.backgroundColor, focusVisibleLink);
|
|
29
29
|
|
|
30
30
|
var isAnchorProps = function isAnchorProps(props) {
|
|
31
31
|
return props.href !== undefined;
|
|
@@ -9,6 +9,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
9
9
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
10
10
|
import '../../helpers/Input/Input.styles.js';
|
|
11
11
|
import '../../helpers/Input/Input.tokens.js';
|
|
12
|
+
import '../InputMessage/InputMessage.js';
|
|
12
13
|
import '../../helpers/Paper/Paper.js';
|
|
13
14
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
14
15
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
@@ -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
|
} & {
|
|
@@ -24,13 +24,13 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
24
24
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
25
25
|
import '../../helpers/Input/Input.styles.js';
|
|
26
26
|
import '../../helpers/Input/Input.tokens.js';
|
|
27
|
+
import '../InputMessage/InputMessage.js';
|
|
27
28
|
import { Paper } from '../../helpers/Paper/Paper.js';
|
|
28
29
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
29
30
|
import '../Typography/Link/Link.js';
|
|
30
31
|
import { popoverTokens } from './Popover.tokens.js';
|
|
31
32
|
import '../../icons/utils/StyledSvg.js';
|
|
32
33
|
import { CloseIcon } from '../../icons/tsx/close.js';
|
|
33
|
-
import { createPortal } from 'react-dom';
|
|
34
34
|
|
|
35
35
|
var Spacing = ddsBaseTokens.spacing;
|
|
36
36
|
var wrapper = popoverTokens.wrapper,
|
|
@@ -77,15 +77,13 @@ var Popover = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
77
77
|
children = props.children,
|
|
78
78
|
_props$placement = props.placement,
|
|
79
79
|
placement = _props$placement === void 0 ? 'bottom' : _props$placement,
|
|
80
|
-
_props$parentElement = props.parentElement,
|
|
81
|
-
parentElement = _props$parentElement === void 0 ? document.body : _props$parentElement,
|
|
82
80
|
_props$offset = props.offset,
|
|
83
81
|
offset = _props$offset === void 0 ? Spacing.SizesDdsSpacingLocalX05NumberPx : _props$offset,
|
|
84
82
|
id = props.id,
|
|
85
83
|
className = props.className,
|
|
86
84
|
_props$htmlProps = props.htmlProps,
|
|
87
85
|
htmlProps = _props$htmlProps === void 0 ? {} : _props$htmlProps,
|
|
88
|
-
rest = __rest(props, ["title", "isOpen", "withCloseButton", "onBlur", "onCloseButtonClick", "onClose", "anchorElement", "children", "placement", "
|
|
86
|
+
rest = __rest(props, ["title", "isOpen", "withCloseButton", "onBlur", "onCloseButtonClick", "onClose", "anchorElement", "children", "placement", "offset", "id", "className", "htmlProps"]);
|
|
89
87
|
|
|
90
88
|
var popoverRef = useReturnFocusOnBlur(isOpen, function () {
|
|
91
89
|
onClose && onClose();
|
|
@@ -118,7 +116,7 @@ var Popover = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
118
116
|
style: Object.assign(Object.assign({}, htmlProps.style), styles.floating),
|
|
119
117
|
role: 'dialog'
|
|
120
118
|
});
|
|
121
|
-
return isOpen || hasTransitionedIn ?
|
|
119
|
+
return isOpen || hasTransitionedIn ? jsxs(Wrapper, Object.assign({}, wrapperProps, {
|
|
122
120
|
elevation: 3,
|
|
123
121
|
border: "light"
|
|
124
122
|
}, {
|
|
@@ -141,7 +139,7 @@ var Popover = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
141
139
|
onClick: onCloseButtonClick,
|
|
142
140
|
"aria-label": "Lukk"
|
|
143
141
|
})]
|
|
144
|
-
}))
|
|
142
|
+
})) : null;
|
|
145
143
|
});
|
|
146
144
|
|
|
147
145
|
export { Popover };
|
|
@@ -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
|
} & {
|
|
@@ -7,6 +7,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
7
7
|
import { HiddenInput } from '../../helpers/HiddenInput/HiddenInput.js';
|
|
8
8
|
import '../../helpers/Input/Input.styles.js';
|
|
9
9
|
import '../../helpers/Input/Input.tokens.js';
|
|
10
|
+
import '../InputMessage/InputMessage.js';
|
|
10
11
|
import '../../helpers/Paper/Paper.js';
|
|
11
12
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
12
13
|
import { getBaseHTMLProps, joinClassNames } from '../../types/BaseComponentProps.js';
|
|
@@ -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;
|
|
@@ -8,9 +8,9 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
8
8
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
9
9
|
import '../../helpers/Input/Input.styles.js';
|
|
10
10
|
import '../../helpers/Input/Input.tokens.js';
|
|
11
|
+
import { renderInputMessage } from '../../helpers/Input/Input.utils.js';
|
|
11
12
|
import '../../helpers/Paper/Paper.js';
|
|
12
13
|
import { RequiredMarker } from '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
13
|
-
import { InputMessage } from '../InputMessage/InputMessage.js';
|
|
14
14
|
import { radioButtonGroupTokens } from './RadioButtonGroup.tokens.js';
|
|
15
15
|
import { RadioButtonGroupContext } from './RadioButtonGroupContext.js';
|
|
16
16
|
import { Typography } from '../Typography/Typography/Typography.js';
|
|
@@ -66,7 +66,6 @@ var RadioButtonGroupInner = function RadioButtonGroupInner(props, ref) {
|
|
|
66
66
|
return onChange && onChange(e, e.target.value);
|
|
67
67
|
});
|
|
68
68
|
var hasErrorMessage = !!errorMessage;
|
|
69
|
-
var hasTip = !!tip;
|
|
70
69
|
var showRequiredMarker = required || ariaRequired;
|
|
71
70
|
var tipId = tip && "".concat(uniqueGroupId, "-tip");
|
|
72
71
|
var errorMessageId = errorMessage && "".concat(uniqueGroupId, "-errorMessage");
|
|
@@ -91,11 +90,7 @@ var RadioButtonGroupInner = function RadioButtonGroupInner(props, ref) {
|
|
|
91
90
|
id: uniqueGroupId
|
|
92
91
|
}, {
|
|
93
92
|
children: [label, " ", showRequiredMarker && jsx(RequiredMarker, {})]
|
|
94
|
-
})),
|
|
95
|
-
message: tip,
|
|
96
|
-
messageType: "tip",
|
|
97
|
-
id: tipId
|
|
98
|
-
}), jsx(RadioButtonGroupContext.Provider, Object.assign({
|
|
93
|
+
})), renderInputMessage(tip, tipId), jsx(RadioButtonGroupContext.Provider, Object.assign({
|
|
99
94
|
value: Object.assign({}, contextProps)
|
|
100
95
|
}, {
|
|
101
96
|
children: jsx(GroupContainer, Object.assign({
|
|
@@ -107,11 +102,7 @@ var RadioButtonGroupInner = function RadioButtonGroupInner(props, ref) {
|
|
|
107
102
|
}, {
|
|
108
103
|
children: children
|
|
109
104
|
}))
|
|
110
|
-
})),
|
|
111
|
-
message: errorMessage,
|
|
112
|
-
messageType: "error",
|
|
113
|
-
id: errorMessageId
|
|
114
|
-
})]
|
|
105
|
+
})), renderInputMessage(undefined, undefined, errorMessage, errorMessageId)]
|
|
115
106
|
}));
|
|
116
107
|
};
|
|
117
108
|
|
|
@@ -9,9 +9,9 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
9
9
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
10
10
|
import { Input as Input$1 } from '../../helpers/Input/Input.styles.js';
|
|
11
11
|
import '../../helpers/Input/Input.tokens.js';
|
|
12
|
+
import { renderInputMessage } from '../../helpers/Input/Input.utils.js';
|
|
12
13
|
import '../../helpers/Paper/Paper.js';
|
|
13
14
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
14
|
-
import { InputMessage } from '../InputMessage/InputMessage.js';
|
|
15
15
|
import { spaceSeparatedIdListGenerator, derivativeIdGenerator } from '../../utils/idGenerator.js';
|
|
16
16
|
import '../../utils/color.js';
|
|
17
17
|
import { Icon } from '../Icon/Icon.js';
|
|
@@ -81,7 +81,6 @@ var Search = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
81
81
|
var generatedId = useId();
|
|
82
82
|
var uniqueId = id !== null && id !== void 0 ? id : "".concat(generatedId, "-searchInput");
|
|
83
83
|
var hasLabel = !!label;
|
|
84
|
-
var hasTip = !!tip;
|
|
85
84
|
var tipId = derivativeIdGenerator(uniqueId, 'tip', tip);
|
|
86
85
|
var containerProps = {
|
|
87
86
|
className: className,
|
|
@@ -120,11 +119,7 @@ var Search = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
120
119
|
label: buttonLabel || 'Søk',
|
|
121
120
|
onClick: onClick
|
|
122
121
|
}, otherButtonProps))]
|
|
123
|
-
})),
|
|
124
|
-
id: tipId,
|
|
125
|
-
messageType: "tip",
|
|
126
|
-
message: tip
|
|
127
|
-
})]
|
|
122
|
+
})), renderInputMessage(tip, tipId)]
|
|
128
123
|
})]
|
|
129
124
|
});
|
|
130
125
|
});
|
|
@@ -9,12 +9,11 @@ import { CloseSmallIcon } from '../../icons/tsx/closeSmall.js';
|
|
|
9
9
|
import { spaceSeparatedIdListGenerator, derivativeIdGenerator } from '../../utils/idGenerator.js';
|
|
10
10
|
import '../../utils/color.js';
|
|
11
11
|
import { Icon } from '../Icon/Icon.js';
|
|
12
|
-
import { InputMessage } from '../InputMessage/InputMessage.js';
|
|
13
12
|
import { prefix, getCustomStyles, Container, InnerSingleValue, StyledIcon } from './Select.styles.js';
|
|
14
13
|
import '../Typography/Typography/Typography.js';
|
|
15
14
|
import { Label } from '../Typography/Label/Label.js';
|
|
16
15
|
import '../Typography/Link/Link.js';
|
|
17
|
-
import { getFormInputIconSize } from '../../helpers/Input/Input.utils.js';
|
|
16
|
+
import { renderInputMessage, getFormInputIconSize } from '../../helpers/Input/Input.utils.js';
|
|
18
17
|
|
|
19
18
|
var Option = components.Option,
|
|
20
19
|
NoOptionsMessage = components.NoOptionsMessage,
|
|
@@ -224,15 +223,7 @@ var SelectInner = function SelectInner(props, ref) {
|
|
|
224
223
|
children: label
|
|
225
224
|
})), jsx(ReactSelect, Object.assign({}, reactSelectProps, {
|
|
226
225
|
ref: ref
|
|
227
|
-
})),
|
|
228
|
-
messageType: "error",
|
|
229
|
-
id: errorMessageId,
|
|
230
|
-
message: errorMessage
|
|
231
|
-
}), tip && !errorMessage && jsx(InputMessage, {
|
|
232
|
-
messageType: "tip",
|
|
233
|
-
id: tipId,
|
|
234
|
-
message: tip
|
|
235
|
-
})]
|
|
226
|
+
})), renderInputMessage(tip, tipId, errorMessage, errorMessageId)]
|
|
236
227
|
}));
|
|
237
228
|
};
|
|
238
229
|
|
|
@@ -9,6 +9,7 @@ import '../../helpers/Chevron/AnimatedChevronUpDown.styles.js';
|
|
|
9
9
|
import '../../helpers/HiddenInput/HiddenInput.js';
|
|
10
10
|
import '../../helpers/Input/Input.styles.js';
|
|
11
11
|
import '../../helpers/Input/Input.tokens.js';
|
|
12
|
+
import '../InputMessage/InputMessage.js';
|
|
12
13
|
import '../../helpers/Paper/Paper.js';
|
|
13
14
|
import '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
14
15
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
@@ -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>>;
|