@workday/canvas-kit-docs 9.0.0-alpha.368-next.6 → 9.0.0-alpha.382-next.2

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 (57) hide show
  1. package/dist/es6/docgen/createTraversals.js +41 -22
  2. package/dist/es6/docgen/docParser.js +285 -257
  3. package/dist/es6/docgen/getExternalSymbol.js +2 -2
  4. package/dist/es6/docgen/plugins/componentParser.js +28 -33
  5. package/dist/es6/docgen/plugins/enhancedComponentParser.js +211 -150
  6. package/dist/es6/docgen/plugins/modelParser.js +139 -79
  7. package/dist/es6/docgen/traversals.js +396 -397
  8. package/dist/es6/docgen/traverse.js +8 -9
  9. package/dist/es6/lib/DescriptionTooltip.js +1 -1
  10. package/dist/es6/lib/MDXElements.js +13 -39
  11. package/dist/es6/lib/MoreTooltip.js +21 -41
  12. package/dist/es6/lib/Specifications.js +30 -34
  13. package/dist/es6/lib/StylePropsTable.js +8 -9
  14. package/dist/es6/lib/Table.js +19 -30
  15. package/dist/es6/lib/Value.js +13 -17
  16. package/dist/es6/lib/docs.js +701 -397
  17. package/dist/es6/lib/widgetUtils.js +44 -76
  18. package/dist/es6/lib/widgets/array.js +1 -2
  19. package/dist/es6/lib/widgets/callExpression.js +4 -5
  20. package/dist/es6/lib/widgets/canvasColor.js +2 -2
  21. package/dist/es6/lib/widgets/component.js +1 -2
  22. package/dist/es6/lib/widgets/conditional.js +1 -2
  23. package/dist/es6/lib/widgets/enhancedComponent.js +19 -24
  24. package/dist/es6/lib/widgets/external.js +1 -4
  25. package/dist/es6/lib/widgets/function.js +5 -7
  26. package/dist/es6/lib/widgets/intersection.js +3 -4
  27. package/dist/es6/lib/widgets/model.js +4 -6
  28. package/dist/es6/lib/widgets/object.js +2 -3
  29. package/dist/es6/lib/widgets/parenthesis.js +1 -2
  30. package/dist/es6/lib/widgets/primitives.js +17 -39
  31. package/dist/es6/lib/widgets/qualifiedName.js +1 -2
  32. package/dist/es6/lib/widgets/symbol.js +1 -2
  33. package/dist/es6/lib/widgets/tuple.js +2 -3
  34. package/dist/es6/lib/widgets/typeParameter.js +1 -2
  35. package/dist/es6/lib/widgets/union.js +3 -4
  36. package/dist/es6/mdx/installBlock.js +6 -7
  37. package/dist/es6/mdx/style-props/examples/Background.js +5 -16
  38. package/dist/es6/mdx/style-props/examples/Border.js +5 -16
  39. package/dist/es6/mdx/style-props/examples/Color.js +5 -16
  40. package/dist/es6/mdx/style-props/examples/Depth.js +5 -16
  41. package/dist/es6/mdx/style-props/examples/Flex.js +11 -22
  42. package/dist/es6/mdx/style-props/examples/FlexItem.js +10 -21
  43. package/dist/es6/mdx/style-props/examples/Grid.js +6 -17
  44. package/dist/es6/mdx/style-props/examples/GridItem.js +6 -17
  45. package/dist/es6/mdx/style-props/examples/Layout.js +5 -16
  46. package/dist/es6/mdx/style-props/examples/Other.js +5 -16
  47. package/dist/es6/mdx/style-props/examples/Position.js +5 -16
  48. package/dist/es6/mdx/style-props/examples/Space.js +6 -17
  49. package/dist/es6/mdx/style-props/examples/Text.js +2 -2
  50. package/dist/es6/mdx/welcomePage.js +3 -3
  51. package/dist/mdx/9.0-UPGRADE-GUIDE.mdx +30 -3
  52. package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -1
  53. package/dist/mdx/preview-react/text-input/examples/Alert.tsx +1 -1
  54. package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +5 -2
  55. package/dist/mdx/react/banner/examples/StickyAnimation.tsx +7 -5
  56. package/dist/mdx/react/common/examples/ResponsiveViewport.tsx +2 -3
  57. package/package.json +5 -5
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { registerWidget, Value } from '../Value';
3
- registerWidget('typeParameter', function (_a) {
4
- var value = _a.value;
3
+ registerWidget('typeParameter', ({ value }) => {
5
4
  return (React.createElement(React.Fragment, null,
6
5
  React.createElement("span", { className: "token symbol" }, value.name),
7
6
  value.constraint && (React.createElement(React.Fragment, null,
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import { registerWidget, Value } from '../Value';
3
3
  import { IndentLevelContext, RenderContext, indent } from '../widgetUtils';
4
- registerWidget('union', function (_a) {
5
- var value = _a.value;
6
- var level = React.useContext(IndentLevelContext);
7
- return (React.createElement(RenderContext.Provider, { value: "inline" }, value.value.map(function (v, index) {
4
+ registerWidget('union', ({ value }) => {
5
+ const level = React.useContext(IndentLevelContext);
6
+ return (React.createElement(RenderContext.Provider, { value: "inline" }, value.value.map((v, index) => {
8
7
  return (React.createElement(React.Fragment, { key: index },
9
8
  ' ',
10
9
  value.value.length > 3 && (React.createElement(React.Fragment, null,
@@ -2,14 +2,13 @@ import React from 'react';
2
2
  import { Flex } from '@workday/canvas-kit-react/layout';
3
3
  import { colors } from '@workday/canvas-kit-react/tokens';
4
4
  import { PrimaryButton } from '@workday/canvas-kit-react/button';
5
- export var InstallBlock = function (_a) {
6
- var command = _a.command, packageName = _a.packageName;
7
- var commandRef = React.useRef(null);
8
- var _b = React.useState(false), copied = _b[0], setCopied = _b[1];
9
- React.useEffect(function () {
10
- setTimeout(function () { return setCopied(false); }, 600);
5
+ export const InstallBlock = ({ command, packageName }) => {
6
+ const commandRef = React.useRef(null);
7
+ const [copied, setCopied] = React.useState(false);
8
+ React.useEffect(() => {
9
+ setTimeout(() => setCopied(false), 600);
11
10
  }, [copied]);
12
- var handleCopy = function () {
11
+ const handleCopy = () => {
13
12
  setCopied(true);
14
13
  if (commandRef.current) {
15
14
  navigator.clipboard.writeText(commandRef.current.innerText);
@@ -1,17 +1,6 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Box } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  color: 'blackPepper500',
16
5
  display: 'inline-block',
17
6
  margin: 'xxs',
@@ -19,7 +8,7 @@ var baseStyles = {
19
8
  minWidth: '8rem',
20
9
  padding: 'xs',
21
10
  };
22
- export var BackgroundExample = function () { return (React.createElement(React.Fragment, null,
23
- React.createElement(Box, __assign({ backgroundColor: "cinnamon300" }, baseStyles), "Cinnamon 300"),
24
- React.createElement(Box, __assign({ backgroundColor: "sourLemon300" }, baseStyles), "Sour Lemon 300"),
25
- React.createElement(Box, __assign({ backgroundColor: "blueberry300" }, baseStyles), "Blueberry 300"))); };
11
+ export const BackgroundExample = () => (React.createElement(React.Fragment, null,
12
+ React.createElement(Box, Object.assign({ backgroundColor: "cinnamon300" }, baseStyles), "Cinnamon 300"),
13
+ React.createElement(Box, Object.assign({ backgroundColor: "sourLemon300" }, baseStyles), "Sour Lemon 300"),
14
+ React.createElement(Box, Object.assign({ backgroundColor: "blueberry300" }, baseStyles), "Blueberry 300")));
@@ -1,17 +1,6 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Box } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  color: 'blackPepper300',
16
5
  display: 'inline-block',
17
6
  margin: 'xxs',
@@ -19,7 +8,7 @@ var baseStyles = {
19
8
  minWidth: '8rem',
20
9
  padding: 'xs',
21
10
  };
22
- export var BorderExample = function () { return (React.createElement(React.Fragment, null,
23
- React.createElement(Box, __assign({ borderRadius: "m", border: "solid 4px", borderColor: "cinnamon300" }, baseStyles), "Cinnamon 300"),
24
- React.createElement(Box, __assign({ borderRadius: "m", border: "solid 4px", borderColor: "sourLemon300" }, baseStyles), "Sour Lemon 300"),
25
- React.createElement(Box, __assign({ borderRadius: "m", border: "solid 4px", borderColor: "blueberry300" }, baseStyles), "Blueberry 300"))); };
11
+ export const BorderExample = () => (React.createElement(React.Fragment, null,
12
+ React.createElement(Box, Object.assign({ borderRadius: "m", border: "solid 4px", borderColor: "cinnamon300" }, baseStyles), "Cinnamon 300"),
13
+ React.createElement(Box, Object.assign({ borderRadius: "m", border: "solid 4px", borderColor: "sourLemon300" }, baseStyles), "Sour Lemon 300"),
14
+ React.createElement(Box, Object.assign({ borderRadius: "m", border: "solid 4px", borderColor: "blueberry300" }, baseStyles), "Blueberry 300")));
@@ -1,24 +1,13 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Box } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  display: 'inline-block',
16
5
  margin: 'xxs',
17
6
  minHeight: 'xl',
18
7
  minWidth: '8rem',
19
8
  padding: 'xs',
20
9
  };
21
- export var ColorExample = function () { return (React.createElement(React.Fragment, null,
22
- React.createElement(Box, __assign({ backgroundColor: "cinnamon300", color: "blackPepper500" }, baseStyles), "Cinnamon 300"),
23
- React.createElement(Box, __assign({ backgroundColor: "sourLemon300", color: "blackPepper500" }, baseStyles), "Sour Lemon 300"),
24
- React.createElement(Box, __assign({ backgroundColor: "blueberry300", color: "blackPepper500" }, baseStyles), "Blueberry 300"))); };
10
+ export const ColorExample = () => (React.createElement(React.Fragment, null,
11
+ React.createElement(Box, Object.assign({ backgroundColor: "cinnamon300", color: "blackPepper500" }, baseStyles), "Cinnamon 300"),
12
+ React.createElement(Box, Object.assign({ backgroundColor: "sourLemon300", color: "blackPepper500" }, baseStyles), "Sour Lemon 300"),
13
+ React.createElement(Box, Object.assign({ backgroundColor: "blueberry300", color: "blackPepper500" }, baseStyles), "Blueberry 300")));
@@ -1,17 +1,6 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Box } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  color: 'blackPepper500',
16
5
  display: 'inline-block',
17
6
  margin: 'xxs',
@@ -19,7 +8,7 @@ var baseStyles = {
19
8
  minWidth: '8rem',
20
9
  padding: 'xs',
21
10
  };
22
- export var DepthExample = function () { return (React.createElement(React.Fragment, null,
23
- React.createElement(Box, __assign({ backgroundColor: "cinnamon300", depth: 1 }, baseStyles), "Depth 1"),
24
- React.createElement(Box, __assign({ backgroundColor: "sourLemon300", depth: 2 }, baseStyles), "Depth 2"),
25
- React.createElement(Box, __assign({ backgroundColor: "blueberry300", depth: 3 }, baseStyles), "Depth 3"))); };
11
+ export const DepthExample = () => (React.createElement(React.Fragment, null,
12
+ React.createElement(Box, Object.assign({ backgroundColor: "cinnamon300", depth: 1 }, baseStyles), "Depth 1"),
13
+ React.createElement(Box, Object.assign({ backgroundColor: "sourLemon300", depth: 2 }, baseStyles), "Depth 2"),
14
+ React.createElement(Box, Object.assign({ backgroundColor: "blueberry300", depth: 3 }, baseStyles), "Depth 3")));
@@ -1,32 +1,21 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Flex } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  color: 'blackPepper500',
16
5
  minHeight: 'xl',
17
6
  minWidth: '2rem',
18
7
  padding: 'xs',
19
8
  };
20
- export var FlexExample = function () { return (React.createElement(Flex, { columnGap: "xs" },
9
+ export const FlexExample = () => (React.createElement(Flex, { columnGap: "xs" },
21
10
  React.createElement(Flex, { flexDirection: "column", rowGap: "xs", flex: 1 },
22
- React.createElement(Flex.Item, __assign({ backgroundColor: "cinnamon300", textAlign: "center" }, baseStyles), "1"),
23
- React.createElement(Flex.Item, __assign({ backgroundColor: "sourLemon300", textAlign: "center" }, baseStyles), "1"),
24
- React.createElement(Flex.Item, __assign({ backgroundColor: "blueberry300", textAlign: "center" }, baseStyles), "1")),
11
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "cinnamon300", textAlign: "center" }, baseStyles), "1"),
12
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "sourLemon300", textAlign: "center" }, baseStyles), "1"),
13
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "blueberry300", textAlign: "center" }, baseStyles), "1")),
25
14
  React.createElement(Flex, { flexDirection: "column", rowGap: "xs", flex: 2 },
26
- React.createElement(Flex.Item, __assign({ backgroundColor: "cinnamon300", textAlign: "center" }, baseStyles), "2"),
27
- React.createElement(Flex.Item, __assign({ backgroundColor: "sourLemon300", textAlign: "center" }, baseStyles), "2"),
28
- React.createElement(Flex.Item, __assign({ backgroundColor: "blueberry300", textAlign: "center" }, baseStyles), "2")),
15
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "cinnamon300", textAlign: "center" }, baseStyles), "2"),
16
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "sourLemon300", textAlign: "center" }, baseStyles), "2"),
17
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "blueberry300", textAlign: "center" }, baseStyles), "2")),
29
18
  React.createElement(Flex, { flexDirection: "column", rowGap: "xs", flex: 1 },
30
- React.createElement(Flex.Item, __assign({ backgroundColor: "cinnamon300", textAlign: "center" }, baseStyles), "1"),
31
- React.createElement(Flex.Item, __assign({ backgroundColor: "sourLemon300", textAlign: "center" }, baseStyles), "1"),
32
- React.createElement(Flex.Item, __assign({ backgroundColor: "blueberry300", textAlign: "center" }, baseStyles), "1")))); };
19
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "cinnamon300", textAlign: "center" }, baseStyles), "1"),
20
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "sourLemon300", textAlign: "center" }, baseStyles), "1"),
21
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "blueberry300", textAlign: "center" }, baseStyles), "1"))));
@@ -1,31 +1,20 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Flex } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  color: 'blackPepper500',
16
5
  minHeight: 'xl',
