@spaced-out/ui-design-system 0.5.2 → 0.5.4
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/.cspell/custom-words.txt +6 -0
- package/.dependency-cruiser.cjs +22 -0
- package/.prettierrc +1 -0
- package/.storybook/public/depgraph.json +23818 -0
- package/.vscode/keybindings.json +7 -0
- package/.vscode/settings.json +6 -1
- package/CHANGELOG.md +20 -0
- package/cspell.json +1 -0
- package/lib/components/Accordion/Accordion.d.ts.map +1 -1
- package/lib/components/Accordion/Accordion.js +4 -4
- package/lib/components/Accordion/AccordionGroup.d.ts.map +1 -1
- package/lib/components/Accordion/AccordionGroup.js +1 -8
- package/lib/components/Badge/Badge.d.ts +5 -4
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Banner/Banner.d.ts +3 -2
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.d.ts +3 -2
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
- package/lib/components/Button/Button.d.ts +8 -7
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +2 -6
- package/lib/components/ButtonDropdown/ButtonDropdown.d.ts +3 -2
- package/lib/components/ButtonDropdown/ButtonDropdown.d.ts.map +1 -1
- package/lib/components/ButtonDropdown/ButtonDropdown.stories.d.ts +1455 -35
- package/lib/components/ButtonDropdown/ButtonDropdown.stories.d.ts.map +1 -1
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.d.ts +3 -3
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.d.ts.map +1 -1
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.stories.d.ts +2328 -56
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.stories.d.ts.map +1 -1
- package/lib/components/ButtonTabs/ButtonTabDropdown.d.ts +3 -2
- package/lib/components/ButtonTabs/ButtonTabDropdown.d.ts.map +1 -1
- package/lib/components/Card/Card.d.ts +3 -2
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Charts/ColumnChart/ColumnChart.d.ts +3 -2
- package/lib/components/Charts/ColumnChart/ColumnChart.d.ts.map +1 -1
- package/lib/components/Charts/ColumnChart/ColumnChart.js +2 -6
- package/lib/components/Charts/DonutChart/DonutChart.d.ts +3 -2
- package/lib/components/Charts/DonutChart/DonutChart.d.ts.map +1 -1
- package/lib/components/Charts/DonutChart/DonutChart.js +2 -6
- package/lib/components/Charts/FunnelChart/FunnelChart.d.ts +3 -2
- package/lib/components/Charts/FunnelChart/FunnelChart.d.ts.map +1 -1
- package/lib/components/Charts/FunnelChart/FunnelChart.js +2 -6
- package/lib/components/Charts/LineChart/LineChart.d.ts +3 -2
- package/lib/components/Charts/LineChart/LineChart.d.ts.map +1 -1
- package/lib/components/Charts/LineChart/LineChart.js +2 -6
- package/lib/components/Charts/SpiderChart/SpiderChart.d.ts +3 -2
- package/lib/components/Charts/SpiderChart/SpiderChart.d.ts.map +1 -1
- package/lib/components/ChatBubble/ChatBubble.d.ts.map +1 -1
- package/lib/components/ChatBubble/ChatBubble.js +1 -4
- package/lib/components/Checkbox/Checkbox.d.ts +3 -2
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/CheckboxGroup.stories.d.ts +3 -2
- package/lib/components/Checkbox/CheckboxGroup.stories.d.ts.map +1 -1
- package/lib/components/Chip/Chip.d.ts +7 -6
- package/lib/components/Chip/Chip.d.ts.map +1 -1
- package/lib/components/Combobox/Combobox.d.ts.map +1 -1
- package/lib/components/Combobox/Combobox.js +1 -3
- package/lib/components/Combobox/Combobox.stories.d.ts +4 -3
- package/lib/components/Combobox/Combobox.stories.d.ts.map +1 -1
- package/lib/components/DateRangePicker/DateRangeWrapper.d.ts.map +1 -1
- package/lib/components/DateRangePicker/DateRangeWrapper.js +1 -1
- package/lib/components/DateRangePicker/Day.d.ts.map +1 -1
- package/lib/components/DateRangePicker/Day.js +2 -7
- package/lib/components/Dialog/Dialog.d.ts +5 -4
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +3 -2
- package/lib/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/Dropdown/Dropdown.js +1 -3
- package/lib/components/Dropdown/Dropdown.stories.d.ts.map +1 -1
- package/lib/components/Dropdown/SimpleDropdown.d.ts +3 -3
- package/lib/components/Dropdown/SimpleDropdown.d.ts.map +1 -1
- package/lib/components/Dropdown/SimpleDropdown.js +1 -3
- package/lib/components/FileUpload/FileUpload.d.ts +3 -2
- package/lib/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/lib/components/FileUpload/FileUpload.js +0 -1
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.d.ts +3 -2
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.d.ts.map +1 -1
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.d.ts +3 -2
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.d.ts.map +1 -1
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.stories.d.ts.map +1 -1
- package/lib/components/Icon/ClickableIcon.d.ts +3 -2
- package/lib/components/Icon/ClickableIcon.d.ts.map +1 -1
- package/lib/components/Icon/ClickableIcon.js +2 -3
- package/lib/components/Icon/SemanticIcon.d.ts +3 -2
- package/lib/components/Icon/SemanticIcon.d.ts.map +1 -1
- package/lib/components/InContextAlert/InContextAlert.d.ts +3 -2
- package/lib/components/InContextAlert/InContextAlert.d.ts.map +1 -1
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts +3 -2
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts.map +1 -1
- package/lib/components/InlineDropdown/InlineDropdown.d.ts +3 -2
- package/lib/components/InlineDropdown/InlineDropdown.d.ts.map +1 -1
- package/lib/components/InlineDropdown/InlineDropdown.stories.d.ts +873 -21
- package/lib/components/InlineDropdown/InlineDropdown.stories.d.ts.map +1 -1
- package/lib/components/InlineDropdown/SimpleInlineDropdown.d.ts +3 -3
- package/lib/components/InlineDropdown/SimpleInlineDropdown.d.ts.map +1 -1
- package/lib/components/InlineDropdown/SimpleInlineDropdown.js +1 -0
- package/lib/components/InlineDropdown/SimpleInlineDropdown.stories.d.ts +1746 -42
- package/lib/components/InlineDropdown/SimpleInlineDropdown.stories.d.ts.map +1 -1
- package/lib/components/Input/Input.d.ts +3 -2
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Link/Link.d.ts +5 -4
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +1 -3
- package/lib/components/Menu/Menu.d.ts +3 -2
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/MenuOptionButton.d.ts +5 -3
- package/lib/components/Menu/MenuOptionButton.d.ts.map +1 -1
- package/lib/components/Menu/MenuOptionButton.js +1 -5
- package/lib/components/Modal/Modal.d.ts +3 -2
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Notification/Notification.d.ts +3 -2
- package/lib/components/Notification/Notification.d.ts.map +1 -1
- package/lib/components/OptionButton/OptionButton.d.ts +3 -2
- package/lib/components/OptionButton/OptionButton.d.ts.map +1 -1
- package/lib/components/OptionButton/OptionButton.stories.d.ts.map +1 -1
- package/lib/components/OptionButton/SimpleOptionButton.d.ts +3 -3
- package/lib/components/OptionButton/SimpleOptionButton.d.ts.map +1 -1
- package/lib/components/OptionButton/SimpleOptionButton.stories.d.ts +1164 -28
- package/lib/components/OptionButton/SimpleOptionButton.stories.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +9 -5
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +1 -3
- package/lib/components/Pagination/Pagination.stories.d.ts +9 -1
- package/lib/components/Pagination/Pagination.stories.d.ts.map +1 -1
- package/lib/components/Panel/Panel.d.ts +3 -2
- package/lib/components/Panel/Panel.d.ts.map +1 -1
- package/lib/components/PromptChip/PromptChip.d.ts.map +1 -1
- package/lib/components/PromptChip/PromptChip.js +2 -6
- package/lib/components/PromptInput/PromptInput.d.ts.map +1 -1
- package/lib/components/PromptInput/PromptInput.js +1 -3
- package/lib/components/PromptInput/PromptInput.stories.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +3 -2
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioGroup.stories.d.ts.map +1 -1
- package/lib/components/Rating/Rating.d.ts.map +1 -1
- package/lib/components/Rating/Rating.js +3 -10
- package/lib/components/SearchInput/SearchInput.d.ts +3 -2
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/Stepper/Step/Step.d.ts.map +1 -1
- package/lib/components/Stepper/Step/Step.js +2 -7
- package/lib/components/SubMenu/SubMenu.stories.d.ts.map +1 -1
- package/lib/components/SubMenu/SubMenuGroup.d.ts.map +1 -1
- package/lib/components/SubMenu/SubMenuGroup.js +4 -4
- package/lib/components/SubMenu/SubMenuItem.d.ts +1 -0
- package/lib/components/SubMenu/SubMenuItem.d.ts.map +1 -1
- package/lib/components/Table/StaticTable.js +1 -1
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.js +3 -1
- package/lib/components/Table/Table.module.css +1 -0
- package/lib/components/Tabs/Tab/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab/Tab.js +1 -3
- package/lib/components/TextTile/TextTile.d.ts.map +1 -1
- package/lib/components/Textarea/Textarea.d.ts +3 -2
- package/lib/components/Textarea/Textarea.d.ts.map +1 -1
- package/lib/components/Timeline/TimelineItem/TimelineItem.d.ts.map +1 -1
- package/lib/components/Timeline/TimelineItem/TimelineItem.js +1 -3
- package/lib/components/Toast/ToastContainer.d.ts.map +1 -1
- package/lib/components/TokenListInput/TokenListInput.d.ts.map +1 -1
- package/lib/components/TokenListInput/TokenListInput.stories.d.ts +3 -2
- package/lib/components/TokenListInput/TokenListInput.stories.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +3 -2
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Typeahead/SimpleTypeahead.d.ts +4 -3
- package/lib/components/Typeahead/SimpleTypeahead.d.ts.map +1 -1
- package/lib/components/Typeahead/SimpleTypeahead.stories.d.ts.map +1 -1
- package/lib/components/Typeahead/Typeahead.d.ts +5 -4
- package/lib/components/Typeahead/Typeahead.d.ts.map +1 -1
- package/lib/components/Typeahead/Typeahead.js +3 -7
- package/lib/components/Typeahead/Typeahead.stories.d.ts.map +1 -1
- package/lib/components/WeekdayPicker/WeekdayPicker.d.ts +1 -0
- package/lib/components/WeekdayPicker/WeekdayPicker.d.ts.map +1 -1
- package/lib/components/WeekdayPicker/WeekdayPicker.js +9 -3
- package/lib/components/WeekdayPicker/WeekdayPicker.module.css +1 -6
- package/lib/devtools/DependencyGraph/DependencyGraph.stories.d.ts +19 -0
- package/lib/devtools/DependencyGraph/DependencyGraph.stories.d.ts.map +1 -0
- package/lib/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.d.ts +3 -3
- package/lib/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.d.ts.map +1 -1
- package/lib/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.js +5 -18
- package/lib/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.stories.d.ts.map +1 -1
- package/lib/hooks/useFileUpload/useFileUpload.d.ts +12 -8
- package/lib/hooks/useFileUpload/useFileUpload.d.ts.map +1 -1
- package/lib/hooks/useFileUpload/useFileUpload.js +2 -19
- package/lib/hooks/useFileUpload/useFileUpload.stories.d.ts.map +1 -1
- package/lib/hooks/useFilteredOptions/useFilteredOptions.d.ts +7 -3
- package/lib/hooks/useFilteredOptions/useFilteredOptions.d.ts.map +1 -1
- package/lib/hooks/useFilteredOptions/useFilteredOptions.js +2 -6
- package/lib/hooks/useInputState/useInputState.js +1 -3
- package/lib/hooks/useMountTransition/index.d.ts.map +1 -1
- package/lib/hooks/useMountTransition/index.js +0 -2
- package/lib/hooks/usePagination/usePagination.d.ts +1 -1
- package/lib/hooks/usePagination/usePagination.d.ts.map +1 -1
- package/lib/hooks/usePagination/usePagination.js +0 -3
- package/lib/hooks/usePagination/usePagination.stories.d.ts +1 -1
- package/lib/hooks/useResizeObserver/useResizeObserver.d.ts +1 -1
- package/lib/hooks/useResizeObserver/useResizeObserver.d.ts.map +1 -1
- package/lib/hooks/useResizeObserver/useResizeObserver.js +2 -5
- package/lib/hooks/useToastPortal/useToastPortal.d.ts.map +1 -1
- package/lib/hooks/useToastPortal/useToastPortal.js +0 -4
- package/lib/hooks/useToggle/useToggle.stories.d.ts.map +1 -1
- package/lib/types/date-range-picker.d.ts +3 -2
- package/lib/types/date-range-picker.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +11 -0
- package/lib/types/toast.d.ts +3 -2
- package/lib/types/toast.d.ts.map +1 -1
- package/lib/types/utils.d.ts +101 -0
- package/lib/types/utils.d.ts.map +1 -0
- package/lib/types/utils.js +5 -0
- package/lib/utils/click-away/ClickAway.stories.d.ts.map +1 -1
- package/lib/utils/click-away/click-away.d.ts +11 -11
- package/lib/utils/click-away/click-away.d.ts.map +1 -1
- package/lib/utils/helpers/helpers.stories.d.ts.map +1 -1
- package/lib/utils/merge-refs/merge-refs.stories.d.ts.map +1 -1
- package/package.json +10 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Flow } from 'flow-to-typescript-codemod';
|
|
3
3
|
import type { MenuClassNames, MenuLabelTooltip } from '../../types/menu';
|
|
4
|
+
import type { Over } from '../../types/utils';
|
|
4
5
|
import type { ClickAwayRefType } from '../../utils/click-away';
|
|
5
6
|
import type { InputProps } from '../Input';
|
|
6
7
|
import type { MenuOption, Virtualization } from '../Menu';
|
|
@@ -12,8 +13,7 @@ type ClassNames = Readonly<{
|
|
|
12
13
|
export type SimpleTypeaheadRef = {
|
|
13
14
|
selectedKeys?: Array<string>;
|
|
14
15
|
};
|
|
15
|
-
export type SimpleTypeaheadProps =
|
|
16
|
-
InputProps & {
|
|
16
|
+
export type SimpleTypeaheadProps = Over<InputProps, {
|
|
17
17
|
isLoading?: boolean;
|
|
18
18
|
menuOpenOffset?: number;
|
|
19
19
|
classNames?: ClassNames;
|
|
@@ -35,7 +35,8 @@ InputProps & {
|
|
|
35
35
|
resolveSecondaryLabel?: (option: MenuOption) => string | React.ReactNode;
|
|
36
36
|
clickAwayRef?: ClickAwayRefType;
|
|
37
37
|
allowInternalFilter?: boolean;
|
|
38
|
-
|
|
38
|
+
typeaheadInputText?: string;
|
|
39
|
+
}>;
|
|
39
40
|
export declare const SimpleTypeahead: Flow.AbstractComponent<SimpleTypeaheadProps, SimpleTypeaheadRef>;
|
|
40
41
|
export {};
|
|
41
42
|
//# sourceMappingURL=SimpleTypeahead.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleTypeahead.d.ts","sourceRoot":"","sources":["../../../src/components/Typeahead/SimpleTypeahead.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAK9C,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC9B,
|
|
1
|
+
{"version":3,"file":"SimpleTypeahead.d.ts","sourceRoot":"","sources":["../../../src/components/Typeahead/SimpleTypeahead.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAK9C,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC9B,IAAI,CACF,UAAU,EACV;IACE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB,OAAO,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5B,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,kBAAkB,CAAC,EAAE,cAAc,CAAC;IACpC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,aAAa,CAAC;IAE1B,QAAQ,CAAC,EAAE,CACT,MAAM,EAAE,UAAU,EAClB,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,SAAS,KACxD,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,OAAO,CAAC;IACjE,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChE,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACzE,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CACF,CAAC;AAiHJ,eAAO,MAAM,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAClD,oBAAoB,EACpB,kBAAkB,CAInB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleTypeahead.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Typeahead/SimpleTypeahead.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAIxC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU5D,wBAsYE;AAwCF,eAAO,MAAM,eAAe;WAAU,oBAAoB;;;;;CAMzD,CAAC;AAOF,eAAO,MAAM,4BAA4B;WAAU,oBAAoB;;;;;;;;CAMtE,CAAC;AAQF,eAAO,MAAM,oBAAoB;WAAU,oBAAoB;;;;;;CAqB9D,CAAC;AAgCF,eAAO,MAAM,gCAAgC;WACrC,oBAAoB;;;;;
|
|
1
|
+
{"version":3,"file":"SimpleTypeahead.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Typeahead/SimpleTypeahead.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAIxC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU5D,wBAsYE;AAwCF,eAAO,MAAM,eAAe;WAAU,oBAAoB;;;;;CAMzD,CAAC;AAOF,eAAO,MAAM,4BAA4B;WAAU,oBAAoB;;;;;;;;CAMtE,CAAC;AAQF,eAAO,MAAM,oBAAoB;WAAU,oBAAoB;;;;;;CAqB9D,CAAC;AAgCF,eAAO,MAAM,gCAAgC;WACrC,oBAAoB;;;;;CAyC3B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Flow } from 'flow-to-typescript-codemod';
|
|
3
|
+
import type { Over } from '../../types/utils';
|
|
3
4
|
import type { ClickAwayRefType } from '../../utils/click-away';
|
|
4
5
|
import type { InputProps } from '../Input';
|
|
5
6
|
import type { MenuOption, MenuProps } from '../Menu';
|
|
@@ -8,7 +9,7 @@ type ClassNames = Readonly<{
|
|
|
8
9
|
wrapper?: string;
|
|
9
10
|
box?: string;
|
|
10
11
|
}>;
|
|
11
|
-
type BaseTypeaheadProps = InputProps
|
|
12
|
+
type BaseTypeaheadProps = Over<InputProps, {
|
|
12
13
|
classNames?: ClassNames;
|
|
13
14
|
onSelect?: (option: MenuOption, arg2?: React.SyntheticEvent<HTMLElement> | null | undefined) => unknown;
|
|
14
15
|
onSearch?: (evt: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
@@ -21,10 +22,10 @@ type BaseTypeaheadProps = InputProps & {
|
|
|
21
22
|
menuOpenOffset?: number;
|
|
22
23
|
clickAwayRef?: ClickAwayRefType;
|
|
23
24
|
elevation?: ElevationType;
|
|
24
|
-
}
|
|
25
|
-
export type TypeaheadProps = BaseTypeaheadProps
|
|
25
|
+
}>;
|
|
26
|
+
export type TypeaheadProps = Over<BaseTypeaheadProps, {
|
|
26
27
|
allowInternalFilter?: boolean;
|
|
27
|
-
}
|
|
28
|
+
}>;
|
|
28
29
|
export declare const Typeahead: Flow.AbstractComponent<TypeaheadProps, HTMLInputElement>;
|
|
29
30
|
export {};
|
|
30
31
|
//# sourceMappingURL=Typeahead.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../../src/components/Typeahead/Typeahead.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../../src/components/Typeahead/Typeahead.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAIrD,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAGnD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAM9C,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,KAAK,kBAAkB,GAAG,IAAI,CAC5B,UAAU,EACV;IACE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,CACT,MAAM,EAAE,UAAU,EAClB,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,SAAS,KACxD,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,OAAO,CAAC;IACjE,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B,CACF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,kBAAkB,EAClB;IACE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CACF,CAAC;AAyLF,eAAO,MAAM,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAC5C,cAAc,EACd,gBAAgB,CASjB,CAAC"}
|
|
@@ -99,18 +99,14 @@ const BaseTypeahead = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
99
99
|
clickAway();
|
|
100
100
|
}
|
|
101
101
|
onFocus?.(_e);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
,
|
|
105
|
-
onClear: _e => {
|
|
102
|
+
},
|
|
103
|
+
onClear: () => {
|
|
106
104
|
onClear?.();
|
|
107
105
|
}
|
|
108
106
|
})), isOpen && !isLoading && menu && menuOptions && !!menuOptions.length && /*#__PURE__*/React.createElement(_react2.FloatingPortal, null, /*#__PURE__*/React.createElement(_react2.FloatingFocusManager, {
|
|
109
107
|
modal: false,
|
|
110
108
|
context: context,
|
|
111
|
-
returnFocus: false
|
|
112
|
-
// @ts-ignore - TS2322 - Type 'MutableRefObject<ReferenceType | null> & MutableRefObject<ReferenceType | null>' is not assignable to type 'number | MutableRefObject<HTMLElement | null> | undefined'.
|
|
113
|
-
,
|
|
109
|
+
returnFocus: false,
|
|
114
110
|
initialFocus: refs.reference
|
|
115
111
|
}, /*#__PURE__*/React.createElement("div", {
|
|
116
112
|
// @ts-ignore - TS2322 - Type '((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void)' is not assignable to type '{ current: HTMLElement | null | undefined; }'.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typeahead.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Typeahead/Typeahead.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAInD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2ChD,wBAsVE;AAMF,eAAO,MAAM,UAAU;WAAU,cAAc;;;;;CAgB9C,CAAC;AAOF,eAAO,MAAM,4BAA4B;WAAU,cAAc;;;;;;;
|
|
1
|
+
{"version":3,"file":"Typeahead.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Typeahead/Typeahead.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAInD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2ChD,wBAsVE;AAMF,eAAO,MAAM,UAAU;WAAU,cAAc;;;;;CAgB9C,CAAC;AAOF,eAAO,MAAM,4BAA4B;WAAU,cAAc;;;;;;;gDAlYlD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;sBAiCV,CAAD;uBACG,CAAA;kCAAgC,CAAC;;;;;;;;CAgXxC,CAAC;AAOF,eAAO,MAAM,oBAAoB;WAAU,cAAc;;;;CAExD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM,cAAc,sBA+BvD,CAAC;AA8BF,eAAO,MAAM,gCAAgC;WAAU,cAAc;;;;;CA0CpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeekdayPicker.d.ts","sourceRoot":"","sources":["../../../src/components/WeekdayPicker/WeekdayPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAoBrD,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"WeekdayPicker.d.ts","sourceRoot":"","sources":["../../../src/components/WeekdayPicker/WeekdayPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAoBrD,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC,CAAC;AACH,KAAK,iBAAiB,GACpB,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,KAAK,OAAO,GAAG;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,gBAAgB,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,CACT,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,EAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,SAAS,KACxD,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAgEF,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAChD,kBAAkB,EAClB,cAAc,CAsHf,CAAC"}
|
|
@@ -43,7 +43,7 @@ const DayButton = _ref => {
|
|
|
43
43
|
isSelected,
|
|
44
44
|
isDisabled,
|
|
45
45
|
onClick,
|
|
46
|
-
|
|
46
|
+
classNames,
|
|
47
47
|
size,
|
|
48
48
|
readOnly
|
|
49
49
|
} = _ref;
|
|
@@ -53,8 +53,11 @@ const DayButton = _ref => {
|
|
|
53
53
|
[_WeekdayPickerModule.default.weekdayButtonMedium]: size === WEEKDAY_PICKER_SIZE.medium,
|
|
54
54
|
[_WeekdayPickerModule.default.weekdayButtonSmall]: size === WEEKDAY_PICKER_SIZE.small,
|
|
55
55
|
[_WeekdayPickerModule.default.weekdayButtonSelected]: isSelected,
|
|
56
|
+
...(classNames?.selectedButton && {
|
|
57
|
+
[classNames.selectedButton]: isSelected
|
|
58
|
+
}),
|
|
56
59
|
[_WeekdayPickerModule.default.weekdayButtonDisabled]: isDisabled
|
|
57
|
-
},
|
|
60
|
+
}, classNames?.button),
|
|
58
61
|
onClick: onClick,
|
|
59
62
|
disabled: isDisabled,
|
|
60
63
|
"aria-label": `Select ${day.label}`,
|
|
@@ -138,7 +141,10 @@ const WeekdayPicker = exports.WeekdayPicker = /*#__PURE__*/React.forwardRef((_re
|
|
|
138
141
|
handleDayToggle(day, event);
|
|
139
142
|
}
|
|
140
143
|
},
|
|
141
|
-
|
|
144
|
+
classNames: {
|
|
145
|
+
button: classNames.button,
|
|
146
|
+
selectedButton: classNames.selectedButton
|
|
147
|
+
},
|
|
142
148
|
size: size,
|
|
143
149
|
readOnly: readOnly
|
|
144
150
|
});
|
|
@@ -76,11 +76,6 @@
|
|
|
76
76
|
&:focus-visible {
|
|
77
77
|
background-color: colorButtonFillPrimaryHovered;
|
|
78
78
|
color: colorTextInversePrimary;
|
|
79
|
-
|
|
80
|
-
.secondaryLabel {
|
|
81
|
-
background-color: colorButtonFillPrimaryHovered;
|
|
82
|
-
color: colorTextInversePrimary;
|
|
83
|
-
}
|
|
84
79
|
}
|
|
85
80
|
}
|
|
86
81
|
|
|
@@ -94,6 +89,7 @@
|
|
|
94
89
|
.secondaryLabel {
|
|
95
90
|
composes: bodySmall from '../../styles/typography.module.css';
|
|
96
91
|
color: colorTextSecondary;
|
|
92
|
+
background-color: transparent;
|
|
97
93
|
|
|
98
94
|
/* Added a transition to .secondaryLabel for smoother and immediate style updates
|
|
99
95
|
during hover or focus-visible states of .secondaryLabelSelected. This ensures the
|
|
@@ -102,7 +98,6 @@
|
|
|
102
98
|
}
|
|
103
99
|
|
|
104
100
|
.secondaryLabelSelected {
|
|
105
|
-
background-color: colorButtonFillPrimaryEnabled;
|
|
106
101
|
color: colorTextInversePrimary;
|
|
107
102
|
}
|
|
108
103
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import '@xyflow/react/dist/style.css';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
docs: {
|
|
7
|
+
subtitle: string;
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
storySource: {
|
|
13
|
+
componentPath: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
export declare const _DependencyGraph: () => React.JSX.Element;
|
|
19
|
+
//# sourceMappingURL=DependencyGraph.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyGraph.stories.d.ts","sourceRoot":"","sources":["../../../src/devtools/DependencyGraph/DependencyGraph.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqB/B,OAAO,8BAA8B,CAAC;;;;;;;;;;;;;;;AAItC,wBAYE;AAwUF,eAAO,MAAM,gBAAgB,yBAgC5B,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { GroupTitleOption } from '../useFilteredOptions';
|
|
1
|
+
import type { BaseOption, GroupTitleOption } from '../useFilteredOptions';
|
|
2
2
|
export type ArbitraryOption = {
|
|
3
3
|
key: string;
|
|
4
4
|
label: string;
|
|
5
5
|
arbitrary?: boolean;
|
|
6
6
|
multiArbitrary?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare function useArbitraryOptionAddition<V>({ searchTerm, options, excludedKeys, allowArbitraryValues, allowMultiArbitraryValues, validateArbitraryValue, makeArbitraryValue, makeMultiArbitraryValue, groupTitleOptions, arbitraryGroup, searchOptionsBy, }: {
|
|
8
|
+
export declare function useArbitraryOptionAddition<V extends BaseOption>({ searchTerm, options, excludedKeys, allowArbitraryValues, allowMultiArbitraryValues, validateArbitraryValue, makeArbitraryValue, makeMultiArbitraryValue, groupTitleOptions, arbitraryGroup, searchOptionsBy, }: {
|
|
9
9
|
searchTerm: string;
|
|
10
10
|
options?: V[];
|
|
11
11
|
excludedKeys?: string[];
|
|
@@ -13,7 +13,7 @@ export declare function useArbitraryOptionAddition<V>({ searchTerm, options, exc
|
|
|
13
13
|
allowMultiArbitraryValues?: boolean;
|
|
14
14
|
validateArbitraryValue?: (arg1: string) => boolean;
|
|
15
15
|
makeArbitraryValue?: (arg1: string) => V;
|
|
16
|
-
makeMultiArbitraryValue?: (arg1: string) => V;
|
|
16
|
+
makeMultiArbitraryValue?: (arg1: string) => V | undefined;
|
|
17
17
|
groupTitleOptions?: GroupTitleOption<V>[];
|
|
18
18
|
arbitraryGroup?: GroupTitleOption<V>;
|
|
19
19
|
searchOptionsBy?: (option: V, searchTerm: string) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useArbitraryOptionAddition.d.ts","sourceRoot":"","sources":["../../../src/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"useArbitraryOptionAddition.d.ts","sourceRoot":"","sources":["../../../src/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAIxE,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,UAAU,EAAE,EAC/D,UAAU,EACV,OAAY,EACZ,YAAiB,EACjB,oBAA2B,EAC3B,yBAAiC,EACjC,sBAAwE,EAExE,kBAKoB,EAEpB,uBAUC,EAED,iBAAsB,EACtB,cAAsE,EAEtE,eAMC,GACF,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACnD,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC;IACzC,uBAAuB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,CAAC;IAC1D,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,cAAc,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACrC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;CAC9D,GAAG;IACF,oBAAoB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/B,8BAA8B,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5D,CAkDA"}
|
|
@@ -13,24 +13,21 @@ function useArbitraryOptionAddition(_ref) {
|
|
|
13
13
|
allowArbitraryValues = true,
|
|
14
14
|
allowMultiArbitraryValues = false,
|
|
15
15
|
validateArbitraryValue = value => value.trim() !== '',
|
|
16
|
-
// @ts-ignore - TS2322 - Type '{ key: string; label: string; arbitrary: boolean; }' is not assignable to type 'V'.
|
|
17
16
|
makeArbitraryValue = searchTerm => ({
|
|
18
17
|
key: searchTerm,
|
|
19
18
|
label: searchTerm,
|
|
20
19
|
arbitrary: true
|
|
21
20
|
}),
|
|
22
|
-
// @ts-ignore - TS2366 - Function lacks ending return statement and return type does not include 'undefined'.
|
|
23
21
|
makeMultiArbitraryValue = searchTerm => {
|
|
24
|
-
const regex = /^(?=.*[,\n])
|
|
22
|
+
const regex = /^(?=.*[,\n]).+$/;
|
|
25
23
|
if (regex.test(searchTerm)) {
|
|
26
|
-
// $FlowFixMe - Object literal is compatible with V due to type constraint
|
|
27
|
-
// @ts-ignore - TS2322 - Type '{ key: string; label: string; multiArbitrary: boolean; }' is not assignable to type 'V'.
|
|
28
24
|
return {
|
|
29
25
|
key: searchTerm,
|
|
30
26
|
label: searchTerm,
|
|
31
27
|
multiArbitrary: true
|
|
32
28
|
};
|
|
33
29
|
}
|
|
30
|
+
return undefined;
|
|
34
31
|
},
|
|
35
32
|
groupTitleOptions = [],
|
|
36
33
|
arbitraryGroup = {
|
|
@@ -39,13 +36,11 @@ function useArbitraryOptionAddition(_ref) {
|
|
|
39
36
|
options: []
|
|
40
37
|
},
|
|
41
38
|
searchOptionsBy = (option, searchTerm) => {
|
|
42
|
-
// $FlowFixMe
|
|
43
|
-
// @ts-ignore - TS2322 - Type 'V' is not assignable to type '{ label: string; key: string; }'.
|
|
44
39
|
const {
|
|
45
40
|
label,
|
|
46
41
|
key
|
|
47
42
|
} = option;
|
|
48
|
-
return key.toLowerCase().includes(searchTerm) || label.toLowerCase().includes(searchTerm);
|
|
43
|
+
return key.toLowerCase().includes(searchTerm) || (label ? label.toLowerCase().includes(searchTerm) : false);
|
|
49
44
|
}
|
|
50
45
|
} = _ref;
|
|
51
46
|
const trimmedSearchTerm = (searchTerm || '').trim().toLowerCase();
|
|
@@ -60,22 +55,15 @@ function useArbitraryOptionAddition(_ref) {
|
|
|
60
55
|
});
|
|
61
56
|
|
|
62
57
|
// Find if an arbitrary option should be added
|
|
63
|
-
const arbitraryOption = allowArbitraryValues && trimmedSearchTerm &&
|
|
64
|
-
// @ts-ignore - TS2532 - Object is possibly 'undefined'. | TS2339 - Property 'key' does not exist on type 'V'.
|
|
65
|
-
!filteredOptions.some(option => option.key === trimmedSearchTerm) &&
|
|
66
|
-
// @ts-ignore - TS2532 - Object is possibly 'undefined'.
|
|
67
|
-
!filteredGroupTitleOptions.some(group => Array.isArray(group.options) &&
|
|
68
|
-
// @ts-ignore - TS2339 - Property 'key' does not exist on type 'V'.
|
|
69
|
-
group.options.some(option => option.key === trimmedSearchTerm)) && !excludedKeys.includes(trimmedSearchTerm) && validateArbitraryValue(trimmedSearchTerm) && makeArbitraryValue(trimmedSearchTerm);
|
|
58
|
+
const arbitraryOption = allowArbitraryValues && trimmedSearchTerm && !filteredOptions.some(option => option.key === trimmedSearchTerm) && !filteredGroupTitleOptions.some(group => Array.isArray(group.options) && group.options.some(option => option.key === trimmedSearchTerm)) && !excludedKeys.includes(trimmedSearchTerm) && validateArbitraryValue(trimmedSearchTerm) && makeArbitraryValue(trimmedSearchTerm);
|
|
70
59
|
|
|
71
60
|
// Find if a multi-arbitrary option should be added
|
|
72
61
|
const multiArbitraryOption = allowMultiArbitraryValues && trimmedSearchTerm && makeMultiArbitraryValue(trimmedSearchTerm);
|
|
73
62
|
|
|
74
63
|
// Compose the results
|
|
75
64
|
let optionsWithArbitrary = filteredOptions;
|
|
76
|
-
let groupTitleOptionsWithArbitrary =
|
|
65
|
+
let groupTitleOptionsWithArbitrary = filteredGroupTitleOptions;
|
|
77
66
|
if (arbitraryOption) {
|
|
78
|
-
// @ts-ignore - TS2488 - Type 'V[] | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
|
|
79
67
|
optionsWithArbitrary = [arbitraryOption, ...optionsWithArbitrary];
|
|
80
68
|
groupTitleOptionsWithArbitrary = [{
|
|
81
69
|
...arbitraryGroup,
|
|
@@ -89,7 +77,6 @@ function useArbitraryOptionAddition(_ref) {
|
|
|
89
77
|
options: [multiArbitraryOption]
|
|
90
78
|
}, ...groupTitleOptionsWithArbitrary];
|
|
91
79
|
}
|
|
92
|
-
// @ts-ignore - TS2322 - Type 'V[] | undefined' is not assignable to type 'V[]'.
|
|
93
80
|
return {
|
|
94
81
|
optionsWithArbitrary,
|
|
95
82
|
groupTitleOptionsWithArbitrary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useArbitraryOptionAddition.stories.d.ts","sourceRoot":"","sources":["../../../src/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useArbitraryOptionAddition.stories.d.ts","sourceRoot":"","sources":["../../../src/hooks/useArbitraryOptionAddition/useArbitraryOptionAddition.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAC;;;;;;;;;;;;;AAaxE,wBAmDE;AASF,eAAO,MAAM,KAAK,yBAgCjB,CAAC;AAwBF,eAAO,MAAM,OAAO,yBA+BnB,CAAC"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import { type DropzoneInputProps, type DropzoneRootProps } from 'react-dropzone';
|
|
1
2
|
import type { FileObject, FileProgress, FileUploadBaseProps } from '../../components/FileUpload';
|
|
3
|
+
type GetRootProps = <T extends DropzoneRootProps>(props?: T) => T;
|
|
4
|
+
type GetInputProps = <T extends DropzoneInputProps>(props?: T) => T;
|
|
2
5
|
export type UseFileUploadReturnProps = {
|
|
3
6
|
validFiles: Array<FileObject>;
|
|
4
7
|
rejectedFiles: Array<FileObject>;
|
|
5
8
|
isDragActive: boolean;
|
|
6
9
|
shouldAcceptFiles: boolean;
|
|
7
|
-
getRootProps:
|
|
8
|
-
getInputProps:
|
|
9
|
-
handleFileClear: (id: string) =>
|
|
10
|
-
handleClear: () =>
|
|
11
|
-
moveFileToProgress: (id: string, progress: FileProgress) =>
|
|
12
|
-
moveFileToSuccess: (id: string, successMessage?: string) =>
|
|
13
|
-
moveFileToReject: (id: string, rejectReason?: string) =>
|
|
14
|
-
setShowReUpload: (id: string, showReUpload?: boolean) =>
|
|
10
|
+
getRootProps: GetRootProps;
|
|
11
|
+
getInputProps: GetInputProps;
|
|
12
|
+
handleFileClear: (id: string) => void;
|
|
13
|
+
handleClear: () => void;
|
|
14
|
+
moveFileToProgress: (id: string, progress: FileProgress) => void;
|
|
15
|
+
moveFileToSuccess: (id: string, successMessage?: string) => void;
|
|
16
|
+
moveFileToReject: (id: string, rejectReason?: string) => void;
|
|
17
|
+
setShowReUpload: (id: string, showReUpload?: boolean) => void;
|
|
15
18
|
};
|
|
16
19
|
export declare const useFileUpload: ({ maxFiles, maxSize, accept, disabled, onValidFilesDrop, onRejectedFilesDrop, onFileClear, onClear, }: FileUploadBaseProps) => UseFileUploadReturnProps;
|
|
20
|
+
export {};
|
|
17
21
|
//# sourceMappingURL=useFileUpload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFileUpload/useFileUpload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFileUpload/useFileUpload.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAGvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AAIrC,KAAK,YAAY,GAAG,CAAC,CAAC,SAAS,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAClE,KAAK,aAAa,GAAG,CAAC,CAAC,SAAS,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAEpE,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC9B,aAAa,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;IACjE,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/D,CAAC;AA0JF,eAAO,MAAM,aAAa,GAAI,uGAS3B,mBAAmB,KAAG,wBA+FxB,CAAC"}
|
|
@@ -149,8 +149,6 @@ const useFileUpload = _ref => {
|
|
|
149
149
|
onClear
|
|
150
150
|
} = _ref;
|
|
151
151
|
const [state, dispatch] = React.useReducer(reducer, initialState);
|
|
152
|
-
|
|
153
|
-
// Callbacks for when files are dropped / selected and are valid
|
|
154
152
|
const handleDropAccepted = acceptedFiles => {
|
|
155
153
|
const validFiles = acceptedFiles.map(file => ({
|
|
156
154
|
file,
|
|
@@ -168,8 +166,6 @@ const useFileUpload = _ref => {
|
|
|
168
166
|
});
|
|
169
167
|
onValidFilesDrop?.(validFiles);
|
|
170
168
|
};
|
|
171
|
-
|
|
172
|
-
// Callbacks for when files are dropped / selected and are invalid
|
|
173
169
|
const handleDropRejected = fileRejections => {
|
|
174
170
|
const rejectedFiles = fileRejections.map(_ref2 => {
|
|
175
171
|
let {
|
|
@@ -180,9 +176,7 @@ const useFileUpload = _ref => {
|
|
|
180
176
|
file,
|
|
181
177
|
id: (0, _helpers.uuid)(),
|
|
182
178
|
reject: true,
|
|
183
|
-
rejectReason:
|
|
184
|
-
// @ts-ignore - TS7053 - Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ readonly 'file-too-large': "File exceeds maximum size"; readonly 'file-invalid-type': "Wrong file type"; readonly 'too-many-files': "Too many files"; readonly 'file-too-small': "File is too small"; }'.
|
|
185
|
-
DROPZONE_ERROR_MESSAGES[errors[0].code] || 'Some error occurred uploading this file',
|
|
179
|
+
rejectReason: DROPZONE_ERROR_MESSAGES[errors[0]?.code] ?? 'Some error occurred uploading this file',
|
|
186
180
|
success: false,
|
|
187
181
|
successMessage: undefined,
|
|
188
182
|
progress: undefined,
|
|
@@ -215,8 +209,6 @@ const useFileUpload = _ref => {
|
|
|
215
209
|
progress
|
|
216
210
|
});
|
|
217
211
|
};
|
|
218
|
-
|
|
219
|
-
// Note(Nishant): If the file is found in rejected files, we move it to valid files first in the reducer
|
|
220
212
|
const moveFileToSuccess = (id, successMessage) => {
|
|
221
213
|
dispatch({
|
|
222
214
|
type: 'SET_FILE_SUCCESS',
|
|
@@ -224,8 +216,6 @@ const useFileUpload = _ref => {
|
|
|
224
216
|
successMessage
|
|
225
217
|
});
|
|
226
218
|
};
|
|
227
|
-
|
|
228
|
-
// Note(Nishant): If the file is found in valid files, we move it to rejected files first in the reducer
|
|
229
219
|
const moveFileToReject = (id, rejectReason) => {
|
|
230
220
|
dispatch({
|
|
231
221
|
type: 'SET_FILE_REJECT',
|
|
@@ -233,8 +223,6 @@ const useFileUpload = _ref => {
|
|
|
233
223
|
rejectReason
|
|
234
224
|
});
|
|
235
225
|
};
|
|
236
|
-
|
|
237
|
-
// Note: This is used to show the re-upload button on the file
|
|
238
226
|
const setShowReUpload = (id, showReUpload) => {
|
|
239
227
|
dispatch({
|
|
240
228
|
type: 'SET_FILE_RE_UPLOAD',
|
|
@@ -244,8 +232,6 @@ const useFileUpload = _ref => {
|
|
|
244
232
|
};
|
|
245
233
|
const totalFiles = state.validFiles.length + state.rejectedFiles.length;
|
|
246
234
|
const shouldAcceptFiles = !disabled && (maxFiles === 0 || totalFiles < maxFiles);
|
|
247
|
-
|
|
248
|
-
// We are using react-dropzone's useDropzone hook to get the drag and drop props
|
|
249
235
|
const {
|
|
250
236
|
isDragActive,
|
|
251
237
|
getRootProps,
|
|
@@ -259,17 +245,14 @@ const useFileUpload = _ref => {
|
|
|
259
245
|
noClick: !shouldAcceptFiles,
|
|
260
246
|
noDrag: !shouldAcceptFiles,
|
|
261
247
|
onDropAccepted: handleDropAccepted,
|
|
262
|
-
|
|
263
|
-
onDropRejected: handleDropRejected
|
|
248
|
+
onDropRejected: (rejections, _evt) => handleDropRejected(rejections)
|
|
264
249
|
});
|
|
265
250
|
return {
|
|
266
251
|
validFiles: state.validFiles,
|
|
267
252
|
rejectedFiles: state.rejectedFiles,
|
|
268
253
|
shouldAcceptFiles,
|
|
269
254
|
isDragActive,
|
|
270
|
-
// @ts-ignore - TS2322 - Type '<T extends DropzoneRootProps>(props?: T | undefined) => T' is not assignable to type '(arg1: unknown) => unknown'.
|
|
271
255
|
getRootProps,
|
|
272
|
-
// @ts-ignore - TS2322 - Type '<T extends DropzoneInputProps>(props?: T | undefined) => T' is not assignable to type '(arg1: unknown) => unknown'.
|
|
273
256
|
getInputProps,
|
|
274
257
|
handleFileClear,
|
|
275
258
|
handleClear,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileUpload.stories.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFileUpload/useFileUpload.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;AAe1B,wBAiPE;AAEF,eAAO,MAAM,OAAO,QAAO,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"useFileUpload.stories.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFileUpload/useFileUpload.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;AAe1B,wBAiPE;AAEF,eAAO,MAAM,OAAO,QAAO,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CA0NxE,CAAC"}
|
|
@@ -4,14 +4,18 @@ export type GroupTitleOption<V> = {
|
|
|
4
4
|
options?: V[];
|
|
5
5
|
showLineDivider?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type BaseOption = {
|
|
8
|
+
key: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function useFilteredOptions<V extends BaseOption>({ searchTerm, options, excludedKeys, groupTitleOptions, searchOptionsBy, }: {
|
|
8
12
|
searchTerm: string;
|
|
9
13
|
options?: V[];
|
|
10
14
|
groupTitleOptions?: GroupTitleOption<V>[];
|
|
11
15
|
excludedKeys?: string[];
|
|
12
16
|
searchOptionsBy?: (option: V, searchTerm: string) => boolean;
|
|
13
17
|
}): {
|
|
14
|
-
filteredOptions
|
|
15
|
-
filteredGroupTitleOptions
|
|
18
|
+
filteredOptions: V[];
|
|
19
|
+
filteredGroupTitleOptions: GroupTitleOption<V>[];
|
|
16
20
|
};
|
|
17
21
|
//# sourceMappingURL=useFilteredOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFilteredOptions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFilteredOptions/useFilteredOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"useFilteredOptions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFilteredOptions/useFilteredOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAGF,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,UAAU,EAAE,EACvD,UAAU,EACV,OAAY,EACZ,YAAiB,EACjB,iBAAsB,EAEtB,eAOC,GACF,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IACd,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;CAC9D,GAAG;IACF,eAAe,EAAE,CAAC,EAAE,CAAC;IACrB,yBAAyB,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;CAClD,CA+CA"}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useFilteredOptions = useFilteredOptions;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
9
|
-
//
|
|
9
|
+
// Define a base type that all options must extend
|
|
10
10
|
|
|
11
11
|
function useFilteredOptions(_ref) {
|
|
12
12
|
let {
|
|
@@ -15,8 +15,6 @@ function useFilteredOptions(_ref) {
|
|
|
15
15
|
excludedKeys = [],
|
|
16
16
|
groupTitleOptions = [],
|
|
17
17
|
searchOptionsBy = (option, searchTerm) => {
|
|
18
|
-
// $FlowFixMe
|
|
19
|
-
// @ts-ignore - TS2322 - Type 'V' is not assignable to type '{ label: string; key: string; }'.
|
|
20
18
|
const {
|
|
21
19
|
label,
|
|
22
20
|
key
|
|
@@ -25,9 +23,7 @@ function useFilteredOptions(_ref) {
|
|
|
25
23
|
}
|
|
26
24
|
} = _ref;
|
|
27
25
|
// Memoize the filterExcluded function for performance
|
|
28
|
-
const filterExcluded = React.useCallback(list =>
|
|
29
|
-
//@ts-expect-error
|
|
30
|
-
list ? list.filter(option => !excludedKeys.includes(option.key)) : [], [excludedKeys]);
|
|
26
|
+
const filterExcluded = React.useCallback(list => list ? list.filter(option => !excludedKeys.includes(option.key)) : [], [excludedKeys]);
|
|
31
27
|
return React.useMemo(() => {
|
|
32
28
|
const trimmedValue = (searchTerm || '').trim().toLowerCase();
|
|
33
29
|
|
|
@@ -17,9 +17,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
17
17
|
const useInputState = function () {
|
|
18
18
|
let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
19
19
|
const [state, setState] = React.useState(initialState);
|
|
20
|
-
const setInputState = React.useCallback(
|
|
21
|
-
// @ts-ignore - TS7006 - Parameter 'event' implicitly has an 'any' type.
|
|
22
|
-
event => setState(event && event.target.value), []);
|
|
20
|
+
const setInputState = React.useCallback(event => setState(event.target.value), []);
|
|
23
21
|
return [state, setInputState];
|
|
24
22
|
};
|
|
25
23
|
exports.useInputState = useInputState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMountTransition/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,kBAAkB,GACtB,WAAW,OAAO,EAClB,cAAc,MAAM,KACnB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMountTransition/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,kBAAkB,GACtB,WAAW,OAAO,EAClB,cAAc,MAAM,KACnB,OAiBF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -8,7 +8,6 @@ var _react = require("react");
|
|
|
8
8
|
const useMountTransition = (isMounted, unmountDelay) => {
|
|
9
9
|
const [isTransitioning, setIsTransitioning] = (0, _react.useState)(false);
|
|
10
10
|
(0, _react.useEffect)(() => {
|
|
11
|
-
// @ts-ignore - TS7034 - Variable 'timeoutId' implicitly has type 'any' in some locations where its type cannot be determined.
|
|
12
11
|
let timeoutId;
|
|
13
12
|
if (isMounted && !isTransitioning) {
|
|
14
13
|
setIsTransitioning(true);
|
|
@@ -16,7 +15,6 @@ const useMountTransition = (isMounted, unmountDelay) => {
|
|
|
16
15
|
timeoutId = setTimeout(() => setIsTransitioning(false), unmountDelay);
|
|
17
16
|
}
|
|
18
17
|
return () => {
|
|
19
|
-
// @ts-ignore - TS7005 - Variable 'timeoutId' implicitly has an 'any' type.
|
|
20
18
|
clearTimeout(timeoutId);
|
|
21
19
|
};
|
|
22
20
|
}, [unmountDelay, isMounted, isTransitioning]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PaginationBaseProps, PaginationItemProps } from '../../components/Pagination';
|
|
2
2
|
export declare const usePagination: (props: PaginationBaseProps) => {
|
|
3
|
-
items: PaginationItemProps
|
|
3
|
+
items: Array<PaginationItemProps> | null | undefined;
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=usePagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePagination.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePagination/usePagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"usePagination.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePagination/usePagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EAEpB,MAAM,6BAA6B,CAAC;AAIrC,eAAO,MAAM,aAAa,GACxB,OAAO,mBAAmB,KACzB;IACD,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;CAiJtD,CAAC"}
|
|
@@ -78,7 +78,6 @@ const usePagination = props => {
|
|
|
78
78
|
// Convert the basic item list to contain PaginationItem props objects
|
|
79
79
|
const items = itemList.map((item, idx) => typeof item === 'number' ? {
|
|
80
80
|
id: idx.toString(),
|
|
81
|
-
// @ts-ignore - TS7006 - Parameter 'event' implicitly has an 'any' type.
|
|
82
81
|
onClick: event => {
|
|
83
82
|
handleClick(event, item);
|
|
84
83
|
},
|
|
@@ -88,7 +87,6 @@ const usePagination = props => {
|
|
|
88
87
|
disabled
|
|
89
88
|
} : {
|
|
90
89
|
id: idx.toString(),
|
|
91
|
-
// @ts-ignore - TS7006 - Parameter 'event' implicitly has an 'any' type.
|
|
92
90
|
onClick: event => {
|
|
93
91
|
handleClick(event, buttonPage(item));
|
|
94
92
|
},
|
|
@@ -98,7 +96,6 @@ const usePagination = props => {
|
|
|
98
96
|
disabled: disabled || item.indexOf('ellipsis') === -1 && (item === 'next' || item === 'last' ? currentPage >= totalPages : currentPage <= 1)
|
|
99
97
|
});
|
|
100
98
|
return {
|
|
101
|
-
// @ts-ignore - TS2322 - Type '{ id: string; onClick: (event: any) => void; type: string; page: number | null; selected: boolean; disabled: boolean; }[]' is not assignable to type 'PaginationItemProps[]'.
|
|
102
99
|
items
|
|
103
100
|
};
|
|
104
101
|
};
|
|
@@ -3,7 +3,7 @@ declare const _default: {
|
|
|
3
3
|
tags: string[];
|
|
4
4
|
title: string;
|
|
5
5
|
component: (props: import("../../components/Pagination").PaginationBaseProps) => {
|
|
6
|
-
items: import("../../components/Pagination").PaginationItemProps
|
|
6
|
+
items: Array<import("../../components/Pagination").PaginationItemProps> | null | undefined;
|
|
7
7
|
};
|
|
8
8
|
parameters: {
|
|
9
9
|
docs: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResizeObserver/useResizeObserver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,wBAAgB,iBAAiB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResizeObserver/useResizeObserver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,wBAAgB,iBAAiB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CA0BvE"}
|