@brightspace-ui/core 3.267.1 → 3.268.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.
Files changed (113) hide show
  1. package/components/alert/alert-toast.js +98 -102
  2. package/components/alert/alert.js +109 -113
  3. package/components/backdrop/backdrop-dirty-overlay.js +13 -17
  4. package/components/backdrop/backdrop-loading.js +105 -109
  5. package/components/backdrop/backdrop.js +50 -54
  6. package/components/breadcrumbs/breadcrumb-current-page.js +19 -23
  7. package/components/breadcrumbs/breadcrumb.js +50 -54
  8. package/components/breadcrumbs/breadcrumbs.js +34 -38
  9. package/components/button/button-add.js +156 -164
  10. package/components/button/button-copy-mixin.js +9 -11
  11. package/components/button/button-copy.js +15 -19
  12. package/components/button/button-icon.js +110 -114
  13. package/components/button/button-move.js +153 -157
  14. package/components/button/button-split-item.js +16 -20
  15. package/components/button/button-split.js +70 -74
  16. package/components/button/button-subtle-copy.js +17 -19
  17. package/components/button/button-subtle.js +145 -149
  18. package/components/button/button-toggle.js +25 -29
  19. package/components/button/button.js +70 -74
  20. package/components/button/floating-buttons.js +63 -67
  21. package/components/calendar/calendar.js +244 -248
  22. package/components/card/card-content-meta.js +13 -15
  23. package/components/card/card-content-title.js +9 -11
  24. package/components/card/card-footer-link.js +76 -80
  25. package/components/card/card-loading-shimmer.js +35 -39
  26. package/components/card/card.js +188 -192
  27. package/components/collapsible-panel/collapsible-panel-group.js +17 -21
  28. package/components/collapsible-panel/collapsible-panel-summary-item.js +27 -31
  29. package/components/collapsible-panel/collapsible-panel.js +258 -262
  30. package/components/count-badge/count-badge-icon.js +12 -16
  31. package/components/count-badge/count-badge-mixin.js +124 -128
  32. package/components/count-badge/count-badge.js +2 -4
  33. package/components/description-list/description-list-wrapper.js +27 -31
  34. package/components/dialog/dialog-confirm.js +55 -59
  35. package/components/dialog/dialog-fullscreen.js +128 -132
  36. package/components/dialog/dialog-mixin.js +39 -41
  37. package/components/dialog/dialog.js +61 -65
  38. package/components/dropdown/dropdown-button-subtle.js +21 -25
  39. package/components/dropdown/dropdown-button.js +31 -35
  40. package/components/dropdown/dropdown-context-menu.js +28 -31
  41. package/components/dropdown/dropdown-menu.js +27 -31
  42. package/components/dropdown/dropdown-more.js +23 -26
  43. package/components/dropdown/dropdown-opener-mixin.js +44 -46
  44. package/components/dropdown/dropdown-popover-mixin.js +155 -159
  45. package/components/dropdown/dropdown-tabs.js +5 -7
  46. package/components/dropdown/dropdown.js +1 -3
  47. package/components/empty-state/empty-state-action-button.js +18 -22
  48. package/components/empty-state/empty-state-action-link.js +14 -18
  49. package/components/empty-state/empty-state-illustrated.js +21 -25
  50. package/components/empty-state/empty-state-simple.js +8 -12
  51. package/components/expand-collapse/expand-collapse-content.js +48 -52
  52. package/components/filter/filter-dimension-set-date-text-value.js +34 -36
  53. package/components/filter/filter-dimension-set-date-time-range-value.js +45 -47
  54. package/components/filter/filter-dimension-set-empty-state.js +17 -19
  55. package/components/filter/filter-dimension-set-value.js +27 -29
  56. package/components/filter/filter-dimension-set.js +65 -67
  57. package/components/filter/filter-overflow-group.js +15 -19
  58. package/components/filter/filter-tags.js +16 -19
  59. package/components/filter/filter.js +115 -119
  60. package/components/focus-trap/focus-trap.js +17 -21
  61. package/components/form/form-element-mixin.js +33 -35
  62. package/components/form/form-error-summary.js +37 -42
  63. package/components/form/form.js +33 -37
  64. package/components/hierarchical-view/hierarchical-view-mixin.js +76 -80
  65. package/components/hierarchical-view/hierarchical-view.js +5 -7
  66. package/components/html-block/html-block.js +45 -49
  67. package/components/icons/icon-custom.js +20 -24
  68. package/components/icons/icon.js +20 -24
  69. package/components/icons/slotted-icon-mixin.js +16 -18
  70. package/components/inputs/input-checkbox-group.js +34 -38
  71. package/components/inputs/input-checkbox.js +106 -110
  72. package/components/inputs/input-color.js +142 -148
  73. package/components/inputs/input-date-range.js +90 -94
  74. package/components/inputs/input-date-time-range-to.js +70 -74
  75. package/components/inputs/input-date-time-range.js +110 -115
  76. package/components/inputs/input-date-time.js +75 -79
  77. package/components/inputs/input-date.js +101 -105
  78. package/components/inputs/input-fieldset.js +37 -43
  79. package/components/inputs/input-group.js +10 -12
  80. package/components/inputs/input-inline-help.js +4 -6
  81. package/components/inputs/input-number.js +112 -118
  82. package/components/inputs/input-percent.js +52 -58
  83. package/components/inputs/input-radio-group.js +45 -49
  84. package/components/inputs/input-radio-spacer.js +11 -13
  85. package/components/inputs/input-radio.js +62 -66
  86. package/components/inputs/input-search.js +63 -68
  87. package/components/inputs/input-select-styles.js +30 -25
  88. package/components/inputs/input-text.js +245 -251
  89. package/components/inputs/input-textarea.js +128 -132
  90. package/components/inputs/input-time-range.js +100 -104
  91. package/components/inputs/input-time.js +107 -113
  92. package/components/link/link-mixin.js +37 -41
  93. package/components/link/link.js +113 -119
  94. package/components/list/list-controls.js +25 -29
  95. package/components/list/list-item-button-mixin.js +10 -12
  96. package/components/list/list-item-checkbox-mixin.js +35 -37
  97. package/components/list/list-item-content.js +33 -35
  98. package/components/list/list-item-drag-drop-mixin.js +45 -47
  99. package/components/list/list-item-drag-handle.js +80 -84
  100. package/components/list/list-item-drag-image.js +77 -81
  101. package/components/list/list-item-expand-collapse-mixin.js +17 -19
  102. package/components/list/list-item-generic-layout.js +222 -226
  103. package/components/list/list-item-link-mixin.js +10 -12
  104. package/components/list/list-item-mixin.js +68 -70
  105. package/components/list/list-item-nav-mixin.js +17 -19
  106. package/components/list/list-item-placement-marker.js +65 -67
  107. package/components/list/list-item-role-mixin.js +9 -11
  108. package/components/list/list-item.js +7 -9
  109. package/components/list/list.js +121 -125
  110. package/components/loading-spinner/loading-spinner.js +93 -97
  111. package/custom-elements.json +1920 -6694
  112. package/helpers/focus.js +5 -1
  113. package/package.json +3 -2
