@salutejs/plasma-new-hope 0.195.0-canary.1572.11914481185.0 → 0.195.0-dev.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. package/cjs/components/Badge/Badge.css +4 -4
  2. package/cjs/components/Badge/Badge.js +17 -7
  3. package/cjs/components/Badge/Badge.js.map +1 -1
  4. package/cjs/components/Badge/Badge.tokens.js +10 -5
  5. package/cjs/components/Badge/Badge.tokens.js.map +1 -1
  6. package/cjs/components/Badge/variations/_clear/base.js +1 -1
  7. package/cjs/components/Badge/variations/_clear/base.js.map +1 -1
  8. package/cjs/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  9. package/cjs/components/Badge/variations/_size/base.js +1 -1
  10. package/cjs/components/Badge/variations/_size/base.js.map +1 -1
  11. package/{es/components/Badge/variations/_size/base_to0y5x.css → cjs/components/Badge/variations/_size/base_bu5opk.css} +1 -1
  12. package/cjs/components/Badge/variations/_transparent/base.js +1 -1
  13. package/cjs/components/Badge/variations/_transparent/base.js.map +1 -1
  14. package/cjs/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  15. package/cjs/components/Badge/variations/_view/base.js +1 -1
  16. package/cjs/components/Badge/variations/_view/base.js.map +1 -1
  17. package/cjs/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  18. package/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  19. package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  20. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  21. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  22. package/cjs/components/Calendar/store/reducer.js +2 -2
  23. package/cjs/components/Calendar/store/reducer.js.map +1 -1
  24. package/cjs/components/Combobox/ComboboxNew/Combobox.js +18 -4
  25. package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  26. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
  27. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
  28. package/cjs/components/Combobox/ComboboxOld/Combobox.css +5 -4
  29. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +5 -4
  30. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +5 -4
  31. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +5 -4
  32. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +5 -4
  33. package/cjs/components/Dropdown/Dropdown.css +5 -4
  34. package/cjs/components/Dropdown/Dropdown.js +4 -2
  35. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  36. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +5 -4
  37. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -2
  38. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  39. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +7 -1
  40. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  41. package/cjs/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_1b439rx.css → DropdownItem.styles_14yih1y.css} +1 -0
  42. package/cjs/components/Select/Select.js +0 -1
  43. package/cjs/components/Select/Select.js.map +1 -1
  44. package/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -2
  45. package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
  46. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +18 -3
  47. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
  48. package/cjs/index.css +9 -8
  49. package/emotion/cjs/components/Badge/Badge.js +17 -7
  50. package/emotion/cjs/components/Badge/Badge.template-doc.mdx +40 -16
  51. package/emotion/cjs/components/Badge/Badge.tokens.js +10 -6
  52. package/emotion/cjs/components/Badge/variations/_clear/base.js +1 -1
  53. package/emotion/cjs/components/Badge/variations/_size/base.js +2 -1
  54. package/emotion/cjs/components/Badge/variations/_transparent/base.js +1 -1
  55. package/emotion/cjs/components/Badge/variations/_view/base.js +1 -1
  56. package/emotion/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  57. package/emotion/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  58. package/emotion/cjs/components/Calendar/store/reducer.js +2 -2
  59. package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -4
  60. package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
  61. package/emotion/cjs/components/Dropdown/Dropdown.js +4 -2
  62. package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -2
  63. package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +15 -11
  64. package/emotion/cjs/components/Select/Select.js +0 -1
  65. package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -2
  66. package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
  67. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
  68. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  69. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  70. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  71. package/emotion/es/components/Badge/Badge.js +18 -8
  72. package/emotion/es/components/Badge/Badge.template-doc.mdx +40 -16
  73. package/emotion/es/components/Badge/Badge.tokens.js +9 -5
  74. package/emotion/es/components/Badge/variations/_clear/base.js +2 -2
  75. package/emotion/es/components/Badge/variations/_size/base.js +3 -2
  76. package/emotion/es/components/Badge/variations/_transparent/base.js +2 -2
  77. package/emotion/es/components/Badge/variations/_view/base.js +2 -2
  78. package/emotion/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  79. package/emotion/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  80. package/emotion/es/components/Calendar/store/reducer.js +2 -2
  81. package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +22 -4
  82. package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
  83. package/emotion/es/components/Dropdown/Dropdown.js +4 -2
  84. package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -3
  85. package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +15 -11
  86. package/emotion/es/components/Select/Select.js +0 -1
  87. package/emotion/es/components/Select/ui/Inner/ui/Item/Item.js +1 -2
  88. package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
  89. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
  90. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  91. package/emotion/es/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  92. package/emotion/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  93. package/es/components/Badge/Badge.css +4 -4
  94. package/es/components/Badge/Badge.js +20 -10
  95. package/es/components/Badge/Badge.js.map +1 -1
  96. package/es/components/Badge/Badge.tokens.js +10 -6
  97. package/es/components/Badge/Badge.tokens.js.map +1 -1
  98. package/es/components/Badge/variations/_clear/base.js +1 -1
  99. package/es/components/Badge/variations/_clear/base.js.map +1 -1
  100. package/es/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  101. package/es/components/Badge/variations/_size/base.js +1 -1
  102. package/es/components/Badge/variations/_size/base.js.map +1 -1
  103. package/{cjs/components/Badge/variations/_size/base_to0y5x.css → es/components/Badge/variations/_size/base_bu5opk.css} +1 -1
  104. package/es/components/Badge/variations/_transparent/base.js +1 -1
  105. package/es/components/Badge/variations/_transparent/base.js.map +1 -1
  106. package/es/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  107. package/es/components/Badge/variations/_view/base.js +1 -1
  108. package/es/components/Badge/variations/_view/base.js.map +1 -1
  109. package/es/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  110. package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  111. package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  112. package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  113. package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  114. package/es/components/Calendar/store/reducer.js +2 -2
  115. package/es/components/Calendar/store/reducer.js.map +1 -1
  116. package/es/components/Combobox/ComboboxNew/Combobox.js +19 -5
  117. package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  118. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
  119. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
  120. package/es/components/Combobox/ComboboxOld/Combobox.css +5 -4
  121. package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +5 -4
  122. package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +5 -4
  123. package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +5 -4
  124. package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +5 -4
  125. package/es/components/Dropdown/Dropdown.css +5 -4
  126. package/es/components/Dropdown/Dropdown.js +4 -2
  127. package/es/components/Dropdown/Dropdown.js.map +1 -1
  128. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +5 -4
  129. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -3
  130. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  131. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +7 -2
  132. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  133. package/es/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_1b439rx.css → DropdownItem.styles_14yih1y.css} +1 -0
  134. package/es/components/Select/Select.js +0 -1
  135. package/es/components/Select/Select.js.map +1 -1
  136. package/es/components/Select/ui/Inner/ui/Item/Item.js +1 -2
  137. package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
  138. package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +19 -4
  139. package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
  140. package/es/index.css +9 -8
  141. package/package.json +3 -2
  142. package/styled-components/cjs/components/Badge/Badge.js +17 -7
  143. package/styled-components/cjs/components/Badge/Badge.template-doc.mdx +40 -16
  144. package/styled-components/cjs/components/Badge/Badge.tokens.js +10 -6
  145. package/styled-components/cjs/components/Badge/variations/_clear/base.js +1 -1
  146. package/styled-components/cjs/components/Badge/variations/_size/base.js +2 -1
  147. package/styled-components/cjs/components/Badge/variations/_transparent/base.js +1 -1
  148. package/styled-components/cjs/components/Badge/variations/_view/base.js +1 -1
  149. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  150. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  151. package/styled-components/cjs/components/Calendar/store/reducer.js +2 -2
  152. package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -4
  153. package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
  154. package/styled-components/cjs/components/Dropdown/Dropdown.js +4 -2
  155. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -2
  156. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -2
  157. package/styled-components/cjs/components/Select/Select.js +0 -1
  158. package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -2
  159. package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
  160. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  161. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  162. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  163. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  164. package/styled-components/es/components/Badge/Badge.js +18 -8
  165. package/styled-components/es/components/Badge/Badge.template-doc.mdx +40 -16
  166. package/styled-components/es/components/Badge/Badge.tokens.js +9 -5
  167. package/styled-components/es/components/Badge/variations/_clear/base.js +2 -2
  168. package/styled-components/es/components/Badge/variations/_size/base.js +3 -2
  169. package/styled-components/es/components/Badge/variations/_transparent/base.js +2 -2
  170. package/styled-components/es/components/Badge/variations/_view/base.js +2 -2
  171. package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  172. package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  173. package/styled-components/es/components/Calendar/store/reducer.js +2 -2
  174. package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +22 -4
  175. package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
  176. package/styled-components/es/components/Dropdown/Dropdown.js +4 -2
  177. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -3
  178. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -2
  179. package/styled-components/es/components/Select/Select.js +0 -1
  180. package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.js +1 -2
  181. package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +24 -3
  182. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  183. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  184. package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  185. package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  186. package/types/components/Badge/Badge.d.ts.map +1 -1
  187. package/types/components/Badge/Badge.tokens.d.ts +8 -4
  188. package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
  189. package/types/components/Badge/Badge.types.d.ts +18 -5
  190. package/types/components/Badge/Badge.types.d.ts.map +1 -1
  191. package/types/components/Badge/variations/_clear/base.d.ts.map +1 -1
  192. package/types/components/Badge/variations/_size/base.d.ts.map +1 -1
  193. package/types/components/Calendar/store/reducer.d.ts +1 -1
  194. package/types/components/Calendar/store/reducer.d.ts.map +1 -1
  195. package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
  196. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +1 -2
  197. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
  198. package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.d.ts.map +1 -1
  199. package/types/components/Dropdown/Dropdown.d.ts +50 -2
  200. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  201. package/types/components/Dropdown/Dropdown.types.d.ts +11 -6
  202. package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  203. package/types/components/Dropdown/index.d.ts +1 -0
  204. package/types/components/Dropdown/index.d.ts.map +1 -1
  205. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
  206. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +1 -0
  207. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
  208. package/types/components/Select/Select.d.ts.map +1 -1
  209. package/types/components/Select/Select.types.d.ts +1 -2
  210. package/types/components/Select/Select.types.d.ts.map +1 -1
  211. package/types/components/Select/ui/Inner/ui/Item/Item.d.ts.map +1 -1
  212. package/types/components/Select/ui/Target/ui/Textfield/Textfield.d.ts.map +1 -1
  213. package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
  214. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +61 -4
  215. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
  216. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +25 -1
  217. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -1
  218. package/types/examples/plasma_web/components/Badge/Badge.config.d.ts.map +1 -1
  219. package/types/examples/plasma_web/components/Badge/Badge.d.ts +61 -4
  220. package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
  221. package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts +25 -1
  222. package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts.map +1 -1
  223. package/cjs/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  224. package/cjs/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  225. package/cjs/components/Badge/variations/_view/base_qlxank.css +0 -1
  226. package/es/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  227. package/es/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  228. package/es/components/Badge/variations/_view/base_qlxank.css +0 -1
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.base = void 0;
7
7
  var _styledComponents = /*#__PURE__*/require("styled-components");
