@workday/canvas-kit-docs 14.0.0-alpha.1223-next.0 → 14.0.0-alpha.1225-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/ExampleCodeBlock.d.ts.map +1 -1
- package/dist/es6/lib/ExampleCodeBlock.js +7 -6
- package/dist/es6/lib/docs.js +0 -1412
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +33 -2
- package/dist/mdx/preview-react/pill/Pill.mdx +2 -2
- package/dist/mdx/preview-react/pill/examples/WithReadOnly.tsx +1 -1
- package/lib/ExampleCodeBlock.tsx +45 -37
- package/package.json +6 -6
|
@@ -29,8 +29,9 @@ any questions.
|
|
|
29
29
|
- [Side Panel (Main)](#side-panel-main)
|
|
30
30
|
- [Tokens](#tokens)
|
|
31
31
|
- [Removals](#removals)
|
|
32
|
-
- [Menu (preview)](#menu-preview)
|
|
33
32
|
- [Deprecated Buttons](#deprecated-buttons)
|
|
33
|
+
- [Menu (preview)](#menu-preview)
|
|
34
|
+
- [readyOnlyPillStencil and removeablePillStencil][readyOnlyPillStencil-and-removeablePillStencil]
|
|
34
35
|
- [Troubleshooting](#troubleshooting)
|
|
35
36
|
- [Glossary](#glossary)
|
|
36
37
|
- [Main](#main)
|
|
@@ -152,6 +153,7 @@ The following components have been updated:
|
|
|
152
153
|
- `InformationHighlight` [#3443](https://github.com/Workday/canvas-kit/pull/3443)
|
|
153
154
|
- `LoadingDots` (Main) [#3393](https://github.com/Workday/canvas-kit/pull/3393)
|
|
154
155
|
- `Pagination` (Preview) [#3300](https://github.com/Workday/canvas-kit/pull/3300)
|
|
156
|
+
- `Pill` [#3446](https://github.com/Workday/canvas-kit/pull/3446)
|
|
155
157
|
- `SearchForm` (Labs) [#3303](https://github.com/Workday/canvas-kit/pull/3303)
|
|
156
158
|
- `SegmentedControl` (Main) [#3278](https://github.com/Workday/canvas-kit/pull/3278)
|
|
157
159
|
- `SegmentedControl` (Preview) [#3278](https://github.com/Workday/canvas-kit/pull/3278)
|
|
@@ -330,13 +332,37 @@ These changes are only **visual** and should not affect the functionality of the
|
|
|
330
332
|
|
|
331
333
|
### Pill
|
|
332
334
|
|
|
333
|
-
**
|
|
335
|
+
**PRs:** [#3430](https://github.com/Workday/canvas-kit/pull/3430), [#3446](https://github.com/Workday/canvas-kit/pull/3446)
|
|
334
336
|
|
|
335
337
|
- `Pill` has been updated to use the `Avatar` component from Preview. This change requires that you
|
|
336
338
|
provide a value for the `name` prop.
|
|
337
339
|
|
|
338
340
|
> 🤖 The codemod will handle the change of `altText` to `name` on `Pill.Avatar`.
|
|
339
341
|
|
|
342
|
+
- The `Pill` component no longer supports `'default'` as a value for the `variant` prop. If the
|
|
343
|
+
`variant` prop is not provided, the component will use its default styling.
|
|
344
|
+
|
|
345
|
+
- `readyOnlyPillStencil` and `removeablePillStencil` have been removed due to some styling clean up. Please use `pillStencil` instead.
|
|
346
|
+
|
|
347
|
+
**Before in v13**
|
|
348
|
+
|
|
349
|
+
```tsx
|
|
350
|
+
<Pill variant="default">
|
|
351
|
+
<Pill.Avatar altText="John Doe" />
|
|
352
|
+
<Pill.Label>John Doe</Pill.Label>
|
|
353
|
+
</Pill>
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**After in v14**
|
|
357
|
+
|
|
358
|
+
```tsx
|
|
359
|
+
<Pill>
|
|
360
|
+
<Pill.Avatar name="John Doe" />
|
|
361
|
+
<Pill.Label>John Doe</Pill.Label>
|
|
362
|
+
</Pill>
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
|
|
340
366
|
### Search Form 🚨
|
|
341
367
|
|
|
342
368
|
**PR:** [#3303](https://github.com/Workday/canvas-kit/pull/3303)
|
|
@@ -519,6 +545,11 @@ We've removed `Menu` from `@workday/canvas-kit-preview-react` package. Please us
|
|
|
519
545
|
[Menu](https://workday.github.io/canvas-kit/?path=/docs/components-popups-menu--docs) from
|
|
520
546
|
`@workday/canvas-kit-react` instead.
|
|
521
547
|
|
|
548
|
+
### readyOnlyPillStencil and removeablePillStencil
|
|
549
|
+
|
|
550
|
+
The `readyOnlyPillStencil` and `removeablePillStencil` utilities have been removed from the Pill
|
|
551
|
+
package. Please use `pillStencil` instead.
|
|
552
|
+
|
|
522
553
|
---
|
|
523
554
|
|
|
524
555
|
## Troubleshooting
|
|
@@ -28,7 +28,7 @@ information to help with scanning and organization.
|
|
|
28
28
|
|
|
29
29
|
### Basic Pills
|
|
30
30
|
|
|
31
|
-
By default a Pill is considered interactive
|
|
31
|
+
By default a Pill is considered interactive. All leading
|
|
32
32
|
elements (icons or avatars) are intended to be descriptive, helping support the label. Do not rely
|
|
33
33
|
on the leading element to indicate the interaction behavior.
|
|
34
34
|
|
|
@@ -60,7 +60,7 @@ the count will directly correlate to that category.
|
|
|
60
60
|
|
|
61
61
|
### Read Only
|
|
62
62
|
|
|
63
|
-
The `readOnly` variant is a non-interactive element that is used to display information.
|
|
63
|
+
The `readOnly` variant is a non-interactive element that is used to display information.
|
|
64
64
|
|
|
65
65
|
You can define a read only `Pill` by providing a `variant='readOnly'` prop.
|
|
66
66
|
|
|
@@ -10,7 +10,7 @@ const flexStyles = createStyles({
|
|
|
10
10
|
export default () => (
|
|
11
11
|
<div className={flexStyles} id="read-only-list">
|
|
12
12
|
<Pill variant="readOnly">Read-only</Pill>
|
|
13
|
-
<Pill variant="readOnly" maxWidth={
|
|
13
|
+
<Pill variant="readOnly" maxWidth={150}>
|
|
14
14
|
Read-only but with super long text in case you want to read a paragraph in a Pill which we
|
|
15
15
|
don't recommend
|
|
16
16
|
</Pill>
|
package/lib/ExampleCodeBlock.tsx
CHANGED
|
@@ -18,6 +18,7 @@ import eslintrc from '!!raw-loader!./stackblitzFiles/.eslintrc.cjs.txt';
|
|
|
18
18
|
import tsconfigNodeFile from '!!raw-loader!./stackblitzFiles/tsconfig.node.json';
|
|
19
19
|
import appFile from '!!raw-loader!./stackblitzFiles/App.tsx';
|
|
20
20
|
import viteEnvFile from '!!raw-loader!./stackblitzFiles/vite-env.d.ts';
|
|
21
|
+
import {CanvasProvider, defaultCanvasTheme} from '@workday/canvas-kit-react/common';
|
|
21
22
|
|
|
22
23
|
const cardStencil = createStencil({
|
|
23
24
|
base: {
|
|
@@ -123,48 +124,55 @@ export const ExampleCodeBlock = ({code}: any) => {
|
|
|
123
124
|
<div {...cardStencil({opened: isCodeDisplayed})}>
|
|
124
125
|
<Card data-part="example-block" className="sb-unstyled">
|
|
125
126
|
<Card.Body>
|
|
126
|
-
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
<CanvasProvider theme={{canvas: defaultCanvasTheme}}>
|
|
128
|
+
{React.createElement(code)}
|
|
129
|
+
{code && (
|
|
130
|
+
<div data-part="code-toggle-stackblitz-btn-container">
|
|
131
|
+
<TertiaryButton size="extraSmall" onClick={() => openProjectInStackblitz()}>
|
|
132
|
+
⚡️ Edit in Stackblitz
|
|
133
|
+
</TertiaryButton>
|
|
134
|
+
<TertiaryButton
|
|
135
|
+
size="extraSmall"
|
|
136
|
+
onClick={() => setCodeDisplayed(!isCodeDisplayed)}
|
|
137
|
+
>
|
|
138
|
+
{!isCodeDisplayed ? 'Show Code' : 'Hide Code'}
|
|
139
|
+
</TertiaryButton>
|
|
140
|
+
</div>
|
|
141
|
+
)}
|
|
142
|
+
</CanvasProvider>
|
|
137
143
|
</Card.Body>
|
|
138
144
|
</Card>
|
|
139
145
|
<Card data-part="code-block" padding={0}>
|
|
140
146
|
<Card.Body cs={{position: 'relative'}}>
|
|
141
|
-
{
|
|
142
|
-
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
<CanvasProvider theme={{canvas: defaultCanvasTheme}}>
|
|
148
|
+
{code && (
|
|
149
|
+
<div ref={textInput}>
|
|
150
|
+
<SyntaxHighlighter
|
|
151
|
+
className="sb-unstyled"
|
|
152
|
+
language="jsx"
|
|
153
|
+
style={vscDarkPlus}
|
|
154
|
+
customStyle={{
|
|
155
|
+
fontSize: cssVar(system.fontSize.subtext.large),
|
|
156
|
+
lineHeight: cssVar(system.lineHeight.subtext.large),
|
|
157
|
+
margin: '0',
|
|
158
|
+
padding: `${cssVar(system.space.x8)} ${cssVar(system.space.x10)}`,
|
|
159
|
+
}}
|
|
160
|
+
children={code.__RAW__}
|
|
161
|
+
/>
|
|
162
|
+
</div>
|
|
163
|
+
)}
|
|
164
|
+
<Tooltip title={copied ? 'Copied!' : 'Copy Source Code'}>
|
|
165
|
+
<TertiaryButton
|
|
166
|
+
aria-label="Copy Code"
|
|
167
|
+
size="large"
|
|
168
|
+
data-part="copy-btn"
|
|
169
|
+
variant="inverse"
|
|
170
|
+
iconPosition="end"
|
|
171
|
+
icon={copied ? checkCircleIcon : copyIcon}
|
|
172
|
+
onClick={onCopy}
|
|
154
173
|
/>
|
|
155
|
-
</
|
|
156
|
-
|
|
157
|
-
<Tooltip title={copied ? 'Copied!' : 'Copy Source Code'}>
|
|
158
|
-
<TertiaryButton
|
|
159
|
-
aria-label="Copy Code"
|
|
160
|
-
size="large"
|
|
161
|
-
data-part="copy-btn"
|
|
162
|
-
variant="inverse"
|
|
163
|
-
iconPosition="end"
|
|
164
|
-
icon={copied ? checkCircleIcon : copyIcon}
|
|
165
|
-
onClick={onCopy}
|
|
166
|
-
/>
|
|
167
|
-
</Tooltip>
|
|
174
|
+
</Tooltip>
|
|
175
|
+
</CanvasProvider>
|
|
168
176
|
</Card.Body>
|
|
169
177
|
</Card>
|
|
170
178
|
</div>
|
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.1225-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.1225-next.0",
|
|
49
|
+
"@workday/canvas-kit-preview-react": "^14.0.0-alpha.1225-next.0",
|
|
50
|
+
"@workday/canvas-kit-react": "^14.0.0-alpha.1225-next.0",
|
|
51
|
+
"@workday/canvas-kit-styling": "^14.0.0-alpha.1225-next.0",
|
|
52
52
|
"@workday/canvas-system-icons-web": "^3.0.35",
|
|
53
53
|
"@workday/canvas-tokens-web": "3.0.0-alpha.12",
|
|
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": "521a212f0bb4fa645b980f065086277464445490"
|
|
65
65
|
}
|