@itcase/ui 1.8.38 → 1.8.39
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_mqB6k6yB.js} +2 -2
- package/dist/{Avatar_es_B73a6TzA.js → Avatar_es_DKL6hUIM.js} +2 -2
- package/dist/{Button_cjs_plv5-qcj.js → Button_cjs_CwduBuCx.js} +1 -1
- package/dist/{Button_es_BigB2Wz6.js → Button_es_CBUUZuP3.js} +1 -1
- package/dist/{ChipsGroup_cjs_DrOhD-Fc.js → ChipsGroup_cjs_Dq-QQCR_.js} +1 -1
- package/dist/{ChipsGroup_es_B9m4l0wN.js → ChipsGroup_es_DdU5NMpc.js} +1 -1
- package/dist/{DatePicker_cjs_DKoF73mp.js → DatePicker_cjs_0MnhwJnY.js} +3 -3
- package/dist/{DatePicker_es_CdEYxtwj.js → DatePicker_es_D4P4DT8L.js} +3 -3
- package/dist/{DropdownItem_cjs_DQvByLbN.js → DropdownItem_cjs_BuT4hQS1.js} +1 -1
- package/dist/{DropdownItem_es_KppIfto7.js → DropdownItem_es_CrwvBzq_.js} +1 -1
- 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_CKR9noZi.js} +1 -1
- package/dist/{Label_es_C4Px7b-N.js → Label_es_Cz9OKQAr.js} +1 -1
- package/dist/{Tooltip_cjs_DHduWa-v.js → Tooltip_cjs_CiY50iRK.js} +7 -4
- package/dist/{Tooltip_es_ltCY-w4M.js → Tooltip_es_Cc2orRUE.js} +7 -4
- 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 +4 -2
- package/dist/cjs/components/Choice.js +3 -1
- package/dist/cjs/components/CookiesWarning.js +4 -2
- package/dist/cjs/components/DatePeriod.js +7 -5
- package/dist/cjs/components/DatePicker.js +6 -4
- package/dist/cjs/components/Drawer.js +3 -1
- package/dist/cjs/components/Dropdown.js +4 -2
- 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 +4 -2
- 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 +3 -1
- package/dist/cjs/components/Swiper.js +3 -1
- package/dist/cjs/components/Tab.js +3 -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/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 +4 -2
- package/dist/components/Choice.js +3 -1
- package/dist/components/CookiesWarning.js +4 -2
- package/dist/components/DatePeriod.js +7 -5
- package/dist/components/DatePicker.js +6 -4
- package/dist/components/Drawer.js +3 -1
- package/dist/components/Dropdown.js +4 -2
- 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 +4 -2
- 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 +3 -1
- package/dist/components/Swiper.js +3 -1
- package/dist/components/Tab.js +3 -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/hoc/urlWithAssetPrefix.js +62 -0
- package/dist/types/components/Icon/Icon.d.ts +6 -2
- package/dist/types/components/Image/Image.d.ts +5 -2
- package/dist/types/components/Logo/Logo.d.ts +6 -2
- 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/context/UrlAssetPrefix.d.ts +12 -0
- package/dist/types/hoc/urlWithAssetPrefix.d.ts +8 -0
- package/package.json +6 -1
package/dist/components/Tile.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
6
|
-
import { b as Title, B as Badge, I as Icon } from '../
|
|
6
|
+
import { b as Title, B as Badge, I as Icon } from '../Tooltip_es_Cc2orRUE.js';
|
|
7
7
|
import { T as Text } from '../Text_es_BfLRfj-5.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import 'lodash/camelCase';
|
|
@@ -19,6 +19,8 @@ import '../utils/setViewportProperty.js';
|
|
|
19
19
|
import 'lodash/maxBy';
|
|
20
20
|
import '../hooks/useStyles/styleAttributes.js';
|
|
21
21
|
import 'react-inlinesvg';
|
|
22
|
+
import '../hoc/urlWithAssetPrefix.js';
|
|
23
|
+
import '../context/UrlAssetPrefix.js';
|
|
22
24
|
import '../Link_es_DxtZLeKY.js';
|
|
23
25
|
|
|
24
26
|
var tileAppearanceSize = {
|
package/dist/components/Title.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as Title, d as titleAppearance, c as titleConfig } from '../
|
|
1
|
+
export { b as Title, d as titleAppearance, c as titleConfig } from '../Tooltip_es_Cc2orRUE.js';
|
|
2
2
|
import '../tslib.es6_es_Bwu1Cn-t.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
@@ -19,4 +19,6 @@ import 'lodash/maxBy';
|
|
|
19
19
|
import '../hooks/useStyles/styleAttributes.js';
|
|
20
20
|
import '../Text_es_BfLRfj-5.js';
|
|
21
21
|
import 'react-inlinesvg';
|
|
22
|
+
import '../hoc/urlWithAssetPrefix.js';
|
|
23
|
+
import '../context/UrlAssetPrefix.js';
|
|
22
24
|
import '../Link_es_DxtZLeKY.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { T as Tooltip, a as tooltipAppearance, t as tooltipConfig } from '../
|
|
1
|
+
export { T as Tooltip, a as tooltipAppearance, t as tooltipConfig } from '../Tooltip_es_Cc2orRUE.js';
|
|
2
2
|
import '../tslib.es6_es_Bwu1Cn-t.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
@@ -19,4 +19,6 @@ import 'lodash/maxBy';
|
|
|
19
19
|
import '../hooks/useStyles/styleAttributes.js';
|
|
20
20
|
import '../Text_es_BfLRfj-5.js';
|
|
21
21
|
import 'react-inlinesvg';
|
|
22
|
+
import '../hoc/urlWithAssetPrefix.js';
|
|
23
|
+
import '../context/UrlAssetPrefix.js';
|
|
22
24
|
import '../Link_es_DxtZLeKY.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
var UrlAssetPrefixContext = createContext({
|
|
5
|
+
assetPrefix: undefined,
|
|
6
|
+
ignorePathsList: undefined,
|
|
7
|
+
});
|
|
8
|
+
function UrlAssetPrefixProvider(props) {
|
|
9
|
+
var assetPrefix = props.assetPrefix, ignorePathsList = props.ignorePathsList, children = props.children;
|
|
10
|
+
var value = useMemo(function () { return ({ assetPrefix: assetPrefix, ignorePathsList: ignorePathsList }); }, [assetPrefix, ignorePathsList]);
|
|
11
|
+
return (jsx(UrlAssetPrefixContext.Provider, { value: value, children: children }));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { UrlAssetPrefixContext, UrlAssetPrefixProvider };
|
|
@@ -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 };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { IconConfig
|
|
2
|
+
import type { IconConfig } from '../Icon/Icon.interface';
|
|
3
3
|
declare const iconConfig: IconConfig;
|
|
4
|
-
declare const Icon: React.ForwardRefExoticComponent<
|
|
4
|
+
declare const Icon: React.ForwardRefExoticComponent<{
|
|
5
|
+
imageSrc?: string;
|
|
6
|
+
src?: string;
|
|
7
|
+
svgSrc?: string;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
5
9
|
export { Icon, iconConfig };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const Image: import("react").ForwardRefExoticComponent<{
|
|
2
|
+
imageSrc?: string;
|
|
3
|
+
src?: string;
|
|
4
|
+
svgSrc?: string;
|
|
5
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
6
|
export { Image };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { LogoConfig
|
|
1
|
+
import type { LogoConfig } from './Logo.interface';
|
|
2
2
|
declare const logoConfig: LogoConfig;
|
|
3
|
-
declare
|
|
3
|
+
declare const Logo: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
imageSrc?: string;
|
|
5
|
+
src?: string;
|
|
6
|
+
svgSrc?: string;
|
|
7
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
8
|
export { Logo, logoConfig };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { ResponseConfig
|
|
1
|
+
import type { ResponseConfig } from './Response.interface';
|
|
2
2
|
declare const responseConfig: ResponseConfig;
|
|
3
|
-
declare
|
|
3
|
+
declare const Response: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
imageSrc?: string;
|
|
5
|
+
src?: string;
|
|
6
|
+
svgSrc?: string;
|
|
7
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
8
|
export { Response, responseConfig };
|
|
@@ -55,6 +55,7 @@ export interface ResponseProps extends ResponseAppearance, StyleAttributes {
|
|
|
55
55
|
/** desc description */
|
|
56
56
|
desc?: string;
|
|
57
57
|
descTextWeight?: TextWeightProps;
|
|
58
|
+
imageSrc?: string;
|
|
58
59
|
primaryButton?: boolean;
|
|
59
60
|
primaryButtonAfter?: ReactNode;
|
|
60
61
|
primaryButtonBefore?: ReactNode;
|
|
@@ -62,9 +63,10 @@ export interface ResponseProps extends ResponseAppearance, StyleAttributes {
|
|
|
62
63
|
secondaryButtonAfter?: ReactNode;
|
|
63
64
|
secondaryButtonBefore?: ReactNode;
|
|
64
65
|
style?: CSSProperties;
|
|
66
|
+
svgSrc?: string;
|
|
65
67
|
/** title description */
|
|
66
68
|
title?: string;
|
|
67
|
-
isSkeleton
|
|
69
|
+
isSkeleton?: boolean;
|
|
68
70
|
onClickPrimaryButton?: () => void;
|
|
69
71
|
onClickSecondaryButton?: () => void;
|
|
70
72
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const SVGContent: import("react").ForwardRefExoticComponent<{
|
|
2
|
+
imageSrc?: string;
|
|
3
|
+
src?: string;
|
|
4
|
+
svgSrc?: string;
|
|
5
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
6
|
export { SVGContent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type UrlAssetPrefixValue = {
|
|
2
|
+
assetPrefix?: string;
|
|
3
|
+
ignorePathsList?: Array<string | RegExp>;
|
|
4
|
+
};
|
|
5
|
+
type UrlAssetPrefixProviderProps = {
|
|
6
|
+
assetPrefix?: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
ignorePathsList?: Array<string | RegExp>;
|
|
9
|
+
};
|
|
10
|
+
declare const UrlAssetPrefixContext: import("react").Context<UrlAssetPrefixValue>;
|
|
11
|
+
declare function UrlAssetPrefixProvider(props: UrlAssetPrefixProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { UrlAssetPrefixProvider, UrlAssetPrefixContext };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { type ComponentType } from 'react';
|
|
2
|
+
type UrlWithAssetPrefixProps = {
|
|
3
|
+
imageSrc?: string;
|
|
4
|
+
src?: string;
|
|
5
|
+
svgSrc?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const urlWithAssetPrefix: (WrappedComponent: ComponentType<UrlWithAssetPrefixProps>) => React.ForwardRefExoticComponent<UrlWithAssetPrefixProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { urlWithAssetPrefix };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/ui",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.39",
|
|
4
4
|
"description": "UI components (Modal, Loader, Popup, etc)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Modal",
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
"import": "./dist/context/*.js",
|
|
45
45
|
"require": "./dist/cjs/context/*.js"
|
|
46
46
|
},
|
|
47
|
+
"./hoc/*": {
|
|
48
|
+
"types": "./dist/types/hoc/*.d.ts",
|
|
49
|
+
"import": "./dist/hoc/*.js",
|
|
50
|
+
"require": "./dist/cjs/hoc/*.js"
|
|
51
|
+
},
|
|
47
52
|
"./hooks/*": {
|
|
48
53
|
"types": "./dist/types/hooks/*.d.ts",
|
|
49
54
|
"import": "./dist/hooks/*.js",
|