8
8
  var _Badge = /*#__PURE__*/require("../../Badge.tokens");
9
- var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["color:var(", ");background-color:var(", ");"], _Badge.tokens.color, _Badge.tokens.background);
9
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["color:var(", ",var(", "));background-color:var(", ",var(", "));"], _Badge.privateTokens.customColor, _Badge.tokens.color, _Badge.privateTokens.customBackground, _Badge.tokens.background);
@@ -72,7 +72,7 @@ var calendarBaseRoot = exports.calendarBaseRoot = function calendarBaseRoot(Root
72
72
  _useState8 = _slicedToArray(_useState7, 2),
73
73
  outOfRangeKey = _useState8[0],
74
74
  setOutOfRangeKey = _useState8[1];
75
- var _useReducer = (0, _react.useReducer)(_reducer.reducer, (0, _reducer.getInitialState)(value, min, type)),
75
+ var _useReducer = (0, _react.useReducer)(_reducer.reducer, (0, _reducer.getInitialState)(value, type)),
76
76
  _useReducer2 = _slicedToArray(_useReducer, 2),
77
77
  state = _useReducer2[0],
78
78
  dispatch = _useReducer2[1];
@@ -73,7 +73,7 @@ var calendarDoubleRoot = exports.calendarDoubleRoot = function calendarDoubleRoo
73
73
  _useState8 = _slicedToArray(_useState7, 2),
74
74
  outOfRangeKey = _useState8[0],
75
75
  setOutOfRangeKey = _useState8[1];
76
- var _useReducer = (0, _react.useReducer)(_reducer.reducer, (0, _reducer.getInitialState)(value, min, type, true)),
76
+ var _useReducer = (0, _react.useReducer)(_reducer.reducer, (0, _reducer.getInitialState)(value, type, true)),
77
77
  _useReducer2 = _slicedToArray(_useReducer, 2),
78
78
  state = _useReducer2[0],
79
79
  dispatch = _useReducer2[1];
@@ -36,8 +36,8 @@ var sizeMap = exports.sizeMap = {
36
36
  "double": [3, 1]
37
37
  }
38
38
  };
