@zendeskgarden/react-draggable 9.1.1 → 9.1.2
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/dist/esm/elements/draggable/Draggable.js +16 -6
- package/dist/esm/elements/draggable-list/DraggableList.js +10 -5
- package/dist/esm/elements/draggable-list/components/DropIndicator.js +1 -1
- package/dist/esm/elements/draggable-list/components/Item.js +1 -1
- package/dist/esm/elements/dropzone/Dropzone.js +18 -13
- package/dist/esm/elements/dropzone/components/Icon.js +2 -2
- package/dist/esm/styled/draggable/StyledContent.js +1 -1
- package/dist/esm/styled/draggable/StyledDraggable.js +20 -20
- package/dist/esm/styled/draggable/StyledGrip.js +1 -1
- package/dist/esm/styled/draggable-list/StyledDraggableList.js +4 -4
- package/dist/esm/styled/draggable-list/StyledDropIndicator.js +4 -4
- package/dist/esm/styled/draggable-list/StyledItem.js +3 -3
- package/dist/esm/styled/dropzone/StyledDropzone.js +16 -16
- package/dist/esm/styled/dropzone/StyledIcon.js +4 -4
- package/dist/esm/styled/dropzone/StyledMessage.js +1 -1
- package/dist/index.cjs.js +102 -82
- package/dist/typings/styled/draggable/StyledDraggable.d.ts +6 -6
- package/dist/typings/styled/draggable-list/StyledDraggableList.d.ts +1 -1
- package/dist/typings/styled/draggable-list/StyledDropIndicator.d.ts +1 -1
- package/dist/typings/styled/draggable-list/StyledItem.d.ts +1 -1
- package/dist/typings/styled/dropzone/StyledDropzone.d.ts +7 -7
- package/dist/typings/styled/dropzone/StyledIcon.d.ts +2 -2
- package/package.json +4 -4
|
@@ -19,17 +19,27 @@ import '../../styled/dropzone/StyledIcon.js';
|
|
|
19
19
|
|
|
20
20
|
const DraggableComponent = forwardRef((_ref, ref) => {
|
|
21
21
|
let {
|
|
22
|
+
focusInset,
|
|
23
|
+
isBare,
|
|
24
|
+
isCompact,
|
|
25
|
+
isDisabled,
|
|
26
|
+
isGrabbed,
|
|
27
|
+
isPlaceholder,
|
|
22
28
|
tag,
|
|
23
|
-
...
|
|
29
|
+
...other
|
|
24
30
|
} = _ref;
|
|
25
|
-
const isDisabled = props.isDisabled;
|
|
26
31
|
return React__default.createElement(StyledDraggable, Object.assign({
|
|
27
|
-
|
|
32
|
+
$focusInset: focusInset,
|
|
33
|
+
$isBare: isBare,
|
|
34
|
+
$isCompact: isCompact,
|
|
35
|
+
$isDisabled: isDisabled,
|
|
36
|
+
$isGrabbed: isGrabbed,
|
|
37
|
+
$isPlaceholder: isPlaceholder,
|
|
28
38
|
"aria-disabled": isDisabled,
|
|
39
|
+
as: tag,
|
|
40
|
+
ref: ref,
|
|
29
41
|
tabIndex: isDisabled ? undefined : 0
|
|
30
|
-
},
|
|
31
|
-
ref: ref
|
|
32
|
-
}));
|
|
42
|
+
}, other));
|
|
33
43
|
});
|
|
34
44
|
DraggableComponent.displayName = 'Draggable';
|
|
35
45
|
const Draggable = DraggableComponent;
|
|
@@ -18,15 +18,20 @@ import '../../styled/dropzone/StyledMessage.js';
|
|
|
18
18
|
import '../../styled/dropzone/StyledIcon.js';
|
|
19
19
|
import { DraggableListContext } from '../../utils/useDraggableListContext.js';
|
|
20
20
|
|
|
21
|
-
const DraggableListComponent = forwardRef((
|
|
21
|
+
const DraggableListComponent = forwardRef((_ref, ref) => {
|
|
22
|
+
let {
|
|
23
|
+
isHorizontal,
|
|
24
|
+
...other
|
|
25
|
+
} = _ref;
|
|
22
26
|
const value = useMemo(() => ({
|
|
23
|
-
isHorizontal
|
|
24
|
-
}), [
|
|
27
|
+
isHorizontal
|
|
28
|
+
}), [isHorizontal]);
|
|
25
29
|
return React__default.createElement(DraggableListContext.Provider, {
|
|
26
30
|
value: value
|
|
27
|
-
}, React__default.createElement(StyledDraggableList, Object.assign({
|
|
31
|
+
}, React__default.createElement(StyledDraggableList, Object.assign({
|
|
32
|
+
$isHorizontal: isHorizontal,
|
|
28
33
|
ref: ref
|
|
29
|
-
})));
|
|
34
|
+
}, other)));
|
|
30
35
|
});
|
|
31
36
|
DraggableListComponent.displayName = 'DraggableList';
|
|
32
37
|
const DraggableList = DraggableListComponent;
|
|
@@ -24,7 +24,7 @@ const DropIndicator = forwardRef((props, ref) => {
|
|
|
24
24
|
const ariaLabel = useText(DropIndicator, props, 'aria-label', 'Drop indicator');
|
|
25
25
|
return React__default.createElement(StyledDropIndicator, Object.assign({}, props, {
|
|
26
26
|
"aria-label": ariaLabel,
|
|
27
|
-
isHorizontal: isHorizontal,
|
|
27
|
+
$isHorizontal: isHorizontal,
|
|
28
28
|
ref: ref
|
|
29
29
|
}));
|
|
30
30
|
});
|
|
@@ -21,14 +21,15 @@ import { DropzoneContext } from '../../utils/useDropzoneContext.js';
|
|
|
21
21
|
|
|
22
22
|
const DropzoneComponent = forwardRef((_ref, ref) => {
|
|
23
23
|
let {
|
|
24
|
-
tag,
|
|
25
|
-
isVertical,
|
|
26
24
|
children,
|
|
27
|
-
|
|
25
|
+
isActive,
|
|
26
|
+
isDanger,
|
|
27
|
+
isDisabled,
|
|
28
|
+
isHighlighted,
|
|
29
|
+
isVertical,
|
|
30
|
+
tag,
|
|
31
|
+
...other
|
|
28
32
|
} = _ref;
|
|
29
|
-
const {
|
|
30
|
-
isDanger
|
|
31
|
-
} = props;
|
|
32
33
|
const [hasMessage, setHasMessage] = useState(false);
|
|
33
34
|
const [hasIcon, setHasIcon] = useState(false);
|
|
34
35
|
const value = useMemo(() => ({
|
|
@@ -43,16 +44,20 @@ const DropzoneComponent = forwardRef((_ref, ref) => {
|
|
|
43
44
|
value: value
|
|
44
45
|
}, React__default.createElement(StyledDropzone, Object.assign({
|
|
45
46
|
as: tag,
|
|
46
|
-
"aria-disabled":
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
"aria-disabled": isDisabled
|
|
48
|
+
}, other, {
|
|
49
|
+
$isActive: isActive,
|
|
50
|
+
$isDisabled: isDisabled,
|
|
51
|
+
$isDanger: isDanger,
|
|
52
|
+
$isHighlighted: isHighlighted,
|
|
53
|
+
$hasIcon: hasIcon,
|
|
54
|
+
$hasMessage: hasMessage,
|
|
55
|
+
$isVertical: isVertical,
|
|
51
56
|
ref: ref
|
|
52
57
|
}), !!(hasMessage && isDanger) && !hasIcon && React__default.createElement(StyledIcon, {
|
|
53
58
|
"aria-hidden": "true",
|
|
54
|
-
hasMessage: hasMessage,
|
|
55
|
-
isVertical: isVertical
|
|
59
|
+
$hasMessage: hasMessage,
|
|
60
|
+
$isVertical: isVertical
|
|
56
61
|
}, React__default.createElement(SvgTrashStroke, null)), children));
|
|
57
62
|
});
|
|
58
63
|
DropzoneComponent.displayName = 'Dropzone';
|
|
@@ -36,8 +36,8 @@ const Icon = forwardRef((props, ref) => {
|
|
|
36
36
|
return React__default.createElement(StyledIcon, Object.assign({
|
|
37
37
|
"aria-hidden": "true"
|
|
38
38
|
}, props, {
|
|
39
|
-
hasMessage: hasMessage,
|
|
40
|
-
isVertical: isVertical,
|
|
39
|
+
$hasMessage: hasMessage,
|
|
40
|
+
$isVertical: isVertical,
|
|
41
41
|
ref: ref
|
|
42
42
|
}));
|
|
43
43
|
});
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
10
10
|
const COMPONENT_ID = 'draggable.content';
|
|
11
11
|
const StyledContent = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.1.
|
|
13
|
+
'data-garden-version': '9.1.2'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledContent",
|
|
16
16
|
componentId: "sc-15arore-0"
|
|
@@ -24,11 +24,11 @@ function getDragShadow(theme) {
|
|
|
24
24
|
}
|
|
25
25
|
const colorStyles = props => {
|
|
26
26
|
const {
|
|
27
|
-
isBare,
|
|
28
|
-
isGrabbed,
|
|
29
|
-
isDisabled,
|
|
30
|
-
isPlaceholder,
|
|
31
|
-
focusInset,
|
|
27
|
+
$isBare,
|
|
28
|
+
$isGrabbed,
|
|
29
|
+
$isDisabled,
|
|
30
|
+
$isPlaceholder,
|
|
31
|
+
$focusInset,
|
|
32
32
|
theme
|
|
33
33
|
} = props;
|
|
34
34
|
const dragShadow = getDragShadow(theme);
|
|
@@ -53,23 +53,23 @@ const colorStyles = props => {
|
|
|
53
53
|
let boxShadow;
|
|
54
54
|
let borderColor = 'transparent';
|
|
55
55
|
let backgroundColor = baseBgColor;
|
|
56
|
-
if (isDisabled) {
|
|
56
|
+
if ($isDisabled) {
|
|
57
57
|
backgroundColor = disabledBgColor;
|
|
58
58
|
color = disabledColor;
|
|
59
|
-
} else if (isPlaceholder) {
|
|
59
|
+
} else if ($isPlaceholder) {
|
|
60
60
|
backgroundColor = placeholderBgColor;
|
|
61
61
|
} else {
|
|
62
62
|
color = getColor({
|
|
63
63
|
variable: 'foreground.default',
|
|
64
64
|
theme
|
|
65
65
|
});
|
|
66
|
-
borderColor = isBare ? 'transparent' : getColor({
|
|
66
|
+
borderColor = $isBare ? 'transparent' : getColor({
|
|
67
67
|
variable: 'border.default',
|
|
68
68
|
theme
|
|
69
69
|
});
|
|
70
70
|
hoverBackgroundColor = getColor({
|
|
71
|
-
variable: isGrabbed ? 'background.raised' : 'background.primaryEmphasis',
|
|
72
|
-
...(
|
|
71
|
+
variable: $isGrabbed ? 'background.raised' : 'background.primaryEmphasis',
|
|
72
|
+
...(!$isGrabbed && {
|
|
73
73
|
transparency: theme.opacity[100],
|
|
74
74
|
dark: {
|
|
75
75
|
offset: -100
|
|
@@ -79,34 +79,34 @@ const colorStyles = props => {
|
|
|
79
79
|
});
|
|
80
80
|
boxShadow = dragShadow;
|
|
81
81
|
}
|
|
82
|
-
return css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&:hover{background-color:", ";}", " > ", "{color:", ";}"], borderColor, isGrabbed && boxShadow, backgroundColor, color, hoverBackgroundColor, focusStyles({
|
|
82
|
+
return css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&:hover{background-color:", ";}", " > ", "{color:", ";}"], borderColor, $isGrabbed && boxShadow, backgroundColor, color, hoverBackgroundColor, focusStyles({
|
|
83
83
|
theme,
|
|
84
|
-
inset: focusInset,
|
|
85
|
-
boxShadow: isGrabbed ? dragShadow : undefined
|
|
86
|
-
}), StyledGrip, isDisabled && disabledColor);
|
|
84
|
+
inset: $focusInset,
|
|
85
|
+
boxShadow: $isGrabbed ? dragShadow : undefined
|
|
86
|
+
}), StyledGrip, $isDisabled && disabledColor);
|
|
87
87
|
};
|
|
88
88
|
const sizeStyles = props => {
|
|
89
89
|
const {
|
|
90
|
-
isCompact,
|
|
90
|
+
$isCompact,
|
|
91
91
|
theme
|
|
92
92
|
} = props;
|
|
93
93
|
const paddingDefault = theme.space.base * 2.25;
|
|
94
94
|
const paddingCompact = theme.space.base * 1.25;
|
|
95
|
-
return css(["margin:0;border:", ";border-radius:", ";padding:", ";line-height:", ";font-size:", ";font-weight:", ";"], theme.borders.sm, theme.borderRadii.md, isCompact ? `${paddingCompact}px ${paddingDefault}px` : `${paddingDefault}px`, getLineHeight(theme.space.base * 5, theme.fontSizes.md), theme.fontSizes.md, theme.fontWeights.regular);
|
|
95
|
+
return css(["margin:0;border:", ";border-radius:", ";padding:", ";line-height:", ";font-size:", ";font-weight:", ";"], theme.borders.sm, theme.borderRadii.md, $isCompact ? `${paddingCompact}px ${paddingDefault}px` : `${paddingDefault}px`, getLineHeight(theme.space.base * 5, theme.fontSizes.md), theme.fontSizes.md, theme.fontWeights.regular);
|
|
96
96
|
};
|
|
97
97
|
const getCursor = props => {
|
|
98
|
-
let cursor = props
|
|
99
|
-
if (props
|
|
98
|
+
let cursor = props.$isGrabbed ? 'grabbing' : 'grab';
|
|
99
|
+
if (props.$isDisabled || props.$isPlaceholder) {
|
|
100
100
|
cursor = 'default';
|
|
101
101
|
}
|
|
102
102
|
return cursor;
|
|
103
103
|
};
|
|
104
104
|
const StyledDraggable = styled.div.attrs({
|
|
105
105
|
'data-garden-id': COMPONENT_ID,
|
|
106
|
-
'data-garden-version': '9.1.
|
|
106
|
+
'data-garden-version': '9.1.2'
|
|
107
107
|
}).withConfig({
|
|
108
108
|
displayName: "StyledDraggable",
|
|
109
109
|
componentId: "sc-3lxpf1-0"
|
|
110
|
-
})(["display:flex;flex:1;align-items:center;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;cursor:", ";font-family:", ";direction:", ";box-sizing:border-box;", " ", " > *{visibility:", ";}", ";"], getCursor, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', sizeStyles, colorStyles, p => p
|
|
110
|
+
})(["display:flex;flex:1;align-items:center;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;cursor:", ";font-family:", ";direction:", ";box-sizing:border-box;", " ", " > *{visibility:", ";}", ";"], getCursor, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', sizeStyles, colorStyles, p => p.$isPlaceholder && !p.$isDisabled && 'hidden', props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
111
111
|
|
|
112
112
|
export { StyledDraggable, getDragShadow };
|
|
@@ -11,14 +11,14 @@ import { StyledItem } from './StyledItem.js';
|
|
|
11
11
|
const COMPONENT_ID = 'draggable_list';
|
|
12
12
|
const sizeStyles = props => {
|
|
13
13
|
const {
|
|
14
|
-
isHorizontal,
|
|
14
|
+
$isHorizontal,
|
|
15
15
|
theme: {
|
|
16
16
|
space
|
|
17
17
|
}
|
|
18
18
|
} = props;
|
|
19
19
|
let marginStart = 'margin-top';
|
|
20
20
|
let marginEnd = 'margin-bottom';
|
|
21
|
-
if (isHorizontal) {
|
|
21
|
+
if ($isHorizontal) {
|
|
22
22
|
marginStart = 'margin-right';
|
|
23
23
|
marginEnd = 'margin-left';
|
|
24
24
|
}
|
|
@@ -26,10 +26,10 @@ const sizeStyles = props => {
|
|
|
26
26
|
};
|
|
27
27
|
const StyledDraggableList = styled.ul.attrs({
|
|
28
28
|
'data-garden-id': COMPONENT_ID,
|
|
29
|
-
'data-garden-version': '9.1.
|
|
29
|
+
'data-garden-version': '9.1.2'
|
|
30
30
|
}).withConfig({
|
|
31
31
|
displayName: "StyledDraggableList",
|
|
32
32
|
componentId: "sc-17agksa-0"
|
|
33
|
-
})(["display:flex;flex-direction:", ";margin:0;padding:0;list-style:none;box-sizing:border-box;direction:", ";> ", "{flex:1;}", ";", ";"], p => p
|
|
33
|
+
})(["display:flex;flex-direction:", ";margin:0;padding:0;list-style:none;box-sizing:border-box;direction:", ";> ", "{flex:1;}", ";", ";"], p => p.$isHorizontal ? 'row' : 'column', props => props.theme.rtl && 'rtl', StyledItem, sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
34
34
|
|
|
35
35
|
export { StyledDraggableList };
|
|
@@ -20,17 +20,17 @@ const colorStyles = props => {
|
|
|
20
20
|
};
|
|
21
21
|
const sizeStyles = props => {
|
|
22
22
|
const {
|
|
23
|
-
isHorizontal,
|
|
23
|
+
$isHorizontal,
|
|
24
24
|
theme
|
|
25
25
|
} = props;
|
|
26
26
|
const pseudoSize = theme.space.xs;
|
|
27
|
-
const translateX = isHorizontal ? theme.space.xxs : theme.space.xs;
|
|
28
|
-
const translateY = isHorizontal ? theme.space.xs : theme.space.xxs;
|
|
27
|
+
const translateX = $isHorizontal ? theme.space.xxs : theme.space.xs;
|
|
28
|
+
const translateY = $isHorizontal ? theme.space.xs : theme.space.xxs;
|
|
29
29
|
return css(["&::before,&::after{border-radius:50%;width:", ";height:", ";}&::before{top:0;left:0;transform:translate(-", ",-", ");}&::after{right:0;bottom:0;transform:translate(", ",", ");}"], pseudoSize, pseudoSize, translateX, translateY, translateX, translateY);
|
|
30
30
|
};
|
|
31
31
|
const StyledDropIndicator = styled.li.attrs({
|
|
32
32
|
'data-garden-id': COMPONENT_ID,
|
|
33
|
-
'data-garden-version': '9.1.
|
|
33
|
+
'data-garden-version': '9.1.2'
|
|
34
34
|
}).withConfig({
|
|
35
35
|
displayName: "StyledDropIndicator",
|
|
36
36
|
componentId: "sc-1f1u2lh-0"
|
|
@@ -10,16 +10,16 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
10
10
|
const COMPONENT_ID = 'draggable_list.item';
|
|
11
11
|
const sizeStyles = props => {
|
|
12
12
|
const {
|
|
13
|
-
isHorizontal,
|
|
13
|
+
$isHorizontal,
|
|
14
14
|
theme: {
|
|
15
15
|
space
|
|
16
16
|
}
|
|
17
17
|
} = props;
|
|
18
|
-
return css(["padding:", ";"], isHorizontal ? `0 ${space.xxs}` : `${space.xxs} 0`);
|
|
18
|
+
return css(["padding:", ";"], $isHorizontal ? `0 ${space.xxs}` : `${space.xxs} 0`);
|
|
19
19
|
};
|
|
20
20
|
const StyledItem = styled.li.attrs({
|
|
21
21
|
'data-garden-id': COMPONENT_ID,
|
|
22
|
-
'data-garden-version': '9.1.
|
|
22
|
+
'data-garden-version': '9.1.2'
|
|
23
23
|
}).withConfig({
|
|
24
24
|
displayName: "StyledItem",
|
|
25
25
|
componentId: "sc-1nps3s3-0"
|
|
@@ -11,19 +11,19 @@ import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming'
|
|
|
11
11
|
const COMPONENT_ID = 'dropzone';
|
|
12
12
|
const colorStyles = props => {
|
|
13
13
|
const {
|
|
14
|
-
isDanger,
|
|
15
|
-
isDisabled,
|
|
16
|
-
isActive,
|
|
17
|
-
isHighlighted,
|
|
14
|
+
$isDanger,
|
|
15
|
+
$isDisabled,
|
|
16
|
+
$isActive,
|
|
17
|
+
$isHighlighted,
|
|
18
18
|
theme
|
|
19
19
|
} = props;
|
|
20
|
-
const fgVariable = isDanger ? 'foreground.danger' : 'foreground.primary';
|
|
20
|
+
const fgVariable = $isDanger ? 'foreground.danger' : 'foreground.primary';
|
|
21
21
|
const fgActive = getColor({
|
|
22
22
|
variable: fgVariable,
|
|
23
23
|
theme
|
|
24
24
|
});
|
|
25
25
|
const borderActive = getColor({
|
|
26
|
-
variable: isDanger ? `border.dangerEmphasis` : 'border.primaryEmphasis',
|
|
26
|
+
variable: $isDanger ? `border.dangerEmphasis` : 'border.primaryEmphasis',
|
|
27
27
|
theme
|
|
28
28
|
});
|
|
29
29
|
let backgroundColor = 'transparent';
|
|
@@ -35,7 +35,7 @@ const colorStyles = props => {
|
|
|
35
35
|
variable: `foreground.subtle`,
|
|
36
36
|
theme
|
|
37
37
|
});
|
|
38
|
-
if (isDisabled) {
|
|
38
|
+
if ($isDisabled) {
|
|
39
39
|
backgroundColor = getColor({
|
|
40
40
|
variable: 'background.disabled',
|
|
41
41
|
theme
|
|
@@ -48,8 +48,8 @@ const colorStyles = props => {
|
|
|
48
48
|
variable: 'foreground.disabled',
|
|
49
49
|
theme
|
|
50
50
|
});
|
|
51
|
-
} else if (isActive || isHighlighted) {
|
|
52
|
-
color = isHighlighted ? getColor({
|
|
51
|
+
} else if ($isActive || $isHighlighted) {
|
|
52
|
+
color = $isHighlighted ? getColor({
|
|
53
53
|
variable: fgVariable,
|
|
54
54
|
light: {
|
|
55
55
|
offset: 200
|
|
@@ -60,7 +60,7 @@ const colorStyles = props => {
|
|
|
60
60
|
theme
|
|
61
61
|
}) : fgActive;
|
|
62
62
|
backgroundColor = getColor({
|
|
63
|
-
variable: isDanger ? 'background.dangerEmphasis' : 'background.primaryEmphasis',
|
|
63
|
+
variable: $isDanger ? 'background.dangerEmphasis' : 'background.primaryEmphasis',
|
|
64
64
|
transparency: theme.opacity[100],
|
|
65
65
|
dark: {
|
|
66
66
|
offset: -100
|
|
@@ -68,7 +68,7 @@ const colorStyles = props => {
|
|
|
68
68
|
theme
|
|
69
69
|
});
|
|
70
70
|
borderColor = borderActive;
|
|
71
|
-
} else if (isDanger) {
|
|
71
|
+
} else if ($isDanger) {
|
|
72
72
|
borderColor = borderActive;
|
|
73
73
|
color = fgActive;
|
|
74
74
|
}
|
|
@@ -77,17 +77,17 @@ const colorStyles = props => {
|
|
|
77
77
|
const sizeStyles = props => {
|
|
78
78
|
const {
|
|
79
79
|
theme,
|
|
80
|
-
isHighlighted
|
|
80
|
+
$isHighlighted
|
|
81
81
|
} = props;
|
|
82
|
-
const borderWidth = isHighlighted ? math(`${theme.borderWidths.sm} * 2`) : theme.borderWidths.sm;
|
|
83
|
-
return css(["border-width:", ";border-style:", ";border-radius:", ";padding:", "px;width:100%;font-family:", ";font-size:", ";"], borderWidth, isHighlighted ? theme.borderStyles.solid : 'dashed', theme.borderRadii.md, isHighlighted ? theme.space.base * 4 - 1 : theme.space.base * 4, theme.fonts.system, theme.fontSizes.md);
|
|
82
|
+
const borderWidth = $isHighlighted ? math(`${theme.borderWidths.sm} * 2`) : theme.borderWidths.sm;
|
|
83
|
+
return css(["border-width:", ";border-style:", ";border-radius:", ";padding:", "px;width:100%;font-family:", ";font-size:", ";"], borderWidth, $isHighlighted ? theme.borderStyles.solid : 'dashed', theme.borderRadii.md, $isHighlighted ? theme.space.base * 4 - 1 : theme.space.base * 4, theme.fonts.system, theme.fontSizes.md);
|
|
84
84
|
};
|
|
85
85
|
const StyledDropzone = styled.div.attrs({
|
|
86
86
|
'data-garden-id': COMPONENT_ID,
|
|
87
|
-
'data-garden-version': '9.1.
|
|
87
|
+
'data-garden-version': '9.1.2'
|
|
88
88
|
}).withConfig({
|
|
89
89
|
displayName: "StyledDropzone",
|
|
90
90
|
componentId: "sc-1b7zuip-0"
|
|
91
|
-
})(["display:", ";flex-direction:", ";align-items:", ";justify-content:", ";transition:border-color 0.25s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;margin:0;text-align:", ";direction:", ";box-sizing:border-box;", " ", " ", ";"], p => (p
|
|
91
|
+
})(["display:", ";flex-direction:", ";align-items:", ";justify-content:", ";transition:border-color 0.25s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;margin:0;text-align:", ";direction:", ";box-sizing:border-box;", " ", " ", ";"], p => (p.$hasMessage || p.$hasIcon) && 'flex', p => p.$hasMessage && p.$isVertical && 'column', p => (p.$hasMessage || p.$hasIcon) && 'center', p => (p.$hasMessage || p.$hasIcon) && 'center', p => p.$hasMessage && 'center', props => props.theme.rtl && 'rtl', sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
92
92
|
|
|
93
93
|
export { StyledDropzone };
|
|
@@ -11,11 +11,11 @@ const COMPONENT_ID = 'dropzone.icon';
|
|
|
11
11
|
function sizeStyles(_ref) {
|
|
12
12
|
let {
|
|
13
13
|
theme,
|
|
14
|
-
isVertical
|
|
14
|
+
$isVertical
|
|
15
15
|
} = _ref;
|
|
16
16
|
let property;
|
|
17
17
|
let value;
|
|
18
|
-
if (isVertical) {
|
|
18
|
+
if ($isVertical) {
|
|
19
19
|
property = 'margin-bottom';
|
|
20
20
|
value = theme.space.xs;
|
|
21
21
|
} else {
|
|
@@ -26,10 +26,10 @@ function sizeStyles(_ref) {
|
|
|
26
26
|
}
|
|
27
27
|
const StyledIcon = styled.div.attrs({
|
|
28
28
|
'data-garden-id': COMPONENT_ID,
|
|
29
|
-
'data-garden-version': '9.1.
|
|
29
|
+
'data-garden-version': '9.1.2'
|
|
30
30
|
}).withConfig({
|
|
31
31
|
displayName: "StyledIcon",
|
|
32
32
|
componentId: "sc-1o12gen-0"
|
|
33
|
-
})(["display:flex;width:", ";height:", ";", " ", ";"], props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, p => p
|
|
33
|
+
})(["display:flex;width:", ";height:", ";", " ", ";"], props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, p => p.$hasMessage && sizeStyles(p), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
34
34
|
|
|
35
35
|
export { StyledIcon };
|
|
@@ -10,7 +10,7 @@ import { getLineHeight, retrieveComponentStyles } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'dropzone.message';
|
|
11
11
|
const StyledMessage = styled.p.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.1.
|
|
13
|
+
'data-garden-version': '9.1.2'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledMessage",
|
|
16
16
|
componentId: "sc-5kb2l2-0"
|
package/dist/index.cjs.js
CHANGED
|
@@ -44,7 +44,7 @@ function sizeStyles$6(_ref) {
|
|
|
44
44
|
}
|
|
45
45
|
const StyledGrip = styled__default.default.div.attrs({
|
|
46
46
|
'data-garden-id': COMPONENT_ID$8,
|
|
47
|
-
'data-garden-version': '9.1.
|
|
47
|
+
'data-garden-version': '9.1.2'
|
|
48
48
|
}).withConfig({
|
|
49
49
|
displayName: "StyledGrip",
|
|
50
50
|
componentId: "sc-13uv9iv-0"
|
|
@@ -69,11 +69,11 @@ function getDragShadow(theme) {
|
|
|
69
69
|
}
|
|
70
70
|
const colorStyles$2 = props => {
|
|
71
71
|
const {
|
|
72
|
-
isBare,
|
|
73
|
-
isGrabbed,
|
|
74
|
-
isDisabled,
|
|
75
|
-
isPlaceholder,
|
|
76
|
-
focusInset,
|
|
72
|
+
$isBare,
|
|
73
|
+
$isGrabbed,
|
|
74
|
+
$isDisabled,
|
|
75
|
+
$isPlaceholder,
|
|
76
|
+
$focusInset,
|
|
77
77
|
theme
|
|
78
78
|
} = props;
|
|
79
79
|
const dragShadow = getDragShadow(theme);
|
|
@@ -98,23 +98,23 @@ const colorStyles$2 = props => {
|
|
|
98
98
|
let boxShadow;
|
|
99
99
|
let borderColor = 'transparent';
|
|
100
100
|
let backgroundColor = baseBgColor;
|
|
101
|
-
if (isDisabled) {
|
|
101
|
+
if ($isDisabled) {
|
|
102
102
|
backgroundColor = disabledBgColor;
|
|
103
103
|
color = disabledColor;
|
|
104
|
-
} else if (isPlaceholder) {
|
|
104
|
+
} else if ($isPlaceholder) {
|
|
105
105
|
backgroundColor = placeholderBgColor;
|
|
106
106
|
} else {
|
|
107
107
|
color = reactTheming.getColor({
|
|
108
108
|
variable: 'foreground.default',
|
|
109
109
|
theme
|
|
110
110
|
});
|
|
111
|
-
borderColor = isBare ? 'transparent' : reactTheming.getColor({
|
|
111
|
+
borderColor = $isBare ? 'transparent' : reactTheming.getColor({
|
|
112
112
|
variable: 'border.default',
|
|
113
113
|
theme
|
|
114
114
|
});
|
|
115
115
|
hoverBackgroundColor = reactTheming.getColor({
|
|
116
|
-
variable: isGrabbed ? 'background.raised' : 'background.primaryEmphasis',
|
|
117
|
-
...(
|
|
116
|
+
variable: $isGrabbed ? 'background.raised' : 'background.primaryEmphasis',
|
|
117
|
+
...(!$isGrabbed && {
|
|
118
118
|
transparency: theme.opacity[100],
|
|
119
119
|
dark: {
|
|
120
120
|
offset: -100
|
|
@@ -124,40 +124,40 @@ const colorStyles$2 = props => {
|
|
|
124
124
|
});
|
|
125
125
|
boxShadow = dragShadow;
|
|
126
126
|
}
|
|
127
|
-
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&:hover{background-color:", ";}", " > ", "{color:", ";}"], borderColor, isGrabbed && boxShadow, backgroundColor, color, hoverBackgroundColor, reactTheming.focusStyles({
|
|
127
|
+
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";&:hover{background-color:", ";}", " > ", "{color:", ";}"], borderColor, $isGrabbed && boxShadow, backgroundColor, color, hoverBackgroundColor, reactTheming.focusStyles({
|
|
128
128
|
theme,
|
|
129
|
-
inset: focusInset,
|
|
130
|
-
boxShadow: isGrabbed ? dragShadow : undefined
|
|
131
|
-
}), StyledGrip, isDisabled && disabledColor);
|
|
129
|
+
inset: $focusInset,
|
|
130
|
+
boxShadow: $isGrabbed ? dragShadow : undefined
|
|
131
|
+
}), StyledGrip, $isDisabled && disabledColor);
|
|
132
132
|
};
|
|
133
133
|
const sizeStyles$5 = props => {
|
|
134
134
|
const {
|
|
135
|
-
isCompact,
|
|
135
|
+
$isCompact,
|
|
136
136
|
theme
|
|
137
137
|
} = props;
|
|
138
138
|
const paddingDefault = theme.space.base * 2.25;
|
|
139
139
|
const paddingCompact = theme.space.base * 1.25;
|
|
140
|
-
return styled.css(["margin:0;border:", ";border-radius:", ";padding:", ";line-height:", ";font-size:", ";font-weight:", ";"], theme.borders.sm, theme.borderRadii.md, isCompact ? `${paddingCompact}px ${paddingDefault}px` : `${paddingDefault}px`, reactTheming.getLineHeight(theme.space.base * 5, theme.fontSizes.md), theme.fontSizes.md, theme.fontWeights.regular);
|
|
140
|
+
return styled.css(["margin:0;border:", ";border-radius:", ";padding:", ";line-height:", ";font-size:", ";font-weight:", ";"], theme.borders.sm, theme.borderRadii.md, $isCompact ? `${paddingCompact}px ${paddingDefault}px` : `${paddingDefault}px`, reactTheming.getLineHeight(theme.space.base * 5, theme.fontSizes.md), theme.fontSizes.md, theme.fontWeights.regular);
|
|
141
141
|
};
|
|
142
142
|
const getCursor = props => {
|
|
143
|
-
let cursor = props
|
|
144
|
-
if (props
|
|
143
|
+
let cursor = props.$isGrabbed ? 'grabbing' : 'grab';
|
|
144
|
+
if (props.$isDisabled || props.$isPlaceholder) {
|
|
145
145
|
cursor = 'default';
|
|
146
146
|
}
|
|
147
147
|
return cursor;
|
|
148
148
|
};
|
|
149
149
|
const StyledDraggable = styled__default.default.div.attrs({
|
|
150
150
|
'data-garden-id': COMPONENT_ID$7,
|
|
151
|
-
'data-garden-version': '9.1.
|
|
151
|
+
'data-garden-version': '9.1.2'
|
|
152
152
|
}).withConfig({
|
|
153
153
|
displayName: "StyledDraggable",
|
|
154
154
|
componentId: "sc-3lxpf1-0"
|
|
155
|
-
})(["display:flex;flex:1;align-items:center;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;cursor:", ";font-family:", ";direction:", ";box-sizing:border-box;", " ", " > *{visibility:", ";}", ";"], getCursor, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', sizeStyles$5, colorStyles$2, p => p
|
|
155
|
+
})(["display:flex;flex:1;align-items:center;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;cursor:", ";font-family:", ";direction:", ";box-sizing:border-box;", " ", " > *{visibility:", ";}", ";"], getCursor, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', sizeStyles$5, colorStyles$2, p => p.$isPlaceholder && !p.$isDisabled && 'hidden', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
156
156
|
|
|
157
157
|
const COMPONENT_ID$6 = 'draggable.content';
|
|
158
158
|
const StyledContent = styled__default.default.div.attrs({
|
|
159
159
|
'data-garden-id': COMPONENT_ID$6,
|
|
160
|
-
'data-garden-version': '9.1.
|
|
160
|
+
'data-garden-version': '9.1.2'
|
|
161
161
|
}).withConfig({
|
|
162
162
|
displayName: "StyledContent",
|
|
163
163
|
componentId: "sc-15arore-0"
|
|
@@ -166,16 +166,16 @@ const StyledContent = styled__default.default.div.attrs({
|
|
|
166
166
|
const COMPONENT_ID$5 = 'draggable_list.item';
|
|
167
167
|
const sizeStyles$4 = props => {
|
|
168
168
|
const {
|
|
169
|
-
isHorizontal,
|
|
169
|
+
$isHorizontal,
|
|
170
170
|
theme: {
|
|
171
171
|
space
|
|
172
172
|
}
|
|
173
173
|
} = props;
|
|
174
|
-
return styled.css(["padding:", ";"], isHorizontal ? `0 ${space.xxs}` : `${space.xxs} 0`);
|
|
174
|
+
return styled.css(["padding:", ";"], $isHorizontal ? `0 ${space.xxs}` : `${space.xxs} 0`);
|
|
175
175
|
};
|
|
176
176
|
const StyledItem = styled__default.default.li.attrs({
|
|
177
177
|
'data-garden-id': COMPONENT_ID$5,
|
|
178
|
-
'data-garden-version': '9.1.
|
|
178
|
+
'data-garden-version': '9.1.2'
|
|
179
179
|
}).withConfig({
|
|
180
180
|
displayName: "StyledItem",
|
|
181
181
|
componentId: "sc-1nps3s3-0"
|
|
@@ -184,14 +184,14 @@ const StyledItem = styled__default.default.li.attrs({
|
|
|
184
184
|
const COMPONENT_ID$4 = 'draggable_list';
|
|
185
185
|
const sizeStyles$3 = props => {
|
|
186
186
|
const {
|
|
187
|
-
isHorizontal,
|
|
187
|
+
$isHorizontal,
|
|
188
188
|
theme: {
|
|
189
189
|
space
|
|
190
190
|
}
|
|
191
191
|
} = props;
|
|
192
192
|
let marginStart = 'margin-top';
|
|
193
193
|
let marginEnd = 'margin-bottom';
|
|
194
|
-
if (isHorizontal) {
|
|
194
|
+
if ($isHorizontal) {
|
|
195
195
|
marginStart = 'margin-right';
|
|
196
196
|
marginEnd = 'margin-left';
|
|
197
197
|
}
|
|
@@ -199,11 +199,11 @@ const sizeStyles$3 = props => {
|
|
|
199
199
|
};
|
|
200
200
|
const StyledDraggableList = styled__default.default.ul.attrs({
|
|
201
201
|
'data-garden-id': COMPONENT_ID$4,
|
|
202
|
-
'data-garden-version': '9.1.
|
|
202
|
+
'data-garden-version': '9.1.2'
|
|
203
203
|
}).withConfig({
|
|
204
204
|
displayName: "StyledDraggableList",
|
|
205
205
|
componentId: "sc-17agksa-0"
|
|
206
|
-
})(["display:flex;flex-direction:", ";margin:0;padding:0;list-style:none;box-sizing:border-box;direction:", ";> ", "{flex:1;}", ";", ";"], p => p
|
|
206
|
+
})(["display:flex;flex-direction:", ";margin:0;padding:0;list-style:none;box-sizing:border-box;direction:", ";> ", "{flex:1;}", ";", ";"], p => p.$isHorizontal ? 'row' : 'column', props => props.theme.rtl && 'rtl', StyledItem, sizeStyles$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
207
207
|
|
|
208
208
|
const COMPONENT_ID$3 = 'draggable_list.drop_indicator';
|
|
209
209
|
const colorStyles$1 = props => {
|
|
@@ -218,17 +218,17 @@ const colorStyles$1 = props => {
|
|
|
218
218
|
};
|
|
219
219
|
const sizeStyles$2 = props => {
|
|
220
220
|
const {
|
|
221
|
-
isHorizontal,
|
|
221
|
+
$isHorizontal,
|
|
222
222
|
theme
|
|
223
223
|
} = props;
|
|
224
224
|
const pseudoSize = theme.space.xs;
|
|
225
|
-
const translateX = isHorizontal ? theme.space.xxs : theme.space.xs;
|
|
226
|
-
const translateY = isHorizontal ? theme.space.xs : theme.space.xxs;
|
|
225
|
+
const translateX = $isHorizontal ? theme.space.xxs : theme.space.xs;
|
|
226
|
+
const translateY = $isHorizontal ? theme.space.xs : theme.space.xxs;
|
|
227
227
|
return styled.css(["&::before,&::after{border-radius:50%;width:", ";height:", ";}&::before{top:0;left:0;transform:translate(-", ",-", ");}&::after{right:0;bottom:0;transform:translate(", ",", ");}"], pseudoSize, pseudoSize, translateX, translateY, translateX, translateY);
|
|
228
228
|
};
|
|
229
229
|
const StyledDropIndicator = styled__default.default.li.attrs({
|
|
230
230
|
'data-garden-id': COMPONENT_ID$3,
|
|
231
|
-
'data-garden-version': '9.1.
|
|
231
|
+
'data-garden-version': '9.1.2'
|
|
232
232
|
}).withConfig({
|
|
233
233
|
displayName: "StyledDropIndicator",
|
|
234
234
|
componentId: "sc-1f1u2lh-0"
|
|
@@ -237,19 +237,19 @@ const StyledDropIndicator = styled__default.default.li.attrs({
|
|
|
237
237
|
const COMPONENT_ID$2 = 'dropzone';
|
|
238
238
|
const colorStyles = props => {
|
|
239
239
|
const {
|
|
240
|
-
isDanger,
|
|
241
|
-
isDisabled,
|
|
242
|
-
isActive,
|
|
243
|
-
isHighlighted,
|
|
240
|
+
$isDanger,
|
|
241
|
+
$isDisabled,
|
|
242
|
+
$isActive,
|
|
243
|
+
$isHighlighted,
|
|
244
244
|
theme
|
|
245
245
|
} = props;
|
|
246
|
-
const fgVariable = isDanger ? 'foreground.danger' : 'foreground.primary';
|
|
246
|
+
const fgVariable = $isDanger ? 'foreground.danger' : 'foreground.primary';
|
|
247
247
|
const fgActive = reactTheming.getColor({
|
|
248
248
|
variable: fgVariable,
|
|
249
249
|
theme
|
|
250
250
|
});
|
|
251
251
|
const borderActive = reactTheming.getColor({
|
|
252
|
-
variable: isDanger ? `border.dangerEmphasis` : 'border.primaryEmphasis',
|
|
252
|
+
variable: $isDanger ? `border.dangerEmphasis` : 'border.primaryEmphasis',
|
|
253
253
|
theme
|
|
254
254
|
});
|
|
255
255
|
let backgroundColor = 'transparent';
|
|
@@ -261,7 +261,7 @@ const colorStyles = props => {
|
|
|
261
261
|
variable: `foreground.subtle`,
|
|
262
262
|
theme
|
|
263
263
|
});
|
|
264
|
-
if (isDisabled) {
|
|
264
|
+
if ($isDisabled) {
|
|
265
265
|
backgroundColor = reactTheming.getColor({
|
|
266
266
|
variable: 'background.disabled',
|
|
267
267
|
theme
|
|
@@ -274,8 +274,8 @@ const colorStyles = props => {
|
|
|
274
274
|
variable: 'foreground.disabled',
|
|
275
275
|
theme
|
|
276
276
|
});
|
|
277
|
-
} else if (isActive || isHighlighted) {
|
|
278
|
-
color = isHighlighted ? reactTheming.getColor({
|
|
277
|
+
} else if ($isActive || $isHighlighted) {
|
|
278
|
+
color = $isHighlighted ? reactTheming.getColor({
|
|
279
279
|
variable: fgVariable,
|
|
280
280
|
light: {
|
|
281
281
|
offset: 200
|
|
@@ -286,7 +286,7 @@ const colorStyles = props => {
|
|
|
286
286
|
theme
|
|
287
287
|
}) : fgActive;
|
|
288
288
|
backgroundColor = reactTheming.getColor({
|
|
289
|
-
variable: isDanger ? 'background.dangerEmphasis' : 'background.primaryEmphasis',
|
|
289
|
+
variable: $isDanger ? 'background.dangerEmphasis' : 'background.primaryEmphasis',
|
|
290
290
|
transparency: theme.opacity[100],
|
|
291
291
|
dark: {
|
|
292
292
|
offset: -100
|
|
@@ -294,7 +294,7 @@ const colorStyles = props => {
|
|
|
294
294
|
theme
|
|
295
295
|
});
|
|
296
296
|
borderColor = borderActive;
|
|
297
|
-
} else if (isDanger) {
|
|
297
|
+
} else if ($isDanger) {
|
|
298
298
|
borderColor = borderActive;
|
|
299
299
|
color = fgActive;
|
|
300
300
|
}
|
|
@@ -303,23 +303,23 @@ const colorStyles = props => {
|
|
|
303
303
|
const sizeStyles$1 = props => {
|
|
304
304
|
const {
|
|
305
305
|
theme,
|
|
306
|
-
isHighlighted
|
|
306
|
+
$isHighlighted
|
|
307
307
|
} = props;
|
|
308
|
-
const borderWidth = isHighlighted ? polished.math(`${theme.borderWidths.sm} * 2`) : theme.borderWidths.sm;
|
|
309
|
-
return styled.css(["border-width:", ";border-style:", ";border-radius:", ";padding:", "px;width:100%;font-family:", ";font-size:", ";"], borderWidth, isHighlighted ? theme.borderStyles.solid : 'dashed', theme.borderRadii.md, isHighlighted ? theme.space.base * 4 - 1 : theme.space.base * 4, theme.fonts.system, theme.fontSizes.md);
|
|
308
|
+
const borderWidth = $isHighlighted ? polished.math(`${theme.borderWidths.sm} * 2`) : theme.borderWidths.sm;
|
|
309
|
+
return styled.css(["border-width:", ";border-style:", ";border-radius:", ";padding:", "px;width:100%;font-family:", ";font-size:", ";"], borderWidth, $isHighlighted ? theme.borderStyles.solid : 'dashed', theme.borderRadii.md, $isHighlighted ? theme.space.base * 4 - 1 : theme.space.base * 4, theme.fonts.system, theme.fontSizes.md);
|
|
310
310
|
};
|
|
311
311
|
const StyledDropzone = styled__default.default.div.attrs({
|
|
312
312
|
'data-garden-id': COMPONENT_ID$2,
|
|
313
|
-
'data-garden-version': '9.1.
|
|
313
|
+
'data-garden-version': '9.1.2'
|
|
314
314
|
}).withConfig({
|
|
315
315
|
displayName: "StyledDropzone",
|
|
316
316
|
componentId: "sc-1b7zuip-0"
|
|
317
|
-
})(["display:", ";flex-direction:", ";align-items:", ";justify-content:", ";transition:border-color 0.25s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;margin:0;text-align:", ";direction:", ";box-sizing:border-box;", " ", " ", ";"], p => (p
|
|
317
|
+
})(["display:", ";flex-direction:", ";align-items:", ";justify-content:", ";transition:border-color 0.25s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,z-index 0.25s ease-in-out;margin:0;text-align:", ";direction:", ";box-sizing:border-box;", " ", " ", ";"], p => (p.$hasMessage || p.$hasIcon) && 'flex', p => p.$hasMessage && p.$isVertical && 'column', p => (p.$hasMessage || p.$hasIcon) && 'center', p => (p.$hasMessage || p.$hasIcon) && 'center', p => p.$hasMessage && 'center', props => props.theme.rtl && 'rtl', sizeStyles$1, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
318
318
|
|
|
319
319
|
const COMPONENT_ID$1 = 'dropzone.message';
|
|
320
320
|
const StyledMessage = styled__default.default.p.attrs({
|
|
321
321
|
'data-garden-id': COMPONENT_ID$1,
|
|
322
|
-
'data-garden-version': '9.1.
|
|
322
|
+
'data-garden-version': '9.1.2'
|
|
323
323
|
}).withConfig({
|
|
324
324
|
displayName: "StyledMessage",
|
|
325
325
|
componentId: "sc-5kb2l2-0"
|
|
@@ -329,11 +329,11 @@ const COMPONENT_ID = 'dropzone.icon';
|
|
|
329
329
|
function sizeStyles(_ref) {
|
|
330
330
|
let {
|
|
331
331
|
theme,
|
|
332
|
-
isVertical
|
|
332
|
+
$isVertical
|
|
333
333
|
} = _ref;
|
|
334
334
|
let property;
|
|
335
335
|
let value;
|
|
336
|
-
if (isVertical) {
|
|
336
|
+
if ($isVertical) {
|
|
337
337
|
property = 'margin-bottom';
|
|
338
338
|
value = theme.space.xs;
|
|
339
339
|
} else {
|
|
@@ -344,11 +344,11 @@ function sizeStyles(_ref) {
|
|
|
344
344
|
}
|
|
345
345
|
const StyledIcon = styled__default.default.div.attrs({
|
|
346
346
|
'data-garden-id': COMPONENT_ID,
|
|
347
|
-
'data-garden-version': '9.1.
|
|
347
|
+
'data-garden-version': '9.1.2'
|
|
348
348
|
}).withConfig({
|
|
349
349
|
displayName: "StyledIcon",
|
|
350
350
|
componentId: "sc-1o12gen-0"
|
|
351
|
-
})(["display:flex;width:", ";height:", ";", " ", ";"], props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, p => p
|
|
351
|
+
})(["display:flex;width:", ";height:", ";", " ", ";"], props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, p => p.$hasMessage && sizeStyles(p), props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
352
352
|
|
|
353
353
|
const Content = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledContent, Object.assign({}, props, {
|
|
354
354
|
ref: ref
|
|
@@ -419,17 +419,27 @@ Grip.displayName = 'Draggable.Grip';
|
|
|
419
419
|
|
|
420
420
|
const DraggableComponent = React.forwardRef((_ref, ref) => {
|
|
421
421
|
let {
|
|
422
|
+
focusInset,
|
|
423
|
+
isBare,
|
|
424
|
+
isCompact,
|
|
425
|
+
isDisabled,
|
|
426
|
+
isGrabbed,
|
|
427
|
+
isPlaceholder,
|
|
422
428
|
tag,
|
|
423
|
-
...
|
|
429
|
+
...other
|
|
424
430
|
} = _ref;
|
|
425
|
-
const isDisabled = props.isDisabled;
|
|
426
431
|
return React__namespace.default.createElement(StyledDraggable, Object.assign({
|
|
427
|
-
|
|
432
|
+
$focusInset: focusInset,
|
|
433
|
+
$isBare: isBare,
|
|
434
|
+
$isCompact: isCompact,
|
|
435
|
+
$isDisabled: isDisabled,
|
|
436
|
+
$isGrabbed: isGrabbed,
|
|
437
|
+
$isPlaceholder: isPlaceholder,
|
|
428
438
|
"aria-disabled": isDisabled,
|
|
439
|
+
as: tag,
|
|
440
|
+
ref: ref,
|
|
429
441
|
tabIndex: isDisabled ? undefined : 0
|
|
430
|
-
},
|
|
431
|
-
ref: ref
|
|
432
|
-
}));
|
|
442
|
+
}, other));
|
|
433
443
|
});
|
|
434
444
|
DraggableComponent.displayName = 'Draggable';
|
|
435
445
|
const Draggable = DraggableComponent;
|
|
@@ -452,7 +462,7 @@ const DropIndicator = React.forwardRef((props, ref) => {
|
|
|
452
462
|
const ariaLabel = reactTheming.useText(DropIndicator, props, 'aria-label', 'Drop indicator');
|
|
453
463
|
return React__namespace.default.createElement(StyledDropIndicator, Object.assign({}, props, {
|
|
454
464
|
"aria-label": ariaLabel,
|
|
455
|
-
isHorizontal: isHorizontal,
|
|
465
|
+
$isHorizontal: isHorizontal,
|
|
456
466
|
ref: ref
|
|
457
467
|
}));
|
|
458
468
|
});
|
|
@@ -463,21 +473,26 @@ const Item = React.forwardRef((props, ref) => {
|
|
|
463
473
|
isHorizontal
|
|
464
474
|
} = useDraggableListContext();
|
|
465
475
|
return React__namespace.default.createElement(StyledItem, Object.assign({}, props, {
|
|
466
|
-
isHorizontal: isHorizontal,
|
|
476
|
+
$isHorizontal: isHorizontal,
|
|
467
477
|
ref: ref
|
|
468
478
|
}));
|
|
469
479
|
});
|
|
470
480
|
Item.displayName = 'DraggableList.Item';
|
|
471
481
|
|
|
472
|
-
const DraggableListComponent = React.forwardRef((
|
|
482
|
+
const DraggableListComponent = React.forwardRef((_ref, ref) => {
|
|
483
|
+
let {
|
|
484
|
+
isHorizontal,
|
|
485
|
+
...other
|
|
486
|
+
} = _ref;
|
|
473
487
|
const value = React.useMemo(() => ({
|
|
474
|
-
isHorizontal
|
|
475
|
-
}), [
|
|
488
|
+
isHorizontal
|
|
489
|
+
}), [isHorizontal]);
|
|
476
490
|
return React__namespace.default.createElement(DraggableListContext.Provider, {
|
|
477
491
|
value: value
|
|
478
|
-
}, React__namespace.default.createElement(StyledDraggableList, Object.assign({
|
|
492
|
+
}, React__namespace.default.createElement(StyledDraggableList, Object.assign({
|
|
493
|
+
$isHorizontal: isHorizontal,
|
|
479
494
|
ref: ref
|
|
480
|
-
})));
|
|
495
|
+
}, other)));
|
|
481
496
|
});
|
|
482
497
|
DraggableListComponent.displayName = 'DraggableList';
|
|
483
498
|
const DraggableList = DraggableListComponent;
|
|
@@ -552,8 +567,8 @@ const Icon = React.forwardRef((props, ref) => {
|
|
|
552
567
|
return React__namespace.default.createElement(StyledIcon, Object.assign({
|
|
553
568
|
"aria-hidden": "true"
|
|
554
569
|
}, props, {
|
|
555
|
-
hasMessage: hasMessage,
|
|
556
|
-
isVertical: isVertical,
|
|
570
|
+
$hasMessage: hasMessage,
|
|
571
|
+
$isVertical: isVertical,
|
|
557
572
|
ref: ref
|
|
558
573
|
}));
|
|
559
574
|
});
|
|
@@ -561,14 +576,15 @@ Icon.displayName = 'Dropzone.Icon';
|
|
|
561
576
|
|
|
562
577
|
const DropzoneComponent = React.forwardRef((_ref, ref) => {
|
|
563
578
|
let {
|
|
564
|
-
tag,
|
|
565
|
-
isVertical,
|
|
566
579
|
children,
|
|
567
|
-
|
|
580
|
+
isActive,
|
|
581
|
+
isDanger,
|
|
582
|
+
isDisabled,
|
|
583
|
+
isHighlighted,
|
|
584
|
+
isVertical,
|
|
585
|
+
tag,
|
|
586
|
+
...other
|
|
568
587
|
} = _ref;
|
|
569
|
-
const {
|
|
570
|
-
isDanger
|
|
571
|
-
} = props;
|
|
572
588
|
const [hasMessage, setHasMessage] = React.useState(false);
|
|
573
589
|
const [hasIcon, setHasIcon] = React.useState(false);
|
|
574
590
|
const value = React.useMemo(() => ({
|
|
@@ -583,16 +599,20 @@ const DropzoneComponent = React.forwardRef((_ref, ref) => {
|
|
|
583
599
|
value: value
|
|
584
600
|
}, React__namespace.default.createElement(StyledDropzone, Object.assign({
|
|
585
601
|
as: tag,
|
|
586
|
-
"aria-disabled":
|
|
587
|
-
},
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
602
|
+
"aria-disabled": isDisabled
|
|
603
|
+
}, other, {
|
|
604
|
+
$isActive: isActive,
|
|
605
|
+
$isDisabled: isDisabled,
|
|
606
|
+
$isDanger: isDanger,
|
|
607
|
+
$isHighlighted: isHighlighted,
|
|
608
|
+
$hasIcon: hasIcon,
|
|
609
|
+
$hasMessage: hasMessage,
|
|
610
|
+
$isVertical: isVertical,
|
|
591
611
|
ref: ref
|
|
592
612
|
}), !!(hasMessage && isDanger) && !hasIcon && React__namespace.default.createElement(StyledIcon, {
|
|
593
613
|
"aria-hidden": "true",
|
|
594
|
-
hasMessage: hasMessage,
|
|
595
|
-
isVertical: isVertical
|
|
614
|
+
$hasMessage: hasMessage,
|
|
615
|
+
$isVertical: isVertical
|
|
596
616
|
}, React__namespace.default.createElement(SvgTrashStroke, null)), children));
|
|
597
617
|
});
|
|
598
618
|
DropzoneComponent.displayName = 'Dropzone';
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import { ThemeProps, DefaultTheme } from 'styled-components';
|
|
8
8
|
import { IGardenTheme } from '@zendeskgarden/react-theming';
|
|
9
9
|
export interface IStyledDraggableProps extends ThemeProps<DefaultTheme> {
|
|
10
|
-
focusInset?: boolean;
|
|
11
|
-
isBare?: boolean;
|
|
12
|
-
isCompact?: boolean;
|
|
13
|
-
isDisabled?: boolean;
|
|
14
|
-
isGrabbed?: boolean;
|
|
15
|
-
isPlaceholder?: boolean;
|
|
10
|
+
$focusInset?: boolean;
|
|
11
|
+
$isBare?: boolean;
|
|
12
|
+
$isCompact?: boolean;
|
|
13
|
+
$isDisabled?: boolean;
|
|
14
|
+
$isGrabbed?: boolean;
|
|
15
|
+
$isPlaceholder?: boolean;
|
|
16
16
|
}
|
|
17
17
|
export declare function getDragShadow(theme: IGardenTheme): string;
|
|
18
18
|
export declare const StyledDraggable: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ThemeProps, DefaultTheme } from 'styled-components';
|
|
8
8
|
export interface IStyledDropIndicatorProps extends ThemeProps<DefaultTheme> {
|
|
9
|
-
isHorizontal?: boolean;
|
|
9
|
+
$isHorizontal?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const StyledDropIndicator: import("styled-components").StyledComponent<"li", DefaultTheme, {
|
|
12
12
|
'data-garden-id': string;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme, ThemeProps } from 'styled-components';
|
|
8
8
|
export interface IStyledItemProps extends ThemeProps<DefaultTheme> {
|
|
9
|
-
isHorizontal?: boolean;
|
|
9
|
+
$isHorizontal?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const StyledItem: import("styled-components").StyledComponent<"li", DefaultTheme, {
|
|
12
12
|
'data-garden-id': string;
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme, ThemeProps } from 'styled-components';
|
|
8
8
|
export interface IStyledDropzoneProps extends ThemeProps<DefaultTheme> {
|
|
9
|
-
isActive?: boolean;
|
|
10
|
-
isVertical?: boolean;
|
|
11
|
-
isDanger?: boolean;
|
|
12
|
-
isDisabled?: boolean;
|
|
13
|
-
isHighlighted?: boolean;
|
|
14
|
-
hasMessage?: boolean;
|
|
15
|
-
hasIcon?: boolean;
|
|
9
|
+
$isActive?: boolean;
|
|
10
|
+
$isVertical?: boolean;
|
|
11
|
+
$isDanger?: boolean;
|
|
12
|
+
$isDisabled?: boolean;
|
|
13
|
+
$isHighlighted?: boolean;
|
|
14
|
+
$hasMessage?: boolean;
|
|
15
|
+
$hasIcon?: boolean;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* 1. Reset margin, e.g. when alternative tag includes native margin
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme, ThemeProps } from 'styled-components';
|
|
8
8
|
interface IStyledIconProps extends ThemeProps<DefaultTheme> {
|
|
9
|
-
isVertical?: boolean;
|
|
10
|
-
hasMessage?: boolean;
|
|
9
|
+
$isVertical?: boolean;
|
|
10
|
+
$hasMessage?: boolean;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* 1. Corrects the vertical text alignment of the icon within a dropzone message.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-draggable",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "Components related to drag and drop in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@dnd-kit/core": "6.1.0",
|
|
35
35
|
"@dnd-kit/sortable": "8.0.0",
|
|
36
36
|
"@dnd-kit/utilities": "3.2.2",
|
|
37
|
-
"@zendeskgarden/react-theming": "^9.1.
|
|
38
|
-
"@zendeskgarden/react-typography": "^9.1.
|
|
37
|
+
"@zendeskgarden/react-theming": "^9.1.2",
|
|
38
|
+
"@zendeskgarden/react-typography": "^9.1.2",
|
|
39
39
|
"@zendeskgarden/svg-icons": "7.3.0"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"zendeskgarden:src": "src/index.ts",
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "dd7b2e7fb6747ef39a028b4e7b9924c2098deea0"
|
|
56
56
|
}
|