@brightspace-ui/core 2.1.3 → 2.3.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 (195) hide show
  1. package/README.md +1 -0
  2. package/components/alert/alert-toast.js +2 -2
  3. package/components/alert/alert.js +2 -2
  4. package/components/backdrop/backdrop.js +1 -1
  5. package/components/breadcrumbs/breadcrumb-current-page.js +1 -1
  6. package/components/breadcrumbs/breadcrumb.js +2 -2
  7. package/components/breadcrumbs/breadcrumbs.js +1 -1
  8. package/components/button/button-icon.js +2 -2
  9. package/components/button/button-styles.js +1 -1
  10. package/components/button/button-subtle.js +42 -18
  11. package/components/button/button.js +2 -2
  12. package/components/button/demo/button-subtle.html +16 -5
  13. package/components/button/floating-buttons.js +2 -2
  14. package/components/calendar/calendar.js +3 -3
  15. package/components/card/card-content-meta.js +1 -1
  16. package/components/card/card-content-title.js +1 -1
  17. package/components/card/card-footer-link.js +2 -2
  18. package/components/card/card-loading-shimmer.js +1 -1
  19. package/components/card/card.js +4 -4
  20. package/components/colors/demo/color-swatch.js +1 -1
  21. package/components/count-badge/count-badge-icon.js +2 -2
  22. package/components/count-badge/count-badge-mixin.js +2 -2
  23. package/components/count-badge/count-badge.js +2 -2
  24. package/components/demo/code-dark-plus-styles.js +1 -1
  25. package/components/demo/code-tomorrow-styles.js +1 -1
  26. package/components/demo/code-view-styles.js +1 -1
  27. package/components/demo/code-view.js +2 -2
  28. package/components/demo/demo-page.js +1 -1
  29. package/components/demo/demo-snippet.js +1 -1
  30. package/components/dialog/demo/dialog-async-content.js +1 -1
  31. package/components/dialog/demo/dialog-container.js +1 -1
  32. package/components/dialog/dialog-confirm.js +1 -1
  33. package/components/dialog/dialog-fullscreen.js +3 -3
  34. package/components/dialog/dialog-mixin.js +4 -4
  35. package/components/dialog/dialog-styles.js +1 -1
  36. package/components/dialog/dialog.js +4 -4
  37. package/components/dropdown/dropdown-button-subtle.js +2 -2
  38. package/components/dropdown/dropdown-button.js +1 -1
  39. package/components/dropdown/dropdown-content-mixin.js +3 -3
  40. package/components/dropdown/dropdown-content-styles.js +1 -1
  41. package/components/dropdown/dropdown-content.js +1 -1
  42. package/components/dropdown/dropdown-context-menu.js +1 -1
  43. package/components/dropdown/dropdown-menu.js +1 -1
  44. package/components/dropdown/dropdown-more.js +1 -1
  45. package/components/dropdown/dropdown-opener-styles.js +1 -1
  46. package/components/dropdown/dropdown-tabs.js +1 -1
  47. package/components/dropdown/dropdown.js +1 -1
  48. package/components/expand-collapse/expand-collapse-content.js +2 -2
  49. package/components/filter/README.md +19 -0
  50. package/components/filter/demo/filter-search-demo.js +1 -1
  51. package/components/filter/filter-dimension-set-value.js +1 -1
  52. package/components/filter/filter-dimension-set.js +1 -1
  53. package/components/filter/filter.js +3 -3
  54. package/components/focus-trap/focus-trap.js +2 -2
  55. package/components/form/demo/form-demo.js +1 -1
  56. package/components/form/demo/form-dialog-demo.js +1 -1
  57. package/components/form/demo/form-native-demo.js +1 -1
  58. package/components/form/demo/form-panel-demo.js +1 -1
  59. package/components/form/form-errory-summary.js +1 -1
  60. package/components/form/form-native.js +1 -1
  61. package/components/form/form.js +1 -1
  62. package/components/hierarchical-view/README.md +1 -1
  63. package/components/hierarchical-view/hierarchical-view-mixin.js +1 -1
  64. package/components/hierarchical-view/hierarchical-view.js +1 -1
  65. package/components/html-block/README.md +2 -2
  66. package/components/html-block/demo/html-block.html +4 -4
  67. package/components/html-block/html-block.js +1 -1
  68. package/components/icons/demo/icon-color-override.js +1 -1
  69. package/components/icons/demo/icon-size-override.js +1 -1
  70. package/components/icons/icon-custom.js +1 -1
  71. package/components/icons/icon-styles.js +1 -1
  72. package/components/icons/icon.js +2 -2
  73. package/components/inputs/demo/input-radio-label-simple-test.js +1 -1
  74. package/components/inputs/demo/input-radio-label-test.js +1 -1
  75. package/components/inputs/demo/input-radio-solo-test.js +1 -1
  76. package/components/inputs/demo/input-radio-spacer-test.js +1 -1
  77. package/components/inputs/demo/input-select-test.js +1 -1
  78. package/components/inputs/docs/input-checkbox.md +1 -1
  79. package/components/inputs/docs/input-radio.md +3 -3
  80. package/components/inputs/docs/input-select-styles.md +2 -2
  81. package/components/inputs/docs/input-text.md +2 -2
  82. package/components/inputs/input-checkbox-spacer.js +1 -1
  83. package/components/inputs/input-checkbox.js +3 -3
  84. package/components/inputs/input-date-range.js +2 -2
  85. package/components/inputs/input-date-time-range-to.js +2 -2
  86. package/components/inputs/input-date-time-range.js +2 -2
  87. package/components/inputs/input-date-time.js +3 -3
  88. package/components/inputs/input-date.js +3 -3
  89. package/components/inputs/input-fieldset.js +2 -2
  90. package/components/inputs/input-label-styles.js +1 -1
  91. package/components/inputs/input-number.js +2 -2
  92. package/components/inputs/input-percent.js +2 -2
  93. package/components/inputs/input-radio-spacer.js +1 -1
  94. package/components/inputs/input-radio-styles.js +1 -1
  95. package/components/inputs/input-search.js +2 -2
  96. package/components/inputs/input-select-styles.js +1 -1
  97. package/components/inputs/input-styles.js +1 -1
  98. package/components/inputs/input-text.js +4 -4
  99. package/components/inputs/input-textarea.js +3 -3
  100. package/components/inputs/input-time-range.js +2 -2
  101. package/components/inputs/input-time.js +2 -2
  102. package/components/link/README.md +1 -1
  103. package/components/link/link.js +3 -3
  104. package/components/list/README.md +1 -1
  105. package/components/list/demo/list-drag-and-drop-position.js +3 -3
  106. package/components/list/demo/list-drag-and-drop.js +3 -3
  107. package/components/list/demo/list-item-custom.js +1 -1
  108. package/components/list/list-header.js +2 -2
  109. package/components/list/list-item-button-mixin.js +1 -1
  110. package/components/list/list-item-button.js +1 -1
  111. package/components/list/list-item-checkbox-mixin.js +2 -3
  112. package/components/list/list-item-content.js +1 -1
  113. package/components/list/list-item-drag-drop-mixin.js +3 -4
  114. package/components/list/list-item-drag-handle.js +1 -1
  115. package/components/list/list-item-drag-image.js +1 -1
  116. package/components/list/list-item-generic-layout.js +1 -1
  117. package/components/list/list-item-link-mixin.js +1 -1
  118. package/components/list/list-item-mixin.js +3 -4
  119. package/components/list/list-item-placement-marker.js +1 -1
  120. package/components/list/list-item.js +1 -1
  121. package/components/list/list.js +1 -1
  122. package/components/loading-spinner/demo/loading-spinner-override.js +1 -1
  123. package/components/loading-spinner/loading-spinner.js +1 -1
  124. package/components/menu/demo/custom-menu-item.js +1 -1
  125. package/components/menu/demo/custom-view.js +1 -1
  126. package/components/menu/menu-item-checkbox.js +1 -1
  127. package/components/menu/menu-item-link.js +2 -2
  128. package/components/menu/menu-item-radio.js +1 -1
  129. package/components/menu/menu-item-return.js +1 -1
  130. package/components/menu/menu-item-selectable-styles.js +1 -1
  131. package/components/menu/menu-item-separator.js +1 -1
  132. package/components/menu/menu-item-styles.js +1 -1
  133. package/components/menu/menu-item.js +1 -1
  134. package/components/menu/menu.js +1 -1
  135. package/components/meter/meter-circle.js +2 -2
  136. package/components/meter/meter-linear.js +2 -2
  137. package/components/meter/meter-radial.js +2 -2
  138. package/components/more-less/more-less.js +4 -4
  139. package/components/offscreen/demo/offscreen-demo.js +1 -1
  140. package/components/offscreen/offscreen.js +1 -1
  141. package/components/overflow-group/overflow-group.js +2 -2
  142. package/components/scroll-wrapper/demo/scroll-wrapper-test.js +2 -2
  143. package/components/scroll-wrapper/scroll-wrapper.js +2 -2
  144. package/components/selection/README.md +1 -1
  145. package/components/selection/demo/demo-selection.js +1 -1
  146. package/components/selection/selection-action-dropdown.js +2 -2
  147. package/components/selection/selection-action-menu-item.js +1 -1
  148. package/components/selection/selection-action.js +2 -2
  149. package/components/selection/selection-input.js +3 -3
  150. package/components/selection/selection-select-all-pages.js +1 -1
  151. package/components/selection/selection-select-all.js +2 -2
  152. package/components/selection/selection-summary.js +1 -1
  153. package/components/skeleton/demo/skeleton-test-box.js +1 -1
  154. package/components/skeleton/demo/skeleton-test-container.js +1 -1
  155. package/components/skeleton/demo/skeleton-test-heading.js +1 -1
  156. package/components/skeleton/demo/skeleton-test-link.js +2 -2
  157. package/components/skeleton/demo/skeleton-test-paragraph.js +2 -2
  158. package/components/skeleton/demo/skeleton-test-stack.js +1 -1
  159. package/components/skeleton/demo/skeleton-test-width.js +1 -1
  160. package/components/skeleton/skeleton-mixin.js +1 -1
  161. package/components/status-indicator/status-indicator.js +1 -1
  162. package/components/switch/switch-mixin.js +2 -2
  163. package/components/switch/switch-visibility.js +1 -1
  164. package/components/switch/switch.js +1 -1
  165. package/components/table/README.md +3 -3
  166. package/components/table/demo/table-test.js +1 -1
  167. package/components/table/table-col-sort-button.js +1 -1
  168. package/components/table/table-wrapper.js +1 -1
  169. package/components/tabs/tab-internal.js +1 -1
  170. package/components/tabs/tab-panel-mixin.js +1 -1
  171. package/components/tabs/tab-panel.js +1 -1
  172. package/components/tabs/tabs.js +4 -4
  173. package/components/tag-list/README.md +52 -0
  174. package/components/tag-list/demo/tag-list.html +32 -0
  175. package/components/tag-list/tag-list-item-mixin.js +78 -0
  176. package/components/tag-list/tag-list-item.js +21 -0
  177. package/components/tag-list/tag-list.js +89 -0
  178. package/components/tooltip/tooltip.js +2 -2
  179. package/components/typography/styles.js +1 -1
  180. package/components/validation/validation-custom.js +1 -1
  181. package/custom-elements.json +78 -0
  182. package/directives/animate/animate.js +3 -3
  183. package/directives/animate/demo/animate-test.js +1 -1
  184. package/directives/run-async/run-async.js +4 -4
  185. package/helpers/demo/announce-test.js +1 -1
  186. package/helpers/demo/dismissible-test.js +1 -1
  187. package/mixins/arrow-keys-mixin.js +1 -1
  188. package/mixins/async-container/demo/async-container.js +1 -1
  189. package/mixins/async-container/demo/async-item.js +1 -1
  190. package/mixins/demo/arrow-keys-test.js +1 -1
  191. package/mixins/demo/labelled-mixin.html +2 -2
  192. package/mixins/demo/localize-test.js +1 -1
  193. package/mixins/visible-on-ancestor-mixin.js +1 -1
  194. package/package.json +2 -3
  195. package/templates/primary-secondary/primary-secondary.js +4 -4
