@workday/canvas-kit-docs 7.4.9 → 7.4.11

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.
@@ -1353,7 +1353,7 @@ module.exports = {specifications: [
1353
1353
  },
1354
1354
  {
1355
1355
  "type": "it",
1356
- "name": "the asterisk should a title attribute set to \"required\""
1356
+ "name": "the input should have a \"required\" attribute"
1357
1357
  }
1358
1358
  ]
1359
1359
  }
@@ -1445,6 +1445,10 @@ module.exports = {specifications: [
1445
1445
  "type": "it",
1446
1446
  "name": "should transfer focus to the first menu item"
1447
1447
  },
1448
+ {
1449
+ "type": "it",
1450
+ "name": "should have aria-disabled=true"
1451
+ },
1448
1452
  {
1449
1453
  "type": "describe",
1450
1454
  "name": "when escape key is pressed",
@@ -1509,6 +1513,24 @@ module.exports = {specifications: [
1509
1513
  }
1510
1514
  ]
1511
1515
  },
1516
+ {
1517
+ "type": "describe",
1518
+ "name": "when the fourth item is clicked",
1519
+ "children": [
1520
+ {
1521
+ "type": "it",
1522
+ "name": "should not close the menu"
1523
+ },
1524
+ {
1525
+ "type": "it",
1526
+ "name": "should have aria-expanded set to true"
1527
+ },
1528
+ {
1529
+ "type": "it",
1530
+ "name": "should not select the fourth item"
1531
+ }
1532
+ ]
1533
+ },
1512
1534
  {
1513
1535
  "type": "describe",
1514
1536
  "name": "when the tab key is pressed",
@@ -1535,6 +1557,24 @@ module.exports = {specifications: [
1535
1557
  {
1536
1558
  "type": "it",
1537
1559
  "name": "should focus on the last option"
1560
+ },
1561
+ {
1562
+ "type": "describe",
1563
+ "name": "when the enter key is pressed",
1564
+ "children": [
1565
+ {
1566
+ "type": "it",
1567
+ "name": "should not close the menu"
1568
+ },
1569
+ {
1570
+ "type": "it",
1571
+ "name": "should have aria-expanded set to true"
1572
+ },
1573
+ {
1574
+ "type": "it",
1575
+ "name": "should not select the fourth item"
1576
+ }
1577
+ ]
1538
1578
  }
1539
1579
  ]
1540
1580
  }
@@ -1353,7 +1353,7 @@ module.exports = {specifications: [
1353
1353
  },
1354
1354
  {
1355
1355
  "type": "it",
1356
- "name": "the asterisk should a title attribute set to \"required\""
1356
+ "name": "the input should have a \"required\" attribute"
1357
1357
  }
1358
1358
  ]
1359
1359
  }
@@ -1445,6 +1445,10 @@ module.exports = {specifications: [
1445
1445
  "type": "it",
1446
1446
  "name": "should transfer focus to the first menu item"
1447
1447
  },
1448
+ {
1449
+ "type": "it",
1450
+ "name": "should have aria-disabled=true"
1451
+ },
1448
1452
  {
1449
1453
  "type": "describe",
1450
1454
  "name": "when escape key is pressed",
@@ -1509,6 +1513,24 @@ module.exports = {specifications: [
1509
1513
  }
1510
1514
  ]
1511
1515
  },
1516
+ {
1517
+ "type": "describe",
1518
+ "name": "when the fourth item is clicked",
1519
+ "children": [
1520
+ {
1521
+ "type": "it",
1522
+ "name": "should not close the menu"
1523
+ },
1524
+ {
1525
+ "type": "it",
1526
+ "name": "should have aria-expanded set to true"
1527
+ },
1528
+ {
1529
+ "type": "it",
1530
+ "name": "should not select the fourth item"
1531
+ }
1532
+ ]
1533
+ },
1512
1534
  {
1513
1535
  "type": "describe",
1514
1536
  "name": "when the tab key is pressed",
@@ -1535,6 +1557,24 @@ module.exports = {specifications: [
1535
1557
  {
1536
1558
  "type": "it",
1537
1559
  "name": "should focus on the last option"
1560
+ },
1561
+ {
1562
+ "type": "describe",
1563
+ "name": "when the enter key is pressed",
1564
+ "children": [
1565
+ {
1566
+ "type": "it",
1567
+ "name": "should not close the menu"
1568
+ },
1569
+ {
1570
+ "type": "it",
1571
+ "name": "should have aria-expanded set to true"
1572
+ },
1573
+ {
1574
+ "type": "it",
1575
+ "name": "should not select the fourth item"
1576
+ }
1577
+ ]
1538
1578
  }
1539
1579
  ]
1540
1580
  }
@@ -14,7 +14,7 @@ export default () => {
14
14
  <Menu.Item>Second Item</Menu.Item>
15
15
  <Menu.Divider />
16
16
  <Menu.Item>Third Item (with a really, really, really long label)</Menu.Item>
17
- <Menu.Item>Fourth Item</Menu.Item>
17
+ <Menu.Item aria-disabled>Fourth Item</Menu.Item>
18
18
  </Menu.List>
19
19
  </Menu.Card>
20
20
  </Menu.Popper>
@@ -32,9 +32,9 @@ export default () => {
32
32
  * @param id The id of the item that will be removed
33
33
  */
34
34
  const removeItem = <T extends unknown>(id: string, model: ReturnType<typeof useTabsModel>) => {
35
- const index = model.state.items.findIndex(item => model.getId(item) === model.state.cursorId);
35
+ const index = model.state.items.findIndex(item => item.id === model.state.cursorId);
36
36
  const nextIndex = index === model.state.items.length - 1 ? index - 1 : index + 1;
37
- const nextId = model.getId(model.state.items[nextIndex]);
37
+ const nextId = model.state.items[nextIndex].id;
38
38
  if (model.state.selectedIds[0] === id) {
39
39
  // We're removing the currently selected item. Select next item
40
40
  model.events.select({id: nextId});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "7.4.9",
3
+ "version": "7.4.11",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "@storybook/csf": "0.0.1",
45
- "@workday/canvas-kit-react": "^7.4.9"
45
+ "@workday/canvas-kit-react": "^7.4.11"
46
46
  },
47
47
  "devDependencies": {
48
48
  "fs-extra": "^10.0.0",
@@ -50,5 +50,5 @@
50
50
  "mkdirp": "^1.0.3",
51
51
  "typescript": "4.1"
52
52
  },
53
- "gitHead": "ef4231dc82547a15ca41738f8b04731ccaa815a2"
53
+ "gitHead": "0e4657f28e4ece8a2920e99b9466a1dfb3e8d79e"
54
54
  }