@salutejs/plasma-new-hope 0.195.0-canary.1574.11921374356.0 → 0.195.1-canary.1561.11932328624.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. package/cjs/components/Autocomplete/Autocomplete.js +1 -7
  2. package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  3. package/cjs/components/Badge/Badge.css +4 -4
  4. package/cjs/components/Badge/Badge.js +17 -7
  5. package/cjs/components/Badge/Badge.js.map +1 -1
  6. package/cjs/components/Badge/Badge.tokens.js +10 -5
  7. package/cjs/components/Badge/Badge.tokens.js.map +1 -1
  8. package/cjs/components/Badge/variations/_clear/base.js +1 -1
  9. package/cjs/components/Badge/variations/_clear/base.js.map +1 -1
  10. package/cjs/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  11. package/cjs/components/Badge/variations/_size/base.js +1 -1
  12. package/cjs/components/Badge/variations/_size/base.js.map +1 -1
  13. package/{es/components/Badge/variations/_size/base_to0y5x.css → cjs/components/Badge/variations/_size/base_bu5opk.css} +1 -1
  14. package/cjs/components/Badge/variations/_transparent/base.js +1 -1
  15. package/cjs/components/Badge/variations/_transparent/base.js.map +1 -1
  16. package/cjs/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  17. package/cjs/components/Badge/variations/_view/base.js +1 -1
  18. package/cjs/components/Badge/variations/_view/base.js.map +1 -1
  19. package/cjs/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  20. package/cjs/components/Pagination/Pagination.css +2 -2
  21. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -2
  22. package/cjs/components/Select/Select.css +2 -2
  23. package/cjs/components/Select/Select.js +11 -4
  24. package/cjs/components/Select/Select.js.map +1 -1
  25. package/cjs/components/Select/Select.tokens.js +11 -1
  26. package/cjs/components/Select/Select.tokens.js.map +1 -1
  27. package/cjs/components/Select/ui/Inner/Inner.css +2 -2
  28. package/cjs/components/Select/ui/Inner/ui/Item/Item.css +2 -2
  29. package/cjs/components/Select/ui/Target/Target.css +2 -2
  30. package/cjs/components/Select/ui/Target/Target.js +5 -4
  31. package/cjs/components/Select/ui/Target/Target.js.map +1 -1
  32. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +2 -2
  33. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -2
  34. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
  35. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +7 -7
  36. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  37. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles_1b7iij0.css +3 -0
  38. package/cjs/index.css +6 -6
  39. package/emotion/cjs/components/Autocomplete/Autocomplete.js +1 -7
  40. package/emotion/cjs/components/Badge/Badge.js +17 -7
  41. package/emotion/cjs/components/Badge/Badge.template-doc.mdx +40 -16
  42. package/emotion/cjs/components/Badge/Badge.tokens.js +10 -6
  43. package/emotion/cjs/components/Badge/variations/_clear/base.js +1 -1
  44. package/emotion/cjs/components/Badge/variations/_size/base.js +2 -1
  45. package/emotion/cjs/components/Badge/variations/_transparent/base.js +1 -1
  46. package/emotion/cjs/components/Badge/variations/_view/base.js +1 -1
  47. package/emotion/cjs/components/Select/Select.js +11 -4
  48. package/emotion/cjs/components/Select/Select.tokens.js +11 -1
  49. package/emotion/cjs/components/Select/ui/Target/Target.js +5 -4
  50. package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -2
  51. package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +3 -3
  52. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
  53. package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  54. package/emotion/cjs/examples/plasma_b2c/components/Select/Select.config.js +20 -20
  55. package/emotion/cjs/examples/plasma_b2c/components/Select/Select.stories.tsx +31 -0
  56. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  57. package/emotion/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  58. package/emotion/cjs/examples/plasma_web/components/Select/Select.config.js +20 -20
  59. package/emotion/cjs/examples/plasma_web/components/Select/Select.stories.tsx +30 -0
  60. package/emotion/es/components/Autocomplete/Autocomplete.js +1 -7
  61. package/emotion/es/components/Badge/Badge.js +18 -8
  62. package/emotion/es/components/Badge/Badge.template-doc.mdx +40 -16
  63. package/emotion/es/components/Badge/Badge.tokens.js +9 -5
  64. package/emotion/es/components/Badge/variations/_clear/base.js +2 -2
  65. package/emotion/es/components/Badge/variations/_size/base.js +3 -2
  66. package/emotion/es/components/Badge/variations/_transparent/base.js +2 -2
  67. package/emotion/es/components/Badge/variations/_view/base.js +2 -2
  68. package/emotion/es/components/Select/Select.js +11 -4
  69. package/emotion/es/components/Select/Select.tokens.js +11 -1
  70. package/emotion/es/components/Select/ui/Target/Target.js +5 -4
  71. package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -2
  72. package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +3 -3
  73. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +15 -15
  74. package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  75. package/emotion/es/examples/plasma_b2c/components/Select/Select.config.js +20 -20
  76. package/emotion/es/examples/plasma_b2c/components/Select/Select.stories.tsx +31 -0
  77. package/emotion/es/examples/plasma_web/components/Badge/Badge.config.js +14 -14
  78. package/emotion/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  79. package/emotion/es/examples/plasma_web/components/Select/Select.config.js +20 -20
  80. package/emotion/es/examples/plasma_web/components/Select/Select.stories.tsx +30 -0
  81. package/es/components/Autocomplete/Autocomplete.js +1 -7
  82. package/es/components/Autocomplete/Autocomplete.js.map +1 -1
  83. package/es/components/Badge/Badge.css +4 -4
  84. package/es/components/Badge/Badge.js +20 -10
  85. package/es/components/Badge/Badge.js.map +1 -1
  86. package/es/components/Badge/Badge.tokens.js +10 -6
  87. package/es/components/Badge/Badge.tokens.js.map +1 -1
  88. package/es/components/Badge/variations/_clear/base.js +1 -1
  89. package/es/components/Badge/variations/_clear/base.js.map +1 -1
  90. package/es/components/Badge/variations/_clear/base_wiboj8.css +1 -0
  91. package/es/components/Badge/variations/_size/base.js +1 -1
  92. package/es/components/Badge/variations/_size/base.js.map +1 -1
  93. package/{cjs/components/Badge/variations/_size/base_to0y5x.css → es/components/Badge/variations/_size/base_bu5opk.css} +1 -1
  94. package/es/components/Badge/variations/_transparent/base.js +1 -1
  95. package/es/components/Badge/variations/_transparent/base.js.map +1 -1
  96. package/es/components/Badge/variations/_transparent/base_aapqhz.css +1 -0
  97. package/es/components/Badge/variations/_view/base.js +1 -1
  98. package/es/components/Badge/variations/_view/base.js.map +1 -1
  99. package/es/components/Badge/variations/_view/base_j3xzf3.css +1 -0
  100. package/es/components/Pagination/Pagination.css +2 -2
  101. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -2
  102. package/es/components/Select/Select.css +2 -2
  103. package/es/components/Select/Select.js +11 -4
  104. package/es/components/Select/Select.js.map +1 -1
  105. package/es/components/Select/Select.tokens.js +11 -1
  106. package/es/components/Select/Select.tokens.js.map +1 -1
  107. package/es/components/Select/ui/Inner/Inner.css +2 -2
  108. package/es/components/Select/ui/Inner/ui/Item/Item.css +2 -2
  109. package/es/components/Select/ui/Target/Target.css +2 -2
  110. package/es/components/Select/ui/Target/Target.js +5 -4
  111. package/es/components/Select/ui/Target/Target.js.map +1 -1
  112. package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +2 -2
  113. package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -2
  114. package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
  115. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +7 -7
  116. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  117. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles_1b7iij0.css +3 -0
  118. package/es/index.css +6 -6
  119. package/package.json +2 -2
  120. package/styled-components/cjs/components/Autocomplete/Autocomplete.js +1 -7
  121. package/styled-components/cjs/components/Badge/Badge.js +17 -7
  122. package/styled-components/cjs/components/Badge/Badge.template-doc.mdx +40 -16
  123. package/styled-components/cjs/components/Badge/Badge.tokens.js +10 -6
  124. package/styled-components/cjs/components/Badge/variations/_clear/base.js +1 -1
  125. package/styled-components/cjs/components/Badge/variations/_size/base.js +2 -1
  126. package/styled-components/cjs/components/Badge/variations/_transparent/base.js +1 -1
  127. package/styled-components/cjs/components/Badge/variations/_view/base.js +1 -1
  128. package/styled-components/cjs/components/Select/Select.js +11 -4
  129. package/styled-components/cjs/components/Select/Select.tokens.js +11 -1
  130. package/styled-components/cjs/components/Select/ui/Target/Target.js +5 -4
  131. package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -2
  132. package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +2 -2
  133. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  134. package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  135. package/styled-components/cjs/examples/plasma_b2c/components/Select/Select.config.js +8 -8
  136. package/styled-components/cjs/examples/plasma_b2c/components/Select/Select.stories.tsx +31 -0
  137. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  138. package/styled-components/cjs/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  139. package/styled-components/cjs/examples/plasma_web/components/Select/Select.config.js +8 -8
  140. package/styled-components/cjs/examples/plasma_web/components/Select/Select.stories.tsx +30 -0
  141. package/styled-components/es/components/Autocomplete/Autocomplete.js +1 -7
  142. package/styled-components/es/components/Badge/Badge.js +18 -8
  143. package/styled-components/es/components/Badge/Badge.template-doc.mdx +40 -16
  144. package/styled-components/es/components/Badge/Badge.tokens.js +9 -5
  145. package/styled-components/es/components/Badge/variations/_clear/base.js +2 -2
  146. package/styled-components/es/components/Badge/variations/_size/base.js +3 -2
  147. package/styled-components/es/components/Badge/variations/_transparent/base.js +2 -2
  148. package/styled-components/es/components/Badge/variations/_view/base.js +2 -2
  149. package/styled-components/es/components/Select/Select.js +11 -4
  150. package/styled-components/es/components/Select/Select.tokens.js +11 -1
  151. package/styled-components/es/components/Select/ui/Target/Target.js +5 -4
  152. package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -2
  153. package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +2 -2
  154. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +5 -5
  155. package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +23 -6
  156. package/styled-components/es/examples/plasma_b2c/components/Select/Select.config.js +8 -8
  157. package/styled-components/es/examples/plasma_b2c/components/Select/Select.stories.tsx +31 -0
  158. package/styled-components/es/examples/plasma_web/components/Badge/Badge.config.js +5 -5
  159. package/styled-components/es/examples/plasma_web/components/Badge/Badge.stories.tsx +27 -6
  160. package/styled-components/es/examples/plasma_web/components/Select/Select.config.js +8 -8
  161. package/styled-components/es/examples/plasma_web/components/Select/Select.stories.tsx +30 -0
  162. package/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
  163. package/types/components/Autocomplete/Autocomplete.types.d.ts +0 -4
  164. package/types/components/Autocomplete/Autocomplete.types.d.ts.map +1 -1
  165. package/types/components/Badge/Badge.d.ts.map +1 -1
  166. package/types/components/Badge/Badge.tokens.d.ts +8 -4
  167. package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
  168. package/types/components/Badge/Badge.types.d.ts +18 -5
  169. package/types/components/Badge/Badge.types.d.ts.map +1 -1
  170. package/types/components/Badge/variations/_clear/base.d.ts.map +1 -1
  171. package/types/components/Badge/variations/_size/base.d.ts.map +1 -1
  172. package/types/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.d.ts +96 -0
  173. package/types/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.d.ts.map +1 -1
  174. package/types/components/Select/Select.d.ts.map +1 -1
  175. package/types/components/Select/Select.tokens.d.ts +11 -1
  176. package/types/components/Select/Select.tokens.d.ts.map +1 -1
  177. package/types/components/Select/Select.types.d.ts +4 -2
  178. package/types/components/Select/Select.types.d.ts.map +1 -1
  179. package/types/components/Select/ui/Target/Target.d.ts +2 -1
  180. package/types/components/Select/ui/Target/Target.d.ts.map +1 -1
  181. package/types/components/Select/ui/Target/Target.types.d.ts +3 -2
  182. package/types/components/Select/ui/Target/Target.types.d.ts.map +1 -1
  183. package/types/components/Select/ui/Target/ui/Textfield/Textfield.d.ts.map +1 -1
  184. package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts.map +1 -1
  185. package/types/components/Select/ui/Target/ui/Textfield/Textfield.types.d.ts +1 -1
  186. package/types/components/Select/ui/Target/ui/Textfield/Textfield.types.d.ts.map +1 -1
  187. package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
  188. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +61 -4
  189. package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
  190. package/types/examples/plasma_b2c/components/Select/Select.config.d.ts.map +1 -1
  191. package/types/examples/plasma_b2c/components/Select/Select.d.ts +96 -0
  192. package/types/examples/plasma_b2c/components/Select/Select.d.ts.map +1 -1
  193. package/types/examples/plasma_web/components/Badge/Badge.config.d.ts.map +1 -1
  194. package/types/examples/plasma_web/components/Badge/Badge.d.ts +61 -4
  195. package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
  196. package/types/examples/plasma_web/components/Select/Select.config.d.ts.map +1 -1
  197. package/types/examples/plasma_web/components/Select/Select.d.ts +96 -0
  198. package/types/examples/plasma_web/components/Select/Select.d.ts.map +1 -1
  199. package/cjs/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  200. package/cjs/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  201. package/cjs/components/Badge/variations/_view/base_qlxank.css +0 -1
  202. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles_q4kc1p.css +0 -3
  203. package/es/components/Badge/variations/_clear/base_oopyb7.css +0 -1
  204. package/es/components/Badge/variations/_transparent/base_1l6036y.css +0 -1
  205. package/es/components/Badge/variations/_view/base_qlxank.css +0 -1
  206. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles_q4kc1p.css +0 -3
