@workday/canvas-kit-docs 10.0.11 → 10.0.12

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.
@@ -2605,7 +2605,7 @@ module.exports = {specifications: [
2605
2605
  },
2606
2606
  {
2607
2607
  "type": "it",
2608
- "name": "should transfer focus to the header element"
2608
+ "name": "should transfer focus to the cancel button"
2609
2609
  },
2610
2610
  {
2611
2611
  "type": "describe",
@@ -2633,7 +2633,7 @@ module.exports = {specifications: [
2633
2633
  },
2634
2634
  {
2635
2635
  "type": "it",
2636
- "name": "should transfer focus to the header element"
2636
+ "name": "should transfer focus to the cancel button"
2637
2637
  },
2638
2638
  {
2639
2639
  "type": "it",
@@ -4,8 +4,10 @@ import {PrimaryButton} from '@workday/canvas-kit-react/button';
4
4
  import {FormField} from '@workday/canvas-kit-react/form-field';
5
5
  import {TextInput} from '@workday/canvas-kit-react/text-input';
6
6
  import {Flex, Box} from '@workday/canvas-kit-react/layout';
7
+ import {useUniqueId} from '@workday/canvas-kit-react/common';
7
8
 
8
9
  export default () => {
10
+ const longDescID = useUniqueId();
9
11
  const ref = React.useRef<HTMLInputElement>(null);
10
12
  const [value, setValue] = React.useState('');
11
13
  const model = useModalModel({
@@ -20,11 +22,11 @@ export default () => {
20
22
  <Modal model={model}>
21
23
  <Modal.Target as={PrimaryButton}>Acknowledge License</Modal.Target>
22
24
  <Modal.Overlay>
23
- <Modal.Card>
25
+ <Modal.Card aria-describedby={longDescID}>
24
26
  <Modal.CloseIcon aria-label="Close" />
25
27
  <Modal.Heading>Acknowledge License</Modal.Heading>
26
28
  <Modal.Body>
27
- <Box as="p" marginTop={0} marginBottom="m">
29
+ <Box as="p" id={longDescID} marginTop={0} marginBottom="m">
28
30
  Enter your initials to acknowledge the license.
29
31
  </Box>
30
32
  <FormField label="Initials" style={{marginBottom: 0}}>
@@ -20,7 +20,7 @@ export default () => {
20
20
  <Modal.Card maxHeight="inherit" height="inherit">
21
21
  <Modal.CloseIcon aria-label="Close" />
22
22
  <Modal.Heading>MIT License</Modal.Heading>
23
- <Modal.Body>
23
+ <Modal.Body tabIndex={0}>
24
24
  <p style={{marginTop: 0}}>
25
25
  Permission is hereby granted, free of charge, to any person obtaining a copy of this
26
26
  software and associated documentation files (the "Software"), to deal in the Software
@@ -11,9 +11,14 @@ import {
11
11
  } from '@workday/canvas-kit-react/popup';
12
12
  import {DeleteButton} from '@workday/canvas-kit-react/button';
13
13
  import {Flex, Box} from '@workday/canvas-kit-react/layout';
14
+ import {useUniqueId} from '@workday/canvas-kit-react/common';
14
15
 
15
16
  export default () => {
16
- const model = usePopupModel();
17
+ const longDescId = useUniqueId();
18
+ const cancelBtnRef = React.useRef(null);
19
+ const model = usePopupModel({
20
+ initialFocusRef: cancelBtnRef,
21
+ });
17
22
 
18
23
  // disable useCloseOnEscape and useCloseOnOverlayClick
19
24
  useInitialFocus(model);
@@ -29,18 +34,18 @@ export default () => {
29
34
  <Modal model={model}>
30
35
  <Modal.Target as={DeleteButton}>Delete Item</Modal.Target>
31
36
  <Modal.Overlay>
32
- <Modal.Card>
37
+ <Modal.Card aria-describedby={longDescId}>
33
38
  <Modal.Heading>Delete Item</Modal.Heading>
34
39
  <Modal.Body>
35
- <Box as="p" marginY="zero">
40
+ <Box as="p" id={longDescId} marginY="zero">
36
41
  Are you sure you want to delete the item?
37
42
  </Box>
38
43
  </Modal.Body>
39
44
  <Flex gap="s" padding="xxs" marginTop="xxs">
45
+ <Modal.CloseButton ref={cancelBtnRef}>Cancel</Modal.CloseButton>
40
46
  <Modal.CloseButton as={DeleteButton} onClick={handleDelete}>
41
47
  Delete
42
48
  </Modal.CloseButton>
43
- <Modal.CloseButton>Cancel</Modal.CloseButton>
44
49
  </Flex>
45
50
  </Modal.Card>
46
51
  </Modal.Overlay>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "10.0.11",
3
+ "version": "10.0.12",
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,10 +44,10 @@
44
44
  "dependencies": {
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@storybook/csf": "0.0.1",
47
- "@workday/canvas-kit-labs-react": "^10.0.11",
48
- "@workday/canvas-kit-preview-react": "^10.0.11",
49
- "@workday/canvas-kit-react": "^10.0.11",
50
- "@workday/canvas-kit-styling": "^10.0.11",
47
+ "@workday/canvas-kit-labs-react": "^10.0.12",
48
+ "@workday/canvas-kit-preview-react": "^10.0.12",
49
+ "@workday/canvas-kit-react": "^10.0.12",
50
+ "@workday/canvas-kit-styling": "^10.0.12",
51
51
  "@workday/canvas-system-icons-web": "^3.0.0",
52
52
  "@workday/canvas-tokens-web": "^1.0.0",
53
53
  "markdown-to-jsx": "^6.10.3",
@@ -59,5 +59,5 @@
59
59
  "mkdirp": "^1.0.3",
60
60
  "typescript": "4.2"
61
61
  },
62
- "gitHead": "02876b4946ffdd35aa330f25cb12cfa3a1b7c4c8"
62
+ "gitHead": "fc70e44071da24dd518ae13f92120f9b393c3f2b"
63
63
  }