@bitrise/bitkit 13.171.0 → 13.173.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 +8 -8
- package/src/Components/Accordion/Accordion.theme.ts +7 -1
- package/src/Components/EmptyState/EmptyState.theme.ts +1 -1
- package/src/Components/EmptyState/EmptyState.tsx +2 -2
- package/src/Components/Filter/FilterForm/FilterForm.tsx +2 -1
- package/src/Components/Form/Form.theme.ts +1 -1
- package/src/Components/Link/Link.tsx +8 -3
- package/src/Components/Table/Table.theme.ts +1 -0
- package/src/Patterns/NotificationCard/NotificationCard.tsx +2 -2
- package/src/hooks/index.ts +1 -2
- package/src/hooks/useHistory.ts +0 -67
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.173.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@floating-ui/react-dom-interactions": "^0.8.1",
|
|
39
39
|
"@fontsource/figtree": "^5.1.1",
|
|
40
40
|
"@fontsource/source-code-pro": "^5.1.0",
|
|
41
|
-
"framer-motion": "^11.11.
|
|
41
|
+
"framer-motion": "^11.11.10",
|
|
42
42
|
"luxon": "^3.5.0",
|
|
43
43
|
"react": "^18.3.1",
|
|
44
44
|
"react-dom": "^18.3.1",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"react-dom": "^18.2.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@babel/core": "^7.
|
|
55
|
-
"@babel/preset-env": "^7.
|
|
56
|
-
"@babel/preset-react": "^7.25.
|
|
57
|
-
"@babel/preset-typescript": "^7.
|
|
54
|
+
"@babel/core": "^7.26.0",
|
|
55
|
+
"@babel/preset-env": "^7.26.0",
|
|
56
|
+
"@babel/preset-react": "^7.25.9",
|
|
57
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
58
58
|
"@bitrise/eslint-plugin": "^2.12.0",
|
|
59
59
|
"@chakra-ui/cli": "^2.5.5",
|
|
60
60
|
"@google-cloud/storage": "^7.13.0",
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
"@testing-library/jest-dom": "6.6.2",
|
|
72
72
|
"@testing-library/react": "16.0.1",
|
|
73
73
|
"@testing-library/user-event": "^14.5.2",
|
|
74
|
-
"@types/jest": "^29.5.
|
|
74
|
+
"@types/jest": "^29.5.14",
|
|
75
75
|
"@types/luxon": "^3.4.2",
|
|
76
|
-
"@types/react": "^18.3.
|
|
76
|
+
"@types/react": "^18.3.12",
|
|
77
77
|
"@types/react-dom": "^18.3.1",
|
|
78
78
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
79
79
|
"@typescript-eslint/parser": "^7.18.0",
|
|
@@ -9,6 +9,10 @@ const AccordionTheme: ComponentStyleConfig = {
|
|
|
9
9
|
_active: {
|
|
10
10
|
background: 'background/active',
|
|
11
11
|
},
|
|
12
|
+
textStyle: 'body/lg/regular',
|
|
13
|
+
_expanded: {
|
|
14
|
+
textStyle: 'body/lg/semibold',
|
|
15
|
+
},
|
|
12
16
|
alignItems: 'center',
|
|
13
17
|
display: 'flex',
|
|
14
18
|
justifyContent: 'space-between',
|
|
@@ -25,7 +29,9 @@ const AccordionTheme: ComponentStyleConfig = {
|
|
|
25
29
|
borderTopColor: 'border/regular',
|
|
26
30
|
},
|
|
27
31
|
panel: {
|
|
28
|
-
|
|
32
|
+
paddingInline: '16',
|
|
33
|
+
paddingTop: '8',
|
|
34
|
+
paddingBottom: '24',
|
|
29
35
|
},
|
|
30
36
|
root: {
|
|
31
37
|
borderBottom: '1px solid',
|
|
@@ -17,11 +17,11 @@ const EmptyState = ({ children, description, iconName, maxContentWidth, title, .
|
|
|
17
17
|
return (
|
|
18
18
|
<Box __css={css.box} {...rest}>
|
|
19
19
|
{iconName && <Icon aria-label={title} name={iconName} size="32" />}
|
|
20
|
-
<Text as="
|
|
20
|
+
<Text as="h4" textStyle="heading/h4" sx={css.title}>
|
|
21
21
|
{title}
|
|
22
22
|
</Text>
|
|
23
23
|
{description && (
|
|
24
|
-
<Text
|
|
24
|
+
<Text textStyle="body/md/regular" sx={css.description}>
|
|
25
25
|
{description}
|
|
26
26
|
</Text>
|
|
27
27
|
)}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormEvent, useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useMultiStyleConfig } from '@chakra-ui/react';
|
|
3
|
+
import FocusLock from 'react-focus-lock';
|
|
3
4
|
import Badge from '../../Badge/Badge';
|
|
4
5
|
import Box from '../../Box/Box';
|
|
5
6
|
import Button from '../../Button/Button';
|
|
@@ -4,6 +4,7 @@ import { TextSizes } from '../../types/bitkit';
|
|
|
4
4
|
export interface LinkProps extends ChakraLinkProps {
|
|
5
5
|
as?: 'a' | 'button';
|
|
6
6
|
colorScheme?: 'purple' | 'white' | 'gray';
|
|
7
|
+
isExternal?: boolean;
|
|
7
8
|
isUnderlined?: boolean;
|
|
8
9
|
size?: TextSizes;
|
|
9
10
|
}
|
|
@@ -12,15 +13,19 @@ export interface LinkProps extends ChakraLinkProps {
|
|
|
12
13
|
* Links are accessible elements used primarily for navigation.
|
|
13
14
|
*/
|
|
14
15
|
const Link = forwardRef<LinkProps, 'a'>((props, ref) => {
|
|
15
|
-
const { as = 'a', isUnderlined, ...rest } = props;
|
|
16
|
-
const properties: ChakraLinkProps = { as
|
|
16
|
+
const { as = 'a', isExternal, isUnderlined, ...rest } = props;
|
|
17
|
+
const properties: ChakraLinkProps = { as };
|
|
18
|
+
if (isExternal) {
|
|
19
|
+
properties.rel = 'noreferrer noopener';
|
|
20
|
+
properties.target = '_blank';
|
|
21
|
+
}
|
|
17
22
|
if (isUnderlined) {
|
|
18
23
|
properties.textDecoration = 'underline';
|
|
19
24
|
}
|
|
20
25
|
if (as === 'button') {
|
|
21
26
|
properties.type = 'button';
|
|
22
27
|
}
|
|
23
|
-
return <ChakraLink as={as} {...properties} ref={ref} />;
|
|
28
|
+
return <ChakraLink as={as} {...properties} {...rest} ref={ref} />;
|
|
24
29
|
});
|
|
25
30
|
|
|
26
31
|
export default Link;
|
|
@@ -85,11 +85,11 @@ const NotificationCard = ({
|
|
|
85
85
|
padding="12"
|
|
86
86
|
paddingInlineEnd="16"
|
|
87
87
|
display="flex"
|
|
88
|
-
gap="
|
|
88
|
+
gap="24"
|
|
89
89
|
justifyContent="space-between"
|
|
90
90
|
alignItems="stretch"
|
|
91
91
|
>
|
|
92
|
-
<Box display="flex" flexDir="column" justifyContent="space-around">
|
|
92
|
+
<Box display="flex" flexDir="column" gap="4" justifyContent="space-around">
|
|
93
93
|
{title && (
|
|
94
94
|
<Text color={color as TextProps['color']} textStyle="body/lg/semibold">
|
|
95
95
|
{title}
|
package/src/hooks/index.ts
CHANGED
package/src/hooks/useHistory.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
type UseLocation = {
|
|
4
|
-
pathname: string;
|
|
5
|
-
push: (url: string) => void;
|
|
6
|
-
replace: (url: string) => void;
|
|
7
|
-
search: string;
|
|
8
|
-
searchParams: URLSearchParams;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const getCurrentLocation = () => ({
|
|
12
|
-
pathname: window.location.pathname,
|
|
13
|
-
search: window.location.search,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const listeners: Array<() => void> = [];
|
|
17
|
-
|
|
18
|
-
const notify = () => {
|
|
19
|
-
listeners.forEach((listener) => listener());
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const getSearchParams = (search: string): URLSearchParams => {
|
|
23
|
-
const searchParams = new URLSearchParams(search);
|
|
24
|
-
return searchParams;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const useLocation = (): UseLocation => {
|
|
28
|
-
const [{ pathname, search }, setLocation] = useState(getCurrentLocation());
|
|
29
|
-
|
|
30
|
-
const handleChange = () => {
|
|
31
|
-
setLocation(getCurrentLocation());
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const push = (url: string) => {
|
|
35
|
-
window.history.pushState(null, '', url);
|
|
36
|
-
notify();
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const replace = (url: string) => {
|
|
40
|
-
window.history.replaceState(null, '', url);
|
|
41
|
-
notify();
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
window.addEventListener('popstate', handleChange);
|
|
46
|
-
return () => {
|
|
47
|
-
window.removeEventListener('popstate', handleChange);
|
|
48
|
-
};
|
|
49
|
-
}, []);
|
|
50
|
-
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
listeners.push(handleChange);
|
|
55
|
-
return () => listeners.splice(listeners.indexOf(handleChange), 1);
|
|
56
|
-
}, []);
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
pathname,
|
|
60
|
-
push,
|
|
61
|
-
replace,
|
|
62
|
-
search,
|
|
63
|
-
searchParams: getSearchParams(search),
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default useLocation;
|