fulldev-ui 0.12.0 → 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.
- package/CHANGELOG.md +12 -0
- package/package.json +24 -20
- package/public/r/accordion.json +1 -1
- package/public/r/alert-dialog.json +1 -1
- package/public/r/aspect-ratio.json +23 -0
- package/public/r/attachment.json +66 -0
- package/public/r/button-group.json +41 -0
- package/public/r/carousel.json +8 -8
- package/public/r/collapsible.json +1 -1
- package/public/r/combobox.json +4 -4
- package/public/r/command.json +2 -2
- package/public/r/components.json +8 -0
- package/public/r/dialog.json +1 -1
- package/public/r/doc-1.json +1 -1
- package/public/r/drawer.json +109 -0
- package/public/r/dropdown-menu.json +1 -1
- package/public/r/hover-card.json +2 -2
- package/public/r/init.json +1 -1
- package/public/r/navigation-menu.json +2 -2
- package/public/r/pagination.json +59 -0
- package/public/r/popover.json +1 -1
- package/public/r/radio-group.json +1 -1
- package/public/r/registry.json +414 -24
- package/public/r/resizable.json +36 -0
- package/public/r/reviews-3.json +1 -1
- package/public/r/select.json +1 -1
- package/public/r/sheet.json +1 -1
- package/public/r/sidebar.json +1 -1
- package/public/r/slider.json +2 -2
- package/public/r/switch.json +1 -1
- package/public/r/tabs.json +1 -1
- package/public/r/toast.json +80 -0
- package/public/r/toggle-group.json +34 -0
- package/public/r/toggle.json +1 -1
- package/public/r/tooltip.json +1 -1
- package/public/r/typography.json +21 -16
- package/registry/init/global.css +2 -0
- package/registry.json +375 -24
- package/src/components/blocks/doc-1.astro +76 -0
- package/src/components/blocks/reviews-3.astro +1 -1
- package/src/components/ui/aspect-ratio/aspect-ratio.astro +25 -0
- package/src/components/ui/aspect-ratio/index.ts +1 -0
- package/src/components/ui/attachment/attachment-action.astro +20 -0
- package/src/components/ui/attachment/attachment-actions.astro +20 -0
- package/src/components/ui/attachment/attachment-content.astro +20 -0
- package/src/components/ui/attachment/attachment-description.astro +20 -0
- package/src/components/ui/attachment/attachment-group.astro +20 -0
- package/src/components/ui/attachment/attachment-media.astro +36 -0
- package/src/components/ui/attachment/attachment-title.astro +20 -0
- package/src/components/ui/attachment/attachment-trigger.astro +24 -0
- package/src/components/ui/attachment/attachment.astro +52 -0
- package/src/components/ui/attachment/index.ts +9 -0
- package/src/components/ui/button-group/button-group-separator.astro +29 -0
- package/src/components/ui/button-group/button-group-text.astro +20 -0
- package/src/components/ui/button-group/button-group-variants.ts +20 -0
- package/src/components/ui/button-group/button-group.astro +30 -0
- package/src/components/ui/button-group/index.ts +7 -0
- package/src/components/ui/carousel/carousel-content.astro +11 -13
- package/src/components/ui/carousel/carousel-item.astro +2 -5
- package/src/components/ui/carousel/carousel-next.astro +0 -3
- package/src/components/ui/carousel/carousel-previous.astro +0 -3
- package/src/components/ui/carousel/carousel.astro +19 -219
- package/src/components/ui/carousel/index.ts +1 -5
- package/src/components/ui/combobox/combobox-input.astro +11 -4
- package/src/components/ui/combobox/combobox-trigger.astro +7 -7
- package/src/components/ui/drawer/drawer-close.astro +13 -0
- package/src/components/ui/drawer/drawer-content.astro +43 -0
- package/src/components/ui/drawer/drawer-description.astro +17 -0
- package/src/components/ui/drawer/drawer-footer.astro +17 -0
- package/src/components/ui/drawer/drawer-header.astro +17 -0
- package/src/components/ui/drawer/drawer-indent-background.astro +11 -0
- package/src/components/ui/drawer/drawer-indent.astro +11 -0
- package/src/components/ui/drawer/drawer-overlay.astro +21 -0
- package/src/components/ui/drawer/drawer-popup.astro +36 -0
- package/src/components/ui/drawer/drawer-portal.astro +27 -0
- package/src/components/ui/drawer/drawer-provider.astro +11 -0
- package/src/components/ui/drawer/drawer-swipe-handle.astro +20 -0
- package/src/components/ui/drawer/drawer-title.astro +17 -0
- package/src/components/ui/drawer/drawer-trigger.astro +21 -0
- package/src/components/ui/drawer/drawer-viewport.astro +21 -0
- package/src/components/ui/drawer/drawer-virtual-keyboard-provider.astro +11 -0
- package/src/components/ui/drawer/drawer.astro +60 -0
- package/src/components/ui/drawer/index.ts +28 -0
- package/src/components/ui/navigation-menu/navigation-menu.astro +2 -2
- package/src/components/ui/pagination/index.ts +7 -0
- package/src/components/ui/pagination/pagination-content.astro +17 -0
- package/src/components/ui/pagination/pagination-ellipsis.astro +22 -0
- package/src/components/ui/pagination/pagination-item.astro +11 -0
- package/src/components/ui/pagination/pagination-link.astro +41 -0
- package/src/components/ui/pagination/pagination-next.astro +27 -0
- package/src/components/ui/pagination/pagination-previous.astro +27 -0
- package/src/components/ui/pagination/pagination.astro +19 -0
- package/src/components/ui/resizable/index.ts +4 -0
- package/src/components/ui/resizable/resizable-handle.astro +32 -0
- package/src/components/ui/resizable/resizable-panel.astro +36 -0
- package/src/components/ui/resizable/resizable.astro +43 -0
- package/src/components/ui/slider/slider.astro +1 -1
- package/src/components/ui/toast/index.ts +26 -0
- package/src/components/ui/toast/toast-action.astro +25 -0
- package/src/components/ui/toast/toast-close.astro +27 -0
- package/src/components/ui/toast/toast-content.astro +20 -0
- package/src/components/ui/toast/toast-description.astro +18 -0
- package/src/components/ui/toast/toast-icon.astro +37 -0
- package/src/components/ui/toast/toast-item.astro +28 -0
- package/src/components/ui/toast/toast-template.astro +11 -0
- package/src/components/ui/toast/toast-title.astro +17 -0
- package/src/components/ui/toast/toast-viewport.astro +20 -0
- package/src/components/ui/toast/toast.astro +51 -0
- package/src/components/ui/toast/toaster.astro +37 -0
- package/src/components/ui/toggle-group/index.ts +2 -0
- package/src/components/ui/toggle-group/toggle-group-item.astro +44 -0
- package/src/components/ui/toggle-group/toggle-group.astro +74 -0
- package/src/components/ui/typography/typeset.css +441 -0
- package/src/components/ui/typography/typography-a.astro +13 -22
- package/src/components/ui/typography/typography-blockquote.astro +4 -23
- package/src/components/ui/typography/typography-h1.astro +13 -26
- package/src/components/ui/typography/typography-h2.astro +13 -31
- package/src/components/ui/typography/typography-h3.astro +9 -26
- package/src/components/ui/typography/typography-h4.astro +9 -26
- package/src/components/ui/typography/typography-inline-code.astro +8 -27
- package/src/components/ui/typography/typography-lead.astro +4 -26
- package/src/components/ui/typography/typography-list-item.astro +4 -24
- package/src/components/ui/typography/typography-list.astro +10 -40
- package/src/components/ui/typography/typography-p.astro +9 -28
- package/src/components/ui/typography/typography-table-cell.astro +9 -40
- package/src/components/ui/typography/typography-table-head.astro +9 -35
- package/src/components/ui/typography/typography-table-row.astro +4 -23
- package/src/components/ui/typography/typography-table.astro +8 -28
- package/src/components/ui/typography/typography.astro +10 -283
- package/src/styles/global.css +2 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
|
|
4
|
+
type Props = HTMLAttributes<"div">
|
|
5
|
+
|
|
6
|
+
const { class: className, ...props } = Astro.props
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<div data-slot="drawer-virtual-keyboard-provider" class={className} {...props}>
|
|
10
|
+
<slot />
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import type { DrawerSnapPoint, DrawerSwipeDirection } from "@data-slot/drawer"
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div"> & {
|
|
6
|
+
defaultOpen?: boolean
|
|
7
|
+
modal?: boolean | "trap-focus"
|
|
8
|
+
disablePointerDismissal?: boolean
|
|
9
|
+
closeOnEscape?: boolean
|
|
10
|
+
swipeDirection?: DrawerSwipeDirection
|
|
11
|
+
snapPoint?: DrawerSnapPoint | null
|
|
12
|
+
defaultSnapPoint?: DrawerSnapPoint | null
|
|
13
|
+
triggerId?: string | null
|
|
14
|
+
defaultTriggerId?: string | null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
class: className,
|
|
19
|
+
defaultOpen,
|
|
20
|
+
modal,
|
|
21
|
+
disablePointerDismissal,
|
|
22
|
+
closeOnEscape,
|
|
23
|
+
swipeDirection,
|
|
24
|
+
snapPoint,
|
|
25
|
+
defaultSnapPoint,
|
|
26
|
+
triggerId,
|
|
27
|
+
defaultTriggerId,
|
|
28
|
+
...props
|
|
29
|
+
} = Astro.props
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
<div
|
|
33
|
+
data-slot="drawer"
|
|
34
|
+
data-default-open={defaultOpen}
|
|
35
|
+
data-modal={modal}
|
|
36
|
+
data-disable-pointer-dismissal={disablePointerDismissal}
|
|
37
|
+
data-close-on-escape={closeOnEscape}
|
|
38
|
+
data-swipe-direction={swipeDirection}
|
|
39
|
+
data-snap-point={snapPoint}
|
|
40
|
+
data-default-snap-point={defaultSnapPoint}
|
|
41
|
+
data-trigger-id={triggerId}
|
|
42
|
+
data-default-trigger-id={defaultTriggerId}
|
|
43
|
+
class={className}
|
|
44
|
+
{...props}
|
|
45
|
+
>
|
|
46
|
+
<slot />
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<script>
|
|
50
|
+
import { create } from "@data-slot/drawer"
|
|
51
|
+
|
|
52
|
+
const controllers: ReturnType<typeof create> = []
|
|
53
|
+
const initialize = () => controllers.push(...create())
|
|
54
|
+
initialize()
|
|
55
|
+
document.addEventListener("astro:page-load", initialize)
|
|
56
|
+
document.addEventListener("astro:before-swap", () => {
|
|
57
|
+
for (const controller of controllers) controller.destroy()
|
|
58
|
+
controllers.length = 0
|
|
59
|
+
})
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { default as Drawer } from "./drawer.astro"
|
|
2
|
+
export { default as DrawerTrigger } from "./drawer-trigger.astro"
|
|
3
|
+
export { default as DrawerClose } from "./drawer-close.astro"
|
|
4
|
+
export { default as DrawerPortal } from "./drawer-portal.astro"
|
|
5
|
+
export { default as DrawerOverlay } from "./drawer-overlay.astro"
|
|
6
|
+
export { default as DrawerBackdrop } from "./drawer-overlay.astro"
|
|
7
|
+
export { default as DrawerViewport } from "./drawer-viewport.astro"
|
|
8
|
+
export { default as DrawerPopup } from "./drawer-popup.astro"
|
|
9
|
+
export { default as DrawerContent } from "./drawer-content.astro"
|
|
10
|
+
export { default as DrawerSwipeHandle } from "./drawer-swipe-handle.astro"
|
|
11
|
+
export { default as DrawerHeader } from "./drawer-header.astro"
|
|
12
|
+
export { default as DrawerFooter } from "./drawer-footer.astro"
|
|
13
|
+
export { default as DrawerTitle } from "./drawer-title.astro"
|
|
14
|
+
export { default as DrawerDescription } from "./drawer-description.astro"
|
|
15
|
+
export { default as DrawerProvider } from "./drawer-provider.astro"
|
|
16
|
+
export { default as DrawerIndent } from "./drawer-indent.astro"
|
|
17
|
+
export { default as DrawerIndentBackground } from "./drawer-indent-background.astro"
|
|
18
|
+
export { default as DrawerVirtualKeyboardProvider } from "./drawer-virtual-keyboard-provider.astro"
|
|
19
|
+
|
|
20
|
+
export type {
|
|
21
|
+
DrawerChangeDetails,
|
|
22
|
+
DrawerChangeReason,
|
|
23
|
+
DrawerController,
|
|
24
|
+
DrawerOptions,
|
|
25
|
+
DrawerSnapChangeDetails,
|
|
26
|
+
DrawerSnapPoint,
|
|
27
|
+
DrawerSwipeDirection,
|
|
28
|
+
} from "@data-slot/drawer"
|
|
@@ -27,7 +27,7 @@ const {
|
|
|
27
27
|
openOnFocus,
|
|
28
28
|
side = "bottom",
|
|
29
29
|
align = "start",
|
|
30
|
-
sideOffset =
|
|
30
|
+
sideOffset = 8,
|
|
31
31
|
alignOffset = 0,
|
|
32
32
|
positionMethod = "absolute",
|
|
33
33
|
safeTriangle,
|
|
@@ -56,7 +56,7 @@ const {
|
|
|
56
56
|
)}
|
|
57
57
|
>
|
|
58
58
|
<slot />
|
|
59
|
-
<NavigationMenuPositioner
|
|
59
|
+
<NavigationMenuPositioner {side} {sideOffset} {align} {alignOffset} />
|
|
60
60
|
</nav>
|
|
61
61
|
|
|
62
62
|
<script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Pagination } from "./pagination.astro"
|
|
2
|
+
export { default as PaginationContent } from "./pagination-content.astro"
|
|
3
|
+
export { default as PaginationEllipsis } from "./pagination-ellipsis.astro"
|
|
4
|
+
export { default as PaginationItem } from "./pagination-item.astro"
|
|
5
|
+
export { default as PaginationLink } from "./pagination-link.astro"
|
|
6
|
+
export { default as PaginationNext } from "./pagination-next.astro"
|
|
7
|
+
export { default as PaginationPrevious } from "./pagination-previous.astro"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<"ul">
|
|
7
|
+
|
|
8
|
+
const { class: className, ...props } = Astro.props
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<ul
|
|
12
|
+
data-slot="pagination-content"
|
|
13
|
+
class={cn("flex items-center gap-1", className)}
|
|
14
|
+
{...props}
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</ul>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import EllipsisIcon from "@lucide/astro/icons/ellipsis"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
type Props = HTMLAttributes<"span">
|
|
8
|
+
|
|
9
|
+
const { class: className, ...props } = Astro.props
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<span
|
|
13
|
+
data-slot="pagination-ellipsis"
|
|
14
|
+
class={cn(
|
|
15
|
+
"flex size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<EllipsisIcon aria-hidden="true" />
|
|
21
|
+
<span class="sr-only">More pages</span>
|
|
22
|
+
</span>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { Button, type ButtonVariantProps } from "@/components/ui/button"
|
|
6
|
+
|
|
7
|
+
type Props = HTMLAttributes<"a"> & {
|
|
8
|
+
isActive?: boolean
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
size?: ButtonVariantProps["size"]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
class: className,
|
|
15
|
+
href,
|
|
16
|
+
isActive,
|
|
17
|
+
disabled,
|
|
18
|
+
size = "icon",
|
|
19
|
+
tabindex,
|
|
20
|
+
...props
|
|
21
|
+
} = Astro.props
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
<Button
|
|
25
|
+
as="a"
|
|
26
|
+
data-slot="pagination-link"
|
|
27
|
+
data-active={isActive ? "true" : undefined}
|
|
28
|
+
href={disabled ? undefined : href}
|
|
29
|
+
aria-current={isActive ? "page" : undefined}
|
|
30
|
+
aria-disabled={disabled ? "true" : undefined}
|
|
31
|
+
tabindex={disabled ? -1 : tabindex}
|
|
32
|
+
variant={isActive ? "outline" : "ghost"}
|
|
33
|
+
size={size}
|
|
34
|
+
class={cn(
|
|
35
|
+
"aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
>
|
|
40
|
+
<slot />
|
|
41
|
+
</Button>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import ChevronRightIcon from "@lucide/astro/icons/chevron-right"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import type { ButtonVariantProps } from "@/components/ui/button"
|
|
7
|
+
|
|
8
|
+
import PaginationLink from "./pagination-link.astro"
|
|
9
|
+
|
|
10
|
+
type Props = HTMLAttributes<"a"> & {
|
|
11
|
+
text?: string
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
size?: ButtonVariantProps["size"]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { class: className, text = "Next", ...props } = Astro.props
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<PaginationLink
|
|
20
|
+
aria-label="Go to next page"
|
|
21
|
+
size="default"
|
|
22
|
+
class={cn("pr-2!", className)}
|
|
23
|
+
{...props}
|
|
24
|
+
>
|
|
25
|
+
<span class="hidden sm:block">{text}</span>
|
|
26
|
+
<ChevronRightIcon data-icon="inline-end" class="rtl:rotate-180" />
|
|
27
|
+
</PaginationLink>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import ChevronLeftIcon from "@lucide/astro/icons/chevron-left"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import type { ButtonVariantProps } from "@/components/ui/button"
|
|
7
|
+
|
|
8
|
+
import PaginationLink from "./pagination-link.astro"
|
|
9
|
+
|
|
10
|
+
type Props = HTMLAttributes<"a"> & {
|
|
11
|
+
text?: string
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
size?: ButtonVariantProps["size"]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { class: className, text = "Previous", ...props } = Astro.props
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<PaginationLink
|
|
20
|
+
aria-label="Go to previous page"
|
|
21
|
+
size="default"
|
|
22
|
+
class={cn("pl-2!", className)}
|
|
23
|
+
{...props}
|
|
24
|
+
>
|
|
25
|
+
<ChevronLeftIcon data-icon="inline-start" class="rtl:rotate-180" />
|
|
26
|
+
<span class="hidden sm:block">{text}</span>
|
|
27
|
+
</PaginationLink>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<"nav">
|
|
7
|
+
|
|
8
|
+
const { class: className, ...props } = Astro.props
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<nav
|
|
12
|
+
role="navigation"
|
|
13
|
+
aria-label="pagination"
|
|
14
|
+
data-slot="pagination"
|
|
15
|
+
class={cn("mx-auto flex w-full justify-center", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
</nav>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<"div"> & {
|
|
7
|
+
withHandle?: boolean
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { class: className, withHandle, disabled, ...props } = Astro.props
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
data-slot="resizable-handle"
|
|
16
|
+
data-disabled={disabled ? "true" : undefined}
|
|
17
|
+
class={cn(
|
|
18
|
+
"bg-border ring-offset-background focus-visible:ring-ring data-[active]:bg-ring relative flex w-px shrink-0 items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:inset-x-0 aria-[orientation=horizontal]:after:top-1/2 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&[aria-orientation=horizontal]>div]:rotate-90",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
{
|
|
24
|
+
withHandle && (
|
|
25
|
+
<div
|
|
26
|
+
data-slot="resizable-handle-indicator"
|
|
27
|
+
aria-hidden="true"
|
|
28
|
+
class="bg-border z-10 flex h-6 w-1 shrink-0 rounded-lg"
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
</div>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<"div"> & {
|
|
7
|
+
defaultSize?: number
|
|
8
|
+
minSize?: number
|
|
9
|
+
maxSize?: number
|
|
10
|
+
collapsible?: boolean
|
|
11
|
+
collapsedSize?: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
class: className,
|
|
16
|
+
defaultSize,
|
|
17
|
+
minSize,
|
|
18
|
+
maxSize,
|
|
19
|
+
collapsible,
|
|
20
|
+
collapsedSize,
|
|
21
|
+
...props
|
|
22
|
+
} = Astro.props
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<div
|
|
26
|
+
data-slot="resizable-panel"
|
|
27
|
+
data-default-size={defaultSize}
|
|
28
|
+
data-min-size={minSize}
|
|
29
|
+
data-max-size={maxSize}
|
|
30
|
+
data-collapsible={collapsible}
|
|
31
|
+
data-collapsed-size={collapsedSize}
|
|
32
|
+
class={cn("min-h-0 min-w-0", className)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
<slot />
|
|
36
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<"div"> & {
|
|
7
|
+
direction?: "horizontal" | "vertical"
|
|
8
|
+
keyboardResizeBy?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
class: className,
|
|
13
|
+
direction = "horizontal",
|
|
14
|
+
keyboardResizeBy,
|
|
15
|
+
...props
|
|
16
|
+
} = Astro.props
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<div
|
|
20
|
+
data-slot="resizable"
|
|
21
|
+
data-direction={direction}
|
|
22
|
+
data-keyboard-resize-by={keyboardResizeBy}
|
|
23
|
+
class={cn(
|
|
24
|
+
"group/resizable flex h-full w-full data-[direction=vertical]:flex-col",
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
{...props}
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import { create } from "@data-slot/resizable"
|
|
34
|
+
|
|
35
|
+
const controllers: ReturnType<typeof create> = []
|
|
36
|
+
const initialize = () => controllers.push(...create())
|
|
37
|
+
initialize()
|
|
38
|
+
document.addEventListener("astro:page-load", initialize)
|
|
39
|
+
document.addEventListener("astro:before-swap", () => {
|
|
40
|
+
for (const controller of controllers) controller.destroy()
|
|
41
|
+
controllers.length = 0
|
|
42
|
+
})
|
|
43
|
+
</script>
|
|
@@ -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,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>
|