@orbitkit/components 0.3.0 → 0.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.
Files changed (78) hide show
  1. package/dist/astro/ambient-image/AmbientFigcaption.astro +15 -0
  2. package/dist/astro/ambient-image/AmbientImage.astro +70 -0
  3. package/dist/astro/ambient-image/index.ts +4 -0
  4. package/dist/astro/button-group/ButtonGroup.astro +21 -0
  5. package/dist/astro/button-group/buttonGroupVariants.ts +34 -0
  6. package/dist/astro/button-group/index.ts +3 -0
  7. package/dist/astro/diff/Diff.astro +55 -0
  8. package/dist/astro/diff/DiffItem.astro +21 -0
  9. package/dist/astro/diff/index.ts +4 -0
  10. package/dist/astro/drawer/drawer.ts +20 -11
  11. package/dist/astro/dropdown/dropdown.ts +22 -13
  12. package/dist/astro/loader/Loader.astro +16 -0
  13. package/dist/astro/loader/index.ts +6 -0
  14. package/dist/astro/loader/loaders/12-dots-scale-rotate.svg +1 -0
  15. package/dist/astro/loader/loaders/180-ring-with-bg.svg +1 -0
  16. package/dist/astro/loader/loaders/180-ring.svg +1 -0
  17. package/dist/astro/loader/loaders/270-ring-with-bg.svg +1 -0
  18. package/dist/astro/loader/loaders/270-ring.svg +1 -0
  19. package/dist/astro/loader/loaders/3-dots-bounce.svg +1 -0
  20. package/dist/astro/loader/loaders/3-dots-fade.svg +1 -0
  21. package/dist/astro/loader/loaders/3-dots-move.svg +1 -0
  22. package/dist/astro/loader/loaders/3-dots-rotate.svg +1 -0
  23. package/dist/astro/loader/loaders/3-dots-scale-middle.svg +1 -0
  24. package/dist/astro/loader/loaders/3-dots-scale.svg +1 -0
  25. package/dist/astro/loader/loaders/6-dots-rotate.svg +1 -0
  26. package/dist/astro/loader/loaders/6-dots-scale-middle.svg +1 -0
  27. package/dist/astro/loader/loaders/6-dots-scale.svg +1 -0
  28. package/dist/astro/loader/loaders/8-dots-rotate.svg +1 -0
  29. package/dist/astro/loader/loaders/90-ring-with-bg.svg +1 -0
  30. package/dist/astro/loader/loaders/90-ring.svg +1 -0
  31. package/dist/astro/loader/loaders/bars-fade.svg +1 -0
  32. package/dist/astro/loader/loaders/bars-rotate-fade.svg +1 -0
  33. package/dist/astro/loader/loaders/bars-scale-fade.svg +1 -0
  34. package/dist/astro/loader/loaders/bars-scale-middle.svg +1 -0
  35. package/dist/astro/loader/loaders/bars-scale.svg +1 -0
  36. package/dist/astro/loader/loaders/blocks-scale.svg +1 -0
  37. package/dist/astro/loader/loaders/blocks-shuffle-2.svg +1 -0
  38. package/dist/astro/loader/loaders/blocks-shuffle-3.svg +1 -0
  39. package/dist/astro/loader/loaders/blocks-wave.svg +1 -0
  40. package/dist/astro/loader/loaders/bouncing-ball.svg +1 -0
  41. package/dist/astro/loader/loaders/clock.svg +1 -0
  42. package/dist/astro/loader/loaders/dot-revolve.svg +1 -0
  43. package/dist/astro/loader/loaders/eclipse-half.svg +1 -0
  44. package/dist/astro/loader/loaders/eclipse.svg +1 -0
  45. package/dist/astro/loader/loaders/gooey-balls-1.svg +1 -0
  46. package/dist/astro/loader/loaders/gooey-balls-2.svg +1 -0
  47. package/dist/astro/loader/loaders/index.ts +99 -0
  48. package/dist/astro/loader/loaders/pulse-2.svg +1 -0
  49. package/dist/astro/loader/loaders/pulse-3.svg +1 -0
  50. package/dist/astro/loader/loaders/pulse-multiple.svg +1 -0
  51. package/dist/astro/loader/loaders/pulse-ring.svg +1 -0
  52. package/dist/astro/loader/loaders/pulse-rings-2.svg +1 -0
  53. package/dist/astro/loader/loaders/pulse-rings-3.svg +1 -0
  54. package/dist/astro/loader/loaders/pulse-rings-multiple.svg +1 -0
  55. package/dist/astro/loader/loaders/pulse.svg +1 -0
  56. package/dist/astro/loader/loaders/ring-resize.svg +1 -0
  57. package/dist/astro/loader/loaders/tadpole.svg +1 -0
  58. package/dist/astro/loader/loaders/wifi-fade.svg +1 -0
  59. package/dist/astro/loader/loaders/wifi.svg +1 -0
  60. package/dist/astro/loader/loaders/wind-toy.svg +1 -0
  61. package/dist/astro/marquee/Marquee.astro +53 -53
  62. package/dist/astro/marquee/index.ts +3 -3
  63. package/dist/astro/modal/ModalContent.astro +2 -2
  64. package/dist/astro/modal/modal.ts +21 -12
  65. package/dist/astro/popover/popover.ts +19 -11
  66. package/dist/astro/scroll-progress/ScrollProgress.astro +41 -41
  67. package/dist/astro/scroll-progress/ScrollProgressBar.astro +19 -19
  68. package/dist/astro/scroll-progress/index.ts +4 -4
  69. package/dist/astro/toast/Toast.astro +36 -36
  70. package/dist/astro/toast/ToastDescription.astro +10 -10
  71. package/dist/astro/toast/ToastTitle.astro +18 -18
  72. package/dist/astro/toast/Toaster.astro +78 -78
  73. package/dist/astro/toast/assets.ts +6 -6
  74. package/dist/astro/toast/index.ts +30 -30
  75. package/dist/astro/toast/toast.ts +277 -277
  76. package/dist/index.js +18 -2
  77. package/dist/index.js.map +1 -1
  78. package/package.json +55 -54
