@salutejs/plasma-new-hope 0.174.0-canary.1505.11518120718.0 → 0.174.0-dev.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. package/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -27
  2. package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  3. package/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -9
  4. package/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js.map +1 -1
  5. package/cjs/components/Drawer/Drawer.js +2 -1
  6. package/cjs/components/Drawer/Drawer.js.map +1 -1
  7. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  8. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  9. package/cjs/components/Select/Select.js +25 -13
  10. package/cjs/components/Select/Select.js.map +1 -1
  11. package/cjs/components/Select/hooks/useKeyboardNavigation.js +1 -1
  12. package/cjs/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
  13. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  14. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
  15. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  16. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  17. package/cjs/components/Select/utils/getButtonLabel.js +1 -1
  18. package/cjs/components/Select/utils/getButtonLabel.js.map +1 -1
  19. package/cjs/components/Select/utils/initialItemsTransform.js +6 -9
  20. package/cjs/components/Select/utils/initialItemsTransform.js.map +1 -1
  21. package/cjs/components/ViewContainer/ViewContainer.js +38 -0
  22. package/cjs/components/ViewContainer/ViewContainer.js.map +1 -0
  23. package/cjs/components/ViewContainer/ViewContainer_yiqfcb.css +1 -0
  24. package/cjs/components/ViewContainer/_view/base.js +9 -0
  25. package/cjs/components/ViewContainer/_view/base.js.map +1 -0
  26. package/cjs/components/ViewContainer/_view/base_x642ct.css +1 -0
  27. package/cjs/index.css +2 -0
  28. package/cjs/index.js +3 -0
  29. package/cjs/index.js.map +1 -1
  30. package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -26
  31. package/emotion/cjs/components/Combobox/ComboboxNew/utils/index.js +1 -8
  32. package/emotion/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
  33. package/emotion/cjs/components/Drawer/Drawer.js +4 -3
  34. package/emotion/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  35. package/emotion/cjs/components/Select/Select.js +25 -12
  36. package/emotion/cjs/components/Select/hooks/useKeyboardNavigation.js +1 -1
  37. package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  38. package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +13 -13
  39. package/emotion/cjs/components/Select/utils/getButtonLabel.js +1 -1
  40. package/emotion/cjs/components/Select/utils/index.js +1 -8
  41. package/emotion/cjs/components/Select/utils/initialItemsTransform.js +6 -19
  42. package/emotion/cjs/components/ViewContainer/ViewContainer.js +49 -0
  43. package/emotion/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
  44. package/emotion/cjs/components/ViewContainer/_view/base.js +8 -0
  45. package/emotion/cjs/components/ViewContainer/_view/tokens.json +1 -0
  46. package/emotion/cjs/components/ViewContainer/index.js +18 -0
  47. package/emotion/cjs/examples/_helpers.js +3 -14
  48. package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
  49. package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +16 -0
  50. package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +11 -0
  51. package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  52. package/emotion/cjs/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
  53. package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +16 -0
  54. package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +11 -0
  55. package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  56. package/emotion/cjs/index.js +11 -0
  57. package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +23 -27
  58. package/emotion/es/components/Combobox/ComboboxNew/utils/index.js +1 -2
  59. package/emotion/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
  60. package/emotion/es/components/Drawer/Drawer.js +2 -1
  61. package/emotion/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  62. package/emotion/es/components/Select/Select.js +26 -13
  63. package/emotion/es/components/Select/hooks/useKeyboardNavigation.js +1 -1
  64. package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  65. package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +13 -13
  66. package/emotion/es/components/Select/utils/getButtonLabel.js +1 -1
  67. package/emotion/es/components/Select/utils/index.js +1 -2
  68. package/emotion/es/components/Select/utils/initialItemsTransform.js +6 -19
  69. package/emotion/es/components/ViewContainer/ViewContainer.js +40 -0
  70. package/emotion/es/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
  71. package/emotion/es/components/ViewContainer/_view/base.js +2 -0
  72. package/emotion/es/components/ViewContainer/_view/tokens.json +1 -0
  73. package/emotion/es/components/ViewContainer/index.js +1 -0
  74. package/emotion/es/examples/_helpers.js +3 -14
  75. package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
  76. package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +10 -0
  77. package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +5 -0
  78. package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  79. package/emotion/es/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
  80. package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +10 -0
  81. package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +5 -0
  82. package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  83. package/emotion/es/index.js +2 -1
  84. package/es/components/Combobox/ComboboxNew/Combobox.js +22 -27
  85. package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  86. package/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -9
  87. package/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js.map +1 -1
  88. package/es/components/Drawer/Drawer.js +2 -1
  89. package/es/components/Drawer/Drawer.js.map +1 -1
  90. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  91. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  92. package/es/components/Select/Select.js +26 -14
  93. package/es/components/Select/Select.js.map +1 -1
  94. package/es/components/Select/hooks/useKeyboardNavigation.js +1 -1
  95. package/es/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
  96. package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  97. package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
  98. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  99. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  100. package/es/components/Select/utils/getButtonLabel.js +1 -1
  101. package/es/components/Select/utils/getButtonLabel.js.map +1 -1
  102. package/es/components/Select/utils/initialItemsTransform.js +6 -9
  103. package/es/components/Select/utils/initialItemsTransform.js.map +1 -1
  104. package/es/components/ViewContainer/ViewContainer.js +33 -0
  105. package/es/components/ViewContainer/ViewContainer.js.map +1 -0
  106. package/es/components/ViewContainer/ViewContainer_yiqfcb.css +1 -0
  107. package/es/components/ViewContainer/_view/base.js +5 -0
  108. package/es/components/ViewContainer/_view/base.js.map +1 -0
  109. package/es/components/ViewContainer/_view/base_x642ct.css +1 -0
  110. package/es/index.css +2 -0
  111. package/es/index.js +1 -0
  112. package/es/index.js.map +1 -1
  113. package/package.json +3 -2
  114. package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -26
  115. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/index.js +1 -8
  116. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
  117. package/styled-components/cjs/components/Drawer/Drawer.js +4 -3
  118. package/styled-components/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  119. package/styled-components/cjs/components/Select/Select.js +25 -12
  120. package/styled-components/cjs/components/Select/hooks/useKeyboardNavigation.js +1 -1
  121. package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  122. package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  123. package/styled-components/cjs/components/Select/utils/getButtonLabel.js +1 -1
  124. package/styled-components/cjs/components/Select/utils/index.js +1 -8
  125. package/styled-components/cjs/components/Select/utils/initialItemsTransform.js +6 -19
  126. package/styled-components/cjs/components/ViewContainer/ViewContainer.js +40 -0
  127. package/styled-components/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
  128. package/styled-components/cjs/components/ViewContainer/_view/base.js +8 -0
  129. package/styled-components/cjs/components/ViewContainer/_view/tokens.json +1 -0
  130. package/styled-components/cjs/components/ViewContainer/index.js +18 -0
  131. package/styled-components/cjs/examples/_helpers.js +3 -14
  132. package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
  133. package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +16 -0
  134. package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +11 -0
  135. package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  136. package/styled-components/cjs/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
  137. package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +16 -0
  138. package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +11 -0
  139. package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  140. package/styled-components/cjs/index.js +11 -0
  141. package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +23 -27
  142. package/styled-components/es/components/Combobox/ComboboxNew/utils/index.js +1 -2
  143. package/styled-components/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
  144. package/styled-components/es/components/Drawer/Drawer.js +2 -1
  145. package/styled-components/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  146. package/styled-components/es/components/Select/Select.js +26 -13
  147. package/styled-components/es/components/Select/hooks/useKeyboardNavigation.js +1 -1
  148. package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
  149. package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  150. package/styled-components/es/components/Select/utils/getButtonLabel.js +1 -1
  151. package/styled-components/es/components/Select/utils/index.js +1 -2
  152. package/styled-components/es/components/Select/utils/initialItemsTransform.js +6 -19
  153. package/styled-components/es/components/ViewContainer/ViewContainer.js +31 -0
  154. package/styled-components/es/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
  155. package/styled-components/es/components/ViewContainer/_view/base.js +2 -0
  156. package/styled-components/es/components/ViewContainer/_view/tokens.json +1 -0
  157. package/styled-components/es/components/ViewContainer/index.js +1 -0
  158. package/styled-components/es/examples/_helpers.js +3 -14
  159. package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
  160. package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +10 -0
  161. package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +5 -0
  162. package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  163. package/styled-components/es/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
  164. package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +10 -0
  165. package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +5 -0
  166. package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
  167. package/styled-components/es/index.js +2 -1
  168. package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
  169. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +3 -14
  170. package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
  171. package/types/components/Combobox/ComboboxNew/utils/index.d.ts +0 -1
  172. package/types/components/Combobox/ComboboxNew/utils/index.d.ts.map +1 -1
  173. package/types/components/Combobox/ComboboxNew/utils/initialItemsTransform.d.ts.map +1 -1
  174. package/types/components/Drawer/Drawer.d.ts.map +1 -1
  175. package/types/components/Select/Select.d.ts.map +1 -1
  176. package/types/components/Select/Select.types.d.ts +0 -1
  177. package/types/components/Select/Select.types.d.ts.map +1 -1
  178. package/types/components/Select/hooks/useKeyboardNavigation.d.ts +2 -2
  179. package/types/components/Select/hooks/useKeyboardNavigation.d.ts.map +1 -1
  180. package/types/components/Select/ui/Target/Target.types.d.ts +2 -2
  181. package/types/components/Select/ui/Target/Target.types.d.ts.map +1 -1
  182. package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts +4 -4
  183. package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts.map +1 -1
  184. package/types/components/Select/utils/index.d.ts +0 -1
  185. package/types/components/Select/utils/index.d.ts.map +1 -1
  186. package/types/components/Select/utils/initialItemsTransform.d.ts.map +1 -1
  187. package/types/components/ViewContainer/ViewContainer.d.ts +26 -0
  188. package/types/components/ViewContainer/ViewContainer.d.ts.map +1 -0
  189. package/types/components/ViewContainer/_view/base.d.ts +2 -0
  190. package/types/components/ViewContainer/_view/base.d.ts.map +1 -0
  191. package/types/components/ViewContainer/index.d.ts +2 -0
  192. package/types/components/ViewContainer/index.d.ts.map +1 -0
  193. package/types/examples/_helpers.d.ts.map +1 -1
  194. package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +6 -30
  195. package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts.map +1 -1
  196. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts +9 -0
  197. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts.map +1 -0
  198. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts +8 -0
  199. package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts.map +1 -0
  200. package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +6 -30
  201. package/types/examples/plasma_web/components/Combobox/Combobox.d.ts.map +1 -1
  202. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts +9 -0
  203. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts.map +1 -0
  204. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts +8 -0
  205. package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts.map +1 -0
  206. package/types/index.d.ts +1 -0
  207. package/types/index.d.ts.map +1 -1
  208. package/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -21
  209. package/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js.map +0 -1
  210. package/cjs/components/Select/utils/getInitialValue.js +0 -21
  211. package/cjs/components/Select/utils/getInitialValue.js.map +0 -1
  212. package/emotion/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -20
  213. package/emotion/cjs/components/Select/utils/getInitialValue.js +0 -20
  214. package/emotion/cjs/examples/themes/declaration.d.ts +0 -4
  215. package/emotion/cjs/examples/themes/index.js +0 -15
  216. package/emotion/cjs/examples/themes/plasma_b2c.module.css +0 -984
  217. package/emotion/cjs/examples/themes/plasma_web.module.css +0 -984
  218. package/emotion/es/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -14
  219. package/emotion/es/components/Select/utils/getInitialValue.js +0 -14
  220. package/emotion/es/examples/themes/declaration.d.ts +0 -4
  221. package/emotion/es/examples/themes/index.js +0 -7
  222. package/emotion/es/examples/themes/plasma_b2c.module.css +0 -984
  223. package/emotion/es/examples/themes/plasma_web.module.css +0 -984
  224. package/es/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -17
  225. package/es/components/Combobox/ComboboxNew/utils/getInitialValue.js.map +0 -1
  226. package/es/components/Select/utils/getInitialValue.js +0 -17
  227. package/es/components/Select/utils/getInitialValue.js.map +0 -1
  228. package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -20
  229. package/styled-components/cjs/components/Select/utils/getInitialValue.js +0 -20
  230. package/styled-components/cjs/examples/themes/declaration.d.ts +0 -4
  231. package/styled-components/cjs/examples/themes/index.js +0 -15
  232. package/styled-components/cjs/examples/themes/plasma_b2c.module.css +0 -984
  233. package/styled-components/cjs/examples/themes/plasma_web.module.css +0 -984
  234. package/styled-components/es/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -14
  235. package/styled-components/es/components/Select/utils/getInitialValue.js +0 -14
  236. package/styled-components/es/examples/themes/declaration.d.ts +0 -4
  237. package/styled-components/es/examples/themes/index.js +0 -7
  238. package/styled-components/es/examples/themes/plasma_b2c.module.css +0 -984
  239. package/styled-components/es/examples/themes/plasma_web.module.css +0 -984
  240. package/types/components/Combobox/ComboboxNew/utils/getInitialValue.d.ts +0 -4
  241. package/types/components/Combobox/ComboboxNew/utils/getInitialValue.d.ts.map +0 -1
  242. package/types/components/Select/utils/getInitialValue.d.ts +0 -4
  243. package/types/components/Select/utils/getInitialValue.d.ts.map +0 -1
  244. package/types/examples/themes/index.d.ts +0 -6
  245. package/types/examples/themes/index.d.ts.map +0 -1
