@semcore/side-panel 2.0.19 → 2.0.21

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 CHANGED
@@ -2,101 +2,11 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [2.0.19] - 2022-09-29
5
+ ## [2.0.21] - 2022-10-06
6
6
 
7
7
  ### Changed
8
8
 
9
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.4 ~> 2.31.0]).
10
-
11
- ## [2.0.18] - 2022-09-21
12
-
13
- ### Changed
14
-
15
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.3 ~> 2.30.4]).
16
-
17
- ## [2.0.17] - 2022-09-21
18
-
19
- ### Changed
20
-
21
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.2 ~> 2.30.3]).
22
-
23
- ## [2.0.16] - 2022-08-30
24
-
25
- ### Changed
26
-
27
- - Version patch update due to children dependencies update (`@semcore/utils` [3.37.0 ~> 3.37.1], `@semcore/animation` [1.5.9 ~> 1.5.10], `@semcore/flex-box` [4.5.10 ~> 4.5.11], `@semcore/portal` [2.3.11 ~> 2.3.12], `@semcore/outside-click` [2.4.12 ~> 2.4.13], `@semcore/icon` [2.30.1 ~> 2.30.2]).
28
-
29
- ## [2.0.15] - 2022-08-29
30
-
31
- ### Changed
32
-
33
- - Version patch update due to children dependencies update (`@semcore/animation` [1.5.8 ~> 1.5.9]).
34
-
35
- ## [2.0.14] - 2022-08-18
36
-
37
- ### Changed
38
-
39
- - Version patch update due to children dependencies update (`@semcore/icon` [2.30.0 ~> 2.30.1]).
40
-
41
- ## [2.0.13] - 2022-08-18
42
-
43
- ### Changed
44
-
45
- - Version patch update due to children dependencies update (`@semcore/icon` [2.29.5 ~> 2.30.0]).
46
-
47
- ## [2.0.12] - 2022-08-18
48
-
49
- ### Changed
50
-
51
- - Version patch update due to children dependencies update (`@semcore/utils` [3.36.0 ~> 3.37.0], `@semcore/animation` [1.5.7 ~> 1.5.8], `@semcore/flex-box` [4.5.9 ~> 4.5.10], `@semcore/portal` [2.3.10 ~> 2.3.11], `@semcore/outside-click` [2.4.11 ~> 2.4.12], `@semcore/icon` [2.29.4 ~> 2.29.5]).
52
-
53
- ## [2.0.11] - 2022-08-11
54
-
55
- ### Changed
56
-
57
- - Version patch update due to children dependencies update (`@semcore/utils` [3.35.1 ~> 3.36.0], `@semcore/animation` [1.5.6 ~> 1.5.7], `@semcore/flex-box` [4.5.8 ~> 4.5.9], `@semcore/portal` [2.3.9 ~> 2.3.10], `@semcore/typography` [4.0.11 ~> 4.1.0], `@semcore/outside-click` [2.4.10 ~> 2.4.11], `@semcore/icon` [2.29.3 ~> 2.29.4]).
58
-
59
- ## [2.0.10] - 2022-07-25
60
-
61
- ### Changed
62
-
63
- - Version patch update due to children dependencies update (`@semcore/icon` [2.29.1 ~> 2.29.2]).
64
-
65
- ## [2.0.9] - 2022-07-22
66
-
67
- ### Changed
68
-
69
- - Version patch update due to children dependencies update (`@semcore/utils` [3.34.0 ~> 3.35.0], `@semcore/animation` [1.5.4 ~> 1.5.5], `@semcore/flex-box` [4.5.6 ~> 4.5.7], `@semcore/portal` [2.3.7 ~> 2.3.8], `@semcore/outside-click` [2.4.7 ~> 2.4.8], `@semcore/icon` [2.29.0 ~> 2.29.1]).
70
-
71
- ## [2.0.8] - 2022-07-21
72
-
73
- ### Changed
74
-
75
- - Version patch update due to children dependencies update (`@semcore/icon` [2.28.0 ~> 2.29.0]).
76
-
77
- ## [2.0.7] - 2022-07-07
78
-
79
- ### Changed
80
-
81
- - Version patch update due to children dependencies update (`@semcore/utils` [3.33.0 ~> 3.34.0], `@semcore/animation` [1.5.3 ~> 1.5.4], `@semcore/flex-box` [4.5.5 ~> 4.5.6], `@semcore/portal` [2.3.6 ~> 2.3.7], `@semcore/outside-click` [2.4.6 ~> 2.4.7], `@semcore/icon` [2.27.0 ~> 2.28.0]).
82
-
83
- ## [2.0.6] - 2022-06-02
84
-
85
- ### Changed
86
-
87
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.2 ~> 3.33.0], `@semcore/animation` [1.5.2 ~> 1.5.3], `@semcore/flex-box` [4.5.4 ~> 4.5.5], `@semcore/portal` [2.3.5 ~> 2.3.6], `@semcore/outside-click` [2.4.5 ~> 2.4.6], `@semcore/icon` [2.26.1 ~> 2.27.0]).
88
-
89
- ## [2.0.5] - 2022-05-31
90
-
91
- ### Changed
92
-
93
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.1 ~> 3.32.2], `@semcore/animation` [1.5.1 ~> 1.5.2], `@semcore/flex-box` [4.5.3 ~> 4.5.4], `@semcore/portal` [2.3.4 ~> 2.3.5], `@semcore/outside-click` [2.4.4 ~> 2.4.5], `@semcore/icon` [2.26.0 ~> 2.26.1]).
94
-
95
- ## [2.0.4] - 2022-05-23
96
-
97
- ### Changed
98
-
99
- - Version patch update due to children dependencies update (`@semcore/icon` [2.25.1 ~> 2.26.0]).
9
+ - Version patch update due to children dependencies update (`@semcore/icon` [2.32.2 ~> 2.33.0]).
100
10
 
