@salutejs/plasma-new-hope 0.88.0-canary.1225.9348142616.0 → 0.88.0-canary.1225.9412763701.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/cjs/components/Sheet/Sheet.css +9 -5
  2. package/cjs/components/Sheet/Sheet.js +30 -9
  3. package/cjs/components/Sheet/Sheet.js.map +1 -1
  4. package/cjs/components/Sheet/Sheet.styles.js +81 -16
  5. package/cjs/components/Sheet/Sheet.styles.js.map +1 -1
  6. package/cjs/components/Sheet/{Sheet.styles_1bm46e7.css → Sheet.styles_kdjr5m.css} +5 -3
  7. package/cjs/components/Sheet/Sheet.tokens.js +2 -1
  8. package/cjs/components/Sheet/Sheet.tokens.js.map +1 -1
  9. package/cjs/components/Sheet/utils/handleTransition.js +2 -3
  10. package/cjs/components/Sheet/utils/handleTransition.js.map +1 -1
  11. package/cjs/components/Sheet/utils/index.js +8 -0
  12. package/cjs/components/Sheet/utils/index.js.map +1 -0
  13. package/cjs/index.css +7 -5
  14. package/es/components/Sheet/Sheet.css +9 -5
  15. package/es/components/Sheet/Sheet.js +32 -11
  16. package/es/components/Sheet/Sheet.js.map +1 -1
  17. package/es/components/Sheet/Sheet.styles.js +79 -16
  18. package/es/components/Sheet/Sheet.styles.js.map +1 -1
  19. package/es/components/Sheet/{Sheet.styles_1bm46e7.css → Sheet.styles_kdjr5m.css} +5 -3
  20. package/es/components/Sheet/Sheet.tokens.js +2 -1
  21. package/es/components/Sheet/Sheet.tokens.js.map +1 -1
  22. package/es/components/Sheet/utils/handleTransition.js +2 -3
  23. package/es/components/Sheet/utils/handleTransition.js.map +1 -1
  24. package/es/components/Sheet/utils/index.js +4 -0
  25. package/es/components/Sheet/utils/index.js.map +1 -0
  26. package/es/index.css +7 -5
  27. package/package.json +2 -2
  28. package/styled-components/cjs/components/Sheet/Sheet.js +30 -8
  29. package/styled-components/cjs/components/Sheet/Sheet.styles.js +36 -9
  30. package/styled-components/cjs/components/Sheet/Sheet.tokens.js +2 -1
  31. package/styled-components/cjs/components/Sheet/hooks/index.js +0 -7
  32. package/styled-components/cjs/components/Sheet/utils/handleTransition.js +2 -3
  33. package/styled-components/cjs/components/Sheet/utils/index.js +3 -1
  34. package/styled-components/cjs/components/Sheet/variations/_view/tokens.json +4 -1
  35. package/styled-components/cjs/examples/plasma_b2c/components/Sheet/Sheet.config.js +1 -1
  36. package/styled-components/cjs/examples/plasma_b2c/components/Sheet/Sheet.stories.tsx +170 -12
  37. package/styled-components/cjs/examples/plasma_web/components/Sheet/Sheet.config.js +1 -1
  38. package/styled-components/cjs/examples/plasma_web/components/Sheet/Sheet.stories.tsx +162 -11
  39. package/styled-components/es/components/Sheet/Sheet.js +33 -11
  40. package/styled-components/es/components/Sheet/Sheet.styles.js +35 -8
  41. package/styled-components/es/components/Sheet/Sheet.tokens.js +2 -1
  42. package/styled-components/es/components/Sheet/hooks/index.js +0 -1
  43. package/styled-components/es/components/Sheet/utils/handleTransition.js +2 -3
  44. package/styled-components/es/components/Sheet/utils/index.js +2 -1
  45. package/styled-components/es/components/Sheet/variations/_view/tokens.json +4 -1
  46. package/styled-components/es/examples/plasma_b2c/components/Sheet/Sheet.config.js +1 -1
  47. package/styled-components/es/examples/plasma_b2c/components/Sheet/Sheet.stories.tsx +170 -12
  48. package/styled-components/es/examples/plasma_web/components/Sheet/Sheet.config.js +1 -1
  49. package/styled-components/es/examples/plasma_web/components/Sheet/Sheet.stories.tsx +162 -11
  50. package/types/components/Sheet/Sheet.d.ts +1 -0
  51. package/types/components/Sheet/Sheet.d.ts.map +1 -1
  52. package/types/components/Sheet/Sheet.styles.d.ts +12 -8
  53. package/types/components/Sheet/Sheet.styles.d.ts.map +1 -1
  54. package/types/components/Sheet/Sheet.tokens.d.ts +2 -1
  55. package/types/components/Sheet/Sheet.tokens.d.ts.map +1 -1
  56. package/types/components/Sheet/Sheet.types.d.ts +25 -7
  57. package/types/components/Sheet/Sheet.types.d.ts.map +1 -1
  58. package/types/components/Sheet/hooks/index.d.ts +0 -1
  59. package/types/components/Sheet/hooks/index.d.ts.map +1 -1
  60. package/types/components/Sheet/utils/handleTransition.d.ts.map +1 -1
  61. package/types/components/Sheet/utils/index.d.ts +1 -0
  62. package/types/components/Sheet/utils/index.d.ts.map +1 -1
  63. package/types/examples/plasma_b2c/components/Sheet/Sheet.config.d.ts.map +1 -1
  64. package/types/examples/plasma_web/components/Sheet/Sheet.config.d.ts.map +1 -1
  65. package/cjs/components/Sheet/hooks/useThemeContext.js +0 -17
  66. package/cjs/components/Sheet/hooks/useThemeContext.js.map +0 -1
  67. package/es/components/Sheet/hooks/useThemeContext.js +0 -13
  68. package/es/components/Sheet/hooks/useThemeContext.js.map +0 -1
  69. package/styled-components/cjs/components/Sheet/hooks/useThemeContext.js +0 -15
  70. package/styled-components/es/components/Sheet/hooks/useThemeContext.js +0 -9
  71. package/types/components/Sheet/hooks/useThemeContext.d.ts +0 -7
  72. package/types/components/Sheet/hooks/useThemeContext.d.ts.map +0 -1
@@ -1,5 +1,9 @@
1
- .Sheet_styles_1bm46e7_sah7qw3__a2bd4ee6{position:fixed;top:0;bottom:0;left:0;right:0;opacity:1;-webkit-transition:var(--sah7qw3-0);transition:var(--sah7qw3-0);z-index:1000;}.Sheet_styles_1bm46e7_sah7qw3__a2bd4ee6.Sheet_styles_1bm46e7_isClosed__a2bd4ee6{opacity:0;visibility:hidden;}
2
- .Sheet_styles_1bm46e7_shg69gz__a2bd4ee6{position:absolute;left:0;bottom:0;width:100%;max-height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-transition:var(--shg69gz-0);transition:var(--shg69gz-0);}.Sheet_styles_1bm46e7_shg69gz__a2bd4ee6.Sheet_styles_1bm46e7_isClosed__a2bd4ee6{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}
3
- .Sheet_styles_1bm46e7_s1cdpbaw__a2bd4ee6{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--s1cdpbaw-0);}
4
- .Sheet_styles_1bm46e7_sjx120m__a2bd4ee6{border-radius:1.5rem 1.5rem 0 0;background-color:var(--plasma-sheet-content-background-color);padding:1rem;max-height:100%;overflow:auto;overscroll-behavior:contain;}.Sheet_styles_1bm46e7_sjx120m__a2bd4ee6::-webkit-scrollbar{display:none;}
5
- .Sheet_styles_1bm46e7_s1f8rwx6__a2bd4ee6{width:4rem;padding:1.75rem 0;margin:-1.5rem 0;opacity:0.65;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}.Sheet_styles_1bm46e7_s1f8rwx6__a2bd4ee6::before{content:'';display:block;border-radius:0.625rem;background-color:var(--plasma-sheet-handle-background-color);height:0.25rem;}
1
+ .Overlay_styles_cxej3y_s1afr8la__70d4dd9a{position:fixed;inset:0;z-index:var(--s1afr8la-0);--plasma_private-overlay-background-color:var(--s1afr8la-1);--plasma_private-overlay-backdrop-filter:var(--s1afr8la-2);background:var(--s1afr8la-3);-webkit-backdrop-filter:var(--s1afr8la-4);backdrop-filter:var(--s1afr8la-4);cursor:var(--s1afr8la-5);}
2
+
3
+ .Sheet_styles_kdjr5m_sah7qw3__875343fb{position:fixed;top:0;bottom:0;left:0;right:0;opacity:1;-webkit-transition:var(--sah7qw3-0);transition:var(--sah7qw3-0);z-index:1000;}.Sheet_styles_kdjr5m_sah7qw3__875343fb.Sheet_styles_kdjr5m_isClosed__875343fb{opacity:0;visibility:hidden;}
4
+ .Sheet_styles_kdjr5m_shg69gz__875343fb{position:absolute;left:0;bottom:0;width:100%;max-height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-transition:var(--shg69gz-0);transition:var(--shg69gz-0);}.Sheet_styles_kdjr5m_shg69gz__875343fb.Sheet_styles_kdjr5m_isClosed__875343fb{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}
5
+ .Sheet_styles_kdjr5m_s1cdpbaw__875343fb{width:4rem;padding:1.75rem 0;margin:-1.5rem 0;opacity:0.65;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}.Sheet_styles_kdjr5m_s1cdpbaw__875343fb::before{content:'';display:block;border-radius:0.625rem;background-color:var(--plasma-sheet-handle-background-color);height:0.25rem;}
6
+ .Sheet_styles_kdjr5m_sjx120m__875343fb{border-radius:1.5rem 1.5rem 0 0;background-color:var(--plasma-sheet-content-background-color);padding-left:1rem;padding-right:1rem;padding-top:var(--sjx120m-0);padding-bottom:var(--sjx120m-1);max-height:100%;overflow:auto;overscroll-behavior:contain;}.Sheet_styles_kdjr5m_sjx120m__875343fb::-webkit-scrollbar{display:none;}
7
+ .Sheet_styles_kdjr5m_s1f8rwx6__875343fb{width:100%;z-index:1;padding-top:1rem;position:var(--s1f8rwx6-0);top:var(--s1f8rwx6-1);background-color:var(--s1f8rwx6-2);}
8
+
9
+ .Sheet_styles_kdjr5m_s1jdcq0t__875343fb{width:100%;z-index:1;padding-bottom:1rem;position:var(--s1jdcq0t-0);bottom:var(--s1jdcq0t-1);background-color:var(--s1jdcq0t-2);}
@@ -5,16 +5,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
6
  var React = require('react');
