@zendeskgarden/react-loaders 9.12.3 → 9.12.5
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/Dots.js +9 -10
- package/dist/esm/elements/Inline.js +5 -6
- package/dist/esm/elements/Progress.js +10 -11
- package/dist/esm/elements/Skeleton.js +6 -7
- package/dist/esm/elements/Spinner.js +7 -8
- package/dist/esm/styled/StyledDots.js +4 -4
- package/dist/esm/styled/StyledInline.js +11 -15
- package/dist/esm/styled/StyledLoadingPlaceholder.js +9 -10
- package/dist/esm/styled/StyledProgress.js +7 -8
- package/dist/esm/styled/StyledSVG.js +14 -17
- package/dist/esm/styled/StyledSkeleton.js +10 -12
- package/dist/index.cjs.js +74 -90
- package/package.json +3 -3
|
@@ -14,17 +14,16 @@ import '../styled/StyledSpinnerCircle.js';
|
|
|
14
14
|
import { StyledSVG } from '../styled/StyledSVG.js';
|
|
15
15
|
import '../styled/StyledInline.js';
|
|
16
16
|
|
|
17
|
-
const COMPONENT_ID = 'loaders.dots';
|
|
18
|
-
const Dots = forwardRef((
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref;
|
|
17
|
+
const COMPONENT_ID$2 = 'loaders.dots';
|
|
18
|
+
const Dots = forwardRef(({
|
|
19
|
+
size = 'inherit',
|
|
20
|
+
color = 'inherit',
|
|
21
|
+
duration = 1250,
|
|
22
|
+
delayMS = 750,
|
|
23
|
+
...other
|
|
24
|
+
}, ref) => {
|
|
26
25
|
return React.createElement(StyledSVG, Object.assign({
|
|
27
|
-
"data-garden-id": COMPONENT_ID,
|
|
26
|
+
"data-garden-id": COMPONENT_ID$2,
|
|
28
27
|
ref: ref,
|
|
29
28
|
$fontSize: size,
|
|
30
29
|
$color: color,
|
|
@@ -15,12 +15,11 @@ import '../styled/StyledSpinnerCircle.js';
|
|
|
15
15
|
import '../styled/StyledSVG.js';
|
|
16
16
|
import { StyledInline, StyledCircle } from '../styled/StyledInline.js';
|
|
17
17
|
|
|
18
|
-
const Inline = forwardRef((
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
18
|
+
const Inline = forwardRef(({
|
|
19
|
+
size = 16,
|
|
20
|
+
color = 'inherit',
|
|
21
|
+
...other
|
|
22
|
+
}, ref) => {
|
|
24
23
|
const ariaLabel = useText(Inline, other, 'aria-label', 'loading');
|
|
25
24
|
return (
|
|
26
25
|
React.createElement(StyledInline, Object.assign({
|
|
@@ -16,23 +16,22 @@ import '../styled/StyledSpinnerCircle.js';
|
|
|
16
16
|
import '../styled/StyledSVG.js';
|
|
17
17
|
import '../styled/StyledInline.js';
|
|
18
18
|
|
|
19
|
-
const COMPONENT_ID = 'loaders.progress';
|
|
20
|
-
const Progress = React.forwardRef((
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} = _ref;
|
|
19
|
+
const COMPONENT_ID$1 = 'loaders.progress';
|
|
20
|
+
const Progress = React.forwardRef(({
|
|
21
|
+
color,
|
|
22
|
+
value = 0,
|
|
23
|
+
size = 'medium',
|
|
24
|
+
'aria-label': label,
|
|
25
|
+
...other
|
|
26
|
+
}, ref) => {
|
|
28
27
|
const percentage = Math.max(0, Math.min(100, value));
|
|
29
28
|
const ariaLabel = useText(Progress, {
|
|
30
29
|
'aria-label': label
|
|
31
30
|
}, 'aria-label', 'Progress');
|
|
32
31
|
return (
|
|
33
32
|
React.createElement(StyledProgressBackground, Object.assign({
|
|
34
|
-
"data-garden-id": COMPONENT_ID,
|
|
35
|
-
"data-garden-version": '9.12.
|
|
33
|
+
"data-garden-id": COMPONENT_ID$1,
|
|
34
|
+
"data-garden-version": '9.12.5',
|
|
36
35
|
"aria-valuemax": 100,
|
|
37
36
|
"aria-valuemin": 0,
|
|
38
37
|
"aria-valuenow": percentage,
|
|
@@ -14,13 +14,12 @@ import '../styled/StyledSpinnerCircle.js';
|
|
|
14
14
|
import '../styled/StyledSVG.js';
|
|
15
15
|
import '../styled/StyledInline.js';
|
|
16
16
|
|
|
17
|
-
const Skeleton = forwardRef((
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
17
|
+
const Skeleton = forwardRef(({
|
|
18
|
+
width = '100%',
|
|
19
|
+
height = '100%',
|
|
20
|
+
isLight,
|
|
21
|
+
...other
|
|
22
|
+
}, ref) => {
|
|
24
23
|
return React.createElement(StyledSkeleton, Object.assign({
|
|
25
24
|
ref: ref,
|
|
26
25
|
$isLight: isLight,
|
|
@@ -36,14 +36,13 @@ const computeFrames = (frames, duration) => {
|
|
|
36
36
|
return acc;
|
|
37
37
|
}, {});
|
|
38
38
|
};
|
|
39
|
-
const Spinner = forwardRef((
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} = _ref;
|
|
39
|
+
const Spinner = forwardRef(({
|
|
40
|
+
size = 'inherit',
|
|
41
|
+
duration = 1250,
|
|
42
|
+
color = 'inherit',
|
|
43
|
+
delayMS = 750,
|
|
44
|
+
...other
|
|
45
|
+
}, ref) => {
|
|
47
46
|
const strokeWidthValues = computeFrames(STROKE_WIDTH_FRAMES, duration);
|
|
48
47
|
const rotationValues = computeFrames(ROTATION_FRAMES, duration);
|
|
49
48
|
const dasharrayValues = computeFrames(DASHARRAY_FRAMES, duration);
|
|
@@ -14,7 +14,7 @@ const StyledDotsCircle = styled.circle.attrs({
|
|
|
14
14
|
displayName: "StyledDots__StyledDotsCircle",
|
|
15
15
|
componentId: "sc-1ltah7e-0"
|
|
16
16
|
})([""]);
|
|
17
|
-
const animationStyles = (animationName, props) => {
|
|
17
|
+
const animationStyles$1 = (animationName, props) => {
|
|
18
18
|
return css(["animation:", " ", "ms ", "ms linear infinite;"], animationName, props.$duration, props.$delay);
|
|
19
19
|
};
|
|
20
20
|
const StyledDotsCircleOne = styled(StyledDotsCircle).attrs({
|
|
@@ -22,18 +22,18 @@ const StyledDotsCircleOne = styled(StyledDotsCircle).attrs({
|
|
|
22
22
|
}).withConfig({
|
|
23
23
|
displayName: "StyledDots__StyledDotsCircleOne",
|
|
24
24
|
componentId: "sc-1ltah7e-1"
|
|
25
|
-
})(["", ";"], props => animationStyles(dotOneKeyframes, props));
|
|
25
|
+
})(["", ";"], props => animationStyles$1(dotOneKeyframes, props));
|
|
26
26
|
const StyledDotsCircleTwo = styled(StyledDotsCircle).attrs(() => ({
|
|
27
27
|
cx: 40
|
|
28
28
|
})).withConfig({
|
|
29
29
|
displayName: "StyledDots__StyledDotsCircleTwo",
|
|
30
30
|
componentId: "sc-1ltah7e-2"
|
|
31
|
-
})(["", ";"], props => animationStyles(dotTwoKeyframes, props));
|
|
31
|
+
})(["", ";"], props => animationStyles$1(dotTwoKeyframes, props));
|
|
32
32
|
const StyledDotsCircleThree = styled(StyledDotsCircle).attrs(() => ({
|
|
33
33
|
cx: 71
|
|
34
34
|
})).withConfig({
|
|
35
35
|
displayName: "StyledDots__StyledDotsCircleThree",
|
|
36
36
|
componentId: "sc-1ltah7e-3"
|
|
37
|
-
})(["", ";"], props => animationStyles(dotThreeKeyframes, props));
|
|
37
|
+
})(["", ";"], props => animationStyles$1(dotThreeKeyframes, props));
|
|
38
38
|
|
|
39
39
|
export { StyledDotsCircleOne, StyledDotsCircleThree, StyledDotsCircleTwo };
|
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import styled, {
|
|
7
|
+
import styled, { keyframes, css } from 'styled-components';
|
|
8
8
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'loaders.inline';
|
|
11
|
-
const colorStyles =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
10
|
+
const COMPONENT_ID$3 = 'loaders.inline';
|
|
11
|
+
const colorStyles = ({
|
|
12
|
+
theme,
|
|
13
|
+
$color
|
|
14
|
+
}) => {
|
|
16
15
|
const options = $color.includes('.') ? {
|
|
17
16
|
variable: $color,
|
|
18
17
|
theme
|
|
@@ -22,12 +21,9 @@ const colorStyles = _ref => {
|
|
|
22
21
|
};
|
|
23
22
|
return css(["color:", ";"], getColor(options));
|
|
24
23
|
};
|
|
25
|
-
const retrieveAnimation =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref2;
|
|
29
|
-
return keyframes(["0%,100%{opacity:", ";}50%{opacity:", ";}"], theme.opacity[200], theme.opacity[600]);
|
|
30
|
-
};
|
|
24
|
+
const retrieveAnimation = ({
|
|
25
|
+
theme
|
|
26
|
+
}) => keyframes(["0%,100%{opacity:", ";}50%{opacity:", ";}"], theme.opacity[200], theme.opacity[600]);
|
|
31
27
|
const StyledCircle = styled.circle.attrs({
|
|
32
28
|
fill: 'currentColor',
|
|
33
29
|
cy: 2,
|
|
@@ -37,8 +33,8 @@ const StyledCircle = styled.circle.attrs({
|
|
|
37
33
|
componentId: "sc-fxsb9l-0"
|
|
38
34
|
})([""]);
|
|
39
35
|
const StyledInline = styled.svg.attrs(props => ({
|
|
40
|
-
'data-garden-id': COMPONENT_ID,
|
|
41
|
-
'data-garden-version': '9.12.
|
|
36
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
37
|
+
'data-garden-version': '9.12.5',
|
|
42
38
|
viewBox: '0 0 16 4',
|
|
43
39
|
width: props.$size,
|
|
44
40
|
height: props.$size * 0.25
|
|
@@ -8,13 +8,12 @@ import styled, { css } from 'styled-components';
|
|
|
8
8
|
import { getValueAndUnit } from 'polished';
|
|
9
9
|
import { componentStyles } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'loaders.loading_placeholder';
|
|
12
|
-
const sizeStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
11
|
+
const COMPONENT_ID$5 = 'loaders.loading_placeholder';
|
|
12
|
+
const sizeStyles$1 = ({
|
|
13
|
+
$width = '1em',
|
|
14
|
+
$height = '0.9em',
|
|
15
|
+
$fontSize
|
|
16
|
+
}) => {
|
|
18
17
|
const [value, unit] = getValueAndUnit($fontSize);
|
|
19
18
|
let fontSize;
|
|
20
19
|
if (unit === undefined) {
|
|
@@ -25,12 +24,12 @@ const sizeStyles = _ref => {
|
|
|
25
24
|
return css(["width:", ";height:", ";font-size:", ";"], $width, $height, fontSize);
|
|
26
25
|
};
|
|
27
26
|
const StyledLoadingPlaceholder = styled.div.attrs({
|
|
28
|
-
'data-garden-id': COMPONENT_ID,
|
|
29
|
-
'data-garden-version': '9.12.
|
|
27
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
28
|
+
'data-garden-version': '9.12.5',
|
|
30
29
|
role: 'progressbar'
|
|
31
30
|
}).withConfig({
|
|
32
31
|
displayName: "StyledLoadingPlaceholder",
|
|
33
32
|
componentId: "sc-x3bwsx-0"
|
|
34
|
-
})(["display:inline-block;", ";", ""], sizeStyles, componentStyles);
|
|
33
|
+
})(["display:inline-block;", ";", ""], sizeStyles$1, componentStyles);
|
|
35
34
|
|
|
36
35
|
export { StyledLoadingPlaceholder };
|
|
@@ -19,11 +19,10 @@ const sizeToHeight = ($size, theme) => {
|
|
|
19
19
|
};
|
|
20
20
|
const sizeToBorderRadius = ($size, theme) => sizeToHeight($size, theme) / 2;
|
|
21
21
|
const PROGRESS_BACKGROUND_COMPONENT_ID = 'loaders.progress_background';
|
|
22
|
-
const colorStyles =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref;
|
|
22
|
+
const colorStyles$2 = ({
|
|
23
|
+
theme,
|
|
24
|
+
$color
|
|
25
|
+
}) => {
|
|
27
26
|
const backgroundColor = getColor({
|
|
28
27
|
theme,
|
|
29
28
|
transparency: theme.opacity[200],
|
|
@@ -55,15 +54,15 @@ const colorStyles = _ref => {
|
|
|
55
54
|
};
|
|
56
55
|
const StyledProgressBackground = styled.div.attrs({
|
|
57
56
|
'data-garden-id': PROGRESS_BACKGROUND_COMPONENT_ID,
|
|
58
|
-
'data-garden-version': '9.12.
|
|
57
|
+
'data-garden-version': '9.12.5'
|
|
59
58
|
}).withConfig({
|
|
60
59
|
displayName: "StyledProgress__StyledProgressBackground",
|
|
61
60
|
componentId: "sc-2g8w4s-0"
|
|
62
|
-
})(["margin:", "px 0;border-radius:", "px;", ";", ""], props => props.theme.space.base * 2, props => sizeToBorderRadius(props.$size, props.theme), colorStyles, componentStyles);
|
|
61
|
+
})(["margin:", "px 0;border-radius:", "px;", ";", ""], props => props.theme.space.base * 2, props => sizeToBorderRadius(props.$size, props.theme), colorStyles$2, componentStyles);
|
|
63
62
|
const PROGESS_INDICATOR_COMPONENT_ID = 'loaders.progress_indicator';
|
|
64
63
|
const StyledProgressIndicator = styled.div.attrs({
|
|
65
64
|
'data-garden-id': PROGESS_INDICATOR_COMPONENT_ID,
|
|
66
|
-
'data-garden-version': '9.12.
|
|
65
|
+
'data-garden-version': '9.12.5'
|
|
67
66
|
}).withConfig({
|
|
68
67
|
displayName: "StyledProgress__StyledProgressIndicator",
|
|
69
68
|
componentId: "sc-2g8w4s-1"
|
|
@@ -9,11 +9,10 @@ import { getValueAndUnit } from 'polished';
|
|
|
9
9
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
10
10
|
import { delayedVisibilityKeyframes } from '../utils/animations.js';
|
|
11
11
|
|
|
12
|
-
const colorStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} = _ref;
|
|
12
|
+
const colorStyles$1 = ({
|
|
13
|
+
theme,
|
|
14
|
+
$color = 'inherit'
|
|
15
|
+
}) => {
|
|
17
16
|
const options = $color.includes('.') ? {
|
|
18
17
|
variable: $color,
|
|
19
18
|
theme
|
|
@@ -23,12 +22,11 @@ const colorStyles = _ref => {
|
|
|
23
22
|
};
|
|
24
23
|
return css(["color:", ";"], getColor(options));
|
|
25
24
|
};
|
|
26
|
-
const sizeStyles =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref2;
|
|
25
|
+
const sizeStyles = ({
|
|
26
|
+
$containerWidth = '1em',
|
|
27
|
+
$containerHeight = '0.9em',
|
|
28
|
+
$fontSize = 'inherit'
|
|
29
|
+
}) => {
|
|
32
30
|
const [value, unit] = getValueAndUnit($fontSize);
|
|
33
31
|
let fontSize;
|
|
34
32
|
if (unit === undefined) {
|
|
@@ -38,17 +36,16 @@ const sizeStyles = _ref2 => {
|
|
|
38
36
|
}
|
|
39
37
|
return css(["width:", ";height:", ";font-size:", ";"], $containerWidth, $containerHeight, fontSize);
|
|
40
38
|
};
|
|
41
|
-
const delayedVisibilityStyles =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} = _ref3;
|
|
39
|
+
const delayedVisibilityStyles = ({
|
|
40
|
+
$delayShow
|
|
41
|
+
}) => {
|
|
45
42
|
if ($delayShow && $delayShow !== 0) {
|
|
46
43
|
return css(["animation:", " 1ms ", "ms linear 1 forwards;visibility:hidden;"], delayedVisibilityKeyframes, $delayShow);
|
|
47
44
|
}
|
|
48
45
|
return undefined;
|
|
49
46
|
};
|
|
50
47
|
const StyledSVG = styled.svg.attrs(props => ({
|
|
51
|
-
'data-garden-version': '9.12.
|
|
48
|
+
'data-garden-version': '9.12.5',
|
|
52
49
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
53
50
|
focusable: 'false',
|
|
54
51
|
viewBox: `0 0 ${props.$width} ${props.$height}`,
|
|
@@ -56,6 +53,6 @@ const StyledSVG = styled.svg.attrs(props => ({
|
|
|
56
53
|
})).withConfig({
|
|
57
54
|
displayName: "StyledSVG",
|
|
58
55
|
componentId: "sc-1xtc3kx-0"
|
|
59
|
-
})(["", ";", ";", ";", ";"], sizeStyles, colorStyles, componentStyles, delayedVisibilityStyles);
|
|
56
|
+
})(["", ";", ";", ";", ";"], sizeStyles, colorStyles$1, componentStyles, delayedVisibilityStyles);
|
|
60
57
|
|
|
61
58
|
export { StyledSVG };
|
|
@@ -7,15 +7,14 @@
|
|
|
7
7
|
import styled, { keyframes, css } from 'styled-components';
|
|
8
8
|
import { getLineHeight, componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'loaders.skeleton';
|
|
10
|
+
const COMPONENT_ID$4 = 'loaders.skeleton';
|
|
11
11
|
const fadeInAnimation = keyframes(["0%,60%{opacity:0;}100%{opacity:1;}"]);
|
|
12
12
|
const skeletonAnimation = keyframes(["0%{transform:translateX(-100%);}100%{transform:translateX(100%);}"]);
|
|
13
13
|
const skeletonRtlAnimation = keyframes(["0%{transform:translateX(100%);}100%{transform:translateX(-100%)}"]);
|
|
14
|
-
const getBackgroundColor =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
14
|
+
const getBackgroundColor = ({
|
|
15
|
+
theme,
|
|
16
|
+
$isLight
|
|
17
|
+
}) => {
|
|
19
18
|
let backgroundColor;
|
|
20
19
|
if ($isLight) {
|
|
21
20
|
backgroundColor = getColor({
|
|
@@ -38,10 +37,9 @@ const getBackgroundColor = _ref => {
|
|
|
38
37
|
}
|
|
39
38
|
return backgroundColor;
|
|
40
39
|
};
|
|
41
|
-
const animationStyles =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} = _ref2;
|
|
40
|
+
const animationStyles = ({
|
|
41
|
+
theme
|
|
42
|
+
}) => {
|
|
45
43
|
if (theme.rtl) {
|
|
46
44
|
return css(["animation:", " 1.5s ease-in-out 300ms infinite;"], skeletonRtlAnimation);
|
|
47
45
|
}
|
|
@@ -51,8 +49,8 @@ const gradientStyles = props => {
|
|
|
51
49
|
return css(["background-image:linear-gradient( ", ",transparent,", ",transparent );"], props.theme.rtl ? '-45deg' : '45deg', getBackgroundColor);
|
|
52
50
|
};
|
|
53
51
|
const StyledSkeleton = styled.div.attrs({
|
|
54
|
-
'data-garden-id': COMPONENT_ID,
|
|
55
|
-
'data-garden-version': '9.12.
|
|
52
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
53
|
+
'data-garden-version': '9.12.5'
|
|
56
54
|
}).withConfig({
|
|
57
55
|
displayName: "StyledSkeleton",
|
|
58
56
|
componentId: "sc-1raozze-0"
|
package/dist/index.cjs.js
CHANGED
|
@@ -54,12 +54,11 @@ const StyledDotsCircleThree = styled__default.default(StyledDotsCircle).attrs(()
|
|
|
54
54
|
})(["", ";"], props => animationStyles$1(dotThreeKeyframes, props));
|
|
55
55
|
|
|
56
56
|
const COMPONENT_ID$5 = 'loaders.loading_placeholder';
|
|
57
|
-
const sizeStyles$1 =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} = _ref;
|
|
57
|
+
const sizeStyles$1 = ({
|
|
58
|
+
$width = '1em',
|
|
59
|
+
$height = '0.9em',
|
|
60
|
+
$fontSize
|
|
61
|
+
}) => {
|
|
63
62
|
const [value, unit] = polished.getValueAndUnit($fontSize);
|
|
64
63
|
let fontSize;
|
|
65
64
|
if (unit === undefined) {
|
|
@@ -71,7 +70,7 @@ const sizeStyles$1 = _ref => {
|
|
|
71
70
|
};
|
|
72
71
|
const StyledLoadingPlaceholder = styled__default.default.div.attrs({
|
|
73
72
|
'data-garden-id': COMPONENT_ID$5,
|
|
74
|
-
'data-garden-version': '9.12.
|
|
73
|
+
'data-garden-version': '9.12.5',
|
|
75
74
|
role: 'progressbar'
|
|
76
75
|
}).withConfig({
|
|
77
76
|
displayName: "StyledLoadingPlaceholder",
|
|
@@ -90,11 +89,10 @@ const sizeToHeight = ($size, theme) => {
|
|
|
90
89
|
};
|
|
91
90
|
const sizeToBorderRadius = ($size, theme) => sizeToHeight($size, theme) / 2;
|
|
92
91
|
const PROGRESS_BACKGROUND_COMPONENT_ID = 'loaders.progress_background';
|
|
93
|
-
const colorStyles$2 =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} = _ref;
|
|
92
|
+
const colorStyles$2 = ({
|
|
93
|
+
theme,
|
|
94
|
+
$color
|
|
95
|
+
}) => {
|
|
98
96
|
const backgroundColor = reactTheming.getColor({
|
|
99
97
|
theme,
|
|
100
98
|
transparency: theme.opacity[200],
|
|
@@ -126,7 +124,7 @@ const colorStyles$2 = _ref => {
|
|
|
126
124
|
};
|
|
127
125
|
const StyledProgressBackground = styled__default.default.div.attrs({
|
|
128
126
|
'data-garden-id': PROGRESS_BACKGROUND_COMPONENT_ID,
|
|
129
|
-
'data-garden-version': '9.12.
|
|
127
|
+
'data-garden-version': '9.12.5'
|
|
130
128
|
}).withConfig({
|
|
131
129
|
displayName: "StyledProgress__StyledProgressBackground",
|
|
132
130
|
componentId: "sc-2g8w4s-0"
|
|
@@ -134,7 +132,7 @@ const StyledProgressBackground = styled__default.default.div.attrs({
|
|
|
134
132
|
const PROGESS_INDICATOR_COMPONENT_ID = 'loaders.progress_indicator';
|
|
135
133
|
const StyledProgressIndicator = styled__default.default.div.attrs({
|
|
136
134
|
'data-garden-id': PROGESS_INDICATOR_COMPONENT_ID,
|
|
137
|
-
'data-garden-version': '9.12.
|
|
135
|
+
'data-garden-version': '9.12.5'
|
|
138
136
|
}).withConfig({
|
|
139
137
|
displayName: "StyledProgress__StyledProgressIndicator",
|
|
140
138
|
componentId: "sc-2g8w4s-1"
|
|
@@ -144,11 +142,10 @@ const COMPONENT_ID$4 = 'loaders.skeleton';
|
|
|
144
142
|
const fadeInAnimation = styled.keyframes(["0%,60%{opacity:0;}100%{opacity:1;}"]);
|
|
145
143
|
const skeletonAnimation = styled.keyframes(["0%{transform:translateX(-100%);}100%{transform:translateX(100%);}"]);
|
|
146
144
|
const skeletonRtlAnimation = styled.keyframes(["0%{transform:translateX(100%);}100%{transform:translateX(-100%)}"]);
|
|
147
|
-
const getBackgroundColor =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} = _ref;
|
|
145
|
+
const getBackgroundColor = ({
|
|
146
|
+
theme,
|
|
147
|
+
$isLight
|
|
148
|
+
}) => {
|
|
152
149
|
let backgroundColor;
|
|
153
150
|
if ($isLight) {
|
|
154
151
|
backgroundColor = reactTheming.getColor({
|
|
@@ -171,10 +168,9 @@ const getBackgroundColor = _ref => {
|
|
|
171
168
|
}
|
|
172
169
|
return backgroundColor;
|
|
173
170
|
};
|
|
174
|
-
const animationStyles =
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
} = _ref2;
|
|
171
|
+
const animationStyles = ({
|
|
172
|
+
theme
|
|
173
|
+
}) => {
|
|
178
174
|
if (theme.rtl) {
|
|
179
175
|
return styled.css(["animation:", " 1.5s ease-in-out 300ms infinite;"], skeletonRtlAnimation);
|
|
180
176
|
}
|
|
@@ -185,7 +181,7 @@ const gradientStyles = props => {
|
|
|
185
181
|
};
|
|
186
182
|
const StyledSkeleton = styled__default.default.div.attrs({
|
|
187
183
|
'data-garden-id': COMPONENT_ID$4,
|
|
188
|
-
'data-garden-version': '9.12.
|
|
184
|
+
'data-garden-version': '9.12.5'
|
|
189
185
|
}).withConfig({
|
|
190
186
|
displayName: "StyledSkeleton",
|
|
191
187
|
componentId: "sc-1raozze-0"
|
|
@@ -206,11 +202,10 @@ const StyledSpinnerCircle = styled__default.default.circle.attrs(props => ({
|
|
|
206
202
|
componentId: "sc-o4kd70-0"
|
|
207
203
|
})([""]);
|
|
208
204
|
|
|
209
|
-
const colorStyles$1 =
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
} = _ref;
|
|
205
|
+
const colorStyles$1 = ({
|
|
206
|
+
theme,
|
|
207
|
+
$color = 'inherit'
|
|
208
|
+
}) => {
|
|
214
209
|
const options = $color.includes('.') ? {
|
|
215
210
|
variable: $color,
|
|
216
211
|
theme
|
|
@@ -220,12 +215,11 @@ const colorStyles$1 = _ref => {
|
|
|
220
215
|
};
|
|
221
216
|
return styled.css(["color:", ";"], reactTheming.getColor(options));
|
|
222
217
|
};
|
|
223
|
-
const sizeStyles =
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
} = _ref2;
|
|
218
|
+
const sizeStyles = ({
|
|
219
|
+
$containerWidth = '1em',
|
|
220
|
+
$containerHeight = '0.9em',
|
|
221
|
+
$fontSize = 'inherit'
|
|
222
|
+
}) => {
|
|
229
223
|
const [value, unit] = polished.getValueAndUnit($fontSize);
|
|
230
224
|
let fontSize;
|
|
231
225
|
if (unit === undefined) {
|
|
@@ -235,17 +229,16 @@ const sizeStyles = _ref2 => {
|
|
|
235
229
|
}
|
|
236
230
|
return styled.css(["width:", ";height:", ";font-size:", ";"], $containerWidth, $containerHeight, fontSize);
|
|
237
231
|
};
|
|
238
|
-
const delayedVisibilityStyles =
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
} = _ref3;
|
|
232
|
+
const delayedVisibilityStyles = ({
|
|
233
|
+
$delayShow
|
|
234
|
+
}) => {
|
|
242
235
|
if ($delayShow && $delayShow !== 0) {
|
|
243
236
|
return styled.css(["animation:", " 1ms ", "ms linear 1 forwards;visibility:hidden;"], delayedVisibilityKeyframes, $delayShow);
|
|
244
237
|
}
|
|
245
238
|
return undefined;
|
|
246
239
|
};
|
|
247
240
|
const StyledSVG = styled__default.default.svg.attrs(props => ({
|
|
248
|
-
'data-garden-version': '9.12.
|
|
241
|
+
'data-garden-version': '9.12.5',
|
|
249
242
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
250
243
|
focusable: 'false',
|
|
251
244
|
viewBox: `0 0 ${props.$width} ${props.$height}`,
|
|
@@ -256,11 +249,10 @@ const StyledSVG = styled__default.default.svg.attrs(props => ({
|
|
|
256
249
|
})(["", ";", ";", ";", ";"], sizeStyles, colorStyles$1, reactTheming.componentStyles, delayedVisibilityStyles);
|
|
257
250
|
|
|
258
251
|
const COMPONENT_ID$3 = 'loaders.inline';
|
|
259
|
-
const colorStyles =
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
} = _ref;
|
|
252
|
+
const colorStyles = ({
|
|
253
|
+
theme,
|
|
254
|
+
$color
|
|
255
|
+
}) => {
|
|
264
256
|
const options = $color.includes('.') ? {
|
|
265
257
|
variable: $color,
|
|
266
258
|
theme
|
|
@@ -270,12 +262,9 @@ const colorStyles = _ref => {
|
|
|
270
262
|
};
|
|
271
263
|
return styled.css(["color:", ";"], reactTheming.getColor(options));
|
|
272
264
|
};
|
|
273
|
-
const retrieveAnimation =
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
} = _ref2;
|
|
277
|
-
return styled.keyframes(["0%,100%{opacity:", ";}50%{opacity:", ";}"], theme.opacity[200], theme.opacity[600]);
|
|
278
|
-
};
|
|
265
|
+
const retrieveAnimation = ({
|
|
266
|
+
theme
|
|
267
|
+
}) => styled.keyframes(["0%,100%{opacity:", ";}50%{opacity:", ";}"], theme.opacity[200], theme.opacity[600]);
|
|
279
268
|
const StyledCircle = styled__default.default.circle.attrs({
|
|
280
269
|
fill: 'currentColor',
|
|
281
270
|
cy: 2,
|
|
@@ -286,7 +275,7 @@ const StyledCircle = styled__default.default.circle.attrs({
|
|
|
286
275
|
})([""]);
|
|
287
276
|
const StyledInline = styled__default.default.svg.attrs(props => ({
|
|
288
277
|
'data-garden-id': COMPONENT_ID$3,
|
|
289
|
-
'data-garden-version': '9.12.
|
|
278
|
+
'data-garden-version': '9.12.5',
|
|
290
279
|
viewBox: '0 0 16 4',
|
|
291
280
|
width: props.$size,
|
|
292
281
|
height: props.$size * 0.25
|
|
@@ -296,14 +285,13 @@ const StyledInline = styled__default.default.svg.attrs(props => ({
|
|
|
296
285
|
})(["", ";", "{opacity:0.2;&:nth-child(1){animation:", " 1s infinite;animation-delay:", ";}&:nth-child(2){animation:", " 1s infinite;animation-delay:0.2s;}&:nth-child(3){animation:", " 1s infinite;animation-delay:", ";}}", ""], colorStyles, StyledCircle, retrieveAnimation, props => props.theme.rtl ? 'unset' : '0.4s', retrieveAnimation, retrieveAnimation, props => props.theme.rtl ? '0.4s' : 'unset', reactTheming.componentStyles);
|
|
297
286
|
|
|
298
287
|
const COMPONENT_ID$2 = 'loaders.dots';
|
|
299
|
-
const Dots = React.forwardRef((
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
} = _ref;
|
|
288
|
+
const Dots = React.forwardRef(({
|
|
289
|
+
size = 'inherit',
|
|
290
|
+
color = 'inherit',
|
|
291
|
+
duration = 1250,
|
|
292
|
+
delayMS = 750,
|
|
293
|
+
...other
|
|
294
|
+
}, ref) => {
|
|
307
295
|
return React__default.default.createElement(StyledSVG, Object.assign({
|
|
308
296
|
"data-garden-id": COMPONENT_ID$2,
|
|
309
297
|
ref: ref,
|
|
@@ -336,14 +324,13 @@ Dots.propTypes = {
|
|
|
336
324
|
const SIZE = ['small', 'medium', 'large'];
|
|
337
325
|
|
|
338
326
|
const COMPONENT_ID$1 = 'loaders.progress';
|
|
339
|
-
const Progress = React__default.default.forwardRef((
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
} = _ref;
|
|
327
|
+
const Progress = React__default.default.forwardRef(({
|
|
328
|
+
color,
|
|
329
|
+
value = 0,
|
|
330
|
+
size = 'medium',
|
|
331
|
+
'aria-label': label,
|
|
332
|
+
...other
|
|
333
|
+
}, ref) => {
|
|
347
334
|
const percentage = Math.max(0, Math.min(100, value));
|
|
348
335
|
const ariaLabel = reactTheming.useText(Progress, {
|
|
349
336
|
'aria-label': label
|
|
@@ -351,7 +338,7 @@ const Progress = React__default.default.forwardRef((_ref, ref) => {
|
|
|
351
338
|
return (
|
|
352
339
|
React__default.default.createElement(StyledProgressBackground, Object.assign({
|
|
353
340
|
"data-garden-id": COMPONENT_ID$1,
|
|
354
|
-
"data-garden-version": '9.12.
|
|
341
|
+
"data-garden-version": '9.12.5',
|
|
355
342
|
"aria-valuemax": 100,
|
|
356
343
|
"aria-valuemin": 0,
|
|
357
344
|
"aria-valuenow": percentage,
|
|
@@ -373,13 +360,12 @@ Progress.propTypes = {
|
|
|
373
360
|
size: PropTypes__default.default.oneOf(SIZE)
|
|
374
361
|
};
|
|
375
362
|
|
|
376
|
-
const Skeleton = React.forwardRef((
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
} = _ref;
|
|
363
|
+
const Skeleton = React.forwardRef(({
|
|
364
|
+
width = '100%',
|
|
365
|
+
height = '100%',
|
|
366
|
+
isLight,
|
|
367
|
+
...other
|
|
368
|
+
}, ref) => {
|
|
383
369
|
return React__default.default.createElement(StyledSkeleton, Object.assign({
|
|
384
370
|
ref: ref,
|
|
385
371
|
$isLight: isLight,
|
|
@@ -478,14 +464,13 @@ const computeFrames = (frames, duration) => {
|
|
|
478
464
|
return acc;
|
|
479
465
|
}, {});
|
|
480
466
|
};
|
|
481
|
-
const Spinner = React.forwardRef((
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
} = _ref;
|
|
467
|
+
const Spinner = React.forwardRef(({
|
|
468
|
+
size = 'inherit',
|
|
469
|
+
duration = 1250,
|
|
470
|
+
color = 'inherit',
|
|
471
|
+
delayMS = 750,
|
|
472
|
+
...other
|
|
473
|
+
}, ref) => {
|
|
489
474
|
const strokeWidthValues = computeFrames(STROKE_WIDTH_FRAMES, duration);
|
|
490
475
|
const rotationValues = computeFrames(ROTATION_FRAMES, duration);
|
|
491
476
|
const dasharrayValues = computeFrames(DASHARRAY_FRAMES, duration);
|
|
@@ -532,12 +517,11 @@ Spinner.propTypes = {
|
|
|
532
517
|
delayMS: PropTypes__default.default.number
|
|
533
518
|
};
|
|
534
519
|
|
|
535
|
-
const Inline = React.forwardRef((
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
} = _ref;
|
|
520
|
+
const Inline = React.forwardRef(({
|
|
521
|
+
size = 16,
|
|
522
|
+
color = 'inherit',
|
|
523
|
+
...other
|
|
524
|
+
}, ref) => {
|
|
541
525
|
const ariaLabel = reactTheming.useText(Inline, other, 'aria-label', 'loading');
|
|
542
526
|
return (
|
|
543
527
|
React__default.default.createElement(StyledInline, Object.assign({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-loaders",
|
|
3
|
-
"version": "9.12.
|
|
3
|
+
"version": "9.12.5",
|
|
4
4
|
"description": "Components relating to loaders in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"styled-components": "^5.3.1 || ^6.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@zendeskgarden/react-theming": "^9.12.
|
|
35
|
+
"@zendeskgarden/react-theming": "^9.12.5"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"components",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"zendeskgarden:src": "src/index.ts",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a4edcee778788b0e30fc17671b95a6e239e27912"
|
|
48
48
|
}
|