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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/es6/docgen/createTraversals.js +41 -22
  2. package/dist/es6/docgen/docParser.js +285 -257
  3. package/dist/es6/docgen/getExternalSymbol.js +2 -2
  4. package/dist/es6/docgen/plugins/componentParser.js +28 -33
  5. package/dist/es6/docgen/plugins/enhancedComponentParser.js +211 -150
  6. package/dist/es6/docgen/plugins/modelParser.js +139 -79
  7. package/dist/es6/docgen/traversals.js +396 -397
  8. package/dist/es6/docgen/traverse.js +8 -9
  9. package/dist/es6/lib/DescriptionTooltip.js +1 -1
  10. package/dist/es6/lib/MDXElements.js +13 -39
  11. package/dist/es6/lib/MoreTooltip.js +21 -41
  12. package/dist/es6/lib/Specifications.js +30 -34
  13. package/dist/es6/lib/StylePropsTable.js +8 -9
  14. package/dist/es6/lib/Table.js +19 -30
  15. package/dist/es6/lib/Value.js +13 -17
  16. package/dist/es6/lib/docs.js +701 -397
  17. package/dist/es6/lib/widgetUtils.js +44 -76
  18. package/dist/es6/lib/widgets/array.js +1 -2
  19. package/dist/es6/lib/widgets/callExpression.js +4 -5
  20. package/dist/es6/lib/widgets/canvasColor.js +2 -2
  21. package/dist/es6/lib/widgets/component.js +1 -2
  22. package/dist/es6/lib/widgets/conditional.js +1 -2
  23. package/dist/es6/lib/widgets/enhancedComponent.js +19 -24
  24. package/dist/es6/lib/widgets/external.js +1 -4
  25. package/dist/es6/lib/widgets/function.js +5 -7
  26. package/dist/es6/lib/widgets/intersection.js +3 -4
  27. package/dist/es6/lib/widgets/model.js +4 -6
  28. package/dist/es6/lib/widgets/object.js +2 -3
  29. package/dist/es6/lib/widgets/parenthesis.js +1 -2
  30. package/dist/es6/lib/widgets/primitives.js +17 -39
  31. package/dist/es6/lib/widgets/qualifiedName.js +1 -2
  32. package/dist/es6/lib/widgets/symbol.js +1 -2
  33. package/dist/es6/lib/widgets/tuple.js +2 -3
  34. package/dist/es6/lib/widgets/typeParameter.js +1 -2
  35. package/dist/es6/lib/widgets/union.js +3 -4
  36. package/dist/es6/mdx/installBlock.js +6 -7
  37. package/dist/es6/mdx/style-props/examples/Background.js +5 -16
  38. package/dist/es6/mdx/style-props/examples/Border.js +5 -16
  39. package/dist/es6/mdx/style-props/examples/Color.js +5 -16
  40. package/dist/es6/mdx/style-props/examples/Depth.js +5 -16
  41. package/dist/es6/mdx/style-props/examples/Flex.js +11 -22
  42. package/dist/es6/mdx/style-props/examples/FlexItem.js +10 -21
  43. package/dist/es6/mdx/style-props/examples/Grid.js +6 -17
  44. package/dist/es6/mdx/style-props/examples/GridItem.js +6 -17
  45. package/dist/es6/mdx/style-props/examples/Layout.js +5 -16
  46. package/dist/es6/mdx/style-props/examples/Other.js +5 -16
  47. package/dist/es6/mdx/style-props/examples/Position.js +5 -16
  48. package/dist/es6/mdx/style-props/examples/Space.js +6 -17
  49. package/dist/es6/mdx/style-props/examples/Text.js +2 -2
  50. package/dist/es6/mdx/welcomePage.js +3 -3
  51. package/dist/mdx/9.0-UPGRADE-GUIDE.mdx +30 -3
  52. package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -1
  53. package/dist/mdx/preview-react/text-input/examples/Alert.tsx +1 -1
  54. package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +5 -2
  55. package/dist/mdx/react/banner/examples/StickyAnimation.tsx +7 -5
  56. package/dist/mdx/react/common/examples/ResponsiveViewport.tsx +2 -3
  57. package/package.json +5 -5
@@ -4,37 +4,56 @@
4
4
  import fs from 'fs';
5
5
  import path from 'path';
6
6
  ///** Create the guard fn
7
- var source = fs
7
+ const source = fs
8
8
  .readFileSync(path.join(__dirname, '../../../node_modules/typescript/lib/typescript.d.ts'))
