@brightspace-ui/core 3.151.5 → 3.152.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.
@@ -25,9 +25,28 @@ export const cssSizes = {
25
25
 
26
26
  export const checkboxStyles = css`
27
27
  input[type="checkbox"].d2l-input-checkbox {
28
+ --d2l-input-checkbox-background-image: none;
29
+ --d2l-input-checkbox-background-color: var(--d2l-color-regolith);
30
+ --d2l-input-checkbox-background-image-disabled:
31
+ linear-gradient(
32
+ /* regolith at 50% */
33
+ rgba(249, 251, 255, 0.5),
34
+ rgba(249, 251, 255, 0.5)
35
+ ),
36
+ var(--d2l-input-checkbox-background-image);
37
+
38
+ @supports (color: color-mix(in srgb, black 50%, transparent)) {
39
+ --d2l-input-checkbox-background-image-disabled:
40
+ linear-gradient(
41
+ color-mix(in srgb, var(--d2l-input-checkbox-background-color) 50%, transparent),
42
+ color-mix(in srgb, var(--d2l-input-checkbox-background-color) 50%, transparent)
43
+ ),
44
+ var(--d2l-input-checkbox-background-image);
45
+ }
28
46
  -webkit-appearance: none;
29
47
  -moz-appearance: none;
30
48
  appearance: none;
49
+ background-image: var(--d2l-input-checkbox-background-image);
31
50
  background-position: center center;
32
51
  background-repeat: no-repeat;
33
52
  background-size: ${cssSizes.inputBoxSize}rem ${cssSizes.inputBoxSize}rem;
@@ -43,17 +62,20 @@ export const checkboxStyles = css`
43
62
  width: ${cssSizes.inputBoxSize}rem;
44
63
  }
45
64
  input[type="checkbox"].d2l-input-checkbox:checked {
46
- background-image: ${inputCheck};
65
+ --d2l-input-checkbox-background-image: ${inputCheck};
47
66
  }
48
67
  input[type="checkbox"].d2l-input-checkbox:indeterminate {
49
- background-image: ${inputCheckIndeterminate};
68
+ --d2l-input-checkbox-background-image: ${inputCheckIndeterminate};
50
69
  }
51
70
  input[type="checkbox"].d2l-input-checkbox,
52
71
  input[type="checkbox"].d2l-input-checkbox:hover:disabled {
53
- background-color: var(--d2l-color-regolith);
72
+ background-color: var(--d2l-input-checkbox-background-color);
54
73
  border-color: var(--d2l-color-galena);
55
74
  border-width: 1px;
56
75
  }
76
+ input[type="checkbox"].d2l-input-checkbox:hover:disabled {
77
+ border-color: var(--d2l-color-corundum);
78
+ }
57
79
  input[type="checkbox"].d2l-input-checkbox:hover,
58
80
  input[type="checkbox"].d2l-input-checkbox:focus,
59
81
  input[type="checkbox"].d2l-input-checkbox.d2l-input-checkbox-focus,
@@ -63,10 +85,11 @@ export const checkboxStyles = css`
63
85
  outline-width: 0;
64
86
  }
65
87
  input[type="checkbox"].d2l-input-checkbox:disabled,
66
- input[type="checkbox"].d2l-input-checkbox[aria-disabled="true"] {
67
- opacity: 0.5;
88
+ input[type="checkbox"].d2l-input-checkbox:where([aria-disabled="true"]) {
89
+ background-image: var(--d2l-input-checkbox-background-image-disabled);
90
+ border-color: var(--d2l-color-corundum);
68
91
  }
69
- @media (prefers-contrast: more) {
92
+ @media (forced-colors: active) {
70
93
  input[type="checkbox"].d2l-input-checkbox:checked,
71
94
  input[type="checkbox"].d2l-input-checkbox:indeterminate {
72
95
  background-image: none;
@@ -85,6 +108,11 @@ export const checkboxStyles = css`
85
108
  width: ${cssSizes.inputBoxSize}rem;
86
109
  }
87
110
 
111
+ input[type="checkbox"].d2l-input-checkbox:disabled,
112
+ input[type="checkbox"].d2l-input-checkbox:where([aria-disabled="true"]) {
113
+ opacity: 0.5;
114
+ }
115
+
88
116
  input[type="checkbox"].d2l-input-checkbox:checked::after {
89
117
  mask-image: ${inputCheck};
90
118
  }
