@salutejs/plasma-new-hope 0.76.0-dev.0 → 0.76.2-canary.1179.8707316396.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/cjs/components/Chip/Chip.css +2 -0
  2. package/cjs/components/Chip/Chip.js +14 -2
  3. package/cjs/components/Chip/Chip.js.map +1 -1
  4. package/cjs/components/Chip/Chip.tokens.js +5 -0
  5. package/cjs/components/Chip/Chip.tokens.js.map +1 -1
  6. package/cjs/components/Chip/variations/_pilled/base.js +9 -0
  7. package/cjs/components/Chip/variations/_pilled/base.js.map +1 -0
  8. package/cjs/components/Chip/variations/_pilled/base_3kce4h.css +1 -0
  9. package/cjs/components/Combobox/Combobox.css +2 -0
  10. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.css +2 -0
  11. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.css +2 -0
  12. package/cjs/components/Pagination/Pagination.css +2 -0
  13. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -0
  14. package/cjs/components/Select/Select.css +2 -0
  15. package/cjs/components/Select/ui/SelectChip/SelectChip.css +2 -0
  16. package/cjs/components/Select/ui/SelectTarget/SelectTarget.css +2 -0
  17. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.css +2 -0
  18. package/cjs/index.css +2 -0
  19. package/es/components/Chip/Chip.css +2 -0
  20. package/es/components/Chip/Chip.js +15 -3
  21. package/es/components/Chip/Chip.js.map +1 -1
  22. package/es/components/Chip/Chip.tokens.js +5 -1
  23. package/es/components/Chip/Chip.tokens.js.map +1 -1
  24. package/es/components/Chip/variations/_pilled/base.js +5 -0
  25. package/es/components/Chip/variations/_pilled/base.js.map +1 -0
  26. package/es/components/Chip/variations/_pilled/base_3kce4h.css +1 -0
  27. package/es/components/Combobox/Combobox.css +2 -0
  28. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.css +2 -0
  29. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.css +2 -0
  30. package/es/components/Pagination/Pagination.css +2 -0
  31. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -0
  32. package/es/components/Select/Select.css +2 -0
  33. package/es/components/Select/ui/SelectChip/SelectChip.css +2 -0
  34. package/es/components/Select/ui/SelectTarget/SelectTarget.css +2 -0
  35. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.css +2 -0
  36. package/es/index.css +2 -0
  37. package/package.json +2 -2
  38. package/styled-components/cjs/components/Chip/Chip.js +14 -2
  39. package/styled-components/cjs/components/Chip/Chip.template-doc.mdx +2 -2
  40. package/styled-components/cjs/components/Chip/Chip.tokens.js +5 -1
  41. package/styled-components/cjs/components/Chip/variations/_pilled/base.js +9 -0
  42. package/styled-components/cjs/components/Chip/variations/_pilled/tokens.json +4 -0
  43. package/styled-components/cjs/examples/plasma_b2c/components/Chip/Chip.config.js +10 -7
  44. package/styled-components/cjs/examples/plasma_b2c/components/Chip/Chip.stories.tsx +18 -2
  45. package/styled-components/cjs/examples/plasma_b2c/components/Divider/Divider.stories.tsx +1 -0
  46. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +8 -18
  47. package/styled-components/cjs/examples/plasma_b2c/components/Tooltip/Tooltip.stories.tsx +1 -0
  48. package/styled-components/cjs/examples/plasma_web/components/Chip/Chip.config.js +10 -7
  49. package/styled-components/cjs/examples/plasma_web/components/Chip/Chip.stories.tsx +18 -2
  50. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +8 -18
  51. package/styled-components/cjs/examples/plasma_web/components/Tooltip/Tooltip.stories.tsx +1 -0
  52. package/styled-components/cjs/examples/sds_engineer/components/TextField/TextField.stories.tsx +8 -18
  53. package/styled-components/cjs/examples/sds_engineer/components/Tooltip/Tooltip.stories.tsx +1 -0
  54. package/styled-components/es/components/Chip/Chip.js +15 -3
  55. package/styled-components/es/components/Chip/Chip.template-doc.mdx +2 -2
  56. package/styled-components/es/components/Chip/Chip.tokens.js +4 -0
  57. package/styled-components/es/components/Chip/variations/_pilled/base.js +3 -0
  58. package/styled-components/es/components/Chip/variations/_pilled/tokens.json +4 -0
  59. package/styled-components/es/examples/plasma_b2c/components/Chip/Chip.config.js +10 -7
  60. package/styled-components/es/examples/plasma_b2c/components/Chip/Chip.stories.tsx +18 -2
  61. package/styled-components/es/examples/plasma_b2c/components/Divider/Divider.stories.tsx +1 -0
  62. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +8 -18
  63. package/styled-components/es/examples/plasma_b2c/components/Tooltip/Tooltip.stories.tsx +1 -0
  64. package/styled-components/es/examples/plasma_web/components/Chip/Chip.config.js +10 -7
  65. package/styled-components/es/examples/plasma_web/components/Chip/Chip.stories.tsx +18 -2
  66. package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +8 -18
  67. package/styled-components/es/examples/plasma_web/components/Tooltip/Tooltip.stories.tsx +1 -0
  68. package/styled-components/es/examples/sds_engineer/components/TextField/TextField.stories.tsx +8 -18
  69. package/styled-components/es/examples/sds_engineer/components/Tooltip/Tooltip.stories.tsx +1 -0
  70. package/types/components/Chip/Chip.d.ts +4 -0
  71. package/types/components/Chip/Chip.d.ts.map +1 -1
  72. package/types/components/Chip/Chip.tokens.d.ts +4 -0
  73. package/types/components/Chip/Chip.tokens.d.ts.map +1 -1
  74. package/types/components/Chip/Chip.types.d.ts +6 -0
  75. package/types/components/Chip/Chip.types.d.ts.map +1 -1
  76. package/types/components/Chip/variations/_pilled/base.d.ts +2 -0
  77. package/types/components/Chip/variations/_pilled/base.d.ts.map +1 -0
  78. package/types/examples/plasma_b2c/components/Chip/Chip.config.d.ts +4 -1
  79. package/types/examples/plasma_b2c/components/Chip/Chip.config.d.ts.map +1 -1
  80. package/types/examples/plasma_b2c/components/Chip/Chip.d.ts +4 -1
  81. package/types/examples/plasma_b2c/components/Chip/Chip.d.ts.map +1 -1
  82. package/types/examples/plasma_web/components/Chip/Chip.config.d.ts +4 -1
  83. package/types/examples/plasma_web/components/Chip/Chip.config.d.ts.map +1 -1
  84. package/types/examples/plasma_web/components/Chip/Chip.d.ts +4 -1
  85. package/types/examples/plasma_web/components/Chip/Chip.d.ts.map +1 -1