17
6
  minWidth: '2rem',
18
7
  padding: 'xs',
19
8
  };
20
- export var FlexItemExample = function () { return (React.createElement(Flex, { flexDirection: "column", rowGap: "xs" },
9
+ export const FlexItemExample = () => (React.createElement(Flex, { flexDirection: "column", rowGap: "xs" },
21
10
  React.createElement(Flex, { columnGap: "xs" },
22
- React.createElement(Flex.Item, __assign({ backgroundColor: "cinnamon300", flex: 1, textAlign: "center" }, baseStyles), "1"),
23
- React.createElement(Flex.Item, __assign({ backgroundColor: "sourLemon300", flex: 2, textAlign: "center" }, baseStyles), "2"),
24
- React.createElement(Flex.Item, __assign({ backgroundColor: "blueberry300", flex: 1, textAlign: "center" }, baseStyles), "1")),
11
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "cinnamon300", flex: 1, textAlign: "center" }, baseStyles), "1"),
12
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "sourLemon300", flex: 2, textAlign: "center" }, baseStyles), "2"),
13
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "blueberry300", flex: 1, textAlign: "center" }, baseStyles), "1")),
25
14
  React.createElement(Flex, { columnGap: "xs" },
26
- React.createElement(Flex.Item, __assign({ backgroundColor: "cinnamon300", flex: 2, textAlign: "center" }, baseStyles), "2"),
27
- React.createElement(Flex.Item, __assign({ backgroundColor: "sourLemon300", flex: 1, textAlign: "center" }, baseStyles), "1"),
28
- React.createElement(Flex.Item, __assign({ backgroundColor: "blueberry300", flex: 2, textAlign: "center" }, baseStyles), "2")),
15
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "cinnamon300", flex: 2, textAlign: "center" }, baseStyles), "2"),
16
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "sourLemon300", flex: 1, textAlign: "center" }, baseStyles), "1"),
17
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "blueberry300", flex: 2, textAlign: "center" }, baseStyles), "2")),
29
18
  React.createElement(Flex, { columnGap: "xs" },
30
- React.createElement(Flex.Item, __assign({ backgroundColor: "cinnamon300", flex: 1, textAlign: "center" }, baseStyles), "1"),
31
- React.createElement(Flex.Item, __assign({ backgroundColor: "blueberry300", flex: 1, textAlign: "center" }, baseStyles), "1")))); };
19
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "cinnamon300", flex: 1, textAlign: "center" }, baseStyles), "1"),
20
+ React.createElement(Flex.Item, Object.assign({ backgroundColor: "blueberry300", flex: 1, textAlign: "center" }, baseStyles), "1"))));
@@ -1,22 +1,11 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Grid } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  color: 'blackPepper500',
16
5
  padding: 'xs',
