@salutejs/plasma-new-hope 0.329.1-canary.2082.16264269696.0 → 0.329.1-canary.2088.16342669110.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/cjs/components/Drawer/Drawer.css +7 -5
  2. package/cjs/components/Drawer/Drawer.js +1 -1
  3. package/cjs/components/Drawer/Drawer.js.map +1 -1
  4. package/cjs/components/Modal/Modal.css +9 -6
  5. package/cjs/components/Modal/Modal.js +7 -3
  6. package/cjs/components/Modal/Modal.js.map +1 -1
  7. package/cjs/components/Modal/Modal.styles.js +6 -4
  8. package/cjs/components/Modal/Modal.styles.js.map +1 -1
  9. package/cjs/components/Modal/{Modal.styles_1gt0sfn.css → Modal.styles_1obtvtw.css} +4 -3
  10. package/cjs/components/Notification/NotificationsProvider.css +7 -3
  11. package/cjs/components/Popup/Popup.js +67 -3
  12. package/cjs/components/Popup/Popup.js.map +1 -1
  13. package/cjs/components/Popup/Popup.styles.js +31 -19
  14. package/cjs/components/Popup/Popup.styles.js.map +1 -1
  15. package/cjs/components/Popup/Popup.styles_kpf3dd.css +6 -0
  16. package/cjs/components/Popup/Popup.tokens.js +10 -1
  17. package/cjs/components/Popup/Popup.tokens.js.map +1 -1
  18. package/cjs/components/Popup/PopupContext.css +7 -3
  19. package/cjs/components/Popup/utils/getHandleStyles.js +40 -0
  20. package/cjs/components/Popup/utils/getHandleStyles.js.map +1 -0
  21. package/cjs/components/Popup/utils/getRatioBasedOnPlacement.js +38 -0
  22. package/cjs/components/Popup/utils/getRatioBasedOnPlacement.js.map +1 -0
  23. package/cjs/components/Popup/utils/getResizeDirections.js +73 -0
  24. package/cjs/components/Popup/utils/getResizeDirections.js.map +1 -0
  25. package/cjs/components/Popup/utils/index.js.map +1 -1
  26. package/cjs/components/_Icon/Icon.assets/ResizeDiagonal.js +30 -0
  27. package/cjs/components/_Icon/Icon.assets/ResizeDiagonal.js.map +1 -0
  28. package/cjs/components/_Icon/Icons/IconResizeDiagonal.js +30 -0
  29. package/cjs/components/_Icon/Icons/IconResizeDiagonal.js.map +1 -0
  30. package/cjs/index.css +9 -6
  31. package/emotion/cjs/components/Drawer/Drawer.js +3 -2
  32. package/emotion/cjs/components/Modal/Modal.js +8 -4
  33. package/emotion/cjs/components/Modal/Modal.styles.js +11 -6
  34. package/emotion/cjs/components/Popup/Popup.js +70 -4
  35. package/emotion/cjs/components/Popup/Popup.styles.js +22 -8
  36. package/emotion/cjs/components/Popup/Popup.tokens.js +10 -1
  37. package/emotion/cjs/components/Popup/utils/getHandleStyles.js +68 -0
  38. package/emotion/cjs/components/Popup/utils/getRatioBasedOnPlacement.js +54 -0
  39. package/emotion/cjs/components/Popup/utils/getResizeDirections.js +82 -0
  40. package/emotion/cjs/components/Popup/utils/index.js +16 -0
  41. package/emotion/cjs/components/_Icon/Icon.assets/ResizeDiagonal.js +83 -0
  42. package/emotion/cjs/components/_Icon/Icons/IconResizeDiagonal.js +86 -0
  43. package/emotion/cjs/components/_Icon/index.js +4 -0
  44. package/emotion/cjs/examples/components/Button/Button.config.js +21 -26
  45. package/emotion/cjs/examples/components/ButtonGroup/ButtonGroup.config.js +25 -30
  46. package/emotion/cjs/examples/components/IconButton/IconButton.config.js +16 -21
  47. package/emotion/es/components/Drawer/Drawer.js +3 -2
  48. package/emotion/es/components/Modal/Modal.js +9 -5
  49. package/emotion/es/components/Modal/Modal.styles.js +8 -6
  50. package/emotion/es/components/Popup/Popup.js +66 -5
  51. package/emotion/es/components/Popup/Popup.styles.js +16 -8
  52. package/emotion/es/components/Popup/Popup.tokens.js +10 -1
  53. package/emotion/es/components/Popup/utils/getHandleStyles.js +58 -0
  54. package/emotion/es/components/Popup/utils/getRatioBasedOnPlacement.js +44 -0
  55. package/emotion/es/components/Popup/utils/getResizeDirections.js +72 -0
  56. package/emotion/es/components/Popup/utils/index.js +3 -0
  57. package/emotion/es/components/_Icon/Icon.assets/ResizeDiagonal.js +68 -0
  58. package/emotion/es/components/_Icon/Icons/IconResizeDiagonal.js +71 -0
  59. package/emotion/es/components/_Icon/index.js +1 -0
  60. package/emotion/es/examples/components/Button/Button.config.js +21 -26
  61. package/emotion/es/examples/components/ButtonGroup/ButtonGroup.config.js +25 -30
  62. package/emotion/es/examples/components/Combobox/Combobox.js +0 -7
  63. package/emotion/es/examples/components/IconButton/IconButton.config.js +16 -21
  64. package/es/components/Drawer/Drawer.css +7 -5
  65. package/es/components/Drawer/Drawer.js +1 -1
  66. package/es/components/Drawer/Drawer.js.map +1 -1
  67. package/es/components/Modal/Modal.css +9 -6
  68. package/es/components/Modal/Modal.js +10 -6
  69. package/es/components/Modal/Modal.js.map +1 -1
  70. package/es/components/Modal/Modal.styles.js +6 -5
  71. package/es/components/Modal/Modal.styles.js.map +1 -1
  72. package/es/components/Modal/{Modal.styles_1gt0sfn.css → Modal.styles_1obtvtw.css} +4 -3
  73. package/es/components/Notification/NotificationsProvider.css +7 -3
  74. package/es/components/Popup/Popup.js +67 -4
  75. package/es/components/Popup/Popup.js.map +1 -1
  76. package/es/components/Popup/Popup.styles.js +30 -20
  77. package/es/components/Popup/Popup.styles.js.map +1 -1
  78. package/es/components/Popup/Popup.styles_kpf3dd.css +6 -0
  79. package/es/components/Popup/Popup.tokens.js +10 -1
  80. package/es/components/Popup/Popup.tokens.js.map +1 -1
  81. package/es/components/Popup/PopupContext.css +7 -3
  82. package/es/components/Popup/utils/getHandleStyles.js +36 -0
  83. package/es/components/Popup/utils/getHandleStyles.js.map +1 -0
  84. package/es/components/Popup/utils/getRatioBasedOnPlacement.js +34 -0
  85. package/es/components/Popup/utils/getRatioBasedOnPlacement.js.map +1 -0
  86. package/es/components/Popup/utils/getResizeDirections.js +69 -0
  87. package/es/components/Popup/utils/getResizeDirections.js.map +1 -0
  88. package/es/components/Popup/utils/index.js.map +1 -1
  89. package/es/components/_Icon/Icon.assets/ResizeDiagonal.js +22 -0
  90. package/es/components/_Icon/Icon.assets/ResizeDiagonal.js.map +1 -0
  91. package/es/components/_Icon/Icons/IconResizeDiagonal.js +22 -0
  92. package/es/components/_Icon/Icons/IconResizeDiagonal.js.map +1 -0
  93. package/es/index.css +9 -6
  94. package/package.json +3 -2
  95. package/styled-components/cjs/components/Drawer/Drawer.js +3 -2
  96. package/styled-components/cjs/components/Modal/Modal.js +8 -4
  97. package/styled-components/cjs/components/Modal/Modal.styles.js +50 -8
  98. package/styled-components/cjs/components/Popup/Popup.js +70 -4
  99. package/styled-components/cjs/components/Popup/Popup.styles.js +68 -8
  100. package/styled-components/cjs/components/Popup/Popup.tokens.js +10 -1
  101. package/styled-components/cjs/components/Popup/utils/getHandleStyles.js +68 -0
  102. package/styled-components/cjs/components/Popup/utils/getRatioBasedOnPlacement.js +54 -0
  103. package/styled-components/cjs/components/Popup/utils/getResizeDirections.js +82 -0
  104. package/styled-components/cjs/components/Popup/utils/index.js +16 -0
  105. package/styled-components/cjs/components/_Icon/Icon.assets/ResizeDiagonal.js +83 -0
  106. package/styled-components/cjs/components/_Icon/Icons/IconResizeDiagonal.js +86 -0
  107. package/styled-components/cjs/components/_Icon/index.js +4 -0
  108. package/styled-components/cjs/examples/components/Button/Button.config.js +0 -80
  109. package/styled-components/cjs/examples/components/ButtonGroup/ButtonGroup.config.js +0 -65
  110. package/styled-components/cjs/examples/components/IconButton/IconButton.config.js +1 -66
  111. package/styled-components/es/components/Drawer/Drawer.js +3 -2
  112. package/styled-components/es/components/Modal/Modal.js +9 -5
  113. package/styled-components/es/components/Modal/Modal.styles.js +8 -4
  114. package/styled-components/es/components/Popup/Popup.js +66 -5
  115. package/styled-components/es/components/Popup/Popup.styles.js +23 -4
  116. package/styled-components/es/components/Popup/Popup.tokens.js +10 -1
  117. package/styled-components/es/components/Popup/utils/getHandleStyles.js +58 -0
  118. package/styled-components/es/components/Popup/utils/getRatioBasedOnPlacement.js +44 -0
  119. package/styled-components/es/components/Popup/utils/getResizeDirections.js +72 -0
  120. package/styled-components/es/components/Popup/utils/index.js +3 -0
  121. package/styled-components/es/components/_Icon/Icon.assets/ResizeDiagonal.js +68 -0
  122. package/styled-components/es/components/_Icon/Icons/IconResizeDiagonal.js +71 -0
  123. package/styled-components/es/components/_Icon/index.js +1 -0
  124. package/styled-components/es/examples/components/Button/Button.config.js +0 -80
  125. package/styled-components/es/examples/components/ButtonGroup/ButtonGroup.config.js +0 -65
  126. package/styled-components/es/examples/components/IconButton/IconButton.config.js +1 -66
  127. package/types/components/Breadcrumbs/utils/index.d.ts +1 -1
  128. package/types/components/Carousel/CarouselOld/Carousel.d.ts +2 -2
  129. package/types/components/Combobox/ComboboxNew/utils/sizeToIconSize.d.ts +1 -1
  130. package/types/components/Drawer/Drawer.d.ts +2 -2
  131. package/types/components/Drawer/Drawer.d.ts.map +1 -1
  132. package/types/components/Drawer/Drawer.types.d.ts +1 -1
  133. package/types/components/Drawer/Drawer.types.d.ts.map +1 -1
  134. package/types/components/Modal/Modal.d.ts +1 -1
  135. package/types/components/Modal/Modal.d.ts.map +1 -1
  136. package/types/components/Modal/Modal.styles.d.ts +1 -0
  137. package/types/components/Modal/Modal.styles.d.ts.map +1 -1
  138. package/types/components/Popup/Popup.d.ts +1 -1
  139. package/types/components/Popup/Popup.d.ts.map +1 -1
  140. package/types/components/Popup/Popup.styles.d.ts +2 -0
  141. package/types/components/Popup/Popup.styles.d.ts.map +1 -1
  142. package/types/components/Popup/Popup.tokens.d.ts +9 -0
  143. package/types/components/Popup/Popup.tokens.d.ts.map +1 -1
  144. package/types/components/Popup/Popup.types.d.ts +64 -2
  145. package/types/components/Popup/Popup.types.d.ts.map +1 -1
  146. package/types/components/Popup/utils/getHandleStyles.d.ts +37 -0
  147. package/types/components/Popup/utils/getHandleStyles.d.ts.map +1 -0
  148. package/types/components/Popup/utils/getRatioBasedOnPlacement.d.ts +5 -0
  149. package/types/components/Popup/utils/getRatioBasedOnPlacement.d.ts.map +1 -0
  150. package/types/components/Popup/utils/getResizeDirections.d.ts +14 -0
  151. package/types/components/Popup/utils/getResizeDirections.d.ts.map +1 -0
  152. package/types/components/Popup/utils/index.d.ts +3 -0
  153. package/types/components/Popup/utils/index.d.ts.map +1 -1
  154. package/types/components/Select/utils/sizeToIconSize.d.ts +1 -1
  155. package/types/components/Table/ui/HeadCell/HeadCell.d.ts +1 -1
  156. package/types/components/Tree/utils/sizeToIconSize.d.ts +1 -1
  157. package/types/components/_Icon/Icon.assets/ResizeDiagonal.d.ts +4 -0
  158. package/types/components/_Icon/Icon.assets/ResizeDiagonal.d.ts.map +1 -0
  159. package/types/components/_Icon/Icons/IconResizeDiagonal.d.ts +4 -0
  160. package/types/components/_Icon/Icons/IconResizeDiagonal.d.ts.map +1 -0
  161. package/types/components/_Icon/index.d.ts +1 -0
  162. package/types/components/_Icon/index.d.ts.map +1 -1
  163. package/cjs/components/Popup/Popup.styles_gq4luz.css +0 -4
  164. package/es/components/Popup/Popup.styles_gq4luz.css +0 -4
