@brightspace-ui/core 3.277.0 → 3.278.0

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.
@@ -1,73 +0,0 @@
1
- import '../button/button-subtle.js';
2
- import { css, html, LitElement } from 'lit';
3
- import { bodyCompactStyles } from '../typography/styles.js';
4
- import { getFocusRingStyles } from '../../helpers/focus.js';
5
-
6
- const overlayStyles = css`
7
- .action-slot::slotted(*) {
8
- display: inline;
9
- }
10
- :host {
11
- align-items: center;
12
- border: 1px solid var(--d2l-color-mica);
13
- border-radius: 0.3rem;
14
- column-gap: 0.75rem;
15
- display: block;
16
- display: flex;
17
- flex-wrap: wrap;
18
- padding: 1.2rem 1.5rem;
19
- }
20
-
21
- .d2l-backdrop-dirty-overlay {
22
- --d2l-focus-ring-offset: 3px;
23
- border-radius: 0.3rem;
24
- margin: 0;
25
- }
26
-
27
- .d2l-backdrop-dirty-overlay-action {
28
- vertical-align: top;
29
- }
30
- `;
31
-
32
- /**
33
- * The `d2l-backdrop-dirty-overlay` component is used to render a dialog with text and an action over another element that needs to be refreshed after user input.
34
- */
35
- class BackdropDirtyOverlay extends LitElement {
36
-
37
- static properties = {
38
- /**
39
- * The text displayed on the dirty state overlay.
40
- * @type {string}
41
- */
42
- description: { type: String, required: true },
43
-
44
- /**
45
- * The text displayed on the button of the dirty state overlay when the 'dirty' dataState is set.
46
- * @type {string}
47
- */
48
- action: { type: String, required: true }
49
- };
50
-
51
- static styles = [bodyCompactStyles, overlayStyles, getFocusRingStyles('.d2l-backdrop-dirty-overlay')];
52
-
53
- render() {
54
- return html`
55
- <p class="d2l-body-compact d2l-backdrop-dirty-overlay">${this.description}</p>
56
- <d2l-button-subtle
57
- class="d2l-backdrop-dirty-overlay-action"
58
- @click=${this.#handleActionClick}
59
- h-align="text"
60
- text=${this.action}>
61
- </d2l-button-subtle>
62
- `;
63
- }
64
- #handleActionClick(e) {
65
- e.stopPropagation();
66
-
67
- /** Dispatched when the action button on the overlay is clicked */
68
- this.dispatchEvent(new CustomEvent('d2l-backdrop-dirty-overlay-action', { bubbles: true, composed: true }));
69
- }
70
-
71
- }
72
-
73
- customElements.define('d2l-backdrop-dirty-overlay', BackdropDirtyOverlay);