@equinor/eds-core-react 2.3.5 → 2.3.7

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.
Files changed (38) hide show
  1. package/build/index.css +143 -277
  2. package/build/index.min.css +1 -5
  3. package/dist/eds-core-react.cjs +209 -25
  4. package/dist/esm/components/Autocomplete/AddNewOption.js +1 -1
  5. package/dist/esm/components/Autocomplete/Autocomplete.js +1 -1
  6. package/dist/esm/components/Autocomplete/Option.js +11 -2
  7. package/dist/esm/components/Autocomplete/SelectAllOption.js +1 -1
  8. package/dist/esm/components/Autocomplete/useAutocomplete.js +13 -2
  9. package/dist/esm/components/Banner/Banner.tokens.js +2 -10
  10. package/dist/esm/components/Chip/Chip.js +1 -1
  11. package/dist/esm/components/Chip/Chip.tokens.js +0 -2
  12. package/dist/esm/components/Datepicker/DatePicker.js +4 -1
  13. package/dist/esm/components/Datepicker/DateRangePicker.js +4 -1
  14. package/dist/esm/components/Datepicker/fields/DateFieldSegments.js +11 -2
  15. package/dist/esm/components/Datepicker/utils/get-calendar-date.js +1 -1
  16. package/dist/esm/components/Datepicker/utils/getLocalizedValidationErrors.js +164 -0
  17. package/dist/esm/components/EdsProvider/eds.context.js +1 -1
  18. package/dist/esm/components/Menu/Menu.context.js +1 -1
  19. package/dist/esm/components/SideBar/SideBar.context.js +1 -1
  20. package/dist/esm/components/Table/DataCell/DataCell.js +1 -1
  21. package/dist/esm/components/Table/FooterCell/FooterCell.js +1 -1
  22. package/dist/esm/components/Table/HeaderCell/HeaderCell.js +1 -1
  23. package/dist/esm/components/Typography/Typography.js +1 -1
  24. package/dist/esm/index.js +64 -64
  25. package/dist/esm-next/components/next/Button/Button.js +3 -5
  26. package/dist/esm-next/components/next/Input/Input.js +6 -11
  27. package/dist/esm-next/components/next/TextField/TextField.js +7 -2
  28. package/dist/esm-next/index.next.js +4 -4
  29. package/dist/index.next.cjs +15 -18
  30. package/dist/types/components/Autocomplete/Autocomplete.d.ts +1 -1
  31. package/dist/types/components/Autocomplete/AutocompleteContext.d.ts +2 -2
  32. package/dist/types/components/Autocomplete/useAutocomplete.d.ts +3 -2
  33. package/dist/types/components/Datepicker/DateRangePicker.d.ts +1 -1
  34. package/dist/types/components/Datepicker/utils/getLocalizedValidationErrors.d.ts +9 -0
  35. package/dist/types/components/SideBar/SideBarButton/index.d.ts +1 -1
  36. package/dist/types/components/next/Input/Input.types.d.ts +6 -4
  37. package/dist/types/components/next/TextField/TextField.d.ts +1 -0
  38. package/package.json +33 -33
@@ -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
- }, "meta" | "label" | "disabled" | "style" | "ref" | "className" | "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">;
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
- }, "meta" | "label" | "disabled" | "style" | "ref" | "className" | "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">;
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<import("react").DOMAttributes<unknown>>;
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
- }, "meta" | "label" | "disabled" | "style" | "ref" | "className" | "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
+ }, "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, "defaultValue" | "onChange" | "multiple" | "value" | "showTimeInput" | "stateRef"> & Partial<{
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, "variant" | "href" | "type" | "fullWidth"> & import("react").RefAttributes<HTMLButtonElement>>;
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
- /** Text at the start (e.g., "$", "USD") - always neutral color */
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.) - inherits state color (red when invalid) */
9
+ /** Adornment at the start (icons, buttons, etc.) */
8
10
  startAdornment?: ReactNode;
9
- /** Text at the end (e.g., "km", "%") - always neutral color */
11
+ /** Text at the end (e.g., "km", "%") */
10
12
  endText?: string;
11
- /** Adornment at the end (icons, buttons, etc.) - inherits state color (red when invalid) */
13
+ /** Adornment at the end (icons, buttons, etc.) */
12
14
  endAdornment?: ReactNode;
13
15
  /** Render as input or textarea */
14
16
  as?: 'input' | 'textarea';
@@ -8,6 +8,7 @@ export declare const TextField: import("react").ForwardRefExoticComponent<{
8
8
  id?: string;
9
9
  } & {
10
10
  invalid?: boolean;
11
+ hideErrorIcon?: boolean;
11
12
  startText?: string;
12
13
  startAdornment?: import("react").ReactNode;
13
14
  endText?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/eds-core-react",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
4
4
  "description": "The React implementation of the Equinor Design System",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -40,27 +40,27 @@
40
40
  "react"
41
41
  ],
