@brightspace-ui/core 3.96.0 → 3.97.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.
@@ -28,6 +28,12 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
28
28
  position: relative;
29
29
  vertical-align: middle;
30
30
  }
31
+ .d2l-tab-content {
32
+ margin: 0.5rem;
33
+ }
34
+ :host(:first-child) .d2l-tab-content {
35
+ margin-inline-start: 0;
36
+ }
31
37
  .d2l-tab-selected-indicator {
32
38
  border-top: 4px solid var(--d2l-color-celestine);
33
39
  border-top-left-radius: 4px;
@@ -57,6 +63,10 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
57
63
  :host([selected]) .d2l-tab-selected-indicator {
58
64
  display: block;
59
65
  }
66
+ :host([skeleton]) .d2l-tab-selected-indicator {
67
+ position: absolute !important; /* make sure skeleton styles do not override this */
68
+ }
69
+
60
70
  `];
61
71
 
62
72
  super.styles && styles.unshift(super.styles);
@@ -94,7 +104,7 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
94
104
 
95
105
  render() {
96
106
  return html`
97
- ${this.renderContent()}
107
+ <div class="d2l-skeletize d2l-tab-content">${this.renderContent()}</div>
98
108
  <div class="d2l-tab-selected-indicator d2l-skeletize-container"></div>
99
109
  `;
100
110
  }
@@ -21,20 +21,22 @@ class Tab extends TabMixin(LitElement) {
21
21
  static get styles() {
22
22
  const styles = [ css`
23
23
  .d2l-tab-text {
24
- margin: 0.5rem;
25
24
  overflow: hidden;
26
25
  padding: 0.1rem;
27
26
  text-overflow: ellipsis;
28
27
  white-space: nowrap;
29
28
  }
30
- :host(:first-child) .d2l-tab-text {
31
- margin-inline-start: 0;
32
- }
33
- :host(:${unsafeCSS(getFocusPseudoClass())}) > .d2l-tab-text {
29
+ :host(:${unsafeCSS(getFocusPseudoClass())}) .d2l-tab-text {
34
30
  border-radius: 0.3rem;
35
31
  box-shadow: 0 0 0 2px var(--d2l-color-celestine);
36
32
  color: var(--d2l-color-celestine);
37
33
  }
34
+ .d2l-tab-text-skeletize-override {
35
+ min-width: 50px;
36
+ }
37
+ :host([skeleton]) .d2l-tab-content.d2l-skeletize::before {
38
+ inset-block: 0.15rem;
39
+ }
38
40
  `];
39
41
 
40
42
  super.styles && styles.unshift(super.styles);
@@ -50,14 +52,14 @@ class Tab extends TabMixin(LitElement) {
50
52
  }
51
53
 
52
54
  renderContent() {
55
+ const overrideSkeletonText = this.skeleton && (!this.text || this.text.length === 0);
53
56
  const contentClasses = {
54
57
  'd2l-tab-text': true,
58
+ 'd2l-tab-text-skeletize-override': overrideSkeletonText
55
59
  };
56
60
 
57
61
  return html`
58
- <div class="${classMap(contentClasses)}">
59
- ${this.text}
60
- </div>
62
+ <div class="${classMap(contentClasses)}">${overrideSkeletonText ? html`&nbsp;` : this.text}</div>
61
63
  `;
62
64
  }
63
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.96.0",
3
+ "version": "3.97.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",