@brightspace-ui/core 3.268.0 → 3.268.2

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 (108) 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/helpers/flags.js +7 -1
  95. package/mixins/arrow-keys/arrow-keys-mixin.js +10 -12
  96. package/mixins/async-container/async-container-mixin.js +10 -12
  97. package/mixins/collection/collection-mixin.js +7 -9
  98. package/mixins/interactive/interactive-mixin.js +10 -14
  99. package/mixins/labelled/README.md +3 -5
  100. package/mixins/labelled/labelled-mixin.js +26 -30
  101. package/mixins/provider/README.md +5 -7
  102. package/mixins/rtl/README.md +5 -7
  103. package/mixins/rtl/rtl-mixin.js +7 -9
  104. package/mixins/theme/theme-mixin.js +6 -8
  105. package/mixins/visible-on-ancestor/README.md +1 -3
  106. package/mixins/visible-on-ancestor/visible-on-ancestor-mixin.js +11 -13
  107. package/package.json +1 -1
  108. package/templates/primary-secondary/primary-secondary.js +373 -377
@@ -65,9 +65,7 @@ The `d2l-table-wrapper` element can be combined with table styles to apply defau
65
65
 
66
66
  class SampleTable extends LitElement {
67
67
 
68
- static get styles() {
69
- return tableStyles;
70
- }
68
+ static styles = tableStyles;
71
69
 
72
70
  render() {
73
71
  const type = this.type === 'light' ? 'light' : 'default';
@@ -147,15 +145,11 @@ For the example below:
147
145
 
148
146
  class MySortableTableElem extends LitElement {
149
147
 
150
- static get properties() {
151
- return {
152
- _sortDesc: { attribute: false, type: Boolean }
153
- };
154
- }
148
+ static properties = {
149
+ _sortDesc: { attribute: false, type: Boolean }
150
+ };
155
151
 
156
- static get styles() {
157
- return tableStyles;
158
- }
152
+ static styles = tableStyles;
159
153
 
160
154
  constructor() {
161
155
  super();
@@ -290,15 +284,11 @@ When a single column is responsible for sorting in multiple facets (e.g., first
290
284
  { firstname: 'Christopher', lastname: 'Martinez', grade: 83 }
291
285
  ];
292
286
  class MyComplexSortableTableElem extends LitElement {
293
- static get properties() {
294
- return {
295
- _desc: { state: true },
296
- _field: { state: true }
297
- };
298
- }
299
- static get styles() {
300
- return tableStyles;
301
- }
287
+ static properties = {
288
+ _desc: { state: true },
289
+ _field: { state: true }
290
+ };
291
+ static styles = tableStyles;
302
292
  constructor() {
303
293
  super();
304
294
  this._data = data();
@@ -382,16 +372,12 @@ To enable selection, add `d2l-selection-input` components in the selection colum
382
372
 
383
373
  class SampleTableWithSelectionInputs extends LitElement {
384
374
 
385
- static get properties() {
386
- return {
387
- selectionSingle: { type: Boolean, attribute: 'selection-single' },
388
- _data: { state: true }
389
- }
390
- }
375
+ static properties = {
376
+ selectionSingle: { type: Boolean, attribute: 'selection-single' },
377
+ _data: { state: true }
378
+ };
391
379
 
392
- static get styles() {
393
- return tableStyles;
394
- }
380
+ static styles = tableStyles;
395
381
 
396
382
  constructor() {
397
383
  super();
@@ -494,15 +480,11 @@ The `d2l-table-controls` component can be placed in the `d2l-table-wrapper`'s `c
494
480
 
495
481
  class SampleTableWithControls extends LitElement {
496
482
 
497
- static get properties() {
498
- return {
499
- _data: { state: true }
500
- }
501
- }
483
+ static properties = {
484
+ _data: { state: true }
485
+ };
502
486
 
503
- static get styles() {
504
- return tableStyles;
505
- }
487
+ static styles = tableStyles;
506
488
 
507
489
  constructor() {
508
490
  super();
@@ -39,38 +39,34 @@ const formatter = new Intl.NumberFormat('en-US');
39
39
 
40
40
  class TestTable extends DemoPassthroughMixin(TableWrapper, 'd2l-table-wrapper') {
41
41
 
42
- static get properties() {
43
- return {
44
- paging: { type: Boolean, reflect: true },
45
- multiLine: { type: Boolean, attribute: 'multi-line' },
46
- resetOnSort: { type: Boolean, attribute: 'reset-on-sort' },
47
- showButtons: { type: Boolean, attribute: 'show-buttons' },
48
- stickyControls: { attribute: 'sticky-controls', type: Boolean, reflect: true },
49
- visibleBackground: { attribute: 'visible-background', type: Boolean, reflect: true },
50
- _data: { state: true },
51
- _sortField: { state: true },
52
- _sortDesc: { state: true }
53
- };
54
- }
42
+ static properties = {
43
+ paging: { type: Boolean, reflect: true },
44
+ multiLine: { type: Boolean, attribute: 'multi-line' },
45
+ resetOnSort: { type: Boolean, attribute: 'reset-on-sort' },
46
+ showButtons: { type: Boolean, attribute: 'show-buttons' },
47
+ stickyControls: { attribute: 'sticky-controls', type: Boolean, reflect: true },
48
+ visibleBackground: { attribute: 'visible-background', type: Boolean, reflect: true },
49
+ _data: { state: true },
50
+ _sortField: { state: true },
51
+ _sortDesc: { state: true }
52
+ };
55
53
 
56
- static get styles() {
57
- return [tableStyles, css`
58
- :host {
59
- display: block;
60
- }
61
- :host([visible-background]) {
62
- --d2l-table-controls-background-color: #dddddd;
63
- }
64
- .d2l-table > * > tr > :has(d2l-button-icon),
65
- .d2l-table > * > tr > :has(d2l-dropdown-context-menu) {
66
- padding-block: 0;
67
- }
68
- .d2l-table > * > tr > :has(d2l-table-col-sort-button) d2l-button-icon,
69
- .d2l-table > * > tr > :has(d2l-table-col-sort-button) d2l-dropdown-context-menu {
70
- vertical-align: top;
71
- }
72
- `];
73
- }
54
+ static styles = [tableStyles, css`
55
+ :host {
56
+ display: block;
57
+ }
58
+ :host([visible-background]) {
59
+ --d2l-table-controls-background-color: #dddddd;
60
+ }
61
+ .d2l-table > * > tr > :has(d2l-button-icon),
62
+ .d2l-table > * > tr > :has(d2l-dropdown-context-menu) {
63
+ padding-block: 0;
64
+ }
65
+ .d2l-table > * > tr > :has(d2l-table-col-sort-button) d2l-button-icon,
66
+ .d2l-table > * > tr > :has(d2l-table-col-sort-button) d2l-dropdown-context-menu {
67
+ vertical-align: top;
68
+ }
69
+ `];
74
70
 
75
71
  constructor() {
76
72
  super();
@@ -11,9 +11,7 @@ import { menuItemSelectableStyles } from '../menu/menu-item-selectable-styles.js
11
11
  */
12
12
  class TableColSortButtonItem extends MenuItemRadioMixin(LitElement) {
13
13
 
14
- static get styles() {
15
- return menuItemSelectableStyles;
16
- }
14
+ static styles = menuItemSelectableStyles;
17
15
 
18
16
  firstUpdated() {
19
17
  super.firstUpdated();
@@ -19,115 +19,111 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
19
19
  */
20
20
  export class TableColSortButton extends LocalizeCoreElement(FocusMixin(LitElement)) {
21
21
 
22
- static get properties() {
23
- return {
24
- /**
25
- * Whether sort direction is descending
26
- * @type {boolean}
27
- */
28
- desc: {
29
- reflect: true,
30
- type: Boolean
31
- },
32
- /**
33
- * Column is not currently sorted. Hides the ascending/descending sort icon.
34
- * @type {boolean}
35
- */
36
- nosort: {
37
- reflect: true,
38
- type: Boolean
39
- },
40
- /**
41
- * Position of the button content
42
- * @type {'start'|'center'|'end'}
43
- */
44
- position: {
45
- reflect: true,
46
- type: String
47
- },
48
- /**
49
- * ACCESSIBILITY: The type of data in the column (e.g., 'words'). Used to set the title.
50
- * @type {'words'|'numbers'|'dates'|'unknown'}
51
- */
52
- sourceType: {
53
- attribute: 'source-type',
54
- type: String
55
- },
56
- _hasDropdownItems: { state: true },
57
- _selectedMenuItemText: { state: true },
58
- _label: { state: true },
59
- };
60
- }
61
-
62
- static get styles() {
63
- return css`
64
- :host {
65
- --d2l-table-col-sort-button-additional-padding-inline-end: 0px; /* stylelint-disable-line length-zero-no-unit */
66
- --d2l-table-col-sort-button-additional-padding-inline-start: 0px; /* stylelint-disable-line length-zero-no-unit */
67
- --d2l-table-col-sort-button-width: calc(100% - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
68
- }
69
- :host([nosort]) {
70
- --d2l-table-col-sort-button-additional-padding-inline-end: calc(0.6rem + 18px);
71
- }
72
- :host > :first-child {
73
- width: var(--d2l-table-col-sort-button-width);
74
- }
75
- :host([nosort][position="center"]) {
76
- --d2l-table-col-sort-button-additional-padding-inline-end: calc(0.5 * (0.6rem + 18px) + var(--d2l-table-cell-col-sort-button-size-offset, 4px));
77
- --d2l-table-col-sort-button-additional-padding-inline-start: calc(0.5 * (0.6rem + 18px) - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
78
- }
79
- :host([nosort][position="end"]) {
80
- --d2l-table-col-sort-button-additional-padding-inline-end: 0px; /* stylelint-disable-line length-zero-no-unit */
81
- --d2l-table-col-sort-button-additional-padding-inline-start: calc(0.6rem + 18px);
82
- }
83
- :host([position="center"]) button {
84
- justify-content: center;
85
- }
86
- :host([position="end"]) button {
87
- justify-content: end;
88
- }
89
- button {
90
- align-items: center;
91
- background-color: transparent;
92
- border: none;
93
- border-radius: 4px;
94
- color: inherit;
95
- cursor: pointer;
96
- display: inline-flex;
97
- font-family: inherit;
98
- font-size: inherit;
99
- letter-spacing: inherit;
100
- line-height: 0.9rem;
101
- margin-block: 0 var(--d2l-table-cell-col-sort-button-size-offset, 4px);
102
- margin-inline: 0 var(--d2l-table-cell-col-sort-button-size-offset, 4px);
103
- padding: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
104
- padding-inline-end: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px) + var(--d2l-table-col-sort-button-additional-padding-inline-end));
105
- padding-inline-start: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px) + var(--d2l-table-col-sort-button-additional-padding-inline-start));
106
- text-align: start;
107
- text-decoration: none;
108
- width: 100%;
109
- }
110
- button::-moz-focus-inner {
111
- border: 0;
112
- }
113
- button:disabled {
114
- opacity: 0.5;
115
- }
116
- button:hover {
117
- background-color: var(--d2l-color-gypsum);
118
- }
119
- ${getFocusRingStyles('button', { extraStyles: css`box-shadow: 0 0 0 2px #ffffff;` })}
120
- d2l-icon {
121
- margin-inline-start: 0.6rem;
122
- }
123
- ::slotted(*[slot="items"]) {
124
- display: none;
125
- }
126
- ::slotted(d2l-table-col-sort-button-item[slot="items"]) {
127
- display: flex;
128
- }
129
- `;
130
- }
22
+ static properties = {
23
+ /**
24
+ * Whether sort direction is descending
25
+ * @type {boolean}
26
+ */
27
+ desc: {
28
+ reflect: true,
29
+ type: Boolean
30
+ },
31
+ /**
32
+ * Column is not currently sorted. Hides the ascending/descending sort icon.
33
+ * @type {boolean}
34
+ */
35
+ nosort: {
36
+ reflect: true,
37
+ type: Boolean
38
+ },
39
+ /**
40
+ * Position of the button content
41
+ * @type {'start'|'center'|'end'}
42
+ */
43
+ position: {
44
+ reflect: true,
45
+ type: String
46
+ },
47
+ /**
48
+ * ACCESSIBILITY: The type of data in the column (e.g., 'words'). Used to set the title.
49
+ * @type {'words'|'numbers'|'dates'|'unknown'}
50
+ */
51
+ sourceType: {
52
+ attribute: 'source-type',
53
+ type: String
54
+ },
55
+ _hasDropdownItems: { state: true },
56
+ _selectedMenuItemText: { state: true },
57
+ _label: { state: true },
58
+ };
59
+
60
+ static styles = css`
61
+ :host {
62
+ --d2l-table-col-sort-button-additional-padding-inline-end: 0px; /* stylelint-disable-line length-zero-no-unit */
63
+ --d2l-table-col-sort-button-additional-padding-inline-start: 0px; /* stylelint-disable-line length-zero-no-unit */
64
+ --d2l-table-col-sort-button-width: calc(100% - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
65
+ }
66
+ :host([nosort]) {
67
+ --d2l-table-col-sort-button-additional-padding-inline-end: calc(0.6rem + 18px);
68
+ }
69
+ :host > :first-child {
70
+ width: var(--d2l-table-col-sort-button-width);
71
+ }
72
+ :host([nosort][position="center"]) {
73
+ --d2l-table-col-sort-button-additional-padding-inline-end: calc(0.5 * (0.6rem + 18px) + var(--d2l-table-cell-col-sort-button-size-offset, 4px));
74
+ --d2l-table-col-sort-button-additional-padding-inline-start: calc(0.5 * (0.6rem + 18px) - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
75
+ }
76
+ :host([nosort][position="end"]) {
77
+ --d2l-table-col-sort-button-additional-padding-inline-end: 0px; /* stylelint-disable-line length-zero-no-unit */
78
+ --d2l-table-col-sort-button-additional-padding-inline-start: calc(0.6rem + 18px);
79
+ }
80
+ :host([position="center"]) button {
81
+ justify-content: center;
82
+ }
83
+ :host([position="end"]) button {
84
+ justify-content: end;
85
+ }
86
+ button {
87
+ align-items: center;
88
+ background-color: transparent;
89
+ border: none;
90
+ border-radius: 4px;
91
+ color: inherit;
92
+ cursor: pointer;
93
+ display: inline-flex;
94
+ font-family: inherit;
95
+ font-size: inherit;
96
+ letter-spacing: inherit;
97
+ line-height: 0.9rem;
98
+ margin-block: 0 var(--d2l-table-cell-col-sort-button-size-offset, 4px);
99
+ margin-inline: 0 var(--d2l-table-cell-col-sort-button-size-offset, 4px);
100
+ padding: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
101
+ padding-inline-end: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px) + var(--d2l-table-col-sort-button-additional-padding-inline-end));
102
+ padding-inline-start: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px) + var(--d2l-table-col-sort-button-additional-padding-inline-start));
103
+ text-align: start;
104
+ text-decoration: none;
105
+ width: 100%;
106
+ }
107
+ button::-moz-focus-inner {
108
+ border: 0;
109
+ }
110
+ button:disabled {
111
+ opacity: 0.5;
112
+ }
113
+ button:hover {
114
+ background-color: var(--d2l-color-gypsum);
115
+ }
116
+ ${getFocusRingStyles('button', { extraStyles: css`box-shadow: 0 0 0 2px #ffffff;` })}
117
+ d2l-icon {
118
+ margin-inline-start: 0.6rem;
119
+ }
120
+ ::slotted(*[slot="items"]) {
121
+ display: none;
122
+ }
123
+ ::slotted(d2l-table-col-sort-button-item[slot="items"]) {
124
+ display: flex;
125
+ }
126
+ `;
131
127
 
132
128
  constructor() {
133
129
  super();
@@ -5,28 +5,25 @@ import { SelectionControls } from '../selection/selection-controls.js';
5
5
  * Controls for table components containing a selection summary and selection actions.
6
6
  */
7
7
  class TableControls extends SelectionControls {
8
- static get properties() {
9
- return {
10
- /**
11
- * Whether to render the selection summary
12
- * @type {boolean}
13
- */
14
- noSelection: { type: Boolean, attribute: 'no-selection' }
15
- };
16
- }
17
8
 
18
- static get styles() {
19
- return [super.styles, css`
20
- :host {
21
- --d2l-selection-controls-background-color: var(--d2l-table-controls-background-color);
22
- --d2l-selection-controls-shadow-display: var(--d2l-table-controls-shadow-display);
23
- z-index: 6; /* Must be greater than d2l-table-wrapper and d2l-scroll-wrapper */
24
- }
25
- :host([no-sticky]) {
26
- z-index: auto;
27
- }
28
- `];
29
- }
9
+ static properties = {
10
+ /**
11
+ * Whether to render the selection summary
12
+ * @type {boolean}
13
+ */
14
+ noSelection: { type: Boolean, attribute: 'no-selection' }
15
+ };
16
+
17
+ static styles = [super.styles, css`
18
+ :host {
19
+ --d2l-selection-controls-background-color: var(--d2l-table-controls-background-color);
20
+ --d2l-selection-controls-shadow-display: var(--d2l-table-controls-shadow-display);
21
+ z-index: 6; /* Must be greater than d2l-table-wrapper and d2l-scroll-wrapper */
22
+ }
23
+ :host([no-sticky]) {
24
+ z-index: auto;
25
+ }
26
+ `];
30
27
 
31
28
  constructor() {
32
29
  super();