@workday/canvas-kit-docs 13.0.0-alpha.1072-next.0 → 13.0.0-alpha.1075-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 +174 -181
- 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 +67 -3
- 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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import styled from '@emotion/styled';
|
|
3
4
|
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
@@ -47,18 +48,13 @@ export const Heading = createComponent('h4')({
|
|
|
47
48
|
Component({ headingOffset = 0, ...elemProps }) {
|
|
48
49
|
const headingLevel = React.useContext(HeadingLevelContext);
|
|
49
50
|
const as = `h${headingLevel + headingOffset}`; // Make Typescript happy
|
|
50
|
-
return
|
|
51
|
+
return _jsx(MDX, { as: as, ...elemProps });
|
|
51
52
|
},
|
|
52
53
|
});
|
|
53
54
|
export function renderTypeParameters(typeParameters) {
|
|
54
|
-
return typeParameters && typeParameters.length ? (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return (React.createElement(React.Fragment, { key: index },
|
|
58
|
-
index !== 0 && React.createElement("span", { className: "token punctuation" }, ", "),
|
|
59
|
-
React.createElement(Value, { value: p })));
|
|
60
|
-
}),
|
|
61
|
-
React.createElement("span", null, ">"))) : ('');
|
|
55
|
+
return typeParameters && typeParameters.length ? (_jsxs(RenderContext.Provider, { value: "inline", children: [_jsx("span", { children: "<" }), typeParameters.map((p, index) => {
|
|
56
|
+
return (_jsxs(React.Fragment, { children: [index !== 0 && _jsx("span", { className: "token punctuation", children: ", " }), _jsx(Value, { value: p })] }, index));
|
|
57
|
+
}), _jsx("span", { children: ">" })] })) : ('');
|
|
62
58
|
}
|
|
63
59
|
const ButtonHyperLink = Hyperlink.as('button');
|
|
64
60
|
export const SymbolDialog = ({ value }) => {
|
|
@@ -89,41 +85,23 @@ export const SymbolDialog = ({ value }) => {
|
|
|
89
85
|
};
|
|
90
86
|
// If we're inside a nested context, we render a Hyperlink. This button will update the dialog instead of rendering a new one.
|
|
91
87
|
if (nestedContext) {
|
|
92
|
-
return (
|
|
88
|
+
return (_jsx(ButtonHyperLink, { style: {
|
|
93
89
|
border: 'none',
|
|
94
90
|
background: 'transparent',
|
|
95
91
|
fontSize: 'inherit',
|
|
96
92
|
fontFamily: 'inherit',
|
|
97
|
-
}, onClick: handleTargetClick
|
|
93
|
+
}, onClick: handleTargetClick, children: value.displayName || value.name }));
|
|
98
94
|
}
|
|
99
|
-
return (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
React.createElement(Dialog.Card, { maxHeight: "50vh", maxWidth: "90vh", minWidth: '600px' },
|
|
110
|
-
React.createElement(Dialog.CloseIcon, null),
|
|
111
|
-
React.createElement(Dialog.Heading, null,
|
|
112
|
-
value.name,
|
|
113
|
-
" "),
|
|
114
|
-
breadcrumbsList.length > 1 && (React.createElement(Breadcrumbs, { "aria-label": "Breadcrumbs" },
|
|
115
|
-
React.createElement(Breadcrumbs.List, { paddingX: "xxs" }, breadcrumbsList.map((item, index) => {
|
|
116
|
-
return (React.createElement(React.Fragment, null, index === breadcrumbsList.length - 1 ? (React.createElement(Breadcrumbs.CurrentItem, { key: index }, item)) : (React.createElement(Breadcrumbs.Item, { key: index },
|
|
117
|
-
React.createElement(Breadcrumbs.Link, { onClick: e => handleBreadcrumbClick(e, index), href: '#' }, item)))));
|
|
118
|
-
})))),
|
|
119
|
-
React.createElement(Dialog.Body, null,
|
|
120
|
-
React.createElement(RenderContext.Provider, { value: "table" },
|
|
121
|
-
React.createElement(IndentLevelContext.Provider, { value: 0 }, symbol ? (React.createElement(SymbolDoc, { name: breadcrumbsList.length >= 1
|
|
122
|
-
? breadcrumbsList[breadcrumbsList.length - 1]
|
|
123
|
-
: value.name, headingStart: 3, hideHeading: true })) : (React.createElement(React.Fragment, null,
|
|
124
|
-
React.createElement("p", null, "Basic type information:"),
|
|
125
|
-
React.createElement("pre", null,
|
|
126
|
-
React.createElement("code", null, value.name))))))))))));
|
|
95
|
+
return (_jsx(NestedContext.Provider, { value: true, children: _jsxs(Dialog, { model: model, children: [_jsx(Dialog.Target, { as: ButtonHyperLink, className: "token symbol", onClick: handleTargetClick, style: {
|
|
96
|
+
border: 'none',
|
|
97
|
+
background: 'transparent',
|
|
98
|
+
fontSize: 'inherit',
|
|
99
|
+
fontFamily: 'inherit',
|
|
100
|
+
}, "aria-haspopup": "true", children: value.displayName || value.name }), renderTypeParameters(value.typeParameters), _jsx(Dialog.Popper, { children: _jsxs(Dialog.Card, { maxHeight: "50vh", maxWidth: "90vh", minWidth: '600px', children: [_jsx(Dialog.CloseIcon, {}), _jsxs(Dialog.Heading, { children: [value.name, " "] }), breadcrumbsList.length > 1 && (_jsx(Breadcrumbs, { "aria-label": "Breadcrumbs", children: _jsx(Breadcrumbs.List, { paddingX: "xxs", children: breadcrumbsList.map((item, index) => {
|
|
101
|
+
return (_jsx(_Fragment, { children: index === breadcrumbsList.length - 1 ? (_jsx(Breadcrumbs.CurrentItem, { children: item }, index)) : (_jsx(Breadcrumbs.Item, { children: _jsx(Breadcrumbs.Link, { onClick: e => handleBreadcrumbClick(e, index), href: '#', children: item }) }, index)) }));
|
|
102
|
+
}) }) })), _jsx(Dialog.Body, { children: _jsx(RenderContext.Provider, { value: "table", children: _jsx(IndentLevelContext.Provider, { value: 0, children: symbol ? (_jsx(SymbolDoc, { name: breadcrumbsList.length >= 1
|
|
103
|
+
? breadcrumbsList[breadcrumbsList.length - 1]
|
|
104
|
+
: value.name, headingStart: 3, hideHeading: true })) : (_jsxs(_Fragment, { children: [_jsx("p", { children: "Basic type information:" }), _jsx("pre", { children: _jsx("code", { children: value.name }) })] })) }) }) })] }) })] }) }));
|
|
127
105
|
};
|
|
128
106
|
function createColor(color) {
|
|
129
107
|
return {
|
|
@@ -161,15 +139,12 @@ const StyledSymbolDoc = styled('div')({
|
|
|
161
139
|
function getSymbolDocChildren(doc, meta, name) {
|
|
162
140
|
if (!doc) {
|
|
163
141
|
// We're within a symbol doc context, but there's no information, so we still want to render the basic type information
|
|
164
|
-
return (
|
|
165
|
-
React.createElement("p", null, "Basic type information:"),
|
|
166
|
-
React.createElement("pre", null,
|
|
167
|
-
React.createElement("code", null, name))));
|
|
142
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { children: "Basic type information:" }), _jsx("pre", { children: _jsx("code", { children: name }) })] }));
|
|
168
143
|
}
|
|
169
144
|
if (doc && doc.type) {
|
|
170
|
-
return
|
|
145
|
+
return _jsx(Value, { value: doc.type, doc: doc, meta: meta });
|
|
171
146
|
}
|
|
172
|
-
return
|
|
147
|
+
return _jsx("div", { children: "Not found" });
|
|
173
148
|
}
|
|
174
149
|
function findDoc({ name, fileName }) {
|
|
175
150
|
const doc = (docs || []).find(d => {
|
|
@@ -198,7 +173,7 @@ export const SymbolValue = (props) => {
|
|
|
198
173
|
*/
|
|
199
174
|
export const SymbolDescription = (props) => {
|
|
200
175
|
const doc = useDoc(props);
|
|
201
|
-
return doc ?
|
|
176
|
+
return doc ? _jsx(MdxJSToJSX, { children: doc.description }) : null;
|
|
202
177
|
};
|
|
203
178
|
/**
|
|
204
179
|
* Renders an exported symbol as a doc object. This will render JSDoc tags, description and setup
|
|
@@ -232,15 +207,11 @@ export const SymbolDoc = ({ name, fileName, headingStart = 3, hideDescription =
|
|
|
232
207
|
'function',
|
|
233
208
|
'callExpression',
|
|
234
209
|
].includes((doc === null || doc === void 0 ? void 0 : doc.type.kind) || 'notFound');
|
|
235
|
-
const contents = requiresCodeWrapper ? (
|
|
236
|
-
const symbolDocContents = (
|
|
237
|
-
|
|
238
|
-
!hideHeading && React.createElement(Heading, { id: `${name.toLowerCase()}-api` }, name),
|
|
239
|
-
!hideDescription && doc && (React.createElement(MdxJSToJSX, null, descriptionOverride || doc.description)),
|
|
240
|
-
contents)));
|
|
241
|
-
return symbolDocBreadcrumb === undefined ? (React.createElement(SymbolDocWrapper, null, symbolDocContents)) : (symbolDocContents);
|
|
210
|
+
const contents = requiresCodeWrapper ? (_jsx("code", { style: { display: 'block' }, children: children })) : (children);
|
|
211
|
+
const symbolDocContents = (_jsx(StyledSymbolDoc, { ...elemProps, children: _jsxs(HeadingLevelContext.Provider, { value: headingStart, children: [!hideHeading && _jsx(Heading, { id: `${name.toLowerCase()}-api`, children: name }), !hideDescription && doc && (_jsx(MdxJSToJSX, { children: descriptionOverride || doc.description })), contents] }) }));
|
|
212
|
+
return symbolDocBreadcrumb === undefined ? (_jsx(SymbolDocWrapper, { children: symbolDocContents })) : (symbolDocContents);
|
|
242
213
|
};
|
|
243
214
|
const SymbolDocWrapper = ({ children }) => {
|
|
244
215
|
const [breadcrumbsList, updateBreadcrumbs] = React.useState([]);
|
|
245
|
-
return (
|
|
216
|
+
return (_jsx(SymbolDocBreadcrumbsContext.Provider, { value: { breadcrumbsList, updateBreadcrumbs }, children: children }));
|
|
246
217
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { registerWidget, Value } from '../Value';
|
|
3
3
|
import { RenderContext } from '../widgetUtils';
|
|
4
4
|
registerWidget('array', ({ value }) => {
|
|
5
|
-
return (
|
|
6
|
-
React.createElement(Value, { value: value.value }),
|
|
7
|
-
React.createElement("span", { className: "token punctuation" }, "[]")));
|
|
5
|
+
return (_jsxs(RenderContext.Provider, { value: "inline", children: [_jsx(Value, { value: value.value }), _jsx("span", { className: "token punctuation", children: "[]" })] }));
|
|
8
6
|
});
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { registerWidget, Value } from '../Value';
|
|
3
4
|
import { IndentLevelContext, indent } from '../widgetUtils';
|
|
4
5
|
registerWidget('callExpression', ({ value }) => {
|
|
5
6
|
const level = React.useContext(IndentLevelContext);
|
|
6
|
-
return (
|
|
7
|
-
value.name && React.createElement(Value, { value: value.name }),
|
|
8
|
-
React.createElement("span", { className: "token punctuation" }, "("),
|
|
9
|
-
React.createElement(React.Fragment, null, value.parameters.map((p, index) => (React.createElement(React.Fragment, { key: index },
|
|
10
|
-
index !== 0 && React.createElement("span", { className: "token punctuation" }, ", "),
|
|
11
|
-
value.parameters.length > 1 && (React.createElement(React.Fragment, null,
|
|
12
|
-
React.createElement("br", null),
|
|
13
|
-
indent(level + 1))),
|
|
14
|
-
value.parameters.length > 1 ? (React.createElement(IndentLevelContext.Provider, { value: level + 1 },
|
|
15
|
-
React.createElement(Value, { value: p }))) : (React.createElement(Value, { value: p })),
|
|
16
|
-
index === value.parameters.length - 1 && index > 0 && (React.createElement(React.Fragment, null,
|
|
17
|
-
React.createElement("br", null),
|
|
18
|
-
indent(level))))))),
|
|
19
|
-
React.createElement("span", { className: "token punctuation" }, ")")));
|
|
7
|
+
return (_jsxs(_Fragment, { children: [value.name && _jsx(Value, { value: value.name }), _jsx("span", { className: "token punctuation", children: "(" }), _jsx(_Fragment, { children: value.parameters.map((p, index) => (_jsxs(React.Fragment, { children: [index !== 0 && _jsx("span", { className: "token punctuation", children: ", " }), value.parameters.length > 1 && (_jsxs(_Fragment, { children: [_jsx("br", {}), indent(level + 1)] })), value.parameters.length > 1 ? (_jsx(IndentLevelContext.Provider, { value: level + 1, children: _jsx(Value, { value: p }) })) : (_jsx(Value, { value: p })), index === value.parameters.length - 1 && index > 0 && (_jsxs(_Fragment, { children: [_jsx("br", {}), indent(level)] }))] }, index))) }), _jsx("span", { className: "token punctuation", children: ")" })] }));
|
|
20
8
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
3
3
|
import { ColorPicker } from '@workday/canvas-kit-preview-react/color-picker';
|
|
4
4
|
import { registerWidget } from '../Value';
|
|
5
5
|
registerWidget('canvasColor', () => {
|
|
6
|
-
return (
|
|
6
|
+
return (_jsx(ColorPicker, { style: { width: 170 }, colorSet: Object.values(colors), onColorChange: () => { } }));
|
|
7
7
|
});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { PropertiesTable, registerWidget } from '../Value';
|
|
3
3
|
import { Heading } from '../widgetUtils';
|
|
4
4
|
registerWidget('component', ({ value, doc, meta }) => {
|
|
5
5
|
var _a;
|
|
6
|
-
return (
|
|
7
|
-
React.createElement(Heading, { id: `${(_a = value.displayName) === null || _a === void 0 ? void 0 : _a.toLowerCase()}-props-api`, headingOffset: 1 }, "Props"),
|
|
8
|
-
React.createElement(PropertiesTable, { properties: value.props })));
|
|
6
|
+
return (_jsxs(_Fragment, { children: [_jsx(Heading, { id: `${(_a = value.displayName) === null || _a === void 0 ? void 0 : _a.toLowerCase()}-props-api`, headingOffset: 1, children: "Props" }), _jsx(PropertiesTable, { properties: value.props })] }));
|
|
9
7
|
});
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { registerWidget, Value } from '../Value';
|
|
3
3
|
registerWidget('conditional', ({ value }) => {
|
|
4
|
-
return (
|
|
5
|
-
React.createElement(Value, { value: value.check }),
|
|
6
|
-
" ",
|
|
7
|
-
React.createElement("span", { className: "token keyword" }, "extends"),
|
|
8
|
-
' ',
|
|
9
|
-
React.createElement(Value, { value: value.extends }),
|
|
10
|
-
" ? ",
|
|
11
|
-
React.createElement(Value, { value: value.trueType }),
|
|
12
|
-
" :",
|
|
13
|
-
' ',
|
|
14
|
-
React.createElement(Value, { value: value.falseType })));
|
|
4
|
+
return (_jsxs(_Fragment, { children: [_jsx(Value, { value: value.check }), " ", _jsx("span", { className: "token keyword", children: "extends" }), ' ', _jsx(Value, { value: value.extends }), " ? ", _jsx(Value, { value: value.trueType }), " :", ' ', _jsx(Value, { value: value.falseType })] }));
|
|
15
5
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { Expandable } from '@workday/canvas-kit-labs-react/expandable';
|
|
3
4
|
import { defaultJSDoc } from '../../docgen/docParser';
|
|
@@ -42,73 +43,20 @@ registerWidget('enhancedComponent', ({ value, doc, meta }) => {
|
|
|
42
43
|
// model. If we detect another container, only render the intro and a link to the container
|
|
43
44
|
// component
|
|
44
45
|
if (parentComponentName && value.componentType === 'container') {
|
|
45
|
-
return (
|
|
46
|
-
React.createElement(MDX, { as: "p" },
|
|
47
|
-
"This component references the",
|
|
48
|
-
' ',
|
|
49
|
-
React.createElement(ParentComponentNameContext.Provider, { value: "" },
|
|
50
|
-
React.createElement(ParentComponentJSDocContext.Provider, { value: defaultJSDoc },
|
|
51
|
-
React.createElement(SymbolDialog, { value: { kind: 'symbol', name: value.displayName || '' } }))),
|
|
52
|
-
' ',
|
|
53
|
-
"component.")));
|
|
46
|
+
return (_jsx(_Fragment, { children: _jsxs(MDX, { as: "p", children: ["This component references the", ' ', _jsx(ParentComponentNameContext.Provider, { value: "", children: _jsx(ParentComponentJSDocContext.Provider, { value: defaultJSDoc, children: _jsx(SymbolDialog, { value: { kind: 'symbol', name: value.displayName || '' } }) }) }), ' ', "component."] }) }));
|
|
54
47
|
}
|
|
55
|
-
return (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
? `${parentComponentName.toLowerCase()}-
|
|
59
|
-
: `${(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
React.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
React.createElement(Heading, { headingOffset: 1, id: parentComponentName
|
|
68
|
-
? `${parentComponentName.toLowerCase()}-props-api`
|
|
69
|
-
: `${(_b = value.displayName) === null || _b === void 0 ? void 0 : _b.toLowerCase()}-props-api` }, "Props"),
|
|
70
|
-
value.baseElement && (React.createElement(ParentComponentJSDocContext.Provider, { value: defaultJSDoc },
|
|
71
|
-
React.createElement(MDX, { as: "p" },
|
|
72
|
-
"Props extend from ",
|
|
73
|
-
React.createElement(Value, { value: value.baseElement }),
|
|
74
|
-
". Changing the ",
|
|
75
|
-
React.createElement("code", null, "as"),
|
|
76
|
-
" prop will change the element interface."))),
|
|
77
|
-
value.componentType === 'container' && value.model ? (React.createElement(MDX, { as: "p" },
|
|
78
|
-
"Props extend from ",
|
|
79
|
-
React.createElement(SymbolDialog, { value: { kind: 'symbol', name: `${value.model}Config` } }),
|
|
80
|
-
". If a ",
|
|
81
|
-
React.createElement("code", null, "model"),
|
|
82
|
-
" is passed, props from ",
|
|
83
|
-
React.createElement("code", null,
|
|
84
|
-
value.model,
|
|
85
|
-
"Config"),
|
|
86
|
-
" are ignored.")) : null,
|
|
87
|
-
Object.keys(groups).map(key => {
|
|
88
|
-
return (React.createElement(React.Fragment, { key: key }, key === 'Local' ? (React.createElement(PropertiesTable, { properties: groups[key] })) : (React.createElement(Expandable, null,
|
|
89
|
-
React.createElement(Expandable.Target, { headingLevel: "h5" },
|
|
90
|
-
React.createElement(Expandable.Title, null, key),
|
|
91
|
-
React.createElement(Expandable.Icon, { iconPosition: "end" })),
|
|
92
|
-
React.createElement(Expandable.Content, null,
|
|
93
|
-
React.createElement(PropertiesTable, { properties: groups[key] }))))));
|
|
94
|
-
}),
|
|
95
|
-
value.elemPropsHook ? (React.createElement(SymbolDoc, { name: value.elemPropsHook, headingStart: headingLevel + 1 })) : null,
|
|
96
|
-
value.subComponents
|
|
97
|
-
? value.subComponents.map((c, i) => {
|
|
98
|
-
var _a;
|
|
99
|
-
return (React.createElement(React.Fragment, { key: i },
|
|
100
|
-
React.createElement(Heading, { id: `${(_a = value.displayName) === null || _a === void 0 ? void 0 : _a.toLowerCase()}.${c.name.toLowerCase()}-api` },
|
|
101
|
-
parentComponentName ? parentComponentName : value.displayName,
|
|
102
|
-
".",
|
|
103
|
-
c.name),
|
|
104
|
-
React.createElement(ParentComponentNameContext.Provider, { value: `${parentComponentName ? parentComponentName : value.displayName}.${c.name}` },
|
|
105
|
-
React.createElement(ParentComponentJSDocContext.Provider, { value: c },
|
|
106
|
-
React.createElement(SymbolDoc, { name: c.symbol, fileName: c.declarations[c.declarations.length - 1].filePath, hideHeading: true, descriptionOverride: c.description })))));
|
|
107
|
-
})
|
|
108
|
-
: null,
|
|
109
|
-
value.componentType === 'container' && value.model ? (React.createElement(React.Fragment, null,
|
|
110
|
-
React.createElement(Heading, { id: `${(_c = value.displayName) === null || _c === void 0 ? void 0 : _c.toLowerCase()}-model-api`, headingOffset: -1 }, "Model"),
|
|
111
|
-
React.createElement(SymbolDoc, { name: `use${value.model}` }))) : null));
|
|
48
|
+
return (_jsxs(_Fragment, { children: [value.styleComponent ? (_jsxs(_Fragment, { children: [_jsx(Heading, { headingOffset: 1, id: parentComponentName
|
|
49
|
+
? `${parentComponentName.toLowerCase()}-layout-component-api`
|
|
50
|
+
: `${(_a = value.displayName) === null || _a === void 0 ? void 0 : _a.toLowerCase()}-layout-component-api`, children: "Layout Component" }), _jsxs(MDX, { as: "p", children: [_jsx("code", { children: value.displayName || parentComponentName }), " supports all props from the", _jsx("code", { children: _jsx(ParentComponentJSDocContext.Provider, { value: defaultJSDoc, children: _jsx(SymbolDialog, { value: value.styleComponent }) }) }), "layout component."] })] })) : null, _jsx(Heading, { headingOffset: 1, id: parentComponentName
|
|
51
|
+
? `${parentComponentName.toLowerCase()}-props-api`
|
|
52
|
+
: `${(_b = value.displayName) === null || _b === void 0 ? void 0 : _b.toLowerCase()}-props-api`, children: "Props" }), value.baseElement && (_jsx(ParentComponentJSDocContext.Provider, { value: defaultJSDoc, children: _jsxs(MDX, { as: "p", children: ["Props extend from ", _jsx(Value, { value: value.baseElement }), ". Changing the ", _jsx("code", { children: "as" }), " prop will change the element interface."] }) })), value.componentType === 'container' && value.model ? (_jsxs(MDX, { as: "p", children: ["Props extend from ", _jsx(SymbolDialog, { value: { kind: 'symbol', name: `${value.model}Config` } }), ". If a ", _jsx("code", { children: "model" }), " is passed, props from ", _jsxs("code", { children: [value.model, "Config"] }), " are ignored."] })) : null, Object.keys(groups).map(key => {
|
|
53
|
+
return (_jsx(React.Fragment, { children: key === 'Local' ? (_jsx(PropertiesTable, { properties: groups[key] })) : (_jsxs(Expandable, { children: [_jsxs(Expandable.Target, { headingLevel: "h5", children: [_jsx(Expandable.Title, { children: key }), _jsx(Expandable.Icon, { iconPosition: "end" })] }), _jsx(Expandable.Content, { children: _jsx(PropertiesTable, { properties: groups[key] }) })] })) }, key));
|
|
54
|
+
}), value.elemPropsHook ? (_jsx(SymbolDoc, { name: value.elemPropsHook, headingStart: headingLevel + 1 })) : null, value.subComponents
|
|
55
|
+
? value.subComponents.map((c, i) => {
|
|
56
|
+
var _a;
|
|
57
|
+
return (_jsxs(React.Fragment, { children: [_jsxs(Heading, { id: `${(_a = value.displayName) === null || _a === void 0 ? void 0 : _a.toLowerCase()}.${c.name.toLowerCase()}-api`, children: [parentComponentName ? parentComponentName : value.displayName, ".", c.name] }), _jsx(ParentComponentNameContext.Provider, { value: `${parentComponentName ? parentComponentName : value.displayName}.${c.name}`, children: _jsx(ParentComponentJSDocContext.Provider, { value: c, children: _jsx(SymbolDoc, { name: c.symbol, fileName: c.declarations[c.declarations.length - 1].filePath, hideHeading: true, descriptionOverride: c.description }) }) })] }, i));
|
|
58
|
+
})
|
|
59
|
+
: null, value.componentType === 'container' && value.model ? (_jsxs(_Fragment, { children: [_jsx(Heading, { id: `${(_c = value.displayName) === null || _c === void 0 ? void 0 : _c.toLowerCase()}-model-api`, headingOffset: -1, children: "Model" }), _jsx(SymbolDoc, { name: `use${value.model}` })] })) : null] }));
|
|
112
60
|
});
|
|
113
61
|
function groupProps(props) {
|
|
114
62
|
const categories = { Local: [] };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ExternalHyperlink } from '@workday/canvas-kit-react/button';
|
|
3
3
|
import { renderTypeParameters } from '../widgetUtils';
|
|
4
4
|
import { registerWidget } from '../Value';
|
|
5
|
-
registerWidget('external', ({ value }) => (
|
|
6
|
-
React.createElement(ExternalHyperlink, { href: value.url, iconLabel: "Open link in new window" }, value.name),
|
|
7
|
-
renderTypeParameters(value.typeParameters))));
|
|
5
|
+
registerWidget('external', ({ value }) => (_jsxs(_Fragment, { children: [_jsx(ExternalHyperlink, { href: value.url, iconLabel: "Open link in new window", children: value.name }), renderTypeParameters(value.typeParameters)] })));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { DescriptionTooltip } from '../DescriptionTooltip';
|
|
3
4
|
import { MdxJSToJSX } from '../MDXElements';
|
|
@@ -5,32 +6,12 @@ import { registerWidget, Value } from '../Value';
|
|
|
5
6
|
import { RenderContext, IndentLevelContext, indent, renderTypeParameters } from '../widgetUtils';
|
|
6
7
|
registerWidget('function', ({ value }) => {
|
|
7
8
|
const level = React.useContext(IndentLevelContext);
|
|
8
|
-
return (
|
|
9
|
-
value.name && React.createElement(Value, { value: value.name }),
|
|
10
|
-
renderTypeParameters(value.typeParameters),
|
|
11
|
-
React.createElement("span", { className: "token punctuation" }, "("),
|
|
12
|
-
React.createElement(React.Fragment, null, value.parameters.map((p, index) => (React.createElement(React.Fragment, { key: index },
|
|
13
|
-
index !== 0 && React.createElement("span", { className: "token punctuation" }, ", "),
|
|
14
|
-
value.parameters.length > 1 && (React.createElement(React.Fragment, null,
|
|
15
|
-
React.createElement("br", null),
|
|
16
|
-
indent(level + 1))),
|
|
17
|
-
value.parameters.length > 1 ? (React.createElement(IndentLevelContext.Provider, { value: level + 1 },
|
|
18
|
-
React.createElement(Value, { value: p }))) : (React.createElement(Value, { value: p })),
|
|
19
|
-
index === value.parameters.length - 1 && index > 0 && (React.createElement(React.Fragment, null,
|
|
20
|
-
React.createElement("br", null),
|
|
21
|
-
indent(level))))))),
|
|
22
|
-
React.createElement("span", { className: "token operator" }, ")\u00A0=>\u00A0"),
|
|
23
|
-
React.createElement(Value, { value: value.returnType })));
|
|
9
|
+
return (_jsxs(RenderContext.Provider, { value: "inline", children: [value.name && _jsx(Value, { value: value.name }), renderTypeParameters(value.typeParameters), _jsx("span", { className: "token punctuation", children: "(" }), _jsx(_Fragment, { children: value.parameters.map((p, index) => (_jsxs(React.Fragment, { children: [index !== 0 && _jsx("span", { className: "token punctuation", children: ", " }), value.parameters.length > 1 && (_jsxs(_Fragment, { children: [_jsx("br", {}), indent(level + 1)] })), value.parameters.length > 1 ? (_jsx(IndentLevelContext.Provider, { value: level + 1, children: _jsx(Value, { value: p }) })) : (_jsx(Value, { value: p })), index === value.parameters.length - 1 && index > 0 && (_jsxs(_Fragment, { children: [_jsx("br", {}), indent(level)] }))] }, index))) }), _jsx("span", { className: "token operator", children: ")\u00A0=>\u00A0" }), _jsx(Value, { value: value.returnType })] }));
|
|
24
10
|
});
|
|
25
11
|
registerWidget('parameter', ({ value }) => {
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
textDecorationStyle: 'dotted',
|
|
32
|
-
} }, value.name))) : (React.createElement("span", { className: "token property" }, value.name)),
|
|
33
|
-
React.createElement("span", { className: "token punctuation" }, ":"),
|
|
34
|
-
"\u00A0",
|
|
35
|
-
React.createElement(Value, { value: value.type })));
|
|
12
|
+
return (_jsxs(RenderContext.Provider, { value: "inline", children: [value.description ? (_jsx(DescriptionTooltip, { style: { maxWidth: '50em' }, title: _jsx(MdxJSToJSX, { children: value.description }), children: _jsx("span", { className: "token property", style: {
|
|
13
|
+
cursor: 'pointer',
|
|
14
|
+
textDecoration: 'underline',
|
|
15
|
+
textDecorationStyle: 'dotted',
|
|
16
|
+
}, children: value.name }) })) : (_jsx("span", { className: "token property", children: value.name })), _jsx("span", { className: "token punctuation", children: ":" }), "\u00A0", _jsx(Value, { value: value.type })] }));
|
|
36
17
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { registerWidget, Value } from '../Value';
|
|
3
4
|
import { RenderContext } from '../widgetUtils';
|
|
4
5
|
registerWidget('intersection', ({ value }) => {
|
|
5
|
-
return (
|
|
6
|
-
i !== 0 && React.createElement("span", { className: "token punctuation" }, " & "),
|
|
7
|
-
React.createElement(Value, { value: v }))))));
|
|
6
|
+
return (_jsx(RenderContext.Provider, { value: "inline", children: value.value.map((v, i) => (_jsxs(React.Fragment, { children: [i !== 0 && _jsx("span", { className: "token punctuation", children: " & " }), _jsx(Value, { value: v })] }, i))) }));
|
|
8
7
|
});
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { PropertiesTable, registerWidget, Value } from '../Value';
|
|
3
3
|
import { Heading } from '../widgetUtils';
|
|
4
4
|
registerWidget('model', ({ value }) => {
|
|
5
|
-
return (
|
|
6
|
-
React.createElement(Heading, null, "State"),
|
|
7
|
-
React.createElement(PropertiesTable, { properties: value.state, showDefault: false }),
|
|
8
|
-
React.createElement(Heading, null, "Events"),
|
|
9
|
-
React.createElement(PropertiesTable, { properties: value.events, showDefault: false }),
|
|
10
|
-
value.modelProperties.length > 0 && (React.createElement(React.Fragment, null,
|
|
11
|
-
React.createElement(Heading, null, "Additional Properties"),
|
|
12
|
-
React.createElement(PropertiesTable, { properties: value.modelProperties, showDefault: false })))));
|
|
5
|
+
return (_jsxs(_Fragment, { children: [_jsx(Heading, { children: "State" }), _jsx(PropertiesTable, { properties: value.state, showDefault: false }), _jsx(Heading, { children: "Events" }), _jsx(PropertiesTable, { properties: value.events, showDefault: false }), value.modelProperties.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Heading, { children: "Additional Properties" }), _jsx(PropertiesTable, { properties: value.modelProperties, showDefault: false })] }))] }));
|
|
13
6
|
});
|
|
14
7
|
registerWidget('modelHook', ({ value, doc }) => {
|
|
15
|
-
return (
|
|
16
|
-
React.createElement("span", { className: "token symbol" }, value.name),
|
|
17
|
-
' ',
|
|
18
|
-
React.createElement("span", { className: "token punctuation" }, "("),
|
|
19
|
-
React.createElement("span", { className: "value symbol" }, "config"),
|
|
20
|
-
":",
|
|
21
|
-
' ',
|
|
22
|
-
React.createElement(Value, { value: { kind: 'symbol', name: `${value.name.replace('use', '')}Config` } }),
|
|
23
|
-
React.createElement("span", { className: "token punctuation" }, "): "),
|
|
24
|
-
React.createElement(Value, { value: { kind: 'symbol', name: `${value.name.replace('use', '')}` } })));
|
|
8
|
+
return (_jsxs("code", { children: [_jsx("span", { className: "token symbol", children: value.name }), ' ', _jsx("span", { className: "token punctuation", children: "(" }), _jsx("span", { className: "value symbol", children: "config" }), ":", ' ', _jsx(Value, { value: { kind: 'symbol', name: `${value.name.replace('use', '')}Config` } }), _jsx("span", { className: "token punctuation", children: "): " }), _jsx(Value, { value: { kind: 'symbol', name: `${value.name.replace('use', '')}` } })] }));
|
|
25
9
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { PropertiesInline, PropertiesTable, registerWidget } from '../Value';
|
|
3
4
|
import { RenderContext } from '../widgetUtils';
|
|
4
5
|
registerWidget('object', ({ value }) => {
|
|
5
6
|
const renderContext = React.useContext(RenderContext);
|
|
6
|
-
return renderContext === 'inline' ? (
|
|
7
|
-
React.createElement(PropertiesTable, { properties: value.properties })));
|
|
7
|
+
return renderContext === 'inline' ? (_jsx(PropertiesInline, { properties: value.properties })) : (_jsx(RenderContext.Provider, { value: "inline", children: _jsx(PropertiesTable, { properties: value.properties }) }));
|
|
8
8
|
});
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { registerWidget, Value } from '../Value';
|
|
3
3
|
registerWidget('parenthesis', ({ value }) => {
|
|
4
|
-
return (
|
|
5
|
-
React.createElement("span", { className: "token punctuation" }, "("),
|
|
6
|
-
React.createElement(Value, { value: value.value }),
|
|
7
|
-
React.createElement("span", { className: "token punctuation" }, ")")));
|
|
4
|
+
return (_jsxs("span", { children: [_jsx("span", { className: "token punctuation", children: "(" }), _jsx(Value, { value: value.value }), _jsx("span", { className: "token punctuation", children: ")" })] }));
|
|
8
5
|
});
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { registerWidget, Value } from '../Value';
|
|
3
3
|
import { renderTypeParameters } from '../widgetUtils';
|
|
4
|
-
registerWidget('primitive', ({ value }) => (
|
|
5
|
-
registerWidget('boolean', ({ value }) => (
|
|
6
|
-
registerWidget('string', ({ value }) => (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"'")));
|
|
10
|
-
registerWidget('number', ({ value }) => (React.createElement("span", { className: "token number" }, value.value)));
|
|
11
|
-
registerWidget('generic', ({ value }) => (React.createElement("span", { className: "token symbol" }, value.name)));
|
|
4
|
+
registerWidget('primitive', ({ value }) => (_jsx("span", { className: "token primitive", children: value.value })));
|
|
5
|
+
registerWidget('boolean', ({ value }) => (_jsx("span", { className: "token primitive", children: String(value.value) })));
|
|
6
|
+
registerWidget('string', ({ value }) => (_jsxs("span", { className: "token string", children: ["'", value.value, "'"] })));
|
|
7
|
+
registerWidget('number', ({ value }) => (_jsx("span", { className: "token number", children: value.value })));
|
|
8
|
+
registerWidget('generic', ({ value }) => (_jsx("span", { className: "token symbol", children: value.name })));
|
|
12
9
|
registerWidget('type', ({ value, doc }) => {
|
|
13
|
-
return (
|
|
14
|
-
(doc === null || doc === void 0 ? void 0 : doc.name) && (React.createElement(React.Fragment, null,
|
|
15
|
-
React.createElement("span", { className: "token keyword" }, "type"),
|
|
16
|
-
' ',
|
|
17
|
-
React.createElement("span", { className: "token symbol" }, (doc === null || doc === void 0 ? void 0 : doc.name) || 'unknown'),
|
|
18
|
-
renderTypeParameters(value.typeParameters),
|
|
19
|
-
" ",
|
|
20
|
-
React.createElement("span", { className: "token operator" }, "="),
|
|
21
|
-
' ')),
|
|
22
|
-
React.createElement(Value, { value: value.value })));
|
|
10
|
+
return (_jsxs(_Fragment, { children: [(doc === null || doc === void 0 ? void 0 : doc.name) && (_jsxs(_Fragment, { children: [_jsx("span", { className: "token keyword", children: "type" }), ' ', _jsx("span", { className: "token symbol", children: (doc === null || doc === void 0 ? void 0 : doc.name) || 'unknown' }), renderTypeParameters(value.typeParameters), " ", _jsx("span", { className: "token operator", children: "=" }), ' '] })), _jsx(Value, { value: value.value })] }));
|
|
23
11
|
});
|
|
24
|
-
registerWidget('infer', ({ value }) => (
|
|
25
|
-
|
|
26
|
-
" ",
|
|
27
|
-
React.createElement(Value, { value: value.value }))));
|
|
28
|
-
registerWidget('keyof', ({ value }) => (React.createElement(React.Fragment, null,
|
|
29
|
-
React.createElement("span", { className: "token keyword" }, "keyof"),
|
|
30
|
-
" ",
|
|
31
|
-
React.createElement(Value, { value: value.name }))));
|
|
12
|
+
registerWidget('infer', ({ value }) => (_jsxs(_Fragment, { children: [_jsx("span", { className: "token keyword", children: "infer" }), " ", _jsx(Value, { value: value.value })] })));
|
|
13
|
+
registerWidget('keyof', ({ value }) => (_jsxs(_Fragment, { children: [_jsx("span", { className: "token keyword", children: "keyof" }), " ", _jsx(Value, { value: value.name })] })));
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { registerWidget, Value } from '../Value';
|
|
3
3
|
registerWidget('qualifiedName', ({ value }) => {
|
|
4
|
-
return (
|
|
5
|
-
React.createElement(Value, { value: value.left }),
|
|
6
|
-
React.createElement("span", { className: "token punctuation" }, "."),
|
|
7
|
-
React.createElement(Value, { value: value.right })));
|
|
4
|
+
return (_jsxs(_Fragment, { children: [_jsx(Value, { value: value.left }), _jsx("span", { className: "token punctuation", children: "." }), _jsx(Value, { value: value.right })] }));
|
|
8
5
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { registerWidget } from '../Value';
|
|
3
3
|
import { SymbolDialog } from '../widgetUtils';
|
|
4
4
|
registerWidget('symbol', ({ value }) => {
|
|
5
|
-
return
|
|
5
|
+
return _jsx(SymbolDialog, { value: value });
|
|
6
6
|
});
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { registerWidget, Value } from '../Value';
|
|
3
3
|
import { RenderContext } from '../widgetUtils';
|
|
4
4
|
registerWidget('tuple', ({ value }) => {
|
|
5
|
-
return (
|
|
6
|
-
React.createElement("span", { className: "token punctuation" }, "["),
|
|
7
|
-
value.value.map((v, i) => (React.createElement(Value, { key: i, value: v }))),
|
|
8
|
-
React.createElement("span", { className: "token punctuation" }, "]")));
|
|
5
|
+
return (_jsxs(RenderContext.Provider, { value: "inline", children: [_jsx("span", { className: "token punctuation", children: "[" }), value.value.map((v, i) => (_jsx(Value, { value: v }, i))), _jsx("span", { className: "token punctuation", children: "]" })] }));
|
|
9
6
|
});
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { registerWidget, Value } from '../Value';
|
|
3
3
|
registerWidget('typeParameter', ({ value }) => {
|
|
4
|
-
return (
|
|
5
|
-
React.createElement("span", { className: "token symbol" }, value.name),
|
|
6
|
-
value.constraint && (React.createElement(React.Fragment, null,
|
|
7
|
-
' ',
|
|
8
|
-
React.createElement("span", { className: "token keyword" }, "extends"),
|
|
9
|
-
" ",
|
|
10
|
-
React.createElement(Value, { value: value.constraint }))),
|
|
11
|
-
value.defaultValue && (React.createElement(React.Fragment, null,
|
|
12
|
-
' ',
|
|
13
|
-
React.createElement("span", { className: "token operator" }, "="),
|
|
14
|
-
" ",
|
|
15
|
-
React.createElement(Value, { value: value.defaultValue })))));
|
|
4
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "token symbol", children: value.name }), value.constraint && (_jsxs(_Fragment, { children: [' ', _jsx("span", { className: "token keyword", children: "extends" }), " ", _jsx(Value, { value: value.constraint })] })), value.defaultValue && (_jsxs(_Fragment, { children: [' ', _jsx("span", { className: "token operator", children: "=" }), " ", _jsx(Value, { value: value.defaultValue })] }))] }));
|
|
16
5
|
});
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { registerWidget, Value } from '../Value';
|
|
3
4
|
import { IndentLevelContext, RenderContext, indent } from '../widgetUtils';
|
|
4
5
|
registerWidget('union', ({ value }) => {
|
|
5
6
|
const level = React.useContext(IndentLevelContext);
|
|
6
|
-
return (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
value.value.length > 3 && (React.createElement(React.Fragment, null,
|
|
10
|
-
React.createElement("br", null),
|
|
11
|
-
indent(level + 1))),
|
|
12
|
-
index !== 0 && React.createElement("span", { className: "token punctuation" }, " |\u00A0"),
|
|
13
|
-
React.createElement(IndentLevelContext.Provider, { value: level + 1 },
|
|
14
|
-
React.createElement(Value, { value: v }))));
|
|
15
|
-
})));
|
|
7
|
+
return (_jsx(RenderContext.Provider, { value: "inline", children: value.value.map((v, index) => {
|
|
8
|
+
return (_jsxs(React.Fragment, { children: [' ', value.value.length > 3 && (_jsxs(_Fragment, { children: [_jsx("br", {}), indent(level + 1)] })), index !== 0 && _jsx("span", { className: "token punctuation", children: " |\u00A0" }), _jsx(IndentLevelContext.Provider, { value: level + 1, children: _jsx(Value, { value: v }) })] }, index));
|
|
9
|
+
}) }));
|
|
16
10
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export interface InstallBlockProps {
|
|
3
2
|
command?: string;
|
|
4
3
|
packageName?: string;
|
|
5
4
|
}
|
|
6
|
-
export declare const InstallBlock: ({ command, packageName }: InstallBlockProps) =>
|
|
5
|
+
export declare const InstallBlock: ({ command, packageName }: InstallBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
//# sourceMappingURL=installBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installBlock.d.ts","sourceRoot":"","sources":["../../../mdx/installBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"installBlock.d.ts","sourceRoot":"","sources":["../../../mdx/installBlock.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,6BAA4B,iBAAiB,4CA8BrE,CAAC"}
|
|
@@ -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 { Flex } from '@workday/canvas-kit-react/layout';
|
|
3
4
|
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
@@ -14,10 +15,5 @@ export const InstallBlock = ({ command, packageName }) => {
|
|
|
14
15
|
navigator.clipboard.writeText(commandRef.current.innerText);
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
|
-
return (
|
|
18
|
-
React.createElement("pre", { ref: commandRef },
|
|
19
|
-
React.createElement("span", { style: { color: colors.blueberry200 } }, command),
|
|
20
|
-
' ',
|
|
21
|
-
React.createElement("span", { style: { color: colors.frenchVanilla100 } }, packageName)),
|
|
22
|
-
React.createElement(PrimaryButton, { variant: "inverse", onClick: handleCopy, size: "small" }, copied ? 'Copied' : 'Copy')));
|
|
18
|
+
return (_jsxs(Flex, { padding: "xs", backgroundColor: colors.licorice500, borderRadius: "m", justifyContent: "space-between", alignItems: "center", flexWrap: 'wrap', children: [_jsxs("pre", { ref: commandRef, children: [_jsx("span", { style: { color: colors.blueberry200 }, children: command }), ' ', _jsx("span", { style: { color: colors.frenchVanilla100 }, children: packageName })] }), _jsx(PrimaryButton, { variant: "inverse", onClick: handleCopy, size: "small", children: copied ? 'Copied' : 'Copy' })] }));
|
|
23
19
|
};
|