@semcore/dropdown-menu 3.1.0 → 3.1.2

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,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
+ ## [3.1.2] - 2022-10-10
6
+
7
+ ### Changed
8
+
9
+ - Version patch update due to children dependencies update (`@semcore/dropdown` [3.1.1 ~> 3.1.2]).
10
+
5
11
  ## [3.1.0] - 2022-09-07
6
12
 
7
13
  ### Added
@@ -14,36 +20,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
14
20
 
15
21
  - Version patch update due to children dependencies update (`@semcore/utils` [3.37.0 ~> 3.37.1], `@semcore/dropdown` [3.0.10 ~> 3.0.11]).
16
22
 
17
- ## [3.0.11] - 2022-08-18
18
-
19
- ### Changed
20
-
21
- - Version patch update due to children dependencies update (`@semcore/utils` [3.36.0 ~> 3.37.0], `@semcore/dropdown` [3.0.9 ~> 3.0.10]).
22
-
23
- ## [3.0.10] - 2022-08-11
24
-
25
- ### Changed
26
-
27
- - Version patch update due to children dependencies update (`@semcore/utils` [3.35.1 ~> 3.36.0], `@semcore/dropdown` [3.0.8 ~> 3.0.9]).
28
-
29
- ## [3.0.9] - 2022-08-01
30
-
31
- ### Changed
32
-
33
- - Version patch update due to children dependencies update (`@semcore/utils` [3.35.0 ~> 3.35.1], `@semcore/dropdown` [3.0.7 ~> 3.0.8]).
34
-
35
- ## [3.0.8] - 2022-07-22
36
-
37
- ### Changed
38
-
39
- - Version patch update due to children dependencies update (`@semcore/utils` [3.34.0 ~> 3.35.0], `@semcore/dropdown` [3.0.6 ~> 3.0.7]).
40
-
41
- ## [3.0.7] - 2022-07-18
42
-
43
- ### Changed
44
-
45
- - Version patch update due to children dependencies update (`@semcore/dropdown` [3.0.5 ~> 3.0.6]).
46
-
47
23
  ## [3.0.6] - 2022-07-12
48
24
 
49
25
  ### Fixed
@@ -56,30 +32,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
56
32
 
57
33
  - Version patch update due to children dependencies update (`@semcore/utils` [3.33.0 ~> 3.34.0], `@semcore/dropdown` [3.0.4 ~> 3.0.5]).
58
34
 
59
- ## [3.0.4] - 2022-06-02
60
-
61
- ### Changed
62
-
63
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.2 ~> 3.33.0], `@semcore/dropdown` [3.0.3 ~> 3.0.4]).
64
-
65
- ## [3.0.3] - 2022-05-31
66
-
67
- ### Changed
68
-
69
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.1 ~> 3.32.2], `@semcore/dropdown` [3.0.2 ~> 3.0.3]).
70
-
71
- ## [3.0.2] - 2022-05-19
72
-
73
- ### Changed
74
-
75
- - Version patch update due to children dependencies update (`@semcore/dropdown` [3.0.1 ~> 3.0.2]).
76
-
77
- ## [3.0.1] - 2022-05-19
78
-
79
- ### Changed
80
-
81
- - Version patch update due to children dependencies update (`@semcore/utils` [3.32.0 ~> 3.32.1], `@semcore/dropdown` [3.0.0 ~> 3.0.1], `@semcore/flex-box` [4.5.1 ~> 4.5.3]).
82
-
83
35
  ## [3.0.0] - 2022-05-17
84
36
 
85
37
  ### BREAK
@@ -94,18 +46,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
94
46
 
95
47
  - Version patch update due to children dependencies update (`@semcore/scroll-area` [3.7.0 ~> 3.7.1]).
96
48
 
97
- ## [2.3.11] - 2022-04-21
98
-
99
- ### Changed
100
-
101
- - Version patch update due to children dependencies update (`@semcore/scroll-area` [3.6.4 ~> 3.7.0]).
102
-
103
- ## [2.3.10] - 2022-03-14
104
-
105
- ### Changed
106
-
107
- - Version patch update due to children dependencies update (`@semcore/utils` [3.31.2 ~> 3.31.2], `@semcore/dropdown` [2.3.2 ~> 2.3.3]).
108
-
109
49
  ## [2.3.9] - 2022-03-09
