@orbitkit/components 0.2.0-beta.1 → 0.2.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.
@@ -2,14 +2,17 @@
2
2
  import { cn } from "@/utils/cn";
3
3
  import type { HTMLAttributes } from "astro/types";
4
4
 
5
- interface Props extends HTMLAttributes<"div"> {}
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ isOpen?: boolean;
7
+ }
6
8
 
7
- const { class: className, ...attrs } = Astro.props;
9
+ const { class: className, isOpen = false, ...attrs } = Astro.props;
8
10
  ---
9
11
 
10
12
  <div
11
13
  {...attrs}
12
14
  data-accordion-item
15
+ data-default-open={isOpen}
13
16
  class={cn("border-b border-border last:border-b-0", className)}
14
17
  >
15
18
  <slot />
@@ -2,21 +2,18 @@
2
2
  import { cn } from "@/utils/cn";
3
3
  import type { HTMLAttributes } from "astro/types";
4
4
 
5
- interface Props extends HTMLAttributes<"div"> {
6
- open?: boolean;
7
- }
5
+ interface Props extends HTMLAttributes<"div"> {}
8
6
 
9
- const { class: className, open = false, ...attrs } = Astro.props;
7
+ const { class: className, ...attrs } = Astro.props;
10
8
  ---
11
9
 
12
10
  <div
13
11
  {...attrs}
14
12
  role="region"
15
13
  data-accordion-content
16
- data-open={open}
14
+ data-state="closed"
17
15
  class={cn(
18
- "overflow-hidden transition-all duration-300 ease-in-out",
19
- { "max-h-0": !open },
16
+ "overflow-hidden transition-all duration-300 ease-in-out data-[state=closed]:max-h-0",
20
17
  className,
21
18
  )}
22
19
  >
@@ -15,6 +15,8 @@ export class Accordion {
15
15
  }
16
16
 
