@brightspace-ui/core 3.156.0 → 3.156.1
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.
@@ -504,15 +504,21 @@ export const fontFacesCss = `@font-face {
|
|
504
504
|
export const baseTypographyStyles = css`
|
505
505
|
${unsafeCSS(fontFacesCss)}
|
506
506
|
html {
|
507
|
+
--d2l-cursor-resize-inline-end: e-resize;
|
508
|
+
--d2l-cursor-resize-inline-start: w-resize;
|
507
509
|
--d2l-document-direction: ltr;
|
508
510
|
--d2l-inline-end: right;
|
509
511
|
--d2l-inline-start: left;
|
512
|
+
--d2l-length-factor: 1;
|
510
513
|
--d2l-mirror-transform: none;
|
511
514
|
}
|
512
515
|
html[dir="rtl"] {
|
516
|
+
--d2l-cursor-resize-inline-end: w-resize;
|
517
|
+
--d2l-cursor-resize-inline-start: e-resize;
|
513
518
|
--d2l-document-direction: rtl;
|
514
519
|
--d2l-inline-end: left;
|
515
520
|
--d2l-inline-start: right;
|
521
|
+
--d2l-length-factor: -1;
|
516
522
|
--d2l-mirror-transform: scale(-1, 1);
|
517
523
|
}
|
518
524
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.156.
|
3
|
+
"version": "3.156.1",
|
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",
|
@@ -8,7 +8,6 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
8
8
|
import { formatPercent } from '@brightspace-ui/intl';
|
9
9
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
10
10
|
import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
|
11
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
12
11
|
import { styleMap } from 'lit/directives/style-map.js';
|
13
12
|
|
14
13
|
const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
|
@@ -28,6 +27,10 @@ const keyCodes = Object.freeze({
|
|
28
27
|
SPACE: 32
|
29
28
|
});
|
30
29
|
|
30
|
+
function isRtl() {
|
31
|
+
return document.documentElement.getAttribute('dir') === 'rtl';
|
32
|
+
}
|
33
|
+
|
31
34
|
function isMobile() {
|
32
35
|
return matchMedia('only screen and (max-width: 767px)').matches;
|
33
36
|
}
|
@@ -49,7 +52,6 @@ class Resizer {
|
|
49
52
|
this.contentBounds = null;
|
50
53
|
this.isCollapsed = false;
|
51
54
|
this.isMobile = false;
|
52
|
-
this.isRtl = false;
|
53
55
|
this.panelSize = 0;
|
54
56
|
this.secondaryFirst = false;
|
55
57
|
this._wasCollapsed = false;
|
@@ -126,7 +128,7 @@ class DesktopKeyboardResizer extends Resizer {
|
|
126
128
|
e.preventDefault();
|
127
129
|
|
128
130
|
// The direction of the container is flipped if exactly one of isRtl and secondaryFirst is true
|
129
|
-
const isFlipped =
|
131
|
+
const isFlipped = isRtl() ^ this.secondaryFirst;
|
130
132
|
const direction = e.keyCode === keyCodes.LEFT && !isFlipped
|
131
133
|
|| e.keyCode === keyCodes.RIGHT && isFlipped ? 1 : -1;
|
132
134
|
let secondaryWidth;
|
@@ -196,7 +198,7 @@ class DesktopMouseResizer extends Resizer {
|
|
196
198
|
_computeContentX(clientX) {
|
197
199
|
const x = clientX - this.contentRect.left;
|
198
200
|
// The direction of the container is flipped if exactly one of isRtl and secondaryFirst is true
|
199
|
-
return
|
201
|
+
return isRtl() ^ this.secondaryFirst ? x : this.contentRect.width - x;
|
200
202
|
}
|
201
203
|
|
202
204
|
_onMouseDown(e) {
|
@@ -546,7 +548,7 @@ class MobileTouchResizer extends Resizer {
|
|
546
548
|
* @fires d2l-template-primary-secondary-resize-start - Dispatched when a user begins moving the divider.
|
547
549
|
* @fires d2l-template-primary-secondary-resize-end - Dispatched when a user finishes moving the divider.
|
548
550
|
*/
|
549
|
-
class TemplatePrimarySecondary extends
|
551
|
+
class TemplatePrimarySecondary extends LocalizeCoreElement(LitElement) {
|
550
552
|
|
551
553
|
static get properties() {
|
552
554
|
return {
|
@@ -673,13 +675,8 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
673
675
|
:host([resizable]) [data-is-collapsed] aside {
|
674
676
|
visibility: hidden;
|
675
677
|
}
|
676
|
-
:host([resizable]:not([
|
677
|
-
|
678
|
-
float: left;
|
679
|
-
}
|
680
|
-
:host([resizable][dir="rtl"]:not([secondary-first])) aside,
|
681
|
-
:host([resizable]:not([dir="rtl"])[secondary-first]) aside {
|
682
|
-
float: right;
|
678
|
+
:host([resizable]:not([secondary-first])) aside {
|
679
|
+
float: inline-start;
|
683
680
|
}
|
684
681
|
.d2l-template-primary-secondary-divider,
|
685
682
|
.d2l-template-primary-secondary-divider-not-resizable {
|
@@ -701,26 +698,22 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
701
698
|
cursor: ew-resize;
|
702
699
|
width: 0.45rem;
|
703
700
|
}
|
704
|
-
:host([resizable]) [data-is-
|
705
|
-
|
706
|
-
cursor: w-resize;
|
701
|
+
:host([resizable]) [data-is-expanded] .d2l-template-primary-secondary-divider {
|
702
|
+
cursor: var(--d2l-cursor-resize-inline-end, e-resize);
|
707
703
|
}
|
708
|
-
:host([resizable]) [data-is-
|
709
|
-
|
710
|
-
cursor: e-resize;
|
704
|
+
:host([resizable]) [data-is-collapsed] .d2l-template-primary-secondary-divider {
|
705
|
+
cursor: var(--d2l-cursor-resize-inline-start, w-resize);
|
711
706
|
}
|
712
707
|
:host([resizable]) .d2l-template-primary-secondary-divider-handle {
|
713
708
|
align-items: center;
|
714
709
|
display: flex;
|
715
710
|
justify-content: center;
|
716
711
|
}
|
717
|
-
:host([resizable]) [data-background-shading="secondary"] .d2l-template-primary-secondary-divider
|
718
|
-
|
719
|
-
box-shadow: 1px 0 0 0 rgba(0, 0, 0, 0.15);
|
712
|
+
:host([resizable]) [data-background-shading="secondary"] .d2l-template-primary-secondary-divider {
|
713
|
+
box-shadow: calc(1px * var(--d2l-length-factor, 1)) 0 0 0 rgba(0, 0, 0, 0.15);
|
720
714
|
}
|
721
|
-
:host([resizable]) [data-background-shading="primary"] .d2l-template-primary-secondary-divider
|
722
|
-
|
723
|
-
box-shadow: -1px 0 0 0 rgba(0, 0, 0, 0.15);
|
715
|
+
:host([resizable]) [data-background-shading="primary"] .d2l-template-primary-secondary-divider {
|
716
|
+
box-shadow: calc(-1px * var(--d2l-length-factor, 1)) 0 0 0 rgba(0, 0, 0, 0.15);
|
724
717
|
}
|
725
718
|
.d2l-template-primary-secondary-divider-handle-desktop {
|
726
719
|
align-items: center;
|
@@ -735,10 +728,10 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
735
728
|
position: absolute;
|
736
729
|
}
|
737
730
|
.d2l-template-primary-secondary-divider-handle-left {
|
738
|
-
|
731
|
+
inset-inline-start: -1rem;
|
739
732
|
}
|
740
733
|
.d2l-template-primary-secondary-divider-handle-right {
|
741
|
-
|
734
|
+
inset-inline-end: -1rem;
|
742
735
|
}
|
743
736
|
.d2l-template-primary-secondary-divider-handle-line {
|
744
737
|
display: flex;
|
@@ -758,12 +751,8 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
758
751
|
.d2l-template-primary-secondary-divider:${unsafeCSS(getFocusPseudoClass())} .d2l-template-primary-secondary-divider-handle-left {
|
759
752
|
display: block;
|
760
753
|
}
|
761
|
-
:host(:not([
|
762
|
-
:host([
|
763
|
-
display: none;
|
764
|
-
}
|
765
|
-
:host(:not([dir="rtl"])[secondary-first]) [data-is-expanded] .d2l-template-primary-secondary-divider-handle-right,
|
766
|
-
:host([dir="rtl"]:not([secondary-first])) [data-is-expanded] .d2l-template-primary-secondary-divider-handle-right {
|
754
|
+
:host(:not([secondary-first])) [data-is-expanded] .d2l-template-primary-secondary-divider-handle-left,
|
755
|
+
:host([secondary-first]) [data-is-expanded] .d2l-template-primary-secondary-divider-handle-right {
|
767
756
|
display: none;
|
768
757
|
}
|
769
758
|
d2l-icon {
|
@@ -781,14 +770,11 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
781
770
|
}
|
782
771
|
|
783
772
|
:host([resizable]) .d2l-template-primary-secondary-divider:focus,
|
784
|
-
:host([resizable]) .d2l-template-primary-secondary-divider:hover
|
785
|
-
:host([resizable][dir="rtl"]) .d2l-template-primary-secondary-divider:focus,
|
786
|
-
:host([resizable][dir="rtl"]) .d2l-template-primary-secondary-divider:hover {
|
773
|
+
:host([resizable]) .d2l-template-primary-secondary-divider:hover {
|
787
774
|
background-color: var(--d2l-color-mica);
|
788
775
|
box-shadow: none;
|
789
776
|
}
|
790
|
-
:host([resizable]) .d2l-template-primary-secondary-divider:${unsafeCSS(getFocusPseudoClass())}
|
791
|
-
:host([resizable][dir="rtl"]) .d2l-template-primary-secondary-divider:${unsafeCSS(getFocusPseudoClass())} {
|
777
|
+
:host([resizable]) .d2l-template-primary-secondary-divider:${unsafeCSS(getFocusPseudoClass())} {
|
792
778
|
background-color: var(--d2l-color-celestine);
|
793
779
|
}
|
794
780
|
.d2l-template-primary-secondary-divider:focus .d2l-template-primary-secondary-divider-handle-line::before,
|
@@ -897,15 +883,10 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
897
883
|
border-radius: 0;
|
898
884
|
bottom: 0.1rem;
|
899
885
|
display: block;
|
900
|
-
|
886
|
+
inset-inline-end: calc(17px + 0.2rem);
|
901
887
|
overflow: hidden;
|
902
|
-
right: calc(17px + 0.2rem);
|
903
888
|
top: auto;
|
904
889
|
}
|
905
|
-
:host([dir="rtl"]) .d2l-template-primary-secondary-divider-handle {
|
906
|
-
left: calc(17px + 0.2rem);
|
907
|
-
right: auto;
|
908
|
-
}
|
909
890
|
.d2l-template-primary-secondary-divider-handle-mobile {
|
910
891
|
align-items: center;
|
911
892
|
background-color: var(--d2l-color-celestine);
|
@@ -928,13 +909,9 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
928
909
|
.d2l-template-primary-secondary-divider:${unsafeCSS(getFocusPseudoClass())} .d2l-template-primary-secondary-divider-handle {
|
929
910
|
box-shadow: none;
|
930
911
|
height: 1.2rem;
|
931
|
-
|
912
|
+
inset-inline-end: 17px;
|
932
913
|
width: 2.6rem;
|
933
914
|
}
|
934
|
-
:host([dir="rtl"]) .d2l-template-primary-secondary-divider:${unsafeCSS(getFocusPseudoClass())} .d2l-template-primary-secondary-divider-handle {
|
935
|
-
left: 17px;
|
936
|
-
right: auto;
|
937
|
-
}
|
938
915
|
d2l-icon {
|
939
916
|
color: white;
|
940
917
|
display: block;
|
@@ -1038,13 +1015,8 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
1038
1015
|
}
|
1039
1016
|
|
1040
1017
|
firstUpdated(changedProperties) {
|
1041
|
-
|
1042
1018
|
super.firstUpdated(changedProperties);
|
1043
1019
|
|
1044
|
-
const isRtl = this.getAttribute('dir') === 'rtl';
|
1045
|
-
for (const resizer of this._resizers) {
|
1046
|
-
resizer.isRtl = isRtl;
|
1047
|
-
}
|
1048
1020
|
const contentArea = this.shadowRoot.querySelector('.d2l-template-primary-secondary-content');
|
1049
1021
|
this._resizeObserver = new ResizeObserver(this._onContentResize);
|
1050
1022
|
this._resizeObserver.observe(contentArea);
|
@@ -1290,13 +1262,13 @@ class TemplatePrimarySecondary extends RtlMixin(LocalizeCoreElement(LitElement))
|
|
1290
1262
|
<div class="d2l-template-primary-secondary-divider-handle" @click=${this._onHandleTap} @mousedown=${this._onHandleTapStart}>
|
1291
1263
|
<div class="d2l-template-primary-secondary-divider-handle-desktop">
|
1292
1264
|
<d2l-icon-custom size="tier1" class="d2l-template-primary-secondary-divider-handle-left">
|
1293
|
-
<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
|
1265
|
+
<svg width="18" height="18" mirror-in-rtl xmlns="http://www.w3.org/2000/svg">
|
1294
1266
|
<path transform="rotate(90 9.004714965820312,9.000227928161623)" d="m13.708,6.29a1.006,1.006 0 0 0 -0.708,-0.29l-7.995,0a1,1 0 0 0 -0.705,1.71l4,4a1.013,1.013 0 0 0 1.42,0l4,-4a1.01,1.01 0 0 0 -0.013,-1.42l0.001,0z" fill="#494c4e"/>
|
1295
1267
|
</svg>
|
1296
1268
|
</d2l-icon-custom>
|
1297
1269
|
<div class="d2l-template-primary-secondary-divider-handle-line"></div>
|
1298
1270
|
<d2l-icon-custom size="tier1" class="d2l-template-primary-secondary-divider-handle-right">
|
1299
|
-
<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
|
1271
|
+
<svg width="18" height="18" mirror-in-rtl xmlns="http://www.w3.org/2000/svg">
|
1300
1272
|
<path transform="rotate(-90 9.004714965820314,9.000227928161621)" d="m13.708,6.29a1.006,1.006 0 0 0 -0.708,-0.29l-7.995,0a1,1 0 0 0 -0.705,1.71l4,4a1.013,1.013 0 0 0 1.42,0l4,-4a1.01,1.01 0 0 0 -0.013,-1.42l0.001,0z" fill="#494c4e"/>
|
1301
1273
|
</svg>
|
1302
1274
|
</d2l-icon-custom>
|