@brightspace-ui/core 3.268.0 → 3.268.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.
Files changed (107) hide show
  1. package/components/collapsible-panel/README.md +11 -15
  2. package/components/demo/code-view.js +6 -10
  3. package/components/demo/demo-page-settings.js +25 -29
  4. package/components/demo/demo-page.js +32 -36
  5. package/components/demo/demo-snippet.js +95 -99
  6. package/components/description-list/README.md +25 -33
  7. package/components/description-list/demo/description-list-test.js +36 -39
  8. package/components/dialog/README.md +3 -5
  9. package/components/form/docs/form-element-mixin.md +11 -14
  10. package/components/form/docs/form-element-nesting.md +4 -6
  11. package/components/form/docs/form-element-wrapping.md +1 -3
  12. package/components/hierarchical-view/README.md +8 -11
  13. package/components/inputs/docs/input-select-styles.md +4 -9
  14. package/components/inputs/docs/styling-native-inputs.md +11 -25
  15. package/components/link/README.md +1 -1
  16. package/components/list/README.md +8 -16
  17. package/components/menu/menu-item-checkbox.js +1 -3
  18. package/components/menu/menu-item-link.js +27 -33
  19. package/components/menu/menu-item-mixin.js +52 -54
  20. package/components/menu/menu-item-radio.js +1 -3
  21. package/components/menu/menu-item-return.js +18 -22
  22. package/components/menu/menu-item-selectable-mixin.js +12 -14
  23. package/components/menu/menu-item-separator.js +9 -11
  24. package/components/menu/menu-item.js +11 -15
  25. package/components/menu/menu.js +50 -54
  26. package/components/meter/meter-circle.js +3 -4
  27. package/components/meter/meter-linear.js +86 -88
  28. package/components/meter/meter-mixin.js +34 -36
  29. package/components/meter/meter-radial.js +3 -4
  30. package/components/more-less/more-less.js +57 -61
  31. package/components/object-property-list/object-property-list-item-link.js +18 -19
  32. package/components/object-property-list/object-property-list-item-tooltip-help.js +8 -9
  33. package/components/object-property-list/object-property-list-item.js +52 -55
  34. package/components/object-property-list/object-property-list.js +24 -27
  35. package/components/offscreen/README.md +1 -1
  36. package/components/offscreen/offscreen.js +13 -15
  37. package/components/offscreen/screen-reader-pause.js +1 -3
  38. package/components/overflow-group/README.md +1 -3
  39. package/components/overflow-group/overflow-group-mixin.js +55 -59
  40. package/components/overflow-group/overflow-group.js +38 -42
  41. package/components/page/page-header-button.js +41 -45
  42. package/components/page/page-header-custom.js +108 -112
  43. package/components/page/page-header-immersive.js +65 -69
  44. package/components/page/page-header-separator.js +12 -14
  45. package/components/paging/pageable-mixin.js +3 -5
  46. package/components/paging/pageable-subscriber-mixin.js +8 -10
  47. package/components/paging/pager-load-more.js +47 -51
  48. package/components/popover/popover-mixin.js +186 -190
  49. package/components/progress/progress.js +160 -164
  50. package/components/scroll-wrapper/scroll-wrapper.js +109 -113
  51. package/components/selection/README.md +5 -7
  52. package/components/selection/demo/demo-selection.js +5 -7
  53. package/components/selection/selection-action-dropdown.js +9 -13
  54. package/components/selection/selection-action-menu-item.js +11 -15
  55. package/components/selection/selection-action.js +20 -24
  56. package/components/selection/selection-controls.js +92 -96
  57. package/components/selection/selection-input.js +40 -44
  58. package/components/selection/selection-mixin.js +11 -13
  59. package/components/selection/selection-observer-mixin.js +14 -16
  60. package/components/selection/selection-select-all-pages.js +8 -10
  61. package/components/selection/selection-select-all.js +16 -20
  62. package/components/selection/selection-summary.js +18 -22
  63. package/components/skeleton/README.md +2 -6
  64. package/components/skeleton/skeleton-group-mixin.js +3 -5
  65. package/components/skeleton/skeleton-mixin.js +7 -9
  66. package/components/skip-nav/skip-nav-custom.js +33 -37
  67. package/components/sorting/sort.js +11 -13
  68. package/components/status-indicator/status-indicator.js +75 -79
  69. package/components/switch/switch-mixin.js +145 -149
  70. package/components/switch/switch-visibility.js +11 -15
  71. package/components/switch/switch.js +5 -7
  72. package/components/table/README.md +19 -37
  73. package/components/table/demo/table-test.js +27 -31
  74. package/components/table/table-col-sort-button-item.js +1 -3
  75. package/components/table/table-col-sort-button.js +105 -109
  76. package/components/table/table-controls.js +18 -21
  77. package/components/table/table-wrapper.js +124 -128
  78. package/components/tabs/tab-internal.js +72 -76
  79. package/components/tabs/tab-mixin.js +22 -24
  80. package/components/tabs/tab-panel-mixin.js +47 -51
  81. package/components/tabs/tab.js +7 -9
  82. package/components/tabs/tabs.js +171 -175
  83. package/components/tag-list/tag-list-item-mixin.js +103 -107
  84. package/components/tag-list/tag-list-item.js +13 -15
  85. package/components/tag-list/tag-list.js +54 -58
  86. package/components/tooltip/tooltip-help.js +67 -71
  87. package/components/tooltip/tooltip.js +103 -107
  88. package/components/typography/README.md +5 -7
  89. package/components/validation/validation-custom-mixin.js +4 -6
  90. package/components/view-switcher/view-switcher-button.js +42 -46
  91. package/components/view-switcher/view-switcher.js +26 -29
  92. package/controllers/subscriber/README.md +7 -11
  93. package/custom-elements.json +1026 -3850
  94. package/mixins/arrow-keys/arrow-keys-mixin.js +10 -12
  95. package/mixins/async-container/async-container-mixin.js +10 -12
  96. package/mixins/collection/collection-mixin.js +7 -9
  97. package/mixins/interactive/interactive-mixin.js +10 -14
  98. package/mixins/labelled/README.md +3 -5
  99. package/mixins/labelled/labelled-mixin.js +26 -30
  100. package/mixins/provider/README.md +5 -7
  101. package/mixins/rtl/README.md +5 -7
  102. package/mixins/rtl/rtl-mixin.js +7 -9
  103. package/mixins/theme/theme-mixin.js +6 -8
  104. package/mixins/visible-on-ancestor/README.md +1 -3
  105. package/mixins/visible-on-ancestor/visible-on-ancestor-mixin.js +11 -13
  106. package/package.json +1 -1
  107. package/templates/primary-secondary/primary-secondary.js +373 -377
