@cloud-ru/uikit-product-promo-tag-predefined 0.2.4 → 0.2.6
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/CHANGELOG.md +20 -0
- package/dist/cjs/components/PromoTagPredefined.d.ts +13 -0
- package/dist/cjs/components/PromoTagPredefined.js +54 -0
- package/dist/cjs/components/constants.d.ts +9 -0
- package/dist/cjs/components/constants.js +12 -0
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +17 -0
- package/dist/cjs/components/styles.module.css +7 -0
- package/dist/cjs/components/types.d.ts +4 -0
- package/dist/cjs/components/types.js +2 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +17 -0
- package/dist/esm/components/PromoTagPredefined.d.ts +13 -0
- package/dist/esm/components/PromoTagPredefined.js +48 -0
- package/dist/esm/components/constants.d.ts +9 -0
- package/dist/esm/components/constants.js +9 -0
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/styles.module.css +7 -0
- package/dist/esm/components/types.d.ts +4 -0
- package/dist/esm/components/types.js +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.2.6 (2025-11-13)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@cloud-ru/uikit-product-utils@7.0.2](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/utils/CHANGELOG.md)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 0.2.5 (2025-11-12)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **PD-3377:** contributors update to publish all packages ([719fd3e](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/719fd3e1249e247443b125c47ea408d92c8395c3))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## 0.2.4 (2025-11-12)
|
|
7
27
|
|
|
8
28
|
### Only dependencies have been changed
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WithSupportProps } from '@sbercloud/uikit-product-utils';
|
|
2
|
+
import { PromoTagProps } from '@snack-uikit/promo-tag';
|
|
3
|
+
import { TooltipProps } from '@snack-uikit/tooltip';
|
|
4
|
+
import { PreviewContext, Variant } from './types';
|
|
5
|
+
export type PromoTagPredefinedProps = WithSupportProps<{
|
|
6
|
+
/** Вариант промо-тега */
|
|
7
|
+
variant: Variant;
|
|
8
|
+
/** Контекст тега с вариантом "preview" */
|
|
9
|
+
context?: PreviewContext;
|
|
10
|
+
/** Настройки тултипа */
|
|
11
|
+
tooltip?: Pick<TooltipProps, 'placement' | 'trigger'>;
|
|
12
|
+
}> & Pick<PromoTagProps, 'onClick'>;
|
|
13
|
+
export declare function PromoTagPredefined({ context, variant, tooltip, onClick, ...rest }: PromoTagPredefinedProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.PromoTagPredefined = PromoTagPredefined;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
20
|
+
const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
|
|
21
|
+
const promo_tag_1 = require("@snack-uikit/promo-tag");
|
|
22
|
+
const tooltip_1 = require("@snack-uikit/tooltip");
|
|
23
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
24
|
+
const constants_1 = require("./constants");
|
|
25
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
26
|
+
function PromoTagPredefined(_a) {
|
|
27
|
+
var { context = constants_1.PREVIEW_CONTEXT.Service, variant, tooltip, onClick } = _a, rest = __rest(_a, ["context", "variant", "tooltip", "onClick"]);
|
|
28
|
+
const { t } = (0, uikit_product_locale_1.useLocale)('PromoTagPredefined');
|
|
29
|
+
const { tip, text, appearance } = (0, react_1.useMemo)(() => {
|
|
30
|
+
switch (variant) {
|
|
31
|
+
case 'connecting':
|
|
32
|
+
return {
|
|
33
|
+
text: t('connecting'),
|
|
34
|
+
tip: t('tooltipConnecting'),
|
|
35
|
+
appearance: 'neutral',
|
|
36
|
+
};
|
|
37
|
+
case 'partner':
|
|
38
|
+
return {
|
|
39
|
+
text: t('partner'),
|
|
40
|
+
tip: t('tooltipPartner'),
|
|
41
|
+
appearance: 'orange',
|
|
42
|
+
};
|
|
43
|
+
case 'preview':
|
|
44
|
+
default: {
|
|
45
|
+
return {
|
|
46
|
+
text: t('preview'),
|
|
47
|
+
tip: context === constants_1.PREVIEW_CONTEXT.Functional ? t('tooltipPreviewFunctional') : t('tooltipPreviewService'),
|
|
48
|
+
appearance: 'blue',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}, [context, t, variant]);
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, Object.assign({}, tooltip, { tip: tip, className: styles_module_scss_1.default.tooltip, triggerClassName: styles_module_scss_1.default.trigger, hoverDelayOpen: 300, children: (0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, Object.assign({ text: text, appearance: appearance, onClick: onClick, color: 'decor', size: 'xxs' }, (0, utils_1.extractSupportProps)(rest))) })));
|
|
54
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VARIANTS = exports.PREVIEW_CONTEXT = void 0;
|
|
4
|
+
exports.PREVIEW_CONTEXT = {
|
|
5
|
+
Service: 'service',
|
|
6
|
+
Functional: 'functional',
|
|
7
|
+
};
|
|
8
|
+
exports.VARIANTS = {
|
|
9
|
+
Preview: 'preview',
|
|
10
|
+
Connecting: 'connecting',
|
|
11
|
+
Partner: 'partner',
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PromoTagPredefined';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PromoTagPredefined"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WithSupportProps } from '@sbercloud/uikit-product-utils';
|
|
2
|
+
import { PromoTagProps } from '@snack-uikit/promo-tag';
|
|
3
|
+
import { TooltipProps } from '@snack-uikit/tooltip';
|
|
4
|
+
import { PreviewContext, Variant } from './types';
|
|
5
|
+
export type PromoTagPredefinedProps = WithSupportProps<{
|
|
6
|
+
/** Вариант промо-тега */
|
|
7
|
+
variant: Variant;
|
|
8
|
+
/** Контекст тега с вариантом "preview" */
|
|
9
|
+
context?: PreviewContext;
|
|
10
|
+
/** Настройки тултипа */
|
|
11
|
+
tooltip?: Pick<TooltipProps, 'placement' | 'trigger'>;
|
|
12
|
+
}> & Pick<PromoTagProps, 'onClick'>;
|
|
13
|
+
export declare function PromoTagPredefined({ context, variant, tooltip, onClick, ...rest }: PromoTagPredefinedProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { useMemo } from 'react';
|
|
14
|
+
import { useLocale } from '@sbercloud/uikit-product-locale';
|
|
15
|
+
import { PromoTag } from '@snack-uikit/promo-tag';
|
|
16
|
+
import { Tooltip } from '@snack-uikit/tooltip';
|
|
17
|
+
import { extractSupportProps } from '@snack-uikit/utils';
|
|
18
|
+
import { PREVIEW_CONTEXT } from './constants';
|
|
19
|
+
import styles from './styles.module.css';
|
|
20
|
+
export function PromoTagPredefined(_a) {
|
|
21
|
+
var { context = PREVIEW_CONTEXT.Service, variant, tooltip, onClick } = _a, rest = __rest(_a, ["context", "variant", "tooltip", "onClick"]);
|
|
22
|
+
const { t } = useLocale('PromoTagPredefined');
|
|
23
|
+
const { tip, text, appearance } = useMemo(() => {
|
|
24
|
+
switch (variant) {
|
|
25
|
+
case 'connecting':
|
|
26
|
+
return {
|
|
27
|
+
text: t('connecting'),
|
|
28
|
+
tip: t('tooltipConnecting'),
|
|
29
|
+
appearance: 'neutral',
|
|
30
|
+
};
|
|
31
|
+
case 'partner':
|
|
32
|
+
return {
|
|
33
|
+
text: t('partner'),
|
|
34
|
+
tip: t('tooltipPartner'),
|
|
35
|
+
appearance: 'orange',
|
|
36
|
+
};
|
|
37
|
+
case 'preview':
|
|
38
|
+
default: {
|
|
39
|
+
return {
|
|
40
|
+
text: t('preview'),
|
|
41
|
+
tip: context === PREVIEW_CONTEXT.Functional ? t('tooltipPreviewFunctional') : t('tooltipPreviewService'),
|
|
42
|
+
appearance: 'blue',
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, [context, t, variant]);
|
|
47
|
+
return (_jsx(Tooltip, Object.assign({}, tooltip, { tip: tip, className: styles.tooltip, triggerClassName: styles.trigger, hoverDelayOpen: 300, children: _jsx(PromoTag, Object.assign({ text: text, appearance: appearance, onClick: onClick, color: 'decor', size: 'xxs' }, extractSupportProps(rest))) })));
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PromoTagPredefined';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PromoTagPredefined';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/uikit-product-promo-tag-predefined",
|
|
3
3
|
"title": "PromoTag Predefined",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.6",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -30,13 +30,14 @@
|
|
|
30
30
|
"name": "Akhremenko Grigorii",
|
|
31
31
|
"url": "https://github.com/AGrigorii"
|
|
32
32
|
},
|
|
33
|
+
"contributors": [],
|
|
33
34
|
"license": "Apache-2.0",
|
|
34
35
|
"publishConfig": {
|
|
35
36
|
"access": "public"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@cloud-ru/uikit-product-utils": "7.0.
|
|
40
|
+
"@cloud-ru/uikit-product-utils": "7.0.2",
|
|
40
41
|
"@snack-uikit/promo-tag": "0.7.8",
|
|
41
42
|
"@snack-uikit/tooltip": "0.18.4",
|
|
42
43
|
"@snack-uikit/utils": "4.0.0"
|
|
@@ -44,5 +45,5 @@
|
|
|
44
45
|
"peerDependencies": {
|
|
45
46
|
"@cloud-ru/uikit-product-locale": "*"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "bf479ecf7238ef20b78f20acaef439efa535d1a1"
|
|
48
49
|
}
|