7
7
  var index = require('../../utils/index.js');
8
- var useThemeContext = require('./hooks/useThemeContext.js');
8
+ var Overlay = require('../Overlay/Overlay.js');
9
9
  var useSheetSwipe = require('./hooks/useSheetSwipe.js');
10
10
  var useSheet = require('./hooks/useSheet.js');
11
11
  var Sheet_tokens = require('./Sheet.tokens.js');
12
12
  var Sheet_styles = require('./Sheet.styles.js');
13
13
  var base = require('./variations/_view/base.js');
14
+ var index$1 = require('./utils/index.js');
14
15
 
15
- var _excluded = ["isOpen", "children", "onClose", "withOverlay", "withTransition", "throttleMs", "className", "view"];
16
+ var _excluded = ["isOpen", "children", "onClose", "hasHandle", "contentHeader", "isHeaderFixed", "contentFooter", "isFooterFixed", "withOverlay", "withBlur", "withTransition", "throttleMs", "className", "view"];
16
17
 
17
18
  /**
19
+ * Sheet
18
20
  * Открывает окно-шторку поверх основного экрана.
19
21
  */
20
22
 
@@ -23,8 +25,18 @@ var sheetRoot = function sheetRoot(Root) {
23
25
  var isOpen = _ref.isOpen,
24
26
  children = _ref.children,
25
27
  onClose = _ref.onClose,
28
+ _ref$hasHandle = _ref.hasHandle,
29
+ hasHandle = _ref$hasHandle === void 0 ? true : _ref$hasHandle,
30
+ contentHeader = _ref.contentHeader,
31
+ _ref$isHeaderFixed = _ref.isHeaderFixed,
32
+ isHeaderFixed = _ref$isHeaderFixed === void 0 ? false : _ref$isHeaderFixed,
33
+ contentFooter = _ref.contentFooter,
34
+ _ref$isFooterFixed = _ref.isFooterFixed,
35
+ isFooterFixed = _ref$isFooterFixed === void 0 ? false : _ref$isFooterFixed,
26
36
  _ref$withOverlay = _ref.withOverlay,
27
37
  withOverlay = _ref$withOverlay === void 0 ? true : _ref$withOverlay,
38
+ _ref$withBlur = _ref.withBlur,
39
+ withBlur = _ref$withBlur === void 0 ? false : _ref$withBlur,
28
40
  _ref$withTransition = _ref.withTransition,
29
41
  withTransition = _ref$withTransition === void 0 ? true : _ref$withTransition,
30
42
  throttleMs = _ref.throttleMs,
@@ -34,7 +46,6 @@ var sheetRoot = function sheetRoot(Root) {
34
46
  var contentWrapperRef = React.useRef(null);
35
47
  var contentRef = React.useRef(null);
36
48
  var handleRef = React.useRef(null);
37
- var theme = useThemeContext.useThemeContext();
38
49
  useSheet.useSheet({
39
50
  isOpen: isOpen
40
51
  });
@@ -45,9 +56,11 @@ var sheetRoot = function sheetRoot(Root) {
45
56
  throttleMs: throttleMs,
46
57
  onClose: onClose
47
58
  });
59
+ var hasHeader = !!contentHeader;
60
+ var hasFooter = !!contentFooter;
48
61
  var isClosedClass = isOpen ? undefined : "".concat(Sheet_tokens.classes.isClosed);
62
+ var overlayBackgroundToken = withBlur ? "var(".concat(Sheet_tokens.tokens.sheetOverlayWithBlurColor, ")") : "var(".concat(Sheet_tokens.tokens.sheetOverlayColor, ")");
49
63
  return /*#__PURE__*/React.createElement(Sheet_styles.StyledWrapper, _rollupPluginBabelHelpers.extends({
50
- theme: theme,
51
64
  isOpen: isOpen,
52
65
  withTransition: withTransition,
53
66
  className: index.cx(isClosedClass, className)
@@ -57,17 +70,25 @@ var sheetRoot = function sheetRoot(Root) {
57
70
  view: view,
58
71
  ref: rootRef
59
72
  }, /*#__PURE__*/React.createElement(Sheet_styles.StyledContentWrapper, {
60
- theme: theme,
61
73
  isOpen: isOpen,
62
74
  withTransition: withTransition,
63
75
  ref: contentWrapperRef
64
- }, /*#__PURE__*/React.createElement(Sheet_styles.StyledSheetHandle, {
76
+ }, hasHandle && /*#__PURE__*/React.createElement(Sheet_styles.StyledSheetHandle, {
65
77
  ref: handleRef
66
78
  }), /*#__PURE__*/React.createElement(Sheet_styles.StyledSheetContent, {
79
+ hasHeader: hasHeader,
80
+ hasFooter: hasFooter,
67
81
  ref: contentRef
68
- }, children)), /*#__PURE__*/React.createElement(Sheet_styles.StyledOverlay, {
69
- withOverlay: withOverlay,
70
- onClick: onClose
82
+ }, hasHeader && /*#__PURE__*/React.createElement(Sheet_styles.StyledSheetHeader, {
83
+ isHeaderFixed: isHeaderFixed
84
+ }, contentHeader), /*#__PURE__*/React.createElement(Sheet_styles.StyledSheetBody, null, children), hasFooter && /*#__PURE__*/React.createElement(Sheet_styles.StyledSheetFooter, {
85
+ isFooterFixed: isFooterFixed
86
+ }, contentFooter))), withOverlay && /*#__PURE__*/React.createElement(Overlay.Overlay, {
87
+ zIndex: index$1.DEFAULT_Z_INDEX,
88
+ backgroundColorProperty: overlayBackgroundToken,
89
+ withBlur: withBlur,
90
+ isClickable: true,
91
+ onOverlayClick: onClose
71
92
  })));
72
93
  });
