@salutejs/plasma-new-hope 0.88.0-canary.1223.9316788273.0 → 0.88.0-canary.1225.9347054103.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Sheet/Sheet.css +5 -0
- package/cjs/components/Sheet/Sheet.js +91 -0
- package/cjs/components/Sheet/Sheet.js.map +1 -0
- package/cjs/components/Sheet/Sheet.styles.js +62 -0
- package/cjs/components/Sheet/Sheet.styles.js.map +1 -0
- package/cjs/components/Sheet/Sheet.styles_1bm46e7.css +5 -0
- package/cjs/components/Sheet/Sheet.tokens.js +16 -0
- package/cjs/components/Sheet/Sheet.tokens.js.map +1 -0
- package/cjs/components/Sheet/hooks/useSheet.js +26 -0
- package/cjs/components/Sheet/hooks/useSheet.js.map +1 -0
- package/cjs/components/Sheet/hooks/useSheetSwipe.js +98 -0
- package/cjs/components/Sheet/hooks/useSheetSwipe.js.map +1 -0
- package/cjs/components/Sheet/hooks/useThemeContext.js +17 -0
- package/cjs/components/Sheet/hooks/useThemeContext.js.map +1 -0
- package/cjs/components/Sheet/utils/handleTransition.js +14 -0
- package/cjs/components/Sheet/utils/handleTransition.js.map +1 -0
- package/cjs/components/{Accordion/variations/_size → Sheet/variations/_view}/base.js +1 -1
- package/cjs/components/Sheet/variations/_view/base.js.map +1 -0
- package/cjs/index.css +6 -2
- package/cjs/index.js +6 -8
- package/cjs/index.js.map +1 -1
- package/es/components/Sheet/Sheet.css +5 -0
- package/es/components/Sheet/Sheet.js +86 -0
- package/es/components/Sheet/Sheet.js.map +1 -0
- package/es/components/Sheet/Sheet.styles.js +54 -0
- package/es/components/Sheet/Sheet.styles.js.map +1 -0
- package/es/components/Sheet/Sheet.styles_1bm46e7.css +5 -0
- package/es/components/Sheet/Sheet.tokens.js +11 -0
- package/es/components/Sheet/Sheet.tokens.js.map +1 -0
- package/es/components/Sheet/hooks/useSheet.js +22 -0
- package/es/components/Sheet/hooks/useSheet.js.map +1 -0
- package/es/components/Sheet/hooks/useSheetSwipe.js +94 -0
- package/es/components/Sheet/hooks/useSheetSwipe.js.map +1 -0
- package/es/components/Sheet/hooks/useThemeContext.js +13 -0
- package/es/components/Sheet/hooks/useThemeContext.js.map +1 -0
- package/es/components/Sheet/utils/handleTransition.js +10 -0
- package/es/components/Sheet/utils/handleTransition.js.map +1 -0
- package/es/components/{Accordion → Sheet}/variations/_view/base.js +1 -1
- package/es/components/Sheet/variations/_view/base.js.map +1 -0
- package/es/index.css +6 -2
- package/es/index.js +2 -3
- package/es/index.js.map +1 -1
- package/package.json +4 -2
- package/styled-components/cjs/components/Sheet/Sheet.js +90 -0
- package/styled-components/cjs/components/Sheet/Sheet.styles.js +28 -0
- package/styled-components/cjs/components/Sheet/Sheet.tokens.js +14 -0
- package/styled-components/cjs/components/Sheet/hooks/index.js +26 -0
- package/styled-components/cjs/components/Sheet/hooks/useSheet.js +24 -0
- package/styled-components/cjs/components/Sheet/hooks/useSheetSwipe.js +102 -0
- package/styled-components/cjs/components/Sheet/hooks/useThemeContext.js +15 -0
- package/styled-components/cjs/components/Sheet/index.js +31 -0
- package/styled-components/cjs/components/Sheet/utils/handleTransition.js +13 -0
- package/styled-components/cjs/components/Sheet/utils/index.js +12 -0
- package/styled-components/cjs/components/Sheet/variations/_view/tokens.json +3 -0
- package/styled-components/cjs/components/_Icon/index.js +1 -15
- package/styled-components/cjs/examples/plasma_b2c/components/Sheet/Sheet.config.js +18 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Sheet/Sheet.js +17 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Sheet/Sheet.stories.tsx +239 -0
- package/styled-components/cjs/examples/plasma_web/components/Sheet/Sheet.config.js +18 -0
- package/styled-components/cjs/examples/plasma_web/components/Sheet/Sheet.js +17 -0
- package/styled-components/cjs/examples/plasma_web/components/Sheet/Sheet.stories.tsx +239 -0
- package/styled-components/cjs/index.js +11 -11
- package/styled-components/es/components/Sheet/Sheet.js +82 -0
- package/styled-components/es/components/Sheet/Sheet.styles.js +21 -0
- package/styled-components/es/components/Sheet/Sheet.tokens.js +8 -0
- package/styled-components/es/components/Sheet/hooks/index.js +3 -0
- package/styled-components/es/components/Sheet/hooks/useSheet.js +18 -0
- package/styled-components/es/components/Sheet/hooks/useSheetSwipe.js +95 -0
- package/styled-components/es/components/Sheet/hooks/useThemeContext.js +9 -0
- package/styled-components/es/components/Sheet/index.js +2 -0
- package/styled-components/es/components/Sheet/utils/handleTransition.js +7 -0
- package/styled-components/es/components/Sheet/utils/index.js +1 -0
- package/styled-components/es/components/Sheet/variations/_view/tokens.json +3 -0
- package/styled-components/es/components/_Icon/index.js +1 -3
- package/styled-components/es/examples/plasma_b2c/components/Sheet/Sheet.config.js +12 -0
- package/styled-components/es/examples/plasma_b2c/components/Sheet/Sheet.js +6 -0
- package/styled-components/es/examples/plasma_b2c/components/Sheet/Sheet.stories.tsx +239 -0
- package/styled-components/es/examples/plasma_web/components/Sheet/Sheet.config.js +12 -0
- package/styled-components/es/examples/plasma_web/components/Sheet/Sheet.js +6 -0
- package/styled-components/es/examples/plasma_web/components/Sheet/Sheet.stories.tsx +239 -0
- package/styled-components/es/index.js +2 -2
- package/types/components/Sheet/Sheet.d.ts +22 -0
- package/types/components/Sheet/Sheet.d.ts.map +1 -0
- package/types/components/Sheet/Sheet.styles.d.ts +13 -0
- package/types/components/Sheet/Sheet.styles.d.ts.map +1 -0
- package/types/components/Sheet/Sheet.tokens.d.ts +9 -0
- package/types/components/Sheet/Sheet.tokens.d.ts.map +1 -0
- package/types/components/Sheet/Sheet.types.d.ts +35 -0
- package/types/components/Sheet/Sheet.types.d.ts.map +1 -0
- package/types/components/Sheet/hooks/index.d.ts +4 -0
- package/types/components/Sheet/hooks/index.d.ts.map +1 -0
- package/types/components/Sheet/hooks/useSheet.d.ts +3 -0
- package/types/components/Sheet/hooks/useSheet.d.ts.map +1 -0
- package/types/components/Sheet/hooks/useSheetSwipe.d.ts +9 -0
- package/types/components/Sheet/hooks/useSheetSwipe.d.ts.map +1 -0
- package/types/components/Sheet/hooks/useThemeContext.d.ts +7 -0
- package/types/components/Sheet/hooks/useThemeContext.d.ts.map +1 -0
- package/types/components/Sheet/index.d.ts +4 -0
- package/types/components/Sheet/index.d.ts.map +1 -0
- package/types/components/Sheet/utils/handleTransition.d.ts +5 -0
- package/types/components/Sheet/utils/handleTransition.d.ts.map +1 -0
- package/types/components/Sheet/utils/index.d.ts +2 -0
- package/types/components/Sheet/utils/index.d.ts.map +1 -0
- package/types/components/Sheet/variations/_view/base.d.ts.map +1 -0
- package/types/components/_Icon/index.d.ts +0 -2
- package/types/components/_Icon/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Sheet/Sheet.config.d.ts +11 -0
- package/types/examples/plasma_b2c/components/Sheet/Sheet.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Sheet/Sheet.d.ts +8 -0
- package/types/examples/plasma_b2c/components/Sheet/Sheet.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Sheet/Sheet.config.d.ts +11 -0
- package/types/examples/plasma_web/components/Sheet/Sheet.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Sheet/Sheet.d.ts +8 -0
- package/types/examples/plasma_web/components/Sheet/Sheet.d.ts.map +1 -0
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/cjs/components/Accordion/Accordion.css +0 -1
- package/cjs/components/Accordion/Accordion.js +0 -50
- package/cjs/components/Accordion/Accordion.js.map +0 -1
- package/cjs/components/Accordion/Accordion.styles.js +0 -9
- package/cjs/components/Accordion/Accordion.styles.js.map +0 -1
- package/cjs/components/Accordion/Accordion.styles_1mo1sxr.css +0 -1
- package/cjs/components/Accordion/Accordion.tokens.js +0 -45
- package/cjs/components/Accordion/Accordion.tokens.js.map +0 -1
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js +0 -93
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js.map +0 -1
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -63
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +0 -1
- package/cjs/components/Accordion/variations/_size/base.js.map +0 -1
- package/cjs/components/Accordion/variations/_view/base.js +0 -9
- package/cjs/components/Accordion/variations/_view/base.js.map +0 -1
- package/cjs/components/_Icon/Icon.assets/ChevronDownFill.js +0 -33
- package/cjs/components/_Icon/Icon.assets/ChevronDownFill.js.map +0 -1
- package/cjs/components/_Icon/Icon.assets/Minus.js +0 -22
- package/cjs/components/_Icon/Icon.assets/Minus.js.map +0 -1
- package/cjs/components/_Icon/Icons/IconChevronDownFill.js +0 -23
- package/cjs/components/_Icon/Icons/IconChevronDownFill.js.map +0 -1
- package/cjs/components/_Icon/Icons/IconMinus.js +0 -23
- package/cjs/components/_Icon/Icons/IconMinus.js.map +0 -1
- package/es/components/Accordion/Accordion.css +0 -1
- package/es/components/Accordion/Accordion.js +0 -45
- package/es/components/Accordion/Accordion.js.map +0 -1
- package/es/components/Accordion/Accordion.styles.js +0 -5
- package/es/components/Accordion/Accordion.styles.js.map +0 -1
- package/es/components/Accordion/Accordion.styles_1mo1sxr.css +0 -1
- package/es/components/Accordion/Accordion.tokens.js +0 -40
- package/es/components/Accordion/Accordion.tokens.js.map +0 -1
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.js +0 -89
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.js.map +0 -1
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -49
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +0 -1
- package/es/components/Accordion/variations/_size/base.js +0 -5
- package/es/components/Accordion/variations/_size/base.js.map +0 -1
- package/es/components/Accordion/variations/_size/base_x642ct.css +0 -1
- package/es/components/Accordion/variations/_view/base.js.map +0 -1
- package/es/components/Accordion/variations/_view/base_x642ct.css +0 -1
- package/es/components/_Icon/Icon.assets/ChevronDownFill.js +0 -29
- package/es/components/_Icon/Icon.assets/ChevronDownFill.js.map +0 -1
- package/es/components/_Icon/Icon.assets/Minus.js +0 -18
- package/es/components/_Icon/Icon.assets/Minus.js.map +0 -1
- package/es/components/_Icon/Icons/IconChevronDownFill.js +0 -19
- package/es/components/_Icon/Icons/IconChevronDownFill.js.map +0 -1
- package/es/components/_Icon/Icons/IconMinus.js +0 -19
- package/es/components/_Icon/Icons/IconMinus.js.map +0 -1
- package/styled-components/cjs/components/Accordion/Accordion.js +0 -50
- package/styled-components/cjs/components/Accordion/Accordion.styles.js +0 -9
- package/styled-components/cjs/components/Accordion/Accordion.tokens.js +0 -43
- package/styled-components/cjs/components/Accordion/index.js +0 -38
- package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js +0 -99
- package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -49
- package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.types.js +0 -5
- package/styled-components/cjs/components/Accordion/variations/_size/tokens.json +0 -6
- package/styled-components/cjs/components/Accordion/variations/_stretching/base.js +0 -8
- package/styled-components/cjs/components/Accordion/variations/_stretching/tokens.json +0 -1
- package/styled-components/cjs/components/Accordion/variations/_view/base.js +0 -8
- package/styled-components/cjs/components/Accordion/variations/_view/tokens.json +0 -8
- package/styled-components/cjs/components/_Icon/Icon.assets/ChevronDownFill.js +0 -32
- package/styled-components/cjs/components/_Icon/Icon.assets/Minus.js +0 -21
- package/styled-components/cjs/components/_Icon/Icons/IconChevronDownFill.js +0 -22
- package/styled-components/cjs/components/_Icon/Icons/IconMinus.js +0 -22
- package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.config.js +0 -30
- package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.js +0 -17
- package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.stories.tsx +0 -75
- package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.config.js +0 -30
- package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.js +0 -17
- package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.stories.tsx +0 -75
- package/styled-components/es/components/Accordion/Accordion.js +0 -41
- package/styled-components/es/components/Accordion/Accordion.styles.js +0 -3
- package/styled-components/es/components/Accordion/Accordion.tokens.js +0 -37
- package/styled-components/es/components/Accordion/index.js +0 -3
- package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.js +0 -90
- package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -42
- package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.types.js +0 -1
- package/styled-components/es/components/Accordion/variations/_size/tokens.json +0 -6
- package/styled-components/es/components/Accordion/variations/_stretching/base.js +0 -2
- package/styled-components/es/components/Accordion/variations/_stretching/tokens.json +0 -1
- package/styled-components/es/components/Accordion/variations/_view/base.js +0 -2
- package/styled-components/es/components/Accordion/variations/_view/tokens.json +0 -8
- package/styled-components/es/components/_Icon/Icon.assets/ChevronDownFill.js +0 -25
- package/styled-components/es/components/_Icon/Icon.assets/Minus.js +0 -14
- package/styled-components/es/components/_Icon/Icons/IconChevronDownFill.js +0 -15
- package/styled-components/es/components/_Icon/Icons/IconMinus.js +0 -15
- package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.config.js +0 -24
- package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.js +0 -6
- package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.stories.tsx +0 -75
- package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.config.js +0 -24
- package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.js +0 -6
- package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.stories.tsx +0 -75
- package/types/components/Accordion/Accordion.d.ts +0 -35
- package/types/components/Accordion/Accordion.d.ts.map +0 -1
- package/types/components/Accordion/Accordion.styles.d.ts +0 -2
- package/types/components/Accordion/Accordion.styles.d.ts.map +0 -1
- package/types/components/Accordion/Accordion.tokens.d.ts +0 -38
- package/types/components/Accordion/Accordion.tokens.d.ts.map +0 -1
- package/types/components/Accordion/Accordion.types.d.ts +0 -24
- package/types/components/Accordion/Accordion.types.d.ts.map +0 -1
- package/types/components/Accordion/index.d.ts +0 -5
- package/types/components/Accordion/index.d.ts.map +0 -1
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.d.ts +0 -4
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.d.ts.map +0 -1
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.styles.d.ts +0 -13
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.styles.d.ts.map +0 -1
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.types.d.ts +0 -43
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.types.d.ts.map +0 -1
- package/types/components/Accordion/variations/_size/base.d.ts.map +0 -1
- package/types/components/Accordion/variations/_stretching/base.d.ts +0 -2
- package/types/components/Accordion/variations/_stretching/base.d.ts.map +0 -1
- package/types/components/Accordion/variations/_view/base.d.ts +0 -2
- package/types/components/Accordion/variations/_view/base.d.ts.map +0 -1
- package/types/components/_Icon/Icon.assets/ChevronDownFill.d.ts +0 -4
- package/types/components/_Icon/Icon.assets/ChevronDownFill.d.ts.map +0 -1
- package/types/components/_Icon/Icon.assets/Minus.d.ts +0 -4
- package/types/components/_Icon/Icon.assets/Minus.d.ts.map +0 -1
- package/types/components/_Icon/Icons/IconChevronDownFill.d.ts +0 -4
- package/types/components/_Icon/Icons/IconChevronDownFill.d.ts.map +0 -1
- package/types/components/_Icon/Icons/IconMinus.d.ts +0 -4
- package/types/components/_Icon/Icons/IconMinus.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Accordion/Accordion.config.d.ts +0 -23
- package/types/examples/plasma_b2c/components/Accordion/Accordion.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Accordion/Accordion.d.ts +0 -26
- package/types/examples/plasma_b2c/components/Accordion/Accordion.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Accordion/Accordion.config.d.ts +0 -23
- package/types/examples/plasma_web/components/Accordion/Accordion.config.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Accordion/Accordion.d.ts +0 -26
- package/types/examples/plasma_web/components/Accordion/Accordion.d.ts.map +0 -1
- /package/cjs/components/{Accordion/variations/_size → Sheet/variations/_view}/base_x642ct.css +0 -0
- /package/cjs/components/{Accordion/ui/AccordionItem/AccordionItem.css → _Icon/Icons/IconClose.css} +0 -0
- /package/{cjs/components/Accordion → es/components/Sheet}/variations/_view/base_x642ct.css +0 -0
- /package/es/components/{Accordion/ui/AccordionItem/AccordionItem.css → _Icon/Icons/IconClose.css} +0 -0
- /package/styled-components/cjs/components/{Accordion/Accordion.types.js → Sheet/Sheet.types.js} +0 -0
- /package/styled-components/cjs/components/{Accordion/variations/_size → Sheet/variations/_view}/base.js +0 -0
- /package/styled-components/es/components/{Accordion/Accordion.types.js → Sheet/Sheet.types.js} +0 -0
- /package/styled-components/es/components/{Accordion/variations/_size → Sheet/variations/_view}/base.js +0 -0
- /package/types/components/{Accordion/variations/_size → Sheet/variations/_view}/base.d.ts +0 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
import './Sheet.styles_1bm46e7.css';
|
2
|
+
import { styled } from '@linaria/react';
|
3
|
+
import { tokens } from './Sheet.tokens.js';
|
4
|
+
import { handleTransition } from './utils/handleTransition.js';
|
5
|
+
|
6
|
+
var _exp = function _exp() {
|
7
|
+
return handleTransition('all 0.5s 0.1s');
|
8
|
+
};
|
9
|
+
var StyledWrapper = /*#__PURE__*/styled('div')({
|
10
|
+
name: "StyledWrapper",
|
11
|
+
"class": "sah7qw3",
|
12
|
+
propsAsIs: false,
|
13
|
+
vars: {
|
14
|
+
"sah7qw3-0": [/*#__PURE__*/_exp()]
|
15
|
+
}
|
16
|
+
});
|
17
|
+
var _exp3 = function _exp3() {
|
18
|
+
return handleTransition('transform 0.5s');
|
19
|
+
};
|
20
|
+
var StyledContentWrapper = /*#__PURE__*/styled('div')({
|
21
|
+
name: "StyledContentWrapper",
|
22
|
+
"class": "shg69gz",
|
23
|
+
propsAsIs: false,
|
24
|
+
vars: {
|
25
|
+
"shg69gz-0": [/*#__PURE__*/_exp3()]
|
26
|
+
}
|
27
|
+
});
|
28
|
+
var _exp5 = function _exp5() {
|
29
|
+
return function (_ref) {
|
30
|
+
var withOverlay = _ref.withOverlay;
|
31
|
+
return withOverlay ? "var(".concat(tokens.overlayBackgroundColor, ")") : 'transparent';
|
32
|
+
};
|
33
|
+
};
|
34
|
+
var StyledOverlay = /*#__PURE__*/styled('div')({
|
35
|
+
name: "StyledOverlay",
|
36
|
+
"class": "s1cdpbaw",
|
37
|
+
propsAsIs: false,
|
38
|
+
vars: {
|
39
|
+
"s1cdpbaw-0": [/*#__PURE__*/_exp5()]
|
40
|
+
}
|
41
|
+
});
|
42
|
+
var StyledSheetContent = /*#__PURE__*/styled('div')({
|
43
|
+
name: "StyledSheetContent",
|
44
|
+
"class": "sjx120m",
|
45
|
+
propsAsIs: false
|
46
|
+
});
|
47
|
+
var StyledSheetHandle = /*#__PURE__*/styled('div')({
|
48
|
+
name: "StyledSheetHandle",
|
49
|
+
"class": "s1f8rwx6",
|
50
|
+
propsAsIs: false
|
51
|
+
});
|
52
|
+
|
53
|
+
export { StyledContentWrapper, StyledOverlay, StyledSheetContent, StyledSheetHandle, StyledWrapper };
|
54
|
+
//# sourceMappingURL=Sheet.styles.js.map
|
@@ -0,0 +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,gBAAgB,CAAC,eAAe,CAAC,CAAA;AAAA,CAAA,CAAA;AAP5C,IAAMC,aAAa,gBAAGC,MAAM,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,GAA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|
@@ -0,0 +1,5 @@
|
|
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
|
+
.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;}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
var classes = {
|
2
|
+
isClosed: 'is-closed'
|
3
|
+
};
|
4
|
+
var tokens = {
|
5
|
+
overlayBackgroundColor: '--plasma-sheet-overlay-background-color',
|
6
|
+
contentBackgroundColor: '--plasma-sheet-content-background-color',
|
7
|
+
handleColor: '--plasma-sheet-handle-background-color'
|
8
|
+
};
|
9
|
+
|
10
|
+
export { classes, tokens };
|
11
|
+
//# sourceMappingURL=Sheet.tokens.js.map
|
@@ -0,0 +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;;;;"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
2
|
+
|
3
|
+
var useSheet = function useSheet(_ref) {
|
4
|
+
var isOpen = _ref.isOpen;
|
5
|
+
var overflow = useRef(document.body.style.overflowY);
|
6
|
+
|
7
|
+
// linaria не поддерживает динамический global
|
8
|
+
useEffect(function () {
|
9
|
+
if (isOpen) {
|
10
|
+
overflow.current = document.body.style.overflowY;
|
11
|
+
document.body.style.overflowY = 'hidden';
|
12
|
+
}
|
13
|
+
}, [isOpen]);
|
14
|
+
useEffect(function () {
|
15
|
+
if (!isOpen) {
|
16
|
+
document.body.style.overflowY = overflow.current;
|
17
|
+
}
|
18
|
+
}, [isOpen, overflow.current]);
|
19
|
+
};
|
20
|
+
|
21
|
+
export { useSheet };
|
22
|
+
//# sourceMappingURL=useSheet.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useSheet.js","sources":["../../../../src/components/Sheet/hooks/useSheet.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nimport { SheetHookArgs } from '../Sheet.types';\n\nexport const useSheet = ({ isOpen }: SheetHookArgs) => {\n const overflow = useRef<string>(document.body.style.overflowY);\n\n // linaria не поддерживает динамический global\n useEffect(() => {\n if (isOpen) {\n overflow.current = document.body.style.overflowY;\n document.body.style.overflowY = 'hidden';\n }\n }, [isOpen]);\n\n useEffect(() => {\n if (!isOpen) {\n document.body.style.overflowY = overflow.current;\n }\n }, [isOpen, overflow.current]);\n};\n"],"names":["useSheet","_ref","isOpen","overflow","useRef","document","body","style","overflowY","useEffect","current"],"mappings":";;IAIaA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAAkC;AAAA,EAAA,IAA5BC,MAAM,GAAAD,IAAA,CAANC,MAAM,CAAA;EAC7B,IAAMC,QAAQ,GAAGC,MAAM,CAASC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAACC,SAAS,CAAC,CAAA;;AAE9D;AACAC,EAAAA,SAAS,CAAC,YAAM;AACZ,IAAA,IAAIP,MAAM,EAAE;MACRC,QAAQ,CAACO,OAAO,GAAGL,QAAQ,CAACC,IAAI,CAACC,KAAK,CAACC,SAAS,CAAA;AAChDH,MAAAA,QAAQ,CAACC,IAAI,CAACC,KAAK,CAACC,SAAS,GAAG,QAAQ,CAAA;AAC5C,KAAA;AACJ,GAAC,EAAE,CAACN,MAAM,CAAC,CAAC,CAAA;AAEZO,EAAAA,SAAS,CAAC,YAAM;IACZ,IAAI,CAACP,MAAM,EAAE;MACTG,QAAQ,CAACC,IAAI,CAACC,KAAK,CAACC,SAAS,GAAGL,QAAQ,CAACO,OAAO,CAAA;AACpD,KAAA;GACH,EAAE,CAACR,MAAM,EAAEC,QAAQ,CAACO,OAAO,CAAC,CAAC,CAAA;AAClC;;;;"}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
+
import throttle from 'lodash.throttle';
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
4
|
+
|
5
|
+
var SWIPE_THRESHOLD = 0.2;
|
6
|
+
var THROTTLE_DEFAULT_MS = 0;
|
7
|
+
var isScrollable = function isScrollable(element) {
|
8
|
+
if (!element) {
|
9
|
+
return false;
|
10
|
+
}
|
11
|
+
var style = getComputedStyle(element);
|
12
|
+
return style.overflow === 'scroll' || style.overflow === 'auto' || style.overflowY === 'scroll' || style.overflowY === 'auto';
|
13
|
+
};
|
14
|
+
var useSheetSwipe = function useSheetSwipe(args) {
|
15
|
+
var contentWrapperRef = args.contentWrapperRef,
|
16
|
+
contentRef = args.contentRef,
|
17
|
+
handleRef = args.handleRef,
|
18
|
+
onClose = args.onClose,
|
19
|
+
_args$throttleMs = args.throttleMs,
|
20
|
+
throttleMs = _args$throttleMs === void 0 ? THROTTLE_DEFAULT_MS : _args$throttleMs;
|
21
|
+
var _useState = useState(true),
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
23
|
+
isTopScroll = _useState2[0],
|
24
|
+
setIsTopScroll = _useState2[1];
|
25
|
+
var isOverscroll = useRef(false);
|
26
|
+
var startY = useRef(0);
|
27
|
+
var currentY = useRef(0);
|
28
|
+
useEffect(function () {
|
29
|
+
var contentWrapperEl = contentWrapperRef.current;
|
30
|
+
var handleEl = handleRef.current;
|
31
|
+
var contentEl = contentRef.current;
|
32
|
+
var triggerElement = !isTopScroll ? handleEl : contentWrapperEl;
|
33
|
+
if (!triggerElement || !contentEl || !contentWrapperEl) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
var nodes = Array.from(contentWrapperEl.querySelectorAll('*'));
|
37
|
+
var scrollableElements = nodes.filter(isScrollable);
|
38
|
+
contentWrapperEl.style.willChange = 'transform';
|
39
|
+
var onTouchStart = function onTouchStart(event) {
|
40
|
+
isOverscroll.current = false;
|
41
|
+
startY.current = event.changedTouches[0].clientY;
|
42
|
+
currentY.current = startY.current;
|
43
|
+
contentWrapperEl.style.transition = 'none';
|
44
|
+
};
|
45
|
+
var onTouchMove = function onTouchMove(event) {
|
46
|
+
var clientY = event.changedTouches[0].clientY;
|
47
|
+
currentY.current = Math.max(startY.current, clientY);
|
48
|
+
var offsetY = currentY.current - startY.current;
|
49
|
+
if (isOverscroll.current) {
|
50
|
+
startY.current = Infinity;
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
if (offsetY !== 0 && event.cancelable) {
|
54
|
+
event.preventDefault();
|
55
|
+
}
|
56
|
+
contentWrapperEl.style.transform = "translateY(".concat(offsetY, "px)");
|
57
|
+
};
|
58
|
+
var onTouchEnd = function onTouchEnd(event) {
|
59
|
+
isOverscroll.current = false;
|
60
|
+
var curtainHeight = contentWrapperEl.offsetHeight;
|
61
|
+
var endY = event.changedTouches[0].clientY;
|
62
|
+
var offsetY = endY - startY.current;
|
63
|
+
contentWrapperEl.style.transform = '';
|
64
|
+
contentWrapperEl.style.transition = '';
|
65
|
+
if (offsetY / curtainHeight > SWIPE_THRESHOLD) {
|
66
|
+
onClose();
|
67
|
+
}
|
68
|
+
};
|
69
|
+
var onScroll = throttle(function (event) {
|
70
|
+
var onTop = event.target.scrollTop <= 0;
|
71
|
+
if (!onTop) {
|
72
|
+
isOverscroll.current = true;
|
73
|
+
}
|
74
|
+
setIsTopScroll(onTop);
|
75
|
+
}, throttleMs);
|
76
|
+
triggerElement.addEventListener('touchstart', onTouchStart);
|
77
|
+
triggerElement.addEventListener('touchmove', onTouchMove);
|
78
|
+
triggerElement.addEventListener('touchend', onTouchEnd);
|
79
|
+
scrollableElements.forEach(function (element) {
|
80
|
+
element.addEventListener('scroll', onScroll);
|
81
|
+
});
|
82
|
+
return function () {
|
83
|
+
triggerElement.removeEventListener('touchstart', onTouchStart);
|
84
|
+
triggerElement.removeEventListener('touchmove', onTouchMove);
|
85
|
+
triggerElement.removeEventListener('touchend', onTouchEnd);
|
86
|
+
scrollableElements.forEach(function (element) {
|
87
|
+
element.removeEventListener('scroll', onScroll);
|
88
|
+
});
|
89
|
+
};
|
90
|
+
}, [isTopScroll]);
|
91
|
+
};
|
92
|
+
|
93
|
+
export { useSheetSwipe };
|
94
|
+
//# sourceMappingURL=useSheetSwipe.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useSheetSwipe.js","sources":["../../../../src/components/Sheet/hooks/useSheetSwipe.ts"],"sourcesContent":["import throttle from 'lodash.throttle';\nimport React, { useEffect, useRef, useState } from 'react';\n\nconst SWIPE_THRESHOLD = 0.2;\nconst THROTTLE_DEFAULT_MS = 0;\n\nconst isScrollable = (element: HTMLElement | null) => {\n if (!element) {\n return false;\n }\n\n const style = getComputedStyle(element);\n\n return (\n style.overflow === 'scroll' ||\n style.overflow === 'auto' ||\n style.overflowY === 'scroll' ||\n style.overflowY === 'auto'\n );\n};\n\nexport const useSheetSwipe = (args: {\n contentWrapperRef: React.RefObject<HTMLDivElement>;\n contentRef: React.RefObject<HTMLDivElement>;\n handleRef: React.RefObject<HTMLDivElement>;\n throttleMs?: number;\n onClose: () => void;\n}) => {\n const { contentWrapperRef, contentRef, handleRef, onClose, throttleMs = THROTTLE_DEFAULT_MS } = args;\n const [isTopScroll, setIsTopScroll] = useState(true);\n const isOverscroll = useRef(false);\n const startY = useRef(0);\n const currentY = useRef(0);\n\n useEffect(() => {\n const contentWrapperEl = contentWrapperRef.current;\n const handleEl = handleRef.current;\n const contentEl = contentRef.current;\n\n const triggerElement = !isTopScroll ? handleEl : contentWrapperEl;\n\n if (!triggerElement || !contentEl || !contentWrapperEl) {\n return;\n }\n\n const nodes = Array.from<HTMLElement>(contentWrapperEl.querySelectorAll('*'));\n const scrollableElements = nodes.filter(isScrollable);\n\n contentWrapperEl.style.willChange = 'transform';\n\n const onTouchStart = (event: TouchEvent) => {\n isOverscroll.current = false;\n\n startY.current = event.changedTouches[0].clientY;\n currentY.current = startY.current;\n\n contentWrapperEl.style.transition = 'none';\n };\n\n const onTouchMove = (event: TouchEvent) => {\n const { clientY } = event.changedTouches[0];\n currentY.current = Math.max(startY.current, clientY);\n const offsetY = currentY.current - startY.current;\n\n if (isOverscroll.current) {\n startY.current = Infinity;\n return;\n }\n\n if (offsetY !== 0 && event.cancelable) {\n event.preventDefault();\n }\n\n contentWrapperEl.style.transform = `translateY(${offsetY}px)`;\n };\n\n const onTouchEnd = (event: TouchEvent) => {\n isOverscroll.current = false;\n\n const curtainHeight = contentWrapperEl.offsetHeight;\n const endY = event.changedTouches[0].clientY;\n const offsetY = endY - startY.current;\n\n contentWrapperEl.style.transform = '';\n contentWrapperEl.style.transition = '';\n\n if (offsetY / curtainHeight > SWIPE_THRESHOLD) {\n onClose();\n }\n };\n\n const onScroll = throttle((event: Event) => {\n const onTop = (event.target as HTMLElement).scrollTop <= 0;\n\n if (!onTop) {\n isOverscroll.current = true;\n }\n\n setIsTopScroll(onTop);\n }, throttleMs);\n\n triggerElement.addEventListener('touchstart', onTouchStart);\n triggerElement.addEventListener('touchmove', onTouchMove);\n triggerElement.addEventListener('touchend', onTouchEnd);\n\n scrollableElements.forEach((element) => {\n element.addEventListener('scroll', onScroll);\n });\n\n return () => {\n triggerElement.removeEventListener('touchstart', onTouchStart);\n triggerElement.removeEventListener('touchmove', onTouchMove);\n triggerElement.removeEventListener('touchend', onTouchEnd);\n\n scrollableElements.forEach((element) => {\n element.removeEventListener('scroll', onScroll);\n });\n };\n }, [isTopScroll]);\n};\n"],"names":["SWIPE_THRESHOLD","THROTTLE_DEFAULT_MS","isScrollable","element","style","getComputedStyle","overflow","overflowY","useSheetSwipe","args","contentWrapperRef","contentRef","handleRef","onClose","_args$throttleMs","throttleMs","_useState","useState","_useState2","_slicedToArray","isTopScroll","setIsTopScroll","isOverscroll","useRef","startY","currentY","useEffect","contentWrapperEl","current","handleEl","contentEl","triggerElement","nodes","Array","from","querySelectorAll","scrollableElements","filter","willChange","onTouchStart","event","changedTouches","clientY","transition","onTouchMove","Math","max","offsetY","Infinity","cancelable","preventDefault","transform","concat","onTouchEnd","curtainHeight","offsetHeight","endY","onScroll","throttle","onTop","target","scrollTop","addEventListener","forEach","removeEventListener"],"mappings":";;;;AAGA,IAAMA,eAAe,GAAG,GAAG,CAAA;AAC3B,IAAMC,mBAAmB,GAAG,CAAC,CAAA;AAE7B,IAAMC,YAAY,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KACxB,EAAE5C,UAAU,CAAC,CAAA;AAEdgB,IAAAA,cAAc,CAAC+B,gBAAgB,CAAC,YAAY,EAAEvB,YAAY,CAAC,CAAA;AAC3DR,IAAAA,cAAc,CAAC+B,gBAAgB,CAAC,WAAW,EAAElB,WAAW,CAAC,CAAA;AACzDb,IAAAA,cAAc,CAAC+B,gBAAgB,CAAC,UAAU,EAAET,UAAU,CAAC,CAAA;AAEvDjB,IAAAA,kBAAkB,CAAC2B,OAAO,CAAC,UAAC5D,OAAO,EAAK;AACpCA,MAAAA,OAAO,CAAC2D,gBAAgB,CAAC,QAAQ,EAAEL,QAAQ,CAAC,CAAA;AAChD,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,YAAM;AACT1B,MAAAA,cAAc,CAACiC,mBAAmB,CAAC,YAAY,EAAEzB,YAAY,CAAC,CAAA;AAC9DR,MAAAA,cAAc,CAACiC,mBAAmB,CAAC,WAAW,EAAEpB,WAAW,CAAC,CAAA;AAC5Db,MAAAA,cAAc,CAACiC,mBAAmB,CAAC,UAAU,EAAEX,UAAU,CAAC,CAAA;AAE1DjB,MAAAA,kBAAkB,CAAC2B,OAAO,CAAC,UAAC5D,OAAO,EAAK;AACpCA,QAAAA,OAAO,CAAC6D,mBAAmB,CAAC,QAAQ,EAAEP,QAAQ,CAAC,CAAA;AACnD,OAAC,CAAC,CAAA;KACL,CAAA;AACL,GAAC,EAAE,CAACrC,WAAW,CAAC,CAAC,CAAA;AACrB;;;;"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { useContext } from 'react';
|
2
|
+
import { ThemeContext } from 'styled-components';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Возвращает контекст темы.
|
6
|
+
* @return {ThemeProviderContext}
|
7
|
+
*/
|
8
|
+
var useThemeContext = function useThemeContext() {
|
9
|
+
return useContext(ThemeContext) || {};
|
10
|
+
};
|
11
|
+
|
12
|
+
export { useThemeContext };
|
13
|
+
//# sourceMappingURL=useThemeContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useThemeContext.js","sources":["../../../../src/components/Sheet/hooks/useThemeContext.ts"],"sourcesContent":["import { useContext } from 'react';\nimport { ThemeContext } from 'styled-components';\n\nimport { ThemeProviderContext } from '../Sheet.types';\n\n/**\n * Возвращает контекст темы.\n * @return {ThemeProviderContext}\n */\nexport const useThemeContext = (): ThemeProviderContext => {\n return useContext<ThemeProviderContext>(ThemeContext) || {};\n};\n"],"names":["useThemeContext","useContext","ThemeContext"],"mappings":";;;AAKA;AACA;AACA;AACA;IACaA,eAAe,GAAG,SAAlBA,eAAeA,GAA+B;AACvD,EAAA,OAAOC,UAAU,CAAuBC,YAAY,CAAC,IAAI,EAAE,CAAA;AAC/D;;;;"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
var handleTransition = function handleTransition(transition) {
|
2
|
+
return function (props) {
|
3
|
+
var lowPerformance = props.theme.lowPerformance,
|
4
|
+
withTransition = props.withTransition;
|
5
|
+
return !withTransition || lowPerformance ? 'unset' : transition;
|
6
|
+
};
|
7
|
+
};
|
8
|
+
|
9
|
+
export { handleTransition };
|
10
|
+
//# sourceMappingURL=handleTransition.js.map
|
@@ -0,0 +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;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/Sheet/variations/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
package/es/index.css
CHANGED
@@ -538,6 +538,12 @@
|
|
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;}
|
546
|
+
|
541
547
|
.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);}
|
542
548
|
.SliderBase_styles_7is2ll_rnaoqfb__0c0959e2{height:100%;}
|
543
549
|
.SliderBase_styles_7is2ll_r1bro5xo__0c0959e2{position:relative;top:50%;height:var(--plasma-slider-rail-height);border-radius:var(--plasma-slider-rail-border-radius);background-color:var(--plasma-slider-rail-background-color);overflow:hidden;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}
|
@@ -579,5 +585,3 @@
|
|
579
585
|
|
580
586
|
|
581
587
|
|
582
|
-
|
583
|
-
.Accordion_styles_1mo1sxr_bjv6ypd__b7c4430d{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--plasma-accordion-gap);-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;height:auto;background:var(--plasma-accordion-background);}.Accordion_styles_1mo1sxr_bjv6ypd__b7c4430d.Accordion_styles_1mo1sxr_bjv6ypd__b7c4430d.Accordion_styles_1mo1sxr_accordionStretchingFixed__b7c4430d{width:var(--plasma-accordion-width);}.Accordion_styles_1mo1sxr_bjv6ypd__b7c4430d.Accordion_styles_1mo1sxr_bjv6ypd__b7c4430d.Accordion_styles_1mo1sxr_accordionStretchingFilled__b7c4430d{width:100%;}
|
package/es/index.js
CHANGED
@@ -167,6 +167,8 @@ export { classes as dividerClasses, tokens as dividerTokens } from './components
|
|
167
167
|
export { toolbarConfig, toolbarRoot } from './components/Toolbar/Toolbar.js';
|
168
168
|
export { tokens as toolbarTokens } from './components/Toolbar/Toolbar.tokens.js';
|
169
169
|
export { toolbarDividerConfig, toolbarDividerRoot } from './components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js';
|
170
|
+
export { sheetConfig, sheetRoot } from './components/Sheet/Sheet.js';
|
171
|
+
export { classes as sheetClasses, tokens as sheetTokens } from './components/Sheet/Sheet.tokens.js';
|
170
172
|
export { sliderConfig, sliderRoot } from './components/Slider/Slider.js';
|
171
173
|
export { tokens as sliderTokens } from './components/Slider/Slider.tokens.js';
|
172
174
|
import 'react';
|
@@ -175,9 +177,6 @@ export { ThumbBase } from './components/Slider/ui/Thumb/Thumb.styles.js';
|
|
175
177
|
import '@linaria/react';
|
176
178
|
export { rangeConfig, rangeRoot } from './components/Range/Range.js';
|
177
179
|
export { tokens as rangeTokens } from './components/Range/Range.tokens.js';
|
178
|
-
export { accordionConfig, accordionRoot } from './components/Accordion/Accordion.js';
|
179
|
-
export { AccordionItem } from './components/Accordion/ui/AccordionItem/AccordionItem.js';
|
180
|
-
export { classes as accordionClasses, tokens as accordionTokens } from './components/Accordion/Accordion.tokens.js';
|
181
180
|
export { component, mergeConfig } from './engines/common.js';
|
182
181
|
export { canUseDOM } from './utils/canUseDOM.js';
|
183
182
|
export { extractTextFrom } from './utils/extractTextFrom.js';
|
package/es/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.88.0-canary.
|
3
|
+
"version": "0.88.0-canary.1225.9347054103.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"@storybook/react-vite": "7.6.17",
|
77
77
|
"@storybook/theming": "^7.6.17",
|
78
78
|
"@types/lodash": "^4.14.191",
|
79
|
+
"@types/lodash.throttle": "4.1.6",
|
79
80
|
"@types/node": "15.14.9",
|
80
81
|
"@types/react": "18.0.28",
|
81
82
|
"@types/react-dom": "18.0.11",
|
@@ -99,9 +100,10 @@
|
|
99
100
|
"@popperjs/core": "2.11.8",
|
100
101
|
"@salutejs/plasma-core": "1.160.0",
|
101
102
|
"focus-visible": "5.2.0",
|
103
|
+
"lodash.throttle": "4.1.1",
|
102
104
|
"react-draggable": "4.4.3",
|
103
105
|
"react-popper": "2.3.0",
|
104
106
|
"storeon": "3.1.5"
|
105
107
|
},
|
106
|
-
"gitHead": "
|
108
|
+
"gitHead": "dc814b9d7724a10de0d9c4ed8649afef4184caa7"
|
107
109
|
}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.sheetRoot = exports.sheetConfig = void 0;
|
8
|
+
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
+
var _utils = /*#__PURE__*/require("../../utils");
|
10
|
+
var _hooks = /*#__PURE__*/require("./hooks");
|
11
|
+
var _Sheet = /*#__PURE__*/require("./Sheet.tokens");
|
12
|
+
var _Sheet2 = /*#__PURE__*/require("./Sheet.styles");
|
13
|
+
var _base = /*#__PURE__*/require("./variations/_view/base");
|
14
|
+
var _excluded = ["isOpen", "children", "onClose", "withOverlay", "withTransition", "throttleMs", "className", "view"];
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
17
|
+
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); }
|
18
|
+
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; }
|
19
|
+
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; }
|
20
|
+
/**
|
21
|
+
* Открывает окно-шторку поверх основного экрана.
|
22
|
+
*/
|
23
|
+
|
24
|
+
var sheetRoot = exports.sheetRoot = function sheetRoot(Root) {
|
25
|
+
return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, rootRef) {
|
26
|
+
var isOpen = _ref.isOpen,
|
27
|
+
children = _ref.children,
|
28
|
+
onClose = _ref.onClose,
|
29
|
+
_ref$withOverlay = _ref.withOverlay,
|
30
|
+
withOverlay = _ref$withOverlay === void 0 ? true : _ref$withOverlay,
|
31
|
+
_ref$withTransition = _ref.withTransition,
|
32
|
+
withTransition = _ref$withTransition === void 0 ? true : _ref$withTransition,
|
33
|
+
throttleMs = _ref.throttleMs,
|
34
|
+
className = _ref.className,
|
35
|
+
view = _ref.view,
|
36
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
37
|
+
var contentWrapperRef = _react["default"].useRef(null);
|
38
|
+
var contentRef = _react["default"].useRef(null);
|
39
|
+
var handleRef = _react["default"].useRef(null);
|
40
|
+
var theme = (0, _hooks.useThemeContext)();
|
41
|
+
(0, _hooks.useSheet)({
|
42
|
+
isOpen: isOpen
|
43
|
+
});
|
44
|
+
(0, _hooks.useSheetSwipe)({
|
45
|
+
contentWrapperRef: contentWrapperRef,
|
46
|
+
contentRef: contentRef,
|
47
|
+
handleRef: handleRef,
|
48
|
+
throttleMs: throttleMs,
|
49
|
+
onClose: onClose
|
50
|
+
});
|
51
|
+
var isClosedClass = isOpen ? undefined : "".concat(_Sheet.classes.isClosed);
|
52
|
+
return /*#__PURE__*/_react["default"].createElement(_Sheet2.StyledWrapper, _extends({
|
53
|
+
theme: theme,
|
54
|
+
isOpen: isOpen,
|
55
|
+
withTransition: withTransition,
|
56
|
+
className: (0, _utils.cx)(isClosedClass, className)
|
57
|
+
}, restProps), /*#__PURE__*/_react["default"].createElement(Root, {
|
58
|
+
isOpen: isOpen,
|
59
|
+
onClose: onClose,
|
60
|
+
view: view,
|
61
|
+
ref: rootRef
|
62
|
+
}, /*#__PURE__*/_react["default"].createElement(_Sheet2.StyledContentWrapper, {
|
63
|
+
theme: theme,
|
64
|
+
isOpen: isOpen,
|
65
|
+
withTransition: withTransition,
|
66
|
+
ref: contentWrapperRef
|
67
|
+
}, /*#__PURE__*/_react["default"].createElement(_Sheet2.StyledSheetHandle, {
|
68
|
+
ref: handleRef
|
69
|
+
}), /*#__PURE__*/_react["default"].createElement(_Sheet2.StyledSheetContent, {
|
70
|
+
ref: contentRef
|
71
|
+
}, children)), /*#__PURE__*/_react["default"].createElement(_Sheet2.StyledOverlay, {
|
72
|
+
withOverlay: withOverlay,
|
73
|
+
onClick: onClose
|
74
|
+
})));
|
75
|
+
});
|
76
|
+
};
|
77
|
+
var sheetConfig = exports.sheetConfig = {
|
78
|
+
name: 'Sheet',
|
79
|
+
tag: 'div',
|
80
|
+
layout: sheetRoot,
|
81
|
+
base: '',
|
82
|
+
variations: {
|
83
|
+
view: {
|
84
|
+
css: _base.base
|
85
|
+
}
|
86
|
+
},
|
87
|
+
defaults: {
|
88
|
+
view: 'default'
|
89
|
+
}
|
90
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.StyledWrapper = exports.StyledSheetHandle = exports.StyledSheetContent = exports.StyledOverlay = exports.StyledContentWrapper = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
|
+
var _Sheet = /*#__PURE__*/require("./Sheet.tokens");
|
9
|
+
var _handleTransition = /*#__PURE__*/require("./utils/handleTransition");
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
+
var StyledWrapper = exports.StyledWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
12
|
+
componentId: "plasma-new-hope__sc-1pj79gq-0"
|
13
|
+
})(["position:fixed;top:0;bottom:0;left:0;right:0;opacity:1;transition:", ";z-index:1000;&.", "{opacity:0;visibility:hidden;}"], /*#__PURE__*/(0, _handleTransition.handleTransition)('all 0.5s 0.1s'), /*#__PURE__*/String(_Sheet.classes.isClosed));
|
14
|
+
var StyledContentWrapper = exports.StyledContentWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
15
|
+
componentId: "plasma-new-hope__sc-1pj79gq-1"
|
16
|
+
})(["position:absolute;left:0;bottom:0;width:100%;max-height:100%;z-index:1;display:flex;flex-direction:column;justify-content:flex-end;transition:", ";&.", "{transform:translateY(100%);}"], /*#__PURE__*/(0, _handleTransition.handleTransition)('transform 0.5s'), /*#__PURE__*/String(_Sheet.classes.isClosed));
|
17
|
+
var StyledOverlay = exports.StyledOverlay = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
18
|
+
componentId: "plasma-new-hope__sc-1pj79gq-2"
|
19
|
+
})(["position:absolute;top:0;left:0;width:100%;height:100%;background-color:", ";"], function (_ref) {
|
20
|
+
var withOverlay = _ref.withOverlay;
|
21
|
+
return withOverlay ? "var(".concat(_Sheet.tokens.overlayBackgroundColor, ")") : 'transparent';
|
22
|
+
});
|
23
|
+
var StyledSheetContent = exports.StyledSheetContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
24
|
+
componentId: "plasma-new-hope__sc-1pj79gq-3"
|
25
|
+
})(["border-radius:1.5rem 1.5rem 0 0;background-color:var(", ");padding:1rem;max-height:100%;overflow:auto;overscroll-behavior:contain;&::-webkit-scrollbar{display:none;}"], _Sheet.tokens.contentBackgroundColor);
|
26
|
+
var StyledSheetHandle = exports.StyledSheetHandle = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
27
|
+
componentId: "plasma-new-hope__sc-1pj79gq-4"
|
28
|
+
})(["width:4rem;padding:1.75rem 0;margin:-1.5rem 0;opacity:0.65;align-self:center;&::before{content:'';display:block;border-radius:0.625rem;background-color:var(", ");height:0.25rem;}"], _Sheet.tokens.handleColor);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.tokens = exports.classes = void 0;
|
7
|
+
var classes = exports.classes = {
|
8
|
+
isClosed: 'is-closed'
|
9
|
+
};
|
10
|
+
var tokens = exports.tokens = {
|
11
|
+
overlayBackgroundColor: '--plasma-sheet-overlay-background-color',
|
12
|
+
contentBackgroundColor: '--plasma-sheet-content-background-color',
|
13
|
+
handleColor: '--plasma-sheet-handle-background-color'
|
14
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "useSheet", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _useSheet.useSheet;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "useSheetSwipe", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _useSheetSwipe.useSheetSwipe;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
Object.defineProperty(exports, "useThemeContext", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function get() {
|
21
|
+
return _useThemeContext.useThemeContext;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
var _useThemeContext = /*#__PURE__*/require("./useThemeContext");
|
25
|
+
var _useSheetSwipe = /*#__PURE__*/require("./useSheetSwipe");
|
26
|
+
var _useSheet = /*#__PURE__*/require("./useSheet");
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useSheet = void 0;
|
7
|
+
var _react = /*#__PURE__*/require("react");
|
8
|
+
var useSheet = exports.useSheet = function useSheet(_ref) {
|
9
|
+
var isOpen = _ref.isOpen;
|
10
|
+
var overflow = (0, _react.useRef)(document.body.style.overflowY);
|
11
|
+
|
12
|
+
// linaria не поддерживает динамический global
|
13
|
+
(0, _react.useEffect)(function () {
|
14
|
+
if (isOpen) {
|
15
|
+
overflow.current = document.body.style.overflowY;
|
16
|
+
document.body.style.overflowY = 'hidden';
|
17
|
+
}
|
18
|
+
}, [isOpen]);
|
19
|
+
(0, _react.useEffect)(function () {
|
20
|
+
if (!isOpen) {
|
21
|
+
document.body.style.overflowY = overflow.current;
|
22
|
+
}
|
23
|
+
}, [isOpen, overflow.current]);
|
24
|
+
};
|