17
6
  };
18
- export var GridExample = function () { return (React.createElement(Grid, { gridGap: "xs", gridTemplateAreas: "'head head' 'nav main' 'nav foot'", gridTemplateColumns: "1fr 3fr", gridTemplateRows: "2.5rem minmax(10rem, auto) 2.5rem" },
19
- React.createElement(Grid.Item, __assign({ gridArea: "head", backgroundColor: "cinnamon300" }, baseStyles)),
20
- React.createElement(Grid.Item, __assign({ gridArea: "nav", backgroundColor: "sourLemon300" }, baseStyles)),
21
- React.createElement(Grid.Item, __assign({ gridArea: "main", backgroundColor: "blueberry300" }, baseStyles)),
22
- React.createElement(Grid.Item, __assign({ gridArea: "foot", backgroundColor: "cinnamon300" }, baseStyles)))); };
7
+ export const GridExample = () => (React.createElement(Grid, { gridGap: "xs", gridTemplateAreas: "'head head' 'nav main' 'nav foot'", gridTemplateColumns: "1fr 3fr", gridTemplateRows: "2.5rem minmax(10rem, auto) 2.5rem" },
8
+ React.createElement(Grid.Item, Object.assign({ gridArea: "head", backgroundColor: "cinnamon300" }, baseStyles)),
9
+ React.createElement(Grid.Item, Object.assign({ gridArea: "nav", backgroundColor: "sourLemon300" }, baseStyles)),
10
+ React.createElement(Grid.Item, Object.assign({ gridArea: "main", backgroundColor: "blueberry300" }, baseStyles)),
11
+ React.createElement(Grid.Item, Object.assign({ gridArea: "foot", backgroundColor: "cinnamon300" }, baseStyles))));
@@ -1,22 +1,11 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Grid } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  color: 'blackPepper500',
16
5
  padding: 'xs',