110
50
 
111
51
  ### 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.
@@ -63,23 +63,23 @@ var style = (
63
63
  /*__reshadow_css_start__*/
64
64
  _core.sstyled.insert(
65
65
  /*__inner_css_start__*/
66
- ".___SDropdownMenuList_1tre5_gg_{max-height:240px;margin:4px 0;padding:0;position:relative;min-height:26px;min-width:32px}.___SDropdownMenuItem_1tre5_gg_{display:flex;align-items:center;position:relative;text-decoration:none;box-sizing:border-box;cursor:pointer;width:100%;text-align:left;line-height:normal}.___SDropdownMenuItem_1tre5_gg_:hover{background-color:#f4f5f9}.___SDropdownMenuItem_1tre5_gg_:focus{outline:none}.___SDropdownMenuItem_1tre5_gg_.__highlighted_1tre5_gg_{z-index:1;box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2) inset}.___SDropdownMenuItem_1tre5_gg_.__selected_1tre5_gg_{background-color:rgba(196,229,254,.7)}.___SDropdownMenuItem_1tre5_gg_.__selected_1tre5_gg_:hover{background-color:#c4e5fe}.___SDropdownMenuItem_1tre5_gg_.__disabled_1tre5_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SDropdownMenuItem_1tre5_gg_._size_l_1tre5_gg_{font-size:16px;line-height:1.5;padding:8px 12px;min-height:40px}.___SDropdownMenuItem_1tre5_gg_._size_m_1tre5_gg_{font-size:14px;line-height:1.42;padding:6px 8px;min-height:32px}.___SDropdownMenuItem_1tre5_gg_.__notInteractive_1tre5_gg_{cursor:default}.___SDropdownMenuItem_1tre5_gg_.__notInteractive_1tre5_gg_:hover{background:none}.___SDropdownMenuItem_1tre5_gg_._variant_hint_1tre5_gg_{color:#6c6e79;cursor:default}.___SDropdownMenuItem_1tre5_gg_._variant_hint_1tre5_gg_:hover{background:none}.___SDropdownMenuItem_1tre5_gg_._variant_title_1tre5_gg_{font-weight:700;cursor:default}.___SDropdownMenuItem_1tre5_gg_._variant_title_1tre5_gg_:hover{background:none}.___SDropdownMenuItemAddon_1tre5_gg_{display:inline-flex;margin-left:8px;margin-right:8px}.___SDropdownMenuItemAddon_1tre5_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_1tre5_gg_:last-child{margin-right:0}.___SPopper_1tre5_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}"
66
+ ":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.___SDropdownMenuList_12g84_gg_ {\n max-height: 240px;\n margin: 4px 0;\n padding: 0;\n position: relative;\n min-height: 26px;\n min-width: 32px;\n}\n\n.___SDropdownMenuItem_12g84_gg_ {\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n box-sizing: border-box;\n cursor: pointer;\n width: 100%;\n text-align: left;\n line-height: normal\n}\n\n.___SDropdownMenuItem_12g84_gg_:hover {\n background-color: #f4f5f9;\n }\n\n.___SDropdownMenuItem_12g84_gg_:focus {\n outline: none;\n }\n\n.___SDropdownMenuItem_12g84_gg_.__highlighted_12g84_gg_ {\n z-index: 1;\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2) inset;\n}\n\n.___SDropdownMenuItem_12g84_gg_.__selected_12g84_gg_ {\n background-color: rgba(196, 229, 254, 0.7)\n}\n\n.___SDropdownMenuItem_12g84_gg_.__selected_12g84_gg_:hover {\n background-color: #c4e5fe;\n }\n\n.___SDropdownMenuItem_12g84_gg_.__disabled_12g84_gg_ {\n opacity: 0.3;\n cursor: default;\n pointer-events: none;\n}\n\n.___SDropdownMenuItem_12g84_gg_._size_l_12g84_gg_ {\n font-size: 16px;\n line-height: 1.5;\n padding: 8px 12px;\n min-height: 40px;\n}\n\n.___SDropdownMenuItem_12g84_gg_._size_m_12g84_gg_ {\n font-size: 14px;\n line-height: 1.42;\n padding: 6px 8px;\n min-height: 32px;\n}\n\n.___SDropdownMenuItem_12g84_gg_.__notInteractive_12g84_gg_ {\n cursor: default\n}\n\n.___SDropdownMenuItem_12g84_gg_.__notInteractive_12g84_gg_:hover {\n background: none;\n }\n\n.___SDropdownMenuItem_12g84_gg_._variant_hint_12g84_gg_ {\n color: #6c6e79;\n cursor: default\n}\n\n.___SDropdownMenuItem_12g84_gg_._variant_hint_12g84_gg_:hover {\n background: none;\n }\n\n.___SDropdownMenuItem_12g84_gg_._variant_title_12g84_gg_ {\n font-weight: bold;\n cursor: default\n}\n\n.___SDropdownMenuItem_12g84_gg_._variant_title_12g84_gg_:hover {\n background: none;\n }\n\n.___SDropdownMenuItemAddon_12g84_gg_ {\n display: inline-flex;\n margin-left: 8px;\n margin-right: 8px\n}\n\n.___SDropdownMenuItemAddon_12g84_gg_:first-child {\n margin-left: 0;\n }\n\n.___SDropdownMenuItemAddon_12g84_gg_:last-child {\n margin-right: 0;\n }\n\n.___SPopper_12g84_gg_:focus {\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2);\n }\n"
67
67
  /*__inner_css_end__*/
68
- , "1tre5_gg_")
68
+ , "12g84_gg_")
69
69
  /*__reshadow_css_end__*/
