@workday/canvas-kit-docs 7.0.0-alpha.0-next.0 → 7.0.0-alpha.0-next.5

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 (51) hide show
  1. package/dist/mdx/7.0-MIGRATION-GUIDE.mdx +64 -1
  2. package/dist/mdx/preview-react/form-field/examples/Custom.tsx +1 -1
  3. package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +16 -22
  4. package/dist/mdx/preview-react/side-panel/examples/Basic.tsx +8 -13
  5. package/dist/mdx/preview-react/side-panel/examples/ExternalControl.tsx +8 -12
  6. package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +15 -22
  7. package/dist/mdx/preview-react/side-panel/examples/Variant.tsx +8 -13
  8. package/dist/mdx/preview-react/text-area/examples/Alert.tsx +9 -3
  9. package/dist/mdx/preview-react/text-area/examples/Basic.tsx +1 -1
  10. package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +1 -1
  11. package/dist/mdx/preview-react/text-area/examples/Error.tsx +1 -1
  12. package/dist/mdx/preview-react/text-area/examples/Grow.tsx +1 -1
  13. package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +7 -5
  14. package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +1 -1
  15. package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +1 -1
  16. package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +2 -6
  17. package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +3 -3
  18. package/dist/mdx/preview-react/text-area/examples/Required.tsx +1 -1
  19. package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +1 -1
  20. package/dist/mdx/preview-react/text-input/examples/Alert.tsx +4 -8
  21. package/dist/mdx/preview-react/text-input/examples/Basic.tsx +1 -1
  22. package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +1 -1
  23. package/dist/mdx/preview-react/text-input/examples/Error.tsx +1 -1
  24. package/dist/mdx/preview-react/text-input/examples/Grow.tsx +1 -1
  25. package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +7 -5
  26. package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +1 -1
  27. package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +1 -1
  28. package/dist/mdx/preview-react/text-input/examples/LoginForm.tsx +3 -3
  29. package/dist/mdx/preview-react/text-input/examples/Password.tsx +1 -1
  30. package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +1 -1
  31. package/dist/mdx/preview-react/text-input/examples/RefForwarding.tsx +3 -3
  32. package/dist/mdx/preview-react/text-input/examples/Required.tsx +1 -1
  33. package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +3 -2
  34. package/dist/mdx/preview-react/text-input/examples/ThemedError.tsx +2 -4
  35. package/dist/mdx/react/_examples/examples/PageHeader.tsx +1 -1
  36. package/dist/mdx/react/banner/examples/Sticky.tsx +6 -9
  37. package/dist/mdx/react/banner/examples/StickyAnimation.tsx +2 -1
  38. package/dist/mdx/react/banner/examples/StickyRTL.tsx +8 -10
  39. package/dist/mdx/react/button/icon-button/examples/Inverse.tsx +9 -12
  40. package/dist/mdx/react/button/icon-button/examples/InverseFilled.tsx +9 -12
  41. package/dist/mdx/react/modal/Modal.mdx +21 -0
  42. package/dist/mdx/react/modal/examples/Basic.tsx +4 -2
  43. package/dist/mdx/react/modal/examples/BodyOverflow.tsx +56 -0
  44. package/dist/mdx/react/modal/examples/CustomFocus.tsx +5 -2
  45. package/dist/mdx/react/modal/examples/FullOverflow.tsx +55 -0
  46. package/dist/mdx/react/modal/examples/ReturnFocus.tsx +4 -1
  47. package/dist/mdx/react/modal/examples/WithoutCloseIcon.tsx +5 -2
  48. package/dist/mdx/react/skeleton/examples/Simulation.tsx +10 -9
  49. package/dist/mdx/react/status-indicator/StatusIndicator.mdx +12 -0
  50. package/dist/mdx/react/status-indicator/examples/MaxWidth.tsx +30 -0
  51. package/package.json +3 -3
@@ -6,6 +6,8 @@ any questions about the update.
6
6
 
7
7
  - [Codemod](#codemod)
8
8
  - [ActionBar Component Updates](#actionbar-component-updates)
9
+ - [Status Indicator Width](#status-indicator-width)
10
+ - [Popup Cards](popup-cards)
9
11
 
10
12
  ## Codemod
11
13
 
@@ -44,4 +46,65 @@ PR: https://github.com/Workday/canvas-kit/pull/1396
44
46
  - Component has been converted to compound component.
45
47
  - `fixed` prop has been removed from component.
46
48
  - Now ActionBar uses `position` prop to set container position instead `fixed` prop.
47
- - Fixed position has been set as default if there is not passed `position` prop.
49
+ - Fixed position has been set as default if there is not passed `position` prop.
50
+
51
+ ## Status Indicator Width
52
+
53
+ Status Indicators currently truncate when they reach their max width of `150px`. After receiving
54
+ requests to increase this, we have upped it by 25% to `200px`.
55
+
56
+ We've also added a prop (`maxWidth`) to configure this if you need to. While this increases
57
+ flexibility, please keep in mind that status text should be short, direct, and preferably a single
58
+ word.
59
+
60
+ ```tsx
61
+ <StatusIndicator label="Slightly Longer Status" type={StatusIndicator.Type.Gray} maxWidth={250} />
62
+ ```
63
+
64
+ ## Popup Cards
65
+
66
+ `Popup.Card` (this includes `Modal.Card` and `Dialog.Card`) components are now a flexbox container.
67
+ This was done to support overflowing content (by default, the `Popup.Body` component). The idea is
68
+ the card is a vertical flexbox container and the `Popup.Heading`, `Popup.Body`, and any other
69
+ children are flex items. The `Popup.Body` now has an `overflow-y: auto` on it to naturally allow the
70
+ body content to overflow in a scroll container. This is a breaking change if your `Popup`, `Modal`,
71
+ or `Dialog` doesn't work with a flexbox with `flex-direction: column`. In most cases, this shouldn't
72
+ matter. If this change does cause your popup to display correctly, you may need to play around with
73
+ flex item containers.
74
+
75
+ An example where this might break:
76
+
77
+ A common Modal has a heading, body, and footer (Cancel/Submit buttons). If the Cancel and Submit
78
+ buttons are direct children of the `Modal.Card` like the following:
79
+
80
+ ```tsx
81
+ <Modal.Card>
82
+ <Modal.Heading>Some Heading</Modal.Heading>
83
+ <Modal.Body>Some Body</Modal.Body>
84
+ <SecondaryButton>Cancel</SecondaryButton>
85
+ <PrimaryButton>Submit</PrimaryButton>
86
+ </Modal.Card>
87
+ ```
88
+
89
+ The buttons will become vertical flex items instead of the default which is displaying inline-block.
90
+ Before, the buttons would layout next to each other horizontally. After, the buttons will stack
91
+ vertically. To fix this, you'll have to add another element to be a flex item from the `Modal.Card`.
92
+ Our examples use `HStack` to align the buttons. The following will render correctly after this
93
+ change:
94
+
95
+ ```tsx
96
+ <Modal.Card>
97
+ <Modal.Heading>Some Heading</Modal.Heading>
98
+ <Modal.Body>Some Body</Modal.Body>
99
+ <HStack spacing="s">
100
+ <SecondaryButton>Cancel</SecondaryButton>
101
+ <PrimaryButton>Submit</PrimaryButton>
102
+ </HStack>
103
+ </Modal.Card>
104
+ ```
105
+
106
+ If your code contains any hacks to make a `Modal` overflow, these hacks should now be removed.
107
+ [This example shows how body content overflows](https://workday.github.io/canvas-kit/?path=/docs/components-popups-modal-react--body-overflow)
108
+ (you may have to limit your browser height to see the overflow). Before you had to manually set the
109
+ `max-height` of the `Modal.Body` element using calculations. These should be removed. The
110
+ `Popup.Card` now has a max height and the `Popup.Body` height is automatically calculated.
@@ -45,7 +45,7 @@ export default () => {
45
45
 
46
46
  const model = useFormFieldModel({isRequired: true});
47
47
 
48
- const layoutProps = useFormFieldOrientation('vertical')
48
+ const layoutProps = useFormFieldOrientation('vertical');
49
49
 
50
50
  return (
51
51
  <Stack {...layoutProps}>
@@ -1,38 +1,32 @@
1
- /** @jsx jsx */
2
1
  import * as React from 'react';
3
- import {jsx} from '@emotion/core';
4
2
  import {colors, space, type} from '@workday/canvas-kit-react/tokens';
5
3
  import {AccentIcon} from '@workday/canvas-kit-react/icon';
6
4
  import {rocketIcon} from '@workday/canvas-accent-icons-web';
7
5
  import {SidePanel, useSidePanel} from '@workday/canvas-kit-preview-react/side-panel';
8
- import {Flex} from '@workday/canvas-kit-labs-react/layout';
9
- import {useThemeRTL} from '@workday/canvas-kit-labs-react/common';
6
+ import {Flex, HStack} from '@workday/canvas-kit-labs-react/layout';
7
+ import {styled} from '@workday/canvas-kit-react/common';
8
+
9
+ const StyledHeader = styled('h3')({
10
+ ...type.levels.body.large,
11
+ color: colors.licorice500,
12
+ fontWeight: type.properties.fontWeights.bold,
13
+ });
14
+
15
+ const StyledAccentIcon = styled(AccentIcon)({
16
+ marginRight: space.s,
17
+ });
10
18
 
11
19
  export default () => {
12
20
  const {panelProps, labelProps} = useSidePanel();
13
21
 
14
- const {themeRTL} = useThemeRTL();
15
- const iconStyles = themeRTL({
16
- marginRight: space.s,
17
- });
18
-
19
22
  return (
20
- <Flex height={320}>
23
+ <HStack spacing="s" height={320}>
21
24
  <SidePanel {...panelProps}>
22
25
  <Flex alignItems="center" paddingY="s" paddingX="xs">
23
- <AccentIcon css={iconStyles} icon={rocketIcon} />
24
- <h3
25
- css={{
26
- ...type.levels.body.large,
27
- color: colors.licorice500,
28
- fontWeight: type.properties.fontWeights.bold,
29
- }}
30
- {...labelProps}
31
- >
32
- Tasks Panel
33
- </h3>
26
+ <StyledAccentIcon icon={rocketIcon} />
27
+ <StyledHeader {...labelProps}>Tasks Panel</StyledHeader>
34
28
  </Flex>
35
29
  </SidePanel>
36
- </Flex>
30
+ </HStack>
37
31
  );
38
32
  };
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import * as React from 'react';
3
- import {jsx} from '@emotion/core';
4
2
  import {colors, type} from '@workday/canvas-kit-react/tokens';
5
3
  import {SecondaryButton} from '@workday/canvas-kit-react/button';
6
4
  import {
@@ -9,12 +7,18 @@ import {
9
7
  SidePanelTransitionStates,
10
8
  } from '@workday/canvas-kit-preview-react/side-panel';
11
9
  import {Flex} from '@workday/canvas-kit-labs-react/layout';
12
- import {CanvasProvider} from '@workday/canvas-kit-react/common';
10
+ import {CanvasProvider, styled} from '@workday/canvas-kit-react/common';
13
11
  import {AccentIcon} from '@workday/canvas-kit-react/icon';
14
12
  import {rocketIcon} from '@workday/canvas-accent-icons-web';
15
13
  // local helper hook for setting content direction;
16
14
  import {useDirection} from './useDirection';
17
15
 
16
+ const StyledHeader = styled('h3')({
17
+ ...type.levels.body.large,
18
+ color: colors.licorice500,
19
+ fontWeight: type.properties.fontWeights.bold,
20
+ });
21
+
18
22
  export default () => {
19
23
  const {direction, toggleDirection} = useDirection();
20
24
  const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
@@ -32,16 +36,7 @@ export default () => {
32
36
  <Flex marginInlineEnd="s">
33
37
  <AccentIcon icon={rocketIcon} />
34
38
  </Flex>
35
- <h3
36
- css={{
37
- ...type.levels.body.large,
38
- color: colors.licorice500,
39
- fontWeight: type.properties.fontWeights.bold,
40
- }}
41
- {...labelProps}
42
- >
43
- Tasks Panel
44
- </h3>
39
+ <StyledHeader {...labelProps}>Tasks Panel</StyledHeader>
45
40
  </Flex>
46
41
  )}
47
42
  </SidePanel>
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import * as React from 'react';
3
- import {jsx} from '@emotion/core';
4
2
  import {
5
3
  SidePanel,
6
4
  useSidePanel,
@@ -9,6 +7,13 @@ import {
9
7
  import {Flex} from '@workday/canvas-kit-labs-react/layout';
10
8
  import {SecondaryButton} from '@workday/canvas-kit-react/button';
11
9
  import {colors, type} from '@workday/canvas-kit-react/tokens';
10
+ import {styled} from '@workday/canvas-kit-react/common';
11
+
12
+ const StyledHeader = styled('h3')({
13
+ ...type.levels.body.large,
14
+ color: colors.licorice500,
15
+ fontWeight: type.properties.fontWeights.bold,
16
+ });
12
17
 
13
18
  export default () => {
14
19
  const {expanded, panelProps, labelProps, controlProps} = useSidePanel({initialExpanded: false});
@@ -28,16 +33,7 @@ export default () => {
28
33
  >
29
34
  {panelState === 'expanded' && (
30
35
  <Flex alignItems="center" paddingY="s" paddingX="xs">
31
- <h3
32
- css={{
33
- ...type.levels.body.large,
34
- color: colors.licorice500,
35
- fontWeight: type.properties.fontWeights.bold,
36
- }}
37
- {...labelProps}
38
- >
39
- Tasks Panel
40
- </h3>
36
+ <StyledHeader {...labelProps}>Tasks Panel</StyledHeader>
41
37
  </Flex>
42
38
  )}
43
39
  </SidePanel>
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import * as React from 'react';
3
- import {jsx} from '@emotion/core';
4
2
  import {colors, type} from '@workday/canvas-kit-react/tokens';
5
3
  import {SecondaryButton} from '@workday/canvas-kit-react/button';
6
4
  import {
@@ -8,42 +6,37 @@ import {
8
6
  useSidePanel,
9
7
  SidePanelTransitionStates,
10
8
  } from '@workday/canvas-kit-preview-react/side-panel';
11
- import {useThemeRTL} from '@workday/canvas-kit-labs-react/common';
12
9
  import {Flex} from '@workday/canvas-kit-labs-react/layout';
13
- import {CanvasProvider} from '@workday/canvas-kit-react/common';
10
+ import {CanvasProvider, styled} from '@workday/canvas-kit-react/common';
14
11
  // local helper hook for setting content direction;
15
12
  import {useDirection} from './useDirection';
16
13
 
14
+ const StyledHeader = styled('h3')({
15
+ ...type.levels.body.large,
16
+ color: colors.licorice500,
17
+ fontWeight: type.properties.fontWeights.bold,
18
+ });
19
+
20
+ const StyledSidePanel = styled(SidePanel)({
21
+ position: 'absolute',
22
+ right: 0,
23
+ });
24
+
17
25
  const RightPanel = () => {
18
26
  const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
19
27
  const [panelState, setPanelState] = React.useState<SidePanelTransitionStates>(
20
28
  expanded ? 'expanded' : 'collapsed'
21
29
  );
22
30
 
23
- const {themeRTL} = useThemeRTL();
24
- const panelStyles = themeRTL({
25
- position: 'absolute',
26
- right: 0,
27
- });
28
-
29
31
  return (
30
- <SidePanel {...panelProps} onStateTransition={setPanelState} origin="right" css={panelStyles}>
32
+ <StyledSidePanel {...panelProps} onStateTransition={setPanelState} origin="right">
31
33
  <SidePanel.ToggleButton {...controlProps} />
32
34
  {panelState === 'expanded' && (
33
35
  <Flex alignItems="center" justifyContent="flex-end" paddingY="s" paddingX="xs">
34
- <h3
35
- css={{
36
- ...type.levels.body.large,
37
- color: colors.licorice500,
38
- fontWeight: type.properties.fontWeights.bold,
39
- }}
40
- {...labelProps}
41
- >
42
- Tasks Panel
43
- </h3>
36
+ <StyledHeader {...labelProps}>Tasks Panel</StyledHeader>
44
37
  </Flex>
45
38
  )}
46
- </SidePanel>
39
+ </StyledSidePanel>
47
40
  );
48
41
  };
49
42
 
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
1
  import * as React from 'react';
3
- import {jsx} from '@emotion/core';
4
2
  import {colors, type} from '@workday/canvas-kit-react/tokens';
5
3
  import {SecondaryButton} from '@workday/canvas-kit-react/button';
6
4
  import {
@@ -9,10 +7,16 @@ import {
9
7
  SidePanelTransitionStates,
10
8
  } from '@workday/canvas-kit-preview-react/side-panel';
11
9
  import {Flex} from '@workday/canvas-kit-labs-react/layout';
12
- import {CanvasProvider} from '@workday/canvas-kit-react/common';
10
+ import {CanvasProvider, styled} from '@workday/canvas-kit-react/common';
13
11
  // local helper hook for setting content direction;
14
12
  import {useDirection} from './useDirection';
15
13
 
14
+ const StyledHeader = styled('h3')({
15
+ ...type.levels.body.large,
16
+ color: colors.licorice500,
17
+ fontWeight: type.properties.fontWeights.bold,
18
+ });
19
+
16
20
  export default () => {
17
21
  const {direction, toggleDirection} = useDirection();
18
22
  const {expanded, panelProps, labelProps, controlProps} = useSidePanel();
@@ -27,16 +31,7 @@ export default () => {
27
31
  <SidePanel.ToggleButton {...controlProps} />
28
32
  {panelState === 'expanded' && (
29
33
  <Flex alignItems="center" paddingY="s" paddingX="xs">
30
- <h3
31
- css={{
32
- ...type.levels.body.large,
33
- color: colors.licorice500,
34
- fontWeight: type.properties.fontWeights.bold,
35
- }}
36
- {...labelProps}
37
- >
38
- Alternate Panel
39
- </h3>
34
+ <StyledHeader {...labelProps}>Alternate Panel</StyledHeader>
40
35
  </Flex>
41
36
  )}
42
37
  </SidePanel>
@@ -1,5 +1,6 @@
1
+ /** @jsxRuntime classic */
1
2
  /** @jsx jsx */
2
- import { jsx } from '@emotion/core'
3
+ import {jsx} from '@emotion/react';
3
4
  import React from 'react';
4
5
  import {TextArea} from '@workday/canvas-kit-preview-react/text-area';
5
6
  import {useThemedRing} from '@workday/canvas-kit-labs-react/common';
@@ -16,10 +17,15 @@ export default () => {
16
17
  value.length < 3 ? 'success' : value.length < 7 ? 'alert' : 'error'
17
18
  );
18
19
 
19
- const hintColor = value.length < 3 ? colors.greenApple600 : value.length < 7 ? colors.cantaloupe600 : colors.cinnamon500
20
+ const hintColor =
21
+ value.length < 3
22
+ ? colors.greenApple600
23
+ : value.length < 7
24
+ ? colors.cantaloupe600
25
+ : colors.cinnamon500;
20
26
 
21
27
  return (
22
- <TextArea orientation='vertical'>
28
+ <TextArea orientation="vertical">
23
29
  <TextArea.Label>Add a comment</TextArea.Label>
24
30
  <TextArea.Field css={alertStyles} onChange={handleChange} value={value} />
25
31
  <TextArea.Hint paddingTop={space.xxs}>
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextArea orientation='vertical'>
12
+ <TextArea orientation="vertical">
13
13
  <TextArea.Label>Leave a review</TextArea.Label>
14
14
  <TextArea.Field onChange={handleChange} value={value} />
15
15
  </TextArea>
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextArea orientation='vertical'>
12
+ <TextArea orientation="vertical">
13
13
  <TextArea.Label>Leave a review</TextArea.Label>
14
14
  <TextArea.Field disabled onChange={handleChange} value={value} />
15
15
  </TextArea>
@@ -31,7 +31,7 @@ export default () => {
31
31
  };
32
32
 
33
33
  return (
34
- <TextArea hasError={hasError} orientation='vertical'>
34
+ <TextArea hasError={hasError} orientation="vertical">
35
35
  <TextArea.Label>A three letter word</TextArea.Label>
36
36
  <TextArea.Field onChange={handleChange} value={value} />
37
37
  <TextArea.Hint paddingTop={space.xxs}>{hint}</TextArea.Hint>
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextArea orientation='vertical' alignItems='stretch'>
12
+ <TextArea orientation="vertical" alignItems="stretch">
13
13
  <TextArea.Label>Leave a review</TextArea.Label>
14
14
  <TextArea.Field onChange={handleChange} value={value} />
15
15
  </TextArea>
@@ -1,8 +1,10 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core'
3
1
  import React from 'react';
4
2
  import {TextArea} from '@workday/canvas-kit-preview-react/text-area';
5
- import { accessibleHide } from '@workday/canvas-kit-react/common';
3
+ import {accessibleHide, styled} from '@workday/canvas-kit-react/common';
4
+
5
+ const StyledTextAreaLabel = styled(TextArea.Label)({
6
+ ...accessibleHide,
7
+ });
6
8
 
7
9
  export default () => {
8
10
  const [value, setValue] = React.useState('');
@@ -12,8 +14,8 @@ export default () => {
12
14
  };
13
15
 
14
16
  return (
15
- <TextArea orientation='vertical' spacing='zero'>
16
- <TextArea.Label css={{...accessibleHide}}>Email</TextArea.Label>
17
+ <TextArea orientation="vertical" spacing="zero">
18
+ <StyledTextAreaLabel>Email</StyledTextAreaLabel>
17
19
  <TextArea.Field onChange={handleChange} value={value} />
18
20
  </TextArea>
19
21
  );
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextArea orientation='horizontal'>
12
+ <TextArea orientation="horizontal">
13
13
  <TextArea.Label>Leave a review</TextArea.Label>
14
14
  <TextArea.Field onChange={handleChange} value={value} />
15
15
  </TextArea>
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextArea orientation='vertical' spacing='xxxs'>
12
+ <TextArea orientation="vertical" spacing="xxxs">
13
13
  <TextArea.Label>Leave a review</TextArea.Label>
14
14
  <TextArea.Field onChange={handleChange} value={value} />
15
15
  </TextArea>
@@ -9,13 +9,9 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextArea orientation='vertical'>
12
+ <TextArea orientation="vertical">
13
13
  <TextArea.Label>Leave a review</TextArea.Label>
14
- <TextArea.Field
15
- placeholder="Let us know how we did!"
16
- onChange={handleChange}
17
- value={value}
18
- />
14
+ <TextArea.Field placeholder="Let us know how we did!" onChange={handleChange} value={value} />
19
15
  </TextArea>
20
16
  );
21
17
  };
@@ -13,12 +13,12 @@ export default () => {
13
13
  };
14
14
 
15
15
  const handleClick = () => {
16
- changeFocus(ref.current)
16
+ changeFocus(ref.current);
17
17
  };
18
18
 
19
19
  return (
20
- <VStack spacing='xxxs' alignItems='flex-start'>
21
- <TextArea orientation='vertical'>
20
+ <VStack spacing="xxxs" alignItems="flex-start">
21
+ <TextArea orientation="vertical">
22
22
  <TextArea.Label>Leave a review</TextArea.Label>
23
23
  <TextArea.Field onChange={handleChange} value={value} ref={ref} />
24
24
  </TextArea>
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextArea isRequired={true} orientation='vertical'>
12
+ <TextArea isRequired={true} orientation="vertical">
13
13
  <TextArea.Label>Leave a review</TextArea.Label>
14
14
  <TextArea.Field onChange={handleChange} value={value} />
15
15
  </TextArea>
@@ -14,7 +14,7 @@ export default () => {
14
14
  };
15
15
 
16
16
  return (
17
- <TextArea orientation='vertical'>
17
+ <TextArea orientation="vertical">
18
18
  <TextArea.Label>Leave a review</TextArea.Label>
19
19
  <StyledField onChange={handleChange} value={value} />
20
20
  </TextArea>
@@ -1,5 +1,6 @@
1
+ /** @jsxRuntime classic */
1
2
  /** @jsx jsx */
2
- import {jsx} from '@emotion/core';
3
+ import {jsx} from '@emotion/react';
3
4
  import React from 'react';
4
5
  import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
5
6
  import {useThemedRing} from '@workday/canvas-kit-labs-react/common';
@@ -17,14 +18,9 @@ export default () => {
17
18
  );
18
19
 
19
20
  return (
20
- <TextInput orientation='vertical'>
21
+ <TextInput orientation="vertical">
21
22
  <TextInput.Label>Password</TextInput.Label>
22
- <TextInput.Field
23
- css={alertStyles}
24
- onChange={handleChange}
25
- value={value}
26
- type="password"
27
- />
23
+ <TextInput.Field css={alertStyles} onChange={handleChange} value={value} type="password" />
28
24
  <TextInput.Hint paddingTop={space.xxs}>
29
25
  <strong>Password Strength: </strong>
30
26
  {value.length < 3 ? (
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextInput orientation='vertical'>
12
+ <TextInput orientation="vertical">
13
13
  <TextInput.Label>Email</TextInput.Label>
14
14
  <TextInput.Field onChange={handleChange} value={value} />
15
15
  </TextInput>
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextInput orientation='vertical'>
12
+ <TextInput orientation="vertical">
13
13
  <TextInput.Label>Email</TextInput.Label>
14
14
  <TextInput.Field onChange={handleChange} value={value} disabled />
15
15
  </TextInput>
@@ -31,7 +31,7 @@ export default () => {
31
31
  };
32
32
 
33
33
  return (
34
- <TextInput hasError={hasError} orientation='vertical'>
34
+ <TextInput hasError={hasError} orientation="vertical">
35
35
  <TextInput.Label>A three letter word</TextInput.Label>
36
36
  <TextInput.Field onChange={handleChange} value={value} />
37
37
  <TextInput.Hint paddingTop={space.xxs}>{hint}</TextInput.Hint>
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextInput orientation='vertical' alignItems='stretch'>
12
+ <TextInput orientation="vertical" alignItems="stretch">
13
13
  <TextInput.Label>Street Address</TextInput.Label>
14
14
  <TextInput.Field onChange={handleChange} value={value} />
15
15
  </TextInput>
@@ -1,8 +1,10 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/core'
3
1
  import React from 'react';
4
2
  import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
5
- import { accessibleHide } from '@workday/canvas-kit-react/common';
3
+ import {accessibleHide, styled} from '@workday/canvas-kit-react/common';
4
+
5
+ const StyledTextAreaLabel = styled(TextInput.Label)({
6
+ ...accessibleHide,
7
+ });
6
8
 
7
9
  export default () => {
8
10
  const [value, setValue] = React.useState('');
@@ -12,8 +14,8 @@ export default () => {
12
14
  };
13
15
 
14
16
  return (
15
- <TextInput orientation='vertical' spacing='zero'>
16
- <TextInput.Label css={{...accessibleHide}}>Email</TextInput.Label>
17
+ <TextInput orientation="vertical" spacing="zero">
18
+ <StyledTextAreaLabel>Email</StyledTextAreaLabel>
17
19
  <TextInput.Field onChange={handleChange} value={value} />
18
20
  </TextInput>
19
21
  );
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextInput orientation='horizontal'>
12
+ <TextInput orientation="horizontal">
13
13
  <TextInput.Label>Email</TextInput.Label>
14
14
  <TextInput.Field onChange={handleChange} value={value} />
15
15
  </TextInput>
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextInput orientation='vertical' spacing='xxxs'>
12
+ <TextInput orientation="vertical" spacing="xxxs">
13
13
  <TextInput.Label>Email</TextInput.Label>
14
14
  <TextInput.Field onChange={handleChange} value={value} />
15
15
  </TextInput>
@@ -48,9 +48,9 @@ export default () => {
48
48
 
49
49
  return (
50
50
  <form onSubmit={formik.handleSubmit} action=".">
51
- <VStack spacing='xs' alignItems='flex-start'>
51
+ <VStack spacing="xs" alignItems="flex-start">
52
52
  <TextInput
53
- orientation='vertical'
53
+ orientation="vertical"
54
54
  isRequired={true}
55
55
  hasError={formik.touched.email && !!formik.errors.email}
56
56
  >
@@ -66,7 +66,7 @@ export default () => {
66
66
  <TextInput.Hint>{formik.touched.email && formik.errors.email}</TextInput.Hint>
67
67
  </TextInput>
68
68
  <TextInput
69
- orientation='vertical'
69
+ orientation="vertical"
70
70
  id={passwordId}
71
71
  hasError={formik.touched.password && !!formik.errors.password}
72
72
  isRequired={true}
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextInput orientation='vertical'>
12
+ <TextInput orientation="vertical">
13
13
  <TextInput.Label>Password</TextInput.Label>
14
14
  <TextInput.Field onChange={handleChange} value={value} type="password" />
15
15
  </TextInput>
@@ -9,7 +9,7 @@ export default () => {
9
9
  };
10
10
 
11
11
  return (
12
- <TextInput orientation='vertical'>
12
+ <TextInput orientation="vertical">
13
13
  <TextInput.Label>Email</TextInput.Label>
14
14
  <TextInput.Field onChange={handleChange} value={value} placeholder="user@email.com" />
15
15
  </TextInput>