@brightspace-ui/core 3.318.0 → 3.319.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.
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { css, unsafeCSS } from 'lit';
|
|
2
2
|
import { _isValidCssSelector } from '../../helpers/internal/css.js';
|
|
3
|
-
import { getFlag } from '../../helpers/flags.js';
|
|
4
3
|
import { registerSemanticVariableForSvgImageUrl } from '../colors/colors.js';
|
|
5
4
|
|
|
6
|
-
export const useGeneratedStyles = getFlag('GAUD-8849-Use-input-radio-generated-styles', true);
|
|
7
|
-
|
|
8
5
|
registerSemanticVariableForSvgImageUrl(
|
|
9
6
|
'--d2l-input-radio-check-image',
|
|
10
7
|
`<svg width="10" height="10" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -50,7 +47,7 @@ function _getRadioStyleSelectors(inputSelectors) {
|
|
|
50
47
|
* A private helper method that should not be used by general consumers
|
|
51
48
|
*/
|
|
52
49
|
export function _generateRadioStyles(selector, containerSelector) {
|
|
53
|
-
if (!_isValidCssSelector(selector) || (containerSelector && !_isValidCssSelector(containerSelector))) return
|
|
50
|
+
if (!_isValidCssSelector(selector) || (containerSelector && !_isValidCssSelector(containerSelector))) return;
|
|
54
51
|
const inputSelectors = [selector];
|
|
55
52
|
if (containerSelector) {
|
|
56
53
|
inputSelectors.push(`${containerSelector} > input[type="radio"]`);
|
|
@@ -172,129 +169,4 @@ export function _generateRadioStyles(selector, containerSelector) {
|
|
|
172
169
|
|
|
173
170
|
}
|
|
174
171
|
|
|
175
|
-
export const radioStyles =
|
|
176
|
-
${_generateRadioStyles('.d2l-input-radio', '.d2l-input-radio-label')}
|
|
177
|
-
` : css`
|
|
178
|
-
.d2l-input-radio,
|
|
179
|
-
.d2l-input-radio-label > input[type="radio"] {
|
|
180
|
-
-webkit-appearance: none;
|
|
181
|
-
-moz-appearance: none;
|
|
182
|
-
appearance: none;
|
|
183
|
-
background-position: center center;
|
|
184
|
-
background-repeat: no-repeat;
|
|
185
|
-
background-size: 0.5rem 0.5rem;
|
|
186
|
-
border-radius: 50%;
|
|
187
|
-
border-style: solid;
|
|
188
|
-
box-sizing: border-box;
|
|
189
|
-
display: inline-block;
|
|
190
|
-
height: 1.2rem;
|
|
191
|
-
margin: 0;
|
|
192
|
-
padding: 0;
|
|
193
|
-
vertical-align: middle;
|
|
194
|
-
width: 1.2rem;
|
|
195
|
-
}
|
|
196
|
-
.d2l-input-radio[aria-checked="true"],
|
|
197
|
-
.d2l-input-radio:checked,
|
|
198
|
-
.d2l-input-radio-label > input[type="radio"]:checked {
|
|
199
|
-
background-image: var(--d2l-input-radio-check-image);
|
|
200
|
-
}
|
|
201
|
-
.d2l-input-radio,
|
|
202
|
-
.d2l-input-radio:hover:disabled,
|
|
203
|
-
.d2l-input-radio:hover.d2l-disabled,
|
|
204
|
-
.d2l-input-radio-label > input[type="radio"],
|
|
205
|
-
.d2l-input-radio-label > input[type="radio"]:hover:disabled {
|
|
206
|
-
background-color: var(--d2l-theme-background-color-interactive-faint-default);
|
|
207
|
-
border-color: var(--d2l-theme-border-color-emphasized);
|
|
208
|
-
border-width: 1px;
|
|
209
|
-
}
|
|
210
|
-
.d2l-input-radio.d2l-hovering,
|
|
211
|
-
.d2l-input-radio:hover,
|
|
212
|
-
.d2l-input-radio:focus,
|
|
213
|
-
.d2l-input-radio-label > input[type="radio"]:hover,
|
|
214
|
-
.d2l-input-radio-label > input[type="radio"]:focus {
|
|
215
|
-
border-color: var(--d2l-input-radio-border-color-hover-focus, var(--d2l-theme-border-color-focus));
|
|
216
|
-
border-width: 2px;
|
|
217
|
-
outline: none;
|
|
218
|
-
}
|
|
219
|
-
.d2l-input-radio[aria-invalid="true"],
|
|
220
|
-
.d2l-input-radio-label > input[type="radio"][aria-invalid="true"] {
|
|
221
|
-
border-color: var(--d2l-theme-status-color-error);
|
|
222
|
-
}
|
|
223
|
-
.d2l-input-radio:disabled,
|
|
224
|
-
.d2l-input-radio.d2l-disabled,
|
|
225
|
-
.d2l-input-radio-label > input[type="radio"]:disabled {
|
|
226
|
-
opacity: var(--d2l-theme-opacity-disabled-control);
|
|
227
|
-
}
|
|
228
|
-
.d2l-input-radio-label {
|
|
229
|
-
align-items: center;
|
|
230
|
-
color: var(--d2l-theme-text-color-static-standard);
|
|
231
|
-
display: flex;
|
|
232
|
-
font-size: 0.8rem;
|
|
233
|
-
font-weight: 400;
|
|
234
|
-
line-height: 1.2rem;
|
|
235
|
-
margin-bottom: 0.9rem;
|
|
236
|
-
overflow-wrap: anywhere;
|
|
237
|
-
padding-inline-end: 0;
|
|
238
|
-
padding-inline-start: 1.7rem;
|
|
239
|
-
vertical-align: middle;
|
|
240
|
-
}
|
|
241
|
-
.d2l-input-radio-label-disabled:not(.d2l-input-radio-label-disabled-tooltip),
|
|
242
|
-
.d2l-input-radio-label-disabled-tooltip > * {
|
|
243
|
-
opacity: var(--d2l-theme-opacity-disabled-control);
|
|
244
|
-
}
|
|
245
|
-
.d2l-input-radio-label-disabled:not(.d2l-input-radio-label-disabled-tooltip) > .d2l-input-radio,
|
|
246
|
-
.d2l-input-radio-label-disabled:not(.d2l-input-radio-label-disabled-tooltip) > input[type="radio"] {
|
|
247
|
-
opacity: 1;
|
|
248
|
-
}
|
|
249
|
-
.d2l-input-radio.d2l-input-radio-disabled-tooltip.d2l-hovering,
|
|
250
|
-
.d2l-input-radio.d2l-input-radio-disabled-tooltip:hover,
|
|
251
|
-
.d2l-input-radio.d2l-input-radio-disabled-tooltip:focus,
|
|
252
|
-
.d2l-input-radio-label-disabled-tooltip .d2l-input-radio.d2l-hovering,
|
|
253
|
-
.d2l-input-radio-label-disabled-tooltip .d2l-input-radio:hover,
|
|
254
|
-
.d2l-input-radio-label-disabled-tooltip .d2l-input-radio:focus,
|
|
255
|
-
.d2l-input-radio-label-disabled-tooltip .d2l-input-radio-label > input[type="radio"]:hover,
|
|
256
|
-
.d2l-input-radio-label-disabled-tooltip .d2l-input-radio-label > input[type="radio"]:focus {
|
|
257
|
-
background-blend-mode: lighten;
|
|
258
|
-
background-color: var(--d2l-theme-background-color-interactive-faint-disabled);
|
|
259
|
-
border-color: var(--d2l-input-radio-border-color-hover-focus, var(--d2l-theme-border-color-focus));
|
|
260
|
-
border-width: 2px;
|
|
261
|
-
opacity: 1;
|
|
262
|
-
outline: none;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.d2l-input-radio-label:last-of-type {
|
|
266
|
-
margin-bottom: 0;
|
|
267
|
-
}
|
|
268
|
-
.d2l-input-radio-label > .d2l-input-radio,
|
|
269
|
-
.d2l-input-radio-label > input[type="radio"] {
|
|
270
|
-
flex: 0 0 auto;
|
|
271
|
-
margin-inline-end: 0.5rem;
|
|
272
|
-
margin-inline-start: -1.7rem;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
@media (prefers-contrast: more) {
|
|
276
|
-
.d2l-input-radio[aria-checked="true"],
|
|
277
|
-
.d2l-input-radio:checked,
|
|
278
|
-
.d2l-input-radio-label > input[type="radio"]:checked {
|
|
279
|
-
background-image: none;
|
|
280
|
-
position: relative;
|
|
281
|
-
}
|
|
282
|
-
.d2l-input-radio[aria-checked="true"]::after,
|
|
283
|
-
.d2l-input-radio:checked::after,
|
|
284
|
-
.d2l-input-radio-label > input[type="radio"]:checked::after {
|
|
285
|
-
background-color: FieldText;
|
|
286
|
-
content: "";
|
|
287
|
-
display: block;
|
|
288
|
-
height: 1.2rem;
|
|
289
|
-
left: 50%;
|
|
290
|
-
mask-image: var(--d2l-input-radio-check-image);
|
|
291
|
-
mask-position: center center;
|
|
292
|
-
mask-repeat: no-repeat;
|
|
293
|
-
mask-size: 0.5rem 0.5rem;
|
|
294
|
-
position: absolute;
|
|
295
|
-
top: 50%;
|
|
296
|
-
transform: translate(-50%, -50%);
|
|
297
|
-
width: 1.2rem;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
`;
|
|
172
|
+
export const radioStyles = _generateRadioStyles('.d2l-input-radio', '.d2l-input-radio-label');
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import '../expand-collapse/expand-collapse-content.js';
|
|
2
2
|
import '../tooltip/tooltip.js';
|
|
3
3
|
import { css, html, LitElement, nothing } from 'lit';
|
|
4
|
-
import { radioStyles, useGeneratedStyles } from './input-radio-styles.js';
|
|
5
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
6
5
|
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
7
6
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
8
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
8
|
import { InputInlineHelpMixin } from './input-inline-help.js';
|
|
10
9
|
import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
|
|
10
|
+
import { radioStyles } from './input-radio-styles.js';
|
|
11
11
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
12
12
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
13
13
|
|
|
@@ -128,12 +128,11 @@ class InputRadio extends InputInlineHelpMixin(SkeletonMixin(FocusMixin(PropertyR
|
|
|
128
128
|
};
|
|
129
129
|
const labelClasses = {
|
|
130
130
|
'd2l-input-radio-label': true,
|
|
131
|
-
'd2l-input-radio-label-disabled': this.disabled && !this.skeleton
|
|
132
|
-
'd2l-input-radio-label-disabled-tooltip': !useGeneratedStyles && this.disabled && this.disabledTooltip
|
|
131
|
+
'd2l-input-radio-label-disabled': this.disabled && !this.skeleton
|
|
133
132
|
};
|
|
134
133
|
const radioClasses = {
|
|
135
134
|
'd2l-input-radio': true,
|
|
136
|
-
'd2l-input-radio-disabled-tooltip':
|
|
135
|
+
'd2l-input-radio-disabled-tooltip': this.disabled && this.disabledTooltip,
|
|
137
136
|
'd2l-disabled': this.focusDisabled && !this.skeleton,
|
|
138
137
|
'd2l-hovering': this._isHovered && !this.focusDisabled,
|
|
139
138
|
'd2l-skeletize': true
|
|
@@ -38,7 +38,7 @@ function _getSelectFocusStyles(selector) {
|
|
|
38
38
|
* A private helper method that should not be used by general consumers
|
|
39
39
|
*/
|
|
40
40
|
export function _generateSelectStyles(selector) {
|
|
41
|
-
if (!_isValidCssSelector(selector)) return
|
|
41
|
+
if (!_isValidCssSelector(selector)) return;
|
|
42
42
|
const finalSelector = unsafeCSS(selector);
|
|
43
43
|
const selectFocusStyles = _getSelectFocusStyles(finalSelector);
|
|
44
44
|
|
|
@@ -125,7 +125,7 @@ function _generatewebkitSearchStyles(selector) {
|
|
|
125
125
|
* A private helper method that should not be used by general consumers
|
|
126
126
|
*/
|
|
127
127
|
export function _generateInputStyles(selector, focusSelector) {
|
|
128
|
-
if (!_isValidCssSelector(selector) || (focusSelector && !_isValidCssSelector(focusSelector))) return
|
|
128
|
+
if (!_isValidCssSelector(selector) || (focusSelector && !_isValidCssSelector(focusSelector))) return;
|
|
129
129
|
const lastSpaceIndex = selector.lastIndexOf(' ');
|
|
130
130
|
const textareaSelector = unsafeCSS(`${selector.substring(0, lastSpaceIndex + 1)}textarea${selector.substring(lastSpaceIndex + 1)}`);
|
|
131
131
|
const delegates = getStyleDelegates(selector, focusSelector, textareaSelector);
|
|
@@ -191,7 +191,7 @@ export function _generateInputStyles(selector, focusSelector) {
|
|
|
191
191
|
* A private helper method that should not be used by general consumers
|
|
192
192
|
*/
|
|
193
193
|
export function _generateInputTextStyles(selector) {
|
|
194
|
-
if (!_isValidCssSelector(selector)) return
|
|
194
|
+
if (!_isValidCssSelector(selector)) return;
|
|
195
195
|
const finalSelector = unsafeCSS(selector);
|
|
196
196
|
const input = _getInputBaseStyleDelegates(selector);
|
|
197
197
|
|
|
@@ -13,8 +13,8 @@ export const KEYBOARD_STEP = 20; // TO DO: Confirm
|
|
|
13
13
|
export const KEYBOARD_STEP_LARGE = 80; // TO DO: Confirm
|
|
14
14
|
|
|
15
15
|
const DRAG_THRESHOLD = 3; // Number of pixels to move to count as a drag
|
|
16
|
-
const AUTO_EXPAND_WIDTH_FACTOR = 0.1;
|
|
17
|
-
const AUTO_COLLAPSE_WIDTH_FACTOR = 0.75;
|
|
16
|
+
export const AUTO_EXPAND_WIDTH_FACTOR = 0.1;
|
|
17
|
+
export const AUTO_COLLAPSE_WIDTH_FACTOR = 0.75;
|
|
18
18
|
|
|
19
19
|
const clampedSize = (size, min, max) => Math.max(min, Math.min(size, max));
|
|
20
20
|
const isRtl = () => document.documentElement.getAttribute('dir') === 'rtl';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.319.1",
|
|
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",
|