@brightspace-ui/core 3.229.0 → 3.231.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.
@@ -2,25 +2,43 @@ import '../colors/colors.js';
2
2
  import { css } from 'lit';
3
3
  import { dedupeMixin } from '@open-wc/dedupe-mixin';
4
4
  import { EventSubscriberController } from '../../controllers/subscriber/subscriberControllers.js';
5
+ import { svgToCSS } from '../../helpers/svg-to-css.js';
5
6
 
6
7
  // DE50056: starting in Safari 16, the pulsing animation causes FACE
7
8
  // (and possibly elsewhere) to render a blank page
8
9
  const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
9
10
  const animation = isSafari ? css`none` : css`loadingPulse 1.8s linear infinite`;
10
11
 
12
+ const p2Mask = svgToCSS(`<svg xmlns="http://www.w3.org/2000/svg">
13
+ <rect y="11%" width="100%" height="27%" rx="4"/>
14
+ <rect y="61%" width="90%" height="27%" rx="4"/>
15
+ </svg>`);
16
+
17
+ const p3Mask = svgToCSS(`<svg xmlns="http://www.w3.org/2000/svg">
18
+ <rect y="7%" width="100%" height="18%" rx="4"/>
19
+ <rect y="40%" width="100%" height="18%" rx="4"/>
20
+ <rect y="74%" width="90%" height="18%" rx="4"/>
21
+ </svg>`);
22
+
23
+ const p5Mask = svgToCSS(`<svg xmlns="http://www.w3.org/2000/svg">
24
+ <rect y="4%" width="100%" height="11%" rx="4"/>
25
+ <rect y="24%" width="100%" height="11%" rx="4"/>
26
+ <rect y="44%" width="100%" height="11%" rx="4"/>
27
+ <rect y="64%" width="100%" height="11%" rx="4"/>
28
+ <rect y="84%" width="90%" height="11%" rx="4"/>
29
+ </svg>`);
30
+
11
31
  export const skeletonStyles = css`
12
32
  @keyframes loadingPulse {
13
- 0% { background-color: var(--d2l-color-sylvite); }
14
- 50% { background-color: var(--d2l-color-regolith); }
15
- 75% { background-color: var(--d2l-color-sylvite); }
16
- 100% { background-color: var(--d2l-color-sylvite); }
33
+ 0%, 75%, 100% { background-color: var(--d2l-theme-background-color-interactive-faint-hover); }
34
+ 50% { background-color: var(--d2l-theme-background-color-interactive-faint-default); }
17
35
  }
18
36
  :host([skeleton]) {
19
37
  isolation: isolate;
20
38
  }
21
39
  :host([skeleton]) .d2l-skeletize::before {
22
40
  animation: ${animation};
23
- background-color: var(--d2l-color-sylvite);
41
+ background-color: var(--d2l-theme-background-color-interactive-faint-hover);
24
42
  border-radius: 0.2rem;
25
43
  bottom: 0;
26
44
  content: '';
@@ -31,6 +49,9 @@ export const skeletonStyles = css`
31
49
  z-index: 997;
32
50
  }
