@workday/canvas-kit-docs 11.0.0-alpha.662-next.0 → 11.0.0-alpha.664-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 (85) hide show
  1. package/dist/es6/lib/docs.js +110 -144
  2. package/dist/mdx/preview-react/form-field/FormField.mdx +18 -0
  3. package/dist/mdx/preview-react/form-field/examples/AllFields.tsx +12 -12
  4. package/dist/mdx/preview-react/form-field/examples/Grow.tsx +21 -0
  5. package/dist/mdx/preview-react/form-field/examples/ThemedErrors.tsx +36 -0
  6. package/dist/mdx/preview-react/menu/Menu.mdx +10 -1
  7. package/dist/mdx/preview-react/radio/Radio.mdx +2 -5
  8. package/dist/mdx/preview-react/radio/examples/Basic.tsx +11 -4
  9. package/dist/mdx/preview-react/radio/examples/Custom.tsx +11 -4
  10. package/dist/mdx/preview-react/radio/examples/Disabled.tsx +5 -4
  11. package/dist/mdx/preview-react/radio/examples/Error.tsx +1 -1
  12. package/dist/mdx/preview-react/radio/examples/Inverse.tsx +7 -10
  13. package/dist/mdx/preview-react/radio/examples/LabelPosition.tsx +5 -8
  14. package/dist/mdx/preview-react/radio/examples/NoValue.tsx +5 -8
  15. package/dist/mdx/preview-react/radio/examples/RefForwarding.tsx +5 -4
  16. package/dist/mdx/preview-react/radio/examples/Required.tsx +7 -10
  17. package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +7 -4
  18. package/dist/mdx/preview-react/text-area/TextArea.mdx +9 -0
  19. package/dist/mdx/preview-react/text-input/TextInput.mdx +12 -2
  20. package/dist/mdx/react/checkbox/Checkbox.mdx +16 -6
  21. package/dist/mdx/react/checkbox/examples/Alert.tsx +11 -7
  22. package/dist/mdx/react/checkbox/examples/Error.tsx +11 -7
  23. package/dist/mdx/react/checkbox/examples/LabelPosition.tsx +9 -3
  24. package/dist/mdx/react/checkbox/examples/Required.tsx +9 -3
  25. package/dist/mdx/react/color-picker/color-input/ColorInput.mdx +16 -6
  26. package/dist/mdx/react/color-picker/color-input/examples/Alert.tsx +5 -8
  27. package/dist/mdx/react/color-picker/color-input/examples/Basic.tsx +4 -3
  28. package/dist/mdx/react/color-picker/color-input/examples/Checked.tsx +4 -3
  29. package/dist/mdx/react/color-picker/color-input/examples/Disabled.tsx +4 -3
  30. package/dist/mdx/react/color-picker/color-input/examples/Error.tsx +5 -8
  31. package/dist/mdx/react/color-picker/color-input/examples/Grow.tsx +4 -3
  32. package/dist/mdx/react/color-picker/color-input/examples/LabelPosition.tsx +4 -3
  33. package/dist/mdx/react/color-picker/color-input/examples/RefForwarding.tsx +4 -3
  34. package/dist/mdx/react/color-picker/color-input/examples/Required.tsx +4 -3
  35. package/dist/mdx/react/color-picker/color-input/examples/ValidColorChange.tsx +5 -3
  36. package/dist/mdx/react/color-picker/color-preview/ColorPreview.mdx +16 -6
  37. package/dist/mdx/react/color-picker/color-preview/examples/LabelPosition.tsx +4 -3
  38. package/dist/mdx/react/color-picker/color-preview/examples/RefForwarding.tsx +4 -3
  39. package/dist/mdx/react/common/examples/ResponsiveStyles.tsx +4 -3
  40. package/dist/mdx/react/dialog/examples/Basic.tsx +4 -3
  41. package/dist/mdx/react/dialog/examples/Focus.tsx +4 -3
  42. package/dist/mdx/react/form-field/FormField.mdx +9 -0
  43. package/dist/mdx/react/modal/examples/CustomFocus.tsx +9 -3
  44. package/dist/mdx/react/modal/examples/FormModal.tsx +7 -5
  45. package/dist/mdx/react/modal/examples/ReturnFocus.tsx +6 -4
  46. package/dist/mdx/react/radio/Radio.mdx +19 -8
  47. package/dist/mdx/react/radio/examples/Alert.tsx +6 -10
  48. package/dist/mdx/react/radio/examples/Basic.tsx +5 -4
  49. package/dist/mdx/react/radio/examples/Disabled.tsx +5 -4
  50. package/dist/mdx/react/radio/examples/Error.tsx +6 -10
  51. package/dist/mdx/react/radio/examples/LabelPosition.tsx +5 -8
  52. package/dist/mdx/react/radio/examples/NoValue.tsx +5 -4
  53. package/dist/mdx/react/radio/examples/RefForwarding.tsx +5 -4
  54. package/dist/mdx/react/radio/examples/Required.tsx +5 -4
  55. package/dist/mdx/react/select/Select.mdx +16 -7
  56. package/dist/mdx/react/select/examples/Alert.tsx +5 -7
  57. package/dist/mdx/react/select/examples/Basic.tsx +4 -3
  58. package/dist/mdx/react/select/examples/Complex.tsx +4 -3
  59. package/dist/mdx/react/select/examples/Disabled.tsx +4 -3
  60. package/dist/mdx/react/select/examples/DisabledOption.tsx +4 -3
  61. package/dist/mdx/react/select/examples/Error.tsx +5 -7
  62. package/dist/mdx/react/select/examples/Grow.tsx +4 -3
  63. package/dist/mdx/react/select/examples/HoistedModel.tsx +4 -3
  64. package/dist/mdx/react/select/examples/LabelPosition.tsx +4 -3
  65. package/dist/mdx/react/select/examples/MenuHeight.tsx +4 -3
  66. package/dist/mdx/react/select/examples/RefForwarding.tsx +8 -7
  67. package/dist/mdx/react/select/examples/Required.tsx +7 -6
  68. package/dist/mdx/react/select/examples/WithIcons.tsx +11 -6
  69. package/dist/mdx/react/skeleton/examples/Simulation.tsx +7 -5
  70. package/dist/mdx/react/status-indicator/StatusIndicator.mdx +10 -0
  71. package/dist/mdx/react/switch/Switch.mdx +16 -7
  72. package/dist/mdx/react/table/Table.mdx +7 -0
  73. package/dist/mdx/react/text-area/TextArea.mdx +18 -11
  74. package/dist/mdx/react/text-area/examples/Alert.tsx +5 -8
  75. package/dist/mdx/react/text-area/examples/Basic.tsx +4 -3
  76. package/dist/mdx/react/text-area/examples/Disabled.tsx +4 -3
  77. package/dist/mdx/react/text-area/examples/Error.tsx +5 -8
  78. package/dist/mdx/react/text-area/examples/Grow.tsx +4 -3
  79. package/dist/mdx/react/text-area/examples/LabelPosition.tsx +4 -3
  80. package/dist/mdx/react/text-area/examples/Placeholder.tsx +9 -3
  81. package/dist/mdx/react/text-area/examples/RefForwarding.tsx +4 -3
  82. package/dist/mdx/react/text-area/examples/Required.tsx +4 -3
  83. package/dist/mdx/react/text-area/examples/ResizeConstraints.tsx +9 -3
  84. package/dist/mdx/react/text-input/TextInput.mdx +16 -7
  85. package/package.json +6 -6
@@ -1,4 +1,4 @@
1
- import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
1
+ import {SymbolDoc, Specifications, InformationHighlight} from '@workday/canvas-kit-docs';
2
2
 
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
@@ -28,6 +28,18 @@ yarn add @workday/canvas-kit-react
28
28
 
29
29
  ## Usage
30
30
 
31
+ <InformationHighlight style={{margin: '1.5rem 0'}}>
32
+ <InformationHighlight.Icon />
33
+ <InformationHighlight.Heading>Note</InformationHighlight.Heading>
34
+ <InformationHighlight.Body>
35
+ These examples are using FormField from Preview. We can plan to promote this component to the
36
+ Main package in a future major version.
37
+ </InformationHighlight.Body>
38
+ <InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-form-field--basic">
39
+ View Form Field (Preview) Documentation
40
+ </InformationHighlight.Link>
41
+ </InformationHighlight>
42
+
31
43
  ### Basic Example
32
44
 
33
45
  Text Area should be used in tandem with [Form Field](/components/inputs/form-field/) to meet
@@ -69,20 +81,15 @@ accepts the following values:
69
81
 
70
82
  ### Grow
71
83
 
72
- Set the `grow` prop of the wrapping Form Field to `true` to configure the Text Area to expand to the
73
- width of its container.
84
+ Set the `grow` prop of the Text Area to `true` to configure the Text Area to expand to the width of
85
+ its container.
74
86
 
75
87
  <ExampleCodeBlock code={Grow} />
76
88
 
77
- The `grow` prop may also be applied directly to the Text Area if Form Field is not being used.
78
-
79
- ### Label Position
80
-
81
- Set the `labelPosition` prop of the wrapping Form Field to designate the position of the label
82
- relative to the Text Area. `labelPosition` accepts the following values:
89
+ ### Label Position Horizontal
83
90
 
84
- - `FormField.LabelPosition.Top` (Default)
85
- - `FormField.LabelPosition.Left`
91
+ Set the `orientation` prop of the Form Field to designate the position of the label relative to the
92
+ input component. By default, the orientation will be set to `vertical`.
86
93
 
87
94
  <ExampleCodeBlock code={LabelPosition} />
88
95
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
5
5
  export default () => {
@@ -10,13 +10,10 @@ export default () => {
10
10
  };
11
11
 
12
12
  return (
13
- <FormField
14
- error={FormField.ErrorType.Alert}
15
- hintId="hint-alert"
16
- hintText="Please enter your review."
17
- label="Leave a Review"
18
- >
19
- <TextArea onChange={handleChange} value={value} />
13
+ <FormField error="alert">
14
+ <FormField.Label>Please enter your review.</FormField.Label>
15
+ <FormField.Input as={TextArea} onChange={handleChange} value={value} />
16
+ <FormField.Hint>Please enter your review.</FormField.Hint>
20
17
  </FormField>
21
18
  );
22
19
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
5
5
  export default () => {
@@ -10,8 +10,9 @@ export default () => {
10
10
  };
11
11
 
12
12
  return (
13
- <FormField label="Leave a Review">
14
- <TextArea onChange={handleChange} value={value} />
13
+ <FormField>
14
+ <FormField.Label>Leave a Review</FormField.Label>
15
+ <FormField.Input as={TextArea} onChange={handleChange} value={value} />
15
16
  </FormField>
16
17
  );
17
18
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
5
5
  export default () => {
@@ -10,8 +10,9 @@ export default () => {
10
10
  };
11
11
 
12
12
  return (
13
- <FormField label="Leave a Review">
14
- <TextArea disabled onChange={handleChange} value={value} />
13
+ <FormField>
14
+ <FormField.Label>Leave a Review</FormField.Label>
15
+ <FormField.Input as={TextArea} disabled onChange={handleChange} value={value} />
15
16
  </FormField>
16
17
  );
17
18
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
5
5
  export default () => {
@@ -10,13 +10,10 @@ export default () => {
10
10
  };
11
11
 
12
12
  return (
13
- <FormField
14
- error={FormField.ErrorType.Error}
15
- hintId="hint-error"
16
- hintText="Please enter your review."
17
- label="Leave a Review"
18
- >
19
- <TextArea onChange={handleChange} value={value} />
13
+ <FormField error="error">
14
+ <FormField.Label>Leave a Review</FormField.Label>
15
+ <FormField.Input as={TextArea} onChange={handleChange} value={value} />
16
+ <FormField.Hint>Please enter your review.</FormField.Hint>
20
17
  </FormField>
21
18
  );
22
19
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
5
5
  export default () => {
@@ -10,8 +10,9 @@ export default () => {
10
10
  };
11
11
 
12
12
  return (
13
- <FormField grow={true} label="Leave a Review">
14
- <TextArea onChange={handleChange} value={value} />
13
+ <FormField>
14
+ <FormField.Label>Leave a Review</FormField.Label>
15
+ <FormField.Input as={TextArea} grow onChange={handleChange} value={value} />
15
16
  </FormField>
16
17
  );
17
18
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
5
5
  export default () => {
@@ -10,8 +10,9 @@ export default () => {
10
10
  };
11
11
 
12
12
  return (
13
- <FormField label="Leave a Review" labelPosition={FormField.LabelPosition.Left}>
14
- <TextArea onChange={handleChange} value={value} />
13
+ <FormField orientation="horizontal">
14
+ <FormField.Label>Leave a Review</FormField.Label>
15
+ <FormField.Input as={TextArea} onChange={handleChange} value={value} />
15
16
  </FormField>
16
17
  );
17
18
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
5
5
  export default () => {
@@ -10,8 +10,14 @@ export default () => {
10
10
  };
11
11
 
12
12
  return (
13
- <FormField label="Leave a Review">
14
- <TextArea onChange={handleChange} placeholder="Let us know how we did!" value={value} />
13
+ <FormField>
14
+ <FormField.Label>Leave a Review</FormField.Label>
15
+ <FormField.Input
16
+ as={TextArea}
17
+ onChange={handleChange}
18
+ placeholder="Let us know how we did!"
19
+ value={value}
20
+ />
15
21
  </FormField>
16
22
  );
17
23
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import {PrimaryButton} from '@workday/canvas-kit-react/button';
3
- import {FormField} from '@workday/canvas-kit-react/form-field';
3
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
4
4
  import {TextArea} from '@workday/canvas-kit-react/text-area';
5
5
 
6
6
  export default () => {
@@ -17,8 +17,9 @@ export default () => {
17
17
 
18
18
  return (
19
19
  <>
20
- <FormField label="Leave a Review">
21
- <TextArea onChange={handleChange} ref={ref} value={value} />
20
+ <FormField>
21
+ <FormField.Label>Leave a Review</FormField.Label>
22
+ <FormField.Input as={TextArea} onChange={handleChange} ref={ref} value={value} />
22
23
  </FormField>
23
24
  <PrimaryButton onClick={handleClick}>Focus Text Area</PrimaryButton>
24
25
  </>
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
5
5
  export default () => {
@@ -10,8 +10,9 @@ export default () => {
10
10
  };
11
11
 
12
12
  return (
13
- <FormField label="Leave a Review" required={true}>
14
- <TextArea onChange={handleChange} value={value} />
13
+ <FormField isRequired={true}>
14
+ <FormField.Label>Leave a Review</FormField.Label>
15
+ <FormField.Input as={TextArea} onChange={handleChange} value={value} />
15
16
  </FormField>
16
17
  );
17
18
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {FormField} from '@workday/canvas-kit-react/form-field';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
3
  import {TextArea} from '@workday/canvas-kit-react/text-area';
4
4
 
5
5
  export default () => {
@@ -10,8 +10,14 @@ export default () => {
10
10
  };
11
11
 
12
12
  return (
13
- <FormField label="Leave a Review">
14
- <TextArea onChange={handleChange} resize={TextArea.ResizeDirection.Vertical} value={value} />
13
+ <FormField>
14
+ <FormField.Label>Leave a Review</FormField.Label>
15
+ <FormField.Input
16
+ as={TextArea}
17
+ onChange={handleChange}
18
+ resize={TextArea.ResizeDirection.Vertical}
19
+ value={value}
20
+ />
15
21
  </FormField>
16
22
  );
17
23
  };
@@ -1,4 +1,4 @@
1
- import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
1
+ import {SymbolDoc, Specifications, InformationHighlight} from '@workday/canvas-kit-docs';
2
2
 
3
3
  import {TextInput} from '@workday/canvas-kit-react/text-input';
4
4
 
@@ -28,6 +28,18 @@ yarn add @workday/canvas-kit-react
28
28
 
29
29
  ## Usage
30
30
 
31
+ <InformationHighlight style={{margin: '1.5rem 0'}}>
32
+ <InformationHighlight.Icon />
33
+ <InformationHighlight.Heading>Note</InformationHighlight.Heading>
34
+ <InformationHighlight.Body>
35
+ These examples are using FormField from Preview. We can plan to promote this component to the
36
+ Main package in a future major version.
37
+ </InformationHighlight.Body>
38
+ <InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-form-field--basic">
39
+ View Form Field (Preview) Documentation
40
+ </InformationHighlight.Link>
41
+ </InformationHighlight>
42
+
31
43
  ### Basic Example
32
44
 
33
45
  Text Input should be used in tandem with [Form Field](/components/inputs/form-field/) to meet
@@ -64,13 +76,10 @@ the width of its container.
64
76
 
65
77
  The `grow` prop may also be applied directly to the Text Input if Form Field is not being used.
66
78
 
67
- ### Label Position
68
-
69
- Set the `labelPosition` prop of the wrapping Form Field to designate the position of the label
70
- relative to the Text Input. `labelPosition` accepts the following values:
79
+ ### Label Position Horizontal
71
80
 
72
- - `FormField.LabelPosition.Top` (Default)
73
- - `FormField.LabelPosition.Left`
81
+ Set the `orientation` prop of the Form Field to designate the position of the label relative to the
82
+ input component. By default, the orientation will be set to `vertical`.
74
83
 
75
84
  <ExampleCodeBlock code={LabelPosition} />
76
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "11.0.0-alpha.662-next.0",
3
+ "version": "11.0.0-alpha.664-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": "^11.0.0-alpha.662-next.0",
48
- "@workday/canvas-kit-preview-react": "^11.0.0-alpha.662-next.0",
49
- "@workday/canvas-kit-react": "^11.0.0-alpha.662-next.0",
50
- "@workday/canvas-kit-styling": "^11.0.0-alpha.662-next.0",
47
+ "@workday/canvas-kit-labs-react": "^11.0.0-alpha.664-next.0",
48
+ "@workday/canvas-kit-preview-react": "^11.0.0-alpha.664-next.0",
49
+ "@workday/canvas-kit-react": "^11.0.0-alpha.664-next.0",
50
+ "@workday/canvas-kit-styling": "^10.3.0",
51
51
  "@workday/canvas-system-icons-web": "^3.0.0",
52
52
  "@workday/canvas-tokens-web": "^1.0.2",
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": "ffa75d9e1edd782bf454f8a88dffdc6fca2695fa"
62
+ "gitHead": "518377818f85c915b6199f66d73fd7e5e38ce7fa"
63
63
  }