@salutejs/plasma-new-hope 0.94.1-canary.1273.9715265388.0 → 0.95.0-canary.1272.9742620045.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. package/cjs/components/Combobox/Combobox.js +1 -1
  2. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
  3. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
  4. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
  5. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
  6. package/cjs/components/Drawer/Drawer.js +1 -1
  7. package/cjs/components/Drawer/hooks/useDrawer.js +3 -1
  8. package/cjs/components/Drawer/hooks/useDrawer.js.map +1 -1
  9. package/cjs/components/Dropdown/Dropdown.js +1 -1
  10. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
  11. package/cjs/components/Modal/hooks/useModal.js +3 -1
  12. package/cjs/components/Modal/hooks/useModal.js.map +1 -1
  13. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  14. package/cjs/components/Popover/Popover.js +9 -3
  15. package/cjs/components/Popover/Popover.js.map +1 -1
  16. package/cjs/components/Popup/Popup.js +9 -3
  17. package/cjs/components/Popup/Popup.js.map +1 -1
  18. package/cjs/components/Portal/Portal.js +36 -0
  19. package/cjs/components/Portal/Portal.js.map +1 -0
  20. package/cjs/components/Select/Select.js +1 -1
  21. package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
  22. package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
  23. package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
  24. package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
  25. package/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
  26. package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  27. package/cjs/components/Sheet/Sheet.js.map +1 -1
  28. package/cjs/index.js +3 -0
  29. package/cjs/index.js.map +1 -1
  30. package/es/components/Combobox/Combobox.js +1 -1
  31. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
  32. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
  33. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
  34. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
  35. package/es/components/Drawer/Drawer.js +1 -1
  36. package/es/components/Drawer/hooks/useDrawer.js +3 -1
  37. package/es/components/Drawer/hooks/useDrawer.js.map +1 -1
  38. package/es/components/Dropdown/Dropdown.js +1 -1
  39. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
  40. package/es/components/Modal/hooks/useModal.js +3 -1
  41. package/es/components/Modal/hooks/useModal.js.map +1 -1
  42. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  43. package/es/components/Popover/Popover.js +9 -3
  44. package/es/components/Popover/Popover.js.map +1 -1
  45. package/es/components/Popup/Popup.js +9 -3
  46. package/es/components/Popup/Popup.js.map +1 -1
  47. package/es/components/Portal/Portal.js +31 -0
  48. package/es/components/Portal/Portal.js.map +1 -0
  49. package/es/components/Select/Select.js +1 -1
  50. package/es/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
  51. package/es/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
  52. package/es/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
  53. package/es/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
  54. package/es/components/Select/ui/SelectItem/SelectItem.js +1 -1
  55. package/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  56. package/es/components/Sheet/Sheet.js +4 -4
  57. package/es/components/Sheet/Sheet.js.map +1 -1
  58. package/es/index.js +1 -0
  59. package/es/index.js.map +1 -1
  60. package/package.json +2 -2
  61. package/styled-components/cjs/components/Popover/Popover.js +8 -4
  62. package/styled-components/cjs/components/Popup/Popup.js +8 -4
  63. package/styled-components/cjs/components/Portal/Portal.js +37 -0
  64. package/styled-components/cjs/components/Portal/Portal.template-doc.mdx +66 -0
  65. package/styled-components/cjs/components/Portal/Portal.types.js +5 -0
  66. package/styled-components/cjs/components/Portal/index.js +18 -0
  67. package/styled-components/cjs/components/Sheet/Sheet.js +3 -3
  68. package/styled-components/cjs/examples/plasma_b2c/components/Portal/Portal.js +10 -0
  69. package/styled-components/cjs/examples/plasma_b2c/components/Portal/Portal.stories.tsx +57 -0
  70. package/styled-components/cjs/examples/plasma_b2c/components/Sheet/Sheet.stories.tsx +2 -2
  71. package/styled-components/cjs/examples/plasma_web/components/Portal/Portal.js +10 -0
  72. package/styled-components/cjs/examples/plasma_web/components/Portal/Portal.stories.tsx +57 -0
  73. package/styled-components/cjs/examples/plasma_web/components/Sheet/Sheet.stories.tsx +2 -2
  74. package/styled-components/cjs/index.js +11 -0
  75. package/styled-components/es/components/Popover/Popover.js +8 -3
  76. package/styled-components/es/components/Popup/Popup.js +8 -3
  77. package/styled-components/es/components/Portal/Portal.js +27 -0
  78. package/styled-components/es/components/Portal/Portal.template-doc.mdx +66 -0
  79. package/styled-components/es/components/Portal/Portal.types.js +1 -0
  80. package/styled-components/es/components/Portal/index.js +1 -0
  81. package/styled-components/es/components/Sheet/Sheet.js +4 -4
  82. package/styled-components/es/examples/plasma_b2c/components/Portal/Portal.js +4 -0
  83. package/styled-components/es/examples/plasma_b2c/components/Portal/Portal.stories.tsx +57 -0
  84. package/styled-components/es/examples/plasma_b2c/components/Sheet/Sheet.stories.tsx +2 -2
  85. package/styled-components/es/examples/plasma_web/components/Portal/Portal.js +4 -0
  86. package/styled-components/es/examples/plasma_web/components/Portal/Portal.stories.tsx +57 -0
  87. package/styled-components/es/examples/plasma_web/components/Sheet/Sheet.stories.tsx +2 -2
  88. package/styled-components/es/index.js +2 -1
  89. package/types/components/Popover/Popover.d.ts.map +1 -1
  90. package/types/components/Popup/Popup.d.ts.map +1 -1
  91. package/types/components/Portal/Portal.d.ts +13 -0
  92. package/types/components/Portal/Portal.d.ts.map +1 -0
  93. package/types/components/Portal/Portal.types.d.ts +18 -0
  94. package/types/components/Portal/Portal.types.d.ts.map +1 -0
  95. package/types/components/Portal/index.d.ts +3 -0
  96. package/types/components/Portal/index.d.ts.map +1 -0
  97. package/types/components/Sheet/Sheet.d.ts.map +1 -1
  98. package/types/components/Sheet/Sheet.types.d.ts +1 -1
  99. package/types/components/Sheet/Sheet.types.d.ts.map +1 -1
  100. package/types/examples/plasma_b2c/components/Portal/Portal.d.ts +3 -0
  101. package/types/examples/plasma_b2c/components/Portal/Portal.d.ts.map +1 -0
  102. package/types/examples/plasma_web/components/Portal/Portal.d.ts +3 -0
  103. package/types/examples/plasma_web/components/Portal/Portal.d.ts.map +1 -0
  104. package/types/index.d.ts +1 -0
  105. package/types/index.d.ts.map +1 -1
