@bitrise/bitkit 13.319.0 → 13.321.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 +19 -19
- package/src/Components/Dialog/DialogProps.ts +1 -2
- package/src/Components/Drawer/Drawer.tsx +4 -2
- package/src/Components/ExpandableCard/ExpandableCard.tsx +23 -24
- package/src/Components/Filter/Mobile/Filter.tsx +6 -1
- package/src/Components/Filter/Mobile/FilterForm.tsx +5 -3
- package/src/Components/Filter/Mobile/FilterItem.tsx +4 -0
- package/src/Components/Filter/hooks/useFilterForm.ts +6 -2
- package/src/Components/Form/Checkbox/Checkbox.tsx +4 -2
- package/src/Components/Form/Radio/Radio.tsx +4 -2
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.321.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"chakra-ui-2--theme": "npm:@chakra-ui/theme@3.4.9",
|
|
39
39
|
"chakra-ui-2--theme-tools": "npm:@chakra-ui/theme-tools@2.2.9",
|
|
40
40
|
"clsx": "^2.1.1",
|
|
41
|
-
"framer-motion": "^12.23.
|
|
41
|
+
"framer-motion": "^12.23.24",
|
|
42
42
|
"luxon": "^3.7.2",
|
|
43
43
|
"react": "^18.3.1",
|
|
44
44
|
"react-dom": "^18.3.1",
|
|
45
|
-
"react-focus-lock": "2.13.
|
|
45
|
+
"react-focus-lock": "2.13.7",
|
|
46
46
|
"react-imask": "^7.6.1",
|
|
47
47
|
"react-markdown": "^10.1.0"
|
|
48
48
|
},
|
|
@@ -51,39 +51,39 @@
|
|
|
51
51
|
"react-dom": "^18.2.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@babel/core": "^7.28.
|
|
55
|
-
"@babel/preset-env": "^7.28.
|
|
56
|
-
"@babel/preset-react": "^7.
|
|
57
|
-
"@babel/preset-typescript": "^7.
|
|
54
|
+
"@babel/core": "^7.28.5",
|
|
55
|
+
"@babel/preset-env": "^7.28.5",
|
|
56
|
+
"@babel/preset-react": "^7.28.5",
|
|
57
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
58
58
|
"@bitrise/eslint-plugin": "^2.12.0",
|
|
59
|
-
"@google-cloud/storage": "^7.17.
|
|
60
|
-
"@storybook/addon-docs": "^9.1.
|
|
61
|
-
"@storybook/addon-links": "^9.1.
|
|
59
|
+
"@google-cloud/storage": "^7.17.3",
|
|
60
|
+
"@storybook/addon-docs": "^9.1.16",
|
|
61
|
+
"@storybook/addon-links": "^9.1.16",
|
|
62
62
|
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
|
|
63
|
-
"@storybook/react-webpack5": "^9.1.
|
|
63
|
+
"@storybook/react-webpack5": "^9.1.16",
|
|
64
64
|
"@testing-library/dom": "^10.4.1",
|
|
65
65
|
"@testing-library/jest-dom": "6.9.1",
|
|
66
66
|
"@testing-library/react": "16.3.0",
|
|
67
67
|
"@testing-library/user-event": "^14.6.1",
|
|
68
68
|
"@types/jest": "^29.5.14",
|
|
69
69
|
"@types/luxon": "^3.7.1",
|
|
70
|
-
"@types/react": "^18.3.
|
|
70
|
+
"@types/react": "^18.3.27",
|
|
71
71
|
"@types/react-dom": "^18.3.7",
|
|
72
72
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
73
73
|
"@typescript-eslint/parser": "^7.18.0",
|
|
74
|
-
"axios": "^1.
|
|
74
|
+
"axios": "^1.13.2",
|
|
75
75
|
"chakra-ui-2--cli": "npm:@chakra-ui/cli@2.5.8",
|
|
76
76
|
"eslint": "^8.57.1",
|
|
77
|
-
"glob": "^11.0
|
|
77
|
+
"glob": "^11.1.0",
|
|
78
78
|
"jest": "^29.7.0",
|
|
79
79
|
"jest-environment-jsdom": "^29.7.0",
|
|
80
80
|
"jsdom": "26.1.0",
|
|
81
81
|
"lodash": "^4.17.21",
|
|
82
|
-
"prettier": "^3.
|
|
83
|
-
"react-hook-form": "^7.
|
|
84
|
-
"release-it": "^19.0.
|
|
85
|
-
"storybook": "^9.1.
|
|
86
|
-
"ts-jest": "^29.4.
|
|
82
|
+
"prettier": "^3.7.3",
|
|
83
|
+
"react-hook-form": "^7.67.0",
|
|
84
|
+
"release-it": "^19.0.6",
|
|
85
|
+
"storybook": "^9.1.16",
|
|
86
|
+
"ts-jest": "^29.4.5",
|
|
87
87
|
"typescript": "^5.9.3"
|
|
88
88
|
},
|
|
89
89
|
"files": [
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { HTMLChakraProps, ModalProps } from 'chakra-ui-2--react';
|
|
2
2
|
|
|
3
3
|
export interface DialogProps
|
|
4
|
-
extends Omit<HTMLChakraProps<'section'>, 'scrollBehavior'>,
|
|
5
|
-
Pick<ModalProps, 'returnFocusOnClose'> {
|
|
4
|
+
extends Omit<HTMLChakraProps<'section'>, 'scrollBehavior'>, Pick<ModalProps, 'returnFocusOnClose'> {
|
|
6
5
|
isClosable?: boolean;
|
|
7
6
|
isOpen: boolean;
|
|
8
7
|
onClose(): void;
|
|
@@ -17,8 +17,10 @@ import {
|
|
|
17
17
|
} from 'chakra-ui-2--react';
|
|
18
18
|
import Icon from '../Icon/Icon';
|
|
19
19
|
|
|
20
|
-
export interface DrawerProps
|
|
21
|
-
|
|
20
|
+
export interface DrawerProps extends Pick<
|
|
21
|
+
ChakraDrawerProps,
|
|
22
|
+
'finalFocusRef' | 'initialFocusRef' | 'isOpen' | 'onClose' | 'onCloseComplete'
|
|
23
|
+
> {
|
|
22
24
|
blockScrollOnMount?: boolean;
|
|
23
25
|
bodyRef?: React.RefObject<HTMLDivElement>;
|
|
24
26
|
children: DrawerContentProps['children'];
|
|
@@ -5,30 +5,29 @@ import Collapse from '../Collapse/Collapse';
|
|
|
5
5
|
import Card, { CardProps } from '../Card/Card';
|
|
6
6
|
import Icon from '../Icon/Icon';
|
|
7
7
|
|
|
8
|
-
export interface ExpandableCardProps
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
> {
|
|
8
|
+
export interface ExpandableCardProps extends Omit<
|
|
9
|
+
CardProps,
|
|
10
|
+
| 'p'
|
|
11
|
+
| 'pt'
|
|
12
|
+
| 'paddingTop'
|
|
13
|
+
| 'pr'
|
|
14
|
+
| 'paddingRight'
|
|
15
|
+
| 'pe'
|
|
16
|
+
| 'paddingEnd'
|
|
17
|
+
| 'pb'
|
|
18
|
+
| 'paddingBottom'
|
|
19
|
+
| 'pl'
|
|
20
|
+
| 'paddingLeft'
|
|
21
|
+
| 'ps'
|
|
22
|
+
| 'paddingStart'
|
|
23
|
+
| 'px'
|
|
24
|
+
| 'paddingX'
|
|
25
|
+
| 'py'
|
|
26
|
+
| 'paddingY'
|
|
27
|
+
| 'paddingInlineStart'
|
|
28
|
+
| 'paddingInlineEnd'
|
|
29
|
+
| 'onChange'
|
|
30
|
+
> {
|
|
32
31
|
buttonContent: ReactNode;
|
|
33
32
|
buttonPadding?: BoxProps['padding'];
|
|
34
33
|
isExpanded?: boolean;
|
|
@@ -9,6 +9,7 @@ import FilterForm from './FilterForm';
|
|
|
9
9
|
|
|
10
10
|
const Filter = ({ isLoading, showAdd = true }: FilterProps) => {
|
|
11
11
|
const {
|
|
12
|
+
data,
|
|
12
13
|
isPopoverOpen,
|
|
13
14
|
onClearFilters,
|
|
14
15
|
selectedCategory,
|
|
@@ -18,7 +19,11 @@ const Filter = ({ isLoading, showAdd = true }: FilterProps) => {
|
|
|
18
19
|
state,
|
|
19
20
|
} = useFilterContext();
|
|
20
21
|
|
|
21
|
-
const
|
|
22
|
+
const isAllOptionForSwitch = (category: string) => {
|
|
23
|
+
return data[category].type === 'switch' && state[category]?.[0] === 'all';
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const count = Object.entries(state).filter(([name, item]) => item?.length > 0 && !isAllOptionForSwitch(name)).length;
|
|
22
27
|
|
|
23
28
|
return (
|
|
24
29
|
<>
|
|
@@ -66,8 +66,10 @@ const FilterForm = ({ isOpen, onClose, selectedCategory }: FilterFormProps) => {
|
|
|
66
66
|
onChange,
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
const adjustedItems = type === 'switch' ? items.filter((item) => item !== 'all') : items;
|
|
70
|
+
|
|
69
71
|
const { isScrollable } = useIsScrollable({
|
|
70
|
-
items,
|
|
72
|
+
items: adjustedItems,
|
|
71
73
|
hasNotFilteredOption,
|
|
72
74
|
ref: bodyRef,
|
|
73
75
|
});
|
|
@@ -198,7 +200,7 @@ const FilterForm = ({ isOpen, onClose, selectedCategory }: FilterFormProps) => {
|
|
|
198
200
|
currentOptionMap={currentOptionMap}
|
|
199
201
|
emptyText={getEmptyText()}
|
|
200
202
|
isLoading={isLoading}
|
|
201
|
-
items={
|
|
203
|
+
items={adjustedItems}
|
|
202
204
|
onChange={setSelected}
|
|
203
205
|
selectedItems={selected}
|
|
204
206
|
/>
|
|
@@ -209,7 +211,7 @@ const FilterForm = ({ isOpen, onClose, selectedCategory }: FilterFormProps) => {
|
|
|
209
211
|
emptyText={getEmptyText()}
|
|
210
212
|
hasNotFilteredOption={hasNotFilteredOption}
|
|
211
213
|
isLoading={isLoading}
|
|
212
|
-
items={
|
|
214
|
+
items={adjustedItems}
|
|
213
215
|
onChange={(option: string) => {
|
|
214
216
|
onChange(selectedCategory, [option]);
|
|
215
217
|
}}
|
|
@@ -34,6 +34,10 @@ const FilterItem = ({ category }: FilterItemProps) => {
|
|
|
34
34
|
return `${value.length} ${pluralCategoryString}`;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
if (type === 'switch' && value[0] === 'all') {
|
|
38
|
+
return `All ${pluralCategoryString}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
37
41
|
return getOptionLabel(value[0], optionsMap);
|
|
38
42
|
};
|
|
39
43
|
|
|
@@ -65,8 +65,12 @@ const useFilterForm = (props: Omit<FilterFormProps, 'onCancel'>) => {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
const onClearClick = () => {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
let newValue: FilterValue = [];
|
|
69
|
+
if (data[category]?.type === 'switch') {
|
|
70
|
+
newValue = ['all'];
|
|
71
|
+
}
|
|
72
|
+
setSelected(newValue);
|
|
73
|
+
onChange(category, newValue, value);
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
const getEmptyText = () => {
|
|
@@ -15,8 +15,10 @@ type CheckboxInputProps = ChakraCheckboxProps['inputProps'] & {
|
|
|
15
15
|
'data-testid'?: string;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
export interface CheckboxProps
|
|
19
|
-
|
|
18
|
+
export interface CheckboxProps extends Omit<
|
|
19
|
+
FormControlProps,
|
|
20
|
+
'icon' | 'iconColor' | 'iconSize' | 'inputProps' | 'value' | 'onChange'
|
|
21
|
+
> {
|
|
20
22
|
inputProps?: CheckboxInputProps;
|
|
21
23
|
helperText?: ReactNode;
|
|
22
24
|
errorText?: string;
|
|
@@ -13,8 +13,10 @@ type RadioInputProps = ChakraRadioProps['inputProps'] & {
|
|
|
13
13
|
'data-testid'?: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export interface RadioProps
|
|
17
|
-
|
|
16
|
+
export interface RadioProps extends Omit<
|
|
17
|
+
FormControlProps,
|
|
18
|
+
'icon' | 'iconColor' | 'iconSize' | 'inputProps' | 'value' | 'onChange'
|
|
19
|
+
> {
|
|
18
20
|
inputProps?: RadioInputProps;
|
|
19
21
|
helperText?: ReactNode;
|
|
20
22
|
errorText?: string;
|