@zendeskgarden/react-loaders 9.5.0 → 9.5.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/Dots.js +1 -1
- package/dist/esm/elements/Progress.js +1 -1
- package/dist/esm/elements/Spinner.js +3 -3
- package/dist/esm/styled/StyledInline.js +1 -1
- package/dist/esm/styled/StyledLoadingPlaceholder.js +19 -3
- package/dist/esm/styled/StyledProgress.js +2 -2
- package/dist/esm/styled/StyledSVG.js +18 -2
- package/dist/esm/styled/StyledSkeleton.js +1 -1
- package/dist/index.cjs.js +44 -13
- package/dist/typings/styled/StyledLoadingPlaceholder.d.ts +3 -3
- package/package.json +3 -3
|
@@ -53,7 +53,7 @@ const Dots = forwardRef((_ref, ref) => {
|
|
|
53
53
|
});
|
|
54
54
|
if (!delayComplete && delayMS !== 0) {
|
|
55
55
|
return React.createElement(StyledLoadingPlaceholder, {
|
|
56
|
-
fontSize: size
|
|
56
|
+
$fontSize: size
|
|
57
57
|
}, "\xA0");
|
|
58
58
|
}
|
|
59
59
|
return React.createElement(StyledSVG, Object.assign({
|
|
@@ -32,7 +32,7 @@ const Progress = React.forwardRef((_ref, ref) => {
|
|
|
32
32
|
return (
|
|
33
33
|
React.createElement(StyledProgressBackground, Object.assign({
|
|
34
34
|
"data-garden-id": COMPONENT_ID,
|
|
35
|
-
"data-garden-version": '9.5.
|
|
35
|
+
"data-garden-version": '9.5.2',
|
|
36
36
|
"aria-valuemax": 100,
|
|
37
37
|
"aria-valuemin": 0,
|
|
38
38
|
"aria-valuenow": percentage,
|
|
@@ -62,9 +62,9 @@ const Spinner = forwardRef((_ref, ref) => {
|
|
|
62
62
|
const HEIGHT = 80;
|
|
63
63
|
if (!delayComplete && delayMS !== 0) {
|
|
64
64
|
return React.createElement(StyledLoadingPlaceholder, {
|
|
65
|
-
width: "1em",
|
|
66
|
-
height: "1em",
|
|
67
|
-
fontSize: size
|
|
65
|
+
$width: "1em",
|
|
66
|
+
$height: "1em",
|
|
67
|
+
$fontSize: size
|
|
68
68
|
}, "\xA0");
|
|
69
69
|
}
|
|
70
70
|
return React.createElement(StyledSVG, Object.assign({
|
|
@@ -38,7 +38,7 @@ const StyledCircle = styled.circle.attrs({
|
|
|
38
38
|
})([""]);
|
|
39
39
|
const StyledInline = styled.svg.attrs(props => ({
|
|
40
40
|
'data-garden-id': COMPONENT_ID,
|
|
41
|
-
'data-garden-version': '9.5.
|
|
41
|
+
'data-garden-version': '9.5.2',
|
|
42
42
|
viewBox: '0 0 16 4',
|
|
43
43
|
width: props.$size,
|
|
44
44
|
height: props.$size * 0.25
|
|
@@ -4,17 +4,33 @@
|
|
|
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 from 'styled-components';
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { getValueAndUnit } from 'polished';
|
|
8
9
|
import { componentStyles } from '@zendeskgarden/react-theming';
|
|
9
10
|
|
|
10
11
|
const COMPONENT_ID = 'loaders.loading_placeholder';
|
|
12
|
+
const sizeStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
$width = '1em',
|
|
15
|
+
$height = '0.9em',
|
|
16
|
+
$fontSize
|
|
17
|
+
} = _ref;
|
|
18
|
+
const [value, unit] = getValueAndUnit($fontSize);
|
|
19
|
+
let fontSize;
|
|
20
|
+
if (unit === undefined) {
|
|
21
|
+
fontSize = $fontSize;
|
|
22
|
+
} else {
|
|
23
|
+
fontSize = `${value}${unit === '' ? 'px' : unit}`;
|
|
24
|
+
}
|
|
25
|
+
return css(["width:", ";height:", ";font-size:", ";"], $width, $height, fontSize);
|
|
26
|
+
};
|
|
11
27
|
const StyledLoadingPlaceholder = styled.div.attrs({
|
|
12
28
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.5.
|
|
29
|
+
'data-garden-version': '9.5.2',
|
|
14
30
|
role: 'progressbar'
|
|
15
31
|
}).withConfig({
|
|
16
32
|
displayName: "StyledLoadingPlaceholder",
|
|
17
33
|
componentId: "sc-x3bwsx-0"
|
|
18
|
-
})(["display:inline-block;
|
|
34
|
+
})(["display:inline-block;", ";", ""], sizeStyles, componentStyles);
|
|
19
35
|
|
|
20
36
|
export { StyledLoadingPlaceholder };
|
|
@@ -55,7 +55,7 @@ const colorStyles = _ref => {
|
|
|
55
55
|
};
|
|
56
56
|
const StyledProgressBackground = styled.div.attrs({
|
|
57
57
|
'data-garden-id': PROGRESS_BACKGROUND_COMPONENT_ID,
|
|
58
|
-
'data-garden-version': '9.5.
|
|
58
|
+
'data-garden-version': '9.5.2'
|
|
59
59
|
}).withConfig({
|
|
60
60
|
displayName: "StyledProgress__StyledProgressBackground",
|
|
61
61
|
componentId: "sc-2g8w4s-0"
|
|
@@ -63,7 +63,7 @@ const StyledProgressBackground = styled.div.attrs({
|
|
|
63
63
|
const PROGESS_INDICATOR_COMPONENT_ID = 'loaders.progress_indicator';
|
|
64
64
|
const StyledProgressIndicator = styled.div.attrs({
|
|
65
65
|
'data-garden-id': PROGESS_INDICATOR_COMPONENT_ID,
|
|
66
|
-
'data-garden-version': '9.5.
|
|
66
|
+
'data-garden-version': '9.5.2'
|
|
67
67
|
}).withConfig({
|
|
68
68
|
displayName: "StyledProgress__StyledProgressIndicator",
|
|
69
69
|
componentId: "sc-2g8w4s-1"
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
+
import { getValueAndUnit } from 'polished';
|
|
8
9
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
10
|
|
|
10
11
|
const colorStyles = _ref => {
|
|
@@ -21,8 +22,23 @@ const colorStyles = _ref => {
|
|
|
21
22
|
};
|
|
22
23
|
return css(["color:", ";"], getColor(options));
|
|
23
24
|
};
|
|
25
|
+
const sizeStyles = _ref2 => {
|
|
26
|
+
let {
|
|
27
|
+
$containerWidth = '1em',
|
|
28
|
+
$containerHeight = '0.9em',
|
|
29
|
+
$fontSize = 'inherit'
|
|
30
|
+
} = _ref2;
|
|
31
|
+
const [value, unit] = getValueAndUnit($fontSize);
|
|
32
|
+
let fontSize;
|
|
33
|
+
if (unit === undefined) {
|
|
34
|
+
fontSize = $fontSize;
|
|
35
|
+
} else {
|
|
36
|
+
fontSize = `${value}${unit === '' ? 'px' : unit}`;
|
|
37
|
+
}
|
|
38
|
+
return css(["width:", ";height:", ";font-size:", ";"], $containerWidth, $containerHeight, fontSize);
|
|
39
|
+
};
|
|
24
40
|
const StyledSVG = styled.svg.attrs(props => ({
|
|
25
|
-
'data-garden-version': '9.5.
|
|
41
|
+
'data-garden-version': '9.5.2',
|
|
26
42
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
27
43
|
focusable: 'false',
|
|
28
44
|
viewBox: `0 0 ${props.$width} ${props.$height}`,
|
|
@@ -30,6 +46,6 @@ const StyledSVG = styled.svg.attrs(props => ({
|
|
|
30
46
|
})).withConfig({
|
|
31
47
|
displayName: "StyledSVG",
|
|
32
48
|
componentId: "sc-1xtc3kx-0"
|
|
33
|
-
})(["
|
|
49
|
+
})(["", ";", ";", ";"], sizeStyles, colorStyles, componentStyles);
|
|
34
50
|
|
|
35
51
|
export { StyledSVG };
|
|
@@ -52,7 +52,7 @@ const gradientStyles = props => {
|
|
|
52
52
|
};
|
|
53
53
|
const StyledSkeleton = styled.div.attrs({
|
|
54
54
|
'data-garden-id': COMPONENT_ID,
|
|
55
|
-
'data-garden-version': '9.5.
|
|
55
|
+
'data-garden-version': '9.5.2'
|
|
56
56
|
}).withConfig({
|
|
57
57
|
displayName: "StyledSkeleton",
|
|
58
58
|
componentId: "sc-1raozze-0"
|
package/dist/index.cjs.js
CHANGED
|
@@ -11,6 +11,7 @@ var PropTypes = require('prop-types');
|
|
|
11
11
|
var styled = require('styled-components');
|
|
12
12
|
var containerSchedule = require('@zendeskgarden/container-schedule');
|
|
13
13
|
var reactTheming = require('@zendeskgarden/react-theming');
|
|
14
|
+
var polished = require('polished');
|
|
14
15
|
|
|
15
16
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
|
|
@@ -52,14 +53,29 @@ const StyledDotsCircleThree = styled__default.default(StyledDotsCircle).attrs(()
|
|
|
52
53
|
})(["", ";"], props => animationStyles$1(dotThreeKeyframes, props));
|
|
53
54
|
|
|
54
55
|
const COMPONENT_ID$5 = 'loaders.loading_placeholder';
|
|
56
|
+
const sizeStyles$1 = _ref => {
|
|
57
|
+
let {
|
|
58
|
+
$width = '1em',
|
|
59
|
+
$height = '0.9em',
|
|
60
|
+
$fontSize
|
|
61
|
+
} = _ref;
|
|
62
|
+
const [value, unit] = polished.getValueAndUnit($fontSize);
|
|
63
|
+
let fontSize;
|
|
64
|
+
if (unit === undefined) {
|
|
65
|
+
fontSize = $fontSize;
|
|
66
|
+
} else {
|
|
67
|
+
fontSize = `${value}${unit === '' ? 'px' : unit}`;
|
|
68
|
+
}
|
|
69
|
+
return styled.css(["width:", ";height:", ";font-size:", ";"], $width, $height, fontSize);
|
|
70
|
+
};
|
|
55
71
|
const StyledLoadingPlaceholder = styled__default.default.div.attrs({
|
|
56
72
|
'data-garden-id': COMPONENT_ID$5,
|
|
57
|
-
'data-garden-version': '9.5.
|
|
73
|
+
'data-garden-version': '9.5.2',
|
|
58
74
|
role: 'progressbar'
|
|
59
75
|
}).withConfig({
|
|
60
76
|
displayName: "StyledLoadingPlaceholder",
|
|
61
77
|
componentId: "sc-x3bwsx-0"
|
|
62
|
-
})(["display:inline-block;
|
|
78
|
+
})(["display:inline-block;", ";", ""], sizeStyles$1, reactTheming.componentStyles);
|
|
63
79
|
|
|
64
80
|
const sizeToHeight = ($size, theme) => {
|
|
65
81
|
switch ($size) {
|
|
@@ -109,7 +125,7 @@ const colorStyles$2 = _ref => {
|
|
|
109
125
|
};
|
|
110
126
|
const StyledProgressBackground = styled__default.default.div.attrs({
|
|
111
127
|
'data-garden-id': PROGRESS_BACKGROUND_COMPONENT_ID,
|
|
112
|
-
'data-garden-version': '9.5.
|
|
128
|
+
'data-garden-version': '9.5.2'
|
|
113
129
|
}).withConfig({
|
|
114
130
|
displayName: "StyledProgress__StyledProgressBackground",
|
|
115
131
|
componentId: "sc-2g8w4s-0"
|
|
@@ -117,7 +133,7 @@ const StyledProgressBackground = styled__default.default.div.attrs({
|
|
|
117
133
|
const PROGESS_INDICATOR_COMPONENT_ID = 'loaders.progress_indicator';
|
|
118
134
|
const StyledProgressIndicator = styled__default.default.div.attrs({
|
|
119
135
|
'data-garden-id': PROGESS_INDICATOR_COMPONENT_ID,
|
|
120
|
-
'data-garden-version': '9.5.
|
|
136
|
+
'data-garden-version': '9.5.2'
|
|
121
137
|
}).withConfig({
|
|
122
138
|
displayName: "StyledProgress__StyledProgressIndicator",
|
|
123
139
|
componentId: "sc-2g8w4s-1"
|
|
@@ -168,7 +184,7 @@ const gradientStyles = props => {
|
|
|
168
184
|
};
|
|
169
185
|
const StyledSkeleton = styled__default.default.div.attrs({
|
|
170
186
|
'data-garden-id': COMPONENT_ID$4,
|
|
171
|
-
'data-garden-version': '9.5.
|
|
187
|
+
'data-garden-version': '9.5.2'
|
|
172
188
|
}).withConfig({
|
|
173
189
|
displayName: "StyledSkeleton",
|
|
174
190
|
componentId: "sc-1raozze-0"
|
|
@@ -203,8 +219,23 @@ const colorStyles$1 = _ref => {
|
|
|
203
219
|
};
|
|
204
220
|
return styled.css(["color:", ";"], reactTheming.getColor(options));
|
|
205
221
|
};
|
|
222
|
+
const sizeStyles = _ref2 => {
|
|
223
|
+
let {
|
|
224
|
+
$containerWidth = '1em',
|
|
225
|
+
$containerHeight = '0.9em',
|
|
226
|
+
$fontSize = 'inherit'
|
|
227
|
+
} = _ref2;
|
|
228
|
+
const [value, unit] = polished.getValueAndUnit($fontSize);
|
|
229
|
+
let fontSize;
|
|
230
|
+
if (unit === undefined) {
|
|
231
|
+
fontSize = $fontSize;
|
|
232
|
+
} else {
|
|
233
|
+
fontSize = `${value}${unit === '' ? 'px' : unit}`;
|
|
234
|
+
}
|
|
235
|
+
return styled.css(["width:", ";height:", ";font-size:", ";"], $containerWidth, $containerHeight, fontSize);
|
|
236
|
+
};
|
|
206
237
|
const StyledSVG = styled__default.default.svg.attrs(props => ({
|
|
207
|
-
'data-garden-version': '9.5.
|
|
238
|
+
'data-garden-version': '9.5.2',
|
|
208
239
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
209
240
|
focusable: 'false',
|
|
210
241
|
viewBox: `0 0 ${props.$width} ${props.$height}`,
|
|
@@ -212,7 +243,7 @@ const StyledSVG = styled__default.default.svg.attrs(props => ({
|
|
|
212
243
|
})).withConfig({
|
|
213
244
|
displayName: "StyledSVG",
|
|
214
245
|
componentId: "sc-1xtc3kx-0"
|
|
215
|
-
})(["
|
|
246
|
+
})(["", ";", ";", ";"], sizeStyles, colorStyles$1, reactTheming.componentStyles);
|
|
216
247
|
|
|
217
248
|
const COMPONENT_ID$3 = 'loaders.inline';
|
|
218
249
|
const colorStyles = _ref => {
|
|
@@ -245,7 +276,7 @@ const StyledCircle = styled__default.default.circle.attrs({
|
|
|
245
276
|
})([""]);
|
|
246
277
|
const StyledInline = styled__default.default.svg.attrs(props => ({
|
|
247
278
|
'data-garden-id': COMPONENT_ID$3,
|
|
248
|
-
'data-garden-version': '9.5.
|
|
279
|
+
'data-garden-version': '9.5.2',
|
|
249
280
|
viewBox: '0 0 16 4',
|
|
250
281
|
width: props.$size,
|
|
251
282
|
height: props.$size * 0.25
|
|
@@ -290,7 +321,7 @@ const Dots = React.forwardRef((_ref, ref) => {
|
|
|
290
321
|
});
|
|
291
322
|
if (!delayComplete && delayMS !== 0) {
|
|
292
323
|
return React__default.default.createElement(StyledLoadingPlaceholder, {
|
|
293
|
-
fontSize: size
|
|
324
|
+
$fontSize: size
|
|
294
325
|
}, "\xA0");
|
|
295
326
|
}
|
|
296
327
|
return React__default.default.createElement(StyledSVG, Object.assign({
|
|
@@ -345,7 +376,7 @@ const Progress = React__default.default.forwardRef((_ref, ref) => {
|
|
|
345
376
|
return (
|
|
346
377
|
React__default.default.createElement(StyledProgressBackground, Object.assign({
|
|
347
378
|
"data-garden-id": COMPONENT_ID$1,
|
|
348
|
-
"data-garden-version": '9.5.
|
|
379
|
+
"data-garden-version": '9.5.2',
|
|
349
380
|
"aria-valuemax": 100,
|
|
350
381
|
"aria-valuemin": 0,
|
|
351
382
|
"aria-valuenow": percentage,
|
|
@@ -506,9 +537,9 @@ const Spinner = React.forwardRef((_ref, ref) => {
|
|
|
506
537
|
const HEIGHT = 80;
|
|
507
538
|
if (!delayComplete && delayMS !== 0) {
|
|
508
539
|
return React__default.default.createElement(StyledLoadingPlaceholder, {
|
|
509
|
-
width: "1em",
|
|
510
|
-
height: "1em",
|
|
511
|
-
fontSize: size
|
|
540
|
+
$width: "1em",
|
|
541
|
+
$height: "1em",
|
|
542
|
+
$fontSize: size
|
|
512
543
|
}, "\xA0");
|
|
513
544
|
}
|
|
514
545
|
return React__default.default.createElement(StyledSVG, Object.assign({
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
interface IStyledLoadingPlaceholderProps {
|
|
8
|
-
fontSize: string | number;
|
|
9
|
-
width?: string;
|
|
10
|
-
height?: string;
|
|
8
|
+
$fontSize: string | number;
|
|
9
|
+
$width?: string;
|
|
10
|
+
$height?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const StyledLoadingPlaceholder: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
13
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-loaders",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.2",
|
|
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.5.
|
|
35
|
+
"@zendeskgarden/react-theming": "^9.5.2"
|
|
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": "8810b8dc249ca752f9adfa8972a72860cc18c77b"
|
|
48
48
|
}
|