vira 25.4.3 → 25.5.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,3 +1,4 @@
|
|
|
1
|
+
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
1
2
|
import { type ViraIconSvg } from '../icons/index.js';
|
|
2
3
|
/**
|
|
3
4
|
* Button styles available for {@link ViraButton}.
|
|
@@ -16,8 +17,16 @@ export declare enum ViraButtonStyle {
|
|
|
16
17
|
* @see https://electrovir.github.io/element-vir/vira/book/elements/vira-button
|
|
17
18
|
*/
|
|
18
19
|
export declare const ViraButton: import("element-vir").DeclarativeElementDefinition<"vira-button", {
|
|
19
|
-
text
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
text: string;
|
|
21
|
+
} & PartialWithUndefined<{
|
|
22
|
+
icon: Pick<ViraIconSvg, "svgTemplate">;
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
buttonStyle: ViraButtonStyle;
|
|
25
|
+
/**
|
|
26
|
+
* When set to `true`, the given icon (if any) will take up its full dimensions, potentially
|
|
27
|
+
* increasing the button's size.
|
|
28
|
+
*
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
expandToFitIcon: boolean;
|
|
32
|
+
}>, {}, {}, "vira-button-outline-style" | "vira-button-disabled" | "vira-button-expand-to-fit-icon", "vira-button-primary-color" | "vira-button-primary-hover-color" | "vira-button-primary-active-color" | "vira-button-secondary-color" | "vira-button-padding" | "vira-button-internal-foreground-color" | "vira-button-internal-background-color", readonly []>;
|
|
@@ -29,6 +29,7 @@ export const ViraButton = defineViraElement()({
|
|
|
29
29
|
hostClasses: {
|
|
30
30
|
'vira-button-outline-style': ({ inputs }) => inputs.buttonStyle === ViraButtonStyle.Outline,
|
|
31
31
|
'vira-button-disabled': ({ inputs }) => !!inputs.disabled,
|
|
32
|
+
'vira-button-expand-to-fit-icon': ({ inputs }) => !!inputs.expandToFitIcon,
|
|
32
33
|
},
|
|
33
34
|
cssVars: {
|
|
34
35
|
/** On the default button style this is the background color. */
|
|
@@ -106,6 +107,14 @@ export const ViraButton = defineViraElement()({
|
|
|
106
107
|
button ${ViraIcon} + .text-template {
|
|
107
108
|
margin-left: 8px;
|
|
108
109
|
}
|
|
110
|
+
|
|
111
|
+
:host(:not(.${hostClasses['vira-button-expand-to-fit-icon'].name})) {
|
|
112
|
+
& ${ViraIcon} {
|
|
113
|
+
height: 0;
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
109
118
|
`,
|
|
110
119
|
render: ({ inputs }) => {
|
|
111
120
|
const iconTemplate = inputs.icon
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vira",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.5.0",
|
|
4
4
|
"description": "A simple and highly versatile design system using element-vir.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"vite-tsconfig-paths": "^5.1.4"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"element-vir": "^25.
|
|
69
|
+
"element-vir": "^25.5.0"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=22"
|