@@ -1,5 +1,5 @@
1
1
  import '../button/button-subtle.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
+ import { css, html, LitElement } from 'lit';
3
3
  import { FocusMixin } from '../../mixins/focus-mixin.js';
4
4
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
5
5
  import { SelectionInfo } from './selection-mixin.js';
@@ -1,7 +1,7 @@
1
1
  import '../inputs/input-checkbox.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
+ import { css, html, LitElement } from 'lit';
3
3
  import { FocusMixin } from '../../mixins/focus-mixin.js';
4
- import { ifDefined } from 'lit-html/directives/if-defined.js';
4
+ import { ifDefined } from 'lit/directives/if-defined.js';
5
5
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
6
6
  import { SelectionInfo } from './selection-mixin.js';
7
7
  import { SelectionObserverMixin } from './selection-observer-mixin.js';
@@ -1,4 +1,4 @@
1
- import { css, html, LitElement } from 'lit-element/lit-element.js';
1
+ import { css, html, LitElement } from 'lit';
2
2
  import { bodyCompactStyles } from '../typography/styles.js';
3
3
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
4
4
  import { SelectionInfo } from './selection-mixin.js';
@@ -1,5 +1,5 @@
1
1
  import '../../colors/colors.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
+ import { css, html, LitElement } from 'lit';
3
3
  import { SkeletonMixin } from '../skeleton-mixin.js';