@@ -17,35 +17,77 @@ _export(exports, {
17
17
  },
18
18
  get ModalContent () {
19
19
  return ModalContent;
20
+ },
21
+ get base () {
22
+ return base;
20
23
  }
21
24
  });
22
- var _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
25
+ var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
23
26
  var _mixins = require("../../mixins");
24
27
  var _Modaltokens = require("./Modal.tokens");
25
- function _interop_require_default(obj) {
26
- return obj && obj.__esModule ? obj : {
27
- default: obj
28
+ function _getRequireWildcardCache(nodeInterop) {
29
+ if (typeof WeakMap !== "function") return null;
30
+ var cacheBabelInterop = new WeakMap();
31
+ var cacheNodeInterop = new WeakMap();
32
+ return (_getRequireWildcardCache = function(nodeInterop) {
33
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
34
+ })(nodeInterop);
35
+ }
36
+ function _interop_require_wildcard(obj, nodeInterop) {
37
+ if (!nodeInterop && obj && obj.__esModule) {
38
+ return obj;
39
+ }
40
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
41
+ return {
42
+ default: obj
43
+ };
44
+ }
45
+ var cache = _getRequireWildcardCache(nodeInterop);
46
+ if (cache && cache.has(obj)) {
47
+ return cache.get(obj);
48
+ }
49
+ var newObj = {
50
+ __proto__: null
28
51
  };
52
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
53
+ for(var key in obj){
54
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
55
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
56
+ if (desc && (desc.get || desc.set)) {
57
+ Object.defineProperty(newObj, key, desc);
58
+ } else {
59
+ newObj[key] = obj[key];
60
+ }
61
+ }
62
+ }
63
+ newObj.default = obj;
64
+ if (cache) {
65
+ cache.set(obj, newObj);
66
+ }
67
+ return newObj;
29
68
  }