39
- var getInitialState = exports.getInitialState = function getInitialState(value, min, calendarState, isDouble) {
40
- var initDate = value || min || new Date();
39
+ var getInitialState = exports.getInitialState = function getInitialState(value, calendarState, isDouble) {
40
+ var initDate = value || new Date();
41
41
  var date = (0, _utils.getDateFromValue)(initDate);
42
42
  var resSize = isDouble ? sizeMap[calendarState]["double"] : sizeMap[calendarState].single;
43
43
  return {
@@ -24,6 +24,10 @@ var _excluded = ["multiple", "value", "onChange", "isTargetAmount", "targetAmoun
24
24
  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); }
25
25
  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 && {}.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; }
26
26
  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); }
27
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
28
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
30
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
27
31
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
28
32
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
33
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -186,9 +190,24 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
186
190
 
187
191
  // Обработчик чипов
188
192
  var handleChipsChange = function handleChipsChange(chipLabels) {
189
- onChange(chipLabels.map(function (chipLabel) {
190
- return labelToItemMap.get(chipLabel).value;
191
- }));
193
+ if (!Array.isArray(value)) return;
194
+
195
+ // TODO: #1564
196
+ // Из лейблов чипов получаем value у item и далее прокидываем его в onChange.
197
+ if (renderValue && !isTargetAmount) {
198
+ var resultValues = _toConsumableArray(value);
199
+ value.forEach(function (_, index) {
200
+ var labelAfterRenderValue = renderValue(labelToItemMap.get(valueToItemMap.get(value[index]).label));
201
+ if (!chipLabels.includes(labelAfterRenderValue)) {
202
+ resultValues.splice(index, 1);
203
+ }
204
+ });
205
+ onChange(resultValues);
206
+ } else {
207
+ onChange(chipLabels.map(function (chipLabel) {
208
+ return labelToItemMap.get(chipLabel).value;
209
+ }));
210
+ }
192
211
  };
193
212
 
194
213
  // Обработчик открытия/закрытия выпадающего списка
@@ -357,7 +376,6 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
357
376
  handleItemClick: handleItemClick,
358
377
  variant: variant,
359
378
  renderItem: renderItem,
360
- valueToItemMap: valueToItemMap,
361
379
  treeId: treeId
362
380
  }
