@workday/canvas-kit-docs 11.1.3 → 11.1.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.
@@ -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
- After installing Canvas Kit, you need to set up the CanvasProvider at the root of your application.
20
- This can be either in your `index.jsx`,`index.tsx` or `App.jsx` depending on the framework you use.
21
- This ensures proper styling, theming, and focus behavior on our components.
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
- // 1. import `CanvasProvider` component
26
- import {CanvasProvider} from '@workday/canvas-kit-react';
27
- function App() {
28
- // 2. Wrap CanvasProvider at the root of your app
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
- <YourApp />
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",
3
+ "version": "11.1.5",
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.3",
48
- "@workday/canvas-kit-preview-react": "^11.1.3",
49
- "@workday/canvas-kit-react": "^11.1.3",
50
- "@workday/canvas-kit-styling": "^11.1.3",
47
+ "@workday/canvas-kit-labs-react": "^11.1.5",
48
+ "@workday/canvas-kit-preview-react": "^11.1.5",
49
+ "@workday/canvas-kit-react": "^11.1.5",
50
+ "@workday/canvas-kit-styling": "^11.1.5",
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": "0ad69fbb1b6f416855fa2815f7c13ffee5deb53a"
62
+ "gitHead": "deb1fdc2d7f4d17c80dcc0013804c14a21133b3d"
63
63
  }