@itcase/ui 1.8.38 → 1.8.40
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_nMPCDjk8.js → Avatar_cjs_BbeDJ-No.js} +2 -2
- package/dist/{Avatar_es_B73a6TzA.js → Avatar_es_B1Ao9Im_.js} +2 -2
- package/dist/{Button_cjs_plv5-qcj.js → Button_cjs_Ctkyt2ES.js} +1 -1
- package/dist/{Button_es_BigB2Wz6.js → Button_es_BiIuX0ER.js} +1 -1
- package/dist/{ChipsGroup_cjs_DrOhD-Fc.js → ChipsGroup_cjs_p99H-9a8.js} +48 -64
- package/dist/{ChipsGroup_es_B9m4l0wN.js → ChipsGroup_es_CWq3TR_1.js} +48 -64
- package/dist/{DatePicker_cjs_DKoF73mp.js → DatePicker_cjs_D_1v2mS0.js} +3 -3
- package/dist/{DatePicker_es_CdEYxtwj.js → DatePicker_es_CQwbdG0g.js} +3 -3
- package/dist/{DropdownItem_cjs_DQvByLbN.js → DropdownItem_cjs_B1gGciTB.js} +26 -9
- package/dist/{DropdownItem_es_KppIfto7.js → DropdownItem_es_JVT4f6Nb.js} +26 -9
- package/dist/{Image_cjs_CCWqbNn4.js → Image_cjs_2zEjohYE.js} +5 -4
- package/dist/{Image_es_DZUVp0FS.js → Image_es_ChF-63wh.js} +5 -4
- package/dist/{Label_cjs_BGJfyrOL.js → Label_cjs_Mb8j2bLu.js} +1 -5
- package/dist/{Label_es_C4Px7b-N.js → Label_es_CIDBUVgO.js} +1 -5
- package/dist/{Tooltip_cjs_DHduWa-v.js → Tooltip_cjs_BBwH8sjA.js} +16 -6
- package/dist/{Tooltip_es_ltCY-w4M.js → Tooltip_es_Y2aoFQW7.js} +16 -6
- package/dist/cjs/components/Accordion.js +3 -1
- package/dist/cjs/components/Avatar.js +5 -3
- package/dist/cjs/components/AvatarStack.js +5 -3
- package/dist/cjs/components/Badge.js +3 -1
- package/dist/cjs/components/Breadcrumbs.js +3 -1
- package/dist/cjs/components/Button.js +4 -2
- package/dist/cjs/components/Cell.js +4 -2
- package/dist/cjs/components/Chips.js +5 -2
- package/dist/cjs/components/Choice.js +3 -1
- package/dist/cjs/components/CookiesWarning.js +4 -2
- package/dist/cjs/components/DatePeriod.js +8 -5
- package/dist/cjs/components/DatePicker.js +6 -4
- package/dist/cjs/components/Drawer.js +3 -1
- package/dist/cjs/components/Dropdown/stories/__mock__.js +27 -4
- package/dist/cjs/components/Dropdown.js +5 -3
- package/dist/cjs/components/HeroTitle.js +3 -1
- package/dist/cjs/components/Icon.js +3 -1
- package/dist/cjs/components/Image.js +5 -3
- package/dist/cjs/components/InputPassword.js +3 -1
- package/dist/cjs/components/Label.js +4 -2
- package/dist/cjs/components/Logo.js +7 -5
- package/dist/cjs/components/MenuItem.js +3 -1
- package/dist/cjs/components/Modal.js +3 -1
- package/dist/cjs/components/Notification.js +3 -1
- package/dist/cjs/components/Pagination.js +68 -21
- package/dist/cjs/components/Radio.js +45 -65
- package/dist/cjs/components/Response.js +8 -5
- package/dist/cjs/components/SVGContent.js +5 -3
- package/dist/cjs/components/Search.js +3 -1
- package/dist/cjs/components/Segmented.js +3 -1
- package/dist/cjs/components/Select.js +5 -3
- package/dist/cjs/components/Swiper.js +3 -1
- package/dist/cjs/components/Tab.js +3 -1
- package/dist/cjs/components/Textarea.js +1 -1
- package/dist/cjs/components/Tile.js +3 -1
- package/dist/cjs/components/Title.js +3 -1
- package/dist/cjs/components/Tooltip.js +3 -1
- package/dist/cjs/context/UrlAssetPrefix.js +17 -0
- package/dist/cjs/hoc/urlWithAssetPrefix.js +64 -0
- package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +29 -0
- package/dist/cjs/hooks/useAppearanceConfig.js +9 -0
- package/dist/components/Accordion.js +3 -1
- package/dist/components/Avatar.js +5 -3
- package/dist/components/AvatarStack.js +5 -3
- package/dist/components/Badge.js +3 -1
- package/dist/components/Breadcrumbs.js +3 -1
- package/dist/components/Button.js +4 -2
- package/dist/components/Cell.js +4 -2
- package/dist/components/Chips.js +5 -2
- package/dist/components/Choice.js +3 -1
- package/dist/components/CookiesWarning.js +4 -2
- package/dist/components/DatePeriod.js +8 -5
- package/dist/components/DatePicker.js +6 -4
- package/dist/components/Drawer.js +3 -1
- package/dist/components/Dropdown/stories/__mock__.js +26 -5
- package/dist/components/Dropdown.js +5 -3
- package/dist/components/HeroTitle.js +3 -1
- package/dist/components/Icon.js +3 -1
- package/dist/components/Image.js +5 -3
- package/dist/components/InputPassword.js +3 -1
- package/dist/components/Label.js +4 -2
- package/dist/components/Logo.js +7 -5
- package/dist/components/MenuItem.js +3 -1
- package/dist/components/Modal.js +3 -1
- package/dist/components/Notification.js +3 -1
- package/dist/components/Pagination.js +69 -22
- package/dist/components/Radio.js +45 -65
- package/dist/components/Response.js +8 -5
- package/dist/components/SVGContent.js +5 -3
- package/dist/components/Search.js +3 -1
- package/dist/components/Segmented.js +3 -1
- package/dist/components/Select.js +5 -3
- package/dist/components/Swiper.js +3 -1
- package/dist/components/Tab.js +3 -1
- package/dist/components/Textarea.js +1 -1
- package/dist/components/Tile.js +3 -1
- package/dist/components/Title.js +3 -1
- package/dist/components/Tooltip.js +3 -1
- package/dist/context/UrlAssetPrefix.js +14 -0
- package/dist/css/components/Dropdown/Dropdown.css +24 -0
- package/dist/css/components/Pagination/Pagination.css +82 -30
- package/dist/css/components/Pagination/css/__item/pagination__item.css +8 -8
- package/dist/css/components/Pagination/css/__item/pagination__item_size.css +8 -0
- package/dist/css/components/Pagination/css/__item/pagination__item_state_active.css +16 -16
- package/dist/css/components/Radio/Radio.css +44 -5
- package/dist/css/components/Select/Select.css +1 -0
- package/dist/css/components/Select/css/__indicators/select__indicators.css +1 -0
- package/dist/css/components/Swiper/Swiper.css +2 -2
- package/dist/css/styles/fill/fill.css +2 -1
- package/dist/css/styles/fill/fill_active.css +3 -0
- package/dist/css/styles/fill/fill_active_hover.css +7 -0
- package/dist/css/styles/fill/fill_hover.css +5 -9
- package/dist/hoc/urlWithAssetPrefix.js +62 -0
- package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +27 -0
- package/dist/hooks/useAppearanceConfig.js +3 -0
- package/dist/stories/ChipsOverview.mdx +10 -10
- package/dist/stories/ChipsPlayground.mdx +2 -2
- package/dist/stories/Components.mdx +378 -87
- package/dist/stories/useAppearanceConfig.mdx +83 -0
- package/dist/stories/useDevicePropsGenerator.mdx +6 -8
- package/dist/types/components/Chips/appearance/chipsDisabled.d.ts +2 -3
- package/dist/types/components/Dropdown/appearance/dropdownAccent.d.ts +5 -0
- package/dist/types/components/Dropdown/appearance/dropdownSize.d.ts +9 -0
- package/dist/types/components/Dropdown/appearance/dropdownSurface.d.ts +3 -0
- package/dist/types/components/Dropdown/stories/__mock__/index.d.ts +9 -12
- package/dist/types/components/Icon/Icon.d.ts +6 -2
- package/dist/types/components/Icon/appearance/iconDanger.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconDisabled.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconError.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconInfo.d.ts +0 -1
- package/dist/types/components/Icon/appearance/iconPrimary.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconSecondary.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconSuccess.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconSurface.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconWarning.d.ts +1 -0
- package/dist/types/components/Image/Image.d.ts +5 -2
- package/dist/types/components/Label/appearance/labelError.d.ts +0 -1
- package/dist/types/components/Label/appearance/labelGradient.d.ts +8 -0
- package/dist/types/components/Label/appearance/labelPrimary.d.ts +0 -1
- package/dist/types/components/Label/appearance/labelSuccess.d.ts +0 -1
- package/dist/types/components/Label/appearance/labelSurface.d.ts +0 -1
- package/dist/types/components/Logo/Logo.d.ts +6 -2
- package/dist/types/components/Pagination/appearance/paginationAccent.d.ts +22 -1
- package/dist/types/components/Pagination/appearance/paginationSize.d.ts +20 -1
- package/dist/types/components/Pagination/appearance/paginationSurface.d.ts +4 -1
- package/dist/types/components/Radio/Radio.appearance.d.ts +28 -48
- package/dist/types/components/Radio/appearance/radioDefault.d.ts +2 -14
- package/dist/types/components/Radio/appearance/radioDisabled.d.ts +5 -5
- package/dist/types/components/Radio/appearance/radioError.d.ts +6 -5
- package/dist/types/components/Radio/appearance/radioRequire.d.ts +5 -13
- package/dist/types/components/Radio/appearance/radioStyle.d.ts +4 -6
- package/dist/types/components/Radio/appearance/radioSuccess.d.ts +6 -5
- package/dist/types/components/Response/Response.d.ts +6 -2
- package/dist/types/components/Response/Response.interface.d.ts +3 -1
- package/dist/types/components/SVGContent/SVGContent.d.ts +5 -2
- package/dist/types/components/Select/SelectLoadingIndicator.d.ts +2 -1
- package/dist/types/config/forms/datepicker.d.ts +18 -0
- package/dist/types/config/forms/index.d.ts +3 -0
- package/dist/types/config/forms/input.d.ts +14 -0
- package/dist/types/context/UrlAssetPrefix.d.ts +12 -0
- package/dist/types/hoc/urlWithAssetPrefix.d.ts +8 -0
- package/dist/types/hooks/useAppearanceConfig/index.d.ts +1 -0
- package/dist/types/hooks/useAppearanceConfig/useAppearanceConfig.d.ts +7 -0
- package/dist/types/hooks/useDevicePropsGenerator/index.d.ts +1 -0
- package/package.json +22 -17
- package/dist/types/hooks/useDeviceTargetClass.d.ts +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Swiper 11.2.
|
|
2
|
+
* Swiper 11.2.10
|
|
3
3
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
4
4
|
* https://swiperjs.com
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Released under the MIT License
|
|
9
9
|
*
|
|
10
|
-
* Released on:
|
|
10
|
+
* Released on: June 28, 2025
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/* FONT_START */
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
background-color: transparent;
|
|
4
4
|
}
|
|
5
5
|
@each $type in accent, primary, secondary, tertiary, quaternary, surface,
|
|
6
|
-
error, success, warning, info, danger, gradient, disabled, hover,
|
|
6
|
+
error, success, warning, info, danger, gradient, disabled, active, hover,
|
|
7
|
+
inverse {
|
|
7
8
|
@each $color in primary, secondary, tertiary, quaternary, accent, disabled,
|
|
8
9
|
hover, inverse {
|
|
9
10
|
/* @each $alpha in 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 { */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* fill_hover_accent-hover-secondary */
|
|
2
|
+
/* --color-accent-fill-hover-primary */
|
|
1
3
|
.fill {
|
|
2
4
|
&_hover {
|
|
3
5
|
@each $type in accent, primary, secondary, tertiary, quaternary, surface,
|
|
@@ -42,19 +44,13 @@
|
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
&-primary {
|
|
48
|
-
&:hover {
|
|
49
|
-
background: var(--color-$(type)-fill-primary);
|
|
50
|
-
}
|
|
51
|
-
&-hover {
|
|
47
|
+
&-hover {
|
|
48
|
+
&-$(color) {
|
|
52
49
|
&:hover {
|
|
53
|
-
background: var(--color-$(type)-fill-
|
|
50
|
+
background: var(--color-$(type)-fill-hover-$(color));
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
|
-
*/
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
/* } */
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React, { useContext } from 'react';
|
|
4
|
+
import { formatURL } from '@itcase/common';
|
|
5
|
+
import { UrlAssetPrefixContext } from '../context/UrlAssetPrefix.js';
|
|
6
|
+
|
|
7
|
+
var urlPropsList = ['src', 'imageSrc', 'svgSrc', 'placeholderUrl'];
|
|
8
|
+
var urlWithAssetPrefix = function (WrappedComponent) {
|
|
9
|
+
var HOC = React.forwardRef(function HOC(props, ref) {
|
|
10
|
+
var _a = useContext(UrlAssetPrefixContext), assetPrefix = _a.assetPrefix, ignorePathsList = _a.ignorePathsList;
|
|
11
|
+
var overrideProps = urlPropsList.reduce(function (resultProps, propKey) {
|
|
12
|
+
var url = props[propKey];
|
|
13
|
+
if (url && typeof url === 'string') {
|
|
14
|
+
if (assetPrefix) {
|
|
15
|
+
var cleanUrl = formatURL(url);
|
|
16
|
+
var isNeedAssetPrefix = checkIsNeedAssetPrefix(cleanUrl, assetPrefix, ignorePathsList);
|
|
17
|
+
if (isNeedAssetPrefix) {
|
|
18
|
+
var prefixPath = formatURL(assetPrefix).slice(0, -1);
|
|
19
|
+
url = "".concat(prefixPath).concat(cleanUrl);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
resultProps[propKey] = url;
|
|
23
|
+
}
|
|
24
|
+
return resultProps;
|
|
25
|
+
}, {});
|
|
26
|
+
return jsx(WrappedComponent, __assign({}, props, overrideProps, { ref: ref }));
|
|
27
|
+
});
|
|
28
|
+
return HOC;
|
|
29
|
+
};
|
|
30
|
+
var checkIsNeedAssetPrefix = function (url, assetPrefix, ignorePathsList) {
|
|
31
|
+
if (ignorePathsList === void 0) { ignorePathsList = []; }
|
|
32
|
+
// Ignore prefix if:
|
|
33
|
+
var isPrefixIgnore =
|
|
34
|
+
// Url is absolute
|
|
35
|
+
url.startsWith('http:') ||
|
|
36
|
+
url.startsWith('https:') ||
|
|
37
|
+
// Url is data string
|
|
38
|
+
url.startsWith('data:') ||
|
|
39
|
+
// Url already have prefix
|
|
40
|
+
url.startsWith(assetPrefix);
|
|
41
|
+
if (isPrefixIgnore) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
// And check special paths for ignore prefix
|
|
45
|
+
for (var _i = 0, ignorePathsList_1 = ignorePathsList; _i < ignorePathsList_1.length; _i++) {
|
|
46
|
+
var urlPath = ignorePathsList_1[_i];
|
|
47
|
+
if (urlPath instanceof RegExp) {
|
|
48
|
+
if (urlPath.test(url)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (url.startsWith(formatURL(urlPath))) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Need to add prefix to url
|
|
59
|
+
return true;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export { urlWithAssetPrefix };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { _ as __assign } from '../../tslib.es6_es_Bwu1Cn-t.js';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
var useAppearanceConfig = function (appearance, componentConfig, isDisabled) {
|
|
5
|
+
var appearanceConfig = useMemo(function () {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
if (appearance) {
|
|
8
|
+
var appearanceProps = appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
9
|
+
var _a;
|
|
10
|
+
return (__assign(__assign({}, resultConfig), (_a = componentConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
11
|
+
}, {});
|
|
12
|
+
if (isDisabled && ((_a = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.appearance) === null || _a === void 0 ? void 0 : _a.disabled)) {
|
|
13
|
+
Object.assign(appearanceProps, componentConfig.appearance.disabled);
|
|
14
|
+
}
|
|
15
|
+
return appearanceProps;
|
|
16
|
+
}
|
|
17
|
+
if (isDisabled) {
|
|
18
|
+
return (_b = componentConfig.appearance) === null || _b === void 0 ? void 0 : _b.disabled;
|
|
19
|
+
}
|
|
20
|
+
return {};
|
|
21
|
+
}, [appearance, componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.appearance, isDisabled]);
|
|
22
|
+
return {
|
|
23
|
+
appearanceConfig: appearanceConfig,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { useAppearanceConfig };
|
|
@@ -9,41 +9,41 @@ import * as ChipsStories from '../stories/ChipsDefault.stories'
|
|
|
9
9
|
`Chips` — это компактная альтернатива чекбоксам. Они позволяют пользователям выбирать несколько вариантов одновременно и в основном применяются на мобильных устройствах для переключений фильтров.
|
|
10
10
|
Данный компонент может быть использован в компоненте множественного выбора (SelectMulti).
|
|
11
11
|
|
|
12
|
-
<Canvas sourceState="shown"of={ChipsStories.
|
|
12
|
+
<Canvas sourceState="shown"of={ChipsStories.Surface} />
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
## SurfacePrimary
|
|
16
16
|
|
|
17
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
17
|
+
<Canvas sourceState="shown" of={ChipsStories.Surface} />
|
|
18
18
|
|
|
19
19
|
## AccentPrimary
|
|
20
20
|
|
|
21
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
21
|
+
<Canvas sourceState="shown" of={ChipsStories.Accent} />
|
|
22
22
|
|
|
23
23
|
## ErrorPrimary
|
|
24
24
|
|
|
25
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
25
|
+
<Canvas sourceState="shown" of={ChipsStories.Error} />
|
|
26
26
|
|
|
27
27
|
## PrimaryPrimary
|
|
28
28
|
|
|
29
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
29
|
+
<Canvas sourceState="shown" of={ChipsStories.Primary} />
|
|
30
30
|
|
|
31
31
|
## SecondaryPrimary
|
|
32
32
|
|
|
33
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
33
|
+
<Canvas sourceState="shown" of={ChipsStories.Secondary} />
|
|
34
34
|
|
|
35
35
|
## SuccessPrimary
|
|
36
36
|
|
|
37
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
37
|
+
<Canvas sourceState="shown" of={ChipsStories.Success} />
|
|
38
38
|
|
|
39
39
|
## DangerPrimary
|
|
40
40
|
|
|
41
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
41
|
+
<Canvas sourceState="shown" of={ChipsStories.Danger} />
|
|
42
42
|
|
|
43
43
|
## WarningPrimary
|
|
44
44
|
|
|
45
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
45
|
+
<Canvas sourceState="shown" of={ChipsStories.Warning} />
|
|
46
46
|
|
|
47
47
|
## InfoPrimary
|
|
48
48
|
|
|
49
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
49
|
+
<Canvas sourceState="shown" of={ChipsStories.Info} />
|
|
@@ -6,5 +6,5 @@ import * as ChipsStories from '../stories/ChipsDefault.stories'
|
|
|
6
6
|
|
|
7
7
|
# Playground
|
|
8
8
|
|
|
9
|
-
<Canvas sourceState="shown" of={ChipsStories.
|
|
10
|
-
<Controls of={ChipsStories.
|
|
9
|
+
<Canvas sourceState="shown" of={ChipsStories.Surface} />
|
|
10
|
+
<Controls of={ChipsStories.Surface} />
|