@brightspace-ui/core 3.317.3 → 3.319.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,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">
|
|
@@ -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
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { css, unsafeCSS } from 'lit';
|
|
2
|
-
import { getFocusPseudoClass, getFocusVisibleStyles } from '../../helpers/focus.js';
|
|
3
2
|
import { _isValidCssSelector } from '../../helpers/internal/css.js';
|
|
4
|
-
import {
|
|
3
|
+
import { getFocusVisibleStyles } from '../../helpers/focus.js';
|
|
5
4
|
import { registerSemanticVariableForSvgImageUrl } from '../colors/colors.js';
|
|
6
5
|
|
|
7
|
-
const focusClass = unsafeCSS(globalThis.document !== undefined ? getFocusPseudoClass() : 'focus-visible');
|
|
8
|
-
|
|
9
6
|
registerSemanticVariableForSvgImageUrl(
|
|
10
7
|
'--d2l-input-invalid-image',
|
|
11
8
|
`<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
|
|
@@ -213,112 +210,4 @@ export function _generateInputTextStyles(selector) {
|
|
|
213
210
|
`;
|
|
214
211
|
}
|
|
215
212
|
|
|
216
|
-
export const inputStyles =
|
|
217
|
-
.d2l-input {
|
|
218
|
-
background-color: var(--d2l-input-background-color, var(--d2l-theme-background-color-base));
|
|
219
|
-
border-radius: var(--d2l-input-border-radius, 0.3rem);
|
|
220
|
-
border-style: solid;
|
|
221
|
-
box-shadow: var(--d2l-theme-shadow-inset);
|
|
222
|
-
box-sizing: border-box;
|
|
223
|
-
color: var(--d2l-theme-text-color-static-standard);
|
|
224
|
-
display: inline-block;
|
|
225
|
-
font-family: inherit;
|
|
226
|
-
font-size: 0.8rem;
|
|
227
|
-
font-weight: 400;
|
|
228
|
-
height: var(--d2l-input-height, auto);
|
|
229
|
-
letter-spacing: 0.02rem;
|
|
230
|
-
line-height: 1.2rem; /* using min-height AND line-height as IE11 doesn't support line-height on inputs */
|
|
231
|
-
margin: 0;
|
|
232
|
-
min-height: calc(2rem + 2px);
|
|
233
|
-
min-width: calc(2rem + 1em);
|
|
234
|
-
position: var(--d2l-input-position, relative); /* overridden by sticky headers in grades */
|
|
235
|
-
text-align: var(--d2l-input-text-align, start);
|
|
236
|
-
vertical-align: middle;
|
|
237
|
-
width: 100%;
|
|
238
|
-
}
|
|
239
|
-
.d2l-input,
|
|
240
|
-
.d2l-input:hover:disabled,
|
|
241
|
-
.d2l-input:${focusClass}:disabled,
|
|
242
|
-
[aria-invalid="true"].d2l-input:disabled {
|
|
243
|
-
border-color: var(--d2l-input-border-color, var(--d2l-theme-border-color-emphasized));
|
|
244
|
-
border-width: 1px;
|
|
245
|
-
padding: var(--d2l-input-padding, 0.4rem 0.75rem);
|
|
246
|
-
}
|
|
247
|
-
.d2l-input::placeholder {
|
|
248
|
-
color: var(--d2l-theme-text-color-static-faint);
|
|
249
|
-
font-size: 0.8rem;
|
|
250
|
-
font-weight: 400;
|
|
251
|
-
opacity: 1; /* Firefox has non-1 default */
|
|
252
|
-
}
|
|
253
|
-
.d2l-input::-ms-input-placeholder {
|
|
254
|
-
color: var(--d2l-theme-text-color-static-faint);
|
|
255
|
-
font-size: 0.8rem;
|
|
256
|
-
font-weight: 400;
|
|
257
|
-
}
|
|
258
|
-
.d2l-input:hover,
|
|
259
|
-
.d2l-input:${focusClass},
|
|
260
|
-
.d2l-input-focus {
|
|
261
|
-
border-color: var(--d2l-theme-border-color-focus);
|
|
262
|
-
border-width: 2px;
|
|
263
|
-
outline: none;
|
|
264
|
-
padding: var(--d2l-input-padding-focus, calc(0.4rem - 1px) calc(0.75rem - 1px));
|
|
265
|
-
}
|
|
266
|
-
[aria-invalid="true"].d2l-input {
|
|
267
|
-
border-color: var(--d2l-theme-status-color-error);
|
|
268
|
-
}
|
|
269
|
-
.d2l-input:disabled {
|
|
270
|
-
opacity: var(--d2l-theme-opacity-disabled-control);
|
|
271
|
-
}
|
|
272
|
-
.d2l-input::-webkit-search-cancel-button,
|
|
273
|
-
.d2l-input::-webkit-search-decoration {
|
|
274
|
-
display: none;
|
|
275
|
-
}
|
|
276
|
-
.d2l-input::-ms-clear {
|
|
277
|
-
display: none;
|
|
278
|
-
height: 0;
|
|
279
|
-
width: 0;
|
|
280
|
-
}
|
|
281
|
-
textarea.d2l-input {
|
|
282
|
-
line-height: normal;
|
|
283
|
-
}
|
|
284
|
-
textarea.d2l-input,
|
|
285
|
-
textarea.d2l-input:hover:disabled,
|
|
286
|
-
textarea.d2l-input:${focusClass}:disabled,
|
|
287
|
-
textarea[aria-invalid="true"].d2l-input:disabled {
|
|
288
|
-
padding-block: 0.5rem;
|
|
289
|
-
}
|
|
290
|
-
textarea.d2l-input:hover,
|
|
291
|
-
textarea.d2l-input:${focusClass} {
|
|
292
|
-
padding: var(--d2l-input-padding-focus, calc(0.75rem - 1px));
|
|
293
|
-
padding-block: calc(0.5rem - 1px);
|
|
294
|
-
}
|
|
295
|
-
textarea.d2l-input[aria-invalid="true"] {
|
|
296
|
-
background-image: var(--d2l-input-invalid-image);
|
|
297
|
-
background-position: top 12px var(--d2l-inline-end, right) 18px;
|
|
298
|
-
background-repeat: no-repeat;
|
|
299
|
-
background-size: 0.8rem 0.8rem;
|
|
300
|
-
padding-inline-end: calc(18px + 0.8rem);
|
|
301
|
-
}
|
|
302
|
-
textarea.d2l-input-focus[aria-invalid="true"],
|
|
303
|
-
textarea.d2l-input[aria-invalid="true"]:hover,
|
|
304
|
-
textarea.d2l-input[aria-invalid="true"]:${focusClass} {
|
|
305
|
-
background-position: top calc(12px - 1px) var(--d2l-inline-end, right) calc(18px - 1px);
|
|
306
|
-
padding-inline-end: calc(18px + 0.8rem - 1px);
|
|
307
|
-
}
|
|
308
|
-
textarea[aria-invalid="true"].d2l-input:disabled {
|
|
309
|
-
background-image: none;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
@media (prefers-contrast: more) {
|
|
313
|
-
[aria-invalid="true"].d2l-input {
|
|
314
|
-
background-color: Field;
|
|
315
|
-
border-color: var(--d2l-theme-status-color-error);
|
|
316
|
-
box-shadow: none;
|
|
317
|
-
color: FieldText;
|
|
318
|
-
forced-color-adjust: none;
|
|
319
|
-
}
|
|
320
|
-
.d2l-input-focus {
|
|
321
|
-
border-color: Highlight;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
`;
|
|
213
|
+
export const inputStyles = _generateInputStyles('.d2l-input', '.d2l-input-focus');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.319.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",
|