@workday/canvas-kit-docs 14.0.0-alpha.1176-next.0 → 14.0.0-alpha.1180-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/Value.d.ts.map +1 -1
- package/dist/es6/lib/Value.js +5 -1
- package/dist/es6/lib/docs.js +80 -15
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +19 -1
- package/dist/mdx/react/avatar/avatar/Avatar.mdx +0 -2
- package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +1 -1
- package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +2 -2
- package/dist/mdx/react/badge/examples/Basic.tsx +2 -2
- package/dist/mdx/react/badge/examples/CustomLimit.tsx +2 -2
- package/dist/mdx/react/badge/examples/NotificationBadge.tsx +2 -2
- package/dist/mdx/react/button/button/Hyperlink.mdx +21 -5
- package/dist/mdx/react/button/button/examples/ExternalHyperlinkInverse.tsx +9 -0
- package/dist/mdx/react/button/button/examples/HyperlinkInBodyText.tsx +14 -0
- package/dist/mdx/react/button/button/examples/HyperlinkInverse.tsx +5 -0
- package/dist/mdx/react/button/button/examples/StandaloneHyperlink.tsx +19 -0
- package/dist/mdx/styling/mdx/CreateStyles.mdx +1 -1
- package/dist/mdx/styling/mdx/Overview.mdx +2 -2
- package/dist/mdx/styling/mdx/Stencils.mdx +1 -1
- package/dist/mdx/styling/mdx/Utilities.mdx +2 -2
- package/lib/Value.tsx +6 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Value.d.ts","sourceRoot":"","sources":["../../../lib/Value.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Value.d.ts","sourceRoot":"","sources":["../../../lib/Value.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAU5C,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,EACrD,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EACd,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAC9B,IAAI,CAGN;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,KAAK,CAAC,KAAK;IAChE,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,KAAK;UAAqB,MAAM;iFAW5C,CAAC;AAEF,eAAO,MAAM,gBAAgB;gBAA+B,MAAM,cAAc,EAAE;6CAgDjF,CAAC;AAoEF,eAAO,MAAM,eAAe;gBAKd,MAAM,cAAc,EAAE;;;6CAyBnC,CAAC"}
|
package/dist/es6/lib/Value.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Table } from './Table';
|
|
|
7
7
|
import { capitalize, IndentLevelContext, RenderContext, indent } from './widgetUtils';
|
|
8
8
|
import { DescriptionTooltip } from './DescriptionTooltip';
|
|
9
9
|
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
10
|
+
import { createStyles } from '@workday/canvas-kit-styling';
|
|
10
11
|
const widgets = {};
|
|
11
12
|
export function registerWidget(key, widget) {
|
|
12
13
|
widget.displayName = `${capitalize(key)}Widget`;
|
|
@@ -47,10 +48,13 @@ function getTableRows(properties, showDefault = true, showRequired = false, leve
|
|
|
47
48
|
];
|
|
48
49
|
});
|
|
49
50
|
}
|
|
51
|
+
const tableStyles = createStyles({
|
|
52
|
+
tableLayout: 'fixed',
|
|
53
|
+
});
|
|
50
54
|
export const PropertiesTable = ({ properties, showDefault = true, showRequired = false, }) => {
|
|
51
55
|
if (properties.length === 0) {
|
|
52
56
|
return _jsx("span", { className: "token punctuation", children: "{}" });
|
|
53
57
|
}
|
|
54
58
|
const tableBody = getTableRows(properties, showDefault, showRequired, 0, 0);
|
|
55
|
-
return (_jsx(IndentLevelContext.Provider, { value: 0, children: _jsxs(Table, { children: [_jsx(Table.Head, { children: _jsxs(Table.Row, { children: [_jsx(Table.Header, { children: "Name" }), _jsx(Table.Header, { children: "Type" }), _jsx(Table.Header, { children: "Description" }), showDefault ? _jsx(Table.Header, { children: "Default" }) : null] }) }), _jsx(Table.Body, { children: tableBody })] }) }));
|
|
59
|
+
return (_jsx(IndentLevelContext.Provider, { value: 0, children: _jsxs(Table, { cs: tableStyles, children: [_jsx(Table.Head, { children: _jsxs(Table.Row, { children: [_jsx(Table.Header, { children: "Name" }), _jsx(Table.Header, { children: "Type" }), _jsx(Table.Header, { children: "Description" }), showDefault ? _jsx(Table.Header, { children: "Default" }) : null] }) }), _jsx(Table.Body, { children: tableBody })] }) }));
|
|
56
60
|
};
|
package/dist/es6/lib/docs.js
CHANGED
|
@@ -8907,10 +8907,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
8907
8907
|
"name": "variant",
|
|
8908
8908
|
"required": false,
|
|
8909
8909
|
"type": {
|
|
8910
|
-
"kind": "
|
|
8911
|
-
"value":
|
|
8910
|
+
"kind": "union",
|
|
8911
|
+
"value": [
|
|
8912
|
+
{
|
|
8913
|
+
"kind": "string",
|
|
8914
|
+
"value": "inverse"
|
|
8915
|
+
},
|
|
8916
|
+
{
|
|
8917
|
+
"kind": "string",
|
|
8918
|
+
"value": "standalone"
|
|
8919
|
+
},
|
|
8920
|
+
{
|
|
8921
|
+
"kind": "string",
|
|
8922
|
+
"value": "standalone-inverse"
|
|
8923
|
+
}
|
|
8924
|
+
]
|
|
8912
8925
|
},
|
|
8913
|
-
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to
|
|
8926
|
+
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to white and updates hover, focus, and active pseudo-classes\n- `standalone`: removes the underline of the Hyperlink. This is useful when a hyperlink is used outside the context of a paragraph or body text.\n- `standalone-inverse`: removes the underline of the Hyperlink and sets the color to white. This is useful when a hyperlink is used outside the context of a paragraph or body text on a dark background.",
|
|
8914
8927
|
"declarations": [
|
|
8915
8928
|
{
|
|
8916
8929
|
"name": "variant",
|
|
@@ -88324,10 +88337,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
88324
88337
|
"name": "variant",
|
|
88325
88338
|
"required": false,
|
|
88326
88339
|
"type": {
|
|
88327
|
-
"kind": "
|
|
88328
|
-
"value":
|
|
88340
|
+
"kind": "union",
|
|
88341
|
+
"value": [
|
|
88342
|
+
{
|
|
88343
|
+
"kind": "string",
|
|
88344
|
+
"value": "inverse"
|
|
88345
|
+
},
|
|
88346
|
+
{
|
|
88347
|
+
"kind": "string",
|
|
88348
|
+
"value": "standalone"
|
|
88349
|
+
},
|
|
88350
|
+
{
|
|
88351
|
+
"kind": "string",
|
|
88352
|
+
"value": "standalone-inverse"
|
|
88353
|
+
}
|
|
88354
|
+
]
|
|
88329
88355
|
},
|
|
88330
|
-
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to
|
|
88356
|
+
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to white and updates hover, focus, and active pseudo-classes\n- `standalone`: removes the underline of the Hyperlink. This is useful when a hyperlink is used outside the context of a paragraph or body text.\n- `standalone-inverse`: removes the underline of the Hyperlink and sets the color to white. This is useful when a hyperlink is used outside the context of a paragraph or body text on a dark background.",
|
|
88331
88357
|
"declarations": [
|
|
88332
88358
|
{
|
|
88333
88359
|
"name": "variant",
|
|
@@ -114072,10 +114098,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
114072
114098
|
"name": "variant",
|
|
114073
114099
|
"required": false,
|
|
114074
114100
|
"type": {
|
|
114075
|
-
"kind": "
|
|
114076
|
-
"value":
|
|
114101
|
+
"kind": "union",
|
|
114102
|
+
"value": [
|
|
114103
|
+
{
|
|
114104
|
+
"kind": "string",
|
|
114105
|
+
"value": "inverse"
|
|
114106
|
+
},
|
|
114107
|
+
{
|
|
114108
|
+
"kind": "string",
|
|
114109
|
+
"value": "standalone"
|
|
114110
|
+
},
|
|
114111
|
+
{
|
|
114112
|
+
"kind": "string",
|
|
114113
|
+
"value": "standalone-inverse"
|
|
114114
|
+
}
|
|
114115
|
+
]
|
|
114077
114116
|
},
|
|
114078
|
-
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to
|
|
114117
|
+
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to white and updates hover, focus, and active pseudo-classes\n- `standalone`: removes the underline of the Hyperlink. This is useful when a hyperlink is used outside the context of a paragraph or body text.\n- `standalone-inverse`: removes the underline of the Hyperlink and sets the color to white. This is useful when a hyperlink is used outside the context of a paragraph or body text on a dark background.",
|
|
114079
114118
|
"declarations": [
|
|
114080
114119
|
{
|
|
114081
114120
|
"name": "variant",
|
|
@@ -114912,10 +114951,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
114912
114951
|
"name": "variant",
|
|
114913
114952
|
"required": false,
|
|
114914
114953
|
"type": {
|
|
114915
|
-
"kind": "
|
|
114916
|
-
"value":
|
|
114954
|
+
"kind": "union",
|
|
114955
|
+
"value": [
|
|
114956
|
+
{
|
|
114957
|
+
"kind": "string",
|
|
114958
|
+
"value": "inverse"
|
|
114959
|
+
},
|
|
114960
|
+
{
|
|
114961
|
+
"kind": "string",
|
|
114962
|
+
"value": "standalone"
|
|
114963
|
+
},
|
|
114964
|
+
{
|
|
114965
|
+
"kind": "string",
|
|
114966
|
+
"value": "standalone-inverse"
|
|
114967
|
+
}
|
|
114968
|
+
]
|
|
114917
114969
|
},
|
|
114918
|
-
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to
|
|
114970
|
+
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to white and updates hover, focus, and active pseudo-classes\n- `standalone`: removes the underline of the Hyperlink. This is useful when a hyperlink is used outside the context of a paragraph or body text.\n- `standalone-inverse`: removes the underline of the Hyperlink and sets the color to white. This is useful when a hyperlink is used outside the context of a paragraph or body text on a dark background.",
|
|
114919
114971
|
"declarations": [
|
|
114920
114972
|
{
|
|
114921
114973
|
"name": "variant",
|
|
@@ -397108,10 +397160,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
397108
397160
|
"name": "variant",
|
|
397109
397161
|
"required": false,
|
|
397110
397162
|
"type": {
|
|
397111
|
-
"kind": "
|
|
397112
|
-
"value":
|
|
397163
|
+
"kind": "union",
|
|
397164
|
+
"value": [
|
|
397165
|
+
{
|
|
397166
|
+
"kind": "string",
|
|
397167
|
+
"value": "inverse"
|
|
397168
|
+
},
|
|
397169
|
+
{
|
|
397170
|
+
"kind": "string",
|
|
397171
|
+
"value": "standalone"
|
|
397172
|
+
},
|
|
397173
|
+
{
|
|
397174
|
+
"kind": "string",
|
|
397175
|
+
"value": "standalone-inverse"
|
|
397176
|
+
}
|
|
397177
|
+
]
|
|
397113
397178
|
},
|
|
397114
|
-
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to
|
|
397179
|
+
"description": "sets modifier styles for Hyperlink\n- `inverse`: sets the color to white and updates hover, focus, and active pseudo-classes\n- `standalone`: removes the underline of the Hyperlink. This is useful when a hyperlink is used outside the context of a paragraph or body text.\n- `standalone-inverse`: removes the underline of the Hyperlink and sets the color to white. This is useful when a hyperlink is used outside the context of a paragraph or body text on a dark background.",
|
|
397115
397180
|
"declarations": [
|
|
397116
397181
|
{
|
|
397117
397182
|
"name": "variant",
|
|
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
|
|
|
18
18
|
"@emotion/react": "11.11.4",
|
|
19
19
|
"@types/react": "18.2.60",
|
|
20
20
|
"@types/react-dom": "18.2.19",
|
|
21
|
-
"@workday/canvas-kit-labs-react": "13.2.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "13.2.
|
|
23
|
-
"@workday/canvas-kit-react": "13.2.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^13.2.
|
|
25
|
-
"@workday/canvas-kit-styling": "13.2.
|
|
21
|
+
"@workday/canvas-kit-labs-react": "13.2.7",
|
|
22
|
+
"@workday/canvas-kit-preview-react": "13.2.7",
|
|
23
|
+
"@workday/canvas-kit-react": "13.2.7",
|
|
24
|
+
"@workday/canvas-kit-react-fonts": "^13.2.7",
|
|
25
|
+
"@workday/canvas-kit-styling": "13.2.7",
|
|
26
26
|
"@workday/canvas-system-icons-web": "3.0.22",
|
|
27
27
|
"@workday/canvas-tokens-web": "2.0.0"
|
|
28
28
|
},
|
|
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
|
|
|
18
18
|
"@emotion/react": "11.11.4",
|
|
19
19
|
"@types/react": "18.2.60",
|
|
20
20
|
"@types/react-dom": "18.2.19",
|
|
21
|
-
"@workday/canvas-kit-labs-react": "13.2.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "13.2.
|
|
23
|
-
"@workday/canvas-kit-react": "13.2.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^13.2.
|
|
25
|
-
"@workday/canvas-kit-styling": "13.2.
|
|
21
|
+
"@workday/canvas-kit-labs-react": "13.2.7",
|
|
22
|
+
"@workday/canvas-kit-preview-react": "13.2.7",
|
|
23
|
+
"@workday/canvas-kit-react": "13.2.7",
|
|
24
|
+
"@workday/canvas-kit-react-fonts": "^13.2.7",
|
|
25
|
+
"@workday/canvas-kit-styling": "13.2.7",
|
|
26
26
|
"@workday/canvas-system-icons-web": "3.0.22",
|
|
27
27
|
"@workday/canvas-tokens-web": "2.0.0"
|
|
28
28
|
},
|
|
@@ -11,7 +11,8 @@ any questions.
|
|
|
11
11
|
- [Component Updates](#component-updates)
|
|
12
12
|
- [Styling Changes](#styling-changes)
|
|
13
13
|
- [Card](#card)
|
|
14
|
-
|
|
14
|
+
- [Expandable](#expandable)
|
|
15
|
+
- [Hyperlink & ExternalHyperlink](#hyperlink-and-externalhyperlink)
|
|
15
16
|
- [SearchForm](#search-form)
|
|
16
17
|
- [Removals](#removals)
|
|
17
18
|
- [Menu (preview)](#menu-preview)
|
|
@@ -202,6 +203,23 @@ spacing between card elements.
|
|
|
202
203
|
|
|
203
204
|
These changes are only **visual** and should not affect the functionality of the component.
|
|
204
205
|
|
|
206
|
+
### Hyperlink and External Hyperlink
|
|
207
|
+
|
|
208
|
+
**PR:** [#3390](https://github.com/Workday/canvas-kit/pull/3390)
|
|
209
|
+
|
|
210
|
+
- `Hyperlink` and `ExternalHyperlink` now have a `standalone` and `standalone-inverse` variant. This removes the underline text decoration for use outside the context of body text.
|
|
211
|
+
|
|
212
|
+
**HyperLink and ExternalHyperlink in v14**
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
<Hyperlink variant="standalone" href="#hyperlink">Hyperlink</Hyperlink>
|
|
216
|
+
<ExternalHyperlink variant="standalone" href="#external-hyperlink">External Hyperlink</ExternalHyperlink>
|
|
217
|
+
<Hyperlink variant="standalone-inverse" href="#hyperlink">Hyperlink</Hyperlink>
|
|
218
|
+
<ExternalHyperlink variant="standalone-inverse" href="#external-hyperlink">External Hyperlink</ExternalHyperlink>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
> **Note:** Only use the `standalone` or `standalone-inverse` variant in cases where the `<HyperLink>` and `<ExternalHyperlink>` are used outside the context of body text.
|
|
222
|
+
|
|
205
223
|
### Search Form 🚨
|
|
206
224
|
|
|
207
225
|
**PR:** [#3303](https://github.com/Workday/canvas-kit/pull/3303)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
2
2
|
import {createStencil, createStyles} from '@workday/canvas-kit-styling';
|
|
3
3
|
import {system} from '@workday/canvas-tokens-web';
|
|
4
|
-
import {systemIconStencil} from '
|
|
4
|
+
import {systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
5
5
|
|
|
6
6
|
const customOrangeAvatar = createStencil({
|
|
7
7
|
base: {
|
|
@@ -5,7 +5,7 @@ import testAvatar from './test-avatar.png';
|
|
|
5
5
|
export default () => (
|
|
6
6
|
<div className="story">
|
|
7
7
|
{Array.from({length: 5}, (v, index) => (
|
|
8
|
-
|
|
8
|
+
<div>
|
|
9
9
|
<Avatar
|
|
10
10
|
altText="Avatar"
|
|
11
11
|
key={index}
|
|
@@ -14,7 +14,7 @@ export default () => (
|
|
|
14
14
|
url={testAvatar + '?v=' + index}
|
|
15
15
|
/>
|
|
16
16
|
<br />
|
|
17
|
-
|
|
17
|
+
</div>
|
|
18
18
|
))}
|
|
19
19
|
</div>
|
|
20
20
|
);
|
|
@@ -21,7 +21,7 @@ const inverseBackground = createStyles({
|
|
|
21
21
|
padding: system.space.x4,
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
export
|
|
24
|
+
export default () => {
|
|
25
25
|
return (
|
|
26
26
|
<div className={containerStyles}>
|
|
27
27
|
<div className={defaultBackground}>
|
|
@@ -32,4 +32,4 @@ export function Basic() {
|
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
34
34
|
);
|
|
35
|
-
}
|
|
35
|
+
};
|
|
@@ -34,7 +34,7 @@ const inverseBackground = createStyles({
|
|
|
34
34
|
|
|
35
35
|
const initialCount = 1;
|
|
36
36
|
|
|
37
|
-
export
|
|
37
|
+
export default () => {
|
|
38
38
|
const [count, setCount] = React.useState(initialCount);
|
|
39
39
|
|
|
40
40
|
return (
|
|
@@ -55,4 +55,4 @@ export function CustomLimit() {
|
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
57
57
|
);
|
|
58
|
-
}
|
|
58
|
+
};
|
|
@@ -44,7 +44,7 @@ const countBadgeStyles = createStyles({
|
|
|
44
44
|
// NVDA + FF: Consistently describes count value only "{X}"
|
|
45
45
|
// macOS v14.6.1
|
|
46
46
|
// VoiceOver + Chrome / Safari: Consistently describes "New notifications {X}"
|
|
47
|
-
export
|
|
47
|
+
export default () => {
|
|
48
48
|
const [count, setCount] = React.useState(4);
|
|
49
49
|
const badgeID = useUniqueId();
|
|
50
50
|
|
|
@@ -74,4 +74,4 @@ export function NotificationBadge() {
|
|
|
74
74
|
</Flex>
|
|
75
75
|
</Flex>
|
|
76
76
|
);
|
|
77
|
-
}
|
|
77
|
+
};
|
|
@@ -3,6 +3,8 @@ import Link from './examples/Hyperlink';
|
|
|
3
3
|
import LinkInverse from './examples/HyperlinkInverse';
|
|
4
4
|
import ExternalLink from './examples/ExternalHyperlink';
|
|
5
5
|
import ExternalLinkInverse from './examples/ExternalHyperlinkInverse';
|
|
6
|
+
import StandaloneLink from './examples/StandaloneHyperlink';
|
|
7
|
+
import InBodyText from './examples/HyperlinkInBodyText';
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
# Canvas Kit Hyperlinks
|
|
@@ -22,17 +24,32 @@ yarn add @workday/canvas-kit-react
|
|
|
22
24
|
### Hyperlink
|
|
23
25
|
|
|
24
26
|
`Hyperlink`s should be used when you want to navigate away from the current page or to an anchor on
|
|
25
|
-
the current page.
|
|
27
|
+
the current page. By default, `Hyperlink`s have an underline for accessibility.
|
|
26
28
|
|
|
27
29
|
<ExampleCodeBlock code={Link} />
|
|
28
30
|
|
|
29
31
|
#### Inverse
|
|
30
32
|
|
|
31
33
|
`Hyperlink`s also have an `inverse` variant. Use this variant when you need to place a `Hyperlink`
|
|
32
|
-
on a dark or colorful background
|
|
34
|
+
on a dark or colorful background.
|
|
33
35
|
|
|
34
36
|
<ExampleCodeBlock code={LinkInverse} />
|
|
35
37
|
|
|
38
|
+
#### Standalone
|
|
39
|
+
|
|
40
|
+
`Hyperlink`s also have a `standalone` variant. Use this variant when you need to place a `Hyperlink`
|
|
41
|
+
outside of a paragraph or body text. This will remove the underline.
|
|
42
|
+
|
|
43
|
+
This variant can also be used with the `ExternalHyperlink` component.
|
|
44
|
+
|
|
45
|
+
<ExampleCodeBlock code={StandaloneLink} />
|
|
46
|
+
|
|
47
|
+
#### In Body Text
|
|
48
|
+
|
|
49
|
+
In most cases use `HyperLink` and `ExternalHyperlink` in body text of a sentence where you need to link to another page or part of the document. By default they will wrap to a new line.
|
|
50
|
+
|
|
51
|
+
<ExampleCodeBlock code={InBodyText} />
|
|
52
|
+
|
|
36
53
|
### Component API
|
|
37
54
|
|
|
38
55
|
<SymbolDoc name="Hyperlink" fileName="/react/" hideDescription hideHeading headingStart={4} />
|
|
@@ -40,14 +57,13 @@ on a dark or colorful background such as `blueberry400`.
|
|
|
40
57
|
### ExternalHyperlink
|
|
41
58
|
|
|
42
59
|
If your link should open in a new tab or window use the `ExternalHyperlink` component. It will let
|
|
43
|
-
users know about the behavior by adding an icon, `extLinkIcon`.
|
|
44
|
-
"Opens link in new window". You can override `aria-label` of the icon by using the `iconLabel` prop.
|
|
60
|
+
users know about the behavior by adding an icon, `extLinkIcon`. To ensure proper accessibility, you **must* provide a label to the icon via the `iconLabel` prop.
|
|
45
61
|
This override will be needed for translations.
|
|
46
62
|
|
|
47
63
|
<ExampleCodeBlock code={ExternalLink} />
|
|
48
64
|
|
|
49
65
|
`ExternalHyperlink`s also have an `inverse` variant. Use this variant when you need to place the
|
|
50
|
-
link on a dark or colorful background
|
|
66
|
+
link on a dark or colorful background.
|
|
51
67
|
|
|
52
68
|
<ExampleCodeBlock code={ExternalLinkInverse} />
|
|
53
69
|
|
|
@@ -8,6 +8,8 @@ import {system} from '@workday/canvas-tokens-web';
|
|
|
8
8
|
const parentContainerStyles = createStyles({
|
|
9
9
|
backgroundColor: system.color.bg.primary.default,
|
|
10
10
|
padding: system.space.x4,
|
|
11
|
+
display: 'inline-flex',
|
|
12
|
+
gap: system.space.x4,
|
|
11
13
|
});
|
|
12
14
|
|
|
13
15
|
export default () => (
|
|
@@ -19,5 +21,12 @@ export default () => (
|
|
|
19
21
|
>
|
|
20
22
|
Hyperlink
|
|
21
23
|
</ExternalHyperlink>
|
|
24
|
+
<ExternalHyperlink
|
|
25
|
+
href="https://workday.com"
|
|
26
|
+
variant="standalone-inverse"
|
|
27
|
+
iconLabel="Opens link in new window"
|
|
28
|
+
>
|
|
29
|
+
Hyperlink
|
|
30
|
+
</ExternalHyperlink>
|
|
22
31
|
</Box>
|
|
23
32
|
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {ExternalHyperlink, Hyperlink} from '@workday/canvas-kit-react/button';
|
|
2
|
+
|
|
3
|
+
export default () => (
|
|
4
|
+
<p>
|
|
5
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
|
|
6
|
+
<Hyperlink href="#hyperlink">tempor incididunt</Hyperlink> ut labore et dolore magna aliqua. Ut
|
|
7
|
+
enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
8
|
+
consequat. Duis aute irure dolor in reprehenderit in
|
|
9
|
+
<ExternalHyperlink href="#hyperlink">
|
|
10
|
+
voluptate velit esse cillum dolore eu fugiat
|
|
11
|
+
</ExternalHyperlink>
|
|
12
|
+
nulla pariatur.
|
|
13
|
+
</p>
|
|
14
|
+
);
|
|
@@ -8,6 +8,8 @@ import {system} from '@workday/canvas-tokens-web';
|
|
|
8
8
|
const parentContainerStyles = createStyles({
|
|
9
9
|
backgroundColor: system.color.bg.primary.default,
|
|
10
10
|
padding: system.space.x4,
|
|
11
|
+
display: 'inline-flex',
|
|
12
|
+
gap: system.space.x4,
|
|
11
13
|
});
|
|
12
14
|
|
|
13
15
|
export default () => (
|
|
@@ -15,5 +17,8 @@ export default () => (
|
|
|
15
17
|
<Hyperlink href="#hyperlink" variant="inverse">
|
|
16
18
|
Hyperlink
|
|
17
19
|
</Hyperlink>
|
|
20
|
+
<Hyperlink href="#hyperlink" variant="standalone-inverse">
|
|
21
|
+
Hyperlink
|
|
22
|
+
</Hyperlink>
|
|
18
23
|
</Box>
|
|
19
24
|
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {Hyperlink, ExternalHyperlink} from '@workday/canvas-kit-react/button';
|
|
2
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
3
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
4
|
+
|
|
5
|
+
const containerStyles = createStyles({
|
|
6
|
+
display: 'inline-flex',
|
|
7
|
+
gap: system.space.x4,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default () => (
|
|
11
|
+
<div className={containerStyles}>
|
|
12
|
+
<Hyperlink variant="standalone" href="#standalone-hyperlink">
|
|
13
|
+
Standalone Hyperlink
|
|
14
|
+
</Hyperlink>
|
|
15
|
+
<ExternalHyperlink variant="standalone" href="#standalone-external-hyperlink">
|
|
16
|
+
Standalone External Hyperlink
|
|
17
|
+
</ExternalHyperlink>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
@@ -31,7 +31,7 @@ The CSS will look like this:
|
|
|
31
31
|
<InformationHighlight.Icon />
|
|
32
32
|
<InformationHighlight.Heading> Note</InformationHighlight.Heading>
|
|
33
33
|
<InformationHighlight.Body>
|
|
34
|
-
The `createStyles` function handles wrapping our Tokens in `var(
|
|
34
|
+
The `createStyles` function handles wrapping our Tokens in `var(--tokenName)`.
|
|
35
35
|
</InformationHighlight.Body>
|
|
36
36
|
</InformationHighlight>
|
|
37
37
|
|
|
@@ -326,7 +326,7 @@ together and applies `className` and `style` attributes to a React element.
|
|
|
326
326
|
<InformationHighlight.Icon />
|
|
327
327
|
<InformationHighlight.Heading>Information</InformationHighlight.Heading>
|
|
328
328
|
<InformationHighlight.Body>
|
|
329
|
-
For a more in depth overview, please view our <Hyperlink
|
|
329
|
+
For a more in depth overview, please view our <Hyperlink href="https://workday.github.io/canvas-kit/?path=/docs/styling-getting-started-create-styles--docs"> Create Styles </Hyperlink> docs.
|
|
330
330
|
</InformationHighlight.Body>
|
|
331
331
|
</InformationHighlight>
|
|
332
332
|
|
|
@@ -396,6 +396,6 @@ const ThemedCard = ({isDarkTheme, headerColor, elemProps}) => {
|
|
|
396
396
|
<InformationHighlight.Icon />
|
|
397
397
|
<InformationHighlight.Heading>Information</InformationHighlight.Heading>
|
|
398
398
|
<InformationHighlight.Body>
|
|
399
|
-
For a more in depth overview, please view our <Hyperlink
|
|
399
|
+
For a more in depth overview, please view our <Hyperlink href="https://workday.github.io/canvas-kit/?path=/docs/styling-getting-started-create-stencil--docs">Create Stencil</Hyperlink> docs.
|
|
400
400
|
</InformationHighlight.Body>
|
|
401
401
|
</InformationHighlight>
|
|
@@ -5,7 +5,7 @@ import {system} from '@workday/canvas-tokens-web'
|
|
|
5
5
|
import CreateStencil from './examples/CreateStencil';
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# Create Stencil
|
|
9
9
|
|
|
10
10
|
Stencils are a reusable function that returns `style` and `className` props in an object. A Stencil
|
|
11
11
|
should apply to a single element. If your component has nested elements, you can youse `parts` to
|
|
@@ -105,7 +105,7 @@ The `keyframes` function re-exports the [Emotion CSS keyframes](https://emotion.
|
|
|
105
105
|
function, but is compatible with a custom Emotion instance and is understood by the Static style
|
|
106
106
|
transformer.
|
|
107
107
|
|
|
108
|
-
###
|
|
108
|
+
### Example
|
|
109
109
|
|
|
110
110
|
```tsx
|
|
111
111
|
import {system} from '@workday/canvas-tokens-web';
|
|
@@ -167,7 +167,7 @@ The `injectGlobal` function re-exports the
|
|
|
167
167
|
[Emotion CSS injectGlobal](https://emotion.sh/docs/@emotion/css#global-styles) function, but is
|
|
168
168
|
compatible with a custom Emotion instance and is understood by the Static style transformer.
|
|
169
169
|
|
|
170
|
-
###
|
|
170
|
+
### Example
|
|
171
171
|
|
|
172
172
|
```tsx
|
|
173
173
|
import {createRoot} from 'react-dom/client';
|
package/lib/Value.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {Table} from './Table';
|
|
|
9
9
|
import {capitalize, IndentLevelContext, RenderContext, indent} from './widgetUtils';
|
|
10
10
|
import {DescriptionTooltip} from './DescriptionTooltip';
|
|
11
11
|
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
12
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
12
13
|
|
|
13
14
|
const widgets: Record<string, React.FC<ValueProps>> = {};
|
|
14
15
|
|
|
@@ -151,6 +152,10 @@ function getTableRows(
|
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
154
|
|
|
155
|
+
const tableStyles = createStyles({
|
|
156
|
+
tableLayout: 'fixed',
|
|
157
|
+
});
|
|
158
|
+
|
|
154
159
|
export const PropertiesTable = ({
|
|
155
160
|
properties,
|
|
156
161
|
showDefault = true,
|
|
@@ -168,7 +173,7 @@ export const PropertiesTable = ({
|
|
|
168
173
|
|
|
169
174
|
return (
|
|
170
175
|
<IndentLevelContext.Provider value={0}>
|
|
171
|
-
<Table>
|
|
176
|
+
<Table cs={tableStyles}>
|
|
172
177
|
<Table.Head>
|
|
173
178
|
<Table.Row>
|
|
174
179
|
<Table.Header>Name</Table.Header>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.1180-next.0",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@stackblitz/sdk": "^1.11.0",
|
|
47
47
|
"@storybook/csf": "0.0.1",
|
|
48
|
-
"@workday/canvas-kit-labs-react": "^14.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-preview-react": "^14.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-react": "^14.0.0-alpha.
|
|
51
|
-
"@workday/canvas-kit-styling": "^14.0.0-alpha.
|
|
48
|
+
"@workday/canvas-kit-labs-react": "^14.0.0-alpha.1180-next.0",
|
|
49
|
+
"@workday/canvas-kit-preview-react": "^14.0.0-alpha.1180-next.0",
|
|
50
|
+
"@workday/canvas-kit-react": "^14.0.0-alpha.1180-next.0",
|
|
51
|
+
"@workday/canvas-kit-styling": "^14.0.0-alpha.1180-next.0",
|
|
52
52
|
"@workday/canvas-system-icons-web": "^3.0.35",
|
|
53
53
|
"@workday/canvas-tokens-web": "3.0.0-alpha.9",
|
|
54
54
|
"markdown-to-jsx": "^7.2.0",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"mkdirp": "^1.0.3",
|
|
62
62
|
"typescript": "5.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "5993dbdcabeebd9877c0abc60d63a29abd3129fd"
|
|
65
65
|
}
|