70
70
  , {
71
- "__SDropdownMenuList": "___SDropdownMenuList_1tre5_gg_",
72
- "__SDropdownMenuItem": "___SDropdownMenuItem_1tre5_gg_",
73
- "_highlighted": "__highlighted_1tre5_gg_",
74
- "_selected": "__selected_1tre5_gg_",
75
- "_disabled": "__disabled_1tre5_gg_",
76
- "_size_l": "_size_l_1tre5_gg_",
77
- "_size_m": "_size_m_1tre5_gg_",
78
- "_notInteractive": "__notInteractive_1tre5_gg_",
79
- "_variant_hint": "_variant_hint_1tre5_gg_",
80
- "_variant_title": "_variant_title_1tre5_gg_",
81
- "__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_1tre5_gg_",
82
- "__SPopper": "___SPopper_1tre5_gg_"
71
+ "__SDropdownMenuList": "___SDropdownMenuList_12g84_gg_",
72
+ "__SDropdownMenuItem": "___SDropdownMenuItem_12g84_gg_",
73
+ "_highlighted": "__highlighted_12g84_gg_",
74
+ "_selected": "__selected_12g84_gg_",
75
+ "_disabled": "__disabled_12g84_gg_",
76
+ "_size_l": "_size_l_12g84_gg_",
77
+ "_size_m": "_size_m_12g84_gg_",
78
+ "_notInteractive": "__notInteractive_12g84_gg_",
79
+ "_variant_hint": "_variant_hint_12g84_gg_",
80
+ "_variant_title": "_variant_title_12g84_gg_",
81
+ "__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_12g84_gg_",
82
+ "__SPopper": "___SPopper_12g84_gg_"
83
83
  });
84
84
  var KEYS = ['ArrowDown', 'ArrowUp', 'Enter', ' '];
85
85
  var INTERACTION_TAGS = ['INPUT', 'TEXTAREA'];
