@starwind-ui/core 1.11.0 → 1.11.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,17 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
2
3
|
import { tv } from "tailwind-variants";
|
|
3
4
|
|
|
4
5
|
export const avatarFallback = tv({
|
|
5
6
|
base: "absolute inset-0.5 flex items-center justify-center rounded-full font-medium",
|
|
6
7
|
});
|
|
7
8
|
|
|
8
|
-
interface Props {
|
|
9
|
+
interface Props extends HTMLAttributes<"div"> {
|
|
9
10
|
class?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
const { class: className } = Astro.props;
|
|
13
|
+
const { class: className, ...rest } = Astro.props;
|
|
13
14
|
---
|
|
14
15
|
|
|
15
|
-
<div class={avatarFallback({ class: className })} data-slot="avatar-fallback">
|
|
16
|
+
<div class={avatarFallback({ class: className })} data-slot="avatar-fallback" {...rest}>
|
|
16
17
|
<slot />
|
|
17
18
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
2
3
|
import { Image } from "astro:assets";
|
|
3
4
|
import { tv } from "tailwind-variants";
|
|
4
5
|
|
|
@@ -10,9 +11,9 @@ type WithSrc = BaseProps & { src: string; image?: never };
|
|
|
10
11
|
|
|
11
12
|
type WithImage = BaseProps & { src?: never; image: ImageMetadata };
|
|
12
13
|
|
|
13
|
-
type Props = WithSrc | WithImage;
|
|
14
|
+
type Props = HTMLAttributes<"img"> & (WithSrc | WithImage);
|
|
14
15
|
|
|
15
|
-
const { src, image, alt, class: className } = Astro.props;
|
|
16
|
+
const { src, image, alt, class: className, width, height, ...rest } = Astro.props;
|
|
16
17
|
|
|
17
18
|
if (!src && !image) {
|
|
18
19
|
throw new Error("Either 'src' or 'image' is required for an avatar image.");
|
|
@@ -30,6 +31,7 @@ if (!src && !image) {
|
|
|
30
31
|
height={64}
|
|
31
32
|
onerror="this.style.display='none'"
|
|
32
33
|
data-slot="avatar-image"
|
|
34
|
+
{...rest}
|
|
33
35
|
/>
|
|
34
36
|
)
|
|
35
37
|
}
|
|
@@ -41,6 +43,7 @@ if (!src && !image) {
|
|
|
41
43
|
class={avatarImage({ class: className })}
|
|
42
44
|
width={64}
|
|
43
45
|
data-slot="avatar-image"
|
|
46
|
+
{...rest}
|
|
44
47
|
/>
|
|
45
48
|
)
|
|
46
49
|
}
|
|
@@ -163,7 +163,7 @@ const { class: className, openOnHover = false, closeDelay = 200, ...rest } = Ast
|
|
|
163
163
|
if (item && !(item as HTMLElement).hasAttribute("data-disabled")) {
|
|
164
164
|
// Close the dropdown after item selection
|
|
165
165
|
this.closeDropdown();
|
|
166
|
-
console.log("click closing");
|
|
166
|
+
// console.log("click closing");
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
|
|
@@ -104,7 +104,7 @@ const {
|
|
|
104
104
|
|
|
105
105
|
private handleChange(e: Event) {
|
|
106
106
|
const target = e.target as HTMLInputElement;
|
|
107
|
-
console.log("target", target);
|
|
107
|
+
// console.log("target", target);
|
|
108
108
|
if (target.type !== "radio") return;
|
|
109
109
|
|
|
110
110
|
// Update the data-value attribute
|