17
6
  };
18
- export var GridItemExample = function () { return (React.createElement(Grid, { gridGap: "xs", gridTemplateColumns: "1fr 3fr", gridTemplateRows: "2.5rem minmax(10rem, auto) 2.5rem" },
19
- React.createElement(Grid.Item, __assign({ gridColumn: "1 / 3", gridRow: "1", backgroundColor: "cinnamon300" }, baseStyles)),
20
- React.createElement(Grid.Item, __assign({ gridColumn: "1", gridRow: "2 / 4", backgroundColor: "sourLemon300" }, baseStyles)),
21
- React.createElement(Grid.Item, __assign({ gridColumn: "2", gridRow: "2", backgroundColor: "blueberry300" }, baseStyles)),
22
- React.createElement(Grid.Item, __assign({ gridColumn: "2", gridRow: "3", backgroundColor: "cinnamon300" }, baseStyles)))); };
7
+ export const GridItemExample = () => (React.createElement(Grid, { gridGap: "xs", gridTemplateColumns: "1fr 3fr", gridTemplateRows: "2.5rem minmax(10rem, auto) 2.5rem" },
8
+ React.createElement(Grid.Item, Object.assign({ gridColumn: "1 / 3", gridRow: "1", backgroundColor: "cinnamon300" }, baseStyles)),
9
+ React.createElement(Grid.Item, Object.assign({ gridColumn: "1", gridRow: "2 / 4", backgroundColor: "sourLemon300" }, baseStyles)),
10
+ React.createElement(Grid.Item, Object.assign({ gridColumn: "2", gridRow: "2", backgroundColor: "blueberry300" }, baseStyles)),
11
+ React.createElement(Grid.Item, Object.assign({ gridColumn: "2", gridRow: "3", backgroundColor: "cinnamon300" }, baseStyles))));
@@ -1,24 +1,13 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Flex } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  color: 'blackPepper500',
16
5
  margin: 'xxs',
