@bitrise/bitkit 12.81.0 → 12.82.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit",
|
|
3
3
|
"description": "Bitrise React component library",
|
|
4
|
-
"version": "12.
|
|
4
|
+
"version": "12.82.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"react-dom": "^18.2.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@babel/core": "^7.23.
|
|
51
|
-
"@babel/preset-env": "^7.23.
|
|
50
|
+
"@babel/core": "^7.23.9",
|
|
51
|
+
"@babel/preset-env": "^7.23.9",
|
|
52
52
|
"@babel/preset-react": "^7.23.3",
|
|
53
53
|
"@babel/preset-typescript": "^7.23.3",
|
|
54
54
|
"@bitrise/eslint-plugin": "^2.3.3",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@storybook/react-webpack5": "^7.6.10",
|
|
65
65
|
"@storybook/theming": "^7.6.10",
|
|
66
66
|
"@testing-library/dom": "^9.3.4",
|
|
67
|
-
"@testing-library/jest-dom": "^6.
|
|
67
|
+
"@testing-library/jest-dom": "^6.3.0",
|
|
68
68
|
"@testing-library/react": "^14.1.2",
|
|
69
69
|
"@testing-library/user-event": "^14.5.2",
|
|
70
70
|
"@types/jest": "^29.5.11",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@types/react-dom": "^18.2.18",
|
|
74
74
|
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
|
75
75
|
"@typescript-eslint/parser": "^6.19.1",
|
|
76
|
-
"axios": "^1.6.
|
|
76
|
+
"axios": "^1.6.6",
|
|
77
77
|
"eslint": "^8.56.0",
|
|
78
78
|
"eslint-plugin-import": "^2.29.1",
|
|
79
79
|
"eslint-plugin-jest": "^27.6.3",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"jsdom": "^24.0.0",
|
|
90
90
|
"prettier": "^3.2.4",
|
|
91
91
|
"react-hook-form": "^7.49.3",
|
|
92
|
-
"release-it": "^17.0.
|
|
92
|
+
"release-it": "^17.0.3",
|
|
93
93
|
"storybook": "^7.6.10",
|
|
94
94
|
"ts-jest": "^29.1.2",
|
|
95
95
|
"typescript": "^5.3.3"
|
|
@@ -29,15 +29,17 @@ const CheckboxTheme = {
|
|
|
29
29
|
backgroundColor: 'neutral.80',
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
_disabled: {
|
|
33
|
-
backgroundColor: 'neutral.93',
|
|
34
|
-
},
|
|
35
32
|
_hover: {
|
|
36
33
|
borderColor: 'neutral.70',
|
|
37
34
|
},
|
|
38
35
|
_focusVisible: {
|
|
39
36
|
boxShadow: 'formFocus',
|
|
40
37
|
},
|
|
38
|
+
_disabled: {
|
|
39
|
+
cursor: 'not-allowed',
|
|
40
|
+
backgroundColor: 'neutral.93',
|
|
41
|
+
borderColor: 'neutral.90',
|
|
42
|
+
},
|
|
41
43
|
},
|
|
42
44
|
label: {
|
|
43
45
|
userSelect: 'none',
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { LinkBox, LinkOverlay } from '@chakra-ui/react';
|
|
3
|
+
import Checkbox from '../Form/Checkbox/Checkbox';
|
|
4
|
+
import Tooltip, { TooltipProps } from '../Tooltip/Tooltip';
|
|
5
|
+
import Td from './Td';
|
|
6
|
+
import Tr, { RowProps } from './Tr';
|
|
7
|
+
|
|
8
|
+
export interface CheckableRowProps extends RowProps {
|
|
9
|
+
id: string;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
name: string;
|
|
13
|
+
tooltipProps?: Omit<TooltipProps, 'children'>;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const CheckableRow = (props: CheckableRowProps) => {
|
|
18
|
+
const { children, id, isDisabled, label, name, tooltipProps, value, ...rest } = props;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<LinkBox
|
|
22
|
+
as={Tr}
|
|
23
|
+
transform="scale(1)"
|
|
24
|
+
_hover={{
|
|
25
|
+
td: { background: 'neutral.95' },
|
|
26
|
+
':has(input:checked)': {
|
|
27
|
+
td: { background: 'purple.93' },
|
|
28
|
+
},
|
|
29
|
+
}}
|
|
30
|
+
sx={{
|
|
31
|
+
':has(input:checked)': {
|
|
32
|
+
td: { background: 'purple.95' },
|
|
33
|
+
},
|
|
34
|
+
}}
|
|
35
|
+
{...rest}
|
|
36
|
+
>
|
|
37
|
+
<Td>
|
|
38
|
+
<Tooltip isDisabled={!tooltipProps} placement="right" shouldWrapChildren {...tooltipProps}>
|
|
39
|
+
<Checkbox id={id} isDisabled={isDisabled} name={name} value={value} zIndex="1" />
|
|
40
|
+
</Tooltip>
|
|
41
|
+
</Td>
|
|
42
|
+
<Td>
|
|
43
|
+
<LinkOverlay as="label" cursor={isDisabled ? 'not-allowed' : 'pointer'} htmlFor={id}>
|
|
44
|
+
{label}
|
|
45
|
+
</LinkOverlay>
|
|
46
|
+
</Td>
|
|
47
|
+
{children}
|
|
48
|
+
</LinkBox>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default CheckableRow;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { LinkBox, LinkOverlay } from '@chakra-ui/react';
|
|
3
3
|
import Radio from '../Form/Radio/Radio';
|
|
4
|
+
import Tooltip, { TooltipProps } from '../Tooltip/Tooltip';
|
|
4
5
|
import Td from './Td';
|
|
5
6
|
import Tr, { RowProps } from './Tr';
|
|
6
7
|
|
|
7
8
|
export interface SelectableRowProps extends RowProps {
|
|
8
9
|
id: string;
|
|
10
|
+
isDisabled?: boolean;
|
|
9
11
|
label: ReactNode;
|
|
12
|
+
tooltipProps?: Omit<TooltipProps, 'children'>;
|
|
10
13
|
value: string;
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
const SelectableRow = (props: SelectableRowProps) => {
|
|
14
|
-
const { children, id, label, value, ...rest } = props;
|
|
17
|
+
const { children, id, isDisabled, label, tooltipProps, value, ...rest } = props;
|
|
15
18
|
|
|
16
19
|
return (
|
|
17
20
|
<LinkBox
|
|
@@ -31,10 +34,12 @@ const SelectableRow = (props: SelectableRowProps) => {
|
|
|
31
34
|
{...rest}
|
|
32
35
|
>
|
|
33
36
|
<Td>
|
|
34
|
-
<
|
|
37
|
+
<Tooltip isDisabled={!tooltipProps} placement="right" shouldWrapChildren {...tooltipProps}>
|
|
38
|
+
<Radio id={id} isDisabled={isDisabled} value={value} zIndex="1" />
|
|
39
|
+
</Tooltip>
|
|
35
40
|
</Td>
|
|
36
41
|
<Td>
|
|
37
|
-
<LinkOverlay as="label" cursor=
|
|
42
|
+
<LinkOverlay as="label" cursor={isDisabled ? 'not-allowed' : 'pointer'} htmlFor={id}>
|
|
38
43
|
{label}
|
|
39
44
|
</LinkOverlay>
|
|
40
45
|
</Td>
|
package/src/index.ts
CHANGED
|
@@ -283,6 +283,9 @@ export { default as ClickableRow } from './Components/Table/ClickableRow';
|
|
|
283
283
|
export type { SelectableRowProps } from './Components/Table/SelectableRow';
|
|
284
284
|
export { default as SelectableRow } from './Components/Table/SelectableRow';
|
|
285
285
|
|
|
286
|
+
export type { CheckableRowProps } from './Components/Table/CheckableRow';
|
|
287
|
+
export { default as CheckableRow } from './Components/Table/CheckableRow';
|
|
288
|
+
|
|
286
289
|
export type { TagProps } from './Components/Tag/Tag';
|
|
287
290
|
export { default as Tag } from './Components/Tag/Tag';
|
|
288
291
|
|