@@ -9,9 +9,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import React, { forwardRef, useEffect, useRef, useState } from 'react';
12
- import ReactDOM from 'react-dom';
13
12
  import { useForkRef, safeUseId } from '@salutejs/plasma-core';
14
13
  import { cx } from '../../utils';
14
+ import { portalConfig } from '../Portal';
15
+ import { component, mergeConfig } from '../../engines';
15
16
  import { POPUP_PORTAL_ID } from './PopupContext';
16
17
  import { PopupRoot } from './PopupRoot';
17
18
  import { usePopup } from './hooks';
@@ -73,6 +74,8 @@ export var handlePosition = function handlePosition(placement, offset) {
73
74
  transform: transform
74
75
  };
75
76
  };
77
+ var mergedPortalConfig = /*#__PURE__*/mergeConfig(portalConfig);
78
+ var Portal = /*#__PURE__*/component(mergedPortalConfig);
76
79
 
77
80
  /**
78
81
  * Базовый копмонент Popup.
@@ -146,7 +149,9 @@ export var popupRoot = function popupRoot(Root) {
146
149
  return null;
147
150
  }
148
151
  var cls = cx(className, animationInfo !== null && animationInfo !== void 0 && animationInfo.endAnimation ? classes.endAnimation : '', animationInfo !== null && animationInfo !== void 0 && animationInfo.endTransition ? classes.endTransition : '');
149
- return /*#__PURE__*/React.createElement(React.Fragment, null, portalRef.current && /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(Root, _extends({
152
+ return /*#__PURE__*/React.createElement(React.Fragment, null, portalRef.current && /*#__PURE__*/React.createElement(Portal, {
153
+ container: portalRef.current
154
+ }, /*#__PURE__*/React.createElement(Root, _extends({
150
155
  className: cls
151
156
  }, rest), overlay, /*#__PURE__*/React.createElement(PopupRoot, {
152
157
  id: innerId,
@@ -156,7 +161,7 @@ export var popupRoot = function popupRoot(Root) {
156
161
  zIndex: zIndex,
157
162
  animationInfo: animationInfo,
158
163
  setVisible: setVisible
159
- }, children)), portalRef.current));
164
+ }, children))));
160
165
  });
