@brightspace-ui/core 3.193.0 → 3.194.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.
@@ -55,11 +55,12 @@ input.addEventListener('change', (e) => {
55
55
  * `inline-help`: Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
56
56
  <!-- docs: end hidden content -->
57
57
 
58
- ### Accessibility Properties
58
+ ## Accessibility
59
59
 
60
- To make your usage of `d2l-input-color` accessible, use the following properties when applicable:
60
+ At its core, the color input is a button, so it relies on standard button semantics and adheres to [W3C's Button Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button) to ensure a smooth experience for all assistive technologies, but there are a few interesting details to note:
61
61
 
62
- | Attribute | Description |
63
- |---|---|
64
- | `label` | **REQUIRED** when type is `custom`. [Acts as a primary label for the button](https://www.w3.org/WAI/tutorials/forms/labels/). Visible unless `label-hidden` is also used. |
65
- | `label-hidden` | Use if label should be visually hidden. |
62
+ * `label` is required if `type` is `custom`, since it acts as a primary label for the button
63
+ * However, if `type` is set to `background` or `foreground` a simple default will be used if `label` is left empty
64
+ * `label-hidden` can be used to hide the label when there is sufficient visual context for sighted users; the label will remain available to screen reader users who may lack the visual context
65
+ * `associated-value` allows you to set a hex color against which the input's color contrast will be measured, which ensures end users will get appropriate warnings if they choose inaccessible color combinations
66
+ * The color input remains focusable even when `disabled` or in `read-only` mode, so that users can access the tooltip giving the current value
@@ -91,7 +91,7 @@ class InputColor extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(F
91
91
  static get properties() {
92
92
  return {
93
93
  /**
94
- * Value of an associated color as a HEX which will be used for color contrast analysis
94
+ * ACCESSIBILITY: Value of an associated color as a HEX which will be used for color contrast analysis
95
95
  * @type {string}
96
96
  */
97
97
  associatedValue: { attribute: 'associated-value', type: String },
@@ -106,7 +106,7 @@ class InputColor extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(F
106
106
  */
107
107
  disallowNone: { attribute: 'disallow-none', type: Boolean },
108
108
  /**
109
- * REQUIRED: Label for the input, comes with a default value for background & foreground types.
109
+ * ACCESSIBILITY: REQUIRED: Label for the input, comes with a default value for background & foreground types.
110
110
  * @type {string}
111
111
  */
112
112
  label: {
@@ -171,10 +171,10 @@ const getHeadingFocusStyles = (selector) => {
171
171
  /**
172
172
  * A private helper method that should not be used by general consumers
173
173
  */
174
- export const _generateHeading1Styles = (selector) => {
174
+ export const _generateHeading1Styles = (selector, includeFocus = false) => {
175
175
  if (!_isValidCssSelector(selector)) return;
176
176
 
177
- const focusStyles = getHeadingFocusStyles(selector);
177
+ const focusStyles = includeFocus ? getHeadingFocusStyles(selector) : unsafeCSS('');
178
178
  selector = unsafeCSS(selector);
179
179
  return css`
180
180
  ${selector} {
@@ -194,7 +194,7 @@ export const _generateHeading1Styles = (selector) => {
194
194
  `;
195
195
  };
196
196
  export const heading1Styles = css`
197
- ${_generateHeading1Styles('.d2l-heading-1')}
197
+ ${_generateHeading1Styles('.d2l-heading-1', true)}
198
198
  :host([skeleton]) .d2l-heading-1.d2l-skeletize {
199
199
  height: 2.4rem;
200
200
  overflow: hidden;
@@ -217,10 +217,10 @@ export const heading1Styles = css`
217
217
  /**
218
218
  * A private helper method that should not be used by general consumers
219
219
  */
220
- export const _generateHeading2Styles = (selector) => {
220
+ export const _generateHeading2Styles = (selector, includeFocus = false) => {
221
221
  if (!_isValidCssSelector(selector)) return;
222
222
 
223
- const focusStyles = getHeadingFocusStyles(selector);
223
+ const focusStyles = includeFocus ? getHeadingFocusStyles(selector) : unsafeCSS('');
224
224
  selector = unsafeCSS(selector);
225
225
  return css`
226
226
  ${selector} {
@@ -241,7 +241,7 @@ export const _generateHeading2Styles = (selector) => {
241
241
  `;
242
242
  };
243
243
  export const heading2Styles = css`
244
- ${_generateHeading2Styles('.d2l-heading-2')}
244
+ ${_generateHeading2Styles('.d2l-heading-2', true)}
245
245
  :host([skeleton]) .d2l-heading-2.d2l-skeletize {
246
246
  height: 1.8rem;
247
247
  overflow: hidden;
@@ -264,10 +264,10 @@ export const heading2Styles = css`
264
264
  /**
265
265
  * A private helper method that should not be used by general consumers
266
266
  */
267
- export const _generateHeading3Styles = (selector) => {
267
+ export const _generateHeading3Styles = (selector, includeFocus = false) => {
268
268
  if (!_isValidCssSelector(selector)) return;
269
269
 
270
- const focusStyles = getHeadingFocusStyles(selector);
270
+ const focusStyles = includeFocus ? getHeadingFocusStyles(selector) : unsafeCSS('');
271
271
  selector = unsafeCSS(selector);
272
272
  return css`
273
273
  ${selector} {
@@ -287,7 +287,7 @@ export const _generateHeading3Styles = (selector) => {
287
287
  `;
288
288
  };
289
289
  export const heading3Styles = css`
290
- ${_generateHeading3Styles('.d2l-heading-3')}
290
+ ${_generateHeading3Styles('.d2l-heading-3', true)}
291
291
  :host([skeleton]) .d2l-heading-3.d2l-skeletize {
292
292
  height: 1.5rem;
293
293
  overflow: hidden;
@@ -310,10 +310,10 @@ export const heading3Styles = css`
310
310
  /**
311
311
  * A private helper method that should not be used by general consumers
312
312
  */
313
- export const _generateHeading4Styles = (selector) => {
313
+ export const _generateHeading4Styles = (selector, includeFocus = false) => {
314
314
  if (!_isValidCssSelector(selector)) return;
315
315
 
316
- const focusStyles = getHeadingFocusStyles(selector);
316
+ const focusStyles = includeFocus ? getHeadingFocusStyles(selector) : unsafeCSS('');
317
317
  selector = unsafeCSS(selector);
318
318
  return css`
319
319
  ${selector} {
@@ -326,7 +326,7 @@ export const _generateHeading4Styles = (selector) => {
326
326
  `;
327
327
  };
328
328
  export const heading4Styles = css`
329
- ${_generateHeading4Styles('.d2l-heading-4')}
329
+ ${_generateHeading4Styles('.d2l-heading-4', true)}
330
330
  :host([skeleton]) .d2l-heading-4.d2l-skeletize {
331
331
  height: 1.2rem;
332
332
  overflow: hidden;
@@ -20,10 +20,10 @@ if (!document.head.querySelector('#d2l-typography-font-face')) {
20
20
  ${_generateBodyCompactStyles('.d2l-typography .d2l-body-compact', false)}
21
21
  ${_generateBodySmallStyles('.d2l-typography .d2l-body-small', false)}
22
22
  ${_generateLabelStyles('.d2l-typography .d2l-label-text', false)}
23
- ${_generateHeading1Styles('.d2l-typography .d2l-heading-1')}
24
- ${_generateHeading2Styles('.d2l-typography .d2l-heading-2')}
25
- ${_generateHeading3Styles('.d2l-typography .d2l-heading-3')}
26
- ${_generateHeading4Styles('.d2l-typography .d2l-heading-4')}
23
+ ${_generateHeading1Styles('.d2l-typography .d2l-heading-1', true)}
24
+ ${_generateHeading2Styles('.d2l-typography .d2l-heading-2', true)}
25
+ ${_generateHeading3Styles('.d2l-typography .d2l-heading-3', true)}
26
+ ${_generateHeading4Styles('.d2l-typography .d2l-heading-4', true)}
27
27
  ${_generateBlockquoteStyles('.d2l-typography .d2l-blockquote')}
28
28
  `;
29
29
  document.head.appendChild(style);
@@ -5476,12 +5476,12 @@
5476
5476
  "attributes": [
5477
5477
  {
5478
5478
  "name": "label",
5479
- "description": "REQUIRED: Label for the input, comes with a default value for background & foreground types.",
5479
+ "description": "ACCESSIBILITY: REQUIRED: Label for the input, comes with a default value for background & foreground types.",
5480
5480
  "type": "string"
5481
5481
  },
5482
5482
  {
5483
5483
  "name": "associated-value",
5484
- "description": "Value of an associated color as a HEX which will be used for color contrast analysis",
5484
+ "description": "ACCESSIBILITY: Value of an associated color as a HEX which will be used for color contrast analysis",
5485
5485
  "type": "string"
5486
5486
  },
5487
5487
  {
@@ -5534,13 +5534,13 @@
5534
5534
  {
5535
5535
  "name": "label",
5536
5536
  "attribute": "label",
5537
- "description": "REQUIRED: Label for the input, comes with a default value for background & foreground types.",
5537
+ "description": "ACCESSIBILITY: REQUIRED: Label for the input, comes with a default value for background & foreground types.",
5538
5538
  "type": "string"
5539
5539
  },
5540
5540
  {
5541
5541
  "name": "associatedValue",
5542
5542
  "attribute": "associated-value",
5543
- "description": "Value of an associated color as a HEX which will be used for color contrast analysis",
5543
+ "description": "ACCESSIBILITY: Value of an associated color as a HEX which will be used for color contrast analysis",
5544
5544
  "type": "string"
5545
5545
  },
5546
5546
  {
@@ -1,5 +1,3 @@
1
- import { getFlag } from './flags.js';
2
-
3
1
  /* When updating MathJax, update mathjaxBaseUrl to use the new version
4
2
  * and verify that the font mappings included in mathjaxFontMappings
5
3
  * match what's present in the MathJax-src repo.
@@ -40,16 +38,10 @@ class HtmlBlockMathRenderer {
40
38
 
41
39
  async render(elem, options) {
42
40
  if (!options.contextValues) return elem;
43
- let context = options.contextValues.get(mathjaxContextKey);
44
-
45
- if (getFlag('shield-12649-mathjax-default-context', true)) {
46
- context = context || {
47
- renderLatex: false,
48
- outputScale: 1
49
- };
50
- } else {
51
- if (context === undefined) return elem;
52
- }
41
+ const context = options.contextValues.get(mathjaxContextKey) || {
42
+ renderLatex: false,
43
+ outputScale: 1
44
+ };
53
45
 
54
46
  if (!elem.querySelector('math') && !(context.renderLatex && /\$\$|\\\(|\\\[|\\begin{|\\ref{|\\eqref{/.test(elem.innerHTML))) return elem;
55
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.193.0",
3
+ "version": "3.194.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",