@@ -37,196 +37,192 @@ function getOffsetLeft(tab, tabRect) {
37
37
  */
38
38
  class Tabs extends LocalizeCoreElement(ArrowKeysMixin(SkeletonMixin(LitElement))) {
39
39
 
40
- static get properties() {
41
- return {
42
- /**
43
- * Limit the number of tabs to initially display
44
- * @type {number}
45
- */
46
- maxToShow: { type: Number, attribute: 'max-to-show' },
47
- /**
48
- * REQUIRED: ACCESSIBILITY: Accessible text for the tablist
49
- * @type {string}
50
- */
51
- text: { type: String },
52
- _allowScrollNext: { type: Boolean },
53
- _allowScrollPrevious: { type: Boolean },
54
- _defaultSlotBehavior: { state: true },
55
- _maxWidth: { type: Number },
56
- _scrollCollapsed: { type: Boolean },
57
- _state: { type: String },
58
- _tabInfos: { type: Array },
59
- _translationValue: {}
60
- };
61
- }
40
+ static properties = {
41
+ /**
42
+ * Limit the number of tabs to initially display
43
+ * @type {number}
44
+ */
45
+ maxToShow: { type: Number, attribute: 'max-to-show' },
46
+ /**
47
+ * REQUIRED: ACCESSIBILITY: Accessible text for the tablist
48
+ * @type {string}
49
+ */
50
+ text: { type: String },
51
+ _allowScrollNext: { type: Boolean },
52
+ _allowScrollPrevious: { type: Boolean },
53
+ _defaultSlotBehavior: { state: true },
54
+ _maxWidth: { type: Number },
55
+ _scrollCollapsed: { type: Boolean },
56
+ _state: { type: String },
57
+ _tabInfos: { type: Array },
58
+ _translationValue: {}
59
+ };
60
+
61
+ static styles = [super.styles, bodyCompactStyles, css`
62
+ :host {
63
+ --d2l-tabs-background-color: var(--d2l-theme-background-color-base);
64
+ box-sizing: border-box;
65
+ display: block;
66
+ margin-bottom: 1.2rem;
67
+ }
68
+ .d2l-tabs-layout {
69
+ border-bottom: 1px solid var(--d2l-theme-border-color-subtle);
70
+ display: none;
71
+ max-height: 0;
72
+ opacity: 0;
73
+ transform: translateY(-10px);
74
+ -webkit-transition: max-height 200ms ease-out, transform 200ms ease-out, opacity 200ms ease-out;
75
+ transition: max-height 200ms ease-out, transform 200ms ease-out, opacity 200ms ease-out;
76
+ width: 100%;
77
+ }
78
+ .d2l-tabs-layout-anim {
79
+ display: flex;
80
+ }
81
+ .d2l-tabs-layout-shown {
82
+ display: flex;
83
+ max-height: 60px;
84
+ opacity: 1;
85
+ transform: none;
86
+ }
87
+ .d2l-tabs-container {
88
+ box-sizing: border-box;
89
+ flex: auto;
90
+ margin-left: -3px;
91
+ padding-left: 3px;
92
+ position: relative;
93
+ -webkit-transition: max-width 200ms ease-in;
94
+ transition: max-width 200ms ease-in;
95
+ ${getOverflowDeclarations({ textOverflow: 'clip' })}
96
+ }
97
+ .d2l-tabs-container-ext {
98
+ flex: none;
99
+ padding-inline: 4px 0;
100
+ }
101
+ .d2l-tabs-container-list {
102
+ display: flex;
103
+ position: relative;
104
+ -webkit-transition: transform 200ms ease-out;
105
+ transition: transform 200ms ease-out;
106
+ white-space: nowrap;
107
+ }
108
+ .d2l-tabs-scroll-previous-container,
109
+ .d2l-tabs-scroll-next-container {
110
+ background-color: var(--d2l-tabs-background-color);
111
+ box-shadow: 0 0 12px 18px var(--d2l-tabs-background-color);
112
+ clip-path: rect(0% 200% 100% -100%);
113
+ display: none;
114
+ height: 100%;
115
+ position: absolute;
116
+ top: 0;
117
+ z-index: 1;
118
+ }
119
+ .d2l-tabs-scroll-previous-container {
120
+ inset-inline-start: 0;
121
+ margin-inline: 4px 0;
122
+ }
123
+ .d2l-tabs-container[data-allow-scroll-previous] > .d2l-tabs-scroll-previous-container {
124
+ display: inline-block;
125
+ }
126
+ .d2l-tabs-scroll-next-container {
127
+ inset-inline-end: 0;
128
+ margin-inline: 0 4px;
129
+ }
130
+ .d2l-tabs-container[data-allow-scroll-next] > .d2l-tabs-scroll-next-container {
131
+ display: inline-block;
132
+ }
133
+ .d2l-tabs-scroll-button {
134
+ background-color: transparent;
135
+ border: 1px solid transparent;
136
+ border-radius: 15px;
137
+ box-sizing: border-box;
138
+ cursor: pointer;
139
+ display: inline-block;
140
+ height: 30px;
141
+ margin: 0;
142
+ outline: none;
143
+ padding: 0;
144
+ transform: translateY(10px);
145
+ width: 30px;
146
+ }
147
+ .d2l-tabs-scroll-button[disabled] {
148
+ cursor: default;
149
+ opacity: 0.5;
150
+ }
151
+ .d2l-tabs-scroll-button::-moz-focus-inner {
152
+ border: 0;
153
+ }
154
+ .d2l-tabs-scroll-button[disabled]:hover,
155
+ .d2l-tabs-scroll-button[disabled]:${unsafeCSS(getFocusPseudoClass())} {
156
+ background-color: transparent;
157
+ }
158
+ .d2l-tabs-scroll-button:hover,
159
+ .d2l-tabs-scroll-button:${unsafeCSS(getFocusPseudoClass())} {
160
+ background-color: var(--d2l-theme-background-color-interactive-tertiary-hover);
161
+ }
162
+ ${getFocusRingStyles('.d2l-tabs-scroll-button')}
163
+ :host([skeleton]) .d2l-tabs-scroll-button {
164
+ visibility: hidden;
165
+ }
166
+ .d2l-panels-container-no-whitespace ::slotted(*) {
167
+ margin-top: 0;
168
+ -webkit-transition: margin-top 200ms ease-out;
169
+ transition: margin-top 200ms ease-out;
170
+ }
171
+
172
+ d2l-tab-internal, ::slotted([role="tab"]) {
173
+ -webkit-transition: max-width 200ms ease-out, opacity 200ms ease-out, transform 200ms ease-out;
174
+ transition: max-width 200ms ease-out, opacity 200ms ease-out, transform 200ms ease-out;
175
+ }
176
+ d2l-tab-internal[data-state="adding"],
177
+ d2l-tab-internal[data-state="removing"],
178
+ ::slotted([role="tab"][data-state="adding"]),
179
+ ::slotted([role="tab"][data-state="removing"]) {
180
+ max-width: 0;
181
+ opacity: 0;
182
+ transform: translateY(20px);
183
+ }
184
+
185
+ @media (prefers-reduced-motion: reduce) {
62
186
 
63
- static get styles() {
64
- return [super.styles, bodyCompactStyles, css`
65
- :host {
66
- --d2l-tabs-background-color: var(--d2l-theme-background-color-base);
67
- box-sizing: border-box;
68
- display: block;
69
- margin-bottom: 1.2rem;
70
- }
71
187
  .d2l-tabs-layout {
72
- border-bottom: 1px solid var(--d2l-theme-border-color-subtle);
73
- display: none;
74
- max-height: 0;
75
- opacity: 0;
76
- transform: translateY(-10px);
77
- -webkit-transition: max-height 200ms ease-out, transform 200ms ease-out, opacity 200ms ease-out;
78
- transition: max-height 200ms ease-out, transform 200ms ease-out, opacity 200ms ease-out;
79
- width: 100%;
80
- }
81
- .d2l-tabs-layout-anim {
82
- display: flex;
83
- }
84
- .d2l-tabs-layout-shown {
85
- display: flex;
86
- max-height: 60px;
87
- opacity: 1;
88
- transform: none;
188
+ -webkit-transition: none;
189
+ transition: none;
89
190
  }
90
191
  .d2l-tabs-container {
91
- box-sizing: border-box;
92
- flex: auto;
93
- margin-left: -3px;
94
- padding-left: 3px;
95
- position: relative;
96
- -webkit-transition: max-width 200ms ease-in;
97
- transition: max-width 200ms ease-in;
98
- ${getOverflowDeclarations({ textOverflow: 'clip' })}
99
- }
100
- .d2l-tabs-container-ext {
101
- flex: none;
102
- padding-inline: 4px 0;
192
+ -webkit-transition: none;
193
+ transition: none;
103
194
  }
104
195
  .d2l-tabs-container-list {
105
- display: flex;
106
- position: relative;
107
- -webkit-transition: transform 200ms ease-out;
108
- transition: transform 200ms ease-out;
109
- white-space: nowrap;
110
- }
111
- .d2l-tabs-scroll-previous-container,
112
- .d2l-tabs-scroll-next-container {
113
- background-color: var(--d2l-tabs-background-color);
114
- box-shadow: 0 0 12px 18px var(--d2l-tabs-background-color);
115
- clip-path: rect(0% 200% 100% -100%);
116
- display: none;
117
- height: 100%;
118
- position: absolute;
119
- top: 0;
120
- z-index: 1;
121
- }
122
- .d2l-tabs-scroll-previous-container {
123
- inset-inline-start: 0;
124
- margin-inline: 4px 0;
125
- }
126
- .d2l-tabs-container[data-allow-scroll-previous] > .d2l-tabs-scroll-previous-container {
127
- display: inline-block;
128
- }
129
- .d2l-tabs-scroll-next-container {
130
- inset-inline-end: 0;
131
- margin-inline: 0 4px;
132
- }
133
- .d2l-tabs-container[data-allow-scroll-next] > .d2l-tabs-scroll-next-container {
134
- display: inline-block;
135
- }
136
- .d2l-tabs-scroll-button {
137
- background-color: transparent;
138
- border: 1px solid transparent;
139
- border-radius: 15px;
140
- box-sizing: border-box;
141
- cursor: pointer;
142
- display: inline-block;
143
- height: 30px;
144
- margin: 0;
145
- outline: none;
146
- padding: 0;
147
- transform: translateY(10px);
148
- width: 30px;
149
- }
150
- .d2l-tabs-scroll-button[disabled] {
151
- cursor: default;
152
- opacity: 0.5;
153
- }
154
- .d2l-tabs-scroll-button::-moz-focus-inner {
155
- border: 0;
156
- }
157
- .d2l-tabs-scroll-button[disabled]:hover,
158
- .d2l-tabs-scroll-button[disabled]:${unsafeCSS(getFocusPseudoClass())} {
159
- background-color: transparent;
160
- }
161
- .d2l-tabs-scroll-button:hover,
162
- .d2l-tabs-scroll-button:${unsafeCSS(getFocusPseudoClass())} {
163
- background-color: var(--d2l-theme-background-color-interactive-tertiary-hover);
164
- }
165
- ${getFocusRingStyles('.d2l-tabs-scroll-button')}
166
- :host([skeleton]) .d2l-tabs-scroll-button {
167
- visibility: hidden;
196
+ -webkit-transition: none;
197
+ transition: none;
168
198
  }
169
199
  .d2l-panels-container-no-whitespace ::slotted(*) {
170
- margin-top: 0;
171
- -webkit-transition: margin-top 200ms ease-out;
172
- transition: margin-top 200ms ease-out;
200
+ -webkit-transition: none;
201
+ transition: none;
173
202
  }
174
-
175
203
  d2l-tab-internal, ::slotted([role="tab"]) {
176
- -webkit-transition: max-width 200ms ease-out, opacity 200ms ease-out, transform 200ms ease-out;
177
- transition: max-width 200ms ease-out, opacity 200ms ease-out, transform 200ms ease-out;
178
- }
179
- d2l-tab-internal[data-state="adding"],
180
- d2l-tab-internal[data-state="removing"],
181
- ::slotted([role="tab"][data-state="adding"]),
182
- ::slotted([role="tab"][data-state="removing"]) {
183
- max-width: 0;
184
- opacity: 0;
185
- transform: translateY(20px);
204
+ -webkit-transition: none;
205
+ transition: none;
186
206
  }
187
207
 
188
- @media (prefers-reduced-motion: reduce) {
189
-
190
- .d2l-tabs-layout {
191
- -webkit-transition: none;
192
- transition: none;
193
- }
194
- .d2l-tabs-container {
195
- -webkit-transition: none;
196
- transition: none;
197
- }
198
- .d2l-tabs-container-list {
199
- -webkit-transition: none;
200
- transition: none;
201
- }
202
- .d2l-panels-container-no-whitespace ::slotted(*) {
203
- -webkit-transition: none;
204
- transition: none;
205
- }
206
- d2l-tab-internal, ::slotted([role="tab"]) {
207
- -webkit-transition: none;
208
- transition: none;
209
- }
208
+ }
210
209
 
210
+ @media (prefers-contrast: more) {
211
+ .d2l-tabs-scroll-previous-container,
212
+ .d2l-tabs-scroll-next-container {
213
+ margin-inline: 0;
214
+ padding-inline: 4px;
211
215
  }
212
-
213
- @media (prefers-contrast: more) {
214
- .d2l-tabs-scroll-previous-container,
215
- .d2l-tabs-scroll-next-container {
216
- margin-inline: 0;
217
- padding-inline: 4px;
218
- }
219
- .d2l-tabs-scroll-next-container {
220
- border-inline-start: 1px solid var(--d2l-theme-border-color-subtle);
221
- padding-inline-start: 11px;
222
- }
223
- .d2l-tabs-scroll-previous-container {
224
- border-inline-end: 1px solid var(--d2l-theme-border-color-subtle);
225
- padding-inline-end: 11px;
226
- }
216
+ .d2l-tabs-scroll-next-container {
217
+ border-inline-start: 1px solid var(--d2l-theme-border-color-subtle);
218
+ padding-inline-start: 11px;
227
219
  }
228
- `];
229
- }
220
+ .d2l-tabs-scroll-previous-container {
221
+ border-inline-end: 1px solid var(--d2l-theme-border-color-subtle);
222
+ padding-inline-end: 11px;
223
+ }
224
+ }
225
+ `];
230
226
 
231
227
  constructor() {
232
228
  super();
@@ -44,117 +44,113 @@ const focusSelector = isHasSelectorSupported() && isFocusVisibleSupported() ?
44
44
 
45
45
  export const TagListItemMixin = superclass => class extends LocalizeCoreElement(PropertyRequiredMixin(superclass)) {
46
46
 
47
- static get properties() {
48
- return {
49
- /**
50
- * Enables the option to clear a tag list item. The `d2l-tag-list-item-clear` event will be dispatched when the user selects to delete the item. The consumer must handle the actual item deletion.
51
- * @type {boolean}
52
- */
53
- clearable: { type: Boolean },
54
- /**
55
- * REQUIRED if clearable. Acts as a unique identifier for the tag
56
- * @type {string}
57
- */
58
- key: { type: String },
59
- /**
60
- * @ignore
61
- */
62
- keyboardTooltipItem: { type: Boolean, attribute: 'keyboard-tooltip-item' },
63
- /**
64
- * @ignore
65
- */
66
- _plainText: {
67
- state: true,
68
- required: {
69
- message: (_value, elem) => `TagListItemMixin: "${elem.tagName.toLowerCase()}" called "_renderTag()" with empty "plainText" option`
70
- }
71
- },
72
- _displayKeyboardTooltip: { state: true }
73
- };
74
- }
75
-
76
- static get styles() {
77
- return [labelStyles, heading4Styles, css`
78
- :host {
79
- display: grid;
80
- max-width: 100%;
81
- outline: none;
82
- }
83
- :host([hidden]) {
84
- display: none;
85
- }
86
- .tag-list-item-container {
87
- --d2l-focus-ring-offset: -2px;
88
- align-items: center;
89
- background-color: var(--d2l-theme-background-color-interactive-faint-default);
90
- border-radius: 6px;
91
- box-shadow: var(--d2l-theme-shadow-attached);
92
- box-sizing: border-box;
93
- color: var(--d2l-theme-text-color-static-standard);
94
- cursor: pointer;
95
- display: flex;
96
- line-height: 1rem;
97
- max-width: 320px;
98
- min-width: 0;
99
- outline: 1px solid var(--d2l-theme-border-color-subtle);
100
- outline-offset: -1px;
101
- transition: background-color 0.2s ease-out, box-shadow 0.2s ease-out;
102
- white-space: nowrap;
103
- }
104
- .tag-list-item-container.tag-list-item-container-clearable {
105
- padding-inline-end: 0.2rem;
106
- }
107
- .tag-list-item-content {
108
- outline: none;
109
- overflow: hidden;
110
- padding: 0.25rem 0.6rem;
111
- text-overflow: ellipsis;
112
- }
113
- ${getFocusRingStyles(() => focusSelector)}
114
- :host(:hover) .tag-list-item-container,
115
- ${unsafeCSS(focusSelector)} {
116
- background-color: var(--d2l-theme-background-color-interactive-faint-hover);
117
- }
118
- :host(:hover) .tag-list-item-container:not(${unsafeCSS(focusSelector)}) {
119
- outline-color: var(--d2l-theme-border-color-standard);
47
+ static properties = {
48
+ /**
49
+ * Enables the option to clear a tag list item. The `d2l-tag-list-item-clear` event will be dispatched when the user selects to delete the item. The consumer must handle the actual item deletion.
50
+ * @type {boolean}
51
+ */
52
+ clearable: { type: Boolean },
53
+ /**
54
+ * REQUIRED if clearable. Acts as a unique identifier for the tag
55
+ * @type {string}
56
+ */
57
+ key: { type: String },
58
+ /**
59
+ * @ignore
60
+ */
61
+ keyboardTooltipItem: { type: Boolean, attribute: 'keyboard-tooltip-item' },
62
+ /**
63
+ * @ignore
64
+ */
65
+ _plainText: {
66
+ state: true,
67
+ required: {
68
+ message: (_value, elem) => `TagListItemMixin: "${elem.tagName.toLowerCase()}" called "_renderTag()" with empty "plainText" option`
120
69
  }
70
+ },
71
+ _displayKeyboardTooltip: { state: true }
72
+ };
121
73
 
122
- @media (prefers-reduced-motion: reduce) {
123
- .tag-list-item-container {
124
- transition: none;
125
- }
126
- }
127
- .d2l-tag-list-item-clear-button {
128
- margin-inline-start: calc(-0.6rem + 3px);
129
- }
130
- d2l-button-icon {
131
- --d2l-button-icon-fill-color: var(--d2l-color-chromite);
132
- --d2l-button-icon-min-height: 1.2rem;
133
- --d2l-button-icon-min-width: 1.2rem;
134
- }
135
- d2l-button-icon:hover {
136
- --d2l-button-icon-fill-color: var(--d2l-theme-icon-color-standard);
137
- }
138
- d2l-tooltip ul {
139
- list-style: none;
140
- margin-bottom: 0;
141
- margin-top: 0.2rem;
142
- padding: 0;
143
- }
144
- .d2l-tag-list-item-tooltip-title-key {
145
- font-weight: 600;
146
- }
147
- .d2l-heading-4 {
148
- margin: 0 0 0.5rem 0;
74
+ static styles = [labelStyles, heading4Styles, css`
75
+ :host {
76
+ display: grid;
77
+ max-width: 100%;
78
+ outline: none;
79
+ }
80
+ :host([hidden]) {
81
+ display: none;
82
+ }
83
+ .tag-list-item-container {
84
+ --d2l-focus-ring-offset: -2px;
85
+ align-items: center;
86
+ background-color: var(--d2l-theme-background-color-interactive-faint-default);
87
+ border-radius: 6px;
88
+ box-shadow: var(--d2l-theme-shadow-attached);
89
+ box-sizing: border-box;
90
+ color: var(--d2l-theme-text-color-static-standard);
91
+ cursor: pointer;
92
+ display: flex;
93
+ line-height: 1rem;
94
+ max-width: 320px;
95
+ min-width: 0;
96
+ outline: 1px solid var(--d2l-theme-border-color-subtle);
97
+ outline-offset: -1px;
98
+ transition: background-color 0.2s ease-out, box-shadow 0.2s ease-out;
99
+ white-space: nowrap;
100
+ }
101
+ .tag-list-item-container.tag-list-item-container-clearable {
102
+ padding-inline-end: 0.2rem;
103
+ }
104
+ .tag-list-item-content {
105
+ outline: none;
106
+ overflow: hidden;
107
+ padding: 0.25rem 0.6rem;
108
+ text-overflow: ellipsis;
109
+ }
110
+ ${getFocusRingStyles(() => focusSelector)}
111
+ :host(:hover) .tag-list-item-container,
112
+ ${unsafeCSS(focusSelector)} {
113
+ background-color: var(--d2l-theme-background-color-interactive-faint-hover);
114
+ }
115
+ :host(:hover) .tag-list-item-container:not(${unsafeCSS(focusSelector)}) {
116
+ outline-color: var(--d2l-theme-border-color-standard);
117
+ }
118
+
119
+ @media (prefers-reduced-motion: reduce) {
120
+ .tag-list-item-container {
121
+ transition: none;
149
122
  }
150
- @media (prefers-contrast: more) {
151
- :host(:hover) .tag-list-item-container {
152
- outline-offset: -2px;
153
- outline-width: 2px;
154
- }
123
+ }
124
+ .d2l-tag-list-item-clear-button {
125
+ margin-inline-start: calc(-0.6rem + 3px);
126
+ }
127
+ d2l-button-icon {
128
+ --d2l-button-icon-fill-color: var(--d2l-color-chromite);
129
+ --d2l-button-icon-min-height: 1.2rem;
130
+ --d2l-button-icon-min-width: 1.2rem;
131
+ }
132
+ d2l-button-icon:hover {
133
+ --d2l-button-icon-fill-color: var(--d2l-theme-icon-color-standard);
134
+ }
135
+ d2l-tooltip ul {
136
+ list-style: none;
137
+ margin-bottom: 0;
138
+ margin-top: 0.2rem;
139
+ padding: 0;
140
+ }
141
+ .d2l-tag-list-item-tooltip-title-key {
142
+ font-weight: 600;
143
+ }
144
+ .d2l-heading-4 {
145
+ margin: 0 0 0.5rem 0;
146
+ }
147
+ @media (prefers-contrast: more) {
148
+ :host(:hover) .tag-list-item-container {
149
+ outline-offset: -2px;
150
+ outline-width: 2px;
155
151
  }
156
- `];
157
- }
152
+ }
153
+ `];
158
154
 
159
155
  constructor() {
160
156
  super();
@@ -3,21 +3,19 @@ import { TagListItemMixin } from './tag-list-item-mixin.js';
3
3
 
4
4
  class TagListItem extends TagListItemMixin(LitElement) {
5
5
 
6
- static get properties() {
7
- return {
8
- /**
9
- * REQUIRED: Text to display
10
- * @type {string}
11
- */
12
- text: { type: String },
13
- /**
14
- * Optional: Text to display in tooltip.
15
- * Tooltip will also include text property value if truncated.
16
- * @type {string}
17
- */
18
- description: { type: String }
19
- };
20
- }
6
+ static properties = {
7
+ /**
8
+ * REQUIRED: Text to display
9
+ * @type {string}
10
+ */
11
+ text: { type: String },
12
+ /**
13
+ * Optional: Text to display in tooltip.
14
+ * Tooltip will also include text property value if truncated.
15
+ * @type {string}
16
+ */
17
+ description: { type: String }
18
+ };
21
19
 
22
20
  render() {
23
21
  return this._renderTag(this.text, {