17
17
  private init() {
18
+ const defaultOpenItems = [];
19
+
18
20
  this.items?.forEach((item: AccordionItem) => {
19
21
  const trigger = item.querySelector<HTMLElement>(
20
22
  "[data-accordion-trigger]",
@@ -29,6 +31,24 @@ export class Accordion {
29
31
 
30
32
  this.setupAccessibility(item);
31
33
  this.setupEventListeners(item);
34
+
35
+ if (item.dataset.defaultOpen === "true") {
36
+ if (
37
+ defaultOpenItems.length > 0 &&
38
+ this.wrapper.dataset.multiple !== "true"
39
+ ) {
40
+ console.warn(
41
+ "Warning! This accordion is not configured to open multiple items by default. " +
42
+ "Only the first item will be opened." +
43
+ "Consider adding the multiple prop to the accordion if you want to allow multiple items to be open by default.",
44
+ );
45
+ return;
46
+ }
47
+
48
+ this.setContentHeight(content);
49
+ this.setState(item, "open");
50
+ defaultOpenItems.push(item);
51
+ }
32
52
  }
33
53
  });
34
54
  }
@@ -77,8 +97,9 @@ export class Accordion {
77
97
 
78
98
  private openAccordionItem(item: AccordionItem) {
79
99
  this.setState(item, "open");
80
- const height = item.content?.scrollHeight + "px";
81
- item.content!.style.maxHeight = height;
100
+ if (item.content) {
101
+ this.setContentHeight(item.content);
102
+ }
82
103
  }
83
104
 
84
105
  private closeAccordionItem(item: AccordionItem) {
@@ -117,6 +138,11 @@ export class Accordion {
117
138
  }
118
139
  }
119
140
 
141
+ private setContentHeight(content: HTMLElement) {
142
+ const height = content.scrollHeight + "px";
143
+ content.style.maxHeight = height;
144
+ }
145
+
120
146
  private setState(item: AccordionItem, state: "closed" | "open") {
121
147
  item.trigger?.setAttribute("data-state", state);
122
148
  item.trigger?.setAttribute("aria-expanded", `${state === "open"}`);
@@ -29,7 +29,7 @@ const {
29
29
  aria-hidden="true"
30
30
  data-state="closed"
31
31
  data-drawer-backdrop
32
- class="bg-background/10 backdrop-blur-xs fixed inset-0 left-0 top-0 z-50 hidden h-dvh w-full transition-opacity duration-200"
32
+ class="bg-background fixed inset-0 left-0 top-0 z-50 hidden h-dvh w-full transition-opacity duration-100 data-[state=closed]:opacity-0 data-[state=open]:opacity-80"
33
33
  />
34
34
  )
35
35
  }
@@ -1,15 +1,17 @@
1
- import Drawer from "./Drawer.astro";
2
- import DrawerContent from "./DrawerContent.astro";
3
- import DrawerDescription from "./DrawerDescription.astro";
4
- import DrawerFooter from "./DrawerFooter.astro";
5
- import DrawerHeader from "./DrawerHeader.astro";
6
- import DrawerTitle from "./DrawerTitle.astro";
7
-
8
- export {
9
- Drawer,
10
- DrawerContent,
11
- DrawerDescription,
12
- DrawerFooter,
13
- DrawerHeader,
14
- DrawerTitle,
15
- };
1
+ import Drawer from "./Drawer.astro";
2
+ import DrawerContent from "./DrawerContent.astro";
3
+ import DrawerDescription from "./DrawerDescription.astro";
4
+ import DrawerFooter from "./DrawerFooter.astro";
5
+ import DrawerHeader from "./DrawerHeader.astro";
6
+ import DrawerTitle from "./DrawerTitle.astro";
7
+ import { drawerVariants } from "./drawerVariants";
8
+
9
+ export {
10
+ Drawer,
11
+ DrawerContent,
12
+ DrawerDescription,
13
+ DrawerFooter,
14
+ DrawerHeader,
15
+ DrawerTitle,
16
+ drawerVariants,
17
+ };
@@ -4,12 +4,20 @@ import DropdownMenuGroup from "./DropdownMenuGroup.astro";
4
4
  import DropdownMenuItem from "./DropdownMenuItem.astro";
5
5
  import DropdownMenuLabel from "./DropdownMenuLabel.astro";
6
6
  import DropdownMenuSeparator from "./DropdownMenuSeparator.astro";
7
+ import {
8
+ dropdownArrowVariants,
9
+ dropdownMenuItemVariants,
10
+ dropdownMenuVariants,
11
+ } from "./dropdownVariants";
7
12
 
8
13
  export {
14
+ dropdownArrowVariants,
9
15
  DropdownMenu,
10
16
  DropdownMenuContent,
11
17
  DropdownMenuGroup,
12
18
  DropdownMenuItem,
19
+ dropdownMenuItemVariants,
13
20
  DropdownMenuLabel,
14
21
  DropdownMenuSeparator,
22
+ dropdownMenuVariants,
15
23
  };
@@ -1,71 +1,71 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import type { HTMLAttributes } from "astro/types";
4
-
5
- interface Props extends HTMLAttributes<"div"> {
6
- showCloseButton?: boolean;
7
- backdrop?: boolean;
8
- allowOutsideClick?: boolean;
9
- }
10
-
11
- const {
12
- class: className,
13
- showCloseButton = true,
14
- backdrop = true,
15
- allowOutsideClick = true,
16
- ...attrs
17
- } = Astro.props;
18
- ---
19
-
20
- {
21
- backdrop && (
22
- <div
23
- class="bg-background/10 fixed inset-0 left-0 top-0 z-50 hidden h-dvh w-full backdrop-blur-md transition-opacity duration-200"
24
- aria-hidden="true"
25
- data-state="closed"
26
- data-backdrop
27
- />
28
- )
29
- }
30
-
31
- <div
32
- data-modal
33
- role="dialog"
34
- aria-hidden="true"
35
- data-state="closed"
36
- data-show-close-button={showCloseButton}
37
- data-allow-outside-click={allowOutsideClick}
38
- class={cn(
39
- "hidden fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 bg-surface text-foreground border-border border rounded-lg shadow-sm p-6 w-full max-w-[calc(100%-2rem)] sm:max-w-md transform transition-all ease-in data-[state=closed]:opacity-0 data-[state=closed]:scale-95 data[state=open]:opacity-100 data[state=open]:scale-100",
40
- className,
41
- )}
42
- {...attrs}
43
- >
44
- {
45
- showCloseButton && (
46
- <button
47
- class="text-foreground hover:bg-muted absolute right-3 top-3 cursor-pointer rounded-lg p-1 transition-colors duration-150"
48
- aria-label="close modal"
49
- data-close-modal
50
- >
51
- <svg
52
- xmlns="http://www.w3.org/2000/svg"
53
- viewBox="0 0 24 24"
54
- fill="none"
55
- stroke="currentColor"
56
- stroke-width="2"
57
- stroke-linecap="round"
58
- stroke-linejoin="round"
59
- class="size-4"
60
- >
61
- <>
62
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
63
- <path d="M18 6l-12 12" />
64
- <path d="M6 6l12 12" />
65
- </>
66
- </svg>
67
- </button>
68
- )
69
- }
70
- <slot />
71
- </div>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import type { HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ showCloseButton?: boolean;
7
+ backdrop?: boolean;
8
+ allowOutsideClick?: boolean;
9
+ }
10
+
11
+ const {
12
+ class: className,
13
+ showCloseButton = true,
14
+ backdrop = true,
15
+ allowOutsideClick = true,
16
+ ...attrs
17
+ } = Astro.props;
18
+ ---
19
+
20
+ {
21
+ backdrop && (
22
+ <div
23
+ class="bg-background fixed inset-0 left-0 top-0 z-50 hidden h-dvh w-full transition-opacity duration-100 data-[state=closed]:opacity-0 data-[state=open]:opacity-80"
24
+ aria-hidden="true"
25
+ data-state="closed"
26
+ data-backdrop
27
+ />
28
+ )
29
+ }
30
+
31
+ <div
32
+ data-modal
33
+ role="dialog"
34
+ aria-hidden="true"
35
+ data-state="closed"
36
+ data-show-close-button={showCloseButton}
37
+ data-allow-outside-click={allowOutsideClick}
38
+ class={cn(
39
+ "hidden fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 bg-surface text-foreground border-border border rounded-lg shadow-sm p-6 w-full max-w-[calc(100%-2rem)] sm:max-w-md transform transition-all ease-in data-[state=closed]:opacity-0 data-[state=closed]:scale-95 data-[state=open]:opacity-100 data-[state=open]:scale-100",
40
+ className,
41
+ )}
42
+ {...attrs}
43
+ >
44
+ {
45
+ showCloseButton && (
46
+ <button
47
+ class="text-foreground hover:bg-muted absolute right-3 top-3 cursor-pointer rounded-lg p-1 transition-colors duration-150"
48
+ aria-label="close modal"
49
+ data-close-modal
50
+ >
51
+ <svg
52
+ xmlns="http://www.w3.org/2000/svg"
53
+ viewBox="0 0 24 24"
54
+ fill="none"
55
+ stroke="currentColor"
56
+ stroke-width="2"
57
+ stroke-linecap="round"
58
+ stroke-linejoin="round"
59
+ class="size-4"
60
+ >
61
+ <>
62
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
63
+ <path d="M18 6l-12 12" />
64
+ <path d="M6 6l12 12" />
65
+ </>
66
+ </svg>
67
+ </button>
68
+ )
69
+ }
70
+ <slot />
71
+ </div>
@@ -1,13 +1,15 @@
1
- import Pagination from "./Pagination.astro";
2
- import PaginationContent from "./PaginationContent.astro";
3
- import PaginationEllipsis from "./PaginationEllipsis.astro";
4
- import PaginationItem from "./PaginationItem.astro";
5
- import PaginationLink from "./PaginationLink.astro";
6
-
7
- export {
8
- Pagination,
9
- PaginationContent,
10
- PaginationEllipsis,
11
- PaginationItem,
12
- PaginationLink,
13
- };
1
+ import Pagination from "./Pagination.astro";
2
+ import PaginationContent from "./PaginationContent.astro";
3
+ import PaginationEllipsis from "./PaginationEllipsis.astro";
4
+ import PaginationItem from "./PaginationItem.astro";
5
+ import PaginationLink from "./PaginationLink.astro";
6
+ import { paginationLinkVariants } from "./paginationVariants";
7
+
8
+ export {
9
+ Pagination,
10
+ PaginationContent,
11
+ PaginationEllipsis,
12
+ PaginationItem,
13
+ PaginationLink,
14
+ paginationLinkVariants,
15
+ };
@@ -1,4 +1,5 @@
1
1
  import Popover from "./Popover.astro";
2
2
  import PopoverContent from "./PopoverContent.astro";
3
+ import { popoverArrowVariants, popoverVariants } from "./popoverVariants";
3
4
 
4
- export { Popover, PopoverContent };
5
+ export { Popover, popoverArrowVariants, PopoverContent, popoverVariants };
@@ -1,6 +1,5 @@
1
1
  import Tooltip from "./Tooltip.astro";
2
2
  import TooltipContent from "./TooltipContent.astro";
3
- import TooltipTrigger from "./TooltipTrigger.astro";
4
- import { tooltipVariants } from "./tooltipVariants";
3
+ import { tooltipArrowVariants, tooltipVariants } from "./tooltipVariants";
5
4
 
6
- export { Tooltip, TooltipContent, TooltipTrigger, tooltipVariants };
5
+ export { Tooltip, tooltipArrowVariants, TooltipContent, tooltipVariants };
package/dist/index.js CHANGED
@@ -71,15 +71,15 @@ var registry_default = {
71
71
  },
72
72
  {
73
73
  name: "accordion",
74
- version: "0.0.1"
74
+ version: "0.0.2"
75
75
  },
76
76
  {
77
77
  name: "modal",
78
- version: "0.0.1"
78
+ version: "0.0.2"
79
79
  },
80
80
  {
81
81
  name: "tooltip",
82
- version: "0.0.1"
82
+ version: "0.0.2"
83
83
  },
84
84
  {
85
85
  name: "collapsible",
@@ -87,7 +87,7 @@ var registry_default = {
87
87
  },
88
88
  {
89
89
  name: "drawer",
90
- version: "0.0.1"
90
+ version: "0.0.2"
91
91
  },
92
92
  {
93
93
  name: "dropdown",
@@ -121,7 +121,8 @@ import { fileURLToPath } from "node:url";
121
121
  import path from "node:path";
122
122
  var __dirname = path.dirname(fileURLToPath(import.meta.url));
123
123
  function getAllComponents() {
124
- return registry_default.components;
124
+ const availableComponents = registry_default.components;
125
+ return availableComponents.sort((a, b) => a.name.localeCompare(b.name));
125
126
  }
126
127
  function getComponentPath(componentName) {
127
128
  return path.join(__dirname, "astro", componentName);
package/dist/index.js.map CHANGED
@@ -1 +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.2\"\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 \"name\": \"list\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"divider\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"skeleton\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"accordion\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"modal\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"tooltip\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"collapsible\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"drawer\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"dropdown\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"kbd\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"pagination\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"popover\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"stat\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"tab\",\n \"version\": \"0.0.1\"\n }\n ]\n}\n","import registry from \"@/registry.json\";\r\nimport { fileURLToPath } from \"node:url\";\r\n\r\nimport path from \"node:path\";\r\nimport { ComponentRegistryEntry } from \"./types/registry\";\r\n\r\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\r\n\r\nexport function getAllComponents() {\r\n return registry.components as ComponentRegistryEntry[];\r\n}\r\n\r\nexport function getComponentPath(componentName: string) {\r\n return path.join(__dirname, \"astro\", componentName);\r\n}\r\n\r\nexport async function checkComponentsInRegistry(components: string[]) {\r\n const valid: ComponentRegistryEntry[] = [];\r\n const invalid: string[] = [];\r\n const allComponents = getAllComponents();\r\n\r\n for (const component of components) {\r\n const found = allComponents.find(\r\n (c) => c.name.toLowerCase() === component.toLowerCase(),\r\n );\r\n if (found) {\r\n valid.push(found);\r\n } else {\r\n invalid.push(component);\r\n }\r\n }\r\n\r\n return { valid, invalid };\r\n}\r\n\r\nexport { type ComponentRegistryEntry } from \"@/types/registry\";\r\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;AAA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R,SAAW;AAAA,IACb;AAAA,EACF;AACF;;;AClHA,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":[]}
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.2\"\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 \"name\": \"list\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"divider\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"skeleton\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"accordion\",\n \"version\": \"0.0.2\"\n },\n {\n \"name\": \"modal\",\n \"version\": \"0.0.2\"\n },\n {\n \"name\": \"tooltip\",\n \"version\": \"0.0.2\"\n },\n {\n \"name\": \"collapsible\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"drawer\",\n \"version\": \"0.0.2\"\n },\n {\n \"name\": \"dropdown\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"kbd\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"pagination\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"popover\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"stat\",\n \"version\": \"0.0.1\"\n },\n {\n \"name\": \"tab\",\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 const availableComponents = registry.components as ComponentRegistryEntry[];\n return availableComponents.sort((a, b) => a.name.localeCompare(b.name));\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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Q;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;;;AClHA,SAAS,qBAAqB;AAE9B,OAAO,UAAU;AAGjB,IAAM,YAAY,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC;AAEtD,SAAS,mBAAmB;AACjC,QAAM,sBAAsB,iBAAS;AACrC,SAAO,oBAAoB,KAAK,CAAC,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,IAAI,CAAC;AACxE;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 CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "@orbitkit/components",
3
- "version": "0.2.0-beta.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
- "publish:beta": "pnpm build && npm publish --tag beta --access public",
23
- "publish:release": "pnpm build && npm publish --access public"
24
- },
25
- "keywords": [
26
- "ui",
27
- "kit",
28
- "components",
29
- "orbit",
30
- "tailwind"
31
- ],
32
- "author": "NSMichelJ (Michelito)",
33
- "license": "MIT",
34
- "packageManager": "pnpm@10.9.0",
35
- "devDependencies": {
36
- "@types/fs-extra": "11.0.4",
37
- "@types/node": "22.15.3",
38
- "astro": "5.7.10",
39
- "class-variance-authority": "0.7.1",
40
- "clsx": "2.1.1",
41
- "fs-extra": "11.3.0",
42
- "tailwind-merge": "3.2.0",
43
- "tailwindcss": "4.1.5",
44
- "tsup": "8.4.0"
45
- },
46
- "repository": {
47
- "type": "git",
48
- "url": "https://github.com/nsmichelj/orbitui.git",
49
- "directory": "package/components"
50
- },
51
- "files": [
52
- "dist"
53
- ]
54
- }
1
+ {
2
+ "name": "@orbitkit/components",
3
+ "version": "0.2.0",
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
+ "publish:beta": "pnpm build && npm publish --tag beta --access public",
23
+ "publish:release": "pnpm build && npm publish --access public"
24
+ },
25
+ "keywords": [
26
+ "ui",
27
+ "kit",
28
+ "components",
29
+ "orbit",
30
+ "tailwind"
31
+ ],
32
+ "author": "NSMichelJ (Michelito)",
33
+ "license": "MIT",
34
+ "packageManager": "pnpm@10.9.0",
35
+ "devDependencies": {
36
+ "@types/fs-extra": "11.0.4",
37
+ "@types/node": "22.15.3",
38
+ "astro": "5.7.10",
39
+ "class-variance-authority": "0.7.1",
40
+ "clsx": "2.1.1",
41
+ "fs-extra": "11.3.0",
42
+ "tailwind-merge": "3.2.0",
43
+ "tailwindcss": "4.1.5",
44
+ "tsup": "8.4.0"
45
+ },
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/nsmichelj/orbitui.git",
49
+ "directory": "package/components"
50
+ },
51
+ "files": [
52
+ "dist"
53
+ ]
54
+ }