@salutejs/plasma-new-hope 0.88.0-canary.1252.9517095860.0 → 0.88.0-canary.1254.9538803694.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. package/cjs/components/Accordion/Accordion.css +1 -0
  2. package/cjs/components/Accordion/Accordion.js +81 -0
  3. package/cjs/components/Accordion/Accordion.js.map +1 -0
  4. package/cjs/components/Accordion/Accordion.styles.js +9 -0
  5. package/cjs/components/Accordion/Accordion.styles.js.map +1 -0
  6. package/cjs/components/Accordion/Accordion.styles_rsiff6.css +1 -0
  7. package/cjs/components/Accordion/Accordion.tokens.js +45 -0
  8. package/cjs/components/Accordion/Accordion.tokens.js.map +1 -0
  9. package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js +97 -0
  10. package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js.map +1 -0
  11. package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +63 -0
  12. package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -0
  13. package/cjs/components/Accordion/utils/index.js +30 -0
  14. package/cjs/components/Accordion/utils/index.js.map +1 -0
  15. package/cjs/components/Accordion/variations/_size/base.js +9 -0
  16. package/cjs/components/Accordion/variations/_size/base.js.map +1 -0
  17. package/cjs/components/Accordion/variations/_size/base_x642ct.css +1 -0
  18. package/cjs/components/Accordion/variations/_view/base.js +9 -0
  19. package/cjs/components/Accordion/variations/_view/base.js.map +1 -0
  20. package/cjs/components/Accordion/variations/_view/base_x642ct.css +1 -0
  21. package/cjs/components/Segment/SegmentProvider/SegmentProvider.js +1 -4
  22. package/cjs/components/Segment/SegmentProvider/SegmentProvider.js.map +1 -1
  23. package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +2 -9
  24. package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
  25. package/cjs/components/_Icon/Icon.assets/ChevronDownFill.js +24 -0
  26. package/cjs/components/_Icon/Icon.assets/ChevronDownFill.js.map +1 -0
  27. package/cjs/components/_Icon/Icon.assets/Minus.js +22 -0
  28. package/cjs/components/_Icon/Icon.assets/Minus.js.map +1 -0
  29. package/cjs/components/_Icon/Icons/IconChevronDownFill.js +23 -0
  30. package/cjs/components/_Icon/Icons/IconChevronDownFill.js.map +1 -0
  31. package/cjs/components/_Icon/Icons/IconMinus.js +23 -0
  32. package/cjs/components/_Icon/Icons/IconMinus.js.map +1 -0
  33. package/cjs/index.css +2 -0
  34. package/cjs/index.js +8 -0
  35. package/cjs/index.js.map +1 -1
  36. package/es/components/Accordion/Accordion.css +1 -0
  37. package/es/components/Accordion/Accordion.js +76 -0
  38. package/es/components/Accordion/Accordion.js.map +1 -0
  39. package/es/components/Accordion/Accordion.styles.js +5 -0
  40. package/es/components/Accordion/Accordion.styles.js.map +1 -0
  41. package/es/components/Accordion/Accordion.styles_rsiff6.css +1 -0
  42. package/es/components/Accordion/Accordion.tokens.js +40 -0
  43. package/es/components/Accordion/Accordion.tokens.js.map +1 -0
  44. package/es/components/Accordion/ui/AccordionItem/AccordionItem.js +93 -0
  45. package/es/components/Accordion/ui/AccordionItem/AccordionItem.js.map +1 -0
  46. package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +49 -0
  47. package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -0
  48. package/es/components/Accordion/utils/index.js +25 -0
  49. package/es/components/Accordion/utils/index.js.map +1 -0
  50. package/es/components/Accordion/variations/_size/base.js +5 -0
  51. package/es/components/Accordion/variations/_size/base.js.map +1 -0
  52. package/es/components/Accordion/variations/_size/base_x642ct.css +1 -0
  53. package/es/components/Accordion/variations/_view/base.js +5 -0
  54. package/es/components/Accordion/variations/_view/base.js.map +1 -0
  55. package/es/components/Accordion/variations/_view/base_x642ct.css +1 -0
  56. package/es/components/Segment/SegmentProvider/SegmentProvider.js +1 -4
  57. package/es/components/Segment/SegmentProvider/SegmentProvider.js.map +1 -1
  58. package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js +2 -9
  59. package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
  60. package/es/components/_Icon/Icon.assets/ChevronDownFill.js +20 -0
  61. package/es/components/_Icon/Icon.assets/ChevronDownFill.js.map +1 -0
  62. package/es/components/_Icon/Icon.assets/Minus.js +18 -0
  63. package/es/components/_Icon/Icon.assets/Minus.js.map +1 -0
  64. package/es/components/_Icon/Icons/IconChevronDownFill.js +19 -0
  65. package/es/components/_Icon/Icons/IconChevronDownFill.js.map +1 -0
  66. package/es/components/_Icon/Icons/IconMinus.js +19 -0
  67. package/es/components/_Icon/Icons/IconMinus.js.map +1 -0
  68. package/es/index.css +2 -0
  69. package/es/index.js +3 -0
  70. package/es/index.js.map +1 -1
  71. package/package.json +2 -2
  72. package/styled-components/cjs/components/Accordion/Accordion.js +90 -0
  73. package/styled-components/cjs/components/Accordion/Accordion.styles.js +9 -0
  74. package/styled-components/cjs/components/Accordion/Accordion.tokens.js +43 -0
  75. package/styled-components/cjs/components/Accordion/Accordion.types.js +5 -0
  76. package/styled-components/cjs/components/Accordion/index.js +38 -0
  77. package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js +103 -0
  78. package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +49 -0
  79. package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.types.js +5 -0
  80. package/styled-components/cjs/components/Accordion/utils/index.js +27 -0
  81. package/styled-components/cjs/components/Accordion/variations/_size/base.js +8 -0
  82. package/styled-components/cjs/components/Accordion/variations/_size/tokens.json +6 -0
  83. package/styled-components/cjs/components/Accordion/variations/_stretching/base.js +8 -0
  84. package/styled-components/cjs/components/Accordion/variations/_stretching/tokens.json +1 -0
  85. package/styled-components/cjs/components/Accordion/variations/_view/base.js +8 -0
  86. package/styled-components/cjs/components/Accordion/variations/_view/tokens.json +8 -0
  87. package/styled-components/cjs/components/Segment/Segment.template-doc.mdx +1 -6
  88. package/styled-components/cjs/components/Segment/SegmentProvider/SegmentProvider.js +1 -4
  89. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +2 -9
  90. package/styled-components/cjs/components/_Icon/Icon.assets/ChevronDownFill.js +23 -0
  91. package/styled-components/cjs/components/_Icon/Icon.assets/Minus.js +21 -0
  92. package/styled-components/cjs/components/_Icon/Icons/IconChevronDownFill.js +22 -0
  93. package/styled-components/cjs/components/_Icon/Icons/IconMinus.js +22 -0
  94. package/styled-components/cjs/components/_Icon/index.js +15 -1
  95. package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.config.js +26 -0
  96. package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.js +17 -0
  97. package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.stories.tsx +66 -0
  98. package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.config.js +30 -0
  99. package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.js +17 -0
  100. package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.stories.tsx +65 -0
  101. package/styled-components/cjs/index.js +11 -0
  102. package/styled-components/es/components/Accordion/Accordion.js +81 -0
  103. package/styled-components/es/components/Accordion/Accordion.styles.js +3 -0
  104. package/styled-components/es/components/Accordion/Accordion.tokens.js +37 -0
  105. package/styled-components/es/components/Accordion/Accordion.types.js +1 -0
  106. package/styled-components/es/components/Accordion/index.js +3 -0
  107. package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.js +94 -0
  108. package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +42 -0
  109. package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.types.js +1 -0
  110. package/styled-components/es/components/Accordion/utils/index.js +21 -0
  111. package/styled-components/es/components/Accordion/variations/_size/base.js +2 -0
  112. package/styled-components/es/components/Accordion/variations/_size/tokens.json +6 -0
  113. package/styled-components/es/components/Accordion/variations/_stretching/base.js +2 -0
  114. package/styled-components/es/components/Accordion/variations/_stretching/tokens.json +1 -0
  115. package/styled-components/es/components/Accordion/variations/_view/base.js +2 -0
  116. package/styled-components/es/components/Accordion/variations/_view/tokens.json +8 -0
  117. package/styled-components/es/components/Segment/Segment.template-doc.mdx +1 -6
  118. package/styled-components/es/components/Segment/SegmentProvider/SegmentProvider.js +1 -4
  119. package/styled-components/es/components/Segment/ui/SegmentGroup/SegmentGroup.js +2 -9
  120. package/styled-components/es/components/_Icon/Icon.assets/ChevronDownFill.js +16 -0
  121. package/styled-components/es/components/_Icon/Icon.assets/Minus.js +14 -0
  122. package/styled-components/es/components/_Icon/Icons/IconChevronDownFill.js +15 -0
  123. package/styled-components/es/components/_Icon/Icons/IconMinus.js +15 -0
  124. package/styled-components/es/components/_Icon/index.js +3 -1
  125. package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.config.js +20 -0
  126. package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.js +6 -0
  127. package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.stories.tsx +66 -0
  128. package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.config.js +24 -0
  129. package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.js +6 -0
  130. package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.stories.tsx +65 -0
  131. package/styled-components/es/index.js +2 -1
  132. package/types/components/Accordion/Accordion.d.ts +43 -0
  133. package/types/components/Accordion/Accordion.d.ts.map +1 -0
  134. package/types/components/Accordion/Accordion.styles.d.ts +2 -0
  135. package/types/components/Accordion/Accordion.styles.d.ts.map +1 -0
  136. package/types/components/Accordion/Accordion.tokens.d.ts +38 -0
  137. package/types/components/Accordion/Accordion.tokens.d.ts.map +1 -0
  138. package/types/components/Accordion/Accordion.types.d.ts +36 -0
  139. package/types/components/Accordion/Accordion.types.d.ts.map +1 -0
  140. package/types/components/Accordion/index.d.ts +5 -0
  141. package/types/components/Accordion/index.d.ts.map +1 -0
  142. package/types/components/Accordion/ui/AccordionItem/AccordionItem.d.ts +4 -0
  143. package/types/components/Accordion/ui/AccordionItem/AccordionItem.d.ts.map +1 -0
  144. package/types/components/Accordion/ui/AccordionItem/AccordionItem.styles.d.ts +13 -0
  145. package/types/components/Accordion/ui/AccordionItem/AccordionItem.styles.d.ts.map +1 -0
  146. package/types/components/Accordion/ui/AccordionItem/AccordionItem.types.d.ts +51 -0
  147. package/types/components/Accordion/ui/AccordionItem/AccordionItem.types.d.ts.map +1 -0
  148. package/types/components/Accordion/utils/index.d.ts +17 -0
  149. package/types/components/Accordion/utils/index.d.ts.map +1 -0
  150. package/types/components/Accordion/variations/_size/base.d.ts +2 -0
  151. package/types/components/Accordion/variations/_size/base.d.ts.map +1 -0
  152. package/types/components/Accordion/variations/_stretching/base.d.ts +2 -0
  153. package/types/components/Accordion/variations/_stretching/base.d.ts.map +1 -0
  154. package/types/components/Accordion/variations/_view/base.d.ts +2 -0
  155. package/types/components/Accordion/variations/_view/base.d.ts.map +1 -0
  156. package/types/components/Segment/SegmentProvider/SegmentProvider.d.ts.map +1 -1
  157. package/types/components/Segment/SegmentProvider/SegmentProvider.types.d.ts +3 -4
  158. package/types/components/Segment/SegmentProvider/SegmentProvider.types.d.ts.map +1 -1
  159. package/types/components/Segment/ui/SegmentGroup/SegmentGroup.d.ts +0 -2
  160. package/types/components/Segment/ui/SegmentGroup/SegmentGroup.d.ts.map +1 -1
  161. package/types/components/Segment/ui/SegmentGroup/SegmentGroup.types.d.ts +0 -5
  162. package/types/components/Segment/ui/SegmentGroup/SegmentGroup.types.d.ts.map +1 -1
  163. package/types/components/_Icon/Icon.assets/ChevronDownFill.d.ts +4 -0
  164. package/types/components/_Icon/Icon.assets/ChevronDownFill.d.ts.map +1 -0
  165. package/types/components/_Icon/Icon.assets/Minus.d.ts +4 -0
  166. package/types/components/_Icon/Icon.assets/Minus.d.ts.map +1 -0
  167. package/types/components/_Icon/Icons/IconChevronDownFill.d.ts +4 -0
  168. package/types/components/_Icon/Icons/IconChevronDownFill.d.ts.map +1 -0
  169. package/types/components/_Icon/Icons/IconMinus.d.ts +4 -0
  170. package/types/components/_Icon/Icons/IconMinus.d.ts.map +1 -0
  171. package/types/components/_Icon/index.d.ts +2 -0
  172. package/types/components/_Icon/index.d.ts.map +1 -1
  173. package/types/examples/plasma_b2c/components/Accordion/Accordion.config.d.ts +19 -0
  174. package/types/examples/plasma_b2c/components/Accordion/Accordion.config.d.ts.map +1 -0
  175. package/types/examples/plasma_b2c/components/Accordion/Accordion.d.ts +26 -0
  176. package/types/examples/plasma_b2c/components/Accordion/Accordion.d.ts.map +1 -0
  177. package/types/examples/plasma_b2c/components/Segment/Segment.d.ts +0 -1
  178. package/types/examples/plasma_b2c/components/Segment/Segment.d.ts.map +1 -1
  179. package/types/examples/plasma_web/components/Accordion/Accordion.config.d.ts +23 -0
  180. package/types/examples/plasma_web/components/Accordion/Accordion.config.d.ts.map +1 -0
  181. package/types/examples/plasma_web/components/Accordion/Accordion.d.ts +30 -0
  182. package/types/examples/plasma_web/components/Accordion/Accordion.d.ts.map +1 -0
  183. package/types/examples/plasma_web/components/Segment/Segment.d.ts +0 -1
  184. package/types/examples/plasma_web/components/Segment/Segment.d.ts.map +1 -1
  185. package/types/examples/sds_engineer/components/Segment/Segment.d.ts +0 -1
  186. package/types/examples/sds_engineer/components/Segment/Segment.d.ts.map +1 -1
  187. package/types/index.d.ts +1 -0
  188. package/types/index.d.ts.map +1 -1
  189. /package/cjs/components/{_Icon/Icons/IconClose.css → Accordion/ui/AccordionItem/AccordionItem.css} +0 -0
  190. /package/es/components/{_Icon/Icons/IconClose.css → Accordion/ui/AccordionItem/AccordionItem.css} +0 -0
