@brightspace-ui/core 3.226.0 → 3.227.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.
@@ -1,4 +1,5 @@
1
1
  import '../colors/colors.js';
2
+ import '../expand-collapse/expand-collapse-content.js';
2
3
  import '../tooltip/tooltip.js';
3
4
  import { css, html, LitElement, nothing } from 'lit';
4
5
  import { classMap } from 'lit/directives/class-map.js';
@@ -240,12 +241,8 @@ class InputCheckbox extends FormElementMixin(InputInlineHelpMixin(FocusMixin(Ske
240
241
  vertical-align: top;
241
242
  }
242
243
  .d2l-input-checkbox-supporting {
243
- display: none;
244
244
  margin-block-start: 0.6rem;
245
245
  }
246
- .d2l-input-checkbox-supporting-visible {
247
- display: block;
248
- }
249
246
  `
250
247
  ];
251
248
  }
@@ -271,10 +268,7 @@ class InputCheckbox extends FormElementMixin(InputInlineHelpMixin(FocusMixin(Ske
271
268
 
272
269
  render() {
273
270
  const tabindex = this.notTabbable ? -1 : undefined;
274
- const supportingClasses = {
275
- 'd2l-input-checkbox-supporting': true,
276
- 'd2l-input-checkbox-supporting-visible': this._hasSupporting && (this.checked || !this.supportingHiddenWhenUnchecked)
277
- };
271
+ const supportingContentVisible = this._hasSupporting && (this.checked || !this.supportingHiddenWhenUnchecked);
278
272
  const textClasses = {
279
273
  'd2l-input-checkbox-text': true,
280
274
  'd2l-skeletize': true,
@@ -311,7 +305,9 @@ class InputCheckbox extends FormElementMixin(InputInlineHelpMixin(FocusMixin(Ske
311
305
  ${this._renderInlineHelp(this.#inlineHelpId)}
312
306
  ${offscreenContainer}
313
307
  ${disabledTooltip}
314
- <div class="${classMap(supportingClasses)}" @change="${this.#handleSupportingChange}"><slot name="supporting" @slotchange="${this.#handleSupportingSlotChange}"></slot></div>
308
+ <d2l-expand-collapse-content ?expanded="${supportingContentVisible}">
309
+ <div class="d2l-input-checkbox-supporting" @change="${this.#handleSupportingChange}"><slot name="supporting" @slotchange="${this.#handleSupportingSlotChange}"></slot></div>
310
+ </d2l-expand-collapse-content>
315
311
  `;
316
312
  }
317
313
 
@@ -1,3 +1,4 @@
1
+ import '../expand-collapse/expand-collapse-content.js';
1
2
  import '../tooltip/tooltip.js';
2
3
  import { css, html, LitElement, nothing } from 'lit';
3
4
  import { classMap } from 'lit/directives/class-map.js';
@@ -80,12 +81,8 @@ class InputRadio extends InputInlineHelpMixin(SkeletonMixin(FocusMixin(PropertyR
80
81
  margin-inline-start: 1.7rem;
81
82
  }
82
83
  .d2l-input-radio-supporting {
83
- display: none;
84
84
  margin-block-start: 0.6rem;
85
85
  }
86
- .d2l-input-radio-supporting-visible {
87
- display: block;
88
- }
89
86
  `];
90
87
  }
91
88
 
@@ -129,6 +126,7 @@ class InputRadio extends InputInlineHelpMixin(SkeletonMixin(FocusMixin(PropertyR
129
126
 
130
127
  render() {
131
128
  const allowFocus = !this.focusDisabled && this._focusable;
129
+ const supportingContentVisible = this._hasSupporting && (!this.supportingHiddenWhenUnchecked || this._checked);
132
130
  const labelStyles = {
133
131
  alignItems: this._horizontal ? 'flex-start' : undefined
134
132
  };
@@ -143,10 +141,6 @@ class InputRadio extends InputInlineHelpMixin(SkeletonMixin(FocusMixin(PropertyR
143
141
  'd2l-hovering': this._isHovered && !this.focusDisabled,
144
142
  'd2l-skeletize': true
145
143
  };
146
- const supportingClasses = {
147
- 'd2l-input-radio-supporting': true,
148
- 'd2l-input-radio-supporting-visible': this._hasSupporting && (!this.supportingHiddenWhenUnchecked || this._checked),
149
- };
150
144
  const description = this.description ? html`<div id="${this.#descriptionId}" hidden>${this.description}</div>` : nothing;
151
145
  const ariaDescribedByIds = `${this.description ? this.#descriptionId : ''} ${this._hasInlineHelp ? this.#inlineHelpId : ''}`.trim();
152
146
  const disabledTooltip = this.disabled && this.disabledTooltip ?
@@ -169,7 +163,9 @@ class InputRadio extends InputInlineHelpMixin(SkeletonMixin(FocusMixin(PropertyR
169
163
  ${this._renderInlineHelp(this.#inlineHelpId)}
170
164
  ${description}
171
165
  ${disabledTooltip}
172
- <div class="${classMap(supportingClasses)}" @change="${this.#handleSupportingChange}"><slot name="supporting" @slotchange="${this.#handleSupportingSlotChange}"></slot></div>
166
+ <d2l-expand-collapse-content ?expanded="${supportingContentVisible}">
167
+ <div class="d2l-input-radio-supporting" @change="${this.#handleSupportingChange}"><slot name="supporting" @slotchange="${this.#handleSupportingSlotChange}"></slot></div>
168
+ </d2l-expand-collapse-content>
173
169
  `;
174
170
  }
175
171
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.226.0",
3
+ "version": "3.227.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",