363
381
  }, /*#__PURE__*/_react["default"].createElement(_FloatingPopover.FloatingPopover, {
@@ -40,7 +40,6 @@ var Item = exports.Item = function Item(_ref) {
40
40
  handleItemClick = _useContext.handleItemClick,
41
41
  variant = _useContext.variant,
42
42
  renderItem = _useContext.renderItem,
43
- valueToItemMap = _useContext.valueToItemMap,
44
43
  treeId = _useContext.treeId;
45
44
  var disabledClassName = disabled ? _Combobox.classes.dropdownItemIsDisabled : undefined;
46
45
  var focusedClass = currentLevel === focusedPath.length - 1 && index === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? _Combobox.classes.dropdownItemIsFocused : undefined;
@@ -94,7 +93,7 @@ var Item = exports.Item = function Item(_ref) {
94
93
  }))), !multiple && checked.get(item.value) === 'done' && /*#__PURE__*/_react["default"].createElement(_Icon.IconDone, {
95
94
  size: (0, _utils.sizeToIconSize)(size, variant),
96
95
  color: "inherit"
97
- })), renderItem ? /*#__PURE__*/_react["default"].createElement(_Item.StyledText, null, renderItem(valueToItemMap.get(value))) : /*#__PURE__*/_react["default"].createElement(_Item.StyledWrapper, null, /*#__PURE__*/_react["default"].createElement(_Item.StyledCell, {
96
+ })), renderItem ? /*#__PURE__*/_react["default"].createElement(_Item.StyledText, null, renderItem(item)) : /*#__PURE__*/_react["default"].createElement(_Item.StyledWrapper, null, /*#__PURE__*/_react["default"].createElement(_Item.StyledCell, {
98
97
  view: "default",
99
98
  size: "l",
100
99
  contentLeft: contentLeft,
@@ -20,7 +20,7 @@ var _Dropdown2 = /*#__PURE__*/require("./Dropdown.tokens");
20
20
  var _useKeyboardNavigation = /*#__PURE__*/require("./hooks/useKeyboardNavigation");
21
21
  var _useHashMaps3 = /*#__PURE__*/require("./hooks/useHashMaps");
22
22
  var _FloatingPopover = /*#__PURE__*/require("./FloatingPopover");
23
- var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow", "alwaysOpened", "portal"];
23
+ var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow", "alwaysOpened", "portal", "renderItem"];
24
24
  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); }
25
25
  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 && {}.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; }
26
26
  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); }
@@ -69,6 +69,7 @@ var dropdownRoot = exports.dropdownRoot = function dropdownRoot(Root) {
69
69
  _ref$alwaysOpened = _ref.alwaysOpened,
70
70
  alwaysOpened = _ref$alwaysOpened === void 0 ? false : _ref$alwaysOpened,
71
71
  portal = _ref.portal,
72
+ renderItem = _ref.renderItem,
72
73
  rest = _objectWithoutProperties(_ref, _excluded);
73
74
  var _useReducer = (0, _react.useReducer)(_pathReducer.pathReducer, []),
74
75
  _useReducer2 = _slicedToArray(_useReducer, 2),
@@ -144,7 +145,8 @@ var dropdownRoot = exports.dropdownRoot = function dropdownRoot(Root) {
144
145
  onItemClick: onItemClick,
145
146
  onItemSelect: onItemSelect,
146
147
  hasArrow: hasArrow,
147
- treeId: treeId
148
+ treeId: treeId,
149
+ renderItem: renderItem
148
150
  }
149
151
  }, /*#__PURE__*/_react["default"].createElement(_FloatingPopover.FloatingPopover, {
150
152
  ref: floatingPopoverRef,
@@ -43,7 +43,8 @@ var DropdownItem = exports.DropdownItem = function DropdownItem(_ref) {
43
43
  onItemSelect = _useContext.onItemSelect,
44
44
  onItemClick = _useContext.onItemClick,
45
45
  hasArrow = _useContext.hasArrow,
46
- treeId = _useContext.treeId;
46
+ treeId = _useContext.treeId,
47
+ renderItem = _useContext.renderItem;
47
48
  var hasDescendants = Boolean(item.items);
48
49
  var disclosureIconSize = size === 'xs' ? 'xs' : 's';
49
50
  var isDisabledClassName = disabled || isDisabled ? _Dropdown.classes.dropdownItemIsDisabled : undefined;
@@ -94,7 +95,7 @@ var DropdownItem = exports.DropdownItem = function DropdownItem(_ref) {
94
95
  "aria-expanded": ariaExpanded,
95
96
  "aria-level": ariaLevel,
96
97
  "aria-label": ariaLabel
97
- }, /*#__PURE__*/_react["default"].createElement(_DropdownItem.CellWrapper, null, /*#__PURE__*/_react["default"].createElement(_DropdownItem.StyledCell, {
98
+ }, renderItem ? /*#__PURE__*/_react["default"].createElement(_DropdownItem.RenderItemWrapper, null, renderItem(item)) : /*#__PURE__*/_react["default"].createElement(_DropdownItem.CellWrapper, null, /*#__PURE__*/_react["default"].createElement(_DropdownItem.StyledCell, {
98
99
  contentLeft: contentLeft,
99
100
  contentRight: contentRight,
100
101
  alignContentLeft: "center",
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Wrapper = exports.StyledCell = exports.Divider = exports.DisclosureIconWrapper = exports.CellWrapper = void 0;
6
+ exports.Wrapper = exports.StyledCell = exports.RenderItemWrapper = exports.Divider = exports.DisclosureIconWrapper = exports.CellWrapper = void 0;
7
7
  var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
8
8
  var _Dropdown = /*#__PURE__*/require("../../Dropdown.tokens");
9
9
  var _mixins = /*#__PURE__*/require("../../../../mixins");
@@ -42,4 +42,7 @@ var Wrapper = exports.Wrapper = /*#__PURE__*/_styledComponents["default"].li.wit
42
42
  outlineRadius: /*#__PURE__*/"var(".concat(_Dropdown.tokens.itemBorderRadius, ")"),
43
43
  hasTransition: false,
44
44
  customFocusRules: /*#__PURE__*/"\n &.".concat(_Dropdown.classes.dropdownItemIsFocused, ":before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(").concat(_Dropdown.constants.focusColor, ");\n }\n ")
45
- }));
45
+ }));
46
+ var RenderItemWrapper = exports.RenderItemWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
47
+ componentId: "plasma-new-hope__sc-hs0ek1-5"
48
+ })(["", ";flex:1;"], /*#__PURE__*/(0, _mixins.applyEllipsis)());
@@ -281,7 +281,6 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
281
281
  handleItemClick: handleItemClick,