@@ -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 { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport Dropdown, { IDropdownContext, IDropdownProps, IDropdownHandlers } from '@semcore/dropdown';\nimport { Box, IBoxProps, IFlexProps } from '@semcore/flex-box';\nimport { IScrollAreaProps } from '@semcore/scroll-area';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\nexport interface IDropdownMenuProps extends IDropdownProps {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of the element selected by default\n */\n defaultHighlightedIndex?: number;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number) => void;\n}\n\nexport interface IDropdownMenuListProps extends IBoxProps, IScrollAreaProps {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n}\n\nexport interface IDropdownMenuMenuProps extends IDropdownMenuListProps {}\n\nexport interface IDropdownMenuItemProps extends IFlexProps {\n /**\n * Enables selected state\n */\n selected?: boolean;\n /**\n * Disables the component\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n */\n highlighted?: boolean;\n /**\n * Makes the element non-interactive\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n}\n\nexport interface IDropdownMenuItemHintProps extends IFlexProps {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n}\n\nexport interface IDropdownMenuItemTitleProps extends IFlexProps {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n}\n\nexport interface IDropdownMenuContext extends IDropdownContext {\n getListProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getItemHintProps: PropGetterFn;\n getItemTitleProps: PropGetterFn;\n}\n\nexport interface IDropdownMenuHandlers extends IDropdownHandlers {\n highlightedIndex: (index: number) => void;\n}\n\ndeclare const DropdownMenu: (<T>(\n props: CProps<IDropdownMenuProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,\n) => ReturnEl) & {\n Trigger: typeof Dropdown.Trigger;\n Popper: typeof Dropdown.Popper;\n List: <T>(\n props: CProps<IDropdownMenuListProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,\n ) => ReturnEl;\n Menu: <T>(\n props: CProps<IDropdownMenuMenuProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,\n ) => ReturnEl;\n Item: (<T>(\n props: CProps<IDropdownMenuItemProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,\n ) => ReturnEl) & {\n Addon: typeof Box;\n };\n ItemTitle: <T>(props: IDropdownMenuItemTitleProps & T) => ReturnEl;\n ItemHint: <T>(props: IDropdownMenuItemHintProps & T) => ReturnEl;\n};\n\nexport default DropdownMenu;\n"],"mappings":""}
@@ -39,23 +39,23 @@ var style = (
39
39
  /*__reshadow_css_start__*/
40
40
  _sstyled.insert(
41
41
  /*__inner_css_start__*/
42
- ".___SDropdownMenuList_1tre5_gg_{max-height:240px;margin:4px 0;padding:0;position:relative;min-height:26px;min-width:32px}.___SDropdownMenuItem_1tre5_gg_{display:flex;align-items:center;position:relative;text-decoration:none;box-sizing:border-box;cursor:pointer;width:100%;text-align:left;line-height:normal}.___SDropdownMenuItem_1tre5_gg_:hover{background-color:#f4f5f9}.___SDropdownMenuItem_1tre5_gg_:focus{outline:none}.___SDropdownMenuItem_1tre5_gg_.__highlighted_1tre5_gg_{z-index:1;box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2) inset}.___SDropdownMenuItem_1tre5_gg_.__selected_1tre5_gg_{background-color:rgba(196,229,254,.7)}.___SDropdownMenuItem_1tre5_gg_.__selected_1tre5_gg_:hover{background-color:#c4e5fe}.___SDropdownMenuItem_1tre5_gg_.__disabled_1tre5_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SDropdownMenuItem_1tre5_gg_._size_l_1tre5_gg_{font-size:16px;line-height:1.5;padding:8px 12px;min-height:40px}.___SDropdownMenuItem_1tre5_gg_._size_m_1tre5_gg_{font-size:14px;line-height:1.42;padding:6px 8px;min-height:32px}.___SDropdownMenuItem_1tre5_gg_.__notInteractive_1tre5_gg_{cursor:default}.___SDropdownMenuItem_1tre5_gg_.__notInteractive_1tre5_gg_:hover{background:none}.___SDropdownMenuItem_1tre5_gg_._variant_hint_1tre5_gg_{color:#6c6e79;cursor:default}.___SDropdownMenuItem_1tre5_gg_._variant_hint_1tre5_gg_:hover{background:none}.___SDropdownMenuItem_1tre5_gg_._variant_title_1tre5_gg_{font-weight:700;cursor:default}.___SDropdownMenuItem_1tre5_gg_._variant_title_1tre5_gg_:hover{background:none}.___SDropdownMenuItemAddon_1tre5_gg_{display:inline-flex;margin-left:8px;margin-right:8px}.___SDropdownMenuItemAddon_1tre5_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_1tre5_gg_:last-child{margin-right:0}.___SPopper_1tre5_gg_:focus{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}"
42
+ ":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.___SDropdownMenuList_12g84_gg_ {\n max-height: 240px;\n margin: 4px 0;\n padding: 0;\n position: relative;\n min-height: 26px;\n min-width: 32px;\n}\n\n.___SDropdownMenuItem_12g84_gg_ {\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n box-sizing: border-box;\n cursor: pointer;\n width: 100%;\n text-align: left;\n line-height: normal\n}\n\n.___SDropdownMenuItem_12g84_gg_:hover {\n background-color: #f4f5f9;\n }\n\n.___SDropdownMenuItem_12g84_gg_:focus {\n outline: none;\n }\n\n.___SDropdownMenuItem_12g84_gg_.__highlighted_12g84_gg_ {\n z-index: 1;\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2) inset;\n}\n\n.___SDropdownMenuItem_12g84_gg_.__selected_12g84_gg_ {\n background-color: rgba(196, 229, 254, 0.7)\n}\n\n.___SDropdownMenuItem_12g84_gg_.__selected_12g84_gg_:hover {\n background-color: #c4e5fe;\n }\n\n.___SDropdownMenuItem_12g84_gg_.__disabled_12g84_gg_ {\n opacity: 0.3;\n cursor: default;\n pointer-events: none;\n}\n\n.___SDropdownMenuItem_12g84_gg_._size_l_12g84_gg_ {\n font-size: 16px;\n line-height: 1.5;\n padding: 8px 12px;\n min-height: 40px;\n}\n\n.___SDropdownMenuItem_12g84_gg_._size_m_12g84_gg_ {\n font-size: 14px;\n line-height: 1.42;\n padding: 6px 8px;\n min-height: 32px;\n}\n\n.___SDropdownMenuItem_12g84_gg_.__notInteractive_12g84_gg_ {\n cursor: default\n}\n\n.___SDropdownMenuItem_12g84_gg_.__notInteractive_12g84_gg_:hover {\n background: none;\n }\n\n.___SDropdownMenuItem_12g84_gg_._variant_hint_12g84_gg_ {\n color: #6c6e79;\n cursor: default\n}\n\n.___SDropdownMenuItem_12g84_gg_._variant_hint_12g84_gg_:hover {\n background: none;\n }\n\n.___SDropdownMenuItem_12g84_gg_._variant_title_12g84_gg_ {\n font-weight: bold;\n cursor: default\n}\n\n.___SDropdownMenuItem_12g84_gg_._variant_title_12g84_gg_:hover {\n background: none;\n }\n\n.___SDropdownMenuItemAddon_12g84_gg_ {\n display: inline-flex;\n margin-left: 8px;\n margin-right: 8px\n}\n\n.___SDropdownMenuItemAddon_12g84_gg_:first-child {\n margin-left: 0;\n }\n\n.___SDropdownMenuItemAddon_12g84_gg_:last-child {\n margin-right: 0;\n }\n\n.___SPopper_12g84_gg_:focus {\n box-shadow: 0 0 0 3px rgba(0, 143, 248, 0.2);\n }\n"
43
43
  /*__inner_css_end__*/
44
- , "1tre5_gg_")
44
+ , "12g84_gg_")
45
45
  /*__reshadow_css_end__*/
