@snack-uikit/chips 0.27.16-preview-d40db86a.0 → 0.27.16
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 +17 -0
- package/README.md +0 -1
- package/dist/cjs/components/ChipToggle/ChipToggle.d.ts +1 -2
- package/dist/cjs/components/ChipToggle/ChipToggle.js +2 -6
- package/dist/esm/components/ChipToggle/ChipToggle.d.ts +1 -2
- package/dist/esm/components/ChipToggle/ChipToggle.js +2 -2
- package/package.json +11 -11
- package/src/components/ChipToggle/ChipToggle.tsx +1 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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.27.16 (2025-07-15)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@snack-uikit/button@0.19.14](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/button/CHANGELOG.md)
|
|
10
|
+
* [@snack-uikit/calendar@0.12.16](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/calendar/CHANGELOG.md)
|
|
11
|
+
* [@snack-uikit/divider@3.2.8](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/divider/CHANGELOG.md)
|
|
12
|
+
* [@snack-uikit/dropdown@0.5.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/dropdown/CHANGELOG.md)
|
|
13
|
+
* [@snack-uikit/list@0.31.5](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/list/CHANGELOG.md)
|
|
14
|
+
* [@snack-uikit/loaders@0.9.7](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/loaders/CHANGELOG.md)
|
|
15
|
+
* [@snack-uikit/tooltip@0.18.2](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/tooltip/CHANGELOG.md)
|
|
16
|
+
* [@snack-uikit/truncate-string@0.6.25](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
17
|
+
* [@snack-uikit/utils@3.10.0](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/utils/CHANGELOG.md)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## 0.27.15 (2025-07-10)
|
|
7
24
|
|
|
8
25
|
### Only dependencies have been changed
|
package/README.md
CHANGED
|
@@ -114,7 +114,6 @@ import { PlaceholderSVG } from '@snack-uikit/icons';
|
|
|
114
114
|
| tabIndex | `number` | - | HTML tab index |
|
|
115
115
|
| truncateVariant | "end" \| "middle" | middle | Вариант обрезания лейбла |
|
|
116
116
|
| size | enum Size: `"xs"`, `"s"`, `"m"`, `"l"` | s | Размер |
|
|
117
|
-
| customBorderRadius | `string \| number` | - | |
|
|
118
117
|
## ChipChoice.Custom
|
|
119
118
|
### Props
|
|
120
119
|
| name | type | default value | description |
|
|
@@ -8,7 +8,6 @@ export type ChipToggleProps = WithSupportProps<BaseChipProps & {
|
|
|
8
8
|
size?: Size;
|
|
9
9
|
/** Колбек смены значения */
|
|
10
10
|
onChange(checked: boolean, e: ChangeEvent<HTMLInputElement>): void;
|
|
11
|
-
customBorderRadius?: string | number;
|
|
12
11
|
}>;
|
|
13
12
|
/** Чип с состоянием выбран/не выбран */
|
|
14
|
-
export declare function ChipToggle({ icon, size, label, checked, disabled, loading, onChange, className, tabIndex, truncateVariant,
|
|
13
|
+
export declare function ChipToggle({ icon, size, label, checked, disabled, loading, onChange, className, tabIndex, truncateVariant, ...rest }: ChipToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -36,10 +36,9 @@ function ChipToggle(_a) {
|
|
|
36
36
|
onChange,
|
|
37
37
|
className,
|
|
38
38
|
tabIndex = 0,
|
|
39
|
-
truncateVariant = 'middle'
|
|
40
|
-
customBorderRadius
|
|
39
|
+
truncateVariant = 'middle'
|
|
41
40
|
} = _a,
|
|
42
|
-
rest = __rest(_a, ["icon", "size", "label", "checked", "disabled", "loading", "onChange", "className", "tabIndex", "truncateVariant"
|
|
41
|
+
rest = __rest(_a, ["icon", "size", "label", "checked", "disabled", "loading", "onChange", "className", "tabIndex", "truncateVariant"]);
|
|
43
42
|
const variant = icon && size !== constants_1.SIZE.Xs ? constants_1.VARIANT.IconBefore : constants_1.VARIANT.LabelOnly;
|
|
44
43
|
const spinnerSize = size === constants_1.SIZE.Xs ? 'xs' : 's';
|
|
45
44
|
const handleChange = e => {
|
|
@@ -65,9 +64,6 @@ function ChipToggle(_a) {
|
|
|
65
64
|
className: styles_module_scss_1.default.toggleChipInput
|
|
66
65
|
}), (0, jsx_runtime_1.jsxs)("span", {
|
|
67
66
|
className: styles_module_scss_1.default.toggleChipContent,
|
|
68
|
-
style: customBorderRadius ? {
|
|
69
|
-
borderRadius: customBorderRadius
|
|
70
|
-
} : undefined,
|
|
71
67
|
children: [variant === constants_1.VARIANT.IconBefore && !loading && (0, jsx_runtime_1.jsx)("span", {
|
|
72
68
|
className: styles_module_scss_1.default.icon,
|
|
73
69
|
"data-test-id": constants_1.CHIP_TOGGLE_TEST_IDS.icon,
|
|
@@ -8,7 +8,6 @@ export type ChipToggleProps = WithSupportProps<BaseChipProps & {
|
|
|
8
8
|
size?: Size;
|
|
9
9
|
/** Колбек смены значения */
|
|
10
10
|
onChange(checked: boolean, e: ChangeEvent<HTMLInputElement>): void;
|
|
11
|
-
customBorderRadius?: string | number;
|
|
12
11
|
}>;
|
|
13
12
|
/** Чип с состоянием выбран/не выбран */
|
|
14
|
-
export declare function ChipToggle({ icon, size, label, checked, disabled, loading, onChange, className, tabIndex, truncateVariant,
|
|
13
|
+
export declare function ChipToggle({ icon, size, label, checked, disabled, loading, onChange, className, tabIndex, truncateVariant, ...rest }: ChipToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,7 +18,7 @@ import { CHIP_TOGGLE_TEST_IDS, SIZE, VARIANT } from '../../constants';
|
|
|
18
18
|
import styles from './styles.module.css';
|
|
19
19
|
/** Чип с состоянием выбран/не выбран */
|
|
20
20
|
export function ChipToggle(_a) {
|
|
21
|
-
var { icon, size = SIZE.S, label, checked, disabled, loading, onChange, className, tabIndex = 0, truncateVariant = 'middle'
|
|
21
|
+
var { icon, size = SIZE.S, label, checked, disabled, loading, onChange, className, tabIndex = 0, truncateVariant = 'middle' } = _a, rest = __rest(_a, ["icon", "size", "label", "checked", "disabled", "loading", "onChange", "className", "tabIndex", "truncateVariant"]);
|
|
22
22
|
const variant = icon && size !== SIZE.Xs ? VARIANT.IconBefore : VARIANT.LabelOnly;
|
|
23
23
|
const spinnerSize = size === SIZE.Xs ? 'xs' : 's';
|
|
24
24
|
const handleChange = e => {
|
|
@@ -27,5 +27,5 @@ export function ChipToggle(_a) {
|
|
|
27
27
|
}
|
|
28
28
|
onChange === null || onChange === void 0 ? void 0 : onChange(!checked, e);
|
|
29
29
|
};
|
|
30
|
-
return (_jsxs("label", Object.assign({}, extractSupportProps(rest), { "data-size": size, "data-loading": loading || undefined, "data-disabled": (!loading && disabled) || undefined, "data-variant": variant, "data-checked": checked || undefined, className: cn(styles.toggleChip, className), children: [_jsx("input", { "data-test-id": CHIP_TOGGLE_TEST_IDS.input, type: 'checkbox', checked: checked, onChange: handleChange, disabled: !loading && disabled, tabIndex: disabled ? -1 : tabIndex, className: styles.toggleChipInput }), _jsxs("span", { className: styles.toggleChipContent,
|
|
30
|
+
return (_jsxs("label", Object.assign({}, extractSupportProps(rest), { "data-size": size, "data-loading": loading || undefined, "data-disabled": (!loading && disabled) || undefined, "data-variant": variant, "data-checked": checked || undefined, className: cn(styles.toggleChip, className), children: [_jsx("input", { "data-test-id": CHIP_TOGGLE_TEST_IDS.input, type: 'checkbox', checked: checked, onChange: handleChange, disabled: !loading && disabled, tabIndex: disabled ? -1 : tabIndex, className: styles.toggleChipInput }), _jsxs("span", { className: styles.toggleChipContent, children: [variant === VARIANT.IconBefore && !loading && (_jsx("span", { className: styles.icon, "data-test-id": CHIP_TOGGLE_TEST_IDS.icon, children: icon })), loading && (_jsx("span", { className: styles.spinner, "data-test-id": CHIP_TOGGLE_TEST_IDS.spinner, children: _jsx(Sun, { size: spinnerSize }) })), _jsx("span", { className: cn(styles.labelLayout, styles.label), "data-test-id": CHIP_TOGGLE_TEST_IDS.label, children: _jsx(TruncateString, { text: label, variant: truncateVariant }) })] })] })));
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Chips",
|
|
7
|
-
"version": "0.27.16
|
|
7
|
+
"version": "0.27.16",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@snack-uikit/button": "0.19.
|
|
40
|
-
"@snack-uikit/calendar": "0.12.
|
|
41
|
-
"@snack-uikit/divider": "3.2.
|
|
42
|
-
"@snack-uikit/dropdown": "0.5.
|
|
39
|
+
"@snack-uikit/button": "0.19.14",
|
|
40
|
+
"@snack-uikit/calendar": "0.12.16",
|
|
41
|
+
"@snack-uikit/divider": "3.2.8",
|
|
42
|
+
"@snack-uikit/dropdown": "0.5.1",
|
|
43
43
|
"@snack-uikit/icons": "0.27.2",
|
|
44
|
-
"@snack-uikit/list": "0.31.
|
|
45
|
-
"@snack-uikit/loaders": "0.9.
|
|
46
|
-
"@snack-uikit/tooltip": "0.18.
|
|
47
|
-
"@snack-uikit/truncate-string": "0.6.
|
|
48
|
-
"@snack-uikit/utils": "3.
|
|
44
|
+
"@snack-uikit/list": "0.31.5",
|
|
45
|
+
"@snack-uikit/loaders": "0.9.7",
|
|
46
|
+
"@snack-uikit/tooltip": "0.18.2",
|
|
47
|
+
"@snack-uikit/truncate-string": "0.6.25",
|
|
48
|
+
"@snack-uikit/utils": "3.10.0",
|
|
49
49
|
"classnames": "2.5.1",
|
|
50
50
|
"fuzzy-search": "3.2.1",
|
|
51
51
|
"merge-refs": "1.3.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@snack-uikit/locale": "*"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "60a306ca6f30a3dc7363ecc71b1584acc98dea58"
|
|
61
61
|
}
|
|
@@ -17,7 +17,6 @@ export type ChipToggleProps = WithSupportProps<
|
|
|
17
17
|
size?: Size;
|
|
18
18
|
/** Колбек смены значения */
|
|
19
19
|
onChange(checked: boolean, e: ChangeEvent<HTMLInputElement>): void;
|
|
20
|
-
customBorderRadius?: string | number;
|
|
21
20
|
}
|
|
22
21
|
>;
|
|
23
22
|
|
|
@@ -33,7 +32,6 @@ export function ChipToggle({
|
|
|
33
32
|
className,
|
|
34
33
|
tabIndex = 0,
|
|
35
34
|
truncateVariant = 'middle',
|
|
36
|
-
customBorderRadius,
|
|
37
35
|
...rest
|
|
38
36
|
}: ChipToggleProps) {
|
|
39
37
|
const variant = icon && size !== SIZE.Xs ? VARIANT.IconBefore : VARIANT.LabelOnly;
|
|
@@ -67,10 +65,7 @@ export function ChipToggle({
|
|
|
67
65
|
className={styles.toggleChipInput}
|
|
68
66
|
/>
|
|
69
67
|
|
|
70
|
-
<span
|
|
71
|
-
className={styles.toggleChipContent}
|
|
72
|
-
style={customBorderRadius ? { borderRadius: customBorderRadius } : undefined}
|
|
73
|
-
>
|
|
68
|
+
<span className={styles.toggleChipContent}>
|
|
74
69
|
{variant === VARIANT.IconBefore && !loading && (
|
|
75
70
|
<span className={styles.icon} data-test-id={CHIP_TOGGLE_TEST_IDS.icon}>
|
|
76
71
|
{icon}
|