17
6
  padding: 'xs',
18
7
  justifyContent: 'center',
19
8
  alignItems: 'flex-start',
20
9
  };
21
- export var LayoutExample = function () { return (React.createElement(Flex, { alignItems: "flex-end" },
22
- React.createElement(Flex, __assign({ backgroundColor: "cinnamon300", display: "inline-flex", height: "xl", width: "xxxl" }, baseStyles), "40 x 80"),
23
- React.createElement(Flex, __assign({ backgroundColor: "sourLemon300", display: "inline-flex", height: "xxl", width: "xxxl" }, baseStyles), "64 x 80"),
24
- React.createElement(Flex, __assign({ backgroundColor: "blueberry300", display: "inline-flex", height: "xxxl", width: "xxxl" }, baseStyles), "80 x 80"))); };
10
+ export const LayoutExample = () => (React.createElement(Flex, { alignItems: "flex-end" },
11
+ React.createElement(Flex, Object.assign({ backgroundColor: "cinnamon300", display: "inline-flex", height: "xl", width: "xxxl" }, baseStyles), "40 x 80"),
12
+ React.createElement(Flex, Object.assign({ backgroundColor: "sourLemon300", display: "inline-flex", height: "xxl", width: "xxxl" }, baseStyles), "64 x 80"),
13
+ React.createElement(Flex, Object.assign({ backgroundColor: "blueberry300", display: "inline-flex", height: "xxxl", width: "xxxl" }, baseStyles), "80 x 80")));
@@ -1,25 +1,14 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Box } from '@workday/canvas-kit-react/layout';
14
3
  import { colors } from '@workday/canvas-kit-react/tokens';
