@bitrise/bitkit 13.344.0 → 13.345.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 +1 -0
- 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 +8 -7
- 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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit",
|
|
3
3
|
"description": "Bitrise React component library",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.345.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@babel/preset-env": "^7.28.5",
|
|
56
56
|
"@babel/preset-react": "^7.28.5",
|
|
57
57
|
"@babel/preset-typescript": "^7.28.5",
|
|
58
|
-
"@bitrise/eslint-plugin": "^
|
|
58
|
+
"@bitrise/eslint-plugin": "^4.1.0",
|
|
59
59
|
"@google-cloud/storage": "^7.18.0",
|
|
60
60
|
"@storybook/addon-docs": "^9.1.17",
|
|
61
61
|
"@storybook/addon-links": "^9.1.17",
|
|
@@ -69,11 +69,9 @@
|
|
|
69
69
|
"@types/luxon": "^3.7.1",
|
|
70
70
|
"@types/react": "^18.3.27",
|
|
71
71
|
"@types/react-dom": "^18.3.7",
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
73
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
74
72
|
"axios": "^1.13.2",
|
|
75
73
|
"chakra-ui-2--cli": "npm:@chakra-ui/cli@2.5.8",
|
|
76
|
-
"eslint": "^
|
|
74
|
+
"eslint": "^9.39.2",
|
|
77
75
|
"glob": "^11.1.0",
|
|
78
76
|
"jest": "^29.7.0",
|
|
79
77
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
AccordionButton,
|
|
4
3
|
AccordionIcon,
|
|
@@ -8,6 +7,7 @@ import {
|
|
|
8
7
|
CollapseProps,
|
|
9
8
|
useAccordionStyles,
|
|
10
9
|
} from 'chakra-ui-2--react';
|
|
10
|
+
import { ReactNode } from 'react';
|
|
11
11
|
|
|
12
12
|
export interface AccordionItemProps {
|
|
13
13
|
buttonContent: ReactNode | ((props: { isExpanded: boolean; isDisabled: boolean }) => ReactNode);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
1
|
import { Avatar as ChakraAvatar, AvatarProps as ChakraAvatarProps, forwardRef } from 'chakra-ui-2--react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
|
|
3
4
|
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
4
5
|
|
|
5
6
|
export type AvatarSizes = '24' | '32' | '40' | '48' | '64' | '128';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Children } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
Breadcrumb as ChakraBreadcrumb,
|
|
4
3
|
BreadcrumbItem,
|
|
@@ -6,8 +5,10 @@ import {
|
|
|
6
5
|
BreadcrumbSeparator,
|
|
7
6
|
forwardRef,
|
|
8
7
|
} from 'chakra-ui-2--react';
|
|
9
|
-
import
|
|
8
|
+
import { Children } from 'react';
|
|
9
|
+
|
|
10
10
|
import { useResponsive } from '../../hooks';
|
|
11
|
+
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
11
12
|
|
|
12
13
|
export interface BreadcrumbProps extends ChakraBreadcrumbProps {
|
|
13
14
|
hasSeparatorAfterLast?: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
1
|
import { CollapseProps, useClipboard, useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
|
|
3
4
|
import Box, { BoxProps } from '../Box/Box';
|
|
4
|
-
import Tooltip from '../Tooltip/Tooltip';
|
|
5
5
|
import Button from '../Button/Button';
|
|
6
6
|
import Collapse from '../Collapse/Collapse';
|
|
7
7
|
import IconButton from '../IconButton/IconButton';
|
|
8
|
+
import Tooltip from '../Tooltip/Tooltip';
|
|
8
9
|
|
|
9
10
|
export interface CodeSnippetProps extends Omit<BoxProps, 'children'> {
|
|
10
11
|
children: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
3
4
|
import Box from '../Box/Box';
|
|
4
5
|
import Card, { CardProps } from '../Card/Card';
|
|
5
|
-
import Text from '../Text/Text';
|
|
6
6
|
import Icon from '../Icon/Icon';
|
|
7
|
+
import Text from '../Text/Text';
|
|
7
8
|
import Tooltip from '../Tooltip/Tooltip';
|
|
8
9
|
|
|
9
10
|
export interface DataWidgetProps extends CardProps {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createContext } from 'chakra-ui-2--react-utils';
|
|
2
2
|
import { DateTime } from 'luxon';
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import type { DatePickerDayViewProps } from './DatePickerDay';
|
|
5
|
+
import { DateRange } from './useDateRange';
|
|
5
6
|
|
|
6
7
|
interface Context {
|
|
7
8
|
dayTooltip?: DatePickerDayViewProps['tooltip'];
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PopoverAnchor } from 'chakra-ui-2--react';
|
|
2
2
|
import { DateTime } from 'luxon';
|
|
3
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
4
|
import FocusLock from 'react-focus-lock';
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
import useResponsive from '../../hooks/useResponsive';
|
|
5
7
|
import { useObjectMemo } from '../../utils/utils';
|
|
6
|
-
import Popover from '../Popover/Popover';
|
|
7
|
-
import PopoverContent from '../Popover/PopoverContent';
|
|
8
8
|
import Box from '../Box/Box';
|
|
9
|
-
import useResponsive from '../../hooks/useResponsive';
|
|
10
9
|
import Button from '../Button/Button';
|
|
11
|
-
import
|
|
10
|
+
import Popover from '../Popover/Popover';
|
|
11
|
+
import PopoverContent from '../Popover/PopoverContent';
|
|
12
12
|
import { DatePickerContext } from './DatePicker.context';
|
|
13
|
+
import { DatePickerDayViewProps } from './DatePickerDay';
|
|
14
|
+
import DatePickerFooter from './DatePickerFooter';
|
|
15
|
+
import DatePickerMonth from './DatePickerMonth';
|
|
13
16
|
import DatePickerMonthSelector from './DatePickerMonthSelector';
|
|
14
17
|
import useDateRange, { DateRange } from './useDateRange';
|
|
15
18
|
import useViewDate from './useViewDate';
|
|
16
|
-
import DatePickerFooter from './DatePickerFooter';
|
|
17
|
-
import { DatePickerDayViewProps } from './DatePickerDay';
|
|
18
19
|
|
|
19
|
-
export {
|
|
20
|
+
export { DateRange, useDateRange };
|
|
20
21
|
|
|
21
22
|
export type DatePickerProps = {
|
|
22
23
|
children?: React.ReactNode;
|
|
@@ -128,6 +129,7 @@ const DatePicker = (props: DatePickerProps) => {
|
|
|
128
129
|
);
|
|
129
130
|
|
|
130
131
|
const handleSelect = useCallback(
|
|
132
|
+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
131
133
|
(date: DateTime) => {
|
|
132
134
|
let previewNew: 'from' | 'to' | undefined;
|
|
133
135
|
let dateFromNew = dateFrom;
|
|
@@ -188,6 +190,7 @@ const DatePicker = (props: DatePickerProps) => {
|
|
|
188
190
|
const onMonthClickLeft = useCallback(() => setIsMonthSelector('left'), []);
|
|
189
191
|
const onMonthClickRight = useCallback(() => setIsMonthSelector('right'), []);
|
|
190
192
|
const onMonthSelected = useCallback(
|
|
193
|
+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
191
194
|
(month: number, year: number) => {
|
|
192
195
|
if (isMonthSelector === 'left') {
|
|
193
196
|
updateLeftViewDate({ month, year });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ReactNode, useCallback } from 'react';
|
|
2
|
-
import { DateTime, Settings } from 'luxon';
|
|
3
1
|
import { BoxProps, useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
4
2
|
import { createContext } from 'chakra-ui-2--react-utils';
|
|
3
|
+
import { DateTime, Settings } from 'luxon';
|
|
4
|
+
import { ReactNode, useCallback } from 'react';
|
|
5
|
+
|
|
5
6
|
import Box from '../Box/Box';
|
|
6
7
|
import Text from '../Text/Text';
|
|
7
8
|
import Tooltip from '../Tooltip/Tooltip';
|
|
@@ -139,12 +140,12 @@ const DatePickerDay = ({ n }: { n: number }) => {
|
|
|
139
140
|
} else if (isNextMonth) {
|
|
140
141
|
onNextMonth();
|
|
141
142
|
}
|
|
142
|
-
}, [isPreviousMonth, isSelectable, onSelect, date, onPreviousMonth, onNextMonth]);
|
|
143
|
+
}, [isPreviousMonth, isNextMonth, isSelectable, onSelect, date, onPreviousMonth, onNextMonth]);
|
|
143
144
|
const onMouseEnter = useCallback(() => {
|
|
144
145
|
if (isSelectable) {
|
|
145
146
|
onPreview(date);
|
|
146
147
|
}
|
|
147
|
-
}, [
|
|
148
|
+
}, [onPreview, isSelectable, date]);
|
|
148
149
|
|
|
149
150
|
if (isNextMonth && !showOutsideDays) {
|
|
150
151
|
return null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Box from '../Box/Box';
|
|
2
|
-
import Text from '../Text/Text';
|
|
3
2
|
import Button from '../Button/Button';
|
|
4
3
|
import ButtonGroup from '../ButtonGroup/ButtonGroup';
|
|
5
|
-
import
|
|
4
|
+
import Text from '../Text/Text';
|
|
6
5
|
import { useDatePickerContext } from './DatePicker.context';
|
|
6
|
+
import { DateRange } from './useDateRange';
|
|
7
7
|
|
|
8
8
|
const DatePickerFooter = ({
|
|
9
9
|
mode,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { createContext } from 'chakra-ui-2--react-utils';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
3
4
|
import { useObjectMemo } from '../../utils/utils';
|
|
4
5
|
import Box, { BoxProps } from '../Box/Box';
|
|
5
6
|
import IconButton from '../IconButton/IconButton';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createElement, Fragment, useCallback, useId } from 'react';
|
|
2
|
-
import { DateTime, Info } from 'luxon';
|
|
3
1
|
import {
|
|
4
2
|
NumberDecrementStepper,
|
|
5
3
|
NumberIncrementStepper,
|
|
@@ -7,13 +5,16 @@ import {
|
|
|
7
5
|
NumberInputField,
|
|
8
6
|
NumberInputStepper,
|
|
9
7
|
} from 'chakra-ui-2--react';
|
|
8
|
+
import { DateTime, Info } from 'luxon';
|
|
9
|
+
import { createElement, Fragment, useCallback, useId } from 'react';
|
|
10
|
+
|
|
10
11
|
import { useObjectMemo } from '../../utils/utils';
|
|
11
|
-
import Button from '../Button/Button';
|
|
12
12
|
import Box from '../Box/Box';
|
|
13
|
+
import Button from '../Button/Button';
|
|
13
14
|
import Icon from '../Icon/Icon';
|
|
14
15
|
import Text from '../Text/Text';
|
|
15
|
-
import DatePickerGrid from './DatePickerGrid';
|
|
16
16
|
import DatePickerDay, { DatePickerDayContext } from './DatePickerDay';
|
|
17
|
+
import DatePickerGrid from './DatePickerGrid';
|
|
17
18
|
import DatePickerHeader, {
|
|
18
19
|
DatePickerHeaderContent,
|
|
19
20
|
DatePickerHeaderNext,
|
|
@@ -33,7 +34,7 @@ interface Props {
|
|
|
33
34
|
const days = createElement(
|
|
34
35
|
Fragment,
|
|
35
36
|
{},
|
|
36
|
-
...Array.from({ length: daysCount }).map((_, i) => <DatePickerDay n={i + 1} />),
|
|
37
|
+
...Array.from({ length: daysCount }).map((_, i) => <DatePickerDay key={i} n={i + 1} />),
|
|
37
38
|
);
|
|
38
39
|
|
|
39
40
|
export const datePickerMinYear = 1990;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode, useCallback, useEffect, useId, useRef, useState } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
NumberDecrementStepper,
|
|
4
3
|
NumberIncrementStepper,
|
|
@@ -8,9 +7,11 @@ import {
|
|
|
8
7
|
useMultiStyleConfig,
|
|
9
8
|
} from 'chakra-ui-2--react';
|
|
10
9
|
import { DateTime, Info } from 'luxon';
|
|
10
|
+
import { ReactNode, useCallback, useEffect, useId, useRef, useState } from 'react';
|
|
11
|
+
|
|
11
12
|
import Box from '../Box/Box';
|
|
12
|
-
import Text from '../Text/Text';
|
|
13
13
|
import Icon from '../Icon/Icon';
|
|
14
|
+
import Text from '../Text/Text';
|
|
14
15
|
import DatePickerHeader, {
|
|
15
16
|
DatePickerHeaderContent,
|
|
16
17
|
DatePickerHeaderNext,
|
|
@@ -68,6 +69,7 @@ const DatePickerMonthSelector = ({
|
|
|
68
69
|
const onNextYear = useCallback(() => setSelectedYear((year) => year + 1), []);
|
|
69
70
|
const yearRef = useRef<HTMLInputElement>(null);
|
|
70
71
|
useEffect(() => yearRef.current?.focus(), []);
|
|
72
|
+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
71
73
|
const monthClicked = useCallback((m: number) => onMonthSelected(m, selectedYear), [selectedYear]);
|
|
72
74
|
const monthId = useId();
|
|
73
75
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
1
|
import { DateTime } from 'luxon';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
export class DateRange {
|
|
5
5
|
public from?: DateTime;
|
|
@@ -53,7 +53,9 @@ function useDateRange(arg1?: DateTime | [DateTime | undefined, DateTime | undefi
|
|
|
53
53
|
const fromParts = from?.toObject();
|
|
54
54
|
const toParts = to?.toObject();
|
|
55
55
|
return useMemo(
|
|
56
|
+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
56
57
|
() => new DateRange(from as DateTime | undefined, to as DateTime | undefined),
|
|
58
|
+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
57
59
|
[fromParts?.year, fromParts?.month, fromParts?.day, toParts?.year, toParts?.month, toParts?.day],
|
|
58
60
|
);
|
|
59
61
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
2
|
+
|
|
3
|
+
import Box, { BoxProps } from '../Box/Box';
|
|
2
4
|
import Popover, { PopoverProps } from '../Popover/Popover';
|
|
3
5
|
import PopoverContent from '../Popover/PopoverContent';
|
|
4
6
|
import PopoverTrigger from '../Popover/PopoverTrigger';
|
|
5
|
-
import Box, { BoxProps } from '../Box/Box';
|
|
6
7
|
|
|
7
8
|
export interface DefinitionTooltipProps extends Omit<PopoverProps, 'children'> {
|
|
8
9
|
children: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useId } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
ComponentWithAs,
|
|
4
3
|
Modal,
|
|
@@ -9,6 +8,8 @@ import {
|
|
|
9
8
|
useBreakpointValue,
|
|
10
9
|
usePrefersReducedMotion,
|
|
11
10
|
} from 'chakra-ui-2--react';
|
|
11
|
+
import { useId } from 'react';
|
|
12
|
+
|
|
12
13
|
import { BREAKPOINTS } from '../../types/bitkit';
|
|
13
14
|
import Icon from '../Icon/Icon';
|
|
14
15
|
import Text from '../Text/Text';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
2
1
|
import { ModalBody, ModalBodyProps, useModalContext } from 'chakra-ui-2--react';
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
|
|
3
4
|
import Box, { BoxProps } from '../Box/Box';
|
|
4
5
|
import Icon from '../Icon/Icon';
|
|
5
6
|
import { useDialogContext } from './Dialog.context';
|
|
@@ -32,6 +33,7 @@ const ScrollableDialogBody = (props: DialogBodyProps) => {
|
|
|
32
33
|
|
|
33
34
|
const [isScrollButtonVisible, setIsScrollButtonVisible] = useState(false);
|
|
34
35
|
|
|
36
|
+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
35
37
|
const updateScrollButtonVisibility = useCallback(() => {
|
|
36
38
|
const content = contentRef.current;
|
|
37
39
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
|
|
3
|
-
import { ForwardedRef, forwardRef } from 'react';
|
|
2
|
+
|
|
4
3
|
import { useMultiStyleConfig } from 'chakra-ui-2--react';
|
|
4
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
5
|
+
|
|
5
6
|
import Box from '../Box/Box';
|
|
6
7
|
import Card, { CardProps } from '../Card/Card';
|
|
7
8
|
|
|
@@ -13,7 +14,15 @@ export interface DraggableCardProps extends CardProps {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
const DraggableCard = forwardRef<HTMLDivElement, DraggableCardProps>((props, ref) => {
|
|
16
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
activatorListeners,
|
|
19
|
+
activatorRef,
|
|
20
|
+
children,
|
|
21
|
+
cursor: _cursor,
|
|
22
|
+
isDragging,
|
|
23
|
+
isOverlay: _isOverlay,
|
|
24
|
+
...rest
|
|
25
|
+
} = props;
|
|
17
26
|
|
|
18
27
|
const style = useMultiStyleConfig('DraggableCard', props);
|
|
19
28
|
|
|
@@ -36,4 +45,6 @@ const DraggableCard = forwardRef<HTMLDivElement, DraggableCardProps>((props, ref
|
|
|
36
45
|
);
|
|
37
46
|
});
|
|
38
47
|
|
|
48
|
+
DraggableCard.displayName = 'DraggableCard';
|
|
49
|
+
|
|
39
50
|
export default DraggableCard;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
BoxProps,
|
|
4
3
|
Drawer as ChakraDrawer,
|
|
@@ -15,6 +14,8 @@ import {
|
|
|
15
14
|
ModalHeaderProps,
|
|
16
15
|
ModalOverlayProps,
|
|
17
16
|
} from 'chakra-ui-2--react';
|
|
17
|
+
import { ReactNode } from 'react';
|
|
18
|
+
|
|
18
19
|
import Icon from '../Icon/Icon';
|
|
19
20
|
|
|
20
21
|
export interface DrawerProps extends Pick<
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode, useState } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
DrawerContentProps,
|
|
4
3
|
DrawerProps as ChakraDrawerProps,
|
|
@@ -8,6 +7,8 @@ import {
|
|
|
8
7
|
ModalOverlayProps,
|
|
9
8
|
useDisclosure,
|
|
10
9
|
} from 'chakra-ui-2--react';
|
|
10
|
+
import { ReactNode, useState } from 'react';
|
|
11
|
+
|
|
11
12
|
import Drawer from './Drawer';
|
|
12
13
|
|
|
13
14
|
export type UseDrawerProps = {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode } from 'react';
|
|
2
1
|
import { createStylesContext } from 'chakra-ui-2--react';
|
|
3
2
|
import { createContext } from 'chakra-ui-2--react-utils';
|
|
3
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
4
|
+
|
|
4
5
|
import { DropdownProps } from './DropdownProps';
|
|
5
6
|
|
|
6
7
|
const [DropdownStylesProvider, useDropdownStyles] = createStylesContext('Dropdown');
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { FloatingFocusManager } from '@floating-ui/react-dom-interactions';
|
|
2
|
+
import {
|
|
3
|
+
chakra,
|
|
4
|
+
FormControl,
|
|
5
|
+
FormErrorMessage,
|
|
6
|
+
FormHelperText,
|
|
7
|
+
useControllableState,
|
|
8
|
+
useMergeRefs,
|
|
9
|
+
useMultiStyleConfig,
|
|
10
|
+
} from 'chakra-ui-2--react';
|
|
1
11
|
import React, {
|
|
2
12
|
cloneElement,
|
|
3
13
|
createContext,
|
|
@@ -12,32 +22,23 @@ import React, {
|
|
|
12
22
|
useRef,
|
|
13
23
|
useState,
|
|
14
24
|
} from 'react';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
useMergeRefs,
|
|
22
|
-
useMultiStyleConfig,
|
|
23
|
-
} from 'chakra-ui-2--react';
|
|
24
|
-
import { FloatingFocusManager } from '@floating-ui/react-dom-interactions';
|
|
25
|
+
|
|
26
|
+
import { getDataAttributes } from '../../utils/utils';
|
|
27
|
+
import { AvatarProps } from '../Avatar/Avatar';
|
|
28
|
+
import Box from '../Box/Box';
|
|
29
|
+
import FormLabel from '../Form/FormLabel';
|
|
30
|
+
import IconButton from '../IconButton/IconButton';
|
|
25
31
|
import ProgressSpinner from '../ProgressSpinner/ProgressSpinner';
|
|
26
32
|
import SearchInput from '../SearchInput/SearchInput';
|
|
27
|
-
import FormLabel from '../Form/FormLabel';
|
|
28
|
-
import { AvatarProps } from '../Avatar/Avatar';
|
|
29
|
-
import { getDataAttributes } from '../../utils/utils';
|
|
30
33
|
import Tag from '../Tag/Tag';
|
|
31
|
-
import Box from '../Box/Box';
|
|
32
34
|
import Text from '../Text/Text';
|
|
33
|
-
import IconButton from '../IconButton/IconButton';
|
|
34
35
|
import { DropdownEventArgs, DropdownProvider, useDropdownContext, useDropdownStyles } from './Dropdown.context';
|
|
35
|
-
import { DropdownDetailedOption, DropdownGroup, DropdownOption, DropdownOptionProps } from './DropdownOption';
|
|
36
36
|
import DropdownButton from './DropdownButton';
|
|
37
|
+
import { DropdownDetailedOption, DropdownGroup, DropdownOption, DropdownOptionProps } from './DropdownOption';
|
|
38
|
+
import { DropdownProps } from './DropdownProps';
|
|
37
39
|
import useFloatingDropdown from './hooks/useFloatingDropdown';
|
|
38
40
|
import { NoResultsFound, useSimpleSearch } from './hooks/useSimpleSearch';
|
|
39
41
|
import { isSearchable } from './isNodeMatch';
|
|
40
|
-
import { DropdownProps } from './DropdownProps';
|
|
41
42
|
|
|
42
43
|
const MultiSelectContext = createContext<
|
|
43
44
|
| {
|
|
@@ -98,7 +99,7 @@ const DropdownSearch = ({
|
|
|
98
99
|
/>
|
|
99
100
|
);
|
|
100
101
|
};
|
|
101
|
-
export {
|
|
102
|
+
export { DropdownDetailedOption, DropdownGroup, DropdownOption, DropdownSearch, NoResultsFound };
|
|
102
103
|
|
|
103
104
|
function useOptionListWithIndexes({ children }: { children: ReactNode }) {
|
|
104
105
|
return useMemo(() => {
|
|
@@ -108,6 +109,7 @@ function useOptionListWithIndexes({ children }: { children: ReactNode }) {
|
|
|
108
109
|
if (React.isValidElement(ch)) {
|
|
109
110
|
if (ch.type === DropdownOption || ch.type === DropdownDetailedOption) {
|
|
110
111
|
const index = idx;
|
|
112
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
111
113
|
idx += 1;
|
|
112
114
|
return cloneElement(ch, {
|
|
113
115
|
...ch.props,
|
|
@@ -614,6 +616,8 @@ const Dropdown = forwardRef<Element, DropdownProps<string | null>>(
|
|
|
614
616
|
},
|
|
615
617
|
);
|
|
616
618
|
|
|
619
|
+
Dropdown.displayName = 'Dropdown';
|
|
620
|
+
|
|
617
621
|
export function typedDropdown<T>() {
|
|
618
622
|
return {
|
|
619
623
|
Dropdown: Dropdown as React.ForwardRefExoticComponent<DropdownProps<T> & React.RefAttributes<Element>>,
|
|
@@ -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;
|