fulldev-ui 0.11.1 → 0.13.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 (166) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/package.json +29 -21
  3. package/public/r/accordion.json +2 -2
  4. package/public/r/alert-dialog.json +2 -2
  5. package/public/r/aspect-ratio.json +23 -0
  6. package/public/r/attachment.json +66 -0
  7. package/public/r/banner.json +0 -4
  8. package/public/r/blocks-1.json +1 -1
  9. package/public/r/button-group.json +41 -0
  10. package/public/r/button.json +1 -1
  11. package/public/r/carousel.json +8 -8
  12. package/public/r/collapsible.json +2 -2
  13. package/public/r/combobox.json +6 -5
  14. package/public/r/command.json +5 -4
  15. package/public/r/components.json +8 -0
  16. package/public/r/dialog.json +2 -2
  17. package/public/r/doc-1.json +1 -1
  18. package/public/r/drawer.json +109 -0
  19. package/public/r/dropdown-menu.json +4 -4
  20. package/public/r/hover-card.json +4 -4
  21. package/public/r/init.json +1 -1
  22. package/public/r/input-group.json +0 -1
  23. package/public/r/layout.json +3 -0
  24. package/public/r/navigation-menu.json +3 -3
  25. package/public/r/pagination.json +59 -0
  26. package/public/r/popover.json +3 -3
  27. package/public/r/radio-group.json +2 -2
  28. package/public/r/registry.json +418 -28
  29. package/public/r/resizable.json +36 -0
  30. package/public/r/reviews-3.json +1 -1
  31. package/public/r/select.json +3 -3
  32. package/public/r/sheet.json +2 -2
  33. package/public/r/sidebar-1.json +1 -1
  34. package/public/r/sidebar.json +1 -1
  35. package/public/r/slider.json +2 -2
  36. package/public/r/switch.json +2 -2
  37. package/public/r/tabs.json +4 -4
  38. package/public/r/toast.json +80 -0
  39. package/public/r/toggle-group.json +34 -0
  40. package/public/r/toggle.json +2 -2
  41. package/public/r/tooltip.json +3 -3
  42. package/public/r/typography.json +21 -16
  43. package/registry/init/global.css +2 -0
  44. package/registry.json +384 -23
  45. package/src/components/blocks/blocks-1.astro +23 -23
  46. package/src/components/blocks/doc-1.astro +116 -26
  47. package/src/components/blocks/reviews-3.astro +1 -1
  48. package/src/components/blocks/sidebar-1.astro +46 -44
  49. package/src/components/ui/accordion/accordion.astro +8 -2
  50. package/src/components/ui/alert-dialog/alert-dialog.astro +8 -2
  51. package/src/components/ui/aspect-ratio/aspect-ratio.astro +25 -0
  52. package/src/components/ui/aspect-ratio/index.ts +1 -0
  53. package/src/components/ui/attachment/attachment-action.astro +20 -0
  54. package/src/components/ui/attachment/attachment-actions.astro +20 -0
  55. package/src/components/ui/attachment/attachment-content.astro +20 -0
  56. package/src/components/ui/attachment/attachment-description.astro +20 -0
  57. package/src/components/ui/attachment/attachment-group.astro +20 -0
  58. package/src/components/ui/attachment/attachment-media.astro +36 -0
  59. package/src/components/ui/attachment/attachment-title.astro +20 -0
  60. package/src/components/ui/attachment/attachment-trigger.astro +24 -0
  61. package/src/components/ui/attachment/attachment.astro +52 -0
  62. package/src/components/ui/attachment/index.ts +9 -0
  63. package/src/components/ui/button/button.astro +4 -1
  64. package/src/components/ui/button-group/button-group-separator.astro +29 -0
  65. package/src/components/ui/button-group/button-group-text.astro +20 -0
  66. package/src/components/ui/button-group/button-group-variants.ts +20 -0
  67. package/src/components/ui/button-group/button-group.astro +30 -0
  68. package/src/components/ui/button-group/index.ts +7 -0
  69. package/src/components/ui/carousel/carousel-content.astro +11 -13
  70. package/src/components/ui/carousel/carousel-item.astro +2 -5
  71. package/src/components/ui/carousel/carousel-next.astro +0 -3
  72. package/src/components/ui/carousel/carousel-previous.astro +0 -3
  73. package/src/components/ui/carousel/carousel.astro +19 -219
  74. package/src/components/ui/carousel/index.ts +1 -5
  75. package/src/components/ui/collapsible/collapsible.astro +8 -2
  76. package/src/components/ui/combobox/combobox-content.astro +1 -1
  77. package/src/components/ui/combobox/combobox-input.astro +11 -4
  78. package/src/components/ui/combobox/combobox-trigger.astro +7 -7
  79. package/src/components/ui/combobox/combobox.astro +9 -17
  80. package/src/components/ui/command/command-dialog.astro +1 -0
  81. package/src/components/ui/command/command.astro +40 -25
  82. package/src/components/ui/dialog/dialog.astro +8 -2
  83. package/src/components/ui/drawer/drawer-close.astro +13 -0
  84. package/src/components/ui/drawer/drawer-content.astro +43 -0
  85. package/src/components/ui/drawer/drawer-description.astro +17 -0
  86. package/src/components/ui/drawer/drawer-footer.astro +17 -0
  87. package/src/components/ui/drawer/drawer-header.astro +17 -0
  88. package/src/components/ui/drawer/drawer-indent-background.astro +11 -0
  89. package/src/components/ui/drawer/drawer-indent.astro +11 -0
  90. package/src/components/ui/drawer/drawer-overlay.astro +21 -0
  91. package/src/components/ui/drawer/drawer-popup.astro +36 -0
  92. package/src/components/ui/drawer/drawer-portal.astro +27 -0
  93. package/src/components/ui/drawer/drawer-provider.astro +11 -0
  94. package/src/components/ui/drawer/drawer-swipe-handle.astro +20 -0
  95. package/src/components/ui/drawer/drawer-title.astro +17 -0
  96. package/src/components/ui/drawer/drawer-trigger.astro +21 -0
  97. package/src/components/ui/drawer/drawer-viewport.astro +21 -0
  98. package/src/components/ui/drawer/drawer-virtual-keyboard-provider.astro +11 -0
  99. package/src/components/ui/drawer/drawer.astro +60 -0
  100. package/src/components/ui/drawer/index.ts +28 -0
  101. package/src/components/ui/dropdown-menu/dropdown-menu-content.astro +1 -1
  102. package/src/components/ui/dropdown-menu/dropdown-menu-item.astro +40 -9
  103. package/src/components/ui/dropdown-menu/dropdown-menu.astro +8 -2
  104. package/src/components/ui/hover-card/hover-card-content.astro +1 -1
  105. package/src/components/ui/hover-card/hover-card.astro +15 -4
  106. package/src/components/ui/navigation-menu/navigation-menu-positioner.astro +1 -1
  107. package/src/components/ui/navigation-menu/navigation-menu.astro +13 -4
  108. package/src/components/ui/pagination/index.ts +7 -0
  109. package/src/components/ui/pagination/pagination-content.astro +17 -0
  110. package/src/components/ui/pagination/pagination-ellipsis.astro +22 -0
  111. package/src/components/ui/pagination/pagination-item.astro +11 -0
  112. package/src/components/ui/pagination/pagination-link.astro +41 -0
  113. package/src/components/ui/pagination/pagination-next.astro +27 -0
  114. package/src/components/ui/pagination/pagination-previous.astro +27 -0
  115. package/src/components/ui/pagination/pagination.astro +19 -0
  116. package/src/components/ui/popover/popover-content.astro +2 -1
  117. package/src/components/ui/popover/popover.astro +9 -2
  118. package/src/components/ui/radio-group/radio-group.astro +8 -2
  119. package/src/components/ui/resizable/index.ts +4 -0
  120. package/src/components/ui/resizable/resizable-handle.astro +32 -0
  121. package/src/components/ui/resizable/resizable-panel.astro +36 -0
  122. package/src/components/ui/resizable/resizable.astro +43 -0
  123. package/src/components/ui/select/select-content.astro +2 -2
  124. package/src/components/ui/select/select.astro +11 -7
  125. package/src/components/ui/sheet/sheet.astro +8 -2
  126. package/src/components/ui/slider/slider.astro +9 -3
  127. package/src/components/ui/switch/switch.astro +8 -2
  128. package/src/components/ui/tabs/tabs-content.astro +1 -1
  129. package/src/components/ui/tabs/tabs-trigger.astro +3 -2
  130. package/src/components/ui/tabs/tabs.astro +8 -2
  131. package/src/components/ui/toast/index.ts +26 -0
  132. package/src/components/ui/toast/toast-action.astro +25 -0
  133. package/src/components/ui/toast/toast-close.astro +27 -0
  134. package/src/components/ui/toast/toast-content.astro +20 -0
  135. package/src/components/ui/toast/toast-description.astro +18 -0
  136. package/src/components/ui/toast/toast-icon.astro +37 -0
  137. package/src/components/ui/toast/toast-item.astro +28 -0
  138. package/src/components/ui/toast/toast-template.astro +11 -0
  139. package/src/components/ui/toast/toast-title.astro +17 -0
  140. package/src/components/ui/toast/toast-viewport.astro +20 -0
  141. package/src/components/ui/toast/toast.astro +51 -0
  142. package/src/components/ui/toast/toaster.astro +37 -0
  143. package/src/components/ui/toggle/toggle.astro +8 -2
  144. package/src/components/ui/toggle-group/index.ts +2 -0
  145. package/src/components/ui/toggle-group/toggle-group-item.astro +44 -0
  146. package/src/components/ui/toggle-group/toggle-group.astro +74 -0
  147. package/src/components/ui/tooltip/tooltip-content.astro +1 -1
  148. package/src/components/ui/tooltip/tooltip.astro +11 -2
  149. package/src/components/ui/typography/typeset.css +441 -0
  150. package/src/components/ui/typography/typography-a.astro +13 -22
  151. package/src/components/ui/typography/typography-blockquote.astro +4 -23
  152. package/src/components/ui/typography/typography-h1.astro +13 -26
  153. package/src/components/ui/typography/typography-h2.astro +13 -31
  154. package/src/components/ui/typography/typography-h3.astro +9 -26
  155. package/src/components/ui/typography/typography-h4.astro +9 -26
  156. package/src/components/ui/typography/typography-inline-code.astro +8 -27
  157. package/src/components/ui/typography/typography-lead.astro +4 -26
  158. package/src/components/ui/typography/typography-list-item.astro +4 -24
  159. package/src/components/ui/typography/typography-list.astro +10 -40
  160. package/src/components/ui/typography/typography-p.astro +9 -28
  161. package/src/components/ui/typography/typography-table-cell.astro +9 -40
  162. package/src/components/ui/typography/typography-table-head.astro +9 -35
  163. package/src/components/ui/typography/typography-table-row.astro +4 -23
  164. package/src/components/ui/typography/typography-table.astro +8 -28
  165. package/src/components/ui/typography/typography.astro +10 -283
  166. package/src/styles/global.css +2 -0
