@workday/canvas-kit-docs 11.0.0-alpha.643-next.0 → 11.0.0-alpha.656-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 +1919 -706
- package/dist/mdx/11.0-UPGRADE-GUIDE.mdx +41 -9
- package/dist/mdx/preview-react/loading-sparkles/LoadingSparkles.mdx +33 -0
- package/dist/mdx/preview-react/loading-sparkles/examples/Basic.tsx +6 -0
- package/dist/mdx/preview-react/loading-sparkles/examples/RTL.tsx +16 -0
- package/dist/mdx/react/card/card.mdx +2 -2
- package/dist/mdx/react/card/examples/Depth.tsx +7 -1
- package/dist/mdx/react/card/examples/Padding.tsx +8 -1
- package/dist/mdx/react/text/LabelText.mdx +11 -1
- package/dist/mdx/react/text/examples/LabelText/Disabled.tsx +21 -1
- package/package.json +7 -7
|
@@ -6,12 +6,15 @@ any questions.
|
|
|
6
6
|
|
|
7
7
|
- [Codemod](#codemod)
|
|
8
8
|
- [Deprecations](#deprecations)
|
|
9
|
-
- [
|
|
10
|
-
- [
|
|
11
|
-
- [
|
|
9
|
+
- [Form Field Main](#form-field-main)
|
|
10
|
+
- [Text Input Preview](#text-input-preview)
|
|
11
|
+
- [Text Area Preview](#text-input-preview)
|
|
12
|
+
- [Label Text](#label-text)
|
|
12
13
|
- [Component Updates](#component-updates)
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
- [Card](#card)
|
|
15
|
+
- [Count Badge](#count-badge)
|
|
16
|
+
- [Text](#text)
|
|
17
|
+
- [Form Field Preview](#form-field-preview)
|
|
15
18
|
|
|
16
19
|
## Codemod
|
|
17
20
|
|
|
@@ -80,7 +83,7 @@ We add the [@deprecated](https://jsdoc.app/tags-deprecated.html) JSDoc tag to co
|
|
|
80
83
|
in a future major release. This signals consumers to migrate to a more stable alternative before the
|
|
81
84
|
deprecated code is removed.
|
|
82
85
|
|
|
83
|
-
###
|
|
86
|
+
### Form Field Main
|
|
84
87
|
|
|
85
88
|
**PR:** [#2472](https://github.com/Workday/canvas-kit/pull/2472)
|
|
86
89
|
|
|
@@ -91,7 +94,7 @@ instead.
|
|
|
91
94
|
|
|
92
95
|
---
|
|
93
96
|
|
|
94
|
-
###
|
|
97
|
+
### Text Input Preview
|
|
95
98
|
|
|
96
99
|
**PR:** [#2472](https://github.com/Workday/canvas-kit/pull/2472)
|
|
97
100
|
|
|
@@ -102,7 +105,7 @@ instead.
|
|
|
102
105
|
|
|
103
106
|
---
|
|
104
107
|
|
|
105
|
-
###
|
|
108
|
+
### Text Area Preview
|
|
106
109
|
|
|
107
110
|
**PR:** [#2472](https://github.com/Workday/canvas-kit/pull/2472)
|
|
108
111
|
|
|
@@ -113,8 +116,28 @@ instead.
|
|
|
113
116
|
|
|
114
117
|
---
|
|
115
118
|
|
|
119
|
+
### Label Text
|
|
120
|
+
|
|
121
|
+
**PR:** [#2455](https://github.com/Workday/canvas-kit/pull/2455)
|
|
122
|
+
|
|
123
|
+
We've deprecated `LabelText` from [Main](#main) in favor of our compound component `FormField.Label`
|
|
124
|
+
in [Preview](#preview). Please use
|
|
125
|
+
[`FormField.Label`](https://workday.github.io/canvas-kit/?path=//docs/preview-inputs-form-field--basic)
|
|
126
|
+
instead.
|
|
127
|
+
|
|
128
|
+
If you still want to use a `label` element outside of the context of a form, you can use `Text`
|
|
129
|
+
instead.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
116
133
|
## Component Updates
|
|
117
134
|
|
|
135
|
+
### Card
|
|
136
|
+
|
|
137
|
+
`Card` and its subcomponents have been refactored to use our new styling utilities and tokens.
|
|
138
|
+
`Card` no longer extends the `Box` component, however, it still supports Emotion `styled` and style
|
|
139
|
+
props.
|
|
140
|
+
|
|
118
141
|
### Count Badge
|
|
119
142
|
|
|
120
143
|
**PR:** [#2442](https://github.com/Workday/canvas-kit/pull/2442)
|
|
@@ -122,7 +145,16 @@ instead.
|
|
|
122
145
|
`CountBadge` now uses `createComponent`, Canvas Tokens, and our new styling utilities. The component
|
|
123
146
|
API has not been changed, and it should behave identically as it did in previous versions.
|
|
124
147
|
|
|
125
|
-
###
|
|
148
|
+
### Text
|
|
149
|
+
|
|
150
|
+
**PR:** [#2455](https://github.com/Workday/canvas-kit/pull/2455)
|
|
151
|
+
|
|
152
|
+
`Text` has been refactored to use our new styling utilities and tokens. It no longer extends the
|
|
153
|
+
`Box` component, however, it still supports Emotion `styled` and style props. Type level components:
|
|
154
|
+
`Title`, `Heading`, `BodyText` and `Subtext`, have not been changed since they extend the `Text`
|
|
155
|
+
component. These changes do not affect the components API.
|
|
156
|
+
|
|
157
|
+
### Form Field Preview
|
|
126
158
|
|
|
127
159
|
**PR:** [#2472](https://github.com/Workday/canvas-kit/pull/2472)
|
|
128
160
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
|
+
import {LoadingSparkles} from '@workday/canvas-kit-preview-react/loading-sparkles';
|
|
3
|
+
|
|
4
|
+
import Basic from './examples/Basic';
|
|
5
|
+
import RTL from './examples/RTL';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Canvas Kit Loading Sparkles
|
|
9
|
+
|
|
10
|
+
`LoadingSparkles` is a loading animation that makes users aware an AI operation is in progress.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
yarn add @workday/canvas-kit-react
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Basic Example
|
|
21
|
+
|
|
22
|
+
`LoadingSparkles` is designed to work out-of-the-box, but you'll need to add `aria-live="polite"`
|
|
23
|
+
and a descriptive `aria-label` for screen reader accesibility.
|
|
24
|
+
|
|
25
|
+
<ExampleCodeBlock code={Basic} />
|
|
26
|
+
|
|
27
|
+
### Right-to-Left (RTL)
|
|
28
|
+
|
|
29
|
+
<ExampleCodeBlock code={RTL} />
|
|
30
|
+
|
|
31
|
+
## Component API
|
|
32
|
+
|
|
33
|
+
<SymbolDoc name="LoadingSparkles" fileName="/preview-react/" />
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {LoadingSparkles} from '@workday/canvas-kit-preview-react/loading-sparkles';
|
|
3
|
+
import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
|
|
4
|
+
|
|
5
|
+
export default () => {
|
|
6
|
+
const theme = {
|
|
7
|
+
canvas: {
|
|
8
|
+
direction: ContentDirection.RTL,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
return (
|
|
12
|
+
<CanvasProvider theme={theme}>
|
|
13
|
+
<LoadingSparkles />
|
|
14
|
+
</CanvasProvider>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -45,9 +45,9 @@ Here's an example of a `Card` with a increased `depth` of `2`.
|
|
|
45
45
|
### Padding
|
|
46
46
|
|
|
47
47
|
Set the `padding` prop of the `Card` (again, supported via `Box`) to adjust its padding. Card has a
|
|
48
|
-
default padding of `
|
|
48
|
+
default padding of `x8` (`4rem` or `32px`).
|
|
49
49
|
|
|
50
|
-
Here's an example of a `Card` with a reduced padding of `
|
|
50
|
+
Here's an example of a `Card` with a reduced padding of `x3` (`0.75rem` or `12px`).
|
|
51
51
|
|
|
52
52
|
<ExampleCodeBlock code={Padding} />
|
|
53
53
|
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Card} from '@workday/canvas-kit-react/card';
|
|
3
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
|
|
6
|
+
const cardCustomDepth = createStyles({
|
|
7
|
+
boxShadow: system.depth[2],
|
|
8
|
+
});
|
|
3
9
|
|
|
4
10
|
export default () => {
|
|
5
11
|
return (
|
|
6
|
-
<Card
|
|
12
|
+
<Card cs={cardCustomDepth}>
|
|
7
13
|
<Card.Heading>Canvas Supreme</Card.Heading>
|
|
8
14
|
<Card.Body>
|
|
9
15
|
Our house special supreme pizza includes pepperoni, sausage, bell peppers, mushrooms,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Card} from '@workday/canvas-kit-react/card';
|
|
3
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
import {space} from '../../../tokens';
|
|
6
|
+
|
|
7
|
+
const cardCustomPadding = createStyles({
|
|
8
|
+
padding: system.space.x3,
|
|
9
|
+
});
|
|
3
10
|
|
|
4
11
|
export default () => {
|
|
5
12
|
return (
|
|
6
|
-
<Card
|
|
13
|
+
<Card cs={cardCustomPadding}>
|
|
7
14
|
<Card.Heading>Canvas Supreme</Card.Heading>
|
|
8
15
|
<Card.Body>
|
|
9
16
|
Our house special supreme pizza includes pepperoni, sausage, bell peppers, mushrooms,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
|
+
import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
|
|
2
3
|
|
|
3
4
|
import Basic from './examples/LabelText/Basic';
|
|
4
5
|
import Cursor from './examples/LabelText/Cursor';
|
|
@@ -7,6 +8,14 @@ import Disabled from './examples/LabelText/Disabled';
|
|
|
7
8
|
|
|
8
9
|
# Canvas Kit Label Text
|
|
9
10
|
|
|
11
|
+
<StatusIndicator variant="red">
|
|
12
|
+
<StatusIndicator.Label>Deprecated</StatusIndicator.Label>
|
|
13
|
+
</StatusIndicator>
|
|
14
|
+
|
|
15
|
+
`LabelText` has been deprecated and will be removed in a future major version. Please use
|
|
16
|
+
[FormField.Label](https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-form-field--basic)
|
|
17
|
+
from Preview instead.
|
|
18
|
+
|
|
10
19
|
`LabelText` provides a simple way to render a label with built-in support for Canvas type tokens.
|
|
11
20
|
|
|
12
21
|
## Installation
|
|
@@ -19,7 +28,8 @@ yarn add @workday/canvas-kit-react
|
|
|
19
28
|
|
|
20
29
|
### Basic Example
|
|
21
30
|
|
|
22
|
-
`LabelText`
|
|
31
|
+
`LabelText` renders a `<label>` element. This component is deprecated in favor of `FormField.Label`
|
|
32
|
+
since it should be used in tandem with form elements.
|
|
23
33
|
|
|
24
34
|
<ExampleCodeBlock code={Basic} />
|
|
25
35
|
|
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {LabelText} from '@workday/canvas-kit-react/text';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
5
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
6
|
+
|
|
7
|
+
const inverseBackground = createStyles({
|
|
8
|
+
backgroundColor: base.blueberry400,
|
|
9
|
+
padding: system.space.x4,
|
|
10
|
+
marginTop: system.space.x4,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default () => {
|
|
14
|
+
return (
|
|
15
|
+
<div>
|
|
16
|
+
<LabelText disabled>Disabled Label</LabelText>
|
|
17
|
+
<div className={inverseBackground}>
|
|
18
|
+
<LabelText disabled variant="inverse">
|
|
19
|
+
Disabled Inverse Label
|
|
20
|
+
</LabelText>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.656-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",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^11.0.0-alpha.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^11.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-react": "^11.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-styling": "^11.0.0-alpha.
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^11.0.0-alpha.656-next.0",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^11.0.0-alpha.656-next.0",
|
|
49
|
+
"@workday/canvas-kit-react": "^11.0.0-alpha.656-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^11.0.0-alpha.656-next.0",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
|
-
"@workday/canvas-tokens-web": "^1.0.
|
|
52
|
+
"@workday/canvas-tokens-web": "^1.0.2",
|
|
53
53
|
"markdown-to-jsx": "^6.10.3",
|
|
54
54
|
"ts-node": "^10.9.1"
|
|
55
55
|
},
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"mkdirp": "^1.0.3",
|
|
60
60
|
"typescript": "4.2"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "571f72183c962ed851027dcf5d5a93c4111bde68"
|
|
63
63
|
}
|