@equinor/eds-core-react 2.3.5 → 2.3.6-beta.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/build/index.css +186 -304
- package/build/index.min.css +1 -5
- package/dist/eds-core-react.cjs +233 -47
- package/dist/esm/components/Autocomplete/AddNewOption.js +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/esm/components/Autocomplete/AutocompleteContext.js +2 -2
- package/dist/esm/components/Autocomplete/Option.js +11 -2
- package/dist/esm/components/Autocomplete/OptionList.js +6 -4
- package/dist/esm/components/Autocomplete/SelectAllOption.js +1 -1
- package/dist/esm/components/Autocomplete/useAutocomplete.js +13 -2
- package/dist/esm/components/Banner/Banner.tokens.js +2 -10
- package/dist/esm/components/Chip/Chip.js +1 -1
- package/dist/esm/components/Chip/Chip.tokens.js +0 -2
- package/dist/esm/components/Datepicker/DatePicker.js +4 -1
- package/dist/esm/components/Datepicker/DateRangePicker.js +4 -1
- package/dist/esm/components/Datepicker/calendars/CalendarGrid.js +4 -8
- package/dist/esm/components/Datepicker/calendars/CalendarHeader.js +6 -6
- package/dist/esm/components/Datepicker/fields/DateFieldSegments.js +11 -2
- package/dist/esm/components/Datepicker/fields/DateSegment.js +4 -1
- package/dist/esm/components/Datepicker/utils/get-calendar-date.js +1 -1
- package/dist/esm/components/Datepicker/utils/getLocalizedValidationErrors.js +164 -0
- package/dist/esm/components/EdsProvider/eds.context.js +1 -1
- package/dist/esm/components/Menu/Menu.context.js +1 -1
- package/dist/esm/components/Popover/Popover.js +4 -4
- package/dist/esm/components/SideBar/SideBar.context.js +1 -1
- package/dist/esm/components/Table/DataCell/DataCell.js +1 -1
- package/dist/esm/components/Table/FooterCell/FooterCell.js +1 -1
- package/dist/esm/components/Table/HeaderCell/HeaderCell.js +1 -1
- package/dist/esm/components/Typography/Typography.js +1 -1
- package/dist/esm/index.js +64 -64
- package/dist/esm-next/components/next/Button/Button.js +4 -5
- package/dist/esm-next/components/next/Icon/Icon.js +27 -1
- package/dist/esm-next/components/next/Input/Input.js +6 -11
- package/dist/esm-next/components/next/TextField/TextField.js +8 -2
- package/dist/esm-next/index.next.js +4 -4
- package/dist/index.next.cjs +44 -19
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/types/components/Autocomplete/AutocompleteContext.d.ts +2 -2
- package/dist/types/components/Autocomplete/useAutocomplete.d.ts +3 -2
- package/dist/types/components/Datepicker/DateRangePicker.d.ts +1 -1
- package/dist/types/components/Datepicker/utils/getLocalizedValidationErrors.d.ts +9 -0
- package/dist/types/components/SideBar/SideBarButton/index.d.ts +1 -1
- package/dist/types/components/next/Icon/Icon.d.ts +0 -1
- package/dist/types/components/next/Input/Input.types.d.ts +6 -4
- package/dist/types/components/next/TextField/TextField.d.ts +1 -0
- package/package.json +44 -37
|
@@ -5,6 +5,7 @@ import { Icon } from '../Icon/Icon.js';
|
|
|
5
5
|
|
|
6
6
|
const Input = /*#__PURE__*/forwardRef(function Input({
|
|
7
7
|
invalid = false,
|
|
8
|
+
hideErrorIcon = false,
|
|
8
9
|
disabled,
|
|
9
10
|
readOnly,
|
|
10
11
|
type = 'text',
|
|
@@ -17,8 +18,8 @@ const Input = /*#__PURE__*/forwardRef(function Input({
|
|
|
17
18
|
as: Component = 'input',
|
|
18
19
|
...inputProps
|
|
19
20
|
}, ref) {
|
|
20
|
-
const tone = invalid && !disabled ? 'danger' : 'neutral';
|
|
21
|
-
const
|
|
21
|
+
const tone = invalid && !disabled && !readOnly ? 'danger' : 'neutral';
|
|
22
|
+
const displayErrorIcon = !hideErrorIcon && invalid && !disabled && !readOnly;
|
|
22
23
|
const hasStartAdornment = startText || startAdornment;
|
|
23
24
|
const hasEndAdornment = endText || endAdornment;
|
|
24
25
|
const containerClasses = ['eds-input-container', containerClassName].filter(Boolean).join(' ');
|
|
@@ -31,7 +32,7 @@ const Input = /*#__PURE__*/forwardRef(function Input({
|
|
|
31
32
|
"data-disabled": disabled || undefined,
|
|
32
33
|
"data-readonly": readOnly || undefined,
|
|
33
34
|
"data-invalid": invalid || undefined,
|
|
34
|
-
children: [
|
|
35
|
+
children: [displayErrorIcon && /*#__PURE__*/jsx("span", {
|
|
35
36
|
className: "eds-error-icon",
|
|
36
37
|
"data-font-size": "xs",
|
|
37
38
|
"data-font-family": "ui",
|
|
@@ -41,10 +42,9 @@ const Input = /*#__PURE__*/forwardRef(function Input({
|
|
|
41
42
|
})
|
|
42
43
|
}), hasStartAdornment && /*#__PURE__*/jsxs("div", {
|
|
43
44
|
className: "eds-adornment",
|
|
44
|
-
"data-
|
|
45
|
+
"data-color-appearance": "neutral",
|
|
45
46
|
children: [startText && /*#__PURE__*/jsx("span", {
|
|
46
47
|
className: "eds-adornment__text",
|
|
47
|
-
"data-color-appearance": "neutral",
|
|
48
48
|
"data-font-family": "ui",
|
|
49
49
|
"data-font-size": "xs",
|
|
50
50
|
"data-baseline": "center",
|
|
@@ -52,8 +52,6 @@ const Input = /*#__PURE__*/forwardRef(function Input({
|
|
|
52
52
|
}), startAdornment && /*#__PURE__*/jsx("span", {
|
|
53
53
|
className: "eds-adornment__adornment",
|
|
54
54
|
"data-font-size": "xs",
|
|
55
|
-
"data-font-family": "ui",
|
|
56
|
-
"data-baseline": "center",
|
|
57
55
|
children: startAdornment
|
|
58
56
|
})]
|
|
59
57
|
}), /*#__PURE__*/jsx(Component, {
|
|
@@ -70,10 +68,9 @@ const Input = /*#__PURE__*/forwardRef(function Input({
|
|
|
70
68
|
"aria-invalid": invalid || undefined
|
|
71
69
|
}), hasEndAdornment && /*#__PURE__*/jsxs("div", {
|
|
72
70
|
className: "eds-adornment",
|
|
73
|
-
"data-
|
|
71
|
+
"data-color-appearance": "neutral",
|
|
74
72
|
children: [endText && /*#__PURE__*/jsx("span", {
|
|
75
73
|
className: "eds-adornment__text",
|
|
76
|
-
"data-color-appearance": "neutral",
|
|
77
74
|
"data-font-family": "ui",
|
|
78
75
|
"data-font-size": "xs",
|
|
79
76
|
"data-baseline": "center",
|
|
@@ -81,8 +78,6 @@ const Input = /*#__PURE__*/forwardRef(function Input({
|
|
|
81
78
|
}), endAdornment && /*#__PURE__*/jsx("span", {
|
|
82
79
|
className: "eds-adornment__adornment",
|
|
83
80
|
"data-font-size": "xs",
|
|
84
|
-
"data-font-family": "ui",
|
|
85
|
-
"data-baseline": "center",
|
|
86
81
|
children: endAdornment
|
|
87
82
|
})]
|
|
88
83
|
})]
|
|
@@ -4,6 +4,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useFieldIds } from '../Field/useFieldIds.js';
|
|
5
5
|
import { Field } from '../Field/Field.js';
|
|
6
6
|
import { Tooltip } from '../../Tooltip/Tooltip.js';
|
|
7
|
+
import { Button } from '../Button/Button.js';
|
|
7
8
|
import { Icon } from '../Icon/Icon.js';
|
|
8
9
|
import { Input } from '../Input/Input.js';
|
|
9
10
|
|
|
@@ -26,6 +27,7 @@ const TextField = /*#__PURE__*/forwardRef(function TextField({
|
|
|
26
27
|
} = useFieldIds(providedId);
|
|
27
28
|
return /*#__PURE__*/jsxs(Field, {
|
|
28
29
|
disabled: disabled,
|
|
30
|
+
className: "eds-text-field",
|
|
29
31
|
children: [label && /*#__PURE__*/jsxs("div", {
|
|
30
32
|
className: "eds-text-field__header",
|
|
31
33
|
children: [/*#__PURE__*/jsx(Field.Label, {
|
|
@@ -35,8 +37,12 @@ const TextField = /*#__PURE__*/forwardRef(function TextField({
|
|
|
35
37
|
}), labelInfo && /*#__PURE__*/jsx(Tooltip, {
|
|
36
38
|
title: labelInfo,
|
|
37
39
|
placement: "top",
|
|
38
|
-
children: /*#__PURE__*/jsx(
|
|
39
|
-
|
|
40
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
41
|
+
variant: "ghost",
|
|
42
|
+
icon: true,
|
|
43
|
+
round: true,
|
|
44
|
+
size: "small",
|
|
45
|
+
tone: "neutral",
|
|
40
46
|
className: "eds-text-field__info",
|
|
41
47
|
"aria-label": "More information",
|
|
42
48
|
children: /*#__PURE__*/jsx(Icon, {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { Button } from './components/next/Button/Button.js';
|
|
2
|
-
export { Icon } from './components/next/Icon/Icon.js';
|
|
3
|
-
export { Field } from './components/next/Field/Field.js';
|
|
4
|
-
export { useFieldIds } from './components/next/Field/useFieldIds.js';
|
|
5
2
|
export { Checkbox } from './components/next/Checkbox/Checkbox.js';
|
|
3
|
+
export { Field } from './components/next/Field/Field.js';
|
|
4
|
+
export { Icon } from './components/next/Icon/Icon.js';
|
|
5
|
+
export { Input } from './components/next/Input/Input.js';
|
|
6
6
|
export { Radio } from './components/next/Radio/Radio.js';
|
|
7
7
|
export { Switch } from './components/next/Switch/Switch.js';
|
|
8
|
-
export { Input } from './components/next/Input/Input.js';
|
|
9
8
|
export { TextField } from './components/next/TextField/TextField.js';
|
|
9
|
+
export { useFieldIds } from './components/next/Field/useFieldIds.js';
|
package/dist/index.next.cjs
CHANGED
|
@@ -106,24 +106,49 @@ const Button = /*#__PURE__*/react.forwardRef(function Button({
|
|
|
106
106
|
"data-variant": variant,
|
|
107
107
|
"data-selectable-space": selectableSpace,
|
|
108
108
|
"data-space-proportions": "squished",
|
|
109
|
-
"data-font-family": "ui",
|
|
110
|
-
"data-font-size": typographySize,
|
|
111
|
-
"data-line-height": "squished",
|
|
112
109
|
"data-color-appearance": disabled ? 'neutral' : tone,
|
|
113
110
|
"data-icon-only": icon || undefined,
|
|
114
111
|
"data-round": icon && round ? true : undefined,
|
|
115
112
|
...rest,
|
|
116
|
-
children: /*#__PURE__*/jsxRuntime.jsx(TypographyNext, {
|
|
113
|
+
children: icon ? children : /*#__PURE__*/jsxRuntime.jsx(TypographyNext, {
|
|
114
|
+
as: "span",
|
|
115
|
+
className: "eds-button__label",
|
|
117
116
|
family: "ui",
|
|
118
117
|
size: typographySize,
|
|
119
|
-
baseline: "center",
|
|
120
118
|
lineHeight: "squished",
|
|
119
|
+
baseline: "center",
|
|
121
120
|
children: children
|
|
122
121
|
})
|
|
123
122
|
});
|
|
124
123
|
});
|
|
125
124
|
Button.displayName = 'Button';
|
|
126
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Icon component for EDS 2.0
|
|
128
|
+
*
|
|
129
|
+
* Features:
|
|
130
|
+
* - Automatic sizing from parent's data-font-size via --eds-typography-icon-size
|
|
131
|
+
* - Dynamic fallback sizing (1.5em) when no tokens are set
|
|
132
|
+
* - Explicit size prop for standalone usage
|
|
133
|
+
* - WCAG 2.1 AA accessible with optional title for semantic icons
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```tsx
|
|
137
|
+
* import { Icon } from '@equinor/eds-core-react/next'
|
|
138
|
+
* import { save } from '@equinor/eds-icons'
|
|
139
|
+
*
|
|
140
|
+
* // Auto-sized from parent's data-font-size
|
|
141
|
+
* <div data-font-size="md">
|
|
142
|
+
* <Icon data={warning} /> Error message
|
|
143
|
+
* </div>
|
|
144
|
+
*
|
|
145
|
+
* // Explicit size for standalone usage
|
|
146
|
+
* <Icon data={save} size="lg" />
|
|
147
|
+
*
|
|
148
|
+
* // Semantic icon with accessible name
|
|
149
|
+
* <Icon data={save} title="Save document" />
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
127
152
|
const Icon = /*#__PURE__*/react.forwardRef(function Icon({
|
|
128
153
|
data,
|
|
129
154
|
title,
|
|
@@ -142,7 +167,7 @@ const Icon = /*#__PURE__*/react.forwardRef(function Icon({
|
|
|
142
167
|
height = '24',
|
|
143
168
|
width = '24'
|
|
144
169
|
} = data;
|
|
145
|
-
const classes = ['icon', className].filter(Boolean).join(' ');
|
|
170
|
+
const classes = ['eds-icon', className].filter(Boolean).join(' ');
|
|
146
171
|
|
|
147
172
|
// Accessibility: decorative icons are hidden, semantic icons have role="img"
|
|
148
173
|
const accessibilityProps = title ? {
|
|
@@ -533,6 +558,7 @@ Switch.displayName = 'Switch';
|
|
|
533
558
|
|
|
534
559
|
const Input = /*#__PURE__*/react.forwardRef(function Input({
|
|
535
560
|
invalid = false,
|
|
561
|
+
hideErrorIcon = false,
|
|
536
562
|
disabled,
|
|
537
563
|
readOnly,
|
|
538
564
|
type = 'text',
|
|
@@ -545,8 +571,8 @@ const Input = /*#__PURE__*/react.forwardRef(function Input({
|
|
|
545
571
|
as: Component = 'input',
|
|
546
572
|
...inputProps
|
|
547
573
|
}, ref) {
|
|
548
|
-
const tone = invalid && !disabled ? 'danger' : 'neutral';
|
|
549
|
-
const
|
|
574
|
+
const tone = invalid && !disabled && !readOnly ? 'danger' : 'neutral';
|
|
575
|
+
const displayErrorIcon = !hideErrorIcon && invalid && !disabled && !readOnly;
|
|
550
576
|
const hasStartAdornment = startText || startAdornment;
|
|
551
577
|
const hasEndAdornment = endText || endAdornment;
|
|
552
578
|
const containerClasses = ['eds-input-container', containerClassName].filter(Boolean).join(' ');
|
|
@@ -559,7 +585,7 @@ const Input = /*#__PURE__*/react.forwardRef(function Input({
|
|
|
559
585
|
"data-disabled": disabled || undefined,
|
|
560
586
|
"data-readonly": readOnly || undefined,
|
|
561
587
|
"data-invalid": invalid || undefined,
|
|
562
|
-
children: [
|
|
588
|
+
children: [displayErrorIcon && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
563
589
|
className: "eds-error-icon",
|
|
564
590
|
"data-font-size": "xs",
|
|
565
591
|
"data-font-family": "ui",
|
|
@@ -569,10 +595,9 @@ const Input = /*#__PURE__*/react.forwardRef(function Input({
|
|
|
569
595
|
})
|
|
570
596
|
}), hasStartAdornment && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
571
597
|
className: "eds-adornment",
|
|
572
|
-
"data-
|
|
598
|
+
"data-color-appearance": "neutral",
|
|
573
599
|
children: [startText && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
574
600
|
className: "eds-adornment__text",
|
|
575
|
-
"data-color-appearance": "neutral",
|
|
576
601
|
"data-font-family": "ui",
|
|
577
602
|
"data-font-size": "xs",
|
|
578
603
|
"data-baseline": "center",
|
|
@@ -580,8 +605,6 @@ const Input = /*#__PURE__*/react.forwardRef(function Input({
|
|
|
580
605
|
}), startAdornment && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
581
606
|
className: "eds-adornment__adornment",
|
|
582
607
|
"data-font-size": "xs",
|
|
583
|
-
"data-font-family": "ui",
|
|
584
|
-
"data-baseline": "center",
|
|
585
608
|
children: startAdornment
|
|
586
609
|
})]
|
|
587
610
|
}), /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
@@ -598,10 +621,9 @@ const Input = /*#__PURE__*/react.forwardRef(function Input({
|
|
|
598
621
|
"aria-invalid": invalid || undefined
|
|
599
622
|
}), hasEndAdornment && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
600
623
|
className: "eds-adornment",
|
|
601
|
-
"data-
|
|
624
|
+
"data-color-appearance": "neutral",
|
|
602
625
|
children: [endText && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
603
626
|
className: "eds-adornment__text",
|
|
604
|
-
"data-color-appearance": "neutral",
|
|
605
627
|
"data-font-family": "ui",
|
|
606
628
|
"data-font-size": "xs",
|
|
607
629
|
"data-baseline": "center",
|
|
@@ -609,8 +631,6 @@ const Input = /*#__PURE__*/react.forwardRef(function Input({
|
|
|
609
631
|
}), endAdornment && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
610
632
|
className: "eds-adornment__adornment",
|
|
611
633
|
"data-font-size": "xs",
|
|
612
|
-
"data-font-family": "ui",
|
|
613
|
-
"data-baseline": "center",
|
|
614
634
|
children: endAdornment
|
|
615
635
|
})]
|
|
616
636
|
})]
|
|
@@ -836,6 +856,7 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField({
|
|
|
836
856
|
} = useFieldIds(providedId);
|
|
837
857
|
return /*#__PURE__*/jsxRuntime.jsxs(Field, {
|
|
838
858
|
disabled: disabled,
|
|
859
|
+
className: "eds-text-field",
|
|
839
860
|
children: [label && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
840
861
|
className: "eds-text-field__header",
|
|
841
862
|
children: [/*#__PURE__*/jsxRuntime.jsx(Field.Label, {
|
|
@@ -845,8 +866,12 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField({
|
|
|
845
866
|
}), labelInfo && /*#__PURE__*/jsxRuntime.jsx(Tooltip, {
|
|
846
867
|
title: labelInfo,
|
|
847
868
|
placement: "top",
|
|
848
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
849
|
-
|
|
869
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
870
|
+
variant: "ghost",
|
|
871
|
+
icon: true,
|
|
872
|
+
round: true,
|
|
873
|
+
size: "small",
|
|
874
|
+
tone: "neutral",
|
|
850
875
|
className: "eds-text-field__info",
|
|
851
876
|
"aria-label": "More information",
|
|
852
877
|
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
@@ -11,7 +11,7 @@ export declare const StyledButton: import("styled-components/dist/types").IStyle
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
type?: string;
|
|
13
13
|
fullWidth?: boolean;
|
|
14
|
-
} & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Omit<any,
|
|
14
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Omit<any, keyof import("react").ButtonHTMLAttributes<HTMLButtonElement> | "variant" | "href" | "fullWidth">, never>> & string & Omit<import("@equinor/eds-utils").OverridableComponent<import("../Button").ButtonProps, HTMLButtonElement> & {
|
|
15
15
|
Group: typeof import("../Button").ButtonGroup;
|
|
16
16
|
Toggle: typeof import("../Button").ToggleButton;
|
|
17
17
|
}, keyof import("react").Component<any, {}, any>>;
|
|
@@ -94,7 +94,7 @@ export declare const AutocompleteContext: import("react").Context<{
|
|
|
94
94
|
optionLabel?: (option: unknown) => string;
|
|
95
95
|
} & {
|
|
96
96
|
ref?: React.Ref<HTMLInputElement>;
|
|
97
|
-
}, "
|
|
97
|
+
}, "disabled" | "className" | "style" | "meta" | "label" | "ref" | "multiple" | "variant" | "placeholder" | "readOnly" | "options" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "multiline" | "dropdownHeight" | "itemToKey" | "itemCompare" | "onClear" | "optionLabel">;
|
|
98
98
|
highlightedIndex: number;
|
|
99
99
|
selectedItem: unknown;
|
|
100
100
|
isOpen: boolean;
|
|
@@ -208,7 +208,7 @@ export declare const useAutocompleteContext: () => {
|
|
|
208
208
|
optionLabel?: (option: unknown) => string;
|
|
209
209
|
} & {
|
|
210
210
|
ref?: React.Ref<HTMLInputElement>;
|
|
211
|
-
}, "
|
|
211
|
+
}, "disabled" | "className" | "style" | "meta" | "label" | "ref" | "multiple" | "variant" | "placeholder" | "readOnly" | "options" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "multiline" | "dropdownHeight" | "itemToKey" | "itemCompare" | "onClear" | "optionLabel">;
|
|
212
212
|
highlightedIndex: number;
|
|
213
213
|
selectedItem: unknown;
|
|
214
214
|
isOpen: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DOMAttributes } from 'react';
|
|
1
2
|
import { AutocompleteProps } from './Autocomplete';
|
|
2
3
|
import { AutocompleteToken } from './Autocomplete.tokens';
|
|
3
4
|
export declare const useAutocomplete: <T>({ options, totalOptions, label, meta, className, style, disabled, readOnly, loading, hideClearButton, onOptionsChange, onAddNewOption, onInputChange, selectedOptions: _selectedOptions, selectionDisplay, multiple, itemToKey: _itemToKey, itemCompare: _itemCompare, allowSelectAll, initialSelectedOptions: _initialSelectedOptions, optionDisabled, optionsFilter, autoWidth, placeholder, optionLabel, clearSearchOnChange, multiline, dropdownHeight, optionComponent, helperText, helperIcon, noOptionsText, variant, onClear, ref, ...other }: AutocompleteProps<T> & {
|
|
@@ -26,7 +27,7 @@ export declare const useAutocomplete: <T>({ options, totalOptions, label, meta,
|
|
|
26
27
|
disabled: boolean;
|
|
27
28
|
ref: import("react").RefObject<HTMLInputElement>;
|
|
28
29
|
}>, "preventKeyAction">>;
|
|
29
|
-
consolidatedEvents: Partial<
|
|
30
|
+
consolidatedEvents: Partial<DOMAttributes<unknown>>;
|
|
30
31
|
multiple: boolean;
|
|
31
32
|
disabled: boolean;
|
|
32
33
|
optionDisabled: (option: T) => boolean;
|
|
@@ -102,7 +103,7 @@ export declare const useAutocomplete: <T>({ options, totalOptions, label, meta,
|
|
|
102
103
|
optionLabel?: (option: T) => string;
|
|
103
104
|
}) & {
|
|
104
105
|
ref?: React.Ref<HTMLInputElement>;
|
|
105
|
-
}, "
|
|
106
|
+
}, "disabled" | "className" | "style" | "meta" | "label" | "ref" | "multiple" | "variant" | "placeholder" | "readOnly" | "options" | "helperText" | "helperIcon" | "loading" | "optionDisabled" | "totalOptions" | "initialSelectedOptions" | "noOptionsText" | "hideClearButton" | "selectedOptions" | "selectionDisplay" | "onOptionsChange" | "onInputChange" | "onAddNewOption" | "allowSelectAll" | "optionComponent" | "optionsFilter" | "autoWidth" | "clearSearchOnChange" | "multiline" | "dropdownHeight" | "itemToKey" | "itemCompare" | "onClear" | "optionLabel">;
|
|
106
107
|
highlightedIndex: number;
|
|
107
108
|
selectedItem: T;
|
|
108
109
|
isOpen: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* DateRangePicker component encapsulates the logic for selecting a range of dates
|
|
3
3
|
* Either by accessible input fields or by a calendar.
|
|
4
4
|
*/
|
|
5
|
-
export declare const DateRangePicker: import("react").ForwardRefExoticComponent<Omit<import("./props").DatePickerProps, "
|
|
5
|
+
export declare const DateRangePicker: import("react").ForwardRefExoticComponent<Omit<import("./props").DatePickerProps, "value" | "defaultValue" | "onChange" | "multiple" | "showTimeInput" | "stateRef"> & Partial<{
|
|
6
6
|
onChange: (range: {
|
|
7
7
|
from: Date | null;
|
|
8
8
|
to: Date | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DateValue } from '@internationalized/date';
|
|
2
|
+
/**
|
|
3
|
+
* Generates validation error messages using the provided locale instead of
|
|
4
|
+
* navigator.language (which is what react-stately uses internally).
|
|
5
|
+
*
|
|
6
|
+
* This fixes the issue where validation messages appear in the browser's
|
|
7
|
+
* language rather than the locale configured via I18nProvider.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getLocalizedValidationErrors(validationDetails: ValidityState, locale: string, minValue?: DateValue | null, maxValue?: DateValue | null, timezone?: string): string[];
|
|
@@ -7,4 +7,4 @@ export type SideBarButtonProps = {
|
|
|
7
7
|
export declare const SideBarButton: import("react").ForwardRefExoticComponent<{
|
|
8
8
|
label: string;
|
|
9
9
|
icon: IconData;
|
|
10
|
-
} & Omit<ButtonProps, "
|
|
10
|
+
} & Omit<ButtonProps, "type" | "variant" | "href" | "fullWidth"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -2,13 +2,15 @@ import { InputHTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
export type InputProps = {
|
|
3
3
|
/** Invalid state - shows error styling */
|
|
4
4
|
invalid?: boolean;
|
|
5
|
-
/**
|
|
5
|
+
/** Hide error icon when invalid - defaults to false (icon shows by default) */
|
|
6
|
+
hideErrorIcon?: boolean;
|
|
7
|
+
/** Text at the start (e.g., "https://", "NOK") */
|
|
6
8
|
startText?: string;
|
|
7
|
-
/** Adornment at the start (icons, buttons, etc.)
|
|
9
|
+
/** Adornment at the start (icons, buttons, etc.) */
|
|
8
10
|
startAdornment?: ReactNode;
|
|
9
|
-
/** Text at the end (e.g., "km", "%")
|
|
11
|
+
/** Text at the end (e.g., "km", "%") */
|
|
10
12
|
endText?: string;
|
|
11
|
-
/** Adornment at the end (icons, buttons, etc.)
|
|
13
|
+
/** Adornment at the end (icons, buttons, etc.) */
|
|
12
14
|
endAdornment?: ReactNode;
|
|
13
15
|
/** Render as input or textarea */
|
|
14
16
|
as?: 'input' | 'textarea';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/eds-core-react",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6-beta.0",
|
|
4
4
|
"description": "The React implementation of the Equinor Design System",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -31,7 +31,14 @@
|
|
|
31
31
|
"types": "./dist/types/index.d.ts",
|
|
32
32
|
"import": "./dist/esm/index.js",
|
|
33
33
|
"require": "./dist/eds-core-react.cjs"
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"./next": {
|
|
36
|
+
"types": "./dist/types/index.next.d.ts",
|
|
37
|
+
"import": "./dist/esm-next/index.next.js",
|
|
38
|
+
"require": "./dist/index.next.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./next/index.css": "./build/index.css",
|
|
41
|
+
"./next/index.min.css": "./build/index.min.css"
|
|
35
42
|
},
|
|
36
43
|
"keywords": [
|
|
37
44
|
"eds",
|
|
@@ -40,27 +47,27 @@
|
|
|
40
47
|
"react"
|
|
41
48
|
],
|
|
42
49
|
"devDependencies": {
|
|
43
|
-
"@figma/code-connect": "^1.
|
|
44
|
-
"@playwright/test": "^1.
|
|
50
|
+
"@figma/code-connect": "^1.4.1",
|
|
51
|
+
"@playwright/test": "^1.58.2",
|
|
45
52
|
"@rollup/plugin-babel": "^6.1.0",
|
|
46
|
-
"@rollup/plugin-commonjs": "^
|
|
53
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
47
54
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
48
|
-
"@storybook/addon-a11y": "^
|
|
49
|
-
"@storybook/addon-docs": "^
|
|
50
|
-
"@storybook/addon-links": "^
|
|
51
|
-
"@storybook/react-vite": "^
|
|
55
|
+
"@storybook/addon-a11y": "^10.2.10",
|
|
56
|
+
"@storybook/addon-docs": "^10.2.10",
|
|
57
|
+
"@storybook/addon-links": "^10.2.10",
|
|
58
|
+
"@storybook/react-vite": "^10.2.14",
|
|
52
59
|
"@testing-library/dom": "^10.4.1",
|
|
53
60
|
"@testing-library/jest-dom": "^6.9.1",
|
|
54
|
-
"@testing-library/react": "16.3.
|
|
61
|
+
"@testing-library/react": "16.3.2",
|
|
55
62
|
"@testing-library/user-event": "14.6.1",
|
|
56
63
|
"@types/jest": "^30.0.0",
|
|
57
64
|
"@types/mdx": "^2.0.13",
|
|
58
|
-
"@types/node": "^
|
|
65
|
+
"@types/node": "^25.3.3",
|
|
59
66
|
"@types/ramda": "^0.31.1",
|
|
60
|
-
"@types/react": "^19.2.
|
|
61
|
-
"@types/react-dom": "^19.2.
|
|
67
|
+
"@types/react": "^19.2.14",
|
|
68
|
+
"@types/react-dom": "^19.2.3",
|
|
62
69
|
"babel-plugin-styled-components": "^2.1.4",
|
|
63
|
-
"eslint-plugin-storybook": "
|
|
70
|
+
"eslint-plugin-storybook": "10.2.10",
|
|
64
71
|
"jest": "^30.2.0",
|
|
65
72
|
"jest-environment-jsdom": "^30.2.0",
|
|
66
73
|
"jest-styled-components": "^7.2.0",
|
|
@@ -68,38 +75,38 @@
|
|
|
68
75
|
"postcss": "^8.5.6",
|
|
69
76
|
"postcss-import": "^16.1.1",
|
|
70
77
|
"ramda": "^0.32.0",
|
|
71
|
-
"react": "^19.2.
|
|
72
|
-
"react-dom": "^19.2.
|
|
73
|
-
"react-hook-form": "^7.
|
|
74
|
-
"react-router-dom": "^7.
|
|
75
|
-
"rollup": "^4.
|
|
76
|
-
"rollup-plugin-delete": "^3.0.
|
|
78
|
+
"react": "^19.2.4",
|
|
79
|
+
"react-dom": "^19.2.4",
|
|
80
|
+
"react-hook-form": "^7.71.2",
|
|
81
|
+
"react-router-dom": "^7.13.1",
|
|
82
|
+
"rollup": "^4.59.0",
|
|
83
|
+
"rollup-plugin-delete": "^3.0.2",
|
|
77
84
|
"rollup-plugin-postcss": "^4.0.2",
|
|
78
85
|
"rollup-preserve-directives": "^1.1.3",
|
|
79
|
-
"storybook": "^
|
|
80
|
-
"styled-components": "6.
|
|
86
|
+
"storybook": "^10.2.10",
|
|
87
|
+
"styled-components": "6.3.11",
|
|
81
88
|
"tsc-watch": "^7.2.0",
|
|
82
89
|
"typescript": "^5.9.3"
|
|
83
90
|
},
|
|
84
91
|
"peerDependencies": {
|
|
85
|
-
"react": "^19",
|
|
86
|
-
"react-dom": "^19",
|
|
92
|
+
"react": "^18 || ^19",
|
|
93
|
+
"react-dom": "^18 || ^19",
|
|
87
94
|
"styled-components": "^6"
|
|
88
95
|
},
|
|
89
96
|
"dependencies": {
|
|
90
|
-
"@babel/runtime": "^7.28.
|
|
91
|
-
"@floating-ui/react": "^0.27.
|
|
92
|
-
"@internationalized/date": "^3.
|
|
93
|
-
"@react-aria/utils": "^3.
|
|
94
|
-
"@react-stately/calendar": "^3.9.
|
|
95
|
-
"@react-stately/datepicker": "^3.
|
|
96
|
-
"@react-types/shared": "^3.
|
|
97
|
-
"@tanstack/react-virtual": "3.13.
|
|
98
|
-
"downshift": "9.
|
|
99
|
-
"react-aria": "^3.
|
|
100
|
-
"@equinor/eds-
|
|
101
|
-
"@equinor/eds-
|
|
102
|
-
"@equinor/eds-
|
|
97
|
+
"@babel/runtime": "^7.28.6",
|
|
98
|
+
"@floating-ui/react": "^0.27.18",
|
|
99
|
+
"@internationalized/date": "^3.11.0",
|
|
100
|
+
"@react-aria/utils": "^3.33.0",
|
|
101
|
+
"@react-stately/calendar": "^3.9.2",
|
|
102
|
+
"@react-stately/datepicker": "^3.16.0",
|
|
103
|
+
"@react-types/shared": "^3.33.0",
|
|
104
|
+
"@tanstack/react-virtual": "3.13.18",
|
|
105
|
+
"downshift": "9.3.2",
|
|
106
|
+
"react-aria": "^3.46.0",
|
|
107
|
+
"@equinor/eds-tokens": "^2.2.0",
|
|
108
|
+
"@equinor/eds-icons": "^1.3.0",
|
|
109
|
+
"@equinor/eds-utils": "^2.1.0"
|
|
103
110
|
},
|
|
104
111
|
"scripts": {
|
|
105
112
|
"build": "rollup -c && tsc -p tsconfig.build.json",
|