@workday/canvas-kit-docs 7.0.0-alpha.100-next.25 → 7.0.0-alpha.103-next.28

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.
@@ -1299,6 +1299,46 @@ module.exports = {specifications: [
1299
1299
  }
1300
1300
  ]
1301
1301
  },
1302
+ {
1303
+ "type": "file",
1304
+ "name": "Hyperlink.spec.ts",
1305
+ "children": [
1306
+ {
1307
+ "type": "describe",
1308
+ "name": "Button",
1309
+ "children": [
1310
+ {
1311
+ "type": "describe",
1312
+ "name": "given internal hyperlinks are rendered",
1313
+ "children": [
1314
+ {
1315
+ "type": "it",
1316
+ "name": "should not have any axe errors"
1317
+ },
1318
+ {
1319
+ "type": "it",
1320
+ "name": "should render the correct text"
1321
+ }
1322
+ ]
1323
+ },
1324
+ {
1325
+ "type": "describe",
1326
+ "name": "given external hyperlinks are rendered",
1327
+ "children": [
1328
+ {
1329
+ "type": "it",
1330
+ "name": "should not have any axe errors"
1331
+ },
1332
+ {
1333
+ "type": "it",
1334
+ "name": "should render the correct text"
1335
+ }
1336
+ ]
1337
+ }
1338
+ ]
1339
+ }
1340
+ ]
1341
+ },
1302
1342
  {
1303
1343
  "type": "file",
1304
1344
  "name": "Menu.spec.ts",
@@ -1299,6 +1299,46 @@ module.exports = {specifications: [
1299
1299
  }
1300
1300
  ]
1301
1301
  },