@@ -1,31 +1,17 @@
1
1
  "use strict";
2
2
 
3
- 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); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.initialItemsTransform = void 0;
8
- 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; }
9
- 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; }
10
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
14
- 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."); }
15
- 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); }
16
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
17
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
- 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; }
19
7
  // Проходимся по массиву items и добавляем в каждый item ключ parent, который ссылается на item родителя.
20
8
  // Дает возможность прохода к корневому элементу (снизу вверх).
21
- // На выходе получаем глубокую копию исходного массива items.
22
9
  var initialItemsTransform = exports.initialItemsTransform = function initialItemsTransform(items, parent) {
23
- return _toConsumableArray(items).map(function (item) {
24
- var itemCopy = _objectSpread({}, item);
25
- itemCopy.parent = parent;
26
- if (itemCopy.items) {
27
- itemCopy.items = initialItemsTransform(itemCopy.items, itemCopy);
10
+ items.forEach(function (item) {
11
+ item.parent = parent;
12
+ if (item.items) {
13
+ item.items = initialItemsTransform(item.items, item);
28
14
  }
29
- return itemCopy;
30
15
  });
16
+ return items;
31
17
  };
@@ -13,13 +13,14 @@ var _Overlay = /*#__PURE__*/require("../Overlay");
13
13
  var _utils = /*#__PURE__*/require("../Popup/utils");
14
14
  var _Panel = /*#__PURE__*/require("../Panel");
15
15
  var _utils2 = /*#__PURE__*/require("../../utils");
16
+ var _hooks = /*#__PURE__*/require("../../hooks");
16
17
  var _Drawer = /*#__PURE__*/require("./Drawer.tokens");
17
18
  var _base = /*#__PURE__*/require("./variations/_view/base");
18
19
  var _base2 = /*#__PURE__*/require("./variations/_size/base");
19
20
  var _base3 = /*#__PURE__*/require("./variations/_borderRadius/base");
20
21
  var _Drawer2 = /*#__PURE__*/require("./Drawer.styles");
21
22
  var _DrawerContext = /*#__PURE__*/require("./DrawerContext");
22
- var _hooks = /*#__PURE__*/require("./hooks");
23
+ var _hooks2 = /*#__PURE__*/require("./hooks");
23
24
  var _excluded = ["id", "zIndex", "popupInfo", "withBlur", "children", "view", "size", "width", "height", "isOpen", "opened", "initialFocusRef", "focusAfterRef", "className", "onClose", "onOverlayClick", "onEscKeyDown", "offset", "frame", "borderRadius", "placement", "closeOnEsc", "closeOnOverlayClick", "asModal"];
24
25
  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
26
  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; }
@@ -62,7 +63,7 @@ var drawerRoot = exports.drawerRoot = function drawerRoot(Root) {
62
63
  asModal = _ref$asModal === void 0 ? true : _ref$asModal,
63
64
  rest = _objectWithoutProperties(_ref, _excluded);
64
65
  var innerIsOpen = Boolean(isOpen || opened);
65
- var trapRef = (0, _plasmaCore.useFocusTrap)(true, initialFocusRef, focusAfterRef);
66
+ var trapRef = (0, _hooks.useFocusTrap)(true, initialFocusRef, focusAfterRef);
66
67
  var popupController = (0, _Popup.usePopupContext)();
67
68
  var innerRef = (0, _plasmaCore.useForkRef)(trapRef, outerRef);
68
69
  var uniqId = (0, _plasmaCore.safeUseId)();
@@ -71,7 +72,7 @@ var drawerRoot = exports.drawerRoot = function drawerRoot(Root) {
71
72
  var innerWidth = width ? (0, _utils2.getSizeValueFromProp)(width) : '100%';
72
73
  var innerHeight = height ? (0, _utils2.getSizeValueFromProp)(height) : '100%';
73
74
  var placementClass = placement ? _Drawer.classes["".concat(placement, "Placement")] : undefined;
74
- var _useDrawer = (0, _hooks.useDrawer)({
75
+ var _useDrawer = (0, _hooks2.useDrawer)({
75
76
  id: innerId,
76
77
  isOpen: innerIsOpen,
77
78
  closeOnEsc: closeOnEsc,
@@ -24,8 +24,8 @@ var PaginationSelectPerPage = exports.PaginationSelectPerPage = function Paginat
24
24
  listWidth = _ref.listWidth,
25
25
  rest = _objectWithoutProperties(_ref, _excluded);
26
26
  var handleSelectChange = function handleSelectChange(newValue) {
27
- if (newValue && !Array.isArray(newValue) && onChangeValue) {
28
- onChangeValue(Number(newValue));
27
+ if (newValue) {
28
+ onChangeValue === null || onChangeValue === void 0 || onChangeValue(Number(newValue));
29
29
  }
30
30
  };
31
31
  var transformedList = perPageList.map(function (num) {
@@ -67,6 +67,17 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
67
67
  separator = props.separator,
68
68
  outerCloseAfterSelect = props.closeAfterSelect,
69
69
  rest = _objectWithoutProperties(props, _excluded);
70
+ var _useState = (0, _react.useState)(outerValue || props.multiselect ? [] : ''),
71
+ _useState2 = _slicedToArray(_useState, 2),
72
+ internalValue = _useState2[0],
73
+ setInternalValue = _useState2[1];
74
+ var value = outerValue || internalValue;
75
+ var onChange = function onChange(e) {
76
+ if (outerOnChange) {
77
+ outerOnChange(e);
78
+ }
79
+ setInternalValue(e);
80
+ };
70
81
  var transformedItems = (0, _react.useMemo)(function () {
71
82
  return (0, _utils2.initialItemsTransform)(items || []);
72
83
  }, [items]);
@@ -76,12 +87,6 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
76
87
  focusedToValueMap = _usePathMaps2[1],
77
88
  valueToCheckedMap = _usePathMaps2[2],
78
89
  valueToItemMap = _usePathMaps2[3];
79
- var value = (0, _utils2.getInitialValue)(outerValue, valueToItemMap);
80
- var onChange = function onChange(e) {
81
- if (outerOnChange) {
82
- outerOnChange(e);
83
- }
84
- };
85
90
  var _useReducer = (0, _react.useReducer)(_reducers.pathReducer, []),
86
91
  _useReducer2 = _slicedToArray(_useReducer, 2),
87
92
  path = _useReducer2[0],
@@ -94,10 +99,10 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
94
99
  _useReducer6 = _slicedToArray(_useReducer5, 2),
95
100
  focusedChipIndex = _useReducer6[0],
96
101
  dispatchFocusedChipIndex = _useReducer6[1];
97
- var _useState = (0, _react.useState)(valueToCheckedMap),
98
- _useState2 = _slicedToArray(_useState, 2),
99
- checked = _useState2[0],
100
- setChecked = _useState2[1];
102
+ var _useState3 = (0, _react.useState)(valueToCheckedMap),
103
+ _useState4 = _slicedToArray(_useState3, 2),
104
+ checked = _useState4[0],
105
+ setChecked = _useState4[1];
101
106
  var closeAfterSelect = outerCloseAfterSelect !== null && outerCloseAfterSelect !== void 0 ? outerCloseAfterSelect : !props.multiselect;
102
107
  var targetRef = (0, _hooks.useOutsideClick)(function () {
103
108
  if (focusedChipIndex != null) {
@@ -163,7 +168,15 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
163
168
  if (e) {
164
169
  e.stopPropagation();
165
170
  }
166
- var isCurrentChecked = checked.get(item.value);
171
+ var checkedCopy = new Map(checked);
172
+ var isCurrentChecked = checkedCopy.get(item.value);
173
+ checkedCopy.forEach(function (_, key) {
174
+ checkedCopy.set(key, false);
175
+ });
176
+ if (!isCurrentChecked) {
177
+ checkedCopy.set(item.value, 'done');
178
+ (0, _utils2.updateSingleAncestors)(item, checkedCopy, 'dot');
179
+ }
167
180
  if (closeAfterSelect) {
168
181
  dispatchPath({
169
182
  type: 'reset'
@@ -235,7 +248,7 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
235
248
  }
236
249
  }
237
250
  setChecked(checkedCopy);
238
- }, [outerValue, items]);
251
+ }, [value]);
239
252
  return /*#__PURE__*/_react["default"].createElement(Root, _extends({
240
253
  ref: ref,
241
254
  size: size,
@@ -159,7 +159,7 @@ var useKeyNavigation = exports.useKeyNavigation = function useKeyNavigation(_ref
159
159
  }
160
160
  case keys.Backspace:
161
161
  {
162
- if (!multiselect || !Array.isArray(value)) break;
162
+ if (!multiselect) break;
163
163
  if (focusedChipIndex !== null) {
164
164
  var _currentItem = valueToItemMap.get(value[focusedChipIndex]);
165
165
  handlePressDown(_currentItem);
@@ -41,7 +41,7 @@ var getLabel = function getLabel(_ref) {
41
41
  text: renderValue ? renderValue(valueToItemMap.get(currentValue)) : itemLabel,
42
42
  onClick: function onClick(e) {
43
43
  e.stopPropagation();
44
- onChipClick(currentValue.toString());
44
+ onChipClick(currentValue);
45
45
  },
46
46
  focused: focusedChipIndex === index
47
47
  });
@@ -54,7 +54,7 @@ var ChipWrapper = exports.ChipWrapper = /*#__PURE__*/_styledComponents["default"
54
54
  })(["width:100%;display:flex;min-width:0;padding:", ";gap:0.25rem;overflow-x:scroll;border-top-right-radius:var(", ");border-bottom-right-radius:var(", ");-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"], function (_ref6) {
55
55
  var multiselect = _ref6.multiselect,
56
56
  value = _ref6.value;
57
- return "calc(".concat(_Select.constants.focusSize, " + ").concat(multiselect && value && value.toString().length > 0 ? "var(".concat(_Select.tokens.focusOffset, ")") : 0, ")");
57
+ return "calc(".concat(_Select.constants.focusSize, " + ").concat(multiselect && value && value.length > 0 ? "var(".concat(_Select.tokens.focusOffset, ")") : 0, ")");
58
58
  }, _Select.tokens.chipBorderRadius, _Select.tokens.chipBorderRadius);
59
59
  var Label = exports.Label = /*#__PURE__*/_styledComponents["default"].label.withConfig({
60
60
  componentId: "plasma-new-hope__sc-1akl2tk-6"
@@ -22,7 +22,7 @@ var getButtonLabel = exports.getButtonLabel = function getButtonLabel(_ref3) {
22
22
  if ((0, _utils.isEmpty)(value) && typeof value !== 'number') {
23
23
  return label || '';
24
24
  }
25
- if (selectProps.multiselect && Array.isArray(value) && selectProps.isTargetAmount) {
25
+ if (selectProps.multiselect && selectProps.isTargetAmount) {
26
26
  return "\u0412\u044B\u0431\u0440\u0430\u043D\u043E: ".concat(value.length);
27
27
  }
28
28
  if (selectProps.multiselect && Array.isArray(value)) {
@@ -15,12 +15,6 @@ Object.defineProperty(exports, "getCorrectHeight", {
15
15
  return _getCorrectHeight.getCorrectHeight;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "getInitialValue", {
19
- enumerable: true,
20
- get: function get() {
21
- return _getInitialValue.getInitialValue;
22
- }
23
- });
24
18
  Object.defineProperty(exports, "getView", {
25
19
  enumerable: true,
26
20
  get: function get() {
@@ -64,5 +58,4 @@ var _updateSingleAncestors = /*#__PURE__*/require("./updateSingleAncestors");
64
58
  var _sizeToIconSize = /*#__PURE__*/require("./sizeToIconSize");
65
59
  var _getCorrectHeight = /*#__PURE__*/require("./getCorrectHeight");
66
60
  var _getButtonLabel = /*#__PURE__*/require("./getButtonLabel");
67
- var _getView = /*#__PURE__*/require("./getView");
68
- var _getInitialValue = /*#__PURE__*/require("./getInitialValue");
61
+ var _getView = /*#__PURE__*/require("./getView");
@@ -1,31 +1,18 @@
1
1
  "use strict";
2
2
 
3
- 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); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.initialItemsTransform = void 0;
8
- 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; }
9
- 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; }
10
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
14
- 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."); }
15
- 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); }
16
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
17
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
- 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; }
19
7
  // Проходимся по массиву items и добавляем в каждый item ключ parent, который ссылается на item родителя.
20
8
  // Дает возможность прохода к корневому элементу (снизу вверх).
21
- // На выходе получаем глубокую копию исходного массива items.
9
+
22
10
  var initialItemsTransform = exports.initialItemsTransform = function initialItemsTransform(items, parent) {
23
- return _toConsumableArray(items).map(function (item) {
24
- var itemCopy = _objectSpread({}, item);
25
- itemCopy.parent = parent;
26
- if (itemCopy.items) {
27
- itemCopy.items = initialItemsTransform(itemCopy.items, itemCopy);
11
+ items.forEach(function (item) {
12
+ item.parent = parent;
13
+ if (item.items) {
14
+ item.items = initialItemsTransform(item.items, item);
28
15
  }
29
- return itemCopy;
30
16
  });
17
+ return items;
31
18
  };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.viewContainerRoot = exports.viewContainerConfig = void 0;
8
+ var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
9
+ var _styledComponents = /*#__PURE__*/require("styled-components");
10
+ var _base = /*#__PURE__*/require("./_view/base");
11
+ var _excluded = ["children"];
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
+ 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
+ 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
+ var base = /*#__PURE__*/(0, _styledComponents.css)(["position:relative;"]);
18
+ var viewContainerRoot = exports.viewContainerRoot = function viewContainerRoot(Root) {
19
+ return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
20
+ var children = props.children,
21
+ rest = _objectWithoutProperties(props, _excluded);
22
+ return /*#__PURE__*/_react["default"].createElement(Root, _extends({
23
+ ref: ref
24
+ }, rest), children);
25
+ });
26
+ };
27
+ var viewContainerConfig = exports.viewContainerConfig = {
28
+ name: 'ViewContainer',
29
+ tag: 'div',
30
+ layout: viewContainerRoot,
31
+ base: base,
32
+ variations: {
33
+ view: {
34
+ css: _base.base
35
+ }
36
+ },
37
+ defaults: {
38
+ view: undefined
39
+ }
40
+ };
@@ -0,0 +1,82 @@
1
+ ---
2
+ id: viewContainer
3
+ title: ViewContainer
4
+ ---
5
+
6
+ import { PropsTable, Description } from '@site/src/components';
7
+
8
+ # ViewContainer
9
+ <Description name="ViewContainer" />
10
+ <PropsTable name="ViewContainer" exclude={['css']} />
11
+
12
+ # Описание
13
+
14
+ Данный компонент представляет собой обёртку, которая инвертирует токены компонент, которые в неё помещены, в зависимости от выбранного значения свойства view - `onDark` или `onLight`.
15
+
16
+ При этом, независимо от режима темы (тёмный или светлый) для всего приложения, токены внутри не будут меняться.
17
+
18
+ Этот механизм необходим для случаев, когда требуется отобразить компонент на специфичном бэкграунде, чтобы избежать наложение цветов.
19
+
20
+ # Пример использования
21
+
22
+ ```tsx live
23
+ import React from 'react';
24
+ import { ViewContainer, Button, Checkbox, TextField } from '@salutejs/{{ package }}';
25
+
26
+ export function App() {
27
+ return (
28
+ <div>
29
+ <ViewContainer
30
+ style=\{{
31
+ padding: '1rem',
32
+ borderRadius: '1rem',
33
+ display: 'flex',
34
+ flexDirection: 'column',
35
+ gap: '1rem',
36
+ }}
37
+ >
38
+ <h3 style=\{{ margin: 0 }}>Inside default ViewContainer</h3>
39
+ <Button text="default Button" />
40
+ <Checkbox checked label="Label" />
41
+ <TextField value="Example Value" label="Label" labelPlacement="inner" />
42
+ </ViewContainer>
43
+ <br />
44
+ <ViewContainer
45
+ view="onDark"
46
+ style=\{{
47
+ background: '#1a1a1a',
48
+ color: 'white',
49
+ padding: '1rem',
50
+ borderRadius: '1rem',
51
+ display: 'flex',
52
+ flexDirection: 'column',
53
+ gap: '1rem',
54
+ }}
55
+ >
56
+ <h3 style=\{{ margin: 0 }}>Inside onDark ViewContainer</h3>
57
+ <Button text="default Button" />
58
+ <Checkbox checked label="Label" />
59
+ <TextField value="Example Value" label="Label" labelPlacement="inner" />
60
+ </ViewContainer>
61
+ <br />
62
+ <ViewContainer
63
+ view="onLight"
64
+ style=\{{
65
+ background: '#ededed',
66
+ color: 'black',
67
+ padding: '1rem',
68
+ borderRadius: '1rem',
69
+ display: 'flex',
70
+ flexDirection: 'column',
71
+ gap: '1rem',
72
+ }}
73
+ >
74
+ <h3 style=\{{ margin: 0 }}>Inside onLight ViewContainer</h3>
75
+ <Button text="default Button" />
76
+ <Checkbox checked label="Label" />
77
+ <TextField value="Example Value" label="Label" labelPlacement="inner" />
78
+ </ViewContainer>
79
+ </div>
80
+ );
81
+ }
82
+ ```
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)([""]);
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "viewContainerConfig", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _ViewContainer.viewContainerConfig;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "viewContainerRoot", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _ViewContainer.viewContainerRoot;
16
+ }
17
+ });
18
+ var _ViewContainer = /*#__PURE__*/require("./ViewContainer");
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.WithTheme = void 0;
7
7
  exports.argTypesFromConfig = argTypesFromConfig;
8
8
  var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
9
- var _themes = /*#__PURE__*/require("./themes");
10
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
10
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
12
11
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -15,19 +14,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
15
14
  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; }
16
15
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
16
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
- var WithTheme = exports.WithTheme = function WithTheme(Story, context) {
19
- var _themes$themeName;
20
- var themeType = context.globals.theme;
21
- var themeName = context.title.split('/')[0];
22
- return /*#__PURE__*/_react["default"].createElement("div", {
23
- id: "theme-root",
24
- className: _themes.themes === null || _themes.themes === void 0 || (_themes$themeName = _themes.themes[themeName]) === null || _themes$themeName === void 0 ? void 0 : _themes$themeName[themeType],
25
- style: {
26
- padding: '1rem',
27
- minHeight: '100vh',
28
- boxSizing: 'border-box'
29
- }
30
- }, /*#__PURE__*/_react["default"].createElement(Story, null));
17
+ // TODO: Удалить в отдельном пр из всех компонент
18
+ var WithTheme = exports.WithTheme = function WithTheme(Story) {
19
+ return /*#__PURE__*/_react["default"].createElement(Story, null);
31
20
  };
32
21
  function argTypesFromConfig(config) {
33
22
  var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
@@ -68,10 +68,6 @@ const meta: Meta<StorySelectProps> = {
68
68
  control: { type: 'boolean' },
69
69
  if: { arg: 'alwaysOpened', truthy: false },
70
70
  },
71
- targetAmount: {
72
- control: { type: 'number' },
73
- if: { arg: 'isTargetAmount', truthy: true },
74
- },
75
71
  },
76
72
  args: {
77
73
  label: 'Label',
@@ -82,7 +78,6 @@ const meta: Meta<StorySelectProps> = {
82
78
  view: 'default',
83
79
  enableContentLeft: false,
84
80
  isTargetAmount: false,
85
- targetAmount: undefined,
86
81
  variant: 'normal',
87
82
  alwaysOpened: false,
88
83
  disabled: false,
@@ -99,7 +94,6 @@ const meta: Meta<StorySelectProps> = {
99
94
  'placeholder',
100
95
  'helperText',
101
96
  'isTargetAmount',
102
- 'targetAmount',
103
97
  'closeAfterSelect',
104
98
  'alwaysOpened',
105
99
  'variant',
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.config = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var _plasma_b2c = /*#__PURE__*/require("@salutejs/plasma-themes/tokens/plasma_b2c");
9
+ var config = exports.config = {
10
+ variations: {
11
+ view: {
12
+ onDark: /*#__PURE__*/(0, _styledComponents.css)(["", ""], _plasma_b2c.viewContainer.dark),
13
+ onLight: /*#__PURE__*/(0, _styledComponents.css)(["", ""], _plasma_b2c.viewContainer.light)
14
+ }
15
+ }
16
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ViewContainer = void 0;
7
+ var _ViewContainer = /*#__PURE__*/require("../../../../components/ViewContainer");
8
+ var _engines = /*#__PURE__*/require("../../../../engines");
9
+ var _ViewContainer2 = /*#__PURE__*/require("./ViewContainer.config");
10
+ var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_ViewContainer.viewContainerConfig, _ViewContainer2.config);
11
+ var ViewContainer = exports.ViewContainer = /*#__PURE__*/(0, _engines.component)(mergedConfig);
@@ -0,0 +1,65 @@
1
+ import React, { ComponentProps } from 'react';
2
+ import type { StoryObj, Meta } from '@storybook/react';
3
+
4
+ import { Button } from '../Button/Button';
5
+ import { TextField } from '../TextField/TextField';
6
+ import { Checkbox } from '../Checkbox/Checkbox';
7
+
8
+ import { ViewContainer } from './ViewContainer';
9
+
10
+ type StoryViewProps = ComponentProps<typeof ViewContainer>;
11
+
12
+ const meta: Meta<StoryViewProps> = {
13
+ title: 'plasma_b2c/ViewContainer',
14
+ };
15
+
16
+ export default meta;
17
+
18
+ type Story = StoryObj<StoryViewProps>;
19
+
20
+ const ViewExample = ({ view }: StoryViewProps) => {
21
+ const style = view
22
+ ? {
23
+ background: view === 'onDark' ? '#1a1a1a' : '#ededed',
24
+ color: view === 'onDark' ? 'white' : 'black',
25
+ }
26
+ : undefined;
27
+
28
+ return (
29
+ <>
30
+ <h4>view: {view ?? 'default'}</h4>
31
+ <div>
32
+ <ViewContainer
33
+ view={view}
34
+ style={{
35
+ ...style,
36
+ padding: '1rem',
37
+ borderRadius: '1rem',
38
+ display: 'flex',
39
+ flexDirection: 'column',
40
+ gap: '1rem',
41
+ }}
42
+ >
43
+ <h3 style={{ margin: 0 }}>Inside ViewContainer</h3>
44
+ <Button text="default Button" />
45
+ <Checkbox checked label="Label" />
46
+ <TextField value="Example Value" label="Label" labelPlacement="inner" />
47
+ </ViewContainer>
48
+ </div>
49
+ </>
50
+ );
51
+ };
52
+
53
+ export const Default: Story = {
54
+ render: () => {
55
+ return (
56
+ <>
57
+ <ViewExample />
58
+ <br />
59
+ <ViewExample view="onDark" />
60
+ <br />
61
+ <ViewExample view="onLight" />
62
+ </>
63
+ );
64
+ },
65
+ };
@@ -68,10 +68,6 @@ const meta: Meta<StorySelectProps> = {
68
68
  control: { type: 'boolean' },
69
69
  if: { arg: 'alwaysOpened', truthy: false },
70
70
  },
71
- targetAmount: {
72
- control: { type: 'number' },
73
- if: { arg: 'isTargetAmount', truthy: true },
74
- },
75
71
  },
76
72
  args: {
77
73
  label: 'Label',
@@ -82,7 +78,6 @@ const meta: Meta<StorySelectProps> = {
82
78
  view: 'default',
83
79
  enableContentLeft: false,
84
80
  isTargetAmount: false,
85
- targetAmount: undefined,
86
81
  variant: 'normal',
87
82
  alwaysOpened: false,
88
83
  disabled: false,
@@ -99,7 +94,6 @@ const meta: Meta<StorySelectProps> = {
99
94
  'placeholder',
100
95
  'helperText',
101
96
  'isTargetAmount',
102
- 'targetAmount',
103
97
  'closeAfterSelect',
104
98
  'alwaysOpened',
105
99
  'variant',
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.config = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var _plasma_b2c = /*#__PURE__*/require("@salutejs/plasma-themes/tokens/plasma_b2c");
9
+ var config = exports.config = {
10
+ variations: {
11
+ view: {
12
+ onDark: /*#__PURE__*/(0, _styledComponents.css)(["", ""], _plasma_b2c.viewContainer.dark),
13
+ onLight: /*#__PURE__*/(0, _styledComponents.css)(["", ""], _plasma_b2c.viewContainer.light)
14
+ }
15
+ }
16
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ViewContainer = void 0;
7
+ var _ViewContainer = /*#__PURE__*/require("../../../../components/ViewContainer");
8
+ var _engines = /*#__PURE__*/require("../../../../engines");
9
+ var _ViewContainer2 = /*#__PURE__*/require("./ViewContainer.config");
10
+ var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_ViewContainer.viewContainerConfig, _ViewContainer2.config);
11
+ var ViewContainer = exports.ViewContainer = /*#__PURE__*/(0, _engines.component)(mergedConfig);