@bitrise/bitkit 13.344.0 → 13.346.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/package.json +3 -5
- package/src/Components/Accordion/AccordionItem.tsx +1 -1
- package/src/Components/Avatar/Avatar.theme.ts +1 -0
- package/src/Components/Avatar/Avatar.tsx +2 -1
- package/src/Components/Badge/Badge.theme.ts +1 -0
- package/src/Components/Badge/Badge.tsx +1 -0
- package/src/Components/Breadcrumb/Breadcrumb.tsx +3 -2
- package/src/Components/Button/Button.theme.ts +1 -0
- package/src/Components/Button/Button.tsx +2 -1
- package/src/Components/Card/Card.tsx +1 -0
- package/src/Components/CloseButton/CloseButton.theme.ts +0 -1
- package/src/Components/CloseButton/CloseButton.tsx +1 -0
- package/src/Components/CodeSnippet/CodeSnippet.theme.ts +1 -0
- package/src/Components/CodeSnippet/CodeSnippet.tsx +3 -2
- package/src/Components/ColorButton/ColorButton.tsx +1 -0
- package/src/Components/ControlButton/ControlButton.tsx +1 -0
- package/src/Components/DataWidget/DataWidget.theme.ts +1 -0
- package/src/Components/DataWidget/DataWidget.tsx +3 -2
- package/src/Components/DatePicker/DatePicker.context.ts +2 -1
- package/src/Components/DatePicker/DatePicker.tsx +12 -9
- package/src/Components/DatePicker/DatePickerDay.tsx +5 -4
- package/src/Components/DatePicker/DatePickerFooter.tsx +2 -2
- package/src/Components/DatePicker/DatePickerGrid.tsx +1 -0
- package/src/Components/DatePicker/DatePickerHeader.tsx +2 -1
- package/src/Components/DatePicker/DatePickerMonth.tsx +6 -5
- package/src/Components/DatePicker/DatePickerMonthSelector.tsx +4 -2
- package/src/Components/DatePicker/useDateRange.ts +3 -1
- package/src/Components/DatePicker/useViewDate.ts +1 -1
- package/src/Components/DefinitionTooltip/DefinitionTooltip.theme.ts +1 -0
- package/src/Components/DefinitionTooltip/DefinitionTooltip.tsx +2 -1
- package/src/Components/Dialog/Dialog.context.tsx +1 -0
- package/src/Components/Dialog/Dialog.tsx +2 -1
- package/src/Components/Dialog/DialogBody.tsx +3 -1
- package/src/Components/Dot/Dot.tsx +1 -0
- package/src/Components/DraggableCard/DraggableCard.theme.ts +0 -1
- package/src/Components/DraggableCard/DraggableCard.tsx +14 -3
- package/src/Components/Drawer/Drawer.tsx +2 -1
- package/src/Components/Drawer/useDrawer.tsx +2 -1
- package/src/Components/Dropdown/Dropdown.context.tsx +2 -1
- package/src/Components/Dropdown/Dropdown.tsx +22 -18
- package/src/Components/Dropdown/DropdownButton.tsx +6 -3
- package/src/Components/Dropdown/DropdownOption.tsx +7 -5
- package/src/Components/Dropdown/DropdownProps.ts +4 -3
- package/src/Components/Dropdown/hooks/useFloatingDropdown.ts +2 -1
- package/src/Components/Dropdown/hooks/useSimpleSearch.tsx +4 -3
- package/src/Components/EmptyState/EmptyState.tsx +2 -1
- package/src/Components/ExpandableCard/ExpandableCard.tsx +3 -2
- package/src/Components/Filter/Desktop/Filter.tsx +8 -7
- package/src/Components/Filter/Desktop/FilterAdd/FilterAdd.tsx +2 -1
- package/src/Components/Filter/Desktop/FilterDate/FilterDate.tsx +5 -4
- package/src/Components/Filter/Desktop/FilterForm.tsx +6 -5
- package/src/Components/Filter/Desktop/FilterItem.tsx +3 -2
- package/src/Components/Filter/Desktop/FilterSearch.tsx +2 -1
- package/src/Components/Filter/Desktop/FilterSwitch/FilterSwitch.tsx +5 -4
- package/src/Components/Filter/Desktop/FilterSwitch/FilterSwitchAdapter.tsx +2 -1
- package/src/Components/Filter/Desktop/FilterSwitch/FilterSwitchGroup.tsx +1 -0
- package/src/Components/Filter/Filter.context.tsx +1 -0
- package/src/Components/Filter/Filter.storyData.ts +1 -0
- package/src/Components/Filter/Filter.theme.ts +1 -0
- package/src/Components/Filter/Filter.tsx +16 -2
- package/src/Components/Filter/Filter.types.ts +3 -2
- package/src/Components/Filter/Filter.utils.ts +1 -0
- package/src/Components/Filter/Mobile/DateSelectOption.tsx +1 -0
- package/src/Components/Filter/Mobile/Filter.tsx +11 -11
- package/src/Components/Filter/Mobile/FilterAdd.tsx +4 -3
- package/src/Components/Filter/Mobile/FilterDrawer.tsx +5 -4
- package/src/Components/Filter/Mobile/FilterForm.tsx +9 -8
- package/src/Components/Filter/Mobile/FilterItem.tsx +5 -4
- package/src/Components/Filter/Mobile/FilterSearch.tsx +2 -1
- package/src/Components/Filter/Mobile/MultiSelectOptions.tsx +4 -1
- package/src/Components/Filter/Mobile/SingleSelectOptions.tsx +6 -2
- package/src/Components/Filter/hooks/useFilterAdd.ts +3 -2
- package/src/Components/Filter/hooks/useFilterForm.ts +3 -1
- package/src/Components/Filter/hooks/useIsScrollable.ts +1 -1
- package/src/Components/Filter/hooks/useListBox.ts +2 -1
- package/src/Components/Form/Checkbox/Checkbox.tsx +6 -5
- package/src/Components/Form/Checkbox/CheckboxGroup.tsx +1 -0
- package/src/Components/Form/DateInput/DateInput.tsx +4 -2
- package/src/Components/Form/FileInput/FileInput.tsx +3 -2
- package/src/Components/Form/FormLabel.tsx +4 -3
- package/src/Components/Form/Input/Input.tsx +12 -9
- package/src/Components/Form/Radio/Radio.tsx +4 -4
- package/src/Components/Form/TagsInput/TagsInput.tsx +4 -3
- package/src/Components/Form/Textarea/Textarea.theme.ts +2 -1
- package/src/Components/Form/Textarea/Textarea.tsx +3 -2
- package/src/Components/Icon/Icon.tsx +2 -1
- package/src/Components/IconButton/IconButton.tsx +1 -0
- package/src/Components/Icons/16x16/AppStoreColor.tsx +1 -0
- package/src/Components/Icons/16x16/BitbucketBlue.tsx +1 -0
- package/src/Components/Icons/16x16/BitbucketNeutral.tsx +1 -0
- package/src/Components/Icons/16x16/BitbucketShadedWhite.tsx +1 -0
- package/src/Components/Icons/16x16/BrowserStackColor.tsx +1 -1
- package/src/Components/Icons/16x16/WarningYellow.tsx +1 -0
- package/src/Components/Icons/16x16/index.ts +28 -28
- package/src/Components/Icons/24x24/AppStoreColor.tsx +1 -0
- package/src/Components/Icons/24x24/BitbucketBlue.tsx +1 -0
- package/src/Components/Icons/24x24/BitbucketNeutral.tsx +1 -0
- package/src/Components/Icons/24x24/BitbucketShadedWhite.tsx +1 -0
- package/src/Components/Icons/24x24/BrowserStackColor.tsx +1 -1
- package/src/Components/Icons/24x24/WarningYellow.tsx +1 -0
- package/src/Components/Icons/24x24/index.ts +27 -27
- package/src/Components/Label/Label.tsx +2 -1
- package/src/Components/LabeledData/LabeledData.tsx +3 -2
- package/src/Components/LabeledData/LabeledDataList.tsx +1 -0
- package/src/Components/LightBox/LightBox.tsx +1 -0
- package/src/Components/Link/Link.tsx +1 -0
- package/src/Components/LinkButton/LinkButton.tsx +2 -1
- package/src/Components/List/List.theme.ts +1 -0
- package/src/Components/List/ListItem.tsx +2 -1
- package/src/Components/Menu/Menu.theme.ts +2 -1
- package/src/Components/Menu/MenuItem.tsx +2 -1
- package/src/Components/Note/Note.tsx +3 -2
- package/src/Components/Note/NoteMarkdownContent.tsx +17 -17
- package/src/Components/Notification/Notification.tsx +1 -1
- package/src/Components/OverflowMenu/OverflowMenu.tsx +2 -1
- package/src/Components/OverflowMenu/OverflowMenuItem.tsx +1 -0
- package/src/Components/PaginationLoadMore/PaginationLoadMore.theme.ts +1 -0
- package/src/Components/PaginationLoadMore/PaginationLoadMore.tsx +4 -3
- package/src/Components/Popover/Popover.tsx +2 -1
- package/src/Components/Popover/PopoverContent.tsx +2 -1
- package/src/Components/ProgressBitbot/ProgressBitbot.tsx +1 -0
- package/src/Components/ProgressIndicator/ProgressIndicator.tsx +4 -3
- package/src/Components/Provider/Provider.tsx +3 -3
- package/src/Components/Ribbon/Ribbon.tsx +2 -2
- package/src/Components/SearchInput/SearchInput.tsx +1 -0
- package/src/Components/SegmentedControl/SegmentedControl.tsx +2 -1
- package/src/Components/SegmentedControl/SegmentedControlItem.tsx +1 -0
- package/src/Components/Select/Select.theme.ts +1 -0
- package/src/Components/Select/Select.tsx +4 -3
- package/src/Components/SelectableTag/SelectableTag.theme.ts +1 -0
- package/src/Components/SelectableTag/SelectableTag.tsx +3 -2
- package/src/Components/SelectableTag/SelectableTagGroup.tsx +2 -1
- package/src/Components/Sidebar/Sidebar.tsx +4 -3
- package/src/Components/Sidebar/SidebarItem.tsx +6 -3
- package/src/Components/Skeleton/Skeleton.theme.ts +1 -1
- package/src/Components/Slider/SliderThumb.tsx +1 -0
- package/src/Components/Table/CheckableRow.tsx +2 -1
- package/src/Components/Table/ClickableRow.tsx +2 -1
- package/src/Components/Table/MultiSelectTable.context.tsx +2 -1
- package/src/Components/Table/MultiSelectTh.tsx +3 -0
- package/src/Components/Table/SelectableRow.tsx +2 -1
- package/src/Components/Table/TableCaption.tsx +1 -0
- package/src/Components/Table/TablePagination.tsx +1 -0
- package/src/Components/Table/Th.tsx +3 -2
- package/src/Components/Table/Tr.tsx +3 -2
- package/src/Components/Tabs/ContainedTab.tsx +2 -1
- package/src/Components/Tabs/Tab.tsx +2 -1
- package/src/Components/Tabs/TabList.tsx +3 -2
- package/src/Components/Tabs/Tabs.theme.ts +1 -0
- package/src/Components/Tabs/useTabs.ts +2 -0
- package/src/Components/Tag/Tag.theme.ts +2 -1
- package/src/Components/Tag/Tag.tsx +2 -1
- package/src/Components/Text/Text.theme.ts +1 -0
- package/src/Components/Text/Text.tsx +1 -0
- package/src/Components/Toast/Toast.tsx +2 -1
- package/src/Components/Toggle/Toggle.tsx +4 -3
- package/src/Components/Toggle/ToggleComponent.tsx +2 -1
- package/src/Components/ToggleButton/ToggleButton.tsx +1 -0
- package/src/Components/Toggletip/Toggletip.theme.ts +1 -0
- package/src/Components/Toggletip/Toggletip.tsx +6 -5
- package/src/Components/TreeView/TreeView.context.tsx +2 -1
- package/src/Components/TreeView/TreeView.theme.ts +1 -0
- package/src/Components/TreeView/TreeView.tsx +3 -2
- package/src/Components/TreeView/TreeView.types.ts +4 -3
- package/src/Components/TreeView/TreeViewGroup.tsx +1 -0
- package/src/Components/TreeView/TreeViewNode.tsx +10 -4
- package/src/Components/components.theme.ts +31 -31
- package/src/Patterns/GroupHeader/GroupHeader.tsx +2 -1
- package/src/Patterns/NoteCard/NoteCard.theme.ts +1 -0
- package/src/Patterns/NoteCard/NoteCard.tsx +7 -6
- package/src/Patterns/SettingsCard/SettingsCard.tsx +6 -5
- package/src/hooks/useResponsive.tsx +2 -1
- package/src/index.ts +215 -336
- package/src/theme.ts +1 -2
- package/src/utils/reexports.ts +2 -2
- package/src/utils/utils.ts +1 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { forwardRef, ReactNode } from 'react';
|
|
2
1
|
import { chakra, ChakraProps } from 'chakra-ui-2--react';
|
|
3
|
-
import
|
|
2
|
+
import { forwardRef, ReactNode } from 'react';
|
|
3
|
+
|
|
4
4
|
import Avatar, { AvatarProps } from '../Avatar/Avatar';
|
|
5
|
+
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
5
6
|
import { useDropdownStyles } from './Dropdown.context';
|
|
6
7
|
import { DropdownProps } from './DropdownProps';
|
|
7
8
|
|
|
@@ -26,7 +27,7 @@ const DropdownButton = forwardRef<HTMLButtonElement, DropdownButtonProps>(
|
|
|
26
27
|
{
|
|
27
28
|
avatar,
|
|
28
29
|
blurHandler,
|
|
29
|
-
children,
|
|
30
|
+
children: _,
|
|
30
31
|
disabled,
|
|
31
32
|
formLabel,
|
|
32
33
|
iconName,
|
|
@@ -93,4 +94,6 @@ const DropdownButton = forwardRef<HTMLButtonElement, DropdownButtonProps>(
|
|
|
93
94
|
},
|
|
94
95
|
);
|
|
95
96
|
|
|
97
|
+
DropdownButton.displayName = 'DropdownButton';
|
|
98
|
+
|
|
96
99
|
export default DropdownButton;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { MouseEventHandler, ReactNode, useId } from 'react';
|
|
2
1
|
import { Avatar, AvatarProps, chakra } from 'chakra-ui-2--react';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import { MouseEventHandler, ReactNode, useId } from 'react';
|
|
4
|
+
|
|
6
5
|
import Box from '../Box/Box';
|
|
7
|
-
import
|
|
6
|
+
import Divider from '../Divider/Divider';
|
|
8
7
|
import Checkbox from '../Form/Checkbox/Checkbox';
|
|
8
|
+
import Icon from '../Icon/Icon';
|
|
9
|
+
import Text, { TextProps } from '../Text/Text';
|
|
9
10
|
import { useDropdownContext, useDropdownStyles } from './Dropdown.context';
|
|
10
11
|
|
|
11
12
|
export type DropdownOptionProps<T> = {
|
|
@@ -36,6 +37,7 @@ const DropdownOption = <T = string,>({
|
|
|
36
37
|
<chakra.div
|
|
37
38
|
ref={(node) => {
|
|
38
39
|
if (ctx.listRef.current) {
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, react-hooks/immutability
|
|
39
41
|
ctx.listRef.current[index!] = node;
|
|
40
42
|
}
|
|
41
43
|
}}
|
|
@@ -145,4 +147,4 @@ const DropdownDetailedOption = <T = string,>({
|
|
|
145
147
|
};
|
|
146
148
|
DropdownDetailedOption.searchable = true;
|
|
147
149
|
|
|
148
|
-
export {
|
|
150
|
+
export { DropdownDetailedOption, DropdownGroup, DropdownOption };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ChakraProps } from 'chakra-ui-2--react';
|
|
3
1
|
import { UseFloatingProps } from '@floating-ui/react-dom-interactions';
|
|
2
|
+
import { ChakraProps } from 'chakra-ui-2--react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
import { FormLabelProps } from '../Form/FormLabel';
|
|
4
6
|
import { TypeIconName } from '../Icon/Icon';
|
|
5
7
|
import { TooltipProps } from '../Tooltip/Tooltip';
|
|
6
|
-
import { FormLabelProps } from '../Form/FormLabel';
|
|
7
8
|
|
|
8
9
|
type DropdownInstance<T> = { value: T; name?: string };
|
|
9
10
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { KeyboardEvent, RefObject, useEffect, useRef, useState } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
autoUpdate,
|
|
4
3
|
flip,
|
|
@@ -14,6 +13,8 @@ import {
|
|
|
14
13
|
} from '@floating-ui/react-dom-interactions';
|
|
15
14
|
import { ChakraProps } from 'chakra-ui-2--react';
|
|
16
15
|
import { mergeRefs } from 'chakra-ui-2--react-utils';
|
|
16
|
+
import { KeyboardEvent, RefObject, useEffect, useRef, useState } from 'react';
|
|
17
|
+
|
|
17
18
|
import useAutoScroll from './useAutoScroll';
|
|
18
19
|
|
|
19
20
|
type ApplyFnArgs = MiddlewareState & {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Children, cloneElement, isValidElement, ReactNode, useMemo, useState } from 'react';
|
|
2
1
|
import { chakra } from 'chakra-ui-2--react';
|
|
2
|
+
import { Children, cloneElement, isValidElement, ReactNode, useMemo, useState } from 'react';
|
|
3
|
+
|
|
3
4
|
import { useDropdownStyles } from '../Dropdown.context';
|
|
4
|
-
import isNodeMatch from '../isNodeMatch';
|
|
5
5
|
import { DropdownGroup } from '../DropdownOption';
|
|
6
|
+
import isNodeMatch from '../isNodeMatch';
|
|
6
7
|
|
|
7
8
|
const NoResultsFound = ({ children }: { children: ReactNode }) => {
|
|
8
9
|
const { item } = useDropdownStyles();
|
|
@@ -44,4 +45,4 @@ function useSimpleSearch({ children, onSearch }: { children?: ReactNode; onSearc
|
|
|
44
45
|
|
|
45
46
|
return { children: options, searchOnChange, searchValue };
|
|
46
47
|
}
|
|
47
|
-
export {
|
|
48
|
+
export { NoResultsFound, useSimpleSearch };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { forwardRef, useDisclosure, useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
3
4
|
import Box, { BoxProps } from '../Box/Box';
|
|
4
|
-
import Collapse from '../Collapse/Collapse';
|
|
5
5
|
import Card, { CardProps } from '../Card/Card';
|
|
6
|
+
import Collapse from '../Collapse/Collapse';
|
|
6
7
|
import Icon from '../Icon/Icon';
|
|
7
8
|
|
|
8
9
|
export interface ExpandableCardProps extends Omit<
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Modal, ModalOverlay, useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
2
|
+
|
|
2
3
|
import Box from '../../Box/Box';
|
|
3
|
-
import Icon from '../../Icon/Icon';
|
|
4
4
|
import Button from '../../Button/Button';
|
|
5
5
|
import Divider from '../../Divider/Divider';
|
|
6
|
-
import
|
|
6
|
+
import Icon from '../../Icon/Icon';
|
|
7
7
|
import { useFilterContext } from '../Filter.context';
|
|
8
|
+
import { FilterProps } from '../Filter.types';
|
|
8
9
|
import FilterAdd from './FilterAdd/FilterAdd';
|
|
9
10
|
import FilterDate from './FilterDate/FilterDate';
|
|
10
11
|
import FilterItem from './FilterItem';
|
|
@@ -13,16 +14,16 @@ import FilterSwitchAdapter from './FilterSwitch/FilterSwitchAdapter';
|
|
|
13
14
|
|
|
14
15
|
const Filter = (props: FilterProps) => {
|
|
15
16
|
const {
|
|
16
|
-
data,
|
|
17
|
-
defaultState,
|
|
18
|
-
filtersDependOn,
|
|
17
|
+
data: _data,
|
|
18
|
+
defaultState: _defaultState,
|
|
19
|
+
filtersDependOn: _filtersDependOn,
|
|
19
20
|
isLoading,
|
|
20
21
|
isMobile,
|
|
21
|
-
onChange,
|
|
22
|
+
onChange: _onChange,
|
|
22
23
|
searchTooltip,
|
|
23
24
|
showAdd = true,
|
|
24
25
|
showFilterIcon = true,
|
|
25
|
-
showClearFilters = true,
|
|
26
|
+
showClearFilters: _showClearFilters = true,
|
|
26
27
|
showSearch,
|
|
27
28
|
...rest
|
|
28
29
|
} = props;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Menu, MenuButton, MenuList, Portal } from 'chakra-ui-2--react';
|
|
2
|
+
|
|
2
3
|
import Button from '../../../Button/Button';
|
|
3
4
|
import MenuItem from '../../../Menu/MenuItem';
|
|
4
5
|
import Tooltip from '../../../Tooltip/Tooltip';
|
|
5
6
|
import { useFilterContext } from '../../Filter.context';
|
|
6
|
-
import FilterForm from '../FilterForm';
|
|
7
7
|
import { FilterValue } from '../../Filter.types';
|
|
8
8
|
import { getMissingDependencies } from '../../Filter.utils';
|
|
9
9
|
import useFilterAdd from '../../hooks/useFilterAdd';
|
|
10
|
+
import FilterForm from '../FilterForm';
|
|
10
11
|
|
|
11
12
|
export interface FilterAddProps {
|
|
12
13
|
onChange: (category: string, selected: FilterValue) => void;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
1
|
import { useDisclosure, useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
3
2
|
import { DateTime } from 'luxon';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
import Box from '../../../Box/Box';
|
|
4
6
|
import DatePicker, { DatePickerProps, DateRange, useDateRange } from '../../../DatePicker/DatePicker';
|
|
7
|
+
import Icon from '../../../Icon/Icon';
|
|
8
|
+
import Text from '../../../Text/Text';
|
|
5
9
|
import { useFilterContext } from '../../Filter.context';
|
|
6
10
|
import { FilterStyle } from '../../Filter.theme';
|
|
7
11
|
import { FilterCategoryProps } from '../../Filter.types';
|
|
8
|
-
import Box from '../../../Box/Box';
|
|
9
|
-
import Text from '../../../Text/Text';
|
|
10
|
-
import Icon from '../../../Icon/Icon';
|
|
11
12
|
|
|
12
13
|
export type FilterDateProps = {
|
|
13
14
|
category: string;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
2
2
|
import FocusLock from 'react-focus-lock';
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import Badge from '../../Badge/Badge';
|
|
5
5
|
import Box from '../../Box/Box';
|
|
6
6
|
import Button from '../../Button/Button';
|
|
7
7
|
import ButtonGroup from '../../ButtonGroup/ButtonGroup';
|
|
8
8
|
import Checkbox from '../../Form/Checkbox/Checkbox';
|
|
9
9
|
import CheckboxGroup from '../../Form/Checkbox/CheckboxGroup';
|
|
10
|
-
import Icon from '../../Icon/Icon';
|
|
11
10
|
import Input from '../../Form/Input/Input';
|
|
11
|
+
import Radio from '../../Form/Radio/Radio';
|
|
12
|
+
import RadioGroup from '../../Form/Radio/RadioGroup';
|
|
13
|
+
import Icon from '../../Icon/Icon';
|
|
12
14
|
import List from '../../List/List';
|
|
13
15
|
import ListItem from '../../List/ListItem';
|
|
14
16
|
import ProgressSpinner from '../../ProgressSpinner/ProgressSpinner';
|
|
15
|
-
import Radio from '../../Form/Radio/Radio';
|
|
16
|
-
import RadioGroup from '../../Form/Radio/RadioGroup';
|
|
17
17
|
import SearchInput from '../../SearchInput/SearchInput';
|
|
18
18
|
import Text from '../../Text/Text';
|
|
19
|
+
import Tooltip from '../../Tooltip/Tooltip';
|
|
20
|
+
import { useFilterContext } from '../Filter.context';
|
|
19
21
|
import { FilterStyle } from '../Filter.theme';
|
|
20
22
|
import { FilterFormProps, FilterOptions, FilterValue } from '../Filter.types';
|
|
21
23
|
import { getOptionLabel } from '../Filter.utils';
|
|
22
|
-
import { useFilterContext } from '../Filter.context';
|
|
23
24
|
import useFilterForm, { MAX_ITEMS } from '../hooks/useFilterForm';
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
1
|
import { useDisclosure, useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
|
|
3
4
|
import Box from '../../Box/Box';
|
|
4
5
|
import Icon from '../../Icon/Icon';
|
|
5
6
|
import IconButton from '../../IconButton/IconButton';
|
|
@@ -8,9 +9,9 @@ import PopoverContent from '../../Popover/PopoverContent';
|
|
|
8
9
|
import PopoverTrigger from '../../Popover/PopoverTrigger';
|
|
9
10
|
import Text from '../../Text/Text';
|
|
10
11
|
import Tooltip from '../../Tooltip/Tooltip';
|
|
12
|
+
import { useFilterContext } from '../Filter.context';
|
|
11
13
|
import { FilterStyle } from '../Filter.theme';
|
|
12
14
|
import { FilterValue } from '../Filter.types';
|
|
13
|
-
import { useFilterContext } from '../Filter.context';
|
|
14
15
|
import { getOptionLabel } from '../Filter.utils';
|
|
15
16
|
import FilterForm from './FilterForm';
|
|
16
17
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ChangeEvent, ReactNode, useEffect, useState } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
Input,
|
|
4
3
|
InputGroup,
|
|
@@ -7,6 +6,8 @@ import {
|
|
|
7
6
|
InputRightElement,
|
|
8
7
|
useMultiStyleConfig,
|
|
9
8
|
} from 'chakra-ui-2--react';
|
|
9
|
+
import { ChangeEvent, ReactNode, useEffect, useState } from 'react';
|
|
10
|
+
|
|
10
11
|
import Icon from '../../Icon/Icon';
|
|
11
12
|
import IconButton from '../../IconButton/IconButton';
|
|
12
13
|
import Tooltip from '../../Tooltip/Tooltip';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
chakra,
|
|
4
3
|
forwardRef,
|
|
@@ -7,12 +6,14 @@ import {
|
|
|
7
6
|
useRadio,
|
|
8
7
|
useRadioGroupContext,
|
|
9
8
|
} from 'chakra-ui-2--react';
|
|
10
|
-
import { omitThemingProps } from 'chakra-ui-2--styled-system';
|
|
11
9
|
import { createContext } from 'chakra-ui-2--react-utils';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
10
|
+
import { omitThemingProps } from 'chakra-ui-2--styled-system';
|
|
11
|
+
import { useMemo } from 'react';
|
|
12
|
+
|
|
14
13
|
import Box from '../../../Box/Box';
|
|
14
|
+
import Divider from '../../../Divider/Divider';
|
|
15
15
|
import Icon, { TypeIconName } from '../../../Icon/Icon';
|
|
16
|
+
import Text from '../../../Text/Text';
|
|
16
17
|
|
|
17
18
|
type RadioInputProps = ChakraRadioProps['inputProps'] & {
|
|
18
19
|
'data-testid'?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
+
|
|
2
3
|
import { useFilterContext } from '../../Filter.context';
|
|
3
|
-
import { getOptionLabel } from '../../Filter.utils';
|
|
4
4
|
import { FilterCategoryProps } from '../../Filter.types';
|
|
5
|
+
import { getOptionLabel } from '../../Filter.utils';
|
|
5
6
|
import FilterSwitch from './FilterSwitch';
|
|
6
7
|
import FilterSwitchGroup from './FilterSwitchGroup';
|
|
7
8
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react';
|
|
2
|
+
|
|
2
3
|
import { isEqual } from '../../utils/utils';
|
|
4
|
+
import FilterDesktop from './Desktop/Filter';
|
|
3
5
|
import { FilterContext } from './Filter.context';
|
|
4
6
|
import { FilterContextType, FilterProps, Filters, FilterState, FilterValue } from './Filter.types';
|
|
5
7
|
import { getDependents } from './Filter.utils';
|
|
6
8
|
import FilterMobile from './Mobile/Filter';
|
|
7
|
-
import FilterDesktop from './Desktop/Filter';
|
|
8
9
|
|
|
9
10
|
const Filter = (props: FilterProps) => {
|
|
10
11
|
const { data, defaultState, filtersDependOn, isLoading, isMobile, onChange, showClearFilters = true, state } = props;
|
|
@@ -93,7 +94,20 @@ const Filter = (props: FilterProps) => {
|
|
|
93
94
|
setSelectedCategory,
|
|
94
95
|
state: cleanState,
|
|
95
96
|
}),
|
|
96
|
-
[
|
|
97
|
+
[
|
|
98
|
+
data,
|
|
99
|
+
filters,
|
|
100
|
+
filtersDependOn,
|
|
101
|
+
isPopoverOpen,
|
|
102
|
+
isLoading,
|
|
103
|
+
onClearFilters,
|
|
104
|
+
onFilterChange,
|
|
105
|
+
onFilterClear,
|
|
106
|
+
selectedCategory,
|
|
107
|
+
showClearButton,
|
|
108
|
+
setPopoverOpen,
|
|
109
|
+
cleanState,
|
|
110
|
+
],
|
|
97
111
|
);
|
|
98
112
|
|
|
99
113
|
return (
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
2
|
-
|
|
3
|
-
import { DatePickerProps, DateRange } from '../DatePicker/DatePicker';
|
|
2
|
+
|
|
4
3
|
import { BoxProps } from '../Box/Box';
|
|
4
|
+
import { DatePickerProps, DateRange } from '../DatePicker/DatePicker';
|
|
5
|
+
import { TypeIconName } from '../Icon/Icon';
|
|
5
6
|
|
|
6
7
|
export type FilterType = 'dateRange' | 'search' | 'select' | 'switch' | 'tag';
|
|
7
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Divider from '../../Divider/Divider';
|
|
2
1
|
import Badge from '../../Badge/Badge';
|
|
3
|
-
import Text from '../../Text/Text';
|
|
4
|
-
import Button from '../../Button/Button';
|
|
5
2
|
import Box from '../../Box/Box';
|
|
3
|
+
import Button from '../../Button/Button';
|
|
4
|
+
import Divider from '../../Divider/Divider';
|
|
5
|
+
import Text from '../../Text/Text';
|
|
6
6
|
import { useFilterContext } from '../Filter.context';
|
|
7
7
|
import { FilterProps } from '../Filter.types';
|
|
8
8
|
import FilterDrawer from './FilterDrawer';
|
|
@@ -11,16 +11,16 @@ import FilterSearch from './FilterSearch';
|
|
|
11
11
|
|
|
12
12
|
const Filter = (props: FilterProps) => {
|
|
13
13
|
const {
|
|
14
|
-
data:
|
|
15
|
-
defaultState,
|
|
16
|
-
filtersDependOn,
|
|
14
|
+
data: _initialData,
|
|
15
|
+
defaultState: _defaultState,
|
|
16
|
+
filtersDependOn: _filtersDependOn,
|
|
17
17
|
isLoading,
|
|
18
|
-
isMobile,
|
|
19
|
-
onChange,
|
|
20
|
-
searchTooltip,
|
|
18
|
+
isMobile: _isMobile,
|
|
19
|
+
onChange: _onChange,
|
|
20
|
+
searchTooltip: _searchTooltip,
|
|
21
21
|
showAdd = true,
|
|
22
|
-
showFilterIcon = true,
|
|
23
|
-
showClearFilters = true,
|
|
22
|
+
showFilterIcon: _showFilterIcon = true,
|
|
23
|
+
showClearFilters: _showClearFilters = true,
|
|
24
24
|
showSearch,
|
|
25
25
|
...rest
|
|
26
26
|
} = props;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Modal, ModalOverlay, Portal } from 'chakra-ui-2--react';
|
|
2
|
+
|
|
3
|
+
import Box from '../../Box/Box';
|
|
4
|
+
import Button from '../../Button/Button';
|
|
2
5
|
import Menu from '../../Menu/Menu';
|
|
3
6
|
import MenuItem from '../../Menu/MenuItem';
|
|
4
|
-
import Button from '../../Button/Button';
|
|
5
|
-
import Box from '../../Box/Box';
|
|
6
7
|
import Text from '../../Text/Text';
|
|
8
|
+
import { useFilterContext } from '../Filter.context';
|
|
7
9
|
import { getMissingDependencies } from '../Filter.utils';
|
|
8
10
|
import useFilterAdd from '../hooks/useFilterAdd';
|
|
9
|
-
import { useFilterContext } from '../Filter.context';
|
|
10
11
|
import FilterForm from './FilterForm';
|
|
11
12
|
|
|
12
13
|
const FilterAdd = () => {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { DialogProps } from '../../Dialog/DialogProps';
|
|
2
|
+
|
|
4
3
|
import Box from '../../Box/Box';
|
|
5
4
|
import Button from '../../Button/Button';
|
|
6
|
-
import
|
|
5
|
+
import ButtonGroup from '../../ButtonGroup/ButtonGroup';
|
|
6
|
+
import type { DialogProps } from '../../Dialog/DialogProps';
|
|
7
7
|
import Divider from '../../Divider/Divider';
|
|
8
|
+
import Drawer from '../../Drawer/Drawer';
|
|
8
9
|
import Text from '../../Text/Text';
|
|
9
10
|
import { useFilterContext } from '../Filter.context';
|
|
10
|
-
import FilterItem from './FilterItem';
|
|
11
11
|
import FilterAdd from './FilterAdd';
|
|
12
|
+
import FilterItem from './FilterItem';
|
|
12
13
|
|
|
13
14
|
const FilterDrawer = ({
|
|
14
15
|
isOpen,
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
|
-
|
|
3
|
-
import Divider from '../../Divider/Divider';
|
|
4
|
-
import SearchInput from '../../SearchInput/SearchInput';
|
|
5
|
-
import ControlButton from '../../ControlButton/ControlButton';
|
|
6
|
-
import Text from '../../Text/Text';
|
|
7
|
-
import type { DialogProps } from '../../Dialog/DialogProps';
|
|
2
|
+
|
|
8
3
|
import Box from '../../Box/Box';
|
|
9
4
|
import Button from '../../Button/Button';
|
|
5
|
+
import ButtonGroup from '../../ButtonGroup/ButtonGroup';
|
|
6
|
+
import ControlButton from '../../ControlButton/ControlButton';
|
|
7
|
+
import type { DialogProps } from '../../Dialog/DialogProps';
|
|
8
|
+
import Divider from '../../Divider/Divider';
|
|
10
9
|
import Drawer from '../../Drawer/Drawer';
|
|
10
|
+
import ProgressSpinner from '../../ProgressSpinner/ProgressSpinner';
|
|
11
|
+
import SearchInput from '../../SearchInput/SearchInput';
|
|
12
|
+
import Text from '../../Text/Text';
|
|
11
13
|
import { useFilterContext } from '../Filter.context';
|
|
12
|
-
import useFilterForm from '../hooks/useFilterForm';
|
|
13
14
|
import { FilterValue } from '../Filter.types';
|
|
14
|
-
import
|
|
15
|
+
import useFilterForm from '../hooks/useFilterForm';
|
|
15
16
|
import useIsScrollable from '../hooks/useIsScrollable';
|
|
16
17
|
import DateSelectOption from './DateSelectOption';
|
|
17
18
|
import MultiSelectOptions from './MultiSelectOptions';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { useId } from 'react';
|
|
2
1
|
import { FormControl } from 'chakra-ui-2--react';
|
|
3
|
-
import
|
|
4
|
-
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
|
|
5
4
|
import Box from '../../Box/Box';
|
|
5
|
+
import Button from '../../Button/Button';
|
|
6
|
+
import FormLabel from '../../Form/FormLabel';
|
|
6
7
|
import Icon from '../../Icon/Icon';
|
|
7
|
-
import Text from '../../Text/Text';
|
|
8
8
|
import IconButton from '../../IconButton/IconButton';
|
|
9
|
+
import Text from '../../Text/Text';
|
|
9
10
|
import { useFilterContext } from '../Filter.context';
|
|
10
11
|
import { getDateRangeLabel, getOptionLabel } from '../Filter.utils';
|
|
11
12
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
1
|
import { InputProps } from 'chakra-ui-2--react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
|
|
3
4
|
import { useDebounce } from '../../../utils/utils';
|
|
4
5
|
import SearchInput from '../../SearchInput/SearchInput';
|
|
5
6
|
import { FilterValue } from '../Filter.types';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Checkbox, CheckboxGroup } from 'chakra-ui-2--react';
|
|
2
|
+
|
|
2
3
|
import Box from '../../Box/Box';
|
|
3
4
|
import Text from '../../Text/Text';
|
|
4
5
|
import { FilterOptionsMap } from '../Filter.types';
|
|
@@ -30,12 +31,14 @@ const MultiSelectOptions = ({
|
|
|
30
31
|
<CheckboxGroup onChange={onChange} value={selectedItems}>
|
|
31
32
|
<Box>
|
|
32
33
|
{items.length ? (
|
|
33
|
-
items?.slice(0, MAX_ITEMS).map((option) => {
|
|
34
|
+
items?.slice(0, MAX_ITEMS).map((option, index) => {
|
|
34
35
|
const id = `checkbox-${option}`;
|
|
35
36
|
const isSelected = selectedItems.includes(option);
|
|
37
|
+
const key = `${id}-${index}`;
|
|
36
38
|
|
|
37
39
|
return (
|
|
38
40
|
<Box
|
|
41
|
+
key={key}
|
|
39
42
|
alignItems="center"
|
|
40
43
|
as="label"
|
|
41
44
|
backgroundColor={isSelected ? 'background/selected' : 'transparent'}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import Box from '../../Box/Box';
|
|
4
|
+
import Icon from '../../Icon/Icon';
|
|
4
5
|
import Text from '../../Text/Text';
|
|
5
|
-
import { getOptionLabel } from '../Filter.utils';
|
|
6
6
|
import { FilterOptionsMap } from '../Filter.types';
|
|
7
|
+
import { getOptionLabel } from '../Filter.utils';
|
|
7
8
|
import { MAX_ITEMS } from '../hooks/useFilterForm';
|
|
8
9
|
import useListBox from '../hooks/useListBox';
|
|
9
10
|
|
|
@@ -113,8 +114,11 @@ const SingleSelectOptions = ({
|
|
|
113
114
|
{items.length ? (
|
|
114
115
|
items?.slice(0, MAX_ITEMS).map((option, index) => {
|
|
115
116
|
const isSelected = selectedItems.includes(option);
|
|
117
|
+
const key = `${option}-${index}`;
|
|
118
|
+
|
|
116
119
|
return (
|
|
117
120
|
<Option
|
|
121
|
+
key={key}
|
|
118
122
|
index={index}
|
|
119
123
|
isActive={activeIndex === index}
|
|
120
124
|
isSelected={isSelected}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
1
|
import { useDisclosure } from 'chakra-ui-2--react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
|
|
3
4
|
import { useFilterContext } from '../Filter.context';
|
|
4
|
-
import { hasAllDependencies } from '../Filter.utils';
|
|
5
5
|
import { FilterValue } from '../Filter.types';
|
|
6
|
+
import { hasAllDependencies } from '../Filter.utils';
|
|
6
7
|
|
|
7
8
|
type UseFilterAddProps = {
|
|
8
9
|
isMobile?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FormEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
|
|
2
3
|
import { isEqual, useDebounce } from '../../../utils/utils';
|
|
3
4
|
import { useFilterContext } from '../Filter.context';
|
|
4
5
|
import { FilterFormProps, FilterOptions, FilterOptionsMap, FilterValue } from '../Filter.types';
|
|
@@ -13,6 +14,7 @@ const useFilterForm = (props: Omit<FilterFormProps, 'onCancel'>) => {
|
|
|
13
14
|
const categoryData = data[category] || {};
|
|
14
15
|
const { isPatternEnabled, preserveOptionOrder, isInitialLoading, onAsyncSearch, options, optionsMap } = categoryData;
|
|
15
16
|
|
|
17
|
+
// eslint-disable-next-line react-hooks/use-memo
|
|
16
18
|
const value = useMemo(() => state[category] || [], [category, JSON.stringify(state[category])]);
|
|
17
19
|
|
|
18
20
|
const [selected, setSelected] = useState<FilterValue>(value);
|
|
@@ -99,7 +101,7 @@ const useFilterForm = (props: Omit<FilterFormProps, 'onCancel'>) => {
|
|
|
99
101
|
setFoundOptionsMap(response.optionsMap || optionsMap);
|
|
100
102
|
setLoading(false);
|
|
101
103
|
}
|
|
102
|
-
} catch
|
|
104
|
+
} catch {
|
|
103
105
|
if (requestId === latestRequestRef.current) {
|
|
104
106
|
setLoading(false);
|
|
105
107
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { ReactNode, Ref } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
Checkbox as ChakraCheckbox,
|
|
4
|
-
CheckboxProps as ChakraCheckboxProps,
|
|
5
3
|
CheckboxIconProps,
|
|
6
|
-
|
|
4
|
+
CheckboxProps as ChakraCheckboxProps,
|
|
7
5
|
FormControl,
|
|
8
|
-
FormHelperText,
|
|
9
|
-
FormErrorMessage,
|
|
10
6
|
FormControlProps,
|
|
7
|
+
FormErrorMessage,
|
|
8
|
+
FormHelperText,
|
|
9
|
+
forwardRef,
|
|
11
10
|
} from 'chakra-ui-2--react';
|
|
11
|
+
import { ReactNode, Ref } from 'react';
|
|
12
|
+
|
|
12
13
|
import Icon from '../../Icon/Icon';
|
|
13
14
|
|
|
14
15
|
type CheckboxInputProps = ChakraCheckboxProps['inputProps'] & {
|