@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.
Files changed (186) hide show
  1. package/cjs/components/Cell/Cell.css +3 -0
  2. package/cjs/components/Cell/Cell.js +71 -0
  3. package/cjs/components/Cell/Cell.js.map +1 -0
  4. package/cjs/components/Cell/Cell.styles.js +36 -0
  5. package/cjs/components/Cell/Cell.styles.js.map +1 -0
  6. package/cjs/components/Cell/Cell.tokens.js +50 -0
  7. package/cjs/components/Cell/Cell.tokens.js.map +1 -0
  8. package/cjs/components/Cell/Textbox/Textbox.js +20 -0
  9. package/cjs/components/Cell/Textbox/Textbox.js.map +1 -0
  10. package/cjs/components/Cell/Textbox/Textbox.styles.js +13 -0
  11. package/cjs/components/Cell/Textbox/Textbox.styles.js.map +1 -0
  12. package/cjs/components/Cell/Textbox/ui/TextLabel.js +17 -0
  13. package/cjs/components/Cell/Textbox/ui/TextLabel.js.map +1 -0
  14. package/cjs/components/Cell/Textbox/ui/TextSubtitle.js +17 -0
  15. package/cjs/components/Cell/Textbox/ui/TextSubtitle.js.map +1 -0
  16. package/cjs/components/Cell/Textbox/ui/TextTitle.js +17 -0
  17. package/cjs/components/Cell/Textbox/ui/TextTitle.js.map +1 -0
  18. package/cjs/components/Cell/variations/_size/base.js +9 -0
  19. package/cjs/components/Cell/variations/_size/base.js.map +1 -0
  20. package/cjs/components/Cell/variations/_size/base_x642ct.css +1 -0
  21. package/cjs/components/Cell/variations/_stretching/base.js +9 -0
  22. package/cjs/components/Cell/variations/_stretching/base.js.map +1 -0
  23. package/cjs/components/Cell/variations/_stretching/base_1ryz4br.css +1 -0
  24. package/cjs/components/Cell/variations/_view/base.js +9 -0
  25. package/cjs/components/Cell/variations/_view/base.js.map +1 -0
  26. package/cjs/components/Cell/variations/_view/base_13f5j4a.css +1 -0
  27. package/cjs/components/Dropdown/Dropdown.js +1 -2
  28. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  29. package/cjs/components/Popover/Popover.js +31 -46
  30. package/cjs/components/Popover/Popover.js.map +1 -1
  31. package/cjs/index.css +4 -0
  32. package/cjs/index.js +14 -0
  33. package/cjs/index.js.map +1 -1
  34. package/es/components/Cell/Cell.css +3 -0
  35. package/es/components/Cell/Cell.js +66 -0
  36. package/es/components/Cell/Cell.js.map +1 -0
  37. package/es/components/Cell/Cell.styles.js +29 -0
  38. package/es/components/Cell/Cell.styles.js.map +1 -0
  39. package/es/components/Cell/Cell.tokens.js +45 -0
  40. package/es/components/Cell/Cell.tokens.js.map +1 -0
  41. package/es/components/Cell/Textbox/Textbox.js +16 -0
  42. package/es/components/Cell/Textbox/Textbox.js.map +1 -0
  43. package/es/components/Cell/Textbox/Textbox.styles.js +9 -0
  44. package/es/components/Cell/Textbox/Textbox.styles.js.map +1 -0
  45. package/es/components/Cell/Textbox/ui/TextLabel.js +13 -0
  46. package/es/components/Cell/Textbox/ui/TextLabel.js.map +1 -0
  47. package/es/components/Cell/Textbox/ui/TextSubtitle.js +13 -0
  48. package/es/components/Cell/Textbox/ui/TextSubtitle.js.map +1 -0
  49. package/es/components/Cell/Textbox/ui/TextTitle.js +13 -0
  50. package/es/components/Cell/Textbox/ui/TextTitle.js.map +1 -0
  51. package/es/components/Cell/variations/_size/base.js +5 -0
  52. package/es/components/Cell/variations/_size/base.js.map +1 -0
  53. package/es/components/Cell/variations/_size/base_x642ct.css +1 -0
  54. package/es/components/Cell/variations/_stretching/base.js +5 -0
  55. package/es/components/Cell/variations/_stretching/base.js.map +1 -0
  56. package/es/components/Cell/variations/_stretching/base_1ryz4br.css +1 -0
  57. package/es/components/Cell/variations/_view/base.js +5 -0
  58. package/es/components/Cell/variations/_view/base.js.map +1 -0
  59. package/es/components/Cell/variations/_view/base_13f5j4a.css +1 -0
  60. package/es/components/Dropdown/Dropdown.js +1 -2
  61. package/es/components/Dropdown/Dropdown.js.map +1 -1
  62. package/es/components/Popover/Popover.js +31 -46
  63. package/es/components/Popover/Popover.js.map +1 -1
  64. package/es/index.css +4 -0
  65. package/es/index.js +6 -0
  66. package/es/index.js.map +1 -1
  67. package/package.json +2 -2
  68. package/styled-components/cjs/components/Cell/Cell.js +71 -0
  69. package/styled-components/cjs/components/Cell/Cell.styles.js +32 -0
  70. package/styled-components/cjs/components/Cell/Cell.tokens.js +48 -0
  71. package/styled-components/cjs/components/Cell/Cell.types.js +5 -0
  72. package/styled-components/cjs/components/Cell/Textbox/Textbox.js +19 -0
  73. package/styled-components/cjs/components/Cell/Textbox/Textbox.styles.js +12 -0
  74. package/styled-components/cjs/components/Cell/Textbox/Textbox.types.js +5 -0
  75. package/styled-components/cjs/components/Cell/Textbox/ui/TextLabel.js +16 -0
  76. package/styled-components/cjs/components/Cell/Textbox/ui/TextSubtitle.js +16 -0
  77. package/styled-components/cjs/components/Cell/Textbox/ui/TextTitle.js +16 -0
  78. package/styled-components/cjs/components/Cell/index.js +59 -0
  79. package/styled-components/cjs/components/Cell/variations/_size/base.js +8 -0
  80. package/styled-components/cjs/components/Cell/variations/_size/tokens.json +1 -0
  81. package/styled-components/cjs/components/Cell/variations/_stretching/base.js +9 -0
  82. package/styled-components/cjs/components/Cell/variations/_stretching/tokens.json +1 -0
  83. package/styled-components/cjs/components/Cell/variations/_view/base.js +9 -0
  84. package/styled-components/cjs/components/Cell/variations/_view/tokens.json +1 -0
  85. package/styled-components/cjs/components/Dropdown/Dropdown.js +1 -2
  86. package/styled-components/cjs/components/Popover/Popover.js +31 -46
  87. package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.config.js +31 -0
  88. package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.js +35 -0
  89. package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.stories.tsx +131 -0
  90. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
  91. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
  92. package/styled-components/cjs/examples/plasma_b2c/components/Popover/Popover.stories.tsx +0 -7
  93. package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.config.js +31 -0
  94. package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.js +35 -0
  95. package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.stories.tsx +131 -0
  96. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
  97. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
  98. package/styled-components/cjs/index.js +11 -0
  99. package/styled-components/es/components/Cell/Cell.js +62 -0
  100. package/styled-components/es/components/Cell/Cell.styles.js +25 -0
  101. package/styled-components/es/components/Cell/Cell.tokens.js +42 -0
  102. package/styled-components/es/components/Cell/Cell.types.js +1 -0
  103. package/styled-components/es/components/Cell/Textbox/Textbox.js +12 -0
  104. package/styled-components/es/components/Cell/Textbox/Textbox.styles.js +5 -0
  105. package/styled-components/es/components/Cell/Textbox/Textbox.types.js +1 -0
  106. package/styled-components/es/components/Cell/Textbox/ui/TextLabel.js +9 -0
  107. package/styled-components/es/components/Cell/Textbox/ui/TextSubtitle.js +9 -0
  108. package/styled-components/es/components/Cell/Textbox/ui/TextTitle.js +9 -0
  109. package/styled-components/es/components/Cell/index.js +6 -0
  110. package/styled-components/es/components/Cell/variations/_size/base.js +2 -0
  111. package/styled-components/es/components/Cell/variations/_size/tokens.json +1 -0
  112. package/styled-components/es/components/Cell/variations/_stretching/base.js +3 -0
  113. package/styled-components/es/components/Cell/variations/_stretching/tokens.json +1 -0
  114. package/styled-components/es/components/Cell/variations/_view/base.js +3 -0
  115. package/styled-components/es/components/Cell/variations/_view/tokens.json +1 -0
  116. package/styled-components/es/components/Dropdown/Dropdown.js +1 -2
  117. package/styled-components/es/components/Popover/Popover.js +31 -46
  118. package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.config.js +25 -0
  119. package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.js +6 -0
  120. package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.stories.tsx +131 -0
  121. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
  122. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
  123. package/styled-components/es/examples/plasma_b2c/components/Popover/Popover.stories.tsx +0 -7
  124. package/styled-components/es/examples/plasma_web/components/Cell/Cell.config.js +25 -0
  125. package/styled-components/es/examples/plasma_web/components/Cell/Cell.js +6 -0
  126. package/styled-components/es/examples/plasma_web/components/Cell/Cell.stories.tsx +131 -0
  127. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
  128. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
  129. package/styled-components/es/index.js +1 -0
  130. package/types/components/Cell/Cell.d.ts +27 -0
  131. package/types/components/Cell/Cell.d.ts.map +1 -0
  132. package/types/components/Cell/Cell.styles.d.ts +10 -0
  133. package/types/components/Cell/Cell.styles.d.ts.map +1 -0
  134. package/types/components/Cell/Cell.tokens.d.ts +43 -0
  135. package/types/components/Cell/Cell.tokens.d.ts.map +1 -0
  136. package/types/components/Cell/Cell.types.d.ts +45 -0
  137. package/types/components/Cell/Cell.types.d.ts.map +1 -0
  138. package/types/components/Cell/Textbox/Textbox.d.ts +4 -0
  139. package/types/components/Cell/Textbox/Textbox.d.ts.map +1 -0
  140. package/types/components/Cell/Textbox/Textbox.styles.d.ts +2 -0
  141. package/types/components/Cell/Textbox/Textbox.styles.d.ts.map +1 -0
  142. package/types/components/Cell/Textbox/Textbox.types.d.ts +35 -0
  143. package/types/components/Cell/Textbox/Textbox.types.d.ts.map +1 -0
  144. package/types/components/Cell/Textbox/ui/TextLabel.d.ts +5 -0
  145. package/types/components/Cell/Textbox/ui/TextLabel.d.ts.map +1 -0
  146. package/types/components/Cell/Textbox/ui/TextSubtitle.d.ts +5 -0
  147. package/types/components/Cell/Textbox/ui/TextSubtitle.d.ts.map +1 -0
  148. package/types/components/Cell/Textbox/ui/TextTitle.d.ts +5 -0
  149. package/types/components/Cell/Textbox/ui/TextTitle.d.ts.map +1 -0
  150. package/types/components/Cell/index.d.ts +9 -0
  151. package/types/components/Cell/index.d.ts.map +1 -0
  152. package/types/components/Cell/variations/_size/base.d.ts +2 -0
  153. package/types/components/Cell/variations/_size/base.d.ts.map +1 -0
  154. package/types/components/Cell/variations/_stretching/base.d.ts +2 -0
  155. package/types/components/Cell/variations/_stretching/base.d.ts.map +1 -0
  156. package/types/components/Cell/variations/_view/base.d.ts +2 -0
  157. package/types/components/Cell/variations/_view/base.d.ts.map +1 -0
  158. package/types/components/Combobox/Combobox.styles.d.ts +2 -8
  159. package/types/components/Combobox/Combobox.styles.d.ts.map +1 -1
  160. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  161. package/types/components/Dropdown/Dropdown.styles.d.ts +1 -7
  162. package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  163. package/types/components/Popover/Popover.d.ts +2 -2
  164. package/types/components/Popover/Popover.d.ts.map +1 -1
  165. package/types/components/Popover/Popover.types.d.ts +14 -19
  166. package/types/components/Popover/Popover.types.d.ts.map +1 -1
  167. package/types/components/Select/Select.styles.d.ts +2 -8
  168. package/types/components/Select/Select.styles.d.ts.map +1 -1
  169. package/types/examples/plasma_b2c/components/Cell/Cell.config.d.ts +24 -0
  170. package/types/examples/plasma_b2c/components/Cell/Cell.config.d.ts.map +1 -0
  171. package/types/examples/plasma_b2c/components/Cell/Cell.d.ts +48 -0
  172. package/types/examples/plasma_b2c/components/Cell/Cell.d.ts.map +1 -0
  173. package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +2 -2
  174. package/types/examples/plasma_b2c/components/Popover/Popover.d.ts +1 -7
  175. package/types/examples/plasma_b2c/components/Popover/Popover.d.ts.map +1 -1
  176. package/types/examples/plasma_web/components/Cell/Cell.config.d.ts +24 -0
  177. package/types/examples/plasma_web/components/Cell/Cell.config.d.ts.map +1 -0
  178. package/types/examples/plasma_web/components/Cell/Cell.d.ts +48 -0
  179. package/types/examples/plasma_web/components/Cell/Cell.d.ts.map +1 -0
  180. package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +2 -2
  181. package/types/examples/plasma_web/components/Popover/Popover.d.ts +1 -7
  182. package/types/examples/plasma_web/components/Popover/Popover.d.ts.map +1 -1
  183. package/types/examples/sds_engineer/components/Popover/Popover.d.ts +1 -7
  184. package/types/examples/sds_engineer/components/Popover/Popover.d.ts.map +1 -1
  185. package/types/index.d.ts +1 -0
  186. 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: 'default',
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 (props, outerRootRef) {
43
- var _placement$;
44
- var target = props.target,
45
- children = props.children,
46
- isOpen = props.isOpen,
47
- _props$trigger = props.trigger,
48
- trigger = _props$trigger === void 0 ? 'click' : _props$trigger,
49
- hasArrow = props.hasArrow,
50
- _props$frame = props.frame,
51
- frame = _props$frame === void 0 ? 'document' : _props$frame,
52
- className = props.className,
53
- _props$placement = props.placement,
54
- placement = _props$placement === void 0 ? 'auto' : _props$placement,
55
- _props$offset = props.offset,
56
- offset = _props$offset === void 0 ? [0, 0] : _props$offset,
57
- zIndex = props.zIndex,
58
- _props$isFocusTrapped = props.isFocusTrapped,
59
- isFocusTrapped = _props$isFocusTrapped === void 0 ? true : _props$isFocusTrapped,
60
- _props$closeOnEsc = props.closeOnEsc,
61
- closeOnEsc = _props$closeOnEsc === void 0 ? true : _props$closeOnEsc,
62
- _props$preventOverflo = props.preventOverflow,
63
- preventOverflow = _props$preventOverflo === void 0 ? true : _props$preventOverflo,
64
- _props$usePortal = props.usePortal,
65
- usePortal = _props$usePortal === void 0 ? false : _props$usePortal,
66
- view = props.view,
67
- onToggle = props.onToggle,
68
- rest = _objectWithoutProperties(props, _excluded);
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
- // TODO: #1121
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(_objectSpread({}, styles.popper), {
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
+ };
@@ -51,7 +51,7 @@ const meta: Meta<StoryDropdownProps> = {
51
51
  closeOnEsc: true,
52
52
  isFocusTrapped: true,
53
53
  skidding: 0,
54
- distance: 0,
54
+ distance: 6,
55
55
  },
56
56
  };
57
57
 
@@ -51,7 +51,7 @@ const meta: Meta<StoryDropdownProps> = {
51
51
  closeOnEsc: true,
52
52
  isFocusTrapped: true,
53
53
  skidding: 0,
54
- distance: 0,
54
+ distance: 6,
55
55
  },
56
56
  };
57
57
 
@@ -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
+ };
@@ -51,7 +51,7 @@ const meta: Meta<StoryDropdownProps> = {
51
51
  closeOnEsc: true,
52
52
  isFocusTrapped: true,
53
53
  skidding: 0,
54
- distance: 0,
54
+ distance: 6,
55
55
  },
56
56
  };
57
57
 
@@ -51,7 +51,7 @@ const meta: Meta<StoryDropdownProps> = {
51
51
  closeOnEsc: true,
52
52
  isFocusTrapped: true,
53
53
  skidding: 0,
54
- distance: 0,
54
+ distance: 6,
55
55
  },
56
56
  };
57
57
 
@@ -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;