@@ -44,6 +44,12 @@ const meta: Meta<StorySelectProps> = {
44
44
  eq: 'textfield-like',
45
45
  },
46
46
  },
47
+ placeholder: {
48
+ if: {
49
+ arg: 'target',
50
+ eq: 'textfield-like',
51
+ },
52
+ },
47
53
  chipView: {
48
54
  control: 'select',
49
55
  options: chip,
@@ -79,6 +85,24 @@ const meta: Meta<StorySelectProps> = {
79
85
  eq: 'textfield-like',
80
86
  },
81
87
  },
88
+ requiredPlacement: {
89
+ options: ['left', 'right'],
90
+ control: {
91
+ type: 'select',
92
+ },
93
+ },
94
+ required: {
95
+ control: {
96
+ type: 'boolean',
97
+ },
98
+ if: { arg: 'optional', truthy: false },
99
+ },
100
+ optional: {
101
+ control: {
102
+ type: 'boolean',
103
+ },
104
+ if: { arg: 'required', truthy: false },
105
+ },
82
106
  },
83
107
  args: {
84
108
  target: 'textfield-like',
@@ -93,6 +117,9 @@ const meta: Meta<StorySelectProps> = {
93
117
  isTargetAmount: false,
94
118
  variant: 'normal',
95
119
  disabled: false,
120
+ optional: false,
121
+ required: false,
122
+ requiredPlacement: 'right',
96
123
  },
97
124
  parameters: {
98
125
  controls: {
@@ -113,6 +140,9 @@ const meta: Meta<StorySelectProps> = {
113
140
  'listWidth',
114
141
  'listOverflow',
115
142
  'listHeight',
143
+ 'optional',
144
+ 'required',
145
+ 'requiredPlacement',
116
146
  ],
117
147
  },
118
148
  },
@@ -1,4 +1,4 @@
1
- var _excluded = ["value", "defaultValue", "onChange", "suggestions", "view", "size", "labelPlacement", "disabled", "readOnly", "label", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "onScroll", "listMaxHeight", "listWidth", "portal", "filter", "onSuggestionSelect", "threshold", "renderList", "renderListEnd", "onSearch", "hintText"];
1
+ var _excluded = ["value", "onChange", "suggestions", "view", "size", "labelPlacement", "disabled", "readOnly", "label", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "onScroll", "listMaxHeight", "listWidth", "portal", "filter", "onSuggestionSelect", "threshold", "renderList", "renderListEnd", "onSearch", "hintText"];
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
4
  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."); }
@@ -23,7 +23,6 @@ import { useKeyNavigation } from './hooks/useKeyboardNavigation';
23
23
  export var autocompleteRoot = function autocompleteRoot(Root) {
24
24
  return /*#__PURE__*/forwardRef(function (_ref, ref) {
25
25
  var outerValue = _ref.value,
26
- defaultValue = _ref.defaultValue,
27
26
  onChange = _ref.onChange,
28
27
  suggestions = _ref.suggestions,
29
28
  view = _ref.view,
@@ -111,11 +110,6 @@ export var autocompleteRoot = function autocompleteRoot(Root) {
111
110
  type: 'reset'
112
111
  });
113
112
  }, [value]);
114
- useDidMountEffect(function () {
115
- if (defaultValue) {
116
- setInnerValue(defaultValue);
117
- }
118
- }, [defaultValue]);
119
113
  return /*#__PURE__*/React.createElement(Root, {
120
114
  view: view,
121
115
  size: size,
@@ -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
  }
@@ -2,7 +2,12 @@ export var classes = {
2
2
  badgePilled: 'badge-pilled',
3
3
  badgeTransparent: 'badge-transparent',
4
4
  badgeClear: 'badge-clear',
5
- badgeTruncate: 'badge-truncate'
5
+ badgeTruncate: 'badge-truncate',
6
+ iconOnly: 'badge-icon-only'
7
+ };
8
+ export var privateTokens = {
9
+ customBackground: '--plasma-badge-custom-background',
10
+ customColor: '--plasma-badge-custom-color'
6
11
  };
7
12
  export var tokens = {
8
13
  background: '--plasma-badge-background',
@@ -10,13 +15,12 @@ export var tokens = {
10
15
  backgroundTransparent: '--plasma-badge-background-transparent',
11
16
  colorTransparent: '--plasma-badge-color-transparent',
12
17
  colorClear: '--plasma-badge-color-clear',
18
+ backgroundClear: '--plasma-badge-background-clear',
13
19
  borderRadius: '--plasma-badge-border-radius',
14
20
  pilledBorderRadius: '--plasma-badge-pilled-border-radius',
15
21
  height: '--plasma-badge-height',
16
- paddingTop: '--plasma-badge-padding-top',
17
- paddingRight: '--plasma-badge-padding-right',
18
- paddingBottom: '--plasma-badge-padding-bottom',
19
- paddingLeft: '--plasma-badge-padding-left',
22
+ padding: '--plasma-badge-padding',
23
+ paddingIconOnly: '--plasma-badge-padding-icon-only',
20
24
  fontFamily: '--plasma-badge-font-family',
21
25
  fontSize: '--plasma-badge-font-size',
22
26
  fontStyle: '--plasma-badge-font-style',
@@ -1,3 +1,3 @@
1
1
  import { css } from '@emotion/react';
2
- import { classes, tokens } from '../../Badge.tokens';
3
- export var base = /*#__PURE__*/css("&.", classes.badgeClear, "{color:var(", tokens.colorClear, ");background-color:transparent;padding:0;};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQmFkZ2UvdmFyaWF0aW9ucy9fY2xlYXIvYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJdUIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9CYWRnZS92YXJpYXRpb25zL19jbGVhci9iYXNlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBjbGFzc2VzLCB0b2tlbnMgfSBmcm9tICcuLi8uLi9CYWRnZS50b2tlbnMnO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICAmLiR7Y2xhc3Nlcy5iYWRnZUNsZWFyfSB7XG4gICAgICAgIGNvbG9yOiB2YXIoJHt0b2tlbnMuY29sb3JDbGVhcn0pO1xuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDtcbiAgICAgICAgcGFkZGluZzogMDtcbiAgICB9XG5gO1xuIl19 */"));
2
+ import { classes, privateTokens, tokens } from '../../Badge.tokens';
3
+ export var base = /*#__PURE__*/css("&.", classes.badgeClear, "{color:var(", privateTokens.customColor, ", var(", tokens.colorClear, "));background-color:var(", privateTokens.customBackground, ", var(", tokens.backgroundClear, "));};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQmFkZ2UvdmFyaWF0aW9ucy9fY2xlYXIvYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJdUIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9CYWRnZS92YXJpYXRpb25zL19jbGVhci9iYXNlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBjbGFzc2VzLCBwcml2YXRlVG9rZW5zLCB0b2tlbnMgfSBmcm9tICcuLi8uLi9CYWRnZS50b2tlbnMnO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICAmLiR7Y2xhc3Nlcy5iYWRnZUNsZWFyfSB7XG4gICAgICAgIGNvbG9yOiB2YXIoJHtwcml2YXRlVG9rZW5zLmN1c3RvbUNvbG9yfSwgdmFyKCR7dG9rZW5zLmNvbG9yQ2xlYXJ9KSk7XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6IHZhcigke3ByaXZhdGVUb2tlbnMuY3VzdG9tQmFja2dyb3VuZH0sIHZhcigke3Rva2Vucy5iYWNrZ3JvdW5kQ2xlYXJ9KSk7XG4gICAgfVxuYDtcbiJdfQ== */"));
@@ -1,3 +1,4 @@
1
1
  import { css } from '@emotion/react';
2
- import { tokens } from '../../Badge.tokens';
3
- export var base = /*#__PURE__*/css("font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.letterSpacing, ");line-height:var(", tokens.lineHeight, ");border-radius:var(", tokens.borderRadius, ");height:var(", tokens.height, ");padding-top:var(", tokens.paddingTop, ");padding-right:var(", tokens.paddingRight, ");padding-bottom:var(", tokens.paddingBottom, ");padding-left:var(", tokens.paddingLeft, ");;label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQmFkZ2UvdmFyaWF0aW9ucy9fc2l6ZS9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUl1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0JhZGdlL3ZhcmlhdGlvbnMvX3NpemUvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgdG9rZW5zIH0gZnJvbSAnLi4vLi4vQmFkZ2UudG9rZW5zJztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgXG4gICAgZm9udC1mYW1pbHk6IHZhcigke3Rva2Vucy5mb250RmFtaWx5fSk7XG4gICAgZm9udC1zaXplOiB2YXIoJHt0b2tlbnMuZm9udFNpemV9KTtcbiAgICBmb250LXN0eWxlOiB2YXIoJHt0b2tlbnMuZm9udFN0eWxlfSk7XG4gICAgZm9udC13ZWlnaHQ6IHZhcigke3Rva2Vucy5mb250V2VpZ2h0fSk7XG4gICAgbGV0dGVyLXNwYWNpbmc6IHZhcigke3Rva2Vucy5sZXR0ZXJTcGFjaW5nfSk7XG4gICAgbGluZS1oZWlnaHQ6IHZhcigke3Rva2Vucy5saW5lSGVpZ2h0fSk7XG5cbiAgICBib3JkZXItcmFkaXVzOiB2YXIoJHt0b2tlbnMuYm9yZGVyUmFkaXVzfSk7XG5cbiAgICBoZWlnaHQ6IHZhcigke3Rva2Vucy5oZWlnaHR9KTtcblxuICAgIHBhZGRpbmctdG9wOiB2YXIoJHt0b2tlbnMucGFkZGluZ1RvcH0pO1xuICAgIHBhZGRpbmctcmlnaHQ6IHZhcigke3Rva2Vucy5wYWRkaW5nUmlnaHR9KTtcbiAgICBwYWRkaW5nLWJvdHRvbTogdmFyKCR7dG9rZW5zLnBhZGRpbmdCb3R0b219KTtcbiAgICBwYWRkaW5nLWxlZnQ6IHZhcigke3Rva2Vucy5wYWRkaW5nTGVmdH0pO1xuYDtcbiJdfQ== */"));
2
+ import { classes, tokens } from '../../Badge.tokens';
3
+ import { StyledContentLeft } from '../../Badge.styles';
4
+ export var base = /*#__PURE__*/css("font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.letterSpacing, ");line-height:var(", tokens.lineHeight, ");border-radius:var(", tokens.borderRadius, ");height:var(", tokens.height, ");padding:var(", tokens.padding, ");&.", classes.iconOnly, "{padding:var(", tokens.paddingIconOnly, ");", StyledContentLeft, "{margin:0;}};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQmFkZ2UvdmFyaWF0aW9ucy9fc2l6ZS9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUt1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0JhZGdlL3ZhcmlhdGlvbnMvX3NpemUvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY2xhc3NlcywgdG9rZW5zIH0gZnJvbSAnLi4vLi4vQmFkZ2UudG9rZW5zJztcbmltcG9ydCB7IFN0eWxlZENvbnRlbnRMZWZ0IH0gZnJvbSAnLi4vLi4vQmFkZ2Uuc3R5bGVzJztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgXG4gICAgZm9udC1mYW1pbHk6IHZhcigke3Rva2Vucy5mb250RmFtaWx5fSk7XG4gICAgZm9udC1zaXplOiB2YXIoJHt0b2tlbnMuZm9udFNpemV9KTtcbiAgICBmb250LXN0eWxlOiB2YXIoJHt0b2tlbnMuZm9udFN0eWxlfSk7XG4gICAgZm9udC13ZWlnaHQ6IHZhcigke3Rva2Vucy5mb250V2VpZ2h0fSk7XG4gICAgbGV0dGVyLXNwYWNpbmc6IHZhcigke3Rva2Vucy5sZXR0ZXJTcGFjaW5nfSk7XG4gICAgbGluZS1oZWlnaHQ6IHZhcigke3Rva2Vucy5saW5lSGVpZ2h0fSk7XG5cbiAgICBib3JkZXItcmFkaXVzOiB2YXIoJHt0b2tlbnMuYm9yZGVyUmFkaXVzfSk7XG5cbiAgICBoZWlnaHQ6IHZhcigke3Rva2Vucy5oZWlnaHR9KTtcblxuICAgIHBhZGRpbmc6IHZhcigke3Rva2Vucy5wYWRkaW5nfSk7XG5cbiAgICAmLiR7Y2xhc3Nlcy5pY29uT25seX0ge1xuICAgICAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ0ljb25Pbmx5fSk7XG5cbiAgICAgICAgJHtTdHlsZWRDb250ZW50TGVmdH0ge1xuICAgICAgICAgICAgbWFyZ2luOiAwO1xuICAgICAgICB9XG4gICAgfVxuYDtcbiJdfQ== */"));
@@ -1,3 +1,3 @@
1
1
  import { css } from '@emotion/react';
2
- import { classes, tokens } from '../../Badge.tokens';
3
- export var base = /*#__PURE__*/css("&.", classes.badgeTransparent, "{color:var(", tokens.colorTransparent, ");background-color:var(", tokens.backgroundTransparent, ");};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQmFkZ2UvdmFyaWF0aW9ucy9fdHJhbnNwYXJlbnQvYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJdUIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9CYWRnZS92YXJpYXRpb25zL190cmFuc3BhcmVudC9iYXNlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBjbGFzc2VzLCB0b2tlbnMgfSBmcm9tICcuLi8uLi9CYWRnZS50b2tlbnMnO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICAmLiR7Y2xhc3Nlcy5iYWRnZVRyYW5zcGFyZW50fSB7XG4gICAgICAgIGNvbG9yOiB2YXIoJHt0b2tlbnMuY29sb3JUcmFuc3BhcmVudH0pO1xuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoJHt0b2tlbnMuYmFja2dyb3VuZFRyYW5zcGFyZW50fSk7XG4gICAgfVxuYDtcbiJdfQ== */"));
2
+ import { classes, privateTokens, tokens } from '../../Badge.tokens';
3
+ export var base = /*#__PURE__*/css("&.", classes.badgeTransparent, "{color:var(", privateTokens.customColor, ", var(", tokens.colorTransparent, "));background-color:var(", privateTokens.customBackground, ", var(", tokens.backgroundTransparent, "));};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQmFkZ2UvdmFyaWF0aW9ucy9fdHJhbnNwYXJlbnQvYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJdUIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9CYWRnZS92YXJpYXRpb25zL190cmFuc3BhcmVudC9iYXNlLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBjbGFzc2VzLCBwcml2YXRlVG9rZW5zLCB0b2tlbnMgfSBmcm9tICcuLi8uLi9CYWRnZS50b2tlbnMnO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICAmLiR7Y2xhc3Nlcy5iYWRnZVRyYW5zcGFyZW50fSB7XG4gICAgICAgIGNvbG9yOiB2YXIoJHtwcml2YXRlVG9rZW5zLmN1c3RvbUNvbG9yfSwgdmFyKCR7dG9rZW5zLmNvbG9yVHJhbnNwYXJlbnR9KSk7XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6IHZhcigke3ByaXZhdGVUb2tlbnMuY3VzdG9tQmFja2dyb3VuZH0sIHZhcigke3Rva2Vucy5iYWNrZ3JvdW5kVHJhbnNwYXJlbnR9KSk7XG4gICAgfVxuYDtcbiJdfQ== */"));
@@ -1,3 +1,3 @@
1
1
  import { css } from '@emotion/react';
