@workday/canvas-kit-docs 9.1.14 → 9.1.15

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.
@@ -3199,6 +3199,146 @@ module.exports = {specifications: [
3199
3199
  }
3200
3200
  ]
3201
3201
  },
3202
+ {
3203
+ "type": "file",
3204
+ "name": "PillPreview.spec.ts",
3205
+ "children": [
3206
+ {
3207
+ "type": "describe",
3208
+ "name": "Pill",
3209
+ "children": [
3210
+ {
3211
+ "type": "describe",
3212
+ "name": "given the [Preview/Pill, Basic] story is rendered",
3213
+ "children": [
3214
+ {
3215
+ "type": "it",
3216
+ "name": "should pass axe checks"
3217
+ },
3218
+ {
3219
+ "type": "it",
3220
+ "name": "should have two elements with a role of \"button\""
3221
+ },
3222
+ {
3223
+ "type": "it",
3224
+ "name": "should be able to click on the first pill"
3225
+ },
3226
+ {
3227
+ "type": "it",
3228
+ "name": "should have the second pill disabled"
3229
+ }
3230
+ ]
3231
+ },
3232
+ {
3233
+ "type": "describe",
3234
+ "name": "given the [Preview/Pill, With Avatar] story is rendered",
3235
+ "children": [
3236
+ {
3237
+ "type": "it",
3238
+ "name": "should pass axe checks"
3239
+ },
3240
+ {
3241
+ "type": "it",
3242
+ "name": "should have two elements with a role of \"button\""
3243
+ },
3244
+ {
3245
+ "type": "it",
3246
+ "name": "should be able to click on the first pill"
3247
+ },
3248
+ {
3249
+ "type": "it",
3250
+ "name": "should have the second pill disabled"
3251
+ }
3252
+ ]
3253
+ },
3254
+ {
3255
+ "type": "describe",
3256
+ "name": "given the [Preview/Pill, With Count] story is rendered",
3257
+ "children": [
3258
+ {
3259
+ "type": "it",
3260
+ "name": "should pass axe checks"
3261
+ },
3262
+ {
3263
+ "type": "it",
3264
+ "name": "should have two elements with a role of \"button\""
3265
+ },
3266
+ {
3267
+ "type": "it",
3268
+ "name": "should be able to click on the first pill"
3269
+ },
3270
+ {
3271
+ "type": "it",
3272
+ "name": "should have the second pill disabled"
3273
+ }
3274
+ ]
3275
+ },
3276
+ {
3277
+ "type": "describe",
3278
+ "name": "given the [Preview/Pill, With List] story is rendered",
3279
+ "children": [
3280
+ {
3281
+ "type": "it",
3282
+ "name": "should pass axe checks"
3283
+ },
3284
+ {
3285
+ "type": "it",
3286
+ "name": "should have 11 elements with a role of \"button\""
3287
+ },
3288
+ {
3289
+ "type": "it",
3290
+ "name": "should remove a pill from list if clicked"
3291
+ }
3292
+ ]
3293
+ },
3294
+ {
3295
+ "type": "describe",
3296
+ "name": "given the [Preview/Pill, With Removable] story is rendered",
3297
+ "children": [
3298
+ {
3299
+ "type": "it",
3300
+ "name": "should pass axe checks"
3301
+ },
3302
+ {
3303
+ "type": "it",
3304
+ "name": "should have 3 elements with a role of \"button\""
3305
+ },
3306
+ {
3307
+ "type": "it",
3308
+ "name": "should be able to click on the first pill"
3309
+ },
3310
+ {
3311
+ "type": "it",
3312
+ "name": "should be able to click on the second pill"
3313
+ },
3314
+ {
3315
+ "type": "it",
3316
+ "name": "should have the third pill disabled"
3317
+ }
3318
+ ]
3319
+ },
3320
+ {
3321
+ "type": "describe",
3322
+ "name": "given the [Preview/Pill, With Read Only] story is rendered",
3323
+ "children": [
3324
+ {
3325
+ "type": "it",
3326
+ "name": "should pass axe checks"
3327
+ },
3328
+ {
3329
+ "type": "it",
3330
+ "name": "should have 2 pills"
3331
+ },
3332
+ {
3333
+ "type": "it",
3334
+ "name": "should have tooltip on the second button"
3335
+ }
3336
+ ]
3337
+ }
3338
+ ]
3339
+ }
3340
+ ]
3341
+ },
3202
3342
  {
3203
3343
  "type": "file",
3204
3344
  "name": "Popup.spec.ts",
@@ -2,17 +2,24 @@ import React from 'react';
2
2
 
3
3
  import {Pill} from '@workday/canvas-kit-preview-react/pill';
4
4
 
5
- import {Flex} from '@workday/canvas-kit-react/layout';
5
+ import {Box, Flex} from '@workday/canvas-kit-react/layout';
6
+ import {BodyText} from '@workday/canvas-kit-react/text';
6
7
 
7
- export default () => (
8
- <Flex gap="xxs">
9
- <Pill onClick={() => console.warn('clicked')}>
10
- <Pill.Icon />
11
- <Pill.Label>Regina Skeltor</Pill.Label>
12
- </Pill>
13
- <Pill onClick={() => console.warn('clicked')} disabled>
14
- <Pill.Icon />
15
- <Pill.Label>Regina Skeltor</Pill.Label>
16
- </Pill>
17
- </Flex>
18
- );
8
+ export default () => {
9
+ const [text, setText] = React.useState('');
10
+ return (
11
+ <Box>
12
+ <Flex gap="xxs">
13
+ <Pill onClick={() => setText('The first pill is clicked!')}>
14
+ <Pill.Icon />
15
+ <Pill.Label>Regina Skeltor</Pill.Label>
16
+ </Pill>
17
+ <Pill onClick={() => setText('The second pill is clicked!')} disabled>
18
+ <Pill.Icon />
19
+ <Pill.Label>Regina Skeltor</Pill.Label>
20
+ </Pill>
21
+ </Flex>
22
+ <BodyText size="medium">{text}</BodyText>
23
+ </Box>
24
+ );
25
+ };
@@ -3,19 +3,24 @@ import React from 'react';
3
3
  import {Pill} from '@workday/canvas-kit-preview-react/pill';
4
4
  // @ts-ignore: Cannot find module error
5
5
  import testAvatar from './test-avatar.png';
6
- import {Flex} from '@workday/canvas-kit-react/layout';
6
+ import {Flex, Box} from '@workday/canvas-kit-react/layout';
7
+ import {BodyText} from '@workday/canvas-kit-react/text';
7
8
 
8
9
  export default () => {
10
+ const [text, setText] = React.useState('');
9
11
  return (
10
- <Flex gap="xxs">
11
- <Pill onClick={() => console.warn('clicked')}>
12
- <Pill.Avatar url={testAvatar} />
13
- Regina Skeltor
14
- </Pill>
15
- <Pill onClick={() => console.warn('clicked')} disabled maxWidth={50}>
16
- <Pill.Avatar url={testAvatar} />
17
- Regina Skeltor
18
- </Pill>
19
- </Flex>
12
+ <Box>
13
+ <Flex gap="xxs">
14
+ <Pill onClick={() => setText('The first pill is clicked!')}>
15
+ <Pill.Avatar url={testAvatar} />
16
+ Regina Skeltor
17
+ </Pill>
18
+ <Pill onClick={() => setText('The second pill is clicked!')} disabled maxWidth={50}>
19
+ <Pill.Avatar url={testAvatar} />
20
+ Regina Skeltor
21
+ </Pill>
22
+ </Flex>
23
+ <BodyText size="medium">{text}</BodyText>
24
+ </Box>
20
25
  );
21
26
  };
@@ -1,9 +1,23 @@
1
1
  import React from 'react';
2
2
  import {Pill} from '@workday/canvas-kit-preview-react/pill';
3
+ import {Flex, Box} from '@workday/canvas-kit-react/layout';
4
+ import {BodyText} from '@workday/canvas-kit-react/text';
3
5
 
4
- export default () => (
5
- <Pill onClick={() => console.warn('clicked')}>
6
- Shoes
7
- <Pill.Count>30</Pill.Count>
8
- </Pill>
9
- );
6
+ export default () => {
7
+ const [text, setText] = React.useState('');
8
+ return (
9
+ <Box>
10
+ <Flex gap="xxs">
11
+ <Pill onClick={() => setText('The first pill is clicked!')}>
12
+ Shoes
13
+ <Pill.Count>30</Pill.Count>
14
+ </Pill>
15
+ <Pill onClick={() => setText('The second pill is clicked!')} disabled>
16
+ Shoes
17
+ <Pill.Count>30</Pill.Count>
18
+ </Pill>
19
+ </Flex>
20
+ <BodyText size="medium">{text}</BodyText>
21
+ </Box>
22
+ );
23
+ };
@@ -17,15 +17,19 @@ const data = [
17
17
  'Jewelry',
18
18
  ];
19
19
 
20
- export default () => (
21
- <Flex flexWrap="wrap">
22
- {data.map((cat, index) => {
23
- return (
24
- <Pill key={index} variant="removable" marginBottom="xxs" marginInlineEnd="xxs">
25
- <Pill.Label>{cat}</Pill.Label>
26
- <Pill.IconButton onClick={() => console.log(`delete ${cat}`)} />
27
- </Pill>
28
- );
29
- })}
30
- </Flex>
31
- );
20
+ export default () => {
21
+ const [items, setItems] = React.useState(data);
22
+
23
+ return (
24
+ <Flex flexWrap="wrap">
25
+ {items.map((cat, index) => {
26
+ return (
27
+ <Pill key={index} variant="removable" marginBottom="xxs" marginInlineEnd="xxs">
28
+ <Pill.Label>{cat}</Pill.Label>
29
+ <Pill.IconButton onClick={() => setItems(items.filter(i => i !== cat))} />
30
+ </Pill>
31
+ );
32
+ })}
33
+ </Flex>
34
+ );
35
+ };
@@ -5,7 +5,7 @@ import {Pill} from '@workday/canvas-kit-preview-react/pill';
5
5
  import {Flex} from '@workday/canvas-kit-react/layout';
6
6
 
7
7
  export default () => (
8
- <Flex gap="xxs">
8
+ <Flex gap="xxs" id="read-only-list">
9
9
  <Pill variant="readOnly">Read-only</Pill>
10
10
  <Pill variant="readOnly" maxWidth={250}>
11
11
  Read-only but with super long text in case you want to read a paragraph in a Pill which we
@@ -3,23 +3,29 @@ import React from 'react';
3
3
  import {Pill} from '@workday/canvas-kit-preview-react/pill';
4
4
  // @ts-ignore: Cannot find module error
5
5
  import testAvatar from './test-avatar.png';
6
- import {Flex} from '@workday/canvas-kit-react/layout';
6
+ import {Box, Flex} from '@workday/canvas-kit-react/layout';
7
+ import {BodyText} from '@workday/canvas-kit-react/text';
7
8
 
8
- export default () => (
9
- <Flex gap="xxs">
10
- <Pill variant="removable">
11
- Pink Shirts
12
- <Pill.IconButton onClick={() => console.warn('clicked')} />
13
- </Pill>
14
- <Pill variant="removable">
15
- <Pill.Avatar url={testAvatar} />
16
- Carolyn Grimaldi
17
- <Pill.IconButton onClick={() => console.warn('clicked')} />
18
- </Pill>
19
-
20
- <Pill variant="removable" disabled>
21
- <Pill.Label>This is a category that should not exist because it is too long</Pill.Label>
22
- <Pill.IconButton />
23
- </Pill>
24
- </Flex>
25
- );
9
+ export default () => {
10
+ const [text, setText] = React.useState('');
11
+ return (
12
+ <Box>
13
+ <Flex gap="xxs">
14
+ <Pill variant="removable">
15
+ Pink Shirts
16
+ <Pill.IconButton onClick={() => setText('The first pill is clicked!')} />
17
+ </Pill>
18
+ <Pill variant="removable">
19
+ <Pill.Avatar url={testAvatar} />
20
+ Carolyn Grimaldi
21
+ <Pill.IconButton onClick={() => setText('The second pill is clicked!')} />
22
+ </Pill>
23
+ <Pill variant="removable" disabled>
24
+ <Pill.Label>This is a category that should not exist because it is too long</Pill.Label>
25
+ <Pill.IconButton />
26
+ </Pill>
27
+ </Flex>
28
+ <BodyText size="medium">{text}</BodyText>
29
+ </Box>
30
+ );
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "9.1.14",
3
+ "version": "9.1.15",
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,9 +44,9 @@
44
44
  "dependencies": {
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@storybook/csf": "0.0.1",
47
- "@workday/canvas-kit-labs-react": "^9.1.14",
48
- "@workday/canvas-kit-preview-react": "^9.1.14",
49
- "@workday/canvas-kit-react": "^9.1.14",
47
+ "@workday/canvas-kit-labs-react": "^9.1.15",
48
+ "@workday/canvas-kit-preview-react": "^9.1.15",
49
+ "@workday/canvas-kit-react": "^9.1.15",
50
50
  "@workday/canvas-system-icons-web": "^3.0.0",
51
51
  "markdown-to-jsx": "^6.10.3",
52
52
  "ts-node": "^10.9.1"
@@ -57,5 +57,5 @@
57
57
  "mkdirp": "^1.0.3",
58
58
  "typescript": "4.2"
59
59
  },
60
- "gitHead": "4d9d5ccccccea8f303ca6045ec3d1e3fe3e0572f"
60
+ "gitHead": "96aba3862f634bb72f4bba906eea86f9c0c85563"
61
61
  }