@semcore/dropdown-menu 4.43.0 → 4.43.2-prerelease.0
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 +12 -0
- package/__stories/Dropdown-menu.stories.tsx +162 -0
- package/__stories/examples/dropdown-menu-notice.tsx +59 -0
- package/lib/cjs/DropdownMenu.js +54 -34
- package/lib/cjs/DropdownMenu.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/es6/DropdownMenu.js +54 -34
- package/lib/es6/DropdownMenu.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/types/index.d.ts +2 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [4.43.2] - 2024-11-06
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Unexpected focus on actions in DropdownMenu.Item.
|
|
10
|
+
|
|
11
|
+
## [4.43.1] - 2024-11-05
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `DropdownPopperAriaProps` type for DropdownMenu.Popper props.
|
|
16
|
+
|
|
5
17
|
## [4.43.0] - 2024-11-01
|
|
6
18
|
|
|
7
19
|
### Changed
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import DropdownMenu from '../src';
|
|
5
|
+
import { Flex } from '../../flex-box/src';
|
|
6
|
+
import TrashM from '@semcore/icon/Trash/m';
|
|
7
|
+
import PlusM from '@semcore/icon/MathPlus/m';
|
|
8
|
+
import Button from '../../button/src';
|
|
9
|
+
import ChevronRightIcon from '@semcore/icon/ChevronRight/m';
|
|
10
|
+
import { DropdownMenuWithNoticeExample } from './examples/dropdown-menu-notice';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof DropdownMenu> = {
|
|
13
|
+
title: 'Components/Dropdown Menu',
|
|
14
|
+
component: DropdownMenu,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<typeof DropdownMenu>;
|
|
18
|
+
|
|
19
|
+
export const DropdownMenuWithNotice: Story = {
|
|
20
|
+
render: DropdownMenuWithNoticeExample,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const MenuItemWithActions: Story = {
|
|
24
|
+
render: () => {
|
|
25
|
+
return (
|
|
26
|
+
<DropdownMenu>
|
|
27
|
+
<DropdownMenu.Trigger tag={Button}>List item with actions</DropdownMenu.Trigger>
|
|
28
|
+
<DropdownMenu.Menu>
|
|
29
|
+
<DropdownMenu.Item>Item 1</DropdownMenu.Item>
|
|
30
|
+
<DropdownMenu.Item>Item 2</DropdownMenu.Item>
|
|
31
|
+
|
|
32
|
+
<DropdownMenu.Item>
|
|
33
|
+
<DropdownMenu inlineActions placement={'right'}>
|
|
34
|
+
<Flex justifyContent='space-between'>
|
|
35
|
+
<DropdownMenu.Item.Content tag={DropdownMenu.Trigger}>
|
|
36
|
+
Item 3
|
|
37
|
+
</DropdownMenu.Item.Content>
|
|
38
|
+
<DropdownMenu.Actions gap={1}>
|
|
39
|
+
<DropdownMenu.Item tag={Button} addonLeft={PlusM} aria-label={'Add new'} />
|
|
40
|
+
<DropdownMenu.Item tag={Button} addonLeft={TrashM} aria-label={'Delete'} />
|
|
41
|
+
</DropdownMenu.Actions>
|
|
42
|
+
</Flex>
|
|
43
|
+
</DropdownMenu>
|
|
44
|
+
</DropdownMenu.Item>
|
|
45
|
+
<DropdownMenu.Item>
|
|
46
|
+
<DropdownMenu
|
|
47
|
+
placement={'right-start'}
|
|
48
|
+
interaction={'hover'}
|
|
49
|
+
timeout={[0, 300]}
|
|
50
|
+
offset={[-11, 12]}
|
|
51
|
+
>
|
|
52
|
+
<DropdownMenu.Item.Content tag={DropdownMenu.Trigger}>
|
|
53
|
+
Item 4
|
|
54
|
+
<ChevronRightIcon color='icon-secondary-neutral' />
|
|
55
|
+
</DropdownMenu.Item.Content>
|
|
56
|
+
<DropdownMenu.Menu>
|
|
57
|
+
<DropdownMenu.Item>Add</DropdownMenu.Item>
|
|
58
|
+
<DropdownMenu.Item>Delete</DropdownMenu.Item>
|
|
59
|
+
</DropdownMenu.Menu>
|
|
60
|
+
</DropdownMenu>
|
|
61
|
+
</DropdownMenu.Item>
|
|
62
|
+
</DropdownMenu.Menu>
|
|
63
|
+
</DropdownMenu>
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const NestedMenus: Story = {
|
|
69
|
+
render: () => {
|
|
70
|
+
return (
|
|
71
|
+
<DropdownMenu>
|
|
72
|
+
<DropdownMenu.Trigger tag={Button}>Nested menus</DropdownMenu.Trigger>
|
|
73
|
+
<DropdownMenu.Menu>
|
|
74
|
+
<DropdownMenu.Item>Item 1</DropdownMenu.Item>
|
|
75
|
+
<DropdownMenu.Item>Item 2</DropdownMenu.Item>
|
|
76
|
+
<DropdownMenu.Item>Item 3</DropdownMenu.Item>
|
|
77
|
+
<DropdownMenu.Item>
|
|
78
|
+
<DropdownMenu
|
|
79
|
+
placement='right-start'
|
|
80
|
+
interaction='hover'
|
|
81
|
+
timeout={[0, 300]}
|
|
82
|
+
offset={[-11, 12]}
|
|
83
|
+
>
|
|
84
|
+
<DropdownMenu.Item.Content tag={DropdownMenu.Trigger}>
|
|
85
|
+
Item 4
|
|
86
|
+
<DropdownMenu.Item.Addon tag={ChevronRightIcon} color='icon-secondary-neutral' />
|
|
87
|
+
</DropdownMenu.Item.Content>
|
|
88
|
+
<DropdownMenu.Menu w={120}>
|
|
89
|
+
<DropdownMenu.Item>
|
|
90
|
+
<DropdownMenu
|
|
91
|
+
placement='right-start'
|
|
92
|
+
interaction='hover'
|
|
93
|
+
timeout={[0, 300]}
|
|
94
|
+
offset={[-11, 12]}
|
|
95
|
+
>
|
|
96
|
+
<DropdownMenu.Item.Content tag={DropdownMenu.Trigger}>
|
|
97
|
+
Item 4.1
|
|
98
|
+
<DropdownMenu.Item.Addon
|
|
99
|
+
tag={ChevronRightIcon}
|
|
100
|
+
color='icon-secondary-neutral'
|
|
101
|
+
/>
|
|
102
|
+
</DropdownMenu.Item.Content>
|
|
103
|
+
<DropdownMenu.Menu w={120}>
|
|
104
|
+
<DropdownMenu.Item>Item 4.1.1</DropdownMenu.Item>
|
|
105
|
+
<DropdownMenu.Item>Item 4.1.2</DropdownMenu.Item>
|
|
106
|
+
<DropdownMenu.Item>Item 4.1.3</DropdownMenu.Item>
|
|
107
|
+
</DropdownMenu.Menu>
|
|
108
|
+
</DropdownMenu>
|
|
109
|
+
</DropdownMenu.Item>
|
|
110
|
+
<DropdownMenu.Item>
|
|
111
|
+
<DropdownMenu
|
|
112
|
+
placement='right-start'
|
|
113
|
+
interaction='hover'
|
|
114
|
+
timeout={[0, 300]}
|
|
115
|
+
offset={[-11, 12]}
|
|
116
|
+
>
|
|
117
|
+
<DropdownMenu.Item.Content tag={DropdownMenu.Trigger}>
|
|
118
|
+
Item 4.2
|
|
119
|
+
<DropdownMenu.Item.Addon
|
|
120
|
+
tag={ChevronRightIcon}
|
|
121
|
+
color='icon-secondary-neutral'
|
|
122
|
+
/>
|
|
123
|
+
</DropdownMenu.Item.Content>
|
|
124
|
+
<DropdownMenu.Menu w={120}>
|
|
125
|
+
<DropdownMenu.Item>
|
|
126
|
+
<DropdownMenu
|
|
127
|
+
placement='right-start'
|
|
128
|
+
interaction='hover'
|
|
129
|
+
timeout={[0, 300]}
|
|
130
|
+
offset={[-11, 12]}
|
|
131
|
+
>
|
|
132
|
+
<DropdownMenu.Item.Content tag={DropdownMenu.Trigger}>
|
|
133
|
+
Item 4.2.1
|
|
134
|
+
<DropdownMenu.Item.Addon
|
|
135
|
+
tag={ChevronRightIcon}
|
|
136
|
+
color='icon-secondary-neutral'
|
|
137
|
+
/>
|
|
138
|
+
</DropdownMenu.Item.Content>
|
|
139
|
+
<DropdownMenu.Menu w={120}>
|
|
140
|
+
<DropdownMenu.Item>Item 4.2.1.1</DropdownMenu.Item>
|
|
141
|
+
<DropdownMenu.Item>Item 4.2.1.2</DropdownMenu.Item>
|
|
142
|
+
<DropdownMenu.Item>Item 4.2.1.3</DropdownMenu.Item>
|
|
143
|
+
</DropdownMenu.Menu>
|
|
144
|
+
</DropdownMenu>
|
|
145
|
+
</DropdownMenu.Item>
|
|
146
|
+
<DropdownMenu.Item>Item 4.2.2</DropdownMenu.Item>
|
|
147
|
+
<DropdownMenu.Item>Item 4.2.3</DropdownMenu.Item>
|
|
148
|
+
</DropdownMenu.Menu>
|
|
149
|
+
</DropdownMenu>
|
|
150
|
+
</DropdownMenu.Item>
|
|
151
|
+
<DropdownMenu.Item>Item 4.3</DropdownMenu.Item>
|
|
152
|
+
</DropdownMenu.Menu>
|
|
153
|
+
</DropdownMenu>
|
|
154
|
+
</DropdownMenu.Item>
|
|
155
|
+
<DropdownMenu.Item>Item 5</DropdownMenu.Item>
|
|
156
|
+
</DropdownMenu.Menu>
|
|
157
|
+
</DropdownMenu>
|
|
158
|
+
);
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export default meta;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DropdownMenu from '../../src';
|
|
3
|
+
import Button from '../../../button/src';
|
|
4
|
+
import Link from '../../../link/src';
|
|
5
|
+
import { Text } from '../../../typography/src';
|
|
6
|
+
import Notice from '../../../notice/src';
|
|
7
|
+
import SpinContainer from '../../../spin-container/src';
|
|
8
|
+
import FileExportM from '@semcore/icon/FileExport/m';
|
|
9
|
+
|
|
10
|
+
export const DropdownMenuWithNoticeExample = () => {
|
|
11
|
+
const [loading, setLoading] = React.useState(false);
|
|
12
|
+
|
|
13
|
+
const handleClick = () => {
|
|
14
|
+
setLoading(true);
|
|
15
|
+
setTimeout(() => setLoading(false), 1000);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<DropdownMenu>
|
|
20
|
+
<DropdownMenu.Trigger tag={Button}>
|
|
21
|
+
<Button.Addon>
|
|
22
|
+
<FileExportM />
|
|
23
|
+
</Button.Addon>
|
|
24
|
+
<Button.Text>Export</Button.Text>
|
|
25
|
+
</DropdownMenu.Trigger>
|
|
26
|
+
<DropdownMenu.Popper wMax='256px' aria-label={'Export options'}>
|
|
27
|
+
<SpinContainer loading={loading}>
|
|
28
|
+
<DropdownMenu.List>
|
|
29
|
+
<DropdownMenu.Item onClick={handleClick}>Excel</DropdownMenu.Item>
|
|
30
|
+
<DropdownMenu.Item onClick={handleClick}>CSV</DropdownMenu.Item>
|
|
31
|
+
<DropdownMenu.Item onClick={handleClick}>CSV Semicolon</DropdownMenu.Item>
|
|
32
|
+
</DropdownMenu.List>
|
|
33
|
+
<Notice
|
|
34
|
+
theme='warning'
|
|
35
|
+
style={{
|
|
36
|
+
padding: 'var(--intergalactic-spacing-3x) var(--intergalactic-spacing-2x)',
|
|
37
|
+
borderWidth: 0,
|
|
38
|
+
borderTopWidth: '1px',
|
|
39
|
+
borderRadius:
|
|
40
|
+
'0 0 var(--intergalactic-rounded-medium) var(--intergalactic-rounded-medium)',
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
<Notice.Content>
|
|
44
|
+
<Text tag='strong' mb={1} style={{ display: 'block' }}>
|
|
45
|
+
Export failed
|
|
46
|
+
</Text>
|
|
47
|
+
<Text>
|
|
48
|
+
If the problem persists, please contact us at{' '}
|
|
49
|
+
<Link inline href='mailto:feedback@semrush.com'>
|
|
50
|
+
feedback@semrush.com
|
|
51
|
+
</Link>
|
|
52
|
+
</Text>
|
|
53
|
+
</Notice.Content>
|
|
54
|
+
</Notice>
|
|
55
|
+
</SpinContainer>
|
|
56
|
+
</DropdownMenu.Popper>
|
|
57
|
+
</DropdownMenu>
|
|
58
|
+
);
|
|
59
|
+
};
|
package/lib/cjs/DropdownMenu.js
CHANGED
|
@@ -36,24 +36,24 @@ var _button = _interopRequireDefault(require("@semcore/button"));
|
|
|
36
36
|
var _typography = require("@semcore/typography");
|
|
37
37
|
var _excluded = ["className"];
|
|
38
38
|
/*__reshadow-styles__:"./style/dropdown-menu.shadow.css"*/
|
|
39
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".
|
|
40
|
-
"__SDropdownMenuItemContainer": "
|
|
41
|
-
"_nesting-trigger": "__nesting-
|
|
42
|
-
"__SDropdownMenuNesting": "
|
|
43
|
-
"_size_l": "
|
|
44
|
-
"_size_m": "
|
|
45
|
-
"_highlighted": "
|
|
46
|
-
"__SDropdownNestingItem": "
|
|
47
|
-
"__SItemContent": "
|
|
48
|
-
"__SItemHint": "
|
|
49
|
-
"__SDropdownMenuList": "
|
|
50
|
-
"__SShadowHorizontal": "
|
|
51
|
-
"_position_median": "
|
|
52
|
-
"_position_start": "
|
|
53
|
-
"_position_end": "
|
|
54
|
-
"__SShadowVertical": "
|
|
55
|
-
"__SDropdownMenuItemAddon": "
|
|
56
|
-
"__SItemContentText": "
|
|
39
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SDropdownMenuList_10zcc_gg_{max-height:240px;padding:var(--intergalactic-spacing-1x, 4px)0;position:relative;min-height:26px;min-width:32px;box-sizing:content-box;z-index:0;color:var(--intergalactic-text-primary, #191b23)}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_:after,.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_:before{width:16px;height:100%;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_._position_median_10zcc_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,\n linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_._position_median_10zcc_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,\n linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_._position_start_10zcc_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,\n linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_._position_end_10zcc_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,\n linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_:after,.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_:before{width:100%;height:16px;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_._position_median_10zcc_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,\n linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_._position_median_10zcc_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,\n linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_._position_start_10zcc_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,\n linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_._position_end_10zcc_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,\n linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuItemContainer_10zcc_gg_.__nesting-trigger_10zcc_gg_{justify-content:space-between}.___SDropdownMenuItemAddon_10zcc_gg_,.___SItemContentText_10zcc_gg_{display:inline-flex;margin-left:var(--intergalactic-spacing-1x, 4px);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SDropdownMenuItemAddon_10zcc_gg_:first-child,.___SItemContentText_10zcc_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_10zcc_gg_:last-child,.___SItemContentText_10zcc_gg_:last-child{margin-right:0}.___SDropdownMenuNesting_10zcc_gg_,.___SDropdownMenuNesting_10zcc_gg_._size_l_10zcc_gg_,.___SDropdownMenuNesting_10zcc_gg_._size_m_10zcc_gg_{padding:0}.___SDropdownMenuNesting_10zcc_gg_.__highlighted_10zcc_gg_{z-index:1;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5)) inset}.___SDropdownNestingItem_10zcc_gg_._size_l_10zcc_gg_,.___SDropdownNestingItem_10zcc_gg_._size_m_10zcc_gg_{padding-right:0}.___SDropdownNestingItem_10zcc_gg_ .___SDropdownMenuItemContainer_10zcc_gg_{width:auto;padding-top:0;padding-bottom:0;padding-left:0;min-height:auto}.___SItemContent_10zcc_gg_:focus{outline:0}.___SItemHint_10zcc_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}" /*__inner_css_end__*/, "10zcc_gg_") /*__reshadow_css_end__*/, {
|
|
40
|
+
"__SDropdownMenuItemContainer": "___SDropdownMenuItemContainer_10zcc_gg_",
|
|
41
|
+
"_nesting-trigger": "__nesting-trigger_10zcc_gg_",
|
|
42
|
+
"__SDropdownMenuNesting": "___SDropdownMenuNesting_10zcc_gg_",
|
|
43
|
+
"_size_l": "_size_l_10zcc_gg_",
|
|
44
|
+
"_size_m": "_size_m_10zcc_gg_",
|
|
45
|
+
"_highlighted": "__highlighted_10zcc_gg_",
|
|
46
|
+
"__SDropdownNestingItem": "___SDropdownNestingItem_10zcc_gg_",
|
|
47
|
+
"__SItemContent": "___SItemContent_10zcc_gg_",
|
|
48
|
+
"__SItemHint": "___SItemHint_10zcc_gg_",
|
|
49
|
+
"__SDropdownMenuList": "___SDropdownMenuList_10zcc_gg_",
|
|
50
|
+
"__SShadowHorizontal": "___SShadowHorizontal_10zcc_gg_",
|
|
51
|
+
"_position_median": "_position_median_10zcc_gg_",
|
|
52
|
+
"_position_start": "_position_start_10zcc_gg_",
|
|
53
|
+
"_position_end": "_position_end_10zcc_gg_",
|
|
54
|
+
"__SShadowVertical": "___SShadowVertical_10zcc_gg_",
|
|
55
|
+
"__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_10zcc_gg_",
|
|
56
|
+
"__SItemContentText": "___SItemContentText_10zcc_gg_"
|
|
57
57
|
});
|
|
58
58
|
var ListBoxContextProvider = function ListBoxContextProvider(_ref22) {
|
|
59
59
|
var children = _ref22.children;
|
|
@@ -72,6 +72,7 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
72
72
|
args[_key] = arguments[_key];
|
|
73
73
|
}
|
|
74
74
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
75
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "actionsRef", /*#__PURE__*/_react["default"].createRef());
|
|
75
76
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "role", 'menu');
|
|
76
77
|
return _this;
|
|
77
78
|
}
|
|
@@ -109,27 +110,31 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
109
110
|
key: "getPopperProps",
|
|
110
111
|
value: function getPopperProps() {
|
|
111
112
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _get2["default"])((0, _getPrototypeOf2["default"])(DropdownMenuRoot.prototype), "getPopperProps", this).call(this)), {}, {
|
|
112
|
-
onKeyDown: (0, _assignProps14.callAllEventHandlers)(this.handlePreventCommonKeyDown.bind(this), this.handlePreventPopperKeyDown.bind(this)
|
|
113
|
-
// this.handleKeyDownForPopper.bind(this),
|
|
114
|
-
)
|
|
113
|
+
onKeyDown: (0, _assignProps14.callAllEventHandlers)(this.handlePreventCommonKeyDown.bind(this), this.handlePreventPopperKeyDown.bind(this))
|
|
115
114
|
});
|
|
116
115
|
}
|
|
117
116
|
}, {
|
|
118
117
|
key: "getActionsProps",
|
|
119
118
|
value: function getActionsProps() {
|
|
120
|
-
return this.getListProps()
|
|
119
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, this.getListProps()), {}, {
|
|
120
|
+
ref: this.actionsRef,
|
|
121
|
+
onKeyDown: (0, _assignProps14.callAllEventHandlers)(this.handlePreventTabOnActions.bind(this), this.handlePreventCommonKeyDown.bind(this), this.handleKeyDownForMenu('list'), this.handleArrowKeyDown.bind(this))
|
|
122
|
+
});
|
|
121
123
|
}
|
|
122
124
|
}, {
|
|
123
125
|
key: "getItemProps",
|
|
124
126
|
value: function getItemProps(props, index) {
|
|
125
127
|
var _this2 = this;
|
|
126
|
-
var
|
|
128
|
+
var _this$asProps2 = this.asProps,
|
|
129
|
+
highlightedIndex = _this$asProps2.highlightedIndex,
|
|
130
|
+
visible = _this$asProps2.visible;
|
|
127
131
|
var isHighlighted = index === highlightedIndex;
|
|
128
132
|
var itemProps = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _get2["default"])((0, _getPrototypeOf2["default"])(DropdownMenuRoot.prototype), "getItemProps", this).call(this, props, index)), {}, {
|
|
129
|
-
tabIndex: isHighlighted ? 0 : -1,
|
|
133
|
+
tabIndex: isHighlighted && visible ? 0 : -1,
|
|
130
134
|
ref: function ref(node) {
|
|
131
135
|
return _this2.itemRef(props, index, node);
|
|
132
|
-
}
|
|
136
|
+
},
|
|
137
|
+
actionsRef: this.actionsRef
|
|
133
138
|
});
|
|
134
139
|
if (props.tag === _button["default"]) {
|
|
135
140
|
var _props$use, _props$theme, _props$size;
|
|
@@ -175,15 +180,24 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
175
180
|
}
|
|
176
181
|
};
|
|
177
182
|
}
|
|
183
|
+
}, {
|
|
184
|
+
key: "handlePreventTabOnActions",
|
|
185
|
+
value: function handlePreventTabOnActions(e) {
|
|
186
|
+
if (e.key === 'Tab') {
|
|
187
|
+
e.stopPropagation();
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
178
192
|
}, {
|
|
179
193
|
key: "render",
|
|
180
194
|
value: function render() {
|
|
181
195
|
var _ref = this.asProps;
|
|
182
|
-
var _this$
|
|
183
|
-
Children = _this$
|
|
184
|
-
selectedIndex = _this$
|
|
185
|
-
interaction = _this$
|
|
186
|
-
timeout = _this$
|
|
196
|
+
var _this$asProps3 = this.asProps,
|
|
197
|
+
Children = _this$asProps3.Children,
|
|
198
|
+
selectedIndex = _this$asProps3.selectedIndex,
|
|
199
|
+
interaction = _this$asProps3.interaction,
|
|
200
|
+
timeout = _this$asProps3.timeout;
|
|
187
201
|
this.itemProps = [];
|
|
188
202
|
return /*#__PURE__*/_react["default"].createElement(_dropdown.selectedIndexContext.Provider, {
|
|
189
203
|
value: selectedIndex
|
|
@@ -262,7 +276,9 @@ function Item(_ref25) {
|
|
|
262
276
|
disabled = _ref25.disabled,
|
|
263
277
|
Children = _ref25.Children,
|
|
264
278
|
forwardRef = _ref25.forwardRef,
|
|
265
|
-
role = _ref25.role
|
|
279
|
+
role = _ref25.role,
|
|
280
|
+
tabIndex = _ref25.tabIndex,
|
|
281
|
+
actionsRef = _ref25.actionsRef;
|
|
266
282
|
var SDropdownMenuItemContainer = _dropdown["default"].Item;
|
|
267
283
|
var itemRef = _react["default"].useRef();
|
|
268
284
|
var _React$useState = _react["default"].useState(false),
|
|
@@ -272,7 +288,8 @@ function Item(_ref25) {
|
|
|
272
288
|
var menuItemContextValue = {
|
|
273
289
|
contentId: id,
|
|
274
290
|
ref: (0, _ref31.forkRef)(forwardRef, itemRef),
|
|
275
|
-
role: role
|
|
291
|
+
role: role,
|
|
292
|
+
tabIndex: tabIndex
|
|
276
293
|
};
|
|
277
294
|
var ariaDescribes = [];
|
|
278
295
|
var hasSubMenu = (0, _findComponent.isAdvanceMode)(Children, [DropdownMenu.displayName], true);
|
|
@@ -299,6 +316,9 @@ function Item(_ref25) {
|
|
|
299
316
|
var onBlur = function onBlur(e) {
|
|
300
317
|
if (e.target === itemRef.current) {
|
|
301
318
|
setHighlighted(false);
|
|
319
|
+
if (actionsRef.current) {
|
|
320
|
+
itemRef.current.tabIndex = -1;
|
|
321
|
+
}
|
|
302
322
|
}
|
|
303
323
|
};
|
|
304
324
|
document.addEventListener('focus', onFocus, {
|
|
@@ -324,7 +344,7 @@ function Item(_ref25) {
|
|
|
324
344
|
"use:highlighted": !disabled && highlighted && focusSourceRef.current === 'keyboard',
|
|
325
345
|
"use:role": advancedMode ? undefined : role,
|
|
326
346
|
"use:id": advancedMode ? undefined : id,
|
|
327
|
-
"tabIndex": advancedMode ?
|
|
347
|
+
"use:tabIndex": advancedMode ? -1 : tabIndex
|
|
328
348
|
}, _ref5))), /*#__PURE__*/_react["default"].createElement(Children, _ref16.cn("Children", {}))));
|
|
329
349
|
}
|
|
330
350
|
function Addon(props) {
|
|
@@ -371,7 +391,7 @@ function ItemContent(_ref26) {
|
|
|
371
391
|
return _ref17 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SItemContent, _ref17.cn("SItemContent", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
372
392
|
"role": menuItemCtxValue.role,
|
|
373
393
|
"id": menuItemCtxValue.contentId,
|
|
374
|
-
"tabIndex":
|
|
394
|
+
"tabIndex": menuItemCtxValue.tabIndex,
|
|
375
395
|
"ref": (0, _ref31.forkRef)(menuItemCtxValue.ref, ref),
|
|
376
396
|
"use:aria-describedby": (0, _toConsumableArray2["default"])(describedby).join(' '),
|
|
377
397
|
"aria-haspopup": menuItemCtxValue.hasSubMenu ? 'true' : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_classnames","_dropdown","_flexBox","_scrollArea","_uniqueID","_intergalacticDynamicLocales","_keyboardFocusEnhance","_findComponent","_ref31","_assignProps14","_button","_typography","_excluded","style","_index","sstyled","insert","ListBoxContextProvider","_ref22","children","createElement","hideScrollBarsFromScreenReadersContext","Provider","value","menuItemContext","React","createContext","DropdownMenuRoot","_AbstractDropdown","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","itemRef","props","index","node","_get2","_getPrototypeOf2","prototype","document","activeElement","getTriggerProps","_this$asProps","asProps","Children","uid","visible","hasMenu","isAdvanceMode","DropdownMenu","Menu","displayName","ariaControls","_objectSpread2","onKeyDown","callAllEventHandlers","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","undefined","getListProps","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","getItemProps","_this2","highlightedIndex","isHighlighted","itemProps","tabIndex","ref","tag","ButtonComponent","_props$use","_props$theme","_props$size","use","theme","size","place","_this3","e","_this3$asProps","placement","inlineActions","show","startsWith","hide","isMenuItem","target","getAttribute","handlers","setTimeout","_this3$itemRefs$highl","itemRefs","focus","preventDefault","stopPropagation","_this3$triggerRef$cur","triggerRef","current","render","_ref","_this$asProps2","selectedIndex","interaction","timeout","selectedIndexContext","Dropdown","assignProps","AbstractDropdown","Object","values","enhance","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","localizedMessages","locale","List","_ref23","_ref2","arguments[0]","_ref14","styles","SDropdownMenuList","ScrollAreaComponent","cn","Container","Bar","orientation","Actions","_ref24","_ref3","_ref15","SDropdownMenuActions","Flex","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends2","role","Item","_ref25","_ref5","_ref16","id","disabled","forwardRef","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray2","highlighted","setHighlighted","menuItemContextValue","contentId","forkRef","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","useUID","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","focusSourceRef","useFocusSource","Addon","_useBox","useBox","_useBox2","SDropdownMenuItemAddon","_useBox2$","className","other","_objectWithoutProperties2","Trigger","_ref6","ItemContent","_ref26","_ref7","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_toConsumableArray2","join","ItemContentText","_ref27","_ref8","_ref18","SItemContentText","Text","ItemHint","_ref28","_ref9","_ref19","SItemHint","_React$useContext","_ref10","_ref20","Title","_ref11","_ref21","Nesting","_ref29","_ref12","NestingTrigger","_ref30","_ref13","createComponent","ItemTitle","Group","_default","exports"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, useBox } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { useUID } from '@semcore/utils/lib/uniqueID';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport style from './style/dropdown-menu.shadow.css';\nimport { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\nimport { forkRef } from '@semcore/utils/lib/ref';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonComponent from '@semcore/button';\nimport { Text } from '@semcore/typography';\n\nconst ListBoxContextProvider = ({ children }) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n role = 'menu';\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n // this.handleKeyDownForPopper.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return this.getListProps();\n }\n\n getItemProps(props, index) {\n const { highlightedIndex } = this.asProps;\n const isHighlighted = index === highlightedIndex;\n\n const itemProps = {\n ...super.getItemProps(props, index),\n tabIndex: isHighlighted ? 0 : -1,\n ref: (node) => this.itemRef(props, index, node),\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left'));\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role') === super.childRole;\n\n if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n const { highlightedIndex } = this.asProps;\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n this.triggerRef.current?.focus();\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true}>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <ScrollAreaComponent.Bar orientation='horizontal' />\n <ScrollAreaComponent.Bar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({ id, styles, disabled, Children, forwardRef, role }) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n const focusSourceRef = useFocusSource();\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && focusSourceRef.current === 'keyboard'}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n tabIndex={advancedMode ? undefined : -1}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const [SDropdownMenuItemAddon, { className, ...other }] = useBox(props, props.forwardRef);\n const styles = sstyled(props.styles);\n return (\n <SDropdownMenuItemAddon\n className={cn(styles.cn('SDropdownMenuItemAddon', props).className, className) || undefined}\n {...other}\n />\n );\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={-1}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden={'true'} />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role={'menuitem'}\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAFA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;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,EAAJA,IAAI;EACJoG,IAAI,EAAE,CAACA,IAAI,EAAE;IAAEmC,KAAK,EAALA,KAAK;IAAEZ,OAAO,EAAEuB,WAAW;IAAEyB,IAAI,EAAEL,eAAe;IAAE7C,IAAI,EAAEmD;EAAS,CAAC,CAAC;EACpF;AACJ;AACA;EACIW,OAAO,EAAE,CAACA,OAAO,EAAE;IAAEvC,OAAO,EAAE0C,cAAc;IAAEnD,KAAK,EAALA;EAAM,CAAC,CAAC;EACtDuD,SAAS,EAAEV,KAAK;EAChBR,QAAQ,EAAEnD,IAAI;EACdsE,KAAK,EAAEnI,oBAAQ,CAACmI;AAClB,CAAC,EACD;EACE/B,MAAM,EAAE,CAACpG,oBAAQ;AACnB,CAAC,CACF;AAED7D,YAAY,CAAC4D,oBAAoB,GAAGA,8BAAoB;AAAC,IAAAqI,QAAA,GAE1CjM,YAAY;AAAAkM,OAAA,cAAAD,QAAA"}
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_classnames","_dropdown","_flexBox","_scrollArea","_uniqueID","_intergalacticDynamicLocales","_keyboardFocusEnhance","_findComponent","_ref31","_assignProps14","_button","_typography","_excluded","style","_index","sstyled","insert","ListBoxContextProvider","_ref22","children","createElement","hideScrollBarsFromScreenReadersContext","Provider","value","menuItemContext","React","createContext","DropdownMenuRoot","_AbstractDropdown","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","createRef","_createClass2","key","itemRef","props","index","node","_get2","_getPrototypeOf2","prototype","document","activeElement","getTriggerProps","_this$asProps","asProps","Children","uid","visible","hasMenu","isAdvanceMode","DropdownMenu","Menu","displayName","ariaControls","_objectSpread2","onKeyDown","callAllEventHandlers","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","undefined","getListProps","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","ref","actionsRef","handlePreventTabOnActions","getItemProps","_this2","_this$asProps2","highlightedIndex","isHighlighted","itemProps","tabIndex","tag","ButtonComponent","_props$use","_props$theme","_props$size","use","theme","size","place","_this3","e","_this3$asProps","placement","inlineActions","show","startsWith","hide","isMenuItem","target","getAttribute","handlers","setTimeout","_this3$itemRefs$highl","itemRefs","focus","preventDefault","stopPropagation","_this3$triggerRef$cur","triggerRef","current","render","_ref","_this$asProps3","selectedIndex","interaction","timeout","selectedIndexContext","Dropdown","assignProps","AbstractDropdown","Object","values","enhance","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","localizedMessages","locale","List","_ref23","_ref2","arguments[0]","_ref14","styles","SDropdownMenuList","ScrollAreaComponent","cn","Container","Bar","orientation","Actions","_ref24","_ref3","_ref15","SDropdownMenuActions","Flex","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends2","role","Item","_ref25","_ref5","_ref16","id","disabled","forwardRef","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray2","highlighted","setHighlighted","menuItemContextValue","contentId","forkRef","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","useUID","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","focusSourceRef","useFocusSource","Addon","_useBox","useBox","_useBox2","SDropdownMenuItemAddon","_useBox2$","className","other","_objectWithoutProperties2","Trigger","_ref6","ItemContent","_ref26","_ref7","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_toConsumableArray2","join","ItemContentText","_ref27","_ref8","_ref18","SItemContentText","Text","ItemHint","_ref28","_ref9","_ref19","SItemHint","_React$useContext","_ref10","_ref20","Title","_ref11","_ref21","Nesting","_ref29","_ref12","NestingTrigger","_ref30","_ref13","createComponent","ItemTitle","Group","_default","exports"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, useBox } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { useUID } from '@semcore/utils/lib/uniqueID';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport style from './style/dropdown-menu.shadow.css';\nimport { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\nimport { forkRef } from '@semcore/utils/lib/ref';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonComponent from '@semcore/button';\nimport { Text } from '@semcore/typography';\n\nconst ListBoxContextProvider = ({ children }) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n actionsRef = React.createRef();\n role = 'menu';\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return {\n ...this.getListProps(),\n ref: this.actionsRef,\n onKeyDown: callAllEventHandlers(\n this.handlePreventTabOnActions.bind(this),\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getItemProps(props, index) {\n const { highlightedIndex, visible } = this.asProps;\n const isHighlighted = index === highlightedIndex;\n const itemProps = {\n ...super.getItemProps(props, index),\n tabIndex: isHighlighted && visible ? 0 : -1,\n ref: (node) => this.itemRef(props, index, node),\n actionsRef: this.actionsRef,\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left'));\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role') === super.childRole;\n\n if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n const { highlightedIndex } = this.asProps;\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n this.triggerRef.current?.focus();\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n handlePreventTabOnActions(e) {\n if (e.key === 'Tab') {\n e.stopPropagation();\n e.preventDefault();\n return false;\n }\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true}>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <ScrollAreaComponent.Bar orientation='horizontal' />\n <ScrollAreaComponent.Bar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({ id, styles, disabled, Children, forwardRef, role, tabIndex, actionsRef }) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n tabIndex,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n\n if (actionsRef.current) {\n itemRef.current.tabIndex = -1;\n }\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n const focusSourceRef = useFocusSource();\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && focusSourceRef.current === 'keyboard'}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n use:tabIndex={advancedMode ? -1 : tabIndex}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const [SDropdownMenuItemAddon, { className, ...other }] = useBox(props, props.forwardRef);\n const styles = sstyled(props.styles);\n return (\n <SDropdownMenuItemAddon\n className={cn(styles.cn('SDropdownMenuItemAddon', props).className, className) || undefined}\n {...other}\n />\n );\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={menuItemCtxValue.tabIndex}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden={'true'} />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role={'menuitem'}\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAFA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,SAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,uBAAA,CAAAC,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,4BAAA,GAAAR,OAAA;AAEA,IAAAS,qBAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,WAAA,GAAAd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ourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport Dropdown, {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n} from '@semcore/dropdown';\nimport { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport { ScrollAreaProps } from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\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 | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state\n * @deprecated Dropdown menu item can't have that state\n */\n selected?: boolean;\n /**\n * Disables item\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n */\n highlighted?: boolean;\n /**\n * Disables hover state\n * @deprecated use `disabled` instead\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemHintProps extends DropdownMenuItemHintProps, UnknownProperties {}\nexport type DropdownMenuItemHintProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemTitleProps\n extends DropdownMenuItemTitleProps,\n UnknownProperties {}\nexport type DropdownMenuItemTitleProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuContext extends DropdownMenuContext, UnknownProperties {}\nexport type DropdownMenuContext = DropdownContext & {\n highlightedIndex?: number;\n getListProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getItemHintProps: PropGetterFn;\n getItemTitleProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuHandlers extends DropdownMenuHandlers, UnknownProperties {}\nexport type DropdownMenuHandlers = DropdownHandlers & {\n highlightedIndex: (index: number) => void;\n};\n\nexport type DropdownMenuTriggerProps = DropdownTriggerProps;\n\ndeclare const DropdownMenu: Intergalactic.Component<\n 'div',\n DropdownMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: Intergalactic.Component<'div', DropdownMenuProps>;\n List: Intergalactic.Component<\n 'div',\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Actions: Intergalactic.Component<\n typeof Flex,\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Menu: Intergalactic.Component<\n 'div',\n DropdownMenuMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Item: Intergalactic.Component<\n typeof Dropdown.Item,\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n Addon: typeof Box;\n Content: typeof Flex;\n Text: typeof Text;\n Hint: typeof Flex;\n };\n /**\n * @deprecated Use Group with title prop\n */\n ItemTitle: Intergalactic.Component<'div', DropdownMenuItemTitleProps>;\n /**\n * @deprecated Use prop subTitle on Group or Item component\n */\n ItemHint: Intergalactic.Component<'div', DropdownMenuItemHintProps>;\n Group: typeof Dropdown.Group;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Nesting: Intergalactic.Component<\n 'div',\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n /**\n * @deprecated Use Item instead of Nesting\n */\n Trigger: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Item: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Addon: typeof Box;\n };\n\n selectedIndexContext: React.Context<number>;\n};\n\nexport default DropdownMenu;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport Dropdown, {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n DropdownPopperAriaProps,\n} from '@semcore/dropdown';\nimport { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport { ScrollAreaProps } from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\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 | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state\n * @deprecated Dropdown menu item can't have that state\n */\n selected?: boolean;\n /**\n * Disables item\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n */\n highlighted?: boolean;\n /**\n * Disables hover state\n * @deprecated use `disabled` instead\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemHintProps extends DropdownMenuItemHintProps, UnknownProperties {}\nexport type DropdownMenuItemHintProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemTitleProps\n extends DropdownMenuItemTitleProps,\n UnknownProperties {}\nexport type DropdownMenuItemTitleProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuContext extends DropdownMenuContext, UnknownProperties {}\nexport type DropdownMenuContext = DropdownContext & {\n highlightedIndex?: number;\n getListProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getItemHintProps: PropGetterFn;\n getItemTitleProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuHandlers extends DropdownMenuHandlers, UnknownProperties {}\nexport type DropdownMenuHandlers = DropdownHandlers & {\n highlightedIndex: (index: number) => void;\n};\n\nexport type DropdownMenuTriggerProps = DropdownTriggerProps;\n\ndeclare const DropdownMenu: Intergalactic.Component<\n 'div',\n DropdownMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: Intergalactic.Component<'div', DropdownMenuProps & DropdownPopperAriaProps>;\n List: Intergalactic.Component<\n 'div',\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Actions: Intergalactic.Component<\n typeof Flex,\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Menu: Intergalactic.Component<\n 'div',\n DropdownMenuMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Item: Intergalactic.Component<\n typeof Dropdown.Item,\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n Addon: typeof Box;\n Content: typeof Flex;\n Text: typeof Text;\n Hint: typeof Flex;\n };\n /**\n * @deprecated Use Group with title prop\n */\n ItemTitle: Intergalactic.Component<'div', DropdownMenuItemTitleProps>;\n /**\n * @deprecated Use prop subTitle on Group or Item component\n */\n ItemHint: Intergalactic.Component<'div', DropdownMenuItemHintProps>;\n Group: typeof Dropdown.Group;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Nesting: Intergalactic.Component<\n 'div',\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n /**\n * @deprecated Use Item instead of Nesting\n */\n Trigger: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Item: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Addon: typeof Box;\n };\n\n selectedIndexContext: React.Context<number>;\n};\n\nexport default DropdownMenu;\n"],"mappings":""}
|
package/lib/es6/DropdownMenu.js
CHANGED
|
@@ -35,24 +35,24 @@ import ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@se
|
|
|
35
35
|
import { useUID } from '@semcore/utils/lib/uniqueID';
|
|
36
36
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
37
37
|
/*__reshadow-styles__:"./style/dropdown-menu.shadow.css"*/
|
|
38
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
39
|
-
"__SDropdownMenuItemContainer": "
|
|
40
|
-
"_nesting-trigger": "__nesting-
|
|
41
|
-
"__SDropdownMenuNesting": "
|
|
42
|
-
"_size_l": "
|
|
43
|
-
"_size_m": "
|
|
44
|
-
"_highlighted": "
|
|
45
|
-
"__SDropdownNestingItem": "
|
|
46
|
-
"__SItemContent": "
|
|
47
|
-
"__SItemHint": "
|
|
48
|
-
"__SDropdownMenuList": "
|
|
49
|
-
"__SShadowHorizontal": "
|
|
50
|
-
"_position_median": "
|
|
51
|
-
"_position_start": "
|
|
52
|
-
"_position_end": "
|
|
53
|
-
"__SShadowVertical": "
|
|
54
|
-
"__SDropdownMenuItemAddon": "
|
|
55
|
-
"__SItemContentText": "
|
|
38
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SDropdownMenuList_10zcc_gg_{max-height:240px;padding:var(--intergalactic-spacing-1x, 4px)0;position:relative;min-height:26px;min-width:32px;box-sizing:content-box;z-index:0;color:var(--intergalactic-text-primary, #191b23)}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_:after,.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_:before{width:16px;height:100%;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_._position_median_10zcc_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,\n linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_._position_median_10zcc_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,\n linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_._position_start_10zcc_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,\n linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowHorizontal_10zcc_gg_._position_end_10zcc_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,\n linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_:after,.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_:before{width:100%;height:16px;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_._position_median_10zcc_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,\n linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_._position_median_10zcc_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,\n linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_._position_start_10zcc_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,\n linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_10zcc_gg_ .___SShadowVertical_10zcc_gg_._position_end_10zcc_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,\n linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuItemContainer_10zcc_gg_.__nesting-trigger_10zcc_gg_{justify-content:space-between}.___SDropdownMenuItemAddon_10zcc_gg_,.___SItemContentText_10zcc_gg_{display:inline-flex;margin-left:var(--intergalactic-spacing-1x, 4px);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SDropdownMenuItemAddon_10zcc_gg_:first-child,.___SItemContentText_10zcc_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_10zcc_gg_:last-child,.___SItemContentText_10zcc_gg_:last-child{margin-right:0}.___SDropdownMenuNesting_10zcc_gg_,.___SDropdownMenuNesting_10zcc_gg_._size_l_10zcc_gg_,.___SDropdownMenuNesting_10zcc_gg_._size_m_10zcc_gg_{padding:0}.___SDropdownMenuNesting_10zcc_gg_.__highlighted_10zcc_gg_{z-index:1;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5)) inset}.___SDropdownNestingItem_10zcc_gg_._size_l_10zcc_gg_,.___SDropdownNestingItem_10zcc_gg_._size_m_10zcc_gg_{padding-right:0}.___SDropdownNestingItem_10zcc_gg_ .___SDropdownMenuItemContainer_10zcc_gg_{width:auto;padding-top:0;padding-bottom:0;padding-left:0;min-height:auto}.___SItemContent_10zcc_gg_:focus{outline:0}.___SItemHint_10zcc_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}" /*__inner_css_end__*/, "10zcc_gg_") /*__reshadow_css_end__*/, {
|
|
39
|
+
"__SDropdownMenuItemContainer": "___SDropdownMenuItemContainer_10zcc_gg_",
|
|
40
|
+
"_nesting-trigger": "__nesting-trigger_10zcc_gg_",
|
|
41
|
+
"__SDropdownMenuNesting": "___SDropdownMenuNesting_10zcc_gg_",
|
|
42
|
+
"_size_l": "_size_l_10zcc_gg_",
|
|
43
|
+
"_size_m": "_size_m_10zcc_gg_",
|
|
44
|
+
"_highlighted": "__highlighted_10zcc_gg_",
|
|
45
|
+
"__SDropdownNestingItem": "___SDropdownNestingItem_10zcc_gg_",
|
|
46
|
+
"__SItemContent": "___SItemContent_10zcc_gg_",
|
|
47
|
+
"__SItemHint": "___SItemHint_10zcc_gg_",
|
|
48
|
+
"__SDropdownMenuList": "___SDropdownMenuList_10zcc_gg_",
|
|
49
|
+
"__SShadowHorizontal": "___SShadowHorizontal_10zcc_gg_",
|
|
50
|
+
"_position_median": "_position_median_10zcc_gg_",
|
|
51
|
+
"_position_start": "_position_start_10zcc_gg_",
|
|
52
|
+
"_position_end": "_position_end_10zcc_gg_",
|
|
53
|
+
"__SShadowVertical": "___SShadowVertical_10zcc_gg_",
|
|
54
|
+
"__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_10zcc_gg_",
|
|
55
|
+
"__SItemContentText": "___SItemContentText_10zcc_gg_"
|
|
56
56
|
});
|
|
57
57
|
import { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
|
|
58
58
|
import { isAdvanceMode } from '@semcore/utils/lib/findComponent';
|
|
@@ -77,6 +77,7 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
77
77
|
args[_key] = arguments[_key];
|
|
78
78
|
}
|
|
79
79
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "actionsRef", /*#__PURE__*/React.createRef());
|
|
80
81
|
_defineProperty(_assertThisInitialized(_this), "role", 'menu');
|
|
81
82
|
return _this;
|
|
82
83
|
}
|
|
@@ -114,27 +115,31 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
114
115
|
key: "getPopperProps",
|
|
115
116
|
value: function getPopperProps() {
|
|
116
117
|
return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(DropdownMenuRoot.prototype), "getPopperProps", this).call(this)), {}, {
|
|
117
|
-
onKeyDown: callAllEventHandlers(this.handlePreventCommonKeyDown.bind(this), this.handlePreventPopperKeyDown.bind(this)
|
|
118
|
-
// this.handleKeyDownForPopper.bind(this),
|
|
119
|
-
)
|
|
118
|
+
onKeyDown: callAllEventHandlers(this.handlePreventCommonKeyDown.bind(this), this.handlePreventPopperKeyDown.bind(this))
|
|
120
119
|
});
|
|
121
120
|
}
|
|
122
121
|
}, {
|
|
123
122
|
key: "getActionsProps",
|
|
124
123
|
value: function getActionsProps() {
|
|
125
|
-
return this.getListProps()
|
|
124
|
+
return _objectSpread(_objectSpread({}, this.getListProps()), {}, {
|
|
125
|
+
ref: this.actionsRef,
|
|
126
|
+
onKeyDown: callAllEventHandlers(this.handlePreventTabOnActions.bind(this), this.handlePreventCommonKeyDown.bind(this), this.handleKeyDownForMenu('list'), this.handleArrowKeyDown.bind(this))
|
|
127
|
+
});
|
|
126
128
|
}
|
|
127
129
|
}, {
|
|
128
130
|
key: "getItemProps",
|
|
129
131
|
value: function getItemProps(props, index) {
|
|
130
132
|
var _this2 = this;
|
|
131
|
-
var
|
|
133
|
+
var _this$asProps2 = this.asProps,
|
|
134
|
+
highlightedIndex = _this$asProps2.highlightedIndex,
|
|
135
|
+
visible = _this$asProps2.visible;
|
|
132
136
|
var isHighlighted = index === highlightedIndex;
|
|
133
137
|
var itemProps = _objectSpread(_objectSpread({}, _get(_getPrototypeOf(DropdownMenuRoot.prototype), "getItemProps", this).call(this, props, index)), {}, {
|
|
134
|
-
tabIndex: isHighlighted ? 0 : -1,
|
|
138
|
+
tabIndex: isHighlighted && visible ? 0 : -1,
|
|
135
139
|
ref: function ref(node) {
|
|
136
140
|
return _this2.itemRef(props, index, node);
|
|
137
|
-
}
|
|
141
|
+
},
|
|
142
|
+
actionsRef: this.actionsRef
|
|
138
143
|
});
|
|
139
144
|
if (props.tag === ButtonComponent) {
|
|
140
145
|
var _props$use, _props$theme, _props$size;
|
|
@@ -180,15 +185,24 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
180
185
|
}
|
|
181
186
|
};
|
|
182
187
|
}
|
|
188
|
+
}, {
|
|
189
|
+
key: "handlePreventTabOnActions",
|
|
190
|
+
value: function handlePreventTabOnActions(e) {
|
|
191
|
+
if (e.key === 'Tab') {
|
|
192
|
+
e.stopPropagation();
|
|
193
|
+
e.preventDefault();
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
183
197
|
}, {
|
|
184
198
|
key: "render",
|
|
185
199
|
value: function render() {
|
|
186
200
|
var _ref = this.asProps;
|
|
187
|
-
var _this$
|
|
188
|
-
Children = _this$
|
|
189
|
-
selectedIndex = _this$
|
|
190
|
-
interaction = _this$
|
|
191
|
-
timeout = _this$
|
|
201
|
+
var _this$asProps3 = this.asProps,
|
|
202
|
+
Children = _this$asProps3.Children,
|
|
203
|
+
selectedIndex = _this$asProps3.selectedIndex,
|
|
204
|
+
interaction = _this$asProps3.interaction,
|
|
205
|
+
timeout = _this$asProps3.timeout;
|
|
192
206
|
this.itemProps = [];
|
|
193
207
|
return /*#__PURE__*/React.createElement(selectedIndexContext.Provider, {
|
|
194
208
|
value: selectedIndex
|
|
@@ -267,7 +281,9 @@ function Item(_ref25) {
|
|
|
267
281
|
disabled = _ref25.disabled,
|
|
268
282
|
Children = _ref25.Children,
|
|
269
283
|
forwardRef = _ref25.forwardRef,
|
|
270
|
-
role = _ref25.role
|
|
284
|
+
role = _ref25.role,
|
|
285
|
+
tabIndex = _ref25.tabIndex,
|
|
286
|
+
actionsRef = _ref25.actionsRef;
|
|
271
287
|
var SDropdownMenuItemContainer = Dropdown.Item;
|
|
272
288
|
var itemRef = React.useRef();
|
|
273
289
|
var _React$useState = React.useState(false),
|
|
@@ -277,7 +293,8 @@ function Item(_ref25) {
|
|
|
277
293
|
var menuItemContextValue = {
|
|
278
294
|
contentId: id,
|
|
279
295
|
ref: forkRef(forwardRef, itemRef),
|
|
280
|
-
role: role
|
|
296
|
+
role: role,
|
|
297
|
+
tabIndex: tabIndex
|
|
281
298
|
};
|
|
282
299
|
var ariaDescribes = [];
|
|
283
300
|
var hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);
|
|
@@ -304,6 +321,9 @@ function Item(_ref25) {
|
|
|
304
321
|
var onBlur = function onBlur(e) {
|
|
305
322
|
if (e.target === itemRef.current) {
|
|
306
323
|
setHighlighted(false);
|
|
324
|
+
if (actionsRef.current) {
|
|
325
|
+
itemRef.current.tabIndex = -1;
|
|
326
|
+
}
|
|
307
327
|
}
|
|
308
328
|
};
|
|
309
329
|
document.addEventListener('focus', onFocus, {
|
|
@@ -329,7 +349,7 @@ function Item(_ref25) {
|
|
|
329
349
|
"use:highlighted": !disabled && highlighted && focusSourceRef.current === 'keyboard',
|
|
330
350
|
"use:role": advancedMode ? undefined : role,
|
|
331
351
|
"use:id": advancedMode ? undefined : id,
|
|
332
|
-
"tabIndex": advancedMode ?
|
|
352
|
+
"use:tabIndex": advancedMode ? -1 : tabIndex
|
|
333
353
|
}, _ref5))), /*#__PURE__*/React.createElement(Children, _ref16.cn("Children", {}))));
|
|
334
354
|
}
|
|
335
355
|
function Addon(props) {
|
|
@@ -376,7 +396,7 @@ function ItemContent(_ref26) {
|
|
|
376
396
|
return _ref17 = sstyled(styles), /*#__PURE__*/React.createElement(SItemContent, _ref17.cn("SItemContent", _objectSpread({}, _assignProps7({
|
|
377
397
|
"role": menuItemCtxValue.role,
|
|
378
398
|
"id": menuItemCtxValue.contentId,
|
|
379
|
-
"tabIndex":
|
|
399
|
+
"tabIndex": menuItemCtxValue.tabIndex,
|
|
380
400
|
"ref": forkRef(menuItemCtxValue.ref, ref),
|
|
381
401
|
"use:aria-describedby": _toConsumableArray(describedby).join(' '),
|
|
382
402
|
"aria-haspopup": menuItemCtxValue.hasSubMenu ? 'true' : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":["React","cn","createComponent","sstyled","Root","Dropdown","AbstractDropdown","selectedIndexContext","enhance","Flex","useBox","ScrollAreaComponent","hideScrollBarsFromScreenReadersContext","useUID","localizedMessages","style","_sstyled","insert","useFocusSource","isAdvanceMode","forkRef","callAllEventHandlers","ButtonComponent","Text","ListBoxContextProvider","_ref22","children","createElement","Provider","value","menuItemContext","createContext","DropdownMenuRoot","_AbstractDropdown","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","_createClass","key","itemRef","props","index","node","_get","_getPrototypeOf","prototype","document","activeElement","getTriggerProps","_this$asProps","asProps","Children","uid","visible","hasMenu","DropdownMenu","Menu","displayName","ariaControls","_objectSpread","onKeyDown","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","undefined","getListProps","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","getItemProps","_this2","highlightedIndex","isHighlighted","itemProps","tabIndex","ref","tag","_props$use","_props$theme","_props$size","use","theme","size","place","_this3","e","_this3$asProps","placement","inlineActions","show","startsWith","hide","isMenuItem","target","getAttribute","handlers","setTimeout","_this3$itemRefs$highl","itemRefs","focus","preventDefault","stopPropagation","_this3$triggerRef$cur","triggerRef","current","render","_ref","_this$asProps2","selectedIndex","interaction","timeout","_assignProps","Object","values","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","locale","List","_ref23","_ref2","arguments[0]","_ref14","styles","SDropdownMenuList","_assignProps2","Container","Bar","orientation","Actions","_ref24","_ref3","_ref15","SDropdownMenuActions","_assignProps3","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends","role","_assignProps4","Item","_ref25","_ref5","_ref16","id","disabled","forwardRef","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray","highlighted","setHighlighted","menuItemContextValue","contentId","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","focusSourceRef","_assignProps5","Addon","_useBox","_useBox2","SDropdownMenuItemAddon","_useBox2$","className","other","_objectWithoutProperties","_excluded","Trigger","_ref6","_assignProps6","ItemContent","_ref26","_ref7","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_assignProps7","_toConsumableArray","join","ItemContentText","_ref27","_ref8","_ref18","SItemContentText","_assignProps8","ItemHint","_ref28","_ref9","_ref19","SItemHint","_React$useContext","_assignProps9","_ref10","_ref20","_assignProps10","Title","_ref11","_ref21","_assignProps11","Nesting","_ref29","_ref12","_assignProps12","NestingTrigger","_ref30","_ref13","_assignProps13","ItemTitle","Group"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, useBox } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { useUID } from '@semcore/utils/lib/uniqueID';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport style from './style/dropdown-menu.shadow.css';\nimport { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\nimport { forkRef } from '@semcore/utils/lib/ref';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonComponent from '@semcore/button';\nimport { Text } from '@semcore/typography';\n\nconst ListBoxContextProvider = ({ children }) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n role = 'menu';\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n // this.handleKeyDownForPopper.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return this.getListProps();\n }\n\n getItemProps(props, index) {\n const { highlightedIndex } = this.asProps;\n const isHighlighted = index === highlightedIndex;\n\n const itemProps = {\n ...super.getItemProps(props, index),\n tabIndex: isHighlighted ? 0 : -1,\n ref: (node) => this.itemRef(props, index, node),\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left'));\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role') === super.childRole;\n\n if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n const { highlightedIndex } = this.asProps;\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n this.triggerRef.current?.focus();\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true}>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <ScrollAreaComponent.Bar orientation='horizontal' />\n <ScrollAreaComponent.Bar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({ id, styles, disabled, Children, forwardRef, role }) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n const focusSourceRef = useFocusSource();\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && focusSourceRef.current === 'keyboard'}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n tabIndex={advancedMode ? undefined : -1}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const [SDropdownMenuItemAddon, { className, ...other }] = useBox(props, props.forwardRef);\n const styles = sstyled(props.styles);\n return (\n <SDropdownMenuItemAddon\n className={cn(styles.cn('SDropdownMenuItemAddon', props).className, className) || undefined}\n {...other}\n />\n );\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={-1}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden={'true'} />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role={'menuitem'}\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,YAAY;AAC3B,OAAOC,eAAe,IAAIC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC9D,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,oBAAoB,EAAEC,OAAO,QAAQ,mBAAmB;AAC7F,SAASC,IAAI,EAAEC,MAAM,QAAQ,mBAAmB;AAChD,OAAOC,mBAAmB,IAAIC,sCAAsC,QAAQ,sBAAsB;AAClG,SAASC,MAAM,QAAQ,6BAA6B;AACpD,SAASC,iBAAiB,QAAQ,gDAAgD;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;E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ACsB,OAAO,EAAAuE,cAAA;IAAA,OAC5B3L,YAAY,CAACwI,OAAO;IAAA,OACpBpC,UAAU;IAAA,YACL;EAAU,GAAAsF,MAAA,EACpB;AAEN;AAEA,IAAM1L,YAAY,GAAGlE,eAAe,CAClC8B,gBAAgB,EAChB;EACE4K,OAAO,EAAPA,OAAO;EACP9C,MAAM,EAAEzJ,QAAQ,CAACyJ,MAAM;EACvBxB,IAAI,EAAJA,IAAI;EACJW,OAAO,EAAPA,OAAO;EACP5E,IAAI,EAAJA,IAAI;EACJ6F,IAAI,EAAE,CAACA,IAAI,EAAE;IAAEiC,KAAK,EAALA,KAAK;IAAEX,OAAO,EAAEuB,WAAW;IAAExL,IAAI,EAAE6M,eAAe;IAAE9C,IAAI,EAAEoD;EAAS,CAAC,CAAC;EACpF;AACJ;AACA;EACIc,OAAO,EAAE,CAACA,OAAO,EAAE;IAAE5C,OAAO,EAAEgD,cAAc;IAAEzD,KAAK,EAALA;EAAM,CAAC,CAAC;EACtD6D,SAAS,EAAEZ,KAAK;EAChBV,QAAQ,EAAEpD,IAAI;EACd2E,KAAK,EAAE5P,QAAQ,CAAC4P;AAClB,CAAC,EACD;EACEpC,MAAM,EAAE,CAACxN,QAAQ;AACnB,CAAC,CACF;AAED+D,YAAY,CAAC7D,oBAAoB,GAAGA,oBAAoB;AAExD,eAAe6D,YAAY"}
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":["React","cn","createComponent","sstyled","Root","Dropdown","AbstractDropdown","selectedIndexContext","enhance","Flex","useBox","ScrollAreaComponent","hideScrollBarsFromScreenReadersContext","useUID","localizedMessages","style","_sstyled","insert","useFocusSource","isAdvanceMode","forkRef","callAllEventHandlers","ButtonComponent","Text","ListBoxContextProvider","_ref22","children","createElement","Provider","value","menuItemContext","createContext","DropdownMenuRoot","_AbstractDropdown","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","createRef","_createClass","key","itemRef","props","index","node","_get","_getPrototypeOf","prototype","document","activeElement","getTriggerProps","_this$asProps","asProps","Children","uid","visible","hasMenu","DropdownMenu","Menu","displayName","ariaControls","_objectSpread","onKeyDown","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","undefined","getListProps","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","ref","actionsRef","handlePreventTabOnActions","getItemProps","_this2","_this$asProps2","highlightedIndex","isHighlighted","itemProps","tabIndex","tag","_props$use","_props$theme","_props$size","use","theme","size","place","_this3","e","_this3$asProps","placement","inlineActions","show","startsWith","hide","isMenuItem","target","getAttribute","handlers","setTimeout","_this3$itemRefs$highl","itemRefs","focus","preventDefault","stopPropagation","_this3$triggerRef$cur","triggerRef","current","render","_ref","_this$asProps3","selectedIndex","interaction","timeout","_assignProps","Object","values","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","locale","List","_ref23","_ref2","arguments[0]","_ref14","styles","SDropdownMenuList","_assignProps2","Container","Bar","orientation","Actions","_ref24","_ref3","_ref15","SDropdownMenuActions","_assignProps3","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends","role","_assignProps4","Item","_ref25","_ref5","_ref16","id","disabled","forwardRef","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray","highlighted","setHighlighted","menuItemContextValue","contentId","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","focusSourceRef","_assignProps5","Addon","_useBox","_useBox2","SDropdownMenuItemAddon","_useBox2$","className","other","_objectWithoutProperties","_excluded","Trigger","_ref6","_assignProps6","ItemContent","_ref26","_ref7","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_assignProps7","_toConsumableArray","join","ItemContentText","_ref27","_ref8","_ref18","SItemContentText","_assignProps8","ItemHint","_ref28","_ref9","_ref19","SItemHint","_React$useContext","_assignProps9","_ref10","_ref20","_assignProps10","Title","_ref11","_ref21","_assignProps11","Nesting","_ref29","_ref12","_assignProps12","NestingTrigger","_ref30","_ref13","_assignProps13","ItemTitle","Group"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, useBox } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { useUID } from '@semcore/utils/lib/uniqueID';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport style from './style/dropdown-menu.shadow.css';\nimport { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\nimport { forkRef } from '@semcore/utils/lib/ref';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonComponent from '@semcore/button';\nimport { Text } from '@semcore/typography';\n\nconst ListBoxContextProvider = ({ children }) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n actionsRef = React.createRef();\n role = 'menu';\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return {\n ...this.getListProps(),\n ref: this.actionsRef,\n onKeyDown: callAllEventHandlers(\n this.handlePreventTabOnActions.bind(this),\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getItemProps(props, index) {\n const { highlightedIndex, visible } = this.asProps;\n const isHighlighted = index === highlightedIndex;\n const itemProps = {\n ...super.getItemProps(props, index),\n tabIndex: isHighlighted && visible ? 0 : -1,\n ref: (node) => this.itemRef(props, index, node),\n actionsRef: this.actionsRef,\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left'));\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role') === super.childRole;\n\n if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n const { highlightedIndex } = this.asProps;\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n this.triggerRef.current?.focus();\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n handlePreventTabOnActions(e) {\n if (e.key === 'Tab') {\n e.stopPropagation();\n e.preventDefault();\n return false;\n }\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true}>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <ScrollAreaComponent.Bar orientation='horizontal' />\n <ScrollAreaComponent.Bar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({ id, styles, disabled, Children, forwardRef, role, tabIndex, actionsRef }) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n tabIndex,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n\n if (actionsRef.current) {\n itemRef.current.tabIndex = -1;\n }\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n const focusSourceRef = useFocusSource();\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && focusSourceRef.current === 'keyboard'}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n use:tabIndex={advancedMode ? -1 : tabIndex}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const [SDropdownMenuItemAddon, { className, ...other }] = useBox(props, props.forwardRef);\n const styles = sstyled(props.styles);\n return (\n <SDropdownMenuItemAddon\n className={cn(styles.cn('SDropdownMenuItemAddon', props).className, className) || undefined}\n {...other}\n />\n );\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={menuItemCtxValue.tabIndex}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden={'true'} />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role={'menuitem'}\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,YAAY;AAC3B,OAAOC,eAAe,IAAIC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC9D,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,oBAAoB,EAAEC,OAAO,QAAQ,mBAAmB;AAC7F,SAASC,IAAI,EAAEC,MAAM,QAAQ,mBAAmB;AAChD,OAAOC,mBAAmB,IAAIC,sCAAsC,QAA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2I,OAAO;IAAA,OACpBpC,UAAU;IAAA,YACL;EAAU,GAAAsF,MAAA,EACpB;AAEN;AAEA,IAAM7L,YAAY,GAAGnE,eAAe,CAClC8B,gBAAgB,EAChB;EACEgL,OAAO,EAAPA,OAAO;EACP9C,MAAM,EAAE7J,QAAQ,CAAC6J,MAAM;EACvBxB,IAAI,EAAJA,IAAI;EACJW,OAAO,EAAPA,OAAO;EACP/E,IAAI,EAAJA,IAAI;EACJgG,IAAI,EAAE,CAACA,IAAI,EAAE;IAAEiC,KAAK,EAALA,KAAK;IAAEX,OAAO,EAAEuB,WAAW;IAAE5L,IAAI,EAAEiN,eAAe;IAAE9C,IAAI,EAAEoD;EAAS,CAAC,CAAC;EACpF;AACJ;AACA;EACIc,OAAO,EAAE,CAACA,OAAO,EAAE;IAAE5C,OAAO,EAAEgD,cAAc;IAAEzD,KAAK,EAALA;EAAM,CAAC,CAAC;EACtD6D,SAAS,EAAEZ,KAAK;EAChBV,QAAQ,EAAEpD,IAAI;EACd2E,KAAK,EAAEhQ,QAAQ,CAACgQ;AAClB,CAAC,EACD;EACEpC,MAAM,EAAE,CAAC5N,QAAQ;AACnB,CAAC,CACF;AAEDgE,YAAY,CAAC9D,oBAAoB,GAAGA,oBAAoB;AAExD,eAAe8D,YAAY"}
|
package/lib/es6/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport Dropdown, {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n} from '@semcore/dropdown';\nimport { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport { ScrollAreaProps } from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\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 | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state\n * @deprecated Dropdown menu item can't have that state\n */\n selected?: boolean;\n /**\n * Disables item\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n */\n highlighted?: boolean;\n /**\n * Disables hover state\n * @deprecated use `disabled` instead\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemHintProps extends DropdownMenuItemHintProps, UnknownProperties {}\nexport type DropdownMenuItemHintProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemTitleProps\n extends DropdownMenuItemTitleProps,\n UnknownProperties {}\nexport type DropdownMenuItemTitleProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuContext extends DropdownMenuContext, UnknownProperties {}\nexport type DropdownMenuContext = DropdownContext & {\n highlightedIndex?: number;\n getListProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getItemHintProps: PropGetterFn;\n getItemTitleProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuHandlers extends DropdownMenuHandlers, UnknownProperties {}\nexport type DropdownMenuHandlers = DropdownHandlers & {\n highlightedIndex: (index: number) => void;\n};\n\nexport type DropdownMenuTriggerProps = DropdownTriggerProps;\n\ndeclare const DropdownMenu: Intergalactic.Component<\n 'div',\n DropdownMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: Intergalactic.Component<'div', DropdownMenuProps>;\n List: Intergalactic.Component<\n 'div',\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Actions: Intergalactic.Component<\n typeof Flex,\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Menu: Intergalactic.Component<\n 'div',\n DropdownMenuMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Item: Intergalactic.Component<\n typeof Dropdown.Item,\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n Addon: typeof Box;\n Content: typeof Flex;\n Text: typeof Text;\n Hint: typeof Flex;\n };\n /**\n * @deprecated Use Group with title prop\n */\n ItemTitle: Intergalactic.Component<'div', DropdownMenuItemTitleProps>;\n /**\n * @deprecated Use prop subTitle on Group or Item component\n */\n ItemHint: Intergalactic.Component<'div', DropdownMenuItemHintProps>;\n Group: typeof Dropdown.Group;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Nesting: Intergalactic.Component<\n 'div',\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n /**\n * @deprecated Use Item instead of Nesting\n */\n Trigger: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Item: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Addon: typeof Box;\n };\n\n selectedIndexContext: React.Context<number>;\n};\n\nexport default DropdownMenu;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport Dropdown, {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n DropdownPopperAriaProps,\n} from '@semcore/dropdown';\nimport { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport { ScrollAreaProps } from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\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 | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state\n * @deprecated Dropdown menu item can't have that state\n */\n selected?: boolean;\n /**\n * Disables item\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n */\n highlighted?: boolean;\n /**\n * Disables hover state\n * @deprecated use `disabled` instead\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemHintProps extends DropdownMenuItemHintProps, UnknownProperties {}\nexport type DropdownMenuItemHintProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemTitleProps\n extends DropdownMenuItemTitleProps,\n UnknownProperties {}\nexport type DropdownMenuItemTitleProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuContext extends DropdownMenuContext, UnknownProperties {}\nexport type DropdownMenuContext = DropdownContext & {\n highlightedIndex?: number;\n getListProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getItemHintProps: PropGetterFn;\n getItemTitleProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuHandlers extends DropdownMenuHandlers, UnknownProperties {}\nexport type DropdownMenuHandlers = DropdownHandlers & {\n highlightedIndex: (index: number) => void;\n};\n\nexport type DropdownMenuTriggerProps = DropdownTriggerProps;\n\ndeclare const DropdownMenu: Intergalactic.Component<\n 'div',\n DropdownMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: Intergalactic.Component<'div', DropdownMenuProps & DropdownPopperAriaProps>;\n List: Intergalactic.Component<\n 'div',\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Actions: Intergalactic.Component<\n typeof Flex,\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Menu: Intergalactic.Component<\n 'div',\n DropdownMenuMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Item: Intergalactic.Component<\n typeof Dropdown.Item,\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n Addon: typeof Box;\n Content: typeof Flex;\n Text: typeof Text;\n Hint: typeof Flex;\n };\n /**\n * @deprecated Use Group with title prop\n */\n ItemTitle: Intergalactic.Component<'div', DropdownMenuItemTitleProps>;\n /**\n * @deprecated Use prop subTitle on Group or Item component\n */\n ItemHint: Intergalactic.Component<'div', DropdownMenuItemHintProps>;\n Group: typeof Dropdown.Group;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Nesting: Intergalactic.Component<\n 'div',\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n /**\n * @deprecated Use Item instead of Nesting\n */\n Trigger: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Item: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Addon: typeof Box;\n };\n\n selectedIndexContext: React.Context<number>;\n};\n\nexport default DropdownMenu;\n"],"mappings":""}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import Dropdown, {
|
|
|
4
4
|
DropdownProps,
|
|
5
5
|
DropdownHandlers,
|
|
6
6
|
DropdownTriggerProps,
|
|
7
|
+
DropdownPopperAriaProps,
|
|
7
8
|
} from '@semcore/dropdown';
|
|
8
9
|
import { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';
|
|
9
10
|
import { ScrollAreaProps } from '@semcore/scroll-area';
|
|
@@ -129,7 +130,7 @@ declare const DropdownMenu: Intergalactic.Component<
|
|
|
129
130
|
[handlers: DropdownMenuHandlers]
|
|
130
131
|
> & {
|
|
131
132
|
Trigger: typeof Dropdown.Trigger;
|
|
132
|
-
Popper: Intergalactic.Component<'div', DropdownMenuProps>;
|
|
133
|
+
Popper: Intergalactic.Component<'div', DropdownMenuProps & DropdownPopperAriaProps>;
|
|
133
134
|
List: Intergalactic.Component<
|
|
134
135
|
'div',
|
|
135
136
|
DropdownMenuListProps,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/dropdown-menu",
|
|
3
3
|
"description": "Semrush DropdownMenu Component",
|
|
4
|
-
"version": "4.43.0",
|
|
4
|
+
"version": "4.43.2-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@semcore/dropdown": "4.41.0",
|
|
13
|
-
"@semcore/flex-box": "5.38.0",
|
|
14
|
-
"@semcore/scroll-area": "5.42.0",
|
|
15
|
-
"@semcore/utils": "4.43.0",
|
|
16
|
-
"@semcore/icon": "4.52.0",
|
|
17
|
-
"@semcore/typography": "5.47.0",
|
|
12
|
+
"@semcore/dropdown": "4.41.2-prerelease.0",
|
|
13
|
+
"@semcore/flex-box": "5.38.1-prerelease.0",
|
|
14
|
+
"@semcore/scroll-area": "5.42.1-prerelease.0",
|
|
15
|
+
"@semcore/utils": "4.43.2-prerelease.0",
|
|
16
|
+
"@semcore/icon": "4.52.1-prerelease.0",
|
|
17
|
+
"@semcore/typography": "5.47.1-prerelease.0",
|
|
18
18
|
"classnames": "2.2.6"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@semcore/core": "^2.
|
|
21
|
+
"@semcore/core": "^2.36.1-prerelease.0",
|
|
22
22
|
"react": "16.8 - 18",
|
|
23
23
|
"react-dom": "16.8 - 18"
|
|
24
24
|
},
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@types/classnames": "2.2.6",
|
|
33
33
|
"@semcore/testing-utils": "1.0.0",
|
|
34
34
|
"@semcore/base-trigger": "4.26.1",
|
|
35
|
-
"@semcore/icon": "4.
|
|
36
|
-
"@semcore/button": "5.39.
|
|
35
|
+
"@semcore/icon": "4.52.1-prerelease.0",
|
|
36
|
+
"@semcore/button": "5.39.2-prerelease.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "pnpm semcore-builder --source=js"
|