@@ -201,12 +229,9 @@ class InputCheckbox extends FormElementMixin(InputInlineHelpMixin(FocusMixin(Ske
201
229
  .d2l-input-checkbox-supporting {
202
230
  margin-inline-start: ${cssSizes.inputBoxSize + cssSizes.checkboxMargin}rem;
203
231
  }
204
- .d2l-input-checkbox-text-disabled {
232
+ :host(:not([skeleton])) .d2l-input-checkbox-text-disabled {
205
233
  opacity: 0.5;
206
234
  }
207
- :host([skeleton]) .d2l-input-checkbox-text-disabled {
208
- opacity: 1;
209
- }
210
235
  input[type="checkbox"].d2l-input-checkbox {
211
236
  vertical-align: top;
212
237
  }
@@ -14,6 +14,11 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
14
14
  * @type {boolean}
15
15
  */
16
16
  selectionDisabled: { type: Boolean, attribute: 'selection-disabled', reflect: true },
17
+ /**
18
+ * **Selection:** Tooltip text when selection is disabled
19
+ * @type {string}
20
+ */
21
+ selectionDisabledTooltip: { type: String, attribute: 'selection-disabled-tooltip' },
17
22
  /**
18
23
  * **Selection:** Value to identify item if selectable
19
24
  * @type {string}
@@ -45,8 +50,12 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
45
50
  display: block;
46
51
  height: 100%;
47
52
  }
48
- :host([selection-disabled]) .d2l-checkbox-action {
49
- cursor: default;
53
+ :host([selection-disabled]) [slot="control-action"] {
54
+ pointer-events: none;
55
+ }
56
+ :host([selection-disabled]) [slot="control"],
57
+ :host([selection-disabled]) [slot="control-action"] [slot="content"] {
58
+ pointer-events: all;
50
59
  }
51
60
  ` ];
52
61
 
@@ -155,10 +164,12 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
155
164
  }
156
165
 
157
166
  _renderCheckbox() {
167
+ /* eslint-disable lit/no-private-properties */
158
168
  return this.selectable ? html`
159
169
  <d2l-selection-input
160
170
  @d2l-selection-change="${this._onCheckboxChange}"
161
171
  ?disabled="${this.selectionDisabled}"
172
+ ._disabledTooltip=${this.selectionDisabledTooltip}
162
173
  .hovering="${this._hoveringSelection}"
163
174
  id="${this._checkboxId}"
164
175
  ?_indeterminate="${this.selectionInfo.state === SelectionInfo.states.some}"
@@ -168,6 +179,7 @@ export const ListItemCheckboxMixin = superclass => class extends SkeletonMixin(s
168
179
  ?skeleton="${this.skeleton}">
169
180
  </d2l-selection-input>
170
181
  ` : nothing;
182
+ /* eslint-enable */
171
183
  }
172
184
 
173
185
  _renderCheckboxAction(inner) {
@@ -176,7 +176,7 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
176
176
  :host(:not([no-primary-action])) ::slotted([slot="outside-control-action"]) {
177
177
  grid-column-end: end;
178
178
  }
179
-
179
+
180
180
  :host(:not([no-primary-action])) ::slotted([slot="control-action"]) {
181
181
  grid-column-end: actions-start;
182
182
  }
@@ -40,6 +40,8 @@ class Input extends SkeletonMixin(LabelledMixin(LitElement)) {
40
40
  * @type {string}
41
41
  */
42
42
  key: { type: String },
43
+ /* passthrough for list-item */
44
+ _disabledTooltip: { state: true },
43
45
  _indeterminate: { type: Boolean },
44
46
  _provider: { type: Object }
45
47
  };
@@ -120,6 +122,7 @@ class Input extends SkeletonMixin(LabelledMixin(LitElement)) {
120
122
  ?checked="${this.selected}"
121
123
  class="${ifDefined(this.hovering ? 'd2l-hovering' : undefined)}"
122
124
  ?disabled="${this.disabled}"
125
+ disabled-tooltip="${ifDefined(this._disabledTooltip)}"
123
126
  ?indeterminate="${this._indeterminate}"
124
127
  ?skeleton="${this.skeleton}">
125
128
  </d2l-input-checkbox>
@@ -8700,6 +8700,11 @@
8700
8700
  "type": "'normal'|'none'",
8701
8701
  "default": "\"normal\""
8702
8702
  },
8703
+ {
8704
+ "name": "selection-disabled-tooltip",
8705
+ "description": "**Selection:** Tooltip text when selection is disabled",
8706
+ "type": "string"
8707
+ },
8703
8708
  {
8704
8709
  "name": "selectable",
8705
8710
  "description": "**Selection:** Indicates an input should be rendered for selecting the item",
@@ -8809,6 +8814,12 @@
8809
8814
  "type": "'normal'|'none'",
8810
8815
  "default": "\"normal\""
8811
8816
  },
8817
+ {
8818
+ "name": "selectionDisabledTooltip",
8819
+ "attribute": "selection-disabled-tooltip",
8820
+ "description": "**Selection:** Tooltip text when selection is disabled",
8821
+ "type": "string"
8822
+ },
8812
8823
  {
8813
8824
  "name": "selectable",
8814
8825
  "attribute": "selectable",
@@ -9050,6 +9061,11 @@
9050
9061
  "type": "'normal'|'none'",
9051
9062
  "default": "\"normal\""
9052
9063
  },
9064
+ {
9065
+ "name": "selection-disabled-tooltip",
9066
+ "description": "**Selection:** Tooltip text when selection is disabled",
9067
+ "type": "string"
9068
+ },
9053
9069
  {
9054
9070
  "name": "selectable",
9055
9071
  "description": "**Selection:** Indicates an input should be rendered for selecting the item",
@@ -9166,6 +9182,12 @@
9166
9182
  "type": "'normal'|'none'",
9167
9183
  "default": "\"normal\""
9168
9184
  },
9185
+ {
9186
+ "name": "selectionDisabledTooltip",
9187
+ "attribute": "selection-disabled-tooltip",
9188
+ "description": "**Selection:** Tooltip text when selection is disabled",
9189
+ "type": "string"
9190
+ },
9169
9191
  {
9170
9192
  "name": "selectable",
9171
9193
  "attribute": "selectable",
@@ -9537,6 +9559,11 @@
9537
9559
  "type": "'normal'|'none'",
9538
9560
  "default": "\"normal\""
9539
9561
  },
9562
+ {
9563
+ "name": "selection-disabled-tooltip",
9564
+ "description": "**Selection:** Tooltip text when selection is disabled",
9565
+ "type": "string"
9566
+ },
9540
9567
  {
9541
9568
  "name": "selectable",
9542
9569
  "description": "**Selection:** Indicates an input should be rendered for selecting the item",
@@ -9665,6 +9692,12 @@
9665
9692
  "type": "'normal'|'none'",
9666
9693
  "default": "\"normal\""
9667
9694
  },
9695
+ {
9696
+ "name": "selectionDisabledTooltip",
9697
+ "attribute": "selection-disabled-tooltip",
9698
+ "description": "**Selection:** Tooltip text when selection is disabled",
9699
+ "type": "string"
9700
+ },
9668
9701
  {
9669
9702
  "name": "selectable",
9670
9703
  "attribute": "selectable",
@@ -9840,6 +9873,11 @@
9840
9873
  "type": "'normal'|'none'",
9841
9874
  "default": "\"normal\""
9842
9875
  },
9876
+ {
9877
+ "name": "selection-disabled-tooltip",
9878
+ "description": "**Selection:** Tooltip text when selection is disabled",
9879
+ "type": "string"
9880
+ },
9843
9881
  {
9844
9882
  "name": "selectable",
9845
9883
  "description": "**Selection:** Indicates an input should be rendered for selecting the item",
@@ -9961,6 +9999,12 @@
9961
9999
  "type": "'normal'|'none'",
9962
10000
  "default": "\"normal\""
9963
10001
  },
10002
+ {
10003
+ "name": "selectionDisabledTooltip",
10004
+ "attribute": "selection-disabled-tooltip",
10005
+ "description": "**Selection:** Tooltip text when selection is disabled",
10006
+ "type": "string"
10007
+ },
9964
10008
  {
9965
10009
  "name": "selectable",
9966
10010
  "attribute": "selectable",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.151.5",
3
+ "version": "3.152.0",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",