46
46
  , {
47
- "__SDropdownMenuList": "___SDropdownMenuList_1tre5_gg_",
48
- "__SDropdownMenuItem": "___SDropdownMenuItem_1tre5_gg_",
49
- "_highlighted": "__highlighted_1tre5_gg_",
50
- "_selected": "__selected_1tre5_gg_",
51
- "_disabled": "__disabled_1tre5_gg_",
52
- "_size_l": "_size_l_1tre5_gg_",
53
- "_size_m": "_size_m_1tre5_gg_",
54
- "_notInteractive": "__notInteractive_1tre5_gg_",
55
- "_variant_hint": "_variant_hint_1tre5_gg_",
56
- "_variant_title": "_variant_title_1tre5_gg_",
57
- "__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_1tre5_gg_",
58
- "__SPopper": "___SPopper_1tre5_gg_"
47
+ "__SDropdownMenuList": "___SDropdownMenuList_12g84_gg_",
48
+ "__SDropdownMenuItem": "___SDropdownMenuItem_12g84_gg_",
49
+ "_highlighted": "__highlighted_12g84_gg_",
50
+ "_selected": "__selected_12g84_gg_",
51
+ "_disabled": "__disabled_12g84_gg_",
52
+ "_size_l": "_size_l_12g84_gg_",
53
+ "_size_m": "_size_m_12g84_gg_",
54
+ "_notInteractive": "__notInteractive_12g84_gg_",
55
+ "_variant_hint": "_variant_hint_12g84_gg_",
56
+ "_variant_title": "_variant_title_12g84_gg_",
57
+ "__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_12g84_gg_",
58
+ "__SPopper": "___SPopper_12g84_gg_"
59
59
  });
