@workday/canvas-kit-react 10.0.0-alpha.548-next.0 → 10.0.0-alpha.549-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/common/lib/CanvasProvider.tsx +4 -4
- package/dist/commonjs/common/lib/CanvasProvider.d.ts +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.d.ts.map +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.js +3 -2
- package/dist/es6/common/lib/CanvasProvider.d.ts +1 -1
- package/dist/es6/common/lib/CanvasProvider.d.ts.map +1 -1
- package/dist/es6/common/lib/CanvasProvider.js +3 -2
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ import {defaultCanvasTheme, PartialEmotionCanvasTheme, useTheme} from './theming
|
|
|
5
5
|
import {brand} from '@workday/canvas-tokens-web';
|
|
6
6
|
|
|
7
7
|
export interface CanvasProviderProps {
|
|
8
|
-
theme
|
|
8
|
+
theme?: PartialEmotionCanvasTheme;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const mappedKeys = {
|
|
@@ -18,7 +18,7 @@ const mappedKeys = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const useCanvasThemeToCssVars = (
|
|
21
|
-
theme: PartialEmotionCanvasTheme,
|
|
21
|
+
theme: PartialEmotionCanvasTheme | undefined,
|
|
22
22
|
elemProps: React.HTMLAttributes<HTMLElement>
|
|
23
23
|
) => {
|
|
24
24
|
const filledTheme = useTheme(theme);
|
|
@@ -42,7 +42,7 @@ const useCanvasThemeToCssVars = (
|
|
|
42
42
|
|
|
43
43
|
export const CanvasProvider = ({
|
|
44
44
|
children,
|
|
45
|
-
theme,
|
|
45
|
+
theme = {canvas: defaultCanvasTheme},
|
|
46
46
|
...props
|
|
47
47
|
}: CanvasProviderProps & React.HTMLAttributes<HTMLElement>) => {
|
|
48
48
|
const elemProps = useCanvasThemeToCssVars(theme, props);
|
|
@@ -50,7 +50,7 @@ export const CanvasProvider = ({
|
|
|
50
50
|
<ThemeProvider theme={theme as Theme}>
|
|
51
51
|
<InputProvider />
|
|
52
52
|
<div
|
|
53
|
-
dir={
|
|
53
|
+
dir={theme?.canvas?.direction || defaultCanvasTheme.direction}
|
|
54
54
|
{...(elemProps as React.HTMLAttributes<HTMLDivElement>)}
|
|
55
55
|
>
|
|
56
56
|
{children}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PartialEmotionCanvasTheme } from './theming';
|
|
3
3
|
export interface CanvasProviderProps {
|
|
4
|
-
theme
|
|
4
|
+
theme?: PartialEmotionCanvasTheme;
|
|
5
5
|
}
|
|
6
6
|
export declare const CanvasProvider: ({ children, theme, ...props }: CanvasProviderProps & React.HTMLAttributes<HTMLElement>) => JSX.Element;
|
|
7
7
|
//# sourceMappingURL=CanvasProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasProvider.d.ts","sourceRoot":"","sources":["../../../../common/lib/CanvasProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAqB,yBAAyB,EAAW,MAAM,WAAW,CAAC;AAGlF,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasProvider.d.ts","sourceRoot":"","sources":["../../../../common/lib/CanvasProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAqB,yBAAyB,EAAW,MAAM,WAAW,CAAC;AAGlF,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,yBAAyB,CAAC;CACnC;AAkCD,eAAO,MAAM,cAAc,kCAIxB,mBAAmB,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,gBAazD,CAAC"}
|
|
@@ -49,10 +49,11 @@ const useCanvasThemeToCssVars = (theme, elemProps) => {
|
|
|
49
49
|
}, elemProps.style || {});
|
|
50
50
|
return { ...elemProps, style };
|
|
51
51
|
};
|
|
52
|
-
const CanvasProvider = ({ children, theme, ...props }) => {
|
|
52
|
+
const CanvasProvider = ({ children, theme = { canvas: theming_1.defaultCanvasTheme }, ...props }) => {
|
|
53
|
+
var _a;
|
|
53
54
|
const elemProps = useCanvasThemeToCssVars(theme, props);
|
|
54
55
|
return (React.createElement(react_1.ThemeProvider, { theme: theme },
|
|
55
56
|
React.createElement(InputProvider_1.InputProvider, null),
|
|
56
|
-
React.createElement("div", Object.assign({ dir: (theme
|
|
57
|
+
React.createElement("div", Object.assign({ dir: ((_a = theme === null || theme === void 0 ? void 0 : theme.canvas) === null || _a === void 0 ? void 0 : _a.direction) || theming_1.defaultCanvasTheme.direction }, elemProps), children)));
|
|
57
58
|
};
|
|
58
59
|
exports.CanvasProvider = CanvasProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PartialEmotionCanvasTheme } from './theming';
|
|
3
3
|
export interface CanvasProviderProps {
|
|
4
|
-
theme
|
|
4
|
+
theme?: PartialEmotionCanvasTheme;
|
|
5
5
|
}
|
|
6
6
|
export declare const CanvasProvider: ({ children, theme, ...props }: CanvasProviderProps & React.HTMLAttributes<HTMLElement>) => JSX.Element;
|
|
7
7
|
//# sourceMappingURL=CanvasProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasProvider.d.ts","sourceRoot":"","sources":["../../../../common/lib/CanvasProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAqB,yBAAyB,EAAW,MAAM,WAAW,CAAC;AAGlF,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasProvider.d.ts","sourceRoot":"","sources":["../../../../common/lib/CanvasProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAqB,yBAAyB,EAAW,MAAM,WAAW,CAAC;AAGlF,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,yBAAyB,CAAC;CACnC;AAkCD,eAAO,MAAM,cAAc,kCAIxB,mBAAmB,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,gBAazD,CAAC"}
|
|
@@ -27,9 +27,10 @@ const useCanvasThemeToCssVars = (theme, elemProps) => {
|
|
|
27
27
|
}, elemProps.style || {});
|
|
28
28
|
return { ...elemProps, style };
|
|
29
29
|
};
|
|
30
|
-
export const CanvasProvider = ({ children, theme, ...props }) => {
|
|
30
|
+
export const CanvasProvider = ({ children, theme = { canvas: defaultCanvasTheme }, ...props }) => {
|
|
31
|
+
var _a;
|
|
31
32
|
const elemProps = useCanvasThemeToCssVars(theme, props);
|
|
32
33
|
return (React.createElement(ThemeProvider, { theme: theme },
|
|
33
34
|
React.createElement(InputProvider, null),
|
|
34
|
-
React.createElement("div", Object.assign({ dir: (theme
|
|
35
|
+
React.createElement("div", Object.assign({ dir: ((_a = theme === null || theme === void 0 ? void 0 : theme.canvas) === null || _a === void 0 ? void 0 : _a.direction) || defaultCanvasTheme.direction }, elemProps), children)));
|
|
35
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.549-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",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@emotion/styled": "^11.6.0",
|
|
50
50
|
"@popperjs/core": "^2.5.4",
|
|
51
51
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
52
|
-
"@workday/canvas-kit-popup-stack": "^10.0.0-alpha.
|
|
53
|
-
"@workday/canvas-kit-styling": "^10.0.0-alpha.
|
|
52
|
+
"@workday/canvas-kit-popup-stack": "^10.0.0-alpha.549-next.0",
|
|
53
|
+
"@workday/canvas-kit-styling": "^10.0.0-alpha.549-next.0",
|
|
54
54
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
55
55
|
"@workday/canvas-tokens-web": "0.1.6",
|
|
56
56
|
"@workday/design-assets-types": "^0.2.8",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
69
69
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "a3b27a08ffa91e394c4e5f2940f1d6cb370bc5d5"
|
|
72
72
|
}
|