73
94
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.js","sources":["../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { cx } from '../../utils';\nimport { RootProps } from '../../engines';\n\nimport { SheetProps } from './Sheet.types';\nimport { useSheet, useSheetSwipe, useThemeContext } from './hooks';\nimport { classes } from './Sheet.tokens';\nimport {\n StyledContentWrapper,\n StyledOverlay,\n StyledSheetContent,\n StyledSheetHandle,\n StyledWrapper,\n} from './Sheet.styles';\nimport { base as viewCSS } from './variations/_view/base';\n\n/**\n * Открывает окно-шторку поверх основного экрана.\n */\n\nexport const sheetRoot = (Root: RootProps<HTMLDivElement, SheetProps>) =>\n forwardRef<HTMLDivElement, SheetProps>(\n (\n {\n isOpen,\n children,\n onClose,\n withOverlay = true,\n withTransition = true,\n throttleMs,\n className,\n view,\n ...restProps\n },\n rootRef,\n ) => {\n const contentWrapperRef = React.useRef<HTMLDivElement>(null);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const handleRef = React.useRef<HTMLDivElement>(null);\n\n const theme = useThemeContext();\n\n useSheet({ isOpen });\n useSheetSwipe({ contentWrapperRef, contentRef, handleRef, throttleMs, onClose });\n\n const isClosedClass = isOpen ? undefined : `${classes.isClosed}`;\n\n return (\n <StyledWrapper\n theme={theme}\n isOpen={isOpen}\n withTransition={withTransition}\n className={cx(isClosedClass, className)}\n {...restProps}\n >\n <Root isOpen={isOpen} onClose={onClose} view={view} ref={rootRef}>\n <StyledContentWrapper\n theme={theme}\n isOpen={isOpen}\n withTransition={withTransition}\n ref={contentWrapperRef}\n >\n <StyledSheetHandle ref={handleRef} />\n <StyledSheetContent ref={contentRef}>{children}</StyledSheetContent>\n </StyledContentWrapper>\n <StyledOverlay withOverlay={withOverlay} onClick={onClose} />\n </Root>\n </StyledWrapper>\n );\n },\n );\n\nexport const sheetConfig = {\n name: 'Sheet',\n tag: 'div',\n layout: sheetRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'default',\n },\n};\n"],"names":["sheetRoot","Root","forwardRef","_ref","rootRef","isOpen","children","onClose","_ref$withOverlay","withOverlay","_ref$withTransition","withTransition","throttleMs","className","view","restProps","_objectWithoutProperties","_excluded","contentWrapperRef","React","useRef","contentRef","handleRef","theme","useThemeContext","useSheet","useSheetSwipe","isClosedClass","undefined","concat","classes","isClosed","createElement","StyledWrapper","_extends","cx","ref","StyledContentWrapper","StyledSheetHandle","StyledSheetContent","StyledOverlay","onClick","sheetConfig","name","tag","layout","base","variations","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;AAiBA;AACA;AACA;;IAEaA,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAA2C,EAAA;AAAA,EAAA,oBACjEC,gBAAU,CACN,UAAAC,IAAA,EAYIC,OAAO,EACN;AAAA,IAAA,IAXGC,MAAM,GAAAF,IAAA,CAANE,MAAM;MACNC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;MACRC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;MAAAC,gBAAA,GAAAL,IAAA,CACPM,WAAW;AAAXA,MAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,gBAAA;MAAAE,mBAAA,GAAAP,IAAA,CAClBQ,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;MACrBE,UAAU,GAAAT,IAAA,CAAVS,UAAU;MACVC,SAAS,GAAAV,IAAA,CAATU,SAAS;MACTC,IAAI,GAAAX,IAAA,CAAJW,IAAI;AACDC,MAAAA,SAAS,GAAAC,iDAAA,CAAAb,IAAA,EAAAc,SAAA,CAAA,CAAA;AAIhB,IAAA,IAAMC,iBAAiB,GAAGC,KAAK,CAACC,MAAM,CAAiB,IAAI,CAAC,CAAA;AAC5D,IAAA,IAAMC,UAAU,GAAGF,KAAK,CAACC,MA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,iBAAAA;AAAkB,KAAA,eAEvBC,KAAA,CAAAa,aAAA,CAACM,8BAAiB,EAAA;AAACF,MAAAA,GAAG,EAAEd,SAAAA;AAAU,KAAE,CAAC,eACrCH,KAAA,CAAAa,aAAA,CAACO,+BAAkB,EAAA;AAACH,MAAAA,GAAG,EAAEf,UAAAA;KAAaf,EAAAA,QAA6B,CACjD,CAAC,eACvBa,KAAA,CAAAa,aAAA,CAACQ,0BAAa,EAAA;AAAC/B,MAAAA,WAAW,EAAEA,WAAY;AAACgC,MAAAA,OAAO,EAAElC,OAAAA;KAAU,CAC1D,CACK,CAAC,CAAA;AAExB,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMmC,WAAW,GAAG;AACvBC,EAAAA,IAAI,EAAE,OAAO;AACbC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7C,SAAS;AACjB8C,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRjC,IAAAA,IAAI,EAAE;AACFkC,MAAAA,GAAG,EAAEC,SAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNpC,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"Sheet.js","sources":["../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { cx } from '../../utils';\nimport { RootProps } from '../../engines';\nimport { Overlay } from '../Overlay';\n\nimport { SheetProps } from './Sheet.types';\nimport { useSheet, useSheetSwipe } from './hooks';\nimport { classes, tokens } from './Sheet.tokens';\nimport {\n StyledContentWrapper,\n StyledSheetBody,\n StyledSheetContent,\n StyledSheetFooter,\n StyledSheetHandle,\n StyledSheetHeader,\n StyledWrapper,\n} from './Sheet.styles';\nimport { base as viewCSS } from './variations/_view/base';\nimport { DEFAULT_Z_INDEX } from './utils';\n\n/**\n * Sheet\n * Открывает окно-шторку поверх основного экрана.\n */\n\nexport const sheetRoot = (Root: RootProps<HTMLDivElement, SheetProps>) =>\n forwardRef<HTMLDivElement, SheetProps>(\n (\n {\n isOpen,\n children,\n onClose,\n hasHandle = true,\n contentHeader,\n isHeaderFixed = false,\n contentFooter,\n isFooterFixed = false,\n withOverlay = true,\n withBlur = false,\n withTransition = true,\n throttleMs,\n className,\n view,\n ...restProps\n },\n rootRef,\n ) => {\n const contentWrapperRef = React.useRef<HTMLDivElement>(null);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const handleRef = React.useRef<HTMLDivElement>(null);\n\n useSheet({ isOpen });\n useSheetSwipe({ contentWrapperRef, contentRef, handleRef, throttleMs, onClose });\n\n const hasHeader = !!contentHeader;\n const hasFooter = !!contentFooter;\n\n const isClosedClass = isOpen ? undefined : `${classes.isClosed}`;\n\n const overlayBackgroundToken = withBlur\n ? `var(${tokens.sheetOverlayWithBlurColor})`\n : `var(${tokens.sheetOverlayColor})`;\n\n return (\n <StyledWrapper\n isOpen={isOpen}\n withTransition={withTransition}\n className={cx(isClosedClass, className)}\n {...restProps}\n >\n <Root isOpen={isOpen} onClose={onClose} view={view} ref={rootRef}>\n <StyledContentWrapper isOpen={isOpen} withTransition={withTransition} ref={contentWrapperRef}>\n {hasHandle && <StyledSheetHandle ref={handleRef} />}\n <StyledSheetContent hasHeader={hasHeader} hasFooter={hasFooter} ref={contentRef}>\n {hasHeader && (\n <StyledSheetHeader isHeaderFixed={isHeaderFixed}>{contentHeader}</StyledSheetHeader>\n )}\n <StyledSheetBody>{children}</StyledSheetBody>\n {hasFooter && (\n <StyledSheetFooter isFooterFixed={isFooterFixed}>{contentFooter}</StyledSheetFooter>\n )}\n </StyledSheetContent>\n </StyledContentWrapper>\n {withOverlay && (\n <Overlay\n zIndex={DEFAULT_Z_INDEX}\n backgroundColorProperty={overlayBackgroundToken}\n withBlur={withBlur}\n isClickable\n onOverlayClick={onClose}\n />\n )}\n </Root>\n </StyledWrapper>\n );\n },\n );\n\nexport const sheetConfig = {\n name: 'Sheet',\n tag: 'div',\n layout: sheetRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'default',\n },\n};\n"],"names":["sheetRoot","Root","forwardRef","_ref","rootRef","isOpen","children","onClose","_ref$hasHandle","hasHandle","contentHeader","_ref$isHeaderFixed","isHeaderFixed","contentFooter","_ref$isFooterFixed","isFooterFixed","_ref$withOverlay","withOverlay","_ref$withBlur","withBlur","_ref$withTransition","withTransition","throttleMs","className","view","restProps","_objectWithoutProperties","_excluded","contentWrapperRef","React","useRef","contentRef","handleRef","useSheet","useSheetSwipe","hasHeader","hasFooter","isClosedClass","undefined","concat","classes","isClosed","overlayBackgroundToken","tokens","sheetOverlayWithBlurColor","sheetOverlayColor","createElement","StyledWrapper","_extends","cx","ref","StyledContentWrapper","StyledSheetHandle","StyledSheetContent","StyledSheetHeader","StyledSheetBody","StyledSheetFooter","Overlay","zIndex","DEFAULT_Z_INDEX","backgroundColorProperty","isClickable","onOverlayClick","sheetConfig","name","tag","layout","base","variations","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;AAqBA;AACA;AACA;AACA;;IAEaA,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAA2C,EAAA;AAAA,EAAA,oBACjEC,gBAAU,CACN,UAAAC,IAAA,EAkBIC,OAAO,EACN;AAAA,IAAA,IAjBGC,MAAM,GAAAF,IAAA,CAANE,MAAM;MACNC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;MACRC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;MAAAC,cAAA,GAAAL,IAAA,CACPM,SAAS;AAATA,MAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,cAAA;MAChBE,aAAa,GAAAP,IAAA,CAAbO,aAAa;MAAAC,kBAAA,GAAAR,IAAA,CACbS,aAAa;AAAbA,MAAAA,aAAa,GAAAD,kBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,kBAAA;MACrBE,aAAa,GAA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ACC,MAAAA,SAAS,EAAEA,SAAU;AAACc,MAAAA,GAAG,EAAEnB,UAAAA;AAAW,KAAA,EAC3EI,SAAS,iBACNN,KAAA,CAAAiB,aAAA,CAACQ,8BAAiB,EAAA;AAAC1C,MAAAA,aAAa,EAAEA,aAAAA;AAAc,KAAA,EAAEF,aAAiC,CACtF,eACDmB,KAAA,CAAAiB,aAAA,CAACS,4BAAe,EAAA,IAAA,EAAEjD,QAA0B,CAAC,EAC5C8B,SAAS,iBACNP,KAAA,CAAAiB,aAAA,CAACU,8BAAiB,EAAA;AAACzC,MAAAA,aAAa,EAAEA,aAAAA;KAAgBF,EAAAA,aAAiC,CAEvE,CACF,CAAC,EACtBI,WAAW,iBACRY,KAAA,CAAAiB,aAAA,CAACW,eAAO,EAAA;AACJC,MAAAA,MAAM,EAAEC,uBAAgB;AACxBC,MAAAA,uBAAuB,EAAElB,sBAAuB;AAChDvB,MAAAA,QAAQ,EAAEA,QAAS;MACnB0C,WAAW,EAAA,IAAA;AACXC,MAAAA,cAAc,EAAEvD,OAAAA;KACnB,CAEH,CACK,CAAC,CAAA;AAExB,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMwD,WAAW,GAAG;AACvBC,EAAAA,IAAI,EAAE,OAAO;AACbC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAElE,SAAS;AACjBmE,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACR5C,IAAAA,IAAI,EAAE;AACF6C,MAAAA,GAAG,EAAEC,SAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN/C,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;;"}
@@ -1,4 +1,4 @@
1
- import './Sheet.styles_1bm46e7.css';
1
+ import './Sheet.styles_kdjr5m.css';
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -29,34 +29,99 @@ var StyledContentWrapper = /*#__PURE__*/react.styled('div')({
29
29
  "shg69gz-0": [/*#__PURE__*/_exp3()]
30
30
  }
31
31
  });
