@workday/canvas-kit-docs 13.0.0-alpha.1051-next.0 → 13.0.0-alpha.1061-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.
Files changed (27) hide show
  1. package/dist/es6/lib/ExampleCodeBlock.d.ts.map +1 -1
  2. package/dist/es6/lib/ExampleCodeBlock.js +3 -1
  3. package/dist/es6/lib/docs.js +20393 -11950
  4. package/dist/es6/lib/stackblitzFiles/.eslintrc.cjs.txt +15 -0
  5. package/dist/es6/lib/stackblitzFiles/App.tsx +34 -0
  6. package/dist/es6/lib/stackblitzFiles/Demo.tsx +3 -0
  7. package/dist/es6/lib/stackblitzFiles/index.html +13 -0
  8. package/dist/es6/lib/stackblitzFiles/main.tsx +28 -0
  9. package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +6 -6
  10. package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +42 -0
  11. package/dist/es6/lib/stackblitzFiles/tsconfig.json +26 -0
  12. package/dist/es6/lib/stackblitzFiles/tsconfig.node.json +12 -0
  13. package/dist/es6/lib/stackblitzFiles/vite-env.d.ts +1 -0
  14. package/dist/es6/lib/stackblitzFiles/vite.config.ts +10 -0
  15. package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +1 -1
  16. package/dist/mdx/13.0-UPGRADE-GUIDE.mdx +21 -2
  17. package/dist/mdx/TESTING.mdx +34 -0
  18. package/dist/mdx/preview-react/pill/Pill.mdx +18 -9
  19. package/dist/mdx/preview-react/pill/examples/Basic.tsx +14 -8
  20. package/dist/mdx/preview-react/pill/examples/CustomStyles.tsx +47 -0
  21. package/dist/mdx/preview-react/pill/examples/WithAvatar.tsx +15 -9
  22. package/dist/mdx/preview-react/pill/examples/WithCount.tsx +12 -6
  23. package/dist/mdx/preview-react/pill/examples/WithList.tsx +15 -5
  24. package/dist/mdx/preview-react/pill/examples/WithReadOnly.tsx +8 -3
  25. package/dist/mdx/preview-react/pill/examples/WithRemovable.tsx +22 -10
  26. package/lib/ExampleCodeBlock.tsx +3 -1
  27. package/package.json +7 -6
@@ -3,29 +3,41 @@ import React from 'react';
3
3
  import {Pill} from '@workday/canvas-kit-preview-react/pill';
4
4
  // @ts-ignore: Cannot find module error
5
5
  import testAvatar from './test-avatar.png';
6
- import {Box, Flex} from '@workday/canvas-kit-react/layout';
7
6
  import {BodyText} from '@workday/canvas-kit-react/text';
7
+ import {system} from '@workday/canvas-tokens-web';
8
+ import {createStyles} from '@workday/canvas-kit-styling';
9
+
10
+ const flexStyles = createStyles({
11
+ display: 'flex',
12
+ gap: system.space.x2,
13
+ });
8
14
 
9
15
  export default () => {
10
16
  const [text, setText] = React.useState('');
11
17
  return (
12
- <Box>
13
- <Flex gap="xxs">
18
+ <div>
19
+ <div className={flexStyles}>
14
20
  <Pill variant="removable">
15
- Pink Shirts
16
- <Pill.IconButton onClick={() => setText('The first pill is clicked!')} />
21
+ <Pill.Label>Pink Shirts</Pill.Label>
22
+ <Pill.IconButton
23
+ aria-label="Remove"
24
+ onClick={() => setText('The first pill is clicked!')}
25
+ />
17
26
  </Pill>
18
27
  <Pill variant="removable">
19
28
  <Pill.Avatar url={testAvatar} />
20
- Carolyn Grimaldi
21
- <Pill.IconButton onClick={() => setText('The second pill is clicked!')} />
29
+ <Pill.Label>Carolyn Grimaldi</Pill.Label>
30
+ <Pill.IconButton
31
+ aria-label="Remove"
32
+ onClick={() => setText('The second pill is clicked!')}
33
+ />
22
34
  </Pill>
23
35
  <Pill variant="removable" disabled>
24
36
  <Pill.Label>This is a category that should not exist because it is too long</Pill.Label>
25
- <Pill.IconButton />
37
+ <Pill.IconButton aria-label="Remove" />
26
38
  </Pill>
27
- </Flex>
39
+ </div>
28
40
  <BodyText size="medium">{text}</BodyText>
29
- </Box>
41
+ </div>
30
42
  );
31
43
  };
@@ -86,7 +86,9 @@ export const ExampleCodeBlock = ({code}: any) => {
86
86
  * `code` returns our examples. We need to rewrite them so that they export `Demo`.
87
87
  */
88
88
  const handleExampleRewrite = (code: any) => {
89
- return code.replace(/\bexport\s+const\s+(\w+)\s*=/, `export const Demo =`);
89
+ return code
90
+ .replace(/\bexport\s+const\s+(\w+)\s*=/, `export const Demo =`)
91
+ .replace(/export default/, 'export const Demo =');
90
92
  };
91
93
 
92
94
  const openProjectInStackblitz = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "13.0.0-alpha.1051-next.0",
3
+ "version": "13.0.0-alpha.1061-next.0",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -43,11 +43,12 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@emotion/styled": "^11.6.0",
46
+ "@stackblitz/sdk": "^1.11.0",
46
47
  "@storybook/csf": "0.0.1",
47
- "@workday/canvas-kit-labs-react": "^13.0.0-alpha.1051-next.0",
48
- "@workday/canvas-kit-preview-react": "^13.0.0-alpha.1051-next.0",
49
- "@workday/canvas-kit-react": "^13.0.0-alpha.1051-next.0",
50
- "@workday/canvas-kit-styling": "^13.0.0-alpha.1051-next.0",
48
+ "@workday/canvas-kit-labs-react": "^13.0.0-alpha.1061-next.0",
49
+ "@workday/canvas-kit-preview-react": "^13.0.0-alpha.1061-next.0",
50
+ "@workday/canvas-kit-react": "^13.0.0-alpha.1061-next.0",
51
+ "@workday/canvas-kit-styling": "^13.0.0-alpha.1061-next.0",
51
52
  "@workday/canvas-system-icons-web": "^3.0.0",
52
53
  "@workday/canvas-tokens-web": "^2.1.1",
53
54
  "markdown-to-jsx": "^7.2.0",
@@ -60,5 +61,5 @@
60
61
  "mkdirp": "^1.0.3",
61
62
  "typescript": "5.0"
62
63
  },
63
- "gitHead": "1d31c5bee6dbae914e2af4f9f73da5493a0c5b44"
64
+ "gitHead": "dcac6a3ea9994aac312ac7e7b6a616899f250d36"
64
65
  }