@@ -0,0 +1,26 @@
1
+ export { default as Toast } from "./toast.astro"
2
+ export { default as ToastTemplate } from "./toast-template.astro"
3
+ export { default as ToastViewport } from "./toast-viewport.astro"
4
+ export { default as ToastItem } from "./toast-item.astro"
5
+ export { default as ToastContent } from "./toast-content.astro"
6
+ export { default as ToastIcon } from "./toast-icon.astro"
7
+ export { default as ToastTitle } from "./toast-title.astro"
8
+ export { default as ToastDescription } from "./toast-description.astro"
9
+ export { default as ToastAction } from "./toast-action.astro"
10
+ export { default as ToastClose } from "./toast-close.astro"
11
+ export { default as Toaster } from "./toaster.astro"
12
+
13
+ export type {
14
+ ToastActionEvent,
15
+ ToastClearableField,
16
+ ToastController,
17
+ ToastOptions,
18
+ ToastPosition,
19
+ ToastPromiseErrorValue,
20
+ ToastPromiseHandle,
21
+ ToastPromiseOptions,
22
+ ToastPromiseState,
23
+ ToastPromiseStateValue,
24
+ ToastShowOptions,
25
+ ToastUpdateOptions,
26
+ } from "@data-slot/toast"
@@ -0,0 +1,25 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+
4
+ import { cn } from "@/lib/utils"
5
+ import { buttonVariants } from "@/components/ui/button"
6
+
7
+ type Props = HTMLAttributes<"button">
8
+
9
+ const {
10
+ class: className,
11
+ hidden = true,
12
+ type = "button",
13
+ ...props
14
+ } = Astro.props
15
+ ---
16
+
17
+ <button
18
+ data-slot="toast-action"
19
+ type={type}
20
+ class={cn(buttonVariants({ variant: "outline", size: "sm" }), className)}
21
+ hidden={hidden}
22
+ {...props}
23
+ >
24
+ <slot />
25
+ </button>
@@ -0,0 +1,27 @@
1
+ ---
2
+ import type { ComponentProps } from "astro/types"
3
+ import XIcon from "@lucide/astro/icons/x"
4
+
5
+ import { cn } from "@/lib/utils"
6
+ import { Button } from "@/components/ui/button"
7
+
8
+ type Props = ComponentProps<typeof Button>
9
+
10
+ const { class: className, ...props } = Astro.props
11
+ ---
12
+
13
+ <Button
14
+ data-slot="toast-close"
15
+ variant="ghost"
16
+ size="icon-sm"
17
+ aria-label="Close notification"
18
+ class={cn(
19
+ "text-muted-foreground hover:text-foreground relative shrink-0 after:absolute after:-inset-2 after:content-['']",
20
+ className
21
+ )}
22
+ {...props}
23
+ >
24
+ <slot>
25
+ <XIcon aria-hidden="true" />
26
+ </slot>
27
+ </Button>
@@ -0,0 +1,20 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ type Props = HTMLAttributes<"div">
7
+
8
+ const { class: className, ...props } = Astro.props
9
+ ---
10
+
11
+ <div
12
+ data-slot="toast-content"
13
+ class={cn(
14
+ "flex min-h-16 items-center gap-3 overflow-hidden p-4 transition-opacity duration-200",
15
+ className
16
+ )}
17
+ {...props}
18
+ >
19
+ <slot />
20
+ </div>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ type Props = HTMLAttributes<"div">
7
+
8
+ const { class: className, hidden = true, ...props } = Astro.props
9
+ ---
10
+
11
+ <div
12
+ data-slot="toast-description"
13
+ class={cn("text-muted-foreground text-sm", className)}
14
+ hidden={hidden}
15
+ {...props}
16
+ >
17
+ <slot />
18
+ </div>
@@ -0,0 +1,37 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+ import CircleCheckIcon from "@lucide/astro/icons/circle-check"
4
+ import InfoIcon from "@lucide/astro/icons/info"
5
+ import LoaderIcon from "@lucide/astro/icons/loader-circle"
6
+ import OctagonXIcon from "@lucide/astro/icons/octagon-x"
7
+ import TriangleAlertIcon from "@lucide/astro/icons/triangle-alert"
8
+
9
+ import { cn } from "@/lib/utils"
10
+
11
+ type Props = HTMLAttributes<"span">
12
+
13
+ const { class: className, ...props } = Astro.props
14
+ ---
15
+
16
+ <span
17
+ data-slot="toast-icon"
18
+ class={cn(
19
+ "shrink-0 group-data-[type=error]/toast-item:[&_[data-toast-icon=error]]:block group-data-[type=info]/toast-item:[&_[data-toast-icon=info]]:block group-data-[type=loading]/toast-item:[&_[data-toast-icon=loading]]:block group-data-[type=success]/toast-item:[&_[data-toast-icon=success]]:block group-data-[type=warning]/toast-item:[&_[data-toast-icon=warning]]:block [&_svg]:hidden [&_svg]:size-4",
20
+ className
21
+ )}
22
+ {...props}
23
+ >
24
+ <CircleCheckIcon data-toast-icon="success" aria-hidden="true" />
25
+ <InfoIcon data-toast-icon="info" aria-hidden="true" />
26
+ <TriangleAlertIcon data-toast-icon="warning" aria-hidden="true" />
27
+ <OctagonXIcon
28
+ data-toast-icon="error"
29
+ class="text-destructive"
30
+ aria-hidden="true"
31
+ />
32
+ <LoaderIcon
33
+ data-toast-icon="loading"
34
+ class="animate-spin"
35
+ aria-hidden="true"
36
+ />
37
+ </span>
@@ -0,0 +1,28 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ type Props = HTMLAttributes<"li">
7
+
8
+ const { class: className, ...props } = Astro.props
9
+ ---
10
+
11
+ <li
12
+ data-slot="toast-item"
13
+ role="status"
14
+ aria-atomic="true"
15
+ class={cn(
16
+ "group/toast-item bg-popover text-popover-foreground ring-foreground/10 focus-visible:border-ring focus-visible:ring-ring/50 pointer-events-auto absolute inset-x-0 z-[calc(1000-var(--toast-index))] box-border w-full rounded-xl opacity-0 shadow-lg ring-1 transition-[transform,opacity,height,box-shadow] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none group-data-[position=bottom-center]/toast-viewport:bottom-0 group-data-[position=bottom-center]/toast-viewport:origin-bottom group-data-[position=bottom-left]/toast-viewport:bottom-0 group-data-[position=bottom-left]/toast-viewport:origin-bottom group-data-[position=bottom-right]/toast-viewport:bottom-0 group-data-[position=bottom-right]/toast-viewport:origin-bottom group-data-[position=top-center]/toast-viewport:top-0 group-data-[position=top-center]/toast-viewport:origin-top group-data-[position=top-left]/toast-viewport:top-0 group-data-[position=top-left]/toast-viewport:origin-top group-data-[position=top-right]/toast-viewport:top-0 group-data-[position=top-right]/toast-viewport:origin-top focus-visible:ring-3",
17
+ "[transform:translate3d(0,calc(var(--toast-lift,-1)*-100%),0)] data-[mounted=true]:[transform:translate3d(0,0,0)] data-[mounted=true]:opacity-100 data-[swiping=true]:transition-none data-[visible=false]:pointer-events-none data-[visible=false]:opacity-0",
18
+ "data-[mounted=true]:data-[expanded=true]:h-(--toast-initial-height) data-[mounted=true]:data-[expanded=true]:[transform:translate3d(0,calc(var(--toast-offset,0px)*var(--toast-lift,-1)),0)] data-[mounted=true]:data-[expanded=false]:data-[front=false]:h-(--toast-front-height) data-[mounted=true]:data-[expanded=false]:data-[front=false]:[transform:translate3d(0,calc(var(--toast-collapsed-offset-y,0px)*var(--toast-lift,-1)),0)_scale(calc(1-var(--toast-index,0)*0.05))]",
19
+ "data-[removed=true]:data-[front=false]:data-[expanded=false]:[transform:translate3d(0,40%,0)] data-[removed=true]:data-[front=false]:data-[expanded=false]:opacity-0 data-[removed=true]:data-[front=false]:data-[expanded=true]:[transform:translate3d(0,calc(var(--toast-lift,-1)*var(--toast-offset,0px)+var(--toast-lift,-1)*-100%),0)] data-[removed=true]:data-[front=false]:data-[expanded=true]:opacity-0 data-[removed=true]:data-[front=true]:[transform:translate3d(0,calc(var(--toast-lift,-1)*-100%),0)] data-[removed=true]:data-[front=true]:opacity-0",
20
+ "data-[swiping=true]:data-[expanded=true]:[transform:translate3d(var(--toast-swipe-amount-x,0px),calc(var(--toast-offset,0px)*var(--toast-lift,-1)+var(--toast-swipe-amount-y,0px)),0)] data-[swiping=true]:data-[front=false]:data-[expanded=false]:[transform:translate3d(var(--toast-swipe-amount-x,0px),calc(var(--toast-collapsed-offset-y,0px)*var(--toast-lift,-1)+var(--toast-swipe-amount-y,0px)),0)_scale(calc(1-var(--toast-index,0)*0.05))] data-[swiping=true]:data-[front=true]:[transform:translate3d(var(--toast-swipe-amount-x,0px),var(--toast-swipe-amount-y,0px),0)]",
21
+ "data-[removed=true]:data-[swipe-out=true]:opacity-0 data-[removed=true]:data-[swipe-out=true]:data-[front=false]:data-[expanded=false]:[transform:translate3d(var(--toast-swipe-end-x,0px),calc(var(--toast-collapsed-offset-y,0px)*var(--toast-lift,-1)+var(--toast-swipe-end-y,0px)),0)_scale(calc(1-var(--toast-index,0)*0.05))] data-[removed=true]:data-[swipe-out=true]:data-[front=false]:data-[expanded=true]:[transform:translate3d(var(--toast-swipe-end-x,0px),calc(var(--toast-lift,-1)*var(--toast-offset,0px)+var(--toast-swipe-end-y,0px)),0)] data-[removed=true]:data-[swipe-out=true]:data-[front=true]:[transform:translate3d(var(--toast-swipe-end-x,0px),var(--toast-swipe-end-y,0px),0)]",
22
+ "after:absolute after:left-0 after:h-[calc(var(--toast-gap,0px)+1px)] after:w-full after:content-[''] group-data-[position=bottom-center]/toast-viewport:after:bottom-full group-data-[position=bottom-left]/toast-viewport:after:bottom-full group-data-[position=bottom-right]/toast-viewport:after:bottom-full group-data-[position=top-center]/toast-viewport:after:top-full group-data-[position=top-left]/toast-viewport:after:top-full group-data-[position=top-right]/toast-viewport:after:top-full data-[expanded=false]:data-[front=false]:data-open:[&>*]:opacity-0",
23
+ className
24
+ )}
25
+ {...props}
26
+ >
27
+ <slot />
28
+ </li>
@@ -0,0 +1,11 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+
4
+ type Props = HTMLAttributes<"div">
5
+
6
+ const { ...props } = Astro.props
7
+ ---
8
+
9
+ <template data-slot="toast-template" {...props}>
10
+ <slot />
11
+ </template>
@@ -0,0 +1,17 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ type Props = HTMLAttributes<"div">
7
+
8
+ const { class: className, ...props } = Astro.props
9
+ ---
10
+
11
+ <div
12
+ data-slot="toast-title"
13
+ class={cn("text-sm font-medium", className)}
14
+ {...props}
15
+ >
16
+ <slot />
17
+ </div>
@@ -0,0 +1,20 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ type Props = HTMLAttributes<"ol">
7
+
8
+ const { class: className, ...props } = Astro.props
9
+ ---
10
+
11
+ <ol
12
+ data-slot="toast-viewport"
13
+ class={cn(
14
+ "group/toast-viewport pointer-events-none fixed z-50 m-0 h-(--toast-stack-size,0px) w-[min(24rem,calc(100vw-2rem))] list-none p-0 outline-none [--toast-collapsed-peek:0.75rem] [--toast-gap:0.75rem] data-[position=bottom-center]:bottom-4 data-[position=bottom-center]:left-1/2 data-[position=bottom-center]:-translate-x-1/2 data-[position=bottom-left]:bottom-4 data-[position=bottom-left]:left-4 data-[position=bottom-right]:right-4 data-[position=bottom-right]:bottom-4 data-[position=top-center]:top-4 data-[position=top-center]:left-1/2 data-[position=top-center]:-translate-x-1/2 data-[position=top-left]:top-4 data-[position=top-left]:left-4 data-[position=top-right]:top-4 data-[position=top-right]:right-4",
15
+ className
16
+ )}
17
+ {...props}
18
+ >
19
+ <slot />
20
+ </ol>
@@ -0,0 +1,51 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+ import type { ToastPosition } from "@data-slot/toast"
4
+
5
+ type Props = HTMLAttributes<"div"> & {
6
+ limit?: number
7
+ duration?: number
8
+ position?: ToastPosition
9
+ pauseOnHover?: boolean
10
+ pauseOnFocus?: boolean
11
+ portal?: boolean
12
+ }
13
+
14
+ const {
15
+ class: className,
16
+ limit,
17
+ duration,
18
+ position,
19
+ pauseOnHover,
20
+ pauseOnFocus,
21
+ portal,
22
+ ...props
23
+ } = Astro.props
24
+ ---
25
+
26
+ <div
27
+ data-slot="toast"
28
+ data-limit={limit}
29
+ data-duration={duration}
30
+ data-position={position}
31
+ data-pause-on-hover={pauseOnHover}
32
+ data-pause-on-focus={pauseOnFocus}
33
+ data-portal={portal}
34
+ class={className}
35
+ {...props}
36
+ >
37
+ <slot />
38
+ </div>
39
+
40
+ <script>
41
+ import { create } from "@data-slot/toast"
42
+
43
+ const controllers: ReturnType<typeof create> = []
44
+ const initialize = () => controllers.push(...create())
45
+ initialize()
46
+ document.addEventListener("astro:page-load", initialize)
47
+ document.addEventListener("astro:before-swap", () => {
48
+ for (const controller of controllers) controller.destroy()
49
+ controllers.length = 0
50
+ })
51
+ </script>
@@ -0,0 +1,37 @@
1
+ ---
2
+ import type { ComponentProps } from "astro/types"
3
+
4
+ import ToastAction from "./toast-action.astro"
5
+ import ToastClose from "./toast-close.astro"
6
+ import ToastContent from "./toast-content.astro"
7
+ import ToastDescription from "./toast-description.astro"
8
+ import ToastIcon from "./toast-icon.astro"
9
+ import ToastItem from "./toast-item.astro"
10
+ import ToastTemplate from "./toast-template.astro"
11
+ import ToastTitle from "./toast-title.astro"
12
+ import ToastViewport from "./toast-viewport.astro"
13
+ import Toast from "./toast.astro"
14
+
15
+ type Props = ComponentProps<typeof Toast> & {
16
+ viewportClass?: string
17
+ }
18
+
19
+ const { viewportClass, ...props } = Astro.props
20
+ ---
21
+
22
+ <Toast {...props}>
23
+ <ToastTemplate>
24
+ <ToastItem>
25
+ <ToastContent>
26
+ <ToastIcon />
27
+ <div class="flex min-w-0 flex-1 flex-col gap-1">
28
+ <ToastTitle />
29
+ <ToastDescription />
30
+ </div>
31
+ <ToastAction />
32
+ <ToastClose />
33
+ </ToastContent>
34
+ </ToastItem>
35
+ </ToastTemplate>
36
+ <ToastViewport class={viewportClass} />
37
+ </Toast>
@@ -38,6 +38,12 @@ const {
38
38
  <script>
39
39
  import { create } from "@data-slot/toggle"
40
40
 
41
- create()
42
- document.addEventListener("astro:page-load", () => create())
41
+ const controllers: ReturnType<typeof create> = []
42
+ const initialize = () => controllers.push(...create())
43
+ initialize()
44
+ document.addEventListener("astro:page-load", initialize)
45
+ document.addEventListener("astro:before-swap", () => {
46
+ for (const controller of controllers) controller.destroy()
47
+ controllers.length = 0
48
+ })
43
49
  </script>
@@ -0,0 +1,2 @@
1
+ export { default as ToggleGroup } from "./toggle-group.astro"
2
+ export { default as ToggleGroupItem } from "./toggle-group-item.astro"
@@ -0,0 +1,44 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+
4
+ import { cn } from "@/lib/utils"
5
+ import {
6
+ toggleVariants,
7
+ type ToggleVariantProps,
8
+ } from "@/components/ui/toggle/toggle-variants"
9
+
10
+ type Props = HTMLAttributes<"button"> &
11
+ ToggleVariantProps & {
12
+ value: string
13
+ disabled?: boolean
14
+ }
15
+
16
+ const {
17
+ class: className,
18
+ value,
19
+ disabled,
20
+ variant = "default",
21
+ size = "default",
22
+ type = "button",
23
+ ...props
24
+ } = Astro.props
25
+ ---
26
+
27
+ <button
28
+ data-slot="toggle-group-item"
29
+ data-value={value}
30
+ data-disabled={disabled ? "" : undefined}
31
+ type={type}
32
+ disabled={disabled}
33
+ aria-pressed="false"
34
+ class={cn(
35
+ "data-[state=on]:bg-muted shrink-0 group-aria-disabled/toggle-group:pointer-events-none group-aria-disabled/toggle-group:opacity-50 focus:z-10 focus-visible:z-10",
36
+ "group-data-[variant=outline]/toggle-group:border-input group-data-[variant=default]/toggle-group:border-0 group-data-[variant=default]/toggle-group:shadow-none group-data-[variant=outline]/toggle-group:border group-data-[variant=outline]/toggle-group:shadow-xs group-data-[variant=default]/toggle-group:data-[state=off]:bg-transparent group-data-[variant=outline]/toggle-group:data-[state=off]:bg-transparent",
37
+ "group-data-[size=default]/toggle-group:h-9 group-data-[size=default]/toggle-group:min-w-9 group-data-[size=default]/toggle-group:px-2.5 group-data-[size=lg]/toggle-group:h-10 group-data-[size=lg]/toggle-group:min-w-10 group-data-[size=lg]/toggle-group:px-2.5 group-data-[size=sm]/toggle-group:h-8 group-data-[size=sm]/toggle-group:min-w-8 group-data-[size=sm]/toggle-group:px-2.5 group-data-[size=default]/toggle-group:has-data-[icon=inline-end]:pr-2 group-data-[size=lg]/toggle-group:has-data-[icon=inline-end]:pr-2 group-data-[size=sm]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[size=default]/toggle-group:has-data-[icon=inline-start]:pl-2 group-data-[size=lg]/toggle-group:has-data-[icon=inline-start]:pl-2 group-data-[size=sm]/toggle-group:has-data-[icon=inline-start]:pl-1.5",
38
+ toggleVariants({ variant, size }),
39
+ className
40
+ )}
41
+ {...props}
42
+ >
43
+ <slot />
44
+ </button>
@@ -0,0 +1,74 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types"
3
+
4
+ import { cn } from "@/lib/utils"
5
+ import type { ToggleVariantProps } from "@/components/ui/toggle/toggle-variants"
6
+
7
+ type Props = HTMLAttributes<"div"> &
8
+ ToggleVariantProps & {
9
+ defaultValue?: string | string[]
10
+ multiple?: boolean
11
+ orientation?: "horizontal" | "vertical"
12
+ loop?: boolean
13
+ disabled?: boolean
14
+ spacing?: number
15
+ }
16
+
17
+ const {
18
+ class: className,
19
+ style,
20
+ defaultValue,
21
+ multiple,
22
+ orientation = "horizontal",
23
+ loop,
24
+ disabled,
25
+ variant,
26
+ size,
27
+ spacing = 2,
28
+ ...props
29
+ } = Astro.props
30
+
31
+ const serializedDefaultValue = Array.isArray(defaultValue)
32
+ ? defaultValue.join(" ")
33
+ : defaultValue
34
+
35
+ const resolvedStyle =
36
+ typeof style === "string"
37
+ ? `--gap: ${spacing}; ${style}`
38
+ : { "--gap": spacing, ...(style ?? {}) }
39
+ ---
40
+
41
+ <div
42
+ data-slot="toggle-group"
43
+ data-default-value={serializedDefaultValue}
44
+ data-multiple={multiple ? "" : undefined}
45
+ data-orientation={orientation}
46
+ data-horizontal={orientation === "horizontal" ? "" : undefined}
47
+ data-vertical={orientation === "vertical" ? "" : undefined}
48
+ data-loop={loop}
49
+ data-disabled={disabled ? "" : undefined}
50
+ data-variant={variant}
51
+ data-size={size}
52
+ data-spacing={spacing}
53
+ style={resolvedStyle}
54
+ class={cn(
55
+ "group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-vertical:flex-col data-vertical:items-stretch data-[spacing=0]:data-[variant=outline]:shadow-xs [&[data-orientation=horizontal][data-spacing='0']>[data-slot=toggle-group-item]:first-child]:rounded-l-md [&[data-orientation=horizontal][data-spacing='0']>[data-slot=toggle-group-item]:last-child]:rounded-r-md [&[data-orientation=horizontal][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-l-0 [&[data-orientation=vertical][data-spacing='0']>[data-slot=toggle-group-item]:first-child]:rounded-t-md [&[data-orientation=vertical][data-spacing='0']>[data-slot=toggle-group-item]:last-child]:rounded-b-md [&[data-orientation=vertical][data-spacing='0'][data-variant=outline]>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0 [&[data-spacing='0']>[data-slot=toggle-group-item]]:rounded-none [&[data-spacing='0']>[data-slot=toggle-group-item]]:px-2 [&[data-spacing='0']>[data-slot=toggle-group-item]]:shadow-none [&[data-spacing='0']>[data-slot=toggle-group-item]:has([data-icon=inline-end])]:pr-1.5 [&[data-spacing='0']>[data-slot=toggle-group-item]:has([data-icon=inline-start])]:pl-1.5",
56
+ className
57
+ )}
58
+ {...props}
59
+ >
60
+ <slot />
61
+ </div>
62
+
63
+ <script>
64
+ import { create } from "@data-slot/toggle-group"
65
+
66
+ const controllers: ReturnType<typeof create> = []
67
+ const initialize = () => controllers.push(...create())
68
+ initialize()
69
+ document.addEventListener("astro:page-load", initialize)
70
+ document.addEventListener("astro:before-swap", () => {
71
+ for (const controller of controllers) controller.destroy()
72
+ controllers.length = 0
73
+ })
74
+ </script>
@@ -35,7 +35,7 @@ const {
35
35
  data-align-offset={alignOffset}
36
36
  data-avoid-collisions={avoidCollisions}
37
37
  data-collision-padding={collisionPadding}
38
- class="isolate z-50"
38
+ class="isolate z-[1000]"
39
39
  >
40
40
  <div
41
41
  data-slot="tooltip-content"
@@ -5,6 +5,7 @@ import type { TooltipAlign, TooltipSide } from "@data-slot/tooltip"
5
5
  import { cn } from "@/lib/utils"
6
6
 
7
7
  type Props = HTMLAttributes<"div"> & {
8
+ mountStrategy?: "lazy" | "eager"
8
9
  delay?: number
9
10
  skipDelayDuration?: number
10
11
  side?: TooltipSide
@@ -17,6 +18,7 @@ type Props = HTMLAttributes<"div"> & {
17
18
  }
18
19
 
19
20
  const {
21
+ mountStrategy,
20
22
  class: className,
21
23
  delay = 300,
22
24
  skipDelayDuration = 300,
@@ -33,6 +35,7 @@ const {
33
35
 
34
36
  <div
35
37
  data-slot="tooltip"
38
+ data-mount-strategy={mountStrategy}
36
39
  data-delay={delay}
37
40
  data-skip-delay-duration={skipDelayDuration}
38
41
  data-side={side}
@@ -51,6 +54,12 @@ const {
51
54
  <script>
52
55
  import { create } from "@data-slot/tooltip"
53
56
 
54
- create()
55
- document.addEventListener("astro:page-load", () => create())
57
+ const controllers: ReturnType<typeof create> = []
58
+ const initialize = () => controllers.push(...create())
59
+ initialize()
60
+ document.addEventListener("astro:page-load", initialize)
61
+ document.addEventListener("astro:before-swap", () => {
62
+ for (const controller of controllers) controller.destroy()
63
+ controllers.length = 0
64
+ })
56
65
  </script>