42
42
  "devDependencies": {
43
- "@figma/code-connect": "^1.3.12",
44
- "@playwright/test": "^1.57.0",
43
+ "@figma/code-connect": "^1.4.1",
44
+ "@playwright/test": "^1.58.2",
45
45
  "@rollup/plugin-babel": "^6.1.0",
46
- "@rollup/plugin-commonjs": "^28.0.8",
46
+ "@rollup/plugin-commonjs": "^29.0.0",
47
47
  "@rollup/plugin-node-resolve": "^16.0.3",
48
- "@storybook/addon-a11y": "^9.1.13",
49
- "@storybook/addon-docs": "^9.1.13",
50
- "@storybook/addon-links": "^9.1.13",
51
- "@storybook/react-vite": "^9.1.13",
48
+ "@storybook/addon-a11y": "^10.2.10",
49
+ "@storybook/addon-docs": "^10.2.10",
50
+ "@storybook/addon-links": "^10.2.10",
51
+ "@storybook/react-vite": "^10.2.10",
52
52
  "@testing-library/dom": "^10.4.1",
53
53
  "@testing-library/jest-dom": "^6.9.1",
54
- "@testing-library/react": "16.3.0",
54
+ "@testing-library/react": "16.3.2",
55
55
  "@testing-library/user-event": "14.6.1",
56
56
  "@types/jest": "^30.0.0",
57
57
  "@types/mdx": "^2.0.13",
58
- "@types/node": "^24.9.1",
58
+ "@types/node": "^25.3.0",
59
59
  "@types/ramda": "^0.31.1",
60
- "@types/react": "^19.2.2",
61
- "@types/react-dom": "^19.2.2",
60
+ "@types/react": "^19.2.14",
61
+ "@types/react-dom": "^19.2.3",
62
62
  "babel-plugin-styled-components": "^2.1.4",
63
- "eslint-plugin-storybook": "9.1.13",
63
+ "eslint-plugin-storybook": "10.2.10",
64
64
  "jest": "^30.2.0",
65
65
  "jest-environment-jsdom": "^30.2.0",
66
66
  "jest-styled-components": "^7.2.0",
@@ -68,16 +68,16 @@
68
68
  "postcss": "^8.5.6",
69
69
  "postcss-import": "^16.1.1",
70
70
  "ramda": "^0.32.0",
71
- "react": "^19.2.0",
72
- "react-dom": "^19.2.0",
73
- "react-hook-form": "^7.65.0",
74
- "react-router-dom": "^7.9.4",
75
- "rollup": "^4.52.5",
76
- "rollup-plugin-delete": "^3.0.1",
71
+ "react": "^19.2.4",
72
+ "react-dom": "^19.2.4",
73
+ "react-hook-form": "^7.71.2",
74
+ "react-router-dom": "^7.13.0",
75
+ "rollup": "^4.57.1",
76
+ "rollup-plugin-delete": "^3.0.2",
77
77
  "rollup-plugin-postcss": "^4.0.2",
78
78
  "rollup-preserve-directives": "^1.1.3",
79
- "storybook": "^9.1.13",
80
- "styled-components": "6.1.19",
79
+ "storybook": "^10.2.10",
80
+ "styled-components": "6.3.11",
81
81
  "tsc-watch": "^7.2.0",
82
82
  "typescript": "^5.9.3"
83
83
  },
@@ -87,19 +87,19 @@
87
87
  "styled-components": "^6"
88
88
  },
89
89
  "dependencies": {
90
- "@babel/runtime": "^7.28.4",
91
- "@floating-ui/react": "^0.27.16",
92
- "@internationalized/date": "^3.10.0",
93
- "@react-aria/utils": "^3.31.0",
94
- "@react-stately/calendar": "^3.9.0",
95
- "@react-stately/datepicker": "^3.15.2",
96
- "@react-types/shared": "^3.32.1",
97
- "@tanstack/react-virtual": "3.13.12",
98
- "downshift": "9.0.10",
99
- "react-aria": "^3.44.0",
100
- "@equinor/eds-icons": "^1.2.2",
90
+ "@babel/runtime": "^7.28.6",
91
+ "@floating-ui/react": "^0.27.18",
92
+ "@internationalized/date": "^3.11.0",
93
+ "@react-aria/utils": "^3.33.0",
94
+ "@react-stately/calendar": "^3.9.2",
95
+ "@react-stately/datepicker": "^3.16.0",
96
+ "@react-types/shared": "^3.33.0",
97
+ "@tanstack/react-virtual": "3.13.18",
98
+ "downshift": "9.3.2",
99
+ "react-aria": "^3.46.0",
100
+ "@equinor/eds-tokens": "^2.2.0",
101
101
  "@equinor/eds-utils": "^2.0.0",
102
- "@equinor/eds-tokens": "^2.1.1"
102
+ "@equinor/eds-icons": "^1.3.0"
103
103
  },
104
104
  "scripts": {
105
105
  "build": "rollup -c && tsc -p tsconfig.build.json",