@brightspace-ui/core 2.89.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.
@@ -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: 100, right: 30, bottom: 30, left: 30 };
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: false },
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 height = (preferredHeight < availableHeight ? preferredHeight : availableHeight);
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-in;
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: 100px;
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-in;
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-in;
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.89.0",
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",