@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
@@ -19,138 +19,134 @@ const MODE = {
19
19
  * A component for quickly adding items to a specific locaiton.
20
20
  */
21
21
  class ButtonAdd extends PropertyRequiredMixin(FocusMixin(LocalizeCoreElement(LitElement))) {
22
- static get properties() {
23
- return {
24
- /**
25
- * Display mode of the component. Defaults to `icon` (plus icon is always visible). Other options are `icon-and-text` (plus icon and text are always visible), and `icon-when-interacted` (plus icon is only visible when hover or focus).
26
- * @type {'icon'|'icon-and-text'|'icon-when-interacted'}
27
- */
28
- mode: { type: String, reflect: true },
29
- /**
30
- * ACCESSIBILITY: The text associated with the button. When mode is `icon-and-text` this text is displayed next to the icon, otherwise this text is in a tooltip.
31
- * @type {string}
32
- */
33
- text: { type: String, required: true }
34
- };
35
- }
36
-
37
- static get styles() {
38
- return css`
39
- :host {
40
- --d2l-button-add-animation-delay: 0ms;
41
- --d2l-button-add-animation-duration: 200ms;
42
- --d2l-button-add-hover-focus-color: var(--d2l-color-celestine-minus-1);
43
- --d2l-button-add-line-color: var(--d2l-color-mica);
44
- --d2l-button-add-line-height: 1px;
45
- --d2l-button-add-hover-focus-line-height: 2px;
46
- }
47
- :host([mode="icon-when-interacted"]) {
48
- --d2l-button-add-animation-delay: 50ms;
49
- }
50
- button {
51
- align-items: center;
52
- background-color: transparent;
53
- border: 0;
54
- box-shadow: none;
55
- cursor: pointer;
56
- display: flex;
57
- font-family: inherit;
58
- height: 11px;
59
- justify-content: center;
60
- margin: 6.5px 0; /* (d2l-button-add-icon-text height - line height) / 2 */
61
- outline: none;
62
- padding: 0;
63
- position: relative;
64
- user-select: none;
65
- white-space: nowrap;
66
- width: 100%;
67
- z-index: 1; /* needed for button-add to have expected hover behaviour in list (hover from below, tooltip position) */
68
- }
69
- :host([mode="icon-and-text"]) button {
70
- margin: calc((1.5rem - 11px) / 2) 0; /* (d2l-button-add-icon-text height - line height) / 2 */
71
- }
72
-
73
- .line {
74
- background: var(--d2l-button-add-line-color);
75
- height: var(--d2l-button-add-line-height);
76
- margin: 5px 0;
77
- width: 100%;
78
- }
79
-
22
+ static properties = {
23
+ /**
24
+ * Display mode of the component. Defaults to `icon` (plus icon is always visible). Other options are `icon-and-text` (plus icon and text are always visible), and `icon-when-interacted` (plus icon is only visible when hover or focus).
25
+ * @type {'icon'|'icon-and-text'|'icon-when-interacted'}
26
+ */
27
+ mode: { type: String, reflect: true },
28
+ /**
29
+ * ACCESSIBILITY: The text associated with the button. When mode is `icon-and-text` this text is displayed next to the icon, otherwise this text is in a tooltip.
30
+ * @type {string}
31
+ */
32
+ text: { type: String, required: true }
33
+ };
34
+
35
+ static styles = css`
36
+ :host {
37
+ --d2l-button-add-animation-delay: 0ms;
38
+ --d2l-button-add-animation-duration: 200ms;
39
+ --d2l-button-add-hover-focus-color: var(--d2l-color-celestine-minus-1);
40
+ --d2l-button-add-line-color: var(--d2l-color-mica);
41
+ --d2l-button-add-line-height: 1px;
42
+ --d2l-button-add-hover-focus-line-height: 2px;
43
+ }
44
+ :host([mode="icon-when-interacted"]) {
45
+ --d2l-button-add-animation-delay: 50ms;
46
+ }
47
+ button {
48
+ align-items: center;
49
+ background-color: transparent;
50
+ border: 0;
51
+ box-shadow: none;
52
+ cursor: pointer;
53
+ display: flex;
54
+ font-family: inherit;
55
+ height: 11px;
56
+ justify-content: center;
57
+ margin: 6.5px 0; /* (d2l-button-add-icon-text height - line height) / 2 */
58
+ outline: none;
59
+ padding: 0;
60
+ position: relative;
61
+ user-select: none;
62
+ white-space: nowrap;
63
+ width: 100%;
64
+ z-index: 1; /* needed for button-add to have expected hover behaviour in list (hover from below, tooltip position) */
65
+ }
66
+ :host([mode="icon-and-text"]) button {
67
+ margin: calc((1.5rem - 11px) / 2) 0; /* (d2l-button-add-icon-text height - line height) / 2 */
68
+ }
69
+
70
+ .line {
71
+ background: var(--d2l-button-add-line-color);
72
+ height: var(--d2l-button-add-line-height);
73
+ margin: 5px 0;
74
+ width: 100%;
75
+ }
76
+
77
+ button:hover .line,
78
+ button:focus .line {
79
+ background: var(--d2l-button-add-hover-focus-color);
80
+ height: var(--d2l-button-add-hover-focus-line-height);
81
+ }
82
+ button:hover d2l-button-add-icon-text,
83
+ button:focus d2l-button-add-icon-text {
84
+ --d2l-button-add-icon-text-color: var(--d2l-button-add-hover-focus-color);
85
+ }
86
+ :host([mode="icon-when-interacted"]) button:hover .line {
87
+ transition-delay: var(--d2l-button-add-animation-delay);
88
+ }
89
+
90
+ :host([mode="icon-when-interacted"]) button:not(:focus):not(:hover) d2l-button-add-icon-text {
91
+ position: absolute;
92
+ }
93
+ :host([mode="icon-when-interacted"]) button:hover d2l-button-add-icon-text,
94
+ :host([mode="icon-when-interacted"]) button:focus d2l-button-add-icon-text {
95
+ animation: position-change-animation var(--d2l-button-add-animation-delay); /* add delay in changing position to avoid flash of missing icon space */
96
+ }
97
+ @keyframes position-change-animation {
98
+ 0% { position: absolute; }
99
+ 100% { position: static; }
100
+ }
101
+ ${getFocusRingStyles(pseudoClass => `button:${pseudoClass} d2l-button-add-icon-text`, { extraStyles: css`background-color: white; border-radius: 0.3rem;` })}
102
+ :host([mode="icon-when-interacted"]) button:${unsafeCSS(getFocusPseudoClass())} d2l-button-add-icon-text,
103
+ :host([mode="icon"]) button:${unsafeCSS(getFocusPseudoClass())} d2l-button-add-icon-text {
104
+ border-radius: 0.2rem;
105
+ padding: 0.15rem;
106
+ }
107
+
108
+ @media (prefers-reduced-motion: no-preference) {
80
109
  button:hover .line,
81
110
  button:focus .line {
82
- background: var(--d2l-button-add-hover-focus-color);
83
- height: var(--d2l-button-add-hover-focus-line-height);
84
- }
85
- button:hover d2l-button-add-icon-text,
86
- button:focus d2l-button-add-icon-text {
87
- --d2l-button-add-icon-text-color: var(--d2l-button-add-hover-focus-color);
88
- }
89
- :host([mode="icon-when-interacted"]) button:hover .line {
90
- transition-delay: var(--d2l-button-add-animation-delay);
91
- }
92
-
93
- :host([mode="icon-when-interacted"]) button:not(:focus):not(:hover) d2l-button-add-icon-text {
94
- position: absolute;
111
+ animation: line-start-animation var(--d2l-button-add-animation-duration) ease-in var(--d2l-button-add-animation-delay) 1 forwards;
112
+ transition: all var(--d2l-button-add-animation-duration) ease-in var(--d2l-button-add-animation-delay);
95
113
  }
96
- :host([mode="icon-when-interacted"]) button:hover d2l-button-add-icon-text,
97
- :host([mode="icon-when-interacted"]) button:focus d2l-button-add-icon-text {
98
- animation: position-change-animation var(--d2l-button-add-animation-delay); /* add delay in changing position to avoid flash of missing icon space */
114
+ button:hover .line-end,
115
+ button:focus .line-end {
116
+ animation-name: line-end-animation;
99
117
  }
100
- @keyframes position-change-animation {
101
- 0% { position: absolute; }
102
- 100% { position: static; }
103
- }
104
- ${getFocusRingStyles(pseudoClass => `button:${pseudoClass} d2l-button-add-icon-text`, { extraStyles: css`background-color: white; border-radius: 0.3rem;` })}
105
- :host([mode="icon-when-interacted"]) button:${unsafeCSS(getFocusPseudoClass())} d2l-button-add-icon-text,
106
- :host([mode="icon"]) button:${unsafeCSS(getFocusPseudoClass())} d2l-button-add-icon-text {
107
- border-radius: 0.2rem;
108
- padding: 0.15rem;
109
- }
110
-
111
- @media (prefers-reduced-motion: no-preference) {
112
- button:hover .line,
113
- button:focus .line {
114
- animation: line-start-animation var(--d2l-button-add-animation-duration) ease-in var(--d2l-button-add-animation-delay) 1 forwards;
115
- transition: all var(--d2l-button-add-animation-duration) ease-in var(--d2l-button-add-animation-delay);
116
- }
117
- button:hover .line-end,
118
- button:focus .line-end {
119
- animation-name: line-end-animation;
120
- }
121
118
 
122
- @keyframes line-start-animation {
123
- 0% {
124
- background: linear-gradient(to var(--d2l-inline-end, right), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-start, left) center / 113%;
125
- opacity: 10%;
126
- }
127
- 100% {
128
- background: linear-gradient(to var(--d2l-inline-end, right), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-start, left) center / 113%; /* safari */
129
- background-position: var(--d2l-inline-end, right);
130
- }
119
+ @keyframes line-start-animation {
120
+ 0% {
121
+ background: linear-gradient(to var(--d2l-inline-end, right), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-start, left) center / 113%;
122
+ opacity: 10%;
131
123
  }
132
- @keyframes line-end-animation {
133
- 0% {
134
- background: linear-gradient(to var(--d2l-inline-start, left), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-end, right) center / 113%;
135
- opacity: 10%;
136
- }
137
- 100% {
138
- background: linear-gradient(to var(--d2l-inline-start, left), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-end, right) center / 113%; /* safari */
139
- background-position: var(--d2l-inline-start, left);
140
- }
124
+ 100% {
125
+ background: linear-gradient(to var(--d2l-inline-end, right), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-start, left) center / 113%; /* safari */
126
+ background-position: var(--d2l-inline-end, right);
141
127
  }
142
128
  }
143
- @media (prefers-contrast: more) {
144
- .line {
145
- background-color: ButtonBorder;
129
+ @keyframes line-end-animation {
130
+ 0% {
131
+ background: linear-gradient(to var(--d2l-inline-start, left), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-end, right) center / 113%;
132
+ opacity: 10%;
146
133
  }
147
- button:hover .line,
148
- button:focus .line {
149
- background-color: Highlight !important;
134
+ 100% {
135
+ background: linear-gradient(to var(--d2l-inline-start, left), var(--d2l-button-add-line-color) 0%, var(--d2l-button-add-line-color) 11%, var(--d2l-button-add-hover-focus-color) 11%) var(--d2l-inline-end, right) center / 113%; /* safari */
136
+ background-position: var(--d2l-inline-start, left);
150
137
  }
151
138
  }
152
- `;
153
- }
139
+ }
140
+ @media (prefers-contrast: more) {
141
+ .line {
142
+ background-color: ButtonBorder;
143
+ }
144
+ button:hover .line,
145
+ button:focus .line {
146
+ background-color: Highlight !important;
147
+ }
148
+ }
149
+ `;
154
150
 
155
151
  constructor() {
156
152
  super();
@@ -194,49 +190,45 @@ customElements.define('d2l-button-add', ButtonAdd);
194
190
  * @ignore
195
191
  */
196
192
  class ButtonAddIconText extends VisibleOnAncestorMixin(LitElement) {
197
- static get properties() {
198
- return {
199
- text: { type: String }
200
- };
201
- }
202
-
203
- static get styles() {
204
- return [visibleOnAncestorStyles, css`
205
- :host {
206
- --d2l-focus-ring-offset: 0;
207
- --d2l-focus-ring-color: var(--d2l-button-add-hover-focus-color);
208
- --d2l-button-add-icon-text-color: var(--d2l-color-galena);
209
- align-items: center;
210
- display: flex;
211
- stroke: var(--d2l-button-add-icon-text-color);
212
- stroke-width: 2;
213
- }
214
- :host([visible-on-ancestor]),
215
- :host([text]) {
216
- --d2l-button-add-icon-text-color: var(--d2l-color-celestine);
217
- }
218
- :host([text]) {
219
- color: var(--d2l-button-add-icon-text-color);
220
- height: 1.5rem;
221
- padding: 0 0.3rem;
222
- }
223
-
224
- :host([text]) svg {
225
- padding-inline-end: 0.2rem;
226
- }
227
- :host(:not([text])) svg {
228
- margin: -0.15rem; /** hover/click target */
229
- padding: 0.15rem; /** hover/click target */
230
- }
231
-
232
- span {
233
- font-size: 0.7rem;
234
- font-weight: 700;
235
- letter-spacing: 0.2px;
236
- line-height: 1rem;
237
- }`
238
- ];
239
- }
193
+ static properties = {
194
+ text: { type: String }
195
+ };
196
+
197
+ static styles = [visibleOnAncestorStyles, css`
198
+ :host {
199
+ --d2l-focus-ring-offset: 0;
200
+ --d2l-focus-ring-color: var(--d2l-button-add-hover-focus-color);
201
+ --d2l-button-add-icon-text-color: var(--d2l-color-galena);
202
+ align-items: center;
203
+ display: flex;
204
+ stroke: var(--d2l-button-add-icon-text-color);
205
+ stroke-width: 2;
206
+ }
207
+ :host([visible-on-ancestor]),
208
+ :host([text]) {
209
+ --d2l-button-add-icon-text-color: var(--d2l-color-celestine);
210
+ }
211
+ :host([text]) {
212
+ color: var(--d2l-button-add-icon-text-color);
213
+ height: 1.5rem;
214
+ padding: 0 0.3rem;
215
+ }
216
+
217
+ :host([text]) svg {
218
+ padding-inline-end: 0.2rem;
219
+ }
220
+ :host(:not([text])) svg {
221
+ margin: -0.15rem; /** hover/click target */
222
+ padding: 0.15rem; /** hover/click target */
223
+ }
224
+
225
+ span {
226
+ font-size: 0.7rem;
227
+ font-weight: 700;
228
+ letter-spacing: 0.2px;
229
+ line-height: 1rem;
230
+ }`
231
+ ];
240
232
 
241
233
  render() {
242
234
  return html`
@@ -4,17 +4,15 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
4
4
 
5
5
  export const ButtonCopyMixin = (superclass) => class extends LocalizeCoreElement(superclass) {
6
6
 
7
- static get properties() {
8
- return {
9
- /**
10
- * Disables the button
11
- * @type {boolean}
12
- */
13
- disabled: { type: Boolean, reflect: true },
14
- _recentCopySuccessful: { state: true },
15
- _toastState: { state: true }
16
- };
17
- }
7
+ static properties = {
8
+ /**
9
+ * Disables the button
10
+ * @type {boolean}
11
+ */
12
+ disabled: { type: Boolean, reflect: true },
13
+ _recentCopySuccessful: { state: true },
14
+ _toastState: { state: true }
15
+ };
18
16
 
19
17
  constructor() {
20
18
  super();
@@ -8,26 +8,22 @@ import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
8
8
  */
9
9
  class ButtonCopy extends FocusMixin(ButtonCopyMixin(LitElement)) {
10
10
 
11
- static get properties() {
12
- return {
13
- /**
14
- * Description of the content being copied to clipboard
15
- * @type {string}
16
- */
17
- text: { type: String },
18
- };
19
- }
11
+ static properties = {
12
+ /**
13
+ * Description of the content being copied to clipboard
14
+ * @type {string}
15
+ */
16
+ text: { type: String },
17
+ };
20
18
 
21
- static get styles() {
22
- return css`
23
- :host {
24
- display: inline-block;
25
- }
26
- :host([hidden]) {
27
- display: none;
28
- }
29
- `;
30
- }
19
+ static styles = css`
20
+ :host {
21
+ display: inline-block;
22
+ }
23
+ :host([hidden]) {
24
+ display: none;
25
+ }
26
+ `;
31
27
 
32
28
  static get focusElementSelector() {
33
29
  return 'd2l-button-icon';
@@ -17,122 +17,118 @@ import { ThemeMixin } from '../../mixins/theme/theme-mixin.js';
17
17
  */
18
18
  class ButtonIcon extends SlottedIconMixin(PropertyRequiredMixin(ThemeMixin(ButtonMixin(VisibleOnAncestorMixin(LitElement))))) {
19
19
 
20
- static get properties() {
21
- return {
22
- /**
23
- * ACCESSIBILITY: A description to be added to the button for accessibility when text on button does not provide enough context
24
- * @type {string}
25
- */
26
- description: { type: String },
27
-
28
- /**
29
- * Aligns the leading edge of text if value is set to "text" for left-aligned layouts, the trailing edge of text if value is set to "text-end" for right-aligned layouts
30
- * @type {'text'|'text-end'|''}
31
- */
32
- hAlign: { type: String, reflect: true, attribute: 'h-align' },
33
-
34
- /**
35
- * ACCESSIBILITY: REQUIRED: Accessible text for the button
36
- * @type {string}
37
- */
38
- text: { type: String, reflect: true, required: true },
39
-
40
- /**
41
- * Indicates to display translucent (e.g., on rich backgrounds)
42
- * @type {boolean}
43
- */
44
- translucent: { type: Boolean, reflect: true }
45
- };
46
- }
47
-
48
- static get styles() {
49
- return [super.styles, buttonStyles, visibleOnAncestorStyles,
50
- css`
51
- :host {
52
- --d2l-button-icon-background-color-default: var(--d2l-theme-background-color-interactive-tertiary-default);
53
- --d2l-button-icon-background-color-hover-default: var(--d2l-theme-background-color-interactive-tertiary-hover);
54
- --d2l-button-icon-border-radius-default: 0.3rem;
55
- --d2l-button-icon-min-height-default: calc(2rem + 2px);
56
- --d2l-button-icon-min-width-default: calc(2rem + 2px);
57
- --d2l-button-icon-h-align: calc(((2rem + 2px - 0.9rem) / 2) * -1);
58
- display: inline-block;
59
- line-height: 0;
60
- }
61
- :host([hidden]) {
62
- display: none;
63
- }
64
- :host([translucent]) {
65
- --d2l-button-icon-background-color-default: var(--d2l-theme-background-color-interactive-translucent-default);
66
- --d2l-button-icon-background-color-hover-default: var(--d2l-theme-background-color-interactive-translucent-hover);
67
- --d2l-focus-ring-color: var(--d2l-theme-icon-color-inverted);
68
- --d2l-focus-ring-offset: -4px;
69
- --d2l-button-icon-fill-color: var(--d2l-theme-icon-color-inverted);
70
- --d2l-button-icon-fill-color-hover: var(--d2l-theme-icon-color-inverted);
71
- }
72
- :host([theme="dark"]) {
73
- --d2l-button-icon-background-color-default: transparent;
74
- --d2l-button-icon-background-color-hover-default: rgba(51, 53, 54, 0.9); /* tungsten @70% @90% */
75
- --d2l-button-icon-fill-color: var(--d2l-color-sylvite);
76
- --d2l-button-icon-fill-color-hover: var(--d2l-color-sylvite);
77
- --d2l-focus-ring-color: var(--d2l-color-celestine-plus-1);
78
- }
79
-
80
- button {
81
- background-color: var(--d2l-button-icon-background-color, var(--d2l-button-icon-background-color-default));
82
- border-color: transparent;
83
- border-radius: var(--d2l-button-icon-border-radius, var(--d2l-button-icon-border-radius-default));
84
- font-family: inherit;
85
- min-height: var(--d2l-button-icon-min-height, var(--d2l-button-icon-min-height-default));
86
- min-width: var(--d2l-button-icon-min-width, var(--d2l-button-icon-min-width-default));
87
- padding: 0;
88
- position: relative;
89
- }
90
-
91
- :host([h-align="text"]) button {
92
- inset-inline-start: var(--d2l-button-icon-h-align);
93
- }
94
- :host([h-align="text-end"]) button {
95
- inset-inline-end: var(--d2l-button-icon-h-align);
96
- }
97
-
98
- /* Firefox includes a hidden border which messes up button dimensions */
99
- button::-moz-focus-inner {
100
- border: 0;
101
- }
102
-
103
- button:hover:not([disabled]),
104
- button:focus:not([disabled]),
105
- :host([active]) button:not([disabled]) {
106
- --d2l-button-icon-fill-color: var(--d2l-button-icon-fill-color-hover, var(--d2l-theme-icon-color-standard));
107
- background-color: var(--d2l-button-icon-background-color-hover, var(--d2l-button-icon-background-color-hover-default));
108
- }
109
-
110
- d2l-icon,
111
- slot[name="icon"]::slotted(d2l-icon-custom) {
112
- color: var(--d2l-button-icon-fill-color, var(--d2l-theme-icon-color-standard));
113
- }
114
-
20
+ static properties = {
21
+ /**
22
+ * ACCESSIBILITY: A description to be added to the button for accessibility when text on button does not provide enough context
23
+ * @type {string}
24
+ */
25
+ description: { type: String },
26
+
27
+ /**
28
+ * Aligns the leading edge of text if value is set to "text" for left-aligned layouts, the trailing edge of text if value is set to "text-end" for right-aligned layouts
29
+ * @type {'text'|'text-end'|''}
30
+ */
31
+ hAlign: { type: String, reflect: true, attribute: 'h-align' },
32
+
33
+ /**
34
+ * ACCESSIBILITY: REQUIRED: Accessible text for the button
35
+ * @type {string}
36
+ */
37
+ text: { type: String, reflect: true, required: true },
38
+
39
+ /**
40
+ * Indicates to display translucent (e.g., on rich backgrounds)
41
+ * @type {boolean}
42
+ */
43
+ translucent: { type: Boolean, reflect: true }
44
+ };
45
+
46
+ static styles = [super.styles, buttonStyles, visibleOnAncestorStyles,
47
+ css`
48
+ :host {
49
+ --d2l-button-icon-background-color-default: var(--d2l-theme-background-color-interactive-tertiary-default);
50
+ --d2l-button-icon-background-color-hover-default: var(--d2l-theme-background-color-interactive-tertiary-hover);
51
+ --d2l-button-icon-border-radius-default: 0.3rem;
52
+ --d2l-button-icon-min-height-default: calc(2rem + 2px);
53
+ --d2l-button-icon-min-width-default: calc(2rem + 2px);
54
+ --d2l-button-icon-h-align: calc(((2rem + 2px - 0.9rem) / 2) * -1);
55
+ display: inline-block;
56
+ line-height: 0;
57
+ }
58
+ :host([hidden]) {
59
+ display: none;
60
+ }
61
+ :host([translucent]) {
62
+ --d2l-button-icon-background-color-default: var(--d2l-theme-background-color-interactive-translucent-default);
63
+ --d2l-button-icon-background-color-hover-default: var(--d2l-theme-background-color-interactive-translucent-hover);
64
+ --d2l-focus-ring-color: var(--d2l-theme-icon-color-inverted);
65
+ --d2l-focus-ring-offset: -4px;
66
+ --d2l-button-icon-fill-color: var(--d2l-theme-icon-color-inverted);
67
+ --d2l-button-icon-fill-color-hover: var(--d2l-theme-icon-color-inverted);
68
+ }
69
+ :host([theme="dark"]) {
70
+ --d2l-button-icon-background-color-default: transparent;
71
+ --d2l-button-icon-background-color-hover-default: rgba(51, 53, 54, 0.9); /* tungsten @70% @90% */
72
+ --d2l-button-icon-fill-color: var(--d2l-color-sylvite);
73
+ --d2l-button-icon-fill-color-hover: var(--d2l-color-sylvite);
74
+ --d2l-focus-ring-color: var(--d2l-color-celestine-plus-1);
75
+ }
76
+
77
+ button {
78
+ background-color: var(--d2l-button-icon-background-color, var(--d2l-button-icon-background-color-default));
79
+ border-color: transparent;
80
+ border-radius: var(--d2l-button-icon-border-radius, var(--d2l-button-icon-border-radius-default));
81
+ font-family: inherit;
82
+ min-height: var(--d2l-button-icon-min-height, var(--d2l-button-icon-min-height-default));
83
+ min-width: var(--d2l-button-icon-min-width, var(--d2l-button-icon-min-width-default));
84
+ padding: 0;
85
+ position: relative;
86
+ }
87
+
88
+ :host([h-align="text"]) button {
89
+ inset-inline-start: var(--d2l-button-icon-h-align);
90
+ }
91
+ :host([h-align="text-end"]) button {
92
+ inset-inline-end: var(--d2l-button-icon-h-align);
93
+ }
94
+
95
+ /* Firefox includes a hidden border which messes up button dimensions */
96
+ button::-moz-focus-inner {
97
+ border: 0;
98
+ }
99
+
100
+ button:hover:not([disabled]),
101
+ button:focus:not([disabled]),
102
+ :host([active]) button:not([disabled]) {
103
+ --d2l-button-icon-fill-color: var(--d2l-button-icon-fill-color-hover, var(--d2l-theme-icon-color-standard));
104
+ background-color: var(--d2l-button-icon-background-color-hover, var(--d2l-button-icon-background-color-hover-default));
105
+ }
106
+
107
+ d2l-icon,
108
+ slot[name="icon"]::slotted(d2l-icon-custom) {
109
+ color: var(--d2l-button-icon-fill-color, var(--d2l-theme-icon-color-standard));
110
+ }
111
+
112
+ :host([translucent]) button {
113
+ transition-duration: 0.2s, 0.2s;
114
+ transition-property: background-color, box-shadow;
115
+ }
116
+ :host([translucent][visible-on-ancestor]) button {
117
+ transition-duration: 0.4s, 0.4s;
118
+ }
119
+
120
+ :host([disabled]) button {
121
+ cursor: default;
122
+ opacity: var(--d2l-theme-opacity-disabled-control);
123
+ }
124
+
125
+ @media (prefers-reduced-motion: reduce) {
115
126
  :host([translucent]) button {
116
- transition-duration: 0.2s, 0.2s;
117
- transition-property: background-color, box-shadow;
127
+ transition: none;
118
128
  }
119
- :host([translucent][visible-on-ancestor]) button {
120
- transition-duration: 0.4s, 0.4s;
121
- }
122
-
123
- :host([disabled]) button {
124
- cursor: default;
125
- opacity: var(--d2l-theme-opacity-disabled-control);
126
- }
127
-
128
- @media (prefers-reduced-motion: reduce) {
129
- :host([translucent]) button {
130
- transition: none;
131
- }
132
- }
133
- `
134
- ];
135
- }
129
+ }
130
+ `
131
+ ];
136
132
 
137
133
  constructor() {
138
134
  super();