@workday/canvas-kit-docs 15.0.0-alpha.0076-next.0 → 15.0.0-alpha.0090-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 (61) hide show
  1. package/dist/es6/lib/StorybookStatusIndicator.d.ts +2 -2
  2. package/dist/es6/lib/StorybookStatusIndicator.d.ts.map +1 -1
  3. package/dist/es6/lib/StorybookStatusIndicator.js +6 -1
  4. package/dist/es6/lib/docs.js +8766 -8796
  5. package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
  6. package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
  7. package/dist/es6/mdx/accessibility/examples/GlobalHeader.js +1 -1
  8. package/dist/mdx/10.0-UPGRADE-GUIDE.mdx +1 -1
  9. package/dist/mdx/15.0-UPGRADE-GUIDE.mdx +127 -0
  10. package/dist/mdx/5.0-UPGRADE-GUIDE.mdx +3 -3
  11. package/dist/mdx/7.0-UPGRADE-GUIDE.mdx +4 -4
  12. package/dist/mdx/8.0-UPGRADE-GUIDE.mdx +5 -5
  13. package/dist/mdx/9.0-UPGRADE-GUIDE.mdx +2 -2
  14. package/dist/mdx/CONTRIBUTING.mdx +4 -4
  15. package/dist/mdx/CREATING_COMPOUND_COMPONENTS.mdx +1 -1
  16. package/dist/mdx/labs-react/side-panel/SidePanel.mdx +85 -54
  17. package/dist/mdx/labs-react/side-panel/examples/AlwaysOpen.tsx +3 -3
  18. package/dist/mdx/labs-react/side-panel/examples/Basic.tsx +17 -37
  19. package/dist/mdx/labs-react/side-panel/examples/ExternalControl.tsx +6 -20
  20. package/dist/mdx/labs-react/side-panel/examples/{HiddenName.tsx → Heading.tsx} +4 -3
  21. package/dist/mdx/labs-react/side-panel/examples/OnStateTransition.tsx +3 -1
  22. package/dist/mdx/labs-react/side-panel/examples/RightOrigin.tsx +3 -9
  23. package/dist/mdx/labs-react/side-panel/examples/Variant.tsx +2 -8
  24. package/dist/mdx/preview-react/divider/examples/Basic.tsx +1 -1
  25. package/dist/mdx/preview-react/multi-select/MultiSelect.mdx +3 -3
  26. package/dist/mdx/preview-react/status-indicator/StatusIndicator.mdx +1 -1
  27. package/dist/mdx/react/action-bar/ActionBar.mdx +1 -1
  28. package/dist/mdx/{preview-react → react}/avatar/Avatar.mdx +5 -7
  29. package/dist/mdx/react/avatar/examples/Basic.tsx +5 -0
  30. package/dist/mdx/{preview-react → react}/avatar/examples/Custom.tsx +1 -1
  31. package/dist/mdx/{preview-react → react}/avatar/examples/Decorative.tsx +1 -1
  32. package/dist/mdx/{preview-react → react}/avatar/examples/Image.tsx +1 -1
  33. package/dist/mdx/{preview-react → react}/avatar/examples/Size.tsx +1 -1
  34. package/dist/mdx/{preview-react → react}/avatar/examples/Variant.tsx +1 -1
  35. package/dist/mdx/react/banner/Banner.mdx +1 -1
  36. package/dist/mdx/react/breadcrumbs/Breadcrumbs.mdx +1 -1
  37. package/dist/mdx/react/card/card.mdx +1 -1
  38. package/dist/mdx/react/common/mdx/CompoundComponentUtilities.mdx +1 -1
  39. package/dist/mdx/react/layout/Box.mdx +13 -13
  40. package/dist/mdx/react/layout/Flex.mdx +3 -3
  41. package/dist/mdx/react/layout/Grid.mdx +3 -3
  42. package/dist/mdx/react/pagination/pagination.mdx +4 -4
  43. package/dist/mdx/react/popup/Popup.mdx +1 -1
  44. package/dist/mdx/react/select/Select.mdx +4 -4
  45. package/dist/mdx/react/tabs/Tabs.mdx +2 -2
  46. package/dist/mdx/react/text/Text.mdx +1 -1
  47. package/dist/mdx/react/toast/toast.mdx +1 -1
  48. package/lib/StorybookStatusIndicator.tsx +10 -1
  49. package/package.json +6 -6
  50. package/dist/mdx/preview-react/avatar/examples/Basic.tsx +0 -5
  51. package/dist/mdx/react/avatar/avatar/Avatar.mdx +0 -109
  52. package/dist/mdx/react/avatar/avatar/examples/Basic.tsx +0 -17
  53. package/dist/mdx/react/avatar/avatar/examples/Button.tsx +0 -20
  54. package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +0 -34
  55. package/dist/mdx/react/avatar/avatar/examples/Image.tsx +0 -25
  56. package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +0 -20
  57. package/dist/mdx/react/avatar/avatar/examples/ObjectFit.tsx +0 -30
  58. package/dist/mdx/react/avatar/avatar/examples/Size.tsx +0 -27
  59. package/dist/mdx/react/avatar/avatar/examples/Variant.tsx +0 -10
  60. package/dist/mdx/react/avatar/avatar/examples/test-avatar.png +0 -0
  61. /package/dist/mdx/{preview-react → react}/avatar/examples/nicholas-avatar.jpg +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "15.0.0-alpha.0076-next.0",