60
60
  var KEYS = ['ArrowDown', 'ArrowUp', 'Enter', ' '];
61
61
  var INTERACTION_TAGS = ['INPUT', 'TEXTAREA'];
@@ -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 { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport Dropdown, { IDropdownContext, IDropdownProps, IDropdownHandlers } from '@semcore/dropdown';\nimport { Box, IBoxProps, IFlexProps } from '@semcore/flex-box';\nimport { IScrollAreaProps } from '@semcore/scroll-area';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\nexport interface IDropdownMenuProps extends IDropdownProps {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of the element selected by default\n */\n defaultHighlightedIndex?: number;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number) => void;\n}\n\nexport interface IDropdownMenuListProps extends IBoxProps, IScrollAreaProps {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n}\n\nexport interface IDropdownMenuMenuProps extends IDropdownMenuListProps {}\n\nexport interface IDropdownMenuItemProps extends IFlexProps {\n /**\n * Enables selected state\n */\n selected?: boolean;\n /**\n * Disables the component\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n */\n highlighted?: boolean;\n /**\n * Makes the element non-interactive\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n}\n\nexport interface IDropdownMenuItemHintProps extends IFlexProps {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n}\n\nexport interface IDropdownMenuItemTitleProps extends IFlexProps {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n}\n\nexport interface IDropdownMenuContext extends IDropdownContext {\n getListProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getItemHintProps: PropGetterFn;\n getItemTitleProps: PropGetterFn;\n}\n\nexport interface IDropdownMenuHandlers extends IDropdownHandlers {\n highlightedIndex: (index: number) => void;\n}\n\ndeclare const DropdownMenu: (<T>(\n props: CProps<IDropdownMenuProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,\n) => ReturnEl) & {\n Trigger: typeof Dropdown.Trigger;\n Popper: typeof Dropdown.Popper;\n List: <T>(\n props: CProps<IDropdownMenuListProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,\n ) => ReturnEl;\n Menu: <T>(\n props: CProps<IDropdownMenuMenuProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,\n ) => ReturnEl;\n Item: (<T>(\n props: CProps<IDropdownMenuItemProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,\n ) => ReturnEl) & {\n Addon: typeof Box;\n };\n ItemTitle: <T>(props: IDropdownMenuItemTitleProps & T) => ReturnEl;\n ItemHint: <T>(props: IDropdownMenuItemHintProps & T) => ReturnEl;\n};\n\nexport default DropdownMenu;\n"],"mappings":""}
package/package.json CHANGED
@@ -1,17 +1,13 @@
1
1
  {
2
2
  "name": "@semcore/dropdown-menu",
3
3
  "description": "Semrush DropdownMenu Component",
4
- "version": "3.1.0",
4
+ "version": "3.1.2",
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/dropdown": "^3",
17
13
  "@semcore/flex-box": "^4",
@@ -32,8 +28,13 @@
32
28
  "directory": "semcore/dropdown-menu"
33
29
  },
34
30
  "devDependencies": {
31
+ "@types/react": "16.8 - 17",
35
32
  "@guidepup/playwright": "0.6.1",
36
33
  "@playwright/test": "1.25.1",
37
34
  "@semcore/jest-preset-ui": "1.0.0"
35
+ },
36
+ "scripts": {
37
+ "build": "pnpm semcore-builder --source=js",
38
+ "test": "jest"
38
39
  }
39
- }
40
+ }
@@ -1,110 +0,0 @@
1
- import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
2
- import Dropdown, { IDropdownContext, IDropdownProps, IDropdownHandlers } from '@semcore/dropdown';
3
- import { Box, IBoxProps, IFlexProps } from '@semcore/flex-box';
4
- import { IScrollAreaProps } from '@semcore/scroll-area';
5
-
6
- export type DropdownMenuSize = 'm' | 'l';
7
-
8
- export interface IDropdownMenuProps extends IDropdownProps {
9
- /**
10
- * Size of the menu
11
- * @default m
12
- */
13
- size?: DropdownMenuSize;
14
- /**
15
- * Index of the element selected by default
16
- */
17
- defaultHighlightedIndex?: number;
18
- /**
19
- * Index of the selected item
20
- */
21
- highlightedIndex?: number;
22
- /**
23
- * Callback for highlightedIndex change
24
- * highlightedIndex - Index of the selected item
25
- */
26
- onHighlightedIndexChange?: (highlightedIndex: number) => void;
27
- }
28
-
29
- export interface IDropdownMenuListProps extends IBoxProps, IScrollAreaProps {
30
- /**
31
- * Size of the menu
32
- * @default m
33
- */
34
- size?: DropdownMenuSize;
35
- }
36
-
37
- export interface IDropdownMenuMenuProps extends IDropdownMenuListProps {}
38
-
39
- export interface IDropdownMenuItemProps extends IFlexProps {
40
- /**
41
- * Enables selected state
42
- */
43
- selected?: boolean;
44
- /**
45
- * Disables the component
46
- */
47
- disabled?: boolean;
48
- /**
49
- * Adds focus styles around
50
- */
51
- highlighted?: boolean;
52
- /**
53
- * Makes the element non-interactive
54
- */
55
- notInteractive?: boolean;
56
- /**
57
- * Size of the component
58
- * @default m
59
- */
60
- size?: DropdownMenuSize;
61
- }
62
-
63
- export interface IDropdownMenuItemHintProps extends IFlexProps {
64
- /**
65
- * Size of the component
66
- * @default m
67
- */
68
- size?: DropdownMenuSize;
69
- }
70
-
71
- export interface IDropdownMenuItemTitleProps extends IFlexProps {
72
- /**
73
- * Size of the component
74
- * @default m
75
- */
76
- size?: DropdownMenuSize;
77
- }
78
-
79
- export interface IDropdownMenuContext extends IDropdownContext {
80
- getListProps: PropGetterFn;
81
- getItemProps: PropGetterFn;
82
- getItemHintProps: PropGetterFn;
83
- getItemTitleProps: PropGetterFn;
84
- }
85
-
86
- export interface IDropdownMenuHandlers extends IDropdownHandlers {
87
- highlightedIndex: (index: number) => void;
88
- }
89
-
90
- declare const DropdownMenu: (<T>(
91
- props: CProps<IDropdownMenuProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,
92
- ) => ReturnEl) & {
93
- Trigger: typeof Dropdown.Trigger;
94
- Popper: typeof Dropdown.Popper;
95
- List: <T>(
96
- props: CProps<IDropdownMenuListProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,
97
- ) => ReturnEl;
98
- Menu: <T>(
99
- props: CProps<IDropdownMenuMenuProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,
100
- ) => ReturnEl;
101
- Item: (<T>(
102
- props: CProps<IDropdownMenuItemProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,
103
- ) => ReturnEl) & {
104
- Addon: typeof Box;
105
- };
106
- ItemTitle: <T>(props: IDropdownMenuItemTitleProps & T) => ReturnEl;
107
- ItemHint: <T>(props: IDropdownMenuItemHintProps & T) => ReturnEl;
108
- };
109
-
110
- export default DropdownMenu;
@@ -1,110 +0,0 @@
1
- import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
2
- import Dropdown, { IDropdownContext, IDropdownProps, IDropdownHandlers } from '@semcore/dropdown';
3
- import { Box, IBoxProps, IFlexProps } from '@semcore/flex-box';
4
- import { IScrollAreaProps } from '@semcore/scroll-area';
5
-
6
- export type DropdownMenuSize = 'm' | 'l';
7
-
8
- export interface IDropdownMenuProps extends IDropdownProps {
9
- /**
10
- * Size of the menu
11
- * @default m
12
- */
13
- size?: DropdownMenuSize;
14
- /**
15
- * Index of the element selected by default
16
- */
17
- defaultHighlightedIndex?: number;
18
- /**
19
- * Index of the selected item
20
- */
21
- highlightedIndex?: number;
22
- /**
23
- * Callback for highlightedIndex change
24
- * highlightedIndex - Index of the selected item
25
- */
26
- onHighlightedIndexChange?: (highlightedIndex: number) => void;
27
- }
28
-
29
- export interface IDropdownMenuListProps extends IBoxProps, IScrollAreaProps {
30
- /**
31
- * Size of the menu
32
- * @default m
33
- */
34
- size?: DropdownMenuSize;
35
- }
36
-
37
- export interface IDropdownMenuMenuProps extends IDropdownMenuListProps {}
38
-
39
- export interface IDropdownMenuItemProps extends IFlexProps {
40
- /**
41
- * Enables selected state
42
- */
43
- selected?: boolean;
44
- /**
45
- * Disables the component
46
- */
47
- disabled?: boolean;
48
- /**
49
- * Adds focus styles around
50
- */
51
- highlighted?: boolean;
52
- /**
53
- * Makes the element non-interactive
54
- */
55
- notInteractive?: boolean;
56
- /**
57
- * Size of the component
58
- * @default m
59
- */
60
- size?: DropdownMenuSize;
61
- }
62
-
63
- export interface IDropdownMenuItemHintProps extends IFlexProps {
64
- /**
65
- * Size of the component
66
- * @default m
67
- */
68
- size?: DropdownMenuSize;
69
- }
70
-
71
- export interface IDropdownMenuItemTitleProps extends IFlexProps {
72
- /**
73
- * Size of the component
74
- * @default m
75
- */
76
- size?: DropdownMenuSize;
77
- }
78
-
79
- export interface IDropdownMenuContext extends IDropdownContext {
80
- getListProps: PropGetterFn;
81
- getItemProps: PropGetterFn;
82
- getItemHintProps: PropGetterFn;
83
- getItemTitleProps: PropGetterFn;
84
- }
85
-
86
- export interface IDropdownMenuHandlers extends IDropdownHandlers {
87
- highlightedIndex: (index: number) => void;
88
- }
89
-
90
- declare const DropdownMenu: (<T>(
91
- props: CProps<IDropdownMenuProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,
92
- ) => ReturnEl) & {
93
- Trigger: typeof Dropdown.Trigger;
94
- Popper: typeof Dropdown.Popper;
95
- List: <T>(
96
- props: CProps<IDropdownMenuListProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,
97
- ) => ReturnEl;
98
- Menu: <T>(
99
- props: CProps<IDropdownMenuMenuProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,
100
- ) => ReturnEl;
101
- Item: (<T>(
102
- props: CProps<IDropdownMenuItemProps & T, IDropdownMenuContext, IDropdownMenuHandlers>,
103
- ) => ReturnEl) & {
104
- Addon: typeof Box;
105
- };
106
- ItemTitle: <T>(props: IDropdownMenuItemTitleProps & T) => ReturnEl;
107
- ItemHint: <T>(props: IDropdownMenuItemHintProps & T) => ReturnEl;
108
- };
109
-
110
- export default DropdownMenu;