@bitrise/bitkit 10.25.2 → 10.26.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 +1 -4
- package/src/Components/Breadcrumb/Breadcrumb.stories.tsx +39 -20
- package/src/Components/Breadcrumb/Breadcrumb.theme.ts +12 -3
- package/src/Components/Breadcrumb/Breadcrumb.tsx +2 -3
- package/src/Components/Breadcrumb/BreadcrumbLink.tsx +2 -3
- package/src/Components/Dialog/Dialog.tsx +1 -1
- package/src/Components/LightBox/LightBox.tsx +1 -1
- package/src/Components/Ribbon/Ribbon.tsx +2 -14
- package/src/Foundations/Responsive/Responsive.examples.tsx +3 -3
- package/src/Old/hooks/index.ts +0 -1
- package/src/old.ts +0 -9
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Old/Dropdown/Dropdown.tsx +0 -101
- package/src/Old/Dropdown/DropdownMenu.css +0 -48
- package/src/Old/Dropdown/DropdownMenu.tsx +0 -35
- package/src/Old/Dropdown/DropdownMenuItem.tsx +0 -62
- package/src/Old/Dropdown/DropdownMenuItemGroup.tsx +0 -19
- package/src/Old/hooks/useCopyToClipboard.ts +0 -25
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit",
|
|
3
3
|
"description": "Bitrise React component library",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.26.0",
|
|
5
5
|
"repository": "git@github.com:bitrise-io/bitkit.git",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"license": "UNLICENSED",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"@floating-ui/react-dom-interactions": "^0.8.1",
|
|
29
29
|
"@popperjs/core": "^2.11.5",
|
|
30
30
|
"classnames": "^2.3.1",
|
|
31
|
-
"clipboard": "^2.0.11",
|
|
32
31
|
"framer-motion": "^6.5.1",
|
|
33
32
|
"luxon": "^2.5.0",
|
|
34
33
|
"react": "^18.2.0",
|
|
@@ -66,7 +65,6 @@
|
|
|
66
65
|
"@testing-library/react": "^13.3.0",
|
|
67
66
|
"@testing-library/user-event": "^14.3.0",
|
|
68
67
|
"@types/cheerio": "^0.22.31",
|
|
69
|
-
"@types/clipboard": "^2.0.1",
|
|
70
68
|
"@types/enzyme": "^3.10.12",
|
|
71
69
|
"@types/jest": "^28.1.6",
|
|
72
70
|
"@types/luxon": "^2.4.0",
|
|
@@ -109,7 +107,6 @@
|
|
|
109
107
|
},
|
|
110
108
|
"files": [
|
|
111
109
|
"src",
|
|
112
|
-
"icons.ts",
|
|
113
110
|
"tsconfig.json"
|
|
114
111
|
],
|
|
115
112
|
"publishConfig": {
|
|
@@ -1,30 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentMeta } from '@storybook/react';
|
|
2
2
|
import Breadcrumb from './Breadcrumb';
|
|
3
3
|
import BreadcrumbLink from './BreadcrumbLink';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
title: 'Components/Breadcrumb',
|
|
7
6
|
component: Breadcrumb,
|
|
8
7
|
subcomponents: { BreadcrumbLink },
|
|
8
|
+
args: {
|
|
9
|
+
hasSeparatorAfterLast: true,
|
|
10
|
+
hasSeparatorBeforeFirst: false,
|
|
11
|
+
},
|
|
9
12
|
} as ComponentMeta<typeof Breadcrumb>;
|
|
10
13
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
export const DefaultVersion = {
|
|
15
|
+
args: {
|
|
16
|
+
children: [
|
|
17
|
+
<BreadcrumbLink
|
|
18
|
+
avatarUrl="https://bitrise-public-content-production.s3.amazonaws.com/org-icons/default_avatar-02.png"
|
|
19
|
+
href="#"
|
|
20
|
+
>
|
|
21
|
+
Bitrise #Core
|
|
22
|
+
</BreadcrumbLink>,
|
|
23
|
+
<BreadcrumbLink avatarName="Bitkit" href="#">
|
|
24
|
+
bitkit
|
|
25
|
+
</BreadcrumbLink>,
|
|
26
|
+
<BreadcrumbLink isCurrentPage>settings</BreadcrumbLink>,
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
25
30
|
|
|
26
|
-
export const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
export const WithLongText = {
|
|
32
|
+
args: {
|
|
33
|
+
children: [
|
|
34
|
+
<BreadcrumbLink
|
|
35
|
+
avatarUrl="https://bitrise-public-content-production.s3.amazonaws.com/org-icons/default_avatar-02.png"
|
|
36
|
+
href="#"
|
|
37
|
+
>
|
|
38
|
+
Bitrise #Core
|
|
39
|
+
</BreadcrumbLink>,
|
|
40
|
+
<BreadcrumbLink avatarName="Bitkit" href="#">
|
|
41
|
+
Bitkit
|
|
42
|
+
</BreadcrumbLink>,
|
|
43
|
+
<BreadcrumbLink href="#">
|
|
44
|
+
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in
|
|
45
|
+
some form, by injected humour, or randomised words which don't look even slightly believable.
|
|
46
|
+
</BreadcrumbLink>,
|
|
47
|
+
],
|
|
48
|
+
},
|
|
30
49
|
};
|
|
@@ -8,13 +8,22 @@ const BreadcrumbTheme: SystemStyleObject = {
|
|
|
8
8
|
alignItems: 'center',
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
|
+
item: {
|
|
12
|
+
_last: {
|
|
13
|
+
minWidth: 0,
|
|
14
|
+
'.chakra-breadcrumb__link': {
|
|
15
|
+
display: 'block',
|
|
16
|
+
maxWidth: '100%',
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
textOverflow: 'ellipsis',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
11
22
|
link: {
|
|
12
23
|
display: 'flex',
|
|
13
24
|
alignItems: 'center',
|
|
14
25
|
gap: '8',
|
|
15
|
-
'
|
|
16
|
-
color: 'red',
|
|
17
|
-
},
|
|
26
|
+
whiteSpace: 'nowrap',
|
|
18
27
|
},
|
|
19
28
|
separator: {
|
|
20
29
|
display: 'flex',
|
|
@@ -5,10 +5,9 @@ import {
|
|
|
5
5
|
BreadcrumbItem,
|
|
6
6
|
BreadcrumbSeparator,
|
|
7
7
|
forwardRef,
|
|
8
|
-
useBreakpointValue,
|
|
9
8
|
} from '@chakra-ui/react';
|
|
10
|
-
import { BREAKPOINTS } from '../../Foundations/Breakpoints/Breakpoints';
|
|
11
9
|
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
10
|
+
import { useResponsive } from '../../hooks';
|
|
12
11
|
|
|
13
12
|
export interface BreadcrumbProps extends ChakraBreadcrumbProps {
|
|
14
13
|
hasSeparatorAfterLast?: boolean;
|
|
@@ -21,7 +20,7 @@ export interface BreadcrumbProps extends ChakraBreadcrumbProps {
|
|
|
21
20
|
*/
|
|
22
21
|
const Breadcrumb = forwardRef<BreadcrumbProps, 'nav'>((props, ref) => {
|
|
23
22
|
const { children, hasSeparatorAfterLast, hasSeparatorBeforeFirst, separatorIconName, ...rest } = props;
|
|
24
|
-
const isMobile =
|
|
23
|
+
const { isMobile } = useResponsive();
|
|
25
24
|
|
|
26
25
|
const childrenCount = Children.count(children);
|
|
27
26
|
const items = Children.map(children, (child, index) => {
|
|
@@ -2,10 +2,9 @@ import {
|
|
|
2
2
|
BreadcrumbLink as ChakraBreadcrumbLink,
|
|
3
3
|
BreadcrumbLinkProps as ChakraBreadcrumbLinkProps,
|
|
4
4
|
forwardRef,
|
|
5
|
-
useBreakpointValue,
|
|
6
5
|
} from '@chakra-ui/react';
|
|
7
|
-
import { BREAKPOINTS } from '../../Foundations/Breakpoints/Breakpoints';
|
|
8
6
|
import Avatar from '../Avatar/Avatar';
|
|
7
|
+
import { useResponsive } from '../../hooks';
|
|
9
8
|
|
|
10
9
|
export interface BreadcrumbLinkProps extends ChakraBreadcrumbLinkProps {
|
|
11
10
|
avatarName?: string;
|
|
@@ -14,7 +13,7 @@ export interface BreadcrumbLinkProps extends ChakraBreadcrumbLinkProps {
|
|
|
14
13
|
|
|
15
14
|
const BreadcrumbLink = forwardRef<BreadcrumbLinkProps, 'a'>((props, ref) => {
|
|
16
15
|
const { avatarName, avatarUrl, children, isCurrentPage, ...rest } = props;
|
|
17
|
-
const isMobile =
|
|
16
|
+
const { isMobile } = useResponsive();
|
|
18
17
|
|
|
19
18
|
const properties: ChakraBreadcrumbLinkProps = {
|
|
20
19
|
color: isCurrentPage ? 'neutral.40' : 'inherit',
|
|
@@ -37,7 +37,7 @@ const Dialog = ({
|
|
|
37
37
|
variant,
|
|
38
38
|
...rest
|
|
39
39
|
}: DialogProps) => {
|
|
40
|
-
const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.
|
|
40
|
+
const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.TABLET]: size });
|
|
41
41
|
const prefersReducedMotion = usePrefersReducedMotion({ ssr: false });
|
|
42
42
|
|
|
43
43
|
return (
|
|
@@ -17,7 +17,7 @@ export interface LightBoxProps extends Omit<HTMLChakraProps<'section'>, 'scrollB
|
|
|
17
17
|
|
|
18
18
|
const LightBox = ({ children, dataTestid, size, isOpen, onClose, ...rest }: LightBoxProps) => {
|
|
19
19
|
const prefersReducedMotion = usePrefersReducedMotion({ ssr: false });
|
|
20
|
-
const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.
|
|
20
|
+
const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.TABLET]: size });
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<Modal isOpen={isOpen} motionPreset={prefersReducedMotion ? 'none' : 'scale'} onClose={onClose} size={dialogSize}>
|
|
@@ -2,7 +2,6 @@ import { createContext, useContext, useMemo } from 'react';
|
|
|
2
2
|
import { Alert as ChakraAlert, AlertProps, forwardRef } from '@chakra-ui/react';
|
|
3
3
|
|
|
4
4
|
import { ColorScheme } from '../../Foundations/Colors/Colors';
|
|
5
|
-
import { BREAKPOINTS } from '../../Foundations/Breakpoints/Breakpoints';
|
|
6
5
|
import CloseButton from '../CloseButton/CloseButton';
|
|
7
6
|
import ColorButton, { ColorButtonProps } from '../ColorButton/ColorButton';
|
|
8
7
|
import Icon from '../Icon/Icon';
|
|
@@ -62,19 +61,8 @@ const Ribbon = forwardRef<RibbonProps, 'div'>((props, ref) => {
|
|
|
62
61
|
{...rest}
|
|
63
62
|
>
|
|
64
63
|
<ActionContext.Provider value={actionContext}>
|
|
65
|
-
{onClose &&
|
|
66
|
-
|
|
67
|
-
display={{ [BREAKPOINTS.MOBILE]: 'none', [BREAKPOINTS.DESKTOP]: 'block' }}
|
|
68
|
-
width={24}
|
|
69
|
-
height={24}
|
|
70
|
-
marginEnd="auto"
|
|
71
|
-
/>
|
|
72
|
-
)}
|
|
73
|
-
<Box
|
|
74
|
-
display="flex"
|
|
75
|
-
flexDirection={{ [BREAKPOINTS.MOBILE]: 'column', [BREAKPOINTS.DESKTOP]: 'row' }}
|
|
76
|
-
gap={{ [BREAKPOINTS.MOBILE]: 12, [BREAKPOINTS.DESKTOP]: 16 }}
|
|
77
|
-
>
|
|
64
|
+
{onClose && <Box display={['none', 'block']} width={24} height={24} marginEnd="auto" />}
|
|
65
|
+
<Box display="flex" flexDirection={['column', 'row']} gap={['12', '16']}>
|
|
78
66
|
{children}
|
|
79
67
|
{actionButton}
|
|
80
68
|
</Box>
|
|
@@ -47,9 +47,9 @@ export const Responsive = () => {
|
|
|
47
47
|
This Box is
|
|
48
48
|
<List>
|
|
49
49
|
<ListItem>green below 848px (53rem)</ListItem>
|
|
50
|
-
<ListItem>purple from 848px (53rem)
|
|
51
|
-
<ListItem>red from 1280px (80rem)
|
|
52
|
-
<ListItem>gray from 1616px (101rem)</ListItem>
|
|
50
|
+
<ListItem>purple from 848px (53rem)</ListItem>
|
|
51
|
+
<ListItem>but red from 1280px (80rem)</ListItem>
|
|
52
|
+
<ListItem>but gray from 1616px (101rem)</ListItem>
|
|
53
53
|
</List>
|
|
54
54
|
</Box>
|
|
55
55
|
</CardContent>
|
package/src/Old/hooks/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { default as useCopyToClipboard } from './useCopyToClipboard';
|
|
2
1
|
export { default as useEventListener } from './useEventListener';
|
|
3
2
|
export { default as useMediaQuery } from './useMediaQuery';
|
|
4
3
|
export { default as useSyncedStateAndProps } from './useSyncedStateAndProps';
|
package/src/old.ts
CHANGED
|
@@ -15,15 +15,6 @@ export { default as Base } from './Old/Base/Base';
|
|
|
15
15
|
export type { Props as DatePickerProps } from './Old/DatePicker/DatePicker';
|
|
16
16
|
export { default as DatePicker } from './Old/DatePicker/DatePicker';
|
|
17
17
|
|
|
18
|
-
export type { Props as DropdownMenuProps } from './Old/Dropdown/DropdownMenu';
|
|
19
|
-
export { default as DropdownMenu } from './Old/Dropdown/DropdownMenu';
|
|
20
|
-
|
|
21
|
-
export type { Props as DropdownMenuItemProps } from './Old/Dropdown/DropdownMenuItem';
|
|
22
|
-
export { default as DropdownMenuItem } from './Old/Dropdown/DropdownMenuItem';
|
|
23
|
-
|
|
24
|
-
export type { Props as DropdownMenuItemGroupProps } from './Old/Dropdown/DropdownMenuItemGroup';
|
|
25
|
-
export { default as DropdownMenuItemGroup } from './Old/Dropdown/DropdownMenuItemGroup';
|
|
26
|
-
|
|
27
18
|
export type { Props as FlexProps } from './Old/Flex/Flex';
|
|
28
19
|
export { default as Flex } from './Old/Flex/Flex';
|
|
29
20
|
|