@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
|
@@ -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 };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { FormSize } from '../theme/index.js';
|
|
3
|
+
import type { SelectComponents, SelectHandle, SelectSelectionProps, SelectValue, StylesConfig } from './types.js';
|
|
4
|
+
/** Props shared by form fields and standalone selects. Implementation components stay private. */
|
|
5
|
+
export interface BaseSelectProps<TValue, TOption extends SelectValue<TValue> = SelectValue<TValue>> {
|
|
6
|
+
options: ReadonlyArray<(TOption & SelectValue<TValue>) | {
|
|
7
|
+
options: ReadonlyArray<TOption & SelectValue<TValue>>;
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
}>;
|
|
10
|
+
'aria-describedby'?: string;
|
|
11
|
+
'aria-invalid'?: boolean;
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
'aria-labelledby'?: string;
|
|
14
|
+
autoFocus?: boolean;
|
|
15
|
+
/** Blur after selection. Defaults to true for single selects, false for multiple. */
|
|
16
|
+
blurInputOnSelect?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Customize content while Select retains input, option, and chip behavior. */
|
|
19
|
+
components?: SelectComponents<TOption>;
|
|
20
|
+
/** Content inside the control, before the selected value and input. */
|
|
21
|
+
controlLeadingItems?: React.ReactNode;
|
|
22
|
+
/** Allow values that are not in `options`. */
|
|
23
|
+
creatable?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Set to null to hide the dropdown indicator. */
|
|
26
|
+
dropdownIndicator?: React.ReactNode;
|
|
27
|
+
filterOption?: ((option: TOption, input: string) => boolean) | null;
|
|
28
|
+
formatCreateLabel?: (input: string) => React.ReactNode;
|
|
29
|
+
/** ID of the native input, for association with a label. */
|
|
30
|
+
id?: string;
|
|
31
|
+
/** Ref to the native search input. */
|
|
32
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
33
|
+
inputValue?: string;
|
|
34
|
+
isInsideModal?: boolean;
|
|
35
|
+
isLoading?: boolean;
|
|
36
|
+
/** Controlled menu state. */
|
|
37
|
+
isOpen?: boolean;
|
|
38
|
+
/** Compare object values. Values are compared with === by default. */
|
|
39
|
+
isValueEqual?: (a: TValue, b: TValue) => boolean;
|
|
40
|
+
loadingMessage?: () => React.ReactNode;
|
|
41
|
+
maxMenuHeight?: number;
|
|
42
|
+
maxMenuWidth?: number | string;
|
|
43
|
+
/** Content after the options, outside the scroll container. */
|
|
44
|
+
menuFooter?: React.ReactNode;
|
|
45
|
+
menuPortalTarget?: HTMLElement | null;
|
|
46
|
+
minMenuHeight?: number;
|
|
47
|
+
name?: string;
|
|
48
|
+
noOptionsMessage?: (state: {
|
|
49
|
+
inputValue: string;
|
|
50
|
+
}) => React.ReactNode;
|
|
51
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
52
|
+
onCreateOption?: (input: string) => void;
|
|
53
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
54
|
+
/** Search text changes, including resets after selection, blur, or menu close. */
|
|
55
|
+
onInputChange?: (input: string, reason: 'input' | 'reset') => void;
|
|
56
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
57
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
58
|
+
openMenuOnClick?: boolean;
|
|
59
|
+
openMenuOnFocus?: boolean;
|
|
60
|
+
placeholder?: React.ReactNode;
|
|
61
|
+
ref?: React.Ref<SelectHandle>;
|
|
62
|
+
searchable?: boolean;
|
|
63
|
+
showCreateOptionIcon?: boolean;
|
|
64
|
+
showDividers?: boolean;
|
|
65
|
+
size?: FormSize;
|
|
66
|
+
styles?: StylesConfig<NoInfer<TValue>, NoInfer<TOption>>;
|
|
67
|
+
tabIndex?: number;
|
|
68
|
+
/** Virtualize large lists, including lists with sections. */
|
|
69
|
+
virtualized?: boolean;
|
|
70
|
+
}
|
|
71
|
+
type DisabledSelectionProps<Props extends {
|
|
72
|
+
onChange: unknown;
|
|
73
|
+
}> = Props extends unknown ? Omit<Props, 'onChange'> & {
|
|
74
|
+
disabled: true;
|
|
75
|
+
onChange?: Props['onChange'];
|
|
76
|
+
} : never;
|
|
77
|
+
export type ControlProps<TValue, TOption extends SelectValue<TValue> = SelectValue<TValue>> = (SelectSelectionProps<TValue, TOption> | DisabledSelectionProps<SelectSelectionProps<TValue, TOption>>) & BaseSelectProps<TValue, TOption>;
|
|
78
|
+
export declare function Select<TValue, TOption extends SelectValue<TValue> = SelectValue<TValue>>(props: ControlProps<TValue, TOption>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
79
|
+
export {};
|