101
11
  ## [2.0.3] - 2022-05-19
102
12
 
@@ -110,12 +20,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
110
20
 
111
21
  - Version patch update due to children dependencies update (`@semcore/utils` [3.32.0 ~> 3.32.1], `@semcore/animation` [1.5.0 ~> 1.5.1], `@semcore/flex-box` [4.5.1 ~> 4.5.3], `@semcore/portal` [2.3.3 ~> 2.3.4], `@semcore/typography` [4.0.1 ~> 4.0.3], `@semcore/outside-click` [2.4.3 ~> 2.4.4], `@semcore/icon` [2.25.0 ~> 2.25.1]).
112
22
 
113
- ## [2.0.1] - 2022-05-18
114
-
115
- ### Changed
116
-
117
- - Version patch update due to children dependencies update (`@semcore/icon` [2.24.0 ~> 2.25.0]).
118
-
119
23
  ## [2.0.0] - 2022-05-17
120
24
 
121
25
  ### BREAK
@@ -132,24 +36,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
132
36
 
133
37
  - Version patch update due to children dependencies update (`@semcore/icon` [2.21.0 ~> 2.24.0]).
134
38
 
135
- ## [1.3.7] - 2022-04-28
136
-
137
- ### Changed
138
-
139
- - Version patch update due to children dependencies update (`@semcore/icon` [2.20.0 ~> 2.21.0]).
140
-
141
- ## [1.3.6] - 2022-04-03
142
-
143
- ### Changed
144
-
145
- - Version patch update due to children dependencies update (`@semcore/animation` [1.5.0 ~> 1.5.0]).
146
-
147
- ## [1.3.5] - 2022-03-21
148
-
149
- ### Changed
150
-
151
- - Version patch update due to children dependencies update (`@semcore/icon` [2.19.4 ~> 2.20.0]).
152
-
153
39
  ## [1.3.4] - 2022-03-09
154
40
 