32
- var _exp5 = function _exp5() {
32
+ var StyledSheetHandle = /*#__PURE__*/react.styled('div')({
33
+ name: "StyledSheetHandle",
34
+ "class": "s1cdpbaw",
35
+ propsAsIs: false
36
+ });
37
+ var _exp7 = function _exp7() {
33
38
  return function (_ref) {
34
- var withOverlay = _ref.withOverlay;
35
- return withOverlay ? "var(".concat(Sheet_tokens.tokens.overlayBackgroundColor, ")") : 'transparent';
39
+ var hasHeader = _ref.hasHeader;
40
+ return hasHeader ? 'unset' : '1rem';
41
+ };
42
+ };
43
+ var _exp8 = function _exp8() {
44
+ return function (_ref2) {
45
+ var hasFooter = _ref2.hasFooter;
46
+ return hasFooter ? 'unset' : '1rem';
36
47
  };
37
48
  };
38
- var StyledOverlay = /*#__PURE__*/react.styled('div')({
39
- name: "StyledOverlay",
40
- "class": "s1cdpbaw",
41
- propsAsIs: false,
42
- vars: {
43
- "s1cdpbaw-0": [/*#__PURE__*/_exp5()]
44
- }
45
- });
46
49
  var StyledSheetContent = /*#__PURE__*/react.styled('div')({
47
50
  name: "StyledSheetContent",
48
51
  "class": "sjx120m",
49
- propsAsIs: false
52
+ propsAsIs: false,
53
+ vars: {
54
+ "sjx120m-0": [/*#__PURE__*/_exp7()],
55
+ "sjx120m-1": [/*#__PURE__*/_exp8()]
56
+ }
50
57
  });
51
- var StyledSheetHandle = /*#__PURE__*/react.styled('div')({
52
- name: "StyledSheetHandle",
58
+ var _exp9 = function _exp9() {
59
+ return function (_ref3) {
60
+ var isHeaderFixed = _ref3.isHeaderFixed;
61
+ return isHeaderFixed ? 'sticky' : 'static';
62
+ };
63
+ };
64
+ var _exp10 = function _exp10() {
65
+ return function (_ref4) {
66
+ var isHeaderFixed = _ref4.isHeaderFixed;
67
+ return isHeaderFixed ? '0' : 'unset';
68
+ };
69
+ };
70
+ var _exp11 = function _exp11() {
71
+ return function (_ref5) {
72
+ var isHeaderFixed = _ref5.isHeaderFixed;
73
+ return isHeaderFixed ? "var(".concat(Sheet_tokens.tokens.contentBackgroundColor, ")") : 'transparent';
74
+ };
75
+ };
76
+ var StyledSheetHeader = /*#__PURE__*/react.styled('div')({
77
+ name: "StyledSheetHeader",
53
78
  "class": "s1f8rwx6",
79
+ propsAsIs: false,
80
+ vars: {
81
+ "s1f8rwx6-0": [/*#__PURE__*/_exp9()],
82
+ "s1f8rwx6-1": [/*#__PURE__*/_exp10()],
83
+ "s1f8rwx6-2": [/*#__PURE__*/_exp11()]
84
+ }
85
+ });
86
+ var StyledSheetBody = /*#__PURE__*/react.styled('div')({
87
+ name: "StyledSheetBody",
88
+ "class": "sqp1ccu",
54
89
  propsAsIs: false
55
90
  });
91
+ var _exp12 = function _exp12() {
92
+ return function (_ref6) {
93
+ var isFooterFixed = _ref6.isFooterFixed;
94
+ return isFooterFixed ? 'sticky' : 'static';
95
+ };
96
+ };
97
+ var _exp13 = function _exp13() {
98
+ return function (_ref7) {
99
+ var isFooterFixed = _ref7.isFooterFixed;
100
+ return isFooterFixed ? '0' : 'unset';
101
+ };
102
+ };
103
+ var _exp14 = function _exp14() {
104
+ return function (_ref8) {
105
+ var isFooterFixed = _ref8.isFooterFixed;
106
+ return isFooterFixed ? "var(".concat(Sheet_tokens.tokens.contentBackgroundColor, ")") : 'transparent';
107
+ };
108
+ };
109
+ var StyledSheetFooter = /*#__PURE__*/react.styled('div')({
110
+ name: "StyledSheetFooter",
111
+ "class": "s1jdcq0t",
112
+ propsAsIs: false,
113
+ vars: {
114
+ "s1jdcq0t-0": [/*#__PURE__*/_exp12()],
115
+ "s1jdcq0t-1": [/*#__PURE__*/_exp13()],
116
+ "s1jdcq0t-2": [/*#__PURE__*/_exp14()]
117
+ }
118
+ });
56
119
 
57
120
  exports.StyledContentWrapper = StyledContentWrapper;
58
- exports.StyledOverlay = StyledOverlay;
121
+ exports.StyledSheetBody = StyledSheetBody;
59
122
  exports.StyledSheetContent = StyledSheetContent;
123
+ exports.StyledSheetFooter = StyledSheetFooter;
60
124
  exports.StyledSheetHandle = StyledSheetHandle;
125
+ exports.StyledSheetHeader = StyledSheetHeader;
61
126
  exports.StyledWrapper = StyledWrapper;
62
127
  //# sourceMappingURL=Sheet.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.styles.js","sources":["../../../src/components/Sheet/Sheet.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { tokens, classes } from './Sheet.tokens';\nimport { CommonProps } from './Sheet.types';\nimport { handleTransition } from './utils/handleTransition';\n\nexport const StyledWrapper = styled.div<CommonProps>`\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n opacity: 1;\n transition: ${handleTransition('all 0.5s 0.1s')};\n z-index: 1000;\n\n &.${String(classes.isClosed)} {\n opacity: 0;\n visibility: hidden;\n }\n`;\n\nexport const StyledContentWrapper = styled.div<CommonProps>`\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n max-height: 100%;\n z-index: 1;\n\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n\n transition: ${handleTransition('transform 0.5s')};\n\n &.${String(classes.isClosed)} {\n transform: translateY(100%);\n }\n`;\n\nexport const StyledOverlay = styled.div<{ withOverlay: boolean }>`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n\n background-color: ${({ withOverlay }) => (withOverlay ? `var(${tokens.overlayBackgroundColor})` : 'transparent')};\n`;\n\nexport const StyledSheetContent = styled.div`\n border-radius: 1.5rem 1.5rem 0 0;\n background-color: var(${tokens.contentBackgroundColor});\n padding: 1rem;\n\n max-height: 100%;\n overflow: auto;\n overscroll-behavior: contain;\n\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nexport const StyledSheetHandle = styled.div`\n width: 4rem;\n padding: 1.75rem 0;\n margin: -1.5rem 0;\n opacity: 0.65;\n align-self: center;\n\n &::before {\n content: '';\n display: block;\n border-radius: 0.625rem;\n background-color: var(${tokens.handleColor});\n height: 0.25rem;\n }\n`;\n"],"names":["_exp","handleTransition","StyledWrapper","styled","name","class","propsAsIs","vars","_exp3","StyledContentWrapper","_exp5","_ref","withOverlay","concat","tokens","overlayBackgroundColor","StyledOverlay","StyledSheetContent","StyledSheetHandle"],"mappings":";;;;;;;;AAI4D,IAAAA,IAAA,GAH1CA,SAG0CA,IAAAA,GAAA;EAAA,OAS1CC,iCAAgB,CAAC,eAAe,CAAC,CAAA;AAAA,CAAA,CAAA;AAP5C,IAAMC,aAAa,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAC,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cAOjBP,IAAiC,EAAA,CAAA;AAAA,GAAA;AAAA,CAOlD,EAAA;AAAC,IAAAQ,KAAA,GAnBgBA,SAmBhBA,KAAAA,GAAA;EAAA,OAcgBP,iCAAgB,CAAC,gBAAgB,CAAC,CAAA;AAAA,CAAA,CAAA;AAZ7C,IAAMQ,oBAAoB,gBAAGN,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,sBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAC,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cAYxBC,KAAkC,EAAA,CAAA;AAAA,GAAA;AAAA,CAKnD,EAAA;AAAC,IAAAE,KAAA,GAtCgBA,SAsChBA,KAAAA,GAAA;AAAA,EAAA,OASsB,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,WAAAA,GAAAA,IAAAA,CAAAA,WAAAA,CAAAA;IAAAA,OAAmBA,WAAW,UAAAC,MAAA,CAAUC,mBAAM,CAACC,sBAAuB,SAAK,aAAc,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAP7G,IAAMC,aAAa,gBAAGb,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAC,EAAAA,IAAA,EAAA;AAAA,IAAA,YAAA,EAAA,cAOXG,KAA4F,EAAA,CAAA;AAAA,GAAA;AAAA,CACnH,EAAA;AAEM,IAAMO,kBAAkB,gBAAGd,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,oBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAYvC,EAAA;AAEM,IAAMY,iBAAiB,gBAAGf,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CActC;;;;;;;;"}
1
+ {"version":3,"file":"Sheet.styles.js","sources":["../../../src/components/Sheet/Sheet.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { tokens, classes } from './Sheet.tokens';\nimport { CommonProps } from './Sheet.types';\nimport { handleTransition } from './utils/handleTransition';\n\nexport const StyledWrapper = styled.div<CommonProps>`\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n opacity: 1;\n transition: ${handleTransition('all 0.5s 0.1s')};\n z-index: 1000;\n\n &.${String(classes.isClosed)} {\n opacity: 0;\n visibility: hidden;\n }\n`;\n\nexport const StyledContentWrapper = styled.div<CommonProps>`\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n max-height: 100%;\n z-index: 1;\n\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n\n transition: ${handleTransition('transform 0.5s')};\n\n &.${String(classes.isClosed)} {\n transform: translateY(100%);\n }\n`;\n\nexport const StyledSheetHandle = styled.div`\n width: 4rem;\n padding: 1.75rem 0;\n margin: -1.5rem 0;\n opacity: 0.65;\n align-self: center;\n\n &::before {\n content: '';\n display: block;\n border-radius: 0.625rem;\n background-color: var(${tokens.handleColor});\n height: 0.25rem;\n }\n`;\n\nexport const StyledSheetContent = styled.div<{ hasHeader?: boolean; hasFooter?: boolean }>`\n border-radius: 1.5rem 1.5rem 0 0;\n background-color: var(${tokens.contentBackgroundColor});\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: ${({ hasHeader }) => (hasHeader ? 'unset' : '1rem')};\n padding-bottom: ${({ hasFooter }) => (hasFooter ? 'unset' : '1rem')};\n\n max-height: 100%;\n overflow: auto;\n overscroll-behavior: contain;\n\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nexport const StyledSheetHeader = styled.div<{ isHeaderFixed?: boolean }>`\n width: 100%;\n z-index: 1;\n padding-top: 1rem;\n position: ${({ isHeaderFixed }) => (isHeaderFixed ? 'sticky' : 'static')};\n top: ${({ isHeaderFixed }) => (isHeaderFixed ? '0' : 'unset')};\n background-color: ${({ isHeaderFixed }) =>\n isHeaderFixed ? `var(${tokens.contentBackgroundColor})` : 'transparent'};\n`;\n\nexport const StyledSheetBody = styled.div``;\n\nexport const StyledSheetFooter = styled.div<{ isFooterFixed?: boolean }>`\n width: 100%;\n z-index: 1;\n padding-bottom: 1rem;\n position: ${({ isFooterFixed }) => (isFooterFixed ? 'sticky' : 'static')};\n bottom: ${({ isFooterFixed }) => (isFooterFixed ? '0' : 'unset')};\n background-color: ${({ isFooterFixed }) =>\n isFooterFixed ? `var(${tokens.contentBackgroundColor})` : 'transparent'};\n`;\n"],"names":["_exp","handleTransition","StyledWrapper","styled","name","class","propsAsIs","vars","_exp3","StyledContentWrapper","StyledSheetHandle","_exp7","_ref","hasHeader","_exp8","_ref2","hasFooter","StyledSheetContent","_exp9","_ref3","isHeaderFixed","_exp10","_ref4","_exp11","_ref5","concat","tokens","contentBackgroundColor","StyledSheetHeader","StyledSheetBody","_exp12","_ref6","isFooterFixed","_exp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C5C,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGJ,aAAAA,GAAAA,KAAAA,CAAAA,aAAAA,CAAAA;IAAAA,OACnBA,aAAa,UAAAP,MAAA,CAAUC,mBAAM,CAACC,sBAAuB,SAAK,aAAa,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAPxE,IAAMU,iBAAiB,gBAAGlC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAC,EAAAA,IAAA,EAAA;AAAA,IAAA,YAAA,EAAA,cAIvBuB,MAA4D,EAAA,CAAA;AAAA,IAAA,YAAA,EAAA,cAC9DG,MAAsD,EAAA,CAAA;AAAA,IAAA,YAAA,EAAA,cAC5CE,MACuD,EAAA,CAAA;AAAA,GAAA;AAAA,CAC9E;;;;;;;;;;"}
@@ -1,5 +1,7 @@
1
1
  .sah7qw3{position:fixed;top:0;bottom:0;left:0;right:0;opacity:1;-webkit-transition:var(--sah7qw3-0);transition:var(--sah7qw3-0);z-index:1000;}.sah7qw3.is-closed{opacity:0;visibility:hidden;}
2
2
  .shg69gz{position:absolute;left:0;bottom:0;width:100%;max-height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-transition:var(--shg69gz-0);transition:var(--shg69gz-0);}.shg69gz.is-closed{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}
3
- .s1cdpbaw{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--s1cdpbaw-0);}
4
- .sjx120m{border-radius:1.5rem 1.5rem 0 0;background-color:var(--plasma-sheet-content-background-color);padding:1rem;max-height:100%;overflow:auto;overscroll-behavior:contain;}.sjx120m::-webkit-scrollbar{display:none;}
5
- .s1f8rwx6{width:4rem;padding:1.75rem 0;margin:-1.5rem 0;opacity:0.65;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}.s1f8rwx6::before{content:'';display:block;border-radius:0.625rem;background-color:var(--plasma-sheet-handle-background-color);height:0.25rem;}
3
+ .s1cdpbaw{width:4rem;padding:1.75rem 0;margin:-1.5rem 0;opacity:0.65;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}.s1cdpbaw::before{content:'';display:block;border-radius:0.625rem;background-color:var(--plasma-sheet-handle-background-color);height:0.25rem;}
4
+ .sjx120m{border-radius:1.5rem 1.5rem 0 0;background-color:var(--plasma-sheet-content-background-color);padding-left:1rem;padding-right:1rem;padding-top:var(--sjx120m-0);padding-bottom:var(--sjx120m-1);max-height:100%;overflow:auto;overscroll-behavior:contain;}.sjx120m::-webkit-scrollbar{display:none;}
5
+ .s1f8rwx6{width:100%;z-index:1;padding-top:1rem;position:var(--s1f8rwx6-0);top:var(--s1f8rwx6-1);background-color:var(--s1f8rwx6-2);}
6
+
7
+ .s1jdcq0t{width:100%;z-index:1;padding-bottom:1rem;position:var(--s1jdcq0t-0);bottom:var(--s1jdcq0t-1);background-color:var(--s1jdcq0t-2);}
@@ -6,7 +6,8 @@ var classes = {
6
6
  isClosed: 'is-closed'
7
7
  };
8
8
  var tokens = {
9
- overlayBackgroundColor: '--plasma-sheet-overlay-background-color',
9
+ sheetOverlayColor: '--plasma-sheet-overlay-color',
10
+ sheetOverlayWithBlurColor: '--plasma-sheet-overlay-with-blur-color',
10
11
  contentBackgroundColor: '--plasma-sheet-content-background-color',
11
12
  handleColor: '--plasma-sheet-handle-background-color'
12
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.tokens.js","sources":["../../../src/components/Sheet/Sheet.tokens.ts"],"sourcesContent":["export const classes = {\n isClosed: 'is-closed',\n};\n\nexport const tokens = {\n overlayBackgroundColor: '--plasma-sheet-overlay-background-color',\n\n contentBackgroundColor: '--plasma-sheet-content-background-color',\n\n handleColor: '--plasma-sheet-handle-background-color',\n};\n"],"names":["classes","isClosed","tokens","overlayBackgroundColor","contentBackgroundColor","handleColor"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,QAAQ,EAAE,WAAA;AACd,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,sBAAsB,EAAE,yCAAyC;AAEjEC,EAAAA,sBAAsB,EAAE,yCAAyC;AAEjEC,EAAAA,WAAW,EAAE,wCAAA;AACjB;;;;;"}
1
+ {"version":3,"file":"Sheet.tokens.js","sources":["../../../src/components/Sheet/Sheet.tokens.ts"],"sourcesContent":["export const classes = {\n isClosed: 'is-closed',\n};\n\nexport const tokens = {\n sheetOverlayColor: '--plasma-sheet-overlay-color',\n sheetOverlayWithBlurColor: '--plasma-sheet-overlay-with-blur-color',\n\n contentBackgroundColor: '--plasma-sheet-content-background-color',\n\n handleColor: '--plasma-sheet-handle-background-color',\n};\n"],"names":["classes","isClosed","tokens","sheetOverlayColor","sheetOverlayWithBlurColor","contentBackgroundColor","handleColor"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,QAAQ,EAAE,WAAA;AACd,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,iBAAiB,EAAE,8BAA8B;AACjDC,EAAAA,yBAAyB,EAAE,wCAAwC;AAEnEC,EAAAA,sBAAsB,EAAE,yCAAyC;AAEjEC,EAAAA,WAAW,EAAE,wCAAA;AACjB;;;;;"}
@@ -4,9 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var handleTransition = function handleTransition(transition) {
6
6
  return function (props) {
7
- var lowPerformance = props.theme.lowPerformance,
8
- withTransition = props.withTransition;
9
- return !withTransition || lowPerformance ? 'unset' : transition;
7
+ var withTransition = props.withTransition;
8
+ return !withTransition ? 'unset' : transition;
10
9
  };
11
10
  };
12
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"handleTransition.js","sources":["../../../../src/components/Sheet/utils/handleTransition.ts"],"sourcesContent":["import { CommonProps } from '../Sheet.types';\n\ntype HandleTransitionProps = Omit<CommonProps, 'isOpen'>;\n\nexport const handleTransition = (transition: string) => (props: HandleTransitionProps): string => {\n const {\n theme: { lowPerformance },\n withTransition,\n } = props;\n\n return !withTransition || lowPerformance ? 'unset' : transition;\n};\n"],"names":["handleTransition","transition","props","lowPerformance","theme","withTransition"],"mappings":";;;;IAIaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,UAAkB,EAAA;EAAA,OAAK,UAACC,KAA4B,EAAa;AAC9F,IAAA,IACaC,cAAc,GAEvBD,KAAK,CAFLE,KAAK,CAAID,cAAc;MACvBE,cAAc,GACdH,KAAK,CADLG,cAAc,CAAA;AAGlB,IAAA,OAAO,CAACA,cAAc,IAAIF,cAAc,GAAG,OAAO,GAAGF,UAAU,CAAA;GAClE,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"handleTransition.js","sources":["../../../../src/components/Sheet/utils/handleTransition.ts"],"sourcesContent":["import { CommonProps } from '../Sheet.types';\n\ntype HandleTransitionProps = Omit<CommonProps, 'isOpen'>;\n\nexport const handleTransition = (transition: string) => (props: HandleTransitionProps): string => {\n const { withTransition } = props;\n\n return !withTransition ? 'unset' : transition;\n};\n"],"names":["handleTransition","transition","props","withTransition"],"mappings":";;;;IAIaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,UAAkB,EAAA;EAAA,OAAK,UAACC,KAA4B,EAAa;AAC9F,IAAA,IAAQC,cAAc,GAAKD,KAAK,CAAxBC,cAAc,CAAA;AAEtB,IAAA,OAAO,CAACA,cAAc,GAAG,OAAO,GAAGF,UAAU,CAAA;GAChD,CAAA;AAAA;;;;"}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DEFAULT_Z_INDEX = '0';
6
+
7
+ exports.DEFAULT_Z_INDEX = DEFAULT_Z_INDEX;
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Sheet/utils/index.ts"],"sourcesContent":["export { handleTransition } from './handleTransition';\n\nexport const DEFAULT_Z_INDEX = '0';\n"],"names":["DEFAULT_Z_INDEX"],"mappings":";;;;AAEO,IAAMA,eAAe,GAAG;;;;"}
package/cjs/index.css CHANGED
@@ -538,11 +538,13 @@
538
538
 
539
539
  .ToolbarDivider_styles_1ypqhb1_mcdkovg__81732880{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;--plasma-divider-background:var(--plasma-toolbar-divider-color);--plasma-divider-border-radius:var(--plasma-toolbar-divider-border-radius);}
540
540
 
541
- .Sheet_styles_1bm46e7_sah7qw3__a2bd4ee6{position:fixed;top:0;bottom:0;left:0;right:0;opacity:1;-webkit-transition:var(--sah7qw3-0);transition:var(--sah7qw3-0);z-index:1000;}.Sheet_styles_1bm46e7_sah7qw3__a2bd4ee6.Sheet_styles_1bm46e7_isClosed__a2bd4ee6{opacity:0;visibility:hidden;}
542
- .Sheet_styles_1bm46e7_shg69gz__a2bd4ee6{position:absolute;left:0;bottom:0;width:100%;max-height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-transition:var(--shg69gz-0);transition:var(--shg69gz-0);}.Sheet_styles_1bm46e7_shg69gz__a2bd4ee6.Sheet_styles_1bm46e7_isClosed__a2bd4ee6{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}
543
- .Sheet_styles_1bm46e7_s1cdpbaw__a2bd4ee6{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--s1cdpbaw-0);}
544
- .Sheet_styles_1bm46e7_sjx120m__a2bd4ee6{border-radius:1.5rem 1.5rem 0 0;background-color:var(--plasma-sheet-content-background-color);padding:1rem;max-height:100%;overflow:auto;overscroll-behavior:contain;}.Sheet_styles_1bm46e7_sjx120m__a2bd4ee6::-webkit-scrollbar{display:none;}
545
- .Sheet_styles_1bm46e7_s1f8rwx6__a2bd4ee6{width:4rem;padding:1.75rem 0;margin:-1.5rem 0;opacity:0.65;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}.Sheet_styles_1bm46e7_s1f8rwx6__a2bd4ee6::before{content:'';display:block;border-radius:0.625rem;background-color:var(--plasma-sheet-handle-background-color);height:0.25rem;}
541
+ .Sheet_styles_kdjr5m_sah7qw3__875343fb{position:fixed;top:0;bottom:0;left:0;right:0;opacity:1;-webkit-transition:var(--sah7qw3-0);transition:var(--sah7qw3-0);z-index:1000;}.Sheet_styles_kdjr5m_sah7qw3__875343fb.Sheet_styles_kdjr5m_isClosed__875343fb{opacity:0;visibility:hidden;}
542
+ .Sheet_styles_kdjr5m_shg69gz__875343fb{position:absolute;left:0;bottom:0;width:100%;max-height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-transition:var(--shg69gz-0);transition:var(--shg69gz-0);}.Sheet_styles_kdjr5m_shg69gz__875343fb.Sheet_styles_kdjr5m_isClosed__875343fb{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}
543
+ .Sheet_styles_kdjr5m_s1cdpbaw__875343fb{width:4rem;padding:1.75rem 0;margin:-1.5rem 0;opacity:0.65;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}.Sheet_styles_kdjr5m_s1cdpbaw__875343fb::before{content:'';display:block;border-radius:0.625rem;background-color:var(--plasma-sheet-handle-background-color);height:0.25rem;}
544
+ .Sheet_styles_kdjr5m_sjx120m__875343fb{border-radius:1.5rem 1.5rem 0 0;background-color:var(--plasma-sheet-content-background-color);padding-left:1rem;padding-right:1rem;padding-top:var(--sjx120m-0);padding-bottom:var(--sjx120m-1);max-height:100%;overflow:auto;overscroll-behavior:contain;}.Sheet_styles_kdjr5m_sjx120m__875343fb::-webkit-scrollbar{display:none;}
545
+ .Sheet_styles_kdjr5m_s1f8rwx6__875343fb{width:100%;z-index:1;padding-top:1rem;position:var(--s1f8rwx6-0);top:var(--s1f8rwx6-1);background-color:var(--s1f8rwx6-2);}
546
+
547
+ .Sheet_styles_kdjr5m_s1jdcq0t__875343fb{width:100%;z-index:1;padding-bottom:1rem;position:var(--s1jdcq0t-0);bottom:var(--s1jdcq0t-1);background-color:var(--s1jdcq0t-2);}
546
548
 
547
549
  .SliderBase_styles_7is2ll_s33crq1__0c0959e2{-webkit-flex:1;-ms-flex:1;flex:1;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:var(--plasma-slider-height);}
548
550
  .SliderBase_styles_7is2ll_rnaoqfb__0c0959e2{height:100%;}
@@ -1,5 +1,9 @@
1
- .Sheet_styles_1bm46e7_sah7qw3__a2bd4ee6{position:fixed;top:0;bottom:0;left:0;right:0;opacity:1;-webkit-transition:var(--sah7qw3-0);transition:var(--sah7qw3-0);z-index:1000;}.Sheet_styles_1bm46e7_sah7qw3__a2bd4ee6.Sheet_styles_1bm46e7_isClosed__a2bd4ee6{opacity:0;visibility:hidden;}
2
- .Sheet_styles_1bm46e7_shg69gz__a2bd4ee6{position:absolute;left:0;bottom:0;width:100%;max-height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-transition:var(--shg69gz-0);transition:var(--shg69gz-0);}.Sheet_styles_1bm46e7_shg69gz__a2bd4ee6.Sheet_styles_1bm46e7_isClosed__a2bd4ee6{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}
3
- .Sheet_styles_1bm46e7_s1cdpbaw__a2bd4ee6{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--s1cdpbaw-0);}
4
- .Sheet_styles_1bm46e7_sjx120m__a2bd4ee6{border-radius:1.5rem 1.5rem 0 0;background-color:var(--plasma-sheet-content-background-color);padding:1rem;max-height:100%;overflow:auto;overscroll-behavior:contain;}.Sheet_styles_1bm46e7_sjx120m__a2bd4ee6::-webkit-scrollbar{display:none;}
5
- .Sheet_styles_1bm46e7_s1f8rwx6__a2bd4ee6{width:4rem;padding:1.75rem 0;margin:-1.5rem 0;opacity:0.65;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}.Sheet_styles_1bm46e7_s1f8rwx6__a2bd4ee6::before{content:'';display:block;border-radius:0.625rem;background-color:var(--plasma-sheet-handle-background-color);height:0.25rem;}
1
+ .Overlay_styles_cxej3y_s1afr8la__70d4dd9a{position:fixed;inset:0;z-index:var(--s1afr8la-0);--plasma_private-overlay-background-color:var(--s1afr8la-1);--plasma_private-overlay-backdrop-filter:var(--s1afr8la-2);background:var(--s1afr8la-3);-webkit-backdrop-filter:var(--s1afr8la-4);backdrop-filter:var(--s1afr8la-4);cursor:var(--s1afr8la-5);}
2
+
3
+ .Sheet_styles_kdjr5m_sah7qw3__875343fb{position:fixed;top:0;bottom:0;left:0;right:0;opacity:1;-webkit-transition:var(--sah7qw3-0);transition:var(--sah7qw3-0);z-index:1000;}.Sheet_styles_kdjr5m_sah7qw3__875343fb.Sheet_styles_kdjr5m_isClosed__875343fb{opacity:0;visibility:hidden;}
4
+ .Sheet_styles_kdjr5m_shg69gz__875343fb{position:absolute;left:0;bottom:0;width:100%;max-height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-transition:var(--shg69gz-0);transition:var(--shg69gz-0);}.Sheet_styles_kdjr5m_shg69gz__875343fb.Sheet_styles_kdjr5m_isClosed__875343fb{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}
5
+ .Sheet_styles_kdjr5m_s1cdpbaw__875343fb{width:4rem;padding:1.75rem 0;margin:-1.5rem 0;opacity:0.65;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}.Sheet_styles_kdjr5m_s1cdpbaw__875343fb::before{content:'';display:block;border-radius:0.625rem;background-color:var(--plasma-sheet-handle-background-color);height:0.25rem;}
6
+ .Sheet_styles_kdjr5m_sjx120m__875343fb{border-radius:1.5rem 1.5rem 0 0;background-color:var(--plasma-sheet-content-background-color);padding-left:1rem;padding-right:1rem;padding-top:var(--sjx120m-0);padding-bottom:var(--sjx120m-1);max-height:100%;overflow:auto;overscroll-behavior:contain;}.Sheet_styles_kdjr5m_sjx120m__875343fb::-webkit-scrollbar{display:none;}
7
+ .Sheet_styles_kdjr5m_s1f8rwx6__875343fb{width:100%;z-index:1;padding-top:1rem;position:var(--s1f8rwx6-0);top:var(--s1f8rwx6-1);background-color:var(--s1f8rwx6-2);}
8
+
9
+ .Sheet_styles_kdjr5m_s1jdcq0t__875343fb{width:100%;z-index:1;padding-bottom:1rem;position:var(--s1jdcq0t-0);bottom:var(--s1jdcq0t-1);background-color:var(--s1jdcq0t-2);}
@@ -1,16 +1,18 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { cx } from '../../utils/index.js';
4
- import { useThemeContext } from './hooks/useThemeContext.js';
4
+ import { Overlay } from '../Overlay/Overlay.js';
5
5
  import { useSheetSwipe } from './hooks/useSheetSwipe.js';
6
6
  import { useSheet } from './hooks/useSheet.js';
7
- import { classes } from './Sheet.tokens.js';
8
- import { StyledWrapper, StyledContentWrapper, StyledSheetHandle, StyledSheetContent, StyledOverlay } from './Sheet.styles.js';
7
+ import { classes, tokens } from './Sheet.tokens.js';
8
+ import { StyledWrapper, StyledContentWrapper, StyledSheetHandle, StyledSheetContent, StyledSheetHeader, StyledSheetBody, StyledSheetFooter } from './Sheet.styles.js';
9
9
  import { base } from './variations/_view/base.js';
10
+ import { DEFAULT_Z_INDEX } from './utils/index.js';
10
11
 
11
- var _excluded = ["isOpen", "children", "onClose", "withOverlay", "withTransition", "throttleMs", "className", "view"];
12
+ var _excluded = ["isOpen", "children", "onClose", "hasHandle", "contentHeader", "isHeaderFixed", "contentFooter", "isFooterFixed", "withOverlay", "withBlur", "withTransition", "throttleMs", "className", "view"];
12
13
 
13
14
  /**
15
+ * Sheet
14
16
  * Открывает окно-шторку поверх основного экрана.
15
17
  */
16
18
 
@@ -19,8 +21,18 @@ var sheetRoot = function sheetRoot(Root) {
19
21
  var isOpen = _ref.isOpen,
20
22
  children = _ref.children,
21
23
  onClose = _ref.onClose,
24
+ _ref$hasHandle = _ref.hasHandle,
25
+ hasHandle = _ref$hasHandle === void 0 ? true : _ref$hasHandle,
26
+ contentHeader = _ref.contentHeader,
27
+ _ref$isHeaderFixed = _ref.isHeaderFixed,
28
+ isHeaderFixed = _ref$isHeaderFixed === void 0 ? false : _ref$isHeaderFixed,
29
+ contentFooter = _ref.contentFooter,
30
+ _ref$isFooterFixed = _ref.isFooterFixed,
31
+ isFooterFixed = _ref$isFooterFixed === void 0 ? false : _ref$isFooterFixed,
22
32
  _ref$withOverlay = _ref.withOverlay,
23
33
  withOverlay = _ref$withOverlay === void 0 ? true : _ref$withOverlay,
34
+ _ref$withBlur = _ref.withBlur,
35
+ withBlur = _ref$withBlur === void 0 ? false : _ref$withBlur,
24
36
  _ref$withTransition = _ref.withTransition,
25
37
  withTransition = _ref$withTransition === void 0 ? true : _ref$withTransition,
26
38
  throttleMs = _ref.throttleMs,
@@ -30,7 +42,6 @@ var sheetRoot = function sheetRoot(Root) {
30
42
  var contentWrapperRef = React.useRef(null);
31
43
  var contentRef = React.useRef(null);
32
44
  var handleRef = React.useRef(null);
33
- var theme = useThemeContext();
34
45
  useSheet({
35
46
  isOpen: isOpen
36
47
  });
@@ -41,9 +52,11 @@ var sheetRoot = function sheetRoot(Root) {
41
52
  throttleMs: throttleMs,
42
53
  onClose: onClose
43
54
  });
55
+ var hasHeader = !!contentHeader;
56
+ var hasFooter = !!contentFooter;
44
57
  var isClosedClass = isOpen ? undefined : "".concat(classes.isClosed);
58
+ var overlayBackgroundToken = withBlur ? "var(".concat(tokens.sheetOverlayWithBlurColor, ")") : "var(".concat(tokens.sheetOverlayColor, ")");
45
59
  return /*#__PURE__*/React.createElement(StyledWrapper, _extends({
46
- theme: theme,
47
60
  isOpen: isOpen,
48
61
  withTransition: withTransition,
49
62
  className: cx(isClosedClass, className)
@@ -53,17 +66,25 @@ var sheetRoot = function sheetRoot(Root) {
53
66
  view: view,
54
67
  ref: rootRef
55
68
  }, /*#__PURE__*/React.createElement(StyledContentWrapper, {
56
- theme: theme,
57
69
  isOpen: isOpen,
58
70
  withTransition: withTransition,
59
71
  ref: contentWrapperRef
60
- }, /*#__PURE__*/React.createElement(StyledSheetHandle, {
72
+ }, hasHandle && /*#__PURE__*/React.createElement(StyledSheetHandle, {
61
73
  ref: handleRef
62
74
  }), /*#__PURE__*/React.createElement(StyledSheetContent, {
75
+ hasHeader: hasHeader,
76
+ hasFooter: hasFooter,
63
77
  ref: contentRef
64
- }, children)), /*#__PURE__*/React.createElement(StyledOverlay, {
65
- withOverlay: withOverlay,
66
- onClick: onClose
78
+ }, hasHeader && /*#__PURE__*/React.createElement(StyledSheetHeader, {
79
+ isHeaderFixed: isHeaderFixed
80
+ }, contentHeader), /*#__PURE__*/React.createElement(StyledSheetBody, null, children), hasFooter && /*#__PURE__*/React.createElement(StyledSheetFooter, {
81
+ isFooterFixed: isFooterFixed
82
+ }, contentFooter))), withOverlay && /*#__PURE__*/React.createElement(Overlay, {
83
+ zIndex: DEFAULT_Z_INDEX,
84
+ backgroundColorProperty: overlayBackgroundToken,
85
+ withBlur: withBlur,
86
+ isClickable: true,
87
+ onOverlayClick: onClose
67
88
  })));
68
89
  });
69
90
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.js","sources":["../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { cx } from '../../utils';\nimport { RootProps } from '../../engines';\n\nimport { SheetProps } from './Sheet.types';\nimport { useSheet, useSheetSwipe, useThemeContext } from './hooks';\nimport { classes } from './Sheet.tokens';\nimport {\n StyledContentWrapper,\n StyledOverlay,\n StyledSheetContent,\n StyledSheetHandle,\n StyledWrapper,\n} from './Sheet.styles';\nimport { base as viewCSS } from './variations/_view/base';\n\n/**\n * Открывает окно-шторку поверх основного экрана.\n */\n\nexport const sheetRoot = (Root: RootProps<HTMLDivElement, SheetProps>) =>\n forwardRef<HTMLDivElement, SheetProps>(\n (\n {\n isOpen,\n children,\n onClose,\n withOverlay = true,\n withTransition = true,\n throttleMs,\n className,\n view,\n ...restProps\n },\n rootRef,\n ) => {\n const contentWrapperRef = React.useRef<HTMLDivElement>(null);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const handleRef = React.useRef<HTMLDivElement>(null);\n\n const theme = useThemeContext();\n\n useSheet({ isOpen });\n useSheetSwipe({ contentWrapperRef, contentRef, handleRef, throttleMs, onClose });\n\n const isClosedClass = isOpen ? undefined : `${classes.isClosed}`;\n\n return (\n <StyledWrapper\n theme={theme}\n isOpen={isOpen}\n withTransition={withTransition}\n className={cx(isClosedClass, className)}\n {...restProps}\n >\n <Root isOpen={isOpen} onClose={onClose} view={view} ref={rootRef}>\n <StyledContentWrapper\n theme={theme}\n isOpen={isOpen}\n withTransition={withTransition}\n ref={contentWrapperRef}\n >\n <StyledSheetHandle ref={handleRef} />\n <StyledSheetContent ref={contentRef}>{children}</StyledSheetContent>\n </StyledContentWrapper>\n <StyledOverlay withOverlay={withOverlay} onClick={onClose} />\n </Root>\n </StyledWrapper>\n );\n },\n );\n\nexport const sheetConfig = {\n name: 'Sheet',\n tag: 'div',\n layout: sheetRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'default',\n },\n};\n"],"names":["sheetRoot","Root","forwardRef","_ref","rootRef","isOpen","children","onClose","_ref$withOverlay","withOverlay","_ref$withTransition","withTransition","throttleMs","className","view","restProps","_objectWithoutProperties","_excluded","contentWrapperRef","React","useRef","contentRef","handleRef","theme","useThemeContext","useSheet","useSheetSwipe","isClosedClass","undefined","concat","classes","isClosed","createElement","StyledWrapper","_extends","cx","ref","StyledContentWrapper","StyledSheetHandle","StyledSheetContent","StyledOverlay","onClick","sheetConfig","name","tag","layout","base","variations","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;AAiBA;AACA;AACA;;IAEaA,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAA2C,EAAA;AAAA,EAAA,oBACjEC,UAAU,CACN,UAAAC,IAAA,EAYIC,OAAO,EACN;AAAA,IAAA,IAXGC,MAAM,GAAAF,IAAA,CAANE,MAAM;MACNC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;MACRC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;MAAAC,gBAAA,GAAAL,IAAA,CACPM,WAAW;AAAXA,MAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,gBAAA;MAAAE,mBAAA,GAAAP,IAAA,CAClBQ,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;MACrBE,UAAU,GAAAT,IAAA,CAAVS,UAAU;MACVC,SAAS,GAAAV,IAAA,CAATU,SAAS;MACTC,IAAI,GAAAX,IAAA,CAAJW,IAAI;AACDC,MAAAA,SAAS,GAAAC,wBAAA,CAAAb,IAAA,EAAAc,SAAA,CAAA,CAAA;AAIhB,IAAA,IAAMC,iBAAiB,GAAGC,KAAK,CAACC,MAAM,CAAiB,IAAI,CAAC,CAAA;AAC5D,I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Ae;AAC/ByB,MAAAA,GAAG,EAAElB,iBAAAA;AAAkB,KAAA,eAEvBC,KAAA,CAAAa,aAAA,CAACM,iBAAiB,EAAA;AAACF,MAAAA,GAAG,EAAEd,SAAAA;AAAU,KAAE,CAAC,eACrCH,KAAA,CAAAa,aAAA,CAACO,kBAAkB,EAAA;AAACH,MAAAA,GAAG,EAAEf,UAAAA;KAAaf,EAAAA,QAA6B,CACjD,CAAC,eACvBa,KAAA,CAAAa,aAAA,CAACQ,aAAa,EAAA;AAAC/B,MAAAA,WAAW,EAAEA,WAAY;AAACgC,MAAAA,OAAO,EAAElC,OAAAA;KAAU,CAC1D,CACK,CAAC,CAAA;AAExB,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMmC,WAAW,GAAG;AACvBC,EAAAA,IAAI,EAAE,OAAO;AACbC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7C,SAAS;AACjB8C,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRjC,IAAAA,IAAI,EAAE;AACFkC,MAAAA,GAAG,EAAEC,IAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNpC,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
1
+ {"version":3,"file":"Sheet.js","sources":["../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { cx } from '../../utils';\nimport { RootProps } from '../../engines';\nimport { Overlay } from '../Overlay';\n\nimport { SheetProps } from './Sheet.types';\nimport { useSheet, useSheetSwipe } from './hooks';\nimport { classes, tokens } from './Sheet.tokens';\nimport {\n StyledContentWrapper,\n StyledSheetBody,\n StyledSheetContent,\n StyledSheetFooter,\n StyledSheetHandle,\n StyledSheetHeader,\n StyledWrapper,\n} from './Sheet.styles';\nimport { base as viewCSS } from './variations/_view/base';\nimport { DEFAULT_Z_INDEX } from './utils';\n\n/**\n * Sheet\n * Открывает окно-шторку поверх основного экрана.\n */\n\nexport const sheetRoot = (Root: RootProps<HTMLDivElement, SheetProps>) =>\n forwardRef<HTMLDivElement, SheetProps>(\n (\n {\n isOpen,\n children,\n onClose,\n hasHandle = true,\n contentHeader,\n isHeaderFixed = false,\n contentFooter,\n isFooterFixed = false,\n withOverlay = true,\n withBlur = false,\n withTransition = true,\n throttleMs,\n className,\n view,\n ...restProps\n },\n rootRef,\n ) => {\n const contentWrapperRef = React.useRef<HTMLDivElement>(null);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const handleRef = React.useRef<HTMLDivElement>(null);\n\n useSheet({ isOpen });\n useSheetSwipe({ contentWrapperRef, contentRef, handleRef, throttleMs, onClose });\n\n const hasHeader = !!contentHeader;\n const hasFooter = !!contentFooter;\n\n const isClosedClass = isOpen ? undefined : `${classes.isClosed}`;\n\n const overlayBackgroundToken = withBlur\n ? `var(${tokens.sheetOverlayWithBlurColor})`\n : `var(${tokens.sheetOverlayColor})`;\n\n return (\n <StyledWrapper\n isOpen={isOpen}\n withTransition={withTransition}\n className={cx(isClosedClass, className)}\n {...restProps}\n >\n <Root isOpen={isOpen} onClose={onClose} view={view} ref={rootRef}>\n <StyledContentWrapper isOpen={isOpen} withTransition={withTransition} ref={contentWrapperRef}>\n {hasHandle && <StyledSheetHandle ref={handleRef} />}\n <StyledSheetContent hasHeader={hasHeader} hasFooter={hasFooter} ref={contentRef}>\n {hasHeader && (\n <StyledSheetHeader isHeaderFixed={isHeaderFixed}>{contentHeader}</StyledSheetHeader>\n )}\n <StyledSheetBody>{children}</StyledSheetBody>\n {hasFooter && (\n <StyledSheetFooter isFooterFixed={isFooterFixed}>{contentFooter}</StyledSheetFooter>\n )}\n </StyledSheetContent>\n </StyledContentWrapper>\n {withOverlay && (\n <Overlay\n zIndex={DEFAULT_Z_INDEX}\n backgroundColorProperty={overlayBackgroundToken}\n withBlur={withBlur}\n isClickable\n onOverlayClick={onClose}\n />\n )}\n </Root>\n </StyledWrapper>\n );\n },\n );\n\nexport const sheetConfig = {\n name: 'Sheet',\n tag: 'div',\n layout: sheetRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'default',\n },\n};\n"],"names":["sheetRoot","Root","forwardRef","_ref","rootRef","isOpen","children","onClose","_ref$hasHandle","hasHandle","contentHeader","_ref$isHeaderFixed","isHeaderFixed","contentFooter","_ref$isFooterFixed","isFooterFixed","_ref$withOverlay","withOverlay","_ref$withBlur","withBlur","_ref$withTransition","withTransition","throttleMs","className","view","restProps","_objectWithoutProperties","_excluded","contentWrapperRef","React","useRef","contentRef","handleRef","useSheet","useSheetSwipe","hasHeader","hasFooter","isClosedClass","undefined","concat","classes","isClosed","overlayBackgroundToken","tokens","sheetOverlayWithBlurColor","sheetOverlayColor","createElement","StyledWrapper","_extends","cx","ref","StyledContentWrapper","StyledSheetHandle","StyledSheetContent","StyledSheetHeader","StyledSheetBody","StyledSheetFooter","Overlay","zIndex","DEFAULT_Z_INDEX","backgroundColorProperty","isClickable","onOverlayClick","sheetConfig","name","tag","layout","base","variations","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;AAqBA;AACA;AACA;AACA;;IAEaA,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAA2C,EAAA;AAAA,EAAA,oBACjEC,UAAU,CACN,UAAAC,IAAA,EAkBIC,OAAO,EACN;AAAA,IAAA,IAjBGC,MAAM,GAAAF,IAAA,CAANE,MAAM;MACNC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;MACRC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;MAAAC,cAAA,GAAAL,IAAA,CACPM,SAAS;AAATA,MAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,cAAA;MAChBE,aAAa,GAAAP,IAAA,CAAbO,aAAa;MAAAC,kBAAA,GAAAR,IAAA,CACbS,aAAa;AAAbA,MAAAA,aAAa,GAAAD,kBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,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