@brightspace-ui/core 1.209.0 → 1.209.1

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.
@@ -4,21 +4,38 @@ Alerts communicate critical information relating to the state of the system and
4
4
  <!-- docs: demo autoSize:false align:start -->
5
5
  ```html
6
6
  <script type="module">
7
- import '@brightspace-ui/core/components/alert/alert-toast.js';
7
+ import '@brightspace-ui/core/components/alert/alert-toast.js';
8
+ import '@brightspace-ui/core/components/button/button.js';
9
+
10
+ var alert = document.querySelector('#alert');
11
+ var alertToast = document.querySelector('#alert-toast');
12
+ var button = document.querySelector('#open');
13
+
14
+ alert.addEventListener('d2l-alert-close', function() {
15
+ if (!alertToast.open) button.style.display = 'block';
16
+ });
17
+ alertToast.addEventListener('d2l-alert-toast-close', function() {
18
+ if (alert.hasAttribute('hidden')) button.style.display = 'block';
19
+ });
20
+
21
+ button.addEventListener('click', () => {
22
+ alert.removeAttribute('hidden');
23
+ alertToast.open = true;
24
+ button.style.display = 'none';
25
+ });
8
26
  </script>
9
- <!-- docs: start hidden content -->
10
27
  <style>
11
28
  d2l-alert-toast {
12
29
  margin-left: 0 !important;
13
30
  margin-right: 0 !important;
14
31
  }
15
32
  </style>
16
- <!-- docs: end hidden content -->
17
33
 
18
- <d2l-alert type="default" button-text="Undo" has-close-button>
34
+ <d2l-button id="open" style="align-self:center;display:none;">Show Alerts</d2l-button>
35
+ <d2l-alert id="alert" type="default" button-text="Undo" has-close-button>
19
36
  A message.
20
37
  </d2l-alert>
21
- <d2l-alert-toast type="success" open no-auto-close>
38
+ <d2l-alert-toast id="alert-toast" type="success" open no-auto-close>
22
39
  A message.
23
40
  </d2l-alert-toast>
24
41
  ```
@@ -7,13 +7,17 @@ Dialogs interrupt the user to complete a set of tasks, confirm an action, or off
7
7
  <script type="module">
8
8
  import '@brightspace-ui/core/components/button/button.js';
9
9
  import '@brightspace-ui/core/components/dialog/dialog.js';
10
- </script>
11
10
 
11
+ document.querySelector('#open-demo').addEventListener('click', () => {
12
+ document.querySelector('#dialog-demo').opened = true;
13
+ });
14
+ </script>
12
15
  <d2l-dialog id="dialog-demo" title-text="Dialog Title">
13
16
  <div>Some dialog content</div>
14
17
  <d2l-button slot="footer" primary data-dialog-action="done">Done</d2l-button>
15
18
  <d2l-button slot="footer" data-dialog-action>Cancel</d2l-button>
16
19
  </d2l-dialog>
20
+ <d2l-button id="open-demo">Show Dialog</d2l-button>
17
21
  ```
18
22
 
19
23
  ## General Dialog [d2l-dialog]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "1.209.0",
3
+ "version": "1.209.1",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "repository": "https://github.com/BrightspaceUI/core.git",
6
6
  "publishConfig": {