@starwind-ui/core 1.10.1 → 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.
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/src/components/accordion/AccordionTrigger.astro +3 -1
- package/dist/src/components/alert-dialog/AlertDialogContent.astro +9 -7
- package/dist/src/components/avatar/AvatarFallback.astro +4 -3
- package/dist/src/components/avatar/AvatarImage.astro +5 -2
- package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +6 -2
- package/dist/src/components/carousel/CarouselNext.astro +6 -2
- package/dist/src/components/carousel/CarouselPrevious.astro +6 -2
- package/dist/src/components/dialog/DialogContent.astro +12 -8
- package/dist/src/components/dropdown/Dropdown.astro +1 -1
- package/dist/src/components/kbd/Kbd.astro +21 -0
- package/dist/src/components/kbd/KbdGroup.astro +16 -0
- package/dist/src/components/kbd/index.ts +11 -0
- package/dist/src/components/pagination/PaginationEllipsis.astro +6 -2
- package/dist/src/components/pagination/PaginationNext.astro +3 -1
- package/dist/src/components/pagination/PaginationPrevious.astro +3 -1
- package/dist/src/components/radio-group/RadioGroup.astro +1 -1
- package/dist/src/components/radio-group/RadioGroupItem.astro +3 -1
- package/dist/src/components/select/SelectItem.astro +3 -1
- package/dist/src/components/select/SelectTrigger.astro +3 -1
- package/dist/src/components/sheet/SheetContent.astro +6 -2
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -6,28 +6,28 @@ import { fileURLToPath } from "url";
|
|
|
6
6
|
var registry_default = {
|
|
7
7
|
$schema: "https://starwind.dev/registry-schema.json",
|
|
8
8
|
components: [
|
|
9
|
-
{ name: "accordion", type: "component", version: "1.3.
|
|
9
|
+
{ name: "accordion", type: "component", version: "1.3.2", dependencies: [] },
|
|
10
10
|
{ name: "alert", type: "component", version: "1.3.0", dependencies: [] },
|
|
11
11
|
{
|
|
12
12
|
name: "alert-dialog",
|
|
13
13
|
type: "component",
|
|
14
|
-
version: "1.0.
|
|
14
|
+
version: "1.0.1",
|
|
15
15
|
dependencies: ["@starwind-ui/core/button@^2.1.0"]
|
|
16
16
|
},
|
|
17
17
|
{ name: "aspect-ratio", type: "component", version: "1.0.0", dependencies: [] },
|
|
18
18
|
{ name: "avatar", type: "component", version: "1.2.0", dependencies: [] },
|
|
19
19
|
{ name: "badge", type: "component", version: "1.3.0", dependencies: [] },
|
|
20
|
-
{ name: "breadcrumb", type: "component", version: "1.1.
|
|
20
|
+
{ name: "breadcrumb", type: "component", version: "1.1.1", dependencies: [] },
|
|
21
21
|
{ name: "button", type: "component", version: "2.2.0", dependencies: [] },
|
|
22
22
|
{ name: "card", type: "component", version: "1.3.0", dependencies: [] },
|
|
23
23
|
{
|
|
24
24
|
name: "carousel",
|
|
25
25
|
type: "component",
|
|
26
|
-
version: "1.0.
|
|
26
|
+
version: "1.0.1",
|
|
27
27
|
dependencies: ["@starwind-ui/core/button@^2.1.0", "embla-carousel@^8.6.0"]
|
|
28
28
|
},
|
|
29
29
|
{ name: "checkbox", type: "component", version: "1.4.0", dependencies: [] },
|
|
30
|
-
{ name: "dialog", type: "component", version: "1.4.
|
|
30
|
+
{ name: "dialog", type: "component", version: "1.4.1", dependencies: [] },
|
|
31
31
|
{ name: "dropdown", type: "component", version: "1.2.0", dependencies: [] },
|
|
32
32
|
{ name: "dropzone", type: "component", version: "1.2.0", dependencies: [] },
|
|
33
33
|
{ name: "input", type: "component", version: "1.3.0", dependencies: [] },
|
|
@@ -37,16 +37,17 @@ var registry_default = {
|
|
|
37
37
|
version: "1.0.0",
|
|
38
38
|
dependencies: ["@starwind-ui/core/separator@^1.0.0"]
|
|
39
39
|
},
|
|
40
|
+
{ name: "kbd", type: "component", version: "1.0.0", dependencies: [] },
|
|
40
41
|
{ name: "label", type: "component", version: "1.2.0", dependencies: [] },
|
|
41
|
-
{ name: "pagination", type: "component", version: "3.0.
|
|
42
|
+
{ name: "pagination", type: "component", version: "3.0.1", dependencies: [] },
|
|
42
43
|
{ name: "progress", type: "component", version: "1.1.0", dependencies: [] },
|
|
43
|
-
{ name: "radio-group", type: "component", version: "1.2.
|
|
44
|
-
{ name: "select", type: "component", version: "1.6.
|
|
44
|
+
{ name: "radio-group", type: "component", version: "1.2.1", dependencies: [] },
|
|
45
|
+
{ name: "select", type: "component", version: "1.6.1", dependencies: [] },
|
|
45
46
|
{ name: "separator", type: "component", version: "1.0.0", dependencies: [] },
|
|
46
47
|
{
|
|
47
48
|
name: "sheet",
|
|
48
49
|
type: "component",
|
|
49
|
-
version: "1.1.
|
|
50
|
+
version: "1.1.1",
|
|
50
51
|
dependencies: ["@starwind-ui/core/dialog@^1.3.0"]
|
|
51
52
|
},
|
|
52
53
|
{ name: "skeleton", type: "component", version: "1.2.0", dependencies: [] },
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/registry.json"],"sourcesContent":["import { join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport componentRegistry from \"./registry.json\" with { type: \"json\" };\n\n/**\n * Component metadata interface describing a Starwind UI component\n */\nexport interface ComponentMeta {\n name: string;\n version: string;\n type: \"component\";\n dependencies: string[];\n}\n\n/**\n * Registry interface containing all available components\n */\nexport interface Registry {\n components: ComponentMeta[];\n}\n\nconst __dirname = fileURLToPath(new URL(\".\", import.meta.url));\n\n/**\n * Get the absolute path to a component file\n * @param {string} componentName - The name of the component\n * @param {string} fileName - The name of the file within the component\n * @returns {string} The absolute path to the component file\n */\nexport const getComponentPath = (componentName: string, fileName: string): string => {\n // In production (when installed as a dependency), the components will be in dist/src/components\n // In development, they will be in src/components\n const componentsDir = __dirname.includes(\"dist\") ? \"src/components\" : \"src/components\";\n return join(__dirname, componentsDir, componentName, fileName);\n};\n\n/**\n * Map of all components and their metadata from registry\n */\nexport const registry = componentRegistry.components as ComponentMeta[];\n","{\n \"$schema\": \"https://starwind.dev/registry-schema.json\",\n \"components\": [\n { \"name\": \"accordion\", \"type\": \"component\", \"version\": \"1.3.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/registry.json"],"sourcesContent":["import { join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport componentRegistry from \"./registry.json\" with { type: \"json\" };\n\n/**\n * Component metadata interface describing a Starwind UI component\n */\nexport interface ComponentMeta {\n name: string;\n version: string;\n type: \"component\";\n dependencies: string[];\n}\n\n/**\n * Registry interface containing all available components\n */\nexport interface Registry {\n components: ComponentMeta[];\n}\n\nconst __dirname = fileURLToPath(new URL(\".\", import.meta.url));\n\n/**\n * Get the absolute path to a component file\n * @param {string} componentName - The name of the component\n * @param {string} fileName - The name of the file within the component\n * @returns {string} The absolute path to the component file\n */\nexport const getComponentPath = (componentName: string, fileName: string): string => {\n // In production (when installed as a dependency), the components will be in dist/src/components\n // In development, they will be in src/components\n const componentsDir = __dirname.includes(\"dist\") ? \"src/components\" : \"src/components\";\n return join(__dirname, componentsDir, componentName, fileName);\n};\n\n/**\n * Map of all components and their metadata from registry\n */\nexport const registry = componentRegistry.components as ComponentMeta[];\n","{\n \"$schema\": \"https://starwind.dev/registry-schema.json\",\n \"components\": [\n { \"name\": \"accordion\", \"type\": \"component\", \"version\": \"1.3.2\", \"dependencies\": [] },\n { \"name\": \"alert\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n {\n \"name\": \"alert-dialog\",\n \"type\": \"component\",\n \"version\": \"1.0.1\",\n \"dependencies\": [\"@starwind-ui/core/button@^2.1.0\"]\n },\n { \"name\": \"aspect-ratio\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"avatar\", \"type\": \"component\", \"version\": \"1.2.0\", \"dependencies\": [] },\n { \"name\": \"badge\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n { \"name\": \"breadcrumb\", \"type\": \"component\", \"version\": \"1.1.1\", \"dependencies\": [] },\n { \"name\": \"button\", \"type\": \"component\", \"version\": \"2.2.0\", \"dependencies\": [] },\n { \"name\": \"card\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n {\n \"name\": \"carousel\",\n \"type\": \"component\",\n \"version\": \"1.0.1\",\n \"dependencies\": [\"@starwind-ui/core/button@^2.1.0\", \"embla-carousel@^8.6.0\"]\n },\n { \"name\": \"checkbox\", \"type\": \"component\", \"version\": \"1.4.0\", \"dependencies\": [] },\n { \"name\": \"dialog\", \"type\": \"component\", \"version\": \"1.4.1\", \"dependencies\": [] },\n { \"name\": \"dropdown\", \"type\": \"component\", \"version\": \"1.2.0\", \"dependencies\": [] },\n { \"name\": \"dropzone\", \"type\": \"component\", \"version\": \"1.2.0\", \"dependencies\": [] },\n { \"name\": \"input\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n {\n \"name\": \"item\",\n \"type\": \"component\",\n \"version\": \"1.0.0\",\n \"dependencies\": [\"@starwind-ui/core/separator@^1.0.0\"]\n },\n { \"name\": \"kbd\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"label\", \"type\": \"component\", \"version\": \"1.2.0\", \"dependencies\": [] },\n { \"name\": \"pagination\", \"type\": \"component\", \"version\": \"3.0.1\", \"dependencies\": [] },\n { \"name\": \"progress\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n { \"name\": \"radio-group\", \"type\": \"component\", \"version\": \"1.2.1\", \"dependencies\": [] },\n { \"name\": \"select\", \"type\": \"component\", \"version\": \"1.6.1\", \"dependencies\": [] },\n { \"name\": \"separator\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n {\n \"name\": \"sheet\",\n \"type\": \"component\",\n \"version\": \"1.1.1\",\n \"dependencies\": [\"@starwind-ui/core/dialog@^1.3.0\"]\n },\n { \"name\": \"skeleton\", \"type\": \"component\", \"version\": \"1.2.0\", \"dependencies\": [] },\n { \"name\": \"spinner\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"switch\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n { \"name\": \"table\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n { \"name\": \"tabs\", \"type\": \"component\", \"version\": \"1.4.0\", \"dependencies\": [] },\n { \"name\": \"textarea\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n { \"name\": \"tooltip\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] }\n ]\n}\n"],"mappings":"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","names":[]}
|
|
@@ -26,5 +26,7 @@ const { class: className, ...rest } = Astro.props;
|
|
|
26
26
|
{...rest}
|
|
27
27
|
>
|
|
28
28
|
<slot />
|
|
29
|
-
<
|
|
29
|
+
<slot name="icon">
|
|
30
|
+
<ChevronDown class="size-5 shrink-0 transition-transform duration-200" />
|
|
31
|
+
</slot>
|
|
30
32
|
</button>
|
|
@@ -30,13 +30,15 @@ const { class: className, animationDuration = 200, ...rest } = Astro.props;
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
32
|
<!-- dialog overlay -->
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
<slot name="backdrop">
|
|
34
|
+
<div
|
|
35
|
+
class={alertDialogBackdrop()}
|
|
36
|
+
data-state="closed"
|
|
37
|
+
data-slot="alert-dialog-backdrop"
|
|
38
|
+
style={{ animationDuration: `${animationDuration}ms` }}
|
|
39
|
+
>
|
|
40
|
+
</div>
|
|
41
|
+
</slot>
|
|
40
42
|
|
|
41
43
|
<dialog
|
|
42
44
|
class={alertDialogContent({ class: className })}
|
|
@@ -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
|
}
|
|
@@ -19,6 +19,10 @@ const { class: className, ...rest } = Astro.props;
|
|
|
19
19
|
data-slot="breadcrumb-ellipsis"
|
|
20
20
|
{...rest}
|
|
21
21
|
>
|
|
22
|
-
<
|
|
23
|
-
|
|
22
|
+
<slot name="icon">
|
|
23
|
+
<Dots />
|
|
24
|
+
</slot>
|
|
25
|
+
<slot>
|
|
26
|
+
<span class="sr-only">More</span>
|
|
27
|
+
</slot>
|
|
24
28
|
</span>
|
|
@@ -28,6 +28,10 @@ const { class: className = "", variant = "outline", size = "icon", ...rest } = A
|
|
|
28
28
|
aria-label="Next slide"
|
|
29
29
|
{...rest}
|
|
30
30
|
>
|
|
31
|
-
<
|
|
32
|
-
|
|
31
|
+
<slot name="icon">
|
|
32
|
+
<ArrowRight />
|
|
33
|
+
</slot>
|
|
34
|
+
<slot>
|
|
35
|
+
<span class="sr-only">Next slide</span>
|
|
36
|
+
</slot>
|
|
33
37
|
</Button>
|
|
@@ -28,6 +28,10 @@ const { class: className = "", variant = "outline", size = "icon", ...rest } = A
|
|
|
28
28
|
aria-label="Previous slide"
|
|
29
29
|
{...rest}
|
|
30
30
|
>
|
|
31
|
-
<
|
|
32
|
-
|
|
31
|
+
<slot name="icon">
|
|
32
|
+
<ArrowLeft />
|
|
33
|
+
</slot>
|
|
34
|
+
<slot>
|
|
35
|
+
<span class="sr-only">Previous slide</span>
|
|
36
|
+
</slot>
|
|
33
37
|
</Button>
|
|
@@ -40,13 +40,15 @@ const { class: className, animationDuration = 200, ...rest } = Astro.props;
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
42
|
<!-- dialog overlay -->
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
<slot name="backdrop">
|
|
44
|
+
<div
|
|
45
|
+
class={dialogBackdrop()}
|
|
46
|
+
data-state="closed"
|
|
47
|
+
data-slot="dialog-backdrop"
|
|
48
|
+
style={{ animationDuration: `${animationDuration}ms` }}
|
|
49
|
+
>
|
|
50
|
+
</div>
|
|
51
|
+
</slot>
|
|
50
52
|
|
|
51
53
|
<dialog
|
|
52
54
|
class={dialogContent({ class: className })}
|
|
@@ -57,7 +59,9 @@ const { class: className, animationDuration = 200, ...rest } = Astro.props;
|
|
|
57
59
|
>
|
|
58
60
|
<slot />
|
|
59
61
|
<button type="button" class={dialogCloseButton()} data-dialog-close aria-label="Close dialog">
|
|
60
|
-
<
|
|
62
|
+
<slot name="icon">
|
|
63
|
+
<X class="size-5 transition-opacity" />
|
|
64
|
+
</slot>
|
|
61
65
|
<span class="sr-only">Close</span>
|
|
62
66
|
</button>
|
|
63
67
|
</dialog>
|
|
@@ -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
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"kbd">;
|
|
6
|
+
|
|
7
|
+
export const kbd = tv({
|
|
8
|
+
base: [
|
|
9
|
+
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none",
|
|
10
|
+
"bg-muted text-muted-foreground",
|
|
11
|
+
"[&_svg:not([class*='size-'])]:size-3",
|
|
12
|
+
"[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
|
|
13
|
+
],
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const { class: className, ...rest } = Astro.props;
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<kbd class={kbd({ class: className })} data-slot="kbd" {...rest}>
|
|
20
|
+
<slot />
|
|
21
|
+
</kbd>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"kbd">;
|
|
6
|
+
|
|
7
|
+
export const kbdGroup = tv({
|
|
8
|
+
base: "inline-flex items-center gap-1",
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const { class: className, ...rest } = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<kbd class={kbdGroup({ class: className })} data-slot="kbd-group" {...rest}>
|
|
15
|
+
<slot />
|
|
16
|
+
</kbd>
|
|
@@ -16,6 +16,10 @@ const { class: className, ...rest } = Astro.props;
|
|
|
16
16
|
data-slot="pagination-ellipsis"
|
|
17
17
|
{...rest}
|
|
18
18
|
>
|
|
19
|
-
<
|
|
20
|
-
|
|
19
|
+
<slot name="icon">
|
|
20
|
+
<Dots class="size-4" />
|
|
21
|
+
</slot>
|
|
22
|
+
<slot>
|
|
23
|
+
<span class="sr-only">More pages</span>
|
|
24
|
+
</slot>
|
|
21
25
|
</span>
|
|
@@ -20,5 +20,7 @@ const { class: className, size = "md", ...rest } = Astro.props;
|
|
|
20
20
|
{...rest}
|
|
21
21
|
>
|
|
22
22
|
<slot />
|
|
23
|
-
<
|
|
23
|
+
<slot name="icon">
|
|
24
|
+
<ChevronRight class="size-4 transition-transform group-hover:translate-x-1" />
|
|
25
|
+
</slot>
|
|
24
26
|
</PaginationLink>
|
|
@@ -19,6 +19,8 @@ const { class: className, size = "md", ...rest } = Astro.props;
|
|
|
19
19
|
data-slot="pagination-previous"
|
|
20
20
|
{...rest}
|
|
21
21
|
>
|
|
22
|
-
<
|
|
22
|
+
<slot name="icon">
|
|
23
|
+
<ChevronLeft class="size-4 transition-transform group-hover:-translate-x-1" />
|
|
24
|
+
</slot>
|
|
23
25
|
<slot />
|
|
24
26
|
</PaginationLink>
|
|
@@ -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
|
|
@@ -122,6 +122,8 @@ const {
|
|
|
122
122
|
{...rest}
|
|
123
123
|
/>
|
|
124
124
|
<span class={radioControl({ variant, class: className })} data-slot="radio-group-item-control">
|
|
125
|
-
<
|
|
125
|
+
<slot name="icon">
|
|
126
|
+
<CircleFilled class={radioIndicator({ size })} />
|
|
127
|
+
</slot>
|
|
126
128
|
</span>
|
|
127
129
|
</div>
|
|
@@ -63,7 +63,9 @@ export const sheetCloseButton = tv({
|
|
|
63
63
|
---
|
|
64
64
|
|
|
65
65
|
<!-- dialog overlay -->
|
|
66
|
-
<
|
|
66
|
+
<slot name="backdrop">
|
|
67
|
+
<div class={dialogBackdrop()} data-state="closed" data-slot="dialog-backdrop"></div>
|
|
68
|
+
</slot>
|
|
67
69
|
|
|
68
70
|
<dialog
|
|
69
71
|
class={sheetContent({
|
|
@@ -82,7 +84,9 @@ export const sheetCloseButton = tv({
|
|
|
82
84
|
data-slot="sheet-close"
|
|
83
85
|
aria-label="Close dialog"
|
|
84
86
|
>
|
|
85
|
-
<
|
|
87
|
+
<slot name="icon">
|
|
88
|
+
<X class="size-5 transition-opacity" />
|
|
89
|
+
</slot>
|
|
86
90
|
<span class="sr-only">Close</span>
|
|
87
91
|
</button>
|
|
88
92
|
</dialog>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starwind-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.1",
|
|
4
4
|
"description": "Starwind UI core components and registry",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"dev": "tsup --watch",
|
|
41
41
|
"core:link": "pnpm link --global",
|
|
42
42
|
"core:unlink": "pnpm rm --global @starwind-ui/core",
|
|
43
|
-
"sync:demo": "pnpm exec starwind sync src/components ../../apps/demo/src/components/starwind",
|
|
44
43
|
"publish:beta": "pnpm publish --tag beta --access public",
|
|
45
44
|
"publish:next": "pnpm publish --tag next --access public",
|
|
46
45
|
"publish:release": "pnpm publish --access public"
|