@workday/canvas-kit-docs 9.1.0 → 9.1.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/lib/specs.js +15 -0
- package/dist/es6/lib/widgetUtils.js +1 -1
- package/dist/es6/lib/widgets/component.js +2 -1
- package/dist/es6/lib/widgets/enhancedComponent.js +10 -4
- package/lib/widgetUtils.tsx +1 -1
- package/lib/widgets/component.tsx +3 -1
- package/lib/widgets/enhancedComponent.tsx +24 -4
- package/package.json +5 -5
package/dist/es6/lib/specs.js
CHANGED
|
@@ -516,6 +516,21 @@ module.exports = {specifications: [
|
|
|
516
516
|
]
|
|
517
517
|
}
|
|
518
518
|
]
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"type": "describe",
|
|
522
|
+
"name": "when the user types in a value not found",
|
|
523
|
+
"children": [
|
|
524
|
+
{
|
|
525
|
+
"type": "describe",
|
|
526
|
+
"name": "when the user hits the enter key",
|
|
527
|
+
"children": []
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"type": "it",
|
|
531
|
+
"name": "should not clear the input"
|
|
532
|
+
}
|
|
533
|
+
]
|
|
519
534
|
}
|
|
520
535
|
]
|
|
521
536
|
}
|
|
@@ -235,7 +235,7 @@ export const SymbolDoc = ({ name, fileName, headingStart = 3, hideDescription =
|
|
|
235
235
|
const contents = requiresCodeWrapper ? (React.createElement("code", { style: { display: 'block' } }, children)) : (children);
|
|
236
236
|
const symbolDocContents = (React.createElement(StyledSymbolDoc, Object.assign({}, elemProps),
|
|
237
237
|
React.createElement(HeadingLevelContext.Provider, { value: headingStart },
|
|
238
|
-
!hideHeading && React.createElement(Heading,
|
|
238
|
+
!hideHeading && React.createElement(Heading, { id: `${name.toLowerCase()}-api` }, name),
|
|
239
239
|
!hideDescription && doc && (React.createElement(MdxJSToJSX, null, descriptionOverride || doc.description)),
|
|
240
240
|
contents)));
|
|
241
241
|
return symbolDocBreadcrumb === undefined ? (React.createElement(SymbolDocWrapper, null, symbolDocContents)) : (symbolDocContents);
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { PropertiesTable, registerWidget } from '../Value';
|
|
3
3
|
import { Heading } from '../widgetUtils';
|
|
4
4
|
registerWidget('component', ({ value, doc, meta }) => {
|
|
5
|
+
var _a;
|
|
5
6
|
return (React.createElement(React.Fragment, null,
|
|
6
|
-
React.createElement(Heading, { headingOffset: 1 }, "Props"),
|
|
7
|
+
React.createElement(Heading, { id: `${(_a = value.displayName) === null || _a === void 0 ? void 0 : _a.toLowerCase()}-props-api`, headingOffset: 1 }, "Props"),
|
|
7
8
|
React.createElement(PropertiesTable, { properties: value.props })));
|
|
8
9
|
});
|
|
@@ -34,6 +34,7 @@ const fileNameToCategoryMap = {
|
|
|
34
34
|
Other: ['utils/other'],
|
|
35
35
|
};
|
|
36
36
|
registerWidget('enhancedComponent', ({ value, doc, meta }) => {
|
|
37
|
+
var _a, _b, _c;
|
|
37
38
|
const groups = groupProps(value.props);
|
|
38
39
|
const parentComponentName = React.useContext(ParentComponentNameContext);
|
|
39
40
|
const headingLevel = React.useContext(HeadingLevelContext);
|
|
@@ -53,7 +54,9 @@ registerWidget('enhancedComponent', ({ value, doc, meta }) => {
|
|
|
53
54
|
}
|
|
54
55
|
return (React.createElement(React.Fragment, null,
|
|
55
56
|
value.styleComponent ? (React.createElement(React.Fragment, null,
|
|
56
|
-
React.createElement(Heading, { headingOffset: 1
|
|
57
|
+
React.createElement(Heading, { headingOffset: 1, id: parentComponentName
|
|
58
|
+
? `${parentComponentName.toLowerCase()}-layout-component-api`
|
|
59
|
+
: `${(_a = value.displayName) === null || _a === void 0 ? void 0 : _a.toLowerCase()}-layout-component-api` }, "Layout Component"),
|
|
57
60
|
React.createElement(MDX, { as: "p" },
|
|
58
61
|
React.createElement("code", null, value.displayName || parentComponentName),
|
|
59
62
|
" supports all props from the",
|
|
@@ -61,7 +64,9 @@ registerWidget('enhancedComponent', ({ value, doc, meta }) => {
|
|
|
61
64
|
React.createElement(ParentComponentJSDocContext.Provider, { value: defaultJSDoc },
|
|
62
65
|
React.createElement(SymbolDialog, { value: value.styleComponent }))),
|
|
63
66
|
"layout component."))) : null,
|
|
64
|
-
React.createElement(Heading, { headingOffset: 1
|
|
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"),
|
|
65
70
|
value.baseElement && (React.createElement(ParentComponentJSDocContext.Provider, { value: defaultJSDoc },
|
|
66
71
|
React.createElement(MDX, { as: "p" },
|
|
67
72
|
"Props extend from ",
|
|
@@ -90,8 +95,9 @@ registerWidget('enhancedComponent', ({ value, doc, meta }) => {
|
|
|
90
95
|
value.elemPropsHook ? (React.createElement(SymbolDoc, { name: value.elemPropsHook, headingStart: headingLevel + 1 })) : null,
|
|
91
96
|
value.subComponents
|
|
92
97
|
? value.subComponents.map((c, i) => {
|
|
98
|
+
var _a;
|
|
93
99
|
return (React.createElement(React.Fragment, { key: i },
|
|
94
|
-
React.createElement(Heading, null,
|
|
100
|
+
React.createElement(Heading, { id: `${(_a = value.displayName) === null || _a === void 0 ? void 0 : _a.toLowerCase()}.${c.name.toLowerCase()}-api` },
|
|
95
101
|
parentComponentName ? parentComponentName : value.displayName,
|
|
96
102
|
".",
|
|
97
103
|
c.name),
|
|
@@ -101,7 +107,7 @@ registerWidget('enhancedComponent', ({ value, doc, meta }) => {
|
|
|
101
107
|
})
|
|
102
108
|
: null,
|
|
103
109
|
value.componentType === 'container' && value.model ? (React.createElement(React.Fragment, null,
|
|
104
|
-
React.createElement(Heading, { headingOffset: -1 }, "Model"),
|
|
110
|
+
React.createElement(Heading, { id: `${(_c = value.displayName) === null || _c === void 0 ? void 0 : _c.toLowerCase()}-model-api`, headingOffset: -1 }, "Model"),
|
|
105
111
|
React.createElement(SymbolDoc, { name: `use${value.model}` }))) : null));
|
|
106
112
|
});
|
|
107
113
|
function groupProps(props) {
|
package/lib/widgetUtils.tsx
CHANGED
|
@@ -402,7 +402,7 @@ export const SymbolDoc = ({
|
|
|
402
402
|
const symbolDocContents = (
|
|
403
403
|
<StyledSymbolDoc {...elemProps}>
|
|
404
404
|
<HeadingLevelContext.Provider value={headingStart}>
|
|
405
|
-
{!hideHeading && <Heading>{name}</Heading>}
|
|
405
|
+
{!hideHeading && <Heading id={`${name.toLowerCase()}-api`}>{name}</Heading>}
|
|
406
406
|
{!hideDescription && doc && (
|
|
407
407
|
<MdxJSToJSX>{descriptionOverride || doc.description}</MdxJSToJSX>
|
|
408
408
|
)}
|
|
@@ -7,7 +7,9 @@ import {Heading} from '../widgetUtils';
|
|
|
7
7
|
registerWidget<ComponentValue>('component', ({value, doc, meta}) => {
|
|
8
8
|
return (
|
|
9
9
|
<>
|
|
10
|
-
<Heading headingOffset={1}>
|
|
10
|
+
<Heading id={`${value.displayName?.toLowerCase()}-props-api`} headingOffset={1}>
|
|
11
|
+
Props
|
|
12
|
+
</Heading>
|
|
11
13
|
<PropertiesTable properties={value.props}></PropertiesTable>
|
|
12
14
|
</>
|
|
13
15
|
);
|
|
@@ -68,7 +68,16 @@ registerWidget<EnhancedComponentValue>('enhancedComponent', ({value, doc, meta})
|
|
|
68
68
|
<>
|
|
69
69
|
{value.styleComponent ? (
|
|
70
70
|
<>
|
|
71
|
-
<Heading
|
|
71
|
+
<Heading
|
|
72
|
+
headingOffset={1}
|
|
73
|
+
id={
|
|
74
|
+
parentComponentName
|
|
75
|
+
? `${parentComponentName.toLowerCase()}-layout-component-api`
|
|
76
|
+
: `${value.displayName?.toLowerCase()}-layout-component-api`
|
|
77
|
+
}
|
|
78
|
+
>
|
|
79
|
+
Layout Component
|
|
80
|
+
</Heading>
|
|
72
81
|
<MDX as="p">
|
|
73
82
|
<code>{value.displayName || parentComponentName}</code> supports all props from the
|
|
74
83
|
<code>
|
|
@@ -80,7 +89,16 @@ registerWidget<EnhancedComponentValue>('enhancedComponent', ({value, doc, meta})
|
|
|
80
89
|
</MDX>
|
|
81
90
|
</>
|
|
82
91
|
) : null}
|
|
83
|
-
<Heading
|
|
92
|
+
<Heading
|
|
93
|
+
headingOffset={1}
|
|
94
|
+
id={
|
|
95
|
+
parentComponentName
|
|
96
|
+
? `${parentComponentName.toLowerCase()}-props-api`
|
|
97
|
+
: `${value.displayName?.toLowerCase()}-props-api`
|
|
98
|
+
}
|
|
99
|
+
>
|
|
100
|
+
Props
|
|
101
|
+
</Heading>
|
|
84
102
|
{value.baseElement && (
|
|
85
103
|
<ParentComponentJSDocContext.Provider value={defaultJSDoc}>
|
|
86
104
|
<MDX as="p">
|
|
@@ -122,7 +140,7 @@ registerWidget<EnhancedComponentValue>('enhancedComponent', ({value, doc, meta})
|
|
|
122
140
|
? value.subComponents.map((c, i) => {
|
|
123
141
|
return (
|
|
124
142
|
<React.Fragment key={i}>
|
|
125
|
-
<Heading>
|
|
143
|
+
<Heading id={`${value.displayName?.toLowerCase()}.${c.name.toLowerCase()}-api`}>
|
|
126
144
|
{parentComponentName ? parentComponentName : value.displayName}.{c.name}
|
|
127
145
|
</Heading>
|
|
128
146
|
<ParentComponentNameContext.Provider
|
|
@@ -145,7 +163,9 @@ registerWidget<EnhancedComponentValue>('enhancedComponent', ({value, doc, meta})
|
|
|
145
163
|
: null}
|
|
146
164
|
{value.componentType === 'container' && value.model ? (
|
|
147
165
|
<>
|
|
148
|
-
<Heading headingOffset={-1}>
|
|
166
|
+
<Heading id={`${value.displayName?.toLowerCase()}-model-api`} headingOffset={-1}>
|
|
167
|
+
Model
|
|
168
|
+
</Heading>
|
|
149
169
|
<SymbolDoc name={`use${value.model}`} />
|
|
150
170
|
</>
|
|
151
171
|
) : null}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^9.1.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^9.1.
|
|
49
|
-
"@workday/canvas-kit-react": "^9.1.
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^9.1.2",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^9.1.2",
|
|
49
|
+
"@workday/canvas-kit-react": "^9.1.2",
|
|
50
50
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
51
51
|
"markdown-to-jsx": "^6.10.3",
|
|
52
52
|
"ts-node": "^10.9.1"
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"mkdirp": "^1.0.3",
|
|
58
58
|
"typescript": "4.2"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "a6373b653f90cdd16a25830ffbd34dff421940ac"
|
|
61
61
|
}
|