@bitrise/bitkit 13.39.0 → 13.39.1-alpha.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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* eslint-disable no-underscore-dangle */
|
|
2
|
+
import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system';
|
|
3
|
+
|
|
4
|
+
const keys = ['card', 'wrapper', 'handler'];
|
|
5
|
+
const { defineMultiStyleConfig } = createMultiStyleConfigHelpers(keys);
|
|
6
|
+
|
|
7
|
+
const DraggableCardTheme = defineMultiStyleConfig({
|
|
8
|
+
baseStyle: ({ isDragging, isOverlay }) => {
|
|
9
|
+
const style: Record<string, any> = {
|
|
10
|
+
card: {
|
|
11
|
+
_hover: {
|
|
12
|
+
borderColor: isDragging ? undefined : 'border/regular',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
wrapper: {
|
|
16
|
+
position: 'relative',
|
|
17
|
+
padding: '16',
|
|
18
|
+
paddingInlineStart: '32',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
visibility: isDragging ? 'hidden' : 'visible',
|
|
21
|
+
},
|
|
22
|
+
handler: {
|
|
23
|
+
cursor: isOverlay ? 'grabbing' : 'grab',
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
left: 0,
|
|
26
|
+
top: 0,
|
|
27
|
+
bottom: 0,
|
|
28
|
+
padding: '8',
|
|
29
|
+
borderStartRadius: 7,
|
|
30
|
+
color: 'icon/tertiary',
|
|
31
|
+
_hover: {
|
|
32
|
+
backgroundColor: isOverlay ? 'background/active' : 'background/hover',
|
|
33
|
+
color: 'icon/secondary',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
if (isDragging) {
|
|
39
|
+
style.card.backgroundColor = 'background/secondary';
|
|
40
|
+
style.card.borderColor = 'border/strong';
|
|
41
|
+
style.card.borderStyle = 'dashed';
|
|
42
|
+
}
|
|
43
|
+
if (isOverlay) {
|
|
44
|
+
style.card._hover = {
|
|
45
|
+
borderColor: 'border/strong',
|
|
46
|
+
boxShadow: 'large',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return style;
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export default DraggableCardTheme;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable no-underscore-dangle */
|
|
3
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
4
|
+
import { useMultiStyleConfig } from '@chakra-ui/react';
|
|
5
|
+
import Box from '../Box/Box';
|
|
6
|
+
import Card, { CardProps } from '../Card/Card';
|
|
7
|
+
|
|
8
|
+
export interface DraggableCardProps extends CardProps {
|
|
9
|
+
activatorListeners?: any;
|
|
10
|
+
activatorRef?: ForwardedRef<HTMLElement>;
|
|
11
|
+
isDragging?: boolean;
|
|
12
|
+
isOverlay?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const DraggableCard = forwardRef<HTMLDivElement, DraggableCardProps>((props, ref) => {
|
|
16
|
+
const { activatorListeners, activatorRef, children, cursor, isDragging, isOverlay, ...rest } = props;
|
|
17
|
+
|
|
18
|
+
const style = useMultiStyleConfig('DraggableCard', props);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Card ref={ref} {...rest} sx={style.card}>
|
|
22
|
+
<Box visibility={isDragging ? 'hidden' : 'visible'} sx={style.wrapper}>
|
|
23
|
+
<Box as="button" ref={activatorRef} {...activatorListeners} sx={style.handler}>
|
|
24
|
+
<svg width="8" height="12" viewBox="0 0 8 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
|
25
|
+
<circle cx="2" cy="2" r="1" />
|
|
26
|
+
<circle cx="6" cy="2" r="1" />
|
|
27
|
+
<circle cx="2" cy="6" r="1" />
|
|
28
|
+
<circle cx="6" cy="6" r="1" />
|
|
29
|
+
<circle cx="2" cy="10" r="1" />
|
|
30
|
+
<circle cx="6" cy="10" r="1" />
|
|
31
|
+
</svg>
|
|
32
|
+
</Box>
|
|
33
|
+
{children}
|
|
34
|
+
</Box>
|
|
35
|
+
</Card>
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export default DraggableCard;
|
|
@@ -47,6 +47,7 @@ import Filter from './Filter/Filter.theme';
|
|
|
47
47
|
import Toggletip from './Toggletip/Toggletip.theme';
|
|
48
48
|
import FilterSwitch from './Filter/FilterSwitch/FilterSwitch.theme';
|
|
49
49
|
import TagsInput from './Form/TagsInput/TagsInput.theme';
|
|
50
|
+
import DraggableCard from './DraggableCard/DraggableCard.theme';
|
|
50
51
|
|
|
51
52
|
const components = {
|
|
52
53
|
Accordion,
|
|
@@ -69,6 +70,7 @@ const components = {
|
|
|
69
70
|
CodeSnippet,
|
|
70
71
|
DatePickerDay,
|
|
71
72
|
DefinitionTooltip,
|
|
73
|
+
DraggableCard,
|
|
72
74
|
ExpandableCard,
|
|
73
75
|
FileInput,
|
|
74
76
|
Filter,
|
package/src/index.ts
CHANGED
|
@@ -327,3 +327,6 @@ export { default as DateInput, dateInputDateFormat } from './Components/Form/Dat
|
|
|
327
327
|
|
|
328
328
|
export type { TagsInputProps } from './Components/Form/TagsInput/TagsInput';
|
|
329
329
|
export { default as TagsInput } from './Components/Form/TagsInput/TagsInput';
|
|
330
|
+
|
|
331
|
+
export type { DraggableCardProps } from './Components/DraggableCard/DraggableCard';
|
|
332
|
+
export { default as DraggableCard } from './Components/DraggableCard/DraggableCard';
|