@squadbase/vantage 0.6.2-dev1.b332e5a → 0.6.2-dev1.d7c0911
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/dist/add-4GHF2TX2.js +6 -0
- package/dist/add-4GHF2TX2.js.map +1 -0
- package/dist/{build-TVKFIVFQ.js → build-X5NVCQKT.js} +7 -7
- package/dist/{build-TVKFIVFQ.js.map → build-X5NVCQKT.js.map} +1 -1
- package/dist/{check-3KHZXZMQ.js → check-ZBIH422T.js} +5 -5
- package/dist/{check-3KHZXZMQ.js.map → check-ZBIH422T.js.map} +1 -1
- package/dist/chunk-2ICNHUG6.js +1820 -0
- package/dist/chunk-2ICNHUG6.js.map +1 -0
- package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
- package/dist/chunk-2N72FKLB.js.map +1 -0
- package/dist/{chunk-P7W4LR3Z.js → chunk-7DZGJQ3P.js} +3 -3
- package/dist/{chunk-P7W4LR3Z.js.map → chunk-7DZGJQ3P.js.map} +1 -1
- package/dist/{chunk-U2M6HGKQ.js → chunk-AABMKHEU.js} +4 -4
- package/dist/{chunk-U2M6HGKQ.js.map → chunk-AABMKHEU.js.map} +1 -1
- package/dist/{chunk-QI3XQKHS.js → chunk-GNXCX4WE.js} +10 -3
- package/dist/chunk-GNXCX4WE.js.map +1 -0
- package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
- package/dist/chunk-PDOBHMUQ.js.map +1 -0
- package/dist/{chunk-ZVANIULZ.js → chunk-RNTDBX6S.js} +4 -4
- package/dist/{chunk-ZVANIULZ.js.map → chunk-RNTDBX6S.js.map} +1 -1
- package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
- package/dist/chunk-U736PVHY.js.map +1 -0
- package/dist/{chunk-PVTHHV7X.js → chunk-V3LF7BE7.js} +27 -5
- package/dist/chunk-V3LF7BE7.js.map +1 -0
- package/dist/{chunk-LMUACBMA.js → chunk-WAMZWZJB.js} +53 -8
- package/dist/chunk-WAMZWZJB.js.map +1 -0
- package/dist/chunk-WRSX2MDK.js +7866 -0
- package/dist/chunk-WRSX2MDK.js.map +1 -0
- package/dist/{chunk-RPZAALCX.js → chunk-XPQSTZUU.js} +254 -164
- package/dist/chunk-XPQSTZUU.js.map +1 -0
- package/dist/{chunk-DTDVSFRY.js → chunk-XQUSGIDG.js} +17 -3
- package/dist/chunk-XQUSGIDG.js.map +1 -0
- package/dist/cli.js +12 -11
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +32 -3
- package/dist/client/index.js +205 -12
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +1975 -28
- package/dist/components/index.js +4 -4
- package/dist/{dev-GDKATCC7.js → dev-4XEDTELV.js} +8 -8
- package/dist/dev-4XEDTELV.js.map +1 -0
- package/dist/doc/index.js +2 -2
- package/dist/doc/index.js.map +1 -1
- package/dist/{docs-EJJ3BECT.js → docs-JVP4RPKT.js} +3 -3
- package/dist/{docs-EJJ3BECT.js.map → docs-JVP4RPKT.js.map} +1 -1
- package/dist/{doctor-WQXPXP6K.js → doctor-5E2VEZPK.js} +5 -5
- package/dist/{doctor-WQXPXP6K.js.map → doctor-5E2VEZPK.js.map} +1 -1
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/index.js.map +1 -1
- package/dist/{preview-OGMCNQUO.js → preview-T6CLSQVX.js} +3 -3
- package/dist/{preview-OGMCNQUO.js.map → preview-T6CLSQVX.js.map} +1 -1
- package/dist/query/index.d.ts +0 -11
- package/dist/query/index.js +2 -2
- package/dist/{routes-MWBWWOJ2.js → routes-3SGAFDMC.js} +4 -4
- package/dist/{routes-MWBWWOJ2.js.map → routes-3SGAFDMC.js.map} +1 -1
- package/dist/{search-6Y422SV6.js → search-5LC4XPB5.js} +3 -3
- package/dist/{search-6Y422SV6.js.map → search-5LC4XPB5.js.map} +1 -1
- package/dist/table/index.js +10 -9
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +144 -11
- package/dist/ui/index.js +1339 -87
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-HCANX4GQ.js → upgrade-JHXZBGQS.js} +6 -6
- package/dist/{upgrade-HCANX4GQ.js.map → upgrade-JHXZBGQS.js.map} +1 -1
- package/dist/vite/index.d.ts +10 -0
- package/dist/vite/index.js +3 -3
- package/docs/en/components.md +29 -15
- package/docs/en/parts/data-table.md +22 -0
- package/docs/en/parts/delta.md +50 -0
- package/docs/en/parts/format.md +43 -0
- package/docs/en/parts/kpi-card.md +57 -0
- package/docs/en/parts/metric-value.md +3 -2
- package/docs/en/parts/sparkline.md +1 -1
- package/docs/en/parts/trend-indicator.md +17 -1
- package/docs/en/ui-and-theming.md +1 -1
- package/docs/index.json +366 -76
- package/docs/ja/changelog.md +31 -0
- package/docs/ja/components.md +57 -101
- package/docs/ja/page-types/csv.md +83 -0
- package/docs/ja/page-types/doc.md +83 -0
- package/docs/ja/page-types/excel.md +82 -0
- package/docs/ja/page-types/slide.md +132 -0
- package/docs/ja/page-types.md +47 -0
- package/docs/ja/parts/area-chart.md +61 -0
- package/docs/ja/parts/bar-chart.md +69 -0
- package/docs/ja/parts/bar-list.md +35 -0
- package/docs/ja/parts/category-bar.md +36 -0
- package/docs/ja/parts/data-table.md +22 -0
- package/docs/ja/parts/delta.md +50 -0
- package/docs/ja/parts/donut-chart.md +47 -0
- package/docs/ja/parts/echart.md +3 -0
- package/docs/ja/parts/format.md +44 -0
- package/docs/ja/parts/kpi-card.md +55 -0
- package/docs/ja/parts/line-chart.md +58 -0
- package/docs/ja/parts/metric-value.md +3 -2
- package/docs/ja/parts/progress-circle.md +34 -0
- package/docs/ja/parts/sparkline.md +2 -2
- package/docs/ja/parts/tracker.md +32 -0
- package/docs/ja/parts/trend-indicator.md +17 -1
- package/docs/ja/routing.md +8 -86
- package/docs/ja/ui/alert-dialog.md +41 -0
- package/docs/ja/ui/avatar.md +31 -0
- package/docs/ja/ui/combobox.md +74 -0
- package/docs/ja/ui/drawer.md +41 -0
- package/docs/ja/ui/field.md +42 -0
- package/docs/ja/ui/hover-card.md +21 -0
- package/docs/ja/ui/kbd.md +16 -0
- package/docs/ja/ui/pagination.md +36 -0
- package/docs/ja/ui/radio-group.md +21 -0
- package/docs/ja/ui/toast.md +46 -0
- package/docs/ja/ui-and-theming.md +14 -7
- package/package.json +13 -4
- package/registry/ui/accordion.tsx +76 -0
- package/registry/ui/alert-dialog.tsx +189 -0
- package/registry/ui/alert.tsx +80 -0
- package/registry/ui/app-shell.tsx +287 -0
- package/registry/ui/area-chart.tsx +3639 -0
- package/registry/ui/avatar.tsx +110 -0
- package/registry/ui/badge.tsx +56 -0
- package/registry/ui/bar-chart.tsx +3636 -0
- package/registry/ui/bar-list.tsx +3680 -0
- package/registry/ui/breadcrumb.tsx +128 -0
- package/registry/ui/button.tsx +62 -0
- package/registry/ui/calendar.tsx +223 -0
- package/registry/ui/card.tsx +107 -0
- package/registry/ui/category-bar.tsx +1255 -0
- package/registry/ui/chart-frame.tsx +1358 -0
- package/registry/ui/checkbox.tsx +30 -0
- package/registry/ui/collapsible.tsx +23 -0
- package/registry/ui/combobox.tsx +310 -0
- package/registry/ui/command.tsx +198 -0
- package/registry/ui/dashboard-card.tsx +217 -0
- package/registry/ui/data-table.tsx +693 -146
- package/registry/ui/date-range-picker.tsx +390 -0
- package/registry/ui/delta.tsx +188 -0
- package/registry/ui/dialog.tsx +161 -0
- package/registry/ui/donut-chart.tsx +3688 -0
- package/registry/ui/drawer.tsx +229 -0
- package/registry/ui/dropdown-menu.tsx +274 -0
- package/registry/ui/echart.tsx +890 -0
- package/registry/ui/field.tsx +240 -0
- package/registry/ui/filter-bar.tsx +392 -0
- package/registry/ui/funnel-steps.tsx +3541 -0
- package/registry/ui/heatmap.tsx +1752 -0
- package/registry/ui/hover-card.tsx +52 -0
- package/registry/ui/input-group.tsx +160 -0
- package/registry/ui/input.tsx +24 -0
- package/registry/ui/kbd.tsx +30 -0
- package/registry/ui/kpi-card.tsx +677 -0
- package/registry/ui/label.tsx +22 -0
- package/registry/ui/legend.tsx +3500 -0
- package/registry/ui/line-chart.tsx +3637 -0
- package/registry/ui/metric-value.tsx +62 -0
- package/registry/ui/multi-select.tsx +232 -0
- package/registry/ui/page-shell.tsx +282 -0
- package/registry/ui/pagination.tsx +140 -0
- package/registry/ui/placeholder.tsx +36 -0
- package/registry/ui/popover.tsx +92 -0
- package/registry/ui/progress-circle.tsx +867 -0
- package/registry/ui/progress.tsx +85 -0
- package/registry/ui/radio-group.tsx +39 -0
- package/registry/ui/sample-data.tsx +86 -0
- package/registry/ui/scatter-chart.tsx +4150 -0
- package/registry/ui/scroll-area.tsx +56 -0
- package/registry/ui/searchable-select.tsx +214 -0
- package/registry/ui/section-header.tsx +43 -0
- package/registry/ui/segmented-control.tsx +76 -0
- package/registry/ui/select.tsx +255 -0
- package/registry/ui/separator.tsx +27 -0
- package/registry/ui/sheet.tsx +139 -0
- package/registry/ui/sidebar.tsx +725 -0
- package/registry/ui/skeleton.tsx +17 -0
- package/registry/ui/slider.tsx +56 -0
- package/registry/ui/sparkline.tsx +230 -0
- package/registry/ui/spinner.tsx +14 -0
- package/registry/ui/states.tsx +90 -0
- package/registry/ui/status-badge.tsx +121 -0
- package/registry/ui/switch.tsx +34 -0
- package/registry/ui/table.tsx +118 -0
- package/registry/ui/tabs.tsx +84 -0
- package/registry/ui/textarea.tsx +22 -0
- package/registry/ui/toast.tsx +250 -0
- package/registry/ui/toggle-group.tsx +91 -0
- package/registry/ui/toggle.tsx +47 -0
- package/registry/ui/tooltip.tsx +68 -0
- package/registry/ui/tracker.tsx +843 -0
- package/registry/ui/trend-indicator.tsx +74 -0
- package/registry/ui/updated-at.tsx +122 -0
- package/registry/ui/waterfall-chart.tsx +4186 -0
- package/skills/vantage-add-feature/SKILL.md +9 -7
- package/skills/vantage-pitfalls/SKILL.md +5 -1
- package/templates/AGENTS.md +22 -1
- package/templates/agents/csv.md +2 -1
- package/templates/agents/doc.md +4 -3
- package/templates/agents/page.md +20 -6
- package/templates/agents/xlsx.md +2 -1
- package/theme.css +237 -136
- package/dist/add-DY4AXANK.js +0 -6
- package/dist/add-DY4AXANK.js.map +0 -1
- package/dist/chunk-5ZOP4SQR.js.map +0 -1
- package/dist/chunk-A2UUGASH.js.map +0 -1
- package/dist/chunk-DTDVSFRY.js.map +0 -1
- package/dist/chunk-LMUACBMA.js.map +0 -1
- package/dist/chunk-NKFBFDRZ.js +0 -2241
- package/dist/chunk-NKFBFDRZ.js.map +0 -1
- package/dist/chunk-PVTHHV7X.js.map +0 -1
- package/dist/chunk-PXRX5PEC.js.map +0 -1
- package/dist/chunk-QI3XQKHS.js.map +0 -1
- package/dist/chunk-RPZAALCX.js.map +0 -1
- package/dist/chunk-VA776YE5.js +0 -316
- package/dist/chunk-VA776YE5.js.map +0 -1
- package/dist/dev-GDKATCC7.js.map +0 -1
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
// Copied by `vantage add ui drawer`. This file is yours to edit.
|
|
2
|
+
// Generated from @squadbase/squadkit registry/ui/drawer.tsx by `npm run registry` (in Vantage, edit packages/squadkit, not registry/).
|
|
3
|
+
"use client"
|
|
4
|
+
|
|
5
|
+
import * as React from "react"
|
|
6
|
+
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer"
|
|
7
|
+
import { cn } from "@squadbase/vantage/ui"
|
|
8
|
+
|
|
9
|
+
type DrawerContextProps = {
|
|
10
|
+
hasSnapPoints: boolean
|
|
11
|
+
modal: DrawerPrimitive.Root.Props["modal"]
|
|
12
|
+
showSwipeHandle: boolean
|
|
13
|
+
swipeDirection: NonNullable<DrawerPrimitive.Root.Props["swipeDirection"]>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const DrawerContext = React.createContext<DrawerContextProps | null>(null)
|
|
17
|
+
|
|
18
|
+
function useDrawer() {
|
|
19
|
+
const context = React.useContext(DrawerContext)
|
|
20
|
+
|
|
21
|
+
if (!context) {
|
|
22
|
+
throw new Error("useDrawer must be used within a Drawer.")
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return context
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function Drawer({
|
|
29
|
+
modal = true,
|
|
30
|
+
showSwipeHandle = false,
|
|
31
|
+
snapPoints,
|
|
32
|
+
swipeDirection = "down",
|
|
33
|
+
...props
|
|
34
|
+
}: DrawerPrimitive.Root.Props & {
|
|
35
|
+
showSwipeHandle?: boolean
|
|
36
|
+
}) {
|
|
37
|
+
const hasSnapPoints = snapPoints != null && snapPoints.length > 0
|
|
38
|
+
const contextValue = React.useMemo(
|
|
39
|
+
() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
|
|
40
|
+
[hasSnapPoints, modal, showSwipeHandle, swipeDirection]
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<DrawerContext.Provider value={contextValue}>
|
|
45
|
+
<DrawerPrimitive.Root
|
|
46
|
+
data-slot="drawer"
|
|
47
|
+
modal={modal}
|
|
48
|
+
snapPoints={snapPoints}
|
|
49
|
+
swipeDirection={swipeDirection}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
</DrawerContext.Provider>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {
|
|
57
|
+
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {
|
|
61
|
+
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {
|
|
65
|
+
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function DrawerOverlay({
|
|
69
|
+
className,
|
|
70
|
+
...props
|
|
71
|
+
}: DrawerPrimitive.Backdrop.Props) {
|
|
72
|
+
return (
|
|
73
|
+
<DrawerPrimitive.Backdrop
|
|
74
|
+
data-slot="drawer-overlay"
|
|
75
|
+
className={cn(
|
|
76
|
+
"fixed inset-0 z-50 min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function DrawerSwipeHandle({
|
|
85
|
+
className,
|
|
86
|
+
...props
|
|
87
|
+
}: React.ComponentProps<"div">) {
|
|
88
|
+
return (
|
|
89
|
+
<div
|
|
90
|
+
data-slot="drawer-swipe-handle"
|
|
91
|
+
aria-hidden="true"
|
|
92
|
+
className={cn(
|
|
93
|
+
"relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-axis=y]/drawer-popup:justify-center group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:items-start after:block after:shrink-0 after:rounded-full after:bg-muted group-data-[swipe-axis=x]/drawer-popup:after:h-24 group-data-[swipe-axis=x]/drawer-popup:after:w-1 group-data-[swipe-axis=y]/drawer-popup:after:h-1 group-data-[swipe-axis=y]/drawer-popup:after:w-24 active:cursor-grabbing",
|
|
94
|
+
className
|
|
95
|
+
)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function DrawerContent({
|
|
102
|
+
className,
|
|
103
|
+
children,
|
|
104
|
+
...props
|
|
105
|
+
}: DrawerPrimitive.Popup.Props) {
|
|
106
|
+
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()
|
|
107
|
+
const swipeAxis =
|
|
108
|
+
swipeDirection === "down" || swipeDirection === "up" ? "y" : "x"
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<DrawerPortal data-slot="drawer-portal">
|
|
112
|
+
{modal === true && (
|
|
113
|
+
<DrawerOverlay data-snap-points={hasSnapPoints ? "" : undefined} />
|
|
114
|
+
)}
|
|
115
|
+
<DrawerPrimitive.Viewport
|
|
116
|
+
data-slot="drawer-viewport"
|
|
117
|
+
data-modal={modal}
|
|
118
|
+
className="pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto"
|
|
119
|
+
>
|
|
120
|
+
<DrawerPrimitive.Popup
|
|
121
|
+
data-slot="drawer-popup"
|
|
122
|
+
data-swipe-axis={swipeAxis}
|
|
123
|
+
data-snap-points={hasSnapPoints ? "" : undefined}
|
|
124
|
+
className={cn(
|
|
125
|
+
// Base.
|
|
126
|
+
"group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b",
|
|
127
|
+
// Nested.
|
|
128
|
+
"data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
|
|
129
|
+
// Bleed.
|
|
130
|
+
"after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full",
|
|
131
|
+
// Sizing.
|
|
132
|
+
"[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]",
|
|
133
|
+
// Stack.
|
|
134
|
+
"[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]",
|
|
135
|
+
// Transitions.
|
|
136
|
+
"data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]",
|
|
137
|
+
// Axis: y.
|
|
138
|
+
"data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
|
|
139
|
+
// Axis: x.
|
|
140
|
+
"data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row",
|
|
141
|
+
// Direction: down.
|
|
142
|
+
"data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]",
|
|
143
|
+
// Direction: up.
|
|
144
|
+
"data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]",
|
|
145
|
+
// Direction: left.
|
|
146
|
+
"data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]",
|
|
147
|
+
// Direction: right.
|
|
148
|
+
"data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]",
|
|
149
|
+
className
|
|
150
|
+
)}
|
|
151
|
+
{...props}
|
|
152
|
+
>
|
|
153
|
+
{showSwipeHandle && <DrawerSwipeHandle />}
|
|
154
|
+
<DrawerPrimitive.Content
|
|
155
|
+
data-slot="drawer-content"
|
|
156
|
+
className={cn(
|
|
157
|
+
"flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none"
|
|
158
|
+
)}
|
|
159
|
+
>
|
|
160
|
+
{children}
|
|
161
|
+
</DrawerPrimitive.Content>
|
|
162
|
+
</DrawerPrimitive.Popup>
|
|
163
|
+
</DrawerPrimitive.Viewport>
|
|
164
|
+
</DrawerPortal>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
169
|
+
return (
|
|
170
|
+
<div
|
|
171
|
+
data-slot="drawer-header"
|
|
172
|
+
className={cn(
|
|
173
|
+
"flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0.5 md:text-left",
|
|
174
|
+
className
|
|
175
|
+
)}
|
|
176
|
+
{...props}
|
|
177
|
+
/>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
182
|
+
return (
|
|
183
|
+
<div
|
|
184
|
+
data-slot="drawer-footer"
|
|
185
|
+
className={cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className)}
|
|
186
|
+
{...props}
|
|
187
|
+
/>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {
|
|
192
|
+
return (
|
|
193
|
+
<DrawerPrimitive.Title
|
|
194
|
+
data-slot="drawer-title"
|
|
195
|
+
className={cn(
|
|
196
|
+
"cn-font-heading text-base font-medium text-foreground",
|
|
197
|
+
className
|
|
198
|
+
)}
|
|
199
|
+
{...props}
|
|
200
|
+
/>
|
|
201
|
+
)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function DrawerDescription({
|
|
205
|
+
className,
|
|
206
|
+
...props
|
|
207
|
+
}: DrawerPrimitive.Description.Props) {
|
|
208
|
+
return (
|
|
209
|
+
<DrawerPrimitive.Description
|
|
210
|
+
data-slot="drawer-description"
|
|
211
|
+
className={cn("text-sm text-balance text-muted-foreground", className)}
|
|
212
|
+
{...props}
|
|
213
|
+
/>
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export {
|
|
218
|
+
Drawer,
|
|
219
|
+
DrawerPortal,
|
|
220
|
+
DrawerOverlay,
|
|
221
|
+
DrawerSwipeHandle,
|
|
222
|
+
DrawerTrigger,
|
|
223
|
+
DrawerClose,
|
|
224
|
+
DrawerContent,
|
|
225
|
+
DrawerHeader,
|
|
226
|
+
DrawerFooter,
|
|
227
|
+
DrawerTitle,
|
|
228
|
+
DrawerDescription,
|
|
229
|
+
}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
// Copied by `vantage add ui dropdown-menu`. This file is yours to edit.
|
|
2
|
+
// Generated from @squadbase/squadkit registry/ui/dropdown-menu.tsx by `npm run registry` (in Vantage, edit packages/squadkit, not registry/).
|
|
3
|
+
"use client"
|
|
4
|
+
|
|
5
|
+
import * as React from "react"
|
|
6
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu"
|
|
7
|
+
|
|
8
|
+
import { cn } from "@squadbase/vantage/ui"
|
|
9
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react"
|
|
10
|
+
|
|
11
|
+
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
12
|
+
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
|
|
16
|
+
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
|
|
20
|
+
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function DropdownMenuContent({
|
|
24
|
+
align = "start",
|
|
25
|
+
alignOffset = 0,
|
|
26
|
+
side = "bottom",
|
|
27
|
+
sideOffset = 4,
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}: MenuPrimitive.Popup.Props &
|
|
31
|
+
Pick<
|
|
32
|
+
MenuPrimitive.Positioner.Props,
|
|
33
|
+
"align" | "alignOffset" | "side" | "sideOffset"
|
|
34
|
+
>) {
|
|
35
|
+
return (
|
|
36
|
+
<MenuPrimitive.Portal>
|
|
37
|
+
<MenuPrimitive.Positioner
|
|
38
|
+
className="isolate z-50 outline-none"
|
|
39
|
+
align={align}
|
|
40
|
+
alignOffset={alignOffset}
|
|
41
|
+
side={side}
|
|
42
|
+
sideOffset={sideOffset}
|
|
43
|
+
>
|
|
44
|
+
<MenuPrimitive.Popup
|
|
45
|
+
data-slot="dropdown-menu-content"
|
|
46
|
+
className={cn(
|
|
47
|
+
"cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none 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 motion-reduce:animate-none! data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
</MenuPrimitive.Positioner>
|
|
53
|
+
</MenuPrimitive.Portal>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
|
|
58
|
+
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function DropdownMenuLabel({
|
|
62
|
+
className,
|
|
63
|
+
inset,
|
|
64
|
+
...props
|
|
65
|
+
}: MenuPrimitive.GroupLabel.Props & {
|
|
66
|
+
inset?: boolean
|
|
67
|
+
}) {
|
|
68
|
+
return (
|
|
69
|
+
<MenuPrimitive.GroupLabel
|
|
70
|
+
data-slot="dropdown-menu-label"
|
|
71
|
+
data-inset={inset}
|
|
72
|
+
className={cn(
|
|
73
|
+
"px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",
|
|
74
|
+
className
|
|
75
|
+
)}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function DropdownMenuItem({
|
|
82
|
+
className,
|
|
83
|
+
inset,
|
|
84
|
+
variant = "default",
|
|
85
|
+
...props
|
|
86
|
+
}: MenuPrimitive.Item.Props & {
|
|
87
|
+
inset?: boolean
|
|
88
|
+
variant?: "default" | "destructive"
|
|
89
|
+
}) {
|
|
90
|
+
return (
|
|
91
|
+
<MenuPrimitive.Item
|
|
92
|
+
data-slot="dropdown-menu-item"
|
|
93
|
+
data-inset={inset}
|
|
94
|
+
data-variant={variant}
|
|
95
|
+
className={cn(
|
|
96
|
+
"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
|
|
97
|
+
className
|
|
98
|
+
)}
|
|
99
|
+
{...props}
|
|
100
|
+
/>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
|
|
105
|
+
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function DropdownMenuSubTrigger({
|
|
109
|
+
className,
|
|
110
|
+
inset,
|
|
111
|
+
children,
|
|
112
|
+
...props
|
|
113
|
+
}: MenuPrimitive.SubmenuTrigger.Props & {
|
|
114
|
+
inset?: boolean
|
|
115
|
+
}) {
|
|
116
|
+
return (
|
|
117
|
+
<MenuPrimitive.SubmenuTrigger
|
|
118
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
119
|
+
data-inset={inset}
|
|
120
|
+
className={cn(
|
|
121
|
+
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
122
|
+
className
|
|
123
|
+
)}
|
|
124
|
+
{...props}
|
|
125
|
+
>
|
|
126
|
+
{children}
|
|
127
|
+
<ChevronRightIcon className="cn-rtl-flip ml-auto" />
|
|
128
|
+
</MenuPrimitive.SubmenuTrigger>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function DropdownMenuSubContent({
|
|
133
|
+
align = "start",
|
|
134
|
+
alignOffset = -3,
|
|
135
|
+
side = "right",
|
|
136
|
+
sideOffset = 0,
|
|
137
|
+
className,
|
|
138
|
+
...props
|
|
139
|
+
}: React.ComponentProps<typeof DropdownMenuContent>) {
|
|
140
|
+
return (
|
|
141
|
+
<DropdownMenuContent
|
|
142
|
+
data-slot="dropdown-menu-sub-content"
|
|
143
|
+
className={cn(
|
|
144
|
+
"cn-menu-target cn-menu-translucent w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-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 motion-reduce:animate-none! data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
145
|
+
className
|
|
146
|
+
)}
|
|
147
|
+
align={align}
|
|
148
|
+
alignOffset={alignOffset}
|
|
149
|
+
side={side}
|
|
150
|
+
sideOffset={sideOffset}
|
|
151
|
+
{...props}
|
|
152
|
+
/>
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function DropdownMenuCheckboxItem({
|
|
157
|
+
className,
|
|
158
|
+
children,
|
|
159
|
+
checked,
|
|
160
|
+
inset,
|
|
161
|
+
...props
|
|
162
|
+
}: MenuPrimitive.CheckboxItem.Props & {
|
|
163
|
+
inset?: boolean
|
|
164
|
+
}) {
|
|
165
|
+
return (
|
|
166
|
+
<MenuPrimitive.CheckboxItem
|
|
167
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
168
|
+
data-inset={inset}
|
|
169
|
+
className={cn(
|
|
170
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
171
|
+
className
|
|
172
|
+
)}
|
|
173
|
+
checked={checked}
|
|
174
|
+
{...props}
|
|
175
|
+
>
|
|
176
|
+
<span
|
|
177
|
+
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
178
|
+
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
179
|
+
>
|
|
180
|
+
<MenuPrimitive.CheckboxItemIndicator>
|
|
181
|
+
<CheckIcon />
|
|
182
|
+
</MenuPrimitive.CheckboxItemIndicator>
|
|
183
|
+
</span>
|
|
184
|
+
{children}
|
|
185
|
+
</MenuPrimitive.CheckboxItem>
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
190
|
+
return (
|
|
191
|
+
<MenuPrimitive.RadioGroup
|
|
192
|
+
data-slot="dropdown-menu-radio-group"
|
|
193
|
+
{...props}
|
|
194
|
+
/>
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function DropdownMenuRadioItem({
|
|
199
|
+
className,
|
|
200
|
+
children,
|
|
201
|
+
inset,
|
|
202
|
+
...props
|
|
203
|
+
}: MenuPrimitive.RadioItem.Props & {
|
|
204
|
+
inset?: boolean
|
|
205
|
+
}) {
|
|
206
|
+
return (
|
|
207
|
+
<MenuPrimitive.RadioItem
|
|
208
|
+
data-slot="dropdown-menu-radio-item"
|
|
209
|
+
data-inset={inset}
|
|
210
|
+
className={cn(
|
|
211
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
212
|
+
className
|
|
213
|
+
)}
|
|
214
|
+
{...props}
|
|
215
|
+
>
|
|
216
|
+
<span
|
|
217
|
+
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
218
|
+
data-slot="dropdown-menu-radio-item-indicator"
|
|
219
|
+
>
|
|
220
|
+
<MenuPrimitive.RadioItemIndicator>
|
|
221
|
+
<CheckIcon />
|
|
222
|
+
</MenuPrimitive.RadioItemIndicator>
|
|
223
|
+
</span>
|
|
224
|
+
{children}
|
|
225
|
+
</MenuPrimitive.RadioItem>
|
|
226
|
+
)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function DropdownMenuSeparator({
|
|
230
|
+
className,
|
|
231
|
+
...props
|
|
232
|
+
}: MenuPrimitive.Separator.Props) {
|
|
233
|
+
return (
|
|
234
|
+
<MenuPrimitive.Separator
|
|
235
|
+
data-slot="dropdown-menu-separator"
|
|
236
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
237
|
+
{...props}
|
|
238
|
+
/>
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function DropdownMenuShortcut({
|
|
243
|
+
className,
|
|
244
|
+
...props
|
|
245
|
+
}: React.ComponentProps<"span">) {
|
|
246
|
+
return (
|
|
247
|
+
<span
|
|
248
|
+
data-slot="dropdown-menu-shortcut"
|
|
249
|
+
className={cn(
|
|
250
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
|
|
251
|
+
className
|
|
252
|
+
)}
|
|
253
|
+
{...props}
|
|
254
|
+
/>
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export {
|
|
259
|
+
DropdownMenu,
|
|
260
|
+
DropdownMenuPortal,
|
|
261
|
+
DropdownMenuTrigger,
|
|
262
|
+
DropdownMenuContent,
|
|
263
|
+
DropdownMenuGroup,
|
|
264
|
+
DropdownMenuLabel,
|
|
265
|
+
DropdownMenuItem,
|
|
266
|
+
DropdownMenuCheckboxItem,
|
|
267
|
+
DropdownMenuRadioGroup,
|
|
268
|
+
DropdownMenuRadioItem,
|
|
269
|
+
DropdownMenuSeparator,
|
|
270
|
+
DropdownMenuShortcut,
|
|
271
|
+
DropdownMenuSub,
|
|
272
|
+
DropdownMenuSubTrigger,
|
|
273
|
+
DropdownMenuSubContent,
|
|
274
|
+
}
|