@sentry/scraps 0.4.0 → 0.5.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/README.md +6 -5
- package/dist/alert/alert.js +0 -3
- package/dist/badge/badge.js +1 -2
- package/dist/badge/tag.js +0 -2
- package/dist/button/index.d.ts +0 -1
- package/dist/button/index.js +0 -1
- package/dist/clipboard/copyToClipboardButton.d.ts +15 -0
- package/dist/clipboard/copyToClipboardButton.js +32 -0
- package/dist/clipboard/index.d.ts +1 -0
- package/dist/clipboard/index.js +1 -0
- package/dist/code/index.d.ts +1 -0
- package/dist/code/index.js +1 -0
- package/dist/codeBlock/codeBlock.d.ts +68 -0
- package/dist/codeBlock/codeBlock.js +242 -0
- package/dist/codeBlock/index.d.ts +2 -0
- package/dist/codeBlock/index.js +2 -0
- package/dist/codeBlock/prism.d.ts +11 -0
- package/dist/codeBlock/prism.js +101 -0
- package/dist/codeBlock/styles.d.ts +2 -0
- package/dist/codeBlock/styles.js +133 -0
- package/dist/compactSelect/compactSelect.d.ts +21 -0
- package/dist/compactSelect/compactSelect.js +150 -0
- package/dist/compactSelect/composite.d.ts +54 -0
- package/dist/compactSelect/composite.js +101 -0
- package/dist/compactSelect/control.d.ts +112 -0
- package/dist/compactSelect/control.js +354 -0
- package/dist/compactSelect/fzf.d.ts +8 -0
- package/dist/compactSelect/fzf.js +151 -0
- package/dist/compactSelect/gridList/index.d.ts +46 -0
- package/dist/compactSelect/gridList/index.js +102 -0
- package/dist/compactSelect/gridList/option.d.ts +15 -0
- package/dist/compactSelect/gridList/option.js +111 -0
- package/dist/compactSelect/gridList/section.d.ts +15 -0
- package/dist/compactSelect/gridList/section.js +58 -0
- package/dist/compactSelect/highlightText.d.ts +6 -0
- package/dist/compactSelect/highlightText.js +33 -0
- package/dist/compactSelect/index.d.ts +9 -0
- package/dist/compactSelect/index.js +8 -0
- package/dist/compactSelect/list.d.ts +94 -0
- package/dist/compactSelect/list.js +167 -0
- package/dist/compactSelect/listBox/index.d.ts +84 -0
- package/dist/compactSelect/listBox/index.js +175 -0
- package/dist/compactSelect/listBox/option.d.ts +19 -0
- package/dist/compactSelect/listBox/option.js +101 -0
- package/dist/compactSelect/listBox/section.d.ts +21 -0
- package/dist/compactSelect/listBox/section.js +58 -0
- package/dist/compactSelect/menuComponents.d.ts +89 -0
- package/dist/compactSelect/menuComponents.js +117 -0
- package/dist/compactSelect/selectFilterContext.d.ts +2 -0
- package/dist/compactSelect/selectFilterContext.js +3 -0
- package/dist/compactSelect/styles.d.ts +39 -0
- package/dist/compactSelect/styles.js +155 -0
- package/dist/compactSelect/types.d.ts +1 -0
- package/dist/compactSelect/types.js +0 -0
- package/dist/compactSelect/useVirtualizedItems.d.ts +52 -0
- package/dist/compactSelect/useVirtualizedItems.js +74 -0
- package/dist/compactSelect/utils.d.ts +80 -0
- package/dist/compactSelect/utils.js +268 -0
- package/dist/confirm/index.d.ts +153 -0
- package/dist/confirm/index.js +132 -0
- package/dist/descriptionList/descriptionList.js +4 -3
- package/dist/disclosure/disclosure.js +2 -2
- package/dist/dragHandle/dragHandle.d.ts +3 -1
- package/dist/dragHandle/dragHandle.js +8 -5
- package/dist/drawer/components.d.ts +46 -0
- package/dist/drawer/components.js +265 -0
- package/dist/drawer/globalDrawer.d.ts +106 -0
- package/dist/drawer/globalDrawer.js +173 -0
- package/dist/drawer/index.d.ts +3 -0
- package/dist/drawer/index.js +2 -0
- package/dist/drawer/useDrawerResizing.d.ts +19 -0
- package/dist/drawer/useDrawerResizing.js +111 -0
- package/dist/drawer/useDrawerWidth.d.ts +1 -0
- package/dist/drawer/useDrawerWidth.js +42 -0
- package/dist/dropdownMenu/content.d.ts +1 -0
- package/dist/dropdownMenu/content.js +1 -0
- package/dist/dropdownMenu/context.d.ts +24 -0
- package/dist/dropdownMenu/context.js +3 -0
- package/dist/dropdownMenu/dropdownMenu.d.ts +70 -0
- package/dist/dropdownMenu/dropdownMenu.js +103 -0
- package/dist/dropdownMenu/index.d.ts +2 -0
- package/dist/dropdownMenu/index.js +1 -0
- package/dist/dropdownMenu/item.d.ts +136 -0
- package/dist/dropdownMenu/item.js +182 -0
- package/dist/dropdownMenu/list.d.ts +59 -0
- package/dist/dropdownMenu/list.js +410 -0
- package/dist/dropdownMenu/search.d.ts +16 -0
- package/dist/dropdownMenu/search.js +16 -0
- package/dist/dropdownMenu/section.d.ts +21 -0
- package/dist/dropdownMenu/section.js +40 -0
- package/dist/dropdownMenu/separator.d.ts +7 -0
- package/dist/dropdownMenu/separator.js +15 -0
- package/dist/dropdownMenu/useDropdownMenuKeyboard.d.ts +260 -0
- package/dist/dropdownMenu/useDropdownMenuKeyboard.js +55 -0
- package/dist/dropdownMenu/useDropdownMenuRowLayout.d.ts +29 -0
- package/dist/dropdownMenu/useDropdownMenuRowLayout.js +64 -0
- package/dist/dropdownMenu/useSafetyTriangle.d.ts +12 -0
- package/dist/dropdownMenu/useSafetyTriangle.js +119 -0
- package/dist/dropdownMenu/utils.d.ts +21 -0
- package/dist/dropdownMenu/utils.js +57 -0
- package/dist/form/FormSearch.d.ts +19 -0
- package/dist/form/FormSearch.js +4 -0
- package/dist/form/autoSaveForm.d.ts +110 -0
- package/dist/form/autoSaveForm.js +100 -0
- package/dist/{formPresentation → form}/displayField.js +2 -2
- package/dist/form/field/baseField.d.ts +23 -0
- package/dist/form/field/baseField.js +116 -0
- package/dist/form/field/checkboxField.d.ts +11 -0
- package/dist/form/field/checkboxField.js +42 -0
- package/dist/form/field/checkboxGroupField.d.ts +16 -0
- package/dist/form/field/checkboxGroupField.js +80 -0
- package/dist/form/field/compactSelectField.d.ts +19 -0
- package/dist/form/field/compactSelectField.js +77 -0
- package/dist/{formPresentation → form/field}/fieldIds.js +1 -1
- package/dist/form/field/inputField.d.ts +19 -0
- package/dist/form/field/inputField.js +31 -0
- package/dist/{formPresentation → form/field}/meta.js +6 -6
- package/dist/form/field/numberField.d.ts +5 -0
- package/dist/form/field/numberField.js +11 -0
- package/dist/form/field/passwordField.d.ts +3 -0
- package/dist/form/field/passwordField.js +27 -0
- package/dist/form/field/radioGroupField.d.ts +16 -0
- package/dist/form/field/radioGroupField.js +92 -0
- package/dist/form/field/rangeField.d.ts +8 -0
- package/dist/form/field/rangeField.js +34 -0
- package/dist/form/field/selectAsyncField.d.ts +31 -0
- package/dist/form/field/selectAsyncField.js +22 -0
- package/dist/form/field/selectField.d.ts +9 -0
- package/dist/form/field/selectField.js +72 -0
- package/dist/form/field/switchField.d.ts +7 -0
- package/dist/form/field/switchField.js +37 -0
- package/dist/form/field/textAreaField.d.ts +7 -0
- package/dist/form/field/textAreaField.js +25 -0
- package/dist/{formPresentation → form}/formContext.js +1 -1
- package/dist/form/formErrorContext/index.d.ts +9 -0
- package/dist/form/formErrorContext/index.js +7 -0
- package/dist/form/index.d.ts +9 -0
- package/dist/form/index.js +8 -0
- package/dist/{formPresentation → form/layout}/base.d.ts +1 -1
- package/dist/{formPresentation → form/layout}/base.js +1 -1
- package/dist/form/layout/fieldGroup.d.ts +6 -0
- package/dist/form/layout/fieldGroup.js +60 -0
- package/dist/{formPresentation/fieldLayout.d.ts → form/layout/index.d.ts} +1 -1
- package/dist/{formPresentation/fieldLayout.js → form/layout/index.js} +3 -3
- package/dist/{formPresentation → form/layout}/useStackedLayout.js +1 -1
- package/dist/form/scrapsForm.d.ts +220 -0
- package/dist/form/scrapsForm.js +126 -0
- package/dist/hotkey/hotkey.d.ts +9 -8
- package/dist/hotkey/hotkey.js +13 -6
- package/dist/hotkey/index.d.ts +2 -1
- package/dist/hotkey/index.js +2 -1
- package/dist/hotkey/keyMappings.d.ts +1 -15
- package/dist/hotkey/keyMappings.js +29 -174
- package/dist/hotkey/useHotkeys.d.ts +3 -47
- package/dist/hotkey/useHotkeys.js +8 -42
- package/dist/image/image.js +2 -1
- package/dist/info/infoTip.d.ts +1 -1
- package/dist/info/infoTip.js +4 -3
- package/dist/input/index.d.ts +0 -3
- package/dist/input/index.js +0 -2
- package/dist/input/input.d.ts +2 -0
- package/dist/input/input.js +2 -0
- package/dist/input/passwordManagerIgnoreProps.d.ts +11 -0
- package/dist/input/passwordManagerIgnoreProps.js +8 -0
- package/dist/layout/index.d.ts +2 -2
- package/dist/layout/index.js +1 -1
- package/dist/link/link.js +4 -3
- package/dist/link/linkBehaviorContext.d.ts +2 -0
- package/dist/link/linkBehaviorContext.js +17 -10
- package/dist/menu/index.d.ts +1 -1
- package/dist/menu/index.js +1 -1
- package/dist/menu/menu.d.ts +14 -6
- package/dist/menu/menu.js +160 -56
- package/dist/modal/components.d.ts +19 -0
- package/dist/modal/components.js +99 -0
- package/dist/modal/errorBoundary.d.ts +2 -0
- package/dist/modal/errorBoundary.js +35 -0
- package/dist/modal/index.d.ts +33 -0
- package/dist/modal/index.js +260 -0
- package/dist/modal/portal.d.ts +1 -0
- package/dist/modal/portal.js +10 -0
- package/dist/modal/state.d.ts +17 -0
- package/dist/modal/state.js +41 -0
- package/dist/modal/types.d.ts +75 -0
- package/dist/modal/types.js +0 -0
- package/dist/numberInput/index.d.ts +3 -0
- package/dist/numberInput/index.js +2 -0
- package/dist/{input → numberInput}/numberDragInput.d.ts +1 -1
- package/dist/{input → numberInput}/numberDragInput.js +1 -1
- package/dist/{input → numberInput}/numberInput.d.ts +1 -1
- package/dist/{input → numberInput}/numberInput.js +1 -1
- package/dist/overlayContext.d.ts +29 -0
- package/dist/overlayContext.js +7 -0
- package/dist/pagination/index.d.ts +1 -0
- package/dist/pagination/index.js +1 -0
- package/dist/pagination/pagination.d.ts +24 -0
- package/dist/pagination/pagination.js +63 -0
- package/dist/pictureInPicture/index.d.ts +2 -0
- package/dist/pictureInPicture/index.js +2 -0
- package/dist/pictureInPicture/pictureInPicture.d.ts +47 -0
- package/dist/pictureInPicture/pictureInPicture.js +100 -0
- package/dist/pictureInPicture/pictureInPicturePortal.d.ts +16 -0
- package/dist/pictureInPicture/pictureInPicturePortal.js +46 -0
- package/dist/pictureInPicture/portalContext.d.ts +2 -0
- package/dist/pictureInPicture/portalContext.js +3 -0
- package/dist/revealOnHover/revealOnHover.js +1 -1
- package/dist/segmentedControl/segmentedControl.js +1 -1
- package/dist/select/filter.d.ts +4 -0
- package/dist/select/filter.js +12 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/index.js +2 -0
- package/dist/select/option.d.ts +16 -0
- package/dist/select/option.js +81 -0
- package/dist/select/reactSelectWrapper.d.ts +8 -0
- package/dist/select/reactSelectWrapper.js +25 -0
- package/dist/select/select.d.ts +79 -0
- package/dist/select/select.js +454 -0
- package/dist/select/styles.d.ts +9 -0
- package/dist/select/styles.js +27 -0
- package/dist/select/types.d.ts +60 -0
- package/dist/select/types.js +0 -0
- package/dist/select/virtualizedMenuList.d.ts +24 -0
- package/dist/select/virtualizedMenuList.js +123 -0
- package/dist/slideOverPanel.d.ts +20 -0
- package/dist/slideOverPanel.js +141 -0
- package/dist/splitPanel/splitPanel.d.ts +3 -1
- package/dist/splitPanel/splitPanel.js +2 -1
- package/dist/table/table.d.ts +1 -1
- package/dist/table/table.js +39 -20
- package/dist/table/useColumnResize.d.ts +6 -5
- package/dist/table/useColumnResize.js +5 -4
- package/dist/tabs/index.d.ts +4 -0
- package/dist/tabs/index.js +3 -0
- package/dist/tabs/item.d.ts +13 -0
- package/dist/tabs/item.js +4 -0
- package/dist/tabs/tab.d.ts +22 -0
- package/dist/tabs/tab.js +205 -0
- package/dist/tabs/tabList.d.ts +18 -0
- package/dist/tabs/tabList.js +256 -0
- package/dist/tabs/tabPanels.d.ts +14 -0
- package/dist/tabs/tabPanels.js +62 -0
- package/dist/tabs/tabs.d.ts +38 -0
- package/dist/tabs/tabs.js +56 -0
- package/dist/tabs/utils.d.ts +3 -0
- package/dist/tabs/utils.js +6 -0
- package/dist/text/heading.d.ts +1 -1
- package/dist/text/heading.js +1 -1
- package/dist/text/styles.js +1 -1
- package/dist/text/text.d.ts +1 -1
- package/dist/text/text.js +1 -1
- package/dist/theme/dark.js +9 -9
- package/dist/theme/light.js +9 -9
- package/dist/tooltip/tooltip.js +2 -5
- package/dist/useMedia.d.ts +15 -0
- package/dist/useMedia.js +24 -0
- package/dist/useOnClickOutside.d.ts +2 -0
- package/dist/useOnClickOutside.js +22 -0
- package/dist/useOverlay.d.ts +1 -0
- package/dist/useOverlay.js +1 -0
- package/dist/useVirtualCollection.d.ts +154 -0
- package/dist/useVirtualCollection.js +143 -0
- package/dist/useVirtualRows.d.ts +26 -0
- package/dist/useVirtualRows.js +26 -0
- package/dist/virtualCollectionLayout.d.ts +51 -0
- package/dist/virtualCollectionLayout.js +49 -0
- package/package.json +115 -16
- package/dist/formPresentation/index.d.ts +0 -8
- package/dist/formPresentation/index.js +0 -8
- package/dist/interactionStateLayer/index.d.ts +0 -1
- package/dist/interactionStateLayer/index.js +0 -1
- package/dist/interactionStateLayer/interactionStateLayer.d.ts +0 -23
- package/dist/interactionStateLayer/interactionStateLayer.js +0 -67
- package/dist/unreachable.d.ts +0 -1
- package/dist/unreachable.js +0 -4
- /package/dist/{formPresentation → form}/autoSaveContext.d.ts +0 -0
- /package/dist/{formPresentation → form}/autoSaveContext.js +0 -0
- /package/dist/{formPresentation → form}/displayField.d.ts +0 -0
- /package/dist/{formPresentation → form/field}/fieldIds.d.ts +0 -0
- /package/dist/{formPresentation → form/field}/groupContext.d.ts +0 -0
- /package/dist/{formPresentation → form/field}/groupContext.js +0 -0
- /package/dist/{formPresentation → form/field}/meta.d.ts +0 -0
- /package/dist/{formPresentation → form}/formContext.d.ts +0 -0
- /package/dist/{formPresentation → form}/icons.d.ts +0 -0
- /package/dist/{formPresentation → form}/icons.js +0 -0
- /package/dist/{formPresentation → form/layout}/useStackedLayout.d.ts +0 -0
|
@@ -1,223 +1,78 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { isMac } from "@react-aria/utils";
|
|
3
2
|
import { IconArrow } from "@sentry/icons/arrow";
|
|
4
3
|
import { IconCommand } from "@sentry/icons/command";
|
|
5
4
|
import { IconControl } from "@sentry/icons/control";
|
|
6
5
|
import { IconOption } from "@sentry/icons/option";
|
|
7
6
|
import { IconReturn } from "@sentry/icons/return";
|
|
8
7
|
import { IconShift } from "@sentry/icons/shift";
|
|
9
|
-
import * as __rspack_external__sentry_react_f0cda475 from "@sentry/react";
|
|
10
|
-
const aliases = {
|
|
11
|
-
cmd: 'command',
|
|
12
|
-
meta: 'command',
|
|
13
|
-
'\u2318': 'command',
|
|
14
|
-
ctrl: 'control',
|
|
15
|
-
'\u2303': 'control',
|
|
16
|
-
option: 'alt',
|
|
17
|
-
'\u2325': 'alt',
|
|
18
|
-
'\u21E7': 'shift',
|
|
19
|
-
return: 'enter',
|
|
20
|
-
esc: 'escape',
|
|
21
|
-
del: 'delete',
|
|
22
|
-
ins: 'insert',
|
|
23
|
-
'\u21EA': 'capslock'
|
|
24
|
-
};
|
|
25
|
-
function canonicalize(keyName) {
|
|
26
|
-
const lower = keyName.toLowerCase();
|
|
27
|
-
if ('mod' === lower) return isMac() ? 'command' : 'control';
|
|
28
|
-
return aliases[lower] ?? lower;
|
|
29
|
-
}
|
|
30
|
-
const namedKeyMap = {
|
|
31
|
-
backspace: 'Backspace',
|
|
32
|
-
tab: 'Tab',
|
|
33
|
-
clear: 'Clear',
|
|
34
|
-
enter: 'Enter',
|
|
35
|
-
escape: 'Escape',
|
|
36
|
-
space: ' ',
|
|
37
|
-
left: 'ArrowLeft',
|
|
38
|
-
up: 'ArrowUp',
|
|
39
|
-
right: 'ArrowRight',
|
|
40
|
-
down: 'ArrowDown',
|
|
41
|
-
delete: 'Delete',
|
|
42
|
-
insert: 'Insert',
|
|
43
|
-
home: 'Home',
|
|
44
|
-
end: 'End',
|
|
45
|
-
pageup: 'PageUp',
|
|
46
|
-
pagedown: 'PageDown',
|
|
47
|
-
capslock: 'CapsLock'
|
|
48
|
-
};
|
|
49
|
-
const punctuationCodeMap = {
|
|
50
|
-
',': 'Comma',
|
|
51
|
-
'.': 'Period',
|
|
52
|
-
'/': 'Slash',
|
|
53
|
-
'`': 'Backquote',
|
|
54
|
-
'-': 'Minus',
|
|
55
|
-
'=': 'Equal',
|
|
56
|
-
';': 'Semicolon',
|
|
57
|
-
"'": 'Quote',
|
|
58
|
-
'[': 'BracketLeft',
|
|
59
|
-
']': 'BracketRight',
|
|
60
|
-
'\\': 'Backslash'
|
|
61
|
-
};
|
|
62
|
-
const modifierPredicates = {
|
|
63
|
-
command: (e)=>e.metaKey,
|
|
64
|
-
shift: (e)=>e.shiftKey,
|
|
65
|
-
control: (e)=>e.ctrlKey,
|
|
66
|
-
alt: (e)=>e.altKey
|
|
67
|
-
};
|
|
68
|
-
const MODIFIER_KEYS = [
|
|
69
|
-
'command',
|
|
70
|
-
'shift',
|
|
71
|
-
'control',
|
|
72
|
-
'alt'
|
|
73
|
-
];
|
|
74
|
-
function codeForChar(ch) {
|
|
75
|
-
if (ch >= 'a' && ch <= 'z') return `Key${ch.toUpperCase()}`;
|
|
76
|
-
if (ch >= '0' && ch <= '9') return `Digit${ch}`;
|
|
77
|
-
return punctuationCodeMap[ch];
|
|
78
|
-
}
|
|
79
|
-
function matchesKey(name, event) {
|
|
80
|
-
const key = canonicalize(name);
|
|
81
|
-
const modifier = modifierPredicates[key];
|
|
82
|
-
if (modifier) return modifier(event);
|
|
83
|
-
const namedKey = namedKeyMap[key];
|
|
84
|
-
if (namedKey) return event.key === namedKey;
|
|
85
|
-
if (1 === key.length) {
|
|
86
|
-
if (event.key?.toLowerCase() === key) return true;
|
|
87
|
-
const code = codeForChar(key);
|
|
88
|
-
if (code && event.code === code) {
|
|
89
|
-
const eventKey = event.key;
|
|
90
|
-
if (eventKey?.length !== 1 || eventKey.charCodeAt(0) > 0x7f) return true;
|
|
91
|
-
if (event.shiftKey) return true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
8
|
const sharedProps = {
|
|
97
9
|
size: 'xs'
|
|
98
10
|
};
|
|
99
|
-
const
|
|
100
|
-
|
|
11
|
+
const shiftGlyph = {
|
|
12
|
+
icon: /*#__PURE__*/ jsx(IconShift, {
|
|
13
|
+
...sharedProps
|
|
14
|
+
}),
|
|
15
|
+
label: '⇧'
|
|
16
|
+
};
|
|
17
|
+
const glyphs = {
|
|
18
|
+
'⌘': {
|
|
101
19
|
icon: /*#__PURE__*/ jsx(IconCommand, {
|
|
102
20
|
...sharedProps
|
|
103
21
|
}),
|
|
104
|
-
label: '
|
|
22
|
+
label: '⌘'
|
|
105
23
|
},
|
|
106
|
-
|
|
24
|
+
'⌃': {
|
|
107
25
|
icon: /*#__PURE__*/ jsx(IconControl, {
|
|
108
26
|
...sharedProps
|
|
109
27
|
}),
|
|
110
|
-
label: '
|
|
28
|
+
label: '⌃'
|
|
111
29
|
},
|
|
112
|
-
|
|
30
|
+
'⌥': {
|
|
113
31
|
icon: /*#__PURE__*/ jsx(IconOption, {
|
|
114
32
|
...sharedProps
|
|
115
33
|
}),
|
|
116
|
-
label: '
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const otherGlyphs = {
|
|
120
|
-
command: {
|
|
121
|
-
label: 'Ctrl'
|
|
122
|
-
},
|
|
123
|
-
control: {
|
|
124
|
-
label: 'Ctrl'
|
|
125
|
-
},
|
|
126
|
-
alt: {
|
|
127
|
-
label: 'Alt'
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
const universalGlyphs = {
|
|
131
|
-
shift: {
|
|
132
|
-
icon: /*#__PURE__*/ jsx(IconShift, {
|
|
133
|
-
...sharedProps
|
|
134
|
-
}),
|
|
135
|
-
label: '\u21E7'
|
|
34
|
+
label: '⌥'
|
|
136
35
|
},
|
|
137
|
-
|
|
36
|
+
'⇧': shiftGlyph,
|
|
37
|
+
Shift: shiftGlyph,
|
|
38
|
+
'↵': {
|
|
138
39
|
icon: /*#__PURE__*/ jsx(IconReturn, {
|
|
139
40
|
...sharedProps
|
|
140
41
|
}),
|
|
141
|
-
label: '
|
|
42
|
+
label: '↵'
|
|
142
43
|
},
|
|
143
|
-
|
|
44
|
+
'←': {
|
|
144
45
|
icon: /*#__PURE__*/ jsx(IconArrow, {
|
|
145
46
|
...sharedProps,
|
|
146
47
|
direction: "left"
|
|
147
48
|
}),
|
|
148
|
-
label: '
|
|
49
|
+
label: '←'
|
|
149
50
|
},
|
|
150
|
-
|
|
51
|
+
'→': {
|
|
151
52
|
icon: /*#__PURE__*/ jsx(IconArrow, {
|
|
152
53
|
...sharedProps,
|
|
153
54
|
direction: "right"
|
|
154
55
|
}),
|
|
155
|
-
label: '
|
|
56
|
+
label: '→'
|
|
156
57
|
},
|
|
157
|
-
|
|
58
|
+
'↑': {
|
|
158
59
|
icon: /*#__PURE__*/ jsx(IconArrow, {
|
|
159
60
|
...sharedProps,
|
|
160
61
|
direction: "up"
|
|
161
62
|
}),
|
|
162
|
-
label: '
|
|
63
|
+
label: '↑'
|
|
163
64
|
},
|
|
164
|
-
|
|
65
|
+
'↓': {
|
|
165
66
|
icon: /*#__PURE__*/ jsx(IconArrow, {
|
|
166
67
|
...sharedProps,
|
|
167
68
|
direction: "down"
|
|
168
69
|
}),
|
|
169
|
-
label: '
|
|
170
|
-
},
|
|
171
|
-
backspace: {
|
|
172
|
-
label: '\u232B'
|
|
173
|
-
},
|
|
174
|
-
delete: {
|
|
175
|
-
label: 'Del'
|
|
176
|
-
},
|
|
177
|
-
tab: {
|
|
178
|
-
label: 'Tab'
|
|
179
|
-
},
|
|
180
|
-
escape: {
|
|
181
|
-
label: 'Esc'
|
|
182
|
-
},
|
|
183
|
-
space: {
|
|
184
|
-
label: 'Space'
|
|
185
|
-
},
|
|
186
|
-
home: {
|
|
187
|
-
label: 'Home'
|
|
188
|
-
},
|
|
189
|
-
end: {
|
|
190
|
-
label: 'End'
|
|
191
|
-
},
|
|
192
|
-
pageup: {
|
|
193
|
-
label: 'PageUp'
|
|
194
|
-
},
|
|
195
|
-
pagedown: {
|
|
196
|
-
label: 'PageDown'
|
|
197
|
-
},
|
|
198
|
-
insert: {
|
|
199
|
-
label: 'Insert'
|
|
200
|
-
},
|
|
201
|
-
clear: {
|
|
202
|
-
label: 'Clear'
|
|
203
|
-
},
|
|
204
|
-
capslock: {
|
|
205
|
-
label: 'CapsLock'
|
|
70
|
+
label: '↓'
|
|
206
71
|
}
|
|
207
72
|
};
|
|
208
|
-
function resolveKeyGlyph(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const glyph = platformGlyphs[key] ?? universalGlyphs[key];
|
|
212
|
-
if (glyph) return glyph;
|
|
213
|
-
if (key.length > 1) {
|
|
214
|
-
if ('production' !== process.env.NODE_ENV) throw new Error(`Missing key glyph mapping for "${keyName}"`);
|
|
215
|
-
__rspack_external__sentry_react_f0cda475.logger.warn('Missing key glyph mapping', {
|
|
216
|
-
keyName
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
return {
|
|
220
|
-
label: keyName.replace(/\w\S*/g, (word)=>word.charAt(0).toUpperCase() + word.substring(1))
|
|
73
|
+
function resolveKeyGlyph(label) {
|
|
74
|
+
return glyphs[label] ?? {
|
|
75
|
+
label
|
|
221
76
|
};
|
|
222
77
|
}
|
|
223
|
-
export {
|
|
78
|
+
export { resolveKeyGlyph };
|
|
@@ -1,47 +1,3 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
callback: (e: KeyboardEvent) => void;
|
|
6
|
-
/**
|
|
7
|
-
* Defines the matching shortcuts.
|
|
8
|
-
*
|
|
9
|
-
* Multiple shortcuts may be passed as a list.
|
|
10
|
-
*
|
|
11
|
-
* The format for shorcuts is `<modifiers>+<key>` For example `shift+t` or
|
|
12
|
-
* `command+shift+t`.
|
|
13
|
-
*/
|
|
14
|
-
match: string[] | string;
|
|
15
|
-
/**
|
|
16
|
-
* When `false`, the hotkey is skipped: the callback never fires and
|
|
17
|
-
* `preventDefault` is never called. Useful for gating a hotkey on state
|
|
18
|
-
* (e.g. only intercept `Escape` while a panel is open) without rebuilding
|
|
19
|
-
* the hotkey array. Defaults to `true`.
|
|
20
|
-
*/
|
|
21
|
-
enabled?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Allow shortcuts to be triggered while a text input is foccused
|
|
24
|
-
*/
|
|
25
|
-
includeInputs?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Do not call preventDefault on the keydown event
|
|
28
|
-
*/
|
|
29
|
-
skipPreventDefault?: boolean;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Returns whether an event should trigger one of the supplied hotkey matches.
|
|
33
|
-
* Uses the same platform-aware modifier and keyboard-layout behavior as
|
|
34
|
-
* useHotkeys, and never matches while an IME is composing text.
|
|
35
|
-
*/
|
|
36
|
-
export declare function matchesHotkey(match: string[] | string, event: KeyboardEvent): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Pass in the hotkey combinations under match and the corresponding callback
|
|
39
|
-
* function to be called. Separate key names with +. For example,
|
|
40
|
-
* 'command+alt+shift+x'
|
|
41
|
-
*
|
|
42
|
-
* Alternate matchings as an array: ['command+alt+backspace', 'ctrl+alt+delete']
|
|
43
|
-
*
|
|
44
|
-
* Note: you can only use one non-modifier (keys other than shift, ctrl, alt, command) key at a time.
|
|
45
|
-
*/
|
|
46
|
-
export declare function useHotkeys(hotkeys: Hotkey[]): void;
|
|
47
|
-
export {};
|
|
1
|
+
import { type UseHotkeyCommonOptions, type UseHotkeyDefinition } from '@tanstack/react-hotkeys';
|
|
2
|
+
/** Register native TanStack hotkeys with Sentry's input and propagation defaults. */
|
|
3
|
+
export declare function useHotkeys(hotkeys: readonly UseHotkeyDefinition[], options?: UseHotkeyCommonOptions): void;
|
|
@@ -1,44 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return (Array.isArray(match) ? match : [
|
|
9
|
-
match
|
|
10
|
-
]).some((keyset)=>{
|
|
11
|
-
const keys = keyset.toLowerCase().split('+').map((key)=>canonicalize(key));
|
|
12
|
-
const unusedModifiers = MODIFIER_KEYS.filter((modifier)=>!keys.includes(modifier));
|
|
13
|
-
return keys.every((key)=>matchesKey(key, event)) && unusedModifiers.every((modifier)=>!matchesKey(modifier, event));
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function useHotkeys(hotkeys) {
|
|
17
|
-
const hotkeysRef = useRef(hotkeys);
|
|
18
|
-
useEffect(()=>{
|
|
19
|
-
hotkeysRef.current = hotkeys;
|
|
1
|
+
import { useHotkeys } from "@tanstack/react-hotkeys";
|
|
2
|
+
function useHotkeys_useHotkeys(hotkeys, options) {
|
|
3
|
+
useHotkeys(hotkeys, {
|
|
4
|
+
ignoreInputs: true,
|
|
5
|
+
stopPropagation: false,
|
|
6
|
+
conflictBehavior: 'allow',
|
|
7
|
+
...options
|
|
20
8
|
});
|
|
21
|
-
useEffect(()=>{
|
|
22
|
-
const onKeyDown = (evt)=>{
|
|
23
|
-
if (shouldIgnoreHotkeyEvent(evt)) return;
|
|
24
|
-
for (const hotkey of hotkeysRef.current){
|
|
25
|
-
if (false === hotkey.enabled) continue;
|
|
26
|
-
const preventDefault = !hotkey.skipPreventDefault;
|
|
27
|
-
const inputHasFocus = !hotkey.includeInputs && evt.target instanceof HTMLElement ? evt.target.isContentEditable || [
|
|
28
|
-
'textarea',
|
|
29
|
-
'input'
|
|
30
|
-
].includes(evt.target.tagName.toLowerCase()) : false;
|
|
31
|
-
if (matchesHotkey(hotkey.match, evt) && !inputHasFocus) {
|
|
32
|
-
if (preventDefault) evt.preventDefault();
|
|
33
|
-
hotkey.callback(evt);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
document.addEventListener('keydown', onKeyDown);
|
|
39
|
-
return ()=>{
|
|
40
|
-
document.removeEventListener('keydown', onKeyDown);
|
|
41
|
-
};
|
|
42
|
-
}, []);
|
|
43
9
|
}
|
|
44
|
-
export {
|
|
10
|
+
export { useHotkeys_useHotkeys as useHotkeys };
|
package/dist/image/image.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
|
-
import { getRadius
|
|
3
|
+
import { getRadius } from "../layout/index.js";
|
|
4
|
+
import { rc } from "../layout/styles.js";
|
|
4
5
|
function Image({ loading, width, height, ...props }) {
|
|
5
6
|
return /*#__PURE__*/ jsx(Img, {
|
|
6
7
|
loading: loading ?? 'lazy',
|
package/dist/info/infoTip.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ interface InfoTooltipProps extends SVGIconProps {
|
|
|
5
5
|
title: React.ReactNode;
|
|
6
6
|
position?: TooltipProps['position'];
|
|
7
7
|
}
|
|
8
|
-
export declare function InfoTip(props: InfoTooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function InfoTip({ variant, ...props }: InfoTooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare function DisabledTip(props: InfoTooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
package/dist/info/infoTip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
|
+
import { IconInfo } from "@sentry/icons/info";
|
|
3
4
|
import { IconLock } from "@sentry/icons/lock";
|
|
4
|
-
import { IconQuestion } from "@sentry/icons/question";
|
|
5
5
|
import { Tooltip } from "../tooltip/index.js";
|
|
6
6
|
import { useTranslation } from "../translation/useTranslation.js";
|
|
7
7
|
function IconWithTooltip({ title, position, icon: Icon, 'aria-label': ariaLabel, ...props }) {
|
|
@@ -29,11 +29,12 @@ const StyledIconWrapper = styled('span')`
|
|
|
29
29
|
${(p)=>p.theme.focusRing()}
|
|
30
30
|
}
|
|
31
31
|
`;
|
|
32
|
-
function InfoTip(props) {
|
|
32
|
+
function InfoTip({ variant = 'primary', ...props }) {
|
|
33
33
|
const { t } = useTranslation();
|
|
34
34
|
return /*#__PURE__*/ jsx(IconWithTooltip, {
|
|
35
35
|
...props,
|
|
36
|
-
|
|
36
|
+
variant: variant,
|
|
37
|
+
icon: IconInfo,
|
|
37
38
|
"aria-label": t('More information')
|
|
38
39
|
});
|
|
39
40
|
}
|
package/dist/input/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export { Input, type InputProps, type InputStylesProps } from './input.js';
|
|
2
2
|
export { InputGroup } from './inputGroup.js';
|
|
3
3
|
/** @public */
|
|
4
|
-
export { NumberDragInput } from './numberDragInput.js';
|
|
5
|
-
export { NumberInput } from './numberInput.js';
|
|
6
|
-
/** @public */
|
|
7
4
|
export { OTPInput, type OTPInputProps } from './otpInput.js';
|
|
8
5
|
export { useAutosizeInput } from './useAutosizeInput.js';
|
package/dist/input/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { Input } from "./input.js";
|
|
2
2
|
export { InputGroup } from "./inputGroup.js";
|
|
3
|
-
export { NumberDragInput } from "./numberDragInput.js";
|
|
4
|
-
export { NumberInput } from "./numberInput.js";
|
|
5
3
|
export { OTPInput } from "./otpInput.js";
|
|
6
4
|
export { useAutosizeInput } from "./useAutosizeInput.js";
|
package/dist/input/input.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
13
13
|
*
|
|
14
14
|
* To add leading/trailing items (e.g. a search icon on the left side), use
|
|
15
15
|
* InputControl (components/inputControl) instead.
|
|
16
|
+
*
|
|
17
|
+
* `type="search"` inputs opt out of password manager autofill.
|
|
16
18
|
*/
|
|
17
19
|
export declare const Input: import("@emotion/styled").StyledComponent<InputProps & {
|
|
18
20
|
theme?: import("@emotion/react").Theme;
|
package/dist/input/input.js
CHANGED
|
@@ -2,7 +2,9 @@ import { jsx } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import is_prop_valid from "@emotion/is-prop-valid";
|
|
3
3
|
import styled from "@emotion/styled";
|
|
4
4
|
import { inputStyles } from "./inputStyles.js";
|
|
5
|
+
import { passwordManagerIgnoreProps } from "./passwordManagerIgnoreProps.js";
|
|
5
6
|
const Input = styled(({ ref, size: _size, nativeSize, ...props })=>/*#__PURE__*/ jsx("input", {
|
|
7
|
+
...'search' === props.type ? passwordManagerIgnoreProps : void 0,
|
|
6
8
|
...props,
|
|
7
9
|
ref: ref,
|
|
8
10
|
size: nativeSize
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stops password manager extensions from offering to fill an input. There is
|
|
3
|
+
* no standard attribute, so each manager needs its own.
|
|
4
|
+
*/
|
|
5
|
+
export declare const passwordManagerIgnoreProps: {
|
|
6
|
+
readonly 'data-1p-ignore': true;
|
|
7
|
+
readonly 'data-bwignore': true;
|
|
8
|
+
readonly 'data-form-type': "other";
|
|
9
|
+
readonly 'data-lpignore': "true";
|
|
10
|
+
readonly 'data-protonpass-ignore': "true";
|
|
11
|
+
};
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export { Stack, type StackProps } from './stack.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* @TODO: these should probably be private to scraps
|
|
8
8
|
*/
|
|
9
|
-
export { ContainerQueryContext, ContainerQueryProvider,
|
|
9
|
+
export { ContainerQueryContext, ContainerQueryProvider, type Responsive, type ResponsiveKey,
|
|
10
10
|
/** @public */
|
|
11
|
-
useContainerBreakpoint, useHasContainerQuery,
|
|
11
|
+
useContainerBreakpoint, useHasContainerQuery, useResponsivePropValue, } from './styles.js';
|
|
12
12
|
export { getBorder, getMargin, getRadius, getSpacing } from './styles.js';
|
|
13
13
|
export { FLEX_JUSTIFY_CONTENT, type FlexJustify } from './styles.js';
|
package/dist/layout/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export { Surface } from "./surface.js";
|
|
|
3
3
|
export { Flex } from "./flex.js";
|
|
4
4
|
export { Grid } from "./grid.js";
|
|
5
5
|
export { Stack } from "./stack.js";
|
|
6
|
-
export { ContainerQueryContext, ContainerQueryProvider, FLEX_JUSTIFY_CONTENT, getBorder, getMargin, getRadius, getSpacing,
|
|
6
|
+
export { ContainerQueryContext, ContainerQueryProvider, FLEX_JUSTIFY_CONTENT, getBorder, getMargin, getRadius, getSpacing, useContainerBreakpoint, useHasContainerQuery, useResponsivePropValue } from "./styles.js";
|
package/dist/link/link.js
CHANGED
|
@@ -8,10 +8,11 @@ import { useLinkBehavior } from "./linkBehaviorContext.js";
|
|
|
8
8
|
const getLinkStyles = ({ disabled, theme })=>css`
|
|
9
9
|
border-radius: 2px;
|
|
10
10
|
pointer-events: ${disabled ? 'none' : void 0};
|
|
11
|
-
color: ${disabled ? theme.tokens.content.disabled :
|
|
11
|
+
color: ${disabled ? theme.tokens.content.disabled : theme.tokens.interactive.link.accent.rest};
|
|
12
12
|
|
|
13
|
-
&:hover
|
|
14
|
-
|
|
13
|
+
&:hover,
|
|
14
|
+
&:focus-visible {
|
|
15
|
+
color: ${disabled ? theme.tokens.content.disabled : theme.tokens.interactive.link.accent.hover};
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
&:focus-visible {
|
|
@@ -11,4 +11,6 @@ export declare const useLinkBehavior: <T extends LinkProps>(props: T) => {
|
|
|
11
11
|
Component: typeof AnchorLink | React.FunctionComponent<T>;
|
|
12
12
|
behavior: () => T;
|
|
13
13
|
};
|
|
14
|
+
/** Resolve collection hrefs through the same application behavior as Link. */
|
|
15
|
+
export declare function useResolveLinkHref(): (to: LinkProps["to"]) => string;
|
|
14
16
|
export {};
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext } from "react";
|
|
2
|
+
import { createContext, useCallback, useContext } from "react";
|
|
3
3
|
import * as __rspack_external_query_string_78b5d812 from "query-string";
|
|
4
4
|
const LinkBehaviorContext = /*#__PURE__*/ createContext(null);
|
|
5
5
|
function AnchorLink({ to, replace: _replace, preventScrollReset: _preventScrollReset, reloadDocument: _reloadDocument, state: _state, ...props }) {
|
|
6
|
-
if ('string' == typeof to) return /*#__PURE__*/ jsx("a", {
|
|
7
|
-
...props,
|
|
8
|
-
href: to
|
|
9
|
-
});
|
|
10
|
-
const { pathname = '', hash = '', search = '', query } = to;
|
|
11
|
-
const querySearch = query ? __rspack_external_query_string_78b5d812.stringify(query) : search;
|
|
12
|
-
const href = `${pathname}${querySearch && !querySearch.startsWith('?') ? '?' : ''}${querySearch}${hash && !hash.startsWith('#') ? '#' : ''}${hash}`;
|
|
13
6
|
return /*#__PURE__*/ jsx("a", {
|
|
14
7
|
...props,
|
|
15
|
-
href:
|
|
8
|
+
href: destinationToHref(to)
|
|
16
9
|
});
|
|
17
10
|
}
|
|
18
11
|
const defaultLinkBehavior = ()=>({
|
|
@@ -28,4 +21,18 @@ const useLinkBehavior = (props)=>{
|
|
|
28
21
|
behavior: ()=>behavior(props)
|
|
29
22
|
};
|
|
30
23
|
};
|
|
31
|
-
|
|
24
|
+
function destinationToHref(to) {
|
|
25
|
+
if ('string' == typeof to) return to;
|
|
26
|
+
const { pathname = '', hash = '', search = '', query } = to;
|
|
27
|
+
const querySearch = query ? __rspack_external_query_string_78b5d812.stringify(query) : search;
|
|
28
|
+
return `${pathname}${querySearch && !querySearch.startsWith('?') ? '?' : ''}${querySearch}${hash && !hash.startsWith('#') ? '#' : ''}${hash}`;
|
|
29
|
+
}
|
|
30
|
+
function useResolveLinkHref() {
|
|
31
|
+
const linkBehavior = useContext(LinkBehaviorContext);
|
|
32
|
+
return useCallback((to)=>destinationToHref(linkBehavior ? linkBehavior.behavior({
|
|
33
|
+
to
|
|
34
|
+
}).to : to), [
|
|
35
|
+
linkBehavior
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
export { LinkBehaviorContextProvider, useLinkBehavior, useResolveLinkHref };
|
package/dist/menu/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Shared presentation; consumers own state, keyboard behavior, and ARIA roles. */
|
|
2
|
-
export { calculateMenuMinHeight, MenuFooterLayout as Footer, MenuHeaderLayout as Header, MenuHeading as Title, MenuSectionLabel as SectionLabel, MenuSectionHeader as SectionHeader, MenuSectionGroup as SectionGroup, MenuSectionList as SectionList, MenuListItem as ListItem, ReserveLeadingSlot, MenuSectionSeparator as SectionSeparator, SearchInput as Search, useReserveLeadingSlot, } from './menu.js';
|
|
2
|
+
export { calculateMenuMinHeight, MenuFooterLayout as Footer, MenuHeaderLayout as Header, MenuHeading as Title, MenuSectionLabel as SectionLabel, MenuSectionHeader as SectionHeader, MenuSectionGroup as SectionGroup, MenuSectionList as SectionList, MenuListItem as ListItem, ReserveLeadingSlot, MenuSectionSeparator as SectionSeparator, SECTION_ITEM_SPACE, SearchInput as Search, useReserveLeadingSlot, focusMenuItemDetails, } from './menu.js';
|
|
3
3
|
export type { ListItemProps, MenuItemTrailingAction } from './menu.js';
|
|
4
4
|
export { ControlContext } from './controlContext.js';
|
|
5
5
|
export { DropdownButton, type DropdownButtonProps } from './dropdownButton.js';
|
package/dist/menu/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { MenuFooterLayout as Footer, MenuHeaderLayout as Header, MenuHeading as Title, MenuListItem as ListItem, MenuSectionGroup as SectionGroup, MenuSectionHeader as SectionHeader, MenuSectionLabel as SectionLabel, MenuSectionList as SectionList, MenuSectionSeparator as SectionSeparator, ReserveLeadingSlot, SearchInput as Search, calculateMenuMinHeight, useReserveLeadingSlot } from "./menu.js";
|
|
1
|
+
export { MenuFooterLayout as Footer, MenuHeaderLayout as Header, MenuHeading as Title, MenuListItem as ListItem, MenuSectionGroup as SectionGroup, MenuSectionHeader as SectionHeader, MenuSectionLabel as SectionLabel, MenuSectionList as SectionList, MenuSectionSeparator as SectionSeparator, ReserveLeadingSlot, SECTION_ITEM_SPACE, SearchInput as Search, calculateMenuMinHeight, focusMenuItemDetails, useReserveLeadingSlot } from "./menu.js";
|
|
2
2
|
export { ControlContext } from "./controlContext.js";
|
|
3
3
|
export { DropdownButton } from "./dropdownButton.js";
|
package/dist/menu/menu.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type * as React from 'react';
|
|
|
2
2
|
import { InputGroup } from '../input/index.js';
|
|
3
3
|
import { type FlexProps } from '../layout/index.js';
|
|
4
4
|
import type { ContainerProps } from '../layout/container.js';
|
|
5
|
+
import { Text } from '../text/index.js';
|
|
5
6
|
import type { FormSize } from '../theme/index.js';
|
|
6
7
|
import type { TooltipProps } from '../tooltip/index.js';
|
|
7
8
|
/** Caps a requested menu height by the space available to its overlay. */
|
|
@@ -14,9 +15,10 @@ export declare function MenuHeading({ children, padding, }: {
|
|
|
14
15
|
padding?: ContainerProps['padding'];
|
|
15
16
|
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
17
|
/** Text style for a heading within a menu section. */
|
|
17
|
-
export declare function MenuSectionLabel({ children, padding, ...props }: Omit<React.HTMLAttributes<HTMLSpanElement>, 'color' | 'style'> & {
|
|
18
|
+
export declare function MenuSectionLabel({ children, padding, size, ...props }: Omit<React.HTMLAttributes<HTMLSpanElement>, 'color' | 'style'> & {
|
|
18
19
|
children: React.ReactNode;
|
|
19
20
|
padding?: ContainerProps['padding'];
|
|
21
|
+
size?: React.ComponentProps<typeof Text>['size'];
|
|
20
22
|
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
23
|
/** Layout for a menu section heading and an optional action beside it. */
|
|
22
24
|
export declare function MenuSectionHeader({ children, trailingAction, ...props }: FlexProps & {
|
|
@@ -27,7 +29,7 @@ export declare function MenuSectionSeparator(): import("@emotion/react/jsx-runti
|
|
|
27
29
|
/** List item wrapper for a menu section. */
|
|
28
30
|
export declare function MenuSectionGroup(props: ContainerProps<'li'>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
29
31
|
/** List wrapper for the items within a menu section. */
|
|
30
|
-
export declare function MenuSectionList(props:
|
|
32
|
+
export declare function MenuSectionList(props: FlexProps<'ul'>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
31
33
|
/** Container for menu footer actions, with a divider above it. */
|
|
32
34
|
export declare function MenuFooterLayout(props: FlexProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
33
35
|
type SearchInputProps = React.ComponentPropsWithRef<typeof InputGroup.Input> & {
|
|
@@ -47,15 +49,16 @@ export declare function ReserveLeadingSlot({ reserve, children, }: {
|
|
|
47
49
|
/** Whether the surrounding menu reserves a leading slot for every item. */
|
|
48
50
|
export declare function useReserveLeadingSlot(): boolean;
|
|
49
51
|
/**
|
|
50
|
-
* Menu item priority. Determines the text
|
|
52
|
+
* Menu item priority. Determines the text color.
|
|
51
53
|
*/
|
|
52
54
|
type Priority = 'primary' | 'danger' | 'default';
|
|
55
|
+
/** Space token between the items of a dropdown menu section. */
|
|
56
|
+
export declare const SECTION_ITEM_SPACE = "2xs";
|
|
53
57
|
declare const StyledInnerWrap: import("@emotion/styled").StyledComponent<((FlexProps<import("../layout/container.js").ContainerElement> | import("../layout/flex.js").FlexPropsWithRenderFunction<import("../layout/container.js").ContainerElement>) & {
|
|
54
58
|
theme?: import("@emotion/react").Theme;
|
|
55
59
|
}) & {
|
|
56
60
|
disabled: boolean;
|
|
57
61
|
hasTrailingAction: boolean;
|
|
58
|
-
isFocused: boolean;
|
|
59
62
|
priority: Priority;
|
|
60
63
|
size?: FormSize;
|
|
61
64
|
}, {}, {}>;
|
|
@@ -86,6 +89,8 @@ export interface MenuItemTrailingAction {
|
|
|
86
89
|
/** Accessible name for the button, also shown as its tooltip. */
|
|
87
90
|
label: string;
|
|
88
91
|
onAction: () => void;
|
|
92
|
+
/** Shows a loading indicator in place of the icon while the action runs. */
|
|
93
|
+
busy?: boolean;
|
|
89
94
|
}
|
|
90
95
|
export type ListItemProps = {
|
|
91
96
|
/**
|
|
@@ -108,7 +113,7 @@ export type ListItemProps = {
|
|
|
108
113
|
*/
|
|
109
114
|
leadingItems?: ExtraContent;
|
|
110
115
|
/**
|
|
111
|
-
* Accented text
|
|
116
|
+
* Accented text color.
|
|
112
117
|
*/
|
|
113
118
|
priority?: Priority;
|
|
114
119
|
/**
|
|
@@ -145,6 +150,7 @@ interface OtherProps<T extends React.ElementType> {
|
|
|
145
150
|
as?: 'div' | 'p';
|
|
146
151
|
id?: string;
|
|
147
152
|
};
|
|
153
|
+
onDetailsHoverChange?: (isHovered: boolean, event: React.PointerEvent) => void;
|
|
148
154
|
trailingAction?: MenuItemTrailingAction;
|
|
149
155
|
/** Ref to the trailing action's button. */
|
|
150
156
|
trailingActionRef?: React.Ref<HTMLButtonElement>;
|
|
@@ -155,5 +161,7 @@ interface MenuListItemProps<T extends React.ElementType = 'li'> extends ListItem
|
|
|
155
161
|
ref?: React.ComponentPropsWithRef<NoInfer<T>>['ref'];
|
|
156
162
|
}
|
|
157
163
|
/** Renders the shared visual shell for menu and select items. */
|
|
158
|
-
export declare function MenuListItem<T extends React.ElementType = 'li'>({ label, details, as, priority, size, disabled, leadingItems, trailingItems, trailingAction, isFocused, isSelected, isPressed, innerWrapProps, labelProps, detailsProps, showDetailsInOverlay, tooltip, tooltipOptions, ref, trailingActionRef, trailingActionWrapperProps, ...props }: MenuListItemProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
164
|
+
export declare function MenuListItem<T extends React.ElementType = 'li'>({ label, details, as, priority, size, disabled, leadingItems, trailingItems, trailingAction, isFocused, isSelected, isPressed, innerWrapProps, labelProps, detailsProps, showDetailsInOverlay, onDetailsHoverChange, tooltip, tooltipOptions, ref, trailingActionRef, trailingActionWrapperProps, ...props }: MenuListItemProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
165
|
+
/** Moves focus into a menu item's overlay details, returning whether it could. */
|
|
166
|
+
export declare function focusMenuItemDetails(item: Element | null): boolean;
|
|
159
167
|
export {};
|