@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,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,65 @@
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_web/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
+ title: 'Как оплатить заправку бонусами СберСпасибо?',
24
+ body:
25
+ 'После указания деталей заправки нажмите кнопку «К оплате». Откроется окно оплаты, где вы сможете списать бонусы и оплатить ими до 99% стоимости топлива',
26
+ },
27
+ argTypes: {
28
+ ...argTypesFromConfig(mergeConfig(accordionConfig, config)),
29
+ ...disableProps(['text']),
30
+ stretching: {
31
+ options: ['filled', 'fixed'],
32
+ control: {
33
+ type: 'select',
34
+ },
35
+ },
36
+ type: {
37
+ options: ['arrow', 'sign', 'clear'],
38
+ control: {
39
+ type: 'select',
40
+ },
41
+ },
42
+ },
43
+ };
44
+
45
+ export default meta;
46
+
47
+ export const Default: StoryObj<ComponentProps<typeof Accordion>> = {
48
+ render: (props: ComponentProps<typeof Accordion>) => {
49
+ const args = { ...props, text: undefined };
50
+
51
+ return (
52
+ <Accordion {...args}>
53
+ <AccordionItem type={args.type} pin={args.pin} title={args.title}>
54
+ {args.body}
55
+ </AccordionItem>
56
+ <AccordionItem type={args.type} pin={args.pin} title={args.title}>
57
+ {args.body}
58
+ </AccordionItem>
59
+ <AccordionItem type={args.type} pin={args.pin} title={args.title}>
60
+ {args.body}
61
+ </AccordionItem>
62
+ </Accordion>
63
+ );
64
+ },
65
+ };
@@ -530,4 +530,15 @@ Object.keys(_Range).forEach(function (key) {
530
530
  return _Range[key];
531
531
  }
532
532
  });
533
+ });
534
+ var _Accordion = /*#__PURE__*/require("./components/Accordion");
535
+ Object.keys(_Accordion).forEach(function (key) {
536
+ if (key === "default" || key === "__esModule") return;
537
+ if (key in exports && exports[key] === _Accordion[key]) return;
538
+ Object.defineProperty(exports, key, {
539
+ enumerable: true,
540
+ get: function get() {
541
+ return _Accordion[key];
542
+ }
543
+ });
533
544
  });
@@ -0,0 +1,81 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
9
+ 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; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import React, { Children, forwardRef, useState } from 'react';
12
+ import { cx } from '../../utils';
13
+ import { base } from './Accordion.styles';
14
+ import { classes } from './Accordion.tokens';
15
+ import { base as viewCSS } from './variations/_view/base';
16
+ import { base as sizeCSS } from './variations/_size/base';
17
+ import { getChildren } from './utils';
18
+ export var accordionRoot = function accordionRoot(Root) {
19
+ return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
20
+ var size = _ref.size,
21
+ view = _ref.view,
22
+ _ref$stretching = _ref.stretching,
23
+ stretching = _ref$stretching === void 0 ? 'filled' : _ref$stretching,
24
+ _ref$defaultActiveEve = _ref.defaultActiveEventKey,
25
+ defaultActiveEventKey = _ref$defaultActiveEve === void 0 ? [] : _ref$defaultActiveEve,
26
+ children = _ref.children,
27
+ disabled = _ref.disabled,
28
+ className = _ref.className,
29
+ singleActive = _ref.singleActive,
30
+ onChange = _ref.onChange;
31
+ var stretchingClass = classes["".concat(stretching, "Stretching")];
32
+ var _useState = useState(defaultActiveEventKey),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ activeIndex = _useState2[0],
35
+ setActiveIndex = _useState2[1];
36
+ var updateValue = function updateValue(index, value) {
37
+ if (onChange) {
38
+ onChange(index, value);
39
+ }
40
+ if (singleActive) {
41
+ if (value) {
42
+ setActiveIndex([index]);
43
+ } else {
44
+ setActiveIndex([]);
45
+ }
46
+ } else if (value) {
47
+ setActiveIndex([index].concat(_toConsumableArray(activeIndex)));
48
+ } else {
49
+ var updatedActiveIndex = activeIndex.filter(function (i) {
50
+ return i !== index;
51
+ });
52
+ setActiveIndex(updatedActiveIndex);
53
+ }
54
+ };
55
+ var childrenArray = Children.toArray(children);
56
+ return /*#__PURE__*/React.createElement(Root, {
57
+ ref: outerRootRef,
58
+ size: size,
59
+ view: view,
60
+ className: cx(stretchingClass, classes.accordionRoot, className)
61
+ }, getChildren(childrenArray, activeIndex, disabled, updateValue));
62
+ });
63
+ };
64
+ export var accordionConfig = {
65
+ name: 'Accordion',
66
+ tag: 'div',
67
+ layout: accordionRoot,
68
+ base: base,
69
+ variations: {
70
+ view: {
71
+ css: viewCSS
72
+ },
73
+ size: {
74
+ css: sizeCSS
75
+ }
76
+ },
77
+ defaults: {
78
+ view: 'default',
79
+ size: 'm'
80
+ }
81
+ };
@@ -0,0 +1,3 @@
1
+ import { css } from 'styled-components';
2
+ import { classes, tokens } from './Accordion.tokens';
3
+ export var base = /*#__PURE__*/css(["display:flex;flex-direction:column;gap:var(", ");align-items:stretch;height:auto;background:var(", ");&.", "{width:var(", ");}&.", "{width:100%;}"], tokens.accordionGap, tokens.accordionBackground, classes.fixedStretching, tokens.accordionWidth, classes.filledStretching);
@@ -0,0 +1,37 @@
1
+ export var classes = {
2
+ filledStretching: 'accordion-stretching-filled',
3
+ fixedStretching: 'accordion-stretching-fixed',
4
+ accordionRoot: 'accordion-root',
5
+ accordionItem: 'accordion-item',
6
+ clearAccordionItem: 'clear-accordion-item',
7
+ accordionItemShowBody: 'accordion-item-show-body',
8
+ accordionPlusAnimationElement: 'accordion-plus-animation-element',
9
+ accordionDisabled: 'accordion-disabled'
10
+ };
11
+ export var tokens = {
12
+ accordionGap: '--plasma-accordion-gap',
13
+ accordionWidth: '--plasma-accordion-width',
14
+ accordionBackground: '--plasma-accordion-background',
15
+ accordionItemBackground: '--plasma-accordion-item-background',
16
+ accordionItemBorderRadius: '--plasma-accordion-item-border-radius',
17
+ accordionItemPadding: '--plasma-accordion-item-padding',
18
+ accordionItemPaddingVertical: '--plasma-accordion-item-padding-vertical',
19
+ accordionItemPaddingHorizontal: '--plasma-accordion-item-padding-horizontal',
20
+ accordionItemGap: '--plasma-accordion-item-gap',
21
+ accordionItemFocus: '--plasma-accordion-item-focus',
22
+ accordionItemBorderBottom: '--plasma-accordion-item-border-bottom',
23
+ accordionItemTitleColor: '--plasma-accordion-item-title-color',
24
+ accordionItemTitleFontFamily: '--plasma-accordion-item-title-font-family',
25
+ accordionItemTitleFontSize: '--plasma-accordion-item-title-font-size',
26
+ accordionItemTitleFontStyle: '--plasma-accordion-item-title-font-style',
27
+ accordionItemTitleFontWeight: '--plasma-accordion-item-title-font-weight',
28
+ accordionItemTitleLetterSpacing: '--plasma-accordion-item-title-letter-spacing',
29
+ accordionItemTitleLineHeight: '--plasma-accordion-item-title-line-height',
30
+ accordionItemTextColor: '--plasma-accordion-item-text-color',
31
+ accordionItemTextFontFamily: '--plasma-accordion-item-text-font-family',
32
+ accordionItemTextFontSize: '--plasma-accordion-item-text-font-size',
33
+ accordionItemTextFontStyle: '--plasma-accordion-item-text-font-style',
34
+ accordionItemTextFontWeight: '--plasma-accordion-item-text-font-weight',
35
+ accordionItemTextLetterSpacing: '--plasma-accordion-item-text-letter-spacing',
36
+ accordionItemTextLineHeight: '--plasma-accordion-item-text-line-height'
37
+ };
@@ -0,0 +1,3 @@
1
+ export { accordionRoot, accordionConfig } from './Accordion';
2
+ export { AccordionItem } from './ui/AccordionItem/AccordionItem';
3
+ export { tokens as accordionTokens, classes as accordionClasses } from './Accordion.tokens';
@@ -0,0 +1,94 @@
1
+ var _StyledMinus, _StyledArrow;
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ 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."); }
4
+ 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); }
5
+ 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; }
6
+ 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; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ import React, { useState, useRef, useEffect } from 'react';
9
+ import { convertRoundnessMatrix } from '../../../../utils/roundness';
10
+ import { classes, tokens } from '../../Accordion.tokens';
11
+ import { StyledAccordionItem, StyledAccordionHeader, StyledAccordionBody, StyledAccordionTitle, StyledAccordionContentLeft, StyledAccordionHeaderLeft, StyledAccordionContentRight, StyledArrow, StyledMinus, StyledPlus, StyledAccordionBodyAnimate } from './AccordionItem.styles';
12
+ export var AccordionItem = function AccordionItem(_ref) {
13
+ var value = _ref.value,
14
+ contentRight = _ref.contentRight,
15
+ contentLeft = _ref.contentLeft,
16
+ title = _ref.title,
17
+ _ref$pin = _ref.pin,
18
+ pin = _ref$pin === void 0 ? 'square-square' : _ref$pin,
19
+ children = _ref.children,
20
+ _ref$type = _ref.type,
21
+ type = _ref$type === void 0 ? 'sign' : _ref$type,
22
+ index = _ref.index,
23
+ eventKey = _ref.eventKey,
24
+ disabled = _ref.disabled,
25
+ onChange = _ref.onChange;
26
+ var key = eventKey !== null && eventKey !== void 0 ? eventKey : index;
27
+ var _useState = useState(),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ leftPadding = _useState2[0],
30
+ setLeftPadding = _useState2[1];
31
+ var handleOpen = function handleOpen() {
32
+ if (disabled) {
33
+ return;
34
+ }
35
+ if (onChange) {
36
+ onChange(key, !value);
37
+ }
38
+ };
39
+ var leftContentRef = useRef(null);
40
+ useEffect(function () {
41
+ var _leftContentRef$curre, _leftContentRef$curre2;
42
+ 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;
43
+ var leftPaddingBody = leftContentWidth ? "calc(".concat(leftContentWidth, "px + var(").concat(tokens.accordionItemGap, "))") : 0;
44
+ setLeftPadding(leftPaddingBody);
45
+ }, [value, type, leftContentRef, setLeftPadding]);
46
+ var openedBodyClass = value ? classes.accordionItemShowBody : undefined;
47
+ var StyledAnimationPLus = function StyledAnimationPLus() {
48
+ return /*#__PURE__*/React.createElement(StyledPlus, null, _StyledMinus || (_StyledMinus = /*#__PURE__*/React.createElement(StyledMinus, {
49
+ size: "xs",
50
+ color: "inhert"
51
+ })), /*#__PURE__*/React.createElement(StyledMinus, {
52
+ size: "xs",
53
+ color: "inhert",
54
+ className: openedBodyClass !== null && openedBodyClass !== void 0 ? openedBodyClass : classes.accordionPlusAnimationElement
55
+ }));
56
+ };
57
+ var accordionBorderRadius = convertRoundnessMatrix(pin, "var(".concat(tokens.accordionItemBorderRadius, ")"), '1.5rem');
58
+ var disabledClass = disabled ? classes.accordionDisabled : '';
59
+ var leftContent = contentLeft !== null && contentLeft !== void 0 ? contentLeft : type === 'arrow' ? _StyledArrow || (_StyledArrow = /*#__PURE__*/React.createElement(StyledArrow, {
60
+ size: "xs",
61
+ color: "inhert"
62
+ })) : undefined;
63
+ var leftContentRotate = type === 'arrow' && value ? classes.accordionItemShowBody : undefined;
64
+ var rightContent = contentRight !== null && contentRight !== void 0 ? contentRight : type === 'sign' ? /*#__PURE__*/React.createElement(StyledAnimationPLus, null) : undefined;
65
+ var rightContentRotate = type === 'sign' && value ? classes.accordionItemShowBody : undefined;
66
+ return /*#__PURE__*/React.createElement(StyledAccordionItem, {
67
+ className: classes.accordionItem,
68
+ key: key,
69
+ style: {
70
+ borderRadius: accordionBorderRadius
71
+ }
72
+ }, /*#__PURE__*/React.createElement(StyledAccordionHeader, {
73
+ role: "tab",
74
+ tabIndex: 0,
75
+ onClick: handleOpen,
76
+ className: disabledClass,
77
+ "aria-expanded": value,
78
+ "aria-controls": "accordion-item-section".concat(key),
79
+ id: "accordion-item-".concat(key)
80
+ }, /*#__PURE__*/React.createElement(StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/React.createElement(StyledAccordionContentLeft, {
81
+ ref: leftContentRef,
82
+ className: leftContentRotate
83
+ }, leftContent), /*#__PURE__*/React.createElement(StyledAccordionTitle, null, title)), /*#__PURE__*/React.createElement(StyledAccordionContentRight, {
84
+ className: rightContentRotate
85
+ }, rightContent && rightContent)), /*#__PURE__*/React.createElement(StyledAccordionBodyAnimate, {
86
+ "aria-labelledby": "accordion-item-".concat(key),
87
+ "aria-hidden": !value,
88
+ id: "accordion-item-section".concat(key),
89
+ className: openedBodyClass,
90
+ style: {
91
+ paddingLeft: "".concat(leftPadding)
92
+ }
93
+ }, /*#__PURE__*/React.createElement(StyledAccordionBody, null, children)));
94
+ };
@@ -0,0 +1,42 @@
1
+ import styled from 'styled-components';
2
+ import { IconChevronDownFill, IconMinus } from '../../../_Icon';
3
+ import { classes, tokens } from '../../Accordion.tokens';
4
+ import { addFocus } from '../../../../mixins';
5
+ export var StyledAccordionItem = /*#__PURE__*/styled.div.withConfig({
6
+ componentId: "plasma-new-hope__sc-20ij9z-0"
7
+ })(["background:var(", ");border-bottom:var(", ");&:last-child{border-bottom:none;}"], tokens.accordionItemBackground, tokens.accordionItemBorderBottom);
8
+ export var StyledAccordionHeader = /*#__PURE__*/styled.button.withConfig({
9
+ componentId: "plasma-new-hope__sc-20ij9z-1"
10
+ })(["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;}", ""], tokens.accordionItemPadding, tokens.accordionItemGap, classes.accordionDisabled, /*#__PURE__*/addFocus({
11
+ outlineOffset: '0.125rem',
12
+ outlineSize: '0.125rem',
13
+ outlineRadius: '0',
14
+ outlineColor: /*#__PURE__*/"var(".concat(tokens.accordionItemFocus, ")")
15
+ }));
16
+ export var StyledAccordionHeaderLeft = /*#__PURE__*/styled.div.withConfig({
17
+ componentId: "plasma-new-hope__sc-20ij9z-2"
18
+ })(["display:flex;gap:var(", ");justify-content:space-between;align-items:center;"], tokens.accordionItemGap);
19
+ export var StyledAccordionContentRight = /*#__PURE__*/styled.div.withConfig({
20
+ componentId: "plasma-new-hope__sc-20ij9z-3"
21
+ })(["transition:0.2s;transform:rotate(90deg);&.", "{transition:0.2s;transform:rotate(0deg);}"], classes.accordionItemShowBody);
22
+ export var StyledAccordionContentLeft = /*#__PURE__*/styled.div.withConfig({
23
+ componentId: "plasma-new-hope__sc-20ij9z-4"
24
+ })(["transition:0.2s;display:flex;align-items:center;&.", "{transition:0.2s;transform:rotate(180deg);}"], classes.accordionItemShowBody);
25
+ export var StyledAccordionTitle = /*#__PURE__*/styled.div.withConfig({
26
+ componentId: "plasma-new-hope__sc-20ij9z-5"
27
+ })(["color:var(", ");font-family:var(", ");font-size:var(", ");font-weight:var(", ");font-style:var(", ");letter-spacing:var(", ");line-height:var(", ");"], tokens.accordionItemTitleColor, tokens.accordionItemTitleFontFamily, tokens.accordionItemTitleFontSize, tokens.accordionItemTitleFontWeight, tokens.accordionItemTitleFontStyle, tokens.accordionItemTitleLetterSpacing, tokens.accordionItemTitleLineHeight);
28
+ export var StyledAccordionBodyAnimate = /*#__PURE__*/styled.div.withConfig({
29
+ componentId: "plasma-new-hope__sc-20ij9z-6"
30
+ })(["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);}}"], classes.accordionItemShowBody, tokens.accordionItemPaddingVertical, classes.accordionPlusAnimationElement);
31
+ export var StyledAccordionBody = /*#__PURE__*/styled.div.withConfig({
32
+ componentId: "plasma-new-hope__sc-20ij9z-7"
33
+ })(["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(", ");"], tokens.accordionItemTextColor, tokens.accordionItemTextFontFamily, tokens.accordionItemTextFontSize, tokens.accordionItemTextFontWeight, tokens.accordionItemTextFontStyle, tokens.accordionItemTextLetterSpacing, tokens.accordionItemTextLineHeight, tokens.accordionItemPaddingHorizontal, tokens.accordionItemPaddingHorizontal);
34
+ export var StyledArrow = /*#__PURE__*/styled(IconChevronDownFill).withConfig({
35
+ componentId: "plasma-new-hope__sc-20ij9z-8"
36
+ })(["pointer-events:none;user-select:none;color:var(", ");"], tokens.accordionItemTextColor);
37
+ export var StyledMinus = /*#__PURE__*/styled(IconMinus).withConfig({
38
+ componentId: "plasma-new-hope__sc-20ij9z-9"
39
+ })(["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);}"], tokens.accordionItemTextColor, classes.accordionPlusAnimationElement, classes.accordionItemShowBody);
40
+ export var StyledPlus = /*#__PURE__*/styled.div.withConfig({
41
+ componentId: "plasma-new-hope__sc-20ij9z-10"
42
+ })(["position:relative;height:1rem;display:flex;align-items:center;justify-content:center;width:1rem;"]);
@@ -0,0 +1,21 @@
1
+ import { Children, cloneElement, isValidElement } from 'react';
2
+ export var updatePropsRecursively = function updatePropsRecursively(children, activeIndex, disabled, updateValue) {
3
+ return Children.map(children || [], function (child, index) {
4
+ if (! /*#__PURE__*/isValidElement(child)) {
5
+ return child;
6
+ }
7
+ var props = {
8
+ index: index,
9
+ value: !!((activeIndex === null || activeIndex === void 0 ? void 0 : activeIndex.findIndex(function (i) {
10
+ var _child$props$eventKey;
11
+ return i === ((_child$props$eventKey = child.props.eventKey) !== null && _child$props$eventKey !== void 0 ? _child$props$eventKey : index);
12
+ })) !== -1),
13
+ disabled: disabled,
14
+ onChange: updateValue
15
+ };
16
+ return /*#__PURE__*/cloneElement(child, props);
17
+ });
18
+ };
19
+ export var getChildren = function getChildren(children, activeIndex, disabled, updateValue) {
20
+ return updatePropsRecursively(children, activeIndex, disabled, updateValue);
21
+ };
@@ -0,0 +1,2 @@
1
+ import { css } from 'styled-components';
2
+ export var base = /*#__PURE__*/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,2 @@
1
+ import { css } from 'styled-components';
2
+ export var base = /*#__PURE__*/css([""]);
@@ -0,0 +1,2 @@
1
+ import { css } from 'styled-components';
2
+ export var base = /*#__PURE__*/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}`}
@@ -53,7 +53,6 @@ export var SegmentProvider = function SegmentProvider(_ref) {
53
53
  }, [selectionMode, setSelectedSegmentItems]);
54
54
  var contextValue = {
55
55
  selectedSegmentItems: selectedSegmentItems,
56
- setSelectedSegmentItems: setSelectedSegmentItems,
57
56
  handleSelect: handleSelect,
58
57
  selectionMode: selectionMode,
59
58
  setSelectionMode: setSelectionMode,
@@ -61,9 +60,7 @@ export var SegmentProvider = function SegmentProvider(_ref) {
61
60
  setDisabledGroup: setDisabledGroup
62
61
  };
63
62
  useEffect(function () {
64
- if (selectionMode === 'single' && (selectedSegmentItems === null || selectedSegmentItems === void 0 ? void 0 : selectedSegmentItems.length) > 0) {
65
- setSelectedSegmentItems([selectedSegmentItems[0]]);
66
- }
63
+ setSelectedSegmentItems([]);
67
64
  }, [selectionMode]);
68
65
  return /*#__PURE__*/React.createElement(SegmentContext.Provider, {
69
66
  value: contextValue
@@ -1,4 +1,4 @@
1
- var _excluded = ["id", "selectionMode", "pilled", "stretch", "filledBackground", "disabled", "size", "view", "children", "defaultSelected"];
1
+ var _excluded = ["id", "selectionMode", "pilled", "stretch", "filledBackground", "disabled", "size", "view", "children"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
4
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -34,12 +34,10 @@ export var segmentGroupRoot = function segmentGroupRoot(Root) {
34
34
  size = props.size,
35
35
  view = props.view,
36
36
  children = props.children,
37
- defaultSelected = props.defaultSelected,
38
37
  rest = _objectWithoutProperties(props, _excluded);
39
38
  var _useSegmentInner = useSegmentInner(),
40
39
  setSelectionMode = _useSegmentInner.setSelectionMode,
41
- setDisabledGroup = _useSegmentInner.setDisabledGroup,
42
- setSelectedSegmentItems = _useSegmentInner.setSelectedSegmentItems;
40
+ setDisabledGroup = _useSegmentInner.setDisabledGroup;
43
41
  var _useState = useState(0),
44
42
  _useState2 = _slicedToArray(_useState, 2),
45
43
  index = _useState2[0],
@@ -123,11 +121,6 @@ export var segmentGroupRoot = function segmentGroupRoot(Root) {
123
121
  selectionMode && setSelectionMode(selectionMode);
124
122
  setDisabledGroup(disabled);
125
123
  }, [selectionMode, disabled]);
126
- useEffect(function () {
127
- if (defaultSelected !== null && defaultSelected !== void 0 && defaultSelected.length) {
128
- setSelectedSegmentItems(defaultSelected);
129
- }
130
- }, [defaultSelected]);
131
124
  useEffect(function () {
132
125
  var _trackRef$current;
133
126
  // Intersection observer для первого сегмента
@@ -0,0 +1,16 @@
1
+ var _path;
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ import React from 'react';
4
+ export var ChevronDownFill = function ChevronDownFill(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ width: "100%",
7
+ viewBox: "0 0 16 16",
8
+ fill: "none"
9
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
10
+ id: "path",
11
+ 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",
12
+ fillRule: "evenodd",
13
+ fill: "currentColor",
14
+ clipRule: "evenodd"
15
+ })));
16
+ };
@@ -0,0 +1,14 @@
1
+ var _path;
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ import React from 'react';
4
+ export var Minus = function Minus(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ width: "100%",
7
+ viewBox: "0 0 24 24",
8
+ fill: "none"
9
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
10
+ id: "icon",
11
+ 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",
12
+ fill: "currentColor"
13
+ })));
14
+ };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { ChevronDownFill } from '../Icon.assets/ChevronDownFill';
3
+ import { IconRoot } from '../IconRoot';
4
+ export var IconChevronDownFill = function IconChevronDownFill(_ref) {
5
+ var _ref$size = _ref.size,
6
+ size = _ref$size === void 0 ? 'xs' : _ref$size,
7
+ color = _ref.color,
8
+ className = _ref.className;
9
+ return /*#__PURE__*/React.createElement(IconRoot, {
10
+ className: className,
11
+ size: size,
12
+ color: color,
13
+ icon: ChevronDownFill
14
+ });
15
+ };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Minus } from '../Icon.assets/Minus';
3
+ import { IconRoot } from '../IconRoot';
4
+ export var IconMinus = function IconMinus(_ref) {
5
+ var _ref$size = _ref.size,
6
+ size = _ref$size === void 0 ? 's' : _ref$size,
7
+ color = _ref.color,
8
+ className = _ref.className;
9
+ return /*#__PURE__*/React.createElement(IconRoot, {
10
+ className: className,
11
+ size: size,
12
+ color: color,
13
+ icon: Minus
14
+ });
15
+ };
@@ -4,6 +4,8 @@ export { IconMic } from './Icons/IconMic';
4
4
  export { IconChevronLeft } from './Icons/IconChevronLeft';
5
5
  export { IconChevronDoubleLeft } from './Icons/IconChevronDoubleLeft';
6
6
  export { IconChevronDown } from './Icons/IconChevronDown';
7
+ export { IconChevronDownFill } from './Icons/IconChevronDownFill';
7
8
  export { IconClose } from './Icons/IconClose';
8
9
  export { IconCross } from './Icons/IconCross';
9
- export { IconDone } from './Icons/IconDone';
10
+ export { IconDone } from './Icons/IconDone';
11
+ export { IconMinus } from './Icons/IconMinus';
@@ -0,0 +1,20 @@
1
+ import { css } from 'styled-components';
2
+ import { accordionTokens } from '../../../../components/Accordion';
3
+ export var config = {
4
+ defaults: {
5
+ view: 'default',
6
+ size: 'm'
7
+ },
8
+ variations: {
9
+ view: {
10
+ "default": /*#__PURE__*/css(["", ":0.125rem;", ":20rem;", ":var(", ") var(", ");", ":var(--surface-solid-card);", ":var(--text-primary);", ":var(--text-primary);", ":var(--surface-accent);", ":var(--surface-clear);", ":0;"], accordionTokens.accordionGap, accordionTokens.accordionWidth, accordionTokens.accordionItemPadding, accordionTokens.accordionItemPaddingVertical, accordionTokens.accordionItemPaddingHorizontal, accordionTokens.accordionItemBackground, accordionTokens.accordionItemTitleColor, accordionTokens.accordionItemTextColor, accordionTokens.accordionItemFocus, accordionTokens.accordionBackground, accordionTokens.accordionItemBorderBottom),
11
+ clear: /*#__PURE__*/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);"], accordionTokens.accordionGap, accordionTokens.accordionWidth, accordionTokens.accordionItemPadding, accordionTokens.accordionItemPaddingVertical, accordionTokens.accordionItemBackground, accordionTokens.accordionItemTitleColor, accordionTokens.accordionItemTextColor, accordionTokens.accordionItemFocus, accordionTokens.accordionItemBorderRadius, accordionTokens.accordionBackground, accordionTokens.accordionItemBorderBottom)
12
+ },
13
+ size: {
14
+ l: /*#__PURE__*/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);"], accordionTokens.accordionItemPaddingVertical, accordionTokens.accordionItemPaddingHorizontal, accordionTokens.accordionItemGap, accordionTokens.accordionItemBorderRadius, accordionTokens.accordionItemTitleFontFamily, accordionTokens.accordionItemTitleFontSize, accordionTokens.accordionItemTitleFontStyle, accordionTokens.accordionItemTitleFontWeight, accordionTokens.accordionItemTitleLetterSpacing, accordionTokens.accordionItemTitleLineHeight, accordionTokens.accordionItemTextFontFamily, accordionTokens.accordionItemTextFontSize, accordionTokens.accordionItemTextFontStyle, accordionTokens.accordionItemTextFontWeight, accordionTokens.accordionItemTextLetterSpacing, accordionTokens.accordionItemTextLineHeight),
15
+ m: /*#__PURE__*/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);"], accordionTokens.accordionItemPaddingVertical, accordionTokens.accordionItemPaddingHorizontal, accordionTokens.accordionItemGap, accordionTokens.accordionItemBorderRadius, accordionTokens.accordionItemTitleFontFamily, accordionTokens.accordionItemTitleFontSize, accordionTokens.accordionItemTitleFontStyle, accordionTokens.accordionItemTitleFontWeight, accordionTokens.accordionItemTitleLetterSpacing, accordionTokens.accordionItemTitleLineHeight, accordionTokens.accordionItemTextFontFamily, accordionTokens.accordionItemTextFontSize, accordionTokens.accordionItemTextFontStyle, accordionTokens.accordionItemTextFontWeight, accordionTokens.accordionItemTextLetterSpacing, accordionTokens.accordionItemTextLineHeight),
16
+ s: /*#__PURE__*/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);"], accordionTokens.accordionItemPaddingVertical, accordionTokens.accordionItemPaddingHorizontal, accordionTokens.accordionItemGap, accordionTokens.accordionItemBorderRadius, accordionTokens.accordionItemTitleFontFamily, accordionTokens.accordionItemTitleFontSize, accordionTokens.accordionItemTitleFontStyle, accordionTokens.accordionItemTitleFontWeight, accordionTokens.accordionItemTitleLetterSpacing, accordionTokens.accordionItemTitleLineHeight, accordionTokens.accordionItemTextFontFamily, accordionTokens.accordionItemTextFontSize, accordionTokens.accordionItemTextFontStyle, accordionTokens.accordionItemTextFontWeight, accordionTokens.accordionItemTextLetterSpacing, accordionTokens.accordionItemTextLineHeight),
17
+ xs: /*#__PURE__*/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);"], accordionTokens.accordionItemPaddingVertical, accordionTokens.accordionItemPaddingHorizontal, accordionTokens.accordionItemGap, accordionTokens.accordionItemBorderRadius, accordionTokens.accordionItemTitleFontFamily, accordionTokens.accordionItemTitleFontSize, accordionTokens.accordionItemTitleFontStyle, accordionTokens.accordionItemTitleFontWeight, accordionTokens.accordionItemTitleLetterSpacing, accordionTokens.accordionItemTitleLineHeight, accordionTokens.accordionItemTextFontFamily, accordionTokens.accordionItemTextFontSize, accordionTokens.accordionItemTextFontStyle, accordionTokens.accordionItemTextFontWeight, accordionTokens.accordionItemTextLetterSpacing, accordionTokens.accordionItemTextLineHeight)
18
+ }
19
+ }
20
+ };
@@ -0,0 +1,6 @@
1
+ import { accordionConfig, AccordionItem } from '../../../../components/Accordion';
2
+ import { component, mergeConfig } from '../../../../engines';
3
+ import { config } from './Accordion.config';
4
+ var mergedConfig = /*#__PURE__*/mergeConfig(accordionConfig, config);
5
+ export var Accordion = /*#__PURE__*/component(mergedConfig);
6
+ export { AccordionItem };