@workday/canvas-kit-docs 17.0.0-alpha.0546-next.0 → 17.0.0-alpha.0559-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/docs.js +35 -3
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/mdx/preview-react/divider/Divider.mdx +5 -0
- package/dist/mdx/preview-react/divider/examples/Basic.tsx +20 -13
- package/dist/mdx/preview-react/divider/examples/Vertical.tsx +50 -0
- package/dist/mdx/react/tooltip/Tooltip.mdx +10 -0
- package/dist/mdx/react/tooltip/examples/AIDisclosure.tsx +38 -0
- package/package.json +6 -6
package/dist/es6/lib/docs.js
CHANGED
|
@@ -44961,7 +44961,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
44961
44961
|
{
|
|
44962
44962
|
"name": "Divider",
|
|
44963
44963
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/divider/lib/Divider.tsx",
|
|
44964
|
-
"description": "# Divider\nA divider to segment and visually organize content. By default, it renders a semantic `[<hr>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr)` element.\n\n[View Docs](https://workday.github.io/canvas-kit/?path=/docs/preview-divider--docs)\n\nThe `space` prop will equally apply
|
|
44964
|
+
"description": "# Divider\nA divider to segment and visually organize content. By default, it renders a semantic `[<hr>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr)` element.\n\n[View Docs](https://workday.github.io/canvas-kit/?path=/docs/preview-divider--docs)\n\nThe `space` prop will equally apply margin styles to both ends of the `Divider`.\nIn the example below, `system.gap.xs` (0.5rem), adds `0.25rem` margin to the top and `0.25rem` to the bottom.",
|
|
44965
44965
|
"declarations": [
|
|
44966
44966
|
{
|
|
44967
44967
|
"name": "Divider",
|
|
@@ -44969,7 +44969,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
44969
44969
|
}
|
|
44970
44970
|
],
|
|
44971
44971
|
"tags": {
|
|
44972
|
-
"example": "```tsx\nimport { Divider } from '@workday/canvas-kit-preview-react/divider';\n\n\n<Divider space={system.gap.xs} />\n\n```"
|
|
44972
|
+
"example": "```tsx\nimport { Divider } from '@workday/canvas-kit-preview-react/divider';\n\n\n<Divider space={system.gap.xs} />\n\n// vertical\n<Divider orientation=\"vertical\" />\n\n```"
|
|
44973
44973
|
},
|
|
44974
44974
|
"type": {
|
|
44975
44975
|
"kind": "enhancedComponent",
|
|
@@ -44984,7 +44984,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
44984
44984
|
"kind": "primitive",
|
|
44985
44985
|
"value": "string"
|
|
44986
44986
|
},
|
|
44987
|
-
"description": "Applies
|
|
44987
|
+
"description": "Applies margin evenly to both ends of the `Divider`. It divides the provided value by two and applies half to each end.\nFor a `horizontal` `Divider` this is the top and bottom margin, and for a `vertical` `Divider` it is the left and right margin.\nE.g. `space=\"2rem\"` would apply `1rem` margin to each end.",
|
|
44988
44988
|
"declarations": [
|
|
44989
44989
|
{
|
|
44990
44990
|
"name": "space",
|
|
@@ -45000,6 +45000,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
45000
45000
|
"value": "`system.gap.md` (1rem)"
|
|
45001
45001
|
}
|
|
45002
45002
|
},
|
|
45003
|
+
{
|
|
45004
|
+
"kind": "property",
|
|
45005
|
+
"name": "orientation",
|
|
45006
|
+
"required": false,
|
|
45007
|
+
"type": {
|
|
45008
|
+
"kind": "union",
|
|
45009
|
+
"value": [
|
|
45010
|
+
{
|
|
45011
|
+
"kind": "string",
|
|
45012
|
+
"value": "horizontal"
|
|
45013
|
+
},
|
|
45014
|
+
{
|
|
45015
|
+
"kind": "string",
|
|
45016
|
+
"value": "vertical"
|
|
45017
|
+
}
|
|
45018
|
+
]
|
|
45019
|
+
},
|
|
45020
|
+
"description": "Sets the orientation of the `Divider`.\n* `horizontal` - renders a horizontal rule to segment stacked content.\n* `vertical` - renders a vertical rule to segment content laid out in a row. The `Divider` stretches to fill\n the height of its container, so it should be placed inside an element with a defined height (e.g. a flex or\n grid container).",
|
|
45021
|
+
"declarations": [
|
|
45022
|
+
{
|
|
45023
|
+
"name": "orientation",
|
|
45024
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/divider/lib/Divider.tsx"
|
|
45025
|
+
}
|
|
45026
|
+
],
|
|
45027
|
+
"tags": {
|
|
45028
|
+
"default": "'horizontal'"
|
|
45029
|
+
},
|
|
45030
|
+
"defaultValue": {
|
|
45031
|
+
"kind": "string",
|
|
45032
|
+
"value": "horizontal"
|
|
45033
|
+
}
|
|
45034
|
+
},
|
|
45003
45035
|
{
|
|
45004
45036
|
"kind": "property",
|
|
45005
45037
|
"name": "cs",
|
|
@@ -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": "16.0.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "16.0.
|
|
23
|
-
"@workday/canvas-kit-react": "16.0.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^16.0.
|
|
25
|
-
"@workday/canvas-kit-styling": "16.0.
|
|
21
|
+
"@workday/canvas-kit-labs-react": "16.0.10",
|
|
22
|
+
"@workday/canvas-kit-preview-react": "16.0.10",
|
|
23
|
+
"@workday/canvas-kit-react": "16.0.10",
|
|
24
|
+
"@workday/canvas-kit-react-fonts": "^16.0.10",
|
|
25
|
+
"@workday/canvas-kit-styling": "16.0.10",
|
|
26
26
|
"@workday/canvas-system-icons-web": "^5.0.3",
|
|
27
27
|
"@workday/canvas-expressive-icons-web": "1.0.1",
|
|
28
28
|
"@workday/canvas-tokens-web": "4.4.0-beta.11"
|
|
@@ -19,11 +19,11 @@ export const packageJSONFile = `{
|
|
|
19
19
|
"@emotion/react": "11.11.4",
|
|
20
20
|
"@types/react": "18.2.60",
|
|
21
21
|
"@types/react-dom": "18.2.19",
|
|
22
|
-
"@workday/canvas-kit-labs-react": "16.0.
|
|
23
|
-
"@workday/canvas-kit-preview-react": "16.0.
|
|
24
|
-
"@workday/canvas-kit-react": "16.0.
|
|
25
|
-
"@workday/canvas-kit-react-fonts": "^16.0.
|
|
26
|
-
"@workday/canvas-kit-styling": "16.0.
|
|
22
|
+
"@workday/canvas-kit-labs-react": "16.0.10",
|
|
23
|
+
"@workday/canvas-kit-preview-react": "16.0.10",
|
|
24
|
+
"@workday/canvas-kit-react": "16.0.10",
|
|
25
|
+
"@workday/canvas-kit-react-fonts": "^16.0.10",
|
|
26
|
+
"@workday/canvas-kit-styling": "16.0.10",
|
|
27
27
|
"@workday/canvas-system-icons-web": "^5.0.3",
|
|
28
28
|
"@workday/canvas-expressive-icons-web": "1.0.1",
|
|
29
29
|
"@workday/canvas-tokens-web": "4.4.0-beta.11"
|
|
@@ -2,6 +2,7 @@ import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-d
|
|
|
2
2
|
|
|
3
3
|
import * as Divider from './Divider.stories.ts';
|
|
4
4
|
import Basic from './examples/Basic';
|
|
5
|
+
import Vertical from './examples/Vertical';
|
|
5
6
|
import CustomSpace from './examples/CustomSpace';
|
|
6
7
|
|
|
7
8
|
|
|
@@ -31,6 +32,10 @@ bottom margin.
|
|
|
31
32
|
|
|
32
33
|
<ExampleCodeBlock code={Basic} />
|
|
33
34
|
|
|
35
|
+
### Vertical Example
|
|
36
|
+
|
|
37
|
+
<ExampleCodeBlock code={Vertical} />
|
|
38
|
+
|
|
34
39
|
### Custom Space
|
|
35
40
|
|
|
36
41
|
You might also want to apply custom space to `Divider` where the top and bottom margin are not
|
|
@@ -28,40 +28,39 @@ const maintainerList = [
|
|
|
28
28
|
{
|
|
29
29
|
id: '44883293',
|
|
30
30
|
name: 'Josh Bagwell',
|
|
31
|
-
bio: '
|
|
31
|
+
bio: 'Master of Cocktails and Fast Cars',
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
id: '338257',
|
|
35
35
|
name: 'Nicholas Boll',
|
|
36
|
-
bio: 'Principal
|
|
36
|
+
bio: 'Principal Potato Engineer',
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
id: '7966550',
|
|
40
40
|
name: 'Manuel Carrera',
|
|
41
|
-
bio: 'Sr.
|
|
41
|
+
bio: 'Sr. Rock Climber and Artist',
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
id: '146020',
|
|
45
45
|
name: 'James Fan',
|
|
46
|
-
bio: 'Sr.
|
|
46
|
+
bio: 'Sr. Television Consultant',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
id: '48605821',
|
|
50
50
|
name: 'Raisa Primerova',
|
|
51
|
-
bio: '
|
|
51
|
+
bio: 'Principal Borscht Connoisseur',
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
id: '4818182',
|
|
55
55
|
name: 'Alan Smith',
|
|
56
|
-
bio: 'Principal
|
|
56
|
+
bio: 'Principal Pizza Tosser',
|
|
57
57
|
},
|
|
58
58
|
];
|
|
59
59
|
|
|
60
60
|
const profileCardStyles = createStyles({
|
|
61
|
-
display: '
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
gridTemplateRows: '1fr 1fr',
|
|
61
|
+
display: 'flex',
|
|
62
|
+
gap: '0.5rem',
|
|
63
|
+
flexDirection: 'row',
|
|
65
64
|
});
|
|
66
65
|
|
|
67
66
|
const profileCardAvatarStyles = createStyles({
|
|
@@ -84,6 +83,12 @@ const profileCardBodyStyles = createStyles({
|
|
|
84
83
|
margin: 0,
|
|
85
84
|
});
|
|
86
85
|
|
|
86
|
+
const profileCardContentStyles = createStyles({
|
|
87
|
+
display: 'flex',
|
|
88
|
+
flexDirection: 'column',
|
|
89
|
+
gap: system.gap.xs,
|
|
90
|
+
});
|
|
91
|
+
|
|
87
92
|
interface ProfileCardProps {
|
|
88
93
|
id: string;
|
|
89
94
|
name: string;
|
|
@@ -93,12 +98,14 @@ interface ProfileCardProps {
|
|
|
93
98
|
const ProfileCard = ({id, name, bio}: ProfileCardProps) => (
|
|
94
99
|
<div className={profileCardStyles}>
|
|
95
100
|
<Avatar
|
|
96
|
-
size="
|
|
101
|
+
size="large"
|
|
97
102
|
url={`https://avatars.githubusercontent.com/u/${id}?v=4`}
|
|
98
103
|
name={`${name}'s avatar`}
|
|
99
104
|
className={profileCardAvatarStyles}
|
|
100
105
|
/>
|
|
101
|
-
<
|
|
102
|
-
|
|
106
|
+
<div className={profileCardContentStyles}>
|
|
107
|
+
<h3 className={profileCardHeadingStyles}>{name}</h3>
|
|
108
|
+
<p className={profileCardBodyStyles}>{bio}</p>
|
|
109
|
+
</div>
|
|
103
110
|
</div>
|
|
104
111
|
);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {Divider} from '@workday/canvas-kit-preview-react/divider';
|
|
2
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
3
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
4
|
+
|
|
5
|
+
const rowStyles = createStyles({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
height: system.size.xxl,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const statStyles = createStyles({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexDirection: 'column',
|
|
14
|
+
gap: system.gap.none,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const labelStyles = createStyles({
|
|
18
|
+
...system.type.subtext.medium,
|
|
19
|
+
color: system.color.fg.default,
|
|
20
|
+
margin: 0,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const valueStyles = createStyles({
|
|
24
|
+
...system.type.body.large,
|
|
25
|
+
fontWeight: system.fontWeight.bold,
|
|
26
|
+
margin: 0,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export default () => {
|
|
30
|
+
const lastIndex = stats.length - 1;
|
|
31
|
+
return (
|
|
32
|
+
<div className={rowStyles}>
|
|
33
|
+
{stats.map((stat, index) => (
|
|
34
|
+
<>
|
|
35
|
+
<div className={statStyles}>
|
|
36
|
+
<p className={labelStyles}>{stat.label}</p>
|
|
37
|
+
<p className={valueStyles}>{stat.value}</p>
|
|
38
|
+
</div>
|
|
39
|
+
{index !== lastIndex && <Divider orientation="vertical" space={system.gap.md} />}
|
|
40
|
+
</>
|
|
41
|
+
))}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const stats = [
|
|
47
|
+
{label: 'Components', value: '128'},
|
|
48
|
+
{label: 'Contributors', value: '64'},
|
|
49
|
+
{label: 'Releases', value: '512'},
|
|
50
|
+
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {ExampleCodeBlock, Specifications, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
2
|
import {InformationHighlight} from '@workday/canvas-kit-react/information-highlight';
|
|
3
3
|
import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
|
|
4
|
+
import AIDisclosure from './examples/AIDisclosure';
|
|
4
5
|
import CustomContent from './examples/CustomContent';
|
|
5
6
|
import Default from './examples/Default';
|
|
6
7
|
import DelayedTooltip from './examples/DelayedTooltip';
|
|
@@ -141,6 +142,15 @@ a dialog instead.
|
|
|
141
142
|
|
|
142
143
|
<ExampleCodeBlock code={CustomContent} />
|
|
143
144
|
|
|
145
|
+
### AI Disclosure
|
|
146
|
+
|
|
147
|
+
Use a tooltip to disclose when content or functionality is powered by AI. Pair an icon button with a
|
|
148
|
+
tooltip near the content it describes so users understand how it was produced before they act on it.
|
|
149
|
+
The tooltip labels the button, making the disclosure available to both sighted and screen reader
|
|
150
|
+
users.
|
|
151
|
+
|
|
152
|
+
<ExampleCodeBlock code={AIDisclosure} />
|
|
153
|
+
|
|
144
154
|
### Delayed Tooltip
|
|
145
155
|
|
|
146
156
|
The default delay for showing and hiding a tooltip are 300ms and 100ms, respectively. You can
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {ExternalHyperlink, TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
2
|
+
import {Card} from '@workday/canvas-kit-react/card';
|
|
3
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
4
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
5
|
+
import {infoSparkleIcon} from '@workday/canvas-system-icons-web';
|
|
6
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
7
|
+
|
|
8
|
+
const containerStyles = createStyles({
|
|
9
|
+
background: system.color.bg.alt.default,
|
|
10
|
+
padding: system.padding.xl,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default () => {
|
|
14
|
+
return (
|
|
15
|
+
<div className={containerStyles}>
|
|
16
|
+
<Card>
|
|
17
|
+
<Card.Heading>
|
|
18
|
+
Giant Pacific Octopus
|
|
19
|
+
<Tooltip title="This content is generated by AI" variant="alt" placement="right-end">
|
|
20
|
+
<TertiaryButton
|
|
21
|
+
size="extraSmall"
|
|
22
|
+
icon={infoSparkleIcon}
|
|
23
|
+
aria-label="This functionality is powered by AI"
|
|
24
|
+
/>
|
|
25
|
+
</Tooltip>
|
|
26
|
+
</Card.Heading>
|
|
27
|
+
<Card.Body>
|
|
28
|
+
The giant Pacific octopus (Enteroctopus dofleini), also known as the North Pacific giant
|
|
29
|
+
octopus, is a large marine cephalopod belonging to the genus Enteroctopus and
|
|
30
|
+
Enteroctopodidae family. –{' '}
|
|
31
|
+
<ExternalHyperlink href="https://en.wikipedia.org/wiki/Giant_Pacific_octopus">
|
|
32
|
+
View Source
|
|
33
|
+
</ExternalHyperlink>
|
|
34
|
+
</Card.Body>
|
|
35
|
+
</Card>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "17.0.0-alpha.
|
|
3
|
+
"version": "17.0.0-alpha.0559-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",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"@stackblitz/sdk": "^1.11.0",
|
|
48
48
|
"@storybook/csf": "0.0.1",
|
|
49
49
|
"@workday/canvas-expressive-icons-web": "1.0.2",
|
|
50
|
-
"@workday/canvas-kit-labs-react": "^17.0.0-alpha.
|
|
51
|
-
"@workday/canvas-kit-preview-react": "^17.0.0-alpha.
|
|
52
|
-
"@workday/canvas-kit-react": "^17.0.0-alpha.
|
|
53
|
-
"@workday/canvas-kit-styling": "^17.0.0-alpha.
|
|
50
|
+
"@workday/canvas-kit-labs-react": "^17.0.0-alpha.0559-next.0",
|
|
51
|
+
"@workday/canvas-kit-preview-react": "^17.0.0-alpha.0559-next.0",
|
|
52
|
+
"@workday/canvas-kit-react": "^17.0.0-alpha.0559-next.0",
|
|
53
|
+
"@workday/canvas-kit-styling": "^17.0.0-alpha.0559-next.0",
|
|
54
54
|
"@workday/canvas-system-icons-web": "^5.0.3",
|
|
55
55
|
"@workday/canvas-tokens-web": "^4.4.0",
|
|
56
56
|
"markdown-to-jsx": "^7.2.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"mkdirp": "^1.0.3",
|
|
64
64
|
"typescript": "5.0"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "ed5e46bdaffc5b98a72fb4c0f7bbb84e54b2bb2a"
|
|
67
67
|
}
|