@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,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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
4
4
  import {useUniqueId} from '@workday/canvas-kit-react/common';
5
5
 
@@ -11,19 +11,15 @@ export default () => {
11
11
  };
12
12
 
13
13
  return (
14
- <FormField
15
- error={FormField.ErrorType.Error}
16
- hintId="hint-error"
17
- hintText="Deep dish is currently sold out."
18
- label="Choose Your Pizza Crust"
19
- useFieldset={true}
20
- >
21
- <RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
14
+ <FormField error="error" as="fieldset">
15
+ <FormField.Label as="legend">Choose Your Pizza Crust</FormField.Label>
16
+ <FormField.Input as={RadioGroup} name={useUniqueId()} onChange={handleChange} value={value}>
22
17
  <Radio label="Deep dish" value="deep-dish" />
23
18
  <Radio label="Thin" value="thin" />
24
19
  <Radio label="Gluten free" value="gluten-free" />
25
20
  <Radio label="Cauliflower" value="cauliflower" />
26
- </RadioGroup>
21
+ </FormField.Input>
22
+ <FormField.Hint>Deep dish is currently sold out</FormField.Hint>
27
23
  </FormField>
28
24
  );
29
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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
4
4
  import {useUniqueId} from '@workday/canvas-kit-react/common';
5
5
 
@@ -11,17 +11,14 @@ export default () => {
11
11
  };
12
12
 
13
13
  return (
14
- <FormField
15
- label="Choose Your Pizza Crust"
16
- labelPosition={FormField.LabelPosition.Left}
17
- useFieldset={true}
18
- >
19
- <RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
14
+ <FormField orientation="horizontal" as="fieldset">
15
+ <FormField.Label as="legend">Choose Your Pizza Crust</FormField.Label>
16
+ <FormField.Input as={RadioGroup} name={useUniqueId()} onChange={handleChange} value={value}>
20
17
  <Radio label="Deep dish" value="deep-dish" />
21
18
  <Radio label="Thin" value="thin" />
22
19
  <Radio label="Gluten free" value="gluten-free" />
23
20
  <Radio label="Cauliflower" value="cauliflower" />
24
- </RadioGroup>
21
+ </FormField.Input>
25
22
  </FormField>
26
23
  );
27
24
  };
@@ -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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
4
4
  import {Subtext} from '@workday/canvas-kit-react/text';
5
5
  import {useUniqueId} from '@workday/canvas-kit-react/common';
@@ -13,13 +13,14 @@ export default () => {
13
13
 
14
14
  return (
15
15
  <>
16
- <FormField label="Choose Your Pizza Crust" useFieldset={true}>
17
- <RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
16
+ <FormField as="fieldset">
17
+ <FormField.Label as="legend">Choose Your Pizza Crust</FormField.Label>
18
+ <FormField.Input as={RadioGroup} name={useUniqueId()} onChange={handleChange} value={value}>
18
19
  <Radio label="Deep dish" />
19
20
  <Radio label="Thin" />
20
21
  <Radio label="Gluten free" />
21
22
  <Radio label="Cauliflower" />
22
- </RadioGroup>
23
+ </FormField.Input>
23
24
  </FormField>
24
25
  <Subtext size="large">Value: {value}</Subtext>
25
26
  </>
@@ -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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
5
5
  import {useUniqueId} from '@workday/canvas-kit-react/common';
6
6
 
@@ -18,13 +18,14 @@ export default () => {
18
18
 
19
19
  return (
20
20
  <>
21
- <FormField label="Choose Your Pizza Crust" useFieldset={true}>
22
- <RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
21
+ <FormField as="fieldset">
22
+ <FormField.Label as="legend">Choose Your Pizza Crust</FormField.Label>
23
+ <FormField.Input as={RadioGroup} name={useUniqueId()} onChange={handleChange} value={value}>
23
24
  <Radio label="Deep dish" value="deep-dish" />
24
25
  <Radio label="Thin" value="thin" />
25
26
  <Radio label="Gluten free" ref={glutenFreeRef} value="gluten-free" />
26
27
  <Radio label="Cauliflower" value="cauliflower" />
27
- </RadioGroup>
28
+ </FormField.Input>
28
29
  </FormField>
29
30
  <PrimaryButton onClick={handleClick}>Select Gluten Free</PrimaryButton>
30
31
  </>
@@ -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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
4
4
  import {useUniqueId} from '@workday/canvas-kit-react/common';
5
5
 
@@ -11,13 +11,14 @@ export default () => {
11
11
  };
12
12
 
13
13
  return (
14
- <FormField label="Choose Your Pizza Crust" required={true} useFieldset={true}>
15
- <RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
14
+ <FormField isRequired={true} as="fieldset">
15
+ <FormField.Label as="legend">Choose Your Pizza Crust</FormField.Label>
16
+ <FormField.Input as={RadioGroup} name={useUniqueId()} onChange={handleChange} value={value}>
16
17
  <Radio label="Deep dish" value="deep-dish" />
17
18
  <Radio label="Thin" value="thin" />
18
19
  <Radio label="Gluten free" value="gluten-free" />
19
20
  <Radio label="Cauliflower" value="cauliflower" />
20
- </RadioGroup>
21
+ </FormField.Input>
21
22
  </FormField>
22
23
  );
23
24
  };
@@ -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 {Select} from '@workday/canvas-kit-react/select';
4
4
 
@@ -31,6 +31,18 @@ yarn add @workday/canvas-kit-react
31
31
 
32
32
  ## Usage
33
33
 
34
+ <InformationHighlight style={{margin: '1.5rem 0'}}>
35
+ <InformationHighlight.Icon />
36
+ <InformationHighlight.Heading>Note</InformationHighlight.Heading>
37
+ <InformationHighlight.Body>
38
+ These examples are using FormField from Preview. We can plan to promote this component to the
39
+ Main package in a future major version.
40
+ </InformationHighlight.Body>
41
+ <InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-form-field--basic">
42
+ View Form Field (Preview) Documentation
43
+ </InformationHighlight.Link>
44
+ </InformationHighlight>
45
+
34
46
  ### Basic Example
35
47
 
36
48
  `Select` supports a
@@ -76,13 +88,10 @@ trigger an event to change the selected item.
76
88
 
77
89
  <ExampleCodeBlock code={HoistedModel} />
78
90
 
79
- ### Label Position
80
-
81
- Set the `labelPosition` prop of the wrapping `FormField` to designate the position of the label
82
- relative to the `Select`. `labelPosition` accepts the following values:
91
+ ### Label Position Horizontal
83
92
 
84
- - `FormField.LabelPosition.Top` (Default)
85
- - `FormField.LabelPosition.Left`
93
+ Set the `orientation` prop of the Form Field to designate the position of the label relative to the
94
+ input component. By default, the orientation will be set to `vertical`.
86
95
 
87
96
  <ExampleCodeBlock code={LabelPosition} />
88
97
 
@@ -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} from '@workday/canvas-kit-react/select';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
5
 
@@ -21,17 +21,15 @@ export default () => {
21
21
  return (
22
22
  <Flex flexDirection="column">
23
23
  <Select items={options}>
24
- <FormField
25
- error={FormField.ErrorType.Alert}
26
- hintText="Please choose a form of contact."
27
- label="Contact"
28
- >
29
- <Select.Input onChange={e => handleChange(e)} id="alert-select" />
24
+ <FormField error="alert">
25
+ <FormField.Label>Contact</FormField.Label>
26
+ <FormField.Input as={Select.Input} onChange={e => handleChange(e)} id="alert-select" />
30
27
  <Select.Popper>
31
28
  <Select.Card>
32
29
  <Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
33
30
  </Select.Card>
34
31
  </Select.Popper>
32
+ <FormField.Hint>Please choose a form of contact.</FormField.Hint>
35
33
  </FormField>
36
34
  </Select>
37
35
  Selected value: {value}
@@ -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} from '@workday/canvas-kit-react/select';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
5
 
@@ -22,8 +22,9 @@ export default () => {
22
22
  return (
23
23
  <Flex flexDirection="column">
24
24
  <Select items={options}>
25
- <FormField label="Contact">
26
- <Select.Input onChange={e => handleChange(e)} />
25
+ <FormField>
26
+ <FormField.Label>Contact</FormField.Label>
27
+ <FormField.Input as={Select.Input} onChange={e => handleChange(e)} />
27
28
  <Select.Popper>
28
29
  <Select.Card>
29
30
  <Select.List>
@@ -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} from '@workday/canvas-kit-react/select';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
5
 
@@ -30,8 +30,9 @@ export default () => {
30
30
  return (
31
31
  <Flex flexDirection="column">
32
32
  <Select items={options} onSelect={handleSelect}>
33
- <FormField label="Contact">
34
- <Select.Input onChange={e => handleChange(e)} />
33
+ <FormField>
34
+ <FormField.Label>Contact</FormField.Label>
35
+ <FormField.Input as={Select.Input} onChange={e => handleChange(e)} />
35
36
  <Select.Popper>
36
37
  <Select.Card>
37
38
  <Select.List>
@@ -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} from '@workday/canvas-kit-react/select';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
5
 
@@ -22,8 +22,9 @@ export default () => {
22
22
  return (
23
23
  <Flex flexDirection="column">
24
24
  <Select items={options} nonInteractiveIds={['Fax (disabled)']}>
25
- <FormField label="Contact">
26
- <Select.Input disabled onChange={e => handleChange(e)} />
25
+ <FormField>
26
+ <FormField.Label>Contact</FormField.Label>
27
+ <FormField.Input as={Select.Input} disabled onChange={e => handleChange(e)} />
27
28
  <Select.Popper>
28
29
  <Select.Card>
29
30
  <Select.List>
@@ -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} from '@workday/canvas-kit-react/select';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
5
 
@@ -22,8 +22,9 @@ export default () => {
22
22
  return (
23
23
  <Flex flexDirection="column">
24
24
  <Select items={options} nonInteractiveIds={['Fax (disabled)', 'Mobile Phone']}>
25
- <FormField label="Contact">
26
- <Select.Input onChange={e => handleChange(e)} />
25
+ <FormField>
26
+ <FormField.Label>Contact</FormField.Label>
27
+ <FormField.Input as={Select.Input} onChange={e => handleChange(e)} />
27
28
  <Select.Popper>
28
29
  <Select.Card>
29
30
  <Select.List>
@@ -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} from '@workday/canvas-kit-react/select';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
5
 
@@ -21,12 +21,9 @@ export default () => {
21
21
  return (
22
22
  <Flex flexDirection="column">
23
23
  <Select items={options} nonInteractiveIds={['Fax (disabled)']}>
24
- <FormField
25
- error={FormField.ErrorType.Error}
26
- hintText="Fax is disabled. Please choose a different option."
27
- label="Contact"
28
- >
29
- <Select.Input onChange={e => handleChange(e)} />
24
+ <FormField error="error">
25
+ <FormField.Label>Contact</FormField.Label>
26
+ <FormField.Input as={Select.Input} onChange={e => handleChange(e)} />
30
27
  <Select.Popper>
31
28
  <Select.Card>
32
29
  <Select.List>
@@ -38,6 +35,7 @@ export default () => {
38
35
  </Select.List>
39
36
  </Select.Card>
40
37
  </Select.Popper>
38
+ <FormField.Hint>Fax is disabled. Please choose a different option.</FormField.Hint>
41
39
  </FormField>
42
40
  </Select>
43
41
  Selected Value: {value}
@@ -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
 
@@ -20,8 +20,9 @@ export default () => {
20
20
  return (
21
21
  <Flex>
22
22
  <Select model={model}>
23
- <FormField label="Contact" grow>
24
- <Select.Input />
23
+ <FormField cs={{width: '100%'}}>
24
+ <FormField.Label>Contact</FormField.Label>
25
+ <FormField.Input grow as={Select.Input} />
25
26
  <Select.Popper>
26
27
  <Select.Card>
27
28
  {model.state.items.length > 0 && (
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import {SecondaryButton} 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 {Select, useSelectModel} from '@workday/canvas-kit-react/select';
5
5
  import {BodyText} from '@workday/canvas-kit-react/text';
6
6
 
@@ -22,8 +22,9 @@ export default () => {
22
22
  return (
23
23
  <>
24
24
  <Select model={model}>
25
- <FormField label="Contact">
26
- <Select.Input />
25
+ <FormField>
26
+ <FormField.Label>Contact</FormField.Label>
27
+ <FormField.Input as={Select.Input} />
27
28
  <Select.Popper>
28
29
  <Select.Card>
29
30
  <Select.List>
@@ -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
 
@@ -20,8 +20,9 @@ export default () => {
20
20
  return (
21
21
  <Flex>
22
22
  <Select model={model}>
23
- <FormField label="Contact" labelPosition={FormField.LabelPosition.Left}>
24
- <Select.Input />
23
+ <FormField orientation="horizontal">
24
+ <FormField.Label>Contact</FormField.Label>
25
+ <FormField.Input as={Select.Input} />
25
26
  <Select.Popper>
26
27
  <Select.Card>
27
28
  {model.state.items.length > 0 && (
@@ -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} from '@workday/canvas-kit-react/select';
4
4
  import {Box} from '@workday/canvas-kit-react/layout';
5
5
 
@@ -38,9 +38,10 @@ const cities = [
38
38
  export default () => {
39
39
  return (
40
40
  <Box>
41
- <FormField label="Choose a City">
41
+ <FormField>
42
+ <FormField.Label>Choose a City</FormField.Label>
42
43
  <Select items={cities}>
43
- <Select.Input />
44
+ <FormField.Input as={Select.Input} />
44
45
  <Select.Popper>
45
46
  <Select.Card maxHeight={200}>
46
47
  <Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
@@ -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 {Select} from '@workday/canvas-kit-react/select';
5
5
 
6
6
  const options = [
@@ -14,7 +14,7 @@ const options = [
14
14
 
15
15
  export default () => {
16
16
  const [value, setValue] = React.useState('medium');
17
- const ref = React.useRef<HTMLInputElement>(null);
17
+ const ref = React.useRef(null);
18
18
 
19
19
  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
20
20
  setValue(event.target.value);
@@ -28,16 +28,17 @@ export default () => {
28
28
 
29
29
  return (
30
30
  <>
31
- <Select items={options}>
32
- <FormField label="Contact">
33
- <Select.Input ref={ref} onChange={e => handleChange(e)} />
31
+ <FormField>
32
+ <Select items={options}>
33
+ <FormField.Label>Contact</FormField.Label>
34
+ <FormField.Input as={Select.Input} ref={ref} onChange={e => handleChange(e)} />
34
35
  <Select.Popper>
35
36
  <Select.Card>
36
37
  <Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
37
38
  </Select.Card>
38
39
  </Select.Popper>
39
- </FormField>
40
- </Select>
40
+ </Select>
41
+ </FormField>
41
42
  <PrimaryButton onClick={handleClick}>Focus Select</PrimaryButton>
42
43
  </>
43
44
  );
@@ -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} from '@workday/canvas-kit-react/select';
4
4
  import {Flex} from '@workday/canvas-kit-react/layout';
5
5
 
@@ -21,16 +21,17 @@ export default () => {
21
21
 
22
22
  return (
23
23
  <Flex flexDirection="column">
24
- <Select items={options}>
25
- <FormField label="Contact" required>
26
- <Select.Input onChange={e => handleChange(e)} />
24
+ <FormField isRequired>
25
+ <Select items={options}>
26
+ <FormField.Label>Contact</FormField.Label>
27
+ <FormField.Input as={Select.Input} onChange={e => handleChange(e)} />
27
28
  <Select.Popper>
28
29
  <Select.Card>
29
30
  <Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
30
31
  </Select.Card>
31
32
  </Select.Popper>
32
- </FormField>
33
- </Select>
33
+ </Select>
34
+ </FormField>
34
35
  Selected Value: {value}
35
36
  </Flex>
36
37
  );
@@ -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)