@dnanpm/styleguide 3.11.0 → 3.11.2
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/cjs/components/Checkbox/Checkbox.js +2 -1
- package/build/cjs/components/Chip/Chip.js +2 -1
- package/build/cjs/components/DateTimePicker/DateTimePicker.d.ts +22 -6
- package/build/cjs/components/DateTimePicker/DateTimePicker.js +61 -29
- package/build/cjs/components/Footer/Components/FooterComponents.js +11 -23
- package/build/cjs/components/Footer/Footer.js +2 -1
- package/build/cjs/components/Input/Input.d.ts +7 -1
- package/build/cjs/components/Input/Input.js +16 -16
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +2 -1
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/DesktopMenu.js +13 -13
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +2 -2
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +12 -12
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +3 -3
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +7 -6
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MobileMenu.d.ts +4 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MobileMenu.js +44 -41
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +3 -1
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +14 -10
- package/build/cjs/components/MainHeaderNavigation/context/NavContext.d.ts +2 -0
- package/build/cjs/components/MainHeaderNavigation/context/NavContext.js +4 -2
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.d.ts +8 -8
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.js +29 -24
- package/build/cjs/components/Notification/Notification.js +2 -1
- package/build/cjs/components/Pill/Pill.js +2 -1
- package/build/cjs/components/RadioButton/RadioButton.js +4 -3
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +3 -1
- package/build/cjs/components/Switch/Switch.js +1 -2
- package/build/cjs/components/Tooltip/Tooltip.js +2 -1
- package/build/cjs/utils/styledUtils.js +4 -4
- package/build/es/components/Checkbox/Checkbox.js +2 -1
- package/build/es/components/Chip/Chip.js +2 -1
- package/build/es/components/DateTimePicker/DateTimePicker.d.ts +22 -6
- package/build/es/components/DateTimePicker/DateTimePicker.js +61 -29
- package/build/es/components/Footer/Components/FooterComponents.js +11 -23
- package/build/es/components/Footer/Footer.js +2 -1
- package/build/es/components/Input/Input.d.ts +7 -1
- package/build/es/components/Input/Input.js +17 -17
- package/build/es/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +2 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/DesktopMenu.js +13 -13
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +2 -2
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +12 -12
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +3 -3
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +7 -6
- package/build/es/components/MainHeaderNavigation/ChildComponents/MobileMenu.d.ts +4 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/MobileMenu.js +45 -43
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +3 -1
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.js +14 -10
- package/build/es/components/MainHeaderNavigation/context/NavContext.d.ts +2 -0
- package/build/es/components/MainHeaderNavigation/context/NavContext.js +4 -2
- package/build/es/components/MainHeaderNavigation/globalNavStyles.d.ts +8 -8
- package/build/es/components/MainHeaderNavigation/globalNavStyles.js +29 -24
- package/build/es/components/Notification/Notification.js +2 -1
- package/build/es/components/Pill/Pill.js +2 -1
- package/build/es/components/RadioButton/RadioButton.js +4 -3
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +3 -1
- package/build/es/components/Switch/Switch.js +1 -2
- package/build/es/components/Tooltip/Tooltip.js +2 -1
- package/build/es/utils/styledUtils.js +4 -4
- package/package.json +12 -10
- package/build/cjs/components/MainHeaderNavigation/context/MobileMenuContext.d.ts +0 -6
- package/build/cjs/components/MainHeaderNavigation/context/MobileMenuContext.js +0 -11
- package/build/es/components/MainHeaderNavigation/context/MobileMenuContext.d.ts +0 -6
- package/build/es/components/MainHeaderNavigation/context/MobileMenuContext.js +0 -7
|
@@ -94,7 +94,8 @@ const Input = styledComponents.styled.input `
|
|
|
94
94
|
|
|
95
95
|
&:focus-visible {
|
|
96
96
|
outline: none;
|
|
97
|
-
box-shadow:
|
|
97
|
+
box-shadow:
|
|
98
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
98
99
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
99
100
|
}
|
|
100
101
|
`;
|
|
@@ -50,7 +50,8 @@ const Element = styledComponents.styled.div `
|
|
|
50
50
|
|
|
51
51
|
&:focus-visible {
|
|
52
52
|
outline: none;
|
|
53
|
-
box-shadow:
|
|
53
|
+
box-shadow:
|
|
54
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
54
55
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
55
56
|
}
|
|
56
57
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChangeEvent } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DatePickerProps } from 'react-datepicker';
|
|
4
4
|
import type { LocaleCode } from '../../types/locale.d';
|
|
5
5
|
interface Props {
|
|
6
6
|
/**
|
|
@@ -15,7 +15,7 @@ interface Props {
|
|
|
15
15
|
* Allows to enable range picker functionality.
|
|
16
16
|
* By passing `null` as value, range picker functionality will be enabled but no value will be provided as default
|
|
17
17
|
*/
|
|
18
|
-
endDate?:
|
|
18
|
+
endDate?: DatePickerProps['endDate'];
|
|
19
19
|
/**
|
|
20
20
|
* Input label content
|
|
21
21
|
*/
|
|
@@ -36,7 +36,7 @@ interface Props {
|
|
|
36
36
|
/**
|
|
37
37
|
* On datetime picker change callback
|
|
38
38
|
*/
|
|
39
|
-
onChange:
|
|
39
|
+
onChange: DatePickerProps['onChange'];
|
|
40
40
|
/**
|
|
41
41
|
* On input change callback
|
|
42
42
|
*/
|
|
@@ -44,17 +44,17 @@ interface Props {
|
|
|
44
44
|
/**
|
|
45
45
|
* Minimum selectable date
|
|
46
46
|
*/
|
|
47
|
-
minDate?:
|
|
47
|
+
minDate?: DatePickerProps['minDate'];
|
|
48
48
|
/**
|
|
49
49
|
* Maximum selectable date
|
|
50
50
|
*/
|
|
51
|
-
maxDate?:
|
|
51
|
+
maxDate?: DatePickerProps['maxDate'];
|
|
52
52
|
/**
|
|
53
53
|
* Allows to define time intervals in time picker
|
|
54
54
|
*
|
|
55
55
|
* @default 30
|
|
56
56
|
*/
|
|
57
|
-
timeInterval?:
|
|
57
|
+
timeInterval?: DatePickerProps['timeIntervals'];
|
|
58
58
|
/**
|
|
59
59
|
* Text of the error message when input element is in error state
|
|
60
60
|
*/
|
|
@@ -107,6 +107,22 @@ interface Props {
|
|
|
107
107
|
* Allows to pass a custom className
|
|
108
108
|
*/
|
|
109
109
|
className?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Descriptive label for screen readers for the input element.
|
|
112
|
+
*/
|
|
113
|
+
ariaLabelInput?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Accessible label for "Previous month" button
|
|
116
|
+
*/
|
|
117
|
+
ariaLabelPreviousMonth?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Accessible label for "Next month" button
|
|
120
|
+
*/
|
|
121
|
+
ariaLabelNextMonth?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Accessible text for announcing date changes (e.g., for screen readers)
|
|
124
|
+
*/
|
|
125
|
+
ariaLiveAnnouncement?: string;
|
|
110
126
|
}
|
|
111
127
|
/** @visibleName DateTime Picker */
|
|
112
128
|
declare const DateTimePicker: ({ date: startDate, locale, isDatePicker, isTimePicker, timeInterval, "data-testid": dataTestId, ...props }: Props) => React.JSX.Element;
|
|
@@ -86,7 +86,6 @@ const Wrapper = styledComponents.styled.div `
|
|
|
86
86
|
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)}
|
|
87
87
|
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)}
|
|
88
88
|
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 0.5)};
|
|
89
|
-
border-bottom: 1px solid ${theme.default.color.line.L03};
|
|
90
89
|
background-color: ${theme.default.color.background.sand.E01};
|
|
91
90
|
|
|
92
91
|
.react-datepicker-time__header {
|
|
@@ -100,6 +99,7 @@ const Wrapper = styledComponents.styled.div `
|
|
|
100
99
|
& .react-datepicker__month,
|
|
101
100
|
.react-datepicker__time-list {
|
|
102
101
|
display: grid;
|
|
102
|
+
border-top: 1px solid ${theme.default.color.line.L03};
|
|
103
103
|
gap: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 0.5)};
|
|
104
104
|
color: ${theme.default.color.text.gray};
|
|
105
105
|
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 0.5)}
|
|
@@ -234,30 +234,26 @@ const CurrentMonth = styledComponents.styled.div `
|
|
|
234
234
|
line-height: ${theme.default.lineHeight.default};
|
|
235
235
|
font-weight: ${theme.default.fontWeight.bold};
|
|
236
236
|
`;
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
div {
|
|
241
|
-
background-color: ${theme.default.color.background.white.default};
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.react-datepicker-ignore-onclickoutside-lock-icon {
|
|
245
|
-
display: none;
|
|
246
|
-
}
|
|
247
|
-
`}
|
|
237
|
+
const VisuallyHiddenStatus = styledComponents.styled.div `
|
|
238
|
+
position: absolute;
|
|
239
|
+
left: -9999px;
|
|
248
240
|
`;
|
|
249
|
-
const DateTimePickerCustomHeader = ({ date, decreaseMonth, increaseMonth, locale, }) => (React__default.default.createElement(MonthSelector, null,
|
|
250
|
-
React__default.default.createElement(ButtonIcon.default, { icon: icons.ChevronLeft, onClick: decreaseMonth }),
|
|
241
|
+
const DateTimePickerCustomHeader = ({ date, decreaseMonth, increaseMonth, locale, ariaLabelPreviousMonth, ariaLabelNextMonth, }) => (React__default.default.createElement(MonthSelector, null,
|
|
242
|
+
React__default.default.createElement(ButtonIcon.default, { icon: icons.ChevronLeft, onClick: decreaseMonth, ariaLabel: ariaLabelPreviousMonth }),
|
|
251
243
|
React__default.default.createElement(CurrentMonth, null, sentenceCase(date.toLocaleString(locale, {
|
|
252
244
|
month: 'long',
|
|
253
245
|
year: 'numeric',
|
|
254
246
|
}))),
|
|
255
|
-
React__default.default.createElement(ButtonIcon.default, { icon: icons.ChevronRight, onClick: increaseMonth })));
|
|
247
|
+
React__default.default.createElement(ButtonIcon.default, { icon: icons.ChevronRight, onClick: increaseMonth, ariaLabel: ariaLabelNextMonth })));
|
|
256
248
|
/** @visibleName DateTime Picker */
|
|
257
249
|
const DateTimePicker = (_a) => {
|
|
258
|
-
var _b;
|
|
250
|
+
var _b, _c, _d;
|
|
259
251
|
var { date: startDate, locale = 'fi-FI', isDatePicker = true, isTimePicker = false, timeInterval = 30, 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["date", "locale", "isDatePicker", "isTimePicker", "timeInterval", 'data-testid']);
|
|
260
252
|
const [showReactDatePicker, setShowReactDatePicker] = React.useState(false);
|
|
253
|
+
const isRange = props.endDate !== undefined;
|
|
254
|
+
const callOnChange = (date, event) => {
|
|
255
|
+
props.onChange(date, event);
|
|
256
|
+
};
|
|
261
257
|
const handleOnInputFocus = () => {
|
|
262
258
|
setShowReactDatePicker(true);
|
|
263
259
|
};
|
|
@@ -267,17 +263,41 @@ const DateTimePicker = (_a) => {
|
|
|
267
263
|
}
|
|
268
264
|
};
|
|
269
265
|
const handleOnKeyDown = (e) => {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
266
|
+
const isNavigationKey = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key);
|
|
267
|
+
if (isNavigationKey && showReactDatePicker) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (e.key === 'Escape') {
|
|
271
|
+
setShowReactDatePicker(false);
|
|
272
|
+
}
|
|
273
|
+
if (e.key === 'Enter' && showReactDatePicker) {
|
|
274
|
+
setShowReactDatePicker(false);
|
|
275
|
+
}
|
|
276
|
+
if (!props.isEditable && ['Backspace', 'Delete', 'Clear'].includes(e.key)) {
|
|
277
|
+
callOnChange(null, e);
|
|
273
278
|
}
|
|
274
279
|
};
|
|
275
280
|
const handleClearable = (e) => {
|
|
276
|
-
|
|
281
|
+
callOnChange(null, e);
|
|
277
282
|
};
|
|
278
|
-
const handleOnReactDatePickerChange = (date,
|
|
279
|
-
|
|
280
|
-
|
|
283
|
+
const handleOnReactDatePickerChange = (date, event) => {
|
|
284
|
+
var _a, _b;
|
|
285
|
+
let shouldKeepOpen = false;
|
|
286
|
+
if (isRange) {
|
|
287
|
+
const [start, end] = Array.isArray(date) && date.length === 2 ? date : [null, null];
|
|
288
|
+
shouldKeepOpen = !(start && end);
|
|
289
|
+
}
|
|
290
|
+
else if (isDatePicker &&
|
|
291
|
+
isTimePicker &&
|
|
292
|
+
date instanceof Date &&
|
|
293
|
+
((_a = date.getHours) === null || _a === void 0 ? void 0 : _a.call(date)) === 0 &&
|
|
294
|
+
((_b = date.getMinutes) === null || _b === void 0 ? void 0 : _b.call(date)) === 0) {
|
|
295
|
+
shouldKeepOpen = true;
|
|
296
|
+
}
|
|
297
|
+
if (!shouldKeepOpen) {
|
|
298
|
+
setShowReactDatePicker(false);
|
|
299
|
+
}
|
|
300
|
+
callOnChange(date, event);
|
|
281
301
|
};
|
|
282
302
|
const handleOnReactDatePickerClickOutside = () => {
|
|
283
303
|
setShowReactDatePicker(false);
|
|
@@ -291,13 +311,25 @@ const DateTimePicker = (_a) => {
|
|
|
291
311
|
timeStyle: 'short',
|
|
292
312
|
}))))
|
|
293
313
|
.join(' - ');
|
|
294
|
-
const getDateTimePickerCustomHeader = (args) => DateTimePickerCustomHeader(Object.assign(Object.assign({}, args), { locale }));
|
|
314
|
+
const getDateTimePickerCustomHeader = (args) => DateTimePickerCustomHeader(Object.assign(Object.assign({}, args), { locale, ariaLabelPreviousMonth: props.ariaLabelPreviousMonth, ariaLabelNextMonth: props.ariaLabelNextMonth }));
|
|
295
315
|
return (React__default.default.createElement(Wrapper, { id: props.id, className: props.className, "data-testid": dataTestId },
|
|
296
|
-
React__default.default.createElement(
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
316
|
+
React__default.default.createElement(Input.default, { id: `datetimepicker-input-${props.id}`, name: `datetimepicker-input-${props.id}`, label: props.label, placeholder: props.placeholder, value: formatInputValue, onFocus: handleOnInputFocus, onChange: handleOnInputChange, onKeyDown: handleOnKeyDown, onClearableButtonClick: props.isClearable ? handleClearable : undefined, className: "react-datepicker-ignore-onclickoutside", "data-testid": dataTestId && `${dataTestId}-datetimepicker-input`, disabled: props.isDisabled, required: props.isRequired, readonlyUnstyled: !props.isEditable, status: props.isInError ? 'error' : undefined, errorMessage: props.errorMessage, ariaLabel: props.ariaLabelInput, onBlur: (_val, e) => {
|
|
317
|
+
if (props.isEditable && e.target.value) {
|
|
318
|
+
const parsedDate = new Date(e.target.value);
|
|
319
|
+
if (!Number.isNaN(parsedDate.getTime())) {
|
|
320
|
+
callOnChange(parsedDate, e);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
} }),
|
|
324
|
+
React__default.default.createElement(VisuallyHiddenStatus, { role: "status", "aria-live": "polite" }, startDate instanceof Date && !Number.isNaN(startDate.getTime())
|
|
325
|
+
? (_b = props.ariaLiveAnnouncement) === null || _b === void 0 ? void 0 : _b.replace('{{date}}', startDate.toLocaleDateString(locale))
|
|
326
|
+
: ''),
|
|
327
|
+
showReactDatePicker &&
|
|
328
|
+
(isRange ? (React__default.default.createElement(ReactDatePicker__default.default, { selectsRange: true, endDate: props.endDate, inline: true, selected: startDate, startDate: startDate, maxDate: props.maxDate, minDate: props.minDate, onChange: handleOnReactDatePickerChange, timeCaption: (_c = localeData[locale]) === null || _c === void 0 ? void 0 : _c.localize.timeCaption, timeIntervals: timeInterval, onClickOutside: handleOnReactDatePickerClickOutside, locale: localeData[locale], dateFormat: [isDatePicker && 'P', isTimePicker && 'p']
|
|
329
|
+
.filter(Boolean)
|
|
330
|
+
.join(''), renderCustomHeader: getDateTimePickerCustomHeader })) : (React__default.default.createElement(ReactDatePicker__default.default, { showTimeSelect: isTimePicker, showTimeSelectOnly: !isDatePicker && isTimePicker, inline: true, selected: startDate, startDate: startDate, maxDate: props.maxDate, minDate: props.minDate, onChange: handleOnReactDatePickerChange, timeCaption: (_d = localeData[locale]) === null || _d === void 0 ? void 0 : _d.localize.timeCaption, timeIntervals: timeInterval, onClickOutside: handleOnReactDatePickerClickOutside, locale: localeData[locale], dateFormat: [isDatePicker && 'P', isTimePicker && 'p']
|
|
331
|
+
.filter(Boolean)
|
|
332
|
+
.join(''), renderCustomHeader: getDateTimePickerCustomHeader })))));
|
|
301
333
|
};
|
|
302
334
|
|
|
303
335
|
exports.default = DateTimePicker;
|
|
@@ -49,7 +49,8 @@ const BaseContainer = styledComponents.styled.div `
|
|
|
49
49
|
`;
|
|
50
50
|
const CategoryLinks = styledComponents.styled.ul `
|
|
51
51
|
display: ${({ $active }) => ($active ? 'flex' : 'none')};
|
|
52
|
-
transition:
|
|
52
|
+
transition:
|
|
53
|
+
all 0.3s ease-in-out,
|
|
53
54
|
padding 0s linear ${({ $active }) => ($active ? '0s' : '0.3s')};
|
|
54
55
|
max-height: ${({ $active }) => ($active ? '500' : '0')}px;
|
|
55
56
|
flex-direction: column;
|
|
@@ -68,7 +69,8 @@ const CategoryHeader = styledComponents.styled.button `
|
|
|
68
69
|
justify-content: space-between;
|
|
69
70
|
&:focus-visible {
|
|
70
71
|
outline: 1px solid transparent;
|
|
71
|
-
box-shadow:
|
|
72
|
+
box-shadow:
|
|
73
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
72
74
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
73
75
|
${theme.default.radius.s};
|
|
74
76
|
}
|
|
@@ -314,30 +316,16 @@ const SocialMediaLinks = ({ socialMedia }) => {
|
|
|
314
316
|
return (React__default.default.createElement("a", { href: url, key: `social-media-link-${socialMediaKey}`, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : socialMediaName }, SocialIcon && React__default.default.createElement(SocialIcon, null)));
|
|
315
317
|
})));
|
|
316
318
|
};
|
|
317
|
-
const isNewApplicationLinks = (links) => 'appStore' in links && typeof links.appStore === 'object';
|
|
318
319
|
const ApplicationLinks = ({ applicationLinks, language, }) => {
|
|
319
|
-
var _a, _b, _c, _d, _e, _f
|
|
320
|
-
|
|
321
|
-
const { appStore, googlePlay, title } = applicationLinks;
|
|
322
|
-
return (React__default.default.createElement(AppSection, null,
|
|
323
|
-
React__default.default.createElement("p", null, title[language]),
|
|
324
|
-
React__default.default.createElement(AppList, null,
|
|
325
|
-
((_a = appStore.urls) === null || _a === void 0 ? void 0 : _a[language]) && (React__default.default.createElement("a", { "aria-label": (_b = appStore.ariaLabels) === null || _b === void 0 ? void 0 : _b[language], href: appStore.urls[language], target: "_blank", rel: "noopener noreferrer" },
|
|
326
|
-
React__default.default.createElement("img", { src: "https://res.cloudinary.com/dnaoyj/image/upload/dpr_2,f_auto,q_auto,w_142/v1/Assets/Icons%20and%20logos/Other%20icons/App_Store_Badge.png", alt: (_c = appStore.alts) === null || _c === void 0 ? void 0 : _c[language] }))),
|
|
327
|
-
((_d = googlePlay.urls) === null || _d === void 0 ? void 0 : _d[language]) && (React__default.default.createElement("a", { "aria-label": (_e = googlePlay.ariaLabels) === null || _e === void 0 ? void 0 : _e[language], href: googlePlay.urls[language], target: "_blank", rel: "noopener noreferrer" },
|
|
328
|
-
React__default.default.createElement("img", { src: "https://res.cloudinary.com/dnaoyj/image/upload/dpr_2,f_auto,q_auto,w_142/v1/Assets/Icons%20and%20logos/Other%20icons/Google_Play_Badge.png", alt: (_f = googlePlay.alts) === null || _f === void 0 ? void 0 : _f[language] }))))));
|
|
329
|
-
}
|
|
320
|
+
var _a, _b, _c, _d, _e, _f;
|
|
321
|
+
const { appStore, googlePlay, title } = applicationLinks;
|
|
330
322
|
return (React__default.default.createElement(AppSection, null,
|
|
331
|
-
React__default.default.createElement("p", null,
|
|
323
|
+
React__default.default.createElement("p", null, title[language]),
|
|
332
324
|
React__default.default.createElement(AppList, null,
|
|
333
|
-
((
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
React__default.default.createElement("img", { src: "https://res.cloudinary.com/dnaoyj/image/upload/dpr_2,f_auto,q_auto,w_142/v1/Assets/Icons%20and%20logos/Other%20icons/
|
|
337
|
-
((_h = applicationLinks.googlePlayURL) === null || _h === void 0 ? void 0 : _h[language]) && (React__default.default.createElement("a", { "aria-label": language === 'fi'
|
|
338
|
-
? 'Lataa sovellus Google Playstä'
|
|
339
|
-
: 'Download from Google Play', href: applicationLinks.googlePlayURL[language], target: "_blank", rel: "noopener noreferrer" },
|
|
340
|
-
React__default.default.createElement("img", { src: "https://res.cloudinary.com/dnaoyj/image/upload/dpr_2,f_auto,q_auto,w_142/v1/Assets/Icons%20and%20logos/Other%20icons/Google_Play_Badge.png", alt: "" }))))));
|
|
325
|
+
((_a = appStore.urls) === null || _a === void 0 ? void 0 : _a[language]) && (React__default.default.createElement("a", { "aria-label": (_b = appStore.ariaLabels) === null || _b === void 0 ? void 0 : _b[language], href: appStore.urls[language], target: "_blank", rel: "noopener noreferrer" },
|
|
326
|
+
React__default.default.createElement("img", { src: "https://res.cloudinary.com/dnaoyj/image/upload/dpr_2,f_auto,q_auto,w_142/v1/Assets/Icons%20and%20logos/Other%20icons/App_Store_Badge.png", alt: (_c = appStore.alts) === null || _c === void 0 ? void 0 : _c[language] }))),
|
|
327
|
+
((_d = googlePlay.urls) === null || _d === void 0 ? void 0 : _d[language]) && (React__default.default.createElement("a", { "aria-label": (_e = googlePlay.ariaLabels) === null || _e === void 0 ? void 0 : _e[language], href: googlePlay.urls[language], target: "_blank", rel: "noopener noreferrer" },
|
|
328
|
+
React__default.default.createElement("img", { src: "https://res.cloudinary.com/dnaoyj/image/upload/dpr_2,f_auto,q_auto,w_142/v1/Assets/Icons%20and%20logos/Other%20icons/Google_Play_Badge.png", alt: (_f = googlePlay.alts) === null || _f === void 0 ? void 0 : _f[language] }))))));
|
|
341
329
|
};
|
|
342
330
|
const BottomSection = ({ items }) => {
|
|
343
331
|
const { applicationLinks, businessSelector, customLinks, generalInformation, languageSelector, socialMedia, } = items.footerNavigation;
|
|
@@ -29,7 +29,8 @@ const FooterContainer = styledComponents.styled.footer `
|
|
|
29
29
|
&:focus-visible {
|
|
30
30
|
text-decoration: none;
|
|
31
31
|
outline: 1px solid transparent;
|
|
32
|
-
box-shadow:
|
|
32
|
+
box-shadow:
|
|
33
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
33
34
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
34
35
|
&:not(.menu-link):not(${FooterComponents.LangLink}) {
|
|
35
36
|
${theme.default.radius.s};
|
|
@@ -102,6 +102,12 @@ interface Props {
|
|
|
102
102
|
* @default false
|
|
103
103
|
*/
|
|
104
104
|
readonly?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Allows to set input as readonly without any styles applied
|
|
107
|
+
*
|
|
108
|
+
* @default false
|
|
109
|
+
*/
|
|
110
|
+
readonlyUnstyled?: boolean;
|
|
105
111
|
/**
|
|
106
112
|
* Allows to set input as mandatory
|
|
107
113
|
*
|
|
@@ -148,6 +154,6 @@ interface Props {
|
|
|
148
154
|
*/
|
|
149
155
|
'data-testid'?: string;
|
|
150
156
|
}
|
|
151
|
-
declare const Input:
|
|
157
|
+
declare const Input: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
152
158
|
/** @component */
|
|
153
159
|
export default Input;
|
|
@@ -129,16 +129,10 @@ const ErrorMessage = styledComponents.styled(Message) `
|
|
|
129
129
|
font-weight: ${theme.default.fontWeight.medium};
|
|
130
130
|
color: ${theme.default.color.notification.error};
|
|
131
131
|
`;
|
|
132
|
-
const Input = (_a) => {
|
|
132
|
+
const Input = React.forwardRef((_a, ref) => {
|
|
133
133
|
var _b;
|
|
134
134
|
var { type = 'text', 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["type", 'data-testid']);
|
|
135
|
-
const inputRef = React.useRef(null);
|
|
136
135
|
const [showPassword, setShowPassword] = React.useState(false);
|
|
137
|
-
React.useEffect(() => {
|
|
138
|
-
if (props.showPasswordToggle && inputRef && inputRef.current) {
|
|
139
|
-
inputRef.current.type = showPassword ? 'text' : 'password';
|
|
140
|
-
}
|
|
141
|
-
}, [showPassword, props.showPasswordToggle]);
|
|
142
136
|
const togglePasswordVisibility = () => {
|
|
143
137
|
if (props.showPasswordToggle && !props.disabled) {
|
|
144
138
|
setShowPassword(!showPassword);
|
|
@@ -156,9 +150,7 @@ const Input = (_a) => {
|
|
|
156
150
|
};
|
|
157
151
|
const onClick = (e) => {
|
|
158
152
|
e.preventDefault();
|
|
159
|
-
|
|
160
|
-
inputRef.current.focus();
|
|
161
|
-
}
|
|
153
|
+
e.currentTarget.focus();
|
|
162
154
|
};
|
|
163
155
|
const getDescribedBy = () => {
|
|
164
156
|
if (props.status === 'error' && props.errorMessage) {
|
|
@@ -169,24 +161,32 @@ const Input = (_a) => {
|
|
|
169
161
|
}
|
|
170
162
|
return undefined;
|
|
171
163
|
};
|
|
172
|
-
|
|
164
|
+
const getInputType = () => {
|
|
165
|
+
if (props.showPasswordToggle) {
|
|
166
|
+
return showPassword ? 'text' : 'password';
|
|
167
|
+
}
|
|
168
|
+
return type;
|
|
169
|
+
};
|
|
170
|
+
const inputType = getInputType();
|
|
171
|
+
return (React__default.default.createElement(FieldContainer, { className: props.className, "data-testid": dataTestId && `${dataTestId}-container` },
|
|
173
172
|
props.label && (React__default.default.createElement(LabelText.default, { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label`, status: props.status === 'error' ? props.status : undefined, isMandatory: props.required }, props.label)),
|
|
174
|
-
React__default.default.createElement(FieldWrapper, { "$status": props.status, "$type":
|
|
175
|
-
React__default.default.createElement(StyledInput, { id: props.id, name: props.name, type:
|
|
173
|
+
React__default.default.createElement(FieldWrapper, { "$status": props.status, "$type": inputType, "$disabled": props.disabled, "$readonly": props.readonly && !props.readonlyUnstyled },
|
|
174
|
+
React__default.default.createElement(StyledInput, { id: props.id, name: props.name, type: inputType, value: props.value, placeholder: props.placeholder, onChange: handleChange, onBlur: handleOnBlur, onFocus: props.onFocus, onClick: onClick, onKeyDown: props.onKeyDown, onKeyPress: props.onKeyPress, required: props.required, disabled: props.disabled, autoComplete: props.autocomplete, "aria-disabled": props.disabled, "aria-readonly": props.readonly || props.readonlyUnstyled || undefined, "aria-label": !props.label ? ((_b = props.ariaLabel) !== null && _b !== void 0 ? _b : props.id) : undefined, ref: ref, tabIndex: props.tabIndex, "aria-describedby": getDescribedBy(), "data-testid": dataTestId, readOnly: props.readonly || props.readonlyUnstyled }),
|
|
176
175
|
((props.status && props.status !== 'comment') ||
|
|
177
176
|
props.showPasswordToggle ||
|
|
178
177
|
props.disabled ||
|
|
179
178
|
props.readonly ||
|
|
179
|
+
props.readonlyUnstyled ||
|
|
180
180
|
props.onClearableButtonClick) && (React__default.default.createElement(IconWrapper, null,
|
|
181
181
|
props.showPasswordToggle && (React__default.default.createElement(StyledButtonIcon, { icon: showPassword ? icons.EyeOpen : icons.EyeClosed, onClick: togglePasswordVisibility, ariaLabel: props.passwordToggleLabel })),
|
|
182
182
|
(props.status === 'success' || props.status === 'error') && (React__default.default.createElement(Icon.default, { "aria-hidden": true, icon: iconsMap[props.status], color: theme.default.color.notification[props.status] })),
|
|
183
|
-
(props.disabled || props.readonly) && (React__default.default.createElement(Icon.default, { "aria-hidden": true, icon: icons.Lock, className: props.className && `${props.className}-lock-icon` })),
|
|
183
|
+
(props.disabled || (props.readonly && !props.readonlyUnstyled)) && (React__default.default.createElement(Icon.default, { "aria-hidden": true, icon: icons.Lock, className: props.className && `${props.className}-lock-icon` })),
|
|
184
184
|
props.onClearableButtonClick &&
|
|
185
185
|
Boolean(props.value) &&
|
|
186
186
|
!props.disabled &&
|
|
187
|
-
!props.readonly && (React__default.default.createElement(ButtonIcon.default, { icon: icons.Close, onClick: props.onClearableButtonClick, ariaLabel: props.clearButtonLabel }))))),
|
|
187
|
+
(!props.readonly || props.readonlyUnstyled) && (React__default.default.createElement(ButtonIcon.default, { icon: icons.Close, onClick: props.onClearableButtonClick, ariaLabel: props.clearButtonLabel }))))),
|
|
188
188
|
props.status === 'error' && props.errorMessage && (React__default.default.createElement(ErrorMessage, { id: `${props.id}-error`, "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage)),
|
|
189
189
|
props.status === 'comment' && props.commentMessage && (React__default.default.createElement(Message, { id: `${props.id}-comment`, "data-testid": dataTestId && `${dataTestId}-comment` }, props.commentMessage))));
|
|
190
|
-
};
|
|
190
|
+
});
|
|
191
191
|
|
|
192
192
|
exports.default = Input;
|
|
@@ -40,7 +40,8 @@ const BusinessMenuLink = styledComponents.styled.a `
|
|
|
40
40
|
}
|
|
41
41
|
&:focus-visible {
|
|
42
42
|
outline: none;
|
|
43
|
-
box-shadow:
|
|
43
|
+
box-shadow:
|
|
44
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
44
45
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
45
46
|
}
|
|
46
47
|
`;
|
|
@@ -73,8 +73,8 @@ const CategoryCollectionBlock = styledComponents.styled(CategoryBlock) `
|
|
|
73
73
|
`;
|
|
74
74
|
const SubMenuItem = styledComponents.styled.li `
|
|
75
75
|
> a {
|
|
76
|
-
color: ${p => (p
|
|
77
|
-
font-weight: ${p => (p
|
|
76
|
+
color: ${p => (p.$isHighlighted ? theme.default.color.text.pink : theme.default.color.text.black)};
|
|
77
|
+
font-weight: ${p => (p.$isHighlighted ? theme.default.fontWeight.bold : theme.default.fontWeight.book)};
|
|
78
78
|
}
|
|
79
79
|
`;
|
|
80
80
|
const DesktopMenuItem = styledComponents.styled(globalNavStyles.MenuItem) `
|
|
@@ -97,7 +97,7 @@ const DesktopMenuItem = styledComponents.styled(globalNavStyles.MenuItem) `
|
|
|
97
97
|
bottom: -22px;
|
|
98
98
|
left: 0;
|
|
99
99
|
border-bottom: 2px solid
|
|
100
|
-
${p => (p
|
|
100
|
+
${p => (p.$isActive ? theme.default.color.default.pink : 'transparent')};
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -108,9 +108,9 @@ const SubMenuList = styledComponents.styled.div `
|
|
|
108
108
|
top: ${navigation.navMaxHeight};
|
|
109
109
|
left: 0;
|
|
110
110
|
right: 0;
|
|
111
|
-
display: ${({ menuStates, navItemId }) => (menuStates === null || menuStates === void 0 ? void 0 : menuStates.level1) === navItemId ? 'block' : 'none'};
|
|
112
|
-
z-index: ${({ navZIndex }) => navZIndex + 1};
|
|
113
|
-
${({ menuStates }) => menuStates.level1 && menuStates.animate2 &&
|
|
111
|
+
display: ${({ $menuStates, $navItemId }) => ($menuStates === null || $menuStates === void 0 ? void 0 : $menuStates.level1) === $navItemId ? 'block' : 'none'};
|
|
112
|
+
z-index: ${({ $navZIndex }) => $navZIndex + 1};
|
|
113
|
+
${({ $menuStates }) => $menuStates.level1 && $menuStates.animate2 && !$menuStates.level2
|
|
114
114
|
? fadeInAnimation
|
|
115
115
|
: noAnimation};
|
|
116
116
|
background-color: ${theme.default.color.background.white.default};
|
|
@@ -123,16 +123,16 @@ const SubMenuList = styledComponents.styled.div `
|
|
|
123
123
|
}
|
|
124
124
|
`;
|
|
125
125
|
const SubMenuLevel1 = ({ menuItem }) => {
|
|
126
|
-
const { categoryCollectionText, collapseSize, currentUrl, lang, menuLevel, navZIndex } = React.useContext(NavContext.default);
|
|
126
|
+
const { categoryCollectionText, collapseSize, currentUrl, featuredItemsAriaLabel, lang, menuLevel, navZIndex, } = React.useContext(NavContext.default);
|
|
127
127
|
const level1HasElements = !!menuItem.pages.length;
|
|
128
128
|
const pagesWithSubItems = menuItem.pages.filter(element => element.pages.length > 0);
|
|
129
129
|
// Helper function to render a sub menu item
|
|
130
|
-
const renderSubMenuItem = (element, index, currUrl) => (React__default.default.createElement(SubMenuItem, { key: element.id, isHighlighted: LinkModifier.isSelected(currUrl, element.urls[lang], true), "data-testid": `desktop-nav-item-level-2-${index + 1}` },
|
|
130
|
+
const renderSubMenuItem = (element, index, currUrl) => (React__default.default.createElement(SubMenuItem, { key: element.id, "$isHighlighted": LinkModifier.isSelected(currUrl, element.urls[lang], true), "data-testid": `desktop-nav-item-level-2-${index + 1}` },
|
|
131
131
|
React__default.default.createElement(LinkModifier.default, { menuItem: element, disabledTabIndex: false })));
|
|
132
132
|
if (!level1HasElements) {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
135
|
-
return (React__default.default.createElement(SubMenuList, { "aria-hidden": false, menuStates: menuLevel, navItemId: menuItem.id, navZIndex: navZIndex },
|
|
135
|
+
return (React__default.default.createElement(SubMenuList, { "aria-hidden": false, "$menuStates": menuLevel, "$navItemId": menuItem.id, "$navZIndex": navZIndex },
|
|
136
136
|
React__default.default.createElement(MegaMenuContent, { "aria-labelledby": `menu-id-${menuItem.id}` },
|
|
137
137
|
pagesWithSubItems.slice(0, 5).map(element => (React__default.default.createElement(CategoryBlock, { key: element.id },
|
|
138
138
|
React__default.default.createElement(CategoryTitle, { id: `menu-id-${element.id}` }, element.titles[lang]),
|
|
@@ -142,7 +142,7 @@ const SubMenuLevel1 = ({ menuItem }) => {
|
|
|
142
142
|
React__default.default.createElement("ul", { "aria-labelledby": "misc-categories", "data-testid": "desktop-nav-menu-ul-level-2" }, pagesWithSubItems
|
|
143
143
|
.slice(5)
|
|
144
144
|
.map((element, index) => renderSubMenuItem(element, index, currentUrl))))),
|
|
145
|
-
React__default.default.createElement(globalNavStyles.FeaturedBlock, { collapseSize: collapseSize, "data-testid": "desktop-nav-menu-level-2-featured" }, menuItem.pages.map(element => element.pages.length ? null : (React__default.default.createElement(LinkModifier.default, { key: element.id, showIcon: true, menuItem: element, disabledTabIndex: false })))))));
|
|
145
|
+
React__default.default.createElement(globalNavStyles.FeaturedBlock, { "$collapseSize": collapseSize, "data-testid": "desktop-nav-menu-level-2-featured" }, menuItem.pages.some(element => !element.pages.length) && (React__default.default.createElement("section", { "aria-label": featuredItemsAriaLabel }, menuItem.pages.map(element => element.pages.length ? null : (React__default.default.createElement(LinkModifier.default, { key: element.id, showIcon: true, menuItem: element, disabledTabIndex: false })))))))));
|
|
146
146
|
};
|
|
147
147
|
const MenuItemWithChildren = ({ menuItem, currentLevel }) => {
|
|
148
148
|
const { lang, handleNavMenuClick, currentUrl, menuLevel } = React.useContext(NavContext.default);
|
|
@@ -151,8 +151,8 @@ const MenuItemWithChildren = ({ menuItem, currentLevel }) => {
|
|
|
151
151
|
e.preventDefault();
|
|
152
152
|
handleNavMenuClick(element.id, 'level1');
|
|
153
153
|
};
|
|
154
|
-
return (React__default.default.createElement(DesktopMenuItem, { isActive: LinkModifier.isSelected(currentUrl, linkUrl), "data-testid": `desktop-nav-item-level-1-${currentLevel + 1}` },
|
|
155
|
-
React__default.default.createElement(globalNavStyles.MenuLinkWithChildren, { isOpen: menuLevel.level1 === menuItem.id, onClick: menuClickMain(menuItem), "data-testid": "menu-button-with-children", "aria-current": LinkModifier.isSelected(currentUrl, linkUrl) ? 'true' : undefined, "aria-expanded": menuLevel.level1 === menuItem.id, href: linkUrl },
|
|
154
|
+
return (React__default.default.createElement(DesktopMenuItem, { "$isActive": LinkModifier.isSelected(currentUrl, linkUrl), "data-testid": `desktop-nav-item-level-1-${currentLevel + 1}` },
|
|
155
|
+
React__default.default.createElement(globalNavStyles.MenuLinkWithChildren, { "$isOpen": menuLevel.level1 === menuItem.id, onClick: menuClickMain(menuItem), "data-testid": "menu-button-with-children", "aria-current": LinkModifier.isSelected(currentUrl, linkUrl) ? 'true' : undefined, "aria-expanded": menuLevel.level1 === menuItem.id, href: linkUrl },
|
|
156
156
|
React__default.default.createElement("span", { id: `menu-id-${menuItem.id}` }, menuItem.titles[lang]),
|
|
157
157
|
React__default.default.createElement(icons.ChevronRight, { size: "1rem" })),
|
|
158
158
|
React__default.default.createElement(SubMenuLevel1, { menuItem: menuItem })));
|
|
@@ -175,7 +175,7 @@ const DesktopMenu = () => {
|
|
|
175
175
|
if (displaySubMenu) {
|
|
176
176
|
return (React__default.default.createElement(MenuItemWithChildren, { currentLevel: index, key: navElement.id, menuItem: navElement }));
|
|
177
177
|
}
|
|
178
|
-
return (React__default.default.createElement(DesktopMenuItem, { "data-testid": `desktop-nav-item-level-1-${index + 1}`, isActive: LinkModifier.isSelected(currentUrl, navElement.urls[lang]), key: navElement.id },
|
|
178
|
+
return (React__default.default.createElement(DesktopMenuItem, { "data-testid": `desktop-nav-item-level-1-${index + 1}`, "$isActive": LinkModifier.isSelected(currentUrl, navElement.urls[lang]), key: navElement.id },
|
|
179
179
|
React__default.default.createElement(LinkModifier.default, { menuItem: navElement, disabledTabIndex: false })));
|
|
180
180
|
})));
|
|
181
181
|
};
|
|
@@ -24,8 +24,8 @@ interface MainNavTooltipMenuProps<ContentProps extends object = object> extends
|
|
|
24
24
|
fullWidthBreakpoint?: number;
|
|
25
25
|
}
|
|
26
26
|
export declare const IconContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
27
|
-
isActive?: boolean;
|
|
28
|
-
collapseSize: number;
|
|
27
|
+
$isActive?: boolean;
|
|
28
|
+
$collapseSize: number;
|
|
29
29
|
}>> & string;
|
|
30
30
|
declare const MainNavTooltipMenu: <ContentProps extends object = object>({ ariaLabel, children, closeWhenTagClicked, contentComponent, contentWidth, fullWidthBreakpoint, fullWidthDesktop, globalStateString, tooltipRight, zIndex, ...props }: MainNavTooltipMenuProps<ContentProps>) => React.JSX.Element;
|
|
31
31
|
export default MainNavTooltipMenu;
|
|
@@ -35,10 +35,10 @@ const IconContainer = styledComponents.styled.div `
|
|
|
35
35
|
}
|
|
36
36
|
> svg,
|
|
37
37
|
+ span {
|
|
38
|
-
color: ${p => (p
|
|
38
|
+
color: ${p => (p.$isActive ? theme.default.color.text.pink : 'inherit')};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
@media (min-width: ${p => p
|
|
41
|
+
@media (min-width: ${p => p.$collapseSize + 1}px) {
|
|
42
42
|
min-width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 6)};
|
|
43
43
|
+ span {
|
|
44
44
|
display: block;
|
|
@@ -53,13 +53,13 @@ const Tooltip = styledComponents.styled.div `
|
|
|
53
53
|
position: absolute;
|
|
54
54
|
right: 0;
|
|
55
55
|
top: ${navigation.navMaxHeight};
|
|
56
|
-
z-index: ${p => p
|
|
56
|
+
z-index: ${p => p.$zIndex};
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: row;
|
|
59
59
|
|
|
60
|
-
@media (min-width: ${p => p
|
|
61
|
-
width: ${p => p
|
|
62
|
-
right: ${p => (p
|
|
60
|
+
@media (min-width: ${p => p.$fullWidthBreakpoint}px) {
|
|
61
|
+
width: ${p => p.$contentWidth};
|
|
62
|
+
right: ${p => (p.$fullWidthDesktop ? 0 : p.$tooltipRight)};
|
|
63
63
|
}
|
|
64
64
|
`;
|
|
65
65
|
const TooltipBox = styledComponents.styled(Box.default) `
|
|
@@ -70,7 +70,7 @@ const TooltipBox = styledComponents.styled(Box.default) `
|
|
|
70
70
|
`;
|
|
71
71
|
const Caret = styledComponents.styled.div `
|
|
72
72
|
position: absolute;
|
|
73
|
-
z-index: ${p => p
|
|
73
|
+
z-index: ${p => p.$zIndex + 1};
|
|
74
74
|
top: ${navigation.navMaxHeight};
|
|
75
75
|
transform: translate3d(50%, -50%, 0) rotate(-45deg);
|
|
76
76
|
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.2)};
|
|
@@ -80,7 +80,7 @@ const Caret = styledComponents.styled.div `
|
|
|
80
80
|
border-width: 1px 1px 0 0;
|
|
81
81
|
margin-left: -${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
82
82
|
|
|
83
|
-
@media (min-width: ${p => p
|
|
83
|
+
@media (min-width: ${p => p.$collapseSize + 1}px) {
|
|
84
84
|
max-height: calc(var(--vh100, 100vh) - ${navigation.navMaxHeight});
|
|
85
85
|
}
|
|
86
86
|
`;
|
|
@@ -110,11 +110,11 @@ const MainNavTooltipMenu = (_a) => {
|
|
|
110
110
|
setTooltipItems(prevItems => (Object.assign(Object.assign({}, prevItems), { [globalStateKey]: false })));
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
return (React__default.default.createElement(IconContainer, { "data-testid": `header-${globalStateKey}-container`, collapseSize: collapseSize, ref: ref },
|
|
114
|
-
globalStateKey === 'login' && !isLoggedIn ? (React__default.default.createElement(ButtonPrimary.default, { onClick: ContentComponent ? toggleState : undefined, small: true }, children)) : (React__default.default.createElement(MainNavTooltipMenuExportedStyles.default, { "aria-label": ariaLabel, "aria-expanded": tooltipItems[globalStateKey], isLoggedIn: isLoginItemAndLoggedIn, collapseSize: collapseSize, isHighlighted: tooltipItems[globalStateKey] || isLoginItemAndLoggedIn, onClick: props.onCartButtonClick || (ContentComponent ? toggleState : undefined) }, children)),
|
|
113
|
+
return (React__default.default.createElement(IconContainer, { "data-testid": `header-${globalStateKey}-container`, "$collapseSize": collapseSize, ref: ref },
|
|
114
|
+
globalStateKey === 'login' && !isLoggedIn ? (React__default.default.createElement(ButtonPrimary.default, { onClick: ContentComponent ? toggleState : undefined, small: true }, children)) : (React__default.default.createElement(MainNavTooltipMenuExportedStyles.default, { "aria-label": ariaLabel, "aria-expanded": tooltipItems[globalStateKey], "$isLoggedIn": isLoginItemAndLoggedIn, "$collapseSize": collapseSize, "$isHighlighted": tooltipItems[globalStateKey] || isLoginItemAndLoggedIn, onClick: props.onCartButtonClick || (ContentComponent ? toggleState : undefined) }, children)),
|
|
115
115
|
tooltipItems[globalStateKey] && ContentComponent && (React__default.default.createElement(React__default.default.Fragment, null,
|
|
116
|
-
React__default.default.createElement(Caret, { zIndex: zIndex, collapseSize: collapseSize }),
|
|
117
|
-
React__default.default.createElement(Tooltip, { zIndex: zIndex, tooltipRight: tooltipRight, contentWidth: contentWidth, collapseSize: collapseSize, fullWidthDesktop: fullWidthDesktop, fullWidthBreakpoint: fullWidthBreakpoint },
|
|
116
|
+
React__default.default.createElement(Caret, { "$zIndex": zIndex, "$collapseSize": collapseSize }),
|
|
117
|
+
React__default.default.createElement(Tooltip, { "$zIndex": zIndex, "$tooltipRight": tooltipRight, "$contentWidth": contentWidth, "$collapseSize": collapseSize, "$fullWidthDesktop": fullWidthDesktop, "$fullWidthBreakpoint": fullWidthBreakpoint },
|
|
118
118
|
React__default.default.createElement(TooltipBox, { elevation: "high", padding: "0", width: "100%" },
|
|
119
119
|
React__default.default.createElement(ContentComponent, { mobileView: isMobileMenu })))))));
|
|
120
120
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const TooltipWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
2
|
-
collapseSize: number;
|
|
3
|
-
isHighlighted?: boolean;
|
|
4
|
-
isLoggedIn?: boolean;
|
|
2
|
+
$collapseSize: number;
|
|
3
|
+
$isHighlighted?: boolean;
|
|
4
|
+
$isLoggedIn?: boolean;
|
|
5
5
|
}>> & string;
|
|
6
6
|
export default TooltipWrapper;
|
|
7
7
|
export { TooltipWrapper };
|