@workday/canvas-kit-docs 11.0.0-alpha.662-next.0 → 11.0.0-alpha.667-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.
- package/dist/es6/lib/docs.js +191 -146
- package/dist/mdx/preview-react/form-field/FormField.mdx +18 -0
- package/dist/mdx/preview-react/form-field/examples/AllFields.tsx +12 -12
- package/dist/mdx/preview-react/form-field/examples/Grow.tsx +21 -0
- package/dist/mdx/preview-react/form-field/examples/ThemedErrors.tsx +36 -0
- package/dist/mdx/preview-react/menu/Menu.mdx +10 -1
- package/dist/mdx/preview-react/radio/Radio.mdx +2 -5
- package/dist/mdx/preview-react/radio/examples/Basic.tsx +11 -4
- package/dist/mdx/preview-react/radio/examples/Custom.tsx +11 -4
- package/dist/mdx/preview-react/radio/examples/Disabled.tsx +5 -4
- package/dist/mdx/preview-react/radio/examples/Error.tsx +1 -1
- package/dist/mdx/preview-react/radio/examples/Inverse.tsx +7 -10
- package/dist/mdx/preview-react/radio/examples/LabelPosition.tsx +5 -8
- package/dist/mdx/preview-react/radio/examples/NoValue.tsx +5 -8
- package/dist/mdx/preview-react/radio/examples/RefForwarding.tsx +5 -4
- package/dist/mdx/preview-react/radio/examples/Required.tsx +7 -10
- package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +7 -4
- package/dist/mdx/preview-react/text-area/TextArea.mdx +9 -0
- package/dist/mdx/preview-react/text-input/TextInput.mdx +12 -2
- package/dist/mdx/react/checkbox/Checkbox.mdx +16 -6
- package/dist/mdx/react/checkbox/examples/Alert.tsx +11 -7
- package/dist/mdx/react/checkbox/examples/Error.tsx +11 -7
- package/dist/mdx/react/checkbox/examples/LabelPosition.tsx +9 -3
- package/dist/mdx/react/checkbox/examples/Required.tsx +9 -3
- package/dist/mdx/react/color-picker/color-input/ColorInput.mdx +16 -6
- package/dist/mdx/react/color-picker/color-input/examples/Alert.tsx +5 -8
- package/dist/mdx/react/color-picker/color-input/examples/Basic.tsx +4 -3
- package/dist/mdx/react/color-picker/color-input/examples/Checked.tsx +4 -3
- package/dist/mdx/react/color-picker/color-input/examples/Disabled.tsx +4 -3
- package/dist/mdx/react/color-picker/color-input/examples/Error.tsx +5 -8
- package/dist/mdx/react/color-picker/color-input/examples/Grow.tsx +4 -3
- package/dist/mdx/react/color-picker/color-input/examples/LabelPosition.tsx +4 -3
- package/dist/mdx/react/color-picker/color-input/examples/RefForwarding.tsx +4 -3
- package/dist/mdx/react/color-picker/color-input/examples/Required.tsx +4 -3
- package/dist/mdx/react/color-picker/color-input/examples/ValidColorChange.tsx +5 -3
- package/dist/mdx/react/color-picker/color-preview/ColorPreview.mdx +16 -6
- package/dist/mdx/react/color-picker/color-preview/examples/LabelPosition.tsx +4 -3
- package/dist/mdx/react/color-picker/color-preview/examples/RefForwarding.tsx +4 -3
- package/dist/mdx/react/common/examples/ResponsiveStyles.tsx +4 -3
- package/dist/mdx/react/dialog/examples/Basic.tsx +4 -3
- package/dist/mdx/react/dialog/examples/Focus.tsx +4 -3
- package/dist/mdx/react/form-field/FormField.mdx +9 -0
- package/dist/mdx/react/modal/examples/CustomFocus.tsx +9 -3
- package/dist/mdx/react/modal/examples/FormModal.tsx +7 -5
- package/dist/mdx/react/modal/examples/ReturnFocus.tsx +6 -4
- package/dist/mdx/react/radio/Radio.mdx +19 -8
- package/dist/mdx/react/radio/examples/Alert.tsx +6 -10
- package/dist/mdx/react/radio/examples/Basic.tsx +5 -4
- package/dist/mdx/react/radio/examples/Disabled.tsx +5 -4
- package/dist/mdx/react/radio/examples/Error.tsx +6 -10
- package/dist/mdx/react/radio/examples/LabelPosition.tsx +5 -8
- package/dist/mdx/react/radio/examples/NoValue.tsx +5 -4
- package/dist/mdx/react/radio/examples/RefForwarding.tsx +5 -4
- package/dist/mdx/react/radio/examples/Required.tsx +5 -4
- package/dist/mdx/react/select/Select.mdx +16 -7
- package/dist/mdx/react/select/examples/Alert.tsx +5 -7
- package/dist/mdx/react/select/examples/Basic.tsx +4 -3
- package/dist/mdx/react/select/examples/Complex.tsx +4 -3
- package/dist/mdx/react/select/examples/Disabled.tsx +4 -3
- package/dist/mdx/react/select/examples/DisabledOption.tsx +4 -3
- package/dist/mdx/react/select/examples/Error.tsx +5 -7
- package/dist/mdx/react/select/examples/Grow.tsx +4 -3
- package/dist/mdx/react/select/examples/HoistedModel.tsx +4 -3
- package/dist/mdx/react/select/examples/LabelPosition.tsx +4 -3
- package/dist/mdx/react/select/examples/MenuHeight.tsx +4 -3
- package/dist/mdx/react/select/examples/RefForwarding.tsx +8 -7
- package/dist/mdx/react/select/examples/Required.tsx +7 -6
- package/dist/mdx/react/select/examples/WithIcons.tsx +11 -6
- package/dist/mdx/react/skeleton/examples/Simulation.tsx +7 -5
- package/dist/mdx/react/status-indicator/StatusIndicator.mdx +10 -0
- package/dist/mdx/react/switch/Switch.mdx +16 -7
- package/dist/mdx/react/table/Table.mdx +7 -0
- package/dist/mdx/react/text-area/TextArea.mdx +18 -11
- package/dist/mdx/react/text-area/examples/Alert.tsx +5 -8
- package/dist/mdx/react/text-area/examples/Basic.tsx +4 -3
- package/dist/mdx/react/text-area/examples/Disabled.tsx +4 -3
- package/dist/mdx/react/text-area/examples/Error.tsx +5 -8
- package/dist/mdx/react/text-area/examples/Grow.tsx +4 -3
- package/dist/mdx/react/text-area/examples/LabelPosition.tsx +4 -3
- package/dist/mdx/react/text-area/examples/Placeholder.tsx +9 -3
- package/dist/mdx/react/text-area/examples/RefForwarding.tsx +4 -3
- package/dist/mdx/react/text-area/examples/Required.tsx +4 -3
- package/dist/mdx/react/text-area/examples/ResizeConstraints.tsx +9 -3
- package/dist/mdx/react/text-input/TextInput.mdx +16 -7
- package/package.json +6 -6
|
@@ -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
|
-
|
|
53
|
-
|
|
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
|
|
73
|
-
|
|
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
|
-
|
|
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
|
-
|
|
85
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
14
|
-
<
|
|
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
|
|
14
|
-
<
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
14
|
-
<
|
|
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
|
|
14
|
-
<
|
|
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
|
|
14
|
-
<
|
|
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
|
|
21
|
-
<
|
|
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
|
|
14
|
-
<
|
|
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
|
|
14
|
-
<
|
|
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
|
-
|
|
73
|
-
|
|
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.
|
|
3
|
+
"version": "11.0.0-alpha.667-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.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^11.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-react": "^11.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-styling": "^
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^11.0.0-alpha.667-next.0",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^11.0.0-alpha.667-next.0",
|
|
49
|
+
"@workday/canvas-kit-react": "^11.0.0-alpha.667-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^10.3.1",
|
|
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": "
|
|
62
|
+
"gitHead": "345331557dba888d9b12c56470a5e015162a6a0e"
|
|
63
63
|
}
|