@workday/canvas-kit-docs 13.0.0-alpha.1069-next.0 → 13.0.0-alpha.1074-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es6/lib/ExampleCodeBlock.d.ts +1 -2
- package/dist/es6/lib/ExampleCodeBlock.d.ts.map +1 -1
- package/dist/es6/lib/ExampleCodeBlock.js +7 -18
- package/dist/es6/lib/MDXElements.d.ts +1 -2
- package/dist/es6/lib/MDXElements.d.ts.map +1 -1
- package/dist/es6/lib/MDXElements.js +4 -4
- package/dist/es6/lib/MoreTooltip.d.ts +1 -1
- package/dist/es6/lib/MoreTooltip.d.ts.map +1 -1
- package/dist/es6/lib/MoreTooltip.js +11 -12
- package/dist/es6/lib/Specifications.d.ts +1 -2
- package/dist/es6/lib/Specifications.d.ts.map +1 -1
- package/dist/es6/lib/Specifications.js +3 -20
- package/dist/es6/lib/StylePropsTable.d.ts +1 -2
- package/dist/es6/lib/StylePropsTable.d.ts.map +1 -1
- package/dist/es6/lib/StylePropsTable.js +6 -16
- package/dist/es6/lib/Table.d.ts.map +1 -1
- package/dist/es6/lib/Table.js +7 -7
- package/dist/es6/lib/Value.d.ts +3 -3
- package/dist/es6/lib/Value.d.ts.map +1 -1
- package/dist/es6/lib/Value.js +16 -51
- package/dist/es6/lib/docs.js +102 -29
- package/dist/es6/lib/stackblitzFiles/App.d.ts +1 -2
- package/dist/es6/lib/stackblitzFiles/App.d.ts.map +1 -1
- package/dist/es6/lib/stackblitzFiles/App.js +2 -5
- package/dist/es6/lib/stackblitzFiles/App.tsx +0 -1
- package/dist/es6/lib/stackblitzFiles/Demo.d.ts +1 -2
- package/dist/es6/lib/stackblitzFiles/Demo.d.ts.map +1 -1
- package/dist/es6/lib/stackblitzFiles/Demo.js +2 -2
- package/dist/es6/lib/stackblitzFiles/Demo.tsx +0 -2
- package/dist/es6/lib/stackblitzFiles/main.d.ts.map +1 -1
- package/dist/es6/lib/stackblitzFiles/main.js +2 -2
- package/dist/es6/lib/stackblitzFiles/main.tsx +0 -1
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/es6/lib/widgetUtils.d.ts +5 -5
- package/dist/es6/lib/widgetUtils.d.ts.map +1 -1
- package/dist/es6/lib/widgetUtils.js +25 -54
- package/dist/es6/lib/widgets/array.js +2 -4
- package/dist/es6/lib/widgets/callExpression.js +2 -14
- package/dist/es6/lib/widgets/canvasColor.js +2 -2
- package/dist/es6/lib/widgets/component.js +2 -4
- package/dist/es6/lib/widgets/conditional.js +2 -12
- package/dist/es6/lib/widgets/enhancedComponent.js +14 -66
- package/dist/es6/lib/widgets/external.js +2 -4
- package/dist/es6/lib/widgets/function.js +7 -26
- package/dist/es6/lib/widgets/intersection.js +2 -3
- package/dist/es6/lib/widgets/model.js +3 -19
- package/dist/es6/lib/widgets/object.js +2 -2
- package/dist/es6/lib/widgets/parenthesis.js +2 -5
- package/dist/es6/lib/widgets/primitives.js +9 -27
- package/dist/es6/lib/widgets/qualifiedName.js +2 -5
- package/dist/es6/lib/widgets/symbol.js +2 -2
- package/dist/es6/lib/widgets/tuple.js +2 -5
- package/dist/es6/lib/widgets/typeParameter.js +2 -13
- package/dist/es6/lib/widgets/union.js +4 -10
- package/dist/es6/mdx/installBlock.d.ts +1 -2
- package/dist/es6/mdx/installBlock.d.ts.map +1 -1
- package/dist/es6/mdx/installBlock.js +2 -6
- package/dist/es6/mdx/style-props/examples/Background.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Background.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Background.js +2 -5
- package/dist/es6/mdx/style-props/examples/Border.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Border.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Border.js +2 -5
- package/dist/es6/mdx/style-props/examples/Color.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Color.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Color.js +2 -5
- package/dist/es6/mdx/style-props/examples/Depth.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Depth.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Depth.js +2 -5
- package/dist/es6/mdx/style-props/examples/Flex.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Flex.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Flex.js +2 -14
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/FlexItem.js +2 -13
- package/dist/es6/mdx/style-props/examples/Grid.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Grid.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Grid.js +2 -6
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/GridItem.js +2 -6
- package/dist/es6/mdx/style-props/examples/Layout.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Layout.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Layout.js +2 -5
- package/dist/es6/mdx/style-props/examples/Other.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Other.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Other.js +2 -5
- package/dist/es6/mdx/style-props/examples/Position.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Position.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Position.js +2 -5
- package/dist/es6/mdx/style-props/examples/Space.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Space.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Space.js +2 -8
- package/dist/es6/mdx/style-props/examples/Text.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Text.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Text.js +2 -5
- package/dist/es6/mdx/versionsTable.d.ts +1 -2
- package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
- package/dist/es6/mdx/versionsTable.js +8 -21
- package/dist/es6/mdx/welcomePage.d.ts +1 -2
- package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.js +2 -38
- package/dist/mdx/13.0-UPGRADE-GUIDE.mdx +16 -0
- package/dist/mdx/labs-react/expandable/examples/Avatar.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/Depth.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/EndIcon.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/LongTitle.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/RTL.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/StartIcon.tsx +0 -2
- package/dist/mdx/preview-react/information-highlight/examples/Caution.tsx +0 -1
- package/dist/mdx/preview-react/information-highlight/examples/Critical.tsx +0 -1
- package/dist/mdx/preview-react/information-highlight/examples/Informational.tsx +0 -1
- package/dist/mdx/preview-react/pill/examples/WithReadOnly.tsx +0 -2
- package/dist/mdx/preview-react/segmented-control/examples/Disabled.tsx +0 -1
- package/dist/mdx/preview-react/segmented-control/examples/RTL.tsx +0 -1
- package/dist/mdx/preview-react/segmented-control/examples/Vertical.tsx +0 -1
- package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Default.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithCustomOptions.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithSimpleOptions.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Disabled.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Error.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Grow.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Scrollable.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/storiesData.tsx +0 -1
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -4
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +1 -4
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +1 -4
- package/dist/mdx/react/action-bar/examples/Basic.tsx +0 -1
- package/dist/mdx/react/action-bar/examples/DeleteAction.tsx +0 -2
- package/dist/mdx/react/action-bar/examples/Icons.tsx +0 -2
- package/dist/mdx/react/avatar/avatar/examples/Basic.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/Button.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/Image.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/ObjectFit.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/Size.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/Variant.tsx +0 -1
- package/dist/mdx/react/banner/examples/Error.tsx +0 -2
- package/dist/mdx/react/banner/examples/Sticky.tsx +0 -1
- package/dist/mdx/react/banner/examples/StickyAnimation.tsx +42 -26
- package/dist/mdx/react/breadcrumbs/examples/Basic.tsx +0 -1
- package/dist/mdx/react/button/button/examples/Delete.tsx +0 -2
- package/dist/mdx/react/button/button/examples/ExternalHyperlink.tsx +0 -2
- package/dist/mdx/react/button/button/examples/Hyperlink.tsx +0 -2
- package/dist/mdx/react/button/button/examples/Primary.tsx +0 -2
- package/dist/mdx/react/color-picker/color-preview/examples/Basic.tsx +0 -1
- package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +0 -1
- package/dist/mdx/react/modal/examples/Basic.tsx +0 -2
- package/dist/mdx/react/modal/examples/IframeTest.tsx +0 -1
- package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +0 -1
- package/dist/mdx/react/modal/examples/StackedModals.tsx +0 -1
- package/dist/mdx/react/pagination/examples/CustomRange.tsx +0 -1
- package/dist/mdx/react/pagination/examples/GoToForm.tsx +0 -1
- package/dist/mdx/react/pagination/examples/JumpControls.tsx +0 -1
- package/dist/mdx/react/popup/examples/Basic.tsx +0 -2
- package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +0 -1
- package/dist/mdx/react/popup/examples/ComboboxWithinPopup.tsx +0 -1
- package/dist/mdx/react/popup/examples/MultiplePopups.tsx +0 -2
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +0 -1
- package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +0 -1
- package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +0 -2
- package/dist/mdx/react/popup/examples/TooltipReturnFocus.tsx +0 -1
- package/dist/mdx/react/select/examples/MenuHeight.tsx +0 -1
- package/dist/mdx/react/tabs/examples/Basic.tsx +0 -1
- package/dist/mdx/react/tabs/examples/DisabledTab.tsx +0 -1
- package/dist/mdx/react/tabs/examples/NamedTabs.tsx +0 -1
- package/dist/mdx/react/tabs/examples/RightToLeft.tsx +0 -1
- package/dist/mdx/react/text-input/examples/Basic.tsx +0 -3
- package/dist/mdx/react/toast/examples/Basic.tsx +0 -2
- package/dist/mdx/react/toast/examples/ToastAlert.tsx +0 -2
- package/dist/mdx/react/toast/examples/ToastDialog.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/Default.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/DescribeType.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/DescriptionType.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/Muted.tsx +0 -2
- package/dist/mdx/style-props/examples/Background.tsx +0 -1
- package/dist/mdx/style-props/examples/Border.tsx +0 -1
- package/dist/mdx/style-props/examples/Color.tsx +0 -1
- package/dist/mdx/style-props/examples/Depth.tsx +0 -1
- package/dist/mdx/style-props/examples/Flex.tsx +0 -1
- package/dist/mdx/style-props/examples/FlexItem.tsx +0 -1
- package/dist/mdx/style-props/examples/Grid.tsx +0 -1
- package/dist/mdx/style-props/examples/GridItem.tsx +0 -1
- package/dist/mdx/style-props/examples/Layout.tsx +0 -1
- package/dist/mdx/style-props/examples/Other.tsx +0 -1
- package/dist/mdx/style-props/examples/Position.tsx +0 -1
- package/dist/mdx/style-props/examples/Space.tsx +0 -1
- package/dist/mdx/style-props/examples/Text.tsx +0 -1
- package/lib/StylePropsTable.tsx +0 -1
- package/lib/Table.tsx +0 -1
- package/lib/stackblitzFiles/App.tsx +0 -1
- package/lib/stackblitzFiles/Demo.tsx +0 -2
- package/lib/stackblitzFiles/main.tsx +0 -1
- package/lib/widgets/array.tsx +0 -2
- package/lib/widgets/canvasColor.tsx +0 -2
- package/lib/widgets/component.tsx +0 -2
- package/lib/widgets/conditional.tsx +0 -2
- package/lib/widgets/external.tsx +0 -1
- package/lib/widgets/model.tsx +0 -2
- package/lib/widgets/parenthesis.tsx +0 -2
- package/lib/widgets/primitives.tsx +1 -5
- package/lib/widgets/qualifiedName.tsx +0 -2
- package/lib/widgets/symbol.tsx +0 -2
- package/lib/widgets/tuple.tsx +0 -2
- package/lib/widgets/typeParameter.tsx +0 -2
- package/package.json +6 -6
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { Table } from '@workday/canvas-kit-react';
|
|
3
4
|
import { StatusIndicator } from '@workday/canvas-kit-preview-react';
|
|
@@ -48,25 +49,11 @@ export const VersionTable = () => {
|
|
|
48
49
|
}
|
|
49
50
|
setVersions(arr);
|
|
50
51
|
}, []);
|
|
51
|
-
return (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
.slice()
|
|
59
|
-
.reverse()
|
|
60
|
-
.map(item => {
|
|
61
|
-
const { label, variant } = getVersionStatusIndicator(item.versionNumber);
|
|
62
|
-
return (React.createElement(Table.Row, null,
|
|
63
|
-
React.createElement(Table.Cell, null,
|
|
64
|
-
"v",
|
|
65
|
-
item.versionNumber),
|
|
66
|
-
React.createElement(Table.Cell, null,
|
|
67
|
-
React.createElement("a", { href: item.versionUrl, target: "_blank", rel: "noreferrer" }, "Documentation")),
|
|
68
|
-
React.createElement(Table.Cell, null,
|
|
69
|
-
React.createElement(StatusIndicator, { variant: variant },
|
|
70
|
-
React.createElement(StatusIndicator.Label, null, label)))));
|
|
71
|
-
}))));
|
|
52
|
+
return (_jsxs(Table, { children: [_jsx(Table.Head, { children: _jsxs(Table.Row, { children: [_jsx(Table.Header, { scope: "col", children: "Version" }), _jsx(Table.Header, { scope: "col", children: "Documentation" }), _jsx(Table.Header, { scope: "col", children: "Status" })] }) }), _jsx(Table.Body, { children: versions
|
|
53
|
+
.slice()
|
|
54
|
+
.reverse()
|
|
55
|
+
.map(item => {
|
|
56
|
+
const { label, variant } = getVersionStatusIndicator(item.versionNumber);
|
|
57
|
+
return (_jsxs(Table.Row, { children: [_jsxs(Table.Cell, { children: ["v", item.versionNumber] }), _jsx(Table.Cell, { children: _jsx("a", { href: item.versionUrl, target: "_blank", rel: "noreferrer", children: "Documentation" }) }), _jsx(Table.Cell, { children: _jsx(StatusIndicator, { variant: variant, children: _jsx(StatusIndicator.Label, { children: label }) }) })] }));
|
|
58
|
+
}) })] }));
|
|
72
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcomePage.d.ts","sourceRoot":"","sources":["../../../mdx/welcomePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"welcomePage.d.ts","sourceRoot":"","sources":["../../../mdx/welcomePage.tsx"],"names":[],"mappings":"AAqDA,eAAO,MAAM,WAAW,+CAkHvB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// @ts-ignore: Cannot find module error
|
|
3
3
|
import headerImage from './CK-banner-temp.jpg';
|
|
4
4
|
import { Flex, Grid, Box } from '@workday/canvas-kit-react/layout';
|
|
@@ -45,41 +45,5 @@ const linkStyles = createStyles({
|
|
|
45
45
|
marginTop: system.space.x3,
|
|
46
46
|
});
|
|
47
47
|
export const WelcomePage = () => {
|
|
48
|
-
return (
|
|
49
|
-
React.createElement("div", { className: parentFlexStyles },
|
|
50
|
-
React.createElement(Box, { cs: { overflow: 'hidden', position: 'relative' } },
|
|
51
|
-
React.createElement(Flex, { cs: { flexDirection: 'row', position: 'absolute', top: '45%', left: '10%' } },
|
|
52
|
-
React.createElement(Text, { typeLevel: "title.medium", cs: textStyles }, "Canvas Kit"),
|
|
53
|
-
React.createElement(Text, { typeLevel: "title.medium", cs: [textStyles, versionStyles] },
|
|
54
|
-
"v",
|
|
55
|
-
version)),
|
|
56
|
-
React.createElement("img", { src: headerImage, alt: "banner with canvas kit logo and version", className: imageStyles })),
|
|
57
|
-
React.createElement(Text, { typeLevel: "body.medium" },
|
|
58
|
-
"This project provides a set of components for the Workday Canvas Design System that can be used to implement user experiences consistent with",
|
|
59
|
-
React.createElement(ExternalHyperlink, { href: "https://canvas.workdaydesign.com/", iconLabel: "Open docs in new window" }, "Workday Design Principles.")),
|
|
60
|
-
React.createElement(Heading, { size: "medium", className: borderStyles }, "Quick Links"),
|
|
61
|
-
React.createElement(Grid, { gridAutoColumns: "auto", gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))", gridGap: "s" },
|
|
62
|
-
React.createElement(Grid, { as: Card, className: gridStyles },
|
|
63
|
-
React.createElement(SystemIcon, { color: base.cantaloupe400, colorHover: base.cantaloupe400, icon: rocketIcon, size: 60 }),
|
|
64
|
-
React.createElement(Card.Heading, null, "Getting Started"),
|
|
65
|
-
React.createElement(Card.Body, null,
|
|
66
|
-
React.createElement(Text, null, "For all things getting started including helpful guides and docs.")),
|
|
67
|
-
React.createElement(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/guides-getting-started--docs" }, "Getting Started Guide")),
|
|
68
|
-
React.createElement(Grid, { as: Card, className: gridStyles },
|
|
69
|
-
React.createElement(SystemIcon, { color: base.blueberry400, icon: tokensIcon, colorHover: base.blueberry400, size: 60 }),
|
|
70
|
-
React.createElement(Card.Heading, null, "Tokens"),
|
|
71
|
-
React.createElement(Card.Body, null,
|
|
72
|
-
React.createElement(Text, null, "Tokens are the smallest pieces of our Design System with the primary function of storing UI information.")),
|
|
73
|
-
React.createElement(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/tokens--overview" }, "View Our Tokens")),
|
|
74
|
-
React.createElement(Grid, { as: Card, className: gridStyles },
|
|
75
|
-
React.createElement(SystemIcon, { color: base.greenApple400, icon: shapesIcon, size: 60, colorHover: base.greenApple400 }),
|
|
76
|
-
React.createElement(Card.Heading, null, "Assets"),
|
|
77
|
-
React.createElement(Card.Body, null,
|
|
78
|
-
React.createElement(Text, null, "Assets are graphics which help communicate meaning or highlight areas of interaction to our users.")),
|
|
79
|
-
React.createElement(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/assets-icons--overview" }, "View Assets"))),
|
|
80
|
-
React.createElement(Heading, { size: "medium", className: borderStyles }, "Installation"),
|
|
81
|
-
React.createElement(Text, null, "To get started using Canvas Kit React first add or install the module to your existing React project"),
|
|
82
|
-
React.createElement(InstallBlock, { command: "yarn add", packageName: "@workday/canvas-kit-react" }),
|
|
83
|
-
"or",
|
|
84
|
-
React.createElement(InstallBlock, { command: "npm install", packageName: "@workday/canvas-kit-react" }))));
|
|
48
|
+
return (_jsx("div", { className: "sb-unstyled", children: _jsxs("div", { className: parentFlexStyles, children: [_jsxs(Box, { cs: { overflow: 'hidden', position: 'relative' }, children: [_jsxs(Flex, { cs: { flexDirection: 'row', position: 'absolute', top: '45%', left: '10%' }, children: [_jsx(Text, { typeLevel: "title.medium", cs: textStyles, children: "Canvas Kit" }), _jsxs(Text, { typeLevel: "title.medium", cs: [textStyles, versionStyles], children: ["v", version] })] }), _jsx("img", { src: headerImage, alt: "banner with canvas kit logo and version", className: imageStyles })] }), _jsxs(Text, { typeLevel: "body.medium", children: ["This project provides a set of components for the Workday Canvas Design System that can be used to implement user experiences consistent with", _jsx(ExternalHyperlink, { href: "https://canvas.workdaydesign.com/", iconLabel: "Open docs in new window", children: "Workday Design Principles." })] }), _jsx(Heading, { size: "medium", className: borderStyles, children: "Quick Links" }), _jsxs(Grid, { gridAutoColumns: "auto", gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))", gridGap: "s", children: [_jsxs(Grid, { as: Card, className: gridStyles, children: [_jsx(SystemIcon, { color: base.cantaloupe400, colorHover: base.cantaloupe400, icon: rocketIcon, size: 60 }), _jsx(Card.Heading, { children: "Getting Started" }), _jsx(Card.Body, { children: _jsx(Text, { children: "For all things getting started including helpful guides and docs." }) }), _jsx(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/guides-getting-started--docs", children: "Getting Started Guide" })] }), _jsxs(Grid, { as: Card, className: gridStyles, children: [_jsx(SystemIcon, { color: base.blueberry400, icon: tokensIcon, colorHover: base.blueberry400, size: 60 }), _jsx(Card.Heading, { children: "Tokens" }), _jsx(Card.Body, { children: _jsx(Text, { children: "Tokens are the smallest pieces of our Design System with the primary function of storing UI information." }) }), _jsx(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/tokens--overview", children: "View Our Tokens" })] }), _jsxs(Grid, { as: Card, className: gridStyles, children: [_jsx(SystemIcon, { color: base.greenApple400, icon: shapesIcon, size: 60, colorHover: base.greenApple400 }), _jsx(Card.Heading, { children: "Assets" }), _jsx(Card.Body, { children: _jsx(Text, { children: "Assets are graphics which help communicate meaning or highlight areas of interaction to our users." }) }), _jsx(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/assets-icons--overview", children: "View Assets" })] })] }), _jsx(Heading, { size: "medium", className: borderStyles, children: "Installation" }), _jsx(Text, { children: "To get started using Canvas Kit React first add or install the module to your existing React project" }), _jsx(InstallBlock, { command: "yarn add", packageName: "@workday/canvas-kit-react" }), "or", _jsx(InstallBlock, { command: "npm install", packageName: "@workday/canvas-kit-react" })] }) }));
|
|
85
49
|
};
|
|
@@ -21,6 +21,8 @@ any questions.
|
|
|
21
21
|
- [External Hyperlink](#external-hyperlink)
|
|
22
22
|
- [Pill](#pill)
|
|
23
23
|
- [Tabs](#tabs)
|
|
24
|
+
- [Infrastructure](#infrastructure)
|
|
25
|
+
- [Supporting react-jsx](#supoorting-react-jsx)
|
|
24
26
|
- [Troubleshooting](#troubleshooting)
|
|
25
27
|
- [Glossary](#glossary)
|
|
26
28
|
- [Main](#main)
|
|
@@ -158,6 +160,20 @@ A few changes have been made to `Pill` to ensure proper accessibility and styles
|
|
|
158
160
|
|
|
159
161
|
**Note:** There should be no developer impact and the visual changes are safe to accept.
|
|
160
162
|
|
|
163
|
+
## Infrastructure
|
|
164
|
+
|
|
165
|
+
### Supporting `react-jsx`
|
|
166
|
+
|
|
167
|
+
We've updated the `jsx` flag in our `tsconfig` to `react-jsx`. As part of this change, we've also updated our peer dependencies for our packages to a minimum version of `react@17.0.0`. This change is to provide support for modern technologies like `vite` and ES modules.
|
|
168
|
+
|
|
169
|
+
##### Breaking Changes
|
|
170
|
+
|
|
171
|
+
If you're using `react@16.x.x`, you'll need to upgrade to `react@17.x.x` to use Canvas Kit v13.
|
|
172
|
+
|
|
173
|
+
>**Note:** You'll need to update the way `jsx` transpiles. The automatic runtime feature, enabled through the `@babel/preset-react` preset with the `runtime: "automatic"` option, handles the importing of functions that JSX transpiles to.
|
|
174
|
+
|
|
175
|
+
```sh
|
|
176
|
+
|
|
161
177
|
## Troubleshooting
|
|
162
178
|
|
|
163
179
|
## Glossary
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import {TextArea} from '@workday/canvas-kit-preview-react/text-area';
|
|
6
3
|
import {useThemedRing} from '@workday/canvas-kit-react/common';
|
|
@@ -28,7 +25,7 @@ export default () => {
|
|
|
28
25
|
return (
|
|
29
26
|
<TextArea orientation="vertical">
|
|
30
27
|
<TextArea.Label>Add a comment</TextArea.Label>
|
|
31
|
-
<TextArea.Field
|
|
28
|
+
<TextArea.Field cs={alertStyles} onChange={handleChange} value={value} />
|
|
32
29
|
<TextArea.Hint paddingTop={space.xxs}>
|
|
33
30
|
<strong>Character Limit: </strong>
|
|
34
31
|
<Text color={hintColor}>{10 - value.length} Left</Text>
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
6
3
|
import {useThemedRing} from '@workday/canvas-kit-react/common';
|
|
@@ -20,7 +17,7 @@ export default () => {
|
|
|
20
17
|
return (
|
|
21
18
|
<TextInput orientation="vertical">
|
|
22
19
|
<TextInput.Label>Password</TextInput.Label>
|
|
23
|
-
<TextInput.Field
|
|
20
|
+
<TextInput.Field cs={alertStyles} onChange={handleChange} value={value} type="password" />
|
|
24
21
|
<TextInput.Hint paddingTop={space.xxs}>
|
|
25
22
|
<strong>Password Strength: </strong>
|
|
26
23
|
{value.length < 3 ? (
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
6
3
|
import {
|
|
@@ -43,7 +40,7 @@ const AlertInput = () => {
|
|
|
43
40
|
return (
|
|
44
41
|
<TextInput orientation="vertical">
|
|
45
42
|
<TextInput.Label>Email</TextInput.Label>
|
|
46
|
-
<TextInput.Field
|
|
43
|
+
<TextInput.Field cs={alertStyles} onChange={handleChange} value={value} />
|
|
47
44
|
<TextInput.Hint paddingTop={space.xxs}>Please enter a valid email.</TextInput.Hint>
|
|
48
45
|
</TextInput>
|
|
49
46
|
);
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx, keyframes} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
|
|
6
3
|
import {CSSProperties, space} from '@workday/canvas-kit-react/tokens';
|
|
@@ -8,47 +5,66 @@ import {useTheme} from '@workday/canvas-kit-react/common';
|
|
|
8
5
|
import {Box} from '@workday/canvas-kit-react/layout';
|
|
9
6
|
import {loopIcon} from '@workday/canvas-system-icons-web';
|
|
10
7
|
import {Banner} from '@workday/canvas-kit-react/banner';
|
|
8
|
+
import {
|
|
9
|
+
createStencil,
|
|
10
|
+
createStyles,
|
|
11
|
+
createVars,
|
|
12
|
+
keyframes,
|
|
13
|
+
handleCsProp,
|
|
14
|
+
cssVar,
|
|
15
|
+
} from '@workday/canvas-kit-styling';
|
|
16
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
11
17
|
|
|
12
|
-
const containerStyles
|
|
18
|
+
const containerStyles = createStyles({
|
|
13
19
|
position: 'absolute',
|
|
14
20
|
right: 0,
|
|
15
21
|
overflow: 'hidden',
|
|
16
|
-
};
|
|
22
|
+
});
|
|
23
|
+
const stickyAnimationVars = createVars('width', 'rerun');
|
|
24
|
+
const stickAnimationKeyframes = keyframes({
|
|
25
|
+
'0%': {
|
|
26
|
+
transform: `translateX(${cssVar(stickyAnimationVars.width)})`,
|
|
27
|
+
},
|
|
28
|
+
'100%': {
|
|
29
|
+
transform: `translateX(0 * ${cssVar(stickyAnimationVars.rerun)})`,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const stickyAnimationStencil = createStencil({
|
|
34
|
+
base: {
|
|
35
|
+
marginY: system.space.x1,
|
|
36
|
+
marginInlineStart: system.space.x1,
|
|
37
|
+
marginInlineEnd: 0,
|
|
38
|
+
animationName: stickAnimationKeyframes,
|
|
39
|
+
animationDuration: '.3s',
|
|
40
|
+
animationTimingFunction: 'ease-out',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
17
43
|
|
|
18
44
|
export default () => {
|
|
19
45
|
const theme = useTheme();
|
|
20
46
|
const bannerRef = React.useRef<HTMLButtonElement>(null);
|
|
21
47
|
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
22
48
|
const [styles, setStyles] = React.useState<CSSProperties>();
|
|
49
|
+
const [bannerWidth, setBannerWidth] = React.useState(0);
|
|
23
50
|
|
|
24
51
|
const [rerun, setRerun] = React.useState(1); // Only needed for demo purposes
|
|
25
52
|
|
|
26
53
|
React.useLayoutEffect(() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
width *= -1;
|
|
30
|
-
}
|
|
31
|
-
const slideInKeyframes = keyframes({
|
|
32
|
-
'0%': {
|
|
33
|
-
transform: `translateX(${width}px)`,
|
|
34
|
-
},
|
|
35
|
-
'100%': {
|
|
36
|
-
transform: `translateX(0 * ${rerun})`,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
setStyles({
|
|
41
|
-
marginY: space.xxxs,
|
|
42
|
-
marginInlineStart: space.xxxs,
|
|
43
|
-
maringInlineEnd: 0,
|
|
44
|
-
animation: `${slideInKeyframes} .3s ease-out forwards`,
|
|
45
|
-
});
|
|
54
|
+
const width = bannerRef.current.offsetWidth;
|
|
55
|
+
setBannerWidth(theme.canvas.direction === 'rtl' ? width * -1 : width);
|
|
46
56
|
}, [theme.canvas.direction, rerun]);
|
|
47
57
|
|
|
48
58
|
return (
|
|
49
59
|
<Box height={64}>
|
|
50
|
-
<div
|
|
51
|
-
<div
|
|
60
|
+
<div className={containerStyles} ref={containerRef}>
|
|
61
|
+
<div
|
|
62
|
+
key={rerun}
|
|
63
|
+
{...handleCsProp({}, [
|
|
64
|
+
stickyAnimationStencil(),
|
|
65
|
+
stickyAnimationVars({width: `${bannerWidth}px`, rerun: `${rerun}`}),
|
|
66
|
+
])}
|
|
67
|
+
>
|
|
52
68
|
<Banner
|
|
53
69
|
onClick={() => setRerun(r => r + 1)}
|
|
54
70
|
hasError={true}
|