155
41
  ### Fixed
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright ©, 2022, Semrush Inc. (written by Roman Lysov, Sergey Kobets, Mikhail Karachev, Julia Mnizhek, Elena Krasnopolskaia, Mikhail Sereniti).
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -75,25 +75,25 @@ var style = (
75
75
  /*__reshadow_css_start__*/
76
76
  _core.sstyled.insert(
77
77
  /*__inner_css_start__*/
78
- ".___SOverlay_qyft7_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_qyft7_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_qyft7_gg_._placement_top_qyft7_gg_{box-shadow:1px 0 12px rgba(25,27,35,.15);width:100%;margin-bottom:auto;top:0;left:0}.___SPanel_qyft7_gg_._placement_right_qyft7_gg_{box-shadow:0px 1px 12px 0px rgba(25, 27, 35, 0.15);height:100vh;margin-left:auto;top:0;right:0}.___SPanel_qyft7_gg_._placement_bottom_qyft7_gg_{box-shadow:1px 0 12px rgba(25,27,35,.15);width:100%;margin-top:auto;bottom:0;left:0}.___SPanel_qyft7_gg_._placement_left_qyft7_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_qyft7_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_qyft7_gg_:hover{color:#8a8e9b}.___SClose_qyft7_gg_.__keyboardFocused_qyft7_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SBack_qyft7_gg_{display:flex;align-items:center;color:#6c6e79;font-size:12px;line-height:1.33;margin-bottom:4px;cursor:pointer}.___SBack_qyft7_gg_:hover{color:#484a54}.___SBackText_qyft7_gg_{margin-left:4px;font-size:12px;line-height:1.42;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___STitle_qyft7_gg_{font-size:16px;line-height:1.5;font-weight:700;color:#191b23;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SHeader_qyft7_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_qyft7_gg_{min-height:44px;box-shadow:inset 0 1px 0 #c4c7cf;box-sizing:border-box}.___SBody_qyft7_gg_{height:100%;overflow:auto;padding-left:24px;padding-bottom:4px;padding-right:40px;padding-top:16px}"
78
+ ":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___SOverlay_r1b2d_gg_ {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: 0;\n display: flex;\n overflow: hidden;\n z-index: 10005;\n background: rgba(25, 27, 35, 0.7);\n -webkit-overflow-scrolling: touch;\n}\n\n.___SPanel_r1b2d_gg_ {\n display: flex;\n flex-direction: column;\n width: 260px;\n outline: none;\n font-family: Inter, sans-serif;\n position: fixed;\n box-sizing: border-box;\n will-change: transform;\n background: white;\n z-index: 1;\n}\n\n.___SPanel_r1b2d_gg_._placement_top_r1b2d_gg_ {\n box-shadow: 1px 0 12px rgba(25, 27, 35, 0.15);\n width: 100%;\n margin-bottom: auto;\n top: 0;\n left: 0;\n}\n\n.___SPanel_r1b2d_gg_._placement_right_r1b2d_gg_ {\n box-shadow: 0px 1px 12px 0px rgba(25, 27, 35, 0.15);\n height: 100vh;\n margin-left: auto;\n top: 0;\n right: 0;\n}\n\n.___SPanel_r1b2d_gg_._placement_bottom_r1b2d_gg_ {\n box-shadow: 1px 0 12px rgba(25, 27, 35, 0.15);\n width: 100%;\n margin-top: auto;\n bottom: 0;\n left: 0;\n}\n\n.___SPanel_r1b2d_gg_._placement_left_r1b2d_gg_ {\n box-shadow: 0px 1px 12px 0px rgba(25, 27, 35, 0.15);\n height: 100vh;\n margin-right: auto;\n top: 0;\n left: 0;\n}\n\n.panel-right--enter {\n transform: translate(100%, 0);\n}\n\n.panel-left--enter {\n transform: translate(-100%, 0);\n}\n\n.panel-bottom--enter {\n transform: translate(0, 100%);\n}\n\n.panel-right--enter-active,\n.panel-left--enter-active,\n.panel-bottom--enter-active,\n.panel-right--exit,\n.panel-left--exit,\n.panel-bottom--exit {\n transform: translate(0, 0);\n}\n\n.panel-right--exit-active {\n transform: translate(100%, 0);\n}\n\n.panel-left--exit-active {\n transform: translate(-100%, 0);\n}\n\n.panel-bottom--exit-active {\n transform: translate(0, 100%);\n}\n\n.___SClose_r1b2d_gg_ {\n cursor: pointer;\n position: absolute;\n z-index: 1;\n display: inline-flex;\n right: 0;\n top: 0;\n padding: 12px 12px 16px 12px;\n color: #a9abb6;\n border: none;\n background: none;\n outline: none\n}\n\n.___SClose_r1b2d_gg_:hover {\n color: #8a8e9b;\n }\n\n.___SClose_r1b2d_gg_.__keyboardFocused_r1b2d_gg_ {\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2);\n}\n\n.___SBack_r1b2d_gg_ {\n display: flex;\n align-items: center;\n color: #6c6e79;\n font-size: 12px;\n line-height: 1.33;\n margin-bottom: 4px;\n cursor: pointer\n}\n\n.___SBack_r1b2d_gg_:hover {\n color: #484a54;\n }\n\n.___SBackText_r1b2d_gg_ {\n margin-left: 4px;\n font-size: 12px;\n line-height: 1.42;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.___STitle_r1b2d_gg_ {\n font-size: 16px;\n line-height: 1.5;\n font-weight: 700;\n color: #191b23;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.___SHeader_r1b2d_gg_ {\n padding-left: 24px;\n padding-bottom: 4px;\n padding-right: 56px;\n padding-top: 4px;\n min-height: 52px;\n box-shadow: inset 0 -1px 0 #c4c7cf;\n box-sizing: border-box;\n}\n\n.___SFooter_r1b2d_gg_ {\n min-height: 44px;\n box-shadow: inset 0 1px 0 #c4c7cf;\n box-sizing: border-box;\n}\n\n.___SBody_r1b2d_gg_ {\n height: 100%;\n overflow: auto;\n padding-left: 24px;\n padding-bottom: 4px;\n padding-right: 40px;\n padding-top: 16px;\n}\n"
79
79
  /*__inner_css_end__*/
80
- , "qyft7_gg_")
80
+ , "r1b2d_gg_")
81
81
  /*__reshadow_css_end__*/
