fulldev-ui 0.11.1 → 0.12.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 +23 -0
- package/package.json +24 -20
- package/public/r/accordion.json +2 -2
- package/public/r/alert-dialog.json +2 -2
- package/public/r/banner.json +0 -4
- package/public/r/blocks-1.json +1 -1
- package/public/r/button.json +1 -1
- package/public/r/collapsible.json +2 -2
- package/public/r/combobox.json +4 -3
- package/public/r/command.json +5 -4
- package/public/r/dialog.json +2 -2
- package/public/r/doc-1.json +1 -1
- package/public/r/dropdown-menu.json +4 -4
- package/public/r/hover-card.json +4 -4
- package/public/r/input-group.json +0 -1
- package/public/r/layout.json +3 -0
- package/public/r/navigation-menu.json +3 -3
- package/public/r/popover.json +3 -3
- package/public/r/radio-group.json +2 -2
- package/public/r/registry.json +26 -26
- package/public/r/select.json +3 -3
- package/public/r/sheet.json +2 -2
- package/public/r/sidebar-1.json +1 -1
- package/public/r/sidebar.json +1 -1
- package/public/r/slider.json +2 -2
- package/public/r/switch.json +2 -2
- package/public/r/tabs.json +4 -4
- package/public/r/toggle.json +2 -2
- package/public/r/tooltip.json +3 -3
- package/registry.json +31 -21
- package/src/components/blocks/blocks-1.astro +23 -23
- package/src/components/blocks/doc-1.astro +40 -26
- package/src/components/blocks/sidebar-1.astro +46 -44
- package/src/components/ui/accordion/accordion.astro +8 -2
- package/src/components/ui/alert-dialog/alert-dialog.astro +8 -2
- package/src/components/ui/button/button.astro +4 -1
- package/src/components/ui/collapsible/collapsible.astro +8 -2
- package/src/components/ui/combobox/combobox-content.astro +1 -1
- package/src/components/ui/combobox/combobox.astro +9 -17
- package/src/components/ui/command/command-dialog.astro +1 -0
- package/src/components/ui/command/command.astro +40 -25
- package/src/components/ui/dialog/dialog.astro +8 -2
- package/src/components/ui/dropdown-menu/dropdown-menu-content.astro +1 -1
- package/src/components/ui/dropdown-menu/dropdown-menu-item.astro +40 -9
- package/src/components/ui/dropdown-menu/dropdown-menu.astro +8 -2
- package/src/components/ui/hover-card/hover-card-content.astro +1 -1
- package/src/components/ui/hover-card/hover-card.astro +15 -4
- package/src/components/ui/navigation-menu/navigation-menu-positioner.astro +1 -1
- package/src/components/ui/navigation-menu/navigation-menu.astro +11 -2
- package/src/components/ui/popover/popover-content.astro +2 -1
- package/src/components/ui/popover/popover.astro +9 -2
- package/src/components/ui/radio-group/radio-group.astro +8 -2
- package/src/components/ui/select/select-content.astro +2 -2
- package/src/components/ui/select/select.astro +11 -7
- package/src/components/ui/sheet/sheet.astro +8 -2
- package/src/components/ui/slider/slider.astro +10 -4
- package/src/components/ui/switch/switch.astro +8 -2
- package/src/components/ui/tabs/tabs-content.astro +1 -1
- package/src/components/ui/tabs/tabs-trigger.astro +3 -2
- package/src/components/ui/tabs/tabs.astro +8 -2
- package/src/components/ui/toggle/toggle.astro +8 -2
- package/src/components/ui/tooltip/tooltip-content.astro +1 -1
- package/src/components/ui/tooltip/tooltip.astro +11 -2
|
@@ -46,31 +46,46 @@ const {
|
|
|
46
46
|
|
|
47
47
|
<script>
|
|
48
48
|
import { create } from "@data-slot/command"
|
|
49
|
+
import { getParts } from "@data-slot/core"
|
|
49
50
|
|
|
50
|
-
const
|
|
51
|
-
|
|
51
|
+
const controllers: ReturnType<typeof create> = []
|
|
52
|
+
const initialize = () => controllers.push(...create())
|
|
53
|
+
initialize()
|
|
54
|
+
document.addEventListener("astro:page-load", initialize)
|
|
55
|
+
document.addEventListener("astro:before-swap", () => {
|
|
56
|
+
for (const controller of controllers) controller.destroy()
|
|
57
|
+
controllers.length = 0
|
|
58
|
+
})
|
|
52
59
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
// Data Slot selection does not activate links. Preserve native navigation.
|
|
61
|
+
document.addEventListener(
|
|
62
|
+
"keydown",
|
|
63
|
+
(event) => {
|
|
64
|
+
if (
|
|
65
|
+
event.key !== "Enter" ||
|
|
66
|
+
event.defaultPrevented ||
|
|
67
|
+
event.isComposing ||
|
|
68
|
+
event.keyCode === 229
|
|
69
|
+
)
|
|
70
|
+
return
|
|
71
|
+
const input = event.target
|
|
72
|
+
if (
|
|
73
|
+
!(input instanceof HTMLInputElement) ||
|
|
74
|
+
input.dataset.slot !== "command-input"
|
|
75
|
+
)
|
|
76
|
+
return
|
|
77
|
+
const root = input.closest('[data-slot="command"]')
|
|
78
|
+
if (!root) return
|
|
79
|
+
const item = getParts<HTMLAnchorElement>(root, "command-item").find(
|
|
80
|
+
(item) =>
|
|
81
|
+
item.hasAttribute("data-selected") &&
|
|
82
|
+
item.hasAttribute("href") &&
|
|
83
|
+
item.getAttribute("aria-disabled") !== "true"
|
|
84
|
+
)
|
|
85
|
+
if (!item) return
|
|
86
|
+
event.preventDefault()
|
|
87
|
+
item.click()
|
|
88
|
+
},
|
|
89
|
+
true
|
|
90
|
+
)
|
|
76
91
|
</script>
|
|
@@ -36,6 +36,12 @@ const {
|
|
|
36
36
|
<script>
|
|
37
37
|
import { create } from "@data-slot/dialog"
|
|
38
38
|
|
|
39
|
-
create
|
|
40
|
-
|
|
39
|
+
const controllers: ReturnType<typeof create> = []
|
|
40
|
+
const initialize = () => controllers.push(...create())
|
|
41
|
+
initialize()
|
|
42
|
+
document.addEventListener("astro:page-load", initialize)
|
|
43
|
+
document.addEventListener("astro:before-swap", () => {
|
|
44
|
+
for (const controller of controllers) controller.destroy()
|
|
45
|
+
controllers.length = 0
|
|
46
|
+
})
|
|
41
47
|
</script>
|
|
@@ -3,13 +3,16 @@ import type { HTMLAttributes } from "astro/types"
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
|
-
type Props = HTMLAttributes<"button"> &
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
type Props = HTMLAttributes<"button"> &
|
|
7
|
+
HTMLAttributes<"a"> & {
|
|
8
|
+
as?: "button" | "a"
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
variant?: "default" | "destructive"
|
|
11
|
+
inset?: boolean
|
|
12
|
+
}
|
|
11
13
|
|
|
12
14
|
const {
|
|
15
|
+
as: Tag = "href" in Astro.props ? "a" : "button",
|
|
13
16
|
class: className,
|
|
14
17
|
type = "button",
|
|
15
18
|
disabled,
|
|
@@ -19,13 +22,13 @@ const {
|
|
|
19
22
|
} = Astro.props
|
|
20
23
|
---
|
|
21
24
|
|
|
22
|
-
<
|
|
25
|
+
<Tag
|
|
23
26
|
data-slot="dropdown-menu-item"
|
|
24
27
|
data-disabled={disabled}
|
|
25
28
|
data-variant={variant}
|
|
26
29
|
data-inset={inset}
|
|
27
|
-
disabled={disabled ? true : undefined}
|
|
28
|
-
type={type}
|
|
30
|
+
disabled={Tag === "button" && disabled ? true : undefined}
|
|
31
|
+
type={Tag === "button" ? type : undefined}
|
|
29
32
|
class={cn(
|
|
30
33
|
"group/dropdown-menu-item data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground not-data-[variant=destructive]:data-[highlighted]:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 data-[variant=destructive]:data-[highlighted]:text-destructive dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/20 data-[variant=destructive]:*:[svg]:text-destructive relative flex w-full cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
31
34
|
className
|
|
@@ -33,4 +36,32 @@ const {
|
|
|
33
36
|
{...props}
|
|
34
37
|
>
|
|
35
38
|
<slot />
|
|
36
|
-
</
|
|
39
|
+
</Tag>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
// Data Slot owns selection; links also need native keyboard activation.
|
|
43
|
+
document.addEventListener(
|
|
44
|
+
"keydown",
|
|
45
|
+
(event) => {
|
|
46
|
+
if (
|
|
47
|
+
event.defaultPrevented ||
|
|
48
|
+
event.isComposing ||
|
|
49
|
+
!["Enter", " "].includes(event.key)
|
|
50
|
+
)
|
|
51
|
+
return
|
|
52
|
+
const item =
|
|
53
|
+
event.target instanceof Element
|
|
54
|
+
? event.target.closest('[data-slot="dropdown-menu-item"][href]')
|
|
55
|
+
: null
|
|
56
|
+
if (
|
|
57
|
+
!(item instanceof HTMLAnchorElement) ||
|
|
58
|
+
item.getAttribute("aria-disabled") === "true"
|
|
59
|
+
)
|
|
60
|
+
return
|
|
61
|
+
event.preventDefault()
|
|
62
|
+
event.stopPropagation()
|
|
63
|
+
item.click()
|
|
64
|
+
},
|
|
65
|
+
true
|
|
66
|
+
)
|
|
67
|
+
</script>
|
|
@@ -67,6 +67,12 @@ const defaultValuesAttr =
|
|
|
67
67
|
<script>
|
|
68
68
|
import { create } from "@data-slot/dropdown-menu"
|
|
69
69
|
|
|
70
|
-
create
|
|
71
|
-
|
|
70
|
+
const controllers: ReturnType<typeof create> = []
|
|
71
|
+
const initialize = () => controllers.push(...create())
|
|
72
|
+
initialize()
|
|
73
|
+
document.addEventListener("astro:page-load", initialize)
|
|
74
|
+
document.addEventListener("astro:before-swap", () => {
|
|
75
|
+
for (const controller of controllers) controller.destroy()
|
|
76
|
+
controllers.length = 0
|
|
77
|
+
})
|
|
72
78
|
</script>
|
|
@@ -4,6 +4,7 @@ import type { HTMLAttributes } from "astro/types"
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
6
|
type Props = HTMLAttributes<"div"> & {
|
|
7
|
+
mountStrategy?: "lazy" | "eager"
|
|
7
8
|
defaultOpen?: boolean
|
|
8
9
|
open?: boolean
|
|
9
10
|
delay?: number
|
|
@@ -21,6 +22,7 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const {
|
|
25
|
+
mountStrategy,
|
|
24
26
|
class: className,
|
|
25
27
|
defaultOpen,
|
|
26
28
|
open,
|
|
@@ -42,6 +44,7 @@ const {
|
|
|
42
44
|
|
|
43
45
|
<div
|
|
44
46
|
data-slot="hover-card"
|
|
47
|
+
data-mount-strategy={mountStrategy}
|
|
45
48
|
data-default-open={defaultOpen}
|
|
46
49
|
data-controlled-open={open}
|
|
47
50
|
data-delay={delay}
|
|
@@ -63,14 +66,22 @@ const {
|
|
|
63
66
|
</div>
|
|
64
67
|
|
|
65
68
|
<script>
|
|
66
|
-
import { getDataBool } from "@data-slot/core"
|
|
69
|
+
import { getDataBool, getRoots, hasRootBinding } from "@data-slot/core"
|
|
67
70
|
import { createHoverCard } from "@data-slot/hover-card"
|
|
68
71
|
|
|
72
|
+
const controllers: ReturnType<typeof createHoverCard>[] = []
|
|
69
73
|
const initialize = () => {
|
|
70
|
-
document
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
for (const root of getRoots(document, "hover-card")) {
|
|
75
|
+
if (hasRootBinding(root, "@data-slot/hover-card")) continue
|
|
76
|
+
controllers.push(
|
|
77
|
+
createHoverCard(root, { open: getDataBool(root, "controlledOpen") })
|
|
78
|
+
)
|
|
79
|
+
}
|
|
73
80
|
}
|
|
74
81
|
initialize()
|
|
75
82
|
document.addEventListener("astro:page-load", initialize)
|
|
83
|
+
document.addEventListener("astro:before-swap", () => {
|
|
84
|
+
for (const controller of controllers) controller.destroy()
|
|
85
|
+
controllers.length = 0
|
|
86
|
+
})
|
|
76
87
|
</script>
|
|
@@ -29,7 +29,7 @@ const {
|
|
|
29
29
|
data-align={align}
|
|
30
30
|
data-align-offset={alignOffset}
|
|
31
31
|
class={cn(
|
|
32
|
-
"isolate z-
|
|
32
|
+
"isolate z-[1000] h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0",
|
|
33
33
|
className
|
|
34
34
|
)}
|
|
35
35
|
>
|
|
@@ -6,6 +6,7 @@ import { cn } from "@/lib/utils"
|
|
|
6
6
|
import NavigationMenuPositioner from "./navigation-menu-positioner.astro"
|
|
7
7
|
|
|
8
8
|
type Props = HTMLAttributes<"nav"> & {
|
|
9
|
+
mountStrategy?: "lazy" | "eager"
|
|
9
10
|
delayOpen?: number
|
|
10
11
|
delayClose?: number
|
|
11
12
|
openOnFocus?: boolean
|
|
@@ -19,6 +20,7 @@ type Props = HTMLAttributes<"nav"> & {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const {
|
|
23
|
+
mountStrategy,
|
|
22
24
|
class: className = "",
|
|
23
25
|
delayOpen = 0,
|
|
24
26
|
delayClose = 0,
|
|
@@ -37,6 +39,7 @@ const {
|
|
|
37
39
|
<nav
|
|
38
40
|
{...props}
|
|
39
41
|
data-slot="navigation-menu"
|
|
42
|
+
data-mount-strategy={mountStrategy}
|
|
40
43
|
data-delay-open={delayOpen}
|
|
41
44
|
data-delay-close={delayClose}
|
|
42
45
|
data-open-on-focus={openOnFocus}
|
|
@@ -59,6 +62,12 @@ const {
|
|
|
59
62
|
<script>
|
|
60
63
|
import { create } from "@data-slot/navigation-menu"
|
|
61
64
|
|
|
62
|
-
create
|
|
63
|
-
|
|
65
|
+
const controllers: ReturnType<typeof create> = []
|
|
66
|
+
const initialize = () => controllers.push(...create())
|
|
67
|
+
initialize()
|
|
68
|
+
document.addEventListener("astro:page-load", initialize)
|
|
69
|
+
document.addEventListener("astro:before-swap", () => {
|
|
70
|
+
for (const controller of controllers) controller.destroy()
|
|
71
|
+
controllers.length = 0
|
|
72
|
+
})
|
|
64
73
|
</script>
|
|
@@ -11,6 +11,7 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
11
11
|
alignOffset?: number
|
|
12
12
|
avoidCollisions?: boolean
|
|
13
13
|
collisionPadding?: number
|
|
14
|
+
/** Compatibility alias. Prefer `side`. */
|
|
14
15
|
position?: PopoverSide
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -38,7 +39,7 @@ const {
|
|
|
38
39
|
data-avoid-collisions={avoidCollisions}
|
|
39
40
|
data-collision-padding={collisionPadding}
|
|
40
41
|
data-position={position}
|
|
41
|
-
class="isolate z-
|
|
42
|
+
class="isolate z-[1000]"
|
|
42
43
|
>
|
|
43
44
|
<div
|
|
44
45
|
data-slot="popover-content"
|
|
@@ -11,6 +11,7 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
11
11
|
avoidCollisions?: boolean
|
|
12
12
|
collisionPadding?: number
|
|
13
13
|
portal?: boolean
|
|
14
|
+
/** Compatibility alias. Prefer `side`. */
|
|
14
15
|
position?: PopoverSide
|
|
15
16
|
closeOnClickOutside?: boolean
|
|
16
17
|
closeOnEscape?: boolean
|
|
@@ -55,6 +56,12 @@ const {
|
|
|
55
56
|
<script>
|
|
56
57
|
import { create } from "@data-slot/popover"
|
|
57
58
|
|
|
58
|
-
create
|
|
59
|
-
|
|
59
|
+
const controllers: ReturnType<typeof create> = []
|
|
60
|
+
const initialize = () => controllers.push(...create())
|
|
61
|
+
initialize()
|
|
62
|
+
document.addEventListener("astro:page-load", initialize)
|
|
63
|
+
document.addEventListener("astro:before-swap", () => {
|
|
64
|
+
for (const controller of controllers) controller.destroy()
|
|
65
|
+
controllers.length = 0
|
|
66
|
+
})
|
|
60
67
|
</script>
|
|
@@ -38,6 +38,12 @@ const {
|
|
|
38
38
|
<script>
|
|
39
39
|
import { create } from "@data-slot/radio-group"
|
|
40
40
|
|
|
41
|
-
create
|
|
42
|
-
|
|
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>
|
|
@@ -38,7 +38,7 @@ const {
|
|
|
38
38
|
data-align-offset={alignOffset}
|
|
39
39
|
data-avoid-collisions={avoidCollisions}
|
|
40
40
|
data-collision-padding={collisionPadding}
|
|
41
|
-
class="isolate z-
|
|
41
|
+
class="isolate z-[1000]"
|
|
42
42
|
>
|
|
43
43
|
<div
|
|
44
44
|
data-slot="select-content"
|
|
@@ -52,7 +52,7 @@ const {
|
|
|
52
52
|
data-collision-padding={collisionPadding}
|
|
53
53
|
hidden={hidden}
|
|
54
54
|
class={cn(
|
|
55
|
-
"bg-popover text-popover-foreground ring-foreground/10 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-
|
|
55
|
+
"bg-popover text-popover-foreground ring-foreground/10 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-[1000] max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1 duration-100 outline-none data-[align-trigger=true]:animate-none",
|
|
56
56
|
className
|
|
57
57
|
)}
|
|
58
58
|
{...props}
|
|
@@ -5,6 +5,7 @@ import type { Align, Position, Side } from "@data-slot/select"
|
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
7
|
type Props = HTMLAttributes<"div"> & {
|
|
8
|
+
mountStrategy?: "lazy" | "eager"
|
|
8
9
|
defaultValue?: string
|
|
9
10
|
defaultOpen?: boolean
|
|
10
11
|
placeholder?: string
|
|
@@ -23,6 +24,7 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
const {
|
|
27
|
+
mountStrategy,
|
|
26
28
|
class: className,
|
|
27
29
|
defaultValue,
|
|
28
30
|
defaultOpen,
|
|
@@ -45,6 +47,7 @@ const {
|
|
|
45
47
|
|
|
46
48
|
<div
|
|
47
49
|
data-slot="select"
|
|
50
|
+
data-mount-strategy={mountStrategy}
|
|
48
51
|
data-default-value={defaultValue}
|
|
49
52
|
data-default-open={defaultOpen}
|
|
50
53
|
data-placeholder={placeholder}
|
|
@@ -72,11 +75,12 @@ const {
|
|
|
72
75
|
<script>
|
|
73
76
|
import { create } from "@data-slot/select"
|
|
74
77
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
const controllers: ReturnType<typeof create> = []
|
|
79
|
+
const initialize = () => controllers.push(...create())
|
|
80
|
+
initialize()
|
|
81
|
+
document.addEventListener("astro:page-load", initialize)
|
|
82
|
+
document.addEventListener("astro:before-swap", () => {
|
|
83
|
+
for (const controller of controllers) controller.destroy()
|
|
84
|
+
controllers.length = 0
|
|
85
|
+
})
|
|
82
86
|
</script>
|
|
@@ -33,6 +33,12 @@ const {
|
|
|
33
33
|
<script>
|
|
34
34
|
import { create } from "@data-slot/dialog"
|
|
35
35
|
|
|
36
|
-
create
|
|
37
|
-
|
|
36
|
+
const controllers: ReturnType<typeof create> = []
|
|
37
|
+
const initialize = () => controllers.push(...create())
|
|
38
|
+
initialize()
|
|
39
|
+
document.addEventListener("astro:page-load", initialize)
|
|
40
|
+
document.addEventListener("astro:before-swap", () => {
|
|
41
|
+
for (const controller of controllers) controller.destroy()
|
|
42
|
+
controllers.length = 0
|
|
43
|
+
})
|
|
38
44
|
</script>
|
|
@@ -3,7 +3,7 @@ import type { HTMLAttributes } from "astro/types"
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
|
-
type SliderValue = number | [number, number]
|
|
6
|
+
type SliderValue = number | [number, number]
|
|
7
7
|
type ThumbAlignment = "center" | "edge" | "edge-client-only"
|
|
8
8
|
|
|
9
9
|
type Props = HTMLAttributes<"div"> & {
|
|
@@ -25,7 +25,7 @@ const {
|
|
|
25
25
|
step,
|
|
26
26
|
largeStep,
|
|
27
27
|
orientation = "horizontal",
|
|
28
|
-
thumbAlignment = "
|
|
28
|
+
thumbAlignment = "center",
|
|
29
29
|
disabled,
|
|
30
30
|
...props
|
|
31
31
|
} = Astro.props
|
|
@@ -82,6 +82,12 @@ const thumbCount = String(serializedDefaultValue ?? "").includes(",") ? 2 : 1
|
|
|
82
82
|
<script>
|
|
83
83
|
import { create } from "@data-slot/slider"
|
|
84
84
|
|
|
85
|
-
create
|
|
86
|
-
|
|
85
|
+
const controllers: ReturnType<typeof create> = []
|
|
86
|
+
const initialize = () => controllers.push(...create())
|
|
87
|
+
initialize()
|
|
88
|
+
document.addEventListener("astro:page-load", initialize)
|
|
89
|
+
document.addEventListener("astro:before-swap", () => {
|
|
90
|
+
for (const controller of controllers) controller.destroy()
|
|
91
|
+
controllers.length = 0
|
|
92
|
+
})
|
|
87
93
|
</script>
|
|
@@ -69,6 +69,12 @@ const switchSizeStyle = {
|
|
|
69
69
|
<script>
|
|
70
70
|
import { create } from "@data-slot/switch"
|
|
71
71
|
|
|
72
|
-
create
|
|
73
|
-
|
|
72
|
+
const controllers: ReturnType<typeof create> = []
|
|
73
|
+
const initialize = () => controllers.push(...create())
|
|
74
|
+
initialize()
|
|
75
|
+
document.addEventListener("astro:page-load", initialize)
|
|
76
|
+
document.addEventListener("astro:before-swap", () => {
|
|
77
|
+
for (const controller of controllers) controller.destroy()
|
|
78
|
+
controllers.length = 0
|
|
79
|
+
})
|
|
74
80
|
</script>
|
|
@@ -4,14 +4,15 @@ import type { HTMLAttributes } from "astro/types"
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
6
|
type Props = HTMLAttributes<"button"> & {
|
|
7
|
-
value
|
|
7
|
+
value: string
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const { class: className, value, ...props } = Astro.props
|
|
10
|
+
const { class: className, value, type = "button", ...props } = Astro.props
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
<button
|
|
14
14
|
data-slot="tabs-trigger"
|
|
15
|
+
type={type}
|
|
15
16
|
data-value={value}
|
|
16
17
|
class={cn(
|
|
17
18
|
"text-foreground/60 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
@@ -34,6 +34,12 @@ const {
|
|
|
34
34
|
<script>
|
|
35
35
|
import { create } from "@data-slot/tabs"
|
|
36
36
|
|
|
37
|
-
create
|
|
38
|
-
|
|
37
|
+
const controllers: ReturnType<typeof create> = []
|
|
38
|
+
const initialize = () => controllers.push(...create())
|
|
39
|
+
initialize()
|
|
40
|
+
document.addEventListener("astro:page-load", initialize)
|
|
41
|
+
document.addEventListener("astro:before-swap", () => {
|
|
42
|
+
for (const controller of controllers) controller.destroy()
|
|
43
|
+
controllers.length = 0
|
|
44
|
+
})
|
|
39
45
|
</script>
|
|
@@ -38,6 +38,12 @@ const {
|
|
|
38
38
|
<script>
|
|
39
39
|
import { create } from "@data-slot/toggle"
|
|
40
40
|
|
|
41
|
-
create
|
|
42
|
-
|
|
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>
|
|
@@ -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
|
-
|
|
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>
|