@workday/canvas-kit-docs 10.3.9 → 10.3.10

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.
@@ -0,0 +1,2 @@
1
+ export declare const VersionTable: () => JSX.Element;
2
+ //# sourceMappingURL=versionsTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versionsTable.d.ts","sourceRoot":"","sources":["../../../mdx/versionsTable.tsx"],"names":[],"mappings":"AA6DA,eAAO,MAAM,YAAY,mBAgCxB,CAAC"}
@@ -0,0 +1,76 @@
1
+ import React from 'react';
2
+ import { Table, StatusIndicator } from '@workday/canvas-kit-preview-react';
3
+ // @ts-ignore: Cannot find module error
4
+ import { version } from '../../../lerna.json';
5
+ // When we release a new version, add the support version before the first item.
6
+ const allVersions = [
7
+ {
8
+ versionNumber: version,
9
+ documentation: 'https://github.com/Workday/canvas-kit',
10
+ },
11
+ {
12
+ versionNumber: 9,
13
+ documentation: 'https://d2krrudi3mmzzw.cloudfront.net/v9/?path=/docs/welcome--page',
14
+ },
15
+ {
16
+ versionNumber: 8,
17
+ documentation: 'https://d2krrudi3mmzzw.cloudfront.net/v8/?path=/docs/welcome--page',
18
+ },
19
+ {
20
+ versionNumber: 7,
21
+ documentation: 'https://d2krrudi3mmzzw.cloudfront.net/v7/?path=/story/welcome-getting-started--page',
22
+ },
23
+ {
24
+ versionNumber: 6,
25
+ documentation: 'https://d2krrudi3mmzzw.cloudfront.net/v7/?path=/story/welcome-getting-started--page',
26
+ },
27
+ ];
28
+ const statusIndicators = {
29
+ stable: {
30
+ variant: 'blue',
31
+ label: 'Stable',
32
+ },
33
+ support: {
34
+ variant: 'green',
35
+ label: 'Support',
36
+ },
37
+ deprecated: {
38
+ variant: 'red',
39
+ label: 'No Longer Supported',
40
+ },
41
+ };
42
+ function getVersionStatusIndicator(versionNumber) {
43
+ // version from lerna is a string, so we need to do modify into a number
44
+ const currentMajorVersion = Number(version.split('.')[0]);
45
+ const modifiedVersionNumber = typeof versionNumber === 'string' ? Number(versionNumber.split('.')[0]) : versionNumber;
46
+ // if this is the current version
47
+ if (modifiedVersionNumber === currentMajorVersion) {
48
+ return statusIndicators.stable;
49
+ }
50
+ else if (modifiedVersionNumber === currentMajorVersion - 1) {
51
+ return statusIndicators.support;
52
+ }
53
+ else {
54
+ return statusIndicators.deprecated;
55
+ }
56
+ }
57
+ export const VersionTable = () => {
58
+ return (React.createElement(Table, null,
59
+ React.createElement(Table.Head, null,
60
+ React.createElement(Table.Row, null,
61
+ React.createElement(Table.Header, { scope: "col" }, "Version"),
62
+ React.createElement(Table.Header, { scope: "col" }, "Documentation"),
63
+ React.createElement(Table.Header, { scope: "col" }, "Status"))),
64
+ React.createElement(Table.Body, null, allVersions.map(item => {
65
+ const { label, variant } = getVersionStatusIndicator(item.versionNumber);
66
+ return (React.createElement(Table.Row, null,
67
+ React.createElement(Table.Cell, null,
68
+ "v",
69
+ item.versionNumber),
70
+ React.createElement(Table.Cell, null,
71
+ React.createElement("a", { href: item.documentation, target: "_blank", rel: "noreferrer" }, "Documentation")),
72
+ React.createElement(Table.Cell, null,
73
+ React.createElement(StatusIndicator, { variant: variant },
74
+ React.createElement(StatusIndicator.Label, null, label)))));
75
+ }))));
76
+ };
@@ -0,0 +1,8 @@
1
+ import {VersionTable} from './versionsTable';
2
+
3
+
4
+ ## Released Versions
5
+
6
+ Reference older versions documentation when needed.
7
+
8
+ <VersionTable />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "10.3.9",
3
+ "version": "10.3.10",
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,10 +44,10 @@
44
44
  "dependencies": {
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@storybook/csf": "0.0.1",
47
- "@workday/canvas-kit-labs-react": "^10.3.9",
48
- "@workday/canvas-kit-preview-react": "^10.3.9",
49
- "@workday/canvas-kit-react": "^10.3.9",
50
- "@workday/canvas-kit-styling": "^10.3.9",
47
+ "@workday/canvas-kit-labs-react": "^10.3.10",
48
+ "@workday/canvas-kit-preview-react": "^10.3.10",
49
+ "@workday/canvas-kit-react": "^10.3.10",
50
+ "@workday/canvas-kit-styling": "^10.3.10",
51
51
  "@workday/canvas-system-icons-web": "^3.0.0",
52
52
  "@workday/canvas-tokens-web": "^1.0.0",
53
53
  "markdown-to-jsx": "^6.10.3",
@@ -59,5 +59,5 @@
59
59
  "mkdirp": "^1.0.3",
60
60
  "typescript": "4.2"
61
61
  },
62
- "gitHead": "c348631b59726a81c05b4b89c226556ac382395e"
62
+ "gitHead": "add25445d3445ca701342ce14110a0d09b2f875b"
63
63
  }