@salutejs/plasma-new-hope 0.68.0-canary.1104.8452846373.0 → 0.68.0-canary.1148.8452547227.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Cell/Cell.css +3 -0
- package/cjs/components/Cell/Cell.js +71 -0
- package/cjs/components/Cell/Cell.js.map +1 -0
- package/cjs/components/Cell/Cell.styles.js +36 -0
- package/cjs/components/Cell/Cell.styles.js.map +1 -0
- package/cjs/components/Cell/Cell.tokens.js +50 -0
- package/cjs/components/Cell/Cell.tokens.js.map +1 -0
- package/cjs/components/Cell/Textbox/Textbox.js +20 -0
- package/cjs/components/Cell/Textbox/Textbox.js.map +1 -0
- package/cjs/components/Cell/Textbox/Textbox.styles.js +13 -0
- package/cjs/components/Cell/Textbox/Textbox.styles.js.map +1 -0
- package/cjs/components/Cell/Textbox/ui/TextLabel.js +17 -0
- package/cjs/components/Cell/Textbox/ui/TextLabel.js.map +1 -0
- package/cjs/components/Cell/Textbox/ui/TextSubtitle.js +17 -0
- package/cjs/components/Cell/Textbox/ui/TextSubtitle.js.map +1 -0
- package/cjs/components/Cell/Textbox/ui/TextTitle.js +17 -0
- package/cjs/components/Cell/Textbox/ui/TextTitle.js.map +1 -0
- package/cjs/components/Cell/variations/_size/base.js +9 -0
- package/cjs/components/Cell/variations/_size/base.js.map +1 -0
- package/cjs/components/Cell/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Cell/variations/_stretching/base.js +9 -0
- package/cjs/components/Cell/variations/_stretching/base.js.map +1 -0
- package/cjs/components/Cell/variations/_stretching/base_1ryz4br.css +1 -0
- package/cjs/components/Cell/variations/_view/base.js +9 -0
- package/cjs/components/Cell/variations/_view/base.js.map +1 -0
- package/cjs/components/Cell/variations/_view/base_13f5j4a.css +1 -0
- package/cjs/components/Dropdown/Dropdown.js +1 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Popover/Popover.js +31 -46
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/cjs/index.css +4 -0
- package/cjs/index.js +14 -0
- package/cjs/index.js.map +1 -1
- package/es/components/Cell/Cell.css +3 -0
- package/es/components/Cell/Cell.js +66 -0
- package/es/components/Cell/Cell.js.map +1 -0
- package/es/components/Cell/Cell.styles.js +29 -0
- package/es/components/Cell/Cell.styles.js.map +1 -0
- package/es/components/Cell/Cell.tokens.js +45 -0
- package/es/components/Cell/Cell.tokens.js.map +1 -0
- package/es/components/Cell/Textbox/Textbox.js +16 -0
- package/es/components/Cell/Textbox/Textbox.js.map +1 -0
- package/es/components/Cell/Textbox/Textbox.styles.js +9 -0
- package/es/components/Cell/Textbox/Textbox.styles.js.map +1 -0
- package/es/components/Cell/Textbox/ui/TextLabel.js +13 -0
- package/es/components/Cell/Textbox/ui/TextLabel.js.map +1 -0
- package/es/components/Cell/Textbox/ui/TextSubtitle.js +13 -0
- package/es/components/Cell/Textbox/ui/TextSubtitle.js.map +1 -0
- package/es/components/Cell/Textbox/ui/TextTitle.js +13 -0
- package/es/components/Cell/Textbox/ui/TextTitle.js.map +1 -0
- package/es/components/Cell/variations/_size/base.js +5 -0
- package/es/components/Cell/variations/_size/base.js.map +1 -0
- package/es/components/Cell/variations/_size/base_x642ct.css +1 -0
- package/es/components/Cell/variations/_stretching/base.js +5 -0
- package/es/components/Cell/variations/_stretching/base.js.map +1 -0
- package/es/components/Cell/variations/_stretching/base_1ryz4br.css +1 -0
- package/es/components/Cell/variations/_view/base.js +5 -0
- package/es/components/Cell/variations/_view/base.js.map +1 -0
- package/es/components/Cell/variations/_view/base_13f5j4a.css +1 -0
- package/es/components/Dropdown/Dropdown.js +1 -2
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Popover/Popover.js +31 -46
- package/es/components/Popover/Popover.js.map +1 -1
- package/es/index.css +4 -0
- package/es/index.js +6 -0
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Cell/Cell.js +71 -0
- package/styled-components/cjs/components/Cell/Cell.styles.js +32 -0
- package/styled-components/cjs/components/Cell/Cell.tokens.js +48 -0
- package/styled-components/cjs/components/Cell/Cell.types.js +5 -0
- package/styled-components/cjs/components/Cell/Textbox/Textbox.js +19 -0
- package/styled-components/cjs/components/Cell/Textbox/Textbox.styles.js +12 -0
- package/styled-components/cjs/components/Cell/Textbox/Textbox.types.js +5 -0
- package/styled-components/cjs/components/Cell/Textbox/ui/TextLabel.js +16 -0
- package/styled-components/cjs/components/Cell/Textbox/ui/TextSubtitle.js +16 -0
- package/styled-components/cjs/components/Cell/Textbox/ui/TextTitle.js +16 -0
- package/styled-components/cjs/components/Cell/index.js +59 -0
- package/styled-components/cjs/components/Cell/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Cell/variations/_size/tokens.json +1 -0
- package/styled-components/cjs/components/Cell/variations/_stretching/base.js +9 -0
- package/styled-components/cjs/components/Cell/variations/_stretching/tokens.json +1 -0
- package/styled-components/cjs/components/Cell/variations/_view/base.js +9 -0
- package/styled-components/cjs/components/Cell/variations/_view/tokens.json +1 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.js +1 -2
- package/styled-components/cjs/components/Popover/Popover.js +31 -46
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.config.js +31 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.js +35 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.stories.tsx +131 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Popover/Popover.stories.tsx +0 -7
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.config.js +31 -0
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.js +35 -0
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.stories.tsx +131 -0
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Cell/Cell.js +62 -0
- package/styled-components/es/components/Cell/Cell.styles.js +25 -0
- package/styled-components/es/components/Cell/Cell.tokens.js +42 -0
- package/styled-components/es/components/Cell/Cell.types.js +1 -0
- package/styled-components/es/components/Cell/Textbox/Textbox.js +12 -0
- package/styled-components/es/components/Cell/Textbox/Textbox.styles.js +5 -0
- package/styled-components/es/components/Cell/Textbox/Textbox.types.js +1 -0
- package/styled-components/es/components/Cell/Textbox/ui/TextLabel.js +9 -0
- package/styled-components/es/components/Cell/Textbox/ui/TextSubtitle.js +9 -0
- package/styled-components/es/components/Cell/Textbox/ui/TextTitle.js +9 -0
- package/styled-components/es/components/Cell/index.js +6 -0
- package/styled-components/es/components/Cell/variations/_size/base.js +2 -0
- package/styled-components/es/components/Cell/variations/_size/tokens.json +1 -0
- package/styled-components/es/components/Cell/variations/_stretching/base.js +3 -0
- package/styled-components/es/components/Cell/variations/_stretching/tokens.json +1 -0
- package/styled-components/es/components/Cell/variations/_view/base.js +3 -0
- package/styled-components/es/components/Cell/variations/_view/tokens.json +1 -0
- package/styled-components/es/components/Dropdown/Dropdown.js +1 -2
- package/styled-components/es/components/Popover/Popover.js +31 -46
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.config.js +25 -0
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.js +6 -0
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.stories.tsx +131 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Popover/Popover.stories.tsx +0 -7
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.config.js +25 -0
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.js +6 -0
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.stories.tsx +131 -0
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/es/index.js +1 -0
- package/types/components/Cell/Cell.d.ts +27 -0
- package/types/components/Cell/Cell.d.ts.map +1 -0
- package/types/components/Cell/Cell.styles.d.ts +10 -0
- package/types/components/Cell/Cell.styles.d.ts.map +1 -0
- package/types/components/Cell/Cell.tokens.d.ts +43 -0
- package/types/components/Cell/Cell.tokens.d.ts.map +1 -0
- package/types/components/Cell/Cell.types.d.ts +45 -0
- package/types/components/Cell/Cell.types.d.ts.map +1 -0
- package/types/components/Cell/Textbox/Textbox.d.ts +4 -0
- package/types/components/Cell/Textbox/Textbox.d.ts.map +1 -0
- package/types/components/Cell/Textbox/Textbox.styles.d.ts +2 -0
- package/types/components/Cell/Textbox/Textbox.styles.d.ts.map +1 -0
- package/types/components/Cell/Textbox/Textbox.types.d.ts +35 -0
- package/types/components/Cell/Textbox/Textbox.types.d.ts.map +1 -0
- package/types/components/Cell/Textbox/ui/TextLabel.d.ts +5 -0
- package/types/components/Cell/Textbox/ui/TextLabel.d.ts.map +1 -0
- package/types/components/Cell/Textbox/ui/TextSubtitle.d.ts +5 -0
- package/types/components/Cell/Textbox/ui/TextSubtitle.d.ts.map +1 -0
- package/types/components/Cell/Textbox/ui/TextTitle.d.ts +5 -0
- package/types/components/Cell/Textbox/ui/TextTitle.d.ts.map +1 -0
- package/types/components/Cell/index.d.ts +9 -0
- package/types/components/Cell/index.d.ts.map +1 -0
- package/types/components/Cell/variations/_size/base.d.ts +2 -0
- package/types/components/Cell/variations/_size/base.d.ts.map +1 -0
- package/types/components/Cell/variations/_stretching/base.d.ts +2 -0
- package/types/components/Cell/variations/_stretching/base.d.ts.map +1 -0
- package/types/components/Cell/variations/_view/base.d.ts +2 -0
- package/types/components/Cell/variations/_view/base.d.ts.map +1 -0
- package/types/components/Combobox/Combobox.styles.d.ts +2 -8
- package/types/components/Combobox/Combobox.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts +1 -7
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/types/components/Popover/Popover.d.ts +2 -2
- package/types/components/Popover/Popover.d.ts.map +1 -1
- package/types/components/Popover/Popover.types.d.ts +14 -19
- package/types/components/Popover/Popover.types.d.ts.map +1 -1
- package/types/components/Select/Select.styles.d.ts +2 -8
- package/types/components/Select/Select.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Cell/Cell.config.d.ts +24 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts +48 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Popover/Popover.d.ts +1 -7
- package/types/examples/plasma_b2c/components/Popover/Popover.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Cell/Cell.config.d.ts +24 -0
- package/types/examples/plasma_web/components/Cell/Cell.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Cell/Cell.d.ts +48 -0
- package/types/examples/plasma_web/components/Cell/Cell.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +2 -2
- package/types/examples/plasma_web/components/Popover/Popover.d.ts +1 -7
- package/types/examples/plasma_web/components/Popover/Popover.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Popover/Popover.d.ts +1 -7
- package/types/examples/sds_engineer/components/Popover/Popover.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
["--plasma-cell-color", "--plasma-cell-background-color"]
|
@@ -71,7 +71,6 @@ var dropdownRoot = exports.dropdownRoot = function dropdownRoot(Root) {
|
|
71
71
|
placement: (0, _utils.getPlacements)(placement),
|
72
72
|
trigger: trigger,
|
73
73
|
closeOnOverlayClick: closeOnOverlayClick,
|
74
|
-
closeOnBeyondTargetHover: false,
|
75
74
|
closeOnEsc: closeOnEsc,
|
76
75
|
isFocusTrapped: isFocusTrapped,
|
77
76
|
frame: frame
|
@@ -96,7 +95,7 @@ var dropdownConfig = exports.dropdownConfig = {
|
|
96
95
|
}
|
97
96
|
},
|
98
97
|
defaults: {
|
99
|
-
view: '
|
98
|
+
view: 'primary',
|
100
99
|
size: 'm'
|
101
100
|
}
|
102
101
|
};
|
@@ -13,7 +13,7 @@ var _utils = /*#__PURE__*/require("../../utils");
|
|
13
13
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
14
14
|
var _Popover = /*#__PURE__*/require("./Popover.styles");
|
15
15
|
var _Popover2 = /*#__PURE__*/require("./Popover.tokens");
|
16
|
-
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle"];
|
16
|
+
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnOverlayClick", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle"];
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
18
18
|
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); }
|
19
19
|
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 && Object.prototype.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; }
|
@@ -39,41 +39,33 @@ var POPOVER_PORTAL_ID = exports.POPOVER_PORTAL_ID = 'plasma-popover-root';
|
|
39
39
|
* и вызова по клику либо ховеру.
|
40
40
|
*/
|
41
41
|
var popoverRoot = exports.popoverRoot = function popoverRoot(Root) {
|
42
|
-
return /*#__PURE__*/(0, _react.forwardRef)(function (
|
43
|
-
var
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
closeOnEsc =
|
62
|
-
|
63
|
-
preventOverflow =
|
64
|
-
|
65
|
-
usePortal =
|
66
|
-
view =
|
67
|
-
onToggle =
|
68
|
-
rest = _objectWithoutProperties(
|
69
|
-
var closeOnOverlayClick = true;
|
70
|
-
var closeOnBeyondTargetHover = true;
|
71
|
-
if (props.trigger === 'click' && props.closeOnOverlayClick === false) {
|
72
|
-
closeOnOverlayClick = false;
|
73
|
-
}
|
74
|
-
if (props.trigger === 'hover' && props.closeOnBeyondTargetHover === false) {
|
75
|
-
closeOnBeyondTargetHover = false;
|
76
|
-
}
|
42
|
+
return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, outerRootRef) {
|
43
|
+
var target = _ref.target,
|
44
|
+
children = _ref.children,
|
45
|
+
isOpen = _ref.isOpen,
|
46
|
+
trigger = _ref.trigger,
|
47
|
+
hasArrow = _ref.hasArrow,
|
48
|
+
_ref$frame = _ref.frame,
|
49
|
+
frame = _ref$frame === void 0 ? 'document' : _ref$frame,
|
50
|
+
className = _ref.className,
|
51
|
+
_ref$placement = _ref.placement,
|
52
|
+
placement = _ref$placement === void 0 ? 'auto' : _ref$placement,
|
53
|
+
_ref$offset = _ref.offset,
|
54
|
+
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
55
|
+
zIndex = _ref.zIndex,
|
56
|
+
_ref$isFocusTrapped = _ref.isFocusTrapped,
|
57
|
+
isFocusTrapped = _ref$isFocusTrapped === void 0 ? true : _ref$isFocusTrapped,
|
58
|
+
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
59
|
+
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
60
|
+
_ref$closeOnEsc = _ref.closeOnEsc,
|
61
|
+
closeOnEsc = _ref$closeOnEsc === void 0 ? true : _ref$closeOnEsc,
|
62
|
+
_ref$preventOverflow = _ref.preventOverflow,
|
63
|
+
preventOverflow = _ref$preventOverflow === void 0 ? true : _ref$preventOverflow,
|
64
|
+
_ref$usePortal = _ref.usePortal,
|
65
|
+
usePortal = _ref$usePortal === void 0 ? false : _ref$usePortal,
|
66
|
+
view = _ref.view,
|
67
|
+
onToggle = _ref.onToggle,
|
68
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
77
69
|
var rootRef = (0, _react.useRef)(null);
|
78
70
|
var popoverRef = (0, _react.useRef)(null);
|
79
71
|
var handleRef = (0, _plasmaCore.useForkRef)(rootRef, outerRootRef);
|
@@ -94,9 +86,7 @@ var popoverRoot = exports.popoverRoot = function popoverRoot(Root) {
|
|
94
86
|
opacity: isOpen ? 1 : 0
|
95
87
|
};
|
96
88
|
var _usePopper = (0, _reactPopper.usePopper)(rootRef.current, popoverRef.current, {
|
97
|
-
|
98
|
-
// eslint-disable-next-line no-nested-ternary
|
99
|
-
placement: isAutoArray ? (_placement$ = placement[0]) !== null && _placement$ !== void 0 && _placement$.endsWith('start') ? 'auto-start' : 'auto' : placement,
|
89
|
+
placement: isAutoArray ? 'auto' : placement,
|
100
90
|
modifiers: [{
|
101
91
|
name: 'preventOverflow',
|
102
92
|
options: {
|
@@ -232,15 +222,10 @@ var popoverRoot = exports.popoverRoot = function popoverRoot(Root) {
|
|
232
222
|
}, target), children && portalRef.current && /*#__PURE__*/_reactDom["default"].createPortal( /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
233
223
|
view: view,
|
234
224
|
className: className
|
235
|
-
}, rest, {
|
236
|
-
onMouseEnter: closeOnBeyondTargetHover ? undefined : onMouseEnter,
|
237
|
-
onMouseLeave: closeOnBeyondTargetHover ? undefined : onMouseEnter
|
238
|
-
}), /*#__PURE__*/_react["default"].createElement(_Popover.StyledPopover, _extends({}, attributes.popper, {
|
225
|
+
}, rest), /*#__PURE__*/_react["default"].createElement(_Popover.StyledPopover, _extends({}, attributes.popper, {
|
239
226
|
className: _Popover2.classes.root,
|
240
227
|
ref: popoverForkRef,
|
241
|
-
style: _objectSpread(_objectSpread(
|
242
|
-
display: isOpen ? 'block' : 'none'
|
243
|
-
}), initialStyles),
|
228
|
+
style: _objectSpread(_objectSpread({}, styles.popper), initialStyles),
|
244
229
|
zIndex: zIndex
|
245
230
|
}), hasArrow && /*#__PURE__*/_react["default"].createElement(_Popover.StyledArrow, _extends({
|
246
231
|
className: _Popover2.classes.arrow,
|
@@ -0,0 +1,31 @@
|
|
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 _Cell = /*#__PURE__*/require("../../../../components/Cell");
|
9
|
+
var config = exports.config = {
|
10
|
+
defaults: {
|
11
|
+
view: 'default',
|
12
|
+
size: 'm',
|
13
|
+
stretching: 'filled'
|
14
|
+
},
|
15
|
+
variations: {
|
16
|
+
view: {
|
17
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-secondary);", ":transparent;"], _Cell.cellTokens.cellColor, _Cell.cellTokens.cellLabelColor, _Cell.cellTokens.cellTitleColor, _Cell.cellTokens.cellSubtitleColor, _Cell.cellTokens.cellBackgroundColor)
|
18
|
+
},
|
19
|
+
size: {
|
20
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
21
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
22
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
23
|
+
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.25rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight)
|
24
|
+
},
|
25
|
+
stretching: {
|
26
|
+
auto: /*#__PURE__*/(0, _styledComponents.css)([""]),
|
27
|
+
filled: /*#__PURE__*/(0, _styledComponents.css)([""]),
|
28
|
+
fixed: /*#__PURE__*/(0, _styledComponents.css)([""])
|
29
|
+
}
|
30
|
+
}
|
31
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Cell = void 0;
|
7
|
+
Object.defineProperty(exports, "TextLabel", {
|
8
|
+
enumerable: true,
|
9
|
+
get: function get() {
|
10
|
+
return _Cell.TextLabel;
|
11
|
+
}
|
12
|
+
});
|
13
|
+
Object.defineProperty(exports, "TextSubtitle", {
|
14
|
+
enumerable: true,
|
15
|
+
get: function get() {
|
16
|
+
return _Cell.TextSubtitle;
|
17
|
+
}
|
18
|
+
});
|
19
|
+
Object.defineProperty(exports, "TextTitle", {
|
20
|
+
enumerable: true,
|
21
|
+
get: function get() {
|
22
|
+
return _Cell.TextTitle;
|
23
|
+
}
|
24
|
+
});
|
25
|
+
Object.defineProperty(exports, "Textbox", {
|
26
|
+
enumerable: true,
|
27
|
+
get: function get() {
|
28
|
+
return _Cell.Textbox;
|
29
|
+
}
|
30
|
+
});
|
31
|
+
var _Cell = /*#__PURE__*/require("../../../../components/Cell");
|
32
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
33
|
+
var _Cell2 = /*#__PURE__*/require("./Cell.config");
|
34
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Cell.cellConfig, _Cell2.config);
|
35
|
+
var Cell = exports.Cell = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
@@ -0,0 +1,131 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { ComponentProps } from 'react';
|
3
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
4
|
+
import styled from 'styled-components';
|
5
|
+
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
import { Avatar } from '../Avatar/Avatar';
|
8
|
+
import { IconChevronLeft } from '../../../../components/_Icon';
|
9
|
+
|
10
|
+
import { Cell, Textbox, TextTitle } from './Cell';
|
11
|
+
|
12
|
+
type StoryProps = ComponentProps<typeof Cell> & {
|
13
|
+
itemsCount?: number;
|
14
|
+
enableLeftContent?: boolean;
|
15
|
+
enableRightContent?: boolean;
|
16
|
+
};
|
17
|
+
type Story = StoryObj<StoryProps>;
|
18
|
+
|
19
|
+
const sizes = ['l', 'm', 's', 'xs'];
|
20
|
+
const stretchingValues = ['fixed', 'filled', 'auto'];
|
21
|
+
const alignLeft = ['top', 'center', 'bottom'];
|
22
|
+
const alignRight = ['top', 'center', 'bottom'];
|
23
|
+
|
24
|
+
type SizesCell = 'xs' | 'l' | 'm' | 's' | undefined;
|
25
|
+
type SizesAvatar = 'l' | 'm' | 's';
|
26
|
+
|
27
|
+
const getSize = (size: SizesCell): SizesAvatar => {
|
28
|
+
if (size === 'xs' || !size) {
|
29
|
+
return 's';
|
30
|
+
}
|
31
|
+
|
32
|
+
return size;
|
33
|
+
};
|
34
|
+
|
35
|
+
const meta: Meta<typeof Cell> = {
|
36
|
+
title: 'plasma_b2c/Cell',
|
37
|
+
decorators: [WithTheme],
|
38
|
+
argTypes: {
|
39
|
+
size: {
|
40
|
+
options: sizes,
|
41
|
+
control: {
|
42
|
+
type: 'select',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
stretching: {
|
46
|
+
options: stretchingValues,
|
47
|
+
control: {
|
48
|
+
type: 'select',
|
49
|
+
},
|
50
|
+
},
|
51
|
+
alignLeft: {
|
52
|
+
options: alignLeft,
|
53
|
+
control: {
|
54
|
+
type: 'select',
|
55
|
+
},
|
56
|
+
},
|
57
|
+
alignRight: {
|
58
|
+
options: alignRight,
|
59
|
+
control: {
|
60
|
+
type: 'select',
|
61
|
+
},
|
62
|
+
},
|
63
|
+
},
|
64
|
+
};
|
65
|
+
|
66
|
+
export default meta;
|
67
|
+
|
68
|
+
const ChevronRight = styled(IconChevronLeft)`
|
69
|
+
transform: rotate(180deg);
|
70
|
+
color: var(--text-secondary);
|
71
|
+
`;
|
72
|
+
|
73
|
+
export const Default: Story = {
|
74
|
+
args: {
|
75
|
+
size: 'm',
|
76
|
+
stretching: 'filled',
|
77
|
+
enableLeftContent: false,
|
78
|
+
enableRightContent: false,
|
79
|
+
alignLeft: 'center',
|
80
|
+
alignRight: 'center',
|
81
|
+
title: 'Title',
|
82
|
+
subtitle: 'Subtitle',
|
83
|
+
label: 'Label',
|
84
|
+
},
|
85
|
+
render: ({ ...args }: StoryProps) => {
|
86
|
+
return (
|
87
|
+
<Cell
|
88
|
+
contentLeft={
|
89
|
+
!args.enableLeftContent && (
|
90
|
+
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
91
|
+
)
|
92
|
+
}
|
93
|
+
alignLeft={args.alignLeft}
|
94
|
+
contentRight={!args.enableRightContent && <ChevronRight color="inherit" size="xs" />}
|
95
|
+
alignRight={args.alignRight}
|
96
|
+
title={args.title}
|
97
|
+
subtitle={args.subtitle}
|
98
|
+
label={args.label}
|
99
|
+
{...args}
|
100
|
+
/>
|
101
|
+
);
|
102
|
+
},
|
103
|
+
};
|
104
|
+
|
105
|
+
export const WithContentTextboxCustom: Story = {
|
106
|
+
args: {
|
107
|
+
size: 'm',
|
108
|
+
stretching: 'filled',
|
109
|
+
},
|
110
|
+
render: ({ ...args }: StoryProps) => {
|
111
|
+
const MyStyledText = styled.div`
|
112
|
+
font-size: 12px;
|
113
|
+
font-weight: 600;
|
114
|
+
opacity: 0.5;
|
115
|
+
`;
|
116
|
+
return (
|
117
|
+
<Cell
|
118
|
+
contentLeft={
|
119
|
+
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
120
|
+
}
|
121
|
+
contentRight={<ChevronRight color="inherit" size="xs" />}
|
122
|
+
{...args}
|
123
|
+
>
|
124
|
+
<Textbox>
|
125
|
+
<TextTitle>Title</TextTitle>
|
126
|
+
<MyStyledText>My styled Text</MyStyledText>
|
127
|
+
</Textbox>
|
128
|
+
</Cell>
|
129
|
+
);
|
130
|
+
},
|
131
|
+
};
|
@@ -33,12 +33,6 @@ const meta: Meta<typeof Popover> = {
|
|
33
33
|
},
|
34
34
|
table: { defaultValue: { summary: true } },
|
35
35
|
},
|
36
|
-
closeOnBeyondTargetHover: {
|
37
|
-
control: {
|
38
|
-
type: 'boolean',
|
39
|
-
},
|
40
|
-
table: { defaultValue: { summary: true } },
|
41
|
-
},
|
42
36
|
closeOnEsc: {
|
43
37
|
control: {
|
44
38
|
type: 'boolean',
|
@@ -68,7 +62,6 @@ const meta: Meta<typeof Popover> = {
|
|
68
62
|
placement: 'bottom',
|
69
63
|
trigger: 'click',
|
70
64
|
closeOnOverlayClick: true,
|
71
|
-
closeOnBeyondTargetHover: true,
|
72
65
|
closeOnEsc: true,
|
73
66
|
isFocusTrapped: true,
|
74
67
|
skidding: 0,
|
@@ -0,0 +1,31 @@
|
|
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 _Cell = /*#__PURE__*/require("../../../../components/Cell");
|
9
|
+
var config = exports.config = {
|
10
|
+
defaults: {
|
11
|
+
view: 'default',
|
12
|
+
size: 'm',
|
13
|
+
stretching: 'filled'
|
14
|
+
},
|
15
|
+
variations: {
|
16
|
+
view: {
|
17
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-secondary);", ":transparent;"], _Cell.cellTokens.cellColor, _Cell.cellTokens.cellLabelColor, _Cell.cellTokens.cellTitleColor, _Cell.cellTokens.cellSubtitleColor, _Cell.cellTokens.cellBackgroundColor)
|
18
|
+
},
|
19
|
+
size: {
|
20
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
21
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
22
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
23
|
+
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.25rem;", ":0.375rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight)
|
24
|
+
},
|
25
|
+
stretching: {
|
26
|
+
auto: /*#__PURE__*/(0, _styledComponents.css)([""]),
|
27
|
+
filled: /*#__PURE__*/(0, _styledComponents.css)([""]),
|
28
|
+
fixed: /*#__PURE__*/(0, _styledComponents.css)([""])
|
29
|
+
}
|
30
|
+
}
|
31
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Cell = void 0;
|
7
|
+
Object.defineProperty(exports, "TextLabel", {
|
8
|
+
enumerable: true,
|
9
|
+
get: function get() {
|
10
|
+
return _Cell.TextLabel;
|
11
|
+
}
|
12
|
+
});
|
13
|
+
Object.defineProperty(exports, "TextSubtitle", {
|
14
|
+
enumerable: true,
|
15
|
+
get: function get() {
|
16
|
+
return _Cell.TextSubtitle;
|
17
|
+
}
|
18
|
+
});
|
19
|
+
Object.defineProperty(exports, "TextTitle", {
|
20
|
+
enumerable: true,
|
21
|
+
get: function get() {
|
22
|
+
return _Cell.TextTitle;
|
23
|
+
}
|
24
|
+
});
|
25
|
+
Object.defineProperty(exports, "Textbox", {
|
26
|
+
enumerable: true,
|
27
|
+
get: function get() {
|
28
|
+
return _Cell.Textbox;
|
29
|
+
}
|
30
|
+
});
|
31
|
+
var _Cell = /*#__PURE__*/require("../../../../components/Cell");
|
32
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
33
|
+
var _Cell2 = /*#__PURE__*/require("./Cell.config");
|
34
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Cell.cellConfig, _Cell2.config);
|
35
|
+
var Cell = exports.Cell = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
@@ -0,0 +1,131 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { ComponentProps } from 'react';
|
3
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
4
|
+
import styled from 'styled-components';
|
5
|
+
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
import { Avatar } from '../Avatar/Avatar';
|
8
|
+
import { IconChevronLeft } from '../../../../components/_Icon';
|
9
|
+
|
10
|
+
import { Cell, Textbox, TextTitle } from './Cell';
|
11
|
+
|
12
|
+
type StoryProps = ComponentProps<typeof Cell> & {
|
13
|
+
itemsCount?: number;
|
14
|
+
enableLeftContent?: boolean;
|
15
|
+
enableRightContent?: boolean;
|
16
|
+
};
|
17
|
+
type Story = StoryObj<StoryProps>;
|
18
|
+
|
19
|
+
const sizes = ['l', 'm', 's', 'xs'];
|
20
|
+
const stretchingValues = ['fixed', 'filled', 'auto'];
|
21
|
+
const alignLeft = ['top', 'center', 'bottom'];
|
22
|
+
const alignRight = ['top', 'center', 'bottom'];
|
23
|
+
|
24
|
+
type SizesCell = 'xs' | 'l' | 'm' | 's' | undefined;
|
25
|
+
type SizesAvatar = 'l' | 'm' | 's';
|
26
|
+
|
27
|
+
const getSize = (size: SizesCell): SizesAvatar => {
|
28
|
+
if (size === 'xs' || !size) {
|
29
|
+
return 's';
|
30
|
+
}
|
31
|
+
|
32
|
+
return size;
|
33
|
+
};
|
34
|
+
|
35
|
+
const meta: Meta<typeof Cell> = {
|
36
|
+
title: 'plasma_web/Cell',
|
37
|
+
decorators: [WithTheme],
|
38
|
+
argTypes: {
|
39
|
+
size: {
|
40
|
+
options: sizes,
|
41
|
+
control: {
|
42
|
+
type: 'select',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
stretching: {
|
46
|
+
options: stretchingValues,
|
47
|
+
control: {
|
48
|
+
type: 'select',
|
49
|
+
},
|
50
|
+
},
|
51
|
+
alignLeft: {
|
52
|
+
options: alignLeft,
|
53
|
+
control: {
|
54
|
+
type: 'select',
|
55
|
+
},
|
56
|
+
},
|
57
|
+
alignRight: {
|
58
|
+
options: alignRight,
|
59
|
+
control: {
|
60
|
+
type: 'select',
|
61
|
+
},
|
62
|
+
},
|
63
|
+
},
|
64
|
+
};
|
65
|
+
|
66
|
+
export default meta;
|
67
|
+
|
68
|
+
const ChevronRight = styled(IconChevronLeft)`
|
69
|
+
transform: rotate(180deg);
|
70
|
+
color: var(--text-secondary);
|
71
|
+
`;
|
72
|
+
|
73
|
+
export const Default: Story = {
|
74
|
+
args: {
|
75
|
+
size: 'm',
|
76
|
+
stretching: 'filled',
|
77
|
+
enableLeftContent: false,
|
78
|
+
enableRightContent: false,
|
79
|
+
alignLeft: 'center',
|
80
|
+
alignRight: 'center',
|
81
|
+
title: 'Title',
|
82
|
+
subtitle: 'Subtitle',
|
83
|
+
label: 'Label',
|
84
|
+
},
|
85
|
+
render: ({ ...args }: StoryProps) => {
|
86
|
+
return (
|
87
|
+
<Cell
|
88
|
+
contentLeft={
|
89
|
+
!args.enableLeftContent && (
|
90
|
+
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
91
|
+
)
|
92
|
+
}
|
93
|
+
alignLeft={args.alignLeft}
|
94
|
+
contentRight={!args.enableRightContent && <ChevronRight color="inherit" size="xs" />}
|
95
|
+
alignRight={args.alignRight}
|
96
|
+
title={args.title}
|
97
|
+
subtitle={args.subtitle}
|
98
|
+
label={args.label}
|
99
|
+
{...args}
|
100
|
+
/>
|
101
|
+
);
|
102
|
+
},
|
103
|
+
};
|
104
|
+
|
105
|
+
export const WithContentTextboxCustom: Story = {
|
106
|
+
args: {
|
107
|
+
size: 'm',
|
108
|
+
stretching: 'filled',
|
109
|
+
},
|
110
|
+
render: ({ ...args }: StoryProps) => {
|
111
|
+
const MyStyledText = styled.div`
|
112
|
+
font-size: 12px;
|
113
|
+
font-weight: 600;
|
114
|
+
opacity: 0.5;
|
115
|
+
`;
|
116
|
+
return (
|
117
|
+
<Cell
|
118
|
+
contentLeft={
|
119
|
+
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
120
|
+
}
|
121
|
+
contentRight={<ChevronRight color="inherit" size="xs" />}
|
122
|
+
{...args}
|
123
|
+
>
|
124
|
+
<Textbox>
|
125
|
+
<TextTitle>Title</TextTitle>
|
126
|
+
<MyStyledText>My styled Text</MyStyledText>
|
127
|
+
</Textbox>
|
128
|
+
</Cell>
|
129
|
+
);
|
130
|
+
},
|
131
|
+
};
|
@@ -69,6 +69,17 @@ Object.keys(_Chip).forEach(function (key) {
|
|
69
69
|
}
|
70
70
|
});
|
71
71
|
});
|
72
|
+
var _Cell = /*#__PURE__*/require("./components/Cell");
|
73
|
+
Object.keys(_Cell).forEach(function (key) {
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
75
|
+
if (key in exports && exports[key] === _Cell[key]) return;
|
76
|
+
Object.defineProperty(exports, key, {
|
77
|
+
enumerable: true,
|
78
|
+
get: function get() {
|
79
|
+
return _Cell[key];
|
80
|
+
}
|
81
|
+
});
|
82
|
+
});
|
72
83
|
var _Link = /*#__PURE__*/require("./components/Link");
|
73
84
|
Object.keys(_Link).forEach(function (key) {
|
74
85
|
if (key === "default" || key === "__esModule") return;
|