@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
@@ -21,8 +21,7 @@ The `d2l-hierarchical-view` component uses the `d2l-hierarchical-view-mixin` for
21
21
  this.showParentView = this.showParentView.bind(this);
22
22
  }
23
23
  // <!-- docs: start hidden content -->
24
- static get styles() {
25
- return [css`
24
+ static styles = [css`
26
25
  #view1 {
27
26
  width: 100%;
28
27
  }
@@ -74,8 +73,8 @@ The `d2l-hierarchical-view` component uses the `d2l-hierarchical-view-mixin` for
74
73
  .position-display {
75
74
  display: flex;
76
75
  justify-content: space-evenly;
77
- }`];
78
- }
76
+ }
77
+ `];
79
78
 
80
79
  // <!-- docs: end hidden content -->
81
80
  showSubView(id) {
@@ -208,13 +207,11 @@ This mixin allows for nested views within components. To use, apply the mixin an
208
207
  ```js
209
208
  import { HierarchicalViewMixin } from '@brightspace-ui/core/components/hierarchical-view/hierarchical-view-mixin.js';
210
209
  class MyComponent extends HierarchicalViewMixin(LitElement) {
211
- static get styles() {
212
- return [ super.styles, css`
213
- :host {
214
- display: inline-block;
215
- }
216
- `];
217
- }
210
+ static styles = [super.styles, css`
211
+ :host {
212
+ display: inline-block;
213
+ }
214
+ `];
218
215
 
219
216
  render() {
220
217
  return html`
@@ -10,9 +10,8 @@ A Select List allows the user to select a single option out of a relatively larg
10
10
 
11
11
  class MySelectElem extends LitElement {
12
12
 
13
- static get styles() {
14
- return selectStyles;
15
- }
13
+ static styles = selectStyles;
14
+
16
15
  render() {
17
16
  return html`
18
17
  <select class="d2l-input-select" aria-label="Options">
@@ -61,9 +60,7 @@ When applying styles to the native element, we also recommend using the [`Skelet
61
60
  import { SkeletonMixin } from '@brightspace-ui/core/components/skeleton/skeleton-mixin.js';
62
61
 
63
62
  class TestInputSelect extends SkeletonMixin(LitElement) {
64
- static get styles() {
65
- return [super.styles, selectStyles];
66
- }
63
+ static styles = [super.styles, selectStyles];
67
64
 
68
65
  render() {
69
66
  return html`
@@ -100,9 +97,7 @@ For a visible label, import the label styles and include them in your component'
100
97
 
101
98
  class TestInputSelect extends LitElement {
102
99
 
103
- static get styles() {
104
- return [inputLabelStyles, selectStyles];
105
- }
100
+ static styles = [inputLabelStyles, selectStyles];
106
101
 
107
102
  render() {
108
103
  return html`
@@ -16,9 +16,7 @@ Import `input-checkbox-styles.js` and apply the `d2l-input-checkbox` CSS class t
16
16
 
17
17
  class MyCheckboxElem extends LitElement {
18
18
 
19
- static get styles() {
20
- return checkboxStyles;
21
- }
19
+ static styles = checkboxStyles;
22
20
 
23
21
  render() {
24
22
  return html`<input type="checkbox" class="d2l-input-checkbox">`;
@@ -46,9 +44,7 @@ For disabled items, add the `d2l-input-radio-label-disabled` class on the label
46
44
 
47
45
  class MyRadioElem extends LitElement {
48
46
 
49
- static get styles() {
50
- return radioStyles;
51
- }
47
+ static styles = radioStyles;
52
48
 
53
49
  render() {
54
50
  return html`
@@ -85,17 +81,13 @@ If you'd like to manually link the radio input with a label, or use an ARIA labe
85
81
 
86
82
  class MyRadioElem extends LitElement {
87
83
 
88
- static get properties() {
89
- return {
90
- checked: { type: Boolean },
91
- disabled: { type: Boolean },
92
- invalid: { type: Boolean }
93
- };
94
- }
84
+ static properties = {
85
+ checked: { type: Boolean },
86
+ disabled: { type: Boolean },
87
+ invalid: { type: Boolean }
88
+ };
95
89
 
96
- static get styles() {
97
- return radioStyles;
98
- }
90
+ static styles = radioStyles;
99
91
 
100
92
  render() {
101
93
  const invalid = this.invalid ? 'true' : 'false';
@@ -130,9 +122,7 @@ To align related content below radio buttons, the `d2l-input-radio-spacer` eleme
130
122
 
131
123
  class MyRadioElem extends LitElement {
132
124
 
133
- static get styles() {
134
- return [ radioStyles, inlineHelpStyles ];
135
- }
125
+ static styles = [ radioStyles, inlineHelpStyles ];
136
126
 
137
127
  render() {
138
128
  return html`
@@ -164,9 +154,7 @@ Import `input-styles.js` and apply the `d2l-input` CSS class to the native `<inp
164
154
 
165
155
  class MyTextInputElem extends LitElement {
166
156
 
167
- static get styles() {
168
- return inputStyles;
169
- }
157
+ static styles = inputStyles;
170
158
 
171
159
  render() {
172
160
  return html`<input type="text" class="d2l-input">`;
@@ -189,9 +177,7 @@ Import `input-styles.js` and apply the `d2l-input` CSS class to the native `<te
189
177
  import { inputStyles } from '@brightspace-ui/core/components/inputs/input-styles.js';
190
178
 
191
179
  class MyTextareaInputElem extends LitElement {
192
- static get styles() {
193
- return inputStyles;
194
- }
180
+ static styles = inputStyles;
195
181
  render() {
196
182
  return html`
197
183
  <textarea class="d2l-input">
@@ -70,7 +70,7 @@ Alternately, you can apply link styles to a native `<a>` element by importing th
70
70
 
71
71
  class MyLinkElem extends LitElement {
72
72
 
73
- static get styles() { return [ linkStyles ] }
73
+ static styles = [ linkStyles ];
74
74
 
75
75
  render() {
76
76
  return html`
@@ -403,11 +403,9 @@ If an item is draggable, the `drag-handle-text` attribute should be used to prov
403
403
  import { css, html, LitElement } from 'lit';
404
404
 
405
405
  class ListDemoDragAndDropUsage extends LitElement {
406
- static get properties() {
407
- return {
408
- list: { type: Array }
409
- };
410
- }
406
+ static properties = {
407
+ list: { type: Array }
408
+ };
411
409
 
412
410
  constructor() {
413
411
  super();
@@ -467,15 +465,11 @@ These scenarios can be seen in the demo below.
467
465
  import { labelStyles } from '@brightspace-ui/core/components/typography/styles.js';
468
466
 
469
467
  class ListDemoDragAndDropInteractiveUsage extends LitElement {
470
- static get properties() {
471
- return {
472
- list: { type: Array }
473
- };
474
- }
468
+ static properties = {
469
+ list: { type: Array }
470
+ };
475
471
 
476
- static get styles() {
477
- return labelStyles;
478
- }
472
+ static styles = labelStyles;
479
473
 
480
474
  constructor() {
481
475
  super();
@@ -1058,9 +1052,7 @@ class ListItem extends ListItemMixin(LitElement) {
1058
1052
 
1059
1053
  How add the styles:
1060
1054
  ```javascript
1061
- static get styles() {
1062
- return [ super.styles ];
1063
- }
1055
+ static styles = [super.styles];
1064
1056
  ```
1065
1057
 
1066
1058
  How to render the list item:
@@ -9,9 +9,7 @@ import { menuItemSelectableStyles } from './menu-item-selectable-styles.js';
9
9
  */
10
10
  class MenuItemCheckbox extends MenuItemSelectableMixin(LitElement) {
11
11
 
12
- static get styles() {
13
- return menuItemSelectableStyles;
14
- }
12
+ static styles = menuItemSelectableStyles;
15
13
 
16
14
  constructor() {
17
15
  super();
@@ -10,43 +10,37 @@ import { menuItemStyles } from './menu-item-styles.js';
10
10
  */
11
11
  class MenuItemLink extends LinkMixin(MenuItemMixin(LitElement)) {
12
12
 
13
- static get properties() {
14
- return {
15
- _ariaDescription: { type: String, attribute: 'aria-description', reflect: true },
16
- };
17
- }
13
+ static properties = {
14
+ _ariaDescription: { type: String, attribute: 'aria-description', reflect: true },
15
+ };
18
16
 
19
- static get styles() {
20
- return [ super.styles, menuItemStyles,
21
- css`
22
- :host {
23
- display: block;
24
- padding: 0;
25
- }
17
+ static styles = [super.styles, menuItemStyles, css`
18
+ :host {
19
+ display: block;
20
+ padding: 0;
21
+ }
26
22
 
27
- :host > a {
28
- align-items: center;
29
- color: inherit;
30
- display: flex;
31
- line-height: 1rem;
32
- outline: none;
33
- overflow-x: hidden;
34
- padding: 0.75rem 1rem;
35
- text-decoration: none;
36
- }
23
+ :host > a {
24
+ align-items: center;
25
+ color: inherit;
26
+ display: flex;
27
+ line-height: 1rem;
28
+ outline: none;
29
+ overflow-x: hidden;
30
+ padding: 0.75rem 1rem;
31
+ text-decoration: none;
32
+ }
37
33
 
38
- :host([target="_blank"]) .d2l-menu-item-text {
39
- align-self: baseline;
40
- flex: 0 1 auto;
41
- }
34
+ :host([target="_blank"]) .d2l-menu-item-text {
35
+ align-self: baseline;
36
+ flex: 0 1 auto;
37
+ }
42
38
 
43
- #new-window {
44
- align-self: baseline;
45
- flex: auto;
46
- }
47
- `
48
- ];
49
- }
39
+ #new-window {
40
+ align-self: baseline;
41
+ flex: auto;
42
+ }
43
+ `];
50
44
 
51
45
  constructor() {
52
46
  super();
@@ -4,60 +4,58 @@ const defaultLines = 2;
4
4
 
5
5
  export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(superclass) {
6
6
 
7
- static get properties() {
8
- return {
9
- /**
10
- * Disables the menu item
11
- * @type {boolean}
12
- */
13
- disabled: { type: Boolean, reflect: true },
14
- /**
15
- * @ignore
16
- */
17
- first: { type: Boolean, reflect: true }, // set by d2l-menu
18
- /**
19
- * @ignore
20
- */
21
- hasChildView: { type: Boolean },
22
- /**
23
- * @ignore
24
- */
25
- // eslint-disable-next-line lit/no-native-attributes
26
- hidden: { type: Boolean, reflect: true },
27
- /**
28
- * @ignore
29
- */
30
- last: { type: String, reflect: true }, // set by d2l-menu
31
- /**
32
- * The number of lines to display before truncating text with an ellipsis. Defaults to 2.
33
- * @type {number}
34
- */
35
- lines: { type: Number },
36
- /**
37
- * @ignore
38
- */
39
- // eslint-disable-next-line lit/no-native-attributes
40
- role: { type: String, reflect: true },
41
- /**
42
- * @ignore
43
- */
44
- // eslint-disable-next-line lit/no-native-attributes
45
- tabindex: { type: String, reflect: true },
46
- /**
47
- * REQUIRED: Text displayed by the menu item
48
- * @type {string}
49
- */
50
- text: { type: String, required: true },
51
- /**
52
- * ACCESSIBILITY: A description of the menu item that will be used by screen readers for additional context
53
- * @type {string}
54
- */
55
- description: { type: String },
56
- _ariaDisabled: { type: String, attribute: 'aria-disabled', reflect: true },
57
- _ariaLabel: { type: String, attribute: 'aria-label', reflect: true },
58
- _letClickPropagate: { state: true }
59
- };
60
- }
7
+ static properties = {
8
+ /**
9
+ * Disables the menu item
10
+ * @type {boolean}
11
+ */
12
+ disabled: { type: Boolean, reflect: true },
13
+ /**
14
+ * @ignore
15
+ */
16
+ first: { type: Boolean, reflect: true }, // set by d2l-menu
17
+ /**
18
+ * @ignore
19
+ */
20
+ hasChildView: { type: Boolean },
21
+ /**
22
+ * @ignore
23
+ */
24
+ // eslint-disable-next-line lit/no-native-attributes
25
+ hidden: { type: Boolean, reflect: true },
26
+ /**
27
+ * @ignore
28
+ */
29
+ last: { type: String, reflect: true }, // set by d2l-menu
30
+ /**
31
+ * The number of lines to display before truncating text with an ellipsis. Defaults to 2.
32
+ * @type {number}
33
+ */
34
+ lines: { type: Number },
35
+ /**
36
+ * @ignore
37
+ */
38
+ // eslint-disable-next-line lit/no-native-attributes
39
+ role: { type: String, reflect: true },
40
+ /**
41
+ * @ignore
42
+ */
43
+ // eslint-disable-next-line lit/no-native-attributes
44
+ tabindex: { type: String, reflect: true },
45
+ /**
46
+ * REQUIRED: Text displayed by the menu item
47
+ * @type {string}
48
+ */
49
+ text: { type: String, required: true },
50
+ /**
51
+ * ACCESSIBILITY: A description of the menu item that will be used by screen readers for additional context
52
+ * @type {string}
53
+ */
54
+ description: { type: String },
55
+ _ariaDisabled: { type: String, attribute: 'aria-disabled', reflect: true },
56
+ _ariaLabel: { type: String, attribute: 'aria-label', reflect: true },
57
+ _letClickPropagate: { state: true }
58
+ };
61
59
 
62
60
  constructor() {
63
61
  super();
@@ -9,9 +9,7 @@ import { menuItemSelectableStyles } from './menu-item-selectable-styles.js';
9
9
  */
10
10
  export class MenuItemRadio extends MenuItemRadioMixin(LitElement) {
11
11
 
12
- static get styles() {
13
- return menuItemSelectableStyles;
14
- }
12
+ static styles = menuItemSelectableStyles;
15
13
 
16
14
  render() {
17
15
  return html`
@@ -7,28 +7,24 @@ import { overflowEllipsisDeclarations } from '../../helpers/overflow.js';
7
7
 
8
8
  class MenuItemReturn extends LocalizeCoreElement(MenuItemMixin(LitElement)) {
9
9
 
10
- static get styles() {
11
- return [ menuItemStyles,
12
- css`
13
- :host {
14
- display: flex;
15
- padding: 0.75rem 1rem;
16
- }
17
-
18
- span {
19
- flex: auto;
20
- line-height: 1rem;
21
- ${overflowEllipsisDeclarations}
22
- }
23
-
24
- d2l-icon {
25
- flex: none;
26
- margin-inline-end: 1rem;
27
- margin-top: 0.1rem;
28
- }
29
- `
30
- ];
31
- }
10
+ static styles = [menuItemStyles, css`
11
+ :host {
12
+ display: flex;
13
+ padding: 0.75rem 1rem;
14
+ }
15
+
16
+ span {
17
+ flex: auto;
18
+ line-height: 1rem;
19
+ ${overflowEllipsisDeclarations}
20
+ }
21
+
22
+ d2l-icon {
23
+ flex: none;
24
+ margin-inline-end: 1rem;
25
+ margin-top: 0.1rem;
26
+ }
27
+ `];
32
28
 
33
29
  constructor() {
34
30
  super();
@@ -2,20 +2,18 @@ import { MenuItemMixin } from './menu-item-mixin.js';
2
2
 
3
3
  export const MenuItemSelectableMixin = superclass => class extends MenuItemMixin(superclass) {
4
4
 
5
- static get properties() {
6
- return {
7
- /**
8
- * This will set the item to be selected by default
9
- * @type {boolean}
10
- */
11
- selected: { type: Boolean, reflect: true },
12
- /**
13
- * REQUIRED: The selectable item's value
14
- * @type {string}
15
- */
16
- value: { type: String }
17
- };
18
- }
5
+ static properties = {
6
+ /**
7
+ * This will set the item to be selected by default
8
+ * @type {boolean}
9
+ */
10
+ selected: { type: Boolean, reflect: true },
11
+ /**
12
+ * REQUIRED: The selectable item's value
13
+ * @type {string}
14
+ */
15
+ value: { type: String }
16
+ };
19
17
 
20
18
  constructor() {
21
19
  super();
@@ -5,17 +5,15 @@ import { css, LitElement } from 'lit';
5
5
  */
6
6
  class MenuItemSeparator extends LitElement {
7
7
 
8
- static get styles() {
9
- return css`
10
- :host {
11
- border-top: 1px solid var(--d2l-menu-separator-color);
12
- display: block;
13
- margin-top: -1px;
14
- position: relative;
15
- z-index: 1;
16
- }
17
- `;
18
- }
8
+ static styles = css`
9
+ :host {
10
+ border-top: 1px solid var(--d2l-menu-separator-color);
11
+ display: block;
12
+ margin-top: -1px;
13
+ position: relative;
14
+ z-index: 1;
15
+ }
16
+ `;
19
17
 
20
18
  firstUpdated(changedProperties) {
21
19
  super.firstUpdated(changedProperties);
@@ -10,21 +10,17 @@ import { menuItemStyles } from './menu-item-styles.js';
10
10
  */
11
11
  class MenuItem extends MenuItemMixin(LitElement) {
12
12
 
13
- static get styles() {
14
- return [ menuItemStyles,
15
- css`
16
- :host {
17
- align-items: center;
18
- display: flex;
19
- padding: 0.75rem 1rem;
20
- }
21
- d2l-icon {
22
- flex: none;
23
- margin-inline-start: 6px;
24
- }
25
- `
26
- ];
27
- }
13
+ static styles = [menuItemStyles, css`
14
+ :host {
15
+ align-items: center;
16
+ display: flex;
17
+ padding: 0.75rem 1rem;
18
+ }
19
+ d2l-icon {
20
+ flex: none;
21
+ margin-inline-start: 6px;
22
+ }
23
+ `];
28
24
 
29
25
  render() {
30
26
  const icon = this.hasChildView ?