282
282
  variant: variant,
283
283
  renderItem: renderItem,
284
- valueToItemMap: valueToItemMap,
285
284
  treeId: treeId
286
285
  }
287
286
  }, /*#__PURE__*/_react["default"].createElement(_FloatingPopover.FloatingPopover, {
@@ -41,7 +41,6 @@ var Item = exports.Item = function Item(_ref) {
41
41
  handleItemClick = _useContext.handleItemClick,
42
42
  variant = _useContext.variant,
43
43
  renderItem = _useContext.renderItem,
44
- valueToItemMap = _useContext.valueToItemMap,
45
44
  treeId = _useContext.treeId;
46
45
  var itemDisabled = Boolean(disabled || isDisabled);
47
46
  var disabledClassName = itemDisabled ? _Select.classes.dropdownItemIsDisabled : undefined;
@@ -96,7 +95,7 @@ var Item = exports.Item = function Item(_ref) {
96
95
  }))), !multiselect && checked.get(item.value) === 'done' && /*#__PURE__*/_react["default"].createElement(_Icon.IconDone, {
97
96
  size: (0, _utils.sizeToIconSize)(size, variant),
98
97
  color: "inherit"
99
- })), renderItem ? /*#__PURE__*/_react["default"].createElement(_Item.StyledText, null, renderItem(valueToItemMap.get(value))) : /*#__PURE__*/_react["default"].createElement(_Item.StyledWrapper, null, /*#__PURE__*/_react["default"].createElement(_Item.StyledCell, {
98
+ })), renderItem ? /*#__PURE__*/_react["default"].createElement(_Item.StyledText, null, renderItem(item)) : /*#__PURE__*/_react["default"].createElement(_Item.StyledWrapper, null, /*#__PURE__*/_react["default"].createElement(_Item.StyledCell, {
100
99
  contentLeft: contentLeft,
101
100
  contentRight: contentRight
102
101
  // TODO: #1548
@@ -12,6 +12,12 @@ var _Textfield = /*#__PURE__*/require("./Textfield.styles");
12
12
  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); }
13
13
  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 && {}.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; }
14
14
  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); }
15
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
16
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
19
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
20
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
21
  var Textfield = exports.Textfield = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
16
22
  var _valueToItemMap$get;
17
23
  var inputWrapperRef = _ref.inputWrapperRef,
@@ -56,9 +62,24 @@ var Textfield = exports.Textfield = /*#__PURE__*/(0, _react.forwardRef)(function
56
62
 
57
63
  // Обработчик чипов
58
64
  var handleChipsChange = function handleChipsChange(chipLabels) {
59
- onChange(chipLabels.map(function (chipLabel) {
60
- return labelToItemMap.get(chipLabel).value;
61
- }));
65
+ if (!Array.isArray(value)) return;
66
+
67
+ // TODO: #1564
68
+ // Из лейблов чипов получаем value у item и далее прокидываем его в onChange.
69
+ if (renderValue && !isTargetAmount) {
70
+ var resultValues = _toConsumableArray(value);
71
+ value.forEach(function (_, index) {
72
+ var labelAfterRenderValue = renderValue(labelToItemMap.get(valueToItemMap.get(value[index]).label));
73
+ if (!chipLabels.includes(labelAfterRenderValue)) {
74
+ resultValues.splice(index, 1);
75
+ }
76
+ });
77
+ onChange(resultValues);
78
+ } else {
79
+ onChange(chipLabels.map(function (chipLabel) {
80
+ return labelToItemMap.get(chipLabel).value;
81
+ }));
82
+ }
62
83
  };
63
84
  return /*#__PURE__*/_react["default"].createElement(_Textfield.StyledTextField, _extends({
64
85
  ref: ref,
@@ -22,10 +22,10 @@ var config = exports.config = {
22
22
  light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-dark-surface-transparent-card);", ":var(--on-dark-text-primary);"], _Badge.badgeTokens.color, _Badge.badgeTokens.background, _Badge.badgeTokens.colorTransparent, _Badge.badgeTokens.backgroundTransparent, _Badge.badgeTokens.colorClear)
23
23
  },
24
24
  size: {
25
- l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1.75rem;", ":0.6875rem;", ":0.6875rem;", ":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.0625rem;", ":0.25rem;", ":0.25rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.paddingRight, _Badge.badgeTokens.paddingLeft, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
26
- m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.5rem;", ":0.5625rem;", ":0.5625rem;", ":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.0625rem;", ":0.1875rem;", ":0.1875rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.paddingRight, _Badge.badgeTokens.paddingLeft, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
27
- s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.25rem;", ":0.4375rem;", ":0.4375rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.paddingRight, _Badge.badgeTokens.paddingLeft, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
28
- xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.25rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.paddingRight, _Badge.badgeTokens.paddingLeft, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight)
25
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1.75rem;", ":0 0.6875rem;", ":0 0.375rem;", ":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.0625rem;", ":0.25rem;", ":0.25rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
26
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.5rem;", ":0 0.5625rem;", ":0 0.375rem;", ":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.0625rem;", ":0.1875rem;", ":0.1875rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
27
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.25rem;", ":0 0.4375rem;", ":0 0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
28
+ xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.25rem;", ":1rem;", ":0 0.25rem;", ":0 0.188rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight)
29
29
  },
30
30
  pilled: {
31
31
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":1.25rem;"], _Badge.badgeTokens.pilledBorderRadius)
@@ -34,7 +34,7 @@ var config = exports.config = {
34
34
  "true": /*#__PURE__*/(0, _styledComponents.css)([""])
35
35
  },