1302
+ {
1303
+ "type": "file",
1304
+ "name": "Hyperlink.spec.ts",
1305
+ "children": [
1306
+ {
1307
+ "type": "describe",
1308
+ "name": "Button",
1309
+ "children": [
1310
+ {
1311
+ "type": "describe",
1312
+ "name": "given internal hyperlinks are rendered",
1313
+ "children": [
1314
+ {
1315
+ "type": "it",
1316
+ "name": "should not have any axe errors"
1317
+ },
1318
+ {
1319
+ "type": "it",
1320
+ "name": "should render the correct text"
1321
+ }
1322
+ ]
1323
+ },
1324
+ {
1325
+ "type": "describe",
1326
+ "name": "given external hyperlinks are rendered",
1327
+ "children": [
1328
+ {
1329
+ "type": "it",
1330
+ "name": "should not have any axe errors"
1331
+ },
1332
+ {
1333
+ "type": "it",
1334
+ "name": "should render the correct text"
1335
+ }
1336
+ ]
1337
+ }
1338
+ ]
1339
+ }
1340
+ ]
1341
+ },
1302
1342
  {
1303
1343
  "type": "file",
1304
1344
  "name": "Menu.spec.ts",
@@ -0,0 +1,72 @@
1
+ import {Hyperlink, ExternalHyperlink} from '@workday/canvas-kit-react/button';
2
+ import {Specifications} from '@workday/canvas-kit-docs';
3
+
4
+ import Link from './examples/Hyperlink';
5
+ import LinkInverse from './examples/HyperlinkInverse';
6
+ import ExternalLink from './examples/ExternalHyperlink';
7
+ import ExternalLinkInverse from './examples/ExternalHyperlinkInverse';
8
+
9
+
10
+ # Canvas Kit Hyperlinks
11
+
12
+ Clickable anchor elements that extend the native `<a>` element with Canvas styling.
13
+
14
+ [> Workday Design Reference](https://design.workday.com/components/buttons/buttons)
15
+
16
+ ## Installation
17
+
18
+ ```sh
19
+ yarn add @workday/canvas-kit-react
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ### Hyperlink
25
+
26
+ `Hyperlink`s should be used when you want to navigate away from the current page or to an anchor on
27
+ the current page.
28
+
29
+ <ExampleCodeBlock code={Link} />
30
+
31
+ #### Inverse
32
+
33
+ `Hyperlink`s also have an `inverse` variant. Use this variant when you need to place a `Hyperlink` on a
34
+ dark or colorful background such as `blueberry400`.
35
+
36
+ <ExampleCodeBlock code={LinkInverse} />
37
+
38
+ #### Props
39
+
40
+ Undocumented props are spread to the underlying `<a>` element.
41
+
42
+ <ArgsTable of={Hyperlink} />
43
+
44
+ ### ExternalHyperlink
45
+
46
+ If your link should open in a new tab or window use the `ExternalHyperlink` component. It will let
47
+ users know about the behavior by adding an icon, `extLinkIcon`. By default, the icon has a label of
48
+ "Opens link in new window". You can override `aria-label` of the icon by using the `iconLabel`
49
+ prop. This override will be needed for translations.
50
+
51
+ <ExampleCodeBlock code={ExternalLink} />
52
+
53
+ `ExternalHyperlink`s also have an `inverse` variant. Use this variant when you need to place the link on a dark or colorful background such as `blueberry400`.
54
+
55
+ <ExampleCodeBlock code={ExternalLinkInverse} />
56
+
57
+ #### Props
58
+
59
+ Undocumented props are spread to the underlying `<a>` element.
60
+
61
+ <ArgsTable of={ExternalHyperlink} />
62
+
63
+ ### Accessible Use of the `as` Prop
64
+
65
+ Like many of our components, `Hyperlink` and `ExternalHyperlink` accept an `as` prop, which lets you change the underlying
66
+ semantic element - usually an `<a>`, or a `<button>`. This should be done with caution to ensure the
67
+ best accessibility. Generally, `<button>` elements should be used for actions, and `<a>` elements
68
+ should be used for navigation.
69
+
70
+ ## Specifications
71
+
72
+ <Specifications file="Hyperlink.spec.ts" name="Hyperlink" />
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+
3
+ import {ExternalHyperlink} from '@workday/canvas-kit-react/button';
4
+
5
+ export default () => (
6
+ <ExternalHyperlink href="https://workday.com">External Hyperlink</ExternalHyperlink>
7
+ );
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+
3
+ import {ExternalHyperlink} from '@workday/canvas-kit-react/button';
4
+ import {Box} from '@workday/canvas-kit-react/layout';
5
+
6
+ export default () => (
7
+ <Box backgroundColor="blueberry400" padding="s">
8
+ <ExternalHyperlink href="https://workday.com" variant="inverse">
9
+ Hyperlink
10
+ </ExternalHyperlink>
11
+ </Box>
12
+ );
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ import {Hyperlink} from '@workday/canvas-kit-react/button';
4
+
5
+ export default () => <Hyperlink href="#hyperlink">Hyperlink</Hyperlink>;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+
3
+ import {Hyperlink} from '@workday/canvas-kit-react/button';
4
+ import {Box} from '@workday/canvas-kit-react/layout';
5
+
6
+ export default () => (
7
+ <Box backgroundColor="blueberry400" padding="s">
8
+ <Hyperlink href="#hyperlink" variant="inverse">
9
+ Hyperlink
10
+ </Hyperlink>
11
+ </Box>
12
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "7.0.0-alpha.100-next.25+911bfad3",
3
+ "version": "7.0.0-alpha.103-next.28+a55aeef9",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@storybook/csf": "0.0.1",
44
- "@workday/canvas-kit-react": "^7.0.0-alpha.100-next.25+911bfad3"
44
+ "@workday/canvas-kit-react": "^7.0.0-alpha.103-next.28+a55aeef9"
45
45
  },
46
46
  "devDependencies": {
47
47
  "fs-extra": "^10.0.0",
@@ -49,5 +49,5 @@
49
49
  "mkdirp": "^1.0.3",
50
50
  "typescript": "4.1"
51
51
  },
52
- "gitHead": "911bfad34147c054ac08fd77845d0a0339fd3f95"
52
+ "gitHead": "a55aeef97c5138c9b1144584287afa8cac6fe17f"
53
53
  }