3
+ "version": "15.0.0-alpha.0090-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",
@@ -45,10 +45,10 @@
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@stackblitz/sdk": "^1.11.0",
47
47
  "@storybook/csf": "0.0.1",
48
- "@workday/canvas-kit-labs-react": "^15.0.0-alpha.0076-next.0",
49
- "@workday/canvas-kit-preview-react": "^15.0.0-alpha.0076-next.0",
50
- "@workday/canvas-kit-react": "^15.0.0-alpha.0076-next.0",
51
- "@workday/canvas-kit-styling": "^15.0.0-alpha.0076-next.0",
48
+ "@workday/canvas-kit-labs-react": "^15.0.0-alpha.0090-next.0",
49
+ "@workday/canvas-kit-preview-react": "^15.0.0-alpha.0090-next.0",
50
+ "@workday/canvas-kit-react": "^15.0.0-alpha.0090-next.0",
51
+ "@workday/canvas-kit-styling": "^15.0.0-alpha.0090-next.0",
52
52
  "@workday/canvas-system-icons-web": "^3.0.36",
53
53
  "@workday/canvas-tokens-web": "4.0.0-alpha.3",
54
54
  "markdown-to-jsx": "^7.2.0",
@@ -61,5 +61,5 @@
61
61
  "mkdirp": "^1.0.3",
62
62
  "typescript": "5.0"
63
63
  },
64
- "gitHead": "5d389f1b5a66cf5bde37eb570ff634a7b143ee98"
64
+ "gitHead": "54d08f77d0527af840c9f102ce9a8f44942a5e9d"
65
65
  }
