@workday/canvas-kit-docs 14.2.13 → 14.2.14

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.
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "14.2.13",
22
- "@workday/canvas-kit-preview-react": "14.2.13",
23
- "@workday/canvas-kit-react": "14.2.13",
24
- "@workday/canvas-kit-react-fonts": "^14.2.13",
25
- "@workday/canvas-kit-styling": "14.2.13",
21
+ "@workday/canvas-kit-labs-react": "14.2.14",
22
+ "@workday/canvas-kit-preview-react": "14.2.14",
23
+ "@workday/canvas-kit-react": "14.2.14",
24
+ "@workday/canvas-kit-react-fonts": "^14.2.14",
25
+ "@workday/canvas-kit-styling": "14.2.14",
26
26
  "@workday/canvas-system-icons-web": "3.0.36",
27
27
  "@workday/canvas-tokens-web": "3.1.2"
28
28
  },
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "14.2.13",
22
- "@workday/canvas-kit-preview-react": "14.2.13",
23
- "@workday/canvas-kit-react": "14.2.13",
24
- "@workday/canvas-kit-react-fonts": "^14.2.13",
25
- "@workday/canvas-kit-styling": "14.2.13",
21
+ "@workday/canvas-kit-labs-react": "14.2.14",
22
+ "@workday/canvas-kit-preview-react": "14.2.14",
23
+ "@workday/canvas-kit-react": "14.2.14",
24
+ "@workday/canvas-kit-react-fonts": "^14.2.14",
25
+ "@workday/canvas-kit-styling": "14.2.14",
26
26
  "@workday/canvas-system-icons-web": "3.0.36",
27
27
  "@workday/canvas-tokens-web": "3.1.2"
28
28
  },
@@ -0,0 +1,66 @@
1
+ import {Modal, useModalModel} from '@workday/canvas-kit-react/modal';
2
+ import {DeleteButton} from '@workday/canvas-kit-react/button';
3
+ import {
4
+ Popup,
5
+ useCloseOnOutsideClick,
6
+ useCloseOnEscape,
7
+ usePopupModel,
8
+ } from '@workday/canvas-kit-react/popup';
9
+ import {Flex} from '@workday/canvas-kit-react/layout';
10
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
11
+
12
+ export default () => {
13
+ const modal = useModalModel();
14
+ const popup = usePopupModel();
15
+
16
+ const handleDelete = () => {
17
+ console.log('Delete Item');
18
+ };
19
+
20
+ useCloseOnOutsideClick(popup);
21
+ useCloseOnEscape(popup);
22
+
23
+ return (
24
+ <CanvasProvider dir="rtl">
25
+ <Modal model={modal}>
26
+ <Modal.Target as={DeleteButton}>Delete Item</Modal.Target>
27
+ <Modal.Overlay>
28
+ <Modal.Card>
29
+ <Modal.CloseIcon aria-label="Close" />
30
+ <Modal.Heading>Delete Item</Modal.Heading>
31
+ <Modal.Body>
32
+ <p>Are you sure you want to delete the item?</p>
33
+ <Popup model={popup}>
34
+ <Flex gap="s">
35
+ <Popup.Target as={DeleteButton}>Yes, Delete</Popup.Target>
36
+ <Popup.CloseButton>Cancel</Popup.CloseButton>
37
+ </Flex>
38
+ <Popup.Popper>
39
+ <Popup.Card>
40
+ <Popup.CloseIcon aria-label="Close" />
41
+ <Popup.Heading>Really Delete Item</Popup.Heading>
42
+ <Popup.Body>
43
+ <p>Are you sure you'd like to delete the item titled 'My Item'?</p>
44
+ <Flex gap="s">
45
+ <Popup.CloseButton
46
+ as={DeleteButton}
47
+ onClick={event => {
48
+ modal.events.hide(event);
49
+ handleDelete();
50
+ }}
51
+ >
52
+ Yes, Really Delete
53
+ </Popup.CloseButton>
54
+ <Popup.CloseButton>Cancel</Popup.CloseButton>
55
+ </Flex>
56
+ </Popup.Body>
57
+ </Popup.Card>
58
+ </Popup.Popper>
59
+ </Popup>
60
+ </Modal.Body>
61
+ </Modal.Card>
62
+ </Modal.Overlay>
63
+ </Modal>
64
+ </CanvasProvider>
65
+ );
66
+ };
@@ -0,0 +1,48 @@
1
+ import {Modal, useModalModel} from '@workday/canvas-kit-react/modal';
2
+ import {PrimaryButton} from '@workday/canvas-kit-react/button';
3
+ import {Flex, Box} from '@workday/canvas-kit-react/layout';
4
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
5
+ import {extLinkIcon} from '@workday/canvas-system-icons-web';
6
+
7
+ export default () => {
8
+ const model = useModalModel();
9
+ const handleAcknowledge = () => {
10
+ console.log('License Acknowledged');
11
+ };
12
+
13
+ const handleCancel = () => {
14
+ console.log('Cancel clicked');
15
+ };
16
+
17
+ return (
18
+ <CanvasProvider dir="rtl">
19
+ <PrimaryButton onClick={() => model.events.show()}>פתח רישיון</PrimaryButton>
20
+ <Modal model={model}>
21
+ <Modal.Overlay>
22
+ <Modal.Card>
23
+ <Modal.CloseIcon aria-label="Close" />
24
+ <Modal.Heading>MIT License</Modal.Heading>
25
+ <Modal.Body>
26
+ <Box as="p" marginY="zero">
27
+ בזאת ניתנת רשות, ללא תשלום, לכל אדם לקבל עותק של תוכנה זו וקבצי התיעוד הנלווים
28
+ ("התוכנה").
29
+ </Box>
30
+ </Modal.Body>
31
+ <Flex gap="s" padding="xxs">
32
+ <Modal.CloseButton
33
+ as={PrimaryButton}
34
+ onClick={handleAcknowledge}
35
+ icon={extLinkIcon}
36
+ iconPosition="end"
37
+ shouldMirrorIconInRTL
38
+ >
39
+ לְהוֹדוֹת
40
+ </Modal.CloseButton>
41
+ <Modal.CloseButton onClick={handleCancel}>לְבַטֵל</Modal.CloseButton>
42
+ </Flex>
43
+ </Modal.Card>
44
+ </Modal.Overlay>
45
+ </Modal>
46
+ </CanvasProvider>
47
+ );
48
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "14.2.13",
3
+ "version": "14.2.14",
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.2.13",
49
- "@workday/canvas-kit-preview-react": "^14.2.13",
50
- "@workday/canvas-kit-react": "^14.2.13",
51
- "@workday/canvas-kit-styling": "^14.2.13",
48
+ "@workday/canvas-kit-labs-react": "^14.2.14",
49
+ "@workday/canvas-kit-preview-react": "^14.2.14",
50
+ "@workday/canvas-kit-react": "^14.2.14",
51
+ "@workday/canvas-kit-styling": "^14.2.14",
52
52
  "@workday/canvas-system-icons-web": "^3.0.36",
53
53
  "@workday/canvas-tokens-web": "^3.1.6",
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": "9ade26bb6fd57ba27018d9e3ed36df673fc1ced2"
64
+ "gitHead": "4917e7ed2cce2ad785ba7cf7622d4fb586c426ae"
65
65
  }