15
- var baseStyles = {
4
+ const baseStyles = {
16
5
  color: 'blackPepper500',
17
6
  display: 'inline-block',
18
7
  margin: 'xxs',
19
8
  minHeight: 'xl',
20
9
  padding: 'xs',
21
10
  };
22
- export var OtherExample = function () { return (React.createElement(Box, null,
23
- React.createElement(Box, __assign({ backgroundColor: "cinnamon300", cursor: "grab", outline: "2px dashed " + colors.cinnamon300, outlineOffset: "2px" }, baseStyles), "Cursor Grab"),
24
- React.createElement(Box, __assign({ backgroundColor: "sourLemon300", cursor: "text", outline: "2px dashed " + colors.sourLemon300, outlineOffset: "2px" }, baseStyles), "Cursor Text"),
25
- React.createElement(Box, __assign({ backgroundColor: "blueberry300", cursor: "wait", outline: "2px dashed " + colors.blueberry300, outlineOffset: "2px" }, baseStyles), "Cursor Wait"))); };
11
+ export const OtherExample = () => (React.createElement(Box, null,
12
+ React.createElement(Box, Object.assign({ backgroundColor: "cinnamon300", cursor: "grab", outline: `2px dashed ${colors.cinnamon300}`, outlineOffset: "2px" }, baseStyles), "Cursor Grab"),
13
+ React.createElement(Box, Object.assign({ backgroundColor: "sourLemon300", cursor: "text", outline: `2px dashed ${colors.sourLemon300}`, outlineOffset: "2px" }, baseStyles), "Cursor Text"),
14
+ React.createElement(Box, Object.assign({ backgroundColor: "blueberry300", cursor: "wait", outline: `2px dashed ${colors.blueberry300}`, outlineOffset: "2px" }, baseStyles), "Cursor Wait")));
@@ -1,26 +1,15 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Box } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  color: 'blackPepper500',
16
5
  margin: 'xxs',
17
6
  height: 'xl',
18
7
  width: '8rem',
19
8
  padding: 'xs',
20
9
  };
21
- export var PositionExample = function () {
10
+ export const PositionExample = () => {
22
11
  return (React.createElement(React.Fragment, null,
23
- React.createElement(Box, __assign({ backgroundColor: "cinnamon300", left: 0, position: "absolute", top: "calc(50% - 20px)", zIndex: 1, textAlign: "center" }, baseStyles), "Left"),
24
- React.createElement(Box, __assign({ backgroundColor: "sourLemon300", left: "calc(50% - 4rem)", position: "absolute", top: "calc(50% - 20px)", zIndex: 2, textAlign: "center" }, baseStyles), "Center"),
25
- React.createElement(Box, __assign({ backgroundColor: "blueberry300", position: "absolute", right: 0, top: "calc(50% - 20px)", zIndex: 3, textAlign: "center" }, baseStyles), "Right")));
12
+ React.createElement(Box, Object.assign({ backgroundColor: "cinnamon300", left: 0, position: "absolute", top: "calc(50% - 20px)", zIndex: 1, textAlign: "center" }, baseStyles), "Left"),
13
+ React.createElement(Box, Object.assign({ backgroundColor: "sourLemon300", left: `calc(50% - 4rem)`, position: "absolute", top: "calc(50% - 20px)", zIndex: 2, textAlign: "center" }, baseStyles), "Center"),
14
+ React.createElement(Box, Object.assign({ backgroundColor: "blueberry300", position: "absolute", right: 0, top: "calc(50% - 20px)", zIndex: 3, textAlign: "center" }, baseStyles), "Right")));
26
15
  };
@@ -1,26 +1,15 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import * as React from 'react';
13
2
  import { Box } from '@workday/canvas-kit-react/layout';
