@snack-uikit/chips 0.27.14 → 0.27.16-preview-d40db86a.0

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 CHANGED
@@ -3,6 +3,19 @@
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.15 (2025-07-10)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@snack-uikit/calendar@0.12.15](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/calendar/CHANGELOG.md)
10
+ * [@snack-uikit/icons@0.27.2](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/icons/CHANGELOG.md)
11
+ * [@snack-uikit/list@0.31.4](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/list/CHANGELOG.md)
12
+ * [@snack-uikit/tooltip@0.18.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/tooltip/CHANGELOG.md)
13
+ * [@snack-uikit/truncate-string@0.6.24](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/truncate-string/CHANGELOG.md)
14
+
15
+
16
+
17
+
18
+
6
19
  ## 0.27.14 (2025-07-10)
7
20
 
8
21
  ### Only dependencies have been changed
package/README.md CHANGED
@@ -114,6 +114,7 @@ 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` | - | |
117
118
  ## ChipChoice.Custom
118
119
  ### Props
119
120
  | name | type | default value | description |
@@ -8,6 +8,7 @@ export type ChipToggleProps = WithSupportProps<BaseChipProps & {
8
8
  size?: Size;
9
9
  /** Колбек смены значения */
10
10
  onChange(checked: boolean, e: ChangeEvent<HTMLInputElement>): void;
11
+ customBorderRadius?: string | number;
11
12
  }>;
12
13
  /** Чип с состоянием выбран/не выбран */
13
- export declare function ChipToggle({ icon, size, label, checked, disabled, loading, onChange, className, tabIndex, truncateVariant, ...rest }: ChipToggleProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function ChipToggle({ icon, size, label, checked, disabled, loading, onChange, className, tabIndex, truncateVariant, customBorderRadius, ...rest }: ChipToggleProps): import("react/jsx-runtime").JSX.Element;
@@ -36,9 +36,10 @@ function ChipToggle(_a) {
36
36
  onChange,
37
37
  className,
38
38
  tabIndex = 0,
39
- truncateVariant = 'middle'
39
+ truncateVariant = 'middle',
40
+ customBorderRadius
40
41
  } = _a,
41
- rest = __rest(_a, ["icon", "size", "label", "checked", "disabled", "loading", "onChange", "className", "tabIndex", "truncateVariant"]);
42
+ rest = __rest(_a, ["icon", "size", "label", "checked", "disabled", "loading", "onChange", "className", "tabIndex", "truncateVariant", "customBorderRadius"]);
42
43
  const variant = icon && size !== constants_1.SIZE.Xs ? constants_1.VARIANT.IconBefore : constants_1.VARIANT.LabelOnly;
43
44
  const spinnerSize = size === constants_1.SIZE.Xs ? 'xs' : 's';
44
45
  const handleChange = e => {
@@ -64,6 +65,9 @@ function ChipToggle(_a) {
64
65
  className: styles_module_scss_1.default.toggleChipInput
65
66
  }), (0, jsx_runtime_1.jsxs)("span", {
66
67
  className: styles_module_scss_1.default.toggleChipContent,
68
+ style: customBorderRadius ? {
69
+ borderRadius: customBorderRadius
70
+ } : undefined,
67
71
  children: [variant === constants_1.VARIANT.IconBefore && !loading && (0, jsx_runtime_1.jsx)("span", {
68
72
  className: styles_module_scss_1.default.icon,
69
73
  "data-test-id": constants_1.CHIP_TOGGLE_TEST_IDS.icon,
@@ -8,6 +8,7 @@ export type ChipToggleProps = WithSupportProps<BaseChipProps & {
8
8
  size?: Size;
9
9
  /** Колбек смены значения */
10
10
  onChange(checked: boolean, e: ChangeEvent<HTMLInputElement>): void;
11
+ customBorderRadius?: string | number;
11
12
  }>;
12
13
  /** Чип с состоянием выбран/не выбран */
13
- export declare function ChipToggle({ icon, size, label, checked, disabled, loading, onChange, className, tabIndex, truncateVariant, ...rest }: ChipToggleProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function ChipToggle({ icon, size, label, checked, disabled, loading, onChange, className, tabIndex, truncateVariant, customBorderRadius, ...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' } = _a, rest = __rest(_a, ["icon", "size", "label", "checked", "disabled", "loading", "onChange", "className", "tabIndex", "truncateVariant"]);
21
+ var { icon, size = SIZE.S, label, checked, disabled, loading, onChange, className, tabIndex = 0, truncateVariant = 'middle', customBorderRadius } = _a, rest = __rest(_a, ["icon", "size", "label", "checked", "disabled", "loading", "onChange", "className", "tabIndex", "truncateVariant", "customBorderRadius"]);
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, 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 }) })] })] })));
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, style: customBorderRadius ? { borderRadius: customBorderRadius } : undefined, 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.14",
7
+ "version": "0.27.16-preview-d40db86a.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -37,14 +37,14 @@
37
37
  "scripts": {},
38
38
  "dependencies": {
39
39
  "@snack-uikit/button": "0.19.13",
40
- "@snack-uikit/calendar": "0.12.14",
40
+ "@snack-uikit/calendar": "0.12.15",
41
41
  "@snack-uikit/divider": "3.2.7",
42
42
  "@snack-uikit/dropdown": "0.5.0",
43
- "@snack-uikit/icons": "0.27.1",
44
- "@snack-uikit/list": "0.31.3",
43
+ "@snack-uikit/icons": "0.27.2",
44
+ "@snack-uikit/list": "0.31.4",
45
45
  "@snack-uikit/loaders": "0.9.6",
46
- "@snack-uikit/tooltip": "0.18.0",
47
- "@snack-uikit/truncate-string": "0.6.23",
46
+ "@snack-uikit/tooltip": "0.18.1",
47
+ "@snack-uikit/truncate-string": "0.6.24",
48
48
  "@snack-uikit/utils": "3.9.0",
49
49
  "classnames": "2.5.1",
50
50
  "fuzzy-search": "3.2.1",
@@ -57,5 +57,5 @@
57
57
  "peerDependencies": {
58
58
  "@snack-uikit/locale": "*"
59
59
  },
60
- "gitHead": "a52f1e048d51eb120078ce84b5cc497a8f35c133"
60
+ "gitHead": "7096dc003719b443e788abc684aa9e1292bf7bea"
61
61
  }
@@ -17,6 +17,7 @@ export type ChipToggleProps = WithSupportProps<
17
17
  size?: Size;
18
18
  /** Колбек смены значения */
19
19
  onChange(checked: boolean, e: ChangeEvent<HTMLInputElement>): void;
20
+ customBorderRadius?: string | number;
20
21
  }
21
22
  >;
22
23
 
@@ -32,6 +33,7 @@ export function ChipToggle({
32
33
  className,
33
34
  tabIndex = 0,
34
35
  truncateVariant = 'middle',
36
+ customBorderRadius,
35
37
  ...rest
36
38
  }: ChipToggleProps) {
37
39
  const variant = icon && size !== SIZE.Xs ? VARIANT.IconBefore : VARIANT.LabelOnly;
@@ -65,7 +67,10 @@ export function ChipToggle({
65
67
  className={styles.toggleChipInput}
66
68
  />
67
69
 
68
- <span className={styles.toggleChipContent}>
70
+ <span
71
+ className={styles.toggleChipContent}
72
+ style={customBorderRadius ? { borderRadius: customBorderRadius } : undefined}
73
+ >
69
74
  {variant === VARIANT.IconBefore && !loading && (
70
75
  <span className={styles.icon} data-test-id={CHIP_TOGGLE_TEST_IDS.icon}>
71
76
  {icon}