@orbitkit/components 0.0.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.
Files changed (57) hide show
  1. package/README.md +25 -0
  2. package/dist/astro/alert/Alert.astro +30 -0
  3. package/dist/astro/alert/AlertDescription.astro +10 -0
  4. package/dist/astro/alert/AlertTitle.astro +15 -0
  5. package/dist/astro/alert/alertVariants.ts +51 -0
  6. package/dist/astro/alert/index.ts +6 -0
  7. package/dist/astro/avatar/Avatar.astro +16 -0
  8. package/dist/astro/avatar/AvatarFallback.astro +18 -0
  9. package/dist/astro/avatar/AvatarImage.astro +14 -0
  10. package/dist/astro/avatar/avatarVariants.ts +23 -0
  11. package/dist/astro/avatar/index.ts +6 -0
  12. package/dist/astro/badge/Badge.astro +22 -0
  13. package/dist/astro/badge/badgeVariants.ts +37 -0
  14. package/dist/astro/badge/index.ts +4 -0
  15. package/dist/astro/breadcrumb/Breadcrumb.astro +12 -0
  16. package/dist/astro/breadcrumb/BreadcrumbEllipsis.astro +20 -0
  17. package/dist/astro/breadcrumb/BreadcrumbItem.astro +15 -0
  18. package/dist/astro/breadcrumb/BreadcrumbLink.astro +18 -0
  19. package/dist/astro/breadcrumb/BreadcrumbList.astro +18 -0
  20. package/dist/astro/breadcrumb/BreadcrumbPage.astro +18 -0
  21. package/dist/astro/breadcrumb/BreadcrumbSeparator.astro +17 -0
  22. package/dist/astro/breadcrumb/index.ts +17 -0
  23. package/dist/astro/button/Button.astro +29 -0
  24. package/dist/astro/button/buttonVariants.ts +61 -0
  25. package/dist/astro/button/index.ts +4 -0
  26. package/dist/astro/card/Card.astro +18 -0
  27. package/dist/astro/card/CardContent.astro +12 -0
  28. package/dist/astro/card/CardDescription.astro +12 -0
  29. package/dist/astro/card/CardFooter.astro +15 -0
  30. package/dist/astro/card/CardHeader.astro +12 -0
  31. package/dist/astro/card/CardTitle.astro +18 -0
  32. package/dist/astro/card/index.ts +15 -0
  33. package/dist/astro/checkbox/Checkbox.astro +38 -0
  34. package/dist/astro/checkbox/index.ts +3 -0
  35. package/dist/astro/input/Input.astro +18 -0
  36. package/dist/astro/input/index.ts +4 -0
  37. package/dist/astro/input/inputVariants.ts +30 -0
  38. package/dist/astro/label/Label.astro +14 -0
  39. package/dist/astro/label/index.ts +3 -0
  40. package/dist/astro/progress/Progress.astro +23 -0
  41. package/dist/astro/progress/index.ts +4 -0
  42. package/dist/astro/progress/progressContainer.astro +17 -0
  43. package/dist/astro/radio/Radio.astro +26 -0
  44. package/dist/astro/radio/index.ts +3 -0
  45. package/dist/astro/select/Option.astro +11 -0
  46. package/dist/astro/select/Select.astro +39 -0
  47. package/dist/astro/select/index.ts +5 -0
  48. package/dist/astro/select/selectVariants.ts +30 -0
  49. package/dist/astro/switch/Switch.astro +19 -0
  50. package/dist/astro/switch/index.ts +3 -0
  51. package/dist/astro/textarea/Textarea.astro +19 -0
  52. package/dist/astro/textarea/TextareaVariants.ts +30 -0
  53. package/dist/astro/textarea/index.ts +4 -0
  54. package/dist/index.d.ts +13 -0
  55. package/dist/index.js +94 -0
  56. package/dist/index.js.map +1 -0
  57. package/package.json +47 -0
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @orbitkit/components
2
+
3
+ _A collection of accessible, customizable, and lightweight UI components for Astro projects, powered by Tailwind CSS._
4
+
5
+ > **Warning:** Do not install or use this package directly in your projects. Use the Orbit CLI for integration and component management.
6
+
7
+ ## 🛠️ Customization
8
+
9
+ All components are styled with Tailwind CSS utility classes. You can easily override or extend styles via your project's Tailwind configuration.
10
+
11
+ ## 📖 Documentation
12
+
13
+ Full documentation is coming soon.
14
+
15
+ ## 🤝 Contributing
16
+
17
+ Pull requests are welcome! For major changes, please open an issue first.
18
+
19
+ ## 📜 License
20
+
21
+ This project is licensed under the MIT License - See [MIT License](https://github.com/NSMichelJ/orbitkit/blob/main/LICENSE) for details.
22
+
23
+ ---
24
+
25
+ <p align="center"><strong>Built with ❤️</strong></p>
@@ -0,0 +1,30 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { alertVariants } from "./alertVariants";
6
+
7
+ interface Props
8
+ extends HTMLAttributes<"div">,
9
+ VariantProps<typeof alertVariants> {}
10
+
11
+ const {
12
+ class: className,
13
+ variant,
14
+ rounded,
15
+ size,
16
+ direction,
17
+ border,
18
+ ...attrs
19
+ } = Astro.props;
20
+ ---
21
+
22
+ <div
23
+ {...attrs}
24
+ role="alert"
25
+ class={cn(
26
+ alertVariants({ variant, rounded, size, direction, border, className }),
27
+ )}
28
+ >
29
+ <slot />
30
+ </div>
@@ -0,0 +1,10 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"p"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <p {...attrs} class={cn(className)}><slot /></p>
@@ -0,0 +1,15 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"p"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <p
11
+ {...attrs}
12
+ class={cn("font-medium flex items-center justify-start gap-2", className)}
13
+ >
14
+ <slot />
15
+ </p>
@@ -0,0 +1,51 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const baseClass = "flex justify-start gap-y-1 gap-x-2 flex-wrap w-full";
4
+
5
+ const alertVariants = cva(baseClass, {
6
+ variants: {
7
+ variant: {
8
+ default: "bg-surface border-border text-foreground",
9
+ info: " text-blue-800 border-blue-300 bg-blue-50 dark:bg-gray-800 dark:text-blue-400 dark:border-blue-800",
10
+ danger:
11
+ "text-red-800 border-red-300 bg-red-50 dark:bg-gray-800 dark:text-red-400 dark:border-red-800",
12
+ success:
13
+ "text-green-800 border-green-300 bg-green-50 dark:bg-gray-800 dark:text-green-400 dark:border-green-800",
14
+ warning:
15
+ "text-yellow-800 border-yellow-300 bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300 dark:border-yellow-800",
16
+ },
17
+ rounded: {
18
+ none: "rounded-none",
19
+ xs: "rounded-xs",
20
+ sm: "rounded-sm",
21
+ md: "rounded-md",
22
+ lg: "rounded-lg",
23
+ xl: "rounded-xl",
24
+ full: "rounded-full",
25
+ },
26
+ size: {
27
+ xs: "p-3 text-xs",
28
+ sm: "p-3 text-sm",
29
+ md: "p-4 text-sm",
30
+ lg: "p-5 text-base",
31
+ xl: "p-5 text-lg",
32
+ },
33
+ direction: {
34
+ row: "flex-row",
35
+ col: "flex-col",
36
+ },
37
+ border: {
38
+ false: null,
39
+ true: "border",
40
+ },
41
+ },
42
+ defaultVariants: {
43
+ variant: "default",
44
+ size: "sm",
45
+ rounded: "lg",
46
+ direction: "col",
47
+ border: true,
48
+ },
49
+ });
50
+
51
+ export { alertVariants };
@@ -0,0 +1,6 @@
1
+ import Alert from "./Alert.astro";
2
+ import AlertDescription from "./AlertDescription.astro";
3
+ import AlertTitle from "./AlertTitle.astro";
4
+ import { alertVariants } from "./alertVariants";
5
+
6
+ export { Alert, AlertDescription, AlertTitle, alertVariants };
@@ -0,0 +1,16 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { avatarVariants } from "./avatarVariants";
6
+
7
+ interface Props
8
+ extends HTMLAttributes<"div">,
9
+ VariantProps<typeof avatarVariants> {}
10
+
11
+ const { class: className, variant, bordered, ...attrs } = Astro.props;
12
+ ---
13
+
14
+ <div {...attrs} class={cn(avatarVariants({ variant, bordered, className }))}>
15
+ <slot />
16
+ </div>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <div
11
+ {...attrs}
12
+ class={cn(
13
+ "absolute z-0 font-medium text-gray-600 dark:text-gray-300",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </div>
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"img"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <img
11
+ {...attrs}
12
+ class={cn("relative aspect-square object-cover z-10", className)}
13
+ onerror="this.style.display='none'"
14
+ />
@@ -0,0 +1,23 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const avatarBaseClass =
4
+ "relative inline-flex items-center justify-center size-10 overflow-hidden bg-secondary text-secondary-foreground z-10";
5
+
6
+ const avatarVariants = cva(avatarBaseClass, {
7
+ variants: {
8
+ variant: {
9
+ circular: "rounded-full",
10
+ square: "rounded-sm",
11
+ },
12
+ bordered: {
13
+ false: null,
14
+ true: "ring-2 ring-border",
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ variant: "circular",
19
+ bordered: false,
20
+ },
21
+ });
22
+
23
+ export { avatarVariants };
@@ -0,0 +1,6 @@
1
+ import Avatar from "./Avatar.astro";
2
+ import AvatarFallback from "./AvatarFallback.astro";
3
+ import AvatarImage from "./AvatarImage.astro";
4
+ import { avatarVariants } from "./avatarVariants";
5
+
6
+ export { Avatar, AvatarFallback, AvatarImage, avatarVariants };
@@ -0,0 +1,22 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { badgeVariants } from "./badgeVariants";
6
+
7
+ interface Props
8
+ extends HTMLAttributes<"div">,
9
+ HTMLAttributes<"a">,
10
+ VariantProps<typeof badgeVariants> {}
11
+
12
+ const { class: className, variant, rounded, size, ...attrs } = Astro.props;
13
+
14
+ const Comp = Astro.props.href ? "a" : "div";
15
+ ---
16
+
17
+ <Comp
18
+ {...attrs}
19
+ class={cn(badgeVariants({ variant, rounded, size, className }))}
20
+ >
21
+ <slot />
22
+ </Comp>
@@ -0,0 +1,37 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const classBase =
4
+ "inline-flex justify-center items-center gap-1 text-xs font-medium px-2.5 py-0.5";
5
+
6
+ const badgeVariants = cva(classBase, {
7
+ variants: {
8
+ variant: {
9
+ default: "bg-secondary text-secondary-foreground",
10
+ outline:
11
+ "bg-secondary text-secondary-foreground border-secondary-accent border",
12
+ },
13
+ rounded: {
14
+ none: "rounded-none",
15
+ xs: "rounded-xs",
16
+ sm: "rounded-sm",
17
+ md: "rounded-md",
18
+ lg: "rounded-lg",
19
+ xl: "rounded-xl",
20
+ full: "rounded-full",
21
+ },
22
+ size: {
23
+ xs: "text-xs [&_svg]:size-2.5",
24
+ sm: "text-sm [&_svg]:size-3",
25
+ md: "text-base [&_svg]:size-3",
26
+ lg: "text-lg [&_svg]:size-4",
27
+ xl: "text-xl [&_svg]:size-4",
28
+ },
29
+ },
30
+ defaultVariants: {
31
+ variant: "default",
32
+ rounded: "sm",
33
+ size: "xs",
34
+ },
35
+ });
36
+
37
+ export { badgeVariants };
@@ -0,0 +1,4 @@
1
+ import Badge from "./Badge.astro";
2
+ import { badgeVariants } from "./badgeVariants";
3
+
4
+ export { Badge, badgeVariants };
@@ -0,0 +1,12 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"nav"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <nav aria-label="breadcrumb" class={cn("w-max", className)}>
11
+ <slot />
12
+ </nav>
@@ -0,0 +1,20 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import type { HTMLAttributes } from "astro/types";
4
+
5
+ type Props = HTMLAttributes<"span">;
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <span
11
+ {...attrs}
12
+ role="presentation"
13
+ aria-hidden="true"
14
+ class={cn(
15
+ "flex size-6 items-center justify-center [&>svg]:size-4",
16
+ className,
17
+ )}
18
+ >
19
+ <slot> ... </slot>
20
+ </span>
@@ -0,0 +1,15 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"li"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <li
11
+ {...attrs}
12
+ class={cn("flex flex-row items-center justify-between gap-1", className)}
13
+ >
14
+ <slot />
15
+ </li>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"a"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <a
11
+ {...attrs}
12
+ class={cn(
13
+ "flex items-center justify-between gap-1 cursor-pointer hover:text-foreground [&_svg]:size-4",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </a>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"ol"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <ol
11
+ {...attrs}
12
+ class={cn(
13
+ "flex flex-row flex-wrap items-center gap-2 rtl:flex-row-reverse text-muted-foreground break-words font-medium",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </ol>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"span"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <spam
11
+ {...attrs}
12
+ class={cn(
13
+ "flex items-center justify-between gap-1 cursor-pointer text-foreground [&_svg]:size-4",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </spam>
@@ -0,0 +1,17 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import type { HTMLAttributes } from "astro/types";
4
+
5
+ type Props = HTMLAttributes<"li">;
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <li
11
+ {...attrs}
12
+ role="presentation"
13
+ aria-hidden="true"
14
+ class={cn("[&_svg]:size-4", className)}
15
+ >
16
+ <slot> / </slot>
17
+ </li>
@@ -0,0 +1,17 @@
1
+ import Breadcrumb from "./Breadcrumb.astro";
2
+ import BreadcrumbEllipsis from "./BreadcrumbEllipsis.astro";
3
+ import BreadcrumbItem from "./BreadcrumbItem.astro";
4
+ import BreadcrumbLink from "./BreadcrumbLink.astro";
5
+ import BreadcrumbList from "./BreadcrumbList.astro";
6
+ import BreadcrumbPage from "./BreadcrumbPage.astro";
7
+ import BreadcrumbSeparator from "./BreadcrumbSeparator.astro";
8
+
9
+ export {
10
+ Breadcrumb,
11
+ BreadcrumbEllipsis,
12
+ BreadcrumbItem,
13
+ BreadcrumbLink,
14
+ BreadcrumbList,
15
+ BreadcrumbPage,
16
+ BreadcrumbSeparator,
17
+ };
@@ -0,0 +1,29 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import type { HTMLAttributes } from "astro/types";
4
+ import { type VariantProps } from "class-variance-authority";
5
+ import buttonVariants from "./buttonVariants";
6
+
7
+ export interface Props
8
+ extends Omit<HTMLAttributes<"button">, "disabled">,
9
+ Omit<HTMLAttributes<"a">, "type">,
10
+ VariantProps<typeof buttonVariants> {}
11
+
12
+ const {
13
+ class: className,
14
+ variant,
15
+ size,
16
+ rounded,
17
+ disabled,
18
+ ...attrs
19
+ } = Astro.props;
20
+
21
+ const Comp = Astro.props.href ? "a" : "button";
22
+ ---
23
+
24
+ <Comp
25
+ {...attrs}
26
+ class={cn(buttonVariants({ variant, size, rounded, disabled, className }))}
27
+ >
28
+ <slot />
29
+ </Comp>
@@ -0,0 +1,61 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const baseClass =
4
+ "flex justify-center gap-1.5 items-center font-medium cursor-pointer outline-none border [&_svg]:pointer-events-none [&_svg]:shrink-0";
5
+
6
+ const buttonVariants = cva(baseClass, {
7
+ variants: {
8
+ variant: {
9
+ default: "border-primary text-primary-foreground bg-primary",
10
+ outline: "text-primary border-primary",
11
+ ghost: "text-primary bg-transparent border-transparent",
12
+ },
13
+ rounded: {
14
+ none: "rounded-none",
15
+ xs: "rounded-xs",
16
+ sm: "rounded-sm",
17
+ md: "rounded-md",
18
+ lg: "rounded-lg",
19
+ xl: "rounded-xl",
20
+ full: "rounded-full",
21
+ },
22
+ size: {
23
+ xs: "px-3 py-2 text-xs [&_svg]:size-3.5",
24
+ sm: "px-3 py-2 text-sm [&_svg]:size-4",
25
+ md: "px-5 py-2.5 text-sm [&_svg]:size-4",
26
+ lg: "px-5 py-3 text-base [&_svg]:size-[18px]",
27
+ xl: "px-6 py-3.5 text-base [&_svg]:size-[18px]",
28
+ },
29
+ disabled: {
30
+ false: null,
31
+ true: ["opacity-50", "cursor-not-allowed"],
32
+ },
33
+ },
34
+ compoundVariants: [
35
+ {
36
+ variant: "default",
37
+ disabled: false,
38
+ class: "hover:bg-primary-accent hover:border-primary-accent",
39
+ },
40
+ {
41
+ variant: "outline",
42
+ disabled: false,
43
+ class:
44
+ "hover:text-primary-foreground hover:bg-primary-accent hover:border-primary-accent",
45
+ },
46
+ {
47
+ variant: "ghost",
48
+ disabled: false,
49
+ class:
50
+ "hover:bg-primary hover:text-primary-foreground hover:border-primary",
51
+ },
52
+ ],
53
+ defaultVariants: {
54
+ variant: "default",
55
+ size: "sm",
56
+ rounded: "lg",
57
+ disabled: false,
58
+ },
59
+ });
60
+
61
+ export default buttonVariants;
@@ -0,0 +1,4 @@
1
+ import Button from "./Button.astro";
2
+ import buttonVariants from "./buttonVariants";
3
+
4
+ export { Button, buttonVariants };
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <div
11
+ {...attrs}
12
+ class={cn(
13
+ "bg-surface text-foreground border-border border rounded-lg shadow-sm",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </div>
@@ -0,0 +1,12 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <div {...attrs} class={cn("p-6", className)}>
11
+ <slot />
12
+ </div>
@@ -0,0 +1,12 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"p"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <p {...attrs} class={cn("font-normal text-muted-foreground", className)}>
11
+ <slot />
12
+ </p>
@@ -0,0 +1,15 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <div
11
+ {...attrs}
12
+ class={cn("p-6 pt-0 flex items-center justify-between gap-2", className)}
13
+ >
14
+ <slot />
15
+ </div>
@@ -0,0 +1,12 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <div {...attrs} class={cn("p-6 pb-0 flex flex-col gap-1", className)}>
11
+ <slot />
12
+ </div>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"h5"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <h5
11
+ {...attrs}
12
+ class={cn(
13
+ "flex items-center justify-start gap-2 text-2xl font-semibold tracking-tight",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </h5>
@@ -0,0 +1,15 @@
1
+ import Card from "./Card.astro";
2
+ import CardContent from "./CardContent.astro";
3
+ import CardDescription from "./CardDescription.astro";
4
+ import CardFooter from "./CardFooter.astro";
5
+ import CardHeader from "./CardHeader.astro";
6
+ import CardTitle from "./CardTitle.astro";
7
+
8
+ export {
9
+ Card,
10
+ CardContent,
11
+ CardDescription,
12
+ CardFooter,
13
+ CardHeader,
14
+ CardTitle,
15
+ };
@@ -0,0 +1,38 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends Omit<HTMLAttributes<"input">, "type"> {}
6
+
7
+ const { class: className, id, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <div class="inline-flex items-center">
11
+ <label class="relative flex cursor-pointer items-center" for={id}>
12
+ <input
13
+ {...attrs}
14
+ id={id}
15
+ type="checkbox"
16
+ class={"peer h-5 w-5 cursor-pointer transition-all appearance-none rounded border border-border checked:bg-primary disabled:opacity-50 disabled:cursor-not-allowed"}
17
+ />
18
+ <span
19
+ class={cn(
20
+ "text-primary-foreground pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform opacity-0 peer-checked:opacity-100",
21
+ className,
22
+ )}
23
+ >
24
+ <slot>
25
+ <svg
26
+ xmlns="http://www.w3.org/2000/svg"
27
+ class="h-3.5 w-3.5"
28
+ viewBox="0 0 24 24"
29
+ fill="none"
30
+ stroke="currentColor"
31
+ stroke-width="4"
32
+ >
33
+ <path d="M20 6 9 17l-5-5"></path>
34
+ </svg>
35
+ </slot>
36
+ </span>
37
+ </label>
38
+ </div>
@@ -0,0 +1,3 @@
1
+ import Checkbox from "./Checkbox.astro";
2
+
3
+ export { Checkbox };
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { inputVariants } from "./inputVariants";
6
+
7
+ interface Props
8
+ extends Omit<HTMLAttributes<"input">, "disabled">,
9
+ VariantProps<typeof inputVariants> {}
10
+
11
+ const { class: className, variant, disabled, ...attrs } = Astro.props;
12
+ ---
13
+
14
+ <input
15
+ {...attrs}
16
+ disabled={disabled}
17
+ class={cn(inputVariants({ variant, disabled, className }))}
18
+ />
@@ -0,0 +1,4 @@
1
+ import Input from "./Input.astro";
2
+ import { inputVariants } from "./inputVariants";
3
+
4
+ export { Input, inputVariants };
@@ -0,0 +1,30 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const baseClass =
4
+ "block w-full p-2.5 mb-2 text-sm rounded-lg outline-1 -outline-offset-1";
5
+
6
+ const inputVariants = cva(baseClass, {
7
+ variants: {
8
+ variant: {
9
+ default:
10
+ "text-foreground bg-input outline-input-border placeholder-input-placeholder",
11
+ },
12
+ disabled: {
13
+ false: null,
14
+ true: "bg-input/40 outline-input-border/40 text-muted-foreground cursor-not-allowed ",
15
+ },
16
+ },
17
+ compoundVariants: [
18
+ {
19
+ variant: "default",
20
+ disabled: false,
21
+ class: "focus:outline-2 focus:-outline-offset-2 focus:outline-primary",
22
+ },
23
+ ],
24
+ defaultVariants: {
25
+ variant: "default",
26
+ disabled: false,
27
+ },
28
+ });
29
+
30
+ export { inputVariants };
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"label"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <label
11
+ {...attrs}
12
+ class={cn("block mb-2 text-sm font-medium text-foreground", className)}
13
+ ><slot /></label
14
+ >
@@ -0,0 +1,3 @@
1
+ import Label from "./Label.astro";
2
+
3
+ export { Label };
@@ -0,0 +1,23 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ value?: number;
7
+ }
8
+
9
+ const { class: className, value = 50 } = Astro.props;
10
+
11
+ if (value < 0 || value > 100) {
12
+ throw new Error("Value must be between 0 and 100");
13
+ }
14
+ ---
15
+
16
+ <div
17
+ class={cn(
18
+ "flex items-center justify-center h-full overflow-hidden text-primary-foreground break-all bg-primary rounded-full",
19
+ className,
20
+ )}
21
+ style={{ width: `${value}%` }}
22
+ >
23
+ </div>
@@ -0,0 +1,4 @@
1
+ import Progress from "./Progress.astro";
2
+ import ProgressContainer from "./progressContainer.astro";
3
+
4
+ export { Progress, ProgressContainer };
@@ -0,0 +1,17 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {}
6
+
7
+ const { class: className } = Astro.props;
8
+ ---
9
+
10
+ <div
11
+ class={cn(
12
+ "flex-start flex h-2.5 w-full overflow-hidden rounded-full bg-muted font-sans text-xs font-medium",
13
+ className,
14
+ )}
15
+ >
16
+ <slot />
17
+ </div>
@@ -0,0 +1,26 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends Omit<HTMLAttributes<"input">, "type"> {}
6
+
7
+ const { class: className, id, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <div class="inline-flex items-center">
11
+ <label class="relative flex cursor-pointer items-center" for={id}>
12
+ <input
13
+ {...attrs}
14
+ id={id}
15
+ type="radio"
16
+ class="border-input-border checked:border-primary peer h-5 w-5 cursor-pointer appearance-none rounded-full border transition-all"
17
+ />
18
+ <span
19
+ class={cn(
20
+ "absolute bg-primary w-3 h-3 rounded-full opacity-0 peer-checked:opacity-100 transition-opacity duration-200 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
21
+ className,
22
+ )}
23
+ >
24
+ </span>
25
+ </label>
26
+ </div>
@@ -0,0 +1,3 @@
1
+ import Radio from "./Radio.astro";
2
+
3
+ export { Radio };
@@ -0,0 +1,11 @@
1
+ ---
2
+ import { type HTMLAttributes } from "astro/types";
3
+
4
+ interface Props extends Omit<HTMLAttributes<"select">, "type"> {}
5
+
6
+ const { ...attrs } = Astro.props;
7
+ ---
8
+
9
+ <option {...attrs}>
10
+ <slot />
11
+ </option>
@@ -0,0 +1,39 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { selectVariants } from "./selectVariants";
6
+
7
+ interface Props
8
+ extends Omit<HTMLAttributes<"select">, "disabled">,
9
+ VariantProps<typeof selectVariants> {}
10
+
11
+ const { class: className, multiple, variant, disabled, ...attrs } = Astro.props;
12
+ ---
13
+
14
+ <div class="relative">
15
+ <select
16
+ {...attrs}
17
+ disabled={disabled}
18
+ multiple={multiple}
19
+ class={cn(selectVariants({ variant, disabled, className }))}
20
+ >
21
+ <slot />
22
+ </select>
23
+
24
+ {
25
+ !multiple && (
26
+ <svg
27
+ xmlns="http://www.w3.org/2000/svg"
28
+ viewBox="0 0 24 24"
29
+ fill="none"
30
+ stroke="currentColor"
31
+ stroke-width="2"
32
+ class="text-input-placeholder absolute right-2.5 top-2.5 h-5 w-5"
33
+ >
34
+ <path d="m7 15 5 5 5-5" />
35
+ <path d="m7 9 5-5 5 5" />
36
+ </svg>
37
+ )
38
+ }
39
+ </div>
@@ -0,0 +1,5 @@
1
+ import Option from "./Option.astro";
2
+ import Select from "./Select.astro";
3
+ import { selectVariants } from "./selectVariants";
4
+
5
+ export { Option, Select, selectVariants };
@@ -0,0 +1,30 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const baseClass =
4
+ "block w-full p-2.5 mb-2 text-sm rounded-lg outline-1 -outline-offset-1 appearance-none";
5
+
6
+ const selectVariants = cva(baseClass, {
7
+ variants: {
8
+ variant: {
9
+ default:
10
+ "text-foreground bg-input outline-input-border placeholder-input-placeholder cursor-pointer",
11
+ },
12
+ disabled: {
13
+ false: null,
14
+ true: "bg-input/40 outline-input-border/40 text-muted-foreground cursor-not-allowed",
15
+ },
16
+ },
17
+ compoundVariants: [
18
+ {
19
+ variant: "default",
20
+ disabled: false,
21
+ class: "focus:outline-2 focus:-outline-offset-2 focus:outline-primary",
22
+ },
23
+ ],
24
+ defaultVariants: {
25
+ variant: "default",
26
+ disabled: false,
27
+ },
28
+ });
29
+
30
+ export { selectVariants };
@@ -0,0 +1,19 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends Omit<HTMLAttributes<"input">, "type"> {}
6
+
7
+ const { class: className, id, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <label class="inline-flex cursor-pointer items-center" id={id}>
11
+ <input {...attrs} id={id} type="checkbox" class="peer sr-only" />
12
+ <span
13
+ class={cn(
14
+ "relative w-11 h-6 bg-input-border rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
15
+ className,
16
+ )}
17
+ >
18
+ </span>
19
+ </label>
@@ -0,0 +1,3 @@
1
+ import Switch from "./Switch.astro";
2
+
3
+ export { Switch };
@@ -0,0 +1,19 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { textareaVariants } from "./TextareaVariants";
6
+
7
+ interface Props
8
+ extends Omit<HTMLAttributes<"textarea">, "disabled">,
9
+ VariantProps<typeof textareaVariants> {}
10
+
11
+ const { class: className, variant, disabled, ...attrs } = Astro.props;
12
+ ---
13
+
14
+ <textarea
15
+ {...attrs}
16
+ disabled={disabled}
17
+ class={cn(textareaVariants({ variant, disabled, className }))}
18
+ >
19
+ </textarea>
@@ -0,0 +1,30 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const baseClass =
4
+ "block w-full p-2.5 mb-2 text-sm rounded-lg outline-1 -outline-offset-1";
5
+
6
+ const textareaVariants = cva(baseClass, {
7
+ variants: {
8
+ variant: {
9
+ default:
10
+ "text-foreground bg-input outline-input-border placeholder-input-placeholder",
11
+ },
12
+ disabled: {
13
+ false: null,
14
+ true: "bg-input/40 outline-input-border/40 text-muted-foreground cursor-not-allowed ",
15
+ },
16
+ },
17
+ compoundVariants: [
18
+ {
19
+ variant: "default",
20
+ disabled: false,
21
+ class: "focus:outline-2 focus:-outline-offset-2 focus:outline-primary",
22
+ },
23
+ ],
24
+ defaultVariants: {
25
+ variant: "default",
26
+ disabled: false,
27
+ },
28
+ });
29
+
30
+ export { textareaVariants };
@@ -0,0 +1,4 @@
1
+ import Textarea from "./Textarea.astro";
2
+ import { textareaVariants } from "./TextareaVariants";
3
+
4
+ export { Textarea, textareaVariants };
@@ -0,0 +1,13 @@
1
+ interface ComponentRegistryEntry {
2
+ name: string;
3
+ version: string;
4
+ }
5
+
6
+ declare function getAllComponents(): ComponentRegistryEntry[];
7
+ declare function getComponentPath(componentName: string): string;
8
+ declare function checkComponentsInRegistry(components: string[]): Promise<{
9
+ valid: ComponentRegistryEntry[];
10
+ invalid: string[];
11
+ }>;
12
+
13
+ export { type ComponentRegistryEntry, checkComponentsInRegistry, getAllComponents, getComponentPath };
package/dist/index.js ADDED
@@ -0,0 +1,94 @@
1
+ // src/registry.json
2
+ var registry_default = {
3
+ components: [
4
+ {
5
+ name: "button",
6
+ version: "0.0.1"
7
+ },
8
+ {
9
+ name: "alert",
10
+ version: "0.0.1"
11
+ },
12
+ {
13
+ name: "badge",
14
+ version: "0.0.1"
15
+ },
16
+ {
17
+ name: "avatar",
18
+ version: "0.0.1"
19
+ },
20
+ {
21
+ name: "card",
22
+ version: "0.0.1"
23
+ },
24
+ {
25
+ name: "input",
26
+ version: "0.0.1"
27
+ },
28
+ {
29
+ name: "label",
30
+ version: "0.0.1"
31
+ },
32
+ {
33
+ name: "breadcrumb",
34
+ version: "0.0.1"
35
+ },
36
+ {
37
+ name: "progress",
38
+ version: "0.0.1"
39
+ },
40
+ {
41
+ name: "textarea",
42
+ version: "0.0.1"
43
+ },
44
+ {
45
+ name: "select",
46
+ version: "0.0.1"
47
+ },
48
+ {
49
+ name: "switch",
50
+ version: "0.0.1"
51
+ },
52
+ {
53
+ name: "checkbox",
54
+ version: "0.0.1"
55
+ },
56
+ {
57
+ name: "radio",
58
+ version: "0.0.1"
59
+ }
60
+ ]
61
+ };
62
+
63
+ // src/index.ts
64
+ import { fileURLToPath } from "node:url";
65
+ import path from "node:path";
66
+ var __dirname = path.dirname(fileURLToPath(import.meta.url));
67
+ function getAllComponents() {
68
+ return registry_default.components;
69
+ }
70
+ function getComponentPath(componentName) {
71
+ return path.join(__dirname, "astro", componentName);
72
+ }
73
+ async function checkComponentsInRegistry(components) {
74
+ const valid = [];
75
+ const invalid = [];
76
+ const allComponents = getAllComponents();
77
+ for (const component of components) {
78
+ const found = allComponents.find(
79
+ (c) => c.name.toLowerCase() === component.toLowerCase()
80
+ );
81
+ if (found) {
82
+ valid.push(found);
83
+ } else {
84
+ invalid.push(component);
85
+ }
86
+ }
87
+ return { valid, invalid };
88
+ }
89
+ export {
90
+ checkComponentsInRegistry,
91
+ getAllComponents,
92
+ getComponentPath
93
+ };
94
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/registry.json","../src/index.ts"],"sourcesContent":["{\n \"components\": [\n {\n \"name\": \"button\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"alert\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"badge\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"avatar\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"card\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"input\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"label\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"breadcrumb\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"progress\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"textarea\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"select\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"switch\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"checkbox\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"radio\",\n \"version\": \"0.0.1\"\n }\n ]\n}\n","import registry from \"@/registry.json\";\nimport { fileURLToPath } from \"node:url\";\n\nimport path from \"node:path\";\nimport { ComponentRegistryEntry } from \"./types/registry\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport function getAllComponents() {\n return registry.components as ComponentRegistryEntry[];\n}\n\nexport function getComponentPath(componentName: string) {\n return path.join(__dirname, \"astro\", componentName);\n}\n\nexport async function checkComponentsInRegistry(components: string[]) {\n const valid: ComponentRegistryEntry[] = [];\n const invalid: string[] = [];\n const allComponents = getAllComponents();\n\n for (const component of components) {\n const found = allComponents.find(\n (c) => c.name.toLowerCase() === component.toLowerCase(),\n );\n if (found) {\n valid.push(found);\n } else {\n invalid.push(component);\n }\n }\n\n return { valid, invalid };\n}\n\nexport { type ComponentRegistryEntry } from \"@/types/registry\";\n"],"mappings":";AAAA;AAAA,EACE,YAAc;AAAA,IACZ;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,IACb;AAAA,EACF;AACF;;;AC1DA,SAAS,qBAAqB;AAE9B,OAAO,UAAU;AAGjB,IAAM,YAAY,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC;AAEtD,SAAS,mBAAmB;AACjC,SAAO,iBAAS;AAClB;AAEO,SAAS,iBAAiB,eAAuB;AACtD,SAAO,KAAK,KAAK,WAAW,SAAS,aAAa;AACpD;AAEA,eAAsB,0BAA0B,YAAsB;AACpE,QAAM,QAAkC,CAAC;AACzC,QAAM,UAAoB,CAAC;AAC3B,QAAM,gBAAgB,iBAAiB;AAEvC,aAAW,aAAa,YAAY;AAClC,UAAM,QAAQ,cAAc;AAAA,MAC1B,CAAC,MAAM,EAAE,KAAK,YAAY,MAAM,UAAU,YAAY;AAAA,IACxD;AACA,QAAI,OAAO;AACT,YAAM,KAAK,KAAK;AAAA,IAClB,OAAO;AACL,cAAQ,KAAK,SAAS;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,QAAQ;AAC1B;","names":[]}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@orbitkit/components",
3
+ "version": "0.0.1",
4
+ "description": "Customizable UI components designed for seamless integration and scalability.",
5
+ "main": "./dist/index.js",
6
+ "type": "module",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./dist/*": "./dist/*"
14
+ },
15
+ "scripts": {
16
+ "build": "tsup",
17
+ "dev": "tsup --watch",
18
+ "format:check": "eslint . && prettier --check .",
19
+ "format:fix": "eslint --fix . && prettier --write .",
20
+ "components:link": "pnpm link . --global",
21
+ "components:unlink": "pnpm rm --global @orbitkit/components"
22
+ },
23
+ "keywords": [
24
+ "ui",
25
+ "kit",
26
+ "components",
27
+ "orbit",
28
+ "tailwind"
29
+ ],
30
+ "author": "NSMichelJ (Michelito)",
31
+ "license": "MIT",
32
+ "packageManager": "pnpm@10.9.0",
33
+ "devDependencies": {
34
+ "@types/fs-extra": "11.0.4",
35
+ "@types/node": "22.15.3",
36
+ "astro": "5.7.10",
37
+ "class-variance-authority": "0.7.1",
38
+ "clsx": "2.1.1",
39
+ "fs-extra": "11.3.0",
40
+ "tailwind-merge": "3.2.0",
41
+ "tailwindcss": "4.1.5",
42
+ "tsup": "8.4.0"
43
+ },
44
+ "files": [
45
+ "dist"
46
+ ]
47
+ }