14
- var baseStyles = {
3
+ const baseStyles = {
15
4
  border: 'dotted 2px',
16
5
  color: 'blackPepper500',
17
6
  display: 'inline-block',
18
7
  verticalAlign: 'bottom',
19
8
  };
20
- export var SpaceExample = function () { return (React.createElement(React.Fragment, null,
21
- React.createElement(Box, __assign({ backgroundColor: "cinnamon300", margin: "xxs", padding: "s", textAlign: "center" }, baseStyles),
9
+ export const SpaceExample = () => (React.createElement(React.Fragment, null,
10
+ React.createElement(Box, Object.assign({ backgroundColor: "cinnamon300", margin: "xxs", padding: "s", textAlign: "center" }, baseStyles),
22
11
  React.createElement(Box, { border: "dotted 2px", borderColor: "blackPepper500" }, "Small")),
23
- React.createElement(Box, __assign({ backgroundColor: "sourLemon300", margin: "xxs", padding: "m", textAlign: "center" }, baseStyles),
12
+ React.createElement(Box, Object.assign({ backgroundColor: "sourLemon300", margin: "xxs", padding: "m", textAlign: "center" }, baseStyles),
24
13
  React.createElement(Box, { border: "dotted 2px", borderColor: "blackPepper500" }, "Medium")),
25
- React.createElement(Box, __assign({ backgroundColor: "blueberry300", margin: "xxs", padding: "l", textAlign: "center" }, baseStyles),
26
- React.createElement(Box, { border: "dotted 2px", borderColor: "blackPepper500" }, "Large")))); };
14
+ React.createElement(Box, Object.assign({ backgroundColor: "blueberry300", margin: "xxs", padding: "l", textAlign: "center" }, baseStyles),
15
+ React.createElement(Box, { border: "dotted 2px", borderColor: "blackPepper500" }, "Large"))));
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Box } from '@workday/canvas-kit-react/layout';
3
- export var TextExample = function () { return (React.createElement(Box, { padding: "m", border: "solid 4px", borderColor: "blueberry300", color: "blackPepper500" },
3
+ export const TextExample = () => (React.createElement(Box, { padding: "m", border: "solid 4px", borderColor: "blueberry300", color: "blackPepper500" },
4
4
  React.createElement(Box, { as: "h3", fontSize: "large", fontWeight: "bold", margin: "zero" }, "The Elements of Typographic Style"),
5
5
  React.createElement(Box, { as: "p", fontSize: "medium", fontStyle: "italic" }, "\"Typography is the craft of endowing human language with a durable visual form.\""),
6
- React.createElement(Box, { as: "span", fontSize: "small", fontWeight: "bold", color: "licorice300" }, "\u2015 Robert Bringhurst"))); };
6
+ React.createElement(Box, { as: "span", fontSize: "small", fontWeight: "bold", color: "licorice300" }, "\u2015 Robert Bringhurst")));
@@ -11,7 +11,7 @@ import { rocketIcon, tokensIcon, shapesIcon } from '@workday/canvas-system-icons
11
11
  import { SystemIcon } from '@workday/canvas-kit-react/icon';
12
12
  // @ts-ignore: Cannot find module error
13
13
  import { version } from '../../../lerna.json';
14
- export var WelcomePage = function () {
14
+ export const WelcomePage = () => {
15
15
  return (React.createElement(Flex, { flexDirection: "column", gap: "s" },
16
16
  React.createElement(Box, { borderRadius: "m", overflow: "hidden", position: "relative" },
17
17
  React.createElement(Flex, { position: "absolute", flexDirection: "column", top: "30%", left: "10%" },
@@ -25,7 +25,7 @@ export var WelcomePage = function () {
25
25
  "This project provides a set of components for the Workday Canvas Design System that can be used to implement user experiences consistent with",
26
26
  ' ',
27
27
  React.createElement(ExternalHyperlink, { href: "https://canvas.workdaydesign.com/" }, "Workday Design Principles.")),
28
- React.createElement(Heading, { size: "medium", borderBottom: "1px solid " + colors.blueberry200, paddingBottom: "xxs" }, "Quick Links"),
28
+ React.createElement(Heading, { size: "medium", borderBottom: `1px solid ${colors.blueberry200}`, paddingBottom: "xxs" }, "Quick Links"),
29
29
  React.createElement(Grid, { gridAutoColumns: "auto", gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))", gridGap: "s" },
30
30
  React.createElement(Grid, { as: Card, gridTemplateRows: "1fr 1fr 2fr 1fr", depth: "none", display: "grid", maxHeight: 320 },
31
31
  React.createElement(SystemIcon, { color: colors.cantaloupe400, colorHover: colors.cantaloupe400, icon: rocketIcon, size: 60 }),
@@ -51,7 +51,7 @@ export var WelcomePage = function () {
51
51
  React.createElement(Grid.Item, { as: Hyperlink, alignSelf: "end", marginTop: "xs", href: "https://workday.github.io/canvas-kit/?path=/docs/assets-icons--overview" },
52
52
  ' ',
53
53
  "View Assets"))),
54
- React.createElement(Heading, { size: "medium", borderBottom: "1px solid " + colors.blueberry200, paddingBottom: "xxs" }, "Installation"),
54
+ React.createElement(Heading, { size: "medium", borderBottom: `1px solid ${colors.blueberry200}`, paddingBottom: "xxs" }, "Installation"),
55
55
  React.createElement(Text, null, "To get started using Canvas kit React first add or install the module to your existing React project"),
56
56
  React.createElement(InstallBlock, { command: "yarn add", packageName: "@workday/canvas-kit-react" }),
57
57
  "or",
@@ -10,12 +10,15 @@ any questions.
10
10
  - [Layout and Column](#layout-and-column)
11
11
  - [Stack](#stack-hstack-vstack)
12
12
  - [Component Updates](#component-updates)
13
- - [Buttons](#buttons)
14
- - [Toast](#toast)
13
+ - [Buttons](#buttons) - [Toast](#toast)
15
14
  - [Utility Updates](#utility-updates)
16
15
  - [focusRing](#focusring)
16
+ - [useTheme and getTheme](#useTheme-and-getTheme)
17
+ - [useCanvasTheme and getCanvasTheme](#useCanvasTheme-and-getCanvasTheme)
18
+ - [useThemedRing](#useThemedRing)
19
+ - [useThemeRTL](#useThemeRTL)
17
20
  - [Token Updates](#token-updates)
18
- - [Depth](#depth)
21
+ - [Depth](#depth)
19
22
 
20
23
  ## Codemod
21
24
 
@@ -169,6 +172,30 @@ We're removing memoization from focus ring. The `memoize` argument passed to `fo
169
172
  longer valid and we've removed the exported `memoizedFocusRing`. There is no codemod for this
170
173
  change. We couldn't find any example of `memoize` or `memoizedFocusRing` being used.
171
174
 
175
+ ### useTheme and getTheme
176
+
177
+ We've updated `useTheme` by adding error handling if this hook has been used outside a functional
178
+ component. Also, `getTheme` method has been added to access a theme from `styled` or class
179
+ components instead of `useTheme`.
180
+
181
+ ### useCanvasTheme and getCanvasTheme
182
+
183
+ `useCanvasTheme` and `getCanvasTheme` have been removed and can be safely replaced by `useTheme`
184
+ and `getTheme`.
185
+
186
+ ### useThemedRing
187
+
188
+ We've promoted `useThemedRing` from our Labs package to our Main package. You can use this utility
189
+ to theme focus rings.
190
+
191
+ 🤖 The codemod will update the import for this utility.
192
+
193
+ ### useThemeRTL
194
+
195
+ We've [soft-deprecated](#soft-deprecation) `useThemeRTL` from our Labs package. Although you may
196
+ still use this utility, we encourage consumers to use
197
+ [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties).
198
+
172
199
  ## Token Updates
173
200
 
174
201
  ### Depth
@@ -3,7 +3,7 @@
3
3
  import {jsx} from '@emotion/react';
4
4
  import React from 'react';
5
5
  import {TextArea} from '@workday/canvas-kit-preview-react/text-area';
6
- import {useThemedRing} from '@workday/canvas-kit-labs-react/common';
6
+ import {useThemedRing} from '@workday/canvas-kit-react/common';
7
7
  import {space, colors} from '@workday/canvas-kit-react/tokens';
8
8
  import {Text} from '@workday/canvas-kit-react/text';
9
9
 
@@ -3,7 +3,7 @@
3
3
  import {jsx} from '@emotion/react';
4
4
  import React from 'react';
5
5
  import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
6
- import {useThemedRing} from '@workday/canvas-kit-labs-react/common';
6
+ import {useThemedRing} from '@workday/canvas-kit-react/common';
7
7
  import {space} from '@workday/canvas-kit-react/tokens';
8
8
 
9
9
  export default () => {
@@ -3,8 +3,11 @@
3
3
  import {jsx} from '@emotion/react';
4
4
  import React from 'react';
5
5
  import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
6
- import {useThemedRing} from '@workday/canvas-kit-labs-react/common';
7
- import {CanvasProvider, PartialEmotionCanvasTheme} from '@workday/canvas-kit-react/common';
6
+ import {
7
+ CanvasProvider,
8
+ PartialEmotionCanvasTheme,
9
+ useThemedRing,
10
+ } from '@workday/canvas-kit-react/common';
8
11
  import {colors, space} from '@workday/canvas-kit-react/tokens';
9
12
 
10
13
  export default () => {