@brightspace-ui/core 3.28.2 → 3.28.4

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.
@@ -1,8 +1,8 @@
1
+ import { _generateResetStyles, heading3Styles } from '../typography/styles.js';
1
2
  import { css, html, LitElement, nothing } from 'lit';
2
3
  import { DialogMixin } from './dialog-mixin.js';
3
4
  import { dialogStyles } from './dialog-styles.js';
4
5
  import { getUniqueId } from '../../helpers/uniqueId.js';
5
- import { heading3Styles } from '../typography/styles.js';
6
6
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
7
7
 
8
8
  /**
@@ -28,7 +28,7 @@ class DialogConfirm extends LocalizeCoreElement(DialogMixin(LitElement)) {
28
28
  }
29
29
 
30
30
  static get styles() {
31
- return [ dialogStyles, heading3Styles, css`
31
+ return [ _generateResetStyles(':host'), dialogStyles, heading3Styles, css`
32
32
 
33
33
  .d2l-dialog-outer {
34
34
  max-width: 420px;
@@ -1,8 +1,8 @@
1
1
  import '../button/button-icon.js';
2
2
  import '../loading-spinner/loading-spinner.js';
3
+ import { _generateResetStyles, heading2Styles, heading3Styles } from '../typography/styles.js';
3
4
  import { AsyncContainerMixin, asyncStates } from '../../mixins/async-container/async-container-mixin.js';
4
5
  import { css, html, LitElement } from 'lit';
5
- import { heading2Styles, heading3Styles } from '../typography/styles.js';
6
6
  import { classMap } from 'lit/directives/class-map.js';
7
7
  import { DialogMixin } from './dialog-mixin.js';
8
8
  import { dialogStyles } from './dialog-styles.js';
@@ -44,7 +44,7 @@ class DialogFullscreen extends LocalizeCoreElement(AsyncContainerMixin(DialogMix
44
44
  }
45
45
 
46
46
  static get styles() {
47
- return [ dialogStyles, heading2Styles, heading3Styles, css`
47
+ return [ _generateResetStyles(':host'), dialogStyles, heading2Styles, heading3Styles, css`
48
48
 
49
49
  .d2l-dialog-footer.d2l-footer-no-content {
50
50
  display: none;
@@ -1,12 +1,12 @@
1
1
  import '../button/button-icon.js';
2
2
  import '../loading-spinner/loading-spinner.js';
3
+ import { _generateResetStyles, heading3Styles } from '../typography/styles.js';
3
4
  import { AsyncContainerMixin, asyncStates } from '../../mixins/async-container/async-container-mixin.js';
4
5
  import { css, html, LitElement, nothing } from 'lit';
5
6
  import { classMap } from 'lit/directives/class-map.js';
6
7
  import { DialogMixin } from './dialog-mixin.js';
7
8
  import { dialogStyles } from './dialog-styles.js';
8
9
  import { getUniqueId } from '../../helpers/uniqueId.js';
9
- import { heading3Styles } from '../typography/styles.js';
10
10
  import { ifDefined } from 'lit/directives/if-defined.js';
11
11
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
12
12
  import { styleMap } from 'lit/directives/style-map.js';
@@ -52,7 +52,7 @@ class Dialog extends LocalizeCoreElement(AsyncContainerMixin(DialogMixin(LitElem
52
52
  }
53
53
 
54
54
  static get styles() {
55
- return [ dialogStyles, heading3Styles, css`
55
+ return [ _generateResetStyles(':host'), dialogStyles, heading3Styles, css`
56
56
 
57
57
  .d2l-dialog-header,
58
58
  :host([critical]) .d2l-dialog-header {
@@ -271,9 +271,9 @@ Nested menus can be defined by placing a `d2l-menu` inside a `d2l-menu-item`. F
271
271
  </d2l-menu>
272
272
  ```
273
273
 
274
- ## ACCESSIBILITY
274
+ ## Accessibility
275
275
 
276
- - The `label` property for `d2l-menu` is only required for the root menu
277
- - For nested menus, the label is automatically applied based on its parent menu-item
278
276
  - The `d2l-menu` component and its items all follow W3C's [menu](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/) pattern best practices
279
277
  - This includes the expected keyboard behaviour, which allows for seamless navigation within the menu and any submenus within it
278
+ - The `label` property for `d2l-menu` is only required for the root menu
279
+ - For nested menus, the label is automatically applied based on its parent menu-item
@@ -2,6 +2,7 @@ import '../colors/colors.js';
2
2
  import { css, unsafeCSS } from 'lit';
3
3
 
4
4
  export const _isValidCssSelector = (selector) => {
5
+ if (selector === ':host') return true;
5
6
  const re = /([a-zA-Z0-9-_ >.#]+)(\[[a-zA-Z0-9-_]+\])?([a-zA-Z0-9-_ >.#]+)?/g;
6
7
  const match = selector.match(re);
7
8
 
@@ -48,6 +49,26 @@ export const bodyStandardStyles = css`
48
49
  }
49
50
  `;
50
51
 
52
+ /**
53
+ * A private helper method that should not be used by general consumers
54
+ */
55
+ export const _generateResetStyles = (selector) => {
56
+
57
+ if (!_isValidCssSelector(selector)) return;
58
+
59
+ selector = unsafeCSS(selector);
60
+ return css`
61
+ ${selector} {
62
+ color: var(--d2l-color-ferrite);
63
+ font-size: 0.95rem;
64
+ font-weight: 400;
65
+ line-height: 1.4rem;
66
+ text-align: start;
67
+ white-space: normal;
68
+ }
69
+ `;
70
+ };
71
+
51
72
  /**
52
73
  * A private helper method that should not be used by general consumers
53
74
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.28.2",
3
+ "version": "3.28.4",
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",