fulldev-ui 0.9.3 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +100 -16
- package/package.json +3 -2
- package/public/r/accordion.json +4 -6
- package/public/r/alert-dialog.json +3 -3
- package/public/r/alert.json +0 -5
- package/public/r/article-1.json +1 -1
- package/public/r/article-2.json +1 -1
- package/public/r/articles-1.json +1 -1
- package/public/r/articles-2.json +1 -1
- package/public/r/articles-3.json +1 -1
- package/public/r/avatar.json +1 -16
- package/public/r/badge.json +1 -1
- package/public/r/banner-1.json +5 -3
- package/public/r/banner-2.json +1 -1
- package/public/r/banner.json +5 -3
- package/public/r/blocks-1.json +6 -3
- package/public/r/breadcrumb.json +4 -4
- package/public/r/button.json +1 -1
- package/public/r/card.json +4 -4
- package/public/r/carousel.json +5 -5
- package/public/r/checkbox.json +1 -1
- package/public/r/combobox.json +8 -8
- package/public/r/command.json +6 -6
- package/public/r/components.json +1 -7
- package/public/r/contact-1.json +4 -2
- package/public/r/contact-2.json +4 -2
- package/public/r/contact-3.json +11 -3
- package/public/r/content-1.json +11 -3
- package/public/r/content-2.json +11 -3
- package/public/r/content-3.json +7 -1
- package/public/r/content-4.json +11 -3
- package/public/r/cta-2.json +7 -1
- package/public/r/cta-4.json +7 -1
- package/public/r/cta-5.json +11 -3
- package/public/r/cta-6.json +7 -1
- package/public/r/dialog.json +7 -7
- package/public/r/doc-1.json +6 -3
- package/public/r/dropdown-menu.json +9 -11
- package/public/r/features-1.json +5 -3
- package/public/r/features-2.json +5 -3
- package/public/r/features-4.json +5 -3
- package/public/r/features-5.json +4 -2
- package/public/r/field.json +2 -7
- package/public/r/footer-1.json +5 -3
- package/public/r/footer-2.json +5 -3
- package/public/r/footer-3.json +5 -3
- package/public/r/header-1.json +1 -1
- package/public/r/header.json +3 -0
- package/public/r/hero-13.json +1 -1
- package/public/r/hero-4.json +5 -3
- package/public/r/hero-5.json +5 -3
- package/public/r/hero-6.json +5 -3
- package/public/r/hero-7.json +5 -3
- package/public/r/hero-8.json +1 -1
- package/public/r/hero-9.json +5 -3
- package/public/r/hover-card.json +4 -3
- package/public/r/icon.json +1 -1
- package/public/r/input-group.json +1 -1
- package/public/r/item.json +2 -20
- package/public/r/kbd.json +2 -2
- package/public/r/layout.json +4 -7
- package/public/r/links-2.json +5 -3
- package/public/r/marquee.json +1 -1
- package/public/r/native-select.json +3 -3
- package/public/r/navigation-menu.json +8 -10
- package/public/r/page.json +17 -0
- package/public/r/popover.json +1 -1
- package/public/r/pricing-1.json +5 -3
- package/public/r/pricing-2.json +5 -3
- package/public/r/pricing-3.json +5 -3
- package/public/r/products-1.json +1 -1
- package/public/r/products-4.json +1 -1
- package/public/r/products-5.json +1 -1
- package/public/r/radio-group.json +1 -1
- package/public/r/rating.json +3 -3
- package/public/r/registry.json +186 -450
- package/public/r/reviews-1.json +5 -3
- package/public/r/reviews-2.json +5 -3
- package/public/r/reviews-3.json +5 -3
- package/public/r/reviews-4.json +1 -1
- package/public/r/reviews-5.json +5 -3
- package/public/r/select.json +6 -8
- package/public/r/services-1.json +11 -3
- package/public/r/services-2.json +7 -1
- package/public/r/services-3.json +7 -1
- package/public/r/services-4.json +11 -3
- package/public/r/services-5.json +5 -3
- package/public/r/services-6.json +11 -3
- package/public/r/services-7.json +11 -3
- package/public/r/sheet.json +7 -4
- package/public/r/sidebar-1.json +4 -2
- package/public/r/sidebar.json +10 -7
- package/public/r/slider.json +1 -1
- package/public/r/spinner.json +3 -3
- package/public/r/switch.json +1 -1
- package/public/r/tabs.json +1 -1
- package/public/r/theme-toggle.json +5 -3
- package/public/r/toggle.json +1 -1
- package/public/r/tooltip.json +1 -1
- package/public/r/typography.json +16 -16
- package/public/r/video.json +1 -1
- package/registry.json +186 -450
- package/src/components/blocks/article-1.astro +1 -1
- package/src/components/blocks/article-2.astro +1 -1
- package/src/components/blocks/articles-1.astro +1 -1
- package/src/components/blocks/articles-2.astro +2 -2
- package/src/components/blocks/articles-3.astro +1 -1
- package/src/components/blocks/banner-1.astro +3 -5
- package/src/components/blocks/banner-2.astro +1 -1
- package/src/components/blocks/blocks-1.astro +25 -37
- package/src/components/blocks/contact-3.astro +4 -3
- package/src/components/blocks/content-1.astro +5 -4
- package/src/components/blocks/content-2.astro +6 -5
- package/src/components/blocks/content-3.astro +9 -2
- package/src/components/blocks/content-4.astro +6 -5
- package/src/components/blocks/cta-2.astro +4 -3
- package/src/components/blocks/cta-4.astro +3 -2
- package/src/components/blocks/cta-5.astro +6 -5
- package/src/components/blocks/cta-6.astro +4 -3
- package/src/components/blocks/doc-1.astro +28 -56
- package/src/components/blocks/features-1.astro +3 -1
- package/src/components/blocks/features-2.astro +4 -2
- package/src/components/blocks/features-4.astro +3 -1
- package/src/components/blocks/footer-1.astro +26 -12
- package/src/components/blocks/footer-2.astro +24 -12
- package/src/components/blocks/footer-3.astro +26 -12
- package/src/components/blocks/header-1.astro +2 -3
- package/src/components/blocks/hero-13.astro +1 -1
- package/src/components/blocks/hero-4.astro +2 -2
- package/src/components/blocks/hero-5.astro +3 -3
- package/src/components/blocks/hero-6.astro +3 -3
- package/src/components/blocks/hero-7.astro +3 -3
- package/src/components/blocks/hero-8.astro +1 -1
- package/src/components/blocks/hero-9.astro +2 -2
- package/src/components/blocks/links-2.astro +3 -5
- package/src/components/blocks/pricing-1.astro +3 -2
- package/src/components/blocks/pricing-2.astro +3 -2
- package/src/components/blocks/pricing-3.astro +3 -2
- package/src/components/blocks/products-1.astro +1 -1
- package/src/components/blocks/products-4.astro +2 -2
- package/src/components/blocks/products-5.astro +4 -4
- package/src/components/blocks/reviews-1.astro +2 -2
- package/src/components/blocks/reviews-2.astro +2 -2
- package/src/components/blocks/reviews-3.astro +2 -2
- package/src/components/blocks/reviews-4.astro +4 -4
- package/src/components/blocks/reviews-5.astro +16 -25
- package/src/components/blocks/services-1.astro +7 -9
- package/src/components/blocks/services-2.astro +5 -4
- package/src/components/blocks/services-3.astro +6 -5
- package/src/components/blocks/services-4.astro +7 -9
- package/src/components/blocks/services-5.astro +3 -4
- package/src/components/blocks/services-6.astro +7 -6
- package/src/components/blocks/services-7.astro +7 -9
- package/src/components/blocks/sidebar-1.astro +42 -97
- package/src/components/ui/accordion/accordion-content.astro +2 -1
- package/src/components/ui/accordion/accordion-trigger.astro +7 -8
- package/src/components/ui/alert-dialog/alert-dialog-content.astro +1 -1
- package/src/components/ui/alert-dialog/alert-dialog-overlay.astro +1 -1
- package/src/components/ui/alert-dialog/alert-dialog.astro +23 -3
- package/src/components/ui/avatar/avatar.astro +1 -1
- package/src/components/ui/badge/badge.astro +1 -0
- package/src/components/ui/banner/banner-container.astro +3 -3
- package/src/components/ui/breadcrumb/breadcrumb-ellipsis.astro +2 -2
- package/src/components/ui/breadcrumb/breadcrumb-separator.astro +2 -2
- package/src/components/ui/button/button-variants.ts +8 -7
- package/src/components/ui/card/card-content.astro +1 -1
- package/src/components/ui/card/card-footer.astro +1 -1
- package/src/components/ui/card/card-header.astro +1 -1
- package/src/components/ui/card/card.astro +1 -1
- package/src/components/ui/carousel/carousel-next.astro +3 -3
- package/src/components/ui/carousel/carousel-previous.astro +3 -3
- package/src/components/ui/checkbox/checkbox.astro +1 -1
- package/src/components/ui/combobox/combobox-input.astro +2 -2
- package/src/components/ui/combobox/combobox-item.astro +4 -4
- package/src/components/ui/combobox/combobox-list.astro +1 -1
- package/src/components/ui/combobox/combobox-trigger.astro +2 -5
- package/src/components/ui/combobox/combobox.astro +3 -0
- package/src/components/ui/command/command-dialog.astro +10 -10
- package/src/components/ui/command/command-input.astro +2 -2
- package/src/components/ui/command/command-item.astro +4 -5
- package/src/components/ui/dialog/dialog-close.astro +2 -2
- package/src/components/ui/dialog/dialog-content.astro +3 -3
- package/src/components/ui/dialog/dialog-overlay.astro +1 -1
- package/src/components/ui/dialog/dialog.astro +26 -3
- package/src/components/ui/dropdown-menu/dropdown-menu-checkbox-item.astro +4 -5
- package/src/components/ui/dropdown-menu/dropdown-menu-content.astro +4 -4
- package/src/components/ui/dropdown-menu/dropdown-menu-item.astro +1 -1
- package/src/components/ui/dropdown-menu/dropdown-menu-label.astro +1 -1
- package/src/components/ui/dropdown-menu/dropdown-menu-radio-item.astro +4 -5
- package/src/components/ui/dropdown-menu/dropdown-menu-shortcut.astro +1 -1
- package/src/components/ui/dropdown-menu/dropdown-menu.astro +3 -0
- package/src/components/ui/field/field-label.astro +1 -1
- package/src/components/ui/field/field-title.astro +1 -1
- package/src/components/ui/hover-card/hover-card-content.astro +4 -4
- package/src/components/ui/hover-card/hover-card.astro +8 -5
- package/src/components/ui/icon/icon.astro +8 -17
- package/src/components/ui/input-group/input-group-button.astro +0 -1
- package/src/components/ui/item/item-media.astro +1 -1
- package/src/components/ui/item/item.astro +0 -18
- package/src/components/ui/kbd/kbd-group.astro +1 -1
- package/src/components/ui/kbd/kbd.astro +1 -1
- package/src/components/ui/layout/layout-body.astro +1 -1
- package/src/components/ui/layout/layout-head.astro +3 -2
- package/src/components/ui/layout/layout-main.astro +1 -1
- package/src/components/ui/layout/layout.astro +4 -0
- package/src/components/ui/marquee/marquee.astro +50 -69
- package/src/components/ui/native-select/native-select.astro +2 -3
- package/src/components/ui/navigation-menu/navigation-menu-content.astro +3 -1
- package/src/components/ui/navigation-menu/navigation-menu-indicator.astro +2 -1
- package/src/components/ui/navigation-menu/navigation-menu-list.astro +1 -1
- package/src/components/ui/navigation-menu/navigation-menu-positioner.astro +2 -0
- package/src/components/ui/navigation-menu/navigation-menu-trigger.astro +2 -3
- package/src/components/ui/navigation-menu/navigation-menu.astro +1 -1
- package/src/components/ui/popover/popover-content.astro +1 -1
- package/src/components/ui/radio-group/radio-group-item.astro +3 -3
- package/src/components/ui/rating/rating.astro +3 -3
- package/src/components/ui/select/select-content.astro +1 -1
- package/src/components/ui/select/select-item.astro +4 -4
- package/src/components/ui/select/select-trigger.astro +3 -6
- package/src/components/ui/select/select.astro +6 -0
- package/src/components/ui/sheet/sheet-content.astro +6 -7
- package/src/components/ui/sheet/sheet.astro +1 -89
- package/src/components/ui/sidebar/sidebar-menu-button.astro +13 -11
- package/src/components/ui/sidebar/sidebar-menu-sub-button.astro +10 -8
- package/src/components/ui/sidebar/sidebar-provider.astro +37 -15
- package/src/components/ui/sidebar/sidebar-rail.astro +1 -1
- package/src/components/ui/sidebar/sidebar-trigger.astro +3 -3
- package/src/components/ui/sidebar/sidebar.astro +1 -2
- package/src/components/ui/slider/slider.astro +8 -6
- package/src/components/ui/spinner/spinner.astro +4 -4
- package/src/components/ui/switch/switch.astro +5 -3
- package/src/components/ui/tabs/tabs-content.astro +2 -1
- package/src/components/ui/theme-toggle/theme-toggle.astro +4 -3
- package/src/components/ui/toggle/toggle.astro +2 -0
- package/src/components/ui/tooltip/tooltip-content.astro +1 -1
- package/src/components/ui/typography/typography-a.astro +19 -4
- package/src/components/ui/typography/typography-blockquote.astro +26 -6
- package/src/components/ui/typography/typography-h1.astro +7 -9
- package/src/components/ui/typography/typography-h2.astro +12 -9
- package/src/components/ui/typography/typography-h3.astro +7 -9
- package/src/components/ui/typography/typography-h4.astro +7 -9
- package/src/components/ui/typography/typography-inline-code.astro +28 -12
- package/src/components/ui/typography/typography-lead.astro +29 -4
- package/src/components/ui/typography/typography-list-item.astro +25 -9
- package/src/components/ui/typography/typography-list.astro +29 -11
- package/src/components/ui/typography/typography-p.astro +26 -6
- package/src/components/ui/typography/typography-table-cell.astro +32 -13
- package/src/components/ui/typography/typography-table-head.astro +27 -13
- package/src/components/ui/typography/typography-table-row.astro +23 -13
- package/src/components/ui/typography/typography-table.astro +29 -20
- package/src/components/ui/typography/typography.astro +172 -46
- package/src/components/ui/video/video.astro +11 -27
- package/src/styles/global.css +2 -15
- package/public/r/beta-repo-setup.json +0 -125
- package/public/r/blocks.json +0 -91
- package/public/r/content-5.json +0 -17
- package/public/r/content-6.json +0 -17
- package/public/r/gradient.json +0 -17
- package/public/r/init.json +0 -23
- package/public/r/tile.json +0 -27
- package/src/components/blocks/content-5.astro +0 -115
- package/src/components/blocks/content-6.astro +0 -91
- package/src/components/ui/gradient/gradient.astro +0 -45
- package/src/components/ui/gradient/index.ts +0 -1
- package/src/components/ui/tile/index.ts +0 -3
- package/src/components/ui/tile/tile-content.astro +0 -17
- package/src/components/ui/tile/tile-group.astro +0 -76
- package/src/components/ui/tile/tile.astro +0 -46
|
@@ -1,81 +1,73 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
2
|
+
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
4
|
|
|
4
5
|
import { cn } from "@/lib/utils"
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
const trackVariants = cva(
|
|
8
|
+
"flex min-w-max shrink-0 [animation:marquee_var(--marquee-duration)_linear_infinite] items-center gap-[var(--marquee-gap)] before:block before:size-0 before:shrink-0 before:content-['']",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
direction: {
|
|
12
|
+
left: "",
|
|
13
|
+
right: "[animation-direction:reverse]",
|
|
14
|
+
},
|
|
15
|
+
pauseOnHover: {
|
|
16
|
+
true: "group-hover/marquee:[animation-play-state:paused]",
|
|
17
|
+
false: "",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
direction: "left",
|
|
22
|
+
pauseOnHover: false,
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
type Props = HTMLAttributes<"div"> &
|
|
28
|
+
VariantProps<typeof trackVariants> & {
|
|
29
|
+
duration?: string
|
|
30
|
+
gap?: string
|
|
31
|
+
infinite?: boolean
|
|
32
|
+
}
|
|
17
33
|
|
|
18
34
|
const {
|
|
19
|
-
class: className
|
|
20
|
-
direction
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
class: className,
|
|
36
|
+
direction,
|
|
37
|
+
pauseOnHover,
|
|
38
|
+
duration = "40s",
|
|
39
|
+
gap = "1.5rem",
|
|
23
40
|
infinite = true,
|
|
24
|
-
pauseOnHover = false,
|
|
25
41
|
style,
|
|
26
|
-
time = 30,
|
|
27
|
-
variant = "gradient",
|
|
28
42
|
...props
|
|
29
43
|
} = Astro.props
|
|
30
44
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"marquee-content flex min-w-full shrink-0 justify-around gap-[var(--gap)] will-change-transform group-data-[direction=bottom]:[animation-direction:reverse] group-data-[direction=right]:[animation-direction:reverse] data-[direction=bottom]:min-h-full data-[direction=bottom]:flex-col data-[direction=top]:min-h-full data-[direction=top]:flex-col motion-reduce:[animation-play-state:paused]",
|
|
39
|
-
infinite &&
|
|
40
|
-
"animate-[marquee-x_var(--duration,20s)_linear_infinite] group-data-[direction=bottom]:animate-[marquee-y_var(--duration,20s)_linear_infinite] group-data-[direction=top]:animate-[marquee-y_var(--duration,20s)_linear_infinite]",
|
|
41
|
-
direction === "top" && "flex-col",
|
|
42
|
-
direction === "bottom" && "flex-col"
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
const marqueeVariants = cva("relative w-full", {
|
|
46
|
-
variants: {
|
|
47
|
-
variant: {
|
|
48
|
-
gradient:
|
|
49
|
-
"[mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent)] [-webkit-mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent)] [&[data-direction=bottom]]:[mask-image:linear-gradient(to_top,transparent,black_10%,black_90%,transparent)] [&[data-direction=bottom]]:[-webkit-mask-image:linear-gradient(to_top,transparent,black_10%,black_90%,transparent)] [&[data-direction=top]]:[mask-image:linear-gradient(to_bottom,transparent,black_10%,black_90%,transparent)] [&[data-direction=top]]:[-webkit-mask-image:linear-gradient(to_bottom,transparent,black_10%,black_90%,transparent)]",
|
|
50
|
-
solid: "",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
defaultVariants: {
|
|
54
|
-
variant: "gradient",
|
|
55
|
-
},
|
|
56
|
-
})
|
|
45
|
+
const resolvedStyle = [
|
|
46
|
+
`--marquee-duration:${duration}`,
|
|
47
|
+
`--marquee-gap:${gap}`,
|
|
48
|
+
typeof style === "string" ? style : undefined,
|
|
49
|
+
]
|
|
50
|
+
.filter(Boolean)
|
|
51
|
+
.join(";")
|
|
57
52
|
---
|
|
58
53
|
|
|
59
54
|
<div
|
|
60
|
-
data-marquee
|
|
61
|
-
data-direction={direction}
|
|
62
|
-
data-pause-on-hover={pauseOnHover ? "true" : undefined}
|
|
63
55
|
class={cn(
|
|
64
|
-
"",
|
|
65
|
-
// container utilities
|
|
66
|
-
"group flex w-full gap-[var(--gap)] overflow-hidden data-[direction=bottom]:flex-col data-[direction=top]:flex-col",
|
|
67
|
-
marqueeVariants({ variant }),
|
|
56
|
+
"group/marquee flex overflow-hidden select-none [--marquee-duration:40s] [--marquee-gap:1.5rem]",
|
|
68
57
|
className
|
|
69
58
|
)}
|
|
70
|
-
style={
|
|
59
|
+
style={resolvedStyle}
|
|
71
60
|
{...props}
|
|
72
61
|
>
|
|
73
|
-
<div class={
|
|
62
|
+
<div class={trackVariants({ direction, pauseOnHover })}>
|
|
74
63
|
<slot />
|
|
75
64
|
</div>
|
|
76
65
|
{
|
|
77
66
|
infinite && (
|
|
78
|
-
<div
|
|
67
|
+
<div
|
|
68
|
+
aria-hidden="true"
|
|
69
|
+
class={trackVariants({ direction, pauseOnHover })}
|
|
70
|
+
>
|
|
79
71
|
<slot />
|
|
80
72
|
</div>
|
|
81
73
|
)
|
|
@@ -83,24 +75,13 @@ const marqueeVariants = cva("relative w-full", {
|
|
|
83
75
|
</div>
|
|
84
76
|
|
|
85
77
|
<style>
|
|
86
|
-
@keyframes marquee
|
|
78
|
+
@keyframes marquee {
|
|
87
79
|
from {
|
|
88
80
|
transform: translateX(0);
|
|
89
81
|
}
|
|
82
|
+
|
|
90
83
|
to {
|
|
91
|
-
transform: translateX(
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
@keyframes marquee-y {
|
|
95
|
-
from {
|
|
96
|
-
transform: translateY(0);
|
|
97
|
-
}
|
|
98
|
-
to {
|
|
99
|
-
transform: translateY(calc(-100% - var(--gap)));
|
|
84
|
+
transform: translateX(-100%);
|
|
100
85
|
}
|
|
101
86
|
}
|
|
102
|
-
|
|
103
|
-
[data-marquee][data-pause-on-hover="true"]:hover .marquee-content {
|
|
104
|
-
animation-play-state: paused;
|
|
105
|
-
}
|
|
106
87
|
</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import ChevronDownIcon from "@lucide/astro/icons/chevron-down"
|
|
3
4
|
|
|
4
5
|
import { cn } from "@/lib/utils"
|
|
5
|
-
import { Icon } from "@/components/ui/icon"
|
|
6
6
|
|
|
7
7
|
type Props = Omit<HTMLAttributes<"select">, "size"> & {
|
|
8
8
|
size?: "sm" | "default"
|
|
@@ -27,8 +27,7 @@ const { class: className, size = "default", ...props } = Astro.props
|
|
|
27
27
|
>
|
|
28
28
|
<slot />
|
|
29
29
|
</select>
|
|
30
|
-
<
|
|
31
|
-
name="chevron-down"
|
|
30
|
+
<ChevronDownIcon
|
|
32
31
|
class="text-muted-foreground pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 select-none"
|
|
33
32
|
aria-hidden="true"
|
|
34
33
|
data-slot="native-select-icon"
|
|
@@ -13,6 +13,7 @@ type Props = {
|
|
|
13
13
|
|
|
14
14
|
const {
|
|
15
15
|
class: className = "",
|
|
16
|
+
hidden = true,
|
|
16
17
|
align,
|
|
17
18
|
alignOffset,
|
|
18
19
|
side,
|
|
@@ -24,12 +25,13 @@ const {
|
|
|
24
25
|
<div
|
|
25
26
|
{...props}
|
|
26
27
|
data-slot="navigation-menu-content"
|
|
28
|
+
hidden={hidden}
|
|
27
29
|
data-align={align}
|
|
28
30
|
data-align-offset={alignOffset}
|
|
29
31
|
data-side={side}
|
|
30
32
|
data-side-offset={sideOffset}
|
|
31
33
|
class={cn(
|
|
32
|
-
"
|
|
34
|
+
"group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:ring-foreground/10 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95 h-full w-auto p-2 pr-2.5 transition-[opacity,transform,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:duration-300 data-ending-style:opacity-0 data-starting-style:opacity-0 data-ending-style:data-[activation-direction=left]:translate-x-[50%] data-starting-style:data-[activation-direction=left]:translate-x-[-50%] data-ending-style:data-[activation-direction=right]:translate-x-[-50%] data-starting-style:data-[activation-direction=right]:translate-x-[50%] **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
|
|
33
35
|
className
|
|
34
36
|
)}
|
|
35
37
|
>
|
|
@@ -10,8 +10,9 @@ const { class: className, ...props } = Astro.props
|
|
|
10
10
|
|
|
11
11
|
<div
|
|
12
12
|
data-slot="navigation-menu-indicator"
|
|
13
|
+
data-state="hidden"
|
|
13
14
|
class={cn(
|
|
14
|
-
"data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in top-full z-1 flex h-1.5 items-end justify-center overflow-hidden",
|
|
15
|
+
"data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in absolute top-full left-(--indicator-left) z-1 flex h-1.5 w-(--indicator-width) items-end justify-center overflow-hidden data-[state=hidden]:invisible",
|
|
15
16
|
className
|
|
16
17
|
)}
|
|
17
18
|
{...props}
|
|
@@ -11,7 +11,7 @@ const { class: className, ...props } = Astro.props
|
|
|
11
11
|
<ul
|
|
12
12
|
data-slot="navigation-menu-list"
|
|
13
13
|
class={cn(
|
|
14
|
-
"group flex flex-1 list-none items-center justify-center gap-
|
|
14
|
+
"group relative flex flex-1 list-none items-center justify-center gap-0",
|
|
15
15
|
className
|
|
16
16
|
)}
|
|
17
17
|
{...props}
|
|
@@ -35,10 +35,12 @@ const {
|
|
|
35
35
|
>
|
|
36
36
|
<div
|
|
37
37
|
data-slot="navigation-menu-popup"
|
|
38
|
+
hidden
|
|
38
39
|
class="data-[ending-style]:easing-[ease] xs:w-(--popup-width) bg-popover text-popover-foreground ring-foreground/10 relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) rounded-lg shadow ring-1 transition-[opacity,transform,width,height,scale,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] outline-none data-ending-style:scale-90 data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:scale-90 data-starting-style:opacity-0"
|
|
39
40
|
>
|
|
40
41
|
<div
|
|
41
42
|
data-slot="navigation-menu-viewport"
|
|
43
|
+
hidden
|
|
42
44
|
class="relative size-full overflow-hidden"
|
|
43
45
|
>
|
|
44
46
|
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import ChevronDownIcon from "@lucide/astro/icons/chevron-down"
|
|
3
4
|
|
|
4
5
|
import { cn } from "@/lib/utils"
|
|
5
|
-
import { Icon } from "@/components/ui/icon"
|
|
6
6
|
|
|
7
7
|
import navigationMenuTriggerStyle from "./navigation-menu-trigger-style"
|
|
8
8
|
|
|
@@ -19,8 +19,7 @@ const { class: className, type = "button", ...props } = Astro.props
|
|
|
19
19
|
>
|
|
20
20
|
<slot />
|
|
21
21
|
{" "}
|
|
22
|
-
<
|
|
23
|
-
name="chevron-down"
|
|
22
|
+
<ChevronDownIcon
|
|
24
23
|
class="relative top-px ml-1 size-3 transition duration-300 group-data-open/navigation-menu-trigger:rotate-180 group-data-popup-open/navigation-menu-trigger:rotate-180"
|
|
25
24
|
aria-hidden="true"
|
|
26
25
|
/>
|
|
@@ -48,7 +48,7 @@ const {
|
|
|
48
48
|
data-safe-triangle={safeTriangle}
|
|
49
49
|
data-debug-safe-triangle={debugSafeTriangle}
|
|
50
50
|
class={cn(
|
|
51
|
-
"group/navigation-menu relative flex flex-1 items-center justify-center",
|
|
51
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
52
52
|
className
|
|
53
53
|
)}
|
|
54
54
|
>
|
|
@@ -51,7 +51,7 @@ const {
|
|
|
51
51
|
data-position={position}
|
|
52
52
|
hidden={hidden}
|
|
53
53
|
class={cn(
|
|
54
|
-
"bg-popover text-popover-foreground ring-foreground/10 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 duration-100
|
|
54
|
+
"bg-popover text-popover-foreground ring-foreground/10 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95 data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 outline-hidden duration-100",
|
|
55
55
|
className
|
|
56
56
|
)}
|
|
57
57
|
{...props}
|
|
@@ -23,7 +23,7 @@ const {
|
|
|
23
23
|
data-value={value}
|
|
24
24
|
data-disabled={disabled ? "" : undefined}
|
|
25
25
|
class={cn(
|
|
26
|
-
"group/radio-group-item peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[checked]:border-primary data-[checked]:bg-primary data-[checked]:text-primary-foreground dark:data-[checked]:bg-primary relative flex aspect-square size-4 shrink-0 rounded-full border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
26
|
+
"group/radio-group-item peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[checked]:border-primary data-[checked]:bg-primary data-[checked]:text-primary-foreground dark:data-[checked]:bg-primary group-has-[:focus-visible]/field-label:not-data-[checked]:border-input group-has-[:focus-visible]/field-label:data-[checked]:border-primary relative flex aspect-square size-4 shrink-0 rounded-full border outline-none group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
27
27
|
className
|
|
28
28
|
)}
|
|
29
29
|
{...props}
|
|
@@ -32,12 +32,12 @@ const {
|
|
|
32
32
|
aria-hidden="true"
|
|
33
33
|
data-slot="radio-group-indicator"
|
|
34
34
|
class={cn(
|
|
35
|
-
"flex size-4 items-center justify-center opacity-0 group-data-checked/radio-group-item:opacity-100",
|
|
35
|
+
"flex size-4 items-center justify-center opacity-0 group-data-[checked]/radio-group-item:opacity-100",
|
|
36
36
|
indicatorClass
|
|
37
37
|
)}
|
|
38
38
|
>
|
|
39
39
|
<span
|
|
40
|
-
class="bg-
|
|
40
|
+
class="bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full"
|
|
41
41
|
></span>
|
|
42
42
|
</span>
|
|
43
43
|
</span>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import Star from "@lucide/astro/icons/star"
|
|
3
4
|
|
|
4
5
|
import { cn } from "@/lib/utils"
|
|
5
|
-
import { Icon } from "@/components/ui/icon"
|
|
6
6
|
|
|
7
7
|
type Props = HTMLAttributes<"div"> & {
|
|
8
8
|
value?: number
|
|
@@ -23,13 +23,13 @@ const { value = 5, class: className, ...props } = Astro.props
|
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<span class="text-muted-foreground/25 relative inline-flex size-[1em]">
|
|
26
|
-
<
|
|
26
|
+
<Star class="size-[1em] fill-current" />
|
|
27
27
|
{fillPercentage > 0 && (
|
|
28
28
|
<span
|
|
29
29
|
class="text-primary absolute inset-0 overflow-hidden"
|
|
30
30
|
style={{ width: `${fillPercentage}%` }}
|
|
31
31
|
>
|
|
32
|
-
<
|
|
32
|
+
<Star class="size-[1em] fill-current" />
|
|
33
33
|
</span>
|
|
34
34
|
)}
|
|
35
35
|
</span>
|
|
@@ -60,7 +60,7 @@ const {
|
|
|
60
60
|
<div
|
|
61
61
|
data-slot="select-viewport"
|
|
62
62
|
data-position={position}
|
|
63
|
-
class="
|
|
63
|
+
class="data-[position=item-aligned]:w-full data-[position=popper]:min-w-36"
|
|
64
64
|
>
|
|
65
65
|
<slot />
|
|
66
66
|
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import CheckIcon from "@lucide/astro/icons/check"
|
|
3
4
|
|
|
4
5
|
import { cn } from "@/lib/utils"
|
|
5
|
-
import { Icon } from "@/components/ui/icon"
|
|
6
6
|
|
|
7
7
|
type Props = HTMLAttributes<"div"> & {
|
|
8
8
|
value?: string
|
|
@@ -19,7 +19,7 @@ const { class: className, value, disabled, label, ...props } = Astro.props
|
|
|
19
19
|
data-disabled={disabled ? "true" : undefined}
|
|
20
20
|
data-label={label}
|
|
21
21
|
class={cn(
|
|
22
|
-
"group/select-item data-highlighted:bg-accent data-highlighted:text-accent-foreground data-highlighted:**:[svg]:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-
|
|
22
|
+
"group/select-item data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[highlighted]:**:[svg]:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 *:data-[slot=select-item-text]:flex *:data-[slot=select-item-text]:shrink-0 *:data-[slot=select-item-text]:items-center *:data-[slot=select-item-text]:gap-2 *:data-[slot=select-item-text]:whitespace-nowrap [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
23
23
|
className
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
@@ -32,8 +32,8 @@ const { class: className, value, disabled, label, ...props } = Astro.props
|
|
|
32
32
|
</span>
|
|
33
33
|
<span
|
|
34
34
|
aria-hidden="true"
|
|
35
|
-
class="pointer-events-none absolute right-2 flex size-4 items-center justify-center opacity-0 group-data-selected/select-item:opacity-100"
|
|
35
|
+
class="pointer-events-none absolute right-2 flex size-4 items-center justify-center opacity-0 group-data-[selected]/select-item:opacity-100"
|
|
36
36
|
>
|
|
37
|
-
<
|
|
37
|
+
<CheckIcon />
|
|
38
38
|
</span>
|
|
39
39
|
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import ChevronDownIcon from "@lucide/astro/icons/chevron-down"
|
|
3
4
|
|
|
4
5
|
import { cn } from "@/lib/utils"
|
|
5
|
-
import { Icon } from "@/components/ui/icon"
|
|
6
6
|
|
|
7
7
|
type Props = HTMLAttributes<"button"> & {
|
|
8
8
|
size?: "sm" | "default"
|
|
@@ -23,7 +23,7 @@ const {
|
|
|
23
23
|
data-size={size}
|
|
24
24
|
type={type}
|
|
25
25
|
class={cn(
|
|
26
|
-
"border-input dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 data-placeholder:text-muted-foreground flex w-
|
|
26
|
+
"border-input dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 data-placeholder:text-muted-foreground flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
27
27
|
className
|
|
28
28
|
)}
|
|
29
29
|
{...props}
|
|
@@ -31,10 +31,7 @@ const {
|
|
|
31
31
|
<slot />
|
|
32
32
|
{
|
|
33
33
|
showIcon && (
|
|
34
|
-
<
|
|
35
|
-
name="chevron-down"
|
|
36
|
-
class="text-muted-foreground pointer-events-none size-4"
|
|
37
|
-
/>
|
|
34
|
+
<ChevronDownIcon class="text-muted-foreground pointer-events-none size-4" />
|
|
38
35
|
)
|
|
39
36
|
}
|
|
40
37
|
</button>
|
|
@@ -6,6 +6,7 @@ import { cn } from "@/lib/utils"
|
|
|
6
6
|
|
|
7
7
|
type Props = HTMLAttributes<"div"> & {
|
|
8
8
|
defaultValue?: string
|
|
9
|
+
defaultOpen?: boolean
|
|
9
10
|
placeholder?: string
|
|
10
11
|
disabled?: boolean
|
|
11
12
|
required?: boolean
|
|
@@ -18,11 +19,13 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
18
19
|
avoidCollisions?: boolean
|
|
19
20
|
collisionPadding?: number
|
|
20
21
|
highlightItemOnHover?: boolean
|
|
22
|
+
lockScroll?: boolean
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
const {
|
|
24
26
|
class: className,
|
|
25
27
|
defaultValue,
|
|
28
|
+
defaultOpen,
|
|
26
29
|
placeholder,
|
|
27
30
|
disabled,
|
|
28
31
|
required,
|
|
@@ -35,6 +38,7 @@ const {
|
|
|
35
38
|
avoidCollisions,
|
|
36
39
|
collisionPadding,
|
|
37
40
|
highlightItemOnHover,
|
|
41
|
+
lockScroll,
|
|
38
42
|
...props
|
|
39
43
|
} = Astro.props
|
|
40
44
|
---
|
|
@@ -42,6 +46,7 @@ const {
|
|
|
42
46
|
<div
|
|
43
47
|
data-slot="select"
|
|
44
48
|
data-default-value={defaultValue}
|
|
49
|
+
data-default-open={defaultOpen}
|
|
45
50
|
data-placeholder={placeholder}
|
|
46
51
|
data-disabled={disabled}
|
|
47
52
|
data-required={required}
|
|
@@ -54,6 +59,7 @@ const {
|
|
|
54
59
|
data-avoid-collisions={avoidCollisions}
|
|
55
60
|
data-collision-padding={collisionPadding}
|
|
56
61
|
data-highlight-item-on-hover={highlightItemOnHover}
|
|
62
|
+
data-lock-scroll={lockScroll}
|
|
57
63
|
class={cn(
|
|
58
64
|
"group/select relative inline-flex w-fit flex-col gap-1.5",
|
|
59
65
|
className
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types"
|
|
3
|
+
import XIcon from "@lucide/astro/icons/x"
|
|
3
4
|
|
|
4
5
|
import { cn } from "@/lib/utils"
|
|
5
6
|
import { Button } from "@/components/ui/button"
|
|
6
7
|
import DialogPortal from "@/components/ui/dialog/dialog-portal.astro"
|
|
7
|
-
import { Icon } from "@/components/ui/icon"
|
|
8
8
|
|
|
9
9
|
type Props = HTMLAttributes<"div"> & {
|
|
10
10
|
side?: "top" | "right" | "bottom" | "left"
|
|
@@ -25,7 +25,7 @@ const {
|
|
|
25
25
|
data-slot="dialog-overlay"
|
|
26
26
|
hidden
|
|
27
27
|
class="fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs"
|
|
28
|
-
style="z-index: calc(var(--dialog-overlay-stack-index, 0) + 100);"
|
|
28
|
+
style="z-index: calc(var(--dialog-overlay-stack-index, 0) * 2 + 100);"
|
|
29
29
|
>
|
|
30
30
|
</div>
|
|
31
31
|
<div
|
|
@@ -33,11 +33,10 @@ const {
|
|
|
33
33
|
data-side={side}
|
|
34
34
|
hidden
|
|
35
35
|
class={cn(
|
|
36
|
-
"bg-popover text-popover-foreground fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out outline-none data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-
|
|
37
|
-
"bg-popover text-popover-foreground fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out outline-none data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-10 data-[side=bottom]:data-starting-style:translate-y-10 data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:-translate-x-10 data-[side=left]:data-starting-style:-translate-x-10 data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-10 data-[side=right]:data-starting-style:translate-x-10 data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:-translate-y-10 data-[side=top]:data-starting-style:-translate-y-10 data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
36
|
+
"bg-popover text-popover-foreground fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out outline-none data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
38
37
|
className
|
|
39
38
|
)}
|
|
40
|
-
style={`z-index: calc(var(--dialog-content-stack-index, 0) + 101);${style ? ` ${style}` : ""}`}
|
|
39
|
+
style={`z-index: calc(var(--dialog-content-stack-index, 0) * 2 + 101);${style ? ` ${style}` : ""}`}
|
|
41
40
|
{...props}
|
|
42
41
|
>
|
|
43
42
|
<slot />
|
|
@@ -48,9 +47,9 @@ const {
|
|
|
48
47
|
data-slot="dialog-close"
|
|
49
48
|
variant="ghost"
|
|
50
49
|
size="icon-sm"
|
|
51
|
-
class="absolute top-
|
|
50
|
+
class="absolute top-4 right-4"
|
|
52
51
|
>
|
|
53
|
-
<
|
|
52
|
+
<XIcon />
|
|
54
53
|
<span class="sr-only">Close</span>
|
|
55
54
|
</Button>
|
|
56
55
|
)
|
|
@@ -16,18 +16,15 @@ const {
|
|
|
16
16
|
lockScroll,
|
|
17
17
|
...props
|
|
18
18
|
} = Astro.props
|
|
19
|
-
|
|
20
|
-
const manageScrollLock = lockScroll !== false
|
|
21
19
|
---
|
|
22
20
|
|
|
23
21
|
<div
|
|
24
22
|
data-slot="dialog"
|
|
25
|
-
data-sheet-lock-scroll={manageScrollLock ? "" : undefined}
|
|
26
23
|
class={className}
|
|
27
24
|
data-default-open={defaultOpen}
|
|
28
25
|
data-close-on-click-outside={closeOnClickOutside}
|
|
29
26
|
data-close-on-escape={closeOnEscape}
|
|
30
|
-
data-lock-scroll=
|
|
27
|
+
data-lock-scroll={lockScroll}
|
|
31
28
|
{...props}
|
|
32
29
|
>
|
|
33
30
|
<slot />
|
|
@@ -37,89 +34,4 @@ const manageScrollLock = lockScroll !== false
|
|
|
37
34
|
import { create } from "@data-slot/dialog"
|
|
38
35
|
|
|
39
36
|
create()
|
|
40
|
-
|
|
41
|
-
declare global {
|
|
42
|
-
interface Window {
|
|
43
|
-
__fulldevSheetScrollLock?: {
|
|
44
|
-
roots: Set<HTMLElement>
|
|
45
|
-
savedHtmlOverflow: string
|
|
46
|
-
savedHtmlScrollbarGutter: string
|
|
47
|
-
savedBodyPaddingRight: string
|
|
48
|
-
}
|
|
49
|
-
__fulldevSheetScrollLockBound?: boolean
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const state =
|
|
54
|
-
window.__fulldevSheetScrollLock ??
|
|
55
|
-
(window.__fulldevSheetScrollLock = {
|
|
56
|
-
roots: new Set<HTMLElement>(),
|
|
57
|
-
savedHtmlOverflow: "",
|
|
58
|
-
savedHtmlScrollbarGutter: "",
|
|
59
|
-
savedBodyPaddingRight: "",
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
const applyScrollLock = () => {
|
|
63
|
-
const html = document.documentElement
|
|
64
|
-
const body = document.body
|
|
65
|
-
|
|
66
|
-
if (state.roots.size === 0) {
|
|
67
|
-
html.style.overflow = state.savedHtmlOverflow
|
|
68
|
-
html.style.scrollbarGutter = state.savedHtmlScrollbarGutter
|
|
69
|
-
body.style.paddingRight = state.savedBodyPaddingRight
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (state.roots.size === 1) {
|
|
74
|
-
state.savedHtmlOverflow = html.style.overflow
|
|
75
|
-
state.savedHtmlScrollbarGutter = html.style.scrollbarGutter
|
|
76
|
-
state.savedBodyPaddingRight = body.style.paddingRight
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const scrollbarWidth = window.innerWidth - html.clientWidth
|
|
80
|
-
const bodyPaddingRight = Number.parseFloat(
|
|
81
|
-
window.getComputedStyle(body).paddingRight || "0"
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
html.style.overflow = "hidden"
|
|
85
|
-
html.style.scrollbarGutter = "auto"
|
|
86
|
-
body.style.paddingRight = `${bodyPaddingRight + Math.max(scrollbarWidth, 0)}px`
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const syncRoot = (root: HTMLElement, open: boolean) => {
|
|
90
|
-
const hasRoot = state.roots.has(root)
|
|
91
|
-
if (open === hasRoot) return
|
|
92
|
-
|
|
93
|
-
if (open) state.roots.add(root)
|
|
94
|
-
else state.roots.delete(root)
|
|
95
|
-
|
|
96
|
-
applyScrollLock()
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (!window.__fulldevSheetScrollLockBound) {
|
|
100
|
-
window.__fulldevSheetScrollLockBound = true
|
|
101
|
-
|
|
102
|
-
document.addEventListener("dialog:change", (event) => {
|
|
103
|
-
const target = event.target
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
!(target instanceof HTMLElement) ||
|
|
107
|
-
target.dataset.slot !== "dialog" ||
|
|
108
|
-
target.dataset.sheetLockScroll === undefined
|
|
109
|
-
) {
|
|
110
|
-
return
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const detail = (event as CustomEvent<{ open?: boolean }>).detail
|
|
114
|
-
syncRoot(target, Boolean(detail?.open))
|
|
115
|
-
})
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
document
|
|
119
|
-
.querySelectorAll<HTMLElement>(
|
|
120
|
-
'[data-slot="dialog"][data-sheet-lock-scroll]'
|
|
121
|
-
)
|
|
122
|
-
.forEach((root) => {
|
|
123
|
-
syncRoot(root, root.hasAttribute("data-open"))
|
|
124
|
-
})
|
|
125
37
|
</script>
|