@salutejs/plasma-new-hope 0.88.0-canary.1223.9316788273.0 → 0.88.0-canary.1225.9346550240.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,239 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
import type { ComponentProps } from 'react';
|
4
|
+
import { Body1 } from '@salutejs/plasma-core';
|
5
|
+
|
6
|
+
import { Button } from '../Button/Button';
|
7
|
+
import { WithTheme } from '../../../_helpers';
|
8
|
+
|
9
|
+
import { Sheet } from './Sheet';
|
10
|
+
|
11
|
+
const meta: Meta<typeof Sheet> = {
|
12
|
+
title: 'plasma_b2c/Sheet',
|
13
|
+
decorators: [WithTheme],
|
14
|
+
parameters: { viewport: { defaultViewport: '860' } },
|
15
|
+
};
|
16
|
+
|
17
|
+
export default meta;
|
18
|
+
|
19
|
+
type StorySheetProps = ComponentProps<typeof Sheet>;
|
20
|
+
|
21
|
+
const StoryDefault = ({ withOverlay, withTransition }: StorySheetProps) => {
|
22
|
+
const [isOpen, setIsOpen] = useState(false);
|
23
|
+
|
24
|
+
return (
|
25
|
+
<>
|
26
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
27
|
+
<Sheet
|
28
|
+
isOpen={isOpen}
|
29
|
+
withOverlay={withOverlay}
|
30
|
+
withTransition={withTransition}
|
31
|
+
onClose={() => setIsOpen(false)}
|
32
|
+
>
|
33
|
+
<p>Вложенные кнопки</p>
|
34
|
+
<div
|
35
|
+
style={{
|
36
|
+
height: '75px',
|
37
|
+
overflow: 'scroll',
|
38
|
+
display: 'flex',
|
39
|
+
flexDirection: 'column',
|
40
|
+
gap: '1rem',
|
41
|
+
}}
|
42
|
+
>
|
43
|
+
<Button>Кнопка 1</Button>
|
44
|
+
<Button>Кнопка 2</Button>
|
45
|
+
<Button>Кнопка 3</Button>
|
46
|
+
<Button>Кнопка 4</Button>
|
47
|
+
<Button>Кнопка 5</Button>
|
48
|
+
<Button>Кнопка 6</Button>
|
49
|
+
<Button>Кнопка 7</Button>
|
50
|
+
<Button>Кнопка 8</Button>
|
51
|
+
</div>
|
52
|
+
<Body1>
|
53
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
54
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel illum ea
|
55
|
+
fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos nostrum
|
56
|
+
placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt ullam,
|
57
|
+
dolorem labore quaerat vero maxime ab ipsa nihil.
|
58
|
+
</Body1>
|
59
|
+
</Sheet>
|
60
|
+
</>
|
61
|
+
);
|
62
|
+
};
|
63
|
+
|
64
|
+
export const Default: StoryObj<StorySheetProps> = {
|
65
|
+
args: {
|
66
|
+
withOverlay: true,
|
67
|
+
withTransition: true,
|
68
|
+
},
|
69
|
+
render: (args) => <StoryDefault {...args} />,
|
70
|
+
};
|
71
|
+
|
72
|
+
const StoryWithoutOverlay = () => {
|
73
|
+
const [isOpen, setIsOpen] = useState(false);
|
74
|
+
|
75
|
+
return (
|
76
|
+
<>
|
77
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
78
|
+
<Sheet isOpen={isOpen} withOverlay={false} onClose={() => setIsOpen(false)}>
|
79
|
+
<Body1>
|
80
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
81
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel illum ea
|
82
|
+
fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos nostrum
|
83
|
+
placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt ullam,
|
84
|
+
dolorem labore quaerat vero maxime ab ipsa nihil.
|
85
|
+
</Body1>
|
86
|
+
</Sheet>
|
87
|
+
</>
|
88
|
+
);
|
89
|
+
};
|
90
|
+
|
91
|
+
export const WithoutOverlay: StoryObj = {
|
92
|
+
render: () => <StoryWithoutOverlay />,
|
93
|
+
};
|
94
|
+
|
95
|
+
const StoryWithScroll = ({ withOverlay, withTransition }: StorySheetProps) => {
|
96
|
+
const [isOpen, setIsOpen] = useState(false);
|
97
|
+
|
98
|
+
return (
|
99
|
+
<>
|
100
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
101
|
+
<Sheet
|
102
|
+
isOpen={isOpen}
|
103
|
+
withOverlay={withOverlay}
|
104
|
+
withTransition={withTransition}
|
105
|
+
onClose={() => setIsOpen(false)}
|
106
|
+
>
|
107
|
+
<Body1>
|
108
|
+
<Button onClick={() => setIsOpen(false)}>Закрыть</Button>
|
109
|
+
<p>
|
110
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
111
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel
|
112
|
+
illum ea fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos
|
113
|
+
nostrum placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt
|
114
|
+
ullam, dolorem labore quaerat vero maxime ab ipsa nihil.
|
115
|
+
</p>
|
116
|
+
<Button onClick={() => setIsOpen(false)}>Закрыть</Button>
|
117
|
+
<p>
|
118
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
119
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel
|
120
|
+
illum ea fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos
|
121
|
+
nostrum placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt
|
122
|
+
ullam, dolorem labore quaerat vero maxime ab ipsa nihil.
|
123
|
+
</p>
|
124
|
+
</Body1>
|
125
|
+
</Sheet>
|
126
|
+
</>
|
127
|
+
);
|
128
|
+
};
|
129
|
+
|
130
|
+
export const WithScroll: StoryObj<StorySheetProps> = {
|
131
|
+
render: (args) => <StoryWithScroll {...args} />,
|
132
|
+
};
|
133
|
+
|
134
|
+
const StoryWithInsideScroll = ({ withOverlay, withTransition }: StorySheetProps) => {
|
135
|
+
const [isOpen, setIsOpen] = useState(false);
|
136
|
+
|
137
|
+
return (
|
138
|
+
<>
|
139
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
140
|
+
<Sheet
|
141
|
+
isOpen={isOpen}
|
142
|
+
withOverlay={withOverlay}
|
143
|
+
withTransition={withTransition}
|
144
|
+
onClose={() => setIsOpen(false)}
|
145
|
+
>
|
146
|
+
<p>Вложенные кнопки</p>
|
147
|
+
<div
|
148
|
+
style={{
|
149
|
+
height: '150px',
|
150
|
+
overflow: 'scroll',
|
151
|
+
display: 'flex',
|
152
|
+
flexDirection: 'column',
|
153
|
+
gap: '1rem',
|
154
|
+
}}
|
155
|
+
>
|
156
|
+
<Button>Кнопка 1</Button>
|
157
|
+
<Button>Кнопка 2</Button>
|
158
|
+
<Button>Кнопка 3</Button>
|
159
|
+
<Button>Кнопка 4</Button>
|
160
|
+
<Button>Кнопка 5</Button>
|
161
|
+
<Button>Кнопка 6</Button>
|
162
|
+
<Button>Кнопка 7</Button>
|
163
|
+
<Button>Кнопка 8</Button>
|
164
|
+
</div>
|
165
|
+
<Body1>Lorem ipsum dolor sit amet consectetur adipisicing elit.</Body1>
|
166
|
+
</Sheet>
|
167
|
+
</>
|
168
|
+
);
|
169
|
+
};
|
170
|
+
|
171
|
+
export const WithInsideScroll: StoryObj<StorySheetProps> = {
|
172
|
+
args: {
|
173
|
+
withOverlay: true,
|
174
|
+
withTransition: true,
|
175
|
+
},
|
176
|
+
render: (args) => <StoryWithInsideScroll {...args} />,
|
177
|
+
};
|
178
|
+
|
179
|
+
const StoryWithDoubleScroll = ({ withOverlay, withTransition }: StorySheetProps) => {
|
180
|
+
const [isOpen, setIsOpen] = useState(false);
|
181
|
+
|
182
|
+
return (
|
183
|
+
<>
|
184
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
185
|
+
<Sheet
|
186
|
+
isOpen={isOpen}
|
187
|
+
withOverlay={withOverlay}
|
188
|
+
withTransition={withTransition}
|
189
|
+
onClose={() => setIsOpen(false)}
|
190
|
+
>
|
191
|
+
<Body1>
|
192
|
+
<Button onClick={() => setIsOpen(false)}>Закрыть</Button>
|
193
|
+
<p>Вложенные кнопки</p>
|
194
|
+
<div
|
195
|
+
style={{
|
196
|
+
height: '150px',
|
197
|
+
overflow: 'scroll',
|
198
|
+
display: 'flex',
|
199
|
+
flexDirection: 'column',
|
200
|
+
gap: '1rem',
|
201
|
+
}}
|
202
|
+
>
|
203
|
+
<Button>Кнопка 1</Button>
|
204
|
+
<Button>Кнопка 2</Button>
|
205
|
+
<Button>Кнопка 3</Button>
|
206
|
+
<Button>Кнопка 4</Button>
|
207
|
+
<Button>Кнопка 5</Button>
|
208
|
+
<Button>Кнопка 6</Button>
|
209
|
+
<Button>Кнопка 7</Button>
|
210
|
+
<Button>Кнопка 8</Button>
|
211
|
+
</div>
|
212
|
+
<p>
|
213
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
214
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel
|
215
|
+
illum ea fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos
|
216
|
+
nostrum placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt
|
217
|
+
ullam, dolorem labore quaerat vero maxime ab ipsa nihil.
|
218
|
+
</p>
|
219
|
+
<Button onClick={() => setIsOpen(false)}>Закрыть</Button>
|
220
|
+
<p>
|
221
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
222
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel
|
223
|
+
illum ea fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos
|
224
|
+
nostrum placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt
|
225
|
+
ullam, dolorem labore quaerat vero maxime ab ipsa nihil.
|
226
|
+
</p>
|
227
|
+
</Body1>
|
228
|
+
</Sheet>
|
229
|
+
</>
|
230
|
+
);
|
231
|
+
};
|
232
|
+
|
233
|
+
export const WithDoubleScroll: StoryObj<StorySheetProps> = {
|
234
|
+
args: {
|
235
|
+
withOverlay: true,
|
236
|
+
withTransition: true,
|
237
|
+
},
|
238
|
+
render: (args) => <StoryWithDoubleScroll {...args} />,
|
239
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { sheetTokens } from '../../../../components/Sheet';
|
3
|
+
export var config = {
|
4
|
+
defaults: {
|
5
|
+
view: 'default'
|
6
|
+
},
|
7
|
+
variations: {
|
8
|
+
view: {
|
9
|
+
"default": /*#__PURE__*/css(["", ":var(--plasma-colors-background-primary);", ":var(--plasma-colors-overlay);", ":var(--plasma-colors-white);"], sheetTokens.contentBackgroundColor, sheetTokens.overlayBackgroundColor, sheetTokens.handleColor)
|
10
|
+
}
|
11
|
+
}
|
12
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { sheetConfig } from '../../../../components/Sheet';
|
2
|
+
import { component, mergeConfig } from '../../../../engines';
|
3
|
+
import { config } from './Sheet.config';
|
4
|
+
export { sheetClasses } from '../../../../components/Sheet';
|
5
|
+
var mergedConfig = /*#__PURE__*/mergeConfig(sheetConfig, config);
|
6
|
+
export var Sheet = /*#__PURE__*/component(mergedConfig);
|
@@ -0,0 +1,239 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
import type { ComponentProps } from 'react';
|
4
|
+
import { Body1 } from '@salutejs/plasma-core';
|
5
|
+
|
6
|
+
import { Button } from '../Button/Button';
|
7
|
+
import { WithTheme } from '../../../_helpers';
|
8
|
+
|
9
|
+
import { Sheet } from './Sheet';
|
10
|
+
|
11
|
+
const meta: Meta<typeof Sheet> = {
|
12
|
+
title: 'plasma_web/Sheet',
|
13
|
+
decorators: [WithTheme],
|
14
|
+
parameters: { viewport: { defaultViewport: '860' } },
|
15
|
+
};
|
16
|
+
|
17
|
+
export default meta;
|
18
|
+
|
19
|
+
type StorySheetProps = ComponentProps<typeof Sheet>;
|
20
|
+
|
21
|
+
const StoryDefault = ({ withOverlay, withTransition }: StorySheetProps) => {
|
22
|
+
const [isOpen, setIsOpen] = useState(false);
|
23
|
+
|
24
|
+
return (
|
25
|
+
<>
|
26
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
27
|
+
<Sheet
|
28
|
+
isOpen={isOpen}
|
29
|
+
withOverlay={withOverlay}
|
30
|
+
withTransition={withTransition}
|
31
|
+
onClose={() => setIsOpen(false)}
|
32
|
+
>
|
33
|
+
<p>Вложенные кнопки</p>
|
34
|
+
<div
|
35
|
+
style={{
|
36
|
+
height: '75px',
|
37
|
+
overflow: 'scroll',
|
38
|
+
display: 'flex',
|
39
|
+
flexDirection: 'column',
|
40
|
+
gap: '1rem',
|
41
|
+
}}
|
42
|
+
>
|
43
|
+
<Button>Кнопка 1</Button>
|
44
|
+
<Button>Кнопка 2</Button>
|
45
|
+
<Button>Кнопка 3</Button>
|
46
|
+
<Button>Кнопка 4</Button>
|
47
|
+
<Button>Кнопка 5</Button>
|
48
|
+
<Button>Кнопка 6</Button>
|
49
|
+
<Button>Кнопка 7</Button>
|
50
|
+
<Button>Кнопка 8</Button>
|
51
|
+
</div>
|
52
|
+
<Body1>
|
53
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
54
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel illum ea
|
55
|
+
fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos nostrum
|
56
|
+
placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt ullam,
|
57
|
+
dolorem labore quaerat vero maxime ab ipsa nihil.
|
58
|
+
</Body1>
|
59
|
+
</Sheet>
|
60
|
+
</>
|
61
|
+
);
|
62
|
+
};
|
63
|
+
|
64
|
+
export const Default: StoryObj<StorySheetProps> = {
|
65
|
+
args: {
|
66
|
+
withOverlay: true,
|
67
|
+
withTransition: true,
|
68
|
+
},
|
69
|
+
render: (args) => <StoryDefault {...args} />,
|
70
|
+
};
|
71
|
+
|
72
|
+
const StoryWithoutOverlay = () => {
|
73
|
+
const [isOpen, setIsOpen] = useState(false);
|
74
|
+
|
75
|
+
return (
|
76
|
+
<>
|
77
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
78
|
+
<Sheet isOpen={isOpen} withOverlay={false} onClose={() => setIsOpen(false)}>
|
79
|
+
<Body1>
|
80
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
81
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel illum ea
|
82
|
+
fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos nostrum
|
83
|
+
placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt ullam,
|
84
|
+
dolorem labore quaerat vero maxime ab ipsa nihil.
|
85
|
+
</Body1>
|
86
|
+
</Sheet>
|
87
|
+
</>
|
88
|
+
);
|
89
|
+
};
|
90
|
+
|
91
|
+
export const WithoutOverlay: StoryObj = {
|
92
|
+
render: () => <StoryWithoutOverlay />,
|
93
|
+
};
|
94
|
+
|
95
|
+
const StoryWithScroll = ({ withOverlay, withTransition }: StorySheetProps) => {
|
96
|
+
const [isOpen, setIsOpen] = useState(false);
|
97
|
+
|
98
|
+
return (
|
99
|
+
<>
|
100
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
101
|
+
<Sheet
|
102
|
+
isOpen={isOpen}
|
103
|
+
withOverlay={withOverlay}
|
104
|
+
withTransition={withTransition}
|
105
|
+
onClose={() => setIsOpen(false)}
|
106
|
+
>
|
107
|
+
<Body1>
|
108
|
+
<Button onClick={() => setIsOpen(false)}>Закрыть</Button>
|
109
|
+
<p>
|
110
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
111
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel
|
112
|
+
illum ea fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos
|
113
|
+
nostrum placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt
|
114
|
+
ullam, dolorem labore quaerat vero maxime ab ipsa nihil.
|
115
|
+
</p>
|
116
|
+
<Button onClick={() => setIsOpen(false)}>Закрыть</Button>
|
117
|
+
<p>
|
118
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
119
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel
|
120
|
+
illum ea fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos
|
121
|
+
nostrum placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt
|
122
|
+
ullam, dolorem labore quaerat vero maxime ab ipsa nihil.
|
123
|
+
</p>
|
124
|
+
</Body1>
|
125
|
+
</Sheet>
|
126
|
+
</>
|
127
|
+
);
|
128
|
+
};
|
129
|
+
|
130
|
+
export const WithScroll: StoryObj<StorySheetProps> = {
|
131
|
+
render: (args) => <StoryWithScroll {...args} />,
|
132
|
+
};
|
133
|
+
|
134
|
+
const StoryWithInsideScroll = ({ withOverlay, withTransition }: StorySheetProps) => {
|
135
|
+
const [isOpen, setIsOpen] = useState(false);
|
136
|
+
|
137
|
+
return (
|
138
|
+
<>
|
139
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
140
|
+
<Sheet
|
141
|
+
isOpen={isOpen}
|
142
|
+
withOverlay={withOverlay}
|
143
|
+
withTransition={withTransition}
|
144
|
+
onClose={() => setIsOpen(false)}
|
145
|
+
>
|
146
|
+
<p>Вложенные кнопки</p>
|
147
|
+
<div
|
148
|
+
style={{
|
149
|
+
height: '150px',
|
150
|
+
overflow: 'scroll',
|
151
|
+
display: 'flex',
|
152
|
+
flexDirection: 'column',
|
153
|
+
gap: '1rem',
|
154
|
+
}}
|
155
|
+
>
|
156
|
+
<Button>Кнопка 1</Button>
|
157
|
+
<Button>Кнопка 2</Button>
|
158
|
+
<Button>Кнопка 3</Button>
|
159
|
+
<Button>Кнопка 4</Button>
|
160
|
+
<Button>Кнопка 5</Button>
|
161
|
+
<Button>Кнопка 6</Button>
|
162
|
+
<Button>Кнопка 7</Button>
|
163
|
+
<Button>Кнопка 8</Button>
|
164
|
+
</div>
|
165
|
+
<Body1>Lorem ipsum dolor sit amet consectetur adipisicing elit.</Body1>
|
166
|
+
</Sheet>
|
167
|
+
</>
|
168
|
+
);
|
169
|
+
};
|
170
|
+
|
171
|
+
export const WithInsideScroll: StoryObj<StorySheetProps> = {
|
172
|
+
args: {
|
173
|
+
withOverlay: true,
|
174
|
+
withTransition: true,
|
175
|
+
},
|
176
|
+
render: (args) => <StoryWithInsideScroll {...args} />,
|
177
|
+
};
|
178
|
+
|
179
|
+
const StoryWithDoubleScroll = ({ withOverlay, withTransition }: StorySheetProps) => {
|
180
|
+
const [isOpen, setIsOpen] = useState(false);
|
181
|
+
|
182
|
+
return (
|
183
|
+
<>
|
184
|
+
<Button onClick={() => setIsOpen(true)}>Открыть</Button>
|
185
|
+
<Sheet
|
186
|
+
isOpen={isOpen}
|
187
|
+
withOverlay={withOverlay}
|
188
|
+
withTransition={withTransition}
|
189
|
+
onClose={() => setIsOpen(false)}
|
190
|
+
>
|
191
|
+
<Body1>
|
192
|
+
<Button onClick={() => setIsOpen(false)}>Закрыть</Button>
|
193
|
+
<p>Вложенные кнопки</p>
|
194
|
+
<div
|
195
|
+
style={{
|
196
|
+
height: '150px',
|
197
|
+
overflow: 'scroll',
|
198
|
+
display: 'flex',
|
199
|
+
flexDirection: 'column',
|
200
|
+
gap: '1rem',
|
201
|
+
}}
|
202
|
+
>
|
203
|
+
<Button>Кнопка 1</Button>
|
204
|
+
<Button>Кнопка 2</Button>
|
205
|
+
<Button>Кнопка 3</Button>
|
206
|
+
<Button>Кнопка 4</Button>
|
207
|
+
<Button>Кнопка 5</Button>
|
208
|
+
<Button>Кнопка 6</Button>
|
209
|
+
<Button>Кнопка 7</Button>
|
210
|
+
<Button>Кнопка 8</Button>
|
211
|
+
</div>
|
212
|
+
<p>
|
213
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
214
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel
|
215
|
+
illum ea fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos
|
216
|
+
nostrum placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt
|
217
|
+
ullam, dolorem labore quaerat vero maxime ab ipsa nihil.
|
218
|
+
</p>
|
219
|
+
<Button onClick={() => setIsOpen(false)}>Закрыть</Button>
|
220
|
+
<p>
|
221
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quae tempore vitae porro laboriosam
|
222
|
+
consectetur fugiat assumenda, earum nesciunt. Distinctio minima nesciunt dicta rem quae vel
|
223
|
+
illum ea fugit molestiae dolorem? Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos
|
224
|
+
nostrum placeat, neque repudiandae consectetur voluptates soluta et sint eum obcaecati nesciunt
|
225
|
+
ullam, dolorem labore quaerat vero maxime ab ipsa nihil.
|
226
|
+
</p>
|
227
|
+
</Body1>
|
228
|
+
</Sheet>
|
229
|
+
</>
|
230
|
+
);
|
231
|
+
};
|
232
|
+
|
233
|
+
export const WithDoubleScroll: StoryObj<StorySheetProps> = {
|
234
|
+
args: {
|
235
|
+
withOverlay: true,
|
236
|
+
withTransition: true,
|
237
|
+
},
|
238
|
+
render: (args) => <StoryWithDoubleScroll {...args} />,
|
239
|
+
};
|
@@ -46,6 +46,6 @@ export * from './components/Progress';
|
|
46
46
|
export * from './components/Select';
|
47
47
|
export * from './components/Divider';
|
48
48
|
export * from './components/Toolbar';
|
49
|
+
export * from './components/Sheet';
|
49
50
|
export * from './components/Slider';
|
50
|
-
export * from './components/Range';
|
51
|
-
export * from './components/Accordion';
|
51
|
+
export * from './components/Range';
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { RootProps } from '../../engines';
|
3
|
+
import { SheetProps } from './Sheet.types';
|
4
|
+
/**
|
5
|
+
* Открывает окно-шторку поверх основного экрана.
|
6
|
+
*/
|
7
|
+
export declare const sheetRoot: (Root: RootProps<HTMLDivElement, SheetProps>) => React.ForwardRefExoticComponent<SheetProps & React.RefAttributes<HTMLDivElement>>;
|
8
|
+
export declare const sheetConfig: {
|
9
|
+
name: string;
|
10
|
+
tag: string;
|
11
|
+
layout: (Root: RootProps<HTMLDivElement, SheetProps>) => React.ForwardRefExoticComponent<SheetProps & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
base: string;
|
13
|
+
variations: {
|
14
|
+
view: {
|
15
|
+
css: import("@linaria/core").LinariaClassName;
|
16
|
+
};
|
17
|
+
};
|
18
|
+
defaults: {
|
19
|
+
view: string;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
//# sourceMappingURL=Sheet.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAY3C;;GAEG;AAEH,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,UAAU,CAAC,sFAkDhE,CAAC;AAEN,eAAO,MAAM,WAAW;;;mBApDQ,UAAU,cAAc,EAAE,UAAU,CAAC;;;;;;;;;;CAiEpE,CAAC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const StyledWrapper: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Pick<import("./Sheet.types").SheetProps, "isOpen" | "withTransition"> & {
|
3
|
+
theme: import("./Sheet.types").ThemeProviderContext;
|
4
|
+
}>;
|
5
|
+
export declare const StyledContentWrapper: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Pick<import("./Sheet.types").SheetProps, "isOpen" | "withTransition"> & {
|
6
|
+
theme: import("./Sheet.types").ThemeProviderContext;
|
7
|
+
}>;
|
8
|
+
export declare const StyledOverlay: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
9
|
+
withOverlay: boolean;
|
10
|
+
}>;
|
11
|
+
export declare const StyledSheetContent: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
12
|
+
export declare const StyledSheetHandle: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
13
|
+
//# sourceMappingURL=Sheet.styles.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Sheet.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.styles.ts"],"names":[],"mappings":";AAMA,eAAO,MAAM,aAAa;;EAczB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;EAiBhC,CAAC;AAEF,eAAO,MAAM,aAAa;iBAA6B,OAAO;EAQ7D,CAAC;AAEF,eAAO,MAAM,kBAAkB,qKAY9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,qKAc7B,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Sheet.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;CAEnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;CAMlB,CAAC"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
export interface SheetProps extends React.HTMLAttributes<HTMLDivElement> {
|
3
|
+
/**
|
4
|
+
* Состояние шторки, открыта или скрыта
|
5
|
+
*/
|
6
|
+
isOpen: boolean;
|
7
|
+
/**
|
8
|
+
* Обработчик закрытия шторки. Вызывается при клике по оверлею или смахиванию шторки вниз
|
9
|
+
*/
|
10
|
+
onClose: () => void;
|
11
|
+
/**
|
12
|
+
* Наличие оверлея шторки. Если включен, то контент под шторкой перекрывается оверлеем, при нажатии на
|
13
|
+
* который шторка закрывается.
|
14
|
+
*/
|
15
|
+
withOverlay?: boolean;
|
16
|
+
children?: ReactNode;
|
17
|
+
/**
|
18
|
+
* Наличие состояния анимации/перехода, по-умолчанию true.
|
19
|
+
*/
|
20
|
+
withTransition?: boolean;
|
21
|
+
/**
|
22
|
+
* Throttling внутренних обработчиков события onScroll
|
23
|
+
*/
|
24
|
+
throttleMs?: number;
|
25
|
+
view?: string;
|
26
|
+
}
|
27
|
+
export interface ThemeProviderContext {
|
28
|
+
lowPerformance: boolean;
|
29
|
+
[key: string]: unknown;
|
30
|
+
}
|
31
|
+
export declare type CommonProps = Pick<SheetProps, 'withTransition' | 'isOpen'> & {
|
32
|
+
theme: ThemeProviderContext;
|
33
|
+
};
|
34
|
+
export declare type SheetHookArgs = Pick<SheetProps, 'isOpen'>;
|
35
|
+
//# sourceMappingURL=Sheet.types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Sheet.types.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACjC,cAAc,EAAE,OAAO,CAAC;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,oBAAY,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,gBAAgB,GAAG,QAAQ,CAAC,GAAG;IACtE,KAAK,EAAE,oBAAoB,CAAC;CAC/B,CAAC;AAEF,oBAAY,aAAa,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useSheet.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/hooks/useSheet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,QAAQ,eAAgB,aAAa,SAgBjD,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare const useSheetSwipe: (args: {
|
3
|
+
contentWrapperRef: React.RefObject<HTMLDivElement>;
|
4
|
+
contentRef: React.RefObject<HTMLDivElement>;
|
5
|
+
handleRef: React.RefObject<HTMLDivElement>;
|
6
|
+
throttleMs?: number | undefined;
|
7
|
+
onClose: () => void;
|
8
|
+
}) => void;
|
9
|
+
//# sourceMappingURL=useSheetSwipe.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useSheetSwipe.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/hooks/useSheetSwipe.ts"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAoB3D,eAAO,MAAM,aAAa;uBACH,MAAM,SAAS,CAAC,cAAc,CAAC;gBACtC,MAAM,SAAS,CAAC,cAAc,CAAC;eAChC,MAAM,SAAS,CAAC,cAAc,CAAC;;aAEjC,MAAM,IAAI;UA6FtB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/hooks/useThemeContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,oBAElC,CAAC"}
|