@brightspace-ui/core 2.88.0 → 2.90.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.
- package/components/button/button-icon.js +4 -2
- package/components/button/button-mixin.js +1 -2
- package/components/button/button-styles.js +4 -5
- package/components/dialog/dialog-fullscreen.js +0 -4
- package/components/dialog/dialog-mixin.js +9 -4
- package/components/dialog/dialog-styles.js +9 -4
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
2
|
import '../icons/icon.js';
|
|
3
3
|
import '../tooltip/tooltip.js';
|
|
4
|
-
import { css, html, LitElement } from 'lit';
|
|
4
|
+
import { css, html, LitElement, unsafeCSS } from 'lit';
|
|
5
5
|
import { VisibleOnAncestorMixin, visibleOnAncestorStyles } from '../../mixins/visible-on-ancestor-mixin.js';
|
|
6
6
|
import { ButtonMixin } from './button-mixin.js';
|
|
7
7
|
import { buttonStyles } from './button-styles.js';
|
|
8
|
+
import { getFocusPseudoClass } from '../../helpers/focus.js';
|
|
8
9
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
9
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
11
|
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
@@ -116,7 +117,8 @@ class ButtonIcon extends ThemeMixin(ButtonMixin(VisibleOnAncestorMixin(RtlMixin(
|
|
|
116
117
|
--d2l-icon-fill-color: var(--d2l-button-icon-fill-color-hover, var(--d2l-color-tungsten));
|
|
117
118
|
background-color: var(--d2l-button-icon-background-color-hover);
|
|
118
119
|
}
|
|
119
|
-
button.focus-visible
|
|
120
|
+
button.focus-visible,
|
|
121
|
+
button:${unsafeCSS(getFocusPseudoClass())} {
|
|
120
122
|
box-shadow: var(--d2l-button-icon-focus-box-shadow);
|
|
121
123
|
}
|
|
122
124
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
2
|
-
import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
|
|
3
2
|
|
|
4
|
-
export const ButtonMixin = superclass => class extends FocusMixin(
|
|
3
|
+
export const ButtonMixin = superclass => class extends FocusMixin(superclass) {
|
|
5
4
|
|
|
6
5
|
static get properties() {
|
|
7
6
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
|
-
import { css } from 'lit';
|
|
2
|
+
import { css, unsafeCSS } from 'lit';
|
|
3
|
+
import { getFocusPseudoClass } from '../../helpers/focus.js';
|
|
3
4
|
|
|
4
5
|
export const buttonStyles = css`
|
|
5
6
|
button {
|
|
@@ -21,10 +22,8 @@ export const buttonStyles = css`
|
|
|
21
22
|
white-space: nowrap;
|
|
22
23
|
width: auto;
|
|
23
24
|
}
|
|
24
|
-
/*
|
|
25
|
-
|
|
26
|
-
:host(:not([data-js-focus-visible])) button:focus,
|
|
27
|
-
button.focus-visible {
|
|
25
|
+
button.focus-visible, /* still required for when forceFocusVisible is used programatically */
|
|
26
|
+
button:${unsafeCSS(getFocusPseudoClass())} {
|
|
28
27
|
box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--d2l-color-celestine);
|
|
29
28
|
}
|
|
30
29
|
`;
|
|
@@ -127,10 +127,6 @@ class DialogFullscreen extends LocalizeCoreElement(AsyncContainerMixin(DialogMix
|
|
|
127
127
|
animation: d2l-dialog-fullscreen-open 400ms ease-out;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
dialog::backdrop {
|
|
131
|
-
transition: opacity 200ms ease-out;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
130
|
:host([_state="showing"]) dialog::backdrop {
|
|
135
131
|
transition-duration: 400ms;
|
|
136
132
|
}
|
|
@@ -27,7 +27,7 @@ if (window.D2L.DialogMixin.preferNative === undefined) {
|
|
|
27
27
|
|
|
28
28
|
const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
29
29
|
const abortAction = 'abort';
|
|
30
|
-
const defaultMargin = { top:
|
|
30
|
+
const defaultMargin = { top: 75, right: 30, bottom: 30, left: 30 };
|
|
31
31
|
|
|
32
32
|
export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
33
33
|
|
|
@@ -42,7 +42,8 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
|
42
42
|
* The optional title for the dialog
|
|
43
43
|
*/
|
|
44
44
|
titleText: { type: String, attribute: 'title-text' },
|
|
45
|
-
_autoSize: { type: Boolean, attribute:
|
|
45
|
+
_autoSize: { type: Boolean, attribute: 'auto-size', reflect: true },
|
|
46
|
+
_fullHeight: { type: Boolean, attribute: 'full-height', reflect: true },
|
|
46
47
|
_fullscreenWithin: { type: Number },
|
|
47
48
|
_height: { type: Number },
|
|
48
49
|
_inIframe: { type: Boolean, attribute: 'in-iframe', reflect: true },
|
|
@@ -65,6 +66,7 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
|
65
66
|
this.opened = false;
|
|
66
67
|
this._autoSize = true;
|
|
67
68
|
this._dialogId = getUniqueId();
|
|
69
|
+
this._fullHeight = false;
|
|
68
70
|
this._fullscreenWithin = 0;
|
|
69
71
|
this._handleMvcDialogOpen = this._handleMvcDialogOpen.bind(this);
|
|
70
72
|
this._inIframe = false;
|
|
@@ -259,7 +261,10 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
|
259
261
|
const footer = this.shadowRoot.querySelector('.d2l-dialog-footer');
|
|
260
262
|
if (footer) preferredHeight += Math.ceil(footer.getBoundingClientRect().height);
|
|
261
263
|
|
|
262
|
-
const
|
|
264
|
+
const exceedsHeight = preferredHeight > availableHeight;
|
|
265
|
+
this._fullHeight = !this._ifrauContextInfo && exceedsHeight;
|
|
266
|
+
|
|
267
|
+
const height = exceedsHeight ? availableHeight : preferredHeight;
|
|
263
268
|
return height;
|
|
264
269
|
}
|
|
265
270
|
|
|
@@ -437,7 +442,7 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
|
437
442
|
if (this._ifrauContextInfo) styles.top = `${this._top}px`;
|
|
438
443
|
if (this._ifrauContextInfo) styles.bottom = 'auto';
|
|
439
444
|
if (this._left) styles.left = `${this._left}px`;
|
|
440
|
-
if (this._height) styles.height = `${this._height}px`;
|
|
445
|
+
if (this._height && !this._fullHeight) styles.height = `${this._height}px`;
|
|
441
446
|
if (this._width) styles.width = `${this._width}px`;
|
|
442
447
|
else styles.width = 'auto';
|
|
443
448
|
} else if (iframeTopOverride && this._ifrauContextInfo) {
|
|
@@ -21,19 +21,24 @@ export const dialogStyles = css`
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.d2l-dialog-outer {
|
|
24
|
-
animation: d2l-dialog-close 200ms ease-
|
|
24
|
+
animation: d2l-dialog-close 200ms ease-out;
|
|
25
25
|
background-color: white;
|
|
26
26
|
border: 1px solid var(--d2l-color-mica);
|
|
27
27
|
border-radius: 8px;
|
|
28
28
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
29
29
|
box-sizing: border-box;
|
|
30
30
|
position: fixed; /* also required for native to override position: absolute */
|
|
31
|
-
top:
|
|
31
|
+
top: 75px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([auto-size][full-height]) > .d2l-dialog-outer {
|
|
35
|
+
bottom: 1.5rem;
|
|
36
|
+
top: 1.5rem;
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
:host([_state="showing"]) > .d2l-dialog-outer {
|
|
35
40
|
/* must target direct child to avoid ancestor from interfering with closing child dialogs in Legacy-Edge */
|
|
36
|
-
animation: d2l-dialog-open 200ms ease-
|
|
41
|
+
animation: d2l-dialog-open 200ms ease-out;
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
@keyframes d2l-dialog-close {
|
|
@@ -70,7 +75,7 @@ export const dialogStyles = css`
|
|
|
70
75
|
/* cannot use variables inside of ::backdrop : https://github.com/whatwg/fullscreen/issues/124 */
|
|
71
76
|
background-color: #f9fbff;
|
|
72
77
|
opacity: 0;
|
|
73
|
-
transition: opacity 200ms ease-
|
|
78
|
+
transition: opacity 200ms ease-out;
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
:host([_state="showing"]) dialog::backdrop {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.90.0",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|