@workday/canvas-kit-docs 12.0.0-alpha.822-next.0 → 12.0.0-alpha.841-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.
@@ -1 +1 @@
1
- {"version":3,"file":"versionsTable.d.ts","sourceRoot":"","sources":["../../../mdx/versionsTable.tsx"],"names":[],"mappings":"AA8DA,eAAO,MAAM,YAAY,mBAgCxB,CAAC"}
1
+ {"version":3,"file":"versionsTable.d.ts","sourceRoot":"","sources":["../../../mdx/versionsTable.tsx"],"names":[],"mappings":"AAkEA,eAAO,MAAM,YAAY,mBAgCxB,CAAC"}
@@ -9,6 +9,10 @@ const allVersions = [
9
9
  versionNumber: version,
10
10
  documentation: 'https://github.com/Workday/canvas-kit',
11
11
  },
12
+ {
13
+ versionNumber: 10,
14
+ documentation: 'https://d2krrudi3mmzzw.cloudfront.net/v10/?path=/docs/welcome--page',
15
+ },
12
16
  {
13
17
  versionNumber: 9,
14
18
  documentation: 'https://d2krrudi3mmzzw.cloudfront.net/v9/?path=/docs/welcome--page',
@@ -0,0 +1,21 @@
1
+ # Canvas Kit 12.0 Upgrade Guide
2
+
3
+ This guide contains an overview of the changes in Canvas Kit v12. Please
4
+ [reach out](https://github.com/Workday/canvas-kit/issues/new?labels=bug&template=bug.md) if you have
5
+ any questions.
6
+
7
+ ## Why You Should Upgrade
8
+
9
+ ## Table of contents
10
+
11
+ - [Removals](#removals)
12
+ - [Select (Preview)](#select-preview)
13
+
14
+ ## Removals
15
+ Removals are deletions from our codebase and you can no longer consume this component. We've either promoted or replaced a component or utility.
16
+
17
+ ### Select (Preview)
18
+
19
+ **PR:** [#2796](https://github.com/Workday/canvas-kit/pull/2796)
20
+
21
+ We've removed the `Select` component that was in Preview. Please use the compound [`Select` component from Main](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-select--basic).
@@ -7,6 +7,7 @@ import SecondaryInverse from './examples/SecondaryInverse';
7
7
  import Tertiary from './examples/Tertiary';
8
8
  import TertiaryInverse from './examples/TertiaryInverse';
9
9
  import Delete from './examples/Delete';
10
+ import Grow from './examples/Grow';
10
11
  import CustomStyles from './examples/CustomStyles';
11
12
 
12
13
 
@@ -70,6 +71,12 @@ on a dark or colorful background such as `blueberry400`.
70
71
 
71
72
  <ExampleCodeBlock code={Delete} />
72
73
 
74
+ ### Grow Prop
75
+
76
+ The example below shows the use of the `grow` prop on different variants of buttons. This will set the width of the button to the width of its container.
77
+
78
+ <ExampleCodeBlock code={Grow} />
79
+
73
80
  ### Custom Styles
74
81
 
75
82
  All of our buttons support custom styling via the `cs` prop. For more information, check our
@@ -41,9 +41,24 @@ const myCustomStyles = createStyles({
41
41
  textTransform: 'uppercase',
42
42
  });
43
43
 
44
+ const customColors = {
45
+ default: {
46
+ background: system.color.static.green.soft,
47
+ icon: system.color.static.green.strong,
48
+ label: system.color.static.green.strong,
49
+ },
50
+ hover: {
51
+ background: system.color.static.green.default,
52
+ icon: system.color.static.green.strong,
53
+ },
54
+ };
55
+
44
56
  export default () => (
45
57
  <Grid cs={{gap: px2rem(4), gridTemplateColumns: 'repeat(3, 1fr)', alignItems: 'center'}}>
46
58
  <MyCustomButton icon={plusIcon}>Styling Override Via Stencil Variables</MyCustomButton>
47
59
  <PrimaryButton cs={myCustomStyles}>Style Override Via Create Styles</PrimaryButton>
60
+ <PrimaryButton icon={plusIcon} colors={customColors}>
61
+ Styling Override Via Colors Prop
62
+ </PrimaryButton>
48
63
  </Grid>
49
64
  );
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+
3
+ import {
4
+ DeleteButton,
5
+ PrimaryButton,
6
+ SecondaryButton,
7
+ TertiaryButton,
8
+ } from '@workday/canvas-kit-react/button';
9
+ import {Flex} from '@workday/canvas-kit-react/layout';
10
+
11
+ export default () => (
12
+ <Flex gap="s" padding="s" flexDirection="column" maxWidth={300}>
13
+ <PrimaryButton size="small" grow={true}>
14
+ Primary
15
+ </PrimaryButton>
16
+ <SecondaryButton size="small" grow={true}>
17
+ Secondary
18
+ </SecondaryButton>
19
+ <TertiaryButton size="small" grow={true}>
20
+ Tertiary
21
+ </TertiaryButton>
22
+ <DeleteButton size="small" grow={true}>
23
+ Delete
24
+ </DeleteButton>
25
+ </Flex>
26
+ );
@@ -3,10 +3,10 @@ import {Modal, useModalModel} from '@workday/canvas-kit-react/modal';
3
3
  import {DeleteButton} from '@workday/canvas-kit-react/button';
4
4
  import {FormField} from '@workday/canvas-kit-preview-react/form-field';
5
5
  import {Flex, Box} from '@workday/canvas-kit-react/layout';
6
- import {Select} from '@workday/canvas-kit-preview-react/select';
6
+ import {Select} from '@workday/canvas-kit-react/select';
7
7
 
8
8
  export default () => {
9
- const ref = React.useRef<HTMLInputElement>(null);
9
+ const ref = React.useRef(null);
10
10
  const [value, setValue] = React.useState('');
11
11
  const model = useModalModel({
12
12
  returnFocusRef: ref,
@@ -18,24 +18,29 @@ export default () => {
18
18
 
19
19
  return (
20
20
  <Modal model={model}>
21
- <FormField>
22
- <FormField.Label>Choose an option</FormField.Label>
23
- <FormField.Input
24
- as={Select}
25
- ref={ref}
26
- options={['', 'Delete', 'Two']}
27
- value={value}
28
- onChange={e => {
29
- const option = e.currentTarget.value;
30
- if (option === 'Delete') {
31
- model.events.show();
32
- setValue('');
33
- } else {
34
- setValue(e.currentTarget.value);
35
- }
36
- }}
37
- />
38
- </FormField>
21
+ <Select items={['', 'Delete', 'Two']}>
22
+ <FormField>
23
+ <FormField.Label>Choose an option</FormField.Label>
24
+ <FormField.Input
25
+ as={Select.Input}
26
+ ref={ref}
27
+ onChange={e => {
28
+ const option = e.currentTarget.value;
29
+ if (option === 'Delete') {
30
+ model.events.show();
31
+ setValue('');
32
+ } else {
33
+ setValue(e.currentTarget.value);
34
+ }
35
+ }}
36
+ />
37
+ <Select.Popper>
38
+ <Select.Card>
39
+ <Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
40
+ </Select.Card>
41
+ </Select.Popper>
42
+ </FormField>
43
+ </Select>
39
44
  <Modal.Overlay>
40
45
  <Modal.Card>
41
46
  <Modal.CloseIcon aria-label="Close" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "12.0.0-alpha.822-next.0",
3
+ "version": "12.0.0-alpha.841-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",
@@ -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": "^12.0.0-alpha.822-next.0",
48
- "@workday/canvas-kit-preview-react": "^12.0.0-alpha.822-next.0",
49
- "@workday/canvas-kit-react": "^12.0.0-alpha.822-next.0",
50
- "@workday/canvas-kit-styling": "^12.0.0-alpha.822-next.0",
47
+ "@workday/canvas-kit-labs-react": "^12.0.0-alpha.841-next.0",
48
+ "@workday/canvas-kit-preview-react": "^12.0.0-alpha.841-next.0",
49
+ "@workday/canvas-kit-react": "^12.0.0-alpha.841-next.0",
50
+ "@workday/canvas-kit-styling": "^12.0.0-alpha.841-next.0",
51
51
  "@workday/canvas-system-icons-web": "^3.0.0",
52
52
  "@workday/canvas-tokens-web": "^2.0.0",
53
53
  "markdown-to-jsx": "^6.10.3",
@@ -59,5 +59,5 @@
59
59
  "mkdirp": "^1.0.3",
60
60
  "typescript": "4.2"
61
61
  },
62
- "gitHead": "60128be5a045e4fb245a9f8a9f3ee0ddab8fe257"
62
+ "gitHead": "066c4b170850949586bf9f89370f5302a6c8f9a4"
63
63
  }