@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
package/dist/text/heading.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { Responsive } from '../layout/index.js';
|
|
3
3
|
import type { HeadingSize } from '../theme/index.js';
|
|
4
4
|
import { type BaseTextProps } from './text.js';
|
|
5
5
|
type BaseHeadingProps = Omit<BaseTextProps, 'bold' | 'uppercase' | 'trim'>;
|
package/dist/text/heading.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { rc } from "../layout/
|
|
4
|
+
import { rc } from "../layout/styles.js";
|
|
5
5
|
import { getFontSize, getLineHeight, getTextDecoration } from "./styles.js";
|
|
6
6
|
const Heading = styled((props)=>{
|
|
7
7
|
if ('function' == typeof props.children) return props.children({
|
package/dist/text/prose.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type * as React from 'react';
|
|
|
2
2
|
export declare const Prose: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
as?: keyof HTMLElementTagNameMap | undefined;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
ref?: React.Ref<
|
|
6
|
-
} & React.HTMLAttributes<
|
|
5
|
+
ref?: React.Ref<HTMLTimeElement | HTMLElement | HTMLDivElement | HTMLObjectElement | HTMLDialogElement | HTMLProgressElement | HTMLStyleElement | HTMLAnchorElement | HTMLMapElement | HTMLLinkElement | HTMLSlotElement | HTMLTitleElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLSpanElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement | null> | undefined;
|
|
6
|
+
} & React.HTMLAttributes<HTMLTimeElement | HTMLElement | HTMLDivElement | HTMLObjectElement | HTMLDialogElement | HTMLProgressElement | HTMLStyleElement | HTMLAnchorElement | HTMLMapElement | HTMLLinkElement | HTMLSlotElement | HTMLTitleElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLSpanElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement> & {
|
|
7
7
|
theme?: import("@emotion/react").Theme;
|
|
8
8
|
}, {}, {}>;
|
package/dist/text/styles.js
CHANGED
|
@@ -9,7 +9,7 @@ function getTextDecoration(p) {
|
|
|
9
9
|
}
|
|
10
10
|
function getLineHeight(density, theme) {
|
|
11
11
|
if (void 0 === density) return;
|
|
12
|
-
return theme.font.lineHeight[density]
|
|
12
|
+
return String(theme.font.lineHeight[density]);
|
|
13
13
|
}
|
|
14
14
|
function getFontSize(size, theme) {
|
|
15
15
|
if (void 0 === size) return;
|
package/dist/text/text.d.ts
CHANGED
package/dist/text/text.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import is_prop_valid from "@emotion/is-prop-valid";
|
|
3
3
|
import { css } from "@emotion/react";
|
|
4
4
|
import styled from "@emotion/styled";
|
|
5
|
-
import { rc } from "../layout/
|
|
5
|
+
import { rc } from "../layout/styles.js";
|
|
6
6
|
import { getFontSize, getLineHeight, getTextDecoration } from "./styles.js";
|
|
7
7
|
function getDefaultDisplay(p) {
|
|
8
8
|
if ('div' === p.as) return 'block';
|
package/dist/theme/dark.js
CHANGED
|
@@ -442,17 +442,17 @@ const shadow = {
|
|
|
442
442
|
};
|
|
443
443
|
const darkTheme = {
|
|
444
444
|
...baseTheme,
|
|
445
|
-
shadow
|
|
445
|
+
shadow,
|
|
446
446
|
tokens: {
|
|
447
|
-
background
|
|
448
|
-
border
|
|
449
|
-
content
|
|
450
|
-
dataviz
|
|
451
|
-
elevation
|
|
447
|
+
background,
|
|
448
|
+
border,
|
|
449
|
+
content,
|
|
450
|
+
dataviz,
|
|
451
|
+
elevation,
|
|
452
452
|
focus: dark_focus,
|
|
453
|
-
graphics
|
|
454
|
-
interactive
|
|
455
|
-
syntax
|
|
453
|
+
graphics,
|
|
454
|
+
interactive,
|
|
455
|
+
syntax
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
458
|
export { darkTheme };
|
package/dist/theme/light.js
CHANGED
|
@@ -442,17 +442,17 @@ const shadow = {
|
|
|
442
442
|
};
|
|
443
443
|
const lightTheme = {
|
|
444
444
|
...baseTheme,
|
|
445
|
-
shadow
|
|
445
|
+
shadow,
|
|
446
446
|
tokens: {
|
|
447
|
-
background
|
|
448
|
-
border
|
|
449
|
-
content
|
|
450
|
-
dataviz
|
|
451
|
-
elevation
|
|
447
|
+
background,
|
|
448
|
+
border,
|
|
449
|
+
content,
|
|
450
|
+
dataviz,
|
|
451
|
+
elevation,
|
|
452
452
|
focus: light_focus,
|
|
453
|
-
graphics
|
|
454
|
-
interactive
|
|
455
|
-
syntax
|
|
453
|
+
graphics,
|
|
454
|
+
interactive,
|
|
455
|
+
syntax
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
458
|
export { lightTheme };
|
package/dist/theme/theme.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ import { lightTheme as baseLightTheme } from './light.js';
|
|
|
14
14
|
import { type Swatch } from './swatch.js';
|
|
15
15
|
import type { MotionDuration } from './types.js';
|
|
16
16
|
type MotionDefinition = Record<MotionDuration, string>;
|
|
17
|
-
type ScrapsTheme = {
|
|
17
|
+
type ScrapsTheme = Omit<{
|
|
18
18
|
[Key in keyof typeof baseLightTheme]: (typeof baseLightTheme)[Key] | (typeof baseDarkTheme)[Key];
|
|
19
|
-
}
|
|
19
|
+
}, 'font'>;
|
|
20
20
|
export interface SentryTheme extends ScrapsTheme, Omit<typeof lightThemeDefinition, keyof ScrapsTheme | 'chart'> {
|
|
21
21
|
chart: {
|
|
22
22
|
getColorPalette: ReturnType<typeof makeChartColorPalette>;
|
|
@@ -115,6 +115,38 @@ declare const lightThemeDefinition: {
|
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
visuallyHidden: import("@emotion/react").SerializedStyles;
|
|
118
|
+
font: {
|
|
119
|
+
readonly family: {
|
|
120
|
+
readonly sans: "Rubik, 'scraps-fallback-sans', 'Avenir Next', sans-serif";
|
|
121
|
+
readonly mono: "'Roboto Mono', 'scraps-fallback-mono', Monaco, Consolas, 'Courier New', monospace";
|
|
122
|
+
};
|
|
123
|
+
readonly size: {
|
|
124
|
+
xs: "11px";
|
|
125
|
+
sm: "12px";
|
|
126
|
+
md: "14px";
|
|
127
|
+
lg: "16px";
|
|
128
|
+
xl: "20px";
|
|
129
|
+
'2xl': "24px";
|
|
130
|
+
'3xl': "32px";
|
|
131
|
+
'4xl': "40px";
|
|
132
|
+
};
|
|
133
|
+
readonly weight: {
|
|
134
|
+
sans: {
|
|
135
|
+
regular: 400;
|
|
136
|
+
medium: 500;
|
|
137
|
+
};
|
|
138
|
+
mono: {
|
|
139
|
+
regular: 425;
|
|
140
|
+
medium: 500;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
readonly lineHeight: {
|
|
144
|
+
compressed: 1;
|
|
145
|
+
default: 1.2;
|
|
146
|
+
comfortable: 1.4;
|
|
147
|
+
fixed: "1rem";
|
|
148
|
+
};
|
|
149
|
+
};
|
|
118
150
|
focusRing: (baseShadow?: string) => {
|
|
119
151
|
outline: string;
|
|
120
152
|
boxShadow: string;
|
|
@@ -451,38 +483,6 @@ declare const lightThemeDefinition: {
|
|
|
451
483
|
};
|
|
452
484
|
};
|
|
453
485
|
};
|
|
454
|
-
font: {
|
|
455
|
-
size: {
|
|
456
|
-
xs: "11px";
|
|
457
|
-
sm: "12px";
|
|
458
|
-
md: "14px";
|
|
459
|
-
lg: "16px";
|
|
460
|
-
xl: "20px";
|
|
461
|
-
'2xl': "24px";
|
|
462
|
-
'3xl': "32px";
|
|
463
|
-
'4xl': "40px";
|
|
464
|
-
};
|
|
465
|
-
weight: {
|
|
466
|
-
sans: {
|
|
467
|
-
regular: 400;
|
|
468
|
-
medium: 500;
|
|
469
|
-
};
|
|
470
|
-
mono: {
|
|
471
|
-
regular: 425;
|
|
472
|
-
medium: 500;
|
|
473
|
-
};
|
|
474
|
-
};
|
|
475
|
-
family: {
|
|
476
|
-
sans: "Rubik, 'Avenir Next', sans-serif";
|
|
477
|
-
mono: "'Roboto Mono', Monaco, Consolas, 'Courier New', monospace";
|
|
478
|
-
};
|
|
479
|
-
lineHeight: {
|
|
480
|
-
compressed: 1;
|
|
481
|
-
default: 1.2;
|
|
482
|
-
comfortable: 1.4;
|
|
483
|
-
fixed: "1rem";
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
486
|
space: {
|
|
487
487
|
'0': "0px";
|
|
488
488
|
'2xs': "2px";
|
package/dist/theme/theme.js
CHANGED
|
@@ -195,6 +195,13 @@ const commonTheme = {
|
|
|
195
195
|
},
|
|
196
196
|
...typography
|
|
197
197
|
};
|
|
198
|
+
const font = {
|
|
199
|
+
...typography.font,
|
|
200
|
+
family: {
|
|
201
|
+
sans: "Rubik, 'scraps-fallback-sans', 'Avenir Next', sans-serif",
|
|
202
|
+
mono: "'Roboto Mono', 'scraps-fallback-mono', Monaco, Consolas, 'Courier New', monospace"
|
|
203
|
+
}
|
|
204
|
+
};
|
|
198
205
|
const ccl = color.categorical.light;
|
|
199
206
|
const CHART_PALETTE_LIGHT = [
|
|
200
207
|
[
|
|
@@ -744,6 +751,7 @@ const lightThemeDefinition = {
|
|
|
744
751
|
type: 'light',
|
|
745
752
|
...commonTheme,
|
|
746
753
|
...lightTheme,
|
|
754
|
+
font,
|
|
747
755
|
focusRing: (baseShadow = `0 0 0 0 ${lightTheme.tokens.background.primary}`)=>({
|
|
748
756
|
outline: 'none',
|
|
749
757
|
boxShadow: `${baseShadow}, 0 0 0 2px ${lightTheme.tokens.focus["default"]}`
|
|
@@ -763,6 +771,7 @@ const theme_darkTheme = {
|
|
|
763
771
|
type: 'dark',
|
|
764
772
|
...commonTheme,
|
|
765
773
|
...darkTheme,
|
|
774
|
+
font,
|
|
766
775
|
focusRing: (baseShadow = `0 0 0 0 ${darkTheme.tokens.background.primary}`)=>({
|
|
767
776
|
outline: 'none',
|
|
768
777
|
boxShadow: `${baseShadow}, 0 0 0 2px ${darkTheme.tokens.focus["default"]}`
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { size } from '../tokens/size.js';
|
|
2
|
+
import type { lightTheme } from './light.js';
|
|
2
3
|
/**
|
|
3
4
|
* Font size constraint for body typography.
|
|
4
5
|
*/
|
|
@@ -51,9 +52,26 @@ export type ContentVariant = Exclude<SemanticVariant, 'neutral'> | 'primary' | '
|
|
|
51
52
|
*/
|
|
52
53
|
export type GraphicsVariant = SemanticVariant;
|
|
53
54
|
/**
|
|
54
|
-
*
|
|
55
|
+
* Dot paths to every leaf of a token object, e.g. `'transparent.neutral.muted'`.
|
|
55
56
|
*/
|
|
56
|
-
|
|
57
|
+
type TokenPath<T> = {
|
|
58
|
+
[K in keyof T & string]: T[K] extends string ? K : `${K}.${TokenPath<T[K]>}`;
|
|
59
|
+
}[keyof T & string];
|
|
60
|
+
/**
|
|
61
|
+
* Every border color token, as a path into `tokens.border`. Derived from the
|
|
62
|
+
* theme, so a new border token is available without changing this type.
|
|
63
|
+
*/
|
|
64
|
+
export type BorderToken = TokenPath<(typeof lightTheme)['tokens']['border']>;
|
|
65
|
+
/**
|
|
66
|
+
* Border color variant: a border token path, or `none` to remove the border.
|
|
67
|
+
*/
|
|
68
|
+
export type BorderVariant = BorderToken | 'none';
|
|
69
|
+
/**
|
|
70
|
+
* Every background color token, as a path into `tokens.background`. Derived
|
|
71
|
+
* from the theme, so a new background token is available without changing
|
|
72
|
+
* this type.
|
|
73
|
+
*/
|
|
74
|
+
export type BackgroundToken = TokenPath<(typeof lightTheme)['tokens']['background']>;
|
|
57
75
|
/**
|
|
58
76
|
* Icon size constraint.
|
|
59
77
|
*/
|
package/dist/tooltip/tooltip.js
CHANGED
|
@@ -108,7 +108,7 @@ function TooltipHeader({ children, leadingItems, trailingItems }) {
|
|
|
108
108
|
})
|
|
109
109
|
]
|
|
110
110
|
}),
|
|
111
|
-
|
|
111
|
+
null != trailingItems && /*#__PURE__*/ jsx(Text, {
|
|
112
112
|
bold: true,
|
|
113
113
|
align: "right",
|
|
114
114
|
wrap: "nowrap",
|
|
@@ -160,7 +160,7 @@ function TooltipFooter({ children, leadingItems, trailingItems }) {
|
|
|
160
160
|
})
|
|
161
161
|
]
|
|
162
162
|
}),
|
|
163
|
-
|
|
163
|
+
null != trailingItems && /*#__PURE__*/ jsx(Text, {
|
|
164
164
|
variant: "muted",
|
|
165
165
|
align: "right",
|
|
166
166
|
wrap: "nowrap",
|
|
@@ -175,7 +175,4 @@ const Tooltip = Object.assign(TooltipComponent, {
|
|
|
175
175
|
Row: TooltipRow,
|
|
176
176
|
Footer: TooltipFooter
|
|
177
177
|
});
|
|
178
|
-
function defined(value) {
|
|
179
|
-
return null != value;
|
|
180
|
-
}
|
|
181
178
|
export { Tooltip, TooltipContent, TooltipContext };
|
|
@@ -2,3 +2,4 @@
|
|
|
2
2
|
export type { TranslationContextValue } from './translationContext.js';
|
|
3
3
|
export declare const TranslationContextProvider: import("react").Provider<import("./translationContext.js").TranslationContextValue>;
|
|
4
4
|
export { useTranslation } from './useTranslation.js';
|
|
5
|
+
export { pgettext, t, tn, type Translation } from './translate.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslationContext } from "./translationContext.js";
|
|
2
2
|
const TranslationContextProvider = TranslationContext.Provider;
|
|
3
3
|
export { useTranslation } from "./useTranslation.js";
|
|
4
|
+
export { pgettext, t, tn } from "./translate.js";
|
|
4
5
|
export { TranslationContextProvider };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export interface Translation {
|
|
3
|
+
pgettext: (context: string, message: string) => string;
|
|
4
|
+
t: (message: string, ...args: Array<React.ReactNode | Record<string, React.ReactNode>>) => string;
|
|
5
|
+
tn: (singular: string, plural: string, count: number) => string;
|
|
6
|
+
}
|
|
7
|
+
export declare const t: Translation['t'];
|
|
8
|
+
export declare const tn: Translation['tn'];
|
|
9
|
+
export declare const pgettext: Translation['pgettext'];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { getSnapshot } from "../dateTime/config.js";
|
|
2
|
+
const t = (message, ...args)=>getSnapshot().messages.t(message, ...args);
|
|
3
|
+
const tn = (singular, plural, count)=>getSnapshot().messages.tn(singular, plural, count);
|
|
4
|
+
const pgettext = (context, message)=>getSnapshot().messages.pgettext(context, message);
|
|
5
|
+
export { pgettext, t, tn };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
|
+
import { type Translation } from './translate.js';
|
|
2
3
|
export type TranslationContextValue = {
|
|
3
|
-
t:
|
|
4
|
+
t: Translation['t'];
|
|
4
5
|
tct: (template: string, components: Record<string, React.ReactNode>) => React.ReactNode;
|
|
5
6
|
};
|
|
6
7
|
export declare const TranslationContext: React.Context<TranslationContextValue>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook that updates when a media query result changes.
|
|
3
|
+
*
|
|
4
|
+
* Prefer this only for genuine media features that aren't container-expressible
|
|
5
|
+
* — e.g. `(prefers-color-scheme: ...)`, `(hover: ...)`, `(pointer: ...)`,
|
|
6
|
+
* `(max-height: ...)`, `(resolution: ...)`.
|
|
7
|
+
*
|
|
8
|
+
* For width-based checks, prefer scraps responsive props — bare breakpoint
|
|
9
|
+
* keys react to the nearest container (`<Flex direction={{xs: 'column'}} />`),
|
|
10
|
+
* `screen:`-prefixed keys to the viewport — or, when you need the resolved
|
|
11
|
+
* value in JS, `useContainerBreakpoint()` from `@sentry/scraps/layout`.
|
|
12
|
+
* Those react to an element's available space rather than the raw viewport,
|
|
13
|
+
* which is almost always what width checks actually want.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useMedia(query: string): boolean;
|
package/dist/useMedia.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
function useMedia(query) {
|
|
3
|
+
const [state, setState] = useState(()=>window.matchMedia?.(query)?.matches);
|
|
4
|
+
useEffect(()=>{
|
|
5
|
+
let mounted = true;
|
|
6
|
+
if (!window.matchMedia) return;
|
|
7
|
+
const mql = window.matchMedia(query);
|
|
8
|
+
const onChange = ()=>{
|
|
9
|
+
if (!mounted) return;
|
|
10
|
+
setState(!!mql.matches);
|
|
11
|
+
};
|
|
12
|
+
mql.addEventListener('change', onChange);
|
|
13
|
+
setState(mql.matches);
|
|
14
|
+
return ()=>{
|
|
15
|
+
mounted = false;
|
|
16
|
+
mql.removeEventListener('change', onChange);
|
|
17
|
+
};
|
|
18
|
+
}, [
|
|
19
|
+
query
|
|
20
|
+
]);
|
|
21
|
+
if (!window.matchMedia) return false;
|
|
22
|
+
return state;
|
|
23
|
+
}
|
|
24
|
+
export { useMedia };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
function useOnClickOutside(ref, handler) {
|
|
3
|
+
useLayoutEffect(()=>{
|
|
4
|
+
const listener = (event)=>{
|
|
5
|
+
if (!ref) return;
|
|
6
|
+
let el;
|
|
7
|
+
el = 'current' in ref ? ref.current : ref;
|
|
8
|
+
if (!el || el.contains(event.target)) return;
|
|
9
|
+
handler(event);
|
|
10
|
+
};
|
|
11
|
+
document.addEventListener('mousedown', listener);
|
|
12
|
+
document.addEventListener('touchstart', listener);
|
|
13
|
+
return ()=>{
|
|
14
|
+
document.removeEventListener('mousedown', listener);
|
|
15
|
+
document.removeEventListener('touchstart', listener);
|
|
16
|
+
};
|
|
17
|
+
}, [
|
|
18
|
+
ref,
|
|
19
|
+
handler
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
export { useOnClickOutside };
|
package/dist/useOverlay.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ interface UseOverlayResult {
|
|
|
63
63
|
};
|
|
64
64
|
isOpen: boolean;
|
|
65
65
|
overlayProps: ReturnType<typeof useOverlayTriggerAria>['overlayProps'] & ReturnType<typeof useOverlayAria>['overlayProps'] & {
|
|
66
|
+
'data-overlay-root': '';
|
|
66
67
|
ref: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;
|
|
67
68
|
style: React.CSSProperties | undefined;
|
|
68
69
|
};
|
package/dist/useOverlay.js
CHANGED
|
@@ -206,6 +206,7 @@ function useOverlay_useOverlay({ isOpen, onClose, defaultOpen, onOpenChange, typ
|
|
|
206
206
|
overlayProps: {
|
|
207
207
|
ref: setOverlayElement,
|
|
208
208
|
style: overlayStyle,
|
|
209
|
+
'data-overlay-root': '',
|
|
209
210
|
...mergeProps(overlayTriggerAriaProps, overlayAriaProps)
|
|
210
211
|
},
|
|
211
212
|
arrowProps: {
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { Key, Node } from '@react-types/shared';
|
|
3
|
+
import type { FormSize } from './theme/index.js';
|
|
4
|
+
export { estimateRowHeight, isAfterFirstInSection } from './virtualCollectionLayout.js';
|
|
5
|
+
/**
|
|
6
|
+
* Item count above which shared menu controls (CompactSelect, DropdownMenu)
|
|
7
|
+
* virtualize their list.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_VIRTUALIZE_THRESHOLD = 150;
|
|
10
|
+
/**
|
|
11
|
+
* Lists a collection's nodes in the order `useVirtualCollection` renders them:
|
|
12
|
+
* each section is followed by its child nodes, so a long section is windowed
|
|
13
|
+
* like any other run of rows instead of mounting all at once. Nodes in
|
|
14
|
+
* `hiddenKeys` are left out, whether they are sections, their children or
|
|
15
|
+
* top-level items.
|
|
16
|
+
*/
|
|
17
|
+
export declare function flattenSections<T>(nodes: Iterable<Node<T>>, hiddenKeys?: ReadonlySet<Key>): Array<Node<T>>;
|
|
18
|
+
/** Props for the element that renders a row. Spread them onto the row's root element. */
|
|
19
|
+
export interface VirtualRowProps {
|
|
20
|
+
'data-index': number;
|
|
21
|
+
ref: (element: Element | null) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface VirtualRow<T> {
|
|
24
|
+
node: Node<T>;
|
|
25
|
+
/** Undefined when virtualization is disabled. */
|
|
26
|
+
props: VirtualRowProps | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Height of the unmounted rows between this row and the previous one. Render
|
|
29
|
+
* a `VirtualSpacer` of this height before the row. Usually only the first
|
|
30
|
+
* row has space before it, but the focused row stays mounted when it scrolls
|
|
31
|
+
* out of view, so there can be a gap on either side of it.
|
|
32
|
+
*/
|
|
33
|
+
spaceBefore: number;
|
|
34
|
+
}
|
|
35
|
+
export interface UseVirtualCollectionOptions<T> {
|
|
36
|
+
/**
|
|
37
|
+
* The collection's top-level nodes, such as a React Aria `state.collection`.
|
|
38
|
+
* Each section's child nodes are windowed as rows of their own, see
|
|
39
|
+
* `flattenSections`.
|
|
40
|
+
*/
|
|
41
|
+
collection: Iterable<Node<T>>;
|
|
42
|
+
/** Whether to virtualize. When false, every node is returned as a row. */
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The element that scrolls. Rows and spacers must render inside it.
|
|
46
|
+
*/
|
|
47
|
+
scrollRef: React.RefObject<HTMLElement | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Height to assume for a row that has not been measured yet. Read on every
|
|
50
|
+
* render, so it does not need to be stable. Defaults to the height of a menu
|
|
51
|
+
* `ListItem` of `size`, plus `sectionRowSpace`.
|
|
52
|
+
*/
|
|
53
|
+
estimateSize?: (node: Node<T>, index: number) => number;
|
|
54
|
+
/**
|
|
55
|
+
* The collection's focused key. When it changes through the keyboard, the
|
|
56
|
+
* row is scrolled into view so it mounts and React Aria can focus it. The
|
|
57
|
+
* focused row also stays mounted while it is scrolled out of view, so it
|
|
58
|
+
* keeps DOM focus and the keyboard keeps working.
|
|
59
|
+
*/
|
|
60
|
+
focusedKey?: Key | null;
|
|
61
|
+
/** Keys of nodes to leave out, whether they are sections, their children or top-level items. */
|
|
62
|
+
hiddenKeys?: ReadonlySet<Key>;
|
|
63
|
+
/**
|
|
64
|
+
* Vertical CSS padding (px) of the list, at each end. The first row starts
|
|
65
|
+
* below it, and rows scrolled into view keep clear of it.
|
|
66
|
+
*/
|
|
67
|
+
listPadding?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Space (px) above each row in a section except the first, if the rows are
|
|
70
|
+
* spaced that way. The virtualizer measures a row's border box, so the space
|
|
71
|
+
* must be padding on the row's own element for mounted rows to keep it. A
|
|
72
|
+
* margin, or a gap on the list, is not part of a measured row: the rows would
|
|
73
|
+
* lose it once they mount and the scroll range would shrink. Added to the
|
|
74
|
+
* estimates of unmounted rows so the range does not shrink until they mount.
|
|
75
|
+
*/
|
|
76
|
+
sectionRowSpace?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Item size of the default `estimateSize`. Defaults to `md`. Changing it, or
|
|
79
|
+
* `sectionRowSpace`, discards the measured row heights, since every row
|
|
80
|
+
* changes height. Pass it with a custom `estimateSize` too.
|
|
81
|
+
*/
|
|
82
|
+
size?: FormSize;
|
|
83
|
+
/**
|
|
84
|
+
* A row to keep mounted wherever the list is scrolled, such as the one with
|
|
85
|
+
* the longest label. A list that sizes its width to its content is then as
|
|
86
|
+
* wide as that row from the start, instead of widening as wider rows scroll
|
|
87
|
+
* into view.
|
|
88
|
+
*/
|
|
89
|
+
widestKey?: Key | null;
|
|
90
|
+
}
|
|
91
|
+
/** The result of `useVirtualCollection`. Render it with `VirtualRows`. */
|
|
92
|
+
export interface VirtualCollection<T> {
|
|
93
|
+
/** The rows to render, in order: every node, or the mounted ones when virtualized. */
|
|
94
|
+
rows: Array<VirtualRow<T>>;
|
|
95
|
+
/** Height of the unmounted rows after the last mounted one. */
|
|
96
|
+
spaceAfter: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Windows a React Aria collection so only the rows near the viewport mount.
|
|
100
|
+
*
|
|
101
|
+
* It owns layout only, never selection or focus. Callers keep their React Aria
|
|
102
|
+
* state and render the rows with `VirtualRows`, which puts each row in its
|
|
103
|
+
* section and fills the space of the unmounted rows:
|
|
104
|
+
*
|
|
105
|
+
* ```tsx
|
|
106
|
+
* const virtual = useVirtualCollection({
|
|
107
|
+
* collection: state.collection,
|
|
108
|
+
* enabled,
|
|
109
|
+
* size,
|
|
110
|
+
* scrollRef,
|
|
111
|
+
* focusedKey: state.selectionManager.focusedKey,
|
|
112
|
+
* });
|
|
113
|
+
* <ul ref={scrollRef}>
|
|
114
|
+
* <VirtualRows
|
|
115
|
+
* virtual={virtual}
|
|
116
|
+
* renderRow={({node, props}) => <Option {...props} node={node} />}
|
|
117
|
+
* renderSection={({node, props}, rows) => (
|
|
118
|
+
* <Section rowProps={props} node={node}>{rows}</Section>
|
|
119
|
+
* )}
|
|
120
|
+
* />
|
|
121
|
+
* </ul>
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* Spacers keep the list's own element and padding intact, so a virtualized
|
|
125
|
+
* list has the same DOM structure and styling as a regular one.
|
|
126
|
+
*/
|
|
127
|
+
export declare function useVirtualCollection<T>({ collection, enabled, scrollRef, estimateSize, focusedKey, hiddenKeys, listPadding, sectionRowSpace, size, widestKey, }: UseVirtualCollectionOptions<T>): VirtualCollection<T>;
|
|
128
|
+
interface VirtualRowsProps<T> {
|
|
129
|
+
/**
|
|
130
|
+
* Renders an item row. Spread `props` onto the element that is the row's
|
|
131
|
+
* height, so the virtualizer can measure it.
|
|
132
|
+
*
|
|
133
|
+
* The list re-renders on every scroll, and `props` is a new object each time.
|
|
134
|
+
* To let a row that did not change skip rendering, pass the row component
|
|
135
|
+
* `props['data-index']` and `props.ref` as separate props, which keep their
|
|
136
|
+
* identity, and rebuild the object inside it.
|
|
137
|
+
*/
|
|
138
|
+
renderRow: (row: VirtualRow<T>) => React.ReactNode;
|
|
139
|
+
/** The result of `useVirtualCollection`. */
|
|
140
|
+
virtual: VirtualCollection<T>;
|
|
141
|
+
/**
|
|
142
|
+
* Renders a section around its rendered rows. Spread the section's `props`
|
|
143
|
+
* onto the element above its rows, such as the one holding its header.
|
|
144
|
+
* Required when the collection has sections; by default only the rows render.
|
|
145
|
+
*/
|
|
146
|
+
renderSection?: (section: VirtualRow<T>, rows: React.ReactNode) => React.ReactNode;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Renders the rows of `useVirtualCollection`, with each row inside its section
|
|
150
|
+
* and spacers in place of the unmounted rows. Render it inside the scroll
|
|
151
|
+
* element. Rows outside sections stay siblings, so they keep their elements
|
|
152
|
+
* when the list reorders.
|
|
153
|
+
*/
|
|
154
|
+
export declare function VirtualRows<T>({ virtual, renderRow, renderSection, }: VirtualRowsProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
|