@@ -8,6 +8,8 @@
8
8
 
9
9
  .base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
10
10
 
11
+ .base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
12
+
11
13
  .Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
12
14
  .Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
13
15
  .Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@@ -10,6 +10,8 @@
10
10
 
11
11
  .base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
12
12
 
13
+ .base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
14
+
13
15
  .Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
14
16
  .Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
15
17
  .Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
package/es/index.css CHANGED
@@ -40,6 +40,8 @@
40
40
 
41
41
  .base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
42
42
 
43
+ .base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
44
+
43
45
  .Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
44
46
  .Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
45
47
  .Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salutejs/plasma-new-hope",
3
- "version": "0.76.0-dev.0",
3
+ "version": "0.76.2-canary.1179.8707316396.0",
4
4
  "description": "Salute Design System blueprint",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",
@@ -102,5 +102,5 @@
102
102
  "react-popper": "2.3.0",
103
103
  "storeon": "3.1.5"
104
104
  },
105
- "gitHead": "a472ddfdd261f1a196280ad246b24d6afe24fe44"
105
+ "gitHead": "31d6801d448d36bf3a35bdd00edf6f0de6ca2f83"
106
106
  }
@@ -7,14 +7,16 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.chipRoot = exports.chipConfig = void 0;
8
8
  var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
9
9
  var _IconClose = /*#__PURE__*/require("../_Icon/Icons/IconClose");
