@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
package/dist/eds-core-react.cjs
CHANGED
|
@@ -1830,7 +1830,7 @@ const StyledTableCell$2 = styled__default.default.td.withConfig({
|
|
|
1830
1830
|
align
|
|
1831
1831
|
} = theme;
|
|
1832
1832
|
const backgroundColor = color === 'error' ? theme.validation.error?.background : '';
|
|
1833
|
-
const base = styled.css(["min-height:", ";height:", ";background:", ";vertical-align:", ";box-sizing:border-box;", " ", " ", ""], height, height, backgroundColor, align.vertical, edsUtils.spacingsTemplate(spacings), edsUtils.typographyTemplate(typography), edsUtils.bordersTemplate(border));
|
|
1833
|
+
const base = styled.css(["min-height:", ";height:", ";background:", ";vertical-align:", ";box-sizing:border-box;", " ", " ", " a{font-size:inherit;font-weight:inherit;}"], height, height, backgroundColor, align.vertical, edsUtils.spacingsTemplate(spacings), edsUtils.typographyTemplate(typography), edsUtils.bordersTemplate(border));
|
|
1834
1834
|
return base;
|
|
1835
1835
|
});
|
|
1836
1836
|
const TableDataCell = /*#__PURE__*/react.forwardRef(function TableDataCell({
|
|
@@ -2011,7 +2011,7 @@ const StyledTableCell$1 = styled__default.default.th.withConfig({
|
|
|
2011
2011
|
// Firefox specific workaround (bug in v142.0) - see issue #3910
|
|
2012
2012
|
// Hardcoded padding values compensate for Firefox's incorrect table cell height calculation
|
|
2013
2013
|
const firefoxFix = edsUtils.isFirefox() ? styled.css(["vertical-align:top;height:auto;min-height:", ";> div{padding:", " 0;}"], height, $density === 'compact' ? '7px' : '13px') : styled.css([""]);
|
|
2014
|
-
return styled.css(["min-height:", ";height:", ";background:", ";box-sizing:border-box;", " ", " ", " ", " ", " ", " ", ""], height, height, background, edsUtils.spacingsTemplate(spacings), edsUtils.typographyTemplate(typography), edsUtils.bordersTemplate(theme.border), sortStylingHover, sortStylingActive, firefoxFix, $sticky ? styled.css(["position:sticky;top:0;z-index:1;"]) : '');
|
|
2014
|
+
return styled.css(["min-height:", ";height:", ";background:", ";box-sizing:border-box;", " ", " ", " ", " ", " ", " a{font-size:inherit;font-weight:inherit;}", ""], height, height, background, edsUtils.spacingsTemplate(spacings), edsUtils.typographyTemplate(typography), edsUtils.bordersTemplate(theme.border), sortStylingHover, sortStylingActive, firefoxFix, $sticky ? styled.css(["position:sticky;top:0;z-index:1;"]) : '');
|
|
2015
2015
|
});
|
|
2016
2016
|
const CellInner$1 = styled__default.default.div.withConfig({
|
|
2017
2017
|
displayName: "HeaderCell__CellInner",
|
|
@@ -2061,7 +2061,7 @@ const StyledTableCell = styled__default.default.th.withConfig({
|
|
|
2061
2061
|
typography,
|
|
2062
2062
|
spacings
|
|
2063
2063
|
} = theme;
|
|
2064
|
-
return styled.css(["min-height:", ";height:", ";background:", ";box-sizing:border-box;", " ", " ", " ", ""], height, height, background, edsUtils.spacingsTemplate(spacings), edsUtils.typographyTemplate(typography), edsUtils.bordersTemplate(theme.border), $sticky ? styled.css(["position:sticky;bottom:0;z-index:2;"]) : '');
|
|
2064
|
+
return styled.css(["min-height:", ";height:", ";background:", ";box-sizing:border-box;", " ", " ", " a{font-size:inherit;font-weight:inherit;}", ""], height, height, background, edsUtils.spacingsTemplate(spacings), edsUtils.typographyTemplate(typography), edsUtils.bordersTemplate(theme.border), $sticky ? styled.css(["position:sticky;bottom:0;z-index:2;"]) : '');
|
|
2065
2065
|
});
|
|
2066
2066
|
const CellInner = styled__default.default.div.withConfig({
|
|
2067
2067
|
displayName: "FooterCell__CellInner",
|
|
@@ -5443,8 +5443,6 @@ const enabled$3 = {
|
|
|
5443
5443
|
},
|
|
5444
5444
|
entities: {
|
|
5445
5445
|
icon: {
|
|
5446
|
-
height: medium$3,
|
|
5447
|
-
width: medium$3,
|
|
5448
5446
|
border: {
|
|
5449
5447
|
radius: borderRadius$3,
|
|
5450
5448
|
type: 'border',
|
|
@@ -5596,7 +5594,7 @@ const Chip = /*#__PURE__*/react.forwardRef(function Chip({
|
|
|
5596
5594
|
};
|
|
5597
5595
|
const resizedChildren = react.Children.map(children, child => {
|
|
5598
5596
|
// We force size on Icon & Avatar component
|
|
5599
|
-
if (child
|
|
5597
|
+
if (child?.props) {
|
|
5600
5598
|
return /*#__PURE__*/react.cloneElement(child, {
|
|
5601
5599
|
size: 16,
|
|
5602
5600
|
disabled
|
|
@@ -6691,12 +6689,12 @@ const Popover$1 = /*#__PURE__*/react.forwardRef(function Popover({
|
|
|
6691
6689
|
} = react$1.useInteractions([react$1.useDismiss(context)]);
|
|
6692
6690
|
react.useEffect(() => {
|
|
6693
6691
|
if (!elements.floating) return;
|
|
6694
|
-
if (
|
|
6695
|
-
if (
|
|
6692
|
+
if (elements.floating.hasAttribute('popover')) {
|
|
6693
|
+
if (open) {
|
|
6696
6694
|
elements.floating.showPopover();
|
|
6695
|
+
} else {
|
|
6696
|
+
elements.floating.hidePopover();
|
|
6697
6697
|
}
|
|
6698
|
-
} else {
|
|
6699
|
-
elements.floating.hidePopover();
|
|
6700
6698
|
}
|
|
6701
6699
|
}, [open, elements.floating]);
|
|
6702
6700
|
react.useEffect(() => {
|
|
@@ -6964,11 +6962,7 @@ const info$1 = {
|
|
|
6964
6962
|
color: infoColor
|
|
6965
6963
|
}
|
|
6966
6964
|
}
|
|
6967
|
-
}
|
|
6968
|
-
modes: {
|
|
6969
|
-
compact: {}
|
|
6970
|
-
}
|
|
6971
|
-
};
|
|
6965
|
+
}};
|
|
6972
6966
|
const warning$1 = {
|
|
6973
6967
|
entities: {
|
|
6974
6968
|
icon: {
|
|
@@ -6977,11 +6971,7 @@ const warning$1 = {
|
|
|
6977
6971
|
color: warningColor
|
|
6978
6972
|
}
|
|
6979
6973
|
}
|
|
6980
|
-
}
|
|
6981
|
-
modes: {
|
|
6982
|
-
compact: {}
|
|
6983
|
-
}
|
|
6984
|
-
};
|
|
6974
|
+
}};
|
|
6985
6975
|
|
|
6986
6976
|
var tokens$2 = /*#__PURE__*/Object.freeze({
|
|
6987
6977
|
__proto__: null,
|
|
@@ -9512,7 +9502,7 @@ Switch.displayName = 'Switch';
|
|
|
9512
9502
|
|
|
9513
9503
|
const AutocompleteContext = /*#__PURE__*/react.createContext(null);
|
|
9514
9504
|
const useAutocompleteContext = () => {
|
|
9515
|
-
const context = react.
|
|
9505
|
+
const context = react.useContext(AutocompleteContext);
|
|
9516
9506
|
if (!context) {
|
|
9517
9507
|
throw new Error('Autocomplete compound components must be used within an Autocomplete component');
|
|
9518
9508
|
}
|
|
@@ -9694,7 +9684,9 @@ function Option({
|
|
|
9694
9684
|
const isSelected = selectedItemsLabels.includes(label);
|
|
9695
9685
|
const optionComponent = _optionComponent?.(item, isSelected);
|
|
9696
9686
|
const highlighted = highlightedIndex === index && !isDisabled ? 'true' : 'false';
|
|
9697
|
-
|
|
9687
|
+
|
|
9688
|
+
// Guard: downshift 9.x validates that item exists in the items array
|
|
9689
|
+
const itemProps = item !== undefined ? getItemProps({
|
|
9698
9690
|
...(multiline && {
|
|
9699
9691
|
ref: rowVirtualizer.measureElement
|
|
9700
9692
|
}),
|
|
@@ -9706,7 +9698,14 @@ function Option({
|
|
|
9706
9698
|
height: `${virtualItem.size}px`
|
|
9707
9699
|
})
|
|
9708
9700
|
}
|
|
9709
|
-
})
|
|
9701
|
+
}) : {
|
|
9702
|
+
style: {
|
|
9703
|
+
transform: `translateY(${virtualItem.start}px)`,
|
|
9704
|
+
...(!multiline && {
|
|
9705
|
+
height: `${virtualItem.size}px`
|
|
9706
|
+
})
|
|
9707
|
+
}
|
|
9708
|
+
};
|
|
9710
9709
|
return /*#__PURE__*/jsxRuntime.jsxs(StyledListItem, {
|
|
9711
9710
|
$isdisabled: isDisabled ? 'true' : 'false',
|
|
9712
9711
|
$highlighted: highlighted,
|
|
@@ -9766,7 +9765,7 @@ function AddNewOption({
|
|
|
9766
9765
|
ref: rowVirtualizer.measureElement
|
|
9767
9766
|
}),
|
|
9768
9767
|
item,
|
|
9769
|
-
index
|
|
9768
|
+
index
|
|
9770
9769
|
});
|
|
9771
9770
|
return /*#__PURE__*/jsxRuntime.jsxs(StyledListItem, {
|
|
9772
9771
|
$highlighted: highlighted,
|
|
@@ -9818,7 +9817,7 @@ function SelectAllOption({
|
|
|
9818
9817
|
ref: rowVirtualizer.measureElement
|
|
9819
9818
|
}),
|
|
9820
9819
|
item,
|
|
9821
|
-
index
|
|
9820
|
+
index
|
|
9822
9821
|
});
|
|
9823
9822
|
return /*#__PURE__*/jsxRuntime.jsxs(StyledListItem, {
|
|
9824
9823
|
ref: ref,
|
|
@@ -9985,10 +9984,12 @@ const OptionList = ({
|
|
|
9985
9984
|
|
|
9986
9985
|
// MARK: popover toggle
|
|
9987
9986
|
edsUtils.useIsomorphicLayoutEffect(() => {
|
|
9988
|
-
if (
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9987
|
+
if (refs.floating.current?.hasAttribute('popover')) {
|
|
9988
|
+
if (isOpen) {
|
|
9989
|
+
refs.floating.current.showPopover();
|
|
9990
|
+
} else {
|
|
9991
|
+
refs.floating.current.hidePopover();
|
|
9992
|
+
}
|
|
9992
9993
|
}
|
|
9993
9994
|
}, [isOpen, refs.floating]);
|
|
9994
9995
|
const showNoOptions = isOpen && !availableItems.length && noOptionsText.length > 0;
|
|
@@ -10333,7 +10334,13 @@ const useAutocomplete = ({
|
|
|
10333
10334
|
...multipleSelectionProps,
|
|
10334
10335
|
onSelectedItemsChange: changes => {
|
|
10335
10336
|
if (onOptionsChange) {
|
|
10336
|
-
|
|
10337
|
+
// AddSymbol/AllSymbol are handled manually in onStateChange,
|
|
10338
|
+
// so skip propagating when they appear in selectedItems
|
|
10339
|
+
// (downshift 9.x propagates selectedItem to useMultipleSelection)
|
|
10340
|
+
if (changes.selectedItems.some(item => item === AllSymbol || item === AddSymbol)) {
|
|
10341
|
+
return;
|
|
10342
|
+
}
|
|
10343
|
+
let selectedItems = changes.selectedItems;
|
|
10337
10344
|
if (itemCompare) {
|
|
10338
10345
|
selectedItems = inputOptions.filter(item => selectedItems.some(compare => itemCompare(item, compare)));
|
|
10339
10346
|
}
|
|
@@ -10490,6 +10497,9 @@ const useAutocomplete = ({
|
|
|
10490
10497
|
toggleAllSelected();
|
|
10491
10498
|
} else if (selectedItem === AddSymbol && typedInputValue.trim()) {
|
|
10492
10499
|
onAddNewOption?.(typedInputValue);
|
|
10500
|
+
if (clearSearchOnChange) {
|
|
10501
|
+
setTypedInputValue('');
|
|
10502
|
+
}
|
|
10493
10503
|
} else if (multiple) {
|
|
10494
10504
|
const shouldRemove = itemCompare ? selectedItems.some(i => itemCompare(selectedItem, i)) : selectedItems.includes(selectedItem);
|
|
10495
10505
|
if (shouldRemove) {
|
|
@@ -10715,7 +10725,9 @@ const useAutocomplete = ({
|
|
|
10715
10725
|
};
|
|
10716
10726
|
case downshift.useCombobox.stateChangeTypes.InputKeyDownEnter:
|
|
10717
10727
|
case downshift.useCombobox.stateChangeTypes.ItemClick:
|
|
10718
|
-
|
|
10728
|
+
// Don't clear typedInputValue for AddSymbol — onStateChange needs
|
|
10729
|
+
// it to call onAddNewOption (downshift 9.x runs onStateChange after re-render)
|
|
10730
|
+
if (clearSearchOnChange && changes.selectedItem !== AddSymbol) {
|
|
10719
10731
|
setTypedInputValue('');
|
|
10720
10732
|
}
|
|
10721
10733
|
return {
|
|
@@ -12076,9 +12088,6 @@ function CalendarGrid({
|
|
|
12076
12088
|
setYearPickerPage,
|
|
12077
12089
|
...props
|
|
12078
12090
|
}) {
|
|
12079
|
-
const {
|
|
12080
|
-
locale
|
|
12081
|
-
} = reactAria.useLocale();
|
|
12082
12091
|
const {
|
|
12083
12092
|
gridProps,
|
|
12084
12093
|
headerProps,
|
|
@@ -12088,9 +12097,9 @@ function CalendarGrid({
|
|
|
12088
12097
|
weekdayStyle: 'long'
|
|
12089
12098
|
}, state);
|
|
12090
12099
|
|
|
12091
|
-
//
|
|
12092
|
-
|
|
12093
|
-
const weeksInMonthArray = [...new Array(
|
|
12100
|
+
// Always render 6 rows (the maximum weeks in any month) so the calendar
|
|
12101
|
+
// height stays consistent when navigating between months.
|
|
12102
|
+
const weeksInMonthArray = [...new Array(6).keys()];
|
|
12094
12103
|
return showYearPicker ? /*#__PURE__*/jsxRuntime.jsx(YearGrid, {
|
|
12095
12104
|
year: state.focusedDate.year,
|
|
12096
12105
|
setFocusedYear: year => {
|
|
@@ -12142,7 +12151,7 @@ function TodayPicker({
|
|
|
12142
12151
|
onClick: () => onClick(new date.CalendarDate(today.getFullYear(), today.getMonth() + 1, today.getDate())),
|
|
12143
12152
|
variant: 'ghost',
|
|
12144
12153
|
style: {
|
|
12145
|
-
marginLeft:
|
|
12154
|
+
marginLeft: 4
|
|
12146
12155
|
},
|
|
12147
12156
|
children: "Today"
|
|
12148
12157
|
});
|
|
@@ -12151,6 +12160,10 @@ const HeaderActions = styled__default.default.div.withConfig({
|
|
|
12151
12160
|
displayName: "CalendarHeader__HeaderActions",
|
|
12152
12161
|
componentId: "sc-kuy15-1"
|
|
12153
12162
|
})(["display:flex;align-items:center;width:100%;"]);
|
|
12163
|
+
const TitleButton = styled__default.default(Button$1).withConfig({
|
|
12164
|
+
displayName: "CalendarHeader__TitleButton",
|
|
12165
|
+
componentId: "sc-kuy15-2"
|
|
12166
|
+
})(["min-width:13.1rem;white-space:nowrap;font-size:", ";text-transform:capitalize;& > span{display:flex;justify-content:space-between;align-items:center;width:100%;}"], edsTokens.tokens.typography.heading.h5.fontSize);
|
|
12154
12167
|
|
|
12155
12168
|
/**
|
|
12156
12169
|
* The default header for the calendar components if no custom header is provided
|
|
@@ -12182,15 +12195,11 @@ function CalendarHeader({
|
|
|
12182
12195
|
style: {
|
|
12183
12196
|
flex: '1 1 auto'
|
|
12184
12197
|
}
|
|
12185
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
12198
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(TitleButton, {
|
|
12186
12199
|
onClick: () => setShowYearPicker(!showYearPicker),
|
|
12187
12200
|
"data-testid": 'heading',
|
|
12188
12201
|
"aria-live": 'polite',
|
|
12189
12202
|
variant: 'ghost',
|
|
12190
|
-
style: {
|
|
12191
|
-
fontSize: edsTokens.tokens.typography.heading.h5.fontSize,
|
|
12192
|
-
textTransform: 'capitalize'
|
|
12193
|
-
},
|
|
12194
12203
|
children: [title, /*#__PURE__*/jsxRuntime.jsx(Icon$1, {
|
|
12195
12204
|
data: showYearPicker ? edsIcons.chevron_up : edsIcons.chevron_down
|
|
12196
12205
|
})]
|
|
@@ -12482,7 +12491,10 @@ function DateSegment({
|
|
|
12482
12491
|
formatOptions,
|
|
12483
12492
|
timezone
|
|
12484
12493
|
} = useDatePickerContext();
|
|
12485
|
-
const formatter = reactAria.useDateFormatter(
|
|
12494
|
+
const formatter = reactAria.useDateFormatter({
|
|
12495
|
+
...formatOptions,
|
|
12496
|
+
timeZone: timezone
|
|
12497
|
+
});
|
|
12486
12498
|
const parts = state.value ? formatter.formatToParts(state.value.toDate(timezone)) : [];
|
|
12487
12499
|
const part = parts.find(p => p.type === segment.type);
|
|
12488
12500
|
const value = segment.isPlaceholder || segment.type === 'literal' ? segment.text : part?.value ?? segment.text;
|
|
@@ -12523,14 +12535,23 @@ function DateSegment({
|
|
|
12523
12535
|
|
|
12524
12536
|
// In some cases we need to use the index as key
|
|
12525
12537
|
/* eslint-disable react/no-array-index-key */
|
|
12538
|
+
// Use January 1st as placeholder when no value is set.
|
|
12539
|
+
// This ensures the day segment allows values up to 31,
|
|
12540
|
+
// preventing eager auto-advance when typing "3" (which
|
|
12541
|
+
// would otherwise auto-complete to "03" in months with
|
|
12542
|
+
// fewer than 30 days, like February).
|
|
12543
|
+
const DEFAULT_PLACEHOLDER = new date.CalendarDate(new Date().getFullYear(), 1, 1);
|
|
12544
|
+
|
|
12526
12545
|
/**
|
|
12527
12546
|
* A field that wraps segments for inputting a date / date-time
|
|
12528
12547
|
*/
|
|
12529
12548
|
const DateFieldSegments = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
12549
|
+
const placeholderValue = props.placeholderValue ?? DEFAULT_PLACEHOLDER;
|
|
12530
12550
|
const state = datepicker.useDateFieldState({
|
|
12531
12551
|
...props,
|
|
12532
12552
|
locale: props.locale,
|
|
12533
|
-
createCalendar: date.createCalendar
|
|
12553
|
+
createCalendar: date.createCalendar,
|
|
12554
|
+
placeholderValue
|
|
12534
12555
|
});
|
|
12535
12556
|
const {
|
|
12536
12557
|
fieldProps
|
|
@@ -12678,6 +12699,167 @@ const useGetLocale = locale => {
|
|
|
12678
12699
|
return locale ?? currentLocale ?? browserLocale;
|
|
12679
12700
|
};
|
|
12680
12701
|
|
|
12702
|
+
/**
|
|
12703
|
+
* Validation message translations matching @react-stately/datepicker's built-in messages.
|
|
12704
|
+
* Sourced from @react-stately/datepicker's intlStrings bundle.
|
|
12705
|
+
* Unsupported locales fall back to English.
|
|
12706
|
+
*/
|
|
12707
|
+
const allTranslations = {
|
|
12708
|
+
'en-US': {
|
|
12709
|
+
rangeUnderflow: args => `Value must be ${args.minValue} or later.`,
|
|
12710
|
+
rangeOverflow: args => `Value must be ${args.maxValue} or earlier.`,
|
|
12711
|
+
unavailableDate: 'Selected date unavailable.'
|
|
12712
|
+
},
|
|
12713
|
+
'nb-NO': {
|
|
12714
|
+
rangeUnderflow: args => `Verdien m\u00e5 v\u00e6re ${args.minValue} eller senere.`,
|
|
12715
|
+
rangeOverflow: args => `Verdien m\u00e5 v\u00e6re ${args.maxValue} eller tidligere.`,
|
|
12716
|
+
unavailableDate: 'Valgt dato utilgjengelig.'
|
|
12717
|
+
},
|
|
12718
|
+
'da-DK': {
|
|
12719
|
+
rangeUnderflow: args => `V\u00e6rdien skal v\u00e6re ${args.minValue} eller senere.`,
|
|
12720
|
+
rangeOverflow: args => `V\u00e6rdien skal v\u00e6re ${args.maxValue} eller tidligere.`,
|
|
12721
|
+
unavailableDate: 'Den valgte dato er ikke tilg\u00e6ngelig.'
|
|
12722
|
+
},
|
|
12723
|
+
'sv-SE': {
|
|
12724
|
+
rangeUnderflow: args => `V\u00e4rdet m\u00e5ste vara ${args.minValue} eller senare.`,
|
|
12725
|
+
rangeOverflow: args => `V\u00e4rdet m\u00e5ste vara ${args.maxValue} eller tidigare.`,
|
|
12726
|
+
unavailableDate: 'Valt datum \u00e4r inte tillg\u00e4ngligt.'
|
|
12727
|
+
},
|
|
12728
|
+
'de-DE': {
|
|
12729
|
+
rangeUnderflow: args => `Der Wert muss ${args.minValue} oder sp\u00e4ter sein.`,
|
|
12730
|
+
rangeOverflow: args => `Der Wert muss ${args.maxValue} oder fr\u00fcher sein.`,
|
|
12731
|
+
unavailableDate: 'Das ausgew\u00e4hlte Datum ist nicht verf\u00fcgbar.'
|
|
12732
|
+
},
|
|
12733
|
+
'fr-FR': {
|
|
12734
|
+
rangeUnderflow: args => `La valeur doit \u00eatre ${args.minValue} ou ult\u00e9rieure.`,
|
|
12735
|
+
rangeOverflow: args => `La valeur doit \u00eatre ${args.maxValue} ou ant\u00e9rieure.`,
|
|
12736
|
+
unavailableDate: 'Date s\u00e9lectionn\u00e9e non disponible.'
|
|
12737
|
+
},
|
|
12738
|
+
'es-ES': {
|
|
12739
|
+
rangeUnderflow: args => `El valor debe ser ${args.minValue} o posterior.`,
|
|
12740
|
+
rangeOverflow: args => `El valor debe ser ${args.maxValue} o anterior.`,
|
|
12741
|
+
unavailableDate: 'Fecha seleccionada no disponible.'
|
|
12742
|
+
},
|
|
12743
|
+
'pt-BR': {
|
|
12744
|
+
rangeUnderflow: args => `O valor deve ser ${args.minValue} ou posterior.`,
|
|
12745
|
+
rangeOverflow: args => `O valor deve ser ${args.maxValue} ou anterior.`,
|
|
12746
|
+
unavailableDate: 'Data selecionada indispon\u00edvel.'
|
|
12747
|
+
},
|
|
12748
|
+
'pt-PT': {
|
|
12749
|
+
rangeUnderflow: args => `O valor tem de ser ${args.minValue} ou posterior.`,
|
|
12750
|
+
rangeOverflow: args => `O valor tem de ser ${args.maxValue} ou anterior.`,
|
|
12751
|
+
unavailableDate: 'Data selecionada indispon\u00edvel.'
|
|
12752
|
+
},
|
|
12753
|
+
'pl-PL': {
|
|
12754
|
+
rangeUnderflow: args => `Warto\u015b\u0107 musi wynosi\u0107 ${args.minValue} lub p\u00f3\u017aniej.`,
|
|
12755
|
+
rangeOverflow: args => `Warto\u015b\u0107 musi wynosi\u0107 ${args.maxValue} lub wcze\u015bniej.`,
|
|
12756
|
+
unavailableDate: 'Wybrana data jest niedost\u0119pna.'
|
|
12757
|
+
},
|
|
12758
|
+
'nl-NL': {
|
|
12759
|
+
rangeUnderflow: args => `Waarde moet ${args.minValue} of later zijn.`,
|
|
12760
|
+
rangeOverflow: args => `Waarde moet ${args.maxValue} of eerder zijn.`,
|
|
12761
|
+
unavailableDate: 'Geselecteerde datum niet beschikbaar.'
|
|
12762
|
+
},
|
|
12763
|
+
'it-IT': {
|
|
12764
|
+
rangeUnderflow: args => `Il valore deve essere ${args.minValue} o successivo.`,
|
|
12765
|
+
rangeOverflow: args => `Il valore deve essere ${args.maxValue} o precedente.`,
|
|
12766
|
+
unavailableDate: 'Data selezionata non disponibile.'
|
|
12767
|
+
},
|
|
12768
|
+
'ja-JP': {
|
|
12769
|
+
rangeUnderflow: args => `\u5024\u306f${args.minValue}\u4ee5\u964d\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002`,
|
|
12770
|
+
rangeOverflow: args => `\u5024\u306f${args.maxValue}\u4ee5\u524d\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002`,
|
|
12771
|
+
unavailableDate: '\u9078\u629e\u3057\u305f\u65e5\u4ed8\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002'
|
|
12772
|
+
},
|
|
12773
|
+
'ko-KR': {
|
|
12774
|
+
rangeUnderflow: args => `\uac12\uc740 ${args.minValue} \uc774\ud6c4\uc5ec\uc57c \ud569\ub2c8\ub2e4.`,
|
|
12775
|
+
rangeOverflow: args => `\uac12\uc740 ${args.maxValue} \uc774\uc804\uc774\uc5b4\uc57c \ud569\ub2c8\ub2e4.`,
|
|
12776
|
+
unavailableDate: '\uc120\ud0dd\ud55c \ub0a0\uc9dc\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.'
|
|
12777
|
+
},
|
|
12778
|
+
'zh-CN': {
|
|
12779
|
+
rangeUnderflow: args => `\u503c\u5fc5\u987b\u4e3a ${args.minValue} \u6216\u66f4\u665a\u3002`,
|
|
12780
|
+
rangeOverflow: args => `\u503c\u5fc5\u987b\u4e3a ${args.maxValue} \u6216\u66f4\u65e9\u3002`,
|
|
12781
|
+
unavailableDate: '\u6240\u9009\u65e5\u671f\u4e0d\u53ef\u7528\u3002'
|
|
12782
|
+
},
|
|
12783
|
+
'zh-TW': {
|
|
12784
|
+
rangeUnderflow: args => `\u503c\u5fc5\u9808\u70ba ${args.minValue} \u6216\u66f4\u665a\u3002`,
|
|
12785
|
+
rangeOverflow: args => `\u503c\u5fc5\u9808\u70ba ${args.maxValue} \u6216\u66f4\u65e9\u3002`,
|
|
12786
|
+
unavailableDate: '\u6240\u9078\u65e5\u671f\u4e0d\u53ef\u7528\u3002'
|
|
12787
|
+
},
|
|
12788
|
+
'ru-RU': {
|
|
12789
|
+
rangeUnderflow: args => `\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c ${args.minValue} \u0438\u043b\u0438 \u043f\u043e\u0437\u0436\u0435.`,
|
|
12790
|
+
rangeOverflow: args => `\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c ${args.maxValue} \u0438\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435.`,
|
|
12791
|
+
unavailableDate: '\u0412\u044b\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u0434\u0430\u0442\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430.'
|
|
12792
|
+
},
|
|
12793
|
+
'uk-UA': {
|
|
12794
|
+
rangeUnderflow: args => `\u0417\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u043c\u0430\u0454 \u0431\u0443\u0442\u0438 ${args.minValue} \u0430\u0431\u043e \u043f\u0456\u0437\u043d\u0456\u0448\u0435.`,
|
|
12795
|
+
rangeOverflow: args => `\u0417\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u043c\u0430\u0454 \u0431\u0443\u0442\u0438 ${args.maxValue} \u0430\u0431\u043e \u0440\u0430\u043d\u0456\u0448\u0435.`,
|
|
12796
|
+
unavailableDate: '\u0412\u0438\u0431\u0440\u0430\u043d\u0430 \u0434\u0430\u0442\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430.'
|
|
12797
|
+
},
|
|
12798
|
+
'ar-AE': {
|
|
12799
|
+
rangeUnderflow: args => `\u064a\u062c\u0628 \u0623\u0646 \u062a\u0643\u0648\u0646 \u0627\u0644\u0642\u064a\u0645\u0629 ${args.minValue} \u0623\u0648 \u0623\u062d\u062f\u062b.`,
|
|
12800
|
+
rangeOverflow: args => `\u064a\u062c\u0628 \u0623\u0646 \u062a\u0643\u0648\u0646 \u0627\u0644\u0642\u064a\u0645\u0629 ${args.maxValue} \u0623\u0648 \u0623\u0642\u062f\u0645.`,
|
|
12801
|
+
unavailableDate: '\u0627\u0644\u062a\u0627\u0631\u064a\u062e \u0627\u0644\u0645\u062d\u062f\u062f \u063a\u064a\u0631 \u0645\u062a\u0627\u062d.'
|
|
12802
|
+
},
|
|
12803
|
+
'fi-FI': {
|
|
12804
|
+
rangeUnderflow: args => `Arvon on oltava ${args.minValue} tai my\u00f6hempi.`,
|
|
12805
|
+
rangeOverflow: args => `Arvon on oltava ${args.maxValue} tai aikaisempi.`,
|
|
12806
|
+
unavailableDate: 'Valittu p\u00e4iv\u00e4m\u00e4\u00e4r\u00e4 ei ole k\u00e4ytett\u00e4viss\u00e4.'
|
|
12807
|
+
}
|
|
12808
|
+
};
|
|
12809
|
+
const englishFallback = allTranslations['en-US'];
|
|
12810
|
+
|
|
12811
|
+
/**
|
|
12812
|
+
* Find the best matching locale from available translations.
|
|
12813
|
+
* Tries exact match first (e.g. "nb-NO"), then language prefix match (e.g. "nb" → "nb-NO").
|
|
12814
|
+
*/
|
|
12815
|
+
function findLocaleMessages(locale) {
|
|
12816
|
+
if (allTranslations[locale]) return allTranslations[locale];
|
|
12817
|
+
const language = Intl.Locale ? new Intl.Locale(locale).language : locale.split('-')[0];
|
|
12818
|
+
|
|
12819
|
+
// First match wins: e.g. "pt" → "pt-BR", "zh" → "zh-CN"
|
|
12820
|
+
for (const key of Object.keys(allTranslations)) {
|
|
12821
|
+
const keyLang = key.split('-')[0];
|
|
12822
|
+
if (keyLang === language) return allTranslations[key];
|
|
12823
|
+
}
|
|
12824
|
+
return englishFallback;
|
|
12825
|
+
}
|
|
12826
|
+
function formatMessage(msg, args) {
|
|
12827
|
+
return typeof msg === 'function' ? msg(args) : msg;
|
|
12828
|
+
}
|
|
12829
|
+
|
|
12830
|
+
/**
|
|
12831
|
+
* Generates validation error messages using the provided locale instead of
|
|
12832
|
+
* navigator.language (which is what react-stately uses internally).
|
|
12833
|
+
*
|
|
12834
|
+
* This fixes the issue where validation messages appear in the browser's
|
|
12835
|
+
* language rather than the locale configured via I18nProvider.
|
|
12836
|
+
*/
|
|
12837
|
+
function getLocalizedValidationErrors(validationDetails, locale, minValue, maxValue, timezone) {
|
|
12838
|
+
const msgs = findLocaleMessages(locale);
|
|
12839
|
+
const dateFormatter = new date.DateFormatter(locale, {
|
|
12840
|
+
year: 'numeric',
|
|
12841
|
+
month: 'numeric',
|
|
12842
|
+
day: 'numeric'
|
|
12843
|
+
});
|
|
12844
|
+
const timeZone = timezone ?? dateFormatter.resolvedOptions().timeZone;
|
|
12845
|
+
const errors = [];
|
|
12846
|
+
if (validationDetails.rangeUnderflow && minValue && msgs.rangeUnderflow) {
|
|
12847
|
+
errors.push(formatMessage(msgs.rangeUnderflow, {
|
|
12848
|
+
minValue: dateFormatter.format(minValue.toDate(timeZone))
|
|
12849
|
+
}));
|
|
12850
|
+
}
|
|
12851
|
+
if (validationDetails.rangeOverflow && maxValue && msgs.rangeOverflow) {
|
|
12852
|
+
errors.push(formatMessage(msgs.rangeOverflow, {
|
|
12853
|
+
maxValue: dateFormatter.format(maxValue.toDate(timeZone))
|
|
12854
|
+
}));
|
|
12855
|
+
}
|
|
12856
|
+
// react-stately maps isDateUnavailable to badInput (not customError)
|
|
12857
|
+
if (validationDetails.badInput && msgs.unavailableDate) {
|
|
12858
|
+
errors.push(formatMessage(msgs.unavailableDate, {}));
|
|
12859
|
+
}
|
|
12860
|
+
return errors;
|
|
12861
|
+
}
|
|
12862
|
+
|
|
12681
12863
|
const DatePicker = /*#__PURE__*/react.forwardRef(({
|
|
12682
12864
|
onChange,
|
|
12683
12865
|
label,
|
|
@@ -12772,8 +12954,10 @@ const DatePicker = /*#__PURE__*/react.forwardRef(({
|
|
|
12772
12954
|
fieldProps,
|
|
12773
12955
|
calendarProps
|
|
12774
12956
|
} = reactAria.useDatePicker(dateCreateProps, pickerState, ref);
|
|
12957
|
+
const localizedErrors = pickerState.displayValidation.isInvalid ? getLocalizedValidationErrors(pickerState.displayValidation.validationDetails, locale, _minValue, _maxValue, timezone) : [];
|
|
12958
|
+
const errorMessages = localizedErrors.length > 0 ? localizedErrors : pickerState.displayValidation.validationErrors;
|
|
12775
12959
|
const helperPropsInvalid = pickerState.displayValidation.isInvalid ? {
|
|
12776
|
-
text:
|
|
12960
|
+
text: errorMessages.join('\n'),
|
|
12777
12961
|
color: edsTokens.tokens.colors.interactive.warning__text.rgba,
|
|
12778
12962
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icon$1, {
|
|
12779
12963
|
size: 16,
|
|
@@ -13023,8 +13207,10 @@ const DateRangePicker = /*#__PURE__*/react.forwardRef(({
|
|
|
13023
13207
|
buttonProps,
|
|
13024
13208
|
calendarProps
|
|
13025
13209
|
} = reactAria.useDateRangePicker(dateRangePickerStateProps, state, ref);
|
|
13210
|
+
const localizedErrors = state.displayValidation.isInvalid ? getLocalizedValidationErrors(state.displayValidation.validationDetails, locale, _minValue, _maxValue, timezone) : [];
|
|
13211
|
+
const errorMessages = localizedErrors.length > 0 ? localizedErrors : state.displayValidation.validationErrors;
|
|
13026
13212
|
const helperProps = state.displayValidation.isInvalid ? {
|
|
13027
|
-
text:
|
|
13213
|
+
text: errorMessages.join('\n'),
|
|
13028
13214
|
color: edsTokens.tokens.colors.interactive.warning__text.rgba,
|
|
13029
13215
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icon$1, {
|
|
13030
13216
|
size: 16,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useFloating, offset, flip, size } from '@floating-ui/react';
|
|
2
|
-
import styled, {
|
|
2
|
+
import styled, { ThemeProvider, css } from 'styled-components';
|
|
3
3
|
import { Button } from '../Button/index.js';
|
|
4
4
|
import { AutocompleteContext } from './AutocompleteContext.js';
|
|
5
5
|
import { MultipleInput } from './MultipleInput.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createContext,
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
2
|
|
|
3
3
|
const AutocompleteContext = /*#__PURE__*/createContext(null);
|
|
4
4
|
const useAutocompleteContext = () => {
|
|
5
|
-
const context =
|
|
5
|
+
const context = useContext(AutocompleteContext);
|
|
6
6
|
if (!context) {
|
|
7
7
|
throw new Error('Autocomplete compound components must be used within an Autocomplete component');
|
|
8
8
|
}
|
|
@@ -48,7 +48,9 @@ function Option({
|
|
|
48
48
|
const isSelected = selectedItemsLabels.includes(label);
|
|
49
49
|
const optionComponent = _optionComponent?.(item, isSelected);
|
|
50
50
|
const highlighted = highlightedIndex === index && !isDisabled ? 'true' : 'false';
|
|
51
|
-
|
|
51
|
+
|
|
52
|
+
// Guard: downshift 9.x validates that item exists in the items array
|
|
53
|
+
const itemProps = item !== undefined ? getItemProps({
|
|
52
54
|
...(multiline && {
|
|
53
55
|
ref: rowVirtualizer.measureElement
|
|
54
56
|
}),
|
|
@@ -60,7 +62,14 @@ function Option({
|
|
|
60
62
|
height: `${virtualItem.size}px`
|
|
61
63
|
})
|
|
62
64
|
}
|
|
63
|
-
})
|
|
65
|
+
}) : {
|
|
66
|
+
style: {
|
|
67
|
+
transform: `translateY(${virtualItem.start}px)`,
|
|
68
|
+
...(!multiline && {
|
|
69
|
+
height: `${virtualItem.size}px`
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
};
|
|
64
73
|
return /*#__PURE__*/jsxs(StyledListItem, {
|
|
65
74
|
$isdisabled: isDisabled ? 'true' : 'false',
|
|
66
75
|
$highlighted: highlighted,
|
|
@@ -41,10 +41,12 @@ const OptionList = ({
|
|
|
41
41
|
|
|
42
42
|
// MARK: popover toggle
|
|
43
43
|
useIsomorphicLayoutEffect(() => {
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
if (refs.floating.current?.hasAttribute('popover')) {
|
|
45
|
+
if (isOpen) {
|
|
46
|
+
refs.floating.current.showPopover();
|
|
47
|
+
} else {
|
|
48
|
+
refs.floating.current.hidePopover();
|
|
49
|
+
}
|
|
48
50
|
}
|
|
49
51
|
}, [isOpen, refs.floating]);
|
|
50
52
|
const showNoOptions = isOpen && !availableItems.length && noOptionsText.length > 0;
|
|
@@ -112,7 +112,13 @@ const useAutocomplete = ({
|
|
|
112
112
|
...multipleSelectionProps,
|
|
113
113
|
onSelectedItemsChange: changes => {
|
|
114
114
|
if (onOptionsChange) {
|
|
115
|
-
|
|
115
|
+
// AddSymbol/AllSymbol are handled manually in onStateChange,
|
|
116
|
+
// so skip propagating when they appear in selectedItems
|
|
117
|
+
// (downshift 9.x propagates selectedItem to useMultipleSelection)
|
|
118
|
+
if (changes.selectedItems.some(item => item === AllSymbol || item === AddSymbol)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
let selectedItems = changes.selectedItems;
|
|
116
122
|
if (itemCompare) {
|
|
117
123
|
selectedItems = inputOptions.filter(item => selectedItems.some(compare => itemCompare(item, compare)));
|
|
118
124
|
}
|
|
@@ -269,6 +275,9 @@ const useAutocomplete = ({
|
|
|
269
275
|
toggleAllSelected();
|
|
270
276
|
} else if (selectedItem === AddSymbol && typedInputValue.trim()) {
|
|
271
277
|
onAddNewOption?.(typedInputValue);
|
|
278
|
+
if (clearSearchOnChange) {
|
|
279
|
+
setTypedInputValue('');
|
|
280
|
+
}
|
|
272
281
|
} else if (multiple) {
|
|
273
282
|
const shouldRemove = itemCompare ? selectedItems.some(i => itemCompare(selectedItem, i)) : selectedItems.includes(selectedItem);
|
|
274
283
|
if (shouldRemove) {
|
|
@@ -494,7 +503,9 @@ const useAutocomplete = ({
|
|
|
494
503
|
};
|
|
495
504
|
case useCombobox.stateChangeTypes.InputKeyDownEnter:
|
|
496
505
|
case useCombobox.stateChangeTypes.ItemClick:
|
|
497
|
-
|
|
506
|
+
// Don't clear typedInputValue for AddSymbol — onStateChange needs
|
|
507
|
+
// it to call onAddNewOption (downshift 9.x runs onStateChange after re-render)
|
|
508
|
+
if (clearSearchOnChange && changes.selectedItem !== AddSymbol) {
|
|
498
509
|
setTypedInputValue('');
|
|
499
510
|
}
|
|
500
511
|
return {
|
|
@@ -74,11 +74,7 @@ const info = {
|
|
|
74
74
|
color: infoColor
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
}
|
|
78
|
-
modes: {
|
|
79
|
-
compact: {}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
77
|
+
}};
|
|
82
78
|
const warning = {
|
|
83
79
|
entities: {
|
|
84
80
|
icon: {
|
|
@@ -87,10 +83,6 @@ const warning = {
|
|
|
87
83
|
color: warningColor
|
|
88
84
|
}
|
|
89
85
|
}
|
|
90
|
-
}
|
|
91
|
-
modes: {
|
|
92
|
-
compact: {}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
86
|
+
}};
|
|
95
87
|
|
|
96
88
|
export { enabled, info, warning };
|
|
@@ -85,7 +85,7 @@ const Chip = /*#__PURE__*/forwardRef(function Chip({
|
|
|
85
85
|
};
|
|
86
86
|
const resizedChildren = Children.map(children, child => {
|
|
87
87
|
// We force size on Icon & Avatar component
|
|
88
|
-
if (child
|
|
88
|
+
if (child?.props) {
|
|
89
89
|
return /*#__PURE__*/cloneElement(child, {
|
|
90
90
|
size: 16,
|
|
91
91
|
disabled
|
|
@@ -13,6 +13,7 @@ import { tokens } from '@equinor/eds-tokens';
|
|
|
13
13
|
import { Icon } from '../Icon/index.js';
|
|
14
14
|
import { getCalendarDate } from './utils/get-calendar-date.js';
|
|
15
15
|
import { useGetLocale } from './utils/useGetLocale.js';
|
|
16
|
+
import { getLocalizedValidationErrors } from './utils/getLocalizedValidationErrors.js';
|
|
16
17
|
import { jsx } from 'react/jsx-runtime';
|
|
17
18
|
|
|
18
19
|
const DatePicker = /*#__PURE__*/forwardRef(({
|
|
@@ -109,8 +110,10 @@ const DatePicker = /*#__PURE__*/forwardRef(({
|
|
|
109
110
|
fieldProps,
|
|
110
111
|
calendarProps
|
|
111
112
|
} = useDatePicker(dateCreateProps, pickerState, ref);
|
|
113
|
+
const localizedErrors = pickerState.displayValidation.isInvalid ? getLocalizedValidationErrors(pickerState.displayValidation.validationDetails, locale, _minValue, _maxValue, timezone) : [];
|
|
114
|
+
const errorMessages = localizedErrors.length > 0 ? localizedErrors : pickerState.displayValidation.validationErrors;
|
|
112
115
|
const helperPropsInvalid = pickerState.displayValidation.isInvalid ? {
|
|
113
|
-
text:
|
|
116
|
+
text: errorMessages.join('\n'),
|
|
114
117
|
color: tokens.colors.interactive.warning__text.rgba,
|
|
115
118
|
icon: /*#__PURE__*/jsx(Icon, {
|
|
116
119
|
size: 16,
|