@workday/canvas-kit-docs 11.0.0-alpha.657-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 (87) hide show
  1. package/dist/es6/lib/docs.js +818 -324
  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/loading-sparkles/LoadingSparkles.mdx +15 -2
  7. package/dist/mdx/preview-react/loading-sparkles/examples/Basic.tsx +59 -1
  8. package/dist/mdx/preview-react/menu/Menu.mdx +10 -1
  9. package/dist/mdx/preview-react/radio/Radio.mdx +2 -5
  10. package/dist/mdx/preview-react/radio/examples/Basic.tsx +11 -4
  11. package/dist/mdx/preview-react/radio/examples/Custom.tsx +11 -4
  12. package/dist/mdx/preview-react/radio/examples/Disabled.tsx +5 -4
  13. package/dist/mdx/preview-react/radio/examples/Error.tsx +1 -1
  14. package/dist/mdx/preview-react/radio/examples/Inverse.tsx +7 -10
  15. package/dist/mdx/preview-react/radio/examples/LabelPosition.tsx +5 -8
  16. package/dist/mdx/preview-react/radio/examples/NoValue.tsx +5 -8
  17. package/dist/mdx/preview-react/radio/examples/RefForwarding.tsx +5 -4
  18. package/dist/mdx/preview-react/radio/examples/Required.tsx +7 -10
  19. package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +7 -4
  20. package/dist/mdx/preview-react/text-area/TextArea.mdx +9 -0
  21. package/dist/mdx/preview-react/text-input/TextInput.mdx +12 -2
  22. package/dist/mdx/react/checkbox/Checkbox.mdx +16 -6
  23. package/dist/mdx/react/checkbox/examples/Alert.tsx +11 -7
  24. package/dist/mdx/react/checkbox/examples/Error.tsx +11 -7
  25. package/dist/mdx/react/checkbox/examples/LabelPosition.tsx +9 -3
  26. package/dist/mdx/react/checkbox/examples/Required.tsx +9 -3
  27. package/dist/mdx/react/color-picker/color-input/ColorInput.mdx +16 -6
  28. package/dist/mdx/react/color-picker/color-input/examples/Alert.tsx +5 -8
  29. package/dist/mdx/react/color-picker/color-input/examples/Basic.tsx +4 -3
  30. package/dist/mdx/react/color-picker/color-input/examples/Checked.tsx +4 -3
  31. package/dist/mdx/react/color-picker/color-input/examples/Disabled.tsx +4 -3
  32. package/dist/mdx/react/color-picker/color-input/examples/Error.tsx +5 -8
  33. package/dist/mdx/react/color-picker/color-input/examples/Grow.tsx +4 -3
  34. package/dist/mdx/react/color-picker/color-input/examples/LabelPosition.tsx +4 -3
  35. package/dist/mdx/react/color-picker/color-input/examples/RefForwarding.tsx +4 -3
  36. package/dist/mdx/react/color-picker/color-input/examples/Required.tsx +4 -3
  37. package/dist/mdx/react/color-picker/color-input/examples/ValidColorChange.tsx +5 -3
  38. package/dist/mdx/react/color-picker/color-preview/ColorPreview.mdx +16 -6
  39. package/dist/mdx/react/color-picker/color-preview/examples/LabelPosition.tsx +4 -3
  40. package/dist/mdx/react/color-picker/color-preview/examples/RefForwarding.tsx +4 -3
  41. package/dist/mdx/react/common/examples/ResponsiveStyles.tsx +4 -3
  42. package/dist/mdx/react/dialog/examples/Basic.tsx +4 -3
  43. package/dist/mdx/react/dialog/examples/Focus.tsx +4 -3
  44. package/dist/mdx/react/form-field/FormField.mdx +9 -0
  45. package/dist/mdx/react/modal/examples/CustomFocus.tsx +9 -3
  46. package/dist/mdx/react/modal/examples/FormModal.tsx +7 -5
  47. package/dist/mdx/react/modal/examples/ReturnFocus.tsx +6 -4
  48. package/dist/mdx/react/radio/Radio.mdx +19 -8
  49. package/dist/mdx/react/radio/examples/Alert.tsx +6 -10
  50. package/dist/mdx/react/radio/examples/Basic.tsx +5 -4
  51. package/dist/mdx/react/radio/examples/Disabled.tsx +5 -4
  52. package/dist/mdx/react/radio/examples/Error.tsx +6 -10
  53. package/dist/mdx/react/radio/examples/LabelPosition.tsx +5 -8
  54. package/dist/mdx/react/radio/examples/NoValue.tsx +5 -4
  55. package/dist/mdx/react/radio/examples/RefForwarding.tsx +5 -4
  56. package/dist/mdx/react/radio/examples/Required.tsx +5 -4
  57. package/dist/mdx/react/select/Select.mdx +16 -7
  58. package/dist/mdx/react/select/examples/Alert.tsx +5 -7
  59. package/dist/mdx/react/select/examples/Basic.tsx +4 -3
  60. package/dist/mdx/react/select/examples/Complex.tsx +4 -3
  61. package/dist/mdx/react/select/examples/Disabled.tsx +4 -3
  62. package/dist/mdx/react/select/examples/DisabledOption.tsx +4 -3
  63. package/dist/mdx/react/select/examples/Error.tsx +5 -7
  64. package/dist/mdx/react/select/examples/Grow.tsx +4 -3
  65. package/dist/mdx/react/select/examples/HoistedModel.tsx +4 -3
  66. package/dist/mdx/react/select/examples/LabelPosition.tsx +4 -3
  67. package/dist/mdx/react/select/examples/MenuHeight.tsx +4 -3
  68. package/dist/mdx/react/select/examples/RefForwarding.tsx +8 -7
  69. package/dist/mdx/react/select/examples/Required.tsx +7 -6
  70. package/dist/mdx/react/select/examples/WithIcons.tsx +11 -6
  71. package/dist/mdx/react/skeleton/examples/Simulation.tsx +7 -5
  72. package/dist/mdx/react/status-indicator/StatusIndicator.mdx +10 -0
  73. package/dist/mdx/react/switch/Switch.mdx +16 -7
  74. package/dist/mdx/react/table/Table.mdx +7 -0
  75. package/dist/mdx/react/text-area/TextArea.mdx +18 -11
  76. package/dist/mdx/react/text-area/examples/Alert.tsx +5 -8
  77. package/dist/mdx/react/text-area/examples/Basic.tsx +4 -3
  78. package/dist/mdx/react/text-area/examples/Disabled.tsx +4 -3
  79. package/dist/mdx/react/text-area/examples/Error.tsx +5 -8
  80. package/dist/mdx/react/text-area/examples/Grow.tsx +4 -3
  81. package/dist/mdx/react/text-area/examples/LabelPosition.tsx +4 -3
  82. package/dist/mdx/react/text-area/examples/Placeholder.tsx +9 -3
  83. package/dist/mdx/react/text-area/examples/RefForwarding.tsx +4 -3
  84. package/dist/mdx/react/text-area/examples/Required.tsx +4 -3
  85. package/dist/mdx/react/text-area/examples/ResizeConstraints.tsx +9 -3
  86. package/dist/mdx/react/text-input/TextInput.mdx +16 -7
  87. package/package.json +6 -6
