@workday/canvas-kit-react 11.0.0-alpha.664-next.0 → 11.0.0-alpha.667-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/badge/lib/CountBadge.js +3 -3
- package/dist/commonjs/button/lib/BaseButton.js +17 -17
- package/dist/commonjs/button/lib/DeleteButton.js +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +2 -2
- package/dist/commonjs/button/lib/SecondaryButton.js +2 -2
- package/dist/commonjs/button/lib/TertiaryButton.js +15 -15
- package/dist/commonjs/card/lib/Card.js +1 -1
- package/dist/commonjs/card/lib/CardHeading.js +1 -1
- package/dist/commonjs/common/lib/AccessibleHide.js +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.js +1 -1
- package/dist/commonjs/loading-dots/lib/LoadingDots.d.ts +2 -2
- package/dist/commonjs/loading-dots/lib/LoadingDots.d.ts.map +1 -1
- package/dist/commonjs/loading-dots/lib/LoadingDots.js +19 -42
- package/dist/commonjs/popup/lib/hooks/useCloseOnOutsideClick.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/useCloseOnOutsideClick.js +2 -0
- package/dist/commonjs/select/lib/Select.js +1 -1
- package/dist/commonjs/text/lib/LabelText.js +18 -18
- package/dist/commonjs/text/lib/Text.js +15 -15
- package/dist/es6/badge/lib/CountBadge.js +3 -3
- package/dist/es6/button/lib/BaseButton.js +17 -17
- package/dist/es6/button/lib/DeleteButton.js +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +2 -2
- package/dist/es6/button/lib/SecondaryButton.js +2 -2
- package/dist/es6/button/lib/TertiaryButton.js +15 -15
- package/dist/es6/card/lib/Card.js +1 -1
- package/dist/es6/card/lib/CardHeading.js +1 -1
- package/dist/es6/common/lib/AccessibleHide.js +1 -1
- package/dist/es6/common/lib/CanvasProvider.js +1 -1
- package/dist/es6/loading-dots/lib/LoadingDots.d.ts +2 -2
- package/dist/es6/loading-dots/lib/LoadingDots.d.ts.map +1 -1
- package/dist/es6/loading-dots/lib/LoadingDots.js +20 -42
- package/dist/es6/popup/lib/hooks/useCloseOnOutsideClick.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/useCloseOnOutsideClick.js +2 -0
- package/dist/es6/select/lib/Select.js +1 -1
- package/dist/es6/text/lib/LabelText.js +18 -18
- package/dist/es6/text/lib/Text.js +15 -15
- package/loading-dots/lib/LoadingDots.tsx +55 -54
- package/package.json +4 -4
- package/popup/lib/hooks/useCloseOnOutsideClick.ts +2 -0
|
@@ -1,73 +1,74 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
3
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
4
|
+
import {createStyles, handleCsProp, keyframes, CSProps} from '@workday/canvas-kit-styling';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Duration of the sparkle dots loading (in ms).
|
|
8
|
+
*/
|
|
9
|
+
const ANIMATION_DURATION_MS = '1400';
|
|
5
10
|
|
|
6
11
|
/**
|
|
7
12
|
* Keyframe for the dots loading animation.
|
|
8
13
|
*/
|
|
9
|
-
const keyframesLoading = keyframes
|
|
10
|
-
0%,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}`;
|
|
14
|
+
const keyframesLoading = keyframes({
|
|
15
|
+
'0%, 80%, 100%': {
|
|
16
|
+
transform: 'scale(0)',
|
|
17
|
+
},
|
|
18
|
+
'40%': {
|
|
19
|
+
transform: 'scale(1)',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const loadingDotStyles = createStyles({
|
|
24
|
+
backgroundColor: base.soap400,
|
|
25
|
+
width: system.space.x4,
|
|
26
|
+
height: system.space.x4,
|
|
27
|
+
fontSize: system.space.zero,
|
|
28
|
+
borderRadius: system.shape.round,
|
|
29
|
+
transform: 'scale(0)',
|
|
30
|
+
display: 'inline-block',
|
|
31
|
+
animationName: keyframesLoading,
|
|
32
|
+
animationDuration: `${ANIMATION_DURATION_MS}ms`,
|
|
33
|
+
animationIterationCount: 'infinite',
|
|
34
|
+
animationTimingFunction: 'ease-in-out',
|
|
35
|
+
animationFillMode: 'both',
|
|
36
|
+
'&:nth-child(1)': {
|
|
37
|
+
animationDelay: '0ms',
|
|
38
|
+
},
|
|
39
|
+
'&:nth-child(2)': {
|
|
40
|
+
animationDelay: `calc(${ANIMATION_DURATION_MS}ms * (4/35))`, // 160
|
|
41
|
+
},
|
|
42
|
+
'&:nth-child(3)': {
|
|
43
|
+
animationDelay: `calc(${ANIMATION_DURATION_MS}ms * (8/35))`, // 320
|
|
44
|
+
},
|
|
45
|
+
});
|
|
25
46
|
|
|
26
47
|
/**
|
|
27
48
|
* The actual loading dot div.
|
|
28
49
|
*/
|
|
29
|
-
const LoadingAnimationDot =
|
|
30
|
-
{
|
|
31
|
-
backgroundColor: canvas.colors.soap400,
|
|
32
|
-
width: canvas.space.s,
|
|
33
|
-
height: canvas.space.s,
|
|
34
|
-
fontSize: '0px',
|
|
35
|
-
borderRadius: borderRadius.circle,
|
|
36
|
-
transform: 'scale(0)',
|
|
37
|
-
display: 'inline-block',
|
|
38
|
-
marginRight: canvas.space.xxs,
|
|
39
|
-
animationName: keyframesLoading,
|
|
40
|
-
animationDuration: '1400ms',
|
|
41
|
-
animationIterationCount: 'infinite',
|
|
42
|
-
animationTimingFunction: 'ease-in-out',
|
|
43
|
-
animationFillMode: 'both',
|
|
44
|
-
'&:last-child': {
|
|
45
|
-
marginRight: 0,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
({animationDelay}) => ({
|
|
49
|
-
animationDelay: animationDelay + 'ms',
|
|
50
|
-
})
|
|
51
|
-
);
|
|
50
|
+
const LoadingAnimationDot = () => <div className={`${loadingDotStyles}`}></div>;
|
|
52
51
|
|
|
53
52
|
/**
|
|
54
53
|
* A simple container for the loading dots.
|
|
55
54
|
*/
|
|
56
|
-
const
|
|
57
|
-
display: 'inline-
|
|
55
|
+
const containerStyles = createStyles({
|
|
56
|
+
display: 'inline-flex',
|
|
57
|
+
gap: system.space.x2,
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* A simple component that displays three horizontal dots, to be used when some data is loading.
|
|
62
62
|
*/
|
|
63
|
-
export
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
63
|
+
export const LoadingDots = createComponent('div')({
|
|
64
|
+
displayName: 'LoadingDots',
|
|
65
|
+
Component: (elemProps: CSProps, ref, Element) => {
|
|
66
|
+
return (
|
|
67
|
+
<Element ref={ref} {...handleCsProp(elemProps, containerStyles)}>
|
|
68
|
+
<LoadingAnimationDot />
|
|
69
|
+
<LoadingAnimationDot />
|
|
70
|
+
<LoadingAnimationDot />
|
|
71
|
+
</Element>
|
|
72
|
+
);
|
|
73
|
+
},
|
|
74
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.667-next.0",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@emotion/styled": "^11.6.0",
|
|
51
51
|
"@popperjs/core": "^2.5.4",
|
|
52
52
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
53
|
-
"@workday/canvas-kit-popup-stack": "^11.0.0-alpha.
|
|
54
|
-
"@workday/canvas-kit-styling": "^10.3.
|
|
53
|
+
"@workday/canvas-kit-popup-stack": "^11.0.0-alpha.667-next.0",
|
|
54
|
+
"@workday/canvas-kit-styling": "^10.3.1",
|
|
55
55
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
56
56
|
"@workday/canvas-tokens-web": "^1.0.2",
|
|
57
57
|
"@workday/design-assets-types": "^0.2.8",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
70
70
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "345331557dba888d9b12c56470a5e015162a6a0e"
|
|
73
73
|
}
|
|
@@ -27,6 +27,8 @@ export const useCloseOnOutsideClick = createElemPropsHook(usePopupModel)(model =
|
|
|
27
27
|
if (
|
|
28
28
|
elements.length &&
|
|
29
29
|
elements[elements.length - 1] === model.state.stackRef.current &&
|
|
30
|
+
// Only consider event targets that are currently in the DOM as valid
|
|
31
|
+
document.contains(event.target as HTMLElement) &&
|
|
30
32
|
// Use `PopupStack.contains` instead of `ref.current.contains` so that the application can
|
|
31
33
|
// decide if clicking the target should toggle the popup rather than it toggling implicitly
|
|
32
34
|
// because the target is outside `ref.current`
|