69
+ var base = (0, _styledcomponents.css)([
70
+ "height:100%;"
71
+ ]);
30
72
  var ModalBody = _styledcomponents.default.div.withConfig({
31
73
  displayName: "Modal.styles__ModalBody",
32
- componentId: "sc-65f5e73a-0"
74
+ componentId: "sc-96885df7-0"
33
75
  })([
34
- "border-radius:var(",
76
+ "height:100%;box-sizing:border-box;border-radius:var(",
35
77
  ");padding:var(",
36
78
  ");background:var(",
37
79
  ");box-shadow:var(--shadow-down-soft-l);"
38
80
  ], _Modaltokens.tokens.modalBodyBorderRadius, _Modaltokens.tokens.modalBodyPadding, _Modaltokens.tokens.modalBodyBackground);
39
81
  var ModalContent = _styledcomponents.default.div.withConfig({
40
82
  displayName: "Modal.styles__ModalContent",
41
- componentId: "sc-65f5e73a-1"
83
+ componentId: "sc-96885df7-1"
42
84
  })([
43
85
  "position:relative;padding:var(",
44
86
  ");"
45
87
  ], _Modaltokens.tokens.modalContentPadding);
46
88
  var CloseButton = _styledcomponents.default.button.withConfig({
47
89
  displayName: "Modal.styles__CloseButton",
48
- componentId: "sc-65f5e73a-2"
90
+ componentId: "sc-96885df7-2"
49
91
  })([
50
92
  "top:0;right:0;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(",
51
93
  ");padding:0;margin:0;outline:none;cursor:pointer;background:transparent;",
@@ -21,8 +21,11 @@ _export(exports, {
21
21
  });
22
22
  var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
23
23
  var _plasmacore = require("@salutejs/plasma-core");
24
+ var _reactdraggable = /*#__PURE__*/ _interop_require_default(require("react-draggable"));
25
+ var _reresizable = require("re-resizable");
24
26
  var _utils = require("../../utils");
25
27
  var _Portal = require("../Portal");
28
+ var _utils1 = require("./utils");
26
29
  var _PopupRoot = require("./PopupRoot");
27
30
  var _hooks = require("./hooks");
28
31
  var _Popuptokens = require("./Popup.tokens");
@@ -48,6 +51,11 @@ function _define_property(obj, key, value) {
48
51
  }
49
52
  return obj;
50
53
  }
54
+ function _interop_require_default(obj) {
55
+ return obj && obj.__esModule ? obj : {
56
+ default: obj
57
+ };
58
+ }
51
59
  function _getRequireWildcardCache(nodeInterop) {
52
60
  if (typeof WeakMap !== "function") return null;
53
61
  var cacheBabelInterop = new WeakMap();
@@ -230,7 +238,7 @@ var popupRoot = function(Root) {
230
238
  0,
231
239
  0
232
240
  ] : _param_offset, _param_frame = _param.frame, frame = _param_frame === void 0 ? 'document' : _param_frame, children = _param.children, overlay = _param.overlay, // eslint-disable-next-line @typescript-eslint/no-unused-vars
233
- role = _param.role, zIndex = _param.zIndex, popupInfo = _param.popupInfo, _param_withAnimation = _param.withAnimation, withAnimation = _param_withAnimation === void 0 ? false : _param_withAnimation, className = _param.className, rest = _object_without_properties(_param, [
241
+ role = _param.role, zIndex = _param.zIndex, popupInfo = _param.popupInfo, _param_withAnimation = _param.withAnimation, withAnimation = _param_withAnimation === void 0 ? false : _param_withAnimation, className = _param.className, draggable = _param.draggable, outerResizable = _param.resizable, rest = _object_without_properties(_param, [
234
242
  "id",
235
243
  "isOpen",
236
244
  "opened",
@@ -243,9 +251,15 @@ var popupRoot = function(Root) {
243
251
  "zIndex",
244
252
  "popupInfo",
245
253
  "withAnimation",
246
- "className"
254
+ "className",
255
+ "draggable",
256
+ "resizable"
247
257
  ]);
258
+ var _resizable_hiddenIcons, _resizable_icons, _resizable_hiddenIcons1, _resizable_icons1, _resizable_hiddenIcons2, _resizable_icons2, _resizable_hiddenIcons3, _resizable_icons3;
248
259
  var innerIsOpen = isOpen || opened;
260
+ var resizable = typeof outerResizable === 'boolean' ? {
261
+ disabled: !outerResizable
262
+ } : outerResizable;
249
263
  var uniqId = (0, _utils.safeUseId)();
250
264
  var innerId = id || uniqId;
251
265
  var _usePopup = (0, _hooks.usePopup)({
@@ -256,11 +270,22 @@ var popupRoot = function(Root) {
256
270
  }), isVisible = _usePopup.isVisible, animationInfo = _usePopup.animationInfo, setVisible = _usePopup.setVisible, rootId = _usePopup.rootId;
257
271
  var portalRef = (0, _react.useRef)(null);
258
272
  var contentRef = (0, _react.useRef)(null);
273
+ var resizableContainer = (0, _react.useRef)(null);
259
274
  var innerRef = (0, _plasmacore.useForkRef)(contentRef, outerRootRef);
260
275
  if (!isVisible && !innerIsOpen) {
261
276
  return null;
262
277
  }
263
278
  var cls = (0, _utils.cx)(className, (animationInfo === null || animationInfo === void 0 ? void 0 : animationInfo.endAnimation) ? _Popuptokens.classes.endAnimation : '', (animationInfo === null || animationInfo === void 0 ? void 0 : animationInfo.endTransition) ? _Popuptokens.classes.endTransition : '');
279
+ var handleResizeStart = function() {
280
+ if ((resizableContainer === null || resizableContainer === void 0 ? void 0 : resizableContainer.current) && resizableContainer.current.resizable) {
281
+ resizableContainer.current.resizable.classList.toggle(_Popuptokens.classes.resizableContainerNoSelect);
282
+ }
283
+ };
284
+ var handleResizeStop = function() {
285
+ if ((resizableContainer === null || resizableContainer === void 0 ? void 0 : resizableContainer.current) && resizableContainer.current.resizable) {
286
+ resizableContainer.current.resizable.classList.toggle(_Popuptokens.classes.resizableContainerNoSelect);
287
+ }
288
+ };
264
289
  var rootNode = /*#__PURE__*/ _react.default.createElement(Root, {
265
290
  className: cls
266
291
  }, overlay, /*#__PURE__*/ _react.default.createElement(_PopupRoot.PopupRoot, _object_spread({
@@ -271,7 +296,48 @@ var popupRoot = function(Root) {
271
296
  frame: frame,
272
297
  animationInfo: animationInfo,
273
298
  setVisible: setVisible
274
- }, rest), children));
299
+ }, rest), /*#__PURE__*/ _react.default.createElement(_reactdraggable.default, {
300
+ defaultClassName: draggable ? _Popuptokens.classes.draggablePopupWrapper : undefined,
301
+ defaultClassNameDragging: draggable ? _Popuptokens.classes.draggingPopupWrapper : undefined,
302
+ disabled: !draggable,
303
+ cancel: ".".concat(_Popuptokens.classes.resizableHandleWrapper)
304
+ }, /*#__PURE__*/ _react.default.createElement(_reresizable.Resizable, {
305
+ ref: resizableContainer,
306
+ enable: resizable && !resizable.disabled ? (0, _utils1.getResizeDirections)(resizable.directions) : false,
307
+ resizeRatio: (0, _utils1.getRatioBasedOnPlacement)(placement),
308
+ defaultSize: resizable === null || resizable === void 0 ? void 0 : resizable.defaultSize,
309
+ minWidth: resizable === null || resizable === void 0 ? void 0 : resizable.minWidth,
310
+ minHeight: resizable === null || resizable === void 0 ? void 0 : resizable.minHeight,
311
+ maxWidth: resizable === null || resizable === void 0 ? void 0 : resizable.maxWidth,
312
+ maxHeight: resizable === null || resizable === void 0 ? void 0 : resizable.maxHeight,
313
+ onResizeStart: handleResizeStart,
314
+ onResizeStop: handleResizeStop,
315
+ handleComponent: {
316
+ topRight: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons = resizable.hiddenIcons) === null || _resizable_hiddenIcons === void 0 ? void 0 : _resizable_hiddenIcons.includes('top-right')) ? undefined : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (resizable === null || resizable === void 0 ? void 0 : (_resizable_icons = resizable.icons) === null || _resizable_icons === void 0 ? void 0 : _resizable_icons.topRight) || /*#__PURE__*/ _react.default.createElement(_Popupstyles.IconResizeDiagonalStyled, {
317
+ className: _Popuptokens.classes.resizableTopRightIcon,
318
+ color: "inherit",
319
+ size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
320
+ })),
321
+ bottomRight: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons1 = resizable.hiddenIcons) === null || _resizable_hiddenIcons1 === void 0 ? void 0 : _resizable_hiddenIcons1.includes('bottom-right')) ? undefined : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (resizable === null || resizable === void 0 ? void 0 : (_resizable_icons1 = resizable.icons) === null || _resizable_icons1 === void 0 ? void 0 : _resizable_icons1.bottomRight) || /*#__PURE__*/ _react.default.createElement(_Popupstyles.IconResizeDiagonalStyled, {
322
+ className: _Popuptokens.classes.resizableBottomRightIcon,
323
+ color: "inherit",
324
+ size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
325
+ })),
326
+ bottomLeft: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons2 = resizable.hiddenIcons) === null || _resizable_hiddenIcons2 === void 0 ? void 0 : _resizable_hiddenIcons2.includes('bottom-left')) ? undefined : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (resizable === null || resizable === void 0 ? void 0 : (_resizable_icons2 = resizable.icons) === null || _resizable_icons2 === void 0 ? void 0 : _resizable_icons2.bottomLeft) || /*#__PURE__*/ _react.default.createElement(_Popupstyles.IconResizeDiagonalStyled, {
327
+ className: _Popuptokens.classes.resizableBottomLeftIcon,
328
+ color: "inherit",
329
+ size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
330
+ })),
331
+ topLeft: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons3 = resizable.hiddenIcons) === null || _resizable_hiddenIcons3 === void 0 ? void 0 : _resizable_hiddenIcons3.includes('top-left')) ? undefined : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (resizable === null || resizable === void 0 ? void 0 : (_resizable_icons3 = resizable.icons) === null || _resizable_icons3 === void 0 ? void 0 : _resizable_icons3.topLeft) || /*#__PURE__*/ _react.default.createElement(_Popupstyles.IconResizeDiagonalStyled, {
332
+ className: _Popuptokens.classes.resizableTopLeftIcon,
333
+ color: "inherit",
334
+ size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
335
+ }))
336
+ },
337
+ className: _Popuptokens.classes.resizableContainer,
338
+ handleStyles: (0, _utils1.getHandleStyles)(),
339
+ handleWrapperClass: _Popuptokens.classes.resizableHandleWrapper
340
+ }, children))));
275
341
  if (typeof frame !== 'string' && frame && frame.current && _utils.canUseDOM) {
276
342
  return /*#__PURE__*/ _react.default.createElement(_Portal.Portal, {
277
343
  container: frame.current
@@ -298,7 +364,7 @@ var popupConfig = {
298
364
  name: 'Popup',
299
365
  tag: 'div',
300
366
  layout: popupRoot,
301
- base: '',
367
+ base: _Popupstyles.base,
302
368
  variations: {},
303
369
  defaults: {}
304
370
  };
@@ -9,6 +9,9 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ get IconResizeDiagonalStyled () {
13
+ return IconResizeDiagonalStyled;
14
+ },
12
15
  get PopupRootContainer () {
13
16
  return PopupRootContainer;
14
17
  },
@@ -20,36 +23,83 @@ _export(exports, {
20
23
  },
21
24
  get StyledPortalContainer () {
22
25
  return StyledPortalContainer;
26
+ },
27
+ get base () {
28
+ return base;
23
29
  }
24
30
  });
25
- var _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
31
+ var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
32
+ var _Icon = require("../_Icon");
33
+ var _Popuptokens = require("./Popup.tokens");
26
34
  var _utils = require("./utils");
27
- function _interop_require_default(obj) {
28
- return obj && obj.__esModule ? obj : {
29
- default: obj
35
+ function _getRequireWildcardCache(nodeInterop) {
36
+ if (typeof WeakMap !== "function") return null;
37
+ var cacheBabelInterop = new WeakMap();
38
+ var cacheNodeInterop = new WeakMap();
39
+ return (_getRequireWildcardCache = function(nodeInterop) {
40
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
41
+ })(nodeInterop);
42
+ }
43
+ function _interop_require_wildcard(obj, nodeInterop) {
44
+ if (!nodeInterop && obj && obj.__esModule) {
45
+ return obj;
46
+ }
47
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
48
+ return {
49
+ default: obj
50
+ };
51
+ }
52
+ var cache = _getRequireWildcardCache(nodeInterop);
53
+ if (cache && cache.has(obj)) {
54
+ return cache.get(obj);
55
+ }
56
+ var newObj = {
57
+ __proto__: null
30
58
  };
59
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
60
+ for(var key in obj){
61
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
62
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
63
+ if (desc && (desc.get || desc.set)) {
64
+ Object.defineProperty(newObj, key, desc);
65
+ } else {
66
+ newObj[key] = obj[key];
67
+ }
68
+ }
69
+ }
70
+ newObj.default = obj;
71
+ if (cache) {
72
+ cache.set(obj, newObj);
73
+ }
74
+ return newObj;
31
75
  }
76
+ var base = (0, _styledcomponents.css)([
77
+ ".",
78
+ "{cursor:grab;}.",
79
+ "{cursor:grabbing;}.",
80
+ "{user-select:none;-webkit-user-select:none;}"
81
+ ], _Popuptokens.classes.draggablePopupWrapper, _Popuptokens.classes.draggingPopupWrapper, _Popuptokens.classes.resizableContainerNoSelect);
32
82
  var StyledPortal = _styledcomponents.default.div.withConfig({
33
83
  displayName: "Popup.styles__StyledPortal",
34
- componentId: "sc-9d33eb36-0"
84
+ componentId: "sc-e8036c4-0"
35
85
  })([
36
86
  ""
37
87
  ]);
38
88
  var StyledPortalContainer = _styledcomponents.default.div.withConfig({
39
89
  displayName: "Popup.styles__StyledPortalContainer",
40
- componentId: "sc-9d33eb36-1"
90
+ componentId: "sc-e8036c4-1"
41
91
  })([
42
92
  "width:0;"
43
93
  ]);
44
94
  var PopupView = _styledcomponents.default.div.withConfig({
45
95
  displayName: "Popup.styles__PopupView",
46
- componentId: "sc-9d33eb36-2"
96
+ componentId: "sc-e8036c4-2"
47
97
  })([
48
98
  "position:relative;max-width:100%;pointer-events:all;"
49
99
  ]);
50
100
  var PopupRootContainer = _styledcomponents.default.div.withConfig({
51
101
  displayName: "Popup.styles__PopupRootContainer",
52
- componentId: "sc-9d33eb36-3"
102
+ componentId: "sc-e8036c4-3"
53
103
  })([
54
104
  "position:",
55
105
  ";z-index:",
@@ -81,3 +131,13 @@ var PopupRootContainer = _styledcomponents.default.div.withConfig({
81
131
  var position = param.position;
82
132
  return position.transform || '';
83
133
  });
134
+ var IconResizeDiagonalStyled = (0, _styledcomponents.default)(_Icon.IconResizeDiagonal).withConfig({
135
+ displayName: "Popup.styles__IconResizeDiagonalStyled",
136
+ componentId: "sc-e8036c4-4"
137
+ })([
138
+ "color:var(--text-secondary);&:hover{color:var(--text-secondary-hover);}&:active{color:var(--text-secondary-active);}&.",
139
+ "{transform:rotate(-90deg);}&.",
140
+ "{transform:rotate(0);}&.",
141
+ "{transform:rotate(90deg);}&.",
142
+ "{transform:rotate(180deg);}"
143
+ ], _Popuptokens.classes.resizableTopRightIcon, _Popuptokens.classes.resizableBottomRightIcon, _Popuptokens.classes.resizableBottomLeftIcon, _Popuptokens.classes.resizableTopLeftIcon);
@@ -13,5 +13,14 @@ var classes = {
13
13
  * Класс корневого компонента PopupRoot: `popup-base-root`
14
14
  */ root: 'popup-base-root',
15
15
  endAnimation: 'popup-end-animation',
16
- endTransition: 'popup-end-transition'
16
+ endTransition: 'popup-end-transition',
17
+ resizableContainer: 'resizable-container',
18
+ resizableTopRightIcon: 'resizable-top-right-icon',
19
+ resizableBottomRightIcon: 'resizable-bottom-right-icon',
20
+ resizableBottomLeftIcon: 'resizable-bottom-left-icon',
21
+ resizableTopLeftIcon: 'resizable-top-left-icon',
22
+ resizableHandleWrapper: 'resizable-handle-wrapper',
23
+ resizableContainerNoSelect: 'resizable-container-no-select',
24
+ draggablePopupWrapper: 'draggable-popup-wrapper',
25
+ draggingPopupWrapper: 'dragging-popup-wrapper'
17
26
  };
@@ -0,0 +1,68 @@
1
+ // Объект стилей для handler'а, в котором находится иконка ресайза.
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "getHandleStyles", {
7
+ enumerable: true,
8
+ get: function() {
9
+ return getHandleStyles;
10
+ }
11
+ });
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value: value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
22
+ }
23
+ return obj;
24
+ }
25
+ function _object_spread(target) {
26
+ for(var i = 1; i < arguments.length; i++){
27
+ var source = arguments[i] != null ? arguments[i] : {};
28
+ var ownKeys = Object.keys(source);
29
+ if (typeof Object.getOwnPropertySymbols === "function") {
30
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
31
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
32
+ }));
33
+ }
34
+ ownKeys.forEach(function(key) {
35
+ _define_property(target, key, source[key]);
36
+ });
37
+ }
38
+ return target;
39
+ }
40
+ var base = {
41
+ width: 'auto',
42
+ height: 'auto',
43
+ lineHeight: '0'
44
+ };
45
+ var getHandleStyles = function() {
46
+ return {
47
+ topRight: _object_spread({
48
+ top: '0',
49
+ right: '0',
50
+ transform: 'translate(50%, -50%)'
51
+ }, base),
52
+ bottomRight: _object_spread({
53
+ right: '0',
54
+ bottom: '0',
55
+ transform: 'translate(50%, 50%)'
56
+ }, base),
57
+ bottomLeft: _object_spread({
58
+ bottom: '0',
59
+ left: '0',
60
+ transform: 'translate(-50%, 50%)'
61
+ }, base),
62
+ topLeft: _object_spread({
63
+ top: '0',
64
+ left: '0',
65
+ transform: 'translate(-50%, -50%)'
66
+ }, base)
67
+ };
68
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getRatioBasedOnPlacement", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return getRatioBasedOnPlacement;
9
+ }
10
+ });
11
+ var getRatioBasedOnPlacement = function(placement) {
12
+ switch(placement){
13
+ case 'center':
14
+ {
15
+ return [
16
+ 2,
17
+ 2
18
+ ];
19
+ }
20
+ case 'top':
21
+ case 'bottom':
22
+ {
23
+ return [
24
+ 2,
25
+ 1
26
+ ];
27
+ }
28
+ case 'left':
29
+ case 'right':
30
+ {
31
+ return [
32
+ 1,
33
+ 2
34
+ ];
35
+ }
36
+ case 'top-left':
37
+ case 'top-right':
38
+ case 'bottom-left':
39
+ case 'bottom-right':
40
+ {
41
+ return [
42
+ 1,
43
+ 1
44
+ ];
45
+ }
46
+ default:
47
+ {
48
+ return [
49
+ 2,
50
+ 2
51
+ ];
52
+ }
53
+ }
54
+ };
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getResizeDirections", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return getResizeDirections;
9
+ }
10
+ });
11
+ var getResizeDirections = function(directions) {
12
+ if (!directions) {
13
+ return {
14
+ top: true,
15
+ right: true,
16
+ bottom: true,
17
+ left: true,
18
+ topRight: true,
19
+ bottomRight: true,
20
+ bottomLeft: true,
21
+ topLeft: true
22
+ };
23
+ }
24
+ var result = {
25
+ top: false,
26
+ right: false,
27
+ bottom: false,
28
+ left: false,
29
+ topRight: false,
30
+ bottomRight: false,
31
+ bottomLeft: false,
32
+ topLeft: false
33
+ };
34
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
35
+ try {
36
+ for(var _iterator = directions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
37
+ var dir = _step.value;
38
+ switch(dir){
39
+ case 'top':
40
+ result.top = true;
41
+ break;
42
+ case 'right':
43
+ result.right = true;
44
+ break;
45
+ case 'bottom':
46
+ result.bottom = true;
47
+ break;
48
+ case 'left':
49
+ result.left = true;
50
+ break;
51
+ case 'top-right':
52
+ result.topRight = true;
53
+ break;
54
+ case 'top-left':
55
+ result.topLeft = true;
56
+ break;
57
+ case 'bottom-right':
58
+ result.bottomRight = true;
59
+ break;
60
+ case 'bottom-left':
61
+ result.bottomLeft = true;
62
+ break;
63
+ default:
64
+ break;
65
+ }
66
+ }
67
+ } catch (err) {
68
+ _didIteratorError = true;
69
+ _iteratorError = err;
70
+ } finally{
71
+ try {
72
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
73
+ _iterator.return();
74
+ }
75
+ } finally{
76
+ if (_didIteratorError) {
77
+ throw _iteratorError;
78
+ }
79
+ }
80
+ }
81
+ return result;
82
+ };
@@ -8,4 +8,20 @@ Object.defineProperty(exports, "DEFAULT_Z_INDEX", {
8
8
  return DEFAULT_Z_INDEX;
9
9
  }
10
10
  });