82
82
  , {
83
- "__SOverlay": "___SOverlay_qyft7_gg_",
84
- "__SPanel": "___SPanel_qyft7_gg_",
85
- "_placement_top": "_placement_top_qyft7_gg_",
86
- "_placement_right": "_placement_right_qyft7_gg_",
87
- "_placement_bottom": "_placement_bottom_qyft7_gg_",
88
- "_placement_left": "_placement_left_qyft7_gg_",
89
- "__SClose": "___SClose_qyft7_gg_",
90
- "_keyboardFocused": "__keyboardFocused_qyft7_gg_",
91
- "__SBack": "___SBack_qyft7_gg_",
92
- "__SBackText": "___SBackText_qyft7_gg_",
93
- "__STitle": "___STitle_qyft7_gg_",
94
- "__SHeader": "___SHeader_qyft7_gg_",
95
- "__SFooter": "___SFooter_qyft7_gg_",
96
- "__SBody": "___SBody_qyft7_gg_"
83
+ "__SOverlay": "___SOverlay_r1b2d_gg_",
84
+ "__SPanel": "___SPanel_r1b2d_gg_",
85
+ "_placement_top": "_placement_top_r1b2d_gg_",
86
+ "_placement_right": "_placement_right_r1b2d_gg_",
87
+ "_placement_bottom": "_placement_bottom_r1b2d_gg_",
88
+ "_placement_left": "_placement_left_r1b2d_gg_",
89
+ "__SClose": "___SClose_r1b2d_gg_",
90
+ "_keyboardFocused": "__keyboardFocused_r1b2d_gg_",
91
+ "__SBack": "___SBack_r1b2d_gg_",
92
+ "__SBackText": "___SBackText_r1b2d_gg_",
93
+ "__STitle": "___STitle_r1b2d_gg_",
94
+ "__SHeader": "___SHeader_r1b2d_gg_",
95
+ "__SFooter": "___SFooter_r1b2d_gg_",
96
+ "__SBody": "___SBody_r1b2d_gg_"
97
97
  });