@@ -7,53 +7,48 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
7
7
 
8
8
  class FormErrorSummary extends LocalizeCoreElement(LitElement) {
9
9
 
10
- static get properties() {
11
- return {
12
- errors: { type: Object, attribute: false },
13
- _expanded: { type: Boolean, attribute: false },
14
- _hasTopMargin: { type: Boolean, attribute: '_has-top-margin', reflect: true },
15
- _hasErrors: { type: Boolean, attribute: '_has-errors', reflect: true },
16
- };
17
- }
18
-
19
- static get styles() {
20
- return [linkStyles, css`
10
+ static properties = {
11
+ errors: { type: Object, attribute: false },
12
+ _expanded: { type: Boolean, attribute: false },
13
+ _hasTopMargin: { type: Boolean, attribute: '_has-top-margin', reflect: true },
14
+ _hasErrors: { type: Boolean, attribute: '_has-errors', reflect: true },
15
+ };
21
16
 
22
- :host {
23
- display: block;
24
- }
25
- :host([hidden]) {
26
- display: none;
27
- }
28
- :host([_has-top-margin][_has-errors]) {
29
- margin-block-start: 1rem;
30
- }
17
+ static styles = [linkStyles, css`
18
+ :host {
19
+ display: block;
20
+ }
21
+ :host([hidden]) {
22
+ display: none;
23
+ }
24
+ :host([_has-top-margin][_has-errors]) {
25
+ margin-block-start: 1rem;
26
+ }
31
27
 
32
- .d2l-form-error-summary-header {
33
- cursor: pointer;
34
- display: flex;
35
- justify-content: space-between;
36
- padding-block: 0.3rem;
37
- padding-inline: 1.2rem 0.3rem;
38
- }
28
+ .d2l-form-error-summary-header {
29
+ cursor: pointer;
30
+ display: flex;
31
+ justify-content: space-between;
32
+ padding-block: 0.3rem;
33
+ padding-inline: 1.2rem 0.3rem;
34
+ }
39
35
 
40
- .d2l-form-error-summary-text {
41
- align-items: center;
42
- display: flex;
43
- }
36
+ .d2l-form-error-summary-text {
37
+ align-items: center;
38
+ display: flex;
39
+ }
44
40
 
45
- .d2l-form-error-summary-error-list {
46
- margin-block: 0;
47
- margin-inline: 1.2rem 0;
48
- padding-bottom: 0.6rem;
49
- padding-top: 0.3rem;
50
- }
41
+ .d2l-form-error-summary-error-list {
42
+ margin-block: 0;
43
+ margin-inline: 1.2rem 0;
44
+ padding-bottom: 0.6rem;
45
+ padding-top: 0.3rem;
46
+ }
51
47
 
52
- d2l-alert {
53
- max-width: none;
54
- }
55
- `];
56
- }
48
+ d2l-alert {
49
+ max-width: none;
50
+ }
51
+ `];
57
52
 
58
53
  constructor() {
59
54
  super();
@@ -17,43 +17,39 @@ import { localizeFormElement } from './form-element-localize-helper.js';
17
17
  */
18
18
  class Form extends LocalizeCoreElement(LitElement) {
19
19
 
20
- static get properties() {
21
- return {
22
- /**
23
- * Indicates that the form should opt-out of nesting.
24
- * This means that it will not be submitted or validated if an ancestor form is submitted or validated.
25
- * However, directly submitting or validating a form with `no-nesting` will still trigger submission and validation for its descendant forms unless they also opt-out using `no-nesting`.
26
- * @type {boolean}
27
- */
28
- noNesting: { type: Boolean, attribute: 'no-nesting', reflect: true },
29
- /**
30
- * Indicates that the form should interrupt and warn on navigation if the user has unsaved changes on native elements.
31
- * @type {boolean}
32
- */
33
- trackChanges: { type: Boolean, attribute: 'track-changes', reflect: true },
34
- /**
35
- * Id for an alternative error summary element
36
- * @type {string}
37
- */
38
- summaryId: { type: String, attribute: 'summary-id' },
39
- _errors: { type: Object },
40
- _hasErrors: { type: Boolean, attribute: '_has-errors', reflect: true },
41
- };
42
- }
43
-
44
- static get styles() {
45
- return css`
46
- :host {
47
- display: block;
48
- }
49
- :host([hidden]) {
50
- display: none;
51
- }
52
- :host([_has-errors]) ::slotted(d2l-input-group) {
53
- margin-block-start: 1rem;
54
- }
55
- `;
56
- }
20
+ static properties = {
21
+ /**
22
+ * Indicates that the form should opt-out of nesting.
23
+ * This means that it will not be submitted or validated if an ancestor form is submitted or validated.
24
+ * However, directly submitting or validating a form with `no-nesting` will still trigger submission and validation for its descendant forms unless they also opt-out using `no-nesting`.
25
+ * @type {boolean}
26
+ */
27
+ noNesting: { type: Boolean, attribute: 'no-nesting', reflect: true },
28
+ /**
29
+ * Indicates that the form should interrupt and warn on navigation if the user has unsaved changes on native elements.
30
+ * @type {boolean}
31
+ */
32
+ trackChanges: { type: Boolean, attribute: 'track-changes', reflect: true },
33
+ /**
34
+ * Id for an alternative error summary element
35
+ * @type {string}
36
+ */
37
+ summaryId: { type: String, attribute: 'summary-id' },
38
+ _errors: { type: Object },
39
+ _hasErrors: { type: Boolean, attribute: '_has-errors', reflect: true },
40
+ };
41
+
42
+ static styles = css`
43
+ :host {
44
+ display: block;
45
+ }
46
+ :host([hidden]) {
47
+ display: none;
48
+ }
49
+ :host([_has-errors]) ::slotted(d2l-input-group) {
50
+ margin-block-start: 1rem;
51
+ }
52
+ `;
57
53
 
58
54
  constructor() {
59
55
  super();
@@ -8,92 +8,88 @@ const escapeKeyCode = 27;
8
8
 
9
9
  export const HierarchicalViewMixin = superclass => class extends superclass {
10
10
 
11
- static get properties() {
12
- return {
13
- /**
14
- * @ignore
15
- */
16
- hierarchicalView: { type: Boolean },
17
- /**
18
- * @ignore
19
- */
20
- rootView: { type: Boolean, attribute: 'root-view' },
21
- /**
22
- * @ignore
23
- */
24
- shown: { type: Boolean, reflect: true },
25
- _childView: { type: Boolean, reflect: true, attribute: 'child-view' },
26
- };
27
- }
28
-
29
- static get styles() {
30
- return css`
11
+ static properties = {
12
+ /**
13
+ * @ignore
14
+ */
15
+ hierarchicalView: { type: Boolean },
16
+ /**
17
+ * @ignore
18
+ */
19
+ rootView: { type: Boolean, attribute: 'root-view' },
20
+ /**
21
+ * @ignore
22
+ */
23
+ shown: { type: Boolean, reflect: true },
24
+ _childView: { type: Boolean, reflect: true, attribute: 'child-view' },
25
+ };
26
+
27
+ static styles = css`
28
+ :host {
29
+ --d2l-hierarchical-view-height-transition: height 300ms linear;
30
+ box-sizing: border-box;
31
+ display: none;
32
+ left: 0;
33
+ overflow: hidden;
34
+ position: relative;
35
+ -webkit-transition: var(--d2l-hierarchical-view-height-transition);
36
+ transition: var(--d2l-hierarchical-view-height-transition);
37
+ width: 100%;
38
+ }
39
+ :host([child-view]) {
40
+ display: none;
41
+ left: 100%;
42
+ position: absolute;
43
+ top: 0;
44
+ }
45
+ :host([shown]) {
46
+ display: inline-block;
47
+ vertical-align: top; /* DE37329: required to prevent extra spacing caused by inline-block */
48
+ }
49
+ .d2l-hierarchical-view-content {
50
+ position: relative;
51
+ }
52
+ .d2l-hierarchical-view-content.d2l-child-view-show {
53
+ -webkit-animation: show-child-view-animation forwards 300ms linear;
54
+ animation: show-child-view-animation 300ms forwards linear;
55
+ }
56
+ .d2l-hierarchical-view-content.d2l-child-view-hide {
57
+ -webkit-animation: hide-child-view-animation forwards 300ms linear;
58
+ animation: hide-child-view-animation 300ms forwards linear;
59
+ }
60
+ @media (prefers-reduced-motion: reduce) {
31
61
  :host {
32
- --d2l-hierarchical-view-height-transition: height 300ms linear;
33
- box-sizing: border-box;
34
- display: none;
35
- left: 0;
36
- overflow: hidden;
37
- position: relative;
38
- -webkit-transition: var(--d2l-hierarchical-view-height-transition);
39
- transition: var(--d2l-hierarchical-view-height-transition);
40
- width: 100%;
41
- }
42
- :host([child-view]) {
43
- display: none;
44
- left: 100%;
45
- position: absolute;
46
- top: 0;
47
- }
48
- :host([shown]) {
49
- display: inline-block;
50
- vertical-align: top; /* DE37329: required to prevent extra spacing caused by inline-block */
51
- }
52
- .d2l-hierarchical-view-content {
53
- position: relative;
62
+ -webkit-transition: none;
63
+ transition: none;
54
64
  }
55
65
  .d2l-hierarchical-view-content.d2l-child-view-show {
56
- -webkit-animation: show-child-view-animation forwards 300ms linear;
57
- animation: show-child-view-animation 300ms forwards linear;
66
+ -webkit-animation: none;
67
+ animation: none;
68
+ left: -100%;
58
69
  }
59
70
  .d2l-hierarchical-view-content.d2l-child-view-hide {
60
- -webkit-animation: hide-child-view-animation forwards 300ms linear;
61
- animation: hide-child-view-animation 300ms forwards linear;
62
- }
63
- @media (prefers-reduced-motion: reduce) {
64
- :host {
65
- -webkit-transition: none;
66
- transition: none;
67
- }
68
- .d2l-hierarchical-view-content.d2l-child-view-show {
69
- -webkit-animation: none;
70
- animation: none;
71
- left: -100%;
72
- }
73
- .d2l-hierarchical-view-content.d2l-child-view-hide {
74
- -webkit-animation: none;
75
- animation: none;
76
- left: 0;
77
- }
78
- }
79
- @keyframes show-child-view-animation {
80
- 0% { left: 0; }
81
- 100% { left: -100%; }
82
- }
83
- @-webkit-keyframes show-child-view-animation {
84
- 0% { left: 0; }
85
- 100% { left: -100%; }
86
- }
87
- @keyframes hide-child-view-animation {
88
- 0% { left: -100%; }
89
- 100% { left: 0; }
90
- }
91
- @-webkit-keyframes hide-child-view-animation {
92
- 0% { left: -100%; }
93
- 100% { left: 0; }
71
+ -webkit-animation: none;
72
+ animation: none;
73
+ left: 0;
94
74
  }
95
- `;
96
- }
75
+ }
76
+ @keyframes show-child-view-animation {
77
+ 0% { left: 0; }
78
+ 100% { left: -100%; }
79
+ }
80
+ @-webkit-keyframes show-child-view-animation {
81
+ 0% { left: 0; }
82
+ 100% { left: -100%; }
83
+ }
84
+ @keyframes hide-child-view-animation {
85
+ 0% { left: -100%; }
86
+ 100% { left: 0; }
87
+ }
88
+ @-webkit-keyframes hide-child-view-animation {
89
+ 0% { left: -100%; }
90
+ 100% { left: 0; }
91
+ }
92
+ `;
97
93
 
98
94
  constructor() {
99
95
  super();
@@ -10,13 +10,11 @@ import { HierarchicalViewMixin } from '../hierarchical-view/hierarchical-view-mi
10
10
  */
11
11
  class HierarchicalView extends HierarchicalViewMixin(LitElement) {
12
12
 
13
- static get styles() {
14
- return [ super.styles, css`
15
- :host {
16
- display: inline-block;
17
- }
18
- `];
19
- }
13
+ static styles = [super.styles, css`
14
+ :host {
15
+ display: inline-block;
16
+ }
17
+ `];
20
18
 
21
19
  render() {
22
20
  return html`
@@ -188,8 +188,8 @@ const getRenderers = async() => {
188
188
  if (renderers) return renderers;
189
189
  const rendererLoader = requestInstance(document, 'html-block-renderer-loader');
190
190
  const tempRenderers = rendererLoader ? await rendererLoader.getRenderers() : undefined;
191
- const defaultRenderers = [ createMathRenderer(), createCodeRenderer() ];
192
- renderers = (tempRenderers ? [ ...defaultRenderers, ...tempRenderers ] : defaultRenderers);
191
+ const defaultRenderers = [createMathRenderer(), createCodeRenderer()];
192
+ renderers = (tempRenderers ? [...defaultRenderers, ...tempRenderers] : defaultRenderers);
193
193
  return renderers;
194
194
  };
195
195
 
@@ -198,53 +198,49 @@ const getRenderers = async() => {
198
198
  */
199
199
  class HtmlBlock extends LoadingCompleteMixin(LitElement) {
200
200
 
201
- static get properties() {
202
- return {
203
- /**
204
- * Whether compact styles should be applied
205
- * @type {Boolean}
206
- */
207
- compact: { type: Boolean },
208
- /**
209
- * The HTML to be rendered. Ignored if slotted content is provided.
210
- * @type {String}
211
- */
212
- html: { type: String },
213
- /**
214
- * Whether to display the HTML in inline mode
215
- * @type {Boolean}
216
- */
217
- inline: { type: Boolean },
218
- /**
219
- * Whether to disable deferred rendering of the user-authored HTML. Do *not* set this
220
- * unless your HTML relies on script executions that may break upon stamping.
221
- * @type {Boolean}
222
- */
223
- noDeferredRendering: { type: Boolean, attribute: 'no-deferred-rendering' },
224
- _context: { type: Object, state: true }
225
- };
226
- }
227
-
228
- static get styles() {
229
- return [ htmlBlockContentStyles, css`
230
- :host {
231
- display: block;
232
- }
233
- ${_generateHtmlBlockRootStyles(':host')}
234
- :host([inline]),
235
- :host([inline]) .d2l-html-block-rendered {
236
- display: inline;
237
- }
238
- :host([hidden]),
239
- :host([no-deferred-rendering]) .d2l-html-block-rendered,
240
- slot {
241
- display: none;
242
- }
243
- :host([no-deferred-rendering]) slot {
244
- display: contents;
245
- }
246
- `];
247
- }
201
+ static properties = {
202
+ /**
203
+ * Whether compact styles should be applied
204
+ * @type {Boolean}
205
+ */
206
+ compact: { type: Boolean },
207
+ /**
208
+ * The HTML to be rendered. Ignored if slotted content is provided.
209
+ * @type {String}
210
+ */
211
+ html: { type: String },
212
+ /**
213
+ * Whether to display the HTML in inline mode
214
+ * @type {Boolean}
215
+ */
216
+ inline: { type: Boolean },
217
+ /**
218
+ * Whether to disable deferred rendering of the user-authored HTML. Do *not* set this
219
+ * unless your HTML relies on script executions that may break upon stamping.
220
+ * @type {Boolean}
221
+ */
222
+ noDeferredRendering: { type: Boolean, attribute: 'no-deferred-rendering' },
223
+ _context: { type: Object, state: true }
224
+ };
225
+
226
+ static styles = [htmlBlockContentStyles, css`
227
+ :host {
228
+ display: block;
229
+ }
230
+ ${_generateHtmlBlockRootStyles(':host')}
231
+ :host([inline]),
232
+ :host([inline]) .d2l-html-block-rendered {
233
+ display: inline;
234
+ }
235
+ :host([hidden]),
236
+ :host([no-deferred-rendering]) .d2l-html-block-rendered,
237
+ slot {
238
+ display: none;
239
+ }
240
+ :host([no-deferred-rendering]) slot {
241
+ display: contents;
242
+ }
243
+ `];
248
244
 
249
245
  constructor() {
250
246
  super();
@@ -4,31 +4,27 @@ import { iconStyles } from './icon-styles.js';
4
4
 
5
5
  class IconCustom extends LitElement {
6
6
 
7
- static get properties() {
8
- return {
9
- size: {
10
- type: String,
11
- reflect: true
12
- }
13
- };
14
- }
7
+ static properties = {
8
+ size: {
9
+ type: String,
10
+ reflect: true
11
+ }
12
+ };
15
13
 
16
- static get styles() {
17
- return [ iconStyles, css`
18
- :host([size="tier1"]) {
19
- height: var(--d2l-icon-height, 18px);
20
- width: var(--d2l-icon-width, 18px);
21
- }
22
- :host([size="tier2"]) {
23
- height: var(--d2l-icon-height, 24px);
24
- width: var(--d2l-icon-width, 24px);
25
- }
26
- :host([size="tier3"]) {
27
- height: var(--d2l-icon-height, 30px);
28
- width: var(--d2l-icon-width, 30px);
29
- }
30
- `];
31
- }
14
+ static styles = [iconStyles, css`
15
+ :host([size="tier1"]) {
16
+ height: var(--d2l-icon-height, 18px);
17
+ width: var(--d2l-icon-width, 18px);
18
+ }
19
+ :host([size="tier2"]) {
20
+ height: var(--d2l-icon-height, 24px);
21
+ width: var(--d2l-icon-width, 24px);
22
+ }
23
+ :host([size="tier3"]) {
24
+ height: var(--d2l-icon-height, 30px);
25
+ width: var(--d2l-icon-width, 30px);
26
+ }
27
+ `];
32
28
 
33
29
  render() {
34
30
  return html`<slot @slotchange="${this._handleSlotChange}"></slot>`;
@@ -9,31 +9,27 @@ import { until } from 'lit/directives/until.js';
9
9
 
10
10
  class Icon extends LitElement {
11
11
 
12
- static get properties() {
13
- return {
14
- icon: {
15
- type: String,
16
- reflect: true
17
- }
18
- };
19
- }
12
+ static properties = {
13
+ icon: {
14
+ type: String,
15
+ reflect: true
16
+ }
17
+ };
20
18
 
21
- static get styles() {
22
- return [ iconStyles, css`
23
- :host([icon*="tier1:"]) {
24
- height: var(--d2l-icon-height, 18px);
25
- width: var(--d2l-icon-width, 18px);
26
- }
27
- :host([icon*="tier2:"]) {
28
- height: var(--d2l-icon-height, 24px);
29
- width: var(--d2l-icon-width, 24px);
30
- }
31
- :host([icon*="tier3:"]) {
32
- height: var(--d2l-icon-height, 30px);
33
- width: var(--d2l-icon-width, 30px);
34
- }
35
- `];
36
- }
19
+ static styles = [iconStyles, css`
20
+ :host([icon*="tier1:"]) {
21
+ height: var(--d2l-icon-height, 18px);
22
+ width: var(--d2l-icon-width, 18px);
23
+ }
24
+ :host([icon*="tier2:"]) {
25
+ height: var(--d2l-icon-height, 24px);
26
+ width: var(--d2l-icon-width, 24px);
27
+ }
28
+ :host([icon*="tier3:"]) {
29
+ height: var(--d2l-icon-height, 30px);
30
+ width: var(--d2l-icon-width, 30px);
31
+ }
32
+ `];
37
33
 
38
34
  render() {
39
35
  return guard([this.icon], () => until(this._getIcon(), noChange));
@@ -3,26 +3,24 @@ import { css, html, nothing } from 'lit';
3
3
 
4
4
  export const SlottedIconMixin = superclass => class extends superclass {
5
5
 
6
- static get properties() {
7
- return {
8
-
9
- /**
10
- * Preset icon key (e.g. "tier1:gear")
11
- * @type {string}
12
- */
13
- icon: {
14
- type: String,
15
- reflect: true,
16
- required: {
17
- validator: (_value, elem, hasValue) => hasValue || elem._hasCustomIcon || !elem._iconRequired
18
- }
19
- },
20
- _hasCustomIcon: { state: true }
21
- };
22
- }
6
+ static properties = {
7
+
8
+ /**
9
+ * Preset icon key (e.g. "tier1:gear")
10
+ * @type {string}
11
+ */
12
+ icon: {
13
+ type: String,
14
+ reflect: true,
15
+ required: {
16
+ validator: (_value, elem, hasValue) => hasValue || elem._hasCustomIcon || !elem._iconRequired
17
+ }
18
+ },
19
+ _hasCustomIcon: { state: true }
20
+ };
23
21
 
24
22
  static get styles() {
25
- const styles = [ css`
23
+ const styles = [css`
26
24
  slot[name="icon"]::slotted(*) {
27
25
  display: none;
28
26
  }