@@ -0,0 +1,103 @@
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.AccordionItem = void 0;
8
+ var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
9
+ var _roundness = /*#__PURE__*/require("../../../../utils/roundness");
10
+ var _Accordion = /*#__PURE__*/require("../../Accordion.tokens");
11
+ var _AccordionItem = /*#__PURE__*/require("./AccordionItem.styles");
12
+ var _StyledMinus, _StyledArrow;
13
+ 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); }
14
+ 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; }
15
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+ 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."); }
17
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
+ function _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
+ 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; } }
20
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+ var AccordionItem = exports.AccordionItem = function AccordionItem(_ref) {
22
+ var value = _ref.value,
23
+ contentRight = _ref.contentRight,
24
+ contentLeft = _ref.contentLeft,
25
+ title = _ref.title,
26
+ _ref$pin = _ref.pin,
27
+ pin = _ref$pin === void 0 ? 'square-square' : _ref$pin,
28
+ children = _ref.children,
29
+ _ref$type = _ref.type,
30
+ type = _ref$type === void 0 ? 'sign' : _ref$type,
31
+ index = _ref.index,
32
+ eventKey = _ref.eventKey,
33
+ disabled = _ref.disabled,
34
+ onChange = _ref.onChange;
35
+ var key = eventKey !== null && eventKey !== void 0 ? eventKey : index;
36
+ var _useState = (0, _react.useState)(),
37
+ _useState2 = _slicedToArray(_useState, 2),
38
+ leftPadding = _useState2[0],
39
+ setLeftPadding = _useState2[1];
40
+ var handleOpen = function handleOpen() {
41
+ if (disabled) {
42
+ return;
43
+ }
44
+ if (onChange) {
45
+ onChange(key, !value);
46
+ }
47
+ };
48
+ var leftContentRef = (0, _react.useRef)(null);
49
+ (0, _react.useEffect)(function () {
50
+ var _leftContentRef$curre, _leftContentRef$curre2;
51
+ var leftContentWidth = (_leftContentRef$curre = leftContentRef === null || leftContentRef === void 0 || (_leftContentRef$curre2 = leftContentRef.current) === null || _leftContentRef$curre2 === void 0 ? void 0 : _leftContentRef$curre2.offsetWidth) !== null && _leftContentRef$curre !== void 0 ? _leftContentRef$curre : 0;
52
+ var leftPaddingBody = leftContentWidth ? "calc(".concat(leftContentWidth, "px + var(").concat(_Accordion.tokens.accordionItemGap, "))") : 0;
53
+ setLeftPadding(leftPaddingBody);
54
+ }, [value, type, leftContentRef, setLeftPadding]);
55
+ var openedBodyClass = value ? _Accordion.classes.accordionItemShowBody : undefined;
56
+ var StyledAnimationPLus = function StyledAnimationPLus() {
57
+ return /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledPlus, null, _StyledMinus || (_StyledMinus = /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledMinus, {
58
+ size: "xs",
59
+ color: "inhert"
60
+ })), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledMinus, {
61
+ size: "xs",
62
+ color: "inhert",
63
+ className: openedBodyClass !== null && openedBodyClass !== void 0 ? openedBodyClass : _Accordion.classes.accordionPlusAnimationElement
64
+ }));
65
+ };
66
+ var accordionBorderRadius = (0, _roundness.convertRoundnessMatrix)(pin, "var(".concat(_Accordion.tokens.accordionItemBorderRadius, ")"), '1.5rem');
67
+ var disabledClass = disabled ? _Accordion.classes.accordionDisabled : '';
68
+ var leftContent = contentLeft !== null && contentLeft !== void 0 ? contentLeft : type === 'arrow' ? _StyledArrow || (_StyledArrow = /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledArrow, {
69
+ size: "xs",
70
+ color: "inhert"
71
+ })) : undefined;
72
+ var leftContentRotate = type === 'arrow' && value ? _Accordion.classes.accordionItemShowBody : undefined;
73
+ var rightContent = contentRight !== null && contentRight !== void 0 ? contentRight : type === 'sign' ? /*#__PURE__*/_react["default"].createElement(StyledAnimationPLus, null) : undefined;
74
+ var rightContentRotate = type === 'sign' && value ? _Accordion.classes.accordionItemShowBody : undefined;
75
+ return /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionItem, {
76
+ className: _Accordion.classes.accordionItem,
77
+ key: key,
78
+ style: {
79
+ borderRadius: accordionBorderRadius
80
+ }
81
+ }, /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionHeader, {
82
+ role: "tab",
83
+ tabIndex: 0,
84
+ onClick: handleOpen,
85
+ className: disabledClass,
86
+ "aria-expanded": value,
87
+ "aria-controls": "accordion-item-section".concat(key),
88
+ id: "accordion-item-".concat(key)
89
+ }, /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionContentLeft, {
90
+ ref: leftContentRef,
91
+ className: leftContentRotate
92
+ }, leftContent), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionTitle, null, title)), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionContentRight, {
93
+ className: rightContentRotate
94
+ }, rightContent && rightContent)), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionBodyAnimate, {
95
+ "aria-labelledby": "accordion-item-".concat(key),
96
+ "aria-hidden": !value,
97
+ id: "accordion-item-section".concat(key),
98
+ className: openedBodyClass,
99
+ style: {
100
+ paddingLeft: "".concat(leftPadding)
101
+ }
102
+ }, /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionBody, null, children)));
103
+ };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledPlus = exports.StyledMinus = exports.StyledArrow = exports.StyledAccordionTitle = exports.StyledAccordionItem = exports.StyledAccordionHeaderLeft = exports.StyledAccordionHeader = exports.StyledAccordionContentRight = exports.StyledAccordionContentLeft = exports.StyledAccordionBodyAnimate = exports.StyledAccordionBody = void 0;
7
+ var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
8
+ var _Icon = /*#__PURE__*/require("../../../_Icon");
9
+ var _Accordion = /*#__PURE__*/require("../../Accordion.tokens");
10
+ var _mixins = /*#__PURE__*/require("../../../../mixins");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
+ var StyledAccordionItem = exports.StyledAccordionItem = /*#__PURE__*/_styledComponents["default"].div.withConfig({
13
+ componentId: "plasma-new-hope__sc-20ij9z-0"
14
+ })(["background:var(", ");border-bottom:var(", ");&:last-child{border-bottom:none;}"], _Accordion.tokens.accordionItemBackground, _Accordion.tokens.accordionItemBorderBottom);
15
+ var StyledAccordionHeader = exports.StyledAccordionHeader = /*#__PURE__*/_styledComponents["default"].button.withConfig({
16
+ componentId: "plasma-new-hope__sc-20ij9z-1"
17
+ })(["width:100%;border:none;padding:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;background:none;box-sizing:border-box;cursor:pointer;&.", "{opacity:0.4;cursor:not-allowed;}&:focus{outline:none;}", ""], _Accordion.tokens.accordionItemPadding, _Accordion.tokens.accordionItemGap, _Accordion.classes.accordionDisabled, /*#__PURE__*/(0, _mixins.addFocus)({
18
+ outlineOffset: '0.125rem',
19
+ outlineSize: '0.125rem',
20
+ outlineRadius: '0',
21
+ outlineColor: /*#__PURE__*/"var(".concat(_Accordion.tokens.accordionItemFocus, ")")
22
+ }));
23
+ var StyledAccordionHeaderLeft = exports.StyledAccordionHeaderLeft = /*#__PURE__*/_styledComponents["default"].div.withConfig({
24
+ componentId: "plasma-new-hope__sc-20ij9z-2"
25
+ })(["display:flex;gap:var(", ");justify-content:space-between;align-items:center;"], _Accordion.tokens.accordionItemGap);
26
+ var StyledAccordionContentRight = exports.StyledAccordionContentRight = /*#__PURE__*/_styledComponents["default"].div.withConfig({
27
+ componentId: "plasma-new-hope__sc-20ij9z-3"
28
+ })(["transition:0.2s;transform:rotate(90deg);&.", "{transition:0.2s;transform:rotate(0deg);}"], _Accordion.classes.accordionItemShowBody);
29
+ var StyledAccordionContentLeft = exports.StyledAccordionContentLeft = /*#__PURE__*/_styledComponents["default"].div.withConfig({
30
+ componentId: "plasma-new-hope__sc-20ij9z-4"
31
+ })(["transition:0.2s;display:flex;align-items:center;&.", "{transition:0.2s;transform:rotate(180deg);}"], _Accordion.classes.accordionItemShowBody);
32
+ var StyledAccordionTitle = exports.StyledAccordionTitle = /*#__PURE__*/_styledComponents["default"].div.withConfig({
33
+ componentId: "plasma-new-hope__sc-20ij9z-5"
34
+ })(["color:var(", ");font-family:var(", ");font-size:var(", ");font-weight:var(", ");font-style:var(", ");letter-spacing:var(", ");line-height:var(", ");"], _Accordion.tokens.accordionItemTitleColor, _Accordion.tokens.accordionItemTitleFontFamily, _Accordion.tokens.accordionItemTitleFontSize, _Accordion.tokens.accordionItemTitleFontWeight, _Accordion.tokens.accordionItemTitleFontStyle, _Accordion.tokens.accordionItemTitleLetterSpacing, _Accordion.tokens.accordionItemTitleLineHeight);
35
+ var StyledAccordionBodyAnimate = exports.StyledAccordionBodyAnimate = /*#__PURE__*/_styledComponents["default"].div.withConfig({
36
+ componentId: "plasma-new-hope__sc-20ij9z-6"
37
+ })(["display:grid;grid-template-rows:0fr;transition:grid-template-rows 0.2s ease-out;overflow:hidden;&.", "{grid-template-rows:1fr;padding-bottom:var(", ");&.", "{transition:0.2s;transform:rotate(0deg);}}"], _Accordion.classes.accordionItemShowBody, _Accordion.tokens.accordionItemPaddingVertical, _Accordion.classes.accordionPlusAnimationElement);
38
+ var StyledAccordionBody = exports.StyledAccordionBody = /*#__PURE__*/_styledComponents["default"].div.withConfig({
39
+ componentId: "plasma-new-hope__sc-20ij9z-7"
40
+ })(["color:var(", ");font-family:var(", ");font-size:var(", ");font-weight:var(", ");font-style:var(", ");letter-spacing:var(", ");line-height:var(", ");overflow:hidden;padding-right:var(", ");padding-left:var(", ");"], _Accordion.tokens.accordionItemTextColor, _Accordion.tokens.accordionItemTextFontFamily, _Accordion.tokens.accordionItemTextFontSize, _Accordion.tokens.accordionItemTextFontWeight, _Accordion.tokens.accordionItemTextFontStyle, _Accordion.tokens.accordionItemTextLetterSpacing, _Accordion.tokens.accordionItemTextLineHeight, _Accordion.tokens.accordionItemPaddingHorizontal, _Accordion.tokens.accordionItemPaddingHorizontal);
41
+ var StyledArrow = exports.StyledArrow = /*#__PURE__*/(0, _styledComponents["default"])(_Icon.IconChevronDownFill).withConfig({
42
+ componentId: "plasma-new-hope__sc-20ij9z-8"
43
+ })(["pointer-events:none;user-select:none;color:var(", ");"], _Accordion.tokens.accordionItemTextColor);
44
+ var StyledMinus = exports.StyledMinus = /*#__PURE__*/(0, _styledComponents["default"])(_Icon.IconMinus).withConfig({
45
+ componentId: "plasma-new-hope__sc-20ij9z-9"
46
+ })(["pointer-events:none;user-select:none;color:var(", ");display:flex;align-items:center;position:absolute;top:0;left:0;&.", "{transition:0.2s;transform:rotate(90deg);}&.", "{transition:0.2s;transform:rotate(0deg);}"], _Accordion.tokens.accordionItemTextColor, _Accordion.classes.accordionPlusAnimationElement, _Accordion.classes.accordionItemShowBody);
47
+ var StyledPlus = exports.StyledPlus = /*#__PURE__*/_styledComponents["default"].div.withConfig({
48
+ componentId: "plasma-new-hope__sc-20ij9z-10"
49
+ })(["position:relative;height:1rem;display:flex;align-items:center;justify-content:center;width:1rem;"]);
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.updatePropsRecursively = exports.getChildren = void 0;
7
+ var _react = /*#__PURE__*/require("react");
8
+ var updatePropsRecursively = exports.updatePropsRecursively = function updatePropsRecursively(children, activeIndex, disabled, updateValue) {
9
+ return _react.Children.map(children || [], function (child, index) {
10
+ if (! /*#__PURE__*/(0, _react.isValidElement)(child)) {
11
+ return child;
12
+ }
13
+ var props = {
14
+ index: index,
15
+ value: !!((activeIndex === null || activeIndex === void 0 ? void 0 : activeIndex.findIndex(function (i) {
16
+ var _child$props$eventKey;
17
+ return i === ((_child$props$eventKey = child.props.eventKey) !== null && _child$props$eventKey !== void 0 ? _child$props$eventKey : index);
18
+ })) !== -1),
19
+ disabled: disabled,
20
+ onChange: updateValue
21
+ };
22
+ return /*#__PURE__*/(0, _react.cloneElement)(child, props);
23
+ });
24
+ };
25
+ var getChildren = exports.getChildren = function getChildren(children, activeIndex, disabled, updateValue) {
26
+ return updatePropsRecursively(children, activeIndex, disabled, updateValue);
27
+ };
@@ -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,6 @@
1
+ [
2
+ "--plasma-accordion-item-padding-vertical",
3
+ "--plasma-accordion-item-padding-horizontal",
4
+ "--plasma-accordion-item-gap",
5
+ "--plasma-accordion-item-border-radius"
6
+ ]
@@ -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,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,8 @@
1
+ [
2
+ "--plasma-accordion-width",
3
+ "--plasma-accordion-gap",
4
+ "--plasma-accordion-item-padding",
5
+ "--plasma-accordion-background",
6
+ "--plasma-accordion-item-background",
7
+ "--plasma-accordion-item-border-bottom"
8
+ ]
@@ -24,11 +24,6 @@ import { PropsTable, Description } from '@site/src/components';
24
24
  Оберните в `SegmentProvider` компонент, в котором будут использованы SegmentGroup с SegmentItem.
