@sentry/scraps 0.3.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/layout/styles.d.ts +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/controlContext.d.ts +32 -0
- package/dist/menu/controlContext.js +7 -0
- package/dist/menu/dropdownButton.d.ts +18 -0
- package/dist/menu/dropdownButton.js +66 -0
- package/dist/menu/index.d.ts +7 -0
- package/dist/menu/index.js +3 -0
- package/dist/menu/menu.d.ts +167 -0
- package/dist/menu/menu.js +568 -0
- package/dist/menu/selectTypes.d.ts +96 -0
- package/dist/menu/selectTypes.js +0 -0
- package/dist/menu/selectValue.d.ts +13 -0
- package/dist/menu/selectValue.js +0 -0
- 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/overlayTrigger.d.ts +22 -0
- package/dist/overlayTrigger.js +30 -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/slot/knownContexts.d.ts +1 -1
- package/dist/spinner/index.d.ts +1 -0
- package/dist/spinner/index.js +1 -0
- package/dist/spinner/spinner.d.ts +14 -0
- package/dist/spinner/spinner.js +126 -0
- package/dist/splitPanel/index.d.ts +1 -0
- package/dist/splitPanel/index.js +1 -0
- package/dist/splitPanel/splitPanel.d.ts +38 -0
- package/dist/splitPanel/splitPanel.js +145 -0
- 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/toast/index.d.ts +5 -0
- package/dist/toast/index.js +4 -0
- package/dist/toast/toast.d.ts +10 -0
- package/dist/toast/toast.js +182 -0
- package/dist/toast/toastApi.d.ts +10 -0
- package/dist/toast/toastApi.js +53 -0
- package/dist/toast/toaster.d.ts +4 -0
- package/dist/toast/toaster.js +42 -0
- package/dist/toast/types.d.ts +17 -0
- package/dist/toast/types.js +2 -0
- package/dist/toggleCard/index.d.ts +1 -0
- package/dist/toggleCard/index.js +1 -0
- package/dist/toggleCard/toggleCard.d.ts +32 -0
- package/dist/toggleCard/toggleCard.js +301 -0
- package/dist/tooltip/tooltip.js +2 -5
- package/dist/useDimensions.d.ts +12 -0
- package/dist/useDimensions.js +31 -0
- 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/useResizableDrawer.d.ts +72 -0
- package/dist/useResizableDrawer.js +136 -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 +148 -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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ModalBoundaryProps } from './modal/types.js';
|
|
3
|
+
export interface OverlayLocation {
|
|
4
|
+
pathname: string;
|
|
5
|
+
query: Record<string, string | string[] | null | undefined>;
|
|
6
|
+
hash?: string;
|
|
7
|
+
search?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DrawerWidthStorage {
|
|
10
|
+
get: (key: string) => number | undefined;
|
|
11
|
+
set: (key: string, widthPercent: number) => void;
|
|
12
|
+
subscribe: (key: string, listener: () => void) => () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface OverlayContextValue {
|
|
15
|
+
/** Offset below app chrome for left and passive panels. */
|
|
16
|
+
contentTop?: string;
|
|
17
|
+
drawer?: {
|
|
18
|
+
boundaryComponent?: React.ComponentType<React.PropsWithChildren>;
|
|
19
|
+
widthStorage?: DrawerWidthStorage;
|
|
20
|
+
};
|
|
21
|
+
headerHeight?: string;
|
|
22
|
+
location?: OverlayLocation;
|
|
23
|
+
modal?: {
|
|
24
|
+
boundaryComponent?: React.ComponentType<ModalBoundaryProps>;
|
|
25
|
+
getAppElement?: () => HTMLElement | null;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare const OverlayContextProvider: React.Provider<OverlayContextValue>;
|
|
29
|
+
export declare function useOverlayContext(): OverlayContextValue;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
const OverlayContext = /*#__PURE__*/ createContext({});
|
|
3
|
+
const OverlayContextProvider = OverlayContext.Provider;
|
|
4
|
+
function useOverlayContext() {
|
|
5
|
+
return useContext(OverlayContext);
|
|
6
|
+
}
|
|
7
|
+
export { OverlayContextProvider, useOverlayContext };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { DistributedOmit, SetRequired } from 'type-fest';
|
|
3
|
+
import { type DropdownButtonProps } from './menu/dropdownButton.js';
|
|
4
|
+
type TriggerEl = HTMLButtonElement | (Omit<HTMLButtonElement, 'ELEMENT_NODE'> & {
|
|
5
|
+
ELEMENT_NODE: 'only use `OverlayTrigger.Button` or `OverlayTrigger.IconButton` for the trigger prop!';
|
|
6
|
+
});
|
|
7
|
+
export type TriggerProps = Omit<React.HTMLAttributes<TriggerEl>, 'children'> & {
|
|
8
|
+
children: NonNullable<React.ReactNode>;
|
|
9
|
+
ref?: React.Ref<TriggerEl>;
|
|
10
|
+
};
|
|
11
|
+
export type OverlayTriggerButtonProps = DistributedOmit<DropdownButtonProps, 'ref' | 'children' | 'onClick'> & {
|
|
12
|
+
children: NonNullable<React.ReactNode>;
|
|
13
|
+
ref?: React.Ref<TriggerEl> | React.Ref<HTMLButtonElement>;
|
|
14
|
+
};
|
|
15
|
+
export type OverlayTriggerIconButtonProps = SetRequired<DistributedOmit<DropdownButtonProps, 'ref' | 'showChevron' | 'onClick'>, 'aria-label' | 'icon'> & {
|
|
16
|
+
ref?: React.Ref<TriggerEl> | React.Ref<HTMLButtonElement>;
|
|
17
|
+
};
|
|
18
|
+
export declare const OverlayTrigger: {
|
|
19
|
+
Button({ ref, ...props }: OverlayTriggerButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
20
|
+
IconButton({ ref, children: _, ...props }: OverlayTriggerIconButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { ControlContext } from "./menu/controlContext.js";
|
|
3
|
+
import { DropdownButton } from "./menu/dropdownButton.js";
|
|
4
|
+
import * as __rspack_external_react from "react";
|
|
5
|
+
const useContextProps = ()=>{
|
|
6
|
+
const selectContext = __rspack_external_react.useContext(ControlContext);
|
|
7
|
+
return {
|
|
8
|
+
size: selectContext.size,
|
|
9
|
+
isOpen: selectContext.overlayIsOpen,
|
|
10
|
+
disabled: selectContext.disabled
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const OverlayTrigger = {
|
|
14
|
+
Button ({ ref, ...props }) {
|
|
15
|
+
return /*#__PURE__*/ jsx(DropdownButton, {
|
|
16
|
+
...useContextProps(),
|
|
17
|
+
...props,
|
|
18
|
+
ref: ref
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
IconButton ({ ref, children: _, ...props }) {
|
|
22
|
+
return /*#__PURE__*/ jsx(DropdownButton, {
|
|
23
|
+
...useContextProps(),
|
|
24
|
+
...props,
|
|
25
|
+
showChevron: false,
|
|
26
|
+
ref: ref
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export { OverlayTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination, PaginationBehaviorContextProvider, type PaginationProps, type PaginationPage, type CursorHandler, } from './pagination.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination, PaginationBehaviorContextProvider } from "./pagination.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type ButtonProps } from '../button/index.js';
|
|
3
|
+
export type CursorHandler = (cursor: string | undefined, delta: -1 | 1) => void;
|
|
4
|
+
/** Opaque cursor and availability supplied by the consumer. */
|
|
5
|
+
export interface PaginationPage {
|
|
6
|
+
cursor?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PaginationProps {
|
|
10
|
+
caption?: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
next?: PaginationPage;
|
|
14
|
+
/** Override the configured navigation for this pagination instance. */
|
|
15
|
+
onCursor?: CursorHandler;
|
|
16
|
+
/** Observe page changes without overriding the configured navigation. */
|
|
17
|
+
onPageChange?: CursorHandler;
|
|
18
|
+
previous?: PaginationPage;
|
|
19
|
+
size?: ButtonProps['size'];
|
|
20
|
+
}
|
|
21
|
+
/** Supply default cursor navigation while individual instances can override it. */
|
|
22
|
+
export declare const PaginationBehaviorContextProvider: React.Provider<CursorHandler | undefined>;
|
|
23
|
+
/** Cursor formats and navigation belong to consumers. */
|
|
24
|
+
export declare function Pagination({ className, onCursor, onPageChange, previous, next, size, caption, disabled, }: PaginationProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
import { IconChevron } from "@sentry/icons/chevron";
|
|
5
|
+
import { Button, ButtonBar } from "../button/index.js";
|
|
6
|
+
import { Flex } from "../layout/index.js";
|
|
7
|
+
import { useTranslation } from "../translation/useTranslation.js";
|
|
8
|
+
const PaginationBehaviorContext = /*#__PURE__*/ createContext(void 0);
|
|
9
|
+
const PaginationBehaviorContextProvider = PaginationBehaviorContext.Provider;
|
|
10
|
+
function Pagination({ className, onCursor, onPageChange, previous, next, size = 'sm', caption, disabled = false }) {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const defaultOnCursor = useContext(PaginationBehaviorContext);
|
|
13
|
+
const handleCursor = onCursor ?? defaultOnCursor;
|
|
14
|
+
if (void 0 === previous && void 0 === next) return null;
|
|
15
|
+
const previousDisabled = disabled || !handleCursor || void 0 === previous || true === previous.disabled;
|
|
16
|
+
const nextDisabled = disabled || !handleCursor || void 0 === next || true === next.disabled;
|
|
17
|
+
return /*#__PURE__*/ jsxs(Flex, {
|
|
18
|
+
justify: "end",
|
|
19
|
+
align: "center",
|
|
20
|
+
margin: "2xl 0 0 0",
|
|
21
|
+
className: className,
|
|
22
|
+
"data-test-id": "pagination",
|
|
23
|
+
children: [
|
|
24
|
+
caption && /*#__PURE__*/ jsx(PaginationCaption, {
|
|
25
|
+
children: caption
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ jsxs(ButtonBar, {
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ jsx(Button, {
|
|
30
|
+
icon: /*#__PURE__*/ jsx(IconChevron, {
|
|
31
|
+
direction: "left"
|
|
32
|
+
}),
|
|
33
|
+
"aria-label": t('Previous'),
|
|
34
|
+
size: size,
|
|
35
|
+
disabled: previousDisabled,
|
|
36
|
+
onClick: ()=>{
|
|
37
|
+
handleCursor?.(previous?.cursor, -1);
|
|
38
|
+
onPageChange?.(previous?.cursor, -1);
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ jsx(Button, {
|
|
42
|
+
icon: /*#__PURE__*/ jsx(IconChevron, {
|
|
43
|
+
direction: "right"
|
|
44
|
+
}),
|
|
45
|
+
"aria-label": t('Next'),
|
|
46
|
+
size: size,
|
|
47
|
+
disabled: nextDisabled,
|
|
48
|
+
onClick: ()=>{
|
|
49
|
+
handleCursor?.(next?.cursor, 1);
|
|
50
|
+
onPageChange?.(next?.cursor, 1);
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const PaginationCaption = styled('span')`
|
|
59
|
+
color: ${(p)=>p.theme.tokens.content.secondary};
|
|
60
|
+
font-size: ${(p)=>p.theme.font.size.md};
|
|
61
|
+
margin-right: ${(p)=>p.theme.space.xl};
|
|
62
|
+
`;
|
|
63
|
+
export { Pagination, PaginationBehaviorContextProvider };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { PictureInPictureProvider, usePictureInPicture, type PictureInPictureProviderProps, type PictureInPictureContextValue, type RequestPipWindowOptions, } from './pictureInPicture.js';
|
|
2
|
+
export { PictureInPicturePortal, type PictureInPicturePortalProps, } from './pictureInPicturePortal.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface RequestPipWindowOptions {
|
|
3
|
+
height?: number;
|
|
4
|
+
/**
|
|
5
|
+
* Opens at the browser's default placement instead of remembering where the
|
|
6
|
+
* window was last positioned. Useful to avoid the window reappearing far from
|
|
7
|
+
* where it was triggered.
|
|
8
|
+
*/
|
|
9
|
+
preferInitialWindowPlacement?: boolean;
|
|
10
|
+
width?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface PictureInPictureContextValue {
|
|
13
|
+
/**
|
|
14
|
+
* Closes the picture-in-picture window if one is open. Idempotent.
|
|
15
|
+
*/
|
|
16
|
+
closePipWindow: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the Document Picture-in-Picture API is available in this browser.
|
|
19
|
+
*/
|
|
20
|
+
isSupported: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The currently open picture-in-picture window, or null. Watch this value to
|
|
23
|
+
* react to the window being closed (by the user or programmatically).
|
|
24
|
+
*/
|
|
25
|
+
pipWindow: Window | null;
|
|
26
|
+
/**
|
|
27
|
+
* Opens a picture-in-picture window. Must be called from a user gesture (e.g.
|
|
28
|
+
* a click handler) — the API requires transient activation.
|
|
29
|
+
*/
|
|
30
|
+
requestPipWindow: (options?: RequestPipWindowOptions) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Owns the single Document Picture-in-Picture window for the tab (the API allows
|
|
34
|
+
* only one PiP window per browser tab). Provides it through context so any
|
|
35
|
+
* component can open, close, or render into it via `usePictureInPicture`.
|
|
36
|
+
*
|
|
37
|
+
* Pair with `PictureInPicturePortal` to render React content into the window.
|
|
38
|
+
*/
|
|
39
|
+
export interface PictureInPictureProviderProps {
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
/** Configure a newly opened window before its content mounts. */
|
|
42
|
+
onWindowOpen?: (pipWindow: Window) => void;
|
|
43
|
+
/** Additional portal content, such as application-wide styles or window effects. */
|
|
44
|
+
renderPortalContent?: (pipWindow: Window) => ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export declare function PictureInPictureProvider({ children, onWindowOpen, renderPortalContent, }: PictureInPictureProviderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function usePictureInPicture(): PictureInPictureContextValue;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { PictureInPicturePortalContext } from "./portalContext.js";
|
|
4
|
+
const PictureInPictureContext = /*#__PURE__*/ createContext(null);
|
|
5
|
+
const NON_RELATIVE_URL = /^(?:[a-z][a-z0-9+.-]*:|\/\/|#)/i;
|
|
6
|
+
function resolveCssUrls(cssText, baseHref) {
|
|
7
|
+
return cssText.replace(/url\((['"]?)([^'")]*)\1\)/g, (match, quote, url)=>{
|
|
8
|
+
if (!url || NON_RELATIVE_URL.test(url)) return match;
|
|
9
|
+
try {
|
|
10
|
+
return `url(${quote}${new URL(url, baseHref).href}${quote})`;
|
|
11
|
+
} catch {
|
|
12
|
+
return match;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function copyStyles(source, target) {
|
|
17
|
+
for (const sheet of Array.from(source.styleSheets)){
|
|
18
|
+
const owner = sheet.ownerNode;
|
|
19
|
+
if (!(owner instanceof HTMLStyleElement) || !owner.dataset.emotion) try {
|
|
20
|
+
const cssText = Array.from(sheet.cssRules).map((rule)=>rule.cssText).join('');
|
|
21
|
+
const style = target.document.createElement('style');
|
|
22
|
+
style.textContent = resolveCssUrls(cssText, sheet.href ?? source.baseURI);
|
|
23
|
+
target.document.head.appendChild(style);
|
|
24
|
+
} catch {
|
|
25
|
+
if (owner) target.document.head.appendChild(owner.cloneNode(true));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function PictureInPictureProvider({ children, onWindowOpen, renderPortalContent }) {
|
|
30
|
+
const [pipWindow, setPipWindow] = useState(null);
|
|
31
|
+
const documentPictureInPicture = "u" > typeof window && 'documentPictureInPicture' in window ? window.documentPictureInPicture : null;
|
|
32
|
+
const pipWindowRef = useRef(null);
|
|
33
|
+
const handleClose = useCallback(()=>{
|
|
34
|
+
pipWindowRef.current = null;
|
|
35
|
+
setPipWindow(null);
|
|
36
|
+
}, []);
|
|
37
|
+
const requestPipWindow = useCallback(async ({ width, height, preferInitialWindowPlacement } = {})=>{
|
|
38
|
+
if (!documentPictureInPicture) return;
|
|
39
|
+
if (pipWindowRef.current && !pipWindowRef.current.closed) return;
|
|
40
|
+
const pip = await documentPictureInPicture.requestWindow({
|
|
41
|
+
width,
|
|
42
|
+
height,
|
|
43
|
+
preferInitialWindowPlacement
|
|
44
|
+
});
|
|
45
|
+
try {
|
|
46
|
+
copyStyles(document, pip);
|
|
47
|
+
onWindowOpen?.(pip);
|
|
48
|
+
pip.addEventListener('pagehide', handleClose, {
|
|
49
|
+
once: true
|
|
50
|
+
});
|
|
51
|
+
pipWindowRef.current = pip;
|
|
52
|
+
setPipWindow(pip);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
pip.close();
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
}, [
|
|
58
|
+
documentPictureInPicture,
|
|
59
|
+
handleClose,
|
|
60
|
+
onWindowOpen
|
|
61
|
+
]);
|
|
62
|
+
const closePipWindow = useCallback(()=>{
|
|
63
|
+
const pip = pipWindowRef.current;
|
|
64
|
+
if (pip && !pip.closed) pip.close();
|
|
65
|
+
}, []);
|
|
66
|
+
useEffect(()=>()=>{
|
|
67
|
+
const pip = pipWindowRef.current;
|
|
68
|
+
if (pip && !pip.closed) {
|
|
69
|
+
pip.removeEventListener('pagehide', handleClose);
|
|
70
|
+
pip.close();
|
|
71
|
+
}
|
|
72
|
+
pipWindowRef.current = null;
|
|
73
|
+
}, [
|
|
74
|
+
handleClose
|
|
75
|
+
]);
|
|
76
|
+
const value = useMemo(()=>({
|
|
77
|
+
pipWindow,
|
|
78
|
+
isSupported: !!documentPictureInPicture,
|
|
79
|
+
requestPipWindow,
|
|
80
|
+
closePipWindow
|
|
81
|
+
}), [
|
|
82
|
+
pipWindow,
|
|
83
|
+
documentPictureInPicture,
|
|
84
|
+
requestPipWindow,
|
|
85
|
+
closePipWindow
|
|
86
|
+
]);
|
|
87
|
+
return /*#__PURE__*/ jsx(PictureInPictureContext.Provider, {
|
|
88
|
+
value: value,
|
|
89
|
+
children: /*#__PURE__*/ jsx(PictureInPicturePortalContext, {
|
|
90
|
+
value: renderPortalContent,
|
|
91
|
+
children: children
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function usePictureInPicture() {
|
|
96
|
+
const context = useContext(PictureInPictureContext);
|
|
97
|
+
if (!context) throw new Error('usePictureInPicture must be used within a PictureInPictureProvider');
|
|
98
|
+
return context;
|
|
99
|
+
}
|
|
100
|
+
export { PictureInPictureProvider, usePictureInPicture };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export interface PictureInPicturePortalProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* The picture-in-picture window to render into. Obtain one via
|
|
6
|
+
* `usePictureInPicture`.
|
|
7
|
+
*/
|
|
8
|
+
pipWindow: Window;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Renders children into a Document Picture-in-Picture window with the full
|
|
12
|
+
* styling context wired up: a PiP-scoped emotion cache, the theme,
|
|
13
|
+
* and a tooltip container override so overlays render in the PiP window
|
|
14
|
+
* rather than the main one.
|
|
15
|
+
*/
|
|
16
|
+
export declare function PictureInPicturePortal({ children, pipWindow, }: PictureInPicturePortalProps): React.ReactPortal;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useContext, useEffect, useMemo } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import _emotion_cache from "@emotion/cache";
|
|
5
|
+
import { CacheProvider, ThemeProvider, useTheme } from "@emotion/react";
|
|
6
|
+
import { TooltipContext } from "../tooltip/index.js";
|
|
7
|
+
import { PictureInPicturePortalContext } from "./portalContext.js";
|
|
8
|
+
function PictureInPicturePortal({ children, pipWindow }) {
|
|
9
|
+
const theme = useTheme();
|
|
10
|
+
const renderPortalContent = useContext(PictureInPicturePortalContext);
|
|
11
|
+
const cache = useMemo(()=>{
|
|
12
|
+
const pipCache = _emotion_cache({
|
|
13
|
+
key: 'scraps-pip',
|
|
14
|
+
container: pipWindow.document.head,
|
|
15
|
+
stylisPlugins: []
|
|
16
|
+
});
|
|
17
|
+
pipCache.compat = true;
|
|
18
|
+
return pipCache;
|
|
19
|
+
}, [
|
|
20
|
+
pipWindow
|
|
21
|
+
]);
|
|
22
|
+
useEffect(()=>{
|
|
23
|
+
const { documentElement, body } = pipWindow.document;
|
|
24
|
+
documentElement.style.height = '100%';
|
|
25
|
+
body.style.height = '100%';
|
|
26
|
+
body.style.margin = '0';
|
|
27
|
+
}, [
|
|
28
|
+
pipWindow
|
|
29
|
+
]);
|
|
30
|
+
return /*#__PURE__*/ createPortal(/*#__PURE__*/ jsx(CacheProvider, {
|
|
31
|
+
value: cache,
|
|
32
|
+
children: /*#__PURE__*/ jsx(ThemeProvider, {
|
|
33
|
+
theme: theme,
|
|
34
|
+
children: /*#__PURE__*/ jsxs(TooltipContext, {
|
|
35
|
+
value: {
|
|
36
|
+
container: pipWindow.document.body
|
|
37
|
+
},
|
|
38
|
+
children: [
|
|
39
|
+
renderPortalContent?.(pipWindow),
|
|
40
|
+
children
|
|
41
|
+
]
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
}), pipWindow.document.body);
|
|
45
|
+
}
|
|
46
|
+
export { PictureInPicturePortal };
|
|
@@ -7,7 +7,7 @@ import { Item, useCollection } from "@react-stately/collections";
|
|
|
7
7
|
import { ListCollection } from "@react-stately/list";
|
|
8
8
|
import { useRadioGroupState } from "@react-stately/radio";
|
|
9
9
|
import { LayoutGroup } from "framer-motion";
|
|
10
|
-
import { DO_NOT_USE_getButtonStyles } from "../button/
|
|
10
|
+
import { DO_NOT_USE_getButtonStyles } from "../button/styles.js";
|
|
11
11
|
import { Tooltip } from "../tooltip/index.js";
|
|
12
12
|
const getChildTransforms = (count)=>Array.from({
|
|
13
13
|
length: count
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createFilter } from "./reactSelectWrapper.js";
|
|
2
|
+
function filter_createFilter(config) {
|
|
3
|
+
const filter = createFilter({
|
|
4
|
+
stringify: ({ data })=>config?.stringify(data) ?? data.textValue ?? `${'string' == typeof data.label || 'number' == typeof data.label ? data.label : ''} ${data.value}`
|
|
5
|
+
});
|
|
6
|
+
return (option, input)=>filter({
|
|
7
|
+
data: option,
|
|
8
|
+
label: 'string' == typeof option.label ? option.label : '',
|
|
9
|
+
value: String(option.value)
|
|
10
|
+
}, input);
|
|
11
|
+
}
|
|
12
|
+
export { filter_createFilter as createFilter };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { components as selectComponents } from './reactSelectWrapper.js';
|
|
3
|
+
import type { BaseSelectProps } from './select.js';
|
|
4
|
+
import type { SelectValue } from './types.js';
|
|
5
|
+
type Props<TValue, TOption extends SelectValue<TValue>> = Omit<React.ComponentProps<typeof selectComponents.Option>, 'selectProps' | 'data'> & {
|
|
6
|
+
data: TOption & {
|
|
7
|
+
__isNew__?: boolean;
|
|
8
|
+
selectionMode?: 'single' | 'multiple';
|
|
9
|
+
};
|
|
10
|
+
selectProps: Pick<BaseSelectProps<TValue, TOption>, 'showCreateOptionIcon' | 'showDividers'> & {
|
|
11
|
+
contentComponents?: BaseSelectProps<TValue, TOption>['components'];
|
|
12
|
+
size?: BaseSelectProps<TValue, TOption>['size'];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function SelectOption<TValue, TOption extends SelectValue<TValue>>(props: Props<TValue, TOption>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { ClassNames } from "@emotion/react";
|
|
4
|
+
import styled from "@emotion/styled";
|
|
5
|
+
import { IconAdd } from "@sentry/icons/add";
|
|
6
|
+
import { IconCheckmark } from "@sentry/icons/checkmark";
|
|
7
|
+
import { ListItem } from "../menu/index.js";
|
|
8
|
+
import { CheckWrap } from "./styles.js";
|
|
9
|
+
function SelectOption(props) {
|
|
10
|
+
const { label, data, selectProps, isMulti, isSelected, isFocused, isDisabled, innerProps, innerRef } = props;
|
|
11
|
+
const { showDividers, size = 'md' } = selectProps;
|
|
12
|
+
const leadingItems = 'function' == typeof data.leadingItems ? data.leadingItems({
|
|
13
|
+
disabled: isDisabled,
|
|
14
|
+
isFocused,
|
|
15
|
+
isSelected
|
|
16
|
+
}) : data.leadingItems;
|
|
17
|
+
const OptionLabel = selectProps.contentComponents?.OptionLabel;
|
|
18
|
+
const renderedLabel = OptionLabel ? /*#__PURE__*/ jsx(OptionLabel, {
|
|
19
|
+
option: data
|
|
20
|
+
}) : label;
|
|
21
|
+
const { value, selectionMode, priority, ...itemProps } = data;
|
|
22
|
+
const isMultiple = null == selectionMode ? isMulti : 'multiple' === selectionMode;
|
|
23
|
+
const itemPriority = priority ?? 'default';
|
|
24
|
+
const innerWrapProps = {
|
|
25
|
+
'data-test-id': null == value ? void 0 : String(value)
|
|
26
|
+
};
|
|
27
|
+
return /*#__PURE__*/ jsx(ClassNames, {
|
|
28
|
+
children: ({ cx })=>/*#__PURE__*/ jsx(ListItem, {
|
|
29
|
+
...itemProps,
|
|
30
|
+
...innerProps,
|
|
31
|
+
role: isMultiple ? 'menuitemcheckbox' : 'menuitemradio',
|
|
32
|
+
'aria-checked': isSelected,
|
|
33
|
+
className: cx({
|
|
34
|
+
option: true,
|
|
35
|
+
'option--is-disabled': isDisabled,
|
|
36
|
+
'option--is-focused': isFocused,
|
|
37
|
+
'option--is-selected': isSelected
|
|
38
|
+
}),
|
|
39
|
+
value,
|
|
40
|
+
showDivider: showDividers,
|
|
41
|
+
ref: innerRef,
|
|
42
|
+
as: "div",
|
|
43
|
+
label: renderedLabel,
|
|
44
|
+
disabled: isDisabled,
|
|
45
|
+
isFocused: isFocused,
|
|
46
|
+
priority: itemPriority,
|
|
47
|
+
size: size,
|
|
48
|
+
innerWrapProps: innerWrapProps,
|
|
49
|
+
labelProps: {
|
|
50
|
+
as: 'string' == typeof renderedLabel ? 'p' : 'div'
|
|
51
|
+
},
|
|
52
|
+
leadingItems: itemProps.__isNew__ && false !== selectProps.showCreateOptionIcon ? /*#__PURE__*/ jsxs(Fragment, {
|
|
53
|
+
children: [
|
|
54
|
+
/*#__PURE__*/ jsx(IconAdd, {
|
|
55
|
+
size: "sm"
|
|
56
|
+
}),
|
|
57
|
+
leadingItems
|
|
58
|
+
]
|
|
59
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
60
|
+
children: [
|
|
61
|
+
/*#__PURE__*/ jsx(CheckWrap, {
|
|
62
|
+
isMultiple: isMultiple,
|
|
63
|
+
isSelected: isSelected,
|
|
64
|
+
size: size,
|
|
65
|
+
children: isSelected && /*#__PURE__*/ jsx(StyledIconCheckmark, {
|
|
66
|
+
size: isMultiple ? 'xs' : 'sm',
|
|
67
|
+
isMultiple: isMultiple
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
70
|
+
leadingItems
|
|
71
|
+
]
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const StyledIconCheckmark = styled(IconCheckmark, {
|
|
77
|
+
shouldForwardProp: (prop)=>'isMultiple' !== prop
|
|
78
|
+
})`
|
|
79
|
+
color: ${(p)=>p.isMultiple ? p.theme.colors.white : void 0};
|
|
80
|
+
`;
|
|
81
|
+
export { SelectOption };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ReactSelectModule, { components } from 'react-select';
|
|
2
|
+
import type CreatableComponent from 'react-select/creatable';
|
|
3
|
+
declare const ReactSelect: typeof ReactSelectModule;
|
|
4
|
+
declare const Creatable: typeof CreatableComponent;
|
|
5
|
+
declare const ReactSelectWrapper: typeof ReactSelect;
|
|
6
|
+
export { ReactSelectWrapper as ReactSelect, Creatable, components };
|
|
7
|
+
export { createFilter, mergeStyles } from 'react-select';
|
|
8
|
+
export type { NamedProps as Props, StylesConfig, OptionsType, ValueType, } from 'react-select';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import react_select, { components, createFilter, mergeStyles } from "react-select";
|
|
3
|
+
import react_select_cjs from "react-select/creatable/dist/react-select.cjs.js";
|
|
4
|
+
function unwrapDefault(value) {
|
|
5
|
+
return 'object' == typeof value && null !== value && 'default' in value ? value.default : value;
|
|
6
|
+
}
|
|
7
|
+
const ReactSelect = unwrapDefault(react_select);
|
|
8
|
+
const Creatable = unwrapDefault(react_select_cjs);
|
|
9
|
+
const reactSelectDefaultProps = {
|
|
10
|
+
...ReactSelect.defaultProps
|
|
11
|
+
};
|
|
12
|
+
ReactSelect.defaultProps = void 0;
|
|
13
|
+
components.MultiValue.defaultProps = void 0;
|
|
14
|
+
components.NoOptionsMessage.defaultProps = void 0;
|
|
15
|
+
components.LoadingMessage.defaultProps = void 0;
|
|
16
|
+
components.LoadingIndicator.defaultProps = void 0;
|
|
17
|
+
const ReactSelectWrapper = function({ ref, ...props }) {
|
|
18
|
+
return /*#__PURE__*/ jsx(ReactSelect, {
|
|
19
|
+
...reactSelectDefaultProps,
|
|
20
|
+
...props,
|
|
21
|
+
ref: ref,
|
|
22
|
+
menuPlacement: "auto"
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export { Creatable, ReactSelectWrapper as ReactSelect, components, createFilter, mergeStyles };
|