2
- import { tokens } from '../../Badge.tokens';
3
- export var base = /*#__PURE__*/css("color:var(", tokens.color, ");background-color:var(", tokens.background, ");;label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQmFkZ2UvdmFyaWF0aW9ucy9fdmlldy9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUl1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0JhZGdlL3ZhcmlhdGlvbnMvX3ZpZXcvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgdG9rZW5zIH0gZnJvbSAnLi4vLi4vQmFkZ2UudG9rZW5zJztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgXG4gICAgY29sb3I6IHZhcigke3Rva2Vucy5jb2xvcn0pO1xuICAgIGJhY2tncm91bmQtY29sb3I6IHZhcigke3Rva2Vucy5iYWNrZ3JvdW5kfSk7XG5gO1xuIl19 */"));
2
+ import { privateTokens, tokens } from '../../Badge.tokens';
3
+ export var base = /*#__PURE__*/css("color:var(", privateTokens.customColor, ", var(", tokens.color, "));background-color:var(", privateTokens.customBackground, ", var(", tokens.background, "));;label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvQmFkZ2UvdmFyaWF0aW9ucy9fdmlldy9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUl1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0JhZGdlL3ZhcmlhdGlvbnMvX3ZpZXcvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgcHJpdmF0ZVRva2VucywgdG9rZW5zIH0gZnJvbSAnLi4vLi4vQmFkZ2UudG9rZW5zJztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgXG4gICAgY29sb3I6IHZhcigke3ByaXZhdGVUb2tlbnMuY3VzdG9tQ29sb3J9LCB2YXIoJHt0b2tlbnMuY29sb3J9KSk7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogdmFyKCR7cHJpdmF0ZVRva2Vucy5jdXN0b21CYWNrZ3JvdW5kfSwgdmFyKCR7dG9rZW5zLmJhY2tncm91bmR9KSk7XG5gO1xuIl19 */"));
@@ -30,7 +30,7 @@ export var selectRoot = function selectRoot(Root) {
30
30
  var outerValue = props.value,
31
31
  outerOnChange = props.onChange,
32
32
  _props$target = props.target,
33
- _target = _props$target === void 0 ? 'textfield-like' : _props$target,
33
+ target = _props$target === void 0 ? 'textfield-like' : _props$target,
34
34
  items = props.items,
35
35
  _props$placement = props.placement,
36
36
  placement = _props$placement === void 0 ? 'bottom' : _props$placement,
@@ -95,7 +95,14 @@ export var selectRoot = function selectRoot(Root) {
95
95
  var activeDescendantItemValue = ((_getItemByFocused = getItemByFocused(focusedPath, focusedToValueMap)) === null || _getItemByFocused === void 0 ? void 0 : _getItemByFocused.value.toString()) || '';
96
96
  var closeAfterSelect = outerCloseAfterSelect !== null && outerCloseAfterSelect !== void 0 ? outerCloseAfterSelect : !props.multiselect;
97
97
  var treeId = safeUseId();
98
- var view = _target === 'textfield-like' && disabled ? 'default' : getView(status, outerView);
98
+ var view = target === 'textfield-like' && disabled ? 'default' : getView(status, outerView);
99
+
100
+ // Собираем объект с пропсами для required и прокидываем их напрямую в компонент Textfield.
101
+ var requiredProps = props.target === 'button-like' ? undefined : {
102
+ required: props.required,
103
+ requiredPlacement: props.requiredPlacement,
104
+ optional: props.optional
105
+ };
99
106
  var targetRef = useOutsideClick(function () {
100
107
  if (!isCurrentListOpen) {
101
108
  return;
@@ -286,7 +293,6 @@ export var selectRoot = function selectRoot(Root) {
286
293
  target: function target(referenceRef) {
287
294
  return /*#__PURE__*/React.createElement(Target, {
288
295
  ref: ref,
289
- target: _target,
290
296
  value: value,
291
297
  opened: isCurrentListOpen,
292
298
  valueToItemMap: valueToItemMap,
@@ -310,7 +316,8 @@ export var selectRoot = function selectRoot(Root) {
310
316
  onChange: onChange,
311
317
  labelToItemMap: labelToItemMap,
312
318
  chipView: chipView,
313
- separator: separator
319
+ separator: separator,
320
+ requiredProps: requiredProps
314
321
  });
315
322
  }
316
323
  }, /*#__PURE__*/React.createElement(Root, _extends({
@@ -71,7 +71,6 @@ export var tokens = {
71
71
  textFieldBorderColorFocus: '--plasma-select-textfield-border-color-focus',
72
72
  textFieldPlaceholderColor: '--plasma-select-textfield-placeholder-color',
73
73
  textFieldPlaceholderColorFocus: '--plasma-select-textfield-placeholder-color-focus',
74
- textFieldOptionalColor: '--plasma-select-textfield-optional-color',
75
74
  textFieldHeight: '--plasma-select-textfield-height',
76
75
  textFieldBorderWidth: '--plasma-select-textfield-border-width',
77
76
  textFieldBorderRadius: '--plasma-select-textfield-border-radius',
@@ -155,6 +154,17 @@ export var tokens = {
155
154
  textFieldChipLineHeight: '--plasma-select-textfield-chip-line-height',
156
155
  textFieldChipClearContentMarginLeft: '--plasma-select-textfield-chip-clear-content-margin-left',
157
156
  textFieldChipClearContentMarginRight: '--plasma-select-textfield-chip-clear-content-margin-right',
157
+ textFieldIndicatorColor: '--plasma-select-new-textfield-indicator-color',
158
+ textFieldIndicatorSizeInner: '--plasma-select-new-textfield-indicator-size-inner',
159
+ textFieldIndicatorSizeOuter: '--plasma-select-new-textfield-indicator-size-outer',
160
+ textFieldIndicatorLabelPlacementInner: '--plasma-select-new-textfield-indicator-placement-inner',
161
+ textFieldIndicatorLabelPlacementOuter: '--plasma-select-new-textfield-indicator-placement-outer',
162
+ textFieldIndicatorLabelPlacementInnerRight: '--plasma-select-new-textfield-indicator-placement-inner-right',
163
+ textFieldIndicatorLabelPlacementOuterRight: '--plasma-select-new-textfield-indicator-placement-outer-right',
164
+ textFieldClearIndicatorLabelPlacementInner: '--plasma-select-new-textfield-clear-indicator-placement-inner',
165
+ textFieldClearIndicatorLabelPlacementInnerRight: '--plasma-select-new-textfield-clear-indicator-placement-inner-right',
166
+ textFieldClearIndicatorHintInnerRight: '--plasma-select-new-textfield-clear-indicator-hint-placement-inner-right',
167
+ textFieldOptionalColor: '--plasma-select-new-textfield-optional-color',
158
168
  textFieldFocusColor: '--plasma-select-textfield-focus-color',
159
169
  disclosureIconColor: '--plasma-select-disclosure-icon-color',
160
170
  disclosureIconColorHover: '--plasma-select-disclosure-icon-color-hover'
@@ -3,7 +3,6 @@ import { useForkRef } from '@salutejs/plasma-core';
3
3
  import { Button, Textfield } from './ui';
4
4
  export var Target = /*#__PURE__*/forwardRef(function (_ref, ref) {
5
5
  var value = _ref.value,
6
- target = _ref.target,
7
6
  opened = _ref.opened,
8
7
  valueToItemMap = _ref.valueToItemMap,
9
8
  label = _ref.label,
@@ -26,7 +25,8 @@ export var Target = /*#__PURE__*/forwardRef(function (_ref, ref) {
26
25
  onChange = _ref.onChange,
27
26
  labelToItemMap = _ref.labelToItemMap,
28
27
  chipView = _ref.chipView,
29
- separator = _ref.separator;
28
+ separator = _ref.separator,
29
+ requiredProps = _ref.requiredProps;
30
30
  var buttonRef = useForkRef(ref, inputWrapperRef);
31
31
  if (selectProps.renderTarget) {
32
32
  return /*#__PURE__*/React.createElement("div", {
@@ -35,7 +35,7 @@ export var Target = /*#__PURE__*/forwardRef(function (_ref, ref) {
35
35
  return valueToItemMap.get(value);
36
36
  }) : valueToItemMap.get(value)));
37
37
  }
38
- return target === 'button-like' ? /*#__PURE__*/React.createElement(Button, {
38
+ return selectProps.target === 'button-like' ? /*#__PURE__*/React.createElement(Button, {
39
39
  ref: buttonRef,
40
40
  opened: opened,
41
41
  value: value,
@@ -72,6 +72,7 @@ export var Target = /*#__PURE__*/forwardRef(function (_ref, ref) {
72
72
  renderValue: renderValue,
73
73
  onChange: onChange,
74
74
  labelToItemMap: labelToItemMap,
75
- chipView: chipView
75
+ chipView: chipView,
76
+ requiredProps: requiredProps
76
77
  });
77
78
  });
@@ -32,7 +32,8 @@ export var Textfield = /*#__PURE__*/forwardRef(function (_ref, ref) {
32
32
  renderValue = _ref.renderValue,
33
33
  onChange = _ref.onChange,
34
34
  labelToItemMap = _ref.labelToItemMap,
35
- chipView = _ref.chipView;
35
+ chipView = _ref.chipView,
36
+ requiredProps = _ref.requiredProps;
36
37
  var withArrowInverse = opened ? classes.arrowInverse : undefined;
37
38
  var getChips = function getChips() {
38
39
  if (multiselect && Array.isArray(value)) {
@@ -113,5 +114,5 @@ export var Textfield = /*#__PURE__*/forwardRef(function (_ref, ref) {
113
114
  // TODO: #1547
114
115
  ,
115
116
  _forceChipManipulationWithReadonly: true
116
- }));
117
+ }, requiredProps));
117
118
  });