4
4
 
5
5
  export class SkeletonTestBox extends SkeletonMixin(LitElement) {
@@ -1,6 +1,6 @@
1
1
  import '../../colors/colors.js';
2
2
  import '../../inputs/input-checkbox.js';
3
- import { css, html, LitElement } from 'lit-element/lit-element.js';
3
+ import { css, html, LitElement } from 'lit';
4
4
  import { bodyCompactStyles } from '../../typography/styles.js';
5
5
  import { SkeletonMixin } from '../skeleton-mixin.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import { css, html, LitElement } from 'lit-element/lit-element.js';
1
+ import { css, html, LitElement } from 'lit';
2
2
  import { heading1Styles, heading2Styles, heading3Styles, heading4Styles } from '../../typography/styles.js';
3
3
  import { SkeletonMixin } from '../skeleton-mixin.js';
4
4
 
@@ -1,5 +1,5 @@
1
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
- import { classMap } from 'lit-html/directives/class-map.js';
1
+ import { css, html, LitElement } from 'lit';
2
+ import { classMap } from 'lit/directives/class-map.js';
3
3
  import { linkStyles } from '../../link/link.js';
4
4
  import { SkeletonMixin } from '../skeleton-mixin.js';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { bodyCompactStyles, bodySmallStyles, bodyStandardStyles, labelStyles } from '../../typography/styles.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
3
- import { classMap } from 'lit-html/directives/class-map.js';
2
+ import { css, html, LitElement } from 'lit';
3
+ import { classMap } from 'lit/directives/class-map.js';
4
4
  import { SkeletonMixin } from '../skeleton-mixin.js';
5
5
 
6
6
  export class SkeletonTestParagraph extends SkeletonMixin(LitElement) {
@@ -1,5 +1,5 @@
1
1
  import '../../colors/colors.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
+ import { css, html, LitElement } from 'lit';
3
3
  import { SkeletonMixin } from '../skeleton-mixin.js';
4
4
 
5
5
  export class SkeletonTestStack extends SkeletonMixin(LitElement) {
@@ -1,4 +1,4 @@
1
- import { css, html, LitElement } from 'lit-element/lit-element.js';
1
+ import { css, html, LitElement } from 'lit';
2
2
  import { SkeletonMixin } from '../skeleton-mixin.js';
3
3
 
4
4
  export class SkeletonTestWidth extends SkeletonMixin(LitElement) {
@@ -1,5 +1,5 @@
1
1
  import '../colors/colors.js';
2
- import { css } from 'lit-element/lit-element.js';
2
+ import { css } from 'lit';
3
3
  import { dedupeMixin } from '@open-wc/dedupe-mixin';
4
4
  import { RtlMixin } from '../../mixins/rtl-mixin.js';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import '../colors/colors.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
+ import { css, html, LitElement } from 'lit';
3
3
 
4
4
  /**
5
5
  * A component for communicating the status of an item. It is non-interactive and used to assert prominence on state.
@@ -1,10 +1,10 @@
1
1
  import '../colors/colors.js';
2
2
  import '../tooltip/tooltip.js';
3
- import { css, html } from 'lit-element/lit-element.js';
3
+ import { css, html } from 'lit';
4
4
  import { FocusMixin } from '../../mixins/focus-mixin.js';
5
5
  import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
6
6
  import { getUniqueId } from '../../helpers/uniqueId.js';
7
- import { ifDefined } from 'lit-html/directives/if-defined.js';
7
+ import { ifDefined } from 'lit/directives/if-defined.js';
8
8
  import { RtlMixin } from '../../mixins/rtl-mixin.js';
9
9
 
10
10
  export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(FocusVisiblePolyfillMixin(superclass))) {
@@ -1,5 +1,5 @@
1
1
  import '../icons/icon.js';
2
- import { html, LitElement } from 'lit-element/lit-element.js';
2
+ import { html, LitElement } from 'lit';
3
3
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
4
4
  import { SwitchMixin } from './switch-mixin.js';
5
5
 
@@ -1,7 +1,7 @@
1
1
  import '../colors/colors.js';
2
2
  import '../icons/icon.js';
3
3
  import '../icons/icon-custom.js';
4
- import { html, LitElement } from 'lit-element/lit-element.js';
4
+ import { html, LitElement } from 'lit';
5
5
  import { SwitchMixin } from './switch-mixin.js';
6
6
 
7
7
  /**
@@ -51,7 +51,7 @@ The `d2l-table-wrapper` element can be combined with table styles to apply defau
51
51
  <!-- docs: demo live name:d2l-test-table display:block -->
52
52
  ```html
53
53
  <script type="module">
54
- import { html, LitElement } from 'lit-element/lit-element.js';
54
+ import { html, LitElement } from 'lit';
55
55
  import { tableStyles } from '@brightspace-ui/core/components/table/table-wrapper.js';
56
56
 
57
57
  const fruits = ['Apples', 'Oranges', 'Bananas'];
@@ -157,7 +157,7 @@ When tabular data can be sorted, the `<d2l-table-col-sort-button>` can be used t
157
157
  ```html
158
158
  <script type="module">
159
159
  import '@brightspace-ui/core/components/table/table-col-sort-button.js';
160
- import { html, LitElement } from 'lit-element/lit-element.js';
160
+ import { html, LitElement } from 'lit';
161
161
  import { tableStyles } from '@brightspace-ui/core/components/table/table-wrapper.js';
162
162
 
163
163
  class MySortableTableElem extends LitElement {
@@ -257,7 +257,7 @@ If your table supports row selection, apply the `selected` attribute to `<tr>` r
257
257
  <!-- docs: demo -->
258
258
  ```html
259
259
  <script type="module">
260
- import { html, LitElement } from 'lit-element/lit-element.js';
260
+ import { html, LitElement } from 'lit';
261
261
  import { tableStyles } from '@brightspace-ui/core/components/table/table-wrapper.js';
262
262
 
263
263
  class MySelectableTableElem extends LitElement {
@@ -1,5 +1,5 @@
1
1
  import '../table-col-sort-button.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
+ import { css, html, LitElement } from 'lit';
3
3
  import { RtlMixin } from '../../../mixins/rtl-mixin.js';
4
4
  import { tableStyles } from '../table-wrapper.js';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import '../icons/icon.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
+ import { css, html, LitElement } from 'lit';
3
3
  import { FocusMixin } from '../../mixins/focus-mixin.js';
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import '../colors/colors.js';
2
2
  import '../scroll-wrapper/scroll-wrapper.js';
3
- import { css, html, LitElement } from 'lit-element/lit-element.js';
3
+ import { css, html, LitElement } from 'lit';
4
4
  import { RtlMixin } from '../../mixins/rtl-mixin.js';
5
5
 
6
6
  export const tableStyles = css`
@@ -1,5 +1,5 @@
1
1
  import '../colors/colors.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
+ import { css, html, LitElement } from 'lit';
3
3
  import { RtlMixin } from '../../mixins/rtl-mixin.js';
4
4
 
5
5
  const keyCodes = {
@@ -1,4 +1,4 @@
1
- import { css } from 'lit-element/lit-element.js';
1
+ import { css } from 'lit';
2
2
  import { getUniqueId } from '../../helpers/uniqueId.js';
3
3
 
4
4
  export const TabPanelMixin = superclass => class extends superclass {
@@ -1,4 +1,4 @@
1
- import { html, LitElement } from 'lit-element/lit-element.js';
1
+ import { html, LitElement } from 'lit';
2
2
  import { TabPanelMixin } from './tab-panel-mixin.js';
3
3
 
4
4
  /**
@@ -2,17 +2,17 @@ import '../colors/colors.js';
2
2
  import '../icons/icon.js';
3
3
  import '../../helpers/queueMicrotask.js';
4
4
  import './tab-internal.js';
5
- import { css, html, LitElement } from 'lit-element/lit-element.js';
5
+ import { css, html, LitElement } from 'lit';
6
6
  import { cssEscape, findComposedAncestor } from '../../helpers/dom.js';
7
7
  import { ArrowKeysMixin } from '../../mixins/arrow-keys-mixin.js';
8
8
  import { bodyCompactStyles } from '../typography/styles.js';
9
- import { classMap } from 'lit-html/directives/class-map.js';
9
+ import { classMap } from 'lit/directives/class-map.js';
10
10
  import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
11
11
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
12
- import { repeat } from 'lit-html/directives/repeat.js';
12
+ import { repeat } from 'lit/directives/repeat.js';
13
13
  import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
14
14
  import { RtlMixin } from '../../mixins/rtl-mixin.js';
15
- import { styleMap } from 'lit-html/directives/style-map.js';
15
+ import { styleMap } from 'lit/directives/style-map.js';
16
16
 
17
17
  const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
18
18
 
@@ -0,0 +1,52 @@
1
+
2
+ # Tag List
3
+ *This component is in progress and the api is not yet stable.*
4
+
5
+ Tag lists are used to present a list of compact, discrete pieces of information.
6
+
7
+ <!-- docs: demo display:block -->
8
+ ```html
9
+ <script type="module">
10
+ import '@brightspace-ui/core/components/tag-list/tag-list.js';
11
+ import '@brightspace-ui/core/components/tag-list/tag-list-item.js';
12
+ </script>
13
+
14
+ <d2l-tag-list description="Example Tags">
15
+ <d2l-tag-list-item text="Tag"></d2l-tag-list-item>
16
+ <d2l-tag-list-item text="Another Tag"></d2l-tag-list-item>
17
+ <d2l-tag-list-item text="A Third Very Very Very Long Tag"></d2l-tag-list-item>
18
+ </d2l-tag-list>
19
+ ```
20
+
21
+ ## Tag List [d2l-tag-list]
22
+
23
+ The `d2l-tag-list` element can take a combination of any type of `d2l-tag-list-item` and adds the appropriate keyboard navigation, list semantics, clearing behaviour and responsive behaviour.
24
+
25
+ <!-- docs: demo live name:d2l-tag-list display:block -->
26
+ ```html
27
+ <script type="module">
28
+ import '@brightspace-ui/core/components/tag-list/tag-list.js';
29
+ import '@brightspace-ui/core/components/tag-list/tag-list-item.js';
30
+ </script>
31
+
32
+ <d2l-tag-list description="Example Tags">
33
+ <d2l-tag-list-item text="Tag"></d2l-tag-list-item>
34
+ <d2l-tag-list-item text="Another Tag"></d2l-tag-list-item>
35
+ <d2l-tag-list-item text="A Third Very Very Very Long Tag"></d2l-tag-list-item>
36
+ </d2l-tag-list>
37
+ ```
38
+
39
+ ## Tag List Item [d2l-tag-list-item]
40
+ The `d2l-tag-list-item` provides the appropriate `listitem` semantics and styling for children within a tag list. Tag List items do not work outside of a Tag List and should not be used on their own.
41
+
42
+ <!-- docs: demo live name:d2l-tag-list-item display:block -->
43
+ ```html
44
+ <script type="module">
45
+ import '@brightspace-ui/core/components/tag-list/tag-list.js';
46
+ import '@brightspace-ui/core/components/tag-list/tag-list-item.js';
47
+ </script>
48
+
49
+ <d2l-tag-list description="Example Tags">
50
+ <d2l-tag-list-item text="Tag"></d2l-tag-list-item>
51
+ </d2l-tag-list>
52
+ ```
@@ -0,0 +1,32 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
+ <meta charset="UTF-8">
6
+ <link rel="stylesheet" href="../../demo/styles.css" type="text/css">
7
+ <script type="module">
8
+ import '../../demo/demo-page.js';
9
+ import '../tag-list.js';
10
+ import '../tag-list-item.js';
11
+ import '../test/tag-list-item-mixin-consumer.js';
12
+ </script>
13
+ </head>
14
+ <body unresolved>
15
+ <d2l-demo-page page-title="d2l-tag-list">
16
+
17
+ <h2>Basic Tag List</h2>
18
+ <d2l-demo-snippet fullscreen>
19
+ <d2l-tag-list description="A bunch of example tags">
20
+ <d2l-tag-list-item text="Example Tag"></d2l-tag-list-item>
21
+ <d2l-tag-list-item text="Longer Example Tag - much much much much much longer"></d2l-tag-list-item>
22
+ <d2l-tag-list-item text="Another Example Tag"></d2l-tag-list-item>
23
+ <d2l-tag-list-item-mixin-consumer name="Custom Tag List Item"></d2l-tag-list-item-mixin-consumer>
24
+ <d2l-tag-list-item text="Example Tag 5"></d2l-tag-list-item>
25
+ <d2l-tag-list-item text="Example Tag 6"></d2l-tag-list-item>
26
+ <d2l-tag-list-item text="Example Tag 7"></d2l-tag-list-item>
27
+ </d2l-tag-list>
28
+ </d2l-demo-snippet>
29
+
30
+ </d2l-demo-page>
31
+ </body>
32
+ </html>
@@ -0,0 +1,78 @@
1
+ import '../colors/colors.js';
2
+ import { css, html } from 'lit';
3
+ import { labelStyles } from '../typography/styles.js';
4
+
5
+ export const TagListItemMixin = superclass => class extends superclass {
6
+
7
+ static get properties() {
8
+ return {
9
+ /**
10
+ * @ignore
11
+ */
12
+ role: { type: String, reflect: true }
13
+ };
14
+ }
15
+
16
+ static get styles() {
17
+ return [labelStyles, css`
18
+ :host {
19
+ display: grid;
20
+ outline: none;
21
+ }
22
+ :host([hidden]) {
23
+ display: none;
24
+ }
25
+ .tag-list-item-content {
26
+ height: 1rem;
27
+ margin: auto;
28
+ min-width: 0;
29
+ overflow: hidden;
30
+ text-overflow: ellipsis;
31
+ white-space: nowrap;
32
+ }
33
+ .tag-list-item-container {
34
+ background-color: var(--d2l-color-regolith);
35
+ border-radius: 6px;
36
+ box-shadow: inset 0 0 0 1px var(--d2l-color-gypsum), 0 2px 4px rgba(0, 0, 0, 0.03);
37
+ box-sizing: border-box;
38
+ color: var(--d2l-color-ferrite);
39
+ cursor: pointer;
40
+ display: flex;
41
+ min-width: 0;
42
+ padding: 0.25rem 0.6rem;
43
+ transition: background-color 0.2s ease-out, box-shadow 0.2s ease-out;
44
+ }
45
+ :host(:hover) .tag-list-item-container,
46
+ :host(:focus) .tag-list-item-container {
47
+ background-color: var(--d2l-color-sylvite);
48
+ }
49
+ :host(:hover) .tag-list-item-container {
50
+ box-shadow: inset 0 0 0 1px var(--d2l-color-mica), 0 2px 4px rgba(0, 0, 0, 0.03);
51
+ }
52
+ :host(:focus) .tag-list-item-container {
53
+ box-shadow: inset 0 0 0 2px var(--d2l-color-celestine), 0 2px 4px rgba(0, 0, 0, 0.03);
54
+ }
55
+
56
+ @media (prefers-reduced-motion: reduce) {
57
+ .tag-list-item-container {
58
+ transition: none;
59
+ }
60
+ }
61
+ `];
62
+ }
63
+
64
+ constructor() {
65
+ super();
66
+ /** @ignore */
67
+ this.role = 'listitem';
68
+ }
69
+
70
+ _renderTag(tagContent) {
71
+ return html`
72
+ <div class="tag-list-item-container d2l-label-text">
73
+ <div class="tag-list-item-content">${tagContent}</div>
74
+ </div>
75
+ `;
76
+ }
77
+
78
+ };
@@ -0,0 +1,21 @@
1
+ import { LitElement } from 'lit';
2
+ import { TagListItemMixin } from './tag-list-item-mixin.js';
3
+
4
+ class TagListItem extends TagListItemMixin(LitElement) {
5
+
6
+ static get properties() {
7
+ return {
8
+ /**
9
+ * REQUIRED: Text to display
10
+ * @type {string}
11
+ */
12
+ text: { type: String }
13
+ };
14
+ }
15
+
16
+ render() {
17
+ return this._renderTag(this.text);
18
+ }
19
+ }
20
+
21
+ customElements.define('d2l-tag-list-item', TagListItem);
@@ -0,0 +1,89 @@
1
+ import { css, html, LitElement } from 'lit';
2
+ import { ArrowKeysMixin } from '../../mixins/arrow-keys-mixin.js';
3
+
4
+ class TagList extends ArrowKeysMixin(LitElement) {
5
+
6
+ static get properties() {
7
+ return {
8
+ /**
9
+ * REQUIRED: A description of the tag list for additional accessibility context
10
+ * @type {string}
11
+ */
12
+ description: { type: String }
13
+ };
14
+ }
15
+
16
+ static get styles() {
17
+ return css`
18
+ :host {
19
+ display: block;
20
+ }
21
+ :host([hidden]) {
22
+ display: none;
23
+ }
24
+ .tag-list-container {
25
+ display: flex;
26
+ flex-wrap: wrap;
27
+ margin: -6px -6px 0 0;
28
+ padding: 0;
29
+ position: relative;
30
+ }
31
+ ::slotted(*) {
32
+ margin: 6px 6px 0 0;
33
+ }
34
+ `;
35
+ }
36
+
37
+ constructor() {
38
+ super();
39
+ /** @ignore */
40
+ this.arrowKeysDirection = 'leftrightupdown';
41
+ this._items = [];
42
+ }
43
+
44
+ firstUpdated(changedProperties) {
45
+ super.firstUpdated(changedProperties);
46
+
47
+ requestAnimationFrame(() => {
48
+ this._items = this._getTagListItems();
49
+ this._items.forEach((item, index) => {
50
+ item.setAttribute('tabIndex', index === 0 ? 0 : -1);
51
+ });
52
+ });
53
+ }
54
+
55
+ render() {
56
+ const list = html`
57
+ <div role="list" class="tag-list-container" aria-describedby="d2l-tag-list-description">
58
+ <slot></slot>
59
+ </div>
60
+ `;
61
+ return html`
62
+ <div role="application">
63
+ ${this.arrowKeysContainer(list)}
64
+ <div id="d2l-tag-list-description" hidden>${this.description}</div>
65
+ </div>
66
+ `;
67
+ }
68
+
69
+ async arrowKeysFocusablesProvider() {
70
+ return this._items;
71
+ }
72
+
73
+ focus() {
74
+ if (this._items.length > 0) this._items[0].focus();
75
+ }
76
+
77
+ _getTagListItems() {
78
+ const slot = this.shadowRoot && this.shadowRoot.querySelector('slot');
79
+ if (!slot) return;
80
+ return slot.assignedNodes({ flatten: true }).filter((node) => {
81
+ if (node.nodeType !== Node.ELEMENT_NODE) return false;
82
+ const role = node.getAttribute('role');
83
+ return (role === 'listitem');
84
+ });
85
+ }
86
+
87
+ }
88
+
89
+ customElements.define('d2l-tag-list', TagList);
@@ -1,5 +1,5 @@
1
1
  import { clearDismissible, setDismissible } from '../../helpers/dismissible.js';
2
- import { css, html, LitElement } from 'lit-element/lit-element.js';
2
+ import { css, html, LitElement } from 'lit';
3
3
  import { cssEscape, elemIdListAdd, getBoundingAncestor, getOffsetParent } from '../../helpers/dom.js';
4
4
  import { announce } from '../../helpers/announce.js';
5
5
  import { bodySmallStyles } from '../typography/styles.js';
@@ -7,7 +7,7 @@ import { getUniqueId } from '../../helpers/uniqueId.js';
7
7
  import { isFocusable } from '../../helpers/focus.js';
8
8
  import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
9
9
  import { RtlMixin } from '../../mixins/rtl-mixin.js';
10
- import { styleMap } from 'lit-html/directives/style-map.js';
10
+ import { styleMap } from 'lit/directives/style-map.js';
11
11
 
12
12
  let logAccessibilityWarning = true;
13
13
 
@@ -1,4 +1,4 @@
1
- import { css } from 'lit-element/lit-element.js';
1
+ import { css } from 'lit';
2
2
 
3
3
  export const bodyStandardStyles = css`
4
4
  .d2l-body-standard {
@@ -1,5 +1,5 @@
1
1
 
2
- import { LitElement } from 'lit-element/lit-element.js';
2
+ import { LitElement } from 'lit';
3
3
  import { ValidationCustomMixin } from './validation-custom-mixin.js';
4
4
 
5
5
  class ValidationCustom extends ValidationCustomMixin(LitElement) {
@@ -457,6 +457,12 @@
457
457
  "type": "boolean",
458
458
  "default": "false"
459
459
  },
460
+ {
461
+ "name": "slim",
462
+ "description": "Whether to render the slimmer version of the button",
463
+ "type": "boolean",
464
+ "default": "false"
465
+ },
460
466
  {
461
467
  "name": "disabled-tooltip",
462
468
  "description": "Tooltip text when disabled",
@@ -501,6 +507,13 @@
501
507
  "type": "boolean",
502
508
  "default": "false"
503
509
  },
510
+ {
511
+ "name": "slim",
512
+ "attribute": "slim",
513
+ "description": "Whether to render the slimmer version of the button",
514
+ "type": "boolean",
515
+ "default": "false"
516
+ },
504
517
  {
505
518
  "name": "disabledTooltip",
506
519
  "attribute": "disabled-tooltip",
@@ -9766,6 +9779,71 @@
9766
9779
  }
9767
9780
  ]
9768
9781
  },
9782
+ {
9783
+ "name": "d2l-tag-list-item",
9784
+ "path": "./components/tag-list/tag-list-item.js",
9785
+ "attributes": [
9786
+ {
9787
+ "name": "text",
9788
+ "description": "REQUIRED: Text to display",
9789
+ "type": "string"
9790
+ }
9791
+ ],
9792
+ "properties": [
9793
+ {
9794
+ "name": "text",
9795
+ "attribute": "text",
9796
+ "description": "REQUIRED: Text to display",
9797
+ "type": "string"
9798
+ }
9799
+ ]
9800
+ },
9801
+ {
9802
+ "name": "d2l-tag-list",
9803
+ "path": "./components/tag-list/tag-list.js",
9804
+ "attributes": [
9805
+ {
9806
+ "name": "description",
9807
+ "description": "REQUIRED: A description of the tag list for additional accessibility context",
9808
+ "type": "string"
9809
+ }
9810
+ ],
9811
+ "properties": [
9812
+ {
9813
+ "name": "description",
9814
+ "attribute": "description",
9815
+ "description": "REQUIRED: A description of the tag list for additional accessibility context",
9816
+ "type": "string"
9817
+ },
9818
+ {
9819
+ "name": "arrowKeysDirection",
9820
+ "type": "string",
9821
+ "default": "\"leftright\""
9822
+ },
9823
+ {
9824
+ "name": "arrowKeysNoWrap",
9825
+ "type": "boolean",
9826
+ "default": "false"
9827
+ }
9828
+ ]
9829
+ },
9830
+ {
9831
+ "name": "d2l-tag-list-item-mixin-consumer",
9832
+ "path": "./components/tag-list/test/tag-list-item-mixin-consumer.js",
9833
+ "attributes": [
9834
+ {
9835
+ "name": "name",
9836
+ "type": "string"
9837
+ }
9838
+ ],
9839
+ "properties": [
9840
+ {
9841
+ "name": "name",
9842
+ "attribute": "name",
9843
+ "type": "string"
9844
+ }
9845
+ ]
9846
+ },
9769
9847
  {
9770
9848
  "name": "d2l-tooltip",
9771
9849
  "path": "./components/tooltip/tooltip.js",
@@ -1,8 +1,8 @@
1
- import { directive, PartType } from 'lit-html/directive.js';
1
+ import { directive, PartType } from 'lit/directive.js';
2
2
  import { getComposedActiveElement, getNextFocusable } from '../../helpers/focus.js';
3
- import { AsyncDirective } from 'lit-html/async-directive.js';
3
+ import { AsyncDirective } from 'lit/async-directive.js';
4
4
  import { isComposedAncestor } from '../../helpers/dom.js';
5
- import { noChange } from 'lit-html';
5
+ import { noChange } from 'lit';
6
6
 
7
7
  const stateMap = new WeakMap();
8
8
  const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;