@brightspace-ui/core 3.151.0 → 3.151.2
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/breadcrumbs/breadcrumb.js +3 -16
- package/components/breadcrumbs/breadcrumbs.js +5 -13
- package/components/button/button-add.js +9 -17
- package/components/typography/styles.js +4 -2
- package/mixins/loading-complete/README.md +1 -1
- package/mixins/loading-complete/loading-complete-mixin.js +12 -1
- package/package.json +1 -1
@@ -4,12 +4,11 @@ import { findComposedAncestor } from '../../helpers/dom.js';
|
|
4
4
|
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
6
6
|
import { linkStyles } from '../link/link.js';
|
7
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
8
7
|
|
9
8
|
/**
|
10
9
|
* An entry within a <d2l-breadcrumbs> parent.
|
11
10
|
*/
|
12
|
-
class Breadcrumb extends
|
11
|
+
class Breadcrumb extends FocusMixin(LitElement) {
|
13
12
|
|
14
13
|
static get properties() {
|
15
14
|
return {
|
@@ -59,25 +58,13 @@ class Breadcrumb extends RtlMixin(FocusMixin(LitElement)) {
|
|
59
58
|
.d2l-link:focus {
|
60
59
|
outline-offset: -2px;
|
61
60
|
}
|
62
|
-
|
63
61
|
d2l-icon {
|
64
62
|
height: 8px;
|
65
|
-
padding-
|
66
|
-
padding-right: 3px;
|
63
|
+
padding-inline: 8px 3px;
|
67
64
|
width: 8px;
|
68
65
|
}
|
69
|
-
:host([dir="rtl"]) d2l-icon {
|
70
|
-
padding-left: 3px;
|
71
|
-
padding-right: 8px;
|
72
|
-
}
|
73
|
-
|
74
66
|
d2l-icon[icon="tier1:chevron-left"] {
|
75
|
-
padding-
|
76
|
-
padding-right: 8px;
|
77
|
-
}
|
78
|
-
:host([dir="rtl"]) d2l-icon[icon="tier1:chevron-left"] {
|
79
|
-
padding-left: 8px;
|
80
|
-
padding-right: 0;
|
67
|
+
padding-inline: 0 8px;
|
81
68
|
}
|
82
69
|
`];
|
83
70
|
}
|
@@ -3,7 +3,6 @@ import { css, html, LitElement } from 'lit';
|
|
3
3
|
import { getFlag } from '../../helpers/flags.js';
|
4
4
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
5
5
|
import { overflowEllipsisDeclarations } from '../../helpers/overflow.js';
|
6
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
7
6
|
|
8
7
|
const overflowClipEnabled = getFlag('GAUD-7887-core-components-overflow-clipping', true);
|
9
8
|
|
@@ -11,7 +10,8 @@ const overflowClipEnabled = getFlag('GAUD-7887-core-components-overflow-clipping
|
|
11
10
|
* Help users understand where they are within the application, and provide useful clues about how the space is organized. They also provide a convenient navigation mechanism.
|
12
11
|
* @slot - Breadcrumb items
|
13
12
|
*/
|
14
|
-
class Breadcrumbs extends LocalizeCoreElement(
|
13
|
+
class Breadcrumbs extends LocalizeCoreElement(LitElement) {
|
14
|
+
|
15
15
|
static get properties() {
|
16
16
|
return {
|
17
17
|
/**
|
@@ -38,23 +38,15 @@ class Breadcrumbs extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
38
38
|
:host([hidden]) {
|
39
39
|
display: none;
|
40
40
|
}
|
41
|
-
|
42
41
|
:host::after {
|
43
|
-
background: linear-gradient(to right, rgba(255, 255, 255, 0), rgb(251, 252, 252));
|
44
|
-
bottom: 0;
|
42
|
+
background: linear-gradient(to var(--d2l-inline-end, right), rgba(255, 255, 255, 0), rgb(251, 252, 252));
|
45
43
|
content: "";
|
44
|
+
inset-block: 0;
|
45
|
+
inset-inline-end: 0;
|
46
46
|
pointer-events: none;
|
47
47
|
position: absolute;
|
48
|
-
right: 0;
|
49
|
-
top: 0;
|
50
48
|
width: 10px;
|
51
49
|
}
|
52
|
-
:host([dir="rtl"])::after {
|
53
|
-
background: linear-gradient(to left, rgba(255, 255, 255, 0), rgb(251, 252, 252));
|
54
|
-
left: 0;
|
55
|
-
right: auto;
|
56
|
-
}
|
57
|
-
|
58
50
|
:host([compact]) ::slotted(d2l-breadcrumb:not(:last-of-type)),
|
59
51
|
:host([compact]) ::slotted(d2l-breadcrumb-current-page) {
|
60
52
|
display: none;
|
@@ -9,7 +9,6 @@ import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
9
9
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
10
10
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
11
11
|
import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
|
12
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
13
12
|
|
14
13
|
const MODE = {
|
15
14
|
icon: 'icon',
|
@@ -21,7 +20,7 @@ const whiteAddButtonBackgroundFlag = getFlag('GAUD-7495-add-button-white-backgro
|
|
21
20
|
/**
|
22
21
|
* A component for quickly adding items to a specific locaiton.
|
23
22
|
*/
|
24
|
-
class ButtonAdd extends
|
23
|
+
class ButtonAdd extends PropertyRequiredMixin(FocusMixin(LocalizeCoreElement(LitElement))) {
|
25
24
|
static get properties() {
|
26
25
|
return {
|
27
26
|
/**
|
@@ -119,39 +118,32 @@ class ButtonAdd extends RtlMixin(PropertyRequiredMixin(FocusMixin(LocalizeCoreEl
|
|
119
118
|
@media (prefers-reduced-motion: no-preference) {
|
120
119
|
button:hover .line,
|
121
120
|
button:focus .line {
|
122
|
-
transition: all var(--d2l-button-add-animation-duration) ease-in var(--d2l-button-add-animation-delay);
|
123
|
-
}
|
124
|
-
button:hover .line,
|
125
|
-
button:focus .line,
|
126
|
-
:host([dir="rtl"]) button:hover .line-end,
|
127
|
-
:host([dir="rtl"]) button:focus .line-end {
|
128
121
|
animation: line-start-animation var(--d2l-button-add-animation-duration) ease-in var(--d2l-button-add-animation-delay) 1 forwards;
|
122
|
+
transition: all var(--d2l-button-add-animation-duration) ease-in var(--d2l-button-add-animation-delay);
|
129
123
|
}
|
130
124
|
button:hover .line-end,
|
131
|
-
button:focus .line-end
|
132
|
-
:host([dir="rtl"]) button:hover .line-start,
|
133
|
-
:host([dir="rtl"]) button:focus .line-start {
|
125
|
+
button:focus .line-end {
|
134
126
|
animation-name: line-end-animation;
|
135
127
|
}
|
136
128
|
|
137
129
|
@keyframes line-start-animation {
|
138
130
|
0% {
|
139
|
-
background: linear-gradient(to right, var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) left center / 113%;
|
131
|
+
background: linear-gradient(to var(--d2l-inline-end, right), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-start, left) center / 113%;
|
140
132
|
opacity: 10%;
|
141
133
|
}
|
142
134
|
100% {
|
143
|
-
background: linear-gradient(to right, var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) left center / 113%; /* safari */
|
144
|
-
background-position: right;
|
135
|
+
background: linear-gradient(to var(--d2l-inline-end, right), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-start, left) center / 113%; /* safari */
|
136
|
+
background-position: var(--d2l-inline-end, right);
|
145
137
|
}
|
146
138
|
}
|
147
139
|
@keyframes line-end-animation {
|
148
140
|
0% {
|
149
|
-
background: linear-gradient(to left, var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) right center / 113%;
|
141
|
+
background: linear-gradient(to var(--d2l-inline-start, left), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-end, right) center / 113%;
|
150
142
|
opacity: 10%;
|
151
143
|
}
|
152
144
|
100% {
|
153
|
-
background: linear-gradient(to left, var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) right center / 113%; /* safari */
|
154
|
-
background-position: left;
|
145
|
+
background: linear-gradient(to var(--d2l-inline-start, left), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-end, right) center / 113%; /* safari */
|
146
|
+
background-position: var(--d2l-inline-start, left);
|
155
147
|
}
|
156
148
|
}
|
157
149
|
}
|
@@ -505,13 +505,15 @@ export const baseTypographyStyles = css`
|
|
505
505
|
${unsafeCSS(fontFacesCss)}
|
506
506
|
html {
|
507
507
|
--d2l-document-direction: ltr;
|
508
|
-
--d2l-mirror-transform: none;
|
509
508
|
--d2l-inline-end: right;
|
509
|
+
--d2l-inline-start: left;
|
510
|
+
--d2l-mirror-transform: none;
|
510
511
|
}
|
511
512
|
html[dir="rtl"] {
|
512
513
|
--d2l-document-direction: rtl;
|
513
|
-
--d2l-mirror-transform: scale(-1, 1);
|
514
514
|
--d2l-inline-end: left;
|
515
|
+
--d2l-inline-start: right;
|
516
|
+
--d2l-mirror-transform: scale(-1, 1);
|
515
517
|
}
|
516
518
|
|
517
519
|
.d2l-typography {
|
@@ -26,7 +26,7 @@ async removeSkeleton() {
|
|
26
26
|
}
|
27
27
|
```
|
28
28
|
|
29
|
-
If for any reason `resolveLoadingComplete` is never called, `loadingComplete` won't resolve and any consumers will hang.
|
29
|
+
If for any reason `resolveLoadingComplete` is never called, `loadingComplete` won't resolve and any consumers will hang. A warning will be thrown indicating that the component has entered a bad state.
|
30
30
|
|
31
31
|
### `getLoadingComplete`
|
32
32
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
2
2
|
|
3
|
+
const timeoutMs = 30000;
|
4
|
+
|
3
5
|
export const LoadingCompleteMixin = dedupeMixin((superclass) => class extends superclass {
|
4
6
|
get loadingComplete() {
|
5
7
|
return this.getLoadingComplete();
|
@@ -22,7 +24,16 @@ export const LoadingCompleteMixin = dedupeMixin((superclass) => class extends su
|
|
22
24
|
#loadingCompleteResolve;
|
23
25
|
|
24
26
|
#loadingCompletePromise = !Object.prototype.hasOwnProperty.call(this.constructor.prototype, 'getLoadingComplete')
|
25
|
-
? new Promise(resolve =>
|
27
|
+
? new Promise(resolve => {
|
28
|
+
const timeout = setTimeout(() => {
|
29
|
+
console.warn(`Failed to load ${this.localName} in ${timeoutMs}ms: resolveLoadingComplete was not called`);
|
30
|
+
}, timeoutMs);
|
31
|
+
|
32
|
+
this.#loadingCompleteResolve = () => {
|
33
|
+
clearTimeout(timeout);
|
34
|
+
resolve();
|
35
|
+
};
|
36
|
+
})
|
26
37
|
: Promise.resolve();
|
27
38
|
|
28
39
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.151.
|
3
|
+
"version": "3.151.2",
|
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",
|