@gv-tech/design-system 2.2.0 → 2.4.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +20 -0
- package/dist/App.d.ts +1 -2
- package/dist/App.d.ts.map +1 -1
- package/dist/accordion.cjs.js +2 -0
- package/dist/accordion.cjs.js.map +1 -0
- package/dist/accordion.es.js +38 -0
- package/dist/accordion.es.js.map +1 -0
- package/dist/alert-dialog.cjs.js +2 -0
- package/dist/alert-dialog.cjs.js.map +1 -0
- package/dist/alert-dialog.es.js +64 -0
- package/dist/alert-dialog.es.js.map +1 -0
- package/dist/alert.cjs.js +2 -0
- package/dist/alert.cjs.js.map +1 -0
- package/dist/alert.es.js +32 -0
- package/dist/alert.es.js.map +1 -0
- package/dist/aspect-ratio.cjs.js +2 -0
- package/dist/aspect-ratio.cjs.js.map +1 -0
- package/dist/aspect-ratio.es.js +6 -0
- package/dist/aspect-ratio.es.js.map +1 -0
- package/dist/avatar.cjs.js +2 -0
- package/dist/avatar.cjs.js.map +1 -0
- package/dist/avatar.es.js +29 -0
- package/dist/avatar.es.js.map +1 -0
- package/dist/badge.cjs.js +2 -0
- package/dist/badge.cjs.js.map +1 -0
- package/dist/badge.es.js +26 -0
- package/dist/badge.es.js.map +1 -0
- package/dist/breadcrumb.cjs.js +2 -0
- package/dist/breadcrumb.cjs.js.map +1 -0
- package/dist/breadcrumb.es.js +68 -0
- package/dist/breadcrumb.es.js.map +1 -0
- package/dist/button.cjs.js +2 -0
- package/dist/button.cjs.js.map +1 -0
- package/dist/button.es.js +39 -0
- package/dist/button.es.js.map +1 -0
- package/dist/calendar.cjs.js +2 -0
- package/dist/calendar.cjs.js.map +1 -0
- package/dist/calendar.es.js +132 -0
- package/dist/calendar.es.js.map +1 -0
- package/dist/card.cjs.js +2 -0
- package/dist/card.cjs.js.map +1 -0
- package/dist/card.es.js +34 -0
- package/dist/card.es.js.map +1 -0
- package/dist/carousel.cjs.js +2 -0
- package/dist/carousel.cjs.js.map +1 -0
- package/dist/carousel.es.js +158 -0
- package/dist/carousel.es.js.map +1 -0
- package/dist/chart.cjs.js +8 -0
- package/dist/chart.cjs.js.map +1 -0
- package/dist/chart.es.js +187 -0
- package/dist/chart.es.js.map +1 -0
- package/dist/checkbox.cjs.js +2 -0
- package/dist/checkbox.cjs.js.map +1 -0
- package/dist/checkbox.es.js +20 -0
- package/dist/checkbox.es.js.map +1 -0
- package/dist/collapsible.cjs.js +2 -0
- package/dist/collapsible.cjs.js.map +1 -0
- package/dist/collapsible.es.js +8 -0
- package/dist/collapsible.es.js.map +1 -0
- package/dist/command.cjs.js +2 -0
- package/dist/command.cjs.js.map +1 -0
- package/dist/command.es.js +86 -0
- package/dist/command.es.js.map +1 -0
- package/dist/components/docs/Sidebar.d.ts +2 -1
- package/dist/components/docs/Sidebar.d.ts.map +1 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/theme-provider.d.ts +4 -0
- package/dist/components/ui/theme-provider.d.ts.map +1 -0
- package/dist/components/ui/theme-provider.test.d.ts +2 -0
- package/dist/components/ui/theme-provider.test.d.ts.map +1 -0
- package/dist/context-menu.cjs.js +2 -0
- package/dist/context-menu.cjs.js.map +1 -0
- package/dist/context-menu.es.js +121 -0
- package/dist/context-menu.es.js.map +1 -0
- package/dist/design-system.css +1 -1
- package/dist/dialog.cjs.js +2 -0
- package/dist/dialog.cjs.js.map +1 -0
- package/dist/dialog.es.js +65 -0
- package/dist/dialog.es.js.map +1 -0
- package/dist/drawer.cjs.js +2 -0
- package/dist/drawer.cjs.js.map +1 -0
- package/dist/drawer.es.js +54 -0
- package/dist/drawer.es.js.map +1 -0
- package/dist/dropdown-menu.cjs.js +2 -0
- package/dist/dropdown-menu.cjs.js.map +1 -0
- package/dist/dropdown-menu.es.js +123 -0
- package/dist/dropdown-menu.es.js.map +1 -0
- package/dist/form.cjs.js +2 -0
- package/dist/form.cjs.js.map +1 -0
- package/dist/form.es.js +83 -0
- package/dist/form.es.js.map +1 -0
- package/dist/hover-card.cjs.js +2 -0
- package/dist/hover-card.cjs.js.map +1 -0
- package/dist/hover-card.es.js +23 -0
- package/dist/hover-card.es.js.map +1 -0
- package/dist/index.cjs.js +1 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +285 -2446
- package/dist/index.es.js.map +1 -1
- package/dist/input.cjs.js +2 -0
- package/dist/input.cjs.js.map +1 -0
- package/dist/input.es.js +22 -0
- package/dist/input.es.js.map +1 -0
- package/dist/label.cjs.js +2 -0
- package/dist/label.cjs.js.map +1 -0
- package/dist/label.es.js +9 -0
- package/dist/label.es.js.map +1 -0
- package/dist/menubar.cjs.js +2 -0
- package/dist/menubar.cjs.js.map +1 -0
- package/dist/menubar.es.js +161 -0
- package/dist/menubar.es.js.map +1 -0
- package/dist/navigation-menu.cjs.js +2 -0
- package/dist/navigation-menu.cjs.js.map +1 -0
- package/dist/navigation-menu.es.js +96 -0
- package/dist/navigation-menu.es.js.map +1 -0
- package/dist/pages/GettingStarted.d.ts.map +1 -1
- package/dist/pages/components/ThemeToggleDocs.d.ts.map +1 -1
- package/dist/pagination.cjs.js +2 -0
- package/dist/pagination.cjs.js.map +1 -0
- package/dist/pagination.es.js +60 -0
- package/dist/pagination.es.js.map +1 -0
- package/dist/popover.cjs.js +2 -0
- package/dist/popover.cjs.js.map +1 -0
- package/dist/popover.es.js +24 -0
- package/dist/popover.es.js.map +1 -0
- package/dist/progress.cjs.js +2 -0
- package/dist/progress.cjs.js.map +1 -0
- package/dist/progress.es.js +24 -0
- package/dist/progress.es.js.map +1 -0
- package/dist/radio-group.cjs.js +2 -0
- package/dist/radio-group.cjs.js.map +1 -0
- package/dist/radio-group.es.js +23 -0
- package/dist/radio-group.es.js.map +1 -0
- package/dist/registry/command.json +1 -1
- package/dist/registry/index.json +14 -0
- package/dist/registry/search.json +1 -1
- package/dist/registry/search.test.json +1 -1
- package/dist/registry/theme-provider.json +13 -0
- package/dist/registry/theme-provider.test.json +13 -0
- package/dist/resizable.cjs.js +2 -0
- package/dist/resizable.cjs.js.map +1 -0
- package/dist/resizable.es.js +34 -0
- package/dist/resizable.es.js.map +1 -0
- package/dist/scroll-area.cjs.js +2 -0
- package/dist/scroll-area.cjs.js.map +1 -0
- package/dist/scroll-area.es.js +30 -0
- package/dist/scroll-area.es.js.map +1 -0
- package/dist/search.cjs.js +2 -0
- package/dist/search.cjs.js.map +1 -0
- package/dist/search.es.js +60 -0
- package/dist/search.es.js.map +1 -0
- package/dist/select.cjs.js +2 -0
- package/dist/select.cjs.js.map +1 -0
- package/dist/select.es.js +100 -0
- package/dist/select.es.js.map +1 -0
- package/dist/separator.cjs.js +2 -0
- package/dist/separator.cjs.js.map +1 -0
- package/dist/separator.es.js +18 -0
- package/dist/separator.es.js.map +1 -0
- package/dist/sheet.cjs.js +2 -0
- package/dist/sheet.cjs.js.map +1 -0
- package/dist/sheet.es.js +64 -0
- package/dist/sheet.es.js.map +1 -0
- package/dist/skeleton.cjs.js +2 -0
- package/dist/skeleton.cjs.js.map +1 -0
- package/dist/skeleton.es.js +9 -0
- package/dist/skeleton.es.js.map +1 -0
- package/dist/slider.cjs.js +2 -0
- package/dist/slider.cjs.js.map +1 -0
- package/dist/slider.es.js +20 -0
- package/dist/slider.es.js.map +1 -0
- package/dist/sonner.cjs.js +2 -0
- package/dist/sonner.cjs.js.map +1 -0
- package/dist/sonner.es.js +25 -0
- package/dist/sonner.es.js.map +1 -0
- package/dist/switch.cjs.js +2 -0
- package/dist/switch.cjs.js.map +1 -0
- package/dist/switch.es.js +27 -0
- package/dist/switch.es.js.map +1 -0
- package/dist/table.cjs.js +2 -0
- package/dist/table.cjs.js.map +1 -0
- package/dist/table.es.js +70 -0
- package/dist/table.es.js.map +1 -0
- package/dist/tabs.cjs.js +2 -0
- package/dist/tabs.cjs.js.map +1 -0
- package/dist/tabs.es.js +46 -0
- package/dist/tabs.es.js.map +1 -0
- package/dist/textarea.cjs.js +2 -0
- package/dist/textarea.cjs.js.map +1 -0
- package/dist/textarea.es.js +21 -0
- package/dist/textarea.es.js.map +1 -0
- package/dist/theme/tokens.d.ts +46 -0
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme-provider.cjs.js +2 -0
- package/dist/theme-provider.cjs.js.map +1 -0
- package/dist/theme-provider.es.js +9 -0
- package/dist/theme-provider.es.js.map +1 -0
- package/dist/theme-toggle-CCUkxY6o.mjs +181 -0
- package/dist/theme-toggle-CCUkxY6o.mjs.map +1 -0
- package/dist/theme-toggle-Dc_nm_32.js +2 -0
- package/dist/theme-toggle-Dc_nm_32.js.map +1 -0
- package/dist/theme-toggle.cjs.js +2 -0
- package/dist/theme-toggle.cjs.js.map +1 -0
- package/dist/theme-toggle.es.js +9 -0
- package/dist/theme-toggle.es.js.map +1 -0
- package/dist/toast.cjs.js +2 -0
- package/dist/toast.cjs.js.map +1 -0
- package/dist/toast.es.js +70 -0
- package/dist/toast.es.js.map +1 -0
- package/dist/toaster-BjPc-lId.js +2 -0
- package/dist/toaster-BjPc-lId.js.map +1 -0
- package/dist/toaster-Bk6a4gIz.mjs +120 -0
- package/dist/toaster-Bk6a4gIz.mjs.map +1 -0
- package/dist/toaster.cjs.js +2 -0
- package/dist/toaster.cjs.js.map +1 -0
- package/dist/toaster.es.js +7 -0
- package/dist/toaster.es.js.map +1 -0
- package/dist/toggle-group.cjs.js +2 -0
- package/dist/toggle-group.cjs.js.map +1 -0
- package/dist/toggle-group.es.js +33 -0
- package/dist/toggle-group.es.js.map +1 -0
- package/dist/toggle.cjs.js +2 -0
- package/dist/toggle.cjs.js.map +1 -0
- package/dist/toggle.es.js +29 -0
- package/dist/toggle.es.js.map +1 -0
- package/dist/tooltip.cjs.js +2 -0
- package/dist/tooltip.cjs.js.map +1 -0
- package/dist/tooltip.es.js +23 -0
- package/dist/tooltip.es.js.map +1 -0
- package/dist/utils-C9QGdMaH.mjs +8 -0
- package/dist/utils-C9QGdMaH.mjs.map +1 -0
- package/dist/utils-CUFNKXRW.js +2 -0
- package/dist/utils-CUFNKXRW.js.map +1 -0
- package/dist/{vendor-BLvpSabH.mjs → vendor-CCQzmGyD.mjs} +1131 -1160
- package/dist/vendor-CCQzmGyD.mjs.map +1 -0
- package/dist/{vendor-n4WFhtJT.js → vendor-CIyDEr7H.js} +12 -12
- package/dist/vendor-CIyDEr7H.js.map +1 -0
- package/package.json +251 -5
- package/scripts/sync-exports.ts +52 -0
- package/scripts/sync-tokens.ts +73 -0
- package/scripts/{validate.js → validate.ts} +14 -8
- package/src/App.tsx +64 -27
- package/src/components/docs/ComponentShowcase.tsx +5 -5
- package/src/components/docs/Sidebar.tsx +3 -2
- package/src/components/ui/command.tsx +3 -1
- package/src/components/ui/search.test.tsx +2 -0
- package/src/components/ui/search.tsx +3 -3
- package/src/components/ui/theme-provider.test.tsx +47 -0
- package/src/components/ui/theme-provider.tsx +12 -0
- package/src/globals.css +22 -0
- package/src/index.ts +1 -0
- package/src/pages/ColorTokensDocs.tsx +4 -4
- package/src/pages/GettingStarted.tsx +43 -10
- package/src/pages/components/ThemeToggleDocs.tsx +155 -8
- package/src/theme/tokens.ts +60 -38
- package/vite.config.ts +27 -4
- package/dist/vendor-BLvpSabH.mjs.map +0 -1
- package/dist/vendor-n4WFhtJT.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.cjs.js","sources":["../src/components/ui/drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { cn } from '@/lib/utils';\n\nconst Drawer = ({ shouldScaleBackground = true, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\n);\nDrawer.displayName = 'Drawer';\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay ref={ref} className={cn('fixed inset-0 z-50 bg-black/80', className)} {...props} />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background',\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = 'DrawerContent';\n\nconst DrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)} {...props} />\n);\nDrawerHeader.displayName = 'DrawerHeader';\n\nconst DrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />\n);\nDrawerFooter.displayName = 'DrawerFooter';\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n};\n"],"names":["Drawer","shouldScaleBackground","props","jsx","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","React","className","ref","cn","DrawerContent","children","jsxs","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":"scAKMA,EAAS,CAAC,CAAE,sBAAAC,EAAwB,GAAM,GAAGC,CAAA,IACjDC,EAAAA,kBAAAA,IAACC,EAAAA,OAAgB,KAAhB,CAAqB,sBAAAH,EAA+C,GAAGC,CAAA,CAAO,EAEjFF,EAAO,YAAc,SAErB,MAAMK,EAAgBD,EAAAA,OAAgB,QAEhCE,EAAeF,EAAAA,OAAgB,OAE/BG,EAAcH,EAAAA,OAAgB,MAE9BI,EAAgBC,EAAM,WAG1B,CAAC,CAAE,UAAAC,EAAW,GAAGR,CAAA,EAASS,IAC1BR,EAAAA,kBAAAA,IAACC,EAAAA,OAAgB,QAAhB,CAAwB,IAAAO,EAAU,UAAWC,EAAAA,GAAG,iCAAkCF,CAAS,EAAI,GAAGR,EAAO,CAC3G,EACDM,EAAc,YAAcJ,SAAgB,QAAQ,YAEpD,MAAMS,EAAgBJ,EAAM,WAG1B,CAAC,CAAE,UAAAC,EAAW,SAAAI,EAAU,GAAGZ,CAAA,EAASS,IACpCI,EAAAA,kBAAAA,KAACT,EAAA,CACC,SAAA,CAAAH,EAAAA,kBAAAA,IAACK,EAAA,EAAc,EACfO,EAAAA,kBAAAA,KAACX,EAAAA,OAAgB,QAAhB,CACC,IAAAO,EACA,UAAWC,EAAAA,GACT,iGACAF,CAAA,EAED,GAAGR,EAEJ,SAAA,CAAAC,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,kDAAA,CAAmD,EACjEW,CAAA,CAAA,CAAA,CACH,EACF,CACD,EACDD,EAAc,YAAc,gBAE5B,MAAMG,EAAe,CAAC,CAAE,UAAAN,EAAW,GAAGR,CAAA,IACpCC,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAWS,EAAAA,GAAG,4CAA6CF,CAAS,EAAI,GAAGR,CAAA,CAAO,EAEzFc,EAAa,YAAc,eAE3B,MAAMC,EAAe,CAAC,CAAE,UAAAP,EAAW,GAAGR,CAAA,IACpCC,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAWS,EAAAA,GAAG,kCAAmCF,CAAS,EAAI,GAAGR,CAAA,CAAO,EAE/Ee,EAAa,YAAc,eAE3B,MAAMC,EAAcT,EAAM,WAGxB,CAAC,CAAE,UAAAC,EAAW,GAAGR,CAAA,EAASS,IAC1BR,EAAAA,kBAAAA,IAACC,EAAAA,OAAgB,MAAhB,CACC,IAAAO,EACA,UAAWC,EAAAA,GAAG,oDAAqDF,CAAS,EAC3E,GAAGR,CAAA,CACN,CACD,EACDgB,EAAY,YAAcd,SAAgB,MAAM,YAEhD,MAAMe,EAAoBV,EAAM,WAG9B,CAAC,CAAE,UAAAC,EAAW,GAAGR,CAAA,EAASS,IAC1BR,EAAAA,kBAAAA,IAACC,EAAAA,OAAgB,YAAhB,CAA4B,IAAAO,EAAU,UAAWC,EAAAA,GAAG,gCAAiCF,CAAS,EAAI,GAAGR,EAAO,CAC9G,EACDiB,EAAkB,YAAcf,SAAgB,YAAY"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { j as t, a1 as r } from "./vendor-CCQzmGyD.mjs";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { c as o } from "./utils-C9QGdMaH.mjs";
|
|
4
|
+
const n = ({ shouldScaleBackground: e = !0, ...a }) => /* @__PURE__ */ t.jsx(r.Root, { shouldScaleBackground: e, ...a });
|
|
5
|
+
n.displayName = "Drawer";
|
|
6
|
+
const g = r.Trigger, m = r.Portal, y = r.Close, i = l.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ t.jsx(r.Overlay, { ref: s, className: o("fixed inset-0 z-50 bg-black/80", e), ...a }));
|
|
7
|
+
i.displayName = r.Overlay.displayName;
|
|
8
|
+
const c = l.forwardRef(({ className: e, children: a, ...s }, d) => /* @__PURE__ */ t.jsxs(m, { children: [
|
|
9
|
+
/* @__PURE__ */ t.jsx(i, {}),
|
|
10
|
+
/* @__PURE__ */ t.jsxs(
|
|
11
|
+
r.Content,
|
|
12
|
+
{
|
|
13
|
+
ref: d,
|
|
14
|
+
className: o(
|
|
15
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
|
|
16
|
+
e
|
|
17
|
+
),
|
|
18
|
+
...s,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ t.jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
|
|
21
|
+
a
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
] }));
|
|
26
|
+
c.displayName = "DrawerContent";
|
|
27
|
+
const x = ({ className: e, ...a }) => /* @__PURE__ */ t.jsx("div", { className: o("grid gap-1.5 p-4 text-center sm:text-left", e), ...a });
|
|
28
|
+
x.displayName = "DrawerHeader";
|
|
29
|
+
const p = ({ className: e, ...a }) => /* @__PURE__ */ t.jsx("div", { className: o("mt-auto flex flex-col gap-2 p-4", e), ...a });
|
|
30
|
+
p.displayName = "DrawerFooter";
|
|
31
|
+
const f = l.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ t.jsx(
|
|
32
|
+
r.Title,
|
|
33
|
+
{
|
|
34
|
+
ref: s,
|
|
35
|
+
className: o("text-lg font-semibold leading-none tracking-tight", e),
|
|
36
|
+
...a
|
|
37
|
+
}
|
|
38
|
+
));
|
|
39
|
+
f.displayName = r.Title.displayName;
|
|
40
|
+
const w = l.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ t.jsx(r.Description, { ref: s, className: o("text-sm text-muted-foreground", e), ...a }));
|
|
41
|
+
w.displayName = r.Description.displayName;
|
|
42
|
+
export {
|
|
43
|
+
n as Drawer,
|
|
44
|
+
y as DrawerClose,
|
|
45
|
+
c as DrawerContent,
|
|
46
|
+
w as DrawerDescription,
|
|
47
|
+
p as DrawerFooter,
|
|
48
|
+
x as DrawerHeader,
|
|
49
|
+
i as DrawerOverlay,
|
|
50
|
+
m as DrawerPortal,
|
|
51
|
+
f as DrawerTitle,
|
|
52
|
+
g as DrawerTrigger
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=drawer.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.es.js","sources":["../src/components/ui/drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { cn } from '@/lib/utils';\n\nconst Drawer = ({ shouldScaleBackground = true, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\n);\nDrawer.displayName = 'Drawer';\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay ref={ref} className={cn('fixed inset-0 z-50 bg-black/80', className)} {...props} />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background',\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = 'DrawerContent';\n\nconst DrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)} {...props} />\n);\nDrawerHeader.displayName = 'DrawerHeader';\n\nconst DrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />\n);\nDrawerFooter.displayName = 'DrawerFooter';\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n};\n"],"names":["Drawer","shouldScaleBackground","props","jsx","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","React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Ac;AAE3B,MAAMC,IAAe,CAAC,EAAE,WAAAP,GAAW,GAAGR,EAAA,MACpCC,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAWS,EAAG,mCAAmCF,CAAS,GAAI,GAAGR,EAAA,CAAO;AAE/Ee,EAAa,cAAc;AAE3B,MAAMC,IAAcT,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGR,EAAA,GAASS,MAC1BR,gBAAAA,EAAAA;AAAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAO;AAAA,IACA,WAAWC,EAAG,qDAAqDF,CAAS;AAAA,IAC3E,GAAGR;AAAA,EAAA;AACN,CACD;AACDgB,EAAY,cAAcd,EAAgB,MAAM;AAEhD,MAAMe,IAAoBV,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,GAAGR,EAAA,GAASS,MAC1BR,gBAAAA,EAAAA,IAACC,EAAgB,aAAhB,EAA4B,KAAAO,GAAU,WAAWC,EAAG,iCAAiCF,CAAS,GAAI,GAAGR,GAAO,CAC9G;AACDiB,EAAkB,cAAcf,EAAgB,YAAY;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./vendor-CIyDEr7H.js"),g=require("react"),r=require("./utils-CUFNKXRW.js");function b(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const s=b(g),j=e.Root2$7,h=e.Trigger$6,R=e.Group2$2,y=e.Portal2$3,D=e.Sub2$2,M=e.RadioGroup2$2,i=s.forwardRef(({className:t,inset:o,children:n,...a},d)=>e.jsxRuntimeExports.jsxs(e.SubTrigger2$2,{ref:d,className:r.cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",o&&"pl-8",t),...a,children:[n,e.jsxRuntimeExports.jsx(e.ChevronRight,{className:"ml-auto"})]}));i.displayName=e.SubTrigger2$2.displayName;const p=s.forwardRef(({className:t,...o},n)=>e.jsxRuntimeExports.jsx(e.SubContent2$2,{ref:n,className:r.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]",t),...o}));p.displayName=e.SubContent2$2.displayName;const c=s.forwardRef(({className:t,sideOffset:o=4,...n},a)=>e.jsxRuntimeExports.jsx(e.Portal2$3,{children:e.jsxRuntimeExports.jsx(e.Content2$6,{ref:a,sideOffset:o,className:r.cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]",t),...n})}));c.displayName=e.Content2$6.displayName;const u=s.forwardRef(({className:t,inset:o,...n},a)=>e.jsxRuntimeExports.jsx(e.Item2$2,{ref:a,className:r.cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",o&&"pl-8",t),...n}));u.displayName=e.Item2$2.displayName;const l=s.forwardRef(({className:t,children:o,checked:n,...a},d)=>e.jsxRuntimeExports.jsxs(e.CheckboxItem2$2,{ref:d,className:r.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...a,children:[e.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsxRuntimeExports.jsx(e.ItemIndicator2$2,{children:e.jsxRuntimeExports.jsx(e.Check,{className:"h-4 w-4"})})}),o]}));l.displayName=e.CheckboxItem2$2.displayName;const m=s.forwardRef(({className:t,children:o,...n},a)=>e.jsxRuntimeExports.jsxs(e.RadioItem2$2,{ref:a,className:r.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsxRuntimeExports.jsx(e.ItemIndicator2$2,{children:e.jsxRuntimeExports.jsx(e.Circle,{className:"h-2 w-2 fill-current"})})}),o]}));m.displayName=e.RadioItem2$2.displayName;const x=s.forwardRef(({className:t,inset:o,...n},a)=>e.jsxRuntimeExports.jsx(e.Label2$2,{ref:a,className:r.cn("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",t),...n}));x.displayName=e.Label2$2.displayName;const f=s.forwardRef(({className:t,...o},n)=>e.jsxRuntimeExports.jsx(e.Separator2$2,{ref:n,className:r.cn("-mx-1 my-1 h-px bg-muted",t),...o}));f.displayName=e.Separator2$2.displayName;const w=({className:t,...o})=>e.jsxRuntimeExports.jsx("span",{className:r.cn("ml-auto text-xs tracking-widest opacity-60",t),...o});w.displayName="DropdownMenuShortcut";exports.DropdownMenu=j;exports.DropdownMenuCheckboxItem=l;exports.DropdownMenuContent=c;exports.DropdownMenuGroup=R;exports.DropdownMenuItem=u;exports.DropdownMenuLabel=x;exports.DropdownMenuPortal=y;exports.DropdownMenuRadioGroup=M;exports.DropdownMenuRadioItem=m;exports.DropdownMenuSeparator=f;exports.DropdownMenuShortcut=w;exports.DropdownMenuSub=D;exports.DropdownMenuSubContent=p;exports.DropdownMenuSubTrigger=i;exports.DropdownMenuTrigger=h;
|
|
2
|
+
//# sourceMappingURL=dropdown-menu.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.cjs.js","sources":["../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-muted', className)} {...props} />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />;\n};\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n};\n"],"names":["DropdownMenu","DropdownMenuPrimitive.Root","DropdownMenuTrigger","DropdownMenuPrimitive.Trigger","DropdownMenuGroup","DropdownMenuPrimitive.Group","DropdownMenuPortal","DropdownMenuPrimitive.Portal","DropdownMenuSub","DropdownMenuPrimitive.Sub","DropdownMenuRadioGroup","DropdownMenuPrimitive.RadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","jsxs","DropdownMenuPrimitive.SubTrigger","cn","jsx","ChevronRight","DropdownMenuSubContent","DropdownMenuPrimitive.SubContent","DropdownMenuContent","sideOffset","DropdownMenuPrimitive.Content","DropdownMenuItem","DropdownMenuPrimitive.Item","DropdownMenuCheckboxItem","checked","DropdownMenuPrimitive.CheckboxItem","DropdownMenuPrimitive.ItemIndicator","Check","DropdownMenuRadioItem","DropdownMenuPrimitive.RadioItem","Circle","DropdownMenuLabel","DropdownMenuPrimitive.Label","DropdownMenuSeparator","DropdownMenuPrimitive.Separator","DropdownMenuShortcut"],"mappings":"scAMMA,EAAeC,EAAAA,QAEfC,EAAsBC,EAAAA,UAEtBC,EAAoBC,EAAAA,SAEpBC,EAAqBC,EAAAA,UAErBC,EAAkBC,EAAAA,OAElBC,EAAyBC,EAAAA,cAEzBC,EAAyBC,EAAM,WAKnC,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAO,SAAAC,EAAU,GAAGC,GAASC,IAC3CC,EAAAA,kBAAAA,KAACC,EAAAA,cAAA,CACC,IAAAF,EACA,UAAWG,EAAAA,GACT,yMACAN,GAAS,OACTD,CAAA,EAED,GAAGG,EAEH,SAAA,CAAAD,EACDM,EAAAA,kBAAAA,IAACC,EAAAA,aAAA,CAAa,UAAU,SAAA,CAAU,CAAA,CAAA,CACpC,CACD,EACDX,EAAuB,YAAcQ,EA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 -0,0 +1,123 @@
|
|
|
1
|
+
import { j as o, b4 as i, l as w, b5 as l, b6 as c, b7 as m, b8 as p, b9 as u, ba as f, w as h, bb as b, V as N, bc as x, bd as g, be as y, bf as v, bg as j, bh as D, bi as M } from "./vendor-CCQzmGyD.mjs";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { c as n } from "./utils-C9QGdMaH.mjs";
|
|
4
|
+
const E = y, V = M, q = v, A = c, B = D, F = j, R = r.forwardRef(({ className: e, inset: a, children: t, ...s }, d) => /* @__PURE__ */ o.jsxs(
|
|
5
|
+
i,
|
|
6
|
+
{
|
|
7
|
+
ref: d,
|
|
8
|
+
className: n(
|
|
9
|
+
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
10
|
+
a && "pl-8",
|
|
11
|
+
e
|
|
12
|
+
),
|
|
13
|
+
...s,
|
|
14
|
+
children: [
|
|
15
|
+
t,
|
|
16
|
+
/* @__PURE__ */ o.jsx(w, { className: "ml-auto" })
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
));
|
|
20
|
+
R.displayName = i.displayName;
|
|
21
|
+
const S = r.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(
|
|
22
|
+
l,
|
|
23
|
+
{
|
|
24
|
+
ref: t,
|
|
25
|
+
className: n(
|
|
26
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
27
|
+
e
|
|
28
|
+
),
|
|
29
|
+
...a
|
|
30
|
+
}
|
|
31
|
+
));
|
|
32
|
+
S.displayName = l.displayName;
|
|
33
|
+
const C = r.forwardRef(({ className: e, sideOffset: a = 4, ...t }, s) => /* @__PURE__ */ o.jsx(c, { children: /* @__PURE__ */ o.jsx(
|
|
34
|
+
m,
|
|
35
|
+
{
|
|
36
|
+
ref: s,
|
|
37
|
+
sideOffset: a,
|
|
38
|
+
className: n(
|
|
39
|
+
"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
40
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
41
|
+
e
|
|
42
|
+
),
|
|
43
|
+
...t
|
|
44
|
+
}
|
|
45
|
+
) }));
|
|
46
|
+
C.displayName = m.displayName;
|
|
47
|
+
const z = r.forwardRef(({ className: e, inset: a, ...t }, s) => /* @__PURE__ */ o.jsx(
|
|
48
|
+
p,
|
|
49
|
+
{
|
|
50
|
+
ref: s,
|
|
51
|
+
className: n(
|
|
52
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
53
|
+
a && "pl-8",
|
|
54
|
+
e
|
|
55
|
+
),
|
|
56
|
+
...t
|
|
57
|
+
}
|
|
58
|
+
));
|
|
59
|
+
z.displayName = p.displayName;
|
|
60
|
+
const I = r.forwardRef(({ className: e, children: a, checked: t, ...s }, d) => /* @__PURE__ */ o.jsxs(
|
|
61
|
+
u,
|
|
62
|
+
{
|
|
63
|
+
ref: d,
|
|
64
|
+
className: n(
|
|
65
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
66
|
+
e
|
|
67
|
+
),
|
|
68
|
+
checked: t,
|
|
69
|
+
...s,
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(f, { children: /* @__PURE__ */ o.jsx(h, { className: "h-4 w-4" }) }) }),
|
|
72
|
+
a
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
));
|
|
76
|
+
I.displayName = u.displayName;
|
|
77
|
+
const k = r.forwardRef(({ className: e, children: a, ...t }, s) => /* @__PURE__ */ o.jsxs(
|
|
78
|
+
b,
|
|
79
|
+
{
|
|
80
|
+
ref: s,
|
|
81
|
+
className: n(
|
|
82
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
83
|
+
e
|
|
84
|
+
),
|
|
85
|
+
...t,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(f, { children: /* @__PURE__ */ o.jsx(N, { className: "h-2 w-2 fill-current" }) }) }),
|
|
88
|
+
a
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
));
|
|
92
|
+
k.displayName = b.displayName;
|
|
93
|
+
const G = r.forwardRef(({ className: e, inset: a, ...t }, s) => /* @__PURE__ */ o.jsx(
|
|
94
|
+
x,
|
|
95
|
+
{
|
|
96
|
+
ref: s,
|
|
97
|
+
className: n("px-2 py-1.5 text-sm font-semibold", a && "pl-8", e),
|
|
98
|
+
...t
|
|
99
|
+
}
|
|
100
|
+
));
|
|
101
|
+
G.displayName = x.displayName;
|
|
102
|
+
const T = r.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(g, { ref: t, className: n("-mx-1 my-1 h-px bg-muted", e), ...a }));
|
|
103
|
+
T.displayName = g.displayName;
|
|
104
|
+
const _ = ({ className: e, ...a }) => /* @__PURE__ */ o.jsx("span", { className: n("ml-auto text-xs tracking-widest opacity-60", e), ...a });
|
|
105
|
+
_.displayName = "DropdownMenuShortcut";
|
|
106
|
+
export {
|
|
107
|
+
E as DropdownMenu,
|
|
108
|
+
I as DropdownMenuCheckboxItem,
|
|
109
|
+
C as DropdownMenuContent,
|
|
110
|
+
q as DropdownMenuGroup,
|
|
111
|
+
z as DropdownMenuItem,
|
|
112
|
+
G as DropdownMenuLabel,
|
|
113
|
+
A as DropdownMenuPortal,
|
|
114
|
+
F as DropdownMenuRadioGroup,
|
|
115
|
+
k as DropdownMenuRadioItem,
|
|
116
|
+
T as DropdownMenuSeparator,
|
|
117
|
+
_ as DropdownMenuShortcut,
|
|
118
|
+
B as DropdownMenuSub,
|
|
119
|
+
S as DropdownMenuSubContent,
|
|
120
|
+
R as DropdownMenuSubTrigger,
|
|
121
|
+
V as DropdownMenuTrigger
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=dropdown-menu.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.es.js","sources":["../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-muted', className)} {...props} />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />;\n};\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n};\n"],"names":["DropdownMenu","DropdownMenuPrimitive.Root","DropdownMenuTrigger","DropdownMenuPrimitive.Trigger","DropdownMenuGroup","DropdownMenuPrimitive.Group","DropdownMenuPortal","DropdownMenuPrimitive.Portal","DropdownMenuSub","DropdownMenuPrimitive.Sub","DropdownMenuRadioGroup","DropdownMenuPrimitive.RadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","jsxs","DropdownMenuPrimitive.SubTrigger","cn","jsx","ChevronRight","DropdownMenuSubContent","DropdownMenuPrimitive.SubContent","DropdownMenuContent","sideOffset","DropdownMenuPrimitive.Content","DropdownMenuItem","DropdownMenuPrimitive.Item","DropdownMenuCheckboxItem","checked","DropdownMenuPrimitive.CheckboxItem","DropdownMenuPrimitive.ItemIndicator","Check","DropdownMenuRadioItem","DropdownMenuPrimitive.RadioItem","Circle","DropdownMenuLabel","DropdownMenuPrimitive.Label","DropdownMenuSeparator","DropdownMenuPrimitive.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;AACH,CACD;AACDoB,EAAsB,cAAcC,EAAgC;AAEpE,MAAME,IAAoB1B,EAAM,WAK9B,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,GAAGE,KAASC,MACjCI,gBAAAA,EAAAA;AAAAA,EAACkB;AAAAA,EAAA;AAAA,IACC,KAAAtB;AAAA,IACA,WAAWG,EAAG,qCAAqCN,KAAS,QAAQD,CAAS;AAAA,IAC5E,GAAGG;AAAA,EAAA;AACN,CACD;AACDsB,EAAkB,cAAcC,EAA4B;AAE5D,MAAMC,IAAwB5B,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,MAC1BI,gBAAAA,EAAAA,IAACoB,GAAA,EAAgC,KAAAxB,GAAU,WAAWG,EAAG,4BAA4BP,CAAS,GAAI,GAAGG,GAAO,CAC7G;AACDwB,EAAsB,cAAcC,EAAgC;AAEpE,MAAMC,IAAuB,CAAC,EAAE,WAAA7B,GAAW,GAAGG,QACrCK,gBAAAA,EAAAA,IAAC,UAAK,WAAWD,EAAG,8CAA8CP,CAAS,GAAI,GAAGG,GAAO;AAElG0B,EAAqB,cAAc;"}
|
package/dist/form.cjs.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./vendor-CIyDEr7H.js"),b=require("react"),g=require("./label.cjs.js"),c=require("./utils-CUFNKXRW.js");function I(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=I(b),R=s.FormProvider,l=n.createContext(null),y=({...e})=>s.jsxRuntimeExports.jsx(l.Provider,{value:{name:e.name},children:s.jsxRuntimeExports.jsx(s.Controller,{...e})}),a=()=>{const e=n.useContext(l),r=n.useContext(u),{getFieldState:t,formState:o}=s.useFormContext();if(!e)throw new Error("useFormField should be used within <FormField>");if(!r)throw new Error("useFormField should be used within <FormItem>");const m=t(e.name,o),{id:i}=r;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...m}},u=n.createContext(null),f=n.forwardRef(({className:e,...r},t)=>{const o=n.useId();return s.jsxRuntimeExports.jsx(u.Provider,{value:{id:o},children:s.jsxRuntimeExports.jsx("div",{ref:t,className:c.cn("space-y-2",e),...r})})});f.displayName="FormItem";const F=n.forwardRef(({className:e,...r},t)=>{const{error:o,formItemId:m}=a();return s.jsxRuntimeExports.jsx(g.Label,{ref:t,className:c.cn(o&&"text-destructive",e),htmlFor:m,...r})});F.displayName="FormLabel";const x=n.forwardRef(({...e},r)=>{const{error:t,formItemId:o,formDescriptionId:m,formMessageId:i}=a();return s.jsxRuntimeExports.jsx(s.Slot,{ref:r,id:o,"aria-describedby":t?`${m} ${i}`:`${m}`,"aria-invalid":!!t,...e})});x.displayName="FormControl";const p=n.forwardRef(({className:e,...r},t)=>{const{formDescriptionId:o}=a();return s.jsxRuntimeExports.jsx("p",{ref:t,id:o,className:c.cn("text-[0.8rem] text-muted-foreground",e),...r})});p.displayName="FormDescription";const j=n.forwardRef(({className:e,children:r,...t},o)=>{const{error:m,formMessageId:i}=a(),d=m?String(m?.message??""):r;return d?s.jsxRuntimeExports.jsx("p",{ref:o,id:i,className:c.cn("text-[0.8rem] font-medium text-destructive",e),...t,children:d}):null});j.displayName="FormMessage";exports.Form=R;exports.FormControl=x;exports.FormDescription=p;exports.FormField=y;exports.FormItem=f;exports.FormLabel=F;exports.FormMessage=j;exports.useFormField=a;
|
|
2
|
+
//# sourceMappingURL=form.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.cjs.js","sources":["../src/components/ui/form.tsx"],"sourcesContent":["'use client';\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from 'react-hook-form';\n\nimport { Label } from '@/components/ui/label';\nimport { cn } from '@/lib/utils';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n if (!itemContext) {\n throw new Error('useFormField should be used within <FormItem>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\nFormItem.displayName = 'FormItem';\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && 'text-destructive', className)} htmlFor={formItemId} {...props} />;\n});\nFormLabel.displayName = 'FormLabel';\n\nconst FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(\n ({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n },\n);\nFormControl.displayName = 'FormControl';\n\nconst FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p ref={ref} id={formDescriptionId} className={cn('text-[0.8rem] text-muted-foreground', className)} {...props} />\n );\n },\n);\nFormDescription.displayName = 'FormDescription';\n\nconst FormMessage = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn('text-[0.8rem] font-medium text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\nFormMessage.displayName = 'FormMessage';\n\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"],"mappings":"keAiBMA,EAAOC,EAAAA,aASPC,EAAmBC,EAAM,cAA4C,IAAI,EAEzEC,EAAY,CAGhB,CACA,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@
|
|
|
1
|
+
import { j as i, S as u, a2 as F, a3 as x, a4 as p } from "./vendor-CCQzmGyD.mjs";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { Label as I } from "./label.es.js";
|
|
4
|
+
import { c as a } from "./utils-C9QGdMaH.mjs";
|
|
5
|
+
const y = x, l = s.createContext(null), R = ({
|
|
6
|
+
...e
|
|
7
|
+
}) => /* @__PURE__ */ i.jsx(l.Provider, { value: { name: e.name }, children: /* @__PURE__ */ i.jsx(p, { ...e }) }), d = () => {
|
|
8
|
+
const e = s.useContext(l), r = s.useContext(f), { getFieldState: o, formState: t } = F();
|
|
9
|
+
if (!e)
|
|
10
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
11
|
+
if (!r)
|
|
12
|
+
throw new Error("useFormField should be used within <FormItem>");
|
|
13
|
+
const m = o(e.name, t), { id: n } = r;
|
|
14
|
+
return {
|
|
15
|
+
id: n,
|
|
16
|
+
name: e.name,
|
|
17
|
+
formItemId: `${n}-form-item`,
|
|
18
|
+
formDescriptionId: `${n}-form-item-description`,
|
|
19
|
+
formMessageId: `${n}-form-item-message`,
|
|
20
|
+
...m
|
|
21
|
+
};
|
|
22
|
+
}, f = s.createContext(null), C = s.forwardRef(
|
|
23
|
+
({ className: e, ...r }, o) => {
|
|
24
|
+
const t = s.useId();
|
|
25
|
+
return /* @__PURE__ */ i.jsx(f.Provider, { value: { id: t }, children: /* @__PURE__ */ i.jsx("div", { ref: o, className: a("space-y-2", e), ...r }) });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
C.displayName = "FormItem";
|
|
29
|
+
const w = s.forwardRef(({ className: e, ...r }, o) => {
|
|
30
|
+
const { error: t, formItemId: m } = d();
|
|
31
|
+
return /* @__PURE__ */ i.jsx(I, { ref: o, className: a(t && "text-destructive", e), htmlFor: m, ...r });
|
|
32
|
+
});
|
|
33
|
+
w.displayName = "FormLabel";
|
|
34
|
+
const g = s.forwardRef(
|
|
35
|
+
({ ...e }, r) => {
|
|
36
|
+
const { error: o, formItemId: t, formDescriptionId: m, formMessageId: n } = d();
|
|
37
|
+
return /* @__PURE__ */ i.jsx(
|
|
38
|
+
u,
|
|
39
|
+
{
|
|
40
|
+
ref: r,
|
|
41
|
+
id: t,
|
|
42
|
+
"aria-describedby": o ? `${m} ${n}` : `${m}`,
|
|
43
|
+
"aria-invalid": !!o,
|
|
44
|
+
...e
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
g.displayName = "FormControl";
|
|
50
|
+
const h = s.forwardRef(
|
|
51
|
+
({ className: e, ...r }, o) => {
|
|
52
|
+
const { formDescriptionId: t } = d();
|
|
53
|
+
return /* @__PURE__ */ i.jsx("p", { ref: o, id: t, className: a("text-[0.8rem] text-muted-foreground", e), ...r });
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
h.displayName = "FormDescription";
|
|
57
|
+
const j = s.forwardRef(
|
|
58
|
+
({ className: e, children: r, ...o }, t) => {
|
|
59
|
+
const { error: m, formMessageId: n } = d(), c = m ? String(m?.message ?? "") : r;
|
|
60
|
+
return c ? /* @__PURE__ */ i.jsx(
|
|
61
|
+
"p",
|
|
62
|
+
{
|
|
63
|
+
ref: t,
|
|
64
|
+
id: n,
|
|
65
|
+
className: a("text-[0.8rem] font-medium text-destructive", e),
|
|
66
|
+
...o,
|
|
67
|
+
children: c
|
|
68
|
+
}
|
|
69
|
+
) : null;
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
j.displayName = "FormMessage";
|
|
73
|
+
export {
|
|
74
|
+
y as Form,
|
|
75
|
+
g as FormControl,
|
|
76
|
+
h as FormDescription,
|
|
77
|
+
R as FormField,
|
|
78
|
+
C as FormItem,
|
|
79
|
+
w as FormLabel,
|
|
80
|
+
j as FormMessage,
|
|
81
|
+
d as useFormField
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=form.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.es.js","sources":["../src/components/ui/form.tsx"],"sourcesContent":["'use client';\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from 'react-hook-form';\n\nimport { Label } from '@/components/ui/label';\nimport { cn } from '@/lib/utils';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n if (!itemContext) {\n throw new Error('useFormField should be used within <FormItem>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\nFormItem.displayName = 'FormItem';\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && 'text-destructive', className)} htmlFor={formItemId} {...props} />;\n});\nFormLabel.displayName = 'FormLabel';\n\nconst FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(\n ({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n },\n);\nFormControl.displayName = 'FormControl';\n\nconst FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p ref={ref} id={formDescriptionId} className={cn('text-[0.8rem] text-muted-foreground', className)} {...props} />\n );\n },\n);\nFormDescription.displayName = 'FormDescription';\n\nconst FormMessage = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn('text-[0.8rem] font-medium text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\nFormMessage.displayName = 'FormMessage';\n\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","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,IAKH1B,gBAAAA,EAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAa;AAAA,QACA,IAAIQ;AAAA,QACJ,WAAWP,EAAG,8CAA8CF,CAAS;AAAA,QACpE,GAAGb;AAAA,QAEH,UAAA2B;AAAA,MAAA;AAAA,IAAA,IAVI;AAAA,EAaX;AACF;AACAF,EAAY,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./vendor-CIyDEr7H.js"),i=require("react"),s=require("./utils-CUFNKXRW.js");function c(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const l=c(i),u=r.Root2$3,f=r.Trigger$1,n=l.forwardRef(({className:e,align:o="center",sideOffset:t=4,...a},d)=>r.jsxRuntimeExports.jsx(r.Content2$3,{ref:d,align:o,sideOffset:t,className:s.cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-hover-card-content-transform-origin]",e),...a}));n.displayName=r.Content2$3.displayName;exports.HoverCard=u;exports.HoverCardContent=n;exports.HoverCardTrigger=f;
|
|
2
|
+
//# sourceMappingURL=hover-card.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-card.cjs.js","sources":["../src/components/ui/hover-card.tsx"],"sourcesContent":["import * as HoverCardPrimitive from '@radix-ui/react-hover-card';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst HoverCard = HoverCardPrimitive.Root;\n\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\nconst HoverCardContent = React.forwardRef<\n React.ElementRef<typeof HoverCardPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-hover-card-content-transform-origin]',\n className,\n )}\n {...props}\n />\n));\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\nexport { HoverCard, HoverCardContent, HoverCardTrigger };\n"],"names":["HoverCard","HoverCardPrimitive.Root","HoverCardTrigger","HoverCardPrimitive.Trigger","HoverCardContent","React","className","align","sideOffset","props","ref","jsx","HoverCardPrimitive.Content","cn"],"mappings":"scAKMA,EAAYC,EAAAA,QAEZC,EAAmBC,EAAAA,UAEnBC,EAAmBC,EAAM,WAG7B,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAA,EAASC,IAC5DC,EAAAA,kBAAAA,IAACC,EAAAA,WAAA,CACC,IAAAF,EACA,MAAAH,EACA,WAAAC,EACA,UAAWK,EAAAA,GACT,keACAP,CAAA,EAED,GAAGG,CAAA,CACN,CACD,EACDL,EAAiB,YAAcQ,EAAAA,WAA2B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { j as s, a5 as t, a6 as i, a7 as n } from "./vendor-CCQzmGyD.mjs";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { c as p } from "./utils-C9QGdMaH.mjs";
|
|
4
|
+
const g = i, u = n, f = m.forwardRef(({ className: o, align: a = "center", sideOffset: e = 4, ...r }, d) => /* @__PURE__ */ s.jsx(
|
|
5
|
+
t,
|
|
6
|
+
{
|
|
7
|
+
ref: d,
|
|
8
|
+
align: a,
|
|
9
|
+
sideOffset: e,
|
|
10
|
+
className: p(
|
|
11
|
+
"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-hover-card-content-transform-origin]",
|
|
12
|
+
o
|
|
13
|
+
),
|
|
14
|
+
...r
|
|
15
|
+
}
|
|
16
|
+
));
|
|
17
|
+
f.displayName = t.displayName;
|
|
18
|
+
export {
|
|
19
|
+
g as HoverCard,
|
|
20
|
+
f as HoverCardContent,
|
|
21
|
+
u as HoverCardTrigger
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=hover-card.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-card.es.js","sources":["../src/components/ui/hover-card.tsx"],"sourcesContent":["import * as HoverCardPrimitive from '@radix-ui/react-hover-card';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst HoverCard = HoverCardPrimitive.Root;\n\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\nconst HoverCardContent = React.forwardRef<\n React.ElementRef<typeof HoverCardPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-hover-card-content-transform-origin]',\n className,\n )}\n {...props}\n />\n));\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\nexport { HoverCard, HoverCardContent, HoverCardTrigger };\n"],"names":["HoverCard","HoverCardPrimitive.Root","HoverCardTrigger","HoverCardPrimitive.Trigger","HoverCardContent","React","className","align","sideOffset","props","ref","jsx","HoverCardPrimitive.Content","cn"],"mappings":";;;AAKA,MAAMA,IAAYC,GAEZC,IAAmBC,GAEnBC,IAAmBC,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,OAAAC,IAAQ,UAAU,YAAAC,IAAa,GAAG,GAAGC,EAAA,GAASC,MAC5DC,gBAAAA,EAAAA;AAAAA,EAACC;AAAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,OAAAH;AAAA,IACA,YAAAC;AAAA,IACA,WAAWK;AAAA,MACT;AAAA,MACAP;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,EAAA;AACN,CACD;AACDL,EAAiB,cAAcQ,EAA2B;"}
|