@@ -1,10 +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 data-toast-description class={cn("text-sm", className)} {...attrs}></p>
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 data-toast-description class={cn("text-sm", className)} {...attrs}></p>
@@ -1,18 +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
- data-toast-title
12
- class={cn(
13
- "font-medium flex items-center justify-start gap-2 text-sm",
14
- className,
15
- )}
16
- {...attrs}
17
- >
18
- </h5>
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
+ data-toast-title
12
+ class={cn(
13
+ "font-medium flex items-center justify-start gap-2 text-sm",
14
+ className,
15
+ )}
16
+ {...attrs}
17
+ >
18
+ </h5>
@@ -1,78 +1,78 @@
1
- ---
2
- import Toast from "./Toast.astro";
3
- import ToastDescription from "./ToastDescription.astro";
4
- import ToastTitle from "./ToastTitle.astro";
5
-
6
- interface Props {
7
- offset?: number;
8
- gap?: number;
9
- position?:
10
- | "top-right"
11
- | "top-center"
12
- | "top-left"
13
- | "bottom-right"
14
- | "bottom-center"
15
- | "bottom-left";
16
- visibleToasts?: number;
17
- dismissible?: boolean;
18
- autoClose?: boolean;
19
- }
20
-
21
- const {
22
- offset = 24,
23
- gap = 16,
24
- position = "bottom-right",
25
- visibleToasts = 3,
26
- dismissible = true,
27
- autoClose = true,
28
- } = Astro.props;
29
- ---
30
-
31
- <section
32
- tabindex="-1"
33
- data-toaster
34
- data-position={position}
35
- data-visible-toasts={visibleToasts}
36
- data-offset={offset}
37
- data-dismissible={dismissible}
38
- data-position={position}
39
- data-gap={gap}
40
- data-auto-close={autoClose}
41
- >
42
- <template id="toast-template">
43
- <slot>
44
- <Toast>
45
- <div data-toast-icon></div>
46
-
47
- <div>
48
- <ToastTitle />
49
- <ToastDescription />
50
- </div>
51
-
52
- <button
53
- class="absolute right-1 top-1 cursor-pointer rounded-lg p-1 transition-colors duration-150"
54
- aria-label="close toast"
55
- data-close
56
- data-dismissible-button
57
- >
58
- <svg
59
- xmlns="http://www.w3.org/2000/svg"
60
- viewBox="0 0 24 24"
61
- fill="none"
62
- stroke="currentColor"
63
- stroke-width="2"
64
- stroke-linecap="round"
65
- stroke-linejoin="round"
66
- class="size-4"
67
- >
68
- <>
69
- <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
70
- <path d="M18 6l-12 12"></path>
71
- <path d="M6 6l12 12"></path>
72
- </>
73
- </svg>
74
- </button>
75
- </Toast>
76
- </slot>
77
- </template>
78
- </section>
1
+ ---
2
+ import Toast from "./Toast.astro";
3
+ import ToastDescription from "./ToastDescription.astro";
4
+ import ToastTitle from "./ToastTitle.astro";
5
+
6
+ interface Props {
7
+ offset?: number;
8
+ gap?: number;
9
+ position?:
10
+ | "top-right"
11
+ | "top-center"
12
+ | "top-left"
13
+ | "bottom-right"
14
+ | "bottom-center"
15
+ | "bottom-left";
16
+ visibleToasts?: number;
17
+ dismissible?: boolean;
18
+ autoClose?: boolean;
19
+ }
20
+
21
+ const {
22
+ offset = 24,
23
+ gap = 16,
24
+ position = "bottom-right",
25
+ visibleToasts = 3,
26
+ dismissible = true,
27
+ autoClose = true,
28
+ } = Astro.props;
29
+ ---
30
+
31
+ <section
32
+ tabindex="-1"
33
+ data-toaster
34
+ data-position={position}
35
+ data-visible-toasts={visibleToasts}
36
+ data-offset={offset}
37
+ data-dismissible={dismissible}
38
+ data-position={position}
39
+ data-gap={gap}
40
+ data-auto-close={autoClose}
41
+ >
42
+ <template id="toast-template">
43
+ <slot>
44
+ <Toast>
45
+ <div data-toast-icon></div>
46
+
47
+ <div>
48
+ <ToastTitle />
49
+ <ToastDescription />
50
+ </div>
51
+
52
+ <button
53
+ class="absolute right-1 top-1 cursor-pointer rounded-lg p-1 transition-colors duration-150"
54
+ aria-label="close toast"
55
+ data-close
56
+ data-dismissible-button
57
+ >
58
+ <svg
59
+ xmlns="http://www.w3.org/2000/svg"
60
+ viewBox="0 0 24 24"
61
+ fill="none"
62
+ stroke="currentColor"
63
+ stroke-width="2"
64
+ stroke-linecap="round"
65
+ stroke-linejoin="round"
66
+ class="size-4"
67
+ >
68
+ <>
69
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
70
+ <path d="M18 6l-12 12"></path>
71
+ <path d="M6 6l12 12"></path>
72
+ </>
73
+ </svg>
74
+ </button>
75
+ </Toast>
76
+ </slot>
77
+ </template>
78
+ </section>
@@ -1,6 +1,6 @@
1
- export const toastIcons: Record<string, string> = {
2
- success: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" /></svg>`,
3
- error: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor" class="icon icon-tabler icons-tabler-filled icon-tabler-alert-circle"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" /></svg>`,
4
- warning: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" /></svg>`,
5
- info: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z" /></svg>`,
6
- };
1
+ export const toastIcons: Record<string, string> = {
2
+ success: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" /></svg>`,
3
+ error: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor" class="icon icon-tabler icons-tabler-filled icon-tabler-alert-circle"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" /></svg>`,
4
+ warning: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" /></svg>`,
5
+ info: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z" /></svg>`,
6
+ };
@@ -1,30 +1,30 @@
1
- import { toastIcons } from "./assets";
2
- import type {
3
- ToastDomElements,
4
- ToastOptions,
5
- ToastPosition,
6
- ToastType,
7
- } from "./toast";
8
- import { Toast as ToastHandler } from "./toast";
9
- import Toast from "./Toast.astro";
10
- import ToastDescription from "./ToastDescription.astro";
11
- import ToastTitle from "./ToastTitle.astro";
12
-
13
- export { Toast, ToastDescription, ToastHandler, toastIcons, ToastTitle };
14
- export type { ToastDomElements, ToastOptions, ToastPosition, ToastType };
15
-
16
- export const toast = Object.assign(
17
- (opts: ToastOptions) => new ToastHandler(opts),
18
- {
19
- success: (opts: Omit<ToastOptions, "type">) =>
20
- new ToastHandler({ ...opts, type: "success" }),
21
- error: (opts: Omit<ToastOptions, "type">) =>
22
- new ToastHandler({ ...opts, type: "error" }),
23
- warning: (opts: Omit<ToastOptions, "type">) =>
24
- new ToastHandler({ ...opts, type: "warning" }),
25
- info: (opts: Omit<ToastOptions, "type">) =>
26
- new ToastHandler({ ...opts, type: "info" }),
27
- default: (opts: Omit<ToastOptions, "type">) =>
28
- new ToastHandler({ ...opts, type: "default" }),
29
- },
30
- );
1
+ import { toastIcons } from "./assets";
2
+ import type {
3
+ ToastDomElements,
4
+ ToastOptions,
5
+ ToastPosition,
6
+ ToastType,
7
+ } from "./toast";
8
+ import { Toast as ToastHandler } from "./toast";
9
+ import Toast from "./Toast.astro";
10
+ import ToastDescription from "./ToastDescription.astro";
11
+ import ToastTitle from "./ToastTitle.astro";
12
+
13
+ export { Toast, ToastDescription, ToastHandler, toastIcons, ToastTitle };
14
+ export type { ToastDomElements, ToastOptions, ToastPosition, ToastType };
15
+
16
+ export const toast = Object.assign(
17
+ (opts: ToastOptions) => new ToastHandler(opts),
18
+ {
19
+ success: (opts: Omit<ToastOptions, "type">) =>
20
+ new ToastHandler({ ...opts, type: "success" }),
21
+ error: (opts: Omit<ToastOptions, "type">) =>
22
+ new ToastHandler({ ...opts, type: "error" }),
23
+ warning: (opts: Omit<ToastOptions, "type">) =>
24
+ new ToastHandler({ ...opts, type: "warning" }),
25
+ info: (opts: Omit<ToastOptions, "type">) =>
26
+ new ToastHandler({ ...opts, type: "info" }),
27
+ default: (opts: Omit<ToastOptions, "type">) =>
28
+ new ToastHandler({ ...opts, type: "default" }),
29
+ },
30
+ );