@brightspace-ui/core 3.262.8 → 3.263.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.
|
@@ -152,7 +152,7 @@ class ButtonMove extends ThemeMixin(FocusMixin(LitElement)) {
|
|
|
152
152
|
.down-layer {
|
|
153
153
|
height: 1.2rem;
|
|
154
154
|
position: relative;
|
|
155
|
-
width: 1.
|
|
155
|
+
width: 1.25rem;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/* Firefox includes a hidden border which messes up button dimensions */
|
|
@@ -175,21 +175,23 @@ class ButtonMove extends ThemeMixin(FocusMixin(LitElement)) {
|
|
|
175
175
|
align-items: center;
|
|
176
176
|
flex-direction: row;
|
|
177
177
|
height: 1.2rem;
|
|
178
|
-
|
|
179
|
-
width: calc(1.3rem * 2);
|
|
178
|
+
width: calc(calc(1.2rem + 1px) * 2);
|
|
180
179
|
}
|
|
181
180
|
|
|
182
181
|
:host([side-to-side]) .layer {
|
|
183
182
|
flex-direction: row;
|
|
183
|
+
gap: 2px;
|
|
184
184
|
height: 1.2rem;
|
|
185
185
|
inset-inline-start: 0;
|
|
186
186
|
top: 0;
|
|
187
|
-
width: calc(1.
|
|
187
|
+
width: calc(calc(1.2rem + 1px) * 2);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
:host([side-to-side]) d2l-icon {
|
|
191
|
+
height: 1.2rem;
|
|
191
192
|
/* Arrows need to be rotated in opposite direction for RTL */
|
|
192
193
|
transform: rotate(calc(-90deg * var(--d2l-length-factor)));
|
|
194
|
+
width: 1.2rem;
|
|
193
195
|
}
|
|
194
196
|
`
|
|
195
197
|
];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { _isValidCssSelector } from '../../helpers/internal/css.js';
|
|
2
3
|
import { registerSemanticVariableForSvgImageUrl } from '../colors/colors.js';
|
|
3
4
|
|
|
4
5
|
registerSemanticVariableForSvgImageUrl(
|
|
@@ -8,29 +9,55 @@ registerSemanticVariableForSvgImageUrl(
|
|
|
8
9
|
</svg>`
|
|
9
10
|
);
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* A private helper method that should not be used by general consumers
|
|
14
|
+
*/
|
|
15
|
+
export function _generateInputLabelStyles(selector) {
|
|
16
|
+
if (!selector || !_isValidCssSelector(selector.trim())) return;
|
|
17
|
+
const trimmedSelector = selector.trim().split(',').map(s => s.trim()).join(',\n');
|
|
18
|
+
const cssSelector = unsafeCSS(trimmedSelector);
|
|
19
|
+
|
|
20
|
+
return css`
|
|
21
|
+
${cssSelector} {
|
|
22
|
+
cursor: default;
|
|
23
|
+
display: block;
|
|
24
|
+
font-size: 0.7rem;
|
|
25
|
+
font-weight: 700;
|
|
26
|
+
letter-spacing: 0.2px;
|
|
27
|
+
line-height: 0.9rem;
|
|
28
|
+
margin-block: 0 0.4rem;
|
|
29
|
+
margin-inline: 0;
|
|
30
|
+
padding: 0;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A private helper method that should not be used by general consumers
|
|
37
|
+
*/
|
|
38
|
+
export function _generateInputLabelRequiredStyles(selector) {
|
|
39
|
+
if (!selector || !_isValidCssSelector(selector.trim())) return;
|
|
40
|
+
const selectorList = selector.trim().split(',');
|
|
41
|
+
const joinedSelector = selectorList.map(s => `${s.trim()}::after`).join(',\n');
|
|
42
|
+
const cssSelector = unsafeCSS(joinedSelector);
|
|
43
|
+
|
|
44
|
+
return css`
|
|
45
|
+
${cssSelector} {
|
|
46
|
+
background-image: var(--d2l-input-label-required-image);
|
|
47
|
+
bottom: 0.25rem;
|
|
48
|
+
content: "";
|
|
49
|
+
display: inline-block;
|
|
50
|
+
height: 0.3rem;
|
|
51
|
+
inset-inline-start: 0.15rem;
|
|
52
|
+
position: relative;
|
|
53
|
+
width: 0.25rem;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
|
|
11
58
|
export const inputLabelStyles = css`
|
|
12
|
-
.d2l-input-label
|
|
13
|
-
|
|
14
|
-
display: block;
|
|
15
|
-
font-size: 0.7rem;
|
|
16
|
-
font-weight: 700;
|
|
17
|
-
letter-spacing: 0.2px;
|
|
18
|
-
line-height: 0.9rem;
|
|
19
|
-
margin-block: 0 0.4rem;
|
|
20
|
-
margin-inline: 0;
|
|
21
|
-
padding: 0;
|
|
22
|
-
}
|
|
23
|
-
:host([required]) .d2l-input-label::after,
|
|
24
|
-
.d2l-input-label-required::after {
|
|
25
|
-
background-image: var(--d2l-input-label-required-image);
|
|
26
|
-
bottom: 0.25rem;
|
|
27
|
-
content: "";
|
|
28
|
-
display: inline-block;
|
|
29
|
-
height: 0.3rem;
|
|
30
|
-
inset-inline-start: 0.15rem;
|
|
31
|
-
position: relative;
|
|
32
|
-
width: 0.25rem;
|
|
33
|
-
}
|
|
59
|
+
${_generateInputLabelStyles('.d2l-input-label')}
|
|
60
|
+
${_generateInputLabelRequiredStyles(':host([required]) .d2l-input-label,.d2l-input-label-required')}
|
|
34
61
|
:host([skeleton]) .d2l-input-label.d2l-skeletize::before {
|
|
35
62
|
bottom: 0.25rem;
|
|
36
63
|
top: 0.15rem;
|
package/helpers/internal/css.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
export function _isValidCssSelector(selector) {
|
|
2
2
|
const partIsValid = (part) => {
|
|
3
|
-
const
|
|
3
|
+
const notRegex = /:not\((.+?)\)/;
|
|
4
|
+
const notMatches = part.match(notRegex);
|
|
5
|
+
if (notMatches) {
|
|
6
|
+
return [
|
|
7
|
+
part.substring(0, notMatches.index),
|
|
8
|
+
notMatches[1],
|
|
9
|
+
part.substring(notMatches.index + notMatches[1].length + 6)
|
|
10
|
+
].every((part, i) => (i !== 1 && part === '') || partIsValid(part));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const re = /([:a-zA-Z0-9-_ >.#]+)(\(?\[[a-zA-Z0-9-_="]+\]\)?)?([a-zA-Z0-9-_ >.#]+)?/g;
|
|
4
14
|
if (part === ':host') return true;
|
|
5
15
|
const match = part.match(re);
|
|
6
16
|
const isValid = !!match && match.length === 1 && match[0].length === part.length;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.263.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",
|