@@ -1,5 +0,0 @@
1
- import {Avatar} from '@workday/canvas-kit-preview-react/avatar';
2
-
3
- export default () => {
4
- return <Avatar name="John Doe" />;
5
- };
@@ -1,109 +0,0 @@
1
- import {
2
- Specifications,
3
- SymbolDoc,
4
- SymbolDescription,
5
- ExampleCodeBlock,
6
- StorybookStatusIndicator,
7
- } from '@workday/canvas-kit-docs';
8
- import {InformationHighlight} from '@workday/canvas-kit-react/information-highlight';
9
-
10
- import Basic from './examples/Basic';
11
- import Button from './examples/Button';
12
- import Image from './examples/Image';
13
- import LazyLoad from './examples/LazyLoad';
14
- import ObjectFit from './examples/ObjectFit';
15
- import Size from './examples/Size';
16
- import Variant from './examples/Variant';
17
- import CustomStyles from './examples/CustomStyles';
18
-
19
-
20
- # Canvas Kit Avatar <StorybookStatusIndicator type="deprecated" />
21
-
22
- <InformationHighlight className="sb-unstyled" variant="caution" cs={{p: {marginBlock: 0}}}>
23
- <InformationHighlight.Icon />
24
- <InformationHighlight.Body>
25
- `Avatar` in Main has been deprecated and will be removed in a future major version. Please use
26
- [Avatar](https://workday.github.io/canvas-kit/?path=/docs/preview-avatar--docs) in Preview
27
- instead.
28
- </InformationHighlight.Body>
29
- </InformationHighlight>
30
-
31
- Represents a person's profile.
32
-
33
- [> Workday Design Reference](https://canvas.workdaydesign.com/components/indicators/avatar)
34
-
35
- ## Installation
36
-
37
- ```sh
38
- yarn add @workday/canvas-kit-react
39
- ```
40
-
41
- ## Usage
42
-
43
- <SymbolDescription name="Avatar" fileName="/react/" />
44
-
45
- The example below shows multiple instances of a `Avatar` with various configurations.
46
-
47
- ### Basic
48
-
49
- By default, the Avatar renders a `button` element. If yo'd like to change the default element, use
50
- the `as` prop.
51
-
52
- <ExampleCodeBlock code={Basic} />
53
-
54
- ### Button
55
-
56
- Like many of our components, Avatar accepts an `as` prop, which lets you change the underlying
57
- semantic element to a `div`. This should be done with caution to ensure the best accessibility.
58
- Generally, `<button>` elements should be used for actions.
59
-
60
- <ExampleCodeBlock code={Button} />
61
-
62
- ### Variant
63
-
64
- Avatar defaults to using a `"light"` `variant` property. You can change the `variant` prop to "dark"
65
- by including `variant="dark"`.
66
-
67
- <ExampleCodeBlock code={Variant} />
68
-
69
- ### Size
70
-
71
- Avatar defaults to using a `"medium"` `size` property. You can change the `size` prop to various
72
- sizing options. See Component API for more details.
73
-
74
- Additionally, you can explicitly specify the size you want for the Avatar in pixels or rems.
75
-
76
- <ExampleCodeBlock code={Size} />
77
-
78
- ### Image
79
-
80
- Avatar renders an image when the `url` prop is defined.
81
-
82
- <ExampleCodeBlock code={Image} />
83
-
84
- ### Object Fit
85
-
86
- Avatar defaults to using `contain` for object-fit. You can change this property to any other
87
- acceptable `object-fit` properties. For best fit, try to use square images.
88
-
89
- <ExampleCodeBlock code={ObjectFit} />
90
-
91
- ### Lazy Load
92
-
93
- Example of implementing lazy load behavior with Avatar.
94
-
95
- <ExampleCodeBlock code={LazyLoad} />
96
-
97
- ### Custom Styling
98
-
99
- To change the background color of the Avatar, you can use our `createStencil` functionality.
100
-
101
- <ExampleCodeBlock code={CustomStyles} />
102
-
103
- ## Component API
104
-
105
- <SymbolDoc name="Avatar" fileName="/react/" />
106
-
107
- ## Specifications
108
-
109
- <Specifications file="Avatar.spec.ts" name="Avatar" />
@@ -1,17 +0,0 @@
1
- import {Avatar} from '@workday/canvas-kit-react/avatar';
2
- import {createStyles} from '@workday/canvas-kit-styling';
3
- import {system} from '@workday/canvas-tokens-web';
4
-
5
- const handleAvatarButtonClick = () => console.log('AvatarButton clicked');
6
-
7
- const containerStyles = createStyles({
8
- display: 'inline-flex',
9
- gap: system.space.x2,
10
- });
11
-
12
- export default () => (
13
- <div className={containerStyles}>
14
- <Avatar altText="Avatar" onClick={handleAvatarButtonClick} />
15
- <Avatar altText="Avatar" as="div" />
16
- </div>
17
- );
@@ -1,20 +0,0 @@
1
- import {Avatar} from '@workday/canvas-kit-react/avatar';
2
- import {createStyles} from '@workday/canvas-kit-styling';
3
- import {system} from '@workday/canvas-tokens-web';
4
- // @ts-ignore: Cannot find module error
5
- import testAvatar from './test-avatar.png';
6
-
7
- const handleAvatarButtonClick = () => console.log('AvatarButton clicked');
8
-
9
- const containerStyles = createStyles({
10
- display: 'inline-flex',
11
- gap: system.space.x2,
12
- });
13
-
14
- export default () => (
15
- <div className={containerStyles}>
16
- <Avatar altText="Avatar" variant="dark" onClick={handleAvatarButtonClick} />
17
- <Avatar altText="Avatar" onClick={handleAvatarButtonClick} />
18
- <Avatar altText="Avatar" url={testAvatar} onClick={handleAvatarButtonClick} />
19
- </div>
20
- );
@@ -1,34 +0,0 @@
1
- import {Avatar} from '@workday/canvas-kit-react/avatar';
2
- import {createStencil, createStyles} from '@workday/canvas-kit-styling';
3
- import {system} from '@workday/canvas-tokens-web';
4
- import {systemIconStencil} from '@workday/canvas-kit-react/icon';
5
-
6
- const customOrangeAvatar = createStencil({
7
- base: {
8
- backgroundColor: system.color.static.amber.default,
9
- ['[data-part="avatar-icon"]']: {
10
- [systemIconStencil.vars.color]: system.color.static.white,
11
- },
12
- },
13
- });
14
-
15
- const customGreenAvatarStencil = createStencil({
16
- base: {
17
- backgroundColor: system.color.static.green.default,
18
- ['[data-part="avatar-icon"]']: {
19
- [systemIconStencil.vars.color]: system.color.static.white,
20
- },
21
- },
22
- });
23
-
24
- const containerStyles = createStyles({
25
- display: 'inline-flex',
26
- gap: system.space.x2,
27
- });
28
-
29
- export default () => (
30
- <div className={containerStyles}>
31
- <Avatar altText="Avatar" as="div" {...customOrangeAvatar()} />
32
- <Avatar altText="Avatar" as="div" {...customGreenAvatarStencil()} />
33
- </div>
34
- );
@@ -1,25 +0,0 @@
1
- import {Avatar} from '@workday/canvas-kit-react/avatar';
2
- // @ts-ignore: Cannot find module error
3
- import testAvatar from './test-avatar.png';
4
- import {createStyles} from '@workday/canvas-kit-styling';
5
- import {system} from '@workday/canvas-tokens-web';
6
-
7
- const containerStyles = createStyles({
8
- display: 'flex',
9
- flexDirection: 'column',
10
- gap: system.space.x2,
11
- });
12
-
13
- export default () => (
14
- <div className={containerStyles}>
15
- <h3>Working Images</h3>
16
- <Avatar altText="Avatar" size="extraExtraLarge" as="div" url={testAvatar} />
17
- <Avatar altText="Avatar" size="extraLarge" as="div" url={testAvatar} />
18
- <Avatar altText="Avatar" size="large" as="div" url={testAvatar} />
19
- <Avatar altText="Avatar" size="medium" as="div" url={testAvatar} />
20
- <Avatar altText="Avatar" size="small" as="div" url={testAvatar} />
21
- <Avatar altText="Avatar" size="extraSmall" as="div" url={testAvatar} />
22
- <h3>Broken Image</h3>
23
- <Avatar altText="Avatar" url="/fake/path/to/image.png" as="div" />
24
- </div>
25
- );
@@ -1,20 +0,0 @@
1
- import {Avatar} from '@workday/canvas-kit-react/avatar';
2
- // @ts-ignore: Cannot find module error
3
- import testAvatar from './test-avatar.png';
4
-
5
- export default () => (
6
- <div className="story">
7
- {Array.from({length: 5}, (v, index) => (
8
- <div>
9
- <Avatar
10
- altText="Avatar"
11
- key={index}
12
- as="div"
13
- size="medium"
14
- url={testAvatar + '?v=' + index}
15
- />
16
- <br />
17
- </div>
18
- ))}
19
- </div>
20
- );
@@ -1,30 +0,0 @@
1
- import {Avatar} from '@workday/canvas-kit-react/avatar';
2
- import {px2rem} from '@workday/canvas-kit-styling';
3
-
4
- export default () => (
5
- <div className="story">
6
- <h3>Original Rectangle Image</h3>
7
- <img alt="" src="https://picsum.photos/id/237/300/200" />
8
- <h3>Object fit on a Rectangle Image</h3>
9
- <Avatar altText="Avatar" as="div" url="https://picsum.photos/id/237/300/200" />
10
- <h3>Object fit on a Rectangle Image using Dynamic Size</h3>
11
- <Avatar
12
- altText="Avatar"
13
- as="div"
14
- size={px2rem(200)}
15
- url="https://picsum.photos/id/237/300/200"
16
- objectFit="contain"
17
- />
18
- <h3>Original Square Image</h3>
19
- <img alt="" src="https://picsum.photos/id/237/300/300" />
20
- <h3>Object fit on a Square Image</h3>
21
- <Avatar altText="Avatar" as="div" url="https://picsum.photos/id/237/300/300" />
22
- <h3>Object fit on a Square Image using Dynamic Size</h3>
23
- <Avatar
24
- altText="Avatar"
25
- as="div"
26
- size={px2rem(200)}
27
- url="https://picsum.photos/id/237/300/300"
28
- />
29
- </div>
30
- );
@@ -1,27 +0,0 @@
1
- import {Avatar} from '@workday/canvas-kit-react/avatar';
2
- import {px2rem} from '@workday/canvas-kit-styling';
3
-
4
- export default () => (
5
- <div className="story">
6
- <h3>Extra-Extra Large</h3>
7
- <Avatar altText="Avatar" as="div" size="extraExtraLarge" />
8
- <h3>Extra Large</h3>
9
- <Avatar altText="Avatar" as="div" size="extraLarge" />
10
- <h3>Large</h3>
11
- <Avatar altText="Avatar" as="div" size="large" />
12
- <h3>Medium</h3>
13
- <Avatar altText="Avatar" as="div" size="medium" />
14
- <h3>Small</h3>
15
- <Avatar altText="Avatar" as="div" size="small" />
16
- <h3>Extra Small</h3>
17
- <Avatar altText="Avatar" as="div" size="extraSmall" />
18
- <h3>30px</h3>
19
- <Avatar altText="Avatar" as="div" size={px2rem(30)} />
20
- <h3>40px</h3>
21
- <Avatar altText="Avatar" as="div" size={px2rem(40)} />
22
- <h3>3rem</h3>
23
- <Avatar altText="Avatar" as="div" size="3rem" />
24
- <h3>4rem</h3>
25
- <Avatar altText="Avatar" as="div" size="4rem" />
26
- </div>
27
- );
@@ -1,10 +0,0 @@
1
- import {Avatar} from '@workday/canvas-kit-react/avatar';
2
-
3
- export default () => (
4
- <div className="story">
5
- <h3>Light</h3>
6
- <Avatar altText="Avatar" as="div" size="medium" />
7
- <h3>Dark</h3>
8
- <Avatar altText="Avatar" as="div" size="medium" variant="dark" />
9
- </div>
10
- );