11
+ _export_star(require("./getRatioBasedOnPlacement"), exports);
12
+ _export_star(require("./getResizeDirections"), exports);
13
+ _export_star(require("./getHandleStyles"), exports);
14
+ function _export_star(from, to) {
15
+ Object.keys(from).forEach(function(k) {
16
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
17
+ Object.defineProperty(to, k, {
18
+ enumerable: true,
19
+ get: function() {
20
+ return from[k];
21
+ }
22
+ });
23
+ }
24
+ });
25
+ return from;
26
+ }
11
27
  var DEFAULT_Z_INDEX = '9000';
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "ResizeDiagonal", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return ResizeDiagonal;
9
+ }
10
+ });
11
+ var _react = /*#__PURE__*/ _interop_require_default(require("react"));
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value: value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
22
+ }
23
+ return obj;
24
+ }
25
+ function _interop_require_default(obj) {
26
+ return obj && obj.__esModule ? obj : {
27
+ default: obj
28
+ };
29
+ }
30
+ function _object_spread(target) {
31
+ for(var i = 1; i < arguments.length; i++){
32
+ var source = arguments[i] != null ? arguments[i] : {};
33
+ var ownKeys = Object.keys(source);
34
+ if (typeof Object.getOwnPropertySymbols === "function") {
35
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
36
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
37
+ }));
38
+ }
39
+ ownKeys.forEach(function(key) {
40
+ _define_property(target, key, source[key]);
41
+ });
42
+ }
43
+ return target;
44
+ }
45
+ function ownKeys(object, enumerableOnly) {
46
+ var keys = Object.keys(object);
47
+ if (Object.getOwnPropertySymbols) {
48
+ var symbols = Object.getOwnPropertySymbols(object);
49
+ if (enumerableOnly) {
50
+ symbols = symbols.filter(function(sym) {
51
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
52
+ });
53
+ }
54
+ keys.push.apply(keys, symbols);
55
+ }
56
+ return keys;
57
+ }
58
+ function _object_spread_props(target, source) {
59
+ source = source != null ? source : {};
60
+ if (Object.getOwnPropertyDescriptors) {
61
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
62
+ } else {
63
+ ownKeys(Object(source)).forEach(function(key) {
64
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
65
+ });
66
+ }
67
+ return target;
68
+ }
69
+ var ResizeDiagonal = function(props) {
70
+ return /*#__PURE__*/ _react.default.createElement("svg", _object_spread_props(_object_spread({
71
+ width: "100%",
72
+ viewBox: "0 0 24 24",
73
+ fill: "none"
74
+ }, props), {
75
+ xmlns: "http://www.w3.org/2000/svg"
76
+ }), /*#__PURE__*/ _react.default.createElement("path", {
77
+ d: "M21.5 13.25C21.5985 13.25 21.6961 13.269 21.7871 13.3066C21.8781 13.3443 21.9606 13.4001 22.0303 13.4697C22.1 13.5394 22.1556 13.6218 22.1934 13.7129C22.2311 13.8039 22.25 13.9015 22.25 14C22.25 14.0985 22.2311 14.1961 22.1934 14.2871C22.1556 14.3782 22.1 14.4606 22.0303 14.5303L14.5303 22.0303C14.4606 22.0999 14.3781 22.1557 14.2871 22.1934C14.1961 22.231 14.0985 22.25 14 22.25C13.9015 22.25 13.8039 22.2311 13.7129 22.1934C13.6218 22.1556 13.5394 22.1 13.4697 22.0303C13.4001 21.9606 13.3443 21.8781 13.3066 21.7871C13.269 21.6961 13.25 21.5985 13.25 21.5C13.25 21.4015 13.269 21.3039 13.3066 21.2129C13.3443 21.1219 13.4001 21.0394 13.4697 20.9697L20.9697 13.4697C21.0394 13.4 21.1218 13.3444 21.2129 13.3066C21.3039 13.2689 21.4015 13.25 21.5 13.25Z",
78
+ fill: "currentColor"
79
+ }), /*#__PURE__*/ _react.default.createElement("path", {
80
+ d: "M20 4.99902C20.0985 4.99902 20.1961 5.01892 20.2871 5.05664C20.3782 5.09438 20.4606 5.15 20.5303 5.21973C20.6 5.28938 20.6556 5.37184 20.6934 5.46289C20.7311 5.55392 20.751 5.65146 20.751 5.75C20.751 5.84855 20.7311 5.94607 20.6934 6.03711C20.6556 6.12816 20.6 6.21062 20.5303 6.28027L6.28027 20.5303C6.13955 20.671 5.94901 20.75 5.75 20.75C5.551 20.75 5.36045 20.671 5.21973 20.5303C5.07901 20.3895 5.00001 20.199 5 20C5 19.801 5.07902 19.6105 5.21973 19.4697L19.4697 5.21973C19.5394 5.14999 19.6218 5.09438 19.7129 5.05664C19.8039 5.01891 19.9015 4.99903 20 4.99902Z",
81
+ fill: "currentColor"
82
+ }));
83
+ };