@dnanpm/styleguide 3.11.1 → 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 +6 -6
- package/build/cjs/components/DateTimePicker/DateTimePicker.js +19 -27
- package/build/cjs/components/Footer/Components/FooterComponents.js +4 -2
- package/build/cjs/components/Footer/Footer.js +2 -1
- package/build/cjs/components/Input/Input.d.ts +6 -0
- package/build/cjs/components/Input/Input.js +5 -4
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +2 -1
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -1
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.js +4 -2
- 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 +2 -1
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +3 -1
- 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 +6 -6
- package/build/es/components/DateTimePicker/DateTimePicker.js +19 -27
- package/build/es/components/Footer/Components/FooterComponents.js +4 -2
- package/build/es/components/Footer/Footer.js +2 -1
- package/build/es/components/Input/Input.d.ts +6 -0
- package/build/es/components/Input/Input.js +5 -4
- package/build/es/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +2 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -1
- package/build/es/components/MainHeaderNavigation/globalNavStyles.js +4 -2
- 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 +2 -1
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +3 -1
- package/build/es/components/Tooltip/Tooltip.js +2 -1
- package/build/es/utils/styledUtils.js +4 -4
- package/package.json +9 -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
|
*/
|
|
@@ -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,18 +234,6 @@ 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 StyledInput = styledComponents.styled(Input.default) `
|
|
238
|
-
${({ disabled }) => !disabled &&
|
|
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
|
-
`}
|
|
248
|
-
`;
|
|
249
237
|
const VisuallyHiddenStatus = styledComponents.styled.div `
|
|
250
238
|
position: absolute;
|
|
251
239
|
left: -9999px;
|
|
@@ -259,9 +247,13 @@ const DateTimePickerCustomHeader = ({ date, decreaseMonth, increaseMonth, locale
|
|
|
259
247
|
React__default.default.createElement(ButtonIcon.default, { icon: icons.ChevronRight, onClick: increaseMonth, ariaLabel: ariaLabelNextMonth })));
|
|
260
248
|
/** @visibleName DateTime Picker */
|
|
261
249
|
const DateTimePicker = (_a) => {
|
|
262
|
-
var _b, _c;
|
|
250
|
+
var _b, _c, _d;
|
|
263
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']);
|
|
264
252
|
const [showReactDatePicker, setShowReactDatePicker] = React.useState(false);
|
|
253
|
+
const isRange = props.endDate !== undefined;
|
|
254
|
+
const callOnChange = (date, event) => {
|
|
255
|
+
props.onChange(date, event);
|
|
256
|
+
};
|
|
265
257
|
const handleOnInputFocus = () => {
|
|
266
258
|
setShowReactDatePicker(true);
|
|
267
259
|
};
|
|
@@ -282,17 +274,16 @@ const DateTimePicker = (_a) => {
|
|
|
282
274
|
setShowReactDatePicker(false);
|
|
283
275
|
}
|
|
284
276
|
if (!props.isEditable && ['Backspace', 'Delete', 'Clear'].includes(e.key)) {
|
|
285
|
-
|
|
277
|
+
callOnChange(null, e);
|
|
286
278
|
}
|
|
287
279
|
};
|
|
288
280
|
const handleClearable = (e) => {
|
|
289
|
-
|
|
281
|
+
callOnChange(null, e);
|
|
290
282
|
};
|
|
291
283
|
const handleOnReactDatePickerChange = (date, event) => {
|
|
292
284
|
var _a, _b;
|
|
293
|
-
const isSelectingRange = props.endDate !== undefined;
|
|
294
285
|
let shouldKeepOpen = false;
|
|
295
|
-
if (
|
|
286
|
+
if (isRange) {
|
|
296
287
|
const [start, end] = Array.isArray(date) && date.length === 2 ? date : [null, null];
|
|
297
288
|
shouldKeepOpen = !(start && end);
|
|
298
289
|
}
|
|
@@ -306,7 +297,7 @@ const DateTimePicker = (_a) => {
|
|
|
306
297
|
if (!shouldKeepOpen) {
|
|
307
298
|
setShowReactDatePicker(false);
|
|
308
299
|
}
|
|
309
|
-
|
|
300
|
+
callOnChange(date, event);
|
|
310
301
|
};
|
|
311
302
|
const handleOnReactDatePickerClickOutside = () => {
|
|
312
303
|
setShowReactDatePicker(false);
|
|
@@ -322,22 +313,23 @@ const DateTimePicker = (_a) => {
|
|
|
322
313
|
.join(' - ');
|
|
323
314
|
const getDateTimePickerCustomHeader = (args) => DateTimePickerCustomHeader(Object.assign(Object.assign({}, args), { locale, ariaLabelPreviousMonth: props.ariaLabelPreviousMonth, ariaLabelNextMonth: props.ariaLabelNextMonth }));
|
|
324
315
|
return (React__default.default.createElement(Wrapper, { id: props.id, className: props.className, "data-testid": dataTestId },
|
|
325
|
-
React__default.default.createElement(
|
|
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) => {
|
|
326
317
|
if (props.isEditable && e.target.value) {
|
|
327
318
|
const parsedDate = new Date(e.target.value);
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
props.onChange(parsedDate, e);
|
|
319
|
+
if (!Number.isNaN(parsedDate.getTime())) {
|
|
320
|
+
callOnChange(parsedDate, e);
|
|
331
321
|
}
|
|
332
322
|
}
|
|
333
323
|
} }),
|
|
334
324
|
React__default.default.createElement(VisuallyHiddenStatus, { role: "status", "aria-live": "polite" }, startDate instanceof Date && !Number.isNaN(startDate.getTime())
|
|
335
325
|
? (_b = props.ariaLiveAnnouncement) === null || _b === void 0 ? void 0 : _b.replace('{{date}}', startDate.toLocaleDateString(locale))
|
|
336
326
|
: ''),
|
|
337
|
-
showReactDatePicker &&
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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 })))));
|
|
341
333
|
};
|
|
342
334
|
|
|
343
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
|
}
|
|
@@ -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
|
*
|
|
@@ -170,20 +170,21 @@ const Input = React.forwardRef((_a, ref) => {
|
|
|
170
170
|
const inputType = getInputType();
|
|
171
171
|
return (React__default.default.createElement(FieldContainer, { className: props.className, "data-testid": dataTestId && `${dataTestId}-container` },
|
|
172
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)),
|
|
173
|
-
React__default.default.createElement(FieldWrapper, { "$status": props.status, "$type": inputType, "$disabled": props.disabled, "$readonly": props.readonly },
|
|
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 || 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 }),
|
|
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 }),
|
|
175
175
|
((props.status && props.status !== 'comment') ||
|
|
176
176
|
props.showPasswordToggle ||
|
|
177
177
|
props.disabled ||
|
|
178
178
|
props.readonly ||
|
|
179
|
+
props.readonlyUnstyled ||
|
|
179
180
|
props.onClearableButtonClick) && (React__default.default.createElement(IconWrapper, null,
|
|
180
181
|
props.showPasswordToggle && (React__default.default.createElement(StyledButtonIcon, { icon: showPassword ? icons.EyeOpen : icons.EyeClosed, onClick: togglePasswordVisibility, ariaLabel: props.passwordToggleLabel })),
|
|
181
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] })),
|
|
182
|
-
(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` })),
|
|
183
184
|
props.onClearableButtonClick &&
|
|
184
185
|
Boolean(props.value) &&
|
|
185
186
|
!props.disabled &&
|
|
186
|
-
!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 }))))),
|
|
187
188
|
props.status === 'error' && props.errorMessage && (React__default.default.createElement(ErrorMessage, { id: `${props.id}-error`, "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage)),
|
|
188
189
|
props.status === 'comment' && props.commentMessage && (React__default.default.createElement(Message, { id: `${props.id}-comment`, "data-testid": dataTestId && `${dataTestId}-comment` }, props.commentMessage))));
|
|
189
190
|
});
|
|
@@ -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
|
`;
|
|
@@ -32,7 +32,8 @@ const TooltipWrapper = styledComponents.styled.button `
|
|
|
32
32
|
&:focus-visible {
|
|
33
33
|
outline: 0;
|
|
34
34
|
border-radius: ${theme.default.radius.s};
|
|
35
|
-
box-shadow:
|
|
35
|
+
box-shadow:
|
|
36
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
36
37
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
37
38
|
> svg,
|
|
38
39
|
> span {
|
|
@@ -38,7 +38,8 @@ const MobileMenuButton = styledComponents.styled.button `
|
|
|
38
38
|
&:focus-visible {
|
|
39
39
|
outline: 0;
|
|
40
40
|
border-radius: ${theme.default.radius.s};
|
|
41
|
-
box-shadow:
|
|
41
|
+
box-shadow:
|
|
42
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
42
43
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
43
44
|
color: ${theme.default.color.text.black};
|
|
44
45
|
}
|
|
@@ -82,7 +83,8 @@ const MenuItem = styledComponents.styled.li `
|
|
|
82
83
|
&:focus-visible {
|
|
83
84
|
outline: 0;
|
|
84
85
|
border-radius: ${theme.default.radius.s};
|
|
85
|
-
box-shadow:
|
|
86
|
+
box-shadow:
|
|
87
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
86
88
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
87
89
|
}
|
|
88
90
|
${styledUtils.media.xl `
|
|
@@ -53,7 +53,8 @@ const ButtonCloseStyled = styledComponents.styled(ButtonClose.default) `
|
|
|
53
53
|
|
|
54
54
|
&:focus-visible {
|
|
55
55
|
outline: none;
|
|
56
|
-
box-shadow:
|
|
56
|
+
box-shadow:
|
|
57
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
57
58
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
58
59
|
}
|
|
59
60
|
`;
|
|
@@ -76,7 +76,8 @@ const Label = styledComponents.styled.label `
|
|
|
76
76
|
|
|
77
77
|
&:focus-within, *:focus > & {
|
|
78
78
|
outline: none;
|
|
79
|
-
box-shadow:
|
|
79
|
+
box-shadow:
|
|
80
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
80
81
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -79,7 +79,8 @@ const Input = styledComponents.styled.input `
|
|
|
79
79
|
|
|
80
80
|
&:focus-visible {
|
|
81
81
|
outline: none;
|
|
82
|
-
box-shadow:
|
|
82
|
+
box-shadow:
|
|
83
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
83
84
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
84
85
|
}
|
|
85
86
|
`;
|
|
@@ -76,7 +76,9 @@ const SecondaryNavigationList = styledComponents.styled.ul `
|
|
|
76
76
|
overflow: hidden;
|
|
77
77
|
display: flex;
|
|
78
78
|
flex-direction: column;
|
|
79
|
-
transition:
|
|
79
|
+
transition:
|
|
80
|
+
max-height 0.2s ease-in-out,
|
|
81
|
+
border-bottom 0.2s linear;
|
|
80
82
|
background-color: ${({ isOpen }) => isOpen ? theme.default.color.background.white.default : 'transparent'};
|
|
81
83
|
max-height: ${({ isOpen }) => (isOpen ? '500vh' : '0')};
|
|
82
84
|
border-bottom: ${({ isOpen }) => (isOpen ? `1px solid ${theme.default.color.line.L03}` : 'none')};
|
|
@@ -33,7 +33,8 @@ const Helper = styledComponents.styled.button `
|
|
|
33
33
|
|
|
34
34
|
&:focus-visible {
|
|
35
35
|
outline: none;
|
|
36
|
-
box-shadow:
|
|
36
|
+
box-shadow:
|
|
37
|
+
0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
37
38
|
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
38
39
|
border-radius: 100%;
|
|
39
40
|
}
|
|
@@ -7,10 +7,10 @@ const getMultipliedSize = (base, multiply) => `${multiply * base.value}${base.un
|
|
|
7
7
|
const getDividedSize = (base, divide) => `${base.value / divide}${base.unit}`;
|
|
8
8
|
const media = Object.keys(breakpoints.default).reduce((acc, label) => {
|
|
9
9
|
acc[label] = (literals, ...placeholders) => styledComponents.css `
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
@media (min-width: ${breakpoints.default[label]}px) {
|
|
11
|
+
${styledComponents.css(literals, ...placeholders)};
|
|
12
|
+
}
|
|
13
|
+
`.join('');
|
|
14
14
|
return acc;
|
|
15
15
|
}, {});
|
|
16
16
|
|
|
@@ -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
|
*/
|
|
@@ -77,7 +77,6 @@ const Wrapper = styled.div `
|
|
|
77
77
|
padding: ${getMultipliedSize(theme.base.baseWidth, 1)}
|
|
78
78
|
${getMultipliedSize(theme.base.baseWidth, 1)}
|
|
79
79
|
${getMultipliedSize(theme.base.baseWidth, 0.5)};
|
|
80
|
-
border-bottom: 1px solid ${theme.color.line.L03};
|
|
81
80
|
background-color: ${theme.color.background.sand.E01};
|
|
82
81
|
|
|
83
82
|
.react-datepicker-time__header {
|
|
@@ -91,6 +90,7 @@ const Wrapper = styled.div `
|
|
|
91
90
|
& .react-datepicker__month,
|
|
92
91
|
.react-datepicker__time-list {
|
|
93
92
|
display: grid;
|
|
93
|
+
border-top: 1px solid ${theme.color.line.L03};
|
|
94
94
|
gap: ${getMultipliedSize(theme.base.baseWidth, 0.5)};
|
|
95
95
|
color: ${theme.color.text.gray};
|
|
96
96
|
padding: ${getMultipliedSize(theme.base.baseWidth, 0.5)}
|
|
@@ -225,18 +225,6 @@ const CurrentMonth = styled.div `
|
|
|
225
225
|
line-height: ${theme.lineHeight.default};
|
|
226
226
|
font-weight: ${theme.fontWeight.bold};
|
|
227
227
|
`;
|
|
228
|
-
const StyledInput = styled(Input) `
|
|
229
|
-
${({ disabled }) => !disabled &&
|
|
230
|
-
`
|
|
231
|
-
div {
|
|
232
|
-
background-color: ${theme.color.background.white.default};
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.react-datepicker-ignore-onclickoutside-lock-icon {
|
|
236
|
-
display: none;
|
|
237
|
-
}
|
|
238
|
-
`}
|
|
239
|
-
`;
|
|
240
228
|
const VisuallyHiddenStatus = styled.div `
|
|
241
229
|
position: absolute;
|
|
242
230
|
left: -9999px;
|
|
@@ -250,9 +238,13 @@ const DateTimePickerCustomHeader = ({ date, decreaseMonth, increaseMonth, locale
|
|
|
250
238
|
React__default.createElement(ButtonIcon, { icon: ChevronRight, onClick: increaseMonth, ariaLabel: ariaLabelNextMonth })));
|
|
251
239
|
/** @visibleName DateTime Picker */
|
|
252
240
|
const DateTimePicker = (_a) => {
|
|
253
|
-
var _b, _c;
|
|
241
|
+
var _b, _c, _d;
|
|
254
242
|
var { date: startDate, locale = 'fi-FI', isDatePicker = true, isTimePicker = false, timeInterval = 30, 'data-testid': dataTestId } = _a, props = __rest(_a, ["date", "locale", "isDatePicker", "isTimePicker", "timeInterval", 'data-testid']);
|
|
255
243
|
const [showReactDatePicker, setShowReactDatePicker] = useState(false);
|
|
244
|
+
const isRange = props.endDate !== undefined;
|
|
245
|
+
const callOnChange = (date, event) => {
|
|
246
|
+
props.onChange(date, event);
|
|
247
|
+
};
|
|
256
248
|
const handleOnInputFocus = () => {
|
|
257
249
|
setShowReactDatePicker(true);
|
|
258
250
|
};
|
|
@@ -273,17 +265,16 @@ const DateTimePicker = (_a) => {
|
|
|
273
265
|
setShowReactDatePicker(false);
|
|
274
266
|
}
|
|
275
267
|
if (!props.isEditable && ['Backspace', 'Delete', 'Clear'].includes(e.key)) {
|
|
276
|
-
|
|
268
|
+
callOnChange(null, e);
|
|
277
269
|
}
|
|
278
270
|
};
|
|
279
271
|
const handleClearable = (e) => {
|
|
280
|
-
|
|
272
|
+
callOnChange(null, e);
|
|
281
273
|
};
|
|
282
274
|
const handleOnReactDatePickerChange = (date, event) => {
|
|
283
275
|
var _a, _b;
|
|
284
|
-
const isSelectingRange = props.endDate !== undefined;
|
|
285
276
|
let shouldKeepOpen = false;
|
|
286
|
-
if (
|
|
277
|
+
if (isRange) {
|
|
287
278
|
const [start, end] = Array.isArray(date) && date.length === 2 ? date : [null, null];
|
|
288
279
|
shouldKeepOpen = !(start && end);
|
|
289
280
|
}
|
|
@@ -297,7 +288,7 @@ const DateTimePicker = (_a) => {
|
|
|
297
288
|
if (!shouldKeepOpen) {
|
|
298
289
|
setShowReactDatePicker(false);
|
|
299
290
|
}
|
|
300
|
-
|
|
291
|
+
callOnChange(date, event);
|
|
301
292
|
};
|
|
302
293
|
const handleOnReactDatePickerClickOutside = () => {
|
|
303
294
|
setShowReactDatePicker(false);
|
|
@@ -313,22 +304,23 @@ const DateTimePicker = (_a) => {
|
|
|
313
304
|
.join(' - ');
|
|
314
305
|
const getDateTimePickerCustomHeader = (args) => DateTimePickerCustomHeader(Object.assign(Object.assign({}, args), { locale, ariaLabelPreviousMonth: props.ariaLabelPreviousMonth, ariaLabelNextMonth: props.ariaLabelNextMonth }));
|
|
315
306
|
return (React__default.createElement(Wrapper, { id: props.id, className: props.className, "data-testid": dataTestId },
|
|
316
|
-
React__default.createElement(
|
|
307
|
+
React__default.createElement(Input, { 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
308
|
if (props.isEditable && e.target.value) {
|
|
318
309
|
const parsedDate = new Date(e.target.value);
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
props.onChange(parsedDate, e);
|
|
310
|
+
if (!Number.isNaN(parsedDate.getTime())) {
|
|
311
|
+
callOnChange(parsedDate, e);
|
|
322
312
|
}
|
|
323
313
|
}
|
|
324
314
|
} }),
|
|
325
315
|
React__default.createElement(VisuallyHiddenStatus, { role: "status", "aria-live": "polite" }, startDate instanceof Date && !Number.isNaN(startDate.getTime())
|
|
326
316
|
? (_b = props.ariaLiveAnnouncement) === null || _b === void 0 ? void 0 : _b.replace('{{date}}', startDate.toLocaleDateString(locale))
|
|
327
317
|
: ''),
|
|
328
|
-
showReactDatePicker &&
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
318
|
+
showReactDatePicker &&
|
|
319
|
+
(isRange ? (React__default.createElement(ReactDatePicker, { 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']
|
|
320
|
+
.filter(Boolean)
|
|
321
|
+
.join(''), renderCustomHeader: getDateTimePickerCustomHeader })) : (React__default.createElement(ReactDatePicker, { 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']
|
|
322
|
+
.filter(Boolean)
|
|
323
|
+
.join(''), renderCustomHeader: getDateTimePickerCustomHeader })))));
|
|
332
324
|
};
|
|
333
325
|
|
|
334
326
|
export { DateTimePicker as default };
|
|
@@ -43,7 +43,8 @@ const BaseContainer = styled.div `
|
|
|
43
43
|
`;
|
|
44
44
|
const CategoryLinks = styled.ul `
|
|
45
45
|
display: ${({ $active }) => ($active ? 'flex' : 'none')};
|
|
46
|
-
transition:
|
|
46
|
+
transition:
|
|
47
|
+
all 0.3s ease-in-out,
|
|
47
48
|
padding 0s linear ${({ $active }) => ($active ? '0s' : '0.3s')};
|
|
48
49
|
max-height: ${({ $active }) => ($active ? '500' : '0')}px;
|
|
49
50
|
flex-direction: column;
|
|
@@ -62,7 +63,8 @@ const CategoryHeader = styled.button `
|
|
|
62
63
|
justify-content: space-between;
|
|
63
64
|
&:focus-visible {
|
|
64
65
|
outline: 1px solid transparent;
|
|
65
|
-
box-shadow:
|
|
66
|
+
box-shadow:
|
|
67
|
+
0px 0px 0px 2px ${theme.color.focus.light},
|
|
66
68
|
0px 0px 0px 4px ${theme.color.focus.dark};
|
|
67
69
|
${theme.radius.s};
|
|
68
70
|
}
|
|
@@ -21,7 +21,8 @@ const FooterContainer = styled.footer `
|
|
|
21
21
|
&:focus-visible {
|
|
22
22
|
text-decoration: none;
|
|
23
23
|
outline: 1px solid transparent;
|
|
24
|
-
box-shadow:
|
|
24
|
+
box-shadow:
|
|
25
|
+
0px 0px 0px 2px ${theme.color.focus.light},
|
|
25
26
|
0px 0px 0px 4px ${theme.color.focus.dark};
|
|
26
27
|
&:not(.menu-link):not(${LangLink}) {
|
|
27
28
|
${theme.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
|
*
|
|
@@ -162,20 +162,21 @@ const Input = forwardRef((_a, ref) => {
|
|
|
162
162
|
const inputType = getInputType();
|
|
163
163
|
return (React__default.createElement(FieldContainer, { className: props.className, "data-testid": dataTestId && `${dataTestId}-container` },
|
|
164
164
|
props.label && (React__default.createElement(LabelText, { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label`, status: props.status === 'error' ? props.status : undefined, isMandatory: props.required }, props.label)),
|
|
165
|
-
React__default.createElement(FieldWrapper, { "$status": props.status, "$type": inputType, "$disabled": props.disabled, "$readonly": props.readonly },
|
|
166
|
-
React__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 || 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 }),
|
|
165
|
+
React__default.createElement(FieldWrapper, { "$status": props.status, "$type": inputType, "$disabled": props.disabled, "$readonly": props.readonly && !props.readonlyUnstyled },
|
|
166
|
+
React__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 }),
|
|
167
167
|
((props.status && props.status !== 'comment') ||
|
|
168
168
|
props.showPasswordToggle ||
|
|
169
169
|
props.disabled ||
|
|
170
170
|
props.readonly ||
|
|
171
|
+
props.readonlyUnstyled ||
|
|
171
172
|
props.onClearableButtonClick) && (React__default.createElement(IconWrapper, null,
|
|
172
173
|
props.showPasswordToggle && (React__default.createElement(StyledButtonIcon, { icon: showPassword ? EyeOpen : EyeClosed, onClick: togglePasswordVisibility, ariaLabel: props.passwordToggleLabel })),
|
|
173
174
|
(props.status === 'success' || props.status === 'error') && (React__default.createElement(Icon, { "aria-hidden": true, icon: iconsMap[props.status], color: theme.color.notification[props.status] })),
|
|
174
|
-
(props.disabled || props.readonly) && (React__default.createElement(Icon, { "aria-hidden": true, icon: Lock, className: props.className && `${props.className}-lock-icon` })),
|
|
175
|
+
(props.disabled || (props.readonly && !props.readonlyUnstyled)) && (React__default.createElement(Icon, { "aria-hidden": true, icon: Lock, className: props.className && `${props.className}-lock-icon` })),
|
|
175
176
|
props.onClearableButtonClick &&
|
|
176
177
|
Boolean(props.value) &&
|
|
177
178
|
!props.disabled &&
|
|
178
|
-
!props.readonly && (React__default.createElement(ButtonIcon, { icon: Close, onClick: props.onClearableButtonClick, ariaLabel: props.clearButtonLabel }))))),
|
|
179
|
+
(!props.readonly || props.readonlyUnstyled) && (React__default.createElement(ButtonIcon, { icon: Close, onClick: props.onClearableButtonClick, ariaLabel: props.clearButtonLabel }))))),
|
|
179
180
|
props.status === 'error' && props.errorMessage && (React__default.createElement(ErrorMessage, { id: `${props.id}-error`, "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage)),
|
|
180
181
|
props.status === 'comment' && props.commentMessage && (React__default.createElement(Message, { id: `${props.id}-comment`, "data-testid": dataTestId && `${dataTestId}-comment` }, props.commentMessage))));
|
|
181
182
|
});
|
package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js
CHANGED
|
@@ -28,7 +28,8 @@ const TooltipWrapper = styled.button `
|
|
|
28
28
|
&:focus-visible {
|
|
29
29
|
outline: 0;
|
|
30
30
|
border-radius: ${theme.radius.s};
|
|
31
|
-
box-shadow:
|
|
31
|
+
box-shadow:
|
|
32
|
+
0px 0px 0px 2px ${theme.color.focus.light},
|
|
32
33
|
0px 0px 0px 4px ${theme.color.focus.dark};
|
|
33
34
|
> svg,
|
|
34
35
|
> span {
|
|
@@ -36,7 +36,8 @@ const MobileMenuButton = styled.button `
|
|
|
36
36
|
&:focus-visible {
|
|
37
37
|
outline: 0;
|
|
38
38
|
border-radius: ${theme.radius.s};
|
|
39
|
-
box-shadow:
|
|
39
|
+
box-shadow:
|
|
40
|
+
0px 0px 0px 2px ${theme.color.focus.light},
|
|
40
41
|
0px 0px 0px 4px ${theme.color.focus.dark};
|
|
41
42
|
color: ${theme.color.text.black};
|
|
42
43
|
}
|
|
@@ -80,7 +81,8 @@ const MenuItem = styled.li `
|
|
|
80
81
|
&:focus-visible {
|
|
81
82
|
outline: 0;
|
|
82
83
|
border-radius: ${theme.radius.s};
|
|
83
|
-
box-shadow:
|
|
84
|
+
box-shadow:
|
|
85
|
+
0px 0px 0px 2px ${theme.color.focus.light},
|
|
84
86
|
0px 0px 0px 4px ${theme.color.focus.dark};
|
|
85
87
|
}
|
|
86
88
|
${media.xl `
|
|
@@ -45,7 +45,8 @@ const ButtonCloseStyled = styled(ButtonClose) `
|
|
|
45
45
|
|
|
46
46
|
&:focus-visible {
|
|
47
47
|
outline: none;
|
|
48
|
-
box-shadow:
|
|
48
|
+
box-shadow:
|
|
49
|
+
0px 0px 0px 2px ${theme.color.focus.light},
|
|
49
50
|
0px 0px 0px 4px ${theme.color.focus.dark};
|
|
50
51
|
}
|
|
51
52
|
`;
|
|
@@ -68,7 +68,9 @@ const SecondaryNavigationList = styled.ul `
|
|
|
68
68
|
overflow: hidden;
|
|
69
69
|
display: flex;
|
|
70
70
|
flex-direction: column;
|
|
71
|
-
transition:
|
|
71
|
+
transition:
|
|
72
|
+
max-height 0.2s ease-in-out,
|
|
73
|
+
border-bottom 0.2s linear;
|
|
72
74
|
background-color: ${({ isOpen }) => isOpen ? theme.color.background.white.default : 'transparent'};
|
|
73
75
|
max-height: ${({ isOpen }) => (isOpen ? '500vh' : '0')};
|
|
74
76
|
border-bottom: ${({ isOpen }) => (isOpen ? `1px solid ${theme.color.line.L03}` : 'none')};
|
|
@@ -25,7 +25,8 @@ const Helper = styled.button `
|
|
|
25
25
|
|
|
26
26
|
&:focus-visible {
|
|
27
27
|
outline: none;
|
|
28
|
-
box-shadow:
|
|
28
|
+
box-shadow:
|
|
29
|
+
0px 0px 0px 2px ${theme.color.focus.light},
|
|
29
30
|
0px 0px 0px 4px ${theme.color.focus.dark};
|
|
30
31
|
border-radius: 100%;
|
|
31
32
|
}
|
|
@@ -5,10 +5,10 @@ const getMultipliedSize = (base, multiply) => `${multiply * base.value}${base.un
|
|
|
5
5
|
const getDividedSize = (base, divide) => `${base.value / divide}${base.unit}`;
|
|
6
6
|
const media = Object.keys(breakpoints).reduce((acc, label) => {
|
|
7
7
|
acc[label] = (literals, ...placeholders) => css `
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
@media (min-width: ${breakpoints[label]}px) {
|
|
9
|
+
${css(literals, ...placeholders)};
|
|
10
|
+
}
|
|
11
|
+
`.join('');
|
|
12
12
|
return acc;
|
|
13
13
|
}, {});
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnanpm/styleguide",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "v3.11.
|
|
4
|
+
"version": "v3.11.2",
|
|
5
5
|
"main": "build/cjs/index.js",
|
|
6
6
|
"module": "build/es/index.js",
|
|
7
7
|
"jsnext:main": "build/es/index.js",
|
|
@@ -30,9 +30,11 @@
|
|
|
30
30
|
"prepublishOnly": "npm run clean && npm ci && npm run eslint:check && npm run format:check && npm run build",
|
|
31
31
|
"styleguide": "styleguidist server",
|
|
32
32
|
"styleguide:build": "styleguidist build",
|
|
33
|
+
"dev": "npm run styleguide",
|
|
33
34
|
"tar": "npm run clean && npm ci && npm run build && npm pack && mv dnanpm-styleguide*.tgz dnanpm-styleguide-snapshot.tgz",
|
|
34
35
|
"test": "cross-env jest --maxWorkers=2 --coverage",
|
|
35
|
-
"test:coverage": "rm -rf coverage && cross-env jest --coverage --runInBand --no-cache"
|
|
36
|
+
"test:coverage": "rm -rf coverage && cross-env jest --coverage --runInBand --no-cache",
|
|
37
|
+
"preCommit": "npm run eslint:check && npm run format:check"
|
|
36
38
|
},
|
|
37
39
|
"browserslist": [
|
|
38
40
|
">0.2%",
|
|
@@ -52,7 +54,7 @@
|
|
|
52
54
|
"@testing-library/jest-dom": "^6.6.3",
|
|
53
55
|
"@testing-library/react": "^16.3.0",
|
|
54
56
|
"@testing-library/user-event": "^14.5.2",
|
|
55
|
-
"@types/jest": "^
|
|
57
|
+
"@types/jest": "^30.0.0",
|
|
56
58
|
"@types/node": "^17.0.45",
|
|
57
59
|
"@types/ramda": "^0.27.36",
|
|
58
60
|
"@types/react": "^18.3.11",
|
|
@@ -63,7 +65,7 @@
|
|
|
63
65
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
64
66
|
"@typescript-eslint/parser": "^5.62.0",
|
|
65
67
|
"babel-loader": "^9.2.1",
|
|
66
|
-
"cross-env": "^
|
|
68
|
+
"cross-env": "^10.0.0",
|
|
67
69
|
"css-loader": "^6.11.0",
|
|
68
70
|
"eslint": "^8.57.1",
|
|
69
71
|
"eslint-config-airbnb": "^19.0.4",
|
|
@@ -75,11 +77,11 @@
|
|
|
75
77
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
76
78
|
"eslint-plugin-react": "^7.37.4",
|
|
77
79
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
78
|
-
"jest": "^
|
|
80
|
+
"jest": "^30.0.5",
|
|
79
81
|
"jest-environment-jsdom": "^29.7.0",
|
|
80
82
|
"jest-styled-components": "^7.2.0",
|
|
81
83
|
"mini-css-extract-plugin": "^2.9.2",
|
|
82
|
-
"prettier": "^
|
|
84
|
+
"prettier": "^3.6.2",
|
|
83
85
|
"react": "^18.3.1",
|
|
84
86
|
"react-docgen": "^5.4.3",
|
|
85
87
|
"react-docgen-typescript": "^2.2.2",
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
},
|
|
98
100
|
"dependencies": {
|
|
99
101
|
"ramda": "^0.27.1",
|
|
100
|
-
"react-datepicker": "^
|
|
102
|
+
"react-datepicker": "^8.4.0",
|
|
101
103
|
"react-modal": "^3.16.1",
|
|
102
104
|
"react-select": "^5.8.1",
|
|
103
105
|
"react-spring": "^8.0.27",
|