vira 31.9.1 → 31.9.3
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.
|
@@ -113,6 +113,7 @@ export const ViraTabs = defineViraElement()({
|
|
|
113
113
|
display: flex;
|
|
114
114
|
align-items: center;
|
|
115
115
|
justify-content: center;
|
|
116
|
+
text-align: center;
|
|
116
117
|
position: relative;
|
|
117
118
|
color: ${cssVars['vira-tabs-inactive-color'].value};
|
|
118
119
|
font-size: ${viraFormCssVars['vira-form-medium-text-size'].value};
|
|
@@ -6,16 +6,10 @@ import { type ViraIconSvg } from './icon-svg.js';
|
|
|
6
6
|
* @category Internal
|
|
7
7
|
*/
|
|
8
8
|
export type LucideIconKey = keyof typeof lucideStaticImport;
|
|
9
|
-
/**
|
|
10
|
-
* An entry in {@link lucideIcons}.
|
|
11
|
-
*
|
|
12
|
-
* @category Internal
|
|
13
|
-
*/
|
|
14
|
-
export type LucideIconEntry = ViraIconSvg & ((options: Readonly<Record<string, string | number>>) => ViraIconSvg);
|
|
15
9
|
/**
|
|
16
10
|
* All [Lucide icons](https://lucide.dev) in a format compatible with `ViraIcon`. Each icon entry
|
|
17
|
-
* can be accessed directly
|
|
11
|
+
* can be accessed directly as a {@link ViraIconSvg}.
|
|
18
12
|
*
|
|
19
13
|
* @category Icon
|
|
20
14
|
*/
|
|
21
|
-
export declare const lucideIcons: Readonly<Record<LucideIconKey,
|
|
15
|
+
export declare const lucideIcons: Readonly<Record<LucideIconKey, ViraIconSvg>>;
|
|
@@ -14,7 +14,7 @@ function setSvgAttribute(svgString, attributeName, value) {
|
|
|
14
14
|
: svgString.replace(/<svg\b/, `<svg ${attributeName}="${value}"`);
|
|
15
15
|
}
|
|
16
16
|
function applySvgAttributes(svgString, attributes) {
|
|
17
|
-
return Object.entries(attributes).reduce((result, [key, value,]) => setSvgAttribute(result, key,
|
|
17
|
+
return Object.entries(attributes).reduce((result, [key, value,]) => setSvgAttribute(result, key, value), svgString);
|
|
18
18
|
}
|
|
19
19
|
function isLucideIconKey(key) {
|
|
20
20
|
return key in lucideStaticImport;
|
|
@@ -27,33 +27,17 @@ function getLucideIconSvg(key) {
|
|
|
27
27
|
return svg;
|
|
28
28
|
}
|
|
29
29
|
function createLucideIconEntry(iconKey) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
name: iconKey,
|
|
34
|
-
svgTemplate: html `
|
|
35
|
-
${unsafeHTML(applySvgAttributes(svgString, {
|
|
36
|
-
...defaultLucideAttributes,
|
|
37
|
-
...options,
|
|
38
|
-
}))}
|
|
39
|
-
`,
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
Object.defineProperty(configureIconCallback, 'name', {
|
|
43
|
-
value: iconKey,
|
|
44
|
-
writable: false,
|
|
45
|
-
configurable: true,
|
|
46
|
-
});
|
|
47
|
-
return Object.assign(configureIconCallback, {
|
|
30
|
+
return {
|
|
31
|
+
name: iconKey,
|
|
48
32
|
svgTemplate: html `
|
|
49
|
-
${unsafeHTML(applySvgAttributes(
|
|
33
|
+
${unsafeHTML(applySvgAttributes(getLucideIconSvg(iconKey), defaultLucideAttributes))}
|
|
50
34
|
`,
|
|
51
|
-
}
|
|
35
|
+
};
|
|
52
36
|
}
|
|
53
37
|
const lucideIconCache = new Map();
|
|
54
38
|
/**
|
|
55
39
|
* All [Lucide icons](https://lucide.dev) in a format compatible with `ViraIcon`. Each icon entry
|
|
56
|
-
* can be accessed directly
|
|
40
|
+
* can be accessed directly as a {@link ViraIconSvg}.
|
|
57
41
|
*
|
|
58
42
|
* @category Icon
|
|
59
43
|
*/
|
|
@@ -35,7 +35,7 @@ export var ViraColorVariant;
|
|
|
35
35
|
* @category Internal
|
|
36
36
|
*/
|
|
37
37
|
export const viraColorVariantToColorName = {
|
|
38
|
-
[ViraColorVariant.Accent]: ViraThemeColorName.
|
|
38
|
+
[ViraColorVariant.Accent]: ViraThemeColorName.accent,
|
|
39
39
|
[ViraColorVariant.Neutral]: ViraThemeColorName.grey,
|
|
40
40
|
[ViraColorVariant.Danger]: ViraThemeColorName.red,
|
|
41
41
|
[ViraColorVariant.Warning]: ViraThemeColorName.yellow,
|