25
25
  Внутри данного провайдера есть доступ к хуку `useSegment`.
26
26
 
27
- ### Выбранные по умолчанию SegmentItem
28
-
29
- Можно задать выбранные по умолчанию сегменты с помощью свойства `defaultSelected`.
30
- Оно передается в `SegmentGroup`, в виде массива `value` элеметов.
31
-
32
27
  ```tsx live
33
28
  import React from 'react';
34
29
  import { SegmentGroup, SegmentItem, SegmentProvider, useSegment } from '@salutejs/{{ package }}';
@@ -42,7 +37,7 @@ export function App() {
42
37
  return (
43
38
  <>
44
39
  <div>Выбранные элементы: {selectedSegmentItems.join(', ')}</div>
45
- <SegmentGroup defaultSelected={['label_1']} view='filled' selectionMode='multiple' filledBackground pilled>
40
+ <SegmentGroup view='filled' selectionMode='multiple' filledBackground pilled>
46
41
  {items.map((_, i) => (
47
42
  <SegmentItem
48
43
  label={`Label ${i}`}
@@ -62,7 +62,6 @@ var SegmentProvider = exports.SegmentProvider = function SegmentProvider(_ref) {
62
62
  }, [selectionMode, setSelectedSegmentItems]);
63
63
  var contextValue = {
64
64
  selectedSegmentItems: selectedSegmentItems,
65
- setSelectedSegmentItems: setSelectedSegmentItems,
66
65
  handleSelect: handleSelect,
67
66
  selectionMode: selectionMode,
68
67
  setSelectionMode: setSelectionMode,
@@ -70,9 +69,7 @@ var SegmentProvider = exports.SegmentProvider = function SegmentProvider(_ref) {
70
69
  setDisabledGroup: setDisabledGroup
71
70
  };
72
71
  (0, _react.useEffect)(function () {
73
- if (selectionMode === 'single' && (selectedSegmentItems === null || selectedSegmentItems === void 0 ? void 0 : selectedSegmentItems.length) > 0) {
74
- setSelectedSegmentItems([selectedSegmentItems[0]]);
75
- }
72
+ setSelectedSegmentItems([]);
76
73
  }, [selectionMode]);
77
74
  return /*#__PURE__*/_react["default"].createElement(SegmentContext.Provider, {
78
75
  value: contextValue
@@ -18,7 +18,7 @@ var _base4 = /*#__PURE__*/require("./variations/_pilled/base");
18
18
  var _base5 = /*#__PURE__*/require("./variations/_filledBackgound/base");
19
19
  var _base6 = /*#__PURE__*/require("./variations/_stretch/base");
20
20
  var _SegmentGroup = /*#__PURE__*/require("./SegmentGroup.styles");
21
- var _excluded = ["id", "selectionMode", "pilled", "stretch", "filledBackground", "disabled", "size", "view", "children", "defaultSelected"];
21
+ var _excluded = ["id", "selectionMode", "pilled", "stretch", "filledBackground", "disabled", "size", "view", "children"];
22
22
  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); }
23
23
  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; }
24
24
  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); }
@@ -43,12 +43,10 @@ var segmentGroupRoot = exports.segmentGroupRoot = function segmentGroupRoot(Root
43
43
  size = props.size,
44
44
  view = props.view,
45
45
  children = props.children,
46
- defaultSelected = props.defaultSelected,
47
46
  rest = _objectWithoutProperties(props, _excluded);
48
47
  var _useSegmentInner = (0, _SegmentProvider.useSegmentInner)(),
49
48
  setSelectionMode = _useSegmentInner.setSelectionMode,
50
- setDisabledGroup = _useSegmentInner.setDisabledGroup,
51
- setSelectedSegmentItems = _useSegmentInner.setSelectedSegmentItems;
49
+ setDisabledGroup = _useSegmentInner.setDisabledGroup;
52
50
  var _useState = (0, _react.useState)(0),
53
51
  _useState2 = _slicedToArray(_useState, 2),
54
52
  index = _useState2[0],
@@ -132,11 +130,6 @@ var segmentGroupRoot = exports.segmentGroupRoot = function segmentGroupRoot(Root
132
130
  selectionMode && setSelectionMode(selectionMode);
133
131
  setDisabledGroup(disabled);
134
132
  }, [selectionMode, disabled]);
135
- (0, _react.useEffect)(function () {
136
- if (defaultSelected !== null && defaultSelected !== void 0 && defaultSelected.length) {
137
- setSelectedSegmentItems(defaultSelected);
138
- }
139
- }, [defaultSelected]);
140
133
  (0, _react.useEffect)(function () {
141
134
  var _trackRef$current;
142
135
  // Intersection observer для первого сегмента
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ChevronDownFill = void 0;
7
+ var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
8
+ var _path;
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+ 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); }
11
+ var ChevronDownFill = exports.ChevronDownFill = function ChevronDownFill(props) {
12
+ return /*#__PURE__*/_react["default"].createElement("svg", _extends({
13
+ width: "100%",
14
+ viewBox: "0 0 16 16",
15
+ fill: "none"
16
+ }, props), _path || (_path = /*#__PURE__*/_react["default"].createElement("path", {
17
+ id: "path",
18
+ d: "M11.45 5.79C11.37 5.61 11.19 5.5 11 5.5L5 5.5C4.8 5.5 4.62 5.61 4.54 5.79C4.46 5.96 4.49 6.17 4.62 6.32L7.62 9.82C7.71 9.93 7.85 10 8 10C8.14 10 8.28 9.93 8.37 9.82L11.37 6.32C11.5 6.17 11.53 5.96 11.45 5.79Z",
19
+ fillRule: "evenodd",
20
+ fill: "currentColor",
21
+ clipRule: "evenodd"
22
+ })));
23
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Minus = void 0;
7
+ var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
8
+ var _path;
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+ 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); }
11
+ var Minus = exports.Minus = function Minus(props) {
12
+ return /*#__PURE__*/_react["default"].createElement("svg", _extends({
13
+ width: "100%",
14
+ viewBox: "0 0 24 24",
15
+ fill: "none"
16
+ }, props), _path || (_path = /*#__PURE__*/_react["default"].createElement("path", {
17
+ id: "icon",
18
+ d: "M3.25 12C3.25 11.58 3.58 11.25 4 11.25L20 11.25C20.41 11.25 20.75 11.58 20.75 12C20.75 12.41 20.41 12.75 20 12.75L4 12.75C3.58 12.75 3.25 12.41 3.25 12Z",
19
+ fill: "currentColor"
20
+ })));
21
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.IconChevronDownFill = void 0;
7
+ var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
8
+ var _ChevronDownFill = /*#__PURE__*/require("../Icon.assets/ChevronDownFill");
9
+ var _IconRoot = /*#__PURE__*/require("../IconRoot");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ var IconChevronDownFill = exports.IconChevronDownFill = function IconChevronDownFill(_ref) {
12
+ var _ref$size = _ref.size,
13
+ size = _ref$size === void 0 ? 'xs' : _ref$size,
14
+ color = _ref.color,
15
+ className = _ref.className;
16
+ return /*#__PURE__*/_react["default"].createElement(_IconRoot.IconRoot, {
17
+ className: className,
18
+ size: size,
19
+ color: color,
20
+ icon: _ChevronDownFill.ChevronDownFill
21
+ });
22
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.IconMinus = void 0;
7
+ var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
8
+ var _Minus = /*#__PURE__*/require("../Icon.assets/Minus");
9
+ var _IconRoot = /*#__PURE__*/require("../IconRoot");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ var IconMinus = exports.IconMinus = function IconMinus(_ref) {
12
+ var _ref$size = _ref.size,
13
+ size = _ref$size === void 0 ? 's' : _ref$size,
14
+ color = _ref.color,
15
+ className = _ref.className;
16
+ return /*#__PURE__*/_react["default"].createElement(_IconRoot.IconRoot, {
17
+ className: className,
18
+ size: size,
19
+ color: color,
20
+ icon: _Minus.Minus
21
+ });
22
+ };
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "IconChevronDown", {
15
15
  return _IconChevronDown.IconChevronDown;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "IconChevronDownFill", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _IconChevronDownFill.IconChevronDownFill;
22
+ }
23
+ });
18
24
  Object.defineProperty(exports, "IconChevronLeft", {
19
25
  enumerable: true,
20
26
  get: function get() {
@@ -57,12 +63,20 @@ Object.defineProperty(exports, "IconMic", {
57
63
  return _IconMic.IconMic;
58
64
  }
59
65
  });
66
+ Object.defineProperty(exports, "IconMinus", {
67
+ enumerable: true,
68
+ get: function get() {
69
+ return _IconMinus.IconMinus;
70
+ }
71
+ });
60
72
  var _IconDisclosureLeft = /*#__PURE__*/require("./Icons/IconDisclosureLeft");
61
73
  var _IconDisclosureRight = /*#__PURE__*/require("./Icons/IconDisclosureRight");
62
74
  var _IconMic = /*#__PURE__*/require("./Icons/IconMic");
63
75
  var _IconChevronLeft = /*#__PURE__*/require("./Icons/IconChevronLeft");
64
76
  var _IconChevronDoubleLeft = /*#__PURE__*/require("./Icons/IconChevronDoubleLeft");
65
77
  var _IconChevronDown = /*#__PURE__*/require("./Icons/IconChevronDown");
78
+ var _IconChevronDownFill = /*#__PURE__*/require("./Icons/IconChevronDownFill");
66
79
  var _IconClose = /*#__PURE__*/require("./Icons/IconClose");
67
80
  var _IconCross = /*#__PURE__*/require("./Icons/IconCross");
68
- var _IconDone = /*#__PURE__*/require("./Icons/IconDone");
81
+ var _IconDone = /*#__PURE__*/require("./Icons/IconDone");
82
+ var _IconMinus = /*#__PURE__*/require("./Icons/IconMinus");
@@ -0,0 +1,26 @@
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 _Accordion = /*#__PURE__*/require("../../../../components/Accordion");
9
+ var config = exports.config = {
10
+ defaults: {
11
+ view: 'default',
12
+ size: 'm'
13
+ },
14
+ variations: {
15
+ view: {
16
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.125rem;", ":20rem;", ":var(", ") var(", ");", ":var(--surface-solid-card);", ":var(--text-primary);", ":var(--text-primary);", ":var(--surface-accent);", ":var(--surface-clear);", ":0;"], _Accordion.accordionTokens.accordionGap, _Accordion.accordionTokens.accordionWidth, _Accordion.accordionTokens.accordionItemPadding, _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemBackground, _Accordion.accordionTokens.accordionItemTitleColor, _Accordion.accordionTokens.accordionItemTextColor, _Accordion.accordionTokens.accordionItemFocus, _Accordion.accordionTokens.accordionBackground, _Accordion.accordionTokens.accordionItemBorderBottom),
17
+ clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":0;", ":20rem;", ":var(", ") 0rem;", ":var(--surface-clear);", ":var(--text-primary);", ":var(--text-primary);", ":var(--surface-accent);", ":0rem !important;", ":var(--surface-clear);", ":0.125rem solid var(--surface-solid-tertiary);"], _Accordion.accordionTokens.accordionGap, _Accordion.accordionTokens.accordionWidth, _Accordion.accordionTokens.accordionItemPadding, _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemBackground, _Accordion.accordionTokens.accordionItemTitleColor, _Accordion.accordionTokens.accordionItemTextColor, _Accordion.accordionTokens.accordionItemFocus, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionBackground, _Accordion.accordionTokens.accordionItemBorderBottom)
18
+ },
19
+ size: {
20
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.0625rem;", ":1.25rem;", ":0.5rem;", ":0.875rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-bold-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemGap, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionItemTitleFontFamily, _Accordion.accordionTokens.accordionItemTitleFontSize, _Accordion.accordionTokens.accordionItemTitleFontStyle, _Accordion.accordionTokens.accordionItemTitleFontWeight, _Accordion.accordionTokens.accordionItemTitleLetterSpacing, _Accordion.accordionTokens.accordionItemTitleLineHeight, _Accordion.accordionTokens.accordionItemTextFontFamily, _Accordion.accordionTokens.accordionItemTextFontSize, _Accordion.accordionTokens.accordionItemTextFontStyle, _Accordion.accordionTokens.accordionItemTextFontWeight, _Accordion.accordionTokens.accordionItemTextLetterSpacing, _Accordion.accordionTokens.accordionItemTextLineHeight),
21
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.875rem;", ":1.125rem;", ":0.375rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);"], _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemGap, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionItemTitleFontFamily, _Accordion.accordionTokens.accordionItemTitleFontSize, _Accordion.accordionTokens.accordionItemTitleFontStyle, _Accordion.accordionTokens.accordionItemTitleFontWeight, _Accordion.accordionTokens.accordionItemTitleLetterSpacing, _Accordion.accordionTokens.accordionItemTitleLineHeight, _Accordion.accordionTokens.accordionItemTextFontFamily, _Accordion.accordionTokens.accordionItemTextFontSize, _Accordion.accordionTokens.accordionItemTextFontStyle, _Accordion.accordionTokens.accordionItemTextFontWeight, _Accordion.accordionTokens.accordionItemTextLetterSpacing, _Accordion.accordionTokens.accordionItemTextLineHeight),
22
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.6875rem;", ":0.875rem;", ":0.375rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemGap, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionItemTitleFontFamily, _Accordion.accordionTokens.accordionItemTitleFontSize, _Accordion.accordionTokens.accordionItemTitleFontStyle, _Accordion.accordionTokens.accordionItemTitleFontWeight, _Accordion.accordionTokens.accordionItemTitleLetterSpacing, _Accordion.accordionTokens.accordionItemTitleLineHeight, _Accordion.accordionTokens.accordionItemTextFontFamily, _Accordion.accordionTokens.accordionItemTextFontSize, _Accordion.accordionTokens.accordionItemTextFontStyle, _Accordion.accordionTokens.accordionItemTextFontWeight, _Accordion.accordionTokens.accordionItemTextLetterSpacing, _Accordion.accordionTokens.accordionItemTextLineHeight),
23
+ xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":0.75rem;", ":0.25rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-bold-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);"], _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemGap, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionItemTitleFontFamily, _Accordion.accordionTokens.accordionItemTitleFontSize, _Accordion.accordionTokens.accordionItemTitleFontStyle, _Accordion.accordionTokens.accordionItemTitleFontWeight, _Accordion.accordionTokens.accordionItemTitleLetterSpacing, _Accordion.accordionTokens.accordionItemTitleLineHeight, _Accordion.accordionTokens.accordionItemTextFontFamily, _Accordion.accordionTokens.accordionItemTextFontSize, _Accordion.accordionTokens.accordionItemTextFontStyle, _Accordion.accordionTokens.accordionItemTextFontWeight, _Accordion.accordionTokens.accordionItemTextLetterSpacing, _Accordion.accordionTokens.accordionItemTextLineHeight)
24
+ }
25
+ }
26
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Accordion = void 0;
7
+ Object.defineProperty(exports, "AccordionItem", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _Accordion.AccordionItem;
11
+ }
12
+ });
13
+ var _Accordion = /*#__PURE__*/require("../../../../components/Accordion");
14
+ var _engines = /*#__PURE__*/require("../../../../engines");
15
+ var _Accordion2 = /*#__PURE__*/require("./Accordion.config");
16
+ var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Accordion.accordionConfig, _Accordion2.config);
17
+ var Accordion = exports.Accordion = /*#__PURE__*/(0, _engines.component)(mergedConfig);
@@ -0,0 +1,66 @@
1
+ import * as React from 'react';
2
+ import type { ComponentProps } from 'react';
3
+ import type { StoryObj, Meta } from '@storybook/react';
4
+ import { disableProps } from '@salutejs/plasma-sb-utils';
5
+
6
+ import { mergeConfig } from '../../../../engines';
7
+ import { WithTheme, argTypesFromConfig } from '../../../_helpers';
8
+ import { accordionConfig } from '../../../../components/Accordion';
9
+
10
+ import { config } from './Accordion.config';
11
+ import { Accordion, AccordionItem } from './Accordion';
12
+
13
+ const meta: Meta<typeof Accordion> = {
14
+ title: 'plasma_b2c/Accordion',
15
+ decorators: [WithTheme],
16
+ component: Accordion,
17
+ args: {
18
+ singleActive: false,
19
+ view: 'default',
20
+ size: 'm',
21
+ stretching: 'filled',
22
+ type: 'arrow',
23
+ disabled: false,
24
+ title: 'Как оплатить заправку бонусами СберСпасибо?',
25
+ body:
26
+ 'После указания деталей заправки нажмите кнопку «К оплате». Откроется окно оплаты, где вы сможете списать бонусы и оплатить ими до 99% стоимости топлива',
27
+ },
28
+ argTypes: {
29
+ ...argTypesFromConfig(mergeConfig(accordionConfig, config)),
30
+ ...disableProps(['text']),
31
+ stretching: {
32
+ options: ['filled', 'fixed'],
33
+ control: {
34
+ type: 'select',
35
+ },
36
+ },
37
+ type: {
38
+ options: ['arrow', 'sign', 'clear'],
39
+ control: {
40
+ type: 'select',
41
+ },
42
+ },
43
+ },
44
+ };
45
+
46
+ export default meta;
47
+
48
+ export const Default: StoryObj<ComponentProps<typeof Accordion>> = {
49
+ render: (props: ComponentProps<typeof Accordion>) => {
50
+ const args = { ...props, text: undefined };
51
+
52
+ return (
53
+ <Accordion {...args}>
54
+ <AccordionItem type={args.type} pin={args.pin} title={args.title}>
55
+ {args.body}
56
+ </AccordionItem>
57
+ <AccordionItem type={args.type} pin={args.pin} title={args.title}>
58
+ {args.body}
59
+ </AccordionItem>
60
+ <AccordionItem type={args.type} pin={args.pin} title={args.title}>
61
+ {args.body}
62
+ </AccordionItem>
63
+ </Accordion>
64
+ );
65
+ },
66
+ };
@@ -0,0 +1,30 @@
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 _Accordion = /*#__PURE__*/require("../../../../components/Accordion");
9
+ var config = exports.config = {
10
+ defaults: {
11
+ view: 'default',
12
+ size: 'm'
13
+ },
14
+ variations: {
15
+ view: {
16
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.125rem;", ":20rem;", ":var(", ") var(", ");", ":var(--surface-solid-card);", ":var(--text-primary);", ":var(--text-primary);", ":var(--surface-accent);", ":var(--surface-clear);", ":0;"], _Accordion.accordionTokens.accordionGap, _Accordion.accordionTokens.accordionWidth, _Accordion.accordionTokens.accordionItemPadding, _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemBackground, _Accordion.accordionTokens.accordionItemTitleColor, _Accordion.accordionTokens.accordionItemTextColor, _Accordion.accordionTokens.accordionItemFocus, _Accordion.accordionTokens.accordionBackground, _Accordion.accordionTokens.accordionItemBorderBottom),
17
+ clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.125rem;", ":20rem;", ":var(", ") 0rem;", ":var(--surface-clear);", ":var(--text-primary);", ":var(--text-primary);", ":var(--surface-accent);", ":0rem !important;", ":var(--surface-clear);", ":0.125rem solid var(--surface-solid-tertiary);"], _Accordion.accordionTokens.accordionGap, _Accordion.accordionTokens.accordionWidth, _Accordion.accordionTokens.accordionItemPadding, _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemBackground, _Accordion.accordionTokens.accordionItemTitleColor, _Accordion.accordionTokens.accordionItemTextColor, _Accordion.accordionTokens.accordionItemFocus, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionBackground, _Accordion.accordionTokens.accordionItemBorderBottom)
18
+ },
19
+ size: {
20
+ l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.0625rem;", ":1.25rem;", ":0.5rem;", ":0.875rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-bold-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemGap, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionItemTitleFontFamily, _Accordion.accordionTokens.accordionItemTitleFontSize, _Accordion.accordionTokens.accordionItemTitleFontStyle, _Accordion.accordionTokens.accordionItemTitleFontWeight, _Accordion.accordionTokens.accordionItemTitleLetterSpacing, _Accordion.accordionTokens.accordionItemTitleLineHeight, _Accordion.accordionTokens.accordionItemTextFontFamily, _Accordion.accordionTokens.accordionItemTextFontSize, _Accordion.accordionTokens.accordionItemTextFontStyle, _Accordion.accordionTokens.accordionItemTextFontWeight, _Accordion.accordionTokens.accordionItemTextLetterSpacing, _Accordion.accordionTokens.accordionItemTextLineHeight),
21
+ m: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.875rem;", ":1.125rem;", ":0.375rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);"], _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemGap, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionItemTitleFontFamily, _Accordion.accordionTokens.accordionItemTitleFontSize, _Accordion.accordionTokens.accordionItemTitleFontStyle, _Accordion.accordionTokens.accordionItemTitleFontWeight, _Accordion.accordionTokens.accordionItemTitleLetterSpacing, _Accordion.accordionTokens.accordionItemTitleLineHeight, _Accordion.accordionTokens.accordionItemTextFontFamily, _Accordion.accordionTokens.accordionItemTextFontSize, _Accordion.accordionTokens.accordionItemTextFontStyle, _Accordion.accordionTokens.accordionItemTextFontWeight, _Accordion.accordionTokens.accordionItemTextLetterSpacing, _Accordion.accordionTokens.accordionItemTextLineHeight),
22
+ s: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.6875rem;", ":0.875rem;", ":0.375rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemGap, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionItemTitleFontFamily, _Accordion.accordionTokens.accordionItemTitleFontSize, _Accordion.accordionTokens.accordionItemTitleFontStyle, _Accordion.accordionTokens.accordionItemTitleFontWeight, _Accordion.accordionTokens.accordionItemTitleLetterSpacing, _Accordion.accordionTokens.accordionItemTitleLineHeight, _Accordion.accordionTokens.accordionItemTextFontFamily, _Accordion.accordionTokens.accordionItemTextFontSize, _Accordion.accordionTokens.accordionItemTextFontStyle, _Accordion.accordionTokens.accordionItemTextFontWeight, _Accordion.accordionTokens.accordionItemTextLetterSpacing, _Accordion.accordionTokens.accordionItemTextLineHeight),
23
+ xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":0.75rem;", ":0.25rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-bold-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);"], _Accordion.accordionTokens.accordionItemPaddingVertical, _Accordion.accordionTokens.accordionItemPaddingHorizontal, _Accordion.accordionTokens.accordionItemGap, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionItemTitleFontFamily, _Accordion.accordionTokens.accordionItemTitleFontSize, _Accordion.accordionTokens.accordionItemTitleFontStyle, _Accordion.accordionTokens.accordionItemTitleFontWeight, _Accordion.accordionTokens.accordionItemTitleLetterSpacing, _Accordion.accordionTokens.accordionItemTitleLineHeight, _Accordion.accordionTokens.accordionItemTextFontFamily, _Accordion.accordionTokens.accordionItemTextFontSize, _Accordion.accordionTokens.accordionItemTextFontStyle, _Accordion.accordionTokens.accordionItemTextFontWeight, _Accordion.accordionTokens.accordionItemTextLetterSpacing, _Accordion.accordionTokens.accordionItemTextLineHeight)
24
+ },
25
+ stretching: {
26
+ filled: /*#__PURE__*/(0, _styledComponents.css)([""]),
27
+ fixed: /*#__PURE__*/(0, _styledComponents.css)([""])
28
+ }
29
+ }
30
+ };