36
36
  clear: {
37
- "true": /*#__PURE__*/(0, _styledComponents.css)([""])
37
+ "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-clear);"], _Badge.badgeTokens.backgroundClear)
38
38
  },
39
39
  truncate: {
40
40
  "true": /*#__PURE__*/(0, _styledComponents.css)([""])
@@ -34,6 +34,10 @@ const meta: Meta<typeof Badge> = {
34
34
  maxWidth: {
35
35
  control: { type: 'text' },
36
36
  },
37
+ text: {
38
+ control: { type: 'text' },
39
+ if: { arg: 'enableText', truthy: true },
40
+ },
37
41
  ...disableProps(['contentLeft', 'contentRight']),
38
42
  },
39
43
  };
@@ -43,6 +47,7 @@ export default meta;
43
47
  type StoryProps = ComponentProps<typeof Badge> & {
44
48
  enableContentLeft: boolean;
45
49
  enableContentRight: boolean;
50
+ enableText: boolean;
46
51
  };
47
52
  type Story = StoryObj<StoryProps>;
48
53
 
@@ -63,13 +68,14 @@ export const Default: Story = {
63
68
  },
64
69
  enableContentRight: {
65
70
  control: { type: 'boolean' },
66
- if: { arg: 'enableContentLeft', truthy: false },
71
+ if: { arg: 'enableText', truthy: true },
67
72
  },
68
73
  },
69
74
  args: {
70
- text: 'Hello Kitty',
71
75
  view: 'default',
72
76
  size: 'm',
77
+ enableText: true,
78
+ text: 'Hello',
73
79
  enableContentLeft: false,
74
80
  enableContentRight: false,
75
81
  clear: false,
@@ -77,13 +83,24 @@ export const Default: Story = {
77
83
  transparent: false,
78
84
  maxWidth: '',
79
85
  },
80
- render: ({ enableContentLeft, enableContentRight, size, ...rest }: StoryProps) => {
81
- const iconSize = size === 'l' ? '1rem' : '0.75rem';
86
+ render: ({ enableContentLeft, enableContentRight, enableText, size, ...rest }: StoryProps) => {
87
+ const iconSize = () => {
88
+ switch (size) {
89
+ case 'l':
90
+ return '1rem';
91
+ case 'xs':
92
+ return '0.625rem';
93
+ default:
94
+ return '0.75rem';
95
+ }
96
+ };
82
97
 
83
98
  return (
84
99
  <Badge
85
- contentLeft={enableContentLeft ? <BellIcon width={iconSize} height={iconSize} /> : undefined}
86
- contentRight={enableContentRight ? <BellIcon width={iconSize} height={iconSize} /> : undefined}
100
+ contentLeft={
101
+ enableContentLeft || !enableText ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined
102
+ }
103
+ contentRight={enableContentRight ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined}
87
104
  size={size}
88
105
  {...rest}
89
106
  />
@@ -22,10 +22,10 @@ var config = exports.config = {
22
22
  light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-dark-surface-transparent-card);", ":var(--on-dark-text-primary);"], _Badge.badgeTokens.color, _Badge.badgeTokens.background, _Badge.badgeTokens.colorTransparent, _Badge.badgeTokens.backgroundTransparent, _Badge.badgeTokens.colorClear)
23
23
  },
24
24
  size: {
25
- l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1.75rem;", ":0.6875rem;", ":0.6875rem;", ":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.0625rem;", ":0.25rem;", ":0.25rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.paddingRight, _Badge.badgeTokens.paddingLeft, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
26
- m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.5rem;", ":0.5625rem;", ":0.5625rem;", ":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.0625rem;", ":0.1875rem;", ":0.1875rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.paddingRight, _Badge.badgeTokens.paddingLeft, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
27
- s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.25rem;", ":0.4375rem;", ":0.4375rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.paddingRight, _Badge.badgeTokens.paddingLeft, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
28
- xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.25rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.paddingRight, _Badge.badgeTokens.paddingLeft, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight)
25
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1.75rem;", ":0 0.6875rem;", ":0 0.375rem;", ":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.0625rem;", ":0.25rem;", ":0.25rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
26
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.5rem;", ":0 0.5625rem;", ":0 0.375rem;", ":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.0625rem;", ":0.1875rem;", ":0.1875rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
27
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":1.25rem;", ":0 0.4375rem;", ":0 0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight),
28
+ xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.25rem;", ":1rem;", ":0 0.25rem;", ":0 0.188rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);", ":-0.0625rem;", ":0.125rem;", ":0.125rem;", ":-0.0625rem;"], _Badge.badgeTokens.borderRadius, _Badge.badgeTokens.height, _Badge.badgeTokens.padding, _Badge.badgeTokens.paddingIconOnly, _Badge.badgeTokens.fontFamily, _Badge.badgeTokens.fontSize, _Badge.badgeTokens.fontStyle, _Badge.badgeTokens.fontWeight, _Badge.badgeTokens.letterSpacing, _Badge.badgeTokens.lineHeight, _Badge.badgeTokens.leftContentMarginLeft, _Badge.badgeTokens.leftContentMarginRight, _Badge.badgeTokens.rightContentMarginLeft, _Badge.badgeTokens.rightContentMarginRight)
29
29
  },
30
30
  pilled: {
31
31
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":1.25rem;"], _Badge.badgeTokens.pilledBorderRadius)
@@ -34,7 +34,7 @@ var config = exports.config = {
34
34
  "true": /*#__PURE__*/(0, _styledComponents.css)([""])
35
35
  },
