@codefast/ui 0.0.56 → 0.0.58
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/chunk-426OXZ4E.js +2 -0
- package/dist/chunk-426OXZ4E.js.map +1 -0
- package/dist/chunk-IUT4SHXE.mjs +2 -0
- package/dist/chunk-IUT4SHXE.mjs.map +1 -0
- package/dist/react/command.js +1 -1
- package/dist/react/command.mjs +1 -1
- package/dist/react/dialog.d.mts +3 -1
- package/dist/react/dialog.d.ts +3 -1
- package/dist/react/dialog.js +1 -1
- package/dist/react/dialog.mjs +1 -1
- package/dist/react/scroll-area.d.mts +63 -2
- package/dist/react/scroll-area.d.ts +63 -2
- package/dist/react/scroll-area.js +1 -1
- package/dist/react/scroll-area.js.map +1 -1
- package/dist/react/scroll-area.mjs +1 -1
- package/dist/react/scroll-area.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/src/react/dialog.tsx +40 -17
- package/src/react/scroll-area.tsx +75 -25
- package/dist/chunk-LJSD47ZL.js +0 -2
- package/dist/chunk-LJSD47ZL.js.map +0 -1
- package/dist/chunk-Y2GMHG3Z.mjs +0 -2
- package/dist/chunk-Y2GMHG3Z.mjs.map +0 -1
|
@@ -2,26 +2,74 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
5
|
-
import {
|
|
5
|
+
import { createContextScope, type Scope } from '@radix-ui/react-context';
|
|
6
|
+
import { type VariantProps } from 'cva';
|
|
7
|
+
import { cn, cva } from '../lib/utils';
|
|
6
8
|
|
|
7
9
|
/* -----------------------------------------------------------------------------
|
|
8
10
|
* Component: ScrollArea
|
|
9
11
|
* -------------------------------------------------------------------------- */
|
|
10
12
|
|
|
13
|
+
const SCROLL_AREA_NAME = 'ScrollArea';
|
|
14
|
+
|
|
15
|
+
type ScopedProps<P> = P & { __scopeScrollArea?: Scope };
|
|
16
|
+
|
|
17
|
+
const [createCarouselContext] = createContextScope(SCROLL_AREA_NAME);
|
|
18
|
+
|
|
19
|
+
type ScrollAreaContextValue = Pick<ScrollAreaScrollbarVariantsProps, 'size'>;
|
|
20
|
+
|
|
21
|
+
const [CarouselProvider, useCarouselContext] = createCarouselContext<ScrollAreaContextValue>(SCROLL_AREA_NAME);
|
|
22
|
+
|
|
11
23
|
type ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Root>;
|
|
12
|
-
type ScrollAreaProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root
|
|
24
|
+
type ScrollAreaProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & ScrollAreaContextValue;
|
|
13
25
|
|
|
14
|
-
const ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>(
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
const ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>(
|
|
27
|
+
({ __scopeScrollArea, children, className, size = '2', ...props }: ScopedProps<ScrollAreaProps>, ref) => (
|
|
28
|
+
<CarouselProvider scope={__scopeScrollArea} size={size}>
|
|
29
|
+
<ScrollAreaPrimitive.Root ref={ref} className={cn('relative overflow-hidden', className)} {...props}>
|
|
30
|
+
<ScrollAreaPrimitive.Viewport className="size-full rounded-[inherit] [&>*]:min-h-full">
|
|
31
|
+
{children}
|
|
32
|
+
</ScrollAreaPrimitive.Viewport>
|
|
33
|
+
<ScrollAreaScrollbar orientation="vertical" />
|
|
34
|
+
<ScrollAreaScrollbar orientation="horizontal" />
|
|
35
|
+
<ScrollAreaPrimitive.Corner />
|
|
36
|
+
</ScrollAreaPrimitive.Root>
|
|
37
|
+
</CarouselProvider>
|
|
38
|
+
),
|
|
39
|
+
);
|
|
22
40
|
|
|
23
41
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
24
42
|
|
|
43
|
+
/* -----------------------------------------------------------------------------
|
|
44
|
+
* Variant: ScrollAreaScrollbar
|
|
45
|
+
* -------------------------------------------------------------------------- */
|
|
46
|
+
|
|
47
|
+
const scrollAreaScrollbarVariants = cva({
|
|
48
|
+
base: 'flex touch-none select-none transition p-px',
|
|
49
|
+
variants: {
|
|
50
|
+
orientation: {
|
|
51
|
+
vertical: 'h-full flex-row border-l border-l-transparent',
|
|
52
|
+
horizontal: 'w-full flex-col border-t border-t-transparent',
|
|
53
|
+
},
|
|
54
|
+
size: {
|
|
55
|
+
none: '',
|
|
56
|
+
'1': '',
|
|
57
|
+
'2': '',
|
|
58
|
+
'3': '',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
compoundVariants: [
|
|
62
|
+
{ orientation: 'vertical', size: '1', className: 'w-1.5' },
|
|
63
|
+
{ orientation: 'vertical', size: '2', className: 'w-2' },
|
|
64
|
+
{ orientation: 'vertical', size: '3', className: 'w-2.5' },
|
|
65
|
+
{ orientation: 'horizontal', size: '1', className: 'h-1.5' },
|
|
66
|
+
{ orientation: 'horizontal', size: '2', className: 'h-2' },
|
|
67
|
+
{ orientation: 'horizontal', size: '3', className: 'h-2.5' },
|
|
68
|
+
],
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
type ScrollAreaScrollbarVariantsProps = VariantProps<typeof scrollAreaScrollbarVariants>;
|
|
72
|
+
|
|
25
73
|
/* -----------------------------------------------------------------------------
|
|
26
74
|
* Component: ScrollAreaScrollbar
|
|
27
75
|
* -------------------------------------------------------------------------- */
|
|
@@ -30,21 +78,23 @@ type ScrollAreaScrollbarElement = React.ElementRef<typeof ScrollAreaPrimitive.Sc
|
|
|
30
78
|
type ScrollAreaScrollbarProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Scrollbar>;
|
|
31
79
|
|
|
32
80
|
const ScrollAreaScrollbar = React.forwardRef<ScrollAreaScrollbarElement, ScrollAreaScrollbarProps>(
|
|
33
|
-
(
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
81
|
+
(
|
|
82
|
+
{ __scopeScrollArea, className, orientation = 'vertical', ...props }: ScopedProps<ScrollAreaScrollbarProps>,
|
|
83
|
+
ref,
|
|
84
|
+
) => {
|
|
85
|
+
const { size } = useCarouselContext(SCROLL_AREA_NAME, __scopeScrollArea);
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<ScrollAreaPrimitive.Scrollbar
|
|
89
|
+
ref={ref}
|
|
90
|
+
orientation={orientation}
|
|
91
|
+
className={scrollAreaScrollbarVariants({ orientation, size, className })}
|
|
92
|
+
{...props}
|
|
93
|
+
>
|
|
94
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="bg-border relative flex-1 rounded-full" />
|
|
95
|
+
</ScrollAreaPrimitive.Scrollbar>
|
|
96
|
+
);
|
|
97
|
+
},
|
|
48
98
|
);
|
|
49
99
|
|
|
50
100
|
ScrollAreaScrollbar.displayName = ScrollAreaPrimitive.Scrollbar.displayName;
|
package/dist/chunk-LJSD47ZL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkHQ4AUOQMjs = require('./chunk-HQ4AUOQM.js');var _react = require('react'); var s = _interopRequireWildcard(_react);var _reactdialog = require('@radix-ui/react-dialog'); var e = _interopRequireWildcard(_reactdialog);var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');var f=e.Root,P= exports.b =e.Trigger,y= exports.c =e.Close,m= exports.d =s.forwardRef(({children:t,className:o,...l},n)=>_jsxruntime.jsxs.call(void 0, e.Portal,{children:[_jsxruntime.jsx.call(void 0, e.Overlay,{className:"data-[state=open]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 bg-black/80"}),_jsxruntime.jsxs.call(void 0, e.Content,{ref:n,className:_chunkHQ4AUOQMjs.b.call(void 0, "bg-background data-[state=open]:animate-in data-[state=open]:animate-duration-200 data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",o),...l,children:[t,_jsxruntime.jsxs.call(void 0, e.Close,{className:"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none",children:[_jsxruntime.jsx.call(void 0, _reacticons.Cross2Icon,{className:"size-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=e.Content.displayName;function u({className:t,...o}){return _jsxruntime.jsx.call(void 0, "div",{className:_chunkHQ4AUOQMjs.b.call(void 0, "flex flex-col space-y-1.5 text-center sm:text-left",t),...o})}function v({className:t,...o}){return _jsxruntime.jsx.call(void 0, "div",{className:_chunkHQ4AUOQMjs.b.call(void 0, "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...o})}var g=s.forwardRef(({className:t,...o},l)=>_jsxruntime.jsx.call(void 0, e.Title,{ref:l,className:_chunkHQ4AUOQMjs.b.call(void 0, "text-lg font-semibold leading-none tracking-tight",t),...o}));g.displayName=e.Title.displayName;var D=s.forwardRef(({className:t,...o},l)=>_jsxruntime.jsx.call(void 0, e.Description,{ref:l,className:_chunkHQ4AUOQMjs.b.call(void 0, "text-muted-foreground text-sm",t),...o}));D.displayName=e.Description.displayName;exports.a = f; exports.b = P; exports.c = y; exports.d = m; exports.e = u; exports.f = v; exports.g = g; exports.h = D;
|
|
2
|
-
//# sourceMappingURL=chunk-LJSD47ZL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/dialog.tsx"],"names":["React","DialogPrimitive","Cross2Icon","jsx","jsxs","Dialog","DialogTrigger","DialogClose","DialogContent","children","className","props","ref","cn","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":"wCAEA,UAAYA,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBAkCrB,cAAAC,EAUE,QAAAC,MAVF,oBA1BN,IAAMC,EAAyB,OAOzBC,EAAgC,UAOhCC,EAA8B,QAS9BC,EAAsB,aAC1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAClCR,EAAiB,SAAhB,CACC,UAAAD,EAAiB,UAAhB,CAAwB,UAAU,+IAA+I,EAClLC,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,yhBACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDL,EAAiB,QAAhB,CAAsB,UAAU,0PAC/B,UAAAD,EAACD,EAAA,CAAW,UAAU,SAAS,EAC/BC,EAAC,QAAK,UAAU,UAAU,iBAAK,GACjC,GACF,GACF,CAEJ,EAEAK,EAAc,YAA8B,UAAQ,YAQpD,SAASM,EAAa,CAAE,UAAAJ,EAAW,GAAGC,CAAM,EAAyC,CACnF,OAAOR,EAAC,OAAI,UAAWU,EAAG,qDAAsDH,CAAS,EAAI,GAAGC,EAAO,CACzG,CAQA,SAASI,EAAa,CAAE,UAAAL,EAAW,GAAGC,CAAM,EAAyC,CACnF,OAAOR,EAAC,OAAI,UAAWU,EAAG,gEAAiEH,CAAS,EAAI,GAAGC,EAAO,CACpH,CASA,IAAMK,EAAoB,aAAiD,CAAC,CAAE,UAAAN,EAAW,GAAGC,CAAM,EAAGC,IACnGT,EAAiB,QAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,oDAAqDH,CAAS,EAC3E,GAAGC,EACN,CACD,EAEDK,EAAY,YAA8B,QAAM,YAShD,IAAMC,EAA0B,aAC9B,CAAC,CAAE,UAAAP,EAAW,GAAGC,CAAM,EAAGC,IACxBT,EAAiB,cAAhB,CAA4B,IAAKS,EAAK,UAAWC,EAAG,gCAAiCH,CAAS,EAAI,GAAGC,EAAO,CAEjH,EAEAM,EAAkB,YAA8B,cAAY","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross2Icon } from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Dialog\n * -------------------------------------------------------------------------- */\n\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>;\nconst Dialog = DialogPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTrigger\n * -------------------------------------------------------------------------- */\n\ntype DialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\nconst DialogTrigger = DialogPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogClose\n * -------------------------------------------------------------------------- */\n\ntype DialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;\nconst DialogClose = DialogPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogContent\n * -------------------------------------------------------------------------- */\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ntype DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ children, className, ...props }, ref) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"data-[state=open]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 bg-black/80\" />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=open]:animate-duration-200 data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n ),\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogHeader\n * -------------------------------------------------------------------------- */\n\ntype DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element {\n return <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogFooter\n * -------------------------------------------------------------------------- */\n\ntype DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element {\n return <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTitle\n * -------------------------------------------------------------------------- */\n\ntype DialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;\ntype DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\n\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogDescription\n * -------------------------------------------------------------------------- */\n\ntype DialogDescriptionElement = React.ElementRef<typeof DialogPrimitive.Description>;\ntype DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;\n\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n ),\n);\n\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Dialog,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n type DialogProps,\n type DialogTriggerProps,\n type DialogCloseProps,\n type DialogContentProps,\n type DialogHeaderProps,\n type DialogFooterProps,\n type DialogTitleProps,\n type DialogDescriptionProps,\n};\n"]}
|
package/dist/chunk-Y2GMHG3Z.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./chunk-LEUB3C3L.mjs";import*as s from"react";import*as e from"@radix-ui/react-dialog";import{Cross2Icon as p}from"@radix-ui/react-icons";import{jsx as i,jsxs as r}from"react/jsx-runtime";var f=e.Root,P=e.Trigger,y=e.Close,m=s.forwardRef(({children:t,className:o,...l},n)=>r(e.Portal,{children:[i(e.Overlay,{className:"data-[state=open]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 bg-black/80"}),r(e.Content,{ref:n,className:a("bg-background data-[state=open]:animate-in data-[state=open]:animate-duration-200 data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",o),...l,children:[t,r(e.Close,{className:"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none",children:[i(p,{className:"size-4"}),i("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=e.Content.displayName;function u({className:t,...o}){return i("div",{className:a("flex flex-col space-y-1.5 text-center sm:text-left",t),...o})}function v({className:t,...o}){return i("div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...o})}var g=s.forwardRef(({className:t,...o},l)=>i(e.Title,{ref:l,className:a("text-lg font-semibold leading-none tracking-tight",t),...o}));g.displayName=e.Title.displayName;var D=s.forwardRef(({className:t,...o},l)=>i(e.Description,{ref:l,className:a("text-muted-foreground text-sm",t),...o}));D.displayName=e.Description.displayName;export{f as a,P as b,y as c,m as d,u as e,v as f,g,D as h};
|
|
2
|
-
//# sourceMappingURL=chunk-Y2GMHG3Z.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross2Icon } from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Dialog\n * -------------------------------------------------------------------------- */\n\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>;\nconst Dialog = DialogPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTrigger\n * -------------------------------------------------------------------------- */\n\ntype DialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\nconst DialogTrigger = DialogPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogClose\n * -------------------------------------------------------------------------- */\n\ntype DialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;\nconst DialogClose = DialogPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogContent\n * -------------------------------------------------------------------------- */\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ntype DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ children, className, ...props }, ref) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"data-[state=open]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 bg-black/80\" />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=open]:animate-duration-200 data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n ),\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogHeader\n * -------------------------------------------------------------------------- */\n\ntype DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element {\n return <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogFooter\n * -------------------------------------------------------------------------- */\n\ntype DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element {\n return <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTitle\n * -------------------------------------------------------------------------- */\n\ntype DialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;\ntype DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\n\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogDescription\n * -------------------------------------------------------------------------- */\n\ntype DialogDescriptionElement = React.ElementRef<typeof DialogPrimitive.Description>;\ntype DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;\n\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n ),\n);\n\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Dialog,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n type DialogProps,\n type DialogTriggerProps,\n type DialogCloseProps,\n type DialogContentProps,\n type DialogHeaderProps,\n type DialogFooterProps,\n type DialogTitleProps,\n type DialogDescriptionProps,\n};\n"],"mappings":"yCAEA,UAAYA,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBAkCrB,cAAAC,EAUE,QAAAC,MAVF,oBA1BN,IAAMC,EAAyB,OAOzBC,EAAgC,UAOhCC,EAA8B,QAS9BC,EAAsB,aAC1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IAClCR,EAAiB,SAAhB,CACC,UAAAD,EAAiB,UAAhB,CAAwB,UAAU,+IAA+I,EAClLC,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,yhBACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDL,EAAiB,QAAhB,CAAsB,UAAU,0PAC/B,UAAAD,EAACW,EAAA,CAAW,UAAU,SAAS,EAC/BX,EAAC,QAAK,UAAU,UAAU,iBAAK,GACjC,GACF,GACF,CAEJ,EAEAK,EAAc,YAA8B,UAAQ,YAQpD,SAASO,EAAa,CAAE,UAAAL,EAAW,GAAGC,CAAM,EAAyC,CACnF,OAAOR,EAAC,OAAI,UAAWU,EAAG,qDAAsDH,CAAS,EAAI,GAAGC,EAAO,CACzG,CAQA,SAASK,EAAa,CAAE,UAAAN,EAAW,GAAGC,CAAM,EAAyC,CACnF,OAAOR,EAAC,OAAI,UAAWU,EAAG,gEAAiEH,CAAS,EAAI,GAAGC,EAAO,CACpH,CASA,IAAMM,EAAoB,aAAiD,CAAC,CAAE,UAAAP,EAAW,GAAGC,CAAM,EAAGC,IACnGT,EAAiB,QAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,oDAAqDH,CAAS,EAC3E,GAAGC,EACN,CACD,EAEDM,EAAY,YAA8B,QAAM,YAShD,IAAMC,EAA0B,aAC9B,CAAC,CAAE,UAAAR,EAAW,GAAGC,CAAM,EAAGC,IACxBT,EAAiB,cAAhB,CAA4B,IAAKS,EAAK,UAAWC,EAAG,gCAAiCH,CAAS,EAAI,GAAGC,EAAO,CAEjH,EAEAO,EAAkB,YAA8B,cAAY","names":["React","DialogPrimitive","Cross2Icon","jsx","jsxs","Dialog","DialogTrigger","DialogClose","DialogContent","children","className","props","ref","cn","Cross2Icon","DialogHeader","DialogFooter","DialogTitle","DialogDescription"]}
|