@brightspace-ui/core 3.319.0 → 3.320.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.
@@ -1,13 +1,14 @@
1
1
  import { html, LitElement, nothing } from 'lit';
2
2
  import { bodyCompactStyles } from '../typography/styles.js';
3
3
  import { FocusMixin } from '../../mixins/focus-mixin.js';
4
+ import { LinkMixin } from '../link/link-mixin.js';
4
5
  import { linkStyles } from '../link/link.js';
5
6
  import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
6
7
 
7
8
  /**
8
9
  * `d2l-empty-state-action-link` is an empty state action component that can be placed inside of the default slot of `empty-state-simple` or `empty-state-illustrated` to add a link action to the component.
9
10
  */
10
- class EmptyStateActionLink extends FocusMixin(PropertyRequiredMixin(LitElement)) {
11
+ class EmptyStateActionLink extends LinkMixin(FocusMixin(PropertyRequiredMixin(LitElement))) {
11
12
 
12
13
  static properties = {
13
14
  /**
@@ -22,19 +23,17 @@ class EmptyStateActionLink extends FocusMixin(PropertyRequiredMixin(LitElement))
22
23
  href: { type: String, required: true },
23
24
  };
24
25
 
25
- static styles = [bodyCompactStyles, linkStyles];
26
+ static styles = [super.styles, bodyCompactStyles, linkStyles];
26
27
 
27
28
  static get focusElementSelector() {
28
29
  return '.d2l-link';
29
30
  }
30
31
 
31
32
  render() {
32
- const actionLink = this.text && this.href
33
- ? html`
34
- <a class="d2l-body-compact d2l-link" href=${this.href}>${this.text}</a>`
35
- : nothing;
36
-
37
- return html`${actionLink}`;
33
+ if (!this.text || !this.href) return nothing;
34
+ const linkClasses = { 'd2l-body-compact': true, 'd2l-link': true };
35
+ const inner = html`${this.text}${this._renderNewWindowIcon()}`;
36
+ return this._render(inner, { linkClasses });
38
37
  }
39
38
 
40
39
  }
@@ -47,7 +47,7 @@ function _getRadioStyleSelectors(inputSelectors) {
47
47
  * A private helper method that should not be used by general consumers
48
48
  */
49
49
  export function _generateRadioStyles(selector, containerSelector) {
50
- if (!_isValidCssSelector(selector) || (containerSelector && !_isValidCssSelector(containerSelector))) return '';
50
+ if (!_isValidCssSelector(selector) || (containerSelector && !_isValidCssSelector(containerSelector))) return;
51
51
  const inputSelectors = [selector];
52
52
  if (containerSelector) {
53
53
  inputSelectors.push(`${containerSelector} > input[type="radio"]`);
@@ -38,7 +38,7 @@ function _getSelectFocusStyles(selector) {
38
38
  * A private helper method that should not be used by general consumers
39
39
  */
40
40
  export function _generateSelectStyles(selector) {
41
- if (!_isValidCssSelector(selector)) return '';
41
+ if (!_isValidCssSelector(selector)) return;
42
42
  const finalSelector = unsafeCSS(selector);
43
43
  const selectFocusStyles = _getSelectFocusStyles(finalSelector);
44
44
 
@@ -125,7 +125,7 @@ function _generatewebkitSearchStyles(selector) {
125
125
  * A private helper method that should not be used by general consumers
126
126
  */
127
127
  export function _generateInputStyles(selector, focusSelector) {
128
- if (!_isValidCssSelector(selector) || (focusSelector && !_isValidCssSelector(focusSelector))) return '';
128
+ if (!_isValidCssSelector(selector) || (focusSelector && !_isValidCssSelector(focusSelector))) return;
129
129
  const lastSpaceIndex = selector.lastIndexOf(' ');
130
130
  const textareaSelector = unsafeCSS(`${selector.substring(0, lastSpaceIndex + 1)}textarea${selector.substring(lastSpaceIndex + 1)}`);
131
131
  const delegates = getStyleDelegates(selector, focusSelector, textareaSelector);
@@ -191,7 +191,7 @@ export function _generateInputStyles(selector, focusSelector) {
191
191
  * A private helper method that should not be used by general consumers
192
192
  */
193
193
  export function _generateInputTextStyles(selector) {
194
- if (!_isValidCssSelector(selector)) return '';
194
+ if (!_isValidCssSelector(selector)) return;
195
195
  const finalSelector = unsafeCSS(selector);
196
196
  const input = _getInputBaseStyleDelegates(selector);
197
197
 
@@ -13,8 +13,8 @@ export const KEYBOARD_STEP = 20; // TO DO: Confirm
13
13
  export const KEYBOARD_STEP_LARGE = 80; // TO DO: Confirm
14
14
 
15
15
  const DRAG_THRESHOLD = 3; // Number of pixels to move to count as a drag
16
- const AUTO_EXPAND_WIDTH_FACTOR = 0.1;
17
- const AUTO_COLLAPSE_WIDTH_FACTOR = 0.75;
16
+ export const AUTO_EXPAND_WIDTH_FACTOR = 0.1;
17
+ export const AUTO_COLLAPSE_WIDTH_FACTOR = 0.75;
18
18
 
19
19
  const clampedSize = (size, min, max) => Math.max(min, Math.min(size, max));
20
20
  const isRtl = () => document.documentElement.getAttribute('dir') === 'rtl';
@@ -4563,10 +4563,20 @@
4563
4563
  "description": "REQUIRED: The action text to be used in the subtle button",
4564
4564
  "type": "string"
4565
4565
  },
4566
+ {
4567
+ "name": "download",
4568
+ "description": "Prompts the user to save the linked URL instead of navigating to it.\nMust be to a resource on the same origin.\nCan be used with or without a value, when set the value becomes the filename.",
4569
+ "type": "string"
4570
+ },
4566
4571
  {
4567
4572
  "name": "href",
4568
4573
  "description": "REQUIRED: The action URL or URL fragment of the link",
4569
4574
  "type": "string"
4575
+ },
4576
+ {
4577
+ "name": "target",
4578
+ "description": "Where to display the linked URL",
4579
+ "type": "string"
4570
4580
  }
4571
4581
  ],
4572
4582
  "properties": [
@@ -4576,16 +4586,28 @@
4576
4586
  "description": "REQUIRED: The action text to be used in the subtle button",
4577
4587
  "type": "string"
4578
4588
  },
4589
+ {
4590
+ "name": "download",
4591
+ "attribute": "download",
4592
+ "description": "Prompts the user to save the linked URL instead of navigating to it.\nMust be to a resource on the same origin.\nCan be used with or without a value, when set the value becomes the filename.",
4593
+ "type": "string"
4594
+ },
4579
4595
  {
4580
4596
  "name": "href",
4581
4597
  "attribute": "href",
4582
4598
  "description": "REQUIRED: The action URL or URL fragment of the link",
4583
4599
  "type": "string"
4584
4600
  },
4601
+ {
4602
+ "name": "target",
4603
+ "attribute": "target",
4604
+ "description": "Where to display the linked URL",
4605
+ "type": "string"
4606
+ },
4585
4607
  {
4586
4608
  "name": "styles",
4587
4609
  "type": "array",
4588
- "default": "[\"bodyCompactStyles\",\"linkStyles\"]"
4610
+ "default": "[\"styles\",\"bodyCompactStyles\",\"linkStyles\"]"
4589
4611
  }
4590
4612
  ]
4591
4613
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.319.0",
3
+ "version": "3.320.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",