36
36
  clear: {
37
- "true": /*#__PURE__*/(0, _styledComponents.css)([""])
37
+ "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-clear);"], _Badge.badgeTokens.backgroundClear)
38
38
  }
39
39
  }
40
40
  };
@@ -31,6 +31,13 @@ const meta: Meta<typeof Badge> = {
31
31
  control: { type: 'boolean' },
32
32
  if: { arg: 'clear', truthy: false },
33
33
  },
34
+ maxWidth: {
35
+ control: { type: 'text' },
36
+ },
37
+ text: {
38
+ control: { type: 'text' },
39
+ if: { arg: 'enableText', truthy: true },
40
+ },
34
41
  ...disableProps(['contentLeft', 'contentRight']),
35
42
  },
36
43
  };
@@ -40,6 +47,7 @@ export default meta;
40
47
  type StoryProps = ComponentProps<typeof Badge> & {
41
48
  enableContentLeft: boolean;
42
49
  enableContentRight: boolean;
50
+ enableText: boolean;
43
51
  };
44
52
  type Story = StoryObj<StoryProps>;
45
53
 
@@ -60,26 +68,39 @@ export const Default: Story = {
60
68
  },
61
69
  enableContentRight: {
62
70
  control: { type: 'boolean' },
63
- if: { arg: 'enableContentLeft', truthy: false },
71
+ if: { arg: 'enableText', truthy: true },
64
72
  },
65
73
  },
66
74
  args: {
67
- text: 'Hello',
68
75
  view: 'default',
69
76
  size: 'm',
77
+ enableText: true,
78
+ text: 'Hello',
70
79
  enableContentLeft: false,
71
80
  enableContentRight: false,
72
81
  clear: false,
73
82
  pilled: false,
74
83
  transparent: false,
84
+ maxWidth: '',
75
85
  },
76
- render: ({ enableContentLeft, enableContentRight, size, ...rest }: StoryProps) => {
77
- const iconSize = size === 'l' ? '1rem' : '0.75rem';
86
+ render: ({ enableContentLeft, enableContentRight, enableText, size, ...rest }: StoryProps) => {
87
+ const iconSize = () => {
88
+ switch (size) {
89
+ case 'l':
90
+ return '1rem';
91
+ case 'xs':
92
+ return '0.625rem';
93
+ default:
94
+ return '0.75rem';
95
+ }
96
+ };
78
97
 
79
98
  return (
80
99
  <Badge
81
- contentLeft={enableContentLeft ? <BellIcon width={iconSize} height={iconSize} /> : undefined}
82
- contentRight={enableContentRight ? <BellIcon width={iconSize} height={iconSize} /> : undefined}
100
+ contentLeft={
101
+ enableContentLeft || !enableText ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined
102
+ }
103
+ contentRight={enableContentRight ? <BellIcon width={iconSize()} height={iconSize()} /> : undefined}
83
104
  size={size}
84
105
  {...rest}
85
106
  />
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["children", "className", "text", "contentLeft", "contentRight", "size", "view", "pilled", "transparent", "clear", "maxWidth"];
2
+ var _excluded = ["children", "className", "style", "text", "contentLeft", "contentRight", "size", "view", "customColor", "customBackgroundColor", "pilled", "transparent", "clear", "maxWidth"];
3
3
  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); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -16,16 +16,20 @@ import { base as pilledCSS } from './variations/_pilled/base';
16
16
  import { base as transparentCSS } from './variations/_transparent/base';
17
17
  import { base as clearCSS } from './variations/_clear/base';
18
18
  import { StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Badge.styles';
19
- import { classes } from './Badge.tokens';
19
+ import { classes, privateTokens } from './Badge.tokens';
20
20
  export var badgeRoot = function badgeRoot(Root) {
21
21
  return /*#__PURE__*/forwardRef(function (props, ref) {
22
+ var _StyledContentLeft, _StyledContentMain, _StyledContentMain2, _StyledContentRight;
22
23
  var children = props.children,
23
24
  className = props.className,
25
+ style = props.style,
24
26
  text = props.text,
25
27
  contentLeft = props.contentLeft,
26
28
  contentRight = props.contentRight,
27
29
  size = props.size,
28
30
  view = props.view,
31
+ customColor = props.customColor,
32
+ customBackgroundColor = props.customBackgroundColor,
29
33
  _props$pilled = props.pilled,
30
34
  pilled = _props$pilled === void 0 ? false : _props$pilled,
31
35
  _props$transparent = props.transparent,
@@ -40,19 +44,25 @@ export var badgeRoot = function badgeRoot(Root) {
40
44
  var clearClass = clear ? classes.badgeClear : undefined;
41
45
  var truncateClass = maxWidth !== 'auto' ? classes.badgeTruncate : undefined;
42
46
  var txt = !text && typeof children === 'string' ? children : text;
47
+ var iconOnlyClass = !txt && contentLeft ? classes.iconOnly : undefined;
48
+ var BadgeContent = function BadgeContent() {
49
+ if (contentLeft) {
50
+ return /*#__PURE__*/React.createElement(React.Fragment, null, _StyledContentLeft || (_StyledContentLeft = /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft)), txt ? _StyledContentMain || (_StyledContentMain = /*#__PURE__*/React.createElement(StyledContentMain, null, txt)) : children);
51
+ }
52
+ return /*#__PURE__*/React.createElement(React.Fragment, null, txt ? _StyledContentMain2 || (_StyledContentMain2 = /*#__PURE__*/React.createElement(StyledContentMain, null, txt)) : children, contentRight && (_StyledContentRight || (_StyledContentRight = /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight))));
53
+ };
43
54
  return /*#__PURE__*/React.createElement(Root, _extends({
44
55
  ref: ref,
45
- className: cx(pilledClass, transparentClass, clearClass, truncateClass, className),
56
+ className: cx(pilledClass, transparentClass, clearClass, truncateClass, iconOnlyClass, className),
46
57
  view: view,
47
58
  size: size,
48
59
  pilled: pilled,
49
60
  transparent: transparent,
50
- clear: clear
51
- }, rest, {
52
- style: _objectSpread(_objectSpread({}, rest.style), {}, {
61
+ clear: clear,
62
+ style: _objectSpread(_objectSpread({}, style), {}, _defineProperty(_defineProperty({
53
63
  maxWidth: maxWidth
54
- })
55
- }), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight));
64
+ }, privateTokens.customBackground, customBackgroundColor), privateTokens.customColor, customColor))
65
+ }, rest), /*#__PURE__*/React.createElement(BadgeContent, null));
56
66
  });
