@brightspace-ui/core 3.155.0 → 3.155.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.
@@ -11,7 +11,6 @@ import { getUniqueId } from '../../helpers/uniqueId.js';
11
11
  import { ifDefined } from 'lit/directives/if-defined.js';
12
12
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
13
13
  import { offscreenStyles } from '../offscreen/offscreen.js';
14
- import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
15
14
 
16
15
  const daysInWeek = 7;
17
16
  const keyCodes = {
@@ -148,7 +147,7 @@ export function getPrevMonth(month) {
148
147
  * A component can be used to display a responsively sized calendar that allows for date selection.
149
148
  * @slot - Content displayed under the calendar (e.g., buttons)
150
149
  */
151
- class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
150
+ class Calendar extends LocalizeCoreElement(LitElement) {
152
151
 
153
152
  static get properties() {
154
153
  return {
@@ -712,6 +711,8 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
712
711
 
713
712
  let preventDefault = false;
714
713
 
714
+ const isRtl = (document.documentElement.getAttribute('dir') === 'rtl');
715
+
715
716
  switch (e.keyCode) {
716
717
  case keyCodes.ENTER:
717
718
  case keyCodes.SPACE:
@@ -728,17 +729,17 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
728
729
  break;
729
730
  case keyCodes.LEFT:
730
731
  preventDefault = true; // needed for voiceover in safari to properly read aria-label on dates
731
- await this._onKeyDownUpdateFocusDate(this.dir === 'rtl' ? 1 : -1);
732
+ await this._onKeyDownUpdateFocusDate(isRtl ? 1 : -1);
732
733
  break;
733
734
  case keyCodes.RIGHT:
734
735
  preventDefault = true; // needed for voiceover in safari to properly read aria-label on dates
735
- await this._onKeyDownUpdateFocusDate(this.dir === 'rtl' ? -1 : 1);
736
+ await this._onKeyDownUpdateFocusDate(isRtl ? -1 : 1);
736
737
  break;
737
738
  case keyCodes.HOME: {
738
739
  preventDefault = true;
739
740
  let numDaysChange;
740
741
  const dayOfTheWeek = this._focusDate.getDay();
741
- if (this.dir === 'rtl') {
742
+ if (isRtl) {
742
743
  numDaysChange = 6 - dayOfTheWeek + calendarData.firstDayOfWeek;
743
744
  if (numDaysChange > 6) {
744
745
  numDaysChange -= daysInWeek;
@@ -762,7 +763,7 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
762
763
  preventDefault = true;
763
764
  let numDaysChange;
764
765
  const dayOfTheWeek = this._focusDate.getDay();
765
- if (this.dir === 'rtl') {
766
+ if (isRtl) {
766
767
  numDaysChange = dayOfTheWeek - calendarData.firstDayOfWeek;
767
768
  if (numDaysChange < 0) {
768
769
  numDaysChange += daysInWeek;
@@ -898,7 +899,7 @@ class Calendar extends LocalizeCoreElement(RtlMixin(LitElement)) {
898
899
 
899
900
  _triggerMonthChangeAnimations(increase, keyboardTriggered, transitionUpDown) {
900
901
  this._monthNav = undefined;
901
- increase = this.dir === 'rtl' ? !increase : increase;
902
+ increase = document.documentElement.getAttribute('dir') === 'rtl' ? !increase : increase;
902
903
  if (!keyboardTriggered) this._isInitialFocusDate = true;
903
904
  if (!reduceMotion) {
904
905
  setTimeout(() => {
@@ -9,7 +9,6 @@ import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
9
9
  import { getComposedActiveElement } from '../../helpers/focus.js';
10
10
  import { ifDefined } from 'lit/directives/if-defined.js';
11
11
  import { isComposedAncestor } from '../../helpers/dom.js';
12
- import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
13
12
  import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
14
13
 
15
14
  const normalizeHeadingStyle = (number) => {
@@ -53,7 +52,7 @@ function addTabListener() {
53
52
  * @fires d2l-collapsible-panel-expand - Dispatched when the panel is expanded
54
53
  * @fires d2l-collapsible-panel-collapse - Dispatched when the panel is collapsed
55
54
  */
56
- class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
55
+ class CollapsiblePanel extends SkeletonMixin(FocusMixin(LitElement)) {
57
56
 
58
57
  static get properties() {
59
58
  return {
@@ -261,11 +260,9 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
261
260
  margin: 0.6rem;
262
261
  margin-inline-end: var(--d2l-collapsible-panel-spacing-inline);
263
262
  position: relative;
264
- width: 0.9rem;
265
- }
266
- :host([dir="rtl"]) d2l-icon-custom {
267
- transform: scale(-1, 1);
263
+ transform: var(--d2l-mirror-transform, ${document.dir === 'rtl' ? css`scale(-1, 1)` : css`none`}); /* stylelint-disable-line @stylistic/string-quotes, @stylistic/function-whitespace-after */
268
264
  transform-origin: center;
265
+ width: 0.9rem;
269
266
  }
270
267
  d2l-icon-custom svg {
271
268
  position: absolute;
@@ -3,13 +3,12 @@ import '../icons/icon.js';
3
3
  import { css, html, LitElement } from 'lit';
4
4
  import { DropdownOpenerMixin } from './dropdown-opener-mixin.js';
5
5
  import { dropdownOpenerStyles } from './dropdown-opener-styles.js';
6
- import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
7
6
 
8
7
  /**
9
8
  * A "d2l-button" opener for dropdown content.
10
9
  * @slot - Dropdown content (e.g., "d2l-dropdown-content", "d2l-dropdown-menu" or "d2l-dropdown-tabs")
11
10
  */
12
- class DropdownButton extends DropdownOpenerMixin(RtlMixin(LitElement)) {
11
+ class DropdownButton extends DropdownOpenerMixin(LitElement) {
13
12
 
14
13
  static get properties() {
15
14
  return {
@@ -36,17 +35,13 @@ class DropdownButton extends DropdownOpenerMixin(RtlMixin(LitElement)) {
36
35
  return [dropdownOpenerStyles, css`
37
36
  d2l-icon {
38
37
  height: 0.8rem;
39
- margin-left: 0.6rem;
38
+ margin-inline-start: 0.6rem;
40
39
  pointer-events: none;
41
40
  width: 0.8rem;
42
41
  }
43
42
  :host([primary]) d2l-icon {
44
43
  color: white;
45
44
  }
46
- :host([dir="rtl"]) d2l-icon {
47
- margin-left: 0;
48
- margin-right: 0.6rem;
49
- }
50
45
  d2l-button {
51
46
  width: 100%;
52
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.155.0",
3
+ "version": "3.155.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",