@workday/canvas-kit-docs 15.0.0-alpha.0075-next.0 → 15.0.0-alpha.0077-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 (50) 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 +10908 -14026
  5. package/dist/es6/mdx/accessibility/examples/GlobalHeader.js +1 -1
  6. package/dist/mdx/15.0-UPGRADE-GUIDE.mdx +250 -0
  7. package/dist/mdx/preview-react/divider/examples/Basic.tsx +1 -1
  8. package/dist/mdx/{preview-react → react}/avatar/Avatar.mdx +5 -7
  9. package/dist/mdx/react/avatar/examples/Basic.tsx +5 -0
  10. package/dist/mdx/{preview-react → react}/avatar/examples/Custom.tsx +1 -1
  11. package/dist/mdx/{preview-react → react}/avatar/examples/Decorative.tsx +1 -1
  12. package/dist/mdx/{preview-react → react}/avatar/examples/Image.tsx +1 -1
  13. package/dist/mdx/{preview-react → react}/avatar/examples/Size.tsx +1 -1
  14. package/dist/mdx/{preview-react → react}/avatar/examples/Variant.tsx +1 -1
  15. package/dist/mdx/react/select/Select.mdx +8 -1
  16. package/dist/mdx/react/select/examples/GroupedItems.tsx +59 -0
  17. package/lib/StorybookStatusIndicator.tsx +10 -1
  18. package/package.json +6 -6
  19. package/dist/mdx/preview-react/avatar/examples/Basic.tsx +0 -5
  20. package/dist/mdx/preview-react/select/Select.mdx +0 -107
  21. package/dist/mdx/preview-react/select/examples/Left Label/AlertLeft.tsx +0 -18
  22. package/dist/mdx/preview-react/select/examples/Left Label/DefaultLeft.tsx +0 -17
  23. package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithCustomOptionsLeft.tsx +0 -25
  24. package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithSimpleOptionsLeft.tsx +0 -17
  25. package/dist/mdx/preview-react/select/examples/Left Label/DisabledLeft.tsx +0 -19
  26. package/dist/mdx/preview-react/select/examples/Left Label/ErrorLeft.tsx +0 -18
  27. package/dist/mdx/preview-react/select/examples/Left Label/GrowLeft.tsx +0 -17
  28. package/dist/mdx/preview-react/select/examples/Left Label/ScrollableLeft.tsx +0 -17
  29. package/dist/mdx/preview-react/select/examples/Left Label/index.ts +0 -8
  30. package/dist/mdx/preview-react/select/examples/Top Label/Caution.tsx +0 -16
  31. package/dist/mdx/preview-react/select/examples/Top Label/Default.tsx +0 -15
  32. package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithCustomOptions.tsx +0 -23
  33. package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithSimpleOptions.tsx +0 -15
  34. package/dist/mdx/preview-react/select/examples/Top Label/Disabled.tsx +0 -17
  35. package/dist/mdx/preview-react/select/examples/Top Label/Error.tsx +0 -16
  36. package/dist/mdx/preview-react/select/examples/Top Label/Grow.tsx +0 -15
  37. package/dist/mdx/preview-react/select/examples/Top Label/Scrollable.tsx +0 -13
  38. package/dist/mdx/preview-react/select/examples/Top Label/index.ts +0 -8
  39. package/dist/mdx/preview-react/select/examples/storiesData.tsx +0 -92
  40. package/dist/mdx/react/avatar/avatar/Avatar.mdx +0 -109
  41. package/dist/mdx/react/avatar/avatar/examples/Basic.tsx +0 -17
  42. package/dist/mdx/react/avatar/avatar/examples/Button.tsx +0 -20
  43. package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +0 -34
  44. package/dist/mdx/react/avatar/avatar/examples/Image.tsx +0 -25
  45. package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +0 -20
  46. package/dist/mdx/react/avatar/avatar/examples/ObjectFit.tsx +0 -30
  47. package/dist/mdx/react/avatar/avatar/examples/Size.tsx +0 -27
  48. package/dist/mdx/react/avatar/avatar/examples/Variant.tsx +0 -10
  49. package/dist/mdx/react/avatar/avatar/examples/test-avatar.png +0 -0
  50. /package/dist/mdx/{preview-react → react}/avatar/examples/nicholas-avatar.jpg +0 -0
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
-
3
- import {FormField} from '@workday/canvas-kit-react/form-field';
4
- import {Select} from '@workday/canvas-kit-preview-react/select';
5
- import {options} from '../storiesData';
6
- import {controlComponent} from '../../../../../../utils/storybook';
7
-
8
- export default () => {
9
- return (
10
- <FormField orientation="horizontalStart" id="select-default">
11
- <FormField.Label>Label</FormField.Label>
12
- <FormField.Field>
13
- {controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
14
- </FormField.Field>
15
- </FormField>
16
- );
17
- };
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
-
3
- import {FormField} from '@workday/canvas-kit-react/form-field';
4
- import {Select} from '@workday/canvas-kit-preview-react/select';
5
- import {customOptions, customRenderOption, customRenderSelected} from '../storiesData';
6
- import {controlComponent} from '../../../../../../utils/storybook';
7
-
8
- export default () => {
9
- return (
10
- <FormField orientation="horizontalStart" id="select-default-custom">
11
- <FormField.Label>Label</FormField.Label>
12
- <FormField.Field>
13
- {controlComponent(
14
- <FormField.Input
15
- as={Select}
16
- name="icon"
17
- options={customOptions}
18
- renderOption={customRenderOption}
19
- renderSelected={customRenderSelected}
20
- />
21
- )}
22
- </FormField.Field>
23
- </FormField>
24
- );
25
- };
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
-
3
- import {FormField} from '@workday/canvas-kit-react/form-field';
4
- import {Select} from '@workday/canvas-kit-preview-react/select';
5
- import {simpleOptions} from '../storiesData';
6
- import {controlComponent} from '../../../../../../utils/storybook';
7
-
8
- export default () => {
9
- return (
10
- <FormField orientation="horizontalStart" id="select-default-simple">
11
- <FormField.Label>Label</FormField.Label>
12
- <FormField.Field>
13
- {controlComponent(<FormField.Input as={Select} name="state" options={simpleOptions} />)}
14
- </FormField.Field>
15
- </FormField>
16
- );
17
- };
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
-
3
- import {FormField} from '@workday/canvas-kit-react/form-field';
4
- import {Select} from '@workday/canvas-kit-preview-react/select';
5
- import {options} from '../storiesData';
6
- import {controlComponent} from '../../../../../../utils/storybook';
7
-
8
- export default () => {
9
- return (
10
- <FormField orientation="horizontalStart" id="select-disabled">
11
- <FormField.Label>Label</FormField.Label>
12
- <FormField.Field>
13
- {controlComponent(
14
- <FormField.Input as={Select} name="contact" options={options} disabled={true} />
15
- )}
16
- </FormField.Field>
17
- </FormField>
18
- );
19
- };
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
-
3
- import {FormField} from '@workday/canvas-kit-react/form-field';
4
- import {Select} from '@workday/canvas-kit-preview-react/select';
5
- import {hintText, options} from '../storiesData';
6
- import {controlComponent} from '../../../../../../utils/storybook';
7
-
8
- export default () => {
9
- return (
10
- <FormField orientation="horizontalStart" id="select-error" error="error">
11
- <FormField.Label>Label</FormField.Label>
12
- <FormField.Field>
13
- {controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
14
- <FormField.Hint>{hintText}</FormField.Hint>
15
- </FormField.Field>
16
- </FormField>
17
- );
18
- };
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
-
3
- import {FormField} from '@workday/canvas-kit-react/form-field';
4
- import {Select} from '@workday/canvas-kit-preview-react/select';
5
- import {options} from '../storiesData';
6
- import {controlComponent} from '../../../../../../utils/storybook';
7
-
8
- export default () => {
9
- return (
10
- <FormField orientation="horizontalStart" id="select-grow" grow={true}>
11
- <FormField.Label>Label</FormField.Label>
12
- <FormField.Field>
13
- {controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
14
- </FormField.Field>
15
- </FormField>
16
- );
17
- };
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
-
3
- import {FormField} from '@workday/canvas-kit-react/form-field';
4
- import {Select} from '@workday/canvas-kit-preview-react/select';
5
- import {manyOptions} from '../storiesData';
6
- import {controlComponent} from '../../../../../../utils/storybook';
7
-
8
- export default () => {
9
- return (
10
- <FormField orientation="horizontalStart" id="select-default">
11
- <FormField.Label>Label</FormField.Label>
12
- <FormField.Field>
13
- {controlComponent(<FormField.Input as={Select} name="contact" options={manyOptions} />)}
14
- </FormField.Field>
15
- </FormField>
16
- );
17
- };
@@ -1,8 +0,0 @@
1
- export {DefaultLeft} from './DefaultLeft';
2
- export {DefaultWithCustomOptionsLeft} from './DefaultWithCustomOptionsLeft';
3
- export {DefaultWithSimpleOptionsLeft} from './DefaultWithSimpleOptionsLeft';
4
- export {ScrollableLeft} from './ScrollableLeft';
5
- export {DisabledLeft} from './DisabledLeft';
6
- export {AlertLeft} from './AlertLeft';
7
- export {ErrorLeft} from './ErrorLeft';
8
- export {GrowLeft} from './GrowLeft';
@@ -1,16 +0,0 @@
1
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
- import {Select} from '@workday/canvas-kit-preview-react/select';
3
- import {hintText, options} from '../storiesData';
4
- import {controlComponent} from '../../../../../../utils/storybook';
5
-
6
- export default () => {
7
- return (
8
- <FormField id="select-alert" error="caution">
9
- <FormField.Label>Label</FormField.Label>
10
- <FormField.Field>
11
- {controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
12
- <FormField.Hint>{hintText}</FormField.Hint>
13
- </FormField.Field>
14
- </FormField>
15
- );
16
- };
@@ -1,15 +0,0 @@
1
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
- import {Select} from '@workday/canvas-kit-preview-react/select';
3
- import {options} from '../storiesData';
4
- import {controlComponent} from '../../../../../../utils/storybook';
5
-
6
- export default () => {
7
- return (
8
- <FormField id="select-default">
9
- <FormField.Label>Label</FormField.Label>
10
- <FormField.Field>
11
- {controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
12
- </FormField.Field>
13
- </FormField>
14
- );
15
- };
@@ -1,23 +0,0 @@
1
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
- import {Select} from '@workday/canvas-kit-preview-react/select';
3
- import {customOptions, customRenderOption, customRenderSelected} from '../storiesData';
4
- import {controlComponent} from '../../../../../../utils/storybook';
5
-
6
- export default () => {
7
- return (
8
- <FormField id="select-default-custom">
9
- <FormField.Label>Label</FormField.Label>
10
- <FormField.Field>
11
- {controlComponent(
12
- <FormField.Input
13
- as={Select}
14
- name="icon"
15
- options={customOptions}
16
- renderOption={customRenderOption}
17
- renderSelected={customRenderSelected}
18
- />
19
- )}
20
- </FormField.Field>
21
- </FormField>
22
- );
23
- };
@@ -1,15 +0,0 @@
1
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
- import {Select} from '@workday/canvas-kit-preview-react/select';
3
- import {simpleOptions} from '../storiesData';
4
- import {controlComponent} from '../../../../../../utils/storybook';
5
-
6
- export default () => {
7
- return (
8
- <FormField id="select-default-simple">
9
- <FormField.Label>Label</FormField.Label>
10
- <FormField.Field>
11
- {controlComponent(<FormField.Input as={Select} name="state" options={simpleOptions} />)}
12
- </FormField.Field>
13
- </FormField>
14
- );
15
- };
@@ -1,17 +0,0 @@
1
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
- import {Select} from '@workday/canvas-kit-preview-react/select';
3
- import {options} from '../storiesData';
4
- import {controlComponent} from '../../../../../../utils/storybook';
5
-
6
- export default () => {
7
- return (
8
- <FormField id="select-disabled">
9
- <FormField.Label>Label</FormField.Label>
10
- <FormField.Field>
11
- {controlComponent(
12
- <FormField.Input as={Select} name="contact" options={options} disabled={true} />
13
- )}
14
- </FormField.Field>
15
- </FormField>
16
- );
17
- };
@@ -1,16 +0,0 @@
1
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
- import {Select} from '@workday/canvas-kit-preview-react/select';
3
- import {hintText, options} from '../storiesData';
4
- import {controlComponent} from '../../../../../../utils/storybook';
5
-
6
- export default () => {
7
- return (
8
- <FormField id="select-error" error="error">
9
- <FormField.Label>Label</FormField.Label>
10
- <FormField.Field>
11
- {controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
12
- <FormField.Hint>{hintText}</FormField.Hint>
13
- </FormField.Field>
14
- </FormField>
15
- );
16
- };
@@ -1,15 +0,0 @@
1
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
- import {Select} from '@workday/canvas-kit-preview-react/select';
3
- import {options} from '../storiesData';
4
- import {controlComponent} from '../../../../../../utils/storybook';
5
-
6
- export default () => {
7
- return (
8
- <FormField id="select-grow" grow={true}>
9
- <FormField.Label>Label</FormField.Label>
10
- <FormField.Field>
11
- {controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
12
- </FormField.Field>
13
- </FormField>
14
- );
15
- };
@@ -1,13 +0,0 @@
1
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
- import {Select} from '@workday/canvas-kit-preview-react/select';
3
- import {manyOptions} from '../storiesData';
4
- import {controlComponent} from '../../../../../../utils/storybook';
5
-
6
- export default () => {
7
- return (
8
- <FormField id="select-default">
9
- <FormField.Label>Label</FormField.Label>
10
- {controlComponent(<FormField.Input as={Select} name="contact" options={manyOptions} />)}
11
- </FormField>
12
- );
13
- };
@@ -1,8 +0,0 @@
1
- export {Default} from './Default';
2
- export {DefaultWithCustomOptions} from './DefaultWithCustomOptions';
3
- export {DefaultWithSimpleOptions} from './DefaultWithSimpleOptions';
4
- export {Scrollable} from './Scrollable';
5
- export {Disabled} from './Disabled';
6
- export {Caution} from './Caution';
7
- export {Error} from './Error';
8
- export {Grow} from './Grow';
@@ -1,92 +0,0 @@
1
- import {SystemIcon} from '@workday/canvas-kit-react/icon';
2
- import {
3
- activityStreamIcon,
4
- avatarIcon,
5
- uploadCloudIcon,
6
- userIcon,
7
- } from '@workday/canvas-system-icons-web';
8
- import {colors, typeColors} from '@workday/canvas-kit-react/tokens';
9
- import {
10
- RenderOptionFunction,
11
- RenderSelectedFunction,
12
- } from '@workday/canvas-kit-preview-react/select';
13
-
14
- export default 'Helpful text goes here.';
15
- export default 'error-desc-id';
16
-
17
- export default [
18
- {label: 'E-mail', value: 'email-1234'},
19
- {label: 'Phone', value: 'phone'},
20
- {label: 'Fax (disabled)', value: 'fax', disabled: true},
21
- {label: 'Mail', value: 'mail'},
22
- {label: 'Mobile Phone', value: 'mobile_phone'},
23
- {
24
- label: 'The Ontologically Anthropocentric Sensory Immersive Simulation',
25
- value: 'oasis',
26
- },
27
- ];
28
-
29
- export default ['California', 'Florida', 'New York', 'Pennsylvania', 'Texas'];
30
-
31
- export default [
32
- {label: 'Atlanta (United States)', value: 'atlanta'},
33
- {label: 'Amsterdam (Europe)', value: 'amsterdam'},
34
- {label: 'Austin (United States)', value: 'austin'},
35
- {label: 'Beaverton (United States)', value: 'beaverton'},
36
- {label: 'Belfast (Europe)', value: 'belfast'},
37
- {label: 'Berlin (Europe)', value: 'berlin'},
38
- {label: 'Boston (United States)', value: 'boston'},
39
- {label: 'Boulder (United States)', value: 'boulder'},
40
- {label: 'Chicago (United States)', value: 'chicago'},
41
- {label: 'Dallas (United States)', value: 'dallas'},
42
- {label: 'Denver (United States)', value: 'denver'},
43
- {label: 'Dublin (Europe)', value: 'dublin'},
44
- {label: 'Irvine (United States)', value: 'irvine'},
45
- {label: 'Minneapolis (United States)', value: 'minneapolis'},
46
- {label: 'New York (United States)', value: 'new-york'},
47
- {label: 'Orlando (United States)', value: 'orlando'},
48
- {label: 'Palo Alto (United States)', value: 'palo-alto'},
49
- {label: 'Philadelphia (United States)', value: 'philadelphia'},
50
- {label: 'Pleasanton (United States)', value: 'pleasanton'},
51
- {label: 'Raleigh (United States)', value: 'raleigh'},
52
- {label: 'San Francisco (United States)', value: 'san-francisco'},
53
- {label: 'San Mateo (United States)', value: 'san-mateo'},
54
- {label: 'Stockholm (Europe)', value: 'stockholm'},
55
- {
56
- label: 'The Ontologically Anthropocentric Sensory Immersive Simulation (Virtual Reality)',
57
- value: 'oasis',
58
- },
59
- {label: 'Toronto (Canada)', value: 'toronto'},
60
- {label: 'Victoria (Canada)', value: 'victoria'},
61
- {label: 'Vienna (Europe)', value: 'vienna'},
62
- {label: 'Warsaw (Europe)', value: 'warsaw'},
63
- {label: 'Washington, DC (United States)', value: 'washington-dc'},
64
- {label: 'Zurich (Europe)', value: 'zurich'},
65
- ];
66
-
67
- export default [
68
- {value: 'Activity Stream', data: {icon: activityStreamIcon}},
69
- {value: 'Avatar', data: {icon: avatarIcon}},
70
- {value: 'Upload Cloud', data: {icon: uploadCloudIcon}},
71
- {value: 'User', data: {icon: userIcon}},
72
- ];
73
-
74
- export const customRenderOption: RenderOptionFunction = option => {
75
- const iconColor = option.focused ? typeColors.inverse : colors.blackPepper100;
76
- return (
77
- <div style={{alignItems: 'center', display: 'flex', padding: '3px 0'}}>
78
- <SystemIcon icon={option.data.icon} color={iconColor} colorHover={iconColor} />
79
- <div style={{marginLeft: 5}}>{option.value}</div>
80
- </div>
81
- );
82
- };
83
-
84
- export const customRenderSelected: RenderSelectedFunction = option => {
85
- const iconColor = colors.blackPepper100;
86
- return (
87
- <div style={{alignItems: 'center', display: 'flex'}}>
88
- <SystemIcon icon={option.data.icon} color={iconColor} colorHover={iconColor} />
89
- <div style={{marginLeft: 5}}>{option.value}</div>
90
- </div>
91
- );
92
- };
@@ -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
- );