33
51
  @media (prefers-reduced-motion: reduce) {
52
+ :host([skeleton]) .d2l-skeletize-paragraph-2::after,
53
+ :host([skeleton]) .d2l-skeletize-paragraph-3::after,
54
+ :host([skeleton]) .d2l-skeletize-paragraph-5::after,
34
55
  :host([skeleton]) .d2l-skeletize::before {
35
56
  animation: none;
36
57
  }
@@ -38,7 +59,7 @@ export const skeletonStyles = css`
38
59
  :host([skeleton]) .d2l-skeletize,
39
60
  :host([skeleton]) .d2l-skeletize-container {
40
61
  background-color: transparent;
41
- border-color: var(--d2l-color-sylvite);
62
+ border-color: var(--d2l-theme-background-color-interactive-faint-hover);
42
63
  box-shadow: none;
43
64
  color: transparent;
44
65
  position: relative;
@@ -47,40 +68,38 @@ export const skeletonStyles = css`
47
68
  :host([skeleton]) .d2l-skeletize-paragraph-3,
48
69
  :host([skeleton]) .d2l-skeletize-paragraph-5 {
49
70
  color: transparent;
71
+ position: relative;
72
+ }
73
+ :host([skeleton]) .d2l-skeletize-paragraph-2::after,
74
+ :host([skeleton]) .d2l-skeletize-paragraph-3::after,
75
+ :host([skeleton]) .d2l-skeletize-paragraph-5::after {
76
+ background-color: var(--d2l-theme-background-color-interactive-faint-hover);
77
+ content: '';
78
+ inset: 0;
79
+ position: absolute;
50
80
  transform: var(--d2l-mirror-transform, ${document.dir === 'rtl' ? css`scale(-1, 1)` : css`none`}); /* stylelint-disable-line @stylistic/string-quotes, @stylistic/function-whitespace-after */
51
81
  transform-origin: center;
82
+ animation: ${animation};
52
83
  }
53
- :host([skeleton]) .d2l-skeletize-paragraph-2 {
54
- background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cstyle%3E%0A%20%20%20%20%40keyframes%20loadingPulse%7B0%25%2C75%25%7Bfill%3A%23f1f5fb%7D50%25%7Bfill%3A%23f9fbff%7D%7D.skeleton%7Banimation%3AloadingPulse%201.8s%20linear%20infinite%3Bfill%3A%23f1f5fb%7D%0A%20%20%3C%2Fstyle%3E%0A%20%20%3Crect%20y%3D%2211%25%22%20width%3D%22100%25%22%20height%3D%2227%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%20%20%3Crect%20y%3D%2261%25%22%20width%3D%2290%25%22%20height%3D%2227%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%3C%2Fsvg%3E');
55
- }
56
- @media (prefers-reduced-motion: reduce) {
57
- :host([skeleton]) .d2l-skeletize-paragraph-2 {
58
- background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Crect%20y%3D%2211%25%22%20width%3D%22100%25%22%20height%3D%2227%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%20%20%3Crect%20y%3D%2261%25%22%20width%3D%2290%25%22%20height%3D%2227%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%3C%2Fsvg%3E');
59
- }
84
+ :host([skeleton]) .d2l-skeletize-paragraph-2::after {
85
+ -webkit-mask-image: ${p2Mask};
86
+ mask-image: ${p2Mask};
60
87
  }
61
88
  :host([skeleton]) .d2l-skeletize-paragraph-2::before {
62
89
  content: '\\A';
63
90
  white-space: pre;
64
91
  }
65
- :host([skeleton]) .d2l-skeletize-paragraph-3 {
66
- background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cstyle%3E%0A%20%20%20%20%40keyframes%20loadingPulse%7B0%25%2C75%25%7Bfill%3A%23f1f5fb%7D50%25%7Bfill%3A%23f9fbff%7D%7D.skeleton%7Banimation%3AloadingPulse%201.8s%20linear%20infinite%3Bfill%3A%23f1f5fb%7D%0A%20%20%3C%2Fstyle%3E%0A%20%20%3Crect%20y%3D%227%25%22%20width%3D%22100%25%22%20height%3D%2218%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%20%20%3Crect%20y%3D%2240%25%22%20width%3D%22100%25%22%20height%3D%2218%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%20%20%3Crect%20y%3D%2274%25%22%20width%3D%2290%25%22%20height%3D%2218%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%3C%2Fsvg%3E');
67
- }
68
- @media (prefers-reduced-motion: reduce) {
69
- :host([skeleton]) .d2l-skeletize-paragraph-3 {
70
- background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Crect%20y%3D%227%25%22%20width%3D%22100%25%22%20height%3D%2218%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%20%20%3Crect%20y%3D%2240%25%22%20width%3D%22100%25%22%20height%3D%2218%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%20%20%3Crect%20y%3D%2274%25%22%20width%3D%2290%25%22%20height%3D%2218%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%3C%2Fsvg%3E');
71
- }
92
+ :host([skeleton]) .d2l-skeletize-paragraph-3::after {
93
+ -webkit-mask-image: ${p3Mask};
94
+ mask-image: ${p3Mask};
72
95
  }
73
96
  :host([skeleton]) .d2l-skeletize-paragraph-3::before {
74
97
  content: '\\A \\A';
75
98
  white-space: pre;
76
99
  }
77
- :host([skeleton]) .d2l-skeletize-paragraph-5 {
78
- background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cstyle%3E%0A%20%20%20%20%40keyframes%20loadingPulse%7B0%25%2C75%25%7Bfill%3A%23f1f5fb%7D50%25%7Bfill%3A%23f9fbff%7D%7D.skeleton%7Banimation%3AloadingPulse%201.8s%20linear%20infinite%3Bfill%3A%23f1f5fb%7D%0A%20%20%3C%2Fstyle%3E%0A%20%20%3Crect%20y%3D%224%25%22%20width%3D%22100%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%20%20%3Crect%20y%3D%2224%25%22%20width%3D%22100%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%20%20%3Crect%20y%3D%2244%25%22%20width%3D%22100%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%20%20%3Crect%20y%3D%2264%25%22%20width%3D%22100%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%20%20%3Crect%20y%3D%2284%25%22%20width%3D%2290%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20class%3D%22skeleton%22%2F%3E%0A%3C%2Fsvg%3E');
79
- }
80
- @media (prefers-reduced-motion: reduce) {
81
- :host([skeleton]) .d2l-skeletize-paragraph-5 {
82
- background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Crect%20y%3D%224%25%22%20width%3D%22100%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%20%20%3Crect%20y%3D%2224%25%22%20width%3D%22100%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%20%20%3Crect%20y%3D%2244%25%22%20width%3D%22100%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%20%20%3Crect%20y%3D%2264%25%22%20width%3D%22100%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%20%20%3Crect%20y%3D%2284%25%22%20width%3D%2290%25%22%20height%3D%2211%25%22%20rx%3D%224%22%20fill%3D%22%23f1f5fb%22%2F%3E%0A%3C%2Fsvg%3E');
83
- }
100
+ :host([skeleton]) .d2l-skeletize-paragraph-5::after {
101
+ -webkit-mask-image: ${p5Mask};
102
+ mask-image: ${p5Mask};
84
103
  }
85
104
  :host([skeleton]) .d2l-skeletize-paragraph-5::before {
86
105
  content: '\\A \\A \\A \\A';
@@ -46,7 +46,7 @@ class Tab extends SkeletonMixin(LitElement) {
46
46
  margin-inline-start: 0;
47
47
  }
48
48
  .d2l-tab-selected-indicator {
49
- border-top: 4px solid var(--d2l-color-celestine);
49
+ border-top: 4px solid var(--d2l-theme-brand-color-primary-default);
50
50
  border-top-left-radius: 4px;
51
51
  border-top-right-radius: 4px;
52
52
  bottom: 0;
@@ -67,12 +67,12 @@ class Tab extends SkeletonMixin(LitElement) {
67
67
  margin-inline-start: 0;
68
68
  width: calc(100% - 0.6rem);
69
69
  }
70
- ${getFocusRingStyles(pseudoClass => `:host(:${pseudoClass}) > .d2l-tab-text`, { extraStyles: css`border-radius: 0.3rem; color: var(--d2l-color-celestine);` })}
70
+ ${getFocusRingStyles(pseudoClass => `:host(:${pseudoClass}) > .d2l-tab-text`, { extraStyles: css`border-radius: 0.3rem; color: var(--d2l-theme-text-color-interactive-default);` })}
71
71
  :host([aria-selected="true"]:focus) {
72
72
  text-decoration: none;
73
73
  }
74
74
  :host(:hover) {
75
- color: var(--d2l-color-celestine);
75
+ color: var(--d2l-theme-text-color-interactive-default);
76
76
  cursor: pointer;
77
77
  }
78
78
  :host([aria-selected="true"]:hover) {
@@ -54,7 +54,7 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
54
54
  margin-inline-start: 0;
55
55
  }
56
56
  .d2l-tab-selected-indicator {
57
- border-top: 4px solid var(--d2l-color-celestine);
57
+ border-top: 4px solid var(--d2l-theme-brand-color-primary-default);
58
58
  border-top-left-radius: 4px;
59
59
  border-top-right-radius: 4px;
60
60
  bottom: 0;
@@ -72,11 +72,11 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
72
72
  text-decoration: none;
73
73
  }
74
74
  :host(:hover) {
75
- color: var(--d2l-color-celestine);
75
+ color: var(--d2l-theme-text-color-interactive-default);
76
76
  cursor: pointer;
77
77
  }
78
78
  :host([_clicked]) {
79
- color: var(--d2l-color-celestine);
79
+ color: var(--d2l-theme-text-color-interactive-default);
80
80
  }
81
81
  :host([selected]:hover) {
82
82
  color: inherit;
@@ -6,7 +6,7 @@ import { TabMixin } from './tab-mixin.js';
6
6
 
7
7
  const focusRingStyles = getFocusRingStyles(
8
8
  pseudoClass => `:host(:${pseudoClass}) .d2l-tab-text-inner-content`,
9
- { extraStyles: css`border-radius: 0.3rem; color: var(--d2l-color-celestine);` }
9
+ { extraStyles: css`border-radius: 0.3rem; color: var(--d2l-theme-text-color-interactive-default);` }
10
10
  );
11
11
 
12
12
  /**
@@ -37,7 +37,7 @@ class Tab extends TabMixin(LitElement) {
37
37
  }
38
38
  ${focusRingStyles}
39
39
  :host(:${unsafeCSS(getFocusPseudoClass())}) ::slotted(d2l-icon) {
40
- color: var(--d2l-color-celestine);
40
+ color: var(--d2l-theme-text-color-interactive-default);
41
41
  }
42
42
  slot {
43
43
  align-items: center;
@@ -50,7 +50,7 @@ class Tab extends TabMixin(LitElement) {
50
50
  padding-inline-start: 0.3rem;
51
51
  }
52
52
  :host(:not([selected]):hover) ::slotted(d2l-icon) {
53
- color: var(--d2l-color-celestine);
53
+ color: var(--d2l-theme-text-color-interactive-default);
54
54
  }
55
55
  span {
56
56
  ${overflowEllipsisDeclarations}
@@ -58,13 +58,13 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(SkeletonMixin(LitElement))
58
58
  static get styles() {
59
59
  return [super.styles, bodyCompactStyles, css`
60
60
  :host {
61
- --d2l-tabs-background-color: white;
61
+ --d2l-tabs-background-color: var(--d2l-theme-background-color-base);
62
62
  box-sizing: border-box;
63
63
  display: block;
64
64
  margin-bottom: 1.2rem;
65
65
  }
66
66
  .d2l-tabs-layout {
67
- border-bottom: 1px solid var(--d2l-color-gypsum);
67
+ border-bottom: 1px solid var(--d2l-theme-border-color-subtle);
68
68
  display: none;
69
69
  max-height: 0;
70
70
  opacity: 0;
@@ -155,7 +155,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(SkeletonMixin(LitElement))
155
155
  }
156
156
  .d2l-tabs-scroll-button:hover,
157
157
  .d2l-tabs-scroll-button:${unsafeCSS(getFocusPseudoClass())} {
158
- background-color: var(--d2l-color-gypsum);
158
+ background-color: var(--d2l-theme-background-color-interactive-tertiary-hover);
159
159
  }
160
160
  ${getFocusRingStyles('.d2l-tabs-scroll-button')}
161
161
  :host([skeleton]) .d2l-tabs-scroll-button {
@@ -212,11 +212,11 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(SkeletonMixin(LitElement))
212
212
  padding-inline: 4px;
213
213
  }
214
214
  .d2l-tabs-scroll-next-container {
215
- border-inline-start: 1px solid var(--d2l-color-gypsum);
215
+ border-inline-start: 1px solid var(--d2l-theme-border-color-subtle);
216
216
  padding-inline-start: 11px;
217
217
  }
218
218
  .d2l-tabs-scroll-previous-container {
219
- border-inline-end: 1px solid var(--d2l-color-gypsum);
219
+ border-inline-end: 1px solid var(--d2l-theme-border-color-subtle);
220
220
  padding-inline-end: 11px;
221
221
  }
222
222
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.229.0",
3
+ "version": "3.231.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",