@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.
- package/dist/es6/docgen/createTraversals.js +41 -22
- package/dist/es6/docgen/docParser.js +285 -257
- package/dist/es6/docgen/getExternalSymbol.js +2 -2
- package/dist/es6/docgen/plugins/componentParser.js +28 -33
- package/dist/es6/docgen/plugins/enhancedComponentParser.js +211 -150
- package/dist/es6/docgen/plugins/modelParser.js +139 -79
- package/dist/es6/docgen/traversals.js +396 -397
- package/dist/es6/docgen/traverse.js +8 -9
- package/dist/es6/lib/DescriptionTooltip.js +1 -1
- package/dist/es6/lib/MDXElements.js +13 -39
- package/dist/es6/lib/MoreTooltip.js +21 -41
- package/dist/es6/lib/Specifications.js +30 -34
- package/dist/es6/lib/StylePropsTable.js +8 -9
- package/dist/es6/lib/Table.js +19 -30
- package/dist/es6/lib/Value.js +13 -17
- package/dist/es6/lib/docs.js +701 -397
- package/dist/es6/lib/widgetUtils.js +44 -76
- package/dist/es6/lib/widgets/array.js +1 -2
- package/dist/es6/lib/widgets/callExpression.js +4 -5
- package/dist/es6/lib/widgets/canvasColor.js +2 -2
- package/dist/es6/lib/widgets/component.js +1 -2
- package/dist/es6/lib/widgets/conditional.js +1 -2
- package/dist/es6/lib/widgets/enhancedComponent.js +19 -24
- package/dist/es6/lib/widgets/external.js +1 -4
- package/dist/es6/lib/widgets/function.js +5 -7
- package/dist/es6/lib/widgets/intersection.js +3 -4
- package/dist/es6/lib/widgets/model.js +4 -6
- package/dist/es6/lib/widgets/object.js +2 -3
- package/dist/es6/lib/widgets/parenthesis.js +1 -2
- package/dist/es6/lib/widgets/primitives.js +17 -39
- package/dist/es6/lib/widgets/qualifiedName.js +1 -2
- package/dist/es6/lib/widgets/symbol.js +1 -2
- package/dist/es6/lib/widgets/tuple.js +2 -3
- package/dist/es6/lib/widgets/typeParameter.js +1 -2
- package/dist/es6/lib/widgets/union.js +3 -4
- package/dist/es6/mdx/installBlock.js +6 -7
- package/dist/es6/mdx/style-props/examples/Background.js +5 -16
- package/dist/es6/mdx/style-props/examples/Border.js +5 -16
- package/dist/es6/mdx/style-props/examples/Color.js +5 -16
- package/dist/es6/mdx/style-props/examples/Depth.js +5 -16
- package/dist/es6/mdx/style-props/examples/Flex.js +11 -22
- package/dist/es6/mdx/style-props/examples/FlexItem.js +10 -21
- package/dist/es6/mdx/style-props/examples/Grid.js +6 -17
- package/dist/es6/mdx/style-props/examples/GridItem.js +6 -17
- package/dist/es6/mdx/style-props/examples/Layout.js +5 -16
- package/dist/es6/mdx/style-props/examples/Other.js +5 -16
- package/dist/es6/mdx/style-props/examples/Position.js +5 -16
- package/dist/es6/mdx/style-props/examples/Space.js +6 -17
- package/dist/es6/mdx/style-props/examples/Text.js +2 -2
- package/dist/es6/mdx/welcomePage.js +3 -3
- package/dist/mdx/9.0-UPGRADE-GUIDE.mdx +30 -3
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -1
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +1 -1
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +5 -2
- package/dist/mdx/react/banner/examples/StickyAnimation.tsx +7 -5
- package/dist/mdx/react/common/examples/ResponsiveViewport.tsx +2 -3
- 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',
|
|
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',
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
23
|
-
React.createElement(Box,
|
|
24
|
-
React.createElement(Box,
|
|
25
|
-
React.createElement(Box,
|
|
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
|
-
|
|
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
|
|
23
|
-
React.createElement(Box,
|
|
24
|
-
React.createElement(Box,
|
|
25
|
-
React.createElement(Box,
|
|
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
|
-
|
|
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
|
|
22
|
-
React.createElement(Box,
|
|
23
|
-
React.createElement(Box,
|
|
24
|
-
React.createElement(Box,
|
|
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
|
-
|
|
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
|
|
23
|
-
React.createElement(Box,
|
|
24
|
-
React.createElement(Box,
|
|
25
|
-
React.createElement(Box,
|
|
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
|
-
|
|
3
|
+
const baseStyles = {
|
|
15
4
|
color: 'blackPepper500',
|
|
16
5
|
minHeight: 'xl',
|
|
17
6
|
minWidth: '2rem',
|
|
18
7
|
padding: 'xs',
|
|
19
8
|
};
|
|
20
|
-
export
|
|
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,
|
|
23
|
-
React.createElement(Flex.Item,
|
|
24
|
-
React.createElement(Flex.Item,
|
|
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,
|
|
27
|
-
React.createElement(Flex.Item,
|
|
28
|
-
React.createElement(Flex.Item,
|
|
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,
|
|
31
|
-
React.createElement(Flex.Item,
|
|
32
|
-
React.createElement(Flex.Item,
|
|
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
|
-
|
|
3
|
+
const baseStyles = {
|
|
15
4
|
color: 'blackPepper500',
|
|
16
5
|
minHeight: 'xl',
|
|
17
6
|
minWidth: '2rem',
|
|
18
7
|
padding: 'xs',
|
|
19
8
|
};
|
|
20
|
-
export
|
|
9
|
+
export const FlexItemExample = () => (React.createElement(Flex, { flexDirection: "column", rowGap: "xs" },
|
|
21
10
|
React.createElement(Flex, { columnGap: "xs" },
|
|
22
|
-
React.createElement(Flex.Item,
|
|
23
|
-
React.createElement(Flex.Item,
|
|
24
|
-
React.createElement(Flex.Item,
|
|
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,
|
|
27
|
-
React.createElement(Flex.Item,
|
|
28
|
-
React.createElement(Flex.Item,
|
|
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,
|
|
31
|
-
React.createElement(Flex.Item,
|
|
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
|
-
|
|
3
|
+
const baseStyles = {
|
|
15
4
|
color: 'blackPepper500',
|
|
16
5
|
padding: 'xs',
|
|
17
6
|
};
|
|
18
|
-
export
|
|
19
|
-
React.createElement(Grid.Item,
|
|
20
|
-
React.createElement(Grid.Item,
|
|
21
|
-
React.createElement(Grid.Item,
|
|
22
|
-
React.createElement(Grid.Item,
|
|
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
|
-
|
|
3
|
+
const baseStyles = {
|
|
15
4
|
color: 'blackPepper500',
|
|
16
5
|
padding: 'xs',
|
|
17
6
|
};
|
|
18
|
-
export
|
|
19
|
-
React.createElement(Grid.Item,
|
|
20
|
-
React.createElement(Grid.Item,
|
|
21
|
-
React.createElement(Grid.Item,
|
|
22
|
-
React.createElement(Grid.Item,
|
|
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
|
-
|
|
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
|
|
22
|
-
React.createElement(Flex,
|
|
23
|
-
React.createElement(Flex,
|
|
24
|
-
React.createElement(Flex,
|
|
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
|
-
|
|
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
|
|
23
|
-
React.createElement(Box,
|
|
24
|
-
React.createElement(Box,
|
|
25
|
-
React.createElement(Box,
|
|
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
|
-
|
|
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
|
|
10
|
+
export const PositionExample = () => {
|
|
22
11
|
return (React.createElement(React.Fragment, null,
|
|
23
|
-
React.createElement(Box,
|
|
24
|
-
React.createElement(Box,
|
|
25
|
-
React.createElement(Box,
|
|
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
|
-
|
|
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
|
|
21
|
-
React.createElement(Box,
|
|
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,
|
|
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,
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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 {
|
|
7
|
-
|
|
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 () => {
|