10
+ var _utils = /*#__PURE__*/require("../../utils");
10
11
  var _base = /*#__PURE__*/require("./variations/_view/base");
11
12
  var _base2 = /*#__PURE__*/require("./variations/_size/base");
12
13
  var _base3 = /*#__PURE__*/require("./variations/_disabled/base");
13
14
  var _base4 = /*#__PURE__*/require("./variations/_readonly/base");
14
15
  var _base5 = /*#__PURE__*/require("./variations/_focused/base");
16
+ var _base6 = /*#__PURE__*/require("./variations/_pilled/base");
15
17
  var _Chip = /*#__PURE__*/require("./Chip.styles");
16
18
  var _Chip2 = /*#__PURE__*/require("./Chip.tokens");
17
- var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "onClear", "onClick", "readOnly", "disabled"];
19
+ var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "className", "onClear", "onClick", "pilled", "readOnly", "disabled"];
18
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
19
21
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
20
22
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -28,14 +30,18 @@ var chipRoot = exports.chipRoot = function chipRoot(Root) {
28
30
  contentRight = props.contentRight,
29
31
  contentClearButton = props.contentClearButton,
30
32
  size = props.size,
33
+ className = props.className,
31
34
  onClear = props.onClear,
32
35
  onClick = props.onClick,
36
+ _props$pilled = props.pilled,
37
+ pilled = _props$pilled === void 0 ? false : _props$pilled,
33
38
  _props$readOnly = props.readOnly,
34
39
  readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
35
40
  _props$disabled = props.disabled,
36
41
  disabled = _props$disabled === void 0 ? false : _props$disabled,
37
42
  rest = _objectWithoutProperties(props, _excluded);
38
43
  var txt = !text && typeof children === 'string' ? children : text;
44
+ var pilledClass = pilled ? _Chip2.classes.pilled : undefined;
39
45
  var handleClick = function handleClick(event) {
40
46
  if (disabled || readOnly) {
41
47
  return;
@@ -52,9 +58,11 @@ var chipRoot = exports.chipRoot = function chipRoot(Root) {
52
58
  return /*#__PURE__*/_react["default"].createElement(Root, _extends({
53
59
  type: "button",
54
60
  ref: ref,
61
+ className: (0, _utils.cx)(pilledClass, className),
55
62
  tabIndex: readOnly ? -1 : 0,
56
63
  onClick: handleClick,
57
64
  disabled: disabled,
65
+ pilled: pilled,
58
66
  readOnly: !disabled && readOnly,
59
67
  size: size
60
68
  }, rest), contentLeft && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentRight, null, contentRight), ClearContent);
@@ -82,10 +90,14 @@ var chipConfig = exports.chipConfig = {
82
90
  },
83
91
  focused: {
84
92
  css: _base5.base
93
+ },
94
+ pilled: {
95
+ css: _base6.base,
96
+ attrs: true
85
97
  }
86
98
  },
87
99
  defaults: {
88
- view: 'primary',
100
+ view: 'default',
89
101
  size: 'm'
90
102
  }
91
103
  };
@@ -72,7 +72,7 @@ export function App() {
72
72
  Вид Chip задается с помощью свойства `view`. Возможные значения свойства `view`:
73
73
  + `"default"` – основная;
74
74
  + `"secondary"` – вторичная;
75
- + `"positive"` – успешное завершение;
75
+ + `"accent"` – акцентый.
76
76
 
77
77
  ```tsx live
78
78
  import React from 'react';
@@ -83,7 +83,7 @@ export function App() {
83
83
  <div>
84
84
  <Chip text="Chip" size="m" view="default" />
85
85
  <Chip text="Chip" size="m" view="secondary" />
86
- <Chip text="Chip" size="m" view="positive" />
86
+ <Chip text="Chip" size="m" view="accent" />
87
87
  </div>
88
88
  );
89
89
  }
@@ -3,7 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.tokens = void 0;
6
+ exports.tokens = exports.classes = void 0;
7
+ var classes = exports.classes = {
8
+ pilled: 'chip-pilled'
9
+ };
7
10
  var tokens = exports.tokens = {
8
11
  background: '--plasma-chip-background',
9
12
  color: '--plasma-chip-color',
@@ -21,6 +24,7 @@ var tokens = exports.tokens = {
21
24
  outlineSize: '--plasma-chip-outline-size',
22
25
  closeIconColor: '--plasma-chip-close-icon-color',
23
26
  borderRadius: '--plasma-chip-border-radius',
27
+ pilledBorderRadius: '--plasma-chip-pilled-border-radius',
24
28
  width: '--plasma-chip-width',
25
29
  height: '--plasma-chip-height',
26
30
  paddingTop: '--plasma-chip-padding-top',
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var _Chip = /*#__PURE__*/require("../../Chip.tokens");
9
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["&.", "{border-radius:var(", ");}"], /*#__PURE__*/String(_Chip.classes.pilled), _Chip.tokens.pilledBorderRadius);
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "boolean",
3
+ "tokens": ["--plasma-chip-pilled-border-radius"]
4
+ }
@@ -14,21 +14,24 @@ var config = exports.config = {
14
14
  },
15
15
  variations: {
16
16
  view: {
17
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-solid-default) 85% );", ":var(--inverse-text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-solid-default) 80% );", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover),
18
- secondary: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-transparent-secondary) 85% );", ":var(--text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-transparent-secondary) 80% );", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover),
19
- positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-positive) 85% );", ":var(--on-dark-text-primary);", ":color-mix(in srgb,var(--text-primary),var(--surface-positive) 85%);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover)
17
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover),
18
+ secondary: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover),
19
+ accent: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover)
20
20
  },
21
21
  size: {
22
- l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":auto;", ":3rem;", ":1rem;", ":1rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":-0.125rem;", ":0.5rem;", ":0.625rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1.5rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
23
- m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.625rem;", ":auto;", ":2.5rem;", ":0.875rem;", ":0.875rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":-0.125rem;", ":0.375rem;", ":0.5rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
24
- s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":auto;", ":2rem;", ":0.875rem;", ":0.875rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":-0.125rem;", ":0.25rem;", ":0.375rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
25
- xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":auto;", ":1.5rem;", ":0.625rem;", ":0.625rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.125rem;", ":0.25rem;", ":0.25rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize)
22
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":1.5rem;", ":auto;", ":3rem;", ":1rem;", ":1rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":-0.125rem;", ":0.5rem;", ":0.625rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1.5rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.pilledBorderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
23
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.625rem;", ":1.25rem;", ":auto;", ":2.5rem;", ":0.875rem;", ":0.875rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":-0.125rem;", ":0.375rem;", ":0.5rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.pilledBorderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
24
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1rem;", ":auto;", ":2rem;", ":0.875rem;", ":0.875rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":-0.125rem;", ":0.25rem;", ":0.375rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.pilledBorderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
25
+ xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":0.75rem;", ":auto;", ":1.5rem;", ":0.625rem;", ":0.625rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.125rem;", ":0.25rem;", ":0.25rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.pilledBorderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize)
26
26
  },
27
27
  disabled: {
28
28
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Chip.chipTokens.disabledOpacity)
29
29
  },
30
30
  focused: {
31
31
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-accent);"], _Chip.chipTokens.focusColor)
32
+ },
33
+ pilled: {
34
+ "true": /*#__PURE__*/(0, _styledComponents.css)([""])
32
35
  }
33
36
  }
34
37
  };
@@ -40,17 +40,33 @@ const TrashIcon = (props) => (
40
40
  export const Default: Story = {
41
41
  args: {
42
42
  text: 'Hello',
43
- view: 'primary',
43
+ view: 'default',
44
44
  size: 'm',
45
45
  disabled: false,
46
46
  focused: true,
47
+ pilled: false,
47
48
  onClear,
48
49
  },
49
50
  };
50
51
 
51
52
  export const WithIcon: Story = {
52
53
  args: { ...Default.args },
53
- render: (args) => <Chip contentLeft={<TrashIcon width="1.25rem" height="1.25rem" />} {...args} />,
54
+ render: (args) => {
55
+ const iconSizeMapper = {
56
+ l: '1.5rem',
57
+ m: '1.25rem',
58
+ s: '1rem',
59
+ xs: '0.75rem',
60
+ };
61
+ const iconSize = args.size || 'm';
62
+
63
+ return (
64
+ <Chip
65
+ contentLeft={<TrashIcon width={iconSizeMapper[iconSize]} height={iconSizeMapper[iconSize]} />}
66
+ {...args}
67
+ />
68
+ );
69
+ },
54
70
  };
55
71
 
56
72
  export const LongText: Story = {
@@ -26,6 +26,7 @@ const meta: Meta<typeof Divider> = {
26
26
  },
27
27
  table: { defaultValue: { summary: 'default' } },
28
28
  },
29
+ length: { control: 'text' },
29
30
  },
30
31
  };
31
32
 
@@ -70,16 +70,11 @@ type StoryPropsDefault = Omit<
70
70
  | 'chips'
71
71
  | 'onChangeChips'
72
72
  > & {
73
- 'storybook:contentLeft': boolean;
74
- 'storybook:contentRight': boolean;
73
+ enableContentLeft: boolean;
74
+ enableContentRight: boolean;
75
75
  };
76
76
 
77
- const StoryDemo = ({
78
- 'storybook:contentLeft': enableContentLeft,
79
- 'storybook:contentRight': enableContentRight,
80
- view,
81
- ...rest
82
- }: StoryPropsDefault) => {
77
+ const StoryDemo = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsDefault) => {
83
78
  const [text, setText] = useState('Значение поля');
84
79
 
85
80
  const iconSize = rest.size === 'xs' ? 'xs' : 's';
@@ -114,8 +109,8 @@ export const Default: StoryObj<StoryPropsDefault> = {
114
109
  leftHelper: 'Подсказка к полю',
115
110
  disabled: false,
116
111
  readOnly: false,
117
- 'storybook:contentLeft': true,
118
- 'storybook:contentRight': true,
112
+ enableContentLeft: true,
113
+ enableContentRight: true,
119
114
  },
120
115
  render: (args) => <StoryDemo {...args} />,
121
116
  };
@@ -139,16 +134,11 @@ type StoryPropsChips = Omit<
139
134
  | 'required'
140
135
  | 'enumerationType'
141
136
  > & {
142
- 'storybook:contentLeft': boolean;
143
- 'storybook:contentRight': boolean;
137
+ enableContentLeft: boolean;
138
+ enableContentRight: boolean;
144
139
  };
145
140
 
146
- const StoryChips = ({
147
- 'storybook:contentLeft': enableContentLeft,
148
- 'storybook:contentRight': enableContentRight,
149
- view,
150
- ...rest
151
- }: StoryPropsChips) => {
141
+ const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsChips) => {
152
142
  const [text, setText] = useState('Значение поля');
153
143
 
154
144
  const iconSize = rest.size === 'xs' ? 'xs' : 's';
@@ -185,6 +185,7 @@ export const Live: StoryObj<TooltipProps> = {
185
185
  control: {
186
186
  type: 'select',
187
187
  },
188
+ mapping: placements,
188
189
  },
189
190
  size: {
190
191
  options: ['m', 's'],
@@ -14,21 +14,24 @@ var config = exports.config = {
14
14
  },
15
15
  variations: {
16
16
  view: {
17
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-solid-default) 85% );", ":var(--inverse-text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-solid-default) 80% );", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover),
18
- secondary: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-transparent-secondary) 85% );", ":var(--text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-transparent-secondary) 80% );", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover),
19
- positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":color-mix( in srgb,var(--inverse-text-primary),var(--surface-positive) 85% );", ":var(--on-dark-text-primary);", ":color-mix(in srgb,var(--text-primary),var(--surface-positive) 85%);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover)
17
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover),
18
+ secondary: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover),
19
+ accent: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);"], _Chip.chipTokens.color, _Chip.chipTokens.background, _Chip.chipTokens.colorHover, _Chip.chipTokens.backgroundHover, _Chip.chipTokens.colorActive, _Chip.chipTokens.backgroundActive, _Chip.chipTokens.backgroundReadOnly, _Chip.chipTokens.colorReadOnly, _Chip.chipTokens.backgroundReadOnlyHover, _Chip.chipTokens.colorReadOnlyHover)
20
20
  },
21
21
  size: {
22
- l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":auto;", ":3rem;", ":1rem;", ":1rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":-0.125rem;", ":0.5rem;", ":0.625rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1.5rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
23
- m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.625rem;", ":auto;", ":2.5rem;", ":0.875rem;", ":0.875rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":-0.125rem;", ":0.375rem;", ":0.5rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
24
- s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":auto;", ":2rem;", ":0.875rem;", ":0.875rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":-0.125rem;", ":0.25rem;", ":0.375rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
25
- xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":auto;", ":1.5rem;", ":0.625rem;", ":0.625rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.125rem;", ":0.25rem;", ":0.25rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize)
22
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":1.5rem;", ":auto;", ":3rem;", ":1rem;", ":1rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":-0.125rem;", ":0.5rem;", ":0.625rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1.5rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.pilledBorderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
23
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.625rem;", ":1.25rem;", ":auto;", ":2.5rem;", ":0.875rem;", ":0.875rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":-0.125rem;", ":0.375rem;", ":0.5rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.pilledBorderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
24
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1rem;", ":auto;", ":2rem;", ":0.875rem;", ":0.875rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":-0.125rem;", ":0.25rem;", ":0.375rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.pilledBorderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize),
25
+ xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":0.75rem;", ":auto;", ":1.5rem;", ":0.625rem;", ":0.625rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":-0.125rem;", ":0.25rem;", ":0.25rem;", ":-0.25rem;", ":1.02;", ":0.98;", ":1rem;"], _Chip.chipTokens.borderRadius, _Chip.chipTokens.pilledBorderRadius, _Chip.chipTokens.width, _Chip.chipTokens.height, _Chip.chipTokens.paddingRight, _Chip.chipTokens.paddingLeft, _Chip.chipTokens.fontFamily, _Chip.chipTokens.fontSize, _Chip.chipTokens.fontStyle, _Chip.chipTokens.fontWeight, _Chip.chipTokens.letterSpacing, _Chip.chipTokens.lineHeight, _Chip.chipTokens.leftContentMarginLeft, _Chip.chipTokens.leftContentMarginRight, _Chip.chipTokens.clearContentMarginLeft, _Chip.chipTokens.clearContentMarginRight, _Chip.chipTokens.scaleHover, _Chip.chipTokens.scaleActive, _Chip.chipTokens.closeIconSize)
26
26
  },
27
27
  disabled: {
28
28
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Chip.chipTokens.disabledOpacity)
29
29
  },
30
30
  focused: {
31
31
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-accent);"], _Chip.chipTokens.focusColor)
32
+ },
33
+ pilled: {
34
+ "true": /*#__PURE__*/(0, _styledComponents.css)([""])
32
35
  }
33
36
  }
34
37
  };
@@ -40,17 +40,33 @@ const TrashIcon = (props) => (
40
40
  export const Default: Story = {
41
41
  args: {
42
42
  text: 'Hello',
43
- view: 'primary',
43
+ view: 'default',
44
44
  size: 'm',
45
45
  disabled: false,
46
46
  focused: true,
47
+ pilled: false,
47
48
  onClear,
48
49
  },
49
50
  };
50
51
 
51
52
  export const WithIcon: Story = {
52
53
  args: { ...Default.args },
53
- render: (args) => <Chip contentLeft={<TrashIcon width="1.25rem" height="1.25rem" />} {...args} />,
54
+ render: (args) => {
55
+ const iconSizeMapper = {
56
+ l: '1.5rem',
57
+ m: '1.25rem',
58
+ s: '1rem',
59
+ xs: '0.75rem',
60
+ };
61
+ const iconSize = args.size || 'm';
62
+
63
+ return (
64
+ <Chip
65
+ contentLeft={<TrashIcon width={iconSizeMapper[iconSize]} height={iconSizeMapper[iconSize]} />}
66
+ {...args}
67
+ />
68
+ );
69
+ },
54
70
  };
55
71
 
56
72
  export const LongText: Story = {
@@ -70,16 +70,11 @@ type StoryPropsDefault = Omit<
70
70
  | 'chips'
71
71
  | 'onChangeChips'
72
72
  > & {
73
- 'storybook:contentLeft': boolean;
74
- 'storybook:contentRight': boolean;
73
+ enableContentLeft: boolean;
74
+ enableContentRight: boolean;
75
75
  };
76
76
 
77
- const StoryDemo = ({
78
- 'storybook:contentLeft': enableContentLeft,
79
- 'storybook:contentRight': enableContentRight,
80
- view,
81
- ...rest
82
- }: StoryPropsDefault) => {
77
+ const StoryDemo = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsDefault) => {
83
78
  const [text, setText] = useState('Значение поля');
84
79
 
85
80
  const iconSize = rest.size === 'xs' ? 'xs' : 's';
@@ -114,8 +109,8 @@ export const Default: StoryObj<StoryPropsDefault> = {
114
109
  leftHelper: 'Подсказка к полю',
115
110
  disabled: false,
116
111
  readOnly: false,
117
- 'storybook:contentLeft': true,
118
- 'storybook:contentRight': true,
112
+ enableContentLeft: true,
113
+ enableContentRight: true,
119
114
  },
120
115
  render: (args) => <StoryDemo {...args} />,
121
116
  };
@@ -139,16 +134,11 @@ type StoryPropsChips = Omit<
139
134
  | 'required'
140
135
  | 'enumerationType'
141
136
  > & {
142
- 'storybook:contentLeft': boolean;
143
- 'storybook:contentRight': boolean;
137
+ enableContentLeft: boolean;
138
+ enableContentRight: boolean;
144
139
  };
145
140
 
146
- const StoryChips = ({
147
- 'storybook:contentLeft': enableContentLeft,
148
- 'storybook:contentRight': enableContentRight,
149
- view,
150
- ...rest
151
- }: StoryPropsChips) => {
141
+ const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsChips) => {
152
142
  const [text, setText] = useState('Значение поля');
153
143
 
154
144
  const iconSize = rest.size === 'xs' ? 'xs' : 's';
@@ -185,6 +185,7 @@ export const Live: StoryObj<TooltipProps> = {
185
185
  control: {
186
186
  type: 'select',
187
187
  },
188
+ mapping: placements,
188
189
  },
189
190
  size: {
190
191
  options: ['m', 's'],
@@ -70,16 +70,11 @@ type StoryPropsDefault = Omit<
70
70
  | 'chips'
71
71
  | 'onChangeChips'
72
72
  > & {
73
- 'storybook:contentLeft': boolean;
74
- 'storybook:contentRight': boolean;
73
+ enableContentLeft: boolean;
74
+ enableContentRight: boolean;
75
75
  };
76
76
 
77
- const StoryDemo = ({
78
- 'storybook:contentLeft': enableContentLeft,
79
- 'storybook:contentRight': enableContentRight,
80
- view,
81
- ...rest
82
- }: StoryPropsDefault) => {
77
+ const StoryDemo = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsDefault) => {
83
78
  const [text, setText] = useState('Значение поля');
84
79
 
85
80
  const iconSize = rest.size === 'xs' ? 'xs' : 's';
@@ -114,8 +109,8 @@ export const Default: StoryObj<StoryPropsDefault> = {
114
109
  leftHelper: 'Подсказка к полю',
115
110
  disabled: false,
116
111
  readOnly: false,
117
- 'storybook:contentLeft': true,
118
- 'storybook:contentRight': true,
112
+ enableContentLeft: true,
113
+ enableContentRight: true,
119
114
  },
120
115
  render: (args) => <StoryDemo {...args} />,
121
116
  };
@@ -139,16 +134,11 @@ type StoryPropsChips = Omit<
139
134
  | 'required'
140
135
  | 'enumerationType'
141
136
  > & {
142
- 'storybook:contentLeft': boolean;
143
- 'storybook:contentRight': boolean;
137
+ enableContentLeft: boolean;
138
+ enableContentRight: boolean;
144
139
  };
145
140
 
146
- const StoryChips = ({
147
- 'storybook:contentLeft': enableContentLeft,
148
- 'storybook:contentRight': enableContentRight,
149
- view,
150
- ...rest
151
- }: StoryPropsChips) => {
141
+ const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsChips) => {
152
142
  const [text, setText] = useState('Значение поля');
153
143
 
154
144
  const iconSize = rest.size === 'xs' ? 'xs' : 's';
@@ -185,6 +185,7 @@ export const Live: StoryObj<TooltipProps> = {
185
185
  control: {
186
186
  type: 'select',
187
187
  },
188
+ mapping: placements,
188
189
  },
189
190
  size: {
190
191
  options: ['m', 's'],
@@ -1,16 +1,18 @@
1
- var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "onClear", "onClick", "readOnly", "disabled"];
1
+ var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "className", "onClear", "onClick", "pilled", "readOnly", "disabled"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef, useMemo } from 'react';
6
6
  import { IconClose } from '../_Icon/Icons/IconClose';
7
+ import { cx } from '../../utils';
7
8
  import { base as viewCSS } from './variations/_view/base';
8
9
  import { base as sizeCSS } from './variations/_size/base';
9
10
  import { base as disabledCSS } from './variations/_disabled/base';
10
11
  import { base as readonlyCSS } from './variations/_readonly/base';
11
12
  import { base as focusedCSS } from './variations/_focused/base';
13
+ import { base as pilledCSS } from './variations/_pilled/base';
12
14
  import { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';
13
- import { tokens } from './Chip.tokens';
15
+ import { classes, tokens } from './Chip.tokens';
14
16
  export var chipRoot = function chipRoot(Root) {
15
17
  return /*#__PURE__*/forwardRef(function (props, ref) {
16
18
  var children = props.children,
@@ -19,14 +21,18 @@ export var chipRoot = function chipRoot(Root) {
19
21
  contentRight = props.contentRight,
20
22
  contentClearButton = props.contentClearButton,
21
23
  size = props.size,
24
+ className = props.className,
22
25
  onClear = props.onClear,
23
26
  onClick = props.onClick,
27
+ _props$pilled = props.pilled,
28
+ pilled = _props$pilled === void 0 ? false : _props$pilled,
24
29
  _props$readOnly = props.readOnly,
25
30
  readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
26
31
  _props$disabled = props.disabled,
27
32
  disabled = _props$disabled === void 0 ? false : _props$disabled,
28
33
  rest = _objectWithoutProperties(props, _excluded);
29
34
  var txt = !text && typeof children === 'string' ? children : text;
35
+ var pilledClass = pilled ? classes.pilled : undefined;
30
36
  var handleClick = function handleClick(event) {
31
37
  if (disabled || readOnly) {
32
38
  return;
@@ -43,9 +49,11 @@ export var chipRoot = function chipRoot(Root) {
43
49
  return /*#__PURE__*/React.createElement(Root, _extends({
44
50
  type: "button",
45
51
  ref: ref,
52
+ className: cx(pilledClass, className),
46
53
  tabIndex: readOnly ? -1 : 0,
47
54
  onClick: handleClick,
48
55
  disabled: disabled,
56
+ pilled: pilled,
49
57
  readOnly: !disabled && readOnly,
50
58
  size: size
51
59
  }, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), ClearContent);
@@ -73,10 +81,14 @@ export var chipConfig = {
73
81
  },
74
82
  focused: {
75
83
  css: focusedCSS
84
+ },
85
+ pilled: {
86
+ css: pilledCSS,
87
+ attrs: true
76
88
  }
77
89
  },
78
90
  defaults: {
79
- view: 'primary',
91
+ view: 'default',
80
92
  size: 'm'
81
93
  }
82
94
  };