57
67
  };
58
68
  export var badgeConfig = {
@@ -52,16 +52,7 @@ export function App() {
52
52
  ```
53
53
 
54
54
  ### Вид badge
55
- Вид `badge` задается с помощью свойства `view`. Возможные значения свойства `view`:
56
-
57
- + `"primary"` – основной badge;
58
- + `"accent"` – бейдж акцентного цвета;
59
- + `"positive"` – успешное завершение;
60
- + `"warning"` – предупреждение;
61
- + `"negative"` – ошибка;
62
- + `"dark"` – темный badge;
63
- + `"light"` – светлый badge.
64
-
55
+ Вид `badge` задается с помощью свойства `view`.
65
56
  Так же на вид badge влияет свойства `transparent` и `clear`.
66
57
 
67
58
  ```tsx live
@@ -72,7 +63,7 @@ export function App() {
72
63
  const Badges = ({transparent, clear}) => {
73
64
  return (
74
65
  <div style=\{{ display: 'flex', gap: '0.5rem' }}>
75
- <Badge text="Бейдж" size="l" view="primary" transparent={transparent} clear={clear} />
66
+ <Badge text="Бейдж" size="l" view="default" transparent={transparent} clear={clear} />
76
67
  <Badge text="Бейдж" size="l" view="accent" transparent={transparent} clear={clear} />
77
68
  <Badge text="Бейдж" size="l" view="positive" transparent={transparent} clear={clear} />
78
69
  <Badge text="Бейдж" size="l" view="warning" transparent={transparent} clear={clear} />
@@ -94,7 +85,8 @@ export function App() {
94
85
  ```
95
86
 
96
87
  ### Иконка слева / справа
97
- В левой и/или правой части badge можно отобразить иконку:
88
+ В левой или правой части badge можно отобразить иконку.
89
+ Если же нужен Badge с иконкой без текста, нужно использовать `contentLeft`.
98
90
 
99
91
  ```tsx live
100
92
  import React from 'react';
@@ -107,17 +99,49 @@ export function App() {
107
99
  <Badge
108
100
  text="Бейдж"
109
101
  size="l"
110
- view="primary"
102
+ view="default"
111
103
  contentLeft={
112
104
  <IconEye color="inherit" size="xs" />
113
- } />
105
+ }
106
+ />
114
107
  <Badge
115
108
  text="Бейдж"
116
109
  size="l"
117
- view="primary"
110
+ view="default"
118
111
  contentRight={
119
112
  <IconEye color="inherit" size="xs" />
120
- } />
113
+ }
114
+ />
115
+ <Badge
116
+ size="l"
117
+ view="default"
118
+ contentLeft={
119
+ <IconEye color="inherit" size="xs" />
120
+ }
121
+ />
122
+ </div>
123
+ );
124
+ }
125
+ ```
126
+
127
+ ### Задание цвета текста и фона
128
+ Цвет текста и фона можно задать с помощью свойств
129
+ `customColor` и `customBackgroundColor` соответственно.
130
+
131
+ ```tsx live
132
+ import React from 'react';
133
+ import { Badge } from '@salutejs/{{ package }}';
134
+
135
+ export function App() {
136
+ return (
137
+ <div>
138
+ <Badge
139
+ text="Бейдж"
140
+ size="l"
141
+ view="default"
142
+ customColor="antiquewhite"
143
+ customBackgroundColor="darkolivegreen"
144
+ />
121
145
  </div>
122
146
  );
123
147
  }