@workday/canvas-kit-docs 11.1.2 → 11.1.4
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/es6/lib/specs.js +26 -0
- package/dist/es6/mdx/welcomePage.js +1 -1
- package/dist/mdx/welcome.stories.mdx +32 -10
- package/package.json +6 -6
package/dist/es6/lib/specs.js
CHANGED
|
@@ -4798,6 +4798,16 @@ module.exports = {specifications: [
|
|
|
4798
4798
|
]
|
|
4799
4799
|
}
|
|
4800
4800
|
]
|
|
4801
|
+
},
|
|
4802
|
+
{
|
|
4803
|
+
"type": "describe",
|
|
4804
|
+
"name": "when a value is selected",
|
|
4805
|
+
"children": [
|
|
4806
|
+
{
|
|
4807
|
+
"type": "it",
|
|
4808
|
+
"name": "should select phone and the selected value should be visible"
|
|
4809
|
+
}
|
|
4810
|
+
]
|
|
4801
4811
|
}
|
|
4802
4812
|
]
|
|
4803
4813
|
},
|
|
@@ -4883,6 +4893,22 @@ module.exports = {specifications: [
|
|
|
4883
4893
|
}
|
|
4884
4894
|
]
|
|
4885
4895
|
},
|
|
4896
|
+
{
|
|
4897
|
+
"type": "describe",
|
|
4898
|
+
"name": "given the \"Complex\" story is rendered",
|
|
4899
|
+
"children": [
|
|
4900
|
+
{
|
|
4901
|
+
"type": "describe",
|
|
4902
|
+
"name": "when a value is selected with an id and text",
|
|
4903
|
+
"children": [
|
|
4904
|
+
{
|
|
4905
|
+
"type": "it",
|
|
4906
|
+
"name": "should display the correct id and value of the selected Phone"
|
|
4907
|
+
}
|
|
4908
|
+
]
|
|
4909
|
+
}
|
|
4910
|
+
]
|
|
4911
|
+
},
|
|
4886
4912
|
{
|
|
4887
4913
|
"type": "describe",
|
|
4888
4914
|
"name": "given the \"FetchingDynamicItems\" story is rendered",
|
|
@@ -12,7 +12,7 @@ import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
|
12
12
|
// @ts-ignore: Cannot find module error
|
|
13
13
|
import { version } from '../../../lerna.json';
|
|
14
14
|
export const WelcomePage = () => {
|
|
15
|
-
return (React.createElement(Flex, { flexDirection: "column", gap: "s" },
|
|
15
|
+
return (React.createElement(Flex, { flexDirection: "column", gap: "s", marginBottom: "m" },
|
|
16
16
|
React.createElement(Box, { borderRadius: "m", overflow: "hidden", position: "relative" },
|
|
17
17
|
React.createElement(Flex, { position: "absolute", flexDirection: "column", top: "30%", left: "10%" },
|
|
18
18
|
React.createElement(Text, { typeLevel: "title.medium", color: colors.frenchVanilla100, fontSize: "6vmin", marginBottom: "s", style: { lineHeight: '3vmin' } }, "Canvas Kit"),
|
|
@@ -16,20 +16,42 @@ import {version} from '../../../lerna.json';
|
|
|
16
16
|
|
|
17
17
|
<WelcomePage />
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
### Canvas Provider
|
|
20
|
+
|
|
21
|
+
The `<CanvasProvider>` is required for proper branding support. Furthermore, if you use Emotion for
|
|
22
|
+
styling your components, the `<CanvasProvider>` ensures your styles will merge as expected. Note:
|
|
23
|
+
Custom use of `<CacheProvider>` provided by Emotion is not supported. `@workday/canvas-kit-styling`
|
|
24
|
+
owns the creating of the cache reference. This ensures both static styling and Emotion’s dynamic
|
|
25
|
+
styling solutions work together. In most cases you'll want to wrap your application at the root
|
|
26
|
+
level in `<CanvasProvider>`.
|
|
22
27
|
|
|
23
28
|
```tsx
|
|
24
29
|
import * as React from 'react';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
import {
|
|
31
|
+
CanvasProvider,
|
|
32
|
+
ContentDirection,
|
|
33
|
+
PartialEmotionCanvasTheme,
|
|
34
|
+
useTheme,
|
|
35
|
+
} from '@workday/canvas-kit-react/common';
|
|
36
|
+
// Ensure CSS variables are defined. You Can also do this at the root index.css
|
|
37
|
+
import '@workday/canvas-tokens-web/css/base/_variables.css';
|
|
38
|
+
import '@workday/canvas-tokens-web/css/brand/_variables.css';
|
|
39
|
+
import '@workday/canvas-tokens-web/css/system/_variables.css';
|
|
40
|
+
|
|
41
|
+
export const App = () => {
|
|
42
|
+
// useTheme is filling in the Canvas theme object if any keys are missing
|
|
43
|
+
const canvasTheme: PartialEmotionCanvasTheme = useTheme({
|
|
44
|
+
canvas: {
|
|
45
|
+
// Switch to `ContentDirection.RTL` to change direction
|
|
46
|
+
direction: ContentDirection.LTR,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
29
49
|
return (
|
|
30
|
-
<CanvasProvider>
|
|
31
|
-
|
|
50
|
+
<CanvasProvider theme={canvasTheme}>
|
|
51
|
+
<main>
|
|
52
|
+
<p>Get Started With Canvas Kit</p>
|
|
53
|
+
</main>
|
|
32
54
|
</CanvasProvider>
|
|
33
55
|
);
|
|
34
|
-
}
|
|
56
|
+
};
|
|
35
57
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.4",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^11.1.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^11.1.
|
|
49
|
-
"@workday/canvas-kit-react": "^11.1.
|
|
50
|
-
"@workday/canvas-kit-styling": "^11.1.
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^11.1.4",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^11.1.4",
|
|
49
|
+
"@workday/canvas-kit-react": "^11.1.4",
|
|
50
|
+
"@workday/canvas-kit-styling": "^11.1.4",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
52
|
"@workday/canvas-tokens-web": "^2.0.0",
|
|
53
53
|
"markdown-to-jsx": "^7.2.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"mkdirp": "^1.0.3",
|
|
60
60
|
"typescript": "4.2"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "8415b4a94a0330e8eaf704a99ec3cce41b21eaf1"
|
|
63
63
|
}
|