98
98
  var placementTransformMap = {
99
99
  top: ['translate(0, -100%)', 'translate(0, 0)'],
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.d.js.map
@@ -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":""}
@@ -48,25 +48,25 @@ var style = (
48
48
  /*__reshadow_css_start__*/
49
49
  _sstyled.insert(
50
50
  /*__inner_css_start__*/
51
- ".___SOverlay_qyft7_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_qyft7_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_qyft7_gg_._placement_top_qyft7_gg_{box-shadow:1px 0 12px rgba(25,27,35,.15);width:100%;margin-bottom:auto;top:0;left:0}.___SPanel_qyft7_gg_._placement_right_qyft7_gg_{box-shadow:0px 1px 12px 0px rgba(25, 27, 35, 0.15);height:100vh;margin-left:auto;top:0;right:0}.___SPanel_qyft7_gg_._placement_bottom_qyft7_gg_{box-shadow:1px 0 12px rgba(25,27,35,.15);width:100%;margin-top:auto;bottom:0;left:0}.___SPanel_qyft7_gg_._placement_left_qyft7_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_qyft7_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_qyft7_gg_:hover{color:#8a8e9b}.___SClose_qyft7_gg_.__keyboardFocused_qyft7_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SBack_qyft7_gg_{display:flex;align-items:center;color:#6c6e79;font-size:12px;line-height:1.33;margin-bottom:4px;cursor:pointer}.___SBack_qyft7_gg_:hover{color:#484a54}.___SBackText_qyft7_gg_{margin-left:4px;font-size:12px;line-height:1.42;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___STitle_qyft7_gg_{font-size:16px;line-height:1.5;font-weight:700;color:#191b23;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.___SHeader_qyft7_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_qyft7_gg_{min-height:44px;box-shadow:inset 0 1px 0 #c4c7cf;box-sizing:border-box}.___SBody_qyft7_gg_{height:100%;overflow:auto;padding-left:24px;padding-bottom:4px;padding-right:40px;padding-top:16px}"
51
+ ":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___SOverlay_r1b2d_gg_ {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: 0;\n display: flex;\n overflow: hidden;\n z-index: 10005;\n background: rgba(25, 27, 35, 0.7);\n -webkit-overflow-scrolling: touch;\n}\n\n.___SPanel_r1b2d_gg_ {\n display: flex;\n flex-direction: column;\n width: 260px;\n outline: none;\n font-family: Inter, sans-serif;\n position: fixed;\n box-sizing: border-box;\n will-change: transform;\n background: white;\n z-index: 1;\n}\n\n.___SPanel_r1b2d_gg_._placement_top_r1b2d_gg_ {\n box-shadow: 1px 0 12px rgba(25, 27, 35, 0.15);\n width: 100%;\n margin-bottom: auto;\n top: 0;\n left: 0;\n}\n\n.___SPanel_r1b2d_gg_._placement_right_r1b2d_gg_ {\n box-shadow: 0px 1px 12px 0px rgba(25, 27, 35, 0.15);\n height: 100vh;\n margin-left: auto;\n top: 0;\n right: 0;\n}\n\n.___SPanel_r1b2d_gg_._placement_bottom_r1b2d_gg_ {\n box-shadow: 1px 0 12px rgba(25, 27, 35, 0.15);\n width: 100%;\n margin-top: auto;\n bottom: 0;\n left: 0;\n}\n\n.___SPanel_r1b2d_gg_._placement_left_r1b2d_gg_ {\n box-shadow: 0px 1px 12px 0px rgba(25, 27, 35, 0.15);\n height: 100vh;\n margin-right: auto;\n top: 0;\n left: 0;\n}\n\n.panel-right--enter {\n transform: translate(100%, 0);\n}\n\n.panel-left--enter {\n transform: translate(-100%, 0);\n}\n\n.panel-bottom--enter {\n transform: translate(0, 100%);\n}\n\n.panel-right--enter-active,\n.panel-left--enter-active,\n.panel-bottom--enter-active,\n.panel-right--exit,\n.panel-left--exit,\n.panel-bottom--exit {\n transform: translate(0, 0);\n}\n\n.panel-right--exit-active {\n transform: translate(100%, 0);\n}\n\n.panel-left--exit-active {\n transform: translate(-100%, 0);\n}\n\n.panel-bottom--exit-active {\n transform: translate(0, 100%);\n}\n\n.___SClose_r1b2d_gg_ {\n cursor: pointer;\n position: absolute;\n z-index: 1;\n display: inline-flex;\n right: 0;\n top: 0;\n padding: 12px 12px 16px 12px;\n color: #a9abb6;\n border: none;\n background: none;\n outline: none\n}\n\n.___SClose_r1b2d_gg_:hover {\n color: #8a8e9b;\n }\n\n.___SClose_r1b2d_gg_.__keyboardFocused_r1b2d_gg_ {\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2);\n}\n\n.___SBack_r1b2d_gg_ {\n display: flex;\n align-items: center;\n color: #6c6e79;\n font-size: 12px;\n line-height: 1.33;\n margin-bottom: 4px;\n cursor: pointer\n}\n\n.___SBack_r1b2d_gg_:hover {\n color: #484a54;\n }\n\n.___SBackText_r1b2d_gg_ {\n margin-left: 4px;\n font-size: 12px;\n line-height: 1.42;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.___STitle_r1b2d_gg_ {\n font-size: 16px;\n line-height: 1.5;\n font-weight: 700;\n color: #191b23;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.___SHeader_r1b2d_gg_ {\n padding-left: 24px;\n padding-bottom: 4px;\n padding-right: 56px;\n padding-top: 4px;\n min-height: 52px;\n box-shadow: inset 0 -1px 0 #c4c7cf;\n box-sizing: border-box;\n}\n\n.___SFooter_r1b2d_gg_ {\n min-height: 44px;\n box-shadow: inset 0 1px 0 #c4c7cf;\n box-sizing: border-box;\n}\n\n.___SBody_r1b2d_gg_ {\n height: 100%;\n overflow: auto;\n padding-left: 24px;\n padding-bottom: 4px;\n padding-right: 40px;\n padding-top: 16px;\n}\n"
52
52
  /*__inner_css_end__*/
53
- , "qyft7_gg_")
53
+ , "r1b2d_gg_")
54
54
  /*__reshadow_css_end__*/
55
55
  , {
56
- "__SOverlay": "___SOverlay_qyft7_gg_",
57
- "__SPanel": "___SPanel_qyft7_gg_",
58
- "_placement_top": "_placement_top_qyft7_gg_",
59
- "_placement_right": "_placement_right_qyft7_gg_",
60
- "_placement_bottom": "_placement_bottom_qyft7_gg_",
61
- "_placement_left": "_placement_left_qyft7_gg_",
62
- "__SClose": "___SClose_qyft7_gg_",
63
- "_keyboardFocused": "__keyboardFocused_qyft7_gg_",
64
- "__SBack": "___SBack_qyft7_gg_",
65
- "__SBackText": "___SBackText_qyft7_gg_",
66
- "__STitle": "___STitle_qyft7_gg_",
67
- "__SHeader": "___SHeader_qyft7_gg_",
68
- "__SFooter": "___SFooter_qyft7_gg_",
69
- "__SBody": "___SBody_qyft7_gg_"
56
+ "__SOverlay": "___SOverlay_r1b2d_gg_",
57
+ "__SPanel": "___SPanel_r1b2d_gg_",
58
+ "_placement_top": "_placement_top_r1b2d_gg_",
59
+ "_placement_right": "_placement_right_r1b2d_gg_",
60
+ "_placement_bottom": "_placement_bottom_r1b2d_gg_",
61
+ "_placement_left": "_placement_left_r1b2d_gg_",
62
+ "__SClose": "___SClose_r1b2d_gg_",
63
+ "_keyboardFocused": "__keyboardFocused_r1b2d_gg_",
64
+ "__SBack": "___SBack_r1b2d_gg_",
65
+ "__SBackText": "___SBackText_r1b2d_gg_",
66
+ "__STitle": "___STitle_r1b2d_gg_",
67
+ "__SHeader": "___SHeader_r1b2d_gg_",
68
+ "__SFooter": "___SFooter_r1b2d_gg_",
69
+ "__SBody": "___SBody_r1b2d_gg_"
70
70
  });
71
71
  var placementTransformMap = {
72
72
  top: ['translate(0, -100%)', 'translate(0, 0)'],
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.js.map
@@ -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,17 +1,13 @@
1
1
  {
2
2
  "name": "@semcore/side-panel",
3
3
  "description": "Semrush SidePanel Component",
4
- "version": "2.0.19",
4
+ "version": "2.0.21",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
- "scripts": {
12
- "build": "build --source=js",
13
- "test": "jest"
14
- },
15
11
  "dependencies": {
16
12
  "@semcore/utils": "^3.31.2",
17
13
  "@semcore/animation": "^1",
@@ -35,6 +31,11 @@
35
31
  "directory": "semcore/side-panel"
36
32
  },
37
33
  "devDependencies": {
34
+ "@types/react": "16.8 - 17",
38
35
  "@semcore/jest-preset-ui": "1.0.0"
36
+ },
37
+ "scripts": {
38
+ "build": "pnpm semcore-builder --source=js",
39
+ "test": "jest"
39
40
  }
40
- }
41
+ }
@@ -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;
@@ -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;