9
9
  .toString();
10
- var lines = source.split('\n');
11
- var syntaxKinds = source.match(/export enum SyntaxKind \{([^}]+)\}/m);
12
- var pairs = syntaxKinds[1].match(/([a-z]+) = [\d]+/gi);
13
- var guardPairs = [];
14
- pairs === null || pairs === void 0 ? void 0 : pairs.forEach(function (pair) {
15
- var matches = pair.match(/([a-z]+) = [0-9]+/i);
10
+ const lines = source.split('\n');
11
+ const syntaxKinds = source.match(/export enum SyntaxKind \{([^}]+)\}/m);
12
+ const pairs = syntaxKinds[1].match(/([a-z]+) = [\d]+/gi);
13
+ const guardPairs = [];
14
+ pairs === null || pairs === void 0 ? void 0 : pairs.forEach(pair => {
15
+ const matches = pair.match(/([a-z]+) = [0-9]+/i);
16
16
  if (matches) {
17
- var syntaxKind_1 = matches[1];
18
- var lineIndex = lines.findIndex(function (l) { return l.includes("kind: SyntaxKind." + syntaxKind_1 + ";"); });
17
+ const syntaxKind = matches[1];
18
+ const lineIndex = lines.findIndex(l => l.includes(`kind: SyntaxKind.${syntaxKind};`));
19
19
  if (lineIndex > 0) {
20
- var matches_1 = lines[lineIndex - 1].match(/export interface ([a-z]+)\s/i);
21
- if (matches_1) {
22
- guardPairs.push([syntaxKind_1, matches_1[1]]);
20
+ const matches = lines[lineIndex - 1].match(/export interface ([a-z]+)\s/i);
21
+ if (matches) {
22
+ guardPairs.push([syntaxKind, matches[1]]);
23
23
  }
24
24
  }
25
25
  }
26
26
  });
27
- var guardFns = guardPairs.map(function (_a) {
28
- var kind = _a[0], typeName = _a[1];
29
- return "is" + kind + "(node: ts.Node): node is ts." + typeName + " {\n return node.kind === ts.SyntaxKind." + kind + ";\n }";
27
+ const guardFns = guardPairs.map(([kind, typeName]) => {
28
+ return `is${kind}(node: ts.Node): node is ts.${typeName} {
29
+ return node.kind === ts.SyntaxKind.${kind};
30
+ }`;
30
31
  });
31
- var kindMap = guardPairs.map(function (_a) {
32
- var kind = _a[0], typeName = _a[1];
33
- return kind + ": {} as any as ts." + typeName;
32
+ const kindMap = guardPairs.map(([kind, typeName]) => {
33
+ return `${kind}: {} as any as ts.${typeName}`;
34
34
  });
35
- var kindToString = guardPairs.map(function (_a) {
36
- var kind = _a[0];
37
- return "[ts.SyntaxKind." + kind + "]: '" + kind + "'";
35
+ const kindToString = guardPairs.map(([kind]) => {
36
+ return `[ts.SyntaxKind.${kind}]: '${kind}'`;
38
37
  });
39
- var output = "\n// This file is auto-generated from the createTraversals.ts file. Do not modify contents\nimport ts from 'typescript';\n\nexport const guards = {\n " + guardFns.join(',\n ') + "\n}\n\nexport const kindsMap = {\n " + kindMap.join(',\n ') + "\n}\n\nconst kindToString = {\n " + kindToString.join(',\n ') + "\n}\n\nexport function getKindNameFromNode(node: ts.Node): string {\n // @ts-ignore\n return kindToString[node.kind] || String(node.kind);\n}\n";
38
+ const output = `
39
+ // This file is auto-generated from the createTraversals.ts file. Do not modify contents
40
+ import ts from 'typescript';
41
+
42
+ export const guards = {
43
+ ${guardFns.join(',\n ')}
44
+ }
45
+
46
+ export const kindsMap = {
47
+ ${kindMap.join(',\n ')}
48
+ }
49
+
50
+ const kindToString = {
51
+ ${kindToString.join(',\n ')}
52
+ }
53
+
54
+ export function getKindNameFromNode(node: ts.Node): string {
55
+ // @ts-ignore
56
+ return kindToString[node.kind] || String(node.kind);
57
+ }
58
+ `;
40
59
  fs.writeFileSync(path.join(__dirname, 'traversals.ts'), output);