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

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 (54) hide show
  1. package/dist/commonjs/index.js +13 -6
  2. package/dist/commonjs/lib/Specifications.d.ts.map +1 -1
  3. package/dist/commonjs/lib/Specifications.js +3 -1
  4. package/dist/commonjs/lib/docs.js +1 -0
  5. package/dist/es6/lib/Specifications.d.ts.map +1 -1
  6. package/dist/mdx/7.0-MIGRATION-GUIDE.mdx +90 -1
  7. package/dist/mdx/preview-react/form-field/examples/Custom.tsx +1 -1
  8. package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +16 -22
  9. package/dist/mdx/preview-react/side-panel/examples/Basic.tsx +8 -13
  10. package/dist/mdx/preview-react/side-panel/examples/ExternalControl.tsx +8 -12
  11. package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +15 -22
  12. package/dist/mdx/preview-react/side-panel/examples/Variant.tsx +8 -13
  13. package/dist/mdx/preview-react/text-area/examples/Alert.tsx +9 -3
  14. package/dist/mdx/preview-react/text-area/examples/Basic.tsx +1 -1
  15. package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +1 -1
  16. package/dist/mdx/preview-react/text-area/examples/Error.tsx +1 -1
  17. package/dist/mdx/preview-react/text-area/examples/Grow.tsx +1 -1
  18. package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +7 -5
  19. package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +1 -1
  20. package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +1 -1
  21. package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +2 -6
  22. package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +3 -3
  23. package/dist/mdx/preview-react/text-area/examples/Required.tsx +1 -1
  24. package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +1 -1
  25. package/dist/mdx/preview-react/text-input/examples/Alert.tsx +4 -8
  26. package/dist/mdx/preview-react/text-input/examples/Basic.tsx +1 -1
  27. package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +1 -1
  28. package/dist/mdx/preview-react/text-input/examples/Error.tsx +1 -1
  29. package/dist/mdx/preview-react/text-input/examples/Grow.tsx +1 -1
  30. package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +7 -5
  31. package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +1 -1
  32. package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +1 -1
  33. package/dist/mdx/preview-react/text-input/examples/LoginForm.tsx +3 -3
  34. package/dist/mdx/preview-react/text-input/examples/Password.tsx +1 -1
  35. package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +1 -1
  36. package/dist/mdx/preview-react/text-input/examples/RefForwarding.tsx +3 -3
  37. package/dist/mdx/preview-react/text-input/examples/Required.tsx +1 -1
  38. package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +3 -2
  39. package/dist/mdx/preview-react/text-input/examples/ThemedError.tsx +2 -4
  40. package/dist/mdx/react/_examples/examples/PageHeader.tsx +1 -1
  41. package/dist/mdx/react/banner/examples/Sticky.tsx +6 -9
  42. package/dist/mdx/react/banner/examples/StickyAnimation.tsx +2 -1
  43. package/dist/mdx/react/banner/examples/StickyRTL.tsx +8 -10
  44. package/dist/mdx/react/button/icon-button/examples/Inverse.tsx +9 -12
  45. package/dist/mdx/react/button/icon-button/examples/InverseFilled.tsx +9 -12
  46. package/dist/mdx/react/modal/Modal.mdx +21 -0
  47. package/dist/mdx/react/modal/examples/Basic.tsx +4 -2
  48. package/dist/mdx/react/modal/examples/BodyOverflow.tsx +56 -0
  49. package/dist/mdx/react/modal/examples/CustomFocus.tsx +5 -2
  50. package/dist/mdx/react/modal/examples/FullOverflow.tsx +55 -0
  51. package/dist/mdx/react/modal/examples/ReturnFocus.tsx +4 -1
  52. package/dist/mdx/react/modal/examples/WithoutCloseIcon.tsx +5 -2
  53. package/dist/mdx/react/skeleton/examples/Simulation.tsx +10 -9
  54. package/package.json +3 -3
@@ -1,8 +1,15 @@
1
1
  "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
5
12
  Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./lib/specs"));