161
166
  };
162
167
  export var popupConfig = {
@@ -0,0 +1,27 @@
1
+ import React, { forwardRef } from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ /*
4
+ * Вспомогательный компонент. Используется в Popup, Popover.
5
+ * Представляет собой ReactDOM.createPortal() в форме компонента.
6
+ */
7
+ export var portalRoot = function portalRoot(Root) {
8
+ return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
9
+ var children = _ref.children,
10
+ container = _ref.container,
11
+ _ref$disabled = _ref.disabled,
12
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled;
13
+ var portalContainer = typeof container === 'function' ? container() : container;
14
+ return /*#__PURE__*/React.createElement(Root, {
15
+ disabled: disabled,
16
+ ref: outerRootRef
17
+ }, disabled && children, !disabled && /*#__PURE__*/ReactDOM.createPortal(children, portalContainer));
18
+ });
19
+ };
20
+ export var portalConfig = {
21
+ name: 'Portal',
22
+ tag: 'div',
23
+ layout: portalRoot,
24
+ base: '',
25
+ variations: {},
26
+ defaults: {}
27
+ };
@@ -0,0 +1,66 @@
1
+ ---
2
+ id: portal
3
+ title: Portal
4
+ ---
5
+
6
+ import { PropsTable, Description } from '@site/src/components';
7
+
8
+ # Portal
9
+ <Description name="Portal" />
10
+ <PropsTable name="Portal" />
11
+
12
+ ## Использование
13
+
14
+ ```tsx live
15
+ import React, { useState, useRef } from 'react';
16
+ import { Portal, Button, BodyM } from '@salutejs/{{ package }}';
17
+
18
+ export function App() {
19
+ const [show, setShow] = useState(false);
20
+ const containerRef = useRef(null);
21
+
22
+ return (
23
+ <>
24
+ <Button onClick={() => setShow(!show)}>{show ? 'Скрыть' : 'Показать'}</Button>
25
+ <div style=\{{padding: '1.25rem', marginBottom: '0.625rem', marginTop: '0.625rem', border: '1px solid'}}>
26
+ <BodyM style=\{{ marginBottom: '1.25rem' }}>Содержимое портала появится в нижнем блоке.</BodyM>
27
+ {show && containerRef.current && (
28
+ <Portal container={containerRef.current}>
29
+ <BodyM bold>Содержимое портала</BodyM>
30
+ </Portal>
31
+ )}
32
+ </div>
33
+ <div style=\{{padding: '1.25rem', marginBottom: '0.625rem', marginTop: '0.625rem', border: '1px solid'}} ref={containerRef} />
34
+ </>
35
+ );
36
+ }
37
+ ```
38
+
39
+ ### Disabled
40
+ Отключить портал можно с помощью свойства `disabled`.
41
+ В этом случае содержимое портала добавится внутрь родительского элемента.
42
+
43
+ ```tsx live
44
+ import React, { useState, useRef } from 'react';
45
+ import { Portal, Button, BodyM } from '@salutejs/{{ package }}';
46
+
47
+ export function App() {
48
+ const [show, setShow] = useState(false);
49
+ const containerRef = useRef(null);
50
+
51
+ return (
52
+ <>
53
+ <Button onClick={() => setShow(!show)}>{show ? 'Скрыть' : 'Показать'}</Button>
54
+ <div style=\{{padding: '1.25rem', marginBottom: '0.625rem', marginTop: '0.625rem', border: '1px solid'}}>
55
+ <BodyM style=\{{ marginBottom: '1.25rem' }}>Содержимое портала появится в данном блоке.</BodyM>
56
+ {show && containerRef.current && (
57
+ <Portal disabled container={containerRef.current}>
58
+ <BodyM bold>Содержимое портала</BodyM>
59
+ </Portal>
60
+ )}
61
+ </div>
62
+ <div style=\{{padding: '1.25rem', marginBottom: '0.625rem', marginTop: '0.625rem', border: '1px solid'}} ref={containerRef} />
63
+ </>
64
+ );
65
+ }
66
+ ```
@@ -0,0 +1 @@
1
+ export { portalConfig, portalRoot } from './Portal';
@@ -2,7 +2,7 @@ var _excluded = ["opened", "children", "onClose", "hasHandle", "contentHeader",
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
- import React, { forwardRef, useRef } from 'react';
5
+ import React, { forwardRef } from 'react';
6
6
  import { Overlay } from '../Overlay';
7
7
  import { cx } from '../../utils';
8
8
  import { useOverflow, useSheetSwipe } from './hooks';
@@ -38,9 +38,9 @@ export var sheetRoot = function sheetRoot(Root) {
38
38
  className = _ref.className,
39
39
  view = _ref.view,
40
40
  restProps = _objectWithoutProperties(_ref, _excluded);
41
- var contentWrapperRef = useRef(null);
42
- var contentRef = useRef(null);
43
- var handleRef = useRef(null);
41
+ var contentWrapperRef = React.useRef(null);
42
+ var contentRef = React.useRef(null);
43
+ var handleRef = React.useRef(null);
44
44
  useOverflow({
45
45
  opened: opened
46
46
  });
@@ -0,0 +1,4 @@
1
+ import { portalConfig } from '../../../../components/Portal';
2
+ import { component, mergeConfig } from '../../../../engines';
3
+ var mergedConfig = /*#__PURE__*/mergeConfig(portalConfig);
4
+ export var Portal = /*#__PURE__*/component(mergedConfig);
@@ -0,0 +1,57 @@
1
+ import React, { useState, useRef } from 'react';
2
+ import type { StoryObj, Meta } from '@storybook/react';
3
+ import type { ComponentProps } from 'react';
4
+ import styled from 'styled-components';
5
+
6
+ import { Button } from '../Button/Button';
7
+ import { WithTheme } from '../../../_helpers';
8
+ import { Body } from '../../../typograpy/components/Body/Body';
9
+
10
+ import { Portal } from './Portal';
11
+
12
+ const meta: Meta<typeof Portal> = {
13
+ title: 'plasma_b2c/Portal',
14
+ decorators: [WithTheme],
15
+ args: {
16
+ disabled: false,
17
+ },
18
+ };
19
+
20
+ export default meta;
21
+
22
+ type StoryPortalProps = ComponentProps<typeof Portal>;
23
+
24
+ const StyledWrapper = styled.div`
25
+ padding: 1.25rem;
26
+ margin-bottom: 0.625rem;
27
+ margin-top: 0.625rem;
28
+
29
+ border: 1px solid;
30
+ `;
31
+
32
+ const StoryDefault = ({ disabled }: StoryPortalProps) => {
33
+ const [show, setShow] = useState(false);
34
+ const containerRef = useRef<HTMLDivElement>(null);
35
+
36
+ return (
37
+ <>
38
+ <Button onClick={() => setShow(!show)}>{show ? 'Скрыть' : 'Показать'}</Button>
39
+ <StyledWrapper>
40
+ <Body style={{ marginBottom: '1.25rem' }}>Содержимое портала появится в нижнем блоке.</Body>
41
+ <Body style={{ marginBottom: '1.25rem' }}>
42
+ Если портал выключен (disabled), то содержимое появится в данном блоке.
43
+ </Body>
44
+ {show && containerRef.current && (
45
+ <Portal disabled={disabled} container={containerRef.current}>
46
+ <Body bold>Содержимое портала</Body>
47
+ </Portal>
48
+ )}
49
+ </StyledWrapper>
50
+ <StyledWrapper ref={containerRef} />
51
+ </>
52
+ );
53
+ };
54
+
55
+ export const Default: StoryObj<StoryPortalProps> = {
56
+ render: (args) => <StoryDefault {...args} />,
57
+ };
@@ -222,7 +222,7 @@ const StoryWithInsideScroll = ({
222
222
  <div
223
223
  style={{
224
224
  height: '150px',
225
- overflowY: 'scroll',
225
+ overflow: 'scroll',
226
226
  display: 'flex',
227
227
  flexDirection: 'column',
228
228
  gap: '1rem',
@@ -296,7 +296,7 @@ const StoryWithDoubleScroll = ({
296
296
  <div
297
297
  style={{
298
298
  height: '150px',
299
- overflowY: 'scroll',
299
+ overflow: 'scroll',
300
300
  display: 'flex',
301
301
  flexDirection: 'column',
302
302
  gap: '1rem',
@@ -0,0 +1,4 @@
1
+ import { portalConfig } from '../../../../components/Portal';
2
+ import { component, mergeConfig } from '../../../../engines';
3
+ var mergedConfig = /*#__PURE__*/mergeConfig(portalConfig);
4
+ export var Portal = /*#__PURE__*/component(mergedConfig);
@@ -0,0 +1,57 @@
1
+ import React, { useState, useRef } from 'react';
2
+ import type { StoryObj, Meta } from '@storybook/react';
3
+ import type { ComponentProps } from 'react';
4
+ import styled from 'styled-components';
5
+
6
+ import { Button } from '../Button/Button';
7
+ import { WithTheme } from '../../../_helpers';
8
+ import { Body } from '../../../typograpy/components/Body/Body';
9
+
10
+ import { Portal } from './Portal';
11
+
12
+ const meta: Meta<typeof Portal> = {
13
+ title: 'plasma_web/Portal',
14
+ decorators: [WithTheme],
15
+ args: {
16
+ disabled: false,
17
+ },
18
+ };
19
+
20
+ export default meta;
21
+
22
+ type StoryPortalProps = ComponentProps<typeof Portal>;
23
+
24
+ const StyledWrapper = styled.div`
25
+ padding: 1.25rem;
26
+ margin-bottom: 0.625rem;
27
+ margin-top: 0.625rem;
28
+
29
+ border: 1px solid;
30
+ `;
31
+
32
+ const StoryDefault = ({ disabled }: StoryPortalProps) => {
33
+ const [show, setShow] = useState(false);
34
+ const containerRef = useRef<HTMLDivElement>(null);
35
+
36
+ return (
37
+ <>
38
+ <Button onClick={() => setShow(!show)}>{show ? 'Скрыть' : 'Показать'}</Button>
39
+ <StyledWrapper>
40
+ <Body style={{ marginBottom: '1.25rem' }}>Содержимое портала появится в нижнем блоке.</Body>
41
+ <Body style={{ marginBottom: '1.25rem' }}>
42
+ Если портал выключен (disabled), то содержимое появится в данном блоке.
43
+ </Body>
44
+ {show && containerRef.current && (
45
+ <Portal disabled={disabled} container={containerRef.current}>
46
+ <Body bold>Содержимое портала</Body>
47
+ </Portal>
48
+ )}
49
+ </StyledWrapper>
50
+ <StyledWrapper ref={containerRef} />
51
+ </>
52
+ );
53
+ };
54
+
55
+ export const Default: StoryObj<StoryPortalProps> = {
56
+ render: (args) => <StoryDefault {...args} />,
57
+ };
@@ -222,7 +222,7 @@ const StoryWithInsideScroll = ({
222
222
  <div
223
223
  style={{
224
224
  height: '150px',
225
- overflowY: 'scroll',
225
+ overflow: 'scroll',
226
226
  display: 'flex',
227
227
  flexDirection: 'column',
228
228
  gap: '1rem',
@@ -296,7 +296,7 @@ const StoryWithDoubleScroll = ({
296
296
  <div
297
297
  style={{
298
298
  height: '150px',
299
- overflowY: 'scroll',
299
+ overflow: 'scroll',
300
300
  display: 'flex',
301
301
  flexDirection: 'column',
302
302
  gap: '1rem',
@@ -50,4 +50,5 @@ export * from './components/Sheet';
50
50
  export * from './components/Slider';
51
51
  export * from './components/Range';
52
52
  export * from './components/Accordion';
53
- export * from './components/DatePicker';
53
+ export * from './components/DatePicker';
54
+ export * from './components/Portal';
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAItE,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,UAAU,cAAc,EAAE,YAAY,CAAC,+JAwPpE,CAAC;AAEN,eAAO,MAAM,aAAa;;;mBA1PQ,UAAU,cAAc,EAAE,YAAY,CAAC;;;;;;;;;;CAuQxE,CAAC"}
1
+ {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAItE,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAKvD;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,UAAU,cAAc,EAAE,YAAY,CAAC,+JAuPpE,CAAC;AAEN,eAAO,MAAM,aAAa;;;mBAzPQ,UAAU,cAAc,EAAE,YAAY,CAAC;;;;;;;;;;CAsQxE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/components/Popup/Popup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAIvE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,KAAK,EAAuB,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAMxG,eAAO,MAAM,cAAc,cACZ,cAAc,UACjB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAC5C,iBA8DF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,UAAU,CAAC,sFAsGhE,CAAC;AAEN,eAAO,MAAM,WAAW;;;mBAxGQ,UAAU,cAAc,EAAE,UAAU,CAAC;;;;CA+GpE,CAAC"}
1
+ {"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/components/Popup/Popup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAKhD,OAAO,KAAK,EAAuB,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAMxG,eAAO,MAAM,cAAc,cACZ,cAAc,UACjB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAC5C,iBA8DF,CAAC;AAKF;;GAEG;AACH,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,UAAU,CAAC,sFAsGhE,CAAC;AAEN,eAAO,MAAM,WAAW;;;mBAxGQ,UAAU,cAAc,EAAE,UAAU,CAAC;;;;CA+GpE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { RootProps } from '../../engines/types';
3
+ import { PortalProps } from './Portal.types';
4
+ export declare const portalRoot: (Root: RootProps<HTMLDivElement, Omit<PortalProps, 'container'>>) => React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
5
+ export declare const portalConfig: {
6
+ name: string;
7
+ tag: string;
8
+ layout: (Root: RootProps<HTMLDivElement, Omit<PortalProps, 'container'>>) => React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
9
+ base: string;
10
+ variations: {};
11
+ defaults: {};
12
+ };
13
+ //# sourceMappingURL=Portal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../src/components/Portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,eAAO,MAAM,UAAU,SAAU,UAAU,cAAc,EAAE,KAAK,WAAW,EAAE,WAAW,CAAC,CAAC,uFAUpF,CAAC;AAEP,eAAO,MAAM,YAAY;;;mBAZQ,UAAU,cAAc,EAAE,KAAK,WAAW,EAAE,WAAW,CAAC,CAAC;;;;CAmBzF,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare type PortalProps = {
3
+ /**
4
+ * Элемент, в который добавится содержимое портала.
5
+ */
6
+ container: HTMLElement | (() => HTMLElement);
7
+ /**
8
+ * Содержимое портала.
9
+ */
10
+ children?: ReactNode;
11
+ /**
12
+ * Отключение портала.
13
+ * Если портал выключен, то его содержимое добавится внутрь родительского элемента.
14
+ * @default false
15
+ */
16
+ disabled?: boolean;
17
+ };
18
+ //# sourceMappingURL=Portal.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Portal.types.d.ts","sourceRoot":"","sources":["../../../src/components/Portal/Portal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,oBAAY,WAAW,GAAG;IACtB;;OAEG;IACH,SAAS,EAAE,WAAW,GAAG,CAAC,MAAM,WAAW,CAAC,CAAC;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { portalConfig, portalRoot } from './Portal';
2
+ export type { PortalProps } from './Portal.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Portal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAc3C;;GAEG;AAEH,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,UAAU,CAAC,sFAsEhE,CAAC;AAEN,eAAO,MAAM,WAAW;;;mBAxEQ,UAAU,cAAc,EAAE,UAAU,CAAC;;;;;;;;;;CAqFpE,CAAC"}
1
+ {"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAc3C;;GAEG;AAEH,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,UAAU,CAAC,sFAsEhE,CAAC;AAEN,eAAO,MAAM,WAAW;;;mBAxEQ,UAAU,cAAc,EAAE,UAAU,CAAC;;;;;;;;;;CAqFpE,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ReactNode, HTMLAttributes } from 'react';
1
+ import { ReactNode, HTMLAttributes } from 'react';
2
2
  export interface SheetProps extends HTMLAttributes<HTMLDivElement> {
3
3
  /**
4
4
  * Состояние шторки, открыта или скрыта
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.types.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC9D;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,gBAAgB,GAAG,QAAQ,CAAC,CAAC;AAExE,oBAAY,aAAa,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"Sheet.types.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC9D;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,gBAAgB,GAAG,QAAQ,CAAC,CAAC;AAExE,oBAAY,aAAa,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const Portal: import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("../../../../components/Portal").PortalProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ //# sourceMappingURL=Portal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_b2c/components/Portal/Portal.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,MAAM,sOAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const Portal: import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("../../../../components/Portal").PortalProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ //# sourceMappingURL=Portal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/Portal/Portal.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,MAAM,sOAA0B,CAAC"}
package/types/index.d.ts CHANGED
@@ -49,4 +49,5 @@ export * from './components/Slider';
49
49
  export * from './components/Range';
50
50
  export * from './components/Accordion';
51
51
  export * from './components/DatePicker';
52
+ export * from './components/Portal';
52
53
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC"}