@kubetail/ui 2.4.0 → 2.5.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/dist/elements/avatar.cjs +1 -1
- package/dist/elements/avatar.cjs.map +1 -1
- package/dist/elements/avatar.d.ts +1 -1
- package/dist/elements/avatar.js +1 -1
- package/dist/elements/avatar.js.map +1 -1
- package/dist/elements/button.cjs.map +1 -1
- package/dist/elements/calendar.cjs.map +1 -1
- package/dist/elements/calendar.stories.d.ts +0 -3
- package/dist/elements/card.cjs.map +1 -1
- package/dist/elements/checkbox.cjs.map +1 -1
- package/dist/elements/context-menu.cjs +2 -0
- package/dist/elements/context-menu.cjs.map +1 -0
- package/dist/elements/context-menu.d.ts +30 -0
- package/dist/elements/context-menu.js +126 -0
- package/dist/elements/context-menu.js.map +1 -0
- package/dist/elements/context-menu.stories.d.ts +17 -0
- package/dist/elements/context-menu.test.d.ts +0 -0
- package/dist/elements/dialog.cjs.map +1 -1
- package/dist/elements/dropdown-menu.cjs.map +1 -1
- package/dist/elements/form.cjs.map +1 -1
- package/dist/elements/input.cjs.map +1 -1
- package/dist/elements/label.cjs.map +1 -1
- package/dist/elements/link.cjs.map +1 -1
- package/dist/elements/pagination.cjs.map +1 -1
- package/dist/elements/popover.cjs.map +1 -1
- package/dist/elements/search-box.cjs.map +1 -1
- package/dist/elements/select.cjs.map +1 -1
- package/dist/elements/separator.cjs.map +1 -1
- package/dist/elements/sheet.cjs.map +1 -1
- package/dist/elements/sidebar.cjs +1 -1
- package/dist/elements/sidebar.cjs.map +1 -1
- package/dist/elements/sidebar.js +1 -1
- package/dist/elements/sidebar.js.map +1 -1
- package/dist/elements/skeleton.cjs.map +1 -1
- package/dist/elements/spinner.cjs.map +1 -1
- package/dist/elements/switch.cjs.map +1 -1
- package/dist/elements/table.cjs.map +1 -1
- package/dist/elements/tabs.cjs.map +1 -1
- package/dist/elements/toggle.cjs.map +1 -1
- package/dist/elements/tooltip.cjs.map +1 -1
- package/dist/hooks/use-mobile.cjs +1 -1
- package/dist/hooks/use-mobile.cjs.map +1 -1
- package/dist/hooks/use-mobile.js +3 -3
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/hooks/use-mobile.test.d.ts +1 -0
- package/package.json +33 -27
package/dist/elements/avatar.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../lib/utils.cjs`);let n=require(`react/jsx-runtime`),r=require(`react`);r=e.__toESM(r);let i=require(
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../lib/utils.cjs`);let n=require(`react/jsx-runtime`),r=require(`react`);r=e.__toESM(r);let i=require(`@radix-ui/react-avatar`);i=e.__toESM(i);function a({className:e,size:r=`default`,...a}){return(0,n.jsx)(i.Root,{"data-slot":`avatar`,"data-size":r,className:t.cn(`group/avatar relative flex size-8 shrink-0 rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6`,e),...a})}function o({className:e,...r}){return(0,n.jsx)(i.Image,{"data-slot":`avatar-image`,className:t.cn(`aspect-square size-full rounded-full`,e),...r})}function s({className:e,...r}){return(0,n.jsx)(i.Fallback,{"data-slot":`avatar-fallback`,className:t.cn(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...r})}function c({className:e,...r}){return(0,n.jsx)(`span`,{"data-slot":`avatar-badge`,className:t.cn(`absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground ring-2 ring-background select-none`,`group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden`,`group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2`,`group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2`,e),...r})}function l({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`avatar-group`,className:t.cn(`group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background`,e),...r})}function u({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`avatar-group-count`,className:t.cn(`relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3`,e),...r})}exports.Avatar=a,exports.AvatarBadge=c,exports.AvatarFallback=s,exports.AvatarGroup=l,exports.AvatarGroupCount=u,exports.AvatarImage=o;
|
|
2
2
|
//# sourceMappingURL=avatar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.cjs","names":[],"sources":["../../src/elements/avatar.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"avatar.cjs","names":[],"sources":["../../src/elements/avatar.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\n\nimport { cn } from '@/lib/utils';\n\nfunction Avatar({\n className,\n size = 'default',\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: 'default' | 'sm' | 'lg';\n}) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-size={size}\n className={cn(\n 'group/avatar relative flex size-8 shrink-0 rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('aspect-square size-full rounded-full', className)}\n {...props}\n />\n );\n}\n\nfunction AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarBadge({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"avatar-badge\"\n className={cn(\n 'absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground ring-2 ring-background select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"avatar-group\"\n className={cn(\n 'group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarGroupCount({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"avatar-group-count\"\n className={cn(\n 'relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount };\n"],"mappings":"+RAOA,SAAS,EAAO,CACd,YACA,OAAO,UACP,GAAG,GAGF,CACD,OACE,EAAA,EAAA,KAAC,EAAgB,KAAjB,CACE,YAAU,SACV,YAAW,EACX,UAAW,EAAA,GACT,mHACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OACE,EAAA,EAAA,KAAC,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EAAA,GAAG,uCAAwC,EAAU,CAChE,GAAI,EACJ,CAAA,CAIN,SAAS,EAAe,CAAE,YAAW,GAAG,GAAgE,CACtG,OACE,EAAA,EAAA,KAAC,EAAgB,SAAjB,CACE,YAAU,kBACV,UAAW,EAAA,GACT,qIACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,EAAY,CAAE,YAAW,GAAG,GAAuC,CAC1E,OACE,EAAA,EAAA,KAAC,OAAD,CACE,YAAU,eACV,UAAW,EAAA,GACT,4JACA,gFACA,4FACA,gFACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OACE,EAAA,EAAA,KAAC,MAAD,CACE,YAAU,eACV,UAAW,EAAA,GACT,sGACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAsC,CAC9E,OACE,EAAA,EAAA,KAAC,MAAD,CACE,YAAU,qBACV,UAAW,EAAA,GACT,2VACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Avatar as AvatarPrimitive } from 'radix-ui';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
3
|
declare function Avatar({ className, size, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
4
4
|
size?: 'default' | 'sm' | 'lg';
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/elements/avatar.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn as e } from "../lib/utils.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import
|
|
5
|
+
import * as n from "@radix-ui/react-avatar";
|
|
6
6
|
//#region src/elements/avatar.tsx
|
|
7
7
|
function r({ className: r, size: i = "default", ...a }) {
|
|
8
8
|
return /* @__PURE__ */ t(n.Root, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","names":[],"sources":["../../src/elements/avatar.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"avatar.js","names":[],"sources":["../../src/elements/avatar.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\n\nimport { cn } from '@/lib/utils';\n\nfunction Avatar({\n className,\n size = 'default',\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: 'default' | 'sm' | 'lg';\n}) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-size={size}\n className={cn(\n 'group/avatar relative flex size-8 shrink-0 rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('aspect-square size-full rounded-full', className)}\n {...props}\n />\n );\n}\n\nfunction AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarBadge({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"avatar-badge\"\n className={cn(\n 'absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground ring-2 ring-background select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"avatar-group\"\n className={cn(\n 'group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarGroupCount({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"avatar-group-count\"\n className={cn(\n 'relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount };\n"],"mappings":";;;;;;AAOA,SAAS,EAAO,EACd,cACA,UAAO,WACP,GAAG,KAGF;AACD,QACE,kBAAC,EAAgB,MAAjB;EACE,aAAU;EACV,aAAW;EACX,WAAW,EACT,oHACA,EACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAY,EAAE,cAAW,GAAG,KAA6D;AAChG,QACE,kBAAC,EAAgB,OAAjB;EACE,aAAU;EACV,WAAW,EAAG,wCAAwC,EAAU;EAChE,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAe,EAAE,cAAW,GAAG,KAAgE;AACtG,QACE,kBAAC,EAAgB,UAAjB;EACE,aAAU;EACV,WAAW,EACT,sIACA,EACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAY,EAAE,cAAW,GAAG,KAAuC;AAC1E,QACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EACT,6JACA,iFACA,6FACA,iFACA,EACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAY,EAAE,cAAW,GAAG,KAAsC;AACzE,QACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,uGACA,EACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAiB,EAAE,cAAW,GAAG,KAAsC;AAC9E,QACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,4VACA,EACD;EACD,GAAI;EACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.cjs","names":[],"sources":["../../src/elements/button.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',\n destructive:\n 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline:\n 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>;\n\n/**\n * `Button` renders a button component\n *\n * @param props.className - the custom className\n * @param props.variant - the button variant\n * @param props.size - the button size\n * @parmm props.asChild - as child\n */\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n ButtonVariantProps & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot : 'button';\n\n return <Comp data-slot=\"button\" className={cn(buttonVariants({ variant, size, className }))} {...props} />;\n}\n\nexport { Button, buttonVariants };\n"],"mappings":"+PAKA,IAAM,GAAA,EAAA,EAAA,KACJ,8bACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,mEACT,YACE,8JACF,QACE,wIACF,UAAW,yEACX,MAAO,uEACP,KAAM,kDACP,CACD,KAAM,CACJ,QAAS,gCACT,GAAI,gDACJ,GAAI,uCACJ,KAAM,SACN,UAAW,SACX,UAAW,UACZ,CACF,CACD,gBAAiB,CACf,QAAS,UACT,KAAM,UACP,CACF,CACF,CAaD,SAAS,EAAO,CACd,YACA,UACA,OACA,UAAU,GACV,GAAG,GAIA,CAGH,
|
|
1
|
+
{"version":3,"file":"button.cjs","names":[],"sources":["../../src/elements/button.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',\n destructive:\n 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline:\n 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>;\n\n/**\n * `Button` renders a button component\n *\n * @param props.className - the custom className\n * @param props.variant - the button variant\n * @param props.size - the button size\n * @parmm props.asChild - as child\n */\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n ButtonVariantProps & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot : 'button';\n\n return <Comp data-slot=\"button\" className={cn(buttonVariants({ variant, size, className }))} {...props} />;\n}\n\nexport { Button, buttonVariants };\n"],"mappings":"+PAKA,IAAM,GAAA,EAAA,EAAA,KACJ,8bACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,mEACT,YACE,8JACF,QACE,wIACF,UAAW,yEACX,MAAO,uEACP,KAAM,kDACP,CACD,KAAM,CACJ,QAAS,gCACT,GAAI,gDACJ,GAAI,uCACJ,KAAM,SACN,UAAW,SACX,UAAW,UACZ,CACF,CACD,gBAAiB,CACf,QAAS,UACT,KAAM,UACP,CACF,CACF,CAaD,SAAS,EAAO,CACd,YACA,UACA,OACA,UAAU,GACV,GAAG,GAIA,CAGH,OAAO,EAAA,EAAA,KAFM,EAAU,EAAA,KAAO,SAEvB,CAAM,YAAU,SAAS,UAAW,EAAA,GAAG,EAAe,CAAE,UAAS,OAAM,YAAW,CAAC,CAAC,CAAE,GAAI,EAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.cjs","names":[],"sources":["../../src/elements/calendar.tsx"],"sourcesContent":["import { DayPicker, getDefaultClassNames } from 'react-day-picker';\n\nimport { cn } from '@/lib/utils';\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nconst Calendar = ({ className, showOutsideDays = true, ...props }: CalendarProps) => {\n const defaultClassNames = getDefaultClassNames();\n return (\n <DayPicker\n mode=\"single\"\n showOutsideDays={showOutsideDays}\n classNames={{\n today: 'bg-accent text-accent-foreground',\n selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n root: cn(defaultClassNames.root, className),\n chevron: `${defaultClassNames.chevron} fill-amber-500`,\n weekday: 'text-muted-foreground font-normal text-sm',\n day_selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n outside: 'text-muted-foreground',\n }}\n {...props}\n />\n );\n};\n\nexport { Calendar };\n"],"mappings":"qNAMA,IAAM,GAAY,CAAE,YAAW,kBAAkB,GAAM,GAAG,KAA2B,CACnF,IAAM,GAAA,EAAA,EAAA,uBAA0C,CAChD,
|
|
1
|
+
{"version":3,"file":"calendar.cjs","names":[],"sources":["../../src/elements/calendar.tsx"],"sourcesContent":["import { DayPicker, getDefaultClassNames } from 'react-day-picker';\n\nimport { cn } from '@/lib/utils';\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nconst Calendar = ({ className, showOutsideDays = true, ...props }: CalendarProps) => {\n const defaultClassNames = getDefaultClassNames();\n return (\n <DayPicker\n mode=\"single\"\n showOutsideDays={showOutsideDays}\n classNames={{\n today: 'bg-accent text-accent-foreground',\n selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n root: cn(defaultClassNames.root, className),\n chevron: `${defaultClassNames.chevron} fill-amber-500`,\n weekday: 'text-muted-foreground font-normal text-sm',\n day_selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n outside: 'text-muted-foreground',\n }}\n {...props}\n />\n );\n};\n\nexport { Calendar };\n"],"mappings":"qNAMA,IAAM,GAAY,CAAE,YAAW,kBAAkB,GAAM,GAAG,KAA2B,CACnF,IAAM,GAAA,EAAA,EAAA,uBAA0C,CAChD,OACE,EAAA,EAAA,KAAC,EAAA,UAAD,CACE,KAAK,SACY,kBACjB,WAAY,CACV,MAAO,mCACP,SACE,mIACF,KAAM,EAAA,GAAG,EAAkB,KAAM,EAAU,CAC3C,QAAS,GAAG,EAAkB,QAAQ,iBACtC,QAAS,4CACT,aACE,mIACF,UAAW,mCACX,QAAS,wBACV,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.cjs","names":[],"sources":["../../src/elements/card.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nfunction Card({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card\"\n className={cn('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-title\" className={cn('leading-none font-semibold', className)} {...props} />;\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-description\" className={cn('text-muted-foreground text-sm', className)} {...props} />;\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-content\" className={cn('px-6', className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div data-slot=\"card-footer\" className={cn('flex items-center px-6 [.border-t]:pt-6', className)} {...props} />\n );\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };\n"],"mappings":"uLAEA,SAAS,EAAK,CAAE,YAAW,GAAG,GAAsC,CAClE,
|
|
1
|
+
{"version":3,"file":"card.cjs","names":[],"sources":["../../src/elements/card.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nfunction Card({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card\"\n className={cn('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-title\" className={cn('leading-none font-semibold', className)} {...props} />;\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-description\" className={cn('text-muted-foreground text-sm', className)} {...props} />;\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"card-content\" className={cn('px-6', className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div data-slot=\"card-footer\" className={cn('flex items-center px-6 [.border-t]:pt-6', className)} {...props} />\n );\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };\n"],"mappings":"uLAEA,SAAS,EAAK,CAAE,YAAW,GAAG,GAAsC,CAClE,OACE,EAAA,EAAA,KAAC,MAAD,CACE,YAAU,OACV,UAAW,EAAA,GAAG,oFAAqF,EAAU,CAC7G,GAAI,EACJ,CAAA,CAIN,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAA,EAAA,KAAC,MAAD,CACE,YAAU,cACV,UAAW,EAAA,GACT,6JACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,EAAU,CAAE,YAAW,GAAG,GAAsC,CACvE,OAAO,EAAA,EAAA,KAAC,MAAD,CAAK,YAAU,aAAa,UAAW,EAAA,GAAG,6BAA8B,EAAU,CAAE,GAAI,EAAS,CAAA,CAG1G,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAsC,CAC7E,OAAO,EAAA,EAAA,KAAC,MAAD,CAAK,YAAU,mBAAmB,UAAW,EAAA,GAAG,gCAAiC,EAAU,CAAE,GAAI,EAAS,CAAA,CAGnH,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAA,EAAA,KAAC,MAAD,CACE,YAAU,cACV,UAAW,EAAA,GAAG,iEAAkE,EAAU,CAC1F,GAAI,EACJ,CAAA,CAIN,SAAS,EAAY,CAAE,YAAW,GAAG,GAAsC,CACzE,OAAO,EAAA,EAAA,KAAC,MAAD,CAAK,YAAU,eAAe,UAAW,EAAA,GAAG,OAAQ,EAAU,CAAE,GAAI,EAAS,CAAA,CAGtF,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAA,EAAA,KAAC,MAAD,CAAK,YAAU,cAAc,UAAW,EAAA,GAAG,0CAA2C,EAAU,CAAE,GAAI,EAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.cjs","names":[],"sources":["../../src/elements/checkbox.tsx"],"sourcesContent":["'use client';\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"mappings":"qRAOA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA8D,CAC9F,
|
|
1
|
+
{"version":3,"file":"checkbox.cjs","names":[],"sources":["../../src/elements/checkbox.tsx"],"sourcesContent":["'use client';\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"mappings":"qRAOA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA8D,CAC9F,OACE,EAAA,EAAA,KAAC,EAAkB,KAAnB,CACE,YAAU,WACV,UAAW,EAAA,GACT,8eACA,EACD,CACD,GAAI,YAEJ,EAAA,EAAA,KAAC,EAAkB,UAAnB,CACE,YAAU,qBACV,UAAU,0EAEV,EAAA,EAAA,KAAC,EAAA,UAAD,CAAW,UAAU,WAAa,CAAA,CACN,CAAA,CACP,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../lib/utils.cjs`);let n=require(`react/jsx-runtime`),r=require(`lucide-react`),i=require(`@radix-ui/react-context-menu`);i=e.__toESM(i);function a({...e}){return(0,n.jsx)(i.Root,{"data-slot":`context-menu`,...e})}function o({className:e,...r}){return(0,n.jsx)(i.Trigger,{"data-slot":`context-menu-trigger`,className:t.cn(`select-none`,e),...r})}function s({...e}){return(0,n.jsx)(i.Group,{"data-slot":`context-menu-group`,...e})}function c({...e}){return(0,n.jsx)(i.Portal,{"data-slot":`context-menu-portal`,...e})}function l({...e}){return(0,n.jsx)(i.Sub,{"data-slot":`context-menu-sub`,...e})}function u({...e}){return(0,n.jsx)(i.RadioGroup,{"data-slot":`context-menu-radio-group`,...e})}function d({className:e,...r}){return(0,n.jsx)(i.Portal,{children:(0,n.jsx)(i.Content,{"data-slot":`context-menu-content`,className:t.cn(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-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 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 data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function f({className:e,inset:r,variant:a=`default`,...o}){return(0,n.jsx)(i.Item,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":a,className:t.cn(`group/context-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 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 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,e),...o})}function p({className:e,inset:a,children:o,...s}){return(0,n.jsxs)(i.SubTrigger,{"data-slot":`context-menu-sub-trigger`,"data-inset":a,className:t.cn(`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 data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...s,children:[o,(0,n.jsx)(r.ChevronRightIcon,{className:`cn-rtl-flip ml-auto`})]})}function m({className:e,...r}){return(0,n.jsx)(i.SubContent,{"data-slot":`context-menu-sub-content`,className:t.cn(`z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg 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 data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})}function h({className:e,children:a,checked:o,inset:s,...c}){return(0,n.jsxs)(i.CheckboxItem,{"data-slot":`context-menu-checkbox-item`,"data-inset":s,className:t.cn(`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 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`,e),checked:o,...c,children:[(0,n.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,n.jsx)(i.ItemIndicator,{children:(0,n.jsx)(r.CheckIcon,{})})}),a]})}function g({className:e,children:a,inset:o,...s}){return(0,n.jsxs)(i.RadioItem,{"data-slot":`context-menu-radio-item`,"data-inset":o,className:t.cn(`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 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`,e),...s,children:[(0,n.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,n.jsx)(i.ItemIndicator,{children:(0,n.jsx)(r.CheckIcon,{})})}),a]})}function _({className:e,inset:r,...a}){return(0,n.jsx)(i.Label,{"data-slot":`context-menu-label`,"data-inset":r,className:t.cn(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...a})}function v({className:e,...r}){return(0,n.jsx)(i.Separator,{"data-slot":`context-menu-separator`,className:t.cn(`-mx-1 my-1 h-px bg-border`,e),...r})}function y({className:e,...r}){return(0,n.jsx)(`span`,{"data-slot":`context-menu-shortcut`,className:t.cn(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground`,e),...r})}exports.ContextMenu=a,exports.ContextMenuCheckboxItem=h,exports.ContextMenuContent=d,exports.ContextMenuGroup=s,exports.ContextMenuItem=f,exports.ContextMenuLabel=_,exports.ContextMenuPortal=c,exports.ContextMenuRadioGroup=u,exports.ContextMenuRadioItem=g,exports.ContextMenuSeparator=v,exports.ContextMenuShortcut=y,exports.ContextMenuSub=l,exports.ContextMenuSubContent=m,exports.ContextMenuSubTrigger=p,exports.ContextMenuTrigger=o;
|
|
2
|
+
//# sourceMappingURL=context-menu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.cjs","names":[],"sources":["../../src/elements/context-menu.tsx"],"sourcesContent":["'use client';\n\nimport * as ContextMenuPrimitive from '@radix-ui/react-context-menu';\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger\n data-slot=\"context-menu-trigger\"\n className={cn('select-none', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n 'z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-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 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 data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/context-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 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 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"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 data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"cn-rtl-flip ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n 'z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg 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 data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"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 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\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(\n \"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 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\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"],"mappings":"yRAOA,SAAS,EAAY,CAAE,GAAG,GAAiE,CACzF,OAAO,EAAA,EAAA,KAAC,EAAqB,KAAtB,CAA2B,YAAU,eAAe,GAAI,EAAS,CAAA,CAG1E,SAAS,EAAmB,CAAE,YAAW,GAAG,GAAoE,CAC9G,OACE,EAAA,EAAA,KAAC,EAAqB,QAAtB,CACE,YAAU,uBACV,UAAW,EAAA,GAAG,cAAe,EAAU,CACvC,GAAI,EACJ,CAAA,CAIN,SAAS,EAAiB,CAAE,GAAG,GAAkE,CAC/F,OAAO,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Primitive from '@radix-ui/react-context-menu';
|
|
2
|
+
declare function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {
|
|
9
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function ContextMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
variant?: 'default' | 'destructive';
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function ContextMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {
|
|
23
|
+
inset?: boolean;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function ContextMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { CheckIcon as r, ChevronRightIcon as i } from "lucide-react";
|
|
5
|
+
import * as a from "@radix-ui/react-context-menu";
|
|
6
|
+
//#region src/elements/context-menu.tsx
|
|
7
|
+
function o({ ...e }) {
|
|
8
|
+
return /* @__PURE__ */ t(a.Root, {
|
|
9
|
+
"data-slot": "context-menu",
|
|
10
|
+
...e
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function s({ className: n, ...r }) {
|
|
14
|
+
return /* @__PURE__ */ t(a.Trigger, {
|
|
15
|
+
"data-slot": "context-menu-trigger",
|
|
16
|
+
className: e("select-none", n),
|
|
17
|
+
...r
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function c({ ...e }) {
|
|
21
|
+
return /* @__PURE__ */ t(a.Group, {
|
|
22
|
+
"data-slot": "context-menu-group",
|
|
23
|
+
...e
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function l({ ...e }) {
|
|
27
|
+
return /* @__PURE__ */ t(a.Portal, {
|
|
28
|
+
"data-slot": "context-menu-portal",
|
|
29
|
+
...e
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function u({ ...e }) {
|
|
33
|
+
return /* @__PURE__ */ t(a.Sub, {
|
|
34
|
+
"data-slot": "context-menu-sub",
|
|
35
|
+
...e
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function d({ ...e }) {
|
|
39
|
+
return /* @__PURE__ */ t(a.RadioGroup, {
|
|
40
|
+
"data-slot": "context-menu-radio-group",
|
|
41
|
+
...e
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function f({ className: n, ...r }) {
|
|
45
|
+
return /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ t(a.Content, {
|
|
46
|
+
"data-slot": "context-menu-content",
|
|
47
|
+
className: e("z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-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 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 data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", n),
|
|
48
|
+
...r
|
|
49
|
+
}) });
|
|
50
|
+
}
|
|
51
|
+
function p({ className: n, inset: r, variant: i = "default", ...o }) {
|
|
52
|
+
return /* @__PURE__ */ t(a.Item, {
|
|
53
|
+
"data-slot": "context-menu-item",
|
|
54
|
+
"data-inset": r,
|
|
55
|
+
"data-variant": i,
|
|
56
|
+
className: e("group/context-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 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 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive", n),
|
|
57
|
+
...o
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function m({ className: r, inset: o, children: s, ...c }) {
|
|
61
|
+
return /* @__PURE__ */ n(a.SubTrigger, {
|
|
62
|
+
"data-slot": "context-menu-sub-trigger",
|
|
63
|
+
"data-inset": o,
|
|
64
|
+
className: e("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 data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", r),
|
|
65
|
+
...c,
|
|
66
|
+
children: [s, /* @__PURE__ */ t(i, { className: "cn-rtl-flip ml-auto" })]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function h({ className: n, ...r }) {
|
|
70
|
+
return /* @__PURE__ */ t(a.SubContent, {
|
|
71
|
+
"data-slot": "context-menu-sub-content",
|
|
72
|
+
className: e("z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg 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 data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", n),
|
|
73
|
+
...r
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function g({ className: i, children: o, checked: s, inset: c, ...l }) {
|
|
77
|
+
return /* @__PURE__ */ n(a.CheckboxItem, {
|
|
78
|
+
"data-slot": "context-menu-checkbox-item",
|
|
79
|
+
"data-inset": c,
|
|
80
|
+
className: e("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 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", i),
|
|
81
|
+
checked: s,
|
|
82
|
+
...l,
|
|
83
|
+
children: [/* @__PURE__ */ t("span", {
|
|
84
|
+
className: "pointer-events-none absolute right-2",
|
|
85
|
+
children: /* @__PURE__ */ t(a.ItemIndicator, { children: /* @__PURE__ */ t(r, {}) })
|
|
86
|
+
}), o]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function _({ className: i, children: o, inset: s, ...c }) {
|
|
90
|
+
return /* @__PURE__ */ n(a.RadioItem, {
|
|
91
|
+
"data-slot": "context-menu-radio-item",
|
|
92
|
+
"data-inset": s,
|
|
93
|
+
className: e("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 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", i),
|
|
94
|
+
...c,
|
|
95
|
+
children: [/* @__PURE__ */ t("span", {
|
|
96
|
+
className: "pointer-events-none absolute right-2",
|
|
97
|
+
children: /* @__PURE__ */ t(a.ItemIndicator, { children: /* @__PURE__ */ t(r, {}) })
|
|
98
|
+
}), o]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function v({ className: n, inset: r, ...i }) {
|
|
102
|
+
return /* @__PURE__ */ t(a.Label, {
|
|
103
|
+
"data-slot": "context-menu-label",
|
|
104
|
+
"data-inset": r,
|
|
105
|
+
className: e("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", n),
|
|
106
|
+
...i
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function y({ className: n, ...r }) {
|
|
110
|
+
return /* @__PURE__ */ t(a.Separator, {
|
|
111
|
+
"data-slot": "context-menu-separator",
|
|
112
|
+
className: e("-mx-1 my-1 h-px bg-border", n),
|
|
113
|
+
...r
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function b({ className: n, ...r }) {
|
|
117
|
+
return /* @__PURE__ */ t("span", {
|
|
118
|
+
"data-slot": "context-menu-shortcut",
|
|
119
|
+
className: e("ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground", n),
|
|
120
|
+
...r
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
export { o as ContextMenu, g as ContextMenuCheckboxItem, f as ContextMenuContent, c as ContextMenuGroup, p as ContextMenuItem, v as ContextMenuLabel, l as ContextMenuPortal, d as ContextMenuRadioGroup, _ as ContextMenuRadioItem, y as ContextMenuSeparator, b as ContextMenuShortcut, u as ContextMenuSub, h as ContextMenuSubContent, m as ContextMenuSubTrigger, s as ContextMenuTrigger };
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":[],"sources":["../../src/elements/context-menu.tsx"],"sourcesContent":["'use client';\n\nimport * as ContextMenuPrimitive from '@radix-ui/react-context-menu';\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger\n data-slot=\"context-menu-trigger\"\n className={cn('select-none', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n 'z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-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 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 data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/context-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 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 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"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 data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"cn-rtl-flip ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n 'z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg 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 data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"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 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\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(\n \"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 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\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"],"mappings":";;;;;;AAOA,SAAS,EAAY,EAAE,GAAG,KAAiE;AACzF,QAAO,kBAAC,EAAqB,MAAtB;EAA2B,aAAU;EAAe,GAAI;EAAS,CAAA;;AAG1E,SAAS,EAAmB,EAAE,cAAW,GAAG,KAAoE;AAC9G,QACE,kBAAC,EAAqB,SAAtB;EACE,aAAU;EACV,WAAW,EAAG,eAAe,EAAU;EACvC,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAiB,EAAE,GAAG,KAAkE;AAC/F,QAAO,kBAAC,E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A,EACD;EACQ;EACT,GAAI;YARN,CAUE,kBAAC,QAAD;GAAM,WAAU;aACd,kBAAC,EAAqB,eAAtB,EAAA,UACE,kBAAC,GAAD,EAAa,CAAA,EACsB,CAAA;GAChC,CAAA,EACN,EACiC;;;AAIxC,SAAS,EAAqB,EAC5B,cACA,aACA,UACA,GAAG,KAGF;AACD,QACE,kBAAC,EAAqB,WAAtB;EACE,aAAU;EACV,cAAY;EACZ,WAAW,EACT,8TACA,EACD;EACD,GAAI;YAPN,CASE,kBAAC,QAAD;GAAM,WAAU;aACd,kBAAC,EAAqB,eAAtB,EAAA,UACE,kBAAC,GAAD,EAAa,CAAA,EACsB,CAAA;GAChC,CAAA,EACN,EAC8B;;;AAIrC,SAAS,EAAiB,EACxB,cACA,UACA,GAAG,KAGF;AACD,QACE,kBAAC,EAAqB,OAAtB;EACE,aAAU;EACV,cAAY;EACZ,WAAW,EAAG,yEAAyE,EAAU;EACjG,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAqB,EAAE,cAAW,GAAG,KAAsE;AAClH,QACE,kBAAC,EAAqB,WAAtB;EACE,aAAU;EACV,WAAW,EAAG,6BAA6B,EAAU;EACrD,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAoB,EAAE,cAAW,GAAG,KAAuC;AAClF,QACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EACT,8GACA,EACD;EACD,GAAI;EACJ,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ContextMenu } from './context-menu';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
tags: string[];
|
|
5
|
+
component: typeof ContextMenu;
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export declare function Default(): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function Checkboxes(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function RadioGroup(): import("react/jsx-runtime").JSX.Element;
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.cjs","names":[],"sources":["../../src/elements/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"yTAQA,SAAS,EAAO,CAAE,GAAG,GAA4D,CAC/E,
|
|
1
|
+
{"version":3,"file":"dialog.cjs","names":[],"sources":["../../src/elements/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"yTAQA,SAAS,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAAA,EAAA,KAAC,EAAgB,KAAjB,CAAsB,YAAU,SAAS,G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,YAAU,gBACV,UAAW,EAAA,GAAG,yDAA0D,EAAU,CAClF,GAAI,EACJ,CAAA,CAIN,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OACE,EAAA,EAAA,KAAC,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EAAA,GAAG,qCAAsC,EAAU,CAC9D,GAAI,EACJ,CAAA,CAIN,SAAS,EAAkB,CAAE,YAAW,GAAG,GAAmE,CAC5G,OACE,EAAA,EAAA,KAAC,EAAgB,YAAjB,CACE,YAAU,qBACV,UAAW,EAAA,GAAG,gCAAiC,EAAU,CACzD,GAAI,EACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.cjs","names":[],"sources":["../../src/elements/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nexport type { DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":"0RASA,SAAS,EAAa,CAAE,GAAG,GAAkE,CAC3F,OAAA,EAAA,EAAA,KAAQ,EAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAI,EAAS,CAAA,CAG5E,SAAS,EAAmB,CAAE,GAAG,GAAoE,CACnG,OAAA,EAAA,EAAA,KAAQ,EAAsB,OAAvB,CAA8B,YAAU,uBAAuB,GAAI,EAAS,CAAA,CAGrF,SAAS,EAAoB,CAAE,GAAG,GAAqE,CACrG,OAAA,EAAA,EAAA,KAAQ,EAAsB,QAAvB,CAA+B,YAAU,wBAAwB,GAAI,EAAS,CAAA,CAGvF,SAAS,EAAoB,CAC3B,YACA,aAAa,EACb,GAAG,GAC0D,CAC7D,OAAA,EAAA,EAAA,KACG,EAAsB,OAAvB,CAAA,UAAA,EAAA,EAAA,KACG,EAAsB,QAAvB,CACE,YAAU,wBACE,aACZ,UAAW,EAAA,GACT,yjBACA,EACD,CACD,GAAI,EACJ,CAAA,CAC2B,CAAA,CAInC,SAAS,EAAkB,CAAE,GAAG,GAAmE,CACjG,OAAA,EAAA,EAAA,KAAQ,EAAsB,MAAvB,CAA6B,YAAU,sBAAsB,GAAI,EAAS,CAAA,CAGnF,SAAS,EAAiB,CACxB,YACA,QACA,UAAU,UACV,GAAG,GAIF,C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,CAAA,CAIN,SAAS,EAAqB,CAAE,YAAW,GAAG,GAAuC,CACnF,OAAA,EAAA,EAAA,KACG,OAAD,CACE,YAAU,yBACV,UAAW,EAAA,GAAG,wDAAyD,EAAU,CACjF,GAAI,EACJ,CAAA,CAIN,SAAS,EAAgB,CAAE,GAAG,GAAiE,CAC7F,OAAA,EAAA,EAAA,KAAQ,EAAsB,IAAvB,CAA2B,YAAU,oBAAoB,GAAI,EAAS,CAAA,CAG/E,SAAS,EAAuB,CAC9B,YACA,QACA,WACA,GAAG,GAGF,CACD,OAAA,EAAA,EAAA,MACG,EAAsB,WAAvB,CACE,YAAU,4BACV,aAAY,EACZ,UAAW,EAAA,GACT,iOACA,EACD,CACD,GAAI,WAPN,CASG,GAAA,EAAA,EAAA,KACA,EAAA,iBAAD,CAAkB,UAAU,iBAAmB,CAAA,CACd,GAIvC,SAAS,EAAuB,CAC9B,YACA,GAAG,GAC6D,CAChE,OAAA,EAAA,EAAA,KACG,EAAsB,WAAvB,CACE,YAAU,4BACV,UAAW,EAAA,GACT,gfACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.cjs","names":[],"sources":["../../src/elements/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nexport type { DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":"0RASA,SAAS,EAAa,CAAE,GAAG,GAAkE,CAC3F,OAAO,EAAA,EAAA,KAAC,EAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAI,EAAS,CAAA,CAG5E,SAAS,EAAmB,CAAE,GAAG,GAAoE,CACnG,OAAO,EAAA,EAAA,KAAC,EAAsB,OAAvB,CAA8B,YAAU,uBAAuB,GAAI,EAAS,CAAA,CAGrF,SAAS,EAAoB,CAAE,GAAG,GAAqE,CACrG,OAAO,EAAA,EAAA,KAAC,EAAsB,QAAvB,CAA+B,YAAU,wBAAwB,GAAI,EAAS,CAAA,CAGvF,SAAS,EAAoB,CAC3B,YACA,aAAa,EACb,GAAG,GAC0D,CAC7D,OACE,EAAA,EAAA,KAAC,EAAsB,OAAvB,CAAA,UACE,EAAA,EAAA,KAAC,EAAsB,QAAvB,CACE,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,QACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,KAAC,EAAsB,MAAvB,CACE,YAAU,sBACV,aAAY,EACZ,UAAW,EAAA,GAAG,oDAAqD,EAAU,CAC7E,GAAI,EACJ,CAAA,CAIN,SAAS,EAAsB,CAAE,YAAW,GAAG,GAAuE,CACpH,OACE,EAAA,EAAA,KAAC,EAAsB,UAAvB,CACE,YAAU,0BACV,UAAW,EAAA,GAAG,4BAA6B,EAAU,CACrD,GAAI,EACJ,CAAA,CAIN,SAAS,EAAqB,CAAE,YAAW,GAAG,GAAuC,CACnF,OACE,EAAA,EAAA,KAAC,OAAD,CACE,YAAU,yBACV,UAAW,EAAA,GAAG,wDAAyD,EAAU,CACjF,GAAI,EACJ,CAAA,CAIN,SAAS,EAAgB,CAAE,GAAG,GAAiE,CAC7F,OAAO,EAAA,EAAA,KAAC,EAAsB,IAAvB,CAA2B,YAAU,oBAAoB,GAAI,EAAS,CAAA,CAG/E,SAAS,EAAuB,CAC9B,YACA,QACA,WACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,MAAC,EAAsB,WAAvB,CACE,YAAU,4BACV,aAAY,EACZ,UAAW,EAAA,GACT,iOACA,EACD,CACD,GAAI,WAPN,CASG,GACD,EAAA,EAAA,KAAC,EAAA,iBAAD,CAAkB,UAAU,iBAAmB,CAAA,CACd,GAIvC,SAAS,EAAuB,CAC9B,YACA,GAAG,GAC6D,CAChE,OACE,EAAA,EAAA,KAAC,EAAsB,WAAvB,CACE,YAAU,4BACV,UAAW,EAAA,GACT,gfACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.cjs","names":[],"sources":["../../src/elements/form.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext, useId, useMemo } from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n FormProvider,\n useFormContext,\n useFormState,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from 'react-hook-form';\n\nimport { cn } from '@/lib/utils';\nimport { Label } from '@/elements/label';\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 = createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n const value = useMemo(() => ({ name: props.name }), [props.name]);\n\n return (\n <FormFieldContext.Provider value={value}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\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\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = useId();\n const value = useMemo(() => ({ id }), [id]);\n\n return (\n <FormItemContext.Provider value={value}>\n <div data-slot=\"form-item\" className={cn('grid gap-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn('data-[error=true]:text-destructive', className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : props.children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p data-slot=\"form-message\" id={formMessageId} className={cn('text-destructive text-sm', className)} {...props}>\n {body}\n </p>\n );\n}\n\nexport { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };\n"],"mappings":"uWAkBA,IAAM,EAAO,EAAA,aASP,GAAA,EAAA,EAAA,eAAwD,EAAE,CAA0B,CAMpF,GAAA,EAAA,EAAA,eAAsD,EAAE,CAAyB,CAEjF,GAGJ,CACA,GAAG,KACuC,CAC1C,IAAM,GAAA,EAAA,EAAA,cAAuB,CAAE,KAAM,EAAM,KAAM,EAAG,CAAC,EAAM,KAAK,CAAC,CAEjE,
|
|
1
|
+
{"version":3,"file":"form.cjs","names":[],"sources":["../../src/elements/form.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext, useId, useMemo } from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n FormProvider,\n useFormContext,\n useFormState,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from 'react-hook-form';\n\nimport { cn } from '@/lib/utils';\nimport { Label } from '@/elements/label';\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 = createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n const value = useMemo(() => ({ name: props.name }), [props.name]);\n\n return (\n <FormFieldContext.Provider value={value}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\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\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = useId();\n const value = useMemo(() => ({ id }), [id]);\n\n return (\n <FormItemContext.Provider value={value}>\n <div data-slot=\"form-item\" className={cn('grid gap-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn('data-[error=true]:text-destructive', className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : props.children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p data-slot=\"form-message\" id={formMessageId} className={cn('text-destructive text-sm', className)} {...props}>\n {body}\n </p>\n );\n}\n\nexport { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };\n"],"mappings":"uWAkBA,IAAM,EAAO,EAAA,aASP,GAAA,EAAA,EAAA,eAAwD,EAAE,CAA0B,CAMpF,GAAA,EAAA,EAAA,eAAsD,EAAE,CAAyB,CAEjF,GAGJ,CACA,GAAG,KACuC,CAC1C,IAAM,GAAA,EAAA,EAAA,cAAuB,CAAE,KAAM,EAAM,KAAM,EAAG,CAAC,EAAM,KAAK,CAAC,CAEjE,OACE,EAAA,EAAA,KAAC,EAAiB,SAAlB,CAAkC,kBAChC,EAAA,EAAA,KAAC,EAAA,WAAD,CAAY,GAAI,EAAS,CAAA,CACC,CAAA,EAI1B,MAAqB,CACzB,IAAM,GAAA,EAAA,EAAA,YAA0B,EAAiB,CAC3C,GAAA,EAAA,EAAA,YAAyB,EAAgB,CACzC,CAAE,kBAAA,EAAA,EAAA,iBAAkC,CACpC,GAAA,EAAA,EAAA,cAAyB,CAAE,KAAM,EAAa,KAAM,CAAC,CACrD,EAAa,EAAc,EAAa,KAAM,EAAU,CAE9D,GAAI,CAAC,EACH,MAAU,MAAM,iDAAiD,CAGnE,GAAM,CAAE,MAAO,EAEf,MAAO,CACL,KACA,KAAM,EAAa,KACnB,WAAY,GAAG,EAAG,YAClB,kBAAmB,GAAG,E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,YAAU,eAAe,GAAI,EAAe,UAAW,EAAA,GAAG,2BAA4B,EAAU,CAAE,GAAI,WACtG,EACC,CAAA,CANG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.cjs","names":[],"sources":["../../src/elements/input.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"],"mappings":"uLAEA,SAAS,EAAM,CAAE,YAAW,OAAM,GAAG,GAAwC,CAC3E,
|
|
1
|
+
{"version":3,"file":"input.cjs","names":[],"sources":["../../src/elements/input.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"],"mappings":"uLAEA,SAAS,EAAM,CAAE,YAAW,OAAM,GAAG,GAAwC,CAC3E,OACE,EAAA,EAAA,KAAC,QAAD,CACQ,OACN,YAAU,QACV,UAAW,EAAA,GACT,kcACA,gFACA,yGACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.cjs","names":[],"sources":["../../src/elements/label.tsx"],"sourcesContent":["'use client';\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '@/lib/utils';\n\nfunction Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":"wPAMA,SAAS,EAAM,CAAE,YAAW,GAAG,GAA2D,CACxF,
|
|
1
|
+
{"version":3,"file":"label.cjs","names":[],"sources":["../../src/elements/label.tsx"],"sourcesContent":["'use client';\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '@/lib/utils';\n\nfunction Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":"wPAMA,SAAS,EAAM,CAAE,YAAW,GAAG,GAA2D,CACxF,OACE,EAAA,EAAA,KAAC,EAAe,KAAhB,CACE,YAAU,QACV,UAAW,EAAA,GACT,sNACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.cjs","names":[],"sources":["../../src/elements/link.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst linkStyles = cva(\n 'inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline transition-colors outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm cursor-pointer',\n {\n variants: {\n variant: {\n default: '',\n external: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nexport type LinkVariantProps = VariantProps<typeof linkStyles>;\n\ntype LinkComponent = React.ElementType;\n\nlet configuredLinkComponent: LinkComponent | null = null;\n\n/**\n * Set a custom component to be used by `RouterLink` (e.g. your router's Link component).\n *\n * @example\n * import { setLinkComponent } from '@kubetail/ui/elements/link';\n * import { Link } from 'react-router-dom';\n * setLinkComponent(Link);\n */\nfunction setLinkComponent(component: LinkComponent) {\n configuredLinkComponent = component;\n}\n\n/**\n * Get the currently configured link component.\n */\nfunction getLinkComponent(): LinkComponent | null {\n return configuredLinkComponent;\n}\n\ntype LinkProps = React.ComponentProps<'a'> &\n LinkVariantProps & {\n asChild?: boolean;\n };\n\n/**\n * `Link` renders a styled anchor element.\n *\n * Supports `asChild` via Radix UI Slot for composition with custom components.\n *\n * @param props.variant - \"default\" | \"external\" (adds target=\"_blank\" and rel=\"noopener noreferrer\")\n * @param props.asChild - render as child element via Radix Slot\n */\nfunction Link({ className, variant, asChild = false, ...props }: LinkProps) {\n const Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n data-slot=\"link\"\n className={cn(linkStyles({ variant, className }))}\n {...(variant === 'external' && !asChild ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n {...props}\n />\n );\n}\n\ntype RouterLinkProps = Omit<LinkProps, 'asChild'> & Record<string, unknown>;\n\n/**\n * `RouterLink` renders using the component set via `setLinkComponent()`,\n * falling back to a plain `<a>` tag if none has been configured.\n *\n * @example\n * // In your app entry:\n * import { setLinkComponent } from '@kubetail/ui/elements/link';\n * import { Link as RRLink } from 'react-router-dom';\n * setLinkComponent(RRLink);\n *\n * // Then use RouterLink anywhere:\n * <RouterLink to=\"/dashboard\">Dashboard</RouterLink>\n */\nfunction RouterLink({ className, variant, ...props }: RouterLinkProps) {\n const Comp = configuredLinkComponent || 'a';\n\n return (\n <Comp\n data-slot=\"link\"\n className={cn(linkStyles({ variant, className }))}\n {...(variant === 'external' && Comp === 'a' ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n {...props}\n />\n );\n}\n\nexport { Link, RouterLink, linkStyles, setLinkComponent, getLinkComponent };\n"],"mappings":"+PAKA,IAAM,GAAA,EAAA,EAAA,KACJ,8LACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,GACT,SAAU,GACX,CACF,CACD,gBAAiB,CACf,QAAS,UACV,CACF,CACF,CAMG,EAAgD,KAUpD,SAAS,EAAiB,EAA0B,CAClD,EAA0B,EAM5B,SAAS,GAAyC,CAChD,OAAO,EAgBT,SAAS,EAAK,CAAE,YAAW,UAAS,UAAU,GAAO,GAAG,GAAoB,CAG1E,
|
|
1
|
+
{"version":3,"file":"link.cjs","names":[],"sources":["../../src/elements/link.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst linkStyles = cva(\n 'inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline transition-colors outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm cursor-pointer',\n {\n variants: {\n variant: {\n default: '',\n external: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nexport type LinkVariantProps = VariantProps<typeof linkStyles>;\n\ntype LinkComponent = React.ElementType;\n\nlet configuredLinkComponent: LinkComponent | null = null;\n\n/**\n * Set a custom component to be used by `RouterLink` (e.g. your router's Link component).\n *\n * @example\n * import { setLinkComponent } from '@kubetail/ui/elements/link';\n * import { Link } from 'react-router-dom';\n * setLinkComponent(Link);\n */\nfunction setLinkComponent(component: LinkComponent) {\n configuredLinkComponent = component;\n}\n\n/**\n * Get the currently configured link component.\n */\nfunction getLinkComponent(): LinkComponent | null {\n return configuredLinkComponent;\n}\n\ntype LinkProps = React.ComponentProps<'a'> &\n LinkVariantProps & {\n asChild?: boolean;\n };\n\n/**\n * `Link` renders a styled anchor element.\n *\n * Supports `asChild` via Radix UI Slot for composition with custom components.\n *\n * @param props.variant - \"default\" | \"external\" (adds target=\"_blank\" and rel=\"noopener noreferrer\")\n * @param props.asChild - render as child element via Radix Slot\n */\nfunction Link({ className, variant, asChild = false, ...props }: LinkProps) {\n const Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n data-slot=\"link\"\n className={cn(linkStyles({ variant, className }))}\n {...(variant === 'external' && !asChild ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n {...props}\n />\n );\n}\n\ntype RouterLinkProps = Omit<LinkProps, 'asChild'> & Record<string, unknown>;\n\n/**\n * `RouterLink` renders using the component set via `setLinkComponent()`,\n * falling back to a plain `<a>` tag if none has been configured.\n *\n * @example\n * // In your app entry:\n * import { setLinkComponent } from '@kubetail/ui/elements/link';\n * import { Link as RRLink } from 'react-router-dom';\n * setLinkComponent(RRLink);\n *\n * // Then use RouterLink anywhere:\n * <RouterLink to=\"/dashboard\">Dashboard</RouterLink>\n */\nfunction RouterLink({ className, variant, ...props }: RouterLinkProps) {\n const Comp = configuredLinkComponent || 'a';\n\n return (\n <Comp\n data-slot=\"link\"\n className={cn(linkStyles({ variant, className }))}\n {...(variant === 'external' && Comp === 'a' ? { target: '_blank', rel: 'noopener noreferrer' } : {})}\n {...props}\n />\n );\n}\n\nexport { Link, RouterLink, linkStyles, setLinkComponent, getLinkComponent };\n"],"mappings":"+PAKA,IAAM,GAAA,EAAA,EAAA,KACJ,8LACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,GACT,SAAU,GACX,CACF,CACD,gBAAiB,CACf,QAAS,UACV,CACF,CACF,CAMG,EAAgD,KAUpD,SAAS,EAAiB,EAA0B,CAClD,EAA0B,EAM5B,SAAS,GAAyC,CAChD,OAAO,EAgBT,SAAS,EAAK,CAAE,YAAW,UAAS,UAAU,GAAO,GAAG,GAAoB,CAG1E,OACE,EAAA,EAAA,KAHW,EAAU,EAAA,KAAO,IAG5B,CACE,YAAU,OACV,UAAW,EAAA,GAAG,EAAW,CAAE,UAAS,YAAW,CAAC,CAAC,CACjD,GAAK,IAAY,YAAc,CAAC,EAAU,CAAE,OAAQ,SAAU,IAAK,sBAAuB,CAAG,EAAE,CAC/F,GAAI,EACJ,CAAA,CAmBN,SAAS,EAAW,CAAE,YAAW,UAAS,GAAG,GAA0B,CACrE,IAAM,EAAO,GAA2B,IAExC,OACE,EAAA,EAAA,KAAC,EAAD,CACE,YAAU,OACV,UAAW,EAAA,GAAG,EAAW,CAAE,UAAS,YAAW,CAAC,CAAC,CACjD,GAAK,IAAY,YAAc,IAAS,IAAM,CAAE,OAAQ,SAAU,IAAK,sBAAuB,CAAG,EAAE,CACnG,GAAI,EACJ,CAAA"}
|