@salutejs/plasma-new-hope 0.88.0-canary.1222.9283214118.0 → 0.88.0-canary.1223.9301566220.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +4 -4
- package/styled-components/cjs/components/Accordion/Accordion.js +50 -0
- package/styled-components/cjs/components/Accordion/Accordion.styles.js +9 -0
- package/styled-components/cjs/components/Accordion/Accordion.tokens.js +42 -0
- package/styled-components/cjs/components/Accordion/Accordion.types.js +5 -0
- package/styled-components/cjs/components/Accordion/index.js +38 -0
- package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js +96 -0
- package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +49 -0
- package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.types.js +5 -0
- package/styled-components/cjs/components/Accordion/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Accordion/variations/_size/tokens.json +6 -0
- package/styled-components/cjs/components/Accordion/variations/_stretching/base.js +8 -0
- package/styled-components/cjs/components/Accordion/variations/_stretching/tokens.json +1 -0
- package/styled-components/cjs/components/Accordion/variations/_view/base.js +8 -0
- package/styled-components/cjs/components/Accordion/variations/_view/tokens.json +8 -0
- package/styled-components/cjs/components/_Icon/Icon.assets/Minus.js +21 -0
- package/styled-components/cjs/components/_Icon/Icons/IconMinus.js +22 -0
- package/styled-components/cjs/components/_Icon/index.js +8 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.config.js +30 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.js +17 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.stories.tsx +75 -0
- package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.config.js +30 -0
- package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.js +17 -0
- package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.stories.tsx +75 -0
- package/styled-components/es/components/Accordion/Accordion.js +41 -0
- package/styled-components/es/components/Accordion/Accordion.styles.js +3 -0
- package/styled-components/es/components/Accordion/Accordion.tokens.js +36 -0
- package/styled-components/es/components/Accordion/Accordion.types.js +1 -0
- package/styled-components/es/components/Accordion/index.js +3 -0
- package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.js +87 -0
- package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +42 -0
- package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.types.js +1 -0
- package/styled-components/es/components/Accordion/variations/_size/base.js +2 -0
- package/styled-components/es/components/Accordion/variations/_size/tokens.json +6 -0
- package/styled-components/es/components/Accordion/variations/_stretching/base.js +2 -0
- package/styled-components/es/components/Accordion/variations/_stretching/tokens.json +1 -0
- package/styled-components/es/components/Accordion/variations/_view/base.js +2 -0
- package/styled-components/es/components/Accordion/variations/_view/tokens.json +8 -0
- package/styled-components/es/components/_Icon/Icon.assets/Minus.js +14 -0
- package/styled-components/es/components/_Icon/Icons/IconMinus.js +15 -0
- package/styled-components/es/components/_Icon/index.js +2 -1
- package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.config.js +24 -0
- package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.js +6 -0
- package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.stories.tsx +75 -0
- package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.config.js +24 -0
- package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.js +6 -0
- package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.stories.tsx +75 -0
- package/types/components/Accordion/Accordion.d.ts +35 -0
- package/types/components/Accordion/Accordion.d.ts.map +1 -0
- package/types/components/Accordion/Accordion.styles.d.ts +2 -0
- package/types/components/Accordion/Accordion.styles.d.ts.map +1 -0
- package/types/components/Accordion/Accordion.tokens.d.ts +37 -0
- package/types/components/Accordion/Accordion.tokens.d.ts.map +1 -0
- package/types/components/Accordion/Accordion.types.d.ts +24 -0
- package/types/components/Accordion/Accordion.types.d.ts.map +1 -0
- package/types/components/Accordion/index.d.ts +5 -0
- package/types/components/Accordion/index.d.ts.map +1 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.d.ts +4 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.d.ts.map +1 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.styles.d.ts +13 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.styles.d.ts.map +1 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.types.d.ts +39 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.types.d.ts.map +1 -0
- package/types/components/Accordion/variations/_size/base.d.ts +2 -0
- package/types/components/Accordion/variations/_size/base.d.ts.map +1 -0
- package/types/components/Accordion/variations/_stretching/base.d.ts +2 -0
- package/types/components/Accordion/variations/_stretching/base.d.ts.map +1 -0
- package/types/components/Accordion/variations/_view/base.d.ts +2 -0
- package/types/components/Accordion/variations/_view/base.d.ts.map +1 -0
- package/types/components/_Icon/Icon.assets/Minus.d.ts +4 -0
- package/types/components/_Icon/Icon.assets/Minus.d.ts.map +1 -0
- package/types/components/_Icon/Icons/IconMinus.d.ts +4 -0
- package/types/components/_Icon/Icons/IconMinus.d.ts.map +1 -0
- package/types/components/_Icon/index.d.ts +1 -0
- package/types/components/_Icon/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Accordion/Accordion.config.d.ts +23 -0
- package/types/examples/plasma_b2c/components/Accordion/Accordion.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Accordion/Accordion.d.ts +26 -0
- package/types/examples/plasma_b2c/components/Accordion/Accordion.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Accordion/Accordion.config.d.ts +23 -0
- package/types/examples/plasma_web/components/Accordion/Accordion.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Accordion/Accordion.d.ts +26 -0
- package/types/examples/plasma_web/components/Accordion/Accordion.d.ts.map +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.88.0-canary.
|
3
|
+
"version": "0.88.0-canary.1223.9301566220.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"@rollup/plugin-babel": "^6.0.4",
|
69
69
|
"@rollup/plugin-commonjs": "^25.0.4",
|
70
70
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
71
|
-
"@salutejs/plasma-sb-utils": "0.
|
71
|
+
"@salutejs/plasma-sb-utils": "0.158.0",
|
72
72
|
"@storybook/addon-docs": "^7.6.17",
|
73
73
|
"@storybook/addon-essentials": "^7.6.17",
|
74
74
|
"@storybook/addons": "^7.6.17",
|
@@ -97,11 +97,11 @@
|
|
97
97
|
"@linaria/core": "5.0.2",
|
98
98
|
"@linaria/react": "5.0.3",
|
99
99
|
"@popperjs/core": "2.11.8",
|
100
|
-
"@salutejs/plasma-core": "1.
|
100
|
+
"@salutejs/plasma-core": "1.160.0",
|
101
101
|
"focus-visible": "5.2.0",
|
102
102
|
"react-draggable": "4.4.3",
|
103
103
|
"react-popper": "2.3.0",
|
104
104
|
"storeon": "3.1.5"
|
105
105
|
},
|
106
|
-
"gitHead": "
|
106
|
+
"gitHead": "93085fc5bf6fc985c6fcfe7d2ed6b6005d2a6a99"
|
107
107
|
}
|
@@ -0,0 +1,50 @@
|
|
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.accordionRoot = exports.accordionConfig = void 0;
|
8
|
+
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
+
var _utils = /*#__PURE__*/require("../../utils");
|
10
|
+
var _Accordion = /*#__PURE__*/require("./Accordion.styles");
|
11
|
+
var _Accordion2 = /*#__PURE__*/require("./Accordion.tokens");
|
12
|
+
var _base = /*#__PURE__*/require("./variations/_view/base");
|
13
|
+
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
14
|
+
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); }
|
15
|
+
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; }
|
16
|
+
var accordionRoot = exports.accordionRoot = function accordionRoot(Root) {
|
17
|
+
return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, outerRootRef) {
|
18
|
+
var size = _ref.size,
|
19
|
+
view = _ref.view,
|
20
|
+
_ref$stretching = _ref.stretching,
|
21
|
+
stretching = _ref$stretching === void 0 ? 'filled' : _ref$stretching,
|
22
|
+
children = _ref.children,
|
23
|
+
className = _ref.className;
|
24
|
+
var stretchingClass = _Accordion2.classes["".concat(stretching, "Stretching")];
|
25
|
+
return /*#__PURE__*/_react["default"].createElement(Root, {
|
26
|
+
ref: outerRootRef,
|
27
|
+
size: size,
|
28
|
+
view: view,
|
29
|
+
className: (0, _utils.cx)(stretchingClass, _Accordion2.classes.accordionRoot, className)
|
30
|
+
}, children);
|
31
|
+
});
|
32
|
+
};
|
33
|
+
var accordionConfig = exports.accordionConfig = {
|
34
|
+
name: 'Accordion',
|
35
|
+
tag: 'div',
|
36
|
+
layout: accordionRoot,
|
37
|
+
base: _Accordion.base,
|
38
|
+
variations: {
|
39
|
+
view: {
|
40
|
+
css: _base.base
|
41
|
+
},
|
42
|
+
size: {
|
43
|
+
css: _base2.base
|
44
|
+
}
|
45
|
+
},
|
46
|
+
defaults: {
|
47
|
+
view: 'default',
|
48
|
+
size: 'm'
|
49
|
+
}
|
50
|
+
};
|
@@ -0,0 +1,9 @@
|
|
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 _Accordion = /*#__PURE__*/require("./Accordion.tokens");
|
9
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["display:flex;flex-direction:column;gap:var(", ");align-items:stretch;height:auto;background:var(", ");&&.", "{width:var(", ");}&&.", "{width:100%;}"], _Accordion.tokens.accordionGap, _Accordion.tokens.accordionBackground, _Accordion.classes.fixedStretching, _Accordion.tokens.accordionWidth, _Accordion.classes.filledStretching);
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.tokens = exports.classes = void 0;
|
7
|
+
var classes = exports.classes = {
|
8
|
+
filledStretching: 'accordion-stretching-filled',
|
9
|
+
fixedStretching: 'accordion-stretching-fixed',
|
10
|
+
accordionRoot: 'accordion-root',
|
11
|
+
accordionItem: 'accordion-item',
|
12
|
+
clearAccordionItem: 'clear-accordion-item',
|
13
|
+
accordionItemShowBody: 'accordion-item-show-body',
|
14
|
+
accordionPlusAnimationElement: 'accordion-plus-animation-element'
|
15
|
+
};
|
16
|
+
var tokens = exports.tokens = {
|
17
|
+
accordionGap: '--plasma-accordion-gap',
|
18
|
+
accordionWidth: '--plasma-accordion-width',
|
19
|
+
accordionBackground: '--plasma-accordion-background',
|
20
|
+
accordionItemBackground: '--plasma-accordion-item-background',
|
21
|
+
accordionItemBorderRadius: '--plasma-accordion-item-border-radius',
|
22
|
+
accordionItemPaddingTop: '--plasma-accordion-item-padding-top',
|
23
|
+
accordionItemPaddingRight: '--plasma-accordion-item-padding-right',
|
24
|
+
accordionItemPaddingBottom: '--plasma-accordion-item-padding-bottom',
|
25
|
+
accordionItemPaddingLeft: '--plasma-accordion-item-padding-left',
|
26
|
+
accordionItemGap: '--plasma-accordion-item-gap',
|
27
|
+
accordionItemFocus: '--plasma-accordion-item-focus',
|
28
|
+
accordionItemTitleColor: '--plasma-accordion-item-title-color',
|
29
|
+
accordionItemTitleFontFamily: '--plasma-accordion-item-title-font-family',
|
30
|
+
accordionItemTitleFontSize: '--plasma-accordion-item-title-font-size',
|
31
|
+
accordionItemTitleFontStyle: '--plasma-accordion-item-title-font-style',
|
32
|
+
accordionItemTitleFontWeight: '--plasma-accordion-item-title-font-weight',
|
33
|
+
accordionItemTitleLetterSpacing: '--plasma-accordion-item-title-letter-spacing',
|
34
|
+
accordionItemTitleLineHeight: '--plasma-accordion-item-title-line-height',
|
35
|
+
accordionItemTextColor: '--plasma-accordion-item-text-color',
|
36
|
+
accordionItemTextFontFamily: '--plasma-accordion-item-text-font-family',
|
37
|
+
accordionItemTextFontSize: '--plasma-accordion-item-text-font-size',
|
38
|
+
accordionItemTextFontStyle: '--plasma-accordion-item-text-font-style',
|
39
|
+
accordionItemTextFontWeight: '--plasma-accordion-item-text-font-weight',
|
40
|
+
accordionItemTextLetterSpacing: '--plasma-accordion-item-text-letter-spacing',
|
41
|
+
accordionItemTextLineHeight: '--plasma-accordion-item-text-line-height'
|
42
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "AccordionItem", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _AccordionItem.AccordionItem;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "accordionClasses", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _Accordion2.classes;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
Object.defineProperty(exports, "accordionConfig", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function get() {
|
21
|
+
return _Accordion.accordionConfig;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
Object.defineProperty(exports, "accordionRoot", {
|
25
|
+
enumerable: true,
|
26
|
+
get: function get() {
|
27
|
+
return _Accordion.accordionRoot;
|
28
|
+
}
|
29
|
+
});
|
30
|
+
Object.defineProperty(exports, "accordionTokens", {
|
31
|
+
enumerable: true,
|
32
|
+
get: function get() {
|
33
|
+
return _Accordion2.tokens;
|
34
|
+
}
|
35
|
+
});
|
36
|
+
var _Accordion = /*#__PURE__*/require("./Accordion");
|
37
|
+
var _AccordionItem = /*#__PURE__*/require("./ui/AccordionItem/AccordionItem");
|
38
|
+
var _Accordion2 = /*#__PURE__*/require("./Accordion.tokens");
|
@@ -0,0 +1,96 @@
|
|
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
|
+
body = _ref.body,
|
29
|
+
_ref$type = _ref.type,
|
30
|
+
type = _ref$type === void 0 ? 'sign' : _ref$type,
|
31
|
+
onChangeValue = _ref.onChangeValue;
|
32
|
+
var _useState = (0, _react.useState)(value),
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
34
|
+
show = _useState2[0],
|
35
|
+
setShow = _useState2[1];
|
36
|
+
var _useState3 = (0, _react.useState)(),
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
38
|
+
leftPadding = _useState4[0],
|
39
|
+
setLeftPadding = _useState4[1];
|
40
|
+
var showHandler = function showHandler() {
|
41
|
+
setShow(!show);
|
42
|
+
onChangeValue && onChangeValue(!show);
|
43
|
+
};
|
44
|
+
var onKeyPress = function onKeyPress(event) {
|
45
|
+
event.persist();
|
46
|
+
if (event.keyCode === 13) {
|
47
|
+
showHandler();
|
48
|
+
}
|
49
|
+
};
|
50
|
+
var leftContentRef = (0, _react.useRef)(null);
|
51
|
+
(0, _react.useEffect)(function () {
|
52
|
+
var _leftContentRef$curre, _leftContentRef$curre2;
|
53
|
+
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;
|
54
|
+
var leftPaddingBody = leftContentWidth ? "calc(".concat(leftContentWidth, "px + var(").concat(_Accordion.tokens.accordionItemGap, "))") : 0;
|
55
|
+
setLeftPadding(leftPaddingBody);
|
56
|
+
}, [type, leftContentRef, setLeftPadding]);
|
57
|
+
var showedBody = show ? _Accordion.classes.accordionItemShowBody : undefined;
|
58
|
+
var StyledAnimationPLus = function StyledAnimationPLus() {
|
59
|
+
return /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledPlus, null, _StyledMinus || (_StyledMinus = /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledMinus, {
|
60
|
+
size: "s",
|
61
|
+
color: "inhert"
|
62
|
+
})), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledMinus, {
|
63
|
+
size: "s",
|
64
|
+
color: "inhert",
|
65
|
+
className: showedBody !== null && showedBody !== void 0 ? showedBody : _Accordion.classes.accordionPlusAnimationElement
|
66
|
+
}));
|
67
|
+
};
|
68
|
+
var accordionBorderRadius = (0, _roundness.convertRoundnessMatrix)(pin, "var(".concat(_Accordion.tokens.accordionItemBorderRadius, ")"));
|
69
|
+
var leftContent = contentLeft !== null && contentLeft !== void 0 ? contentLeft : type === 'arrow' ? _StyledArrow || (_StyledArrow = /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledArrow, {
|
70
|
+
size: "s",
|
71
|
+
color: "inhert"
|
72
|
+
})) : undefined;
|
73
|
+
var leftContentRotate = type === 'arrow' && show ? _Accordion.classes.accordionItemShowBody : undefined;
|
74
|
+
var rightContent = contentRight !== null && contentRight !== void 0 ? contentRight : type === 'sign' ? /*#__PURE__*/_react["default"].createElement(StyledAnimationPLus, null) : undefined;
|
75
|
+
var rightContentRotate = type === 'sign' && show ? _Accordion.classes.accordionItemShowBody : undefined;
|
76
|
+
return /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionItem, {
|
77
|
+
role: "tab",
|
78
|
+
tabIndex: 0,
|
79
|
+
style: {
|
80
|
+
borderRadius: accordionBorderRadius
|
81
|
+
},
|
82
|
+
onKeyDown: onKeyPress
|
83
|
+
}, /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionHeader, {
|
84
|
+
onClick: showHandler
|
85
|
+
}, /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionContentLeft, {
|
86
|
+
ref: leftContentRef,
|
87
|
+
className: leftContentRotate
|
88
|
+
}, leftContent), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionTitle, null, title)), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionContentRight, {
|
89
|
+
className: rightContentRotate
|
90
|
+
}, rightContent && rightContent)), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionBodyAnimate, {
|
91
|
+
className: showedBody,
|
92
|
+
style: {
|
93
|
+
paddingLeft: "".concat(leftPadding)
|
94
|
+
}
|
95
|
+
}, /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionBody, null, body)));
|
96
|
+
};
|
@@ -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(", ");&:focus{outline:none;}", ""], _Accordion.tokens.accordionItemBackground, /*#__PURE__*/(0, _mixins.addFocus)({
|
15
|
+
outlineOffset: '0.125rem',
|
16
|
+
outlineSize: '0.125rem',
|
17
|
+
outlineRadius: '0',
|
18
|
+
outlineColor: /*#__PURE__*/"var(".concat(_Accordion.tokens.accordionItemFocus, ")")
|
19
|
+
}));
|
20
|
+
var StyledAccordionHeader = exports.StyledAccordionHeader = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
21
|
+
componentId: "plasma-new-hope__sc-20ij9z-1"
|
22
|
+
})(["padding-top:var(", ");padding-right:var(", ");padding-bottom:var(", ");padding-left:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;cursor:pointer;"], _Accordion.tokens.accordionItemPaddingTop, _Accordion.tokens.accordionItemPaddingRight, _Accordion.tokens.accordionItemPaddingBottom, _Accordion.tokens.accordionItemPaddingLeft, _Accordion.tokens.accordionItemGap);
|
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.accordionItemTitleFontWeight, _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.accordionItemPaddingBottom, _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.accordionItemTextFontWeight, _Accordion.tokens.accordionItemTextFontSize, _Accordion.tokens.accordionItemTextFontWeight, _Accordion.tokens.accordionItemTextFontStyle, _Accordion.tokens.accordionItemTextLetterSpacing, _Accordion.tokens.accordionItemTextLineHeight, _Accordion.tokens.accordionItemPaddingRight, _Accordion.tokens.accordionItemPaddingLeft);
|
41
|
+
var StyledArrow = exports.StyledArrow = /*#__PURE__*/(0, _styledComponents["default"])(_Icon.IconChevronDown).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:1.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;"]);
|
@@ -0,0 +1 @@
|
|
1
|
+
["--plasma-button-width"]
|
@@ -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.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
|
+
};
|
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "IconMic", {
|
|
57
57
|
return _IconMic.IconMic;
|
58
58
|
}
|
59
59
|
});
|
60
|
+
Object.defineProperty(exports, "IconMinus", {
|
61
|
+
enumerable: true,
|
62
|
+
get: function get() {
|
63
|
+
return _IconMinus.IconMinus;
|
64
|
+
}
|
65
|
+
});
|
60
66
|
var _IconDisclosureLeft = /*#__PURE__*/require("./Icons/IconDisclosureLeft");
|
61
67
|
var _IconDisclosureRight = /*#__PURE__*/require("./Icons/IconDisclosureRight");
|
62
68
|
var _IconMic = /*#__PURE__*/require("./Icons/IconMic");
|
@@ -65,4 +71,5 @@ var _IconChevronDoubleLeft = /*#__PURE__*/require("./Icons/IconChevronDoubleLeft
|
|
65
71
|
var _IconChevronDown = /*#__PURE__*/require("./Icons/IconChevronDown");
|
66
72
|
var _IconClose = /*#__PURE__*/require("./Icons/IconClose");
|
67
73
|
var _IconCross = /*#__PURE__*/require("./Icons/IconCross");
|
68
|
-
var _IconDone = /*#__PURE__*/require("./Icons/IconDone");
|
74
|
+
var _IconDone = /*#__PURE__*/require("./Icons/IconDone");
|
75
|
+
var _IconMinus = /*#__PURE__*/require("./Icons/IconMinus");
|
@@ -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(--surface-solid-card);", ":var(--text-primary);", ":var(--text-primary);", ":var(--surface-accent);", ":var(--surface-clear);"], _Accordion.accordionTokens.accordionGap, _Accordion.accordionTokens.accordionWidth, _Accordion.accordionTokens.accordionItemBackground, _Accordion.accordionTokens.accordionItemTitleColor, _Accordion.accordionTokens.accordionItemTextColor, _Accordion.accordionTokens.accordionItemFocus, _Accordion.accordionTokens.accordionBackground),
|
17
|
+
clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.125rem;", ":20rem;", ":0rem !important;", ":0rem !important;", ":var(--background-primary);", ":var(--text-primary);", ":var(--text-primary);", ":var(--surface-accent);", ":0rem !important;", ":var(--surface-solid-tertiary);"], _Accordion.accordionTokens.accordionGap, _Accordion.accordionTokens.accordionWidth, _Accordion.accordionTokens.accordionItemPaddingRight, _Accordion.accordionTokens.accordionItemPaddingLeft, _Accordion.accordionTokens.accordionItemBackground, _Accordion.accordionTokens.accordionItemTitleColor, _Accordion.accordionTokens.accordionItemTextColor, _Accordion.accordionTokens.accordionItemFocus, _Accordion.accordionTokens.accordionItemBorderRadius, _Accordion.accordionTokens.accordionBackground)
|
18
|
+
},
|
19
|
+
size: {
|
20
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.0625rem;", ":1.25rem;", ":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.accordionItemPaddingTop, _Accordion.accordionTokens.accordionItemPaddingRight, _Accordion.accordionTokens.accordionItemPaddingBottom, _Accordion.accordionTokens.accordionItemPaddingLeft, _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.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.accordionItemPaddingTop, _Accordion.accordionTokens.accordionItemPaddingRight, _Accordion.accordionTokens.accordionItemPaddingBottom, _Accordion.accordionTokens.accordionItemPaddingLeft, _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.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.accordionItemPaddingTop, _Accordion.accordionTokens.accordionItemPaddingRight, _Accordion.accordionTokens.accordionItemPaddingBottom, _Accordion.accordionTokens.accordionItemPaddingLeft, _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.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.accordionItemPaddingTop, _Accordion.accordionTokens.accordionItemPaddingRight, _Accordion.accordionTokens.accordionItemPaddingBottom, _Accordion.accordionTokens.accordionItemPaddingLeft, _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
|
+
};
|
@@ -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,75 @@
|
|
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
|
+
view: 'default',
|
19
|
+
size: 'm',
|
20
|
+
stretching: 'filled',
|
21
|
+
pin: 'square-square',
|
22
|
+
type: 'arrow',
|
23
|
+
title: 'Как оплатить заправку бонусами СберСпасибо?',
|
24
|
+
body:
|
25
|
+
'После указания деталей заправки нажмите кнопку «К оплате». Откроется окно оплаты, где вы сможете списать бонусы и оплатить ими до 99% стоимости топлива',
|
26
|
+
},
|
27
|
+
argTypes: {
|
28
|
+
...argTypesFromConfig(mergeConfig(accordionConfig, config)),
|
29
|
+
pin: {
|
30
|
+
options: [
|
31
|
+
'square-square',
|
32
|
+
'square-clear',
|
33
|
+
'clear-square',
|
34
|
+
'clear-clear',
|
35
|
+
'clear-circle',
|
36
|
+
'circle-clear',
|
37
|
+
'circle-circle',
|
38
|
+
'',
|
39
|
+
],
|
40
|
+
control: {
|
41
|
+
type: 'select',
|
42
|
+
},
|
43
|
+
table: { defaultValue: { summary: 'bottom' } },
|
44
|
+
},
|
45
|
+
stretching: {
|
46
|
+
options: ['filled', 'fixed'],
|
47
|
+
control: {
|
48
|
+
type: 'select',
|
49
|
+
},
|
50
|
+
},
|
51
|
+
type: {
|
52
|
+
options: ['arrow', 'sign', 'clear'],
|
53
|
+
control: {
|
54
|
+
type: 'select',
|
55
|
+
},
|
56
|
+
},
|
57
|
+
},
|
58
|
+
};
|
59
|
+
|
60
|
+
export default meta;
|
61
|
+
|
62
|
+
export const Default: StoryObj<ComponentProps<typeof Accordion>> = {
|
63
|
+
argTypes: { ...disableProps(['text']) },
|
64
|
+
render: (props: ComponentProps<typeof Accordion>) => {
|
65
|
+
const args = { ...props, text: undefined };
|
66
|
+
|
67
|
+
return (
|
68
|
+
<Accordion {...args}>
|
69
|
+
<AccordionItem type={args.type} pin={args.pin} title={args.title} body={args.body} />
|
70
|
+
<AccordionItem type={args.type} pin={args.pin} title={args.title} body={args.body} />
|
71
|
+
<AccordionItem type={args.type} pin={args.pin} title={args.title} body={args.body} />
|
72
|
+
</Accordion>
|
73
|
+
);
|
74
|
+
},
|
75
|
+
};
|