@semcore/side-panel 2.0.19 → 2.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/cjs/SidePanel.js +16 -16
- package/lib/cjs/index.d.js +2 -0
- package/lib/cjs/index.d.js.map +1 -0
- package/lib/es6/SidePanel.js +16 -16
- package/lib/es6/index.d.js +2 -0
- package/lib/es6/index.d.js.map +1 -0
- package/package.json +3 -2
- package/lib/cjs/index.d.ts +0 -70
- package/lib/es6/index.d.ts +0 -70
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [2.0.20] - 2022-10-04
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/utils` [3.37.1 ~> 3.37.2], `@semcore/animation` [1.5.10 ~> 1.5.11], `@semcore/flex-box` [4.5.11 ~> 4.5.12], `@semcore/portal` [2.3.12 ~> 2.3.13], `@semcore/outside-click` [2.4.13 ~> 2.4.14], `@semcore/icon` [2.32.1 ~> 2.32.2]).
|
|
10
|
+
|
|
5
11
|
## [2.0.19] - 2022-09-29
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/lib/cjs/SidePanel.js
CHANGED
|
@@ -75,25 +75,25 @@ var style = (
|
|
|
75
75
|
/*__reshadow_css_start__*/
|
|
76
76
|
_core.sstyled.insert(
|
|
77
77
|
/*__inner_css_start__*/
|
|
78
|
-
".
|
|
78
|
+
".___SOverlay_sa1wj_gg_{position:fixed;top:0;bottom:0;left:0;right:0;margin:0;display:flex;overflow:hidden;z-index:10005;background:rgba(25,27,35,.7);-webkit-overflow-scrolling:touch}.___SPanel_sa1wj_gg_{display:flex;flex-direction:column;width:260px;outline:none;font-family:Inter,sans-serif;position:fixed;box-sizing:border-box;will-change:transform;background:#fff;z-index:1}.___SPanel_sa1wj_gg_._placement_top_sa1wj_gg_{box-shadow:1px 0 12px rgba(25,27,35,.15);width:100%;margin-bottom:auto;top:0;left:0}.___SPanel_sa1wj_gg_._placement_right_sa1wj_gg_{box-shadow:0px 1px 12px 0px rgba(25, 27, 35, 0.15);height:100vh;margin-left:auto;top:0;right:0}.___SPanel_sa1wj_gg_._placement_bottom_sa1wj_gg_{box-shadow:1px 0 12px rgba(25,27,35,.15);width:100%;margin-top:auto;bottom:0;left:0}.___SPanel_sa1wj_gg_._placement_left_sa1wj_gg_{box-shadow:0px 1px 12px 0px rgba(25, 27, 35, 0.15);height:100vh;margin-right:auto;top:0;left:0}.panel-right--enter{transform:translate(100%)}.panel-left--enter{transform:translate(-100%)}.panel-bottom--enter{transform:translateY(100%)}.panel-bottom--enter-active,.panel-bottom--exit,.panel-left--enter-active,.panel-left--exit,.panel-right--enter-active,.panel-right--exit{transform:translate(0)}.panel-right--exit-active{transform:translate(100%)}.panel-left--exit-active{transform:translate(-100%)}.panel-bottom--exit-active{transform:translateY(100%)}.___SClose_sa1wj_gg_{cursor:pointer;position:absolute;z-index:1;display:inline-flex;right:0;top:0;padding:12px 12px 16px 12px;color:#a9abb6;border:none;background:none;outline:none}.___SClose_sa1wj_gg_:hover{color:#8a8e9b}.___SClose_sa1wj_gg_.__keyboardFocused_sa1wj_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SBack_sa1wj_gg_{display:flex;align-items:center;color:#6c6e79;font-size:12px;line-height:1.33;margin-bottom:4px;cursor:pointer}.___SBack_sa1wj_gg_:hover{color:#484a54}.___SBackText_sa1wj_gg_{margin-left:4px;font-size:12px;line-height:1.42;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___STitle_sa1wj_gg_{font-size:16px;line-height:1.5;font-weight:700;color:#191b23;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SHeader_sa1wj_gg_{padding-left:24px;padding-bottom:4px;padding-right:56px;padding-top:4px;min-height:52px;box-shadow:inset 0 -1px 0 #c4c7cf;box-sizing:border-box}.___SFooter_sa1wj_gg_{min-height:44px;box-shadow:inset 0 1px 0 #c4c7cf;box-sizing:border-box}.___SBody_sa1wj_gg_{height:100%;overflow:auto;padding-left:24px;padding-bottom:4px;padding-right:40px;padding-top:16px}"
|
|
79
79
|
/*__inner_css_end__*/
|
|
80
|
-
, "
|
|
80
|
+
, "sa1wj_gg_")
|
|
81
81
|
/*__reshadow_css_end__*/
|
|
82
82
|
, {
|
|
83
|
-
"__SOverlay": "
|
|
84
|
-
"__SPanel": "
|
|
85
|
-
"_placement_top": "
|
|
86
|
-
"_placement_right": "
|
|
87
|
-
"_placement_bottom": "
|
|
88
|
-
"_placement_left": "
|
|
89
|
-
"__SClose": "
|
|
90
|
-
"_keyboardFocused": "
|
|
91
|
-
"__SBack": "
|
|
92
|
-
"__SBackText": "
|
|
93
|
-
"__STitle": "
|
|
94
|
-
"__SHeader": "
|
|
95
|
-
"__SFooter": "
|
|
96
|
-
"__SBody": "
|
|
83
|
+
"__SOverlay": "___SOverlay_sa1wj_gg_",
|
|
84
|
+
"__SPanel": "___SPanel_sa1wj_gg_",
|
|
85
|
+
"_placement_top": "_placement_top_sa1wj_gg_",
|
|
86
|
+
"_placement_right": "_placement_right_sa1wj_gg_",
|
|
87
|
+
"_placement_bottom": "_placement_bottom_sa1wj_gg_",
|
|
88
|
+
"_placement_left": "_placement_left_sa1wj_gg_",
|
|
89
|
+
"__SClose": "___SClose_sa1wj_gg_",
|
|
90
|
+
"_keyboardFocused": "__keyboardFocused_sa1wj_gg_",
|
|
91
|
+
"__SBack": "___SBack_sa1wj_gg_",
|
|
92
|
+
"__SBackText": "___SBackText_sa1wj_gg_",
|
|
93
|
+
"__STitle": "___STitle_sa1wj_gg_",
|
|
94
|
+
"__SHeader": "___SHeader_sa1wj_gg_",
|
|
95
|
+
"__SFooter": "___SFooter_sa1wj_gg_",
|
|
96
|
+
"__SBody": "___SBody_sa1wj_gg_"
|
|
97
97
|
});
|
|
98
98
|
var placementTransformMap = {
|
|
99
99
|
top: ['translate(0, -100%)', 'translate(0, 0)'],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React, { ComponentProps } from 'react';\nimport { IPortalProps } from '@semcore/portal';\nimport { IFadeInOutProps, ITransformProps } from '@semcore/animation';\nimport { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { Box, IBoxProps, Flex } from '@semcore/flex-box';\nimport { Text } from '@semcore/typography';\n\nexport type OnCloseTriggerType = 'onOutsideClick' | 'onEscape' | 'onCloseClick';\nexport type OnCloseType = (\n trigger: OnCloseTriggerType,\n e?: React.MouseEvent | React.KeyboardEvent,\n) => void;\n\nexport type SidePanelPlacement = 'top' | 'left' | 'right' | 'bottom';\n\nexport interface ISidePanelProps extends IPortalProps {\n /** Animation display duration in ms\n * @default 350\n */\n duration?: number;\n /**\n * The property responsible for the visibility of the component\n */\n visible?: boolean;\n /**\n * Callback for the component closure\n */\n onClose?: OnCloseType;\n /**\n * Property for displaying the close button\n * @default true\n */\n closable?: boolean;\n /**\n * Position of a dropdown window\n * @default right\n */\n placement?: SidePanelPlacement;\n}\n\nexport interface ISidePanelOverlayProps extends IFadeInOutProps, IBoxProps {}\n\nexport interface ISidePanelPanelProps extends ITransformProps, IBoxProps {\n onOutsideClick?: (e?: React.SyntheticEvent) => void;\n}\n\nexport interface ISidePanelContext {\n getOverlayProps?: PropGetterFn;\n getPanelProps?: PropGetterFn;\n getCloseProps?: PropGetterFn;\n}\n\nexport interface ISidePanelHeaderProps extends IBoxProps {\n title?: React.ReactNode;\n}\n\ndeclare const SidePanel: (<T>(\n props: CProps<ISidePanelProps & T, ISidePanelContext>,\n) => ReturnEl) & {\n Header: <T>(props: ISidePanelHeaderProps & T) => ReturnEl;\n Back: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;\n Body: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;\n Footer: <T>(props: ComponentProps<typeof Flex> & T) => ReturnEl;\n Title: <T>(props: ComponentProps<typeof Text> & T) => ReturnEl;\n Overlay: <T>(props: ISidePanelOverlayProps & T) => ReturnEl;\n Panel: <T>(props: ISidePanelPanelProps & T) => ReturnEl;\n Close: typeof Box;\n};\n\nexport default SidePanel;\n"],"mappings":""}
|
package/lib/es6/SidePanel.js
CHANGED
|
@@ -48,25 +48,25 @@ var style = (
|
|
|
48
48
|
/*__reshadow_css_start__*/
|
|
49
49
|
_sstyled.insert(
|
|
50
50
|
/*__inner_css_start__*/
|
|
51
|
-
".
|
|
51
|
+
".___SOverlay_sa1wj_gg_{position:fixed;top:0;bottom:0;left:0;right:0;margin:0;display:flex;overflow:hidden;z-index:10005;background:rgba(25,27,35,.7);-webkit-overflow-scrolling:touch}.___SPanel_sa1wj_gg_{display:flex;flex-direction:column;width:260px;outline:none;font-family:Inter,sans-serif;position:fixed;box-sizing:border-box;will-change:transform;background:#fff;z-index:1}.___SPanel_sa1wj_gg_._placement_top_sa1wj_gg_{box-shadow:1px 0 12px rgba(25,27,35,.15);width:100%;margin-bottom:auto;top:0;left:0}.___SPanel_sa1wj_gg_._placement_right_sa1wj_gg_{box-shadow:0px 1px 12px 0px rgba(25, 27, 35, 0.15);height:100vh;margin-left:auto;top:0;right:0}.___SPanel_sa1wj_gg_._placement_bottom_sa1wj_gg_{box-shadow:1px 0 12px rgba(25,27,35,.15);width:100%;margin-top:auto;bottom:0;left:0}.___SPanel_sa1wj_gg_._placement_left_sa1wj_gg_{box-shadow:0px 1px 12px 0px rgba(25, 27, 35, 0.15);height:100vh;margin-right:auto;top:0;left:0}.panel-right--enter{transform:translate(100%)}.panel-left--enter{transform:translate(-100%)}.panel-bottom--enter{transform:translateY(100%)}.panel-bottom--enter-active,.panel-bottom--exit,.panel-left--enter-active,.panel-left--exit,.panel-right--enter-active,.panel-right--exit{transform:translate(0)}.panel-right--exit-active{transform:translate(100%)}.panel-left--exit-active{transform:translate(-100%)}.panel-bottom--exit-active{transform:translateY(100%)}.___SClose_sa1wj_gg_{cursor:pointer;position:absolute;z-index:1;display:inline-flex;right:0;top:0;padding:12px 12px 16px 12px;color:#a9abb6;border:none;background:none;outline:none}.___SClose_sa1wj_gg_:hover{color:#8a8e9b}.___SClose_sa1wj_gg_.__keyboardFocused_sa1wj_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SBack_sa1wj_gg_{display:flex;align-items:center;color:#6c6e79;font-size:12px;line-height:1.33;margin-bottom:4px;cursor:pointer}.___SBack_sa1wj_gg_:hover{color:#484a54}.___SBackText_sa1wj_gg_{margin-left:4px;font-size:12px;line-height:1.42;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___STitle_sa1wj_gg_{font-size:16px;line-height:1.5;font-weight:700;color:#191b23;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SHeader_sa1wj_gg_{padding-left:24px;padding-bottom:4px;padding-right:56px;padding-top:4px;min-height:52px;box-shadow:inset 0 -1px 0 #c4c7cf;box-sizing:border-box}.___SFooter_sa1wj_gg_{min-height:44px;box-shadow:inset 0 1px 0 #c4c7cf;box-sizing:border-box}.___SBody_sa1wj_gg_{height:100%;overflow:auto;padding-left:24px;padding-bottom:4px;padding-right:40px;padding-top:16px}"
|
|
52
52
|
/*__inner_css_end__*/
|
|
53
|
-
, "
|
|
53
|
+
, "sa1wj_gg_")
|
|
54
54
|
/*__reshadow_css_end__*/
|
|
55
55
|
, {
|
|
56
|
-
"__SOverlay": "
|
|
57
|
-
"__SPanel": "
|
|
58
|
-
"_placement_top": "
|
|
59
|
-
"_placement_right": "
|
|
60
|
-
"_placement_bottom": "
|
|
61
|
-
"_placement_left": "
|
|
62
|
-
"__SClose": "
|
|
63
|
-
"_keyboardFocused": "
|
|
64
|
-
"__SBack": "
|
|
65
|
-
"__SBackText": "
|
|
66
|
-
"__STitle": "
|
|
67
|
-
"__SHeader": "
|
|
68
|
-
"__SFooter": "
|
|
69
|
-
"__SBody": "
|
|
56
|
+
"__SOverlay": "___SOverlay_sa1wj_gg_",
|
|
57
|
+
"__SPanel": "___SPanel_sa1wj_gg_",
|
|
58
|
+
"_placement_top": "_placement_top_sa1wj_gg_",
|
|
59
|
+
"_placement_right": "_placement_right_sa1wj_gg_",
|
|
60
|
+
"_placement_bottom": "_placement_bottom_sa1wj_gg_",
|
|
61
|
+
"_placement_left": "_placement_left_sa1wj_gg_",
|
|
62
|
+
"__SClose": "___SClose_sa1wj_gg_",
|
|
63
|
+
"_keyboardFocused": "__keyboardFocused_sa1wj_gg_",
|
|
64
|
+
"__SBack": "___SBack_sa1wj_gg_",
|
|
65
|
+
"__SBackText": "___SBackText_sa1wj_gg_",
|
|
66
|
+
"__STitle": "___STitle_sa1wj_gg_",
|
|
67
|
+
"__SHeader": "___SHeader_sa1wj_gg_",
|
|
68
|
+
"__SFooter": "___SFooter_sa1wj_gg_",
|
|
69
|
+
"__SBody": "___SBody_sa1wj_gg_"
|
|
70
70
|
});
|
|
71
71
|
var placementTransformMap = {
|
|
72
72
|
top: ['translate(0, -100%)', 'translate(0, 0)'],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React, { ComponentProps } from 'react';\nimport { IPortalProps } from '@semcore/portal';\nimport { IFadeInOutProps, ITransformProps } from '@semcore/animation';\nimport { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { Box, IBoxProps, Flex } from '@semcore/flex-box';\nimport { Text } from '@semcore/typography';\n\nexport type OnCloseTriggerType = 'onOutsideClick' | 'onEscape' | 'onCloseClick';\nexport type OnCloseType = (\n trigger: OnCloseTriggerType,\n e?: React.MouseEvent | React.KeyboardEvent,\n) => void;\n\nexport type SidePanelPlacement = 'top' | 'left' | 'right' | 'bottom';\n\nexport interface ISidePanelProps extends IPortalProps {\n /** Animation display duration in ms\n * @default 350\n */\n duration?: number;\n /**\n * The property responsible for the visibility of the component\n */\n visible?: boolean;\n /**\n * Callback for the component closure\n */\n onClose?: OnCloseType;\n /**\n * Property for displaying the close button\n * @default true\n */\n closable?: boolean;\n /**\n * Position of a dropdown window\n * @default right\n */\n placement?: SidePanelPlacement;\n}\n\nexport interface ISidePanelOverlayProps extends IFadeInOutProps, IBoxProps {}\n\nexport interface ISidePanelPanelProps extends ITransformProps, IBoxProps {\n onOutsideClick?: (e?: React.SyntheticEvent) => void;\n}\n\nexport interface ISidePanelContext {\n getOverlayProps?: PropGetterFn;\n getPanelProps?: PropGetterFn;\n getCloseProps?: PropGetterFn;\n}\n\nexport interface ISidePanelHeaderProps extends IBoxProps {\n title?: React.ReactNode;\n}\n\ndeclare const SidePanel: (<T>(\n props: CProps<ISidePanelProps & T, ISidePanelContext>,\n) => ReturnEl) & {\n Header: <T>(props: ISidePanelHeaderProps & T) => ReturnEl;\n Back: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;\n Body: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;\n Footer: <T>(props: ComponentProps<typeof Flex> & T) => ReturnEl;\n Title: <T>(props: ComponentProps<typeof Text> & T) => ReturnEl;\n Overlay: <T>(props: ISidePanelOverlayProps & T) => ReturnEl;\n Panel: <T>(props: ISidePanelPanelProps & T) => ReturnEl;\n Close: typeof Box;\n};\n\nexport default SidePanel;\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/side-panel",
|
|
3
3
|
"description": "Semrush SidePanel Component",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.20",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "
|
|
12
|
+
"build": "pnpm semcore-builder --source=js",
|
|
13
13
|
"test": "jest"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"directory": "semcore/side-panel"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
+
"@types/react": "16.8 - 17",
|
|
38
39
|
"@semcore/jest-preset-ui": "1.0.0"
|
|
39
40
|
}
|
|
40
41
|
}
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
|
2
|
-
import { IPortalProps } from '@semcore/portal';
|
|
3
|
-
import { IFadeInOutProps, ITransformProps } from '@semcore/animation';
|
|
4
|
-
import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
|
|
5
|
-
import { Box, IBoxProps, Flex } from '@semcore/flex-box';
|
|
6
|
-
import { Text } from '@semcore/typography';
|
|
7
|
-
|
|
8
|
-
export type OnCloseTriggerType = 'onOutsideClick' | 'onEscape' | 'onCloseClick';
|
|
9
|
-
export type OnCloseType = (
|
|
10
|
-
trigger: OnCloseTriggerType,
|
|
11
|
-
e?: React.MouseEvent | React.KeyboardEvent,
|
|
12
|
-
) => void;
|
|
13
|
-
|
|
14
|
-
export type SidePanelPlacement = 'top' | 'left' | 'right' | 'bottom';
|
|
15
|
-
|
|
16
|
-
export interface ISidePanelProps extends IPortalProps {
|
|
17
|
-
/** Animation display duration in ms
|
|
18
|
-
* @default 350
|
|
19
|
-
*/
|
|
20
|
-
duration?: number;
|
|
21
|
-
/**
|
|
22
|
-
* The property responsible for the visibility of the component
|
|
23
|
-
*/
|
|
24
|
-
visible?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Callback for the component closure
|
|
27
|
-
*/
|
|
28
|
-
onClose?: OnCloseType;
|
|
29
|
-
/**
|
|
30
|
-
* Property for displaying the close button
|
|
31
|
-
* @default true
|
|
32
|
-
*/
|
|
33
|
-
closable?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Position of a dropdown window
|
|
36
|
-
* @default right
|
|
37
|
-
*/
|
|
38
|
-
placement?: SidePanelPlacement;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ISidePanelOverlayProps extends IFadeInOutProps, IBoxProps {}
|
|
42
|
-
|
|
43
|
-
export interface ISidePanelPanelProps extends ITransformProps, IBoxProps {
|
|
44
|
-
onOutsideClick?: (e?: React.SyntheticEvent) => void;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface ISidePanelContext {
|
|
48
|
-
getOverlayProps?: PropGetterFn;
|
|
49
|
-
getPanelProps?: PropGetterFn;
|
|
50
|
-
getCloseProps?: PropGetterFn;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface ISidePanelHeaderProps extends IBoxProps {
|
|
54
|
-
title?: React.ReactNode;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
declare const SidePanel: (<T>(
|
|
58
|
-
props: CProps<ISidePanelProps & T, ISidePanelContext>,
|
|
59
|
-
) => ReturnEl) & {
|
|
60
|
-
Header: <T>(props: ISidePanelHeaderProps & T) => ReturnEl;
|
|
61
|
-
Back: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
62
|
-
Body: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
63
|
-
Footer: <T>(props: ComponentProps<typeof Flex> & T) => ReturnEl;
|
|
64
|
-
Title: <T>(props: ComponentProps<typeof Text> & T) => ReturnEl;
|
|
65
|
-
Overlay: <T>(props: ISidePanelOverlayProps & T) => ReturnEl;
|
|
66
|
-
Panel: <T>(props: ISidePanelPanelProps & T) => ReturnEl;
|
|
67
|
-
Close: typeof Box;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export default SidePanel;
|
package/lib/es6/index.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
|
2
|
-
import { IPortalProps } from '@semcore/portal';
|
|
3
|
-
import { IFadeInOutProps, ITransformProps } from '@semcore/animation';
|
|
4
|
-
import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
|
|
5
|
-
import { Box, IBoxProps, Flex } from '@semcore/flex-box';
|
|
6
|
-
import { Text } from '@semcore/typography';
|
|
7
|
-
|
|
8
|
-
export type OnCloseTriggerType = 'onOutsideClick' | 'onEscape' | 'onCloseClick';
|
|
9
|
-
export type OnCloseType = (
|
|
10
|
-
trigger: OnCloseTriggerType,
|
|
11
|
-
e?: React.MouseEvent | React.KeyboardEvent,
|
|
12
|
-
) => void;
|
|
13
|
-
|
|
14
|
-
export type SidePanelPlacement = 'top' | 'left' | 'right' | 'bottom';
|
|
15
|
-
|
|
16
|
-
export interface ISidePanelProps extends IPortalProps {
|
|
17
|
-
/** Animation display duration in ms
|
|
18
|
-
* @default 350
|
|
19
|
-
*/
|
|
20
|
-
duration?: number;
|
|
21
|
-
/**
|
|
22
|
-
* The property responsible for the visibility of the component
|
|
23
|
-
*/
|
|
24
|
-
visible?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Callback for the component closure
|
|
27
|
-
*/
|
|
28
|
-
onClose?: OnCloseType;
|
|
29
|
-
/**
|
|
30
|
-
* Property for displaying the close button
|
|
31
|
-
* @default true
|
|
32
|
-
*/
|
|
33
|
-
closable?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Position of a dropdown window
|
|
36
|
-
* @default right
|
|
37
|
-
*/
|
|
38
|
-
placement?: SidePanelPlacement;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ISidePanelOverlayProps extends IFadeInOutProps, IBoxProps {}
|
|
42
|
-
|
|
43
|
-
export interface ISidePanelPanelProps extends ITransformProps, IBoxProps {
|
|
44
|
-
onOutsideClick?: (e?: React.SyntheticEvent) => void;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface ISidePanelContext {
|
|
48
|
-
getOverlayProps?: PropGetterFn;
|
|
49
|
-
getPanelProps?: PropGetterFn;
|
|
50
|
-
getCloseProps?: PropGetterFn;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface ISidePanelHeaderProps extends IBoxProps {
|
|
54
|
-
title?: React.ReactNode;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
declare const SidePanel: (<T>(
|
|
58
|
-
props: CProps<ISidePanelProps & T, ISidePanelContext>,
|
|
59
|
-
) => ReturnEl) & {
|
|
60
|
-
Header: <T>(props: ISidePanelHeaderProps & T) => ReturnEl;
|
|
61
|
-
Back: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
62
|
-
Body: <T>(props: ComponentProps<typeof Box> & T) => ReturnEl;
|
|
63
|
-
Footer: <T>(props: ComponentProps<typeof Flex> & T) => ReturnEl;
|
|
64
|
-
Title: <T>(props: ComponentProps<typeof Text> & T) => ReturnEl;
|
|
65
|
-
Overlay: <T>(props: ISidePanelOverlayProps & T) => ReturnEl;
|
|
66
|
-
Panel: <T>(props: ISidePanelPanelProps & T) => ReturnEl;
|
|
67
|
-
Close: typeof Box;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export default SidePanel;
|