@equinor/eds-core-react 2.3.2 → 2.3.4-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/README.md +16 -1
- package/build/index.css +143 -277
- package/build/index.min.css +1 -5
- package/dist/eds-core-react.cjs +229 -30
- package/dist/esm/components/Autocomplete/AddNewOption.js +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/esm/components/Autocomplete/MultipleInput.js +21 -5
- package/dist/esm/components/Autocomplete/Option.js +11 -2
- 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/fields/DateFieldSegments.js +11 -2
- 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/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 +3 -5
- package/dist/esm-next/components/next/Input/Input.js +6 -11
- package/dist/esm-next/components/next/TextField/TextField.js +7 -2
- package/dist/esm-next/index.next.js +4 -4
- package/dist/index.next.cjs +15 -18
- 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/Typography/index.d.ts +1 -0
- 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 +41 -34
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { useDateFieldState } from '@react-stately/datepicker';
|
|
2
2
|
import { useDateField } from 'react-aria';
|
|
3
|
-
import { createCalendar } from '@internationalized/date';
|
|
3
|
+
import { CalendarDate, createCalendar } from '@internationalized/date';
|
|
4
4
|
import { DateSegment } from './DateSegment.js';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
// In some cases we need to use the index as key
|
|
9
9
|
/* eslint-disable react/no-array-index-key */
|
|
10
|
+
// Use January 1st as placeholder when no value is set.
|
|
11
|
+
// This ensures the day segment allows values up to 31,
|
|
12
|
+
// preventing eager auto-advance when typing "3" (which
|
|
13
|
+
// would otherwise auto-complete to "03" in months with
|
|
14
|
+
// fewer than 30 days, like February).
|
|
15
|
+
const DEFAULT_PLACEHOLDER = new CalendarDate(new Date().getFullYear(), 1, 1);
|
|
16
|
+
|
|
10
17
|
/**
|
|
11
18
|
* A field that wraps segments for inputting a date / date-time
|
|
12
19
|
*/
|
|
13
20
|
const DateFieldSegments = /*#__PURE__*/forwardRef((props, ref) => {
|
|
21
|
+
const placeholderValue = props.placeholderValue ?? DEFAULT_PLACEHOLDER;
|
|
14
22
|
const state = useDateFieldState({
|
|
15
23
|
...props,
|
|
16
24
|
locale: props.locale,
|
|
17
|
-
createCalendar
|
|
25
|
+
createCalendar,
|
|
26
|
+
placeholderValue
|
|
18
27
|
});
|
|
19
28
|
const {
|
|
20
29
|
fieldProps
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toCalendarDateTime,
|
|
1
|
+
import { toCalendarDateTime, fromDate, toCalendarDate } from '@internationalized/date';
|
|
2
2
|
|
|
3
3
|
const getCalendarDate = (value, timezone, showTimeInput = false) => {
|
|
4
4
|
if (!value) return null;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { DateFormatter } from '@internationalized/date';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Validation message translations matching @react-stately/datepicker's built-in messages.
|
|
5
|
+
* Sourced from @react-stately/datepicker's intlStrings bundle.
|
|
6
|
+
* Unsupported locales fall back to English.
|
|
7
|
+
*/
|
|
8
|
+
const allTranslations = {
|
|
9
|
+
'en-US': {
|
|
10
|
+
rangeUnderflow: args => `Value must be ${args.minValue} or later.`,
|
|
11
|
+
rangeOverflow: args => `Value must be ${args.maxValue} or earlier.`,
|
|
12
|
+
unavailableDate: 'Selected date unavailable.'
|
|
13
|
+
},
|
|
14
|
+
'nb-NO': {
|
|
15
|
+
rangeUnderflow: args => `Verdien m\u00e5 v\u00e6re ${args.minValue} eller senere.`,
|
|
16
|
+
rangeOverflow: args => `Verdien m\u00e5 v\u00e6re ${args.maxValue} eller tidligere.`,
|
|
17
|
+
unavailableDate: 'Valgt dato utilgjengelig.'
|
|
18
|
+
},
|
|
19
|
+
'da-DK': {
|
|
20
|
+
rangeUnderflow: args => `V\u00e6rdien skal v\u00e6re ${args.minValue} eller senere.`,
|
|
21
|
+
rangeOverflow: args => `V\u00e6rdien skal v\u00e6re ${args.maxValue} eller tidligere.`,
|
|
22
|
+
unavailableDate: 'Den valgte dato er ikke tilg\u00e6ngelig.'
|
|
23
|
+
},
|
|
24
|
+
'sv-SE': {
|
|
25
|
+
rangeUnderflow: args => `V\u00e4rdet m\u00e5ste vara ${args.minValue} eller senare.`,
|
|
26
|
+
rangeOverflow: args => `V\u00e4rdet m\u00e5ste vara ${args.maxValue} eller tidigare.`,
|
|
27
|
+
unavailableDate: 'Valt datum \u00e4r inte tillg\u00e4ngligt.'
|
|
28
|
+
},
|
|
29
|
+
'de-DE': {
|
|
30
|
+
rangeUnderflow: args => `Der Wert muss ${args.minValue} oder sp\u00e4ter sein.`,
|
|
31
|
+
rangeOverflow: args => `Der Wert muss ${args.maxValue} oder fr\u00fcher sein.`,
|
|
32
|
+
unavailableDate: 'Das ausgew\u00e4hlte Datum ist nicht verf\u00fcgbar.'
|
|
33
|
+
},
|
|
34
|
+
'fr-FR': {
|
|
35
|
+
rangeUnderflow: args => `La valeur doit \u00eatre ${args.minValue} ou ult\u00e9rieure.`,
|
|
36
|
+
rangeOverflow: args => `La valeur doit \u00eatre ${args.maxValue} ou ant\u00e9rieure.`,
|
|
37
|
+
unavailableDate: 'Date s\u00e9lectionn\u00e9e non disponible.'
|
|
38
|
+
},
|
|
39
|
+
'es-ES': {
|
|
40
|
+
rangeUnderflow: args => `El valor debe ser ${args.minValue} o posterior.`,
|
|
41
|
+
rangeOverflow: args => `El valor debe ser ${args.maxValue} o anterior.`,
|
|
42
|
+
unavailableDate: 'Fecha seleccionada no disponible.'
|
|
43
|
+
},
|
|
44
|
+
'pt-BR': {
|
|
45
|
+
rangeUnderflow: args => `O valor deve ser ${args.minValue} ou posterior.`,
|
|
46
|
+
rangeOverflow: args => `O valor deve ser ${args.maxValue} ou anterior.`,
|
|
47
|
+
unavailableDate: 'Data selecionada indispon\u00edvel.'
|
|
48
|
+
},
|
|
49
|
+
'pt-PT': {
|
|
50
|
+
rangeUnderflow: args => `O valor tem de ser ${args.minValue} ou posterior.`,
|
|
51
|
+
rangeOverflow: args => `O valor tem de ser ${args.maxValue} ou anterior.`,
|
|
52
|
+
unavailableDate: 'Data selecionada indispon\u00edvel.'
|
|
53
|
+
},
|
|
54
|
+
'pl-PL': {
|
|
55
|
+
rangeUnderflow: args => `Warto\u015b\u0107 musi wynosi\u0107 ${args.minValue} lub p\u00f3\u017aniej.`,
|
|
56
|
+
rangeOverflow: args => `Warto\u015b\u0107 musi wynosi\u0107 ${args.maxValue} lub wcze\u015bniej.`,
|
|
57
|
+
unavailableDate: 'Wybrana data jest niedost\u0119pna.'
|
|
58
|
+
},
|
|
59
|
+
'nl-NL': {
|
|
60
|
+
rangeUnderflow: args => `Waarde moet ${args.minValue} of later zijn.`,
|
|
61
|
+
rangeOverflow: args => `Waarde moet ${args.maxValue} of eerder zijn.`,
|
|
62
|
+
unavailableDate: 'Geselecteerde datum niet beschikbaar.'
|
|
63
|
+
},
|
|
64
|
+
'it-IT': {
|
|
65
|
+
rangeUnderflow: args => `Il valore deve essere ${args.minValue} o successivo.`,
|
|
66
|
+
rangeOverflow: args => `Il valore deve essere ${args.maxValue} o precedente.`,
|
|
67
|
+
unavailableDate: 'Data selezionata non disponibile.'
|
|
68
|
+
},
|
|
69
|
+
'ja-JP': {
|
|
70
|
+
rangeUnderflow: args => `\u5024\u306f${args.minValue}\u4ee5\u964d\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002`,
|
|
71
|
+
rangeOverflow: args => `\u5024\u306f${args.maxValue}\u4ee5\u524d\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002`,
|
|
72
|
+
unavailableDate: '\u9078\u629e\u3057\u305f\u65e5\u4ed8\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002'
|
|
73
|
+
},
|
|
74
|
+
'ko-KR': {
|
|
75
|
+
rangeUnderflow: args => `\uac12\uc740 ${args.minValue} \uc774\ud6c4\uc5ec\uc57c \ud569\ub2c8\ub2e4.`,
|
|
76
|
+
rangeOverflow: args => `\uac12\uc740 ${args.maxValue} \uc774\uc804\uc774\uc5b4\uc57c \ud569\ub2c8\ub2e4.`,
|
|
77
|
+
unavailableDate: '\uc120\ud0dd\ud55c \ub0a0\uc9dc\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.'
|
|
78
|
+
},
|
|
79
|
+
'zh-CN': {
|
|
80
|
+
rangeUnderflow: args => `\u503c\u5fc5\u987b\u4e3a ${args.minValue} \u6216\u66f4\u665a\u3002`,
|
|
81
|
+
rangeOverflow: args => `\u503c\u5fc5\u987b\u4e3a ${args.maxValue} \u6216\u66f4\u65e9\u3002`,
|
|
82
|
+
unavailableDate: '\u6240\u9009\u65e5\u671f\u4e0d\u53ef\u7528\u3002'
|
|
83
|
+
},
|
|
84
|
+
'zh-TW': {
|
|
85
|
+
rangeUnderflow: args => `\u503c\u5fc5\u9808\u70ba ${args.minValue} \u6216\u66f4\u665a\u3002`,
|
|
86
|
+
rangeOverflow: args => `\u503c\u5fc5\u9808\u70ba ${args.maxValue} \u6216\u66f4\u65e9\u3002`,
|
|
87
|
+
unavailableDate: '\u6240\u9078\u65e5\u671f\u4e0d\u53ef\u7528\u3002'
|
|
88
|
+
},
|
|
89
|
+
'ru-RU': {
|
|
90
|
+
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.`,
|
|
91
|
+
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.`,
|
|
92
|
+
unavailableDate: '\u0412\u044b\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u0434\u0430\u0442\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430.'
|
|
93
|
+
},
|
|
94
|
+
'uk-UA': {
|
|
95
|
+
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.`,
|
|
96
|
+
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.`,
|
|
97
|
+
unavailableDate: '\u0412\u0438\u0431\u0440\u0430\u043d\u0430 \u0434\u0430\u0442\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430.'
|
|
98
|
+
},
|
|
99
|
+
'ar-AE': {
|
|
100
|
+
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.`,
|
|
101
|
+
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.`,
|
|
102
|
+
unavailableDate: '\u0627\u0644\u062a\u0627\u0631\u064a\u062e \u0627\u0644\u0645\u062d\u062f\u062f \u063a\u064a\u0631 \u0645\u062a\u0627\u062d.'
|
|
103
|
+
},
|
|
104
|
+
'fi-FI': {
|
|
105
|
+
rangeUnderflow: args => `Arvon on oltava ${args.minValue} tai my\u00f6hempi.`,
|
|
106
|
+
rangeOverflow: args => `Arvon on oltava ${args.maxValue} tai aikaisempi.`,
|
|
107
|
+
unavailableDate: 'Valittu p\u00e4iv\u00e4m\u00e4\u00e4r\u00e4 ei ole k\u00e4ytett\u00e4viss\u00e4.'
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const englishFallback = allTranslations['en-US'];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Find the best matching locale from available translations.
|
|
114
|
+
* Tries exact match first (e.g. "nb-NO"), then language prefix match (e.g. "nb" → "nb-NO").
|
|
115
|
+
*/
|
|
116
|
+
function findLocaleMessages(locale) {
|
|
117
|
+
if (allTranslations[locale]) return allTranslations[locale];
|
|
118
|
+
const language = Intl.Locale ? new Intl.Locale(locale).language : locale.split('-')[0];
|
|
119
|
+
|
|
120
|
+
// First match wins: e.g. "pt" → "pt-BR", "zh" → "zh-CN"
|
|
121
|
+
for (const key of Object.keys(allTranslations)) {
|
|
122
|
+
const keyLang = key.split('-')[0];
|
|
123
|
+
if (keyLang === language) return allTranslations[key];
|
|
124
|
+
}
|
|
125
|
+
return englishFallback;
|
|
126
|
+
}
|
|
127
|
+
function formatMessage(msg, args) {
|
|
128
|
+
return typeof msg === 'function' ? msg(args) : msg;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Generates validation error messages using the provided locale instead of
|
|
133
|
+
* navigator.language (which is what react-stately uses internally).
|
|
134
|
+
*
|
|
135
|
+
* This fixes the issue where validation messages appear in the browser's
|
|
136
|
+
* language rather than the locale configured via I18nProvider.
|
|
137
|
+
*/
|
|
138
|
+
function getLocalizedValidationErrors(validationDetails, locale, minValue, maxValue, timezone) {
|
|
139
|
+
const msgs = findLocaleMessages(locale);
|
|
140
|
+
const dateFormatter = new DateFormatter(locale, {
|
|
141
|
+
year: 'numeric',
|
|
142
|
+
month: 'numeric',
|
|
143
|
+
day: 'numeric'
|
|
144
|
+
});
|
|
145
|
+
const timeZone = timezone ?? dateFormatter.resolvedOptions().timeZone;
|
|
146
|
+
const errors = [];
|
|
147
|
+
if (validationDetails.rangeUnderflow && minValue && msgs.rangeUnderflow) {
|
|
148
|
+
errors.push(formatMessage(msgs.rangeUnderflow, {
|
|
149
|
+
minValue: dateFormatter.format(minValue.toDate(timeZone))
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
if (validationDetails.rangeOverflow && maxValue && msgs.rangeOverflow) {
|
|
153
|
+
errors.push(formatMessage(msgs.rangeOverflow, {
|
|
154
|
+
maxValue: dateFormatter.format(maxValue.toDate(timeZone))
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
// react-stately maps isDateUnavailable to badInput (not customError)
|
|
158
|
+
if (validationDetails.badInput && msgs.unavailableDate) {
|
|
159
|
+
errors.push(formatMessage(msgs.unavailableDate, {}));
|
|
160
|
+
}
|
|
161
|
+
return errors;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export { getLocalizedValidationErrors };
|
|
@@ -20,7 +20,7 @@ const StyledTableCell = styled.td.withConfig({
|
|
|
20
20
|
align
|
|
21
21
|
} = theme;
|
|
22
22
|
const backgroundColor = color === 'error' ? theme.validation.error?.background : '';
|
|
23
|
-
const base = css(["min-height:", ";height:", ";background:", ";vertical-align:", ";box-sizing:border-box;", " ", " ", ""], height, height, backgroundColor, align.vertical, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(border));
|
|
23
|
+
const base = css(["min-height:", ";height:", ";background:", ";vertical-align:", ";box-sizing:border-box;", " ", " ", " a{font-size:inherit;font-weight:inherit;}"], height, height, backgroundColor, align.vertical, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(border));
|
|
24
24
|
return base;
|
|
25
25
|
});
|
|
26
26
|
const TableDataCell = /*#__PURE__*/forwardRef(function TableDataCell({
|
|
@@ -19,7 +19,7 @@ const StyledTableCell = styled.th.withConfig({
|
|
|
19
19
|
typography,
|
|
20
20
|
spacings
|
|
21
21
|
} = theme;
|
|
22
|
-
return css(["min-height:", ";height:", ";background:", ";box-sizing:border-box;", " ", " ", " ", ""], height, height, background, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(theme.border), $sticky ? css(["position:sticky;bottom:0;z-index:2;"]) : '');
|
|
22
|
+
return css(["min-height:", ";height:", ";background:", ";box-sizing:border-box;", " ", " ", " a{font-size:inherit;font-weight:inherit;}", ""], height, height, background, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(theme.border), $sticky ? css(["position:sticky;bottom:0;z-index:2;"]) : '');
|
|
23
23
|
});
|
|
24
24
|
const CellInner = styled.div.withConfig({
|
|
25
25
|
displayName: "FooterCell__CellInner",
|
|
@@ -34,7 +34,7 @@ const StyledTableCell = styled.th.withConfig({
|
|
|
34
34
|
// Firefox specific workaround (bug in v142.0) - see issue #3910
|
|
35
35
|
// Hardcoded padding values compensate for Firefox's incorrect table cell height calculation
|
|
36
36
|
const firefoxFix = isFirefox() ? css(["vertical-align:top;height:auto;min-height:", ";> div{padding:", " 0;}"], height, $density === 'compact' ? '7px' : '13px') : css([""]);
|
|
37
|
-
return css(["min-height:", ";height:", ";background:", ";box-sizing:border-box;", " ", " ", " ", " ", " ", " ", ""], height, height, background, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(theme.border), sortStylingHover, sortStylingActive, firefoxFix, $sticky ? css(["position:sticky;top:0;z-index:1;"]) : '');
|
|
37
|
+
return css(["min-height:", ";height:", ";background:", ";box-sizing:border-box;", " ", " ", " ", " ", " ", " a{font-size:inherit;font-weight:inherit;}", ""], height, height, background, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(theme.border), sortStylingHover, sortStylingActive, firefoxFix, $sticky ? css(["position:sticky;top:0;z-index:1;"]) : '');
|
|
38
38
|
});
|
|
39
39
|
const CellInner = styled.div.withConfig({
|
|
40
40
|
displayName: "HeaderCell__CellInner",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { typographyTemplate, outlineTemplate } from '@equinor/eds-utils';
|
|
4
|
-
import { quickVariants, typography,
|
|
4
|
+
import { quickVariants, typography, link, colors } from './Typography.tokens.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
const getElementType = (variant, link) => {
|
package/dist/esm/index.js
CHANGED
|
@@ -16,85 +16,85 @@ export { Progress } from './components/Progress/index.js';
|
|
|
16
16
|
export { Breadcrumbs } from './components/Breadcrumbs/index.js';
|
|
17
17
|
export { Menu } from './components/Menu/index.js';
|
|
18
18
|
export { SideBar } from './components/SideBar/index.js';
|
|
19
|
-
export { ButtonGroup } from './components/Button/ButtonGroup/ButtonGroup.js';
|
|
20
|
-
export { ToggleButton } from './components/Button/ToggleButton/ToggleButton.js';
|
|
21
|
-
export { TypographyNext } from './components/Typography/Typography.new.js';
|
|
22
|
-
export { Heading } from './components/Typography/Heading.js';
|
|
23
|
-
export { Paragraph } from './components/Typography/Paragraph.js';
|
|
24
|
-
export { Typography } from './components/Typography/Typography.js';
|
|
25
|
-
export { Body as TableBody } from './components/Table/Body.js';
|
|
26
|
-
export { Cell as TableCell } from './components/Table/Cell.js';
|
|
27
|
-
export { Head as TableHead } from './components/Table/Head/Head.js';
|
|
28
|
-
export { Foot as TableFoot } from './components/Table/Foot/Foot.js';
|
|
29
|
-
export { Row as TableRow } from './components/Table/Row/Row.js';
|
|
30
|
-
export { Caption as TableCaption } from './components/Table/Caption.js';
|
|
31
|
-
export { Divider } from './components/Divider/Divider.js';
|
|
32
|
-
export { TextField } from './components/TextField/TextField.js';
|
|
33
|
-
export { Textarea } from './components/Textarea/Textarea.js';
|
|
34
|
-
export { ListItem } from './components/List/ListItem.js';
|
|
35
|
-
export { AccordionItem } from './components/Accordion/AccordionItem.js';
|
|
36
19
|
export { AccordionHeader } from './components/Accordion/AccordionHeader.js';
|
|
37
|
-
export { AccordionHeaderTitle } from './components/Accordion/AccordionHeaderTitle.js';
|
|
38
20
|
export { AccordionHeaderActions } from './components/Accordion/AccordionHeaderActions.js';
|
|
21
|
+
export { AccordionHeaderTitle } from './components/Accordion/AccordionHeaderTitle.js';
|
|
22
|
+
export { AccordionItem } from './components/Accordion/AccordionItem.js';
|
|
39
23
|
export { AccordionPanel } from './components/Accordion/AccordionPanel.js';
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
24
|
+
export { AddSymbol, AllSymbol, Autocomplete, StyledButton, defaultOptionDisabled } from './components/Autocomplete/Autocomplete.js';
|
|
25
|
+
export { Avatar } from './components/Avatar/Avatar.js';
|
|
26
|
+
export { BannerActions } from './components/Banner/BannerActions.js';
|
|
27
|
+
export { BannerIcon } from './components/Banner/BannerIcon.js';
|
|
28
|
+
export { BannerMessage } from './components/Banner/BannerMessage.js';
|
|
29
|
+
export { Breadcrumb } from './components/Breadcrumbs/Breadcrumb.js';
|
|
30
|
+
export { ButtonGroup } from './components/Button/ButtonGroup/ButtonGroup.js';
|
|
44
31
|
export { CardActions } from './components/Card/CardActions.js';
|
|
45
32
|
export { CardContent } from './components/Card/CardContent.js';
|
|
46
33
|
export { CardHeader } from './components/Card/CardHeader.js';
|
|
47
|
-
export { CardMedia } from './components/Card/CardMedia.js';
|
|
48
34
|
export { CardHeaderTitle } from './components/Card/CardHeaderTitle.js';
|
|
49
|
-
export {
|
|
50
|
-
export {
|
|
51
|
-
export {
|
|
35
|
+
export { CardMedia } from './components/Card/CardMedia.js';
|
|
36
|
+
export { Checkbox } from './components/Checkbox/Checkbox.js';
|
|
37
|
+
export { Chip } from './components/Chip/Chip.js';
|
|
38
|
+
export { CircularProgress } from './components/Progress/Circular/CircularProgress.js';
|
|
39
|
+
export { DatePicker } from './components/Datepicker/DatePicker.js';
|
|
40
|
+
export { DateRangePicker } from './components/Datepicker/DateRangePicker.js';
|
|
52
41
|
export { DialogActions } from './components/Dialog/DialogActions.js';
|
|
53
|
-
export { DialogTitle } from './components/Dialog/DialogTitle.js';
|
|
54
42
|
export { DialogContent } from './components/Dialog/DialogContent.js';
|
|
55
43
|
export { DialogHeader } from './components/Dialog/DialogHeader.js';
|
|
56
|
-
export {
|
|
57
|
-
export {
|
|
58
|
-
export { SideSheet } from './components/SideSheet/SideSheet.js';
|
|
59
|
-
export { Chip } from './components/Chip/Chip.js';
|
|
60
|
-
export { Avatar } from './components/Avatar/Avatar.js';
|
|
61
|
-
export { Search } from './components/Search/Search.js';
|
|
62
|
-
export { Slider } from './components/Slider/Slider.js';
|
|
63
|
-
export { Tooltip } from './components/Tooltip/Tooltip.js';
|
|
64
|
-
export { SnackbarAction } from './components/Snackbar/SnackbarAction.js';
|
|
65
|
-
export { PopoverTitle } from './components/Popover/PopoverTitle.js';
|
|
66
|
-
export { PopoverContent } from './components/Popover/PopoverContent.js';
|
|
67
|
-
export { PopoverHeader } from './components/Popover/PopoverHeader.js';
|
|
68
|
-
export { PopoverActions } from './components/Popover/PopoverActions.js';
|
|
69
|
-
export { BannerIcon } from './components/Banner/BannerIcon.js';
|
|
70
|
-
export { BannerMessage } from './components/Banner/BannerMessage.js';
|
|
71
|
-
export { BannerActions } from './components/Banner/BannerActions.js';
|
|
72
|
-
export { LinearProgress } from './components/Progress/Linear/LinearProgress.js';
|
|
73
|
-
export { CircularProgress } from './components/Progress/Circular/CircularProgress.js';
|
|
74
|
-
export { StarProgress } from './components/Progress/Star/StarProgress.js';
|
|
44
|
+
export { DialogTitle } from './components/Dialog/DialogTitle.js';
|
|
45
|
+
export { Divider } from './components/Divider/Divider.js';
|
|
75
46
|
export { DotProgress } from './components/Progress/Dots/DotProgress.js';
|
|
76
|
-
export {
|
|
47
|
+
export { EdsProvider, useEds } from './components/EdsProvider/eds.context.js';
|
|
48
|
+
export { Heading } from './components/Typography/Heading.js';
|
|
49
|
+
export { Input } from './components/Input/Input.js';
|
|
50
|
+
export { InputWrapper } from './components/InputWrapper/InputWrapper.js';
|
|
51
|
+
export { Label } from './components/Label/Label.js';
|
|
52
|
+
export { LinearProgress } from './components/Progress/Linear/LinearProgress.js';
|
|
53
|
+
export { ListItem } from './components/List/ListItem.js';
|
|
77
54
|
export { MenuItem } from './components/Menu/MenuItem.js';
|
|
78
55
|
export { MenuSection } from './components/Menu/MenuSection.js';
|
|
79
|
-
export { Pagination } from './components/Pagination/Pagination.js';
|
|
80
56
|
export { NativeSelect } from './components/Select/NativeSelect.js';
|
|
81
|
-
export {
|
|
82
|
-
export { Input } from './components/Input/Input.js';
|
|
83
|
-
export { Checkbox } from './components/Checkbox/Checkbox.js';
|
|
84
|
-
export { Radio } from './components/Radio/Radio.js';
|
|
85
|
-
export { Switch } from './components/Switch/Switch.js';
|
|
86
|
-
export { EdsProvider, useEds } from './components/EdsProvider/eds.context.js';
|
|
57
|
+
export { Pagination } from './components/Pagination/Pagination.js';
|
|
87
58
|
export { Paper } from './components/Paper/Paper.js';
|
|
88
|
-
export {
|
|
89
|
-
export {
|
|
90
|
-
export {
|
|
91
|
-
export {
|
|
92
|
-
export {
|
|
59
|
+
export { Paragraph } from './components/Typography/Paragraph.js';
|
|
60
|
+
export { PopoverActions } from './components/Popover/PopoverActions.js';
|
|
61
|
+
export { PopoverContent } from './components/Popover/PopoverContent.js';
|
|
62
|
+
export { PopoverHeader } from './components/Popover/PopoverHeader.js';
|
|
63
|
+
export { PopoverTitle } from './components/Popover/PopoverTitle.js';
|
|
64
|
+
export { Radio } from './components/Radio/Radio.js';
|
|
65
|
+
export { Scrim } from './components/Scrim/Scrim.js';
|
|
66
|
+
export { Search } from './components/Search/Search.js';
|
|
67
|
+
export { SideBarAccordion } from './components/SideBar/SideBarAccordion/index.js';
|
|
68
|
+
export { SideBarAccordionItem } from './components/SideBar/SideBarAccordionItem/index.js';
|
|
69
|
+
export { SideBarButton } from './components/SideBar/SideBarButton/index.js';
|
|
93
70
|
export { SideBarContent } from './components/SideBar/SideBarContent.js';
|
|
94
71
|
export { SideBarFooter } from './components/SideBar/SideBarFooter.js';
|
|
95
72
|
export { SideBarToggle } from './components/SideBar/SideBarToggle.js';
|
|
96
|
-
export {
|
|
97
|
-
export {
|
|
98
|
-
export {
|
|
99
|
-
export {
|
|
100
|
-
export {
|
|
73
|
+
export { SideSheet } from './components/SideSheet/SideSheet.js';
|
|
74
|
+
export { SidebarLink } from './components/SideBar/SidebarLink/index.js';
|
|
75
|
+
export { Slider } from './components/Slider/Slider.js';
|
|
76
|
+
export { SnackbarAction } from './components/Snackbar/SnackbarAction.js';
|
|
77
|
+
export { StarProgress } from './components/Progress/Star/StarProgress.js';
|
|
78
|
+
export { Switch } from './components/Switch/Switch.js';
|
|
79
|
+
export { Tab } from './components/Tabs/Tab.js';
|
|
80
|
+
export { TabList } from './components/Tabs/TabList.js';
|
|
81
|
+
export { TabPanel } from './components/Tabs/TabPanel.js';
|
|
82
|
+
export { TabPanels } from './components/Tabs/TabPanels.js';
|
|
83
|
+
export { Body as TableBody } from './components/Table/Body.js';
|
|
84
|
+
export { Caption as TableCaption } from './components/Table/Caption.js';
|
|
85
|
+
export { Cell as TableCell } from './components/Table/Cell.js';
|
|
86
|
+
export { Foot as TableFoot } from './components/Table/Foot/Foot.js';
|
|
87
|
+
export { Head as TableHead } from './components/Table/Head/Head.js';
|
|
88
|
+
export { LinkItem as TableOfContentsLinkItem } from './components/TableOfContents/LinkItem.js';
|
|
89
|
+
export { Row as TableRow } from './components/Table/Row/Row.js';
|
|
90
|
+
export { TextField } from './components/TextField/TextField.js';
|
|
91
|
+
export { Textarea } from './components/Textarea/Textarea.js';
|
|
92
|
+
export { ToggleButton } from './components/Button/ToggleButton/ToggleButton.js';
|
|
93
|
+
export { Tooltip } from './components/Tooltip/Tooltip.js';
|
|
94
|
+
export { Actions as TopbarActions } from './components/TopBar/Actions.js';
|
|
95
|
+
export { CustomContent as TopbarCustomContent } from './components/TopBar/CustomContent.js';
|
|
96
|
+
export { Header as TopbarHeader } from './components/TopBar/Header.js';
|
|
97
|
+
export { Typography } from './components/Typography/Typography.js';
|
|
98
|
+
export { TypographyNext } from './components/Typography/Typography.new.js';
|
|
99
|
+
export { useInputField } from './components/InputWrapper/useInputField.js';
|
|
100
|
+
export { useSideBar } from './components/SideBar/SideBar.context.js';
|
|
@@ -32,18 +32,16 @@ const Button = /*#__PURE__*/forwardRef(function Button({
|
|
|
32
32
|
"data-variant": variant,
|
|
33
33
|
"data-selectable-space": selectableSpace,
|
|
34
34
|
"data-space-proportions": "squished",
|
|
35
|
-
"data-font-family": "ui",
|
|
36
|
-
"data-font-size": typographySize,
|
|
37
|
-
"data-line-height": "squished",
|
|
38
35
|
"data-color-appearance": disabled ? 'neutral' : tone,
|
|
39
36
|
"data-icon-only": icon || undefined,
|
|
40
37
|
"data-round": icon && round ? true : undefined,
|
|
41
38
|
...rest,
|
|
42
|
-
children: /*#__PURE__*/jsx(TypographyNext, {
|
|
39
|
+
children: icon ? children : /*#__PURE__*/jsx(TypographyNext, {
|
|
40
|
+
as: "span",
|
|
43
41
|
family: "ui",
|
|
44
42
|
size: typographySize,
|
|
45
|
-
baseline: "center",
|
|
46
43
|
lineHeight: "squished",
|
|
44
|
+
baseline: "center",
|
|
47
45
|
children: children
|
|
48
46
|
})
|
|
49
47
|
});
|
|
@@ -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
|
|
|
@@ -35,8 +36,12 @@ const TextField = /*#__PURE__*/forwardRef(function TextField({
|
|
|
35
36
|
}), labelInfo && /*#__PURE__*/jsx(Tooltip, {
|
|
36
37
|
title: labelInfo,
|
|
37
38
|
placement: "top",
|
|
38
|
-
children: /*#__PURE__*/jsx(
|
|
39
|
-
|
|
39
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
40
|
+
variant: "ghost",
|
|
41
|
+
icon: true,
|
|
42
|
+
round: true,
|
|
43
|
+
size: "small",
|
|
44
|
+
tone: "neutral",
|
|
40
45
|
className: "eds-text-field__info",
|
|
41
46
|
"aria-label": "More information",
|
|
42
47
|
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';
|