@ozen-ui/kit 0.36.1 → 0.37.1
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.
|
@@ -4,6 +4,7 @@ exports.Chip = exports.chipColorVariant = exports.chipSizeVariant = exports.cnCh
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
require("./Chip.css");
|
|
6
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
var logger_1 = require("@ozen-ui/logger");
|
|
7
8
|
var useThemeProps_1 = require("../../hooks/useThemeProps");
|
|
8
9
|
var classname_1 = require("../../utils/classname");
|
|
9
10
|
var getIconSizeToFormElement_1 = require("../../utils/getIconSizeToFormElement");
|
|
@@ -17,6 +18,9 @@ exports.chipColorVariant = ['primary', 'secondary'];
|
|
|
17
18
|
exports.Chip = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
18
19
|
var _a = (0, useThemeProps_1.useThemeProps)({ name: 'Chip', props: inProps }), _b = _a.size, size = _b === void 0 ? constants_1.CHIP_DEFAULT_SIZE : _b, _c = _a.color, color = _c === void 0 ? constants_1.CHIP_DEFAULT_VARIANT : _c, _d = _a.disabled, disabled = _d === void 0 ? constants_1.CHIP_DEFAULT_DISABLED : _d, IconLeft = _a.iconLeft, IconRight = _a.iconRight, labelProps = _a.labelProps, inputRef = _a.inputRef, className = _a.className, children = _a.children, dataTestId = _a["data-testid"], other = tslib_1.__rest(_a, ["size", "color", "disabled", "iconLeft", "iconRight", "labelProps", "inputRef", "className", "children", 'data-testid']);
|
|
19
20
|
var iconSize = (0, react_1.useMemo)(function () { return (0, getIconSizeToFormElement_1.getIconSizeToFormElement)(size); }, [size]);
|
|
21
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
22
|
+
(0, logger_1.deprecate)("\u041A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442 \u00ABChip\u00BB \u0443\u0441\u0442\u0430\u0440\u0435\u043B. \u0414\u043B\u044F \u0437\u0430\u043C\u0435\u043D\u044B \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442 \u00ABChipNext\u00BB.");
|
|
23
|
+
}
|
|
20
24
|
return (react_1.default.createElement("label", tslib_1.__assign({ ref: ref, className: (0, exports.cnChip)('', { size: size, disabled: disabled, color: color }, [className]), "data-testid": dataTestId }, labelProps),
|
|
21
25
|
react_1.default.createElement("input", tslib_1.__assign({ ref: inputRef, className: (0, exports.cnChip)('Input'), disabled: disabled, type: "checkbox" }, other)),
|
|
22
26
|
react_1.default.createElement("span", { className: (0, exports.cnChip)('Content') },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
2
|
import './Chip.css';
|
|
3
3
|
import React, { forwardRef, useMemo } from 'react';
|
|
4
|
+
import { deprecate } from '@ozen-ui/logger';
|
|
4
5
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
5
6
|
import { cn } from '../../utils/classname';
|
|
6
7
|
import { getIconSizeToFormElement } from '../../utils/getIconSizeToFormElement';
|
|
@@ -14,6 +15,9 @@ export var chipColorVariant = ['primary', 'secondary'];
|
|
|
14
15
|
export var Chip = forwardRef(function (inProps, ref) {
|
|
15
16
|
var _a = useThemeProps({ name: 'Chip', props: inProps }), _b = _a.size, size = _b === void 0 ? CHIP_DEFAULT_SIZE : _b, _c = _a.color, color = _c === void 0 ? CHIP_DEFAULT_VARIANT : _c, _d = _a.disabled, disabled = _d === void 0 ? CHIP_DEFAULT_DISABLED : _d, IconLeft = _a.iconLeft, IconRight = _a.iconRight, labelProps = _a.labelProps, inputRef = _a.inputRef, className = _a.className, children = _a.children, dataTestId = _a["data-testid"], other = __rest(_a, ["size", "color", "disabled", "iconLeft", "iconRight", "labelProps", "inputRef", "className", "children", 'data-testid']);
|
|
16
17
|
var iconSize = useMemo(function () { return getIconSizeToFormElement(size); }, [size]);
|
|
18
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
19
|
+
deprecate("\u041A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442 \u00ABChip\u00BB \u0443\u0441\u0442\u0430\u0440\u0435\u043B. \u0414\u043B\u044F \u0437\u0430\u043C\u0435\u043D\u044B \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442 \u00ABChipNext\u00BB.");
|
|
20
|
+
}
|
|
17
21
|
return (React.createElement("label", __assign({ ref: ref, className: cnChip('', { size: size, disabled: disabled, color: color }, [className]), "data-testid": dataTestId }, labelProps),
|
|
18
22
|
React.createElement("input", __assign({ ref: inputRef, className: cnChip('Input'), disabled: disabled, type: "checkbox" }, other)),
|
|
19
23
|
React.createElement("span", { className: cnChip('Content') },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ozen-ui/kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.1",
|
|
4
4
|
"description": "React component library",
|
|
5
5
|
"files": [
|
|
6
6
|
"*"
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"@bem-react/classnames": "^1.3.10",
|
|
24
24
|
"@ozen-ui/fonts": "latest",
|
|
25
25
|
"@ozen-ui/icons": "latest",
|
|
26
|
+
"@ozen-ui/logger": "latest",
|
|
26
27
|
"@popperjs/core": "^2.11.8",
|
|
27
28
|
"decimal.js": "^10.4.3",
|
|
28
29
|
"react-is": "^18.2.0",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"@ozen-ui/fonts": "latest",
|
|
35
36
|
"@ozen-ui/icons": "latest",
|
|
37
|
+
"@ozen-ui/logger": "latest",
|
|
36
38
|
"react": ">=17.0.2 <19.0.0",
|
|
37
39
|
"react-dom": ">=17.0.2 <19.0.0"
|
|
38
40
|
}
|