@@ -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 {Select, useSelectModel} from '@workday/canvas-kit-react/select';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
5
  import {
@@ -23,9 +23,14 @@ export default () => {
23
23
  const selectedItem = model.navigation.getItem(model.state.selectedIds[0], model);
24
24
  return (
25
25
  <Flex>
26
- <Select model={model}>
27
- <FormField label="Contact">
28
- <Select.Input width="300px" inputStartIcon={selectedItem.value.icon} />
26
+ <FormField>
27
+ <Select model={model}>
28
+ <FormField.Label>Contact</FormField.Label>
29
+ <FormField.Input
30
+ as={Select.Input}
31
+ width="300px"
32
+ inputStartIcon={selectedItem.value.icon}
33
+ />
29
34
  <Select.Popper>
30
35
  <Select.Card maxHeight="200px">
31
36
  {model.state.items.length > 0 && (
@@ -40,8 +45,8 @@ export default () => {
40
45
  )}
41
46
  </Select.Card>
42
47
  </Select.Popper>
43
- </FormField>
44
- </Select>
48
+ </Select>
49
+ </FormField>
45
50
  </Flex>
46
51
  );
47
52
  };
@@ -3,7 +3,7 @@ import {keyframes} from '@emotion/react';
3
3
 
4
4
  import {Card} from '@workday/canvas-kit-react/card';
5
5
  import {Checkbox} from '@workday/canvas-kit-react/checkbox';
6
- import {FormField} from '@workday/canvas-kit-react/form-field';
6
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
7
7
  import {SecondaryButton} from '@workday/canvas-kit-react/button';
8
8
  import {SystemIconCircle} from '@workday/canvas-kit-react/icon';
9
9
  import {TextInput} from '@workday/canvas-kit-react/text-input';
@@ -64,11 +64,13 @@ export default () => {
64
64
  return (
65
65
  <Box>
66
66
  <Box marginBottom="l">
67
- <FormField label="Load Time" labelPosition={FormField.LabelPosition.Left}>
68
- <TextInput onChange={onChangeLoadTime} value={loadTime} />
67
+ <FormField orientation="horizontal">
68
+ <FormField.Label>Load Time</FormField.Label>
69
+ <FormField.Input as={TextInput} onChange={onChangeLoadTime} value={loadTime} />
69
70
  </FormField>
70
- <FormField label="Loading" labelPosition={FormField.LabelPosition.Left}>
71
- <Checkbox checked={loading} onChange={onChangeLoading} />
71
+ <FormField orientation="horizontal">
72
+ <FormField.Label>Loading</FormField.Label>
73
+ <FormField.Input as={Checkbox} checked={loading} onChange={onChangeLoading} />
72
74
  </FormField>
73
75
  <SecondaryButton onClick={resetTimeout}>Simulate Loading</SecondaryButton>
74
76
  </Box>
@@ -1,6 +1,7 @@
1
1
  import {SymbolDoc} from '@workday/canvas-kit-docs';
2
2
 
3
3
  import {StatusIndicator} from '@workday/canvas-kit-react/status-indicator';
4
+ import {StatusIndicator as PreviewStatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
4
5
 
5
6
  import Basic from './examples/Basic';
6
7
  import Icon from './examples/Icon';
@@ -10,6 +11,15 @@ import MaxWidth from './examples/MaxWidth';
10
11
 
11
12
  # Canvas Kit Status Indicator
12
13
 
14
+ <PreviewStatusIndicator variant="red">
15
+ <PreviewStatusIndicator.Label>Deprecated</PreviewStatusIndicator.Label>
16
+ </PreviewStatusIndicator>
17
+
18
+ `StatusIndicator` in Main has been deprecated and will be removed in a future major version. Please
19
+ use
20
+ [`StatusIndicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic)
21
+ in Preview instead.
22
+
13
23
  Status Indicators help the user quickly identify the status of a task, action, or page element.
14
24
 
15
25
  [> Workday Design Reference](https://design.workday.com/components/indicators/status-indicators)
@@ -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 {Switch} from '@workday/canvas-kit-react/switch';
4
4
 
@@ -24,6 +24,18 @@ yarn add @workday/canvas-kit-react
24
24
 
25
25
  ## Usage
26
26
 
27
+ <InformationHighlight style={{margin: '1.5rem 0'}}>
28
+ <InformationHighlight.Icon />
29
+ <InformationHighlight.Heading>Note</InformationHighlight.Heading>
30
+ <InformationHighlight.Body>
31
+ These examples are using FormField from Preview. We can plan to promote this component to the
32
+ Main package in a future major version.
33
+ </InformationHighlight.Body>
34
+ <InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-form-field--basic">
35
+ View Form Field (Preview) Documentation
36
+ </InformationHighlight.Link>
37
+ </InformationHighlight>
38
+
27
39
  ### Basic Example
28
40
 
29
41
  Switch should be used in tandem with [Form Field](/components/inputs/form-field/) to meet
@@ -44,13 +56,10 @@ Switch supports [ref forwarding](https://reactjs.org/docs/forwarding-refs.html).
44
56
 
45
57
  <ExampleCodeBlock code={RefForwarding} />
46
58
 
47
- ### Label Position
48
-
49
- Set the `labelPosition` prop of the wrapping Form Field to designate the position of the label
50
- relative to the Switch. `labelPosition` accepts the following values:
59
+ ### Label Position Horizontal
51
60
 
52
- - `FormField.LabelPosition.Top` (Default)
53
- - `FormField.LabelPosition.Left`
61
+ Set the `orientation` prop of the Form Field to designate the position of the label relative to the
62
+ input component. By default, the orientation will be set to `vertical`.
54
63
 
55
64
  <ExampleCodeBlock code={LabelPosition} />
56
65
 
@@ -1,6 +1,7 @@
1
1
  import {SymbolDoc} from '@workday/canvas-kit-docs';
2
2
 
3
3
  import {Table, TableRow} from '@workday/canvas-kit-react/table';
4
+ import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
4
5
 
5
6
  import Basic from './examples/Basic';
6
7
  import RowHeader from './examples/RowHeader';
@@ -9,6 +10,12 @@ import RowStates from './examples/RowStates';
9
10
 
10
11
  # Canvas Kit Table
11
12
 
13
+ <StatusIndicator variant="red">
14
+ <StatusIndicator.Label>Deprecated</StatusIndicator.Label>
15
+ </StatusIndicator>
16
+
17
+ `Table` has been deprecated and will be removed in a future major version. Please use [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview instead.
18
+
12
19
  Tables are an efficient way of displaying sets of repeating data with the same structure.
13
20
 
14
21
  [> Workday Design Reference](https://design.workday.com/components/containers/tables)
@@ -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.657-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.657-next.0",
48
- "@workday/canvas-kit-preview-react": "^11.0.0-alpha.657-next.0",
49
- "@workday/canvas-kit-react": "^11.0.0-alpha.657-next.0",
50
- "@workday/canvas-kit-styling": "^11.0.0-alpha.657-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": "524bc66bc3431b68ff6340f66a53f30a8b83e541"
62
+ "gitHead": "518377818f85c915b6199f66d73fd7e5e38ce7fa"
63
63
  }