7
- __export(require("./lib/Specifications"));
8
- __export(require("./lib/docs"));
13
+ __exportStar(require("./lib/specs"), exports);
14
+ __exportStar(require("./lib/Specifications"), exports);
15
+ __exportStar(require("./lib/docs"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"Specifications.d.ts","sourceRoot":"","sources":["../../../lib/Specifications.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA8CD,eAAO,MAAM,cAAc,6DAmF1B,CAAC"}
1
+ {"version":3,"file":"Specifications.d.ts","sourceRoot":"","sources":["../../../lib/Specifications.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA8CD,eAAO,MAAM,cAAc,mBAAkB,mBAAmB,uBAmF/D,CAAC"}
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Specifications = void 0;
17
18
  /* eslint-disable no-param-reassign */
18
19
  var react_1 = __importDefault(require("react"));
19
20
  var csf_1 = require("@storybook/csf");
@@ -43,7 +44,7 @@ function createTableRows(rows, item, index, children, context) {
43
44
  }
44
45
  return rows;
45
46
  }
46
- exports.Specifications = function (_a) {
47
+ var Specifications = function (_a) {
47
48
  var file = _a.file, name = _a.name;
48
49
  var storybookBaseUrl = react_1.default.useContext(docs_1.StorybookUrl);
49
50
  var githubUrl = react_1.default.useContext(docs_1.GithubUrl);
@@ -87,3 +88,4 @@ exports.Specifications = function (_a) {
87
88
  ' ',
88
89
  react_1.default.createElement(button_1.Hyperlink, { href: githubUrl + "blob/" + githubBranch + "/cypress/integration/" + file }, file))) : null;
89
90
  };
91
+ exports.Specifications = Specifications;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.StorybookUrl = exports.GithubBranch = exports.GithubUrl = void 0;
6
7
  var react_1 = __importDefault(require("react"));
7
8
  exports.GithubUrl = react_1.default.createContext('https://github.com/Workday/canvas-kit/');
8
9
  exports.GithubBranch = react_1.default.createContext('master');
@@ -1 +1 @@
1
- {"version":3,"file":"Specifications.d.ts","sourceRoot":"","sources":["../../../lib/Specifications.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA8CD,eAAO,MAAM,cAAc,6DAmF1B,CAAC"}
1
+ {"version":3,"file":"Specifications.d.ts","sourceRoot":"","sources":["../../../lib/Specifications.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA8CD,eAAO,MAAM,cAAc,mBAAkB,mBAAmB,uBAmF/D,CAAC"}
@@ -5,8 +5,10 @@ Below are the breaking changes made in Canvas Kit v7. Please
5
5
  any questions about the update.
6
6
 
7
7
  - [Codemod](#codemod)
8
+ - [Component Deprecations](#component-deprecations)
8
9
  - [ActionBar Component Updates](#actionbar-component-updates)
9
10
  - [Status Indicator Width](#status-indicator-width)
11
+ - [Popup Cards](popup-cards)
10
12
 
11
13
  ## Codemod
12
14
 
@@ -34,6 +36,45 @@ rollback more easily if necessary.**
34
36
  encounter any issues or use cases that we've missed. The `@workday/canvas-kit-codemod` package will
35
37
  help us maintain additional codemod transforms to make future migrations easier.
36
38
 
39
+ ## Component Deprecations
40
+
41
+ ### Deprecation Types
42
+
43
+ There are two types of deprecations: soft and hard.
44
+
45
+ #### Soft Deprecation
46
+
47
+ A soft-deprecated component is still available with its full functionality, but it will have been
48
+ renamed with a prefix to indicate its soft-deprecated status. It will also include a console warning
49
+ to announce its deprecation. This warning will only be triggered on the component's initial render.
50
+
51
+ Soft-deprecated types and utilities will also be renamed but generally will not trigger a console
52
+ warning.
53
+
54
+ #### Hard Deprecation
55
+
56
+ A hard-deprecated component or package is no longer available. You will need to follow the method
57
+ prescribed in our migration guide to update your application. Please reach out to our team directly
58
+ if you need additional help.
59
+
60
+ ### Cookie Banner
61
+
62
+ We are [hard deprecating](#hard-deprecation) `CookieBanner`. If you would like to migrate away from
63
+ this deprecated component now, you can reference
64
+ [this example](https://workday.github.io/canvas-kit/?path=/story/examples-cookiebanner-react--basic)
65
+
66
+ ### Page Header
67
+
68
+ We are [hard deprecating](#hard-deprecation) `Page Header`. If you would like to migrate away from
69
+ this deprecated component now, you can reference
70
+ [this example](https://workday.github.io/canvas-kit/?path=/story/examples-pageheader-react--basic)
71
+
72
+ ### Header / GlobalHeader
73
+
74
+ We are [hard deprecating](#hard-deprecation) `Header`. If you would like to migrate away from this
75
+ deprecated component now, you can reference
76
+ [this example](https://workday.github.io/canvas-kit/?path=/story/examples-globalheader-react--basic)
77
+
37
78
  ## ActionBar Component Updates
38
79
 
39
80
  We've refactored our ActionBar components to simplify logic.
@@ -58,4 +99,52 @@ word.
58
99
 
59
100
  ```tsx
60
101
  <StatusIndicator label="Slightly Longer Status" type={StatusIndicator.Type.Gray} maxWidth={250} />
61
- ```
102
+ ```
103
+
104
+ ## Popup Cards
105
+
106
+ `Popup.Card` (this includes `Modal.Card` and `Dialog.Card`) components are now a flexbox container.
107
+ This was done to support overflowing content (by default, the `Popup.Body` component). The idea is
108
+ the card is a vertical flexbox container and the `Popup.Heading`, `Popup.Body`, and any other
109
+ children are flex items. The `Popup.Body` now has an `overflow-y: auto` on it to naturally allow the
110
+ body content to overflow in a scroll container. This is a breaking change if your `Popup`, `Modal`,
111
+ or `Dialog` doesn't work with a flexbox with `flex-direction: column`. In most cases, this shouldn't
112
+ matter. If this change does cause your popup to display correctly, you may need to play around with
113
+ flex item containers.
114
+
115
+ An example where this might break:
116
+
117
+ A common Modal has a heading, body, and footer (Cancel/Submit buttons). If the Cancel and Submit
118
+ buttons are direct children of the `Modal.Card` like the following:
119
+
120
+ ```tsx
121
+ <Modal.Card>
122
+ <Modal.Heading>Some Heading</Modal.Heading>
123
+ <Modal.Body>Some Body</Modal.Body>
124
+ <SecondaryButton>Cancel</SecondaryButton>
125
+ <PrimaryButton>Submit</PrimaryButton>
126
+ </Modal.Card>
127
+ ```
128
+
129
+ The buttons will become vertical flex items instead of the default which is displaying inline-block.
130
+ Before, the buttons would layout next to each other horizontally. After, the buttons will stack
131
+ vertically. To fix this, you'll have to add another element to be a flex item from the `Modal.Card`.
132
+ Our examples use `HStack` to align the buttons. The following will render correctly after this
133
+ change:
134
+
135
+ ```tsx
136
+ <Modal.Card>
137
+ <Modal.Heading>Some Heading</Modal.Heading>
138
+ <Modal.Body>Some Body</Modal.Body>
139
+ <HStack spacing="s">
140
+ <SecondaryButton>Cancel</SecondaryButton>
141
+ <PrimaryButton>Submit</PrimaryButton>
142
+ </HStack>
143
+ </Modal.Card>
144
+ ```
145
+
146
+ If your code contains any hacks to make a `Modal` overflow, these hacks should now be removed.
147
+ [This example shows how body content overflows](https://workday.github.io/canvas-kit/?path=/docs/components-popups-modal-react--body-overflow)
148
+ (you may have to limit your browser height to see the overflow). Before you had to manually set the
149
+ `max-height` of the `Modal.Body` element using calculations. These should be removed. The
150
+ `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>