@sentry/scraps 0.4.0 → 0.6.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 +74 -8
- package/dist/alert/alert.js +0 -3
- package/dist/badge/badge.js +1 -2
- package/dist/badge/tag.js +4 -4
- package/dist/button/button.js +1 -0
- package/dist/button/index.d.ts +0 -1
- package/dist/button/index.js +0 -1
- package/dist/button/linkButton.js +1 -0
- package/dist/button/styles.js +157 -152
- 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 +243 -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 +355 -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 +264 -0
- package/dist/confirm/index.d.ts +153 -0
- package/dist/confirm/index.js +132 -0
- package/dist/dateTime/config.d.ts +23 -0
- package/dist/dateTime/config.js +50 -0
- package/dist/dateTime/context.d.ts +18 -0
- package/dist/dateTime/context.js +46 -0
- package/dist/dateTime/dateTime.d.ts +6 -0
- package/dist/dateTime/dateTime.js +30 -0
- package/dist/dateTime/format.d.ts +24 -0
- package/dist/dateTime/format.js +45 -0
- package/dist/dateTime/index.d.ts +6 -0
- package/dist/dateTime/index.js +6 -0
- package/dist/dateTime/intlFormatter.d.ts +9 -0
- package/dist/dateTime/intlFormatter.js +16 -0
- package/dist/dateTime/parseDate.d.ts +3 -0
- package/dist/dateTime/parseDate.js +12 -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 +39 -0
- package/dist/dropdownMenu/context.js +3 -0
- package/dist/dropdownMenu/dropdownMenu.d.ts +70 -0
- package/dist/dropdownMenu/dropdownMenu.js +109 -0
- package/dist/dropdownMenu/index.d.ts +2 -0
- package/dist/dropdownMenu/index.js +1 -0
- package/dist/dropdownMenu/item.d.ts +140 -0
- package/dist/dropdownMenu/item.js +142 -0
- package/dist/dropdownMenu/list.d.ts +85 -0
- package/dist/dropdownMenu/list.js +429 -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 +24 -0
- package/dist/dropdownMenu/useDropdownMenuKeyboard.js +31 -0
- package/dist/dropdownMenu/useDropdownMenuRowLayout.d.ts +29 -0
- package/dist/dropdownMenu/useDropdownMenuRowLayout.js +64 -0
- package/dist/dropdownMenu/useDropdownRootMenuState.d.ts +13 -0
- package/dist/dropdownMenu/useDropdownRootMenuState.js +30 -0
- package/dist/dropdownMenu/useDropdownSubmenuState.d.ts +19 -0
- package/dist/dropdownMenu/useDropdownSubmenuState.js +25 -0
- package/dist/dropdownMenu/utils.d.ts +21 -0
- package/dist/dropdownMenu/utils.js +55 -0
- package/dist/duration/formatElapsedDuration.d.ts +4 -0
- package/dist/duration/formatElapsedDuration.js +10 -0
- package/dist/duration/getDuration.d.ts +68 -0
- package/dist/duration/getDuration.js +80 -0
- package/dist/duration/index.d.ts +2 -0
- package/dist/duration/index.js +2 -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/fzf.d.ts +9 -0
- package/dist/fzf.js +155 -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/container.d.ts +8 -2
- package/dist/layout/container.js +2 -2
- package/dist/layout/index.d.ts +2 -2
- package/dist/layout/index.js +1 -1
- package/dist/layout/styles.d.ts +2 -1
- package/dist/layout/styles.js +11 -5
- package/dist/legacyDatetime.d.ts +21 -0
- package/dist/legacyDatetime.js +13 -0
- package/dist/link/index.d.ts +1 -1
- package/dist/link/index.js +1 -1
- package/dist/link/link.js +4 -3
- package/dist/link/linkBehaviorContext.d.ts +11 -0
- package/dist/link/linkBehaviorContext.js +48 -11
- package/dist/menu/index.d.ts +1 -1
- package/dist/menu/index.js +1 -1
- package/dist/menu/menu.d.ts +14 -8
- package/dist/menu/menu.js +163 -60
- 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/relativeTime/getRelativeDate.d.ts +14 -0
- package/dist/relativeTime/getRelativeDate.js +107 -0
- package/dist/relativeTime/index.d.ts +3 -0
- package/dist/relativeTime/index.js +3 -0
- package/dist/relativeTime/relativeTime.d.ts +55 -0
- package/dist/relativeTime/relativeTime.js +102 -0
- package/dist/relativeTime/useRelativeTimeFormatter.d.ts +2 -0
- package/dist/relativeTime/useRelativeTimeFormatter.js +10 -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/context.d.ts +9 -0
- package/dist/tabs/context.js +9 -0
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +1 -0
- package/dist/tabs/item.d.ts +24 -0
- package/dist/tabs/item.js +4 -0
- package/dist/tabs/tab.d.ts +22 -0
- package/dist/tabs/tab.js +208 -0
- package/dist/tabs/tabList.d.ts +18 -0
- package/dist/tabs/tabList.js +258 -0
- package/dist/tabs/tabPanels.d.ts +13 -0
- package/dist/tabs/tabPanels.js +62 -0
- package/dist/tabs/tabs.d.ts +53 -0
- package/dist/tabs/tabs.js +59 -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/prose.d.ts +2 -2
- 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/theme/theme.d.ts +34 -34
- package/dist/theme/theme.js +9 -0
- package/dist/theme/types.d.ts +20 -2
- package/dist/tooltip/tooltip.js +2 -5
- package/dist/translation/index.d.ts +1 -0
- package/dist/translation/index.js +1 -0
- package/dist/translation/translate.d.ts +9 -0
- package/dist/translation/translate.js +5 -0
- package/dist/translation/translationContext.d.ts +2 -1
- package/dist/translation/translationContext.js +2 -1
- 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/fonts/OFL.txt +94 -0
- package/fonts/roboto-mono-variable-cyrillic-ext.woff2 +0 -0
- package/fonts/roboto-mono-variable-cyrillic.woff2 +0 -0
- package/fonts/roboto-mono-variable-greek.woff2 +0 -0
- package/fonts/roboto-mono-variable-latin-ext.woff2 +0 -0
- package/fonts/roboto-mono-variable-vietnamese.woff2 +0 -0
- package/fonts/roboto-mono-variable.woff2 +0 -0
- package/fonts/rubik-variable-cyrillic-ext.woff2 +0 -0
- package/fonts/rubik-variable-cyrillic.woff2 +0 -0
- package/fonts/rubik-variable-latin-ext.woff2 +0 -0
- package/fonts/rubik-variable.woff2 +0 -0
- package/fonts.css +211 -0
- package/package.json +140 -23
- package/dist/datetime.d.ts +0 -39
- package/dist/datetime.js +0 -20
- 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
|
+
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CSS } from '../cssTypes.js';
|
|
3
|
-
import type { BorderVariant, RadiusSize, SpaceSize
|
|
3
|
+
import type { BackgroundToken, BorderVariant, RadiusSize, SpaceSize } from '../theme/index.js';
|
|
4
4
|
import { type Responsive, type Shorthand } from './styles.js';
|
|
5
5
|
type Margin = SpaceSize | 'auto' | '0';
|
|
6
6
|
interface ContainerLayoutProps {
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Background color, as a path into `tokens.background`.
|
|
9
|
+
*/
|
|
10
|
+
background?: Responsive<BackgroundToken>;
|
|
8
11
|
display?: Responsive<CSS['display']>;
|
|
9
12
|
padding?: Responsive<Shorthand<SpaceSize, 4>>;
|
|
10
13
|
paddingTop?: Responsive<SpaceSize>;
|
|
@@ -45,6 +48,9 @@ interface ContainerLayoutProps {
|
|
|
45
48
|
height?: Responsive<CSS['height']>;
|
|
46
49
|
minHeight?: Responsive<CSS['minHeight']>;
|
|
47
50
|
maxHeight?: Responsive<CSS['maxHeight']>;
|
|
51
|
+
/**
|
|
52
|
+
* Border color on all sides. Renders a 1px solid border.
|
|
53
|
+
*/
|
|
48
54
|
border?: Responsive<BorderVariant>;
|
|
49
55
|
borderTop?: Responsive<BorderVariant>;
|
|
50
56
|
borderBottom?: Responsive<BorderVariant>;
|
package/dist/layout/container.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useMemo, useRef } from "react";
|
|
|
3
3
|
import is_prop_valid from "@emotion/is-prop-valid";
|
|
4
4
|
import styled from "@emotion/styled";
|
|
5
5
|
import { mergeRefs } from "@react-aria/utils";
|
|
6
|
-
import { ContainerQueryProvider, getBorder, getMargin, getRadius, getSpacing, rc } from "./styles.js";
|
|
6
|
+
import { ContainerQueryProvider, getBackground, getBorder, getMargin, getRadius, getSpacing, rc } from "./styles.js";
|
|
7
7
|
const omitContainerProps = new Set([
|
|
8
8
|
'alignSelf',
|
|
9
9
|
'area',
|
|
@@ -118,7 +118,7 @@ const Container = styled((props)=>{
|
|
|
118
118
|
${(p)=>rc('margin-left', p.marginLeft, p.theme, getMargin)};
|
|
119
119
|
${(p)=>rc('margin-right', p.marginRight, p.theme, getMargin)};
|
|
120
120
|
|
|
121
|
-
${(p)=>rc('background', p.background, p.theme,
|
|
121
|
+
${(p)=>rc('background', p.background, p.theme, getBackground)};
|
|
122
122
|
|
|
123
123
|
${(p)=>rc('border-radius', p.radius, p.theme, getRadius)};
|
|
124
124
|
|
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/layout/styles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode, RefObject } from 'react';
|
|
2
|
-
import type { BorderVariant, BreakpointSize, ContainerBreakpointSize, RadiusSize, SpaceSize, Theme } from '../theme/index.js';
|
|
2
|
+
import type { BackgroundToken, BorderVariant, BreakpointSize, ContainerBreakpointSize, RadiusSize, SpaceSize, Theme } from '../theme/index.js';
|
|
3
3
|
type ResponsiveBreakpoint = BreakpointSize | ContainerBreakpointSize;
|
|
4
4
|
export declare function rc<T>(property: string, value: Responsive<T> | undefined, theme: Theme, resolver?: (value: T | undefined, breakpoint: ResponsiveBreakpoint | undefined, theme: Theme) => string | undefined): string | undefined;
|
|
5
5
|
type Margin = SpaceSize | 'auto' | '0';
|
|
@@ -38,6 +38,7 @@ export type Shorthand<T extends string, N extends 4 | 2> = N extends 4 ? `${T} $
|
|
|
38
38
|
type ScreenBreakpoint = `screen:${BreakpointSize}`;
|
|
39
39
|
export type ResponsiveKey = ContainerBreakpointSize | ScreenBreakpoint;
|
|
40
40
|
export type Responsive<T> = T | Partial<Record<ResponsiveKey, T>>;
|
|
41
|
+
export declare function getBackground(background: BackgroundToken | undefined, _breakpoint: ResponsiveBreakpoint | undefined, theme: Theme): string | undefined;
|
|
41
42
|
export declare function getBorder(border: BorderVariant | undefined, _breakpoint: ResponsiveBreakpoint | undefined, theme: Theme): string | undefined;
|
|
42
43
|
export declare function getRadius(radius: Shorthand<RadiusSize, 4> | undefined, _breakpoint: ResponsiveBreakpoint | undefined, theme: Theme): string | undefined;
|
|
43
44
|
export declare function getSpacing(spacing: Shorthand<SpaceSize, 4> | undefined, _breakpoint: ResponsiveBreakpoint | undefined, theme: Theme): string | undefined;
|
package/dist/layout/styles.js
CHANGED
|
@@ -95,10 +95,16 @@ function resolveMargin(sizeComponent, theme) {
|
|
|
95
95
|
if ('0' === sizeComponent) return '0';
|
|
96
96
|
return theme.space[sizeComponent] ?? theme.space['0'];
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
function getBackground(background, _breakpoint, theme) {
|
|
99
|
+
if (void 0 === background) return;
|
|
100
|
+
let node = theme.tokens.background;
|
|
101
|
+
for (const segment of background.split('.'))node = node[segment];
|
|
102
|
+
return node;
|
|
103
|
+
}
|
|
104
|
+
function borderValue(path, theme) {
|
|
105
|
+
let node = theme.tokens.border;
|
|
106
|
+
for (const segment of path.split('.'))node = node[segment];
|
|
107
|
+
return node;
|
|
102
108
|
}
|
|
103
109
|
function getBorder(border, _breakpoint, theme) {
|
|
104
110
|
if (void 0 === border) return;
|
|
@@ -234,4 +240,4 @@ function ContainerQueryProvider({ elementRef, children }) {
|
|
|
234
240
|
children: children
|
|
235
241
|
});
|
|
236
242
|
}
|
|
237
|
-
export { ContainerQueryContext, ContainerQueryProvider, FLEX_JUSTIFY_CONTENT, getBorder, getMargin, getRadius, getSpacing, rc, useActiveBreakpoint, useContainerBreakpoint, useHasContainerQuery, useResponsivePropResolver, useResponsivePropValue };
|
|
243
|
+
export { ContainerQueryContext, ContainerQueryProvider, FLEX_JUSTIFY_CONTENT, getBackground, getBorder, getMargin, getRadius, getSpacing, rc, useActiveBreakpoint, useContainerBreakpoint, useHasContainerQuery, useResponsivePropResolver, useResponsivePropValue };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { useClock, useTimezone } from './dateTime/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Published 0.4.0 and 0.5.0 exported this API from `@sentry/scraps/datetime`.
|
|
5
|
+
* It now lives in `@sentry/scraps/dateTime`; these aliases keep existing imports
|
|
6
|
+
* working for one release.
|
|
7
|
+
*/
|
|
8
|
+
/** @deprecated Use `DateTimePreferences` from `@sentry/scraps/dateTime`. */
|
|
9
|
+
export interface DateTimeContextValue {
|
|
10
|
+
clockDisplay: '12' | '24';
|
|
11
|
+
timezone: string;
|
|
12
|
+
}
|
|
13
|
+
/** @deprecated Use `DateTimeProvider` from `@sentry/scraps/dateTime`. */
|
|
14
|
+
export declare function DateTimeProvider({ value, children, }: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
value: DateTimeContextValue;
|
|
17
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
|
+
/** @deprecated Use `useTimezone` from `@sentry/scraps/dateTime`. */
|
|
19
|
+
export { useTimezone };
|
|
20
|
+
/** @deprecated Use `useClock` from `@sentry/scraps/dateTime`. */
|
|
21
|
+
export declare const useClockDisplay: typeof useClock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { DateTimeProvider, useClock, useTimezone } from "./dateTime/index.js";
|
|
3
|
+
function legacyDatetime_DateTimeProvider({ value, children }) {
|
|
4
|
+
return /*#__PURE__*/ jsx(DateTimeProvider, {
|
|
5
|
+
value: {
|
|
6
|
+
timezone: value.timezone,
|
|
7
|
+
clock: value.clockDisplay
|
|
8
|
+
},
|
|
9
|
+
children: children
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const useClockDisplay = useClock;
|
|
13
|
+
export { legacyDatetime_DateTimeProvider as DateTimeProvider, useClockDisplay, useTimezone };
|
package/dist/link/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Link, type LinkDestination, type LinkProps, ExternalLink } from './link.js';
|
|
2
|
-
export { LinkBehaviorContextProvider } from './linkBehaviorContext.js';
|
|
2
|
+
export { LinkBehaviorContextProvider, useLinkQueryString, useResolveLinkHref, } from './linkBehaviorContext.js';
|
package/dist/link/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ExternalLink, Link } from "./link.js";
|
|
2
|
-
export { LinkBehaviorContextProvider } from "./linkBehaviorContext.js";
|
|
2
|
+
export { LinkBehaviorContextProvider, useLinkQueryString, useResolveLinkHref } from "./linkBehaviorContext.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 {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
import { type FunctionComponent } from 'react';
|
|
3
3
|
import type { LinkProps } from './link.js';
|
|
4
|
+
type QueryString = {
|
|
5
|
+
parse: (search: string) => Record<string, string | string[] | null>;
|
|
6
|
+
stringify: (query: Record<string, unknown>) => string;
|
|
7
|
+
};
|
|
4
8
|
type LinkBehavior<T extends LinkProps> = {
|
|
5
9
|
behavior: (props: T) => T;
|
|
6
10
|
component: FunctionComponent<T>;
|
|
11
|
+
/** Query string helpers default to URLSearchParams behavior. */
|
|
12
|
+
parse?: QueryString['parse'];
|
|
13
|
+
stringify?: QueryString['stringify'];
|
|
7
14
|
};
|
|
8
15
|
declare function AnchorLink({ to, replace: _replace, preventScrollReset: _preventScrollReset, reloadDocument: _reloadDocument, state: _state, ...props }: LinkProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
16
|
export declare const LinkBehaviorContextProvider: React.Provider<LinkBehavior<LinkProps> | null>;
|
|
@@ -11,4 +18,8 @@ export declare const useLinkBehavior: <T extends LinkProps>(props: T) => {
|
|
|
11
18
|
Component: typeof AnchorLink | React.FunctionComponent<T>;
|
|
12
19
|
behavior: () => T;
|
|
13
20
|
};
|
|
21
|
+
/** Use the provider's query helpers, or the native defaults outside a provider. */
|
|
22
|
+
export declare function useLinkQueryString(): QueryString;
|
|
23
|
+
/** Resolve collection hrefs through the same application behavior as Link. */
|
|
24
|
+
export declare function useResolveLinkHref(): (to: LinkProps["to"]) => string;
|
|
14
25
|
export {};
|