@itcase/ui 1.9.51 → 1.9.52
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/dist/{Avatar_cjs_CZ0XJ6d2.js → Avatar_cjs_CvbURI0f.js} +1 -1
- package/dist/{Avatar_es_B2gMldVe.js → Avatar_es_CV-ffIJu.js} +1 -1
- package/dist/{ChipsGroup_cjs_D0xy5I4S.js → ChipsGroup_cjs_CE-nNENH.js} +2 -4
- package/dist/{ChipsGroup_es_C_dgXLfC.js → ChipsGroup_es_CxqwFgoo.js} +2 -4
- package/dist/{Image_cjs_C_FMjUjx.js → Image_cjs_Hvjp2QDB.js} +2 -2
- package/dist/{Image_es_Ca7UQOkj.js → Image_es_DpOCNWpn.js} +2 -2
- package/dist/{SelectContainer_cjs_DshFNYWN.js → SelectContainer_cjs_qWAMLIkz.js} +5 -5
- package/dist/{SelectContainer_es_BQ3-SqL2.js → SelectContainer_es_kRH4DsEh.js} +5 -5
- package/dist/cjs/components/Avatar.js +2 -2
- package/dist/cjs/components/AvatarStack.js +2 -2
- package/dist/cjs/components/Checkbox.js +47 -50
- package/dist/cjs/components/Checkmark.js +31 -6
- package/dist/cjs/components/Chips.js +1 -1
- package/dist/cjs/components/DatePeriod.js +8 -8
- package/dist/cjs/components/DatePicker.js +4 -4
- package/dist/cjs/components/Drawer.js +23 -24
- package/dist/cjs/components/Image.js +1 -1
- package/dist/cjs/components/InputPassword.js +1 -1
- package/dist/cjs/components/Select/stories/__mock__.js +4 -4
- package/dist/cjs/components/Select.js +2 -2
- package/dist/cjs/components/Tile.js +2 -1
- package/dist/cjs/context/Notifications.js +1 -1
- package/dist/cjs/context/UIContext.js +7 -1
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.helpers.js +9 -9
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.js +3 -3
- package/dist/cjs/hooks/useStyles/styleAttributes.js +166 -43
- package/dist/cjs/hooks/useStyles/useStyles.js +169 -155
- package/dist/cjs/utils/mergeAppearanceKeys.js +14 -1
- package/dist/components/Avatar.js +2 -2
- package/dist/components/AvatarStack.js +2 -2
- package/dist/components/Checkbox.js +47 -50
- package/dist/components/Checkmark.js +31 -6
- package/dist/components/Chips.js +1 -1
- package/dist/components/DatePeriod.js +8 -8
- package/dist/components/DatePicker.js +4 -4
- package/dist/components/Drawer.js +23 -24
- package/dist/components/Image.js +1 -1
- package/dist/components/InputPassword.js +1 -1
- package/dist/components/Select/stories/__mock__.js +4 -4
- package/dist/components/Select.js +2 -2
- package/dist/components/Tile.js +2 -1
- package/dist/context/Notifications.js +1 -1
- package/dist/context/UIContext.js +7 -1
- package/dist/css/styles/bundles.css +102 -97
- package/dist/hooks/useActiveClasses/useActiveClasses.helpers.js +9 -9
- package/dist/hooks/useActiveClasses/useActiveClasses.js +3 -3
- package/dist/hooks/useStyles/styleAttributes.js +166 -43
- package/dist/hooks/useStyles/useStyles.js +169 -155
- package/dist/types/components/Avatar/Avatar.interface.d.ts +2 -2
- package/dist/types/components/AvatarStack/AvatarStack.interface.d.ts +9 -15
- package/dist/types/components/Breadcrumbs/Breadcrumbs.interface.d.ts +9 -8
- package/dist/types/components/Checkbox/Checkbox.interface.d.ts +3 -3
- package/dist/types/components/Checkbox/appearance/checkboxShape.d.ts +3 -0
- package/dist/types/components/Checkmark/Checkmark.interface.d.ts +8 -2
- package/dist/types/components/Checkmark/appearance/checkmarkError.d.ts +3 -0
- package/dist/types/components/Checkmark/stories/CheckmarkError.stories.d.ts +23 -0
- package/dist/types/components/Chips/Chips.interface.d.ts +2 -2
- package/dist/types/components/DatePeriod/DatePeriod.interface.d.ts +20 -19
- package/dist/types/components/DatePeriod/stories/DatePeriodSize.stories.d.ts +3 -0
- package/dist/types/components/DatePicker/DatePicker.interface.d.ts +4 -3
- package/dist/types/components/HeroTitle/HeroTitle.interface.d.ts +1 -1
- package/dist/types/components/Link/Link.interface.d.ts +1 -1
- package/dist/types/components/List/List.interface.d.ts +1 -1
- package/dist/types/components/Loader/Loader.interface.d.ts +4 -3
- package/dist/types/components/MenuItem/MenuItem.interface.d.ts +1 -1
- package/dist/types/components/Notification/Notification.interface.d.ts +2 -2
- package/dist/types/components/Search/Search.interface.d.ts +10 -9
- package/dist/types/components/Search/SearchInput.d.ts +7 -7
- package/dist/types/components/Search/stories/SearchInputDefault.stories.d.ts +7 -7
- package/dist/types/components/Search/stories/SearchInputDemo.stories.d.ts +7 -7
- package/dist/types/components/Search/stories/SearchInputDisabled.stories.d.ts +7 -7
- package/dist/types/components/Search/stories/SearchInputError.stories.d.ts +7 -7
- package/dist/types/components/Search/stories/SearchInputRequire.stories.d.ts +7 -7
- package/dist/types/components/Search/stories/SearchInputShape.stories.d.ts +7 -7
- package/dist/types/components/Search/stories/SearchInputSize.stories.d.ts +7 -7
- package/dist/types/components/Search/stories/SearchInputStyle.stories.d.ts +7 -7
- package/dist/types/components/Search/stories/SearchInputSuccess.stories.d.ts +7 -7
- package/dist/types/components/Select/Select.interface.d.ts +9 -7
- package/dist/types/components/Select/SelectContainer.d.ts +4 -1
- package/dist/types/components/Select/SelectMultiValue.d.ts +2 -2
- package/dist/types/components/Select/stories/Select.stories.d.ts +5 -3
- package/dist/types/components/Select/stories/SelectDefault.stories.d.ts +5 -3
- package/dist/types/components/Select/stories/SelectDisabled.stories.d.ts +5 -3
- package/dist/types/components/Select/stories/SelectError.stories.d.ts +5 -3
- package/dist/types/components/Select/stories/SelectRequire.stories.d.ts +5 -3
- package/dist/types/components/Select/stories/SelectShape.stories.d.ts +5 -3
- package/dist/types/components/Select/stories/SelectSize.stories.d.ts +5 -3
- package/dist/types/components/Select/stories/SelectStyle.stories.d.ts +5 -3
- package/dist/types/components/Select/stories/SelectSuccess.stories.d.ts +5 -3
- package/dist/types/components/Select/stories/__mock__/index.d.ts +2 -2
- package/dist/types/components/Swiper/Swiper.interface.d.ts +2 -11
- package/dist/types/components/Text/Text.interface.d.ts +2 -2
- package/dist/types/context/Notifications.d.ts +1 -1
- package/dist/types/context/Notifications.interface.d.ts +2 -1
- package/dist/types/context/UIContext.d.ts +10 -4
- package/dist/types/hooks/useActiveClasses/useActiveClasses.interface.d.ts +1 -2
- package/dist/types/hooks/useStyles/styleAttributes.d.ts +2 -3
- package/dist/types/hooks/useStyles/styleAttributes.interface.d.ts +9 -3
- package/dist/types/hooks/useStyles/useStyles.d.ts +4 -1
- package/dist/types/utils/mergeAppearanceKeys.d.ts +6 -1
- package/dist/utils/mergeAppearanceKeys.js +14 -1
- package/package.json +12 -12
- package/dist/{DatePicker_cjs_avA-OHmZ.js → DatePicker_cjs_BJzVpk0o.js} +3 -3
- package/dist/{DatePicker_es_ungoFvip.js → DatePicker_es_BP0iWHMt.js} +3 -3
|
@@ -3,6 +3,8 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
6
|
+
import { I as Icon } from '../Icon_es_BYViOa6l.js';
|
|
7
|
+
import { icons14, icons20, icons24, icons32, icons40 } from '@itcase/icons/default';
|
|
6
8
|
import 'react';
|
|
7
9
|
import 'lodash/camelCase';
|
|
8
10
|
import 'lodash/castArray';
|
|
@@ -17,6 +19,11 @@ import '../utils/setViewportProperty.js';
|
|
|
17
19
|
import '../hooks.js';
|
|
18
20
|
import '../hooks/useStyles/styleAttributes.js';
|
|
19
21
|
import 'lodash/maxBy';
|
|
22
|
+
import 'react-inlinesvg';
|
|
23
|
+
import '../hoc/urlWithAssetPrefix.js';
|
|
24
|
+
import '../context/UrlAssetPrefix.js';
|
|
25
|
+
import '../Link_es_BDAmhIzd.js';
|
|
26
|
+
import '../Text_es_DVNvU0m0.js';
|
|
20
27
|
|
|
21
28
|
const checkmarkAppearanceAccent = {
|
|
22
29
|
accentPrimary: {
|
|
@@ -24,7 +31,7 @@ const checkmarkAppearanceAccent = {
|
|
|
24
31
|
fillActive: 'accentPrimary',
|
|
25
32
|
borderColor: 'accentBorderPrimary',
|
|
26
33
|
borderWidth: '2',
|
|
27
|
-
|
|
34
|
+
checkmarkIconFill: 'accentItemPrimary',
|
|
28
35
|
},
|
|
29
36
|
};
|
|
30
37
|
|
|
@@ -34,31 +41,48 @@ const checkmarkAppearanceDisabled = {
|
|
|
34
41
|
fillActive: 'surfaceDisabled',
|
|
35
42
|
borderColor: 'surfaceBorderDisabled',
|
|
36
43
|
borderWidth: '2',
|
|
37
|
-
|
|
44
|
+
checkmarkIconFill: 'surfaceItemDisabled',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const checkmarkAppearanceError = {
|
|
49
|
+
errorPrimary: {
|
|
50
|
+
fill: 'extraPrimary',
|
|
51
|
+
fillActive: 'extraActivePrimary',
|
|
52
|
+
borderColor: 'extraBorderTertiary',
|
|
53
|
+
borderWidth: '2',
|
|
54
|
+
checkmarkIconFill: 'extraItemPrimary',
|
|
38
55
|
},
|
|
39
56
|
};
|
|
40
57
|
|
|
41
58
|
const checkmarkAppearanceSize = {
|
|
42
59
|
sizeXXL: {
|
|
43
60
|
size: 'xxl',
|
|
61
|
+
checkmarkIcon: icons40.General.Check,
|
|
44
62
|
},
|
|
45
63
|
sizeXL: {
|
|
46
64
|
size: 'xl',
|
|
65
|
+
checkmarkIcon: icons40.General.Check,
|
|
47
66
|
},
|
|
48
67
|
sizeL: {
|
|
49
68
|
size: 'l',
|
|
69
|
+
checkmarkIcon: icons32.General.Check,
|
|
50
70
|
},
|
|
51
71
|
sizeM: {
|
|
52
72
|
size: 'm',
|
|
73
|
+
checkmarkIcon: icons24.Form.Check,
|
|
53
74
|
},
|
|
54
75
|
sizeS: {
|
|
55
76
|
size: 's',
|
|
77
|
+
checkmarkIcon: icons24.Form.Check,
|
|
56
78
|
},
|
|
57
79
|
sizeXS: {
|
|
58
80
|
size: 'xs',
|
|
81
|
+
checkmarkIcon: icons20.Form.Check,
|
|
59
82
|
},
|
|
60
83
|
sizeXXS: {
|
|
61
84
|
size: 'xxs',
|
|
85
|
+
checkmarkIcon: icons14.Form.Check,
|
|
62
86
|
},
|
|
63
87
|
};
|
|
64
88
|
|
|
@@ -84,7 +108,7 @@ const checkmarkAppearanceSurface = {
|
|
|
84
108
|
borderColor: 'surfaceBorderTertiary',
|
|
85
109
|
borderColorHover: 'surfaceBorderPrimary',
|
|
86
110
|
borderWidth: '2',
|
|
87
|
-
|
|
111
|
+
checkmarkIconFill: 'surfaceItemPrimary',
|
|
88
112
|
},
|
|
89
113
|
surfaceSecondary: {
|
|
90
114
|
fill: 'surfaceSecondary',
|
|
@@ -93,7 +117,7 @@ const checkmarkAppearanceSurface = {
|
|
|
93
117
|
borderColor: 'surfaceBorderTertiary',
|
|
94
118
|
borderColorHover: 'surfaceBorderPrimary',
|
|
95
119
|
borderWidth: '2',
|
|
96
|
-
|
|
120
|
+
checkmarkIconFill: 'surfaceItemPrimary',
|
|
97
121
|
},
|
|
98
122
|
};
|
|
99
123
|
|
|
@@ -103,6 +127,7 @@ const checkmarkAppearance = {
|
|
|
103
127
|
...checkmarkAppearanceStyle,
|
|
104
128
|
...checkmarkAppearanceSurface,
|
|
105
129
|
...checkmarkAppearanceSize,
|
|
130
|
+
...checkmarkAppearanceError,
|
|
106
131
|
};
|
|
107
132
|
|
|
108
133
|
const checkmarkConfig = {
|
|
@@ -115,7 +140,7 @@ function Checkmark(props) {
|
|
|
115
140
|
const { appearance, className, dataTestId, dataTour, isActive, isChecked, isDisabled = false, onClick, } = props;
|
|
116
141
|
const appearanceConfig = useAppearanceConfig(appearance, checkmarkConfig);
|
|
117
142
|
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
118
|
-
const { fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, borderColorActiveClass, borderColorActiveHoverClass, borderColorClass, borderColorHoverClass, borderWidthClass,
|
|
143
|
+
const { fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, borderColorActiveClass, borderColorActiveHoverClass, borderColorClass, borderColorHoverClass, borderWidthClass, checkmarkFill, checkmarkIcon, checkmarkIconFill, checkmarkIconShape, checkmarkIconSize, checkmarkIconSrc, sizeClass, } = propsGenerator;
|
|
119
144
|
const { styles: checkmarkStyles } = useStyles(props);
|
|
120
145
|
return (jsx("div", { className: clsx(className, 'checkmark', sizeClass && `checkmark_size_${sizeClass}`, !isChecked || !isActive
|
|
121
146
|
? fillClass && `fill_${fillClass}`
|
|
@@ -128,7 +153,7 @@ function Checkmark(props) {
|
|
|
128
153
|
? borderColorHoverClass &&
|
|
129
154
|
`border-color_hover_${borderColorHoverClass}`
|
|
130
155
|
: borderColorActiveHoverClass &&
|
|
131
|
-
`border-color_active_hover_${borderColorActiveHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, isDisabled), "data-testid": dataTestId, "data-tour": dataTour, style: checkmarkStyles, onClick: onClick, children: (isChecked || isActive) && (jsx(
|
|
156
|
+
`border-color_active_hover_${borderColorActiveHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, isDisabled), "data-testid": dataTestId, "data-tour": dataTour, style: checkmarkStyles, onClick: onClick, children: (isChecked || isActive) && (jsx(Icon, { fill: checkmarkFill, iconFill: checkmarkIconFill, iconSize: checkmarkIconSize, imageSrc: checkmarkIconSrc, shape: checkmarkIconShape, SvgImage: checkmarkIcon })) }));
|
|
132
157
|
}
|
|
133
158
|
|
|
134
159
|
export { Checkmark, checkmarkAppearance, checkmarkConfig };
|
package/dist/components/Chips.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as Chips, a as ChipsGroup, c as chipsAppearance, b as chipsConfig } from '../
|
|
1
|
+
export { C as Chips, a as ChipsGroup, c as chipsAppearance, b as chipsConfig } from '../ChipsGroup_es_CxqwFgoo.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'clsx';
|
|
4
4
|
import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
@@ -3,28 +3,27 @@ import { useCallback } from 'react';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { DateTime } from 'luxon';
|
|
5
5
|
import { DATE_PERIOD_INTERVALS } from '@itcase/common';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
|
-
import { a as ChipsGroup, C as Chips } from '../ChipsGroup_es_C_dgXLfC.js';
|
|
10
|
-
import { D as DatePickerInput } from '../DatePicker_es_ungoFvip.js';
|
|
6
|
+
import { a as ChipsGroup, C as Chips } from '../ChipsGroup_es_CxqwFgoo.js';
|
|
7
|
+
import { D as DatePickerInput } from '../DatePicker_es_BP0iWHMt.js';
|
|
11
8
|
import 'react-select';
|
|
12
9
|
import '../Icon_es_BYViOa6l.js';
|
|
13
|
-
import { S as SelectContainer } from '../
|
|
10
|
+
import { S as SelectContainer } from '../SelectContainer_es_kRH4DsEh.js';
|
|
11
|
+
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
12
|
+
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
14
13
|
import 'lodash/camelCase';
|
|
15
14
|
import 'lodash/maxBy';
|
|
16
15
|
import 'lodash/upperFirst';
|
|
17
16
|
import '../context/Notifications.js';
|
|
18
17
|
import '../context/UIContext.js';
|
|
19
18
|
import '../Group_es_Y1qBBLZU.js';
|
|
20
|
-
import '
|
|
19
|
+
import { mergeAppearanceKeys } from '../utils/mergeAppearanceKeys.js';
|
|
20
|
+
import '../hooks/useStyles/useStyles.js';
|
|
21
21
|
import '../hooks.js';
|
|
22
22
|
import '../hooks/useStyles/styleAttributes.js';
|
|
23
23
|
import 'uuid';
|
|
24
24
|
import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
25
25
|
import 'react-responsive';
|
|
26
26
|
import '../utils/setViewportProperty.js';
|
|
27
|
-
import '../hooks/useStyles/useStyles.js';
|
|
28
27
|
import '../Text_es_DVNvU0m0.js';
|
|
29
28
|
import 'date-fns/locale';
|
|
30
29
|
import 'react-datepicker';
|
|
@@ -40,6 +39,7 @@ import '../hoc/urlWithAssetPrefix.js';
|
|
|
40
39
|
import '../context/UrlAssetPrefix.js';
|
|
41
40
|
import 'react-select/creatable';
|
|
42
41
|
import '../Divider_es_D2snK_vn.js';
|
|
42
|
+
import 'lodash/castArray';
|
|
43
43
|
|
|
44
44
|
const datePeriodAppearanceShape = {
|
|
45
45
|
circular: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export { D as DatePickerInput, d as datePickerAppearance, a as datePickerConfig } from '../
|
|
1
|
+
export { D as DatePickerInput, d as datePickerAppearance, a as datePickerConfig } from '../DatePicker_es_BP0iWHMt.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
|
5
5
|
import 'date-fns/locale';
|
|
6
6
|
import 'react-datepicker';
|
|
7
|
+
import '../Button_es_Dk6_9N-r.js';
|
|
8
|
+
import '../utils/mergeAppearanceKeys.js';
|
|
7
9
|
import '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
8
10
|
import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
11
|
import 'lodash/camelCase';
|
|
@@ -18,11 +20,9 @@ import 'react-responsive';
|
|
|
18
20
|
import '../utils/setViewportProperty.js';
|
|
19
21
|
import '../hooks.js';
|
|
20
22
|
import '../hooks/useStyles/styleAttributes.js';
|
|
23
|
+
import '../hooks/useHoldProgress.js';
|
|
21
24
|
import '../hooks/useStyles/useStyles.js';
|
|
22
25
|
import 'lodash/maxBy';
|
|
23
|
-
import '../Button_es_Dk6_9N-r.js';
|
|
24
|
-
import '../utils/mergeAppearanceKeys.js';
|
|
25
|
-
import '../hooks/useHoldProgress.js';
|
|
26
26
|
import '../Icon_es_BYViOa6l.js';
|
|
27
27
|
import 'react-inlinesvg';
|
|
28
28
|
import '../hoc/urlWithAssetPrefix.js';
|
|
@@ -2,14 +2,15 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useRef, useState, useEffect } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import ReactDrawer from 'react-modern-drawer';
|
|
5
|
-
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
6
|
-
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
7
5
|
import { D as Divider } from '../Divider_es_D2snK_vn.js';
|
|
8
6
|
import { I as Icon, b as Title } from '../Icon_es_BYViOa6l.js';
|
|
9
7
|
import { T as Text } from '../Text_es_DVNvU0m0.js';
|
|
8
|
+
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
9
|
+
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
10
10
|
import { icons24 } from '@itcase/icons/default';
|
|
11
|
+
import '../hooks/useStyles/useStyles.js';
|
|
11
12
|
import 'lodash/camelCase';
|
|
12
|
-
import 'lodash/
|
|
13
|
+
import 'lodash/maxBy';
|
|
13
14
|
import 'lodash/upperFirst';
|
|
14
15
|
import '../context/Notifications.js';
|
|
15
16
|
import 'uuid';
|
|
@@ -20,12 +21,11 @@ import 'react-responsive';
|
|
|
20
21
|
import '../utils/setViewportProperty.js';
|
|
21
22
|
import '../hooks.js';
|
|
22
23
|
import '../hooks/useStyles/styleAttributes.js';
|
|
23
|
-
import '../hooks/useStyles/useStyles.js';
|
|
24
|
-
import 'lodash/maxBy';
|
|
25
24
|
import 'react-inlinesvg';
|
|
26
25
|
import '../hoc/urlWithAssetPrefix.js';
|
|
27
26
|
import '../context/UrlAssetPrefix.js';
|
|
28
27
|
import '../Link_es_BDAmhIzd.js';
|
|
28
|
+
import 'lodash/castArray';
|
|
29
29
|
|
|
30
30
|
const drawerAppearanceSize = {
|
|
31
31
|
sizeH3: {
|
|
@@ -72,51 +72,50 @@ const drawerConfig = {
|
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
74
|
function Drawer(props) {
|
|
75
|
-
const { appearance, className, dataTestId, dataTour, type, title, desc, enableOverlay, lockBackgroundScroll = true, stickyButton, before, after, close, isOpen, isOpenModal, onClickClose, onClose, children, } = props;
|
|
76
|
-
const
|
|
77
|
-
const _isOpen = isOpen ?? isOpenModal;
|
|
78
|
-
const isOpenPrevRef = useRef(Boolean(_isOpen));
|
|
75
|
+
const { appearance, className, dataTestId, dataTour, type, title, desc, enableOverlay, lockBackgroundScroll = true, stickyButton, before, after, close, isOpen = false, isOpenModal, onClickClose, onClose, children, } = props;
|
|
76
|
+
const isOpenPrevRef = useRef(isOpen);
|
|
79
77
|
const isFirstRenderRef = useRef(true);
|
|
80
78
|
const appearanceConfig = useAppearanceConfig(appearance, drawerConfig);
|
|
81
79
|
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
82
80
|
const { direction, size, titleTextColor, titleTextSize, titleTextWeight, descTextColor, descTextSize, divider, dividerSize, zeroPadding, closeIcon, closeIconFill, closeIconFillIcon, closeIconFillSize, closeIconShape, closeIconSize, closeIconSrc, } = propsGenerator;
|
|
83
|
-
const [animationState, setAnimationState] = useState(
|
|
81
|
+
const [animationState, setAnimationState] = useState(isOpen
|
|
84
82
|
? ANIMATION_STATE_SNAPSHOTS.ENTER_FINISH
|
|
85
83
|
: ANIMATION_STATE_SNAPSHOTS.EXIT_FINISH);
|
|
86
84
|
useEffect(() => {
|
|
87
|
-
|
|
88
|
-
if (isFromOpenToClose && onClose) {
|
|
89
|
-
onClose();
|
|
90
|
-
}
|
|
91
|
-
isOpenPrevRef.current = Boolean(_isOpen);
|
|
85
|
+
/* TODO: Remove error after some time */
|
|
92
86
|
const isNeedShowWarning = process.env.NODE_ENV === 'development' &&
|
|
93
87
|
typeof isOpenModal !== 'undefined';
|
|
94
88
|
if (isNeedShowWarning) {
|
|
95
|
-
|
|
89
|
+
throw new Error('@itcase/ui Drawer warning: "isOpenModal" is deprecated, use "isOpen" instead.');
|
|
96
90
|
}
|
|
97
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
98
|
-
}, [_isOpen, onClose]);
|
|
99
|
-
useEffect(() => {
|
|
100
91
|
if (isFirstRenderRef.current) {
|
|
101
92
|
isFirstRenderRef.current = false;
|
|
102
93
|
return;
|
|
103
94
|
}
|
|
95
|
+
const isPrevStateOpen = Boolean(isOpenPrevRef.current) === true;
|
|
96
|
+
const isNewStateClose = Boolean(isOpen) === false;
|
|
97
|
+
if (isPrevStateOpen && isNewStateClose && onClose) {
|
|
98
|
+
onClose();
|
|
99
|
+
}
|
|
100
|
+
isOpenPrevRef.current = isOpen;
|
|
104
101
|
setAnimationState(ANIMATION_STATE_SNAPSHOTS.DEFAULT);
|
|
105
102
|
const startTransitionDelay = 16;
|
|
106
|
-
const timeoutDelay =
|
|
103
|
+
const timeoutDelay = isOpen ? startTransitionDelay : ANIMATION_DURATION;
|
|
107
104
|
const timeout = setTimeout(() => {
|
|
108
|
-
|
|
105
|
+
const newAnimationState = isOpen
|
|
109
106
|
? ANIMATION_STATE_SNAPSHOTS.ENTER_FINISH
|
|
110
|
-
: ANIMATION_STATE_SNAPSHOTS.EXIT_FINISH
|
|
107
|
+
: ANIMATION_STATE_SNAPSHOTS.EXIT_FINISH;
|
|
108
|
+
setAnimationState(newAnimationState);
|
|
111
109
|
}, timeoutDelay);
|
|
112
110
|
return () => {
|
|
113
111
|
clearTimeout(timeout);
|
|
114
112
|
};
|
|
115
|
-
|
|
113
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
114
|
+
}, [isOpen]);
|
|
116
115
|
if (!animationState.isInDOM) {
|
|
117
116
|
return null;
|
|
118
117
|
}
|
|
119
|
-
return (jsxs(ReactDrawer, { className: clsx('drawer', type && `drawer_type_${type}`, className, dataTour && `dataTour-${dataTour}`, stickyButton && 'drawer_sticky-button', zeroPadding && 'drawer_reset-padding'), direction: direction || 'right', size: size || 600, customIdSuffix: dataTestId ? `_${dataTestId}` : undefined, "data-testid": dataTestId, "data-tour": dataTour, duration: ANIMATION_DURATION, enableOverlay: enableOverlay, lockBackgroundScroll: lockBackgroundScroll, overlayClassName: "drawer__overlay", open: animationState.isOpen, onClose:
|
|
118
|
+
return (jsxs(ReactDrawer, { className: clsx('drawer', type && `drawer_type_${type}`, className, dataTour && `dataTour-${dataTour}`, stickyButton && 'drawer_sticky-button', zeroPadding && 'drawer_reset-padding'), direction: direction || 'right', size: size || 600, customIdSuffix: dataTestId ? `_${dataTestId}` : undefined, "data-testid": dataTestId, "data-tour": dataTour, duration: ANIMATION_DURATION, enableOverlay: enableOverlay, lockBackgroundScroll: lockBackgroundScroll, overlayClassName: "drawer__overlay", open: animationState.isOpen, onClose: onClickClose, children: [before && jsx("div", { className: "drawer__before", children: before }), !close && (closeIcon || closeIconSrc) && (jsx("div", { className: "drawer__close", children: jsx(Icon, { className: "cursor_type_pointer", fill: closeIconFill, fillSize: closeIconFillSize, iconFill: closeIconFillIcon, iconSize: closeIconSize, imageSrc: closeIconSrc, shape: closeIconShape, SvgImage: closeIcon, onClick: onClickClose }) })), (title || desc) && (jsxs("div", { className: "drawer__header", children: [jsx(Title, { className: "drawer__header-title", size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title }), jsx(Text, { className: "drawer__header-desc", size: descTextSize, textColor: descTextColor, children: desc })] })), divider && (jsx(Divider, { width: "fill", size: dividerSize, fill: "surfaceTertiary" })), children && jsx("div", { className: "drawer__wrapper", children: children }), after && jsx("div", { className: "drawer__after", children: after })] }));
|
|
120
119
|
}
|
|
121
120
|
|
|
122
121
|
export { Drawer, drawerAppearance, drawerConfig };
|
package/dist/components/Image.js
CHANGED
|
@@ -231,7 +231,7 @@ function InputPassword(props) {
|
|
|
231
231
|
return isRevealed ? 'text' : 'password';
|
|
232
232
|
}, [isRevealed]);
|
|
233
233
|
const onClickIconReveal = useCallback((event) => {
|
|
234
|
-
event
|
|
234
|
+
event?.preventDefault();
|
|
235
235
|
setIsRevealed((prev) => !prev);
|
|
236
236
|
}, []);
|
|
237
237
|
const appearanceConfig = useAppearanceConfig(appearance, inputPasswordConfig, isDisabled);
|
|
@@ -18,12 +18,12 @@ const SelectDefaultMock = {
|
|
|
18
18
|
}]
|
|
19
19
|
}, {
|
|
20
20
|
label: 'Томат',
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
value: '2',
|
|
22
|
+
isDisabled: true
|
|
23
23
|
}, {
|
|
24
24
|
label: 'Томат красный',
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
value: '3',
|
|
26
|
+
isDisabled: true
|
|
27
27
|
}, {
|
|
28
28
|
label: 'Томат среднеплодный (круглый)',
|
|
29
29
|
value: '4',
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { S as Select, a as SelectClearIndicator, b as SelectControl, c as SelectDropdownIndicator, d as SelectGroupHeading, e as SelectIndicatorsContainer, f as SelectInput, g as SelectMenu, h as SelectMultiValueContainer, i as SelectMultiValueLabel, j as SelectMultiValueRemove, k as SelectOption, l as SelectPlaceholder, m as SelectSingleValue, n as SelectValueContainer, s as selectConfig } from '../
|
|
1
|
+
export { S as Select, a as SelectClearIndicator, b as SelectControl, c as SelectDropdownIndicator, d as SelectGroupHeading, e as SelectIndicatorsContainer, f as SelectInput, g as SelectMenu, h as SelectMultiValueContainer, i as SelectMultiValueLabel, j as SelectMultiValueRemove, k as SelectOption, l as SelectPlaceholder, m as SelectSingleValue, n as SelectValueContainer, s as selectConfig } from '../SelectContainer_es_kRH4DsEh.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
|
5
5
|
import 'react-select';
|
|
6
6
|
import 'react-select/creatable';
|
|
7
|
+
import '../Group_es_Y1qBBLZU.js';
|
|
7
8
|
import '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
8
9
|
import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
10
|
import 'lodash/camelCase';
|
|
@@ -18,7 +19,6 @@ import 'react-responsive';
|
|
|
18
19
|
import '../utils/setViewportProperty.js';
|
|
19
20
|
import '../hooks.js';
|
|
20
21
|
import '../hooks/useStyles/styleAttributes.js';
|
|
21
|
-
import '../Group_es_Y1qBBLZU.js';
|
|
22
22
|
import '../hooks/useStyles/useStyles.js';
|
|
23
23
|
import 'lodash/maxBy';
|
|
24
24
|
import '../Text_es_DVNvU0m0.js';
|
package/dist/components/Tile.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import { mergeAppearanceKeys } from '../utils/mergeAppearanceKeys.js';
|
|
3
4
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
4
5
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
6
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
@@ -168,7 +169,7 @@ function Tile(props) {
|
|
|
168
169
|
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
169
170
|
const { directionClass, alignClass, alignDirectionClass, fillClass, titleTextAlign, titleTextColor, titleTextSize, titleTextWeight, titleTextWrap, descTextColor, descTextSize, descTextWrap, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, badgeAppearance, badgeAppearanceSize, badgeShape, badgeSize, badgeTextColor, badgeTextSize, icon, iconAppearance, iconFill, iconFillIcon, iconFillSize, iconShape, iconSize, iconSrc, shapeClass, shapeStrengthClass, sizeClass, widthClass, } = propsGenerator;
|
|
170
171
|
const { styles: tileStyles } = useStyles(props);
|
|
171
|
-
return (jsx("div", { className: clsx('tile', className, fillClass && `fill_${fillClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, alignClass && `align_${alignClass}`, directionClass && `direction_${directionClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, sizeClass && `tile_size_${sizeClass}`, type && `tile_type_${type}`, badgeValue && `tile_state_badge`, widthClass && `width_${widthClass}`, isSkeleton && `tile_skeleton`), "data-testid": dataTestId, "data-tour": dataTour, style: tileStyles, onClick: onClick, children: jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, jsxs("div", { className: "tile__header", children: [jsxs("div", { className: "tile__header-inner", children: [title && (jsx(Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), desc && (jsx(Text, { className: "tile__text", size: descTextSize, textColor: descTextColor, textWrap: descTextWrap, children: desc }))] }), jsxs("div", { className: "tile__header-actions", children: [badgeValue && (jsx(Badge, { appearance:
|
|
172
|
+
return (jsx("div", { className: clsx('tile', className, fillClass && `fill_${fillClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, alignClass && `align_${alignClass}`, directionClass && `direction_${directionClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, sizeClass && `tile_size_${sizeClass}`, type && `tile_type_${type}`, badgeValue && `tile_state_badge`, widthClass && `width_${widthClass}`, isSkeleton && `tile_skeleton`), "data-testid": dataTestId, "data-tour": dataTour, style: tileStyles, onClick: onClick, children: jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, jsxs("div", { className: "tile__header", children: [jsxs("div", { className: "tile__header-inner", children: [title && (jsx(Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), desc && (jsx(Text, { className: "tile__text", size: descTextSize, textColor: descTextColor, textWrap: descTextWrap, children: desc }))] }), jsxs("div", { className: "tile__header-actions", children: [badgeValue && (jsx(Badge, { appearance: mergeAppearanceKeys(badgeAppearance, badgeAppearanceSize), className: "tile__badge", size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), (icon || iconSrc) && (jsx(Icon, { appearance: iconAppearance, className: "tile__icon", fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon, onClick: iconClick }))] })] }), children, after] }) }));
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
export { Tile, tileAppearance, tileConfig };
|
|
@@ -142,7 +142,7 @@ function createNotification(notification, onClose) {
|
|
|
142
142
|
let after = null;
|
|
143
143
|
let isLoading = false;
|
|
144
144
|
let closeIconAppearance = '';
|
|
145
|
-
let onClickButton =
|
|
145
|
+
let onClickButton = () => { };
|
|
146
146
|
if (typeof notification === 'string') {
|
|
147
147
|
text = notification;
|
|
148
148
|
}
|
|
@@ -11,6 +11,8 @@ const UserDeviceContext = createContext({
|
|
|
11
11
|
isTablet: false,
|
|
12
12
|
isDesktop: false,
|
|
13
13
|
deviceCurrentMainType: '',
|
|
14
|
+
deviceCurrentType: '',
|
|
15
|
+
deviceTypesList: [],
|
|
14
16
|
});
|
|
15
17
|
const UIProvider = memo(function UIProvider(props) {
|
|
16
18
|
const { userDeviceState = {}, children } = props;
|
|
@@ -61,7 +63,11 @@ const UIProvider = memo(function UIProvider(props) {
|
|
|
61
63
|
return (jsx(UserDeviceContext.Provider, { value: deviceContextState, children: children }));
|
|
62
64
|
});
|
|
63
65
|
function useUserDeviceContext() {
|
|
64
|
-
|
|
66
|
+
const context = useContext(UserDeviceContext);
|
|
67
|
+
if (!context) {
|
|
68
|
+
throw new Error('useUserDeviceContext is not defined');
|
|
69
|
+
}
|
|
70
|
+
return context;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
export { UIProvider, useUserDeviceContext };
|