@lawnguru/ui 3.0.0 → 3.0.2
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/README.md +31 -29
- package/dist/chunk-2R5NZUY2.js +2 -2
- package/dist/chunk-2R5NZUY2.js.map +7 -7
- package/dist/chunk-322C3AJR.js +2 -2
- package/dist/chunk-322C3AJR.js.map +7 -7
- package/dist/chunk-5AXWISGI.js +2 -2
- package/dist/chunk-5AXWISGI.js.map +7 -7
- package/dist/chunk-62LTWWXS.js +2 -2
- package/dist/chunk-62LTWWXS.js.map +7 -7
- package/dist/chunk-63IVPQSD.js +2 -2
- package/dist/chunk-63IVPQSD.js.map +7 -7
- package/dist/chunk-7H74R7P4.js +2 -2
- package/dist/chunk-7H74R7P4.js.map +7 -7
- package/dist/chunk-A4EVMSOO.js +2 -2
- package/dist/chunk-A4EVMSOO.js.map +7 -7
- package/dist/chunk-BF3VTYEM.js +2 -2
- package/dist/chunk-BF3VTYEM.js.map +7 -7
- package/dist/chunk-FUXRPZVU.js +2 -2
- package/dist/chunk-FUXRPZVU.js.map +7 -7
- package/dist/chunk-JVQR7SBQ.js +2 -2
- package/dist/chunk-JVQR7SBQ.js.map +7 -7
- package/dist/chunk-KGEITSDG.js +2 -2
- package/dist/chunk-KGEITSDG.js.map +7 -7
- package/dist/chunk-KR5A3H22.js +2 -2
- package/dist/chunk-KR5A3H22.js.map +7 -7
- package/dist/chunk-LUG5DIYB.js +2 -2
- package/dist/chunk-LUG5DIYB.js.map +7 -7
- package/dist/chunk-PRAYE34P.js +2 -2
- package/dist/chunk-PRAYE34P.js.map +7 -7
- package/dist/chunk-Q3PG3WWG.js +2 -2
- package/dist/chunk-Q3PG3WWG.js.map +7 -7
- package/dist/chunk-S2I5LIDP.js +2 -2
- package/dist/chunk-S2I5LIDP.js.map +7 -7
- package/dist/chunk-T73JL4BL.js +2 -2
- package/dist/chunk-T73JL4BL.js.map +7 -7
- package/dist/chunk-ZJVH3SNI.js +2 -2
- package/dist/chunk-ZJVH3SNI.js.map +7 -7
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command/index.js +1 -1
- package/dist/components/confirm/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog-responsive/index.js +1 -1
- package/dist/components/dropdown-menu-responsive/index.js +1 -1
- package/dist/components/input-group/index.js +1 -1
- package/dist/components/photo-lightbox/index.js +1 -1
- package/dist/components/photo-upload/index.js +1 -1
- package/dist/components/questionnaire/index.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/toggle-group/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/output.css +1 -1
- package/dist/tailwind.preset.js.map +1 -1
- package/dist/variables.css +92 -92
- package/package.json +133 -133
- package/dist/chunk-2ZNU7SP6.js +0 -2
- package/dist/chunk-2ZNU7SP6.js.map +0 -7
- package/dist/chunk-C6BWVSUV.js +0 -2
- package/dist/chunk-C6BWVSUV.js.map +0 -7
- package/dist/chunk-EPZCTKQC.js +0 -2
- package/dist/chunk-EPZCTKQC.js.map +0 -7
- package/dist/chunk-EWEMD7AS.js +0 -2
- package/dist/chunk-EWEMD7AS.js.map +0 -7
- package/dist/chunk-F4MEBVNH.js +0 -2
- package/dist/chunk-F4MEBVNH.js.map +0 -7
- package/dist/chunk-HE3CSN3R.js +0 -2
- package/dist/chunk-HE3CSN3R.js.map +0 -7
- package/dist/chunk-JAPB4ZVX.js +0 -2
- package/dist/chunk-JAPB4ZVX.js.map +0 -7
- package/dist/chunk-KLHKZS2N.js +0 -2
- package/dist/chunk-KLHKZS2N.js.map +0 -7
- package/dist/chunk-LS37UWHK.js +0 -2
- package/dist/chunk-LS37UWHK.js.map +0 -7
- package/dist/chunk-N4JYYENQ.js +0 -2
- package/dist/chunk-N4JYYENQ.js.map +0 -7
- package/dist/chunk-NAS2AFA3.js +0 -2
- package/dist/chunk-NAS2AFA3.js.map +0 -7
- package/dist/chunk-OSONBAJY.js +0 -2
- package/dist/chunk-OSONBAJY.js.map +0 -7
- package/dist/chunk-PLDAFSMG.js +0 -2
- package/dist/chunk-PLDAFSMG.js.map +0 -7
- package/dist/chunk-U26IEDZT.js +0 -2
- package/dist/chunk-U26IEDZT.js.map +0 -7
- package/dist/chunk-UQUO6MUG.js +0 -2
- package/dist/chunk-UQUO6MUG.js.map +0 -7
- package/dist/chunk-V3VA2O5O.js +0 -2
- package/dist/chunk-V3VA2O5O.js.map +0 -7
- package/dist/chunk-YLCKVKJM.js +0 -2
- package/dist/chunk-YLCKVKJM.js.map +0 -7
- package/dist/chunk-Z2DKDZMC.js +0 -2
- package/dist/chunk-Z2DKDZMC.js.map +0 -7
package/README.md
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
# LawnGuru UI
|
|
2
|
-
|
|
3
|
-
This is our UI project. Here, we keep all the reusable components that are used within our systems. This package is
|
|
4
|
-
|
|
5
|
-
In development, it uses [Storybook](https://storybook.js.org/) to create an interactive sandbox for us to build, visualize and test our components before using them in the
|
|
6
|
-
|
|
7
|
-
## How to run it
|
|
8
|
-
|
|
9
|
-
1. Clone the repository.
|
|
10
|
-
2. Run `pnpm` in the root folder.
|
|
11
|
-
3. Run `pnpm storybook`, you should see in the output of this command, the address and port to follow to our *Storybook* view.
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
# LawnGuru UI
|
|
2
|
+
|
|
3
|
+
This is our UI project. Here, we keep all the reusable components that are used within our systems. This package is built and published to the public [npm registry](https://www.npmjs.com/package/@lawnguru/ui) as `@lawnguru/ui`, so we can install it from our projects and use the components.
|
|
4
|
+
|
|
5
|
+
In development, it uses [Storybook](https://storybook.js.org/) to create an interactive sandbox for us to build, visualize and test our components before using them in the outer world.
|
|
6
|
+
|
|
7
|
+
## How to run it
|
|
8
|
+
|
|
9
|
+
1. Clone the repository.
|
|
10
|
+
2. Run `pnpm install` in the root folder.
|
|
11
|
+
3. Run `pnpm storybook`, you should see in the output of this command, the address and port to follow to our *Storybook* view.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Install the package from the npm registry in your project:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add @lawnguru/ui
|
|
19
|
+
# or
|
|
20
|
+
npm install @lawnguru/ui
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Releases
|
|
24
|
+
|
|
25
|
+
Releases are automated through GitHub Actions (`.github/workflows/publish.yaml`):
|
|
26
|
+
|
|
27
|
+
1. Go to the **Actions** tab and run the **Publish Package** workflow manually.
|
|
28
|
+
2. Choose the version bump type: patch, minor, or major.
|
|
29
|
+
3. The workflow bumps the version, builds, publishes to npm, and creates a GitHub Release.
|
|
30
|
+
|
|
31
|
+
Publishing uses [npm trusted publishing](https://docs.npmjs.com/trusted-publishers) with GitHub OIDC, so no npm tokens are stored in the repository.
|
package/dist/chunk-2R5NZUY2.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as d}from"./chunk-WIFBPNRH.js";import{a as n,b as p,c as r}from"./chunk-WHECA25N.js";import*as m from"react";import{Dialog as e}from"radix-ui";import{XIcon as D}from"lucide-react";import{jsx as l,jsxs as c}from"react/jsx-runtime";var h=e.Root,T=e.Trigger,u=e.Portal,w=e.Close,g=m.forwardRef((o,i)=>{var s=o,{className:t}=s,a=r(s,["className"]);return l(e.Overlay,n({ref:i,className:d("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},a))});g.displayName=e.Overlay.displayName;var y=m.forwardRef((s,o)=>{var f=s,{className:t,children:a}=f,i=r(f,["className","children"]);return c(u,{children:[l(g,{}),c(e.Content,p(n({ref:o,className:d("fixed left-[50%] top-[50%] z-50 grid max-h-[85dvh] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t)},i),{children:[a,c(e.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l(D,{className:"h-4 w-4"}),l("span",{className:"sr-only",children:"Close"})]})]}))]})});y.displayName=e.Content.displayName;var R=i=>{var o=i,{className:t}=o,a=r(o,["className"]);return l("div",n({className:d("flex flex-col space-y-1.5 text-center sm:text-left",t)},a))};R.displayName="DialogHeader";var v=i=>{var o=i,{className:t}=o,a=r(o,["className"]);return l("div",n({className:d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},a))};v.displayName="DialogFooter";var x=m.forwardRef((o,i)=>{var s=o,{className:t}=s,a=r(s,["className"]);return l(e.Title,n({ref:i,className:d("text-left text-lg font-semibold leading-none tracking-tight",t)},a))});x.displayName=e.Title.displayName;var N=m.forwardRef((o,i)=>{var s=o,{className:t}=s,a=r(s,["className"]);return l(e.Description,n({ref:i,className:d("text-left text-sm text-muted-foreground",t)},a))});N.displayName=e.Description.displayName;export{h as a,T as b,u as c,w as d,g as e,y as f,R as g,v as h,x as i,N as j};
|
|
2
|
-
//# sourceMappingURL=chunk-2R5NZUY2.js.map
|
|
1
|
+
import{a as d}from"./chunk-WIFBPNRH.js";import{a as n,b as p,c as r}from"./chunk-WHECA25N.js";import*as m from"react";import{Dialog as e}from"radix-ui";import{XIcon as D}from"lucide-react";import{jsx as l,jsxs as c}from"react/jsx-runtime";var h=e.Root,T=e.Trigger,u=e.Portal,w=e.Close,g=m.forwardRef((o,i)=>{var s=o,{className:t}=s,a=r(s,["className"]);return l(e.Overlay,n({ref:i,className:d("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},a))});g.displayName=e.Overlay.displayName;var y=m.forwardRef((s,o)=>{var f=s,{className:t,children:a}=f,i=r(f,["className","children"]);return c(u,{children:[l(g,{}),c(e.Content,p(n({ref:o,className:d("fixed left-[50%] top-[50%] z-50 grid max-h-[85dvh] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t)},i),{children:[a,c(e.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l(D,{className:"h-4 w-4"}),l("span",{className:"sr-only",children:"Close"})]})]}))]})});y.displayName=e.Content.displayName;var R=i=>{var o=i,{className:t}=o,a=r(o,["className"]);return l("div",n({className:d("flex flex-col space-y-1.5 text-center sm:text-left",t)},a))};R.displayName="DialogHeader";var v=i=>{var o=i,{className:t}=o,a=r(o,["className"]);return l("div",n({className:d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},a))};v.displayName="DialogFooter";var x=m.forwardRef((o,i)=>{var s=o,{className:t}=s,a=r(s,["className"]);return l(e.Title,n({ref:i,className:d("text-left text-lg font-semibold leading-none tracking-tight",t)},a))});x.displayName=e.Title.displayName;var N=m.forwardRef((o,i)=>{var s=o,{className:t}=s,a=r(s,["className"]);return l(e.Description,n({ref:i,className:d("text-left text-sm text-muted-foreground",t)},a))});N.displayName=e.Description.displayName;export{h as a,T as b,u as c,w as d,g as e,y as f,R as g,v as h,x as i,N as j};
|
|
2
|
+
//# sourceMappingURL=chunk-2R5NZUY2.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/dialog/index.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { cn } from \"@/lib/utils\";\nimport { XIcon } from \"lucide-react\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid max-h-[85dvh] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <XIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"text-left text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-left text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],
|
|
5
|
-
"mappings": "8FAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,WAE1C,OAAS,SAAAC,MAAa,eAcpB,cAAAC,EA0BI,QAAAC,MA1BJ,oBAZF,IAAMC,EAASC,EAAgB,KAEzBC,EAAgBD,EAAgB,QAEhCE,EAAeF,EAAgB,OAE/BG,EAAcH,EAAgB,MAE9BI,EAAsB,aAG1B,CAACC,EAAyBC,IAAK,CAA9B,IAAAC,EAAAF,EAAE,WAAAG,CAlBL,EAkBGD,EAAgBE,EAAAC,EAAhBH,EAAgB,CAAd,cACH,OAAAV,EAACG,EAAgB,QAAhBW,EAAA,CACC,IAAKL,EACL,UAAWM,EACT,yJACAJ,CACF,GACIC,EACN,EACD,EACDL,EAAc,YAAcJ,EAAgB,QAAQ,YAEpD,IAAMa,EAAsB,aAG1B,CAACR,EAAmCC,IAAK,CAAxC,IAAAC,EAAAF,EAAE,WAAAG,EAAW,SAAAM,CAjChB,EAiCGP,EAA0BE,EAAAC,EAA1BH,EAA0B,CAAxB,YAAW,aACd,OAAAT,EAACI,EAAA,CACC,UAAAL,EAACO,EAAA,EAAc,EACfN,EAACE,EAAgB,QAAhBe,EAAAJ,EAAA,CACC,IAAKL,EACL,UAAWM,EACT,4gBACAJ,CACF,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dialog", "DialogPrimitive", "DialogTrigger", "DialogPortal", "DialogClose", "DialogOverlay", "_a", "ref", "_b", "className", "props", "__objRest", "__spreadValues", "cn", "DialogContent", "children", "__spreadProps", "XIcon", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription"]
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/dialog/index.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { cn } from \"@/lib/utils\";\nimport { XIcon } from \"lucide-react\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid max-h-[85dvh] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <XIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"text-left text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-left text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],
|
|
5
|
+
"mappings": "8FAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,WAE1C,OAAS,SAAAC,MAAa,eAcpB,cAAAC,EA0BI,QAAAC,MA1BJ,oBAZF,IAAMC,EAASC,EAAgB,KAEzBC,EAAgBD,EAAgB,QAEhCE,EAAeF,EAAgB,OAE/BG,EAAcH,EAAgB,MAE9BI,EAAsB,aAG1B,CAACC,EAAyBC,IAAK,CAA9B,IAAAC,EAAAF,EAAE,WAAAG,CAlBL,EAkBGD,EAAgBE,EAAAC,EAAhBH,EAAgB,CAAd,cACH,OAAAV,EAACG,EAAgB,QAAhBW,EAAA,CACC,IAAKL,EACL,UAAWM,EACT,yJACAJ,CACF,GACIC,EACN,EACD,EACDL,EAAc,YAAcJ,EAAgB,QAAQ,YAEpD,IAAMa,EAAsB,aAG1B,CAACR,EAAmCC,IAAK,CAAxC,IAAAC,EAAAF,EAAE,WAAAG,EAAW,SAAAM,CAjChB,EAiCGP,EAA0BE,EAAAC,EAA1BH,EAA0B,CAAxB,YAAW,aACd,OAAAT,EAACI,EAAA,CACC,UAAAL,EAACO,EAAA,EAAc,EACfN,EAACE,EAAgB,QAAhBe,EAAAJ,EAAA,CACC,IAAKL,EACL,UAAWM,EACT,4gBACAJ,CACF,GACIC,GANL,CAQE,UAAAK,EACDhB,EAACE,EAAgB,MAAhB,CAAsB,UAAU,gRAC/B,UAAAH,EAACmB,EAAA,CAAM,UAAU,UAAU,EAC3BnB,EAAC,QAAK,UAAU,UAAU,iBAAK,GACjC,IACF,GACF,EACD,EACDgB,EAAc,YAAcb,EAAgB,QAAQ,YAEpD,IAAMiB,EAAgBZ,GAGmB,CAHnB,IAAAE,EAAAF,EACpB,WAAAG,CAvDF,EAsDsBD,EAEjBE,EAAAC,EAFiBH,EAEjB,CADH,cAGA,OAAAV,EAAC,MAAAc,EAAA,CACC,UAAWC,EACT,qDACAJ,CACF,GACIC,EACN,GAEFQ,EAAa,YAAc,eAE3B,IAAMC,EAAgBb,GAGmB,CAHnB,IAAAE,EAAAF,EACpB,WAAAG,CArEF,EAoEsBD,EAEjBE,EAAAC,EAFiBH,EAEjB,CADH,cAGA,OAAAV,EAAC,MAAAc,EAAA,CACC,UAAWC,EACT,gEACAJ,CACF,GACIC,EACN,GAEFS,EAAa,YAAc,eAE3B,IAAMC,EAAoB,aAGxB,CAACd,EAAyBC,IAAK,CAA9B,IAAAC,EAAAF,EAAE,WAAAG,CArFL,EAqFGD,EAAgBE,EAAAC,EAAhBH,EAAgB,CAAd,cACH,OAAAV,EAACG,EAAgB,MAAhBW,EAAA,CACC,IAAKL,EACL,UAAWM,EACT,8DACAJ,CACF,GACIC,EACN,EACD,EACDU,EAAY,YAAcnB,EAAgB,MAAM,YAEhD,IAAMoB,EAA0B,aAG9B,CAACf,EAAyBC,IAAK,CAA9B,IAAAC,EAAAF,EAAE,WAAAG,CApGL,EAoGGD,EAAgBE,EAAAC,EAAhBH,EAAgB,CAAd,cACH,OAAAV,EAACG,EAAgB,YAAhBW,EAAA,CACC,IAAKL,EACL,UAAWM,EAAG,0CAA2CJ,CAAS,GAC9DC,EACN,EACD,EACDW,EAAkB,YAAcpB,EAAgB,YAAY",
|
|
6
|
+
"names": ["React", "DialogPrimitive", "XIcon", "jsx", "jsxs", "Dialog", "DialogPrimitive", "DialogTrigger", "DialogPortal", "DialogClose", "DialogOverlay", "_a", "ref", "_b", "className", "props", "__objRest", "__spreadValues", "cn", "DialogContent", "children", "__spreadProps", "XIcon", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription"]
|
|
7
|
+
}
|
package/dist/chunk-322C3AJR.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as D,b as h,c as N,d as l,e as x,f as b,g as y,h as B}from"./chunk-7H74R7P4.js";import{b as n}from"./chunk-BF3VTYEM.js";import{a}from"./chunk-WIFBPNRH.js";import{a as f,c as R}from"./chunk-WHECA25N.js";import{Fragment as w,jsx as e,jsxs as i}from"react/jsx-runtime";var P=({title:r,children:c,confirmText:p="Confirm",cancelText:d="Cancel",variant:v="default",cancelVariant:t="outline",icon:g,onConfirm:m,onCancel:u,className:k,loading:s})=>{let{isTouch:o}=D(),C=v==="destructive";return i(x,{className:a("[&>button]:hidden",!o&&"max-w-lg",k),children:[i(b,{className:a(!o&&"flex-row items-start gap-5 space-y-0",o&&"gap-4"),children:[!o&&g&&e("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[hsl(48,89%,93%)] text-[hsl(37,86%,23%)]",children:g}),i("div",{className:a(!o&&g&&"space-y-2",o&&"space-y-3"),children:[e(B,{className:"text-left",children:r}),e("p",{className:"text-left text-sm text-foreground",children:c})]})]}),e(y,{className:a(!o&&"flex-row justify-end gap-2"),children:o?i(w,{children:[e(l,{asChild:!0,children:e(n,{variant:C?"destructive":"default",size:"lg",onClick:m,disabled:s,className:"w-full",children:s?"Loading...":p})}),e(l,{asChild:!0,children:e(n,{variant:t,size:"lg",onClick:u,disabled:s,className:"w-full",children:d})})]}):i(w,{children:[e(l,{asChild:!0,children:e(n,{variant:t,onClick:u,disabled:s,children:d})}),e(l,{asChild:!0,children:e(n,{variant:C?"destructive":"default",onClick:m,disabled:s,children:s?"Loading...":p})})]})})]})},T=v=>{var t=v,{trigger:r,open:c,onOpenChange:p}=t,d=R(t,["trigger","open","onOpenChange"]);return i(h,{open:c,onOpenChange:p,children:[r&&e(N,{asChild:!0,children:r}),e(P,f({},d))]})};T.displayName="Confirm";export{T as a};
|
|
2
|
-
//# sourceMappingURL=chunk-322C3AJR.js.map
|
|
1
|
+
import{a as D,b as h,c as N,d as l,e as x,f as b,g as y,h as B}from"./chunk-7H74R7P4.js";import{b as n}from"./chunk-BF3VTYEM.js";import{a}from"./chunk-WIFBPNRH.js";import{a as f,c as R}from"./chunk-WHECA25N.js";import{Fragment as w,jsx as e,jsxs as i}from"react/jsx-runtime";var P=({title:r,children:c,confirmText:p="Confirm",cancelText:d="Cancel",variant:v="default",cancelVariant:t="outline",icon:g,onConfirm:m,onCancel:u,className:k,loading:s})=>{let{isTouch:o}=D(),C=v==="destructive";return i(x,{className:a("[&>button]:hidden",!o&&"max-w-lg",k),children:[i(b,{className:a(!o&&"flex-row items-start gap-5 space-y-0",o&&"gap-4"),children:[!o&&g&&e("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[hsl(48,89%,93%)] text-[hsl(37,86%,23%)]",children:g}),i("div",{className:a(!o&&g&&"space-y-2",o&&"space-y-3"),children:[e(B,{className:"text-left",children:r}),e("p",{className:"text-left text-sm text-foreground",children:c})]})]}),e(y,{className:a(!o&&"flex-row justify-end gap-2"),children:o?i(w,{children:[e(l,{asChild:!0,children:e(n,{variant:C?"destructive":"default",size:"lg",onClick:m,disabled:s,className:"w-full",children:s?"Loading...":p})}),e(l,{asChild:!0,children:e(n,{variant:t,size:"lg",onClick:u,disabled:s,className:"w-full",children:d})})]}):i(w,{children:[e(l,{asChild:!0,children:e(n,{variant:t,onClick:u,disabled:s,children:d})}),e(l,{asChild:!0,children:e(n,{variant:C?"destructive":"default",onClick:m,disabled:s,children:s?"Loading...":p})})]})})]})},T=v=>{var t=v,{trigger:r,open:c,onOpenChange:p}=t,d=R(t,["trigger","open","onOpenChange"]);return i(h,{open:c,onOpenChange:p,children:[r&&e(N,{asChild:!0,children:r}),e(P,f({},d))]})};T.displayName="Confirm";export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-322C3AJR.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/confirm/index.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport {\n DialogResponsive,\n DialogResponsiveContent,\n DialogResponsiveFooter,\n DialogResponsiveHeader,\n DialogResponsiveTitle,\n DialogResponsiveTrigger,\n DialogResponsiveClose,\n useDialogResponsive,\n} from \"@/components/dialog-responsive\";\nimport { Button, type ButtonProps } from \"@/components/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ConfirmProps = {\n /** The title of the confirmation dialog */\n title: string;\n /** The description/content of the confirmation dialog (can be string or React elements) */\n children: React.ReactNode;\n /** The text for the confirm button */\n confirmText?: string;\n /** The text for the cancel button */\n cancelText?: string;\n /** Whether the action is destructive (red button) */\n variant?: \"default\" | \"destructive\";\n /** Button variant for the cancel action */\n cancelVariant?: ButtonProps[\"variant\"];\n /** Icon to display in desktop mode (only visible on non-touch devices) */\n icon?: React.ReactNode;\n /** Callback when the confirm button is clicked */\n onConfirm?: () => void;\n /** Callback when the cancel button is clicked */\n onCancel?: () => void;\n /** The trigger element that opens the dialog */\n trigger?: React.ReactNode;\n /** Controlled open state */\n open?: boolean;\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void;\n /** Additional class name for the content */\n className?: string;\n /** Whether the confirm action is loading */\n loading?: boolean;\n};\n\nconst ConfirmContent = ({\n title,\n children,\n confirmText = \"Confirm\",\n cancelText = \"Cancel\",\n variant = \"default\",\n cancelVariant = \"outline\",\n icon,\n onConfirm,\n onCancel,\n className,\n loading,\n}: Omit<ConfirmProps, \"trigger\" | \"open\" | \"onOpenChange\">) => {\n const { isTouch } = useDialogResponsive();\n const isDestructive = variant === \"destructive\";\n\n return (\n <DialogResponsiveContent\n className={cn(\n \"[&>button]:hidden\", // Hide default close button\n !isTouch && \"max-w-lg\",\n className,\n )}\n >\n <DialogResponsiveHeader\n className={cn(\n !isTouch && \"flex-row items-start gap-5 space-y-0\",\n isTouch && \"gap-4\",\n )}\n >\n {!isTouch && icon && (\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[hsl(48,89%,93%)] text-[hsl(37,86%,23%)]\">\n {icon}\n </div>\n )}\n <div\n className={cn(\n !isTouch && icon && \"space-y-2\",\n isTouch && \"space-y-3\",\n )}\n >\n <DialogResponsiveTitle className=\"text-left\">\n {title}\n </DialogResponsiveTitle>\n <p className=\"text-left text-sm text-foreground\">{children}</p>\n </div>\n </DialogResponsiveHeader>\n <DialogResponsiveFooter\n className={cn(!isTouch && \"flex-row justify-end gap-2\")}\n >\n {isTouch ? (\n <>\n <DialogResponsiveClose asChild>\n <Button\n variant={isDestructive ? \"destructive\" : \"default\"}\n size=\"lg\"\n onClick={onConfirm}\n disabled={loading}\n className=\"w-full\"\n >\n {loading ? \"Loading...\" : confirmText}\n </Button>\n </DialogResponsiveClose>\n <DialogResponsiveClose asChild>\n <Button\n variant={cancelVariant}\n size=\"lg\"\n onClick={onCancel}\n disabled={loading}\n className=\"w-full\"\n >\n {cancelText}\n </Button>\n </DialogResponsiveClose>\n </>\n ) : (\n <>\n <DialogResponsiveClose asChild>\n <Button\n variant={cancelVariant}\n onClick={onCancel}\n disabled={loading}\n >\n {cancelText}\n </Button>\n </DialogResponsiveClose>\n <DialogResponsiveClose asChild>\n <Button\n variant={isDestructive ? \"destructive\" : \"default\"}\n onClick={onConfirm}\n disabled={loading}\n >\n {loading ? \"Loading...\" : confirmText}\n </Button>\n </DialogResponsiveClose>\n </>\n )}\n </DialogResponsiveFooter>\n </DialogResponsiveContent>\n );\n};\n\nconst Confirm = ({\n trigger,\n open,\n onOpenChange,\n ...contentProps\n}: ConfirmProps) => {\n return (\n <DialogResponsive open={open} onOpenChange={onOpenChange}>\n {trigger && (\n <DialogResponsiveTrigger asChild>{trigger}</DialogResponsiveTrigger>\n )}\n <ConfirmContent {...contentProps} />\n </DialogResponsive>\n );\n};\n\nConfirm.displayName = \"Confirm\";\n\nexport { Confirm };\n"],
|
|
5
|
-
"mappings": "mNA8EU,OAoBA,YAAAA,EApBA,OAAAC,EAIF,QAAAC,MAJE,oBA/BV,IAAMC,EAAiB,CAAC,CACtB,MAAAC,EACA,SAAAC,EACA,YAAAC,EAAc,UACd,WAAAC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,QAASN,EACT,SAAUG,EAET,SAAAA,EAAU,aAAeR,EAC5B,EACF,GACF,EAEJ,GACF,CAEJ,EAEMmB,EAAWC,GAKG,CALH,IAAAC,EAAAD,EACf,SAAAE,EACA,KAAAC,EACA,aAAAC,CAxJF,EAqJiBH,EAIZI,EAAAC,EAJYL,EAIZ,CAHH,UACA,OACA,iBAGA,OACEzB,EAAC+B,EAAA,CAAiB,KAAMJ,EAAM,aAAcC,EACzC,UAAAF,GACC3B,EAACiC,EAAA,CAAwB,QAAO,GAAE,SAAAN,EAAQ,EAE5C3B,EAACE,EAAAgC,EAAA,GAAmBJ,EAAc,GACpC,CAEJ,EAEAN,EAAQ,YAAc",
|
|
6
|
-
"names": ["Fragment", "jsx", "jsxs", "ConfirmContent", "title", "children", "confirmText", "cancelText", "variant", "cancelVariant", "icon", "onConfirm", "onCancel", "className", "loading", "isTouch", "useDialogResponsive", "isDestructive", "DialogResponsiveContent", "cn", "DialogResponsiveHeader", "DialogResponsiveTitle", "DialogResponsiveFooter", "DialogResponsiveClose", "Button", "Confirm", "_a", "_b", "trigger", "open", "onOpenChange", "contentProps", "__objRest", "DialogResponsive", "DialogResponsiveTrigger", "__spreadValues"]
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/confirm/index.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport {\n DialogResponsive,\n DialogResponsiveContent,\n DialogResponsiveFooter,\n DialogResponsiveHeader,\n DialogResponsiveTitle,\n DialogResponsiveTrigger,\n DialogResponsiveClose,\n useDialogResponsive,\n} from \"@/components/dialog-responsive\";\nimport { Button, type ButtonProps } from \"@/components/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ConfirmProps = {\n /** The title of the confirmation dialog */\n title: string;\n /** The description/content of the confirmation dialog (can be string or React elements) */\n children: React.ReactNode;\n /** The text for the confirm button */\n confirmText?: string;\n /** The text for the cancel button */\n cancelText?: string;\n /** Whether the action is destructive (red button) */\n variant?: \"default\" | \"destructive\";\n /** Button variant for the cancel action */\n cancelVariant?: ButtonProps[\"variant\"];\n /** Icon to display in desktop mode (only visible on non-touch devices) */\n icon?: React.ReactNode;\n /** Callback when the confirm button is clicked */\n onConfirm?: () => void;\n /** Callback when the cancel button is clicked */\n onCancel?: () => void;\n /** The trigger element that opens the dialog */\n trigger?: React.ReactNode;\n /** Controlled open state */\n open?: boolean;\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void;\n /** Additional class name for the content */\n className?: string;\n /** Whether the confirm action is loading */\n loading?: boolean;\n};\n\nconst ConfirmContent = ({\n title,\n children,\n confirmText = \"Confirm\",\n cancelText = \"Cancel\",\n variant = \"default\",\n cancelVariant = \"outline\",\n icon,\n onConfirm,\n onCancel,\n className,\n loading,\n}: Omit<ConfirmProps, \"trigger\" | \"open\" | \"onOpenChange\">) => {\n const { isTouch } = useDialogResponsive();\n const isDestructive = variant === \"destructive\";\n\n return (\n <DialogResponsiveContent\n className={cn(\n \"[&>button]:hidden\", // Hide default close button\n !isTouch && \"max-w-lg\",\n className,\n )}\n >\n <DialogResponsiveHeader\n className={cn(\n !isTouch && \"flex-row items-start gap-5 space-y-0\",\n isTouch && \"gap-4\",\n )}\n >\n {!isTouch && icon && (\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[hsl(48,89%,93%)] text-[hsl(37,86%,23%)]\">\n {icon}\n </div>\n )}\n <div\n className={cn(\n !isTouch && icon && \"space-y-2\",\n isTouch && \"space-y-3\",\n )}\n >\n <DialogResponsiveTitle className=\"text-left\">\n {title}\n </DialogResponsiveTitle>\n <p className=\"text-left text-sm text-foreground\">{children}</p>\n </div>\n </DialogResponsiveHeader>\n <DialogResponsiveFooter\n className={cn(!isTouch && \"flex-row justify-end gap-2\")}\n >\n {isTouch ? (\n <>\n <DialogResponsiveClose asChild>\n <Button\n variant={isDestructive ? \"destructive\" : \"default\"}\n size=\"lg\"\n onClick={onConfirm}\n disabled={loading}\n className=\"w-full\"\n >\n {loading ? \"Loading...\" : confirmText}\n </Button>\n </DialogResponsiveClose>\n <DialogResponsiveClose asChild>\n <Button\n variant={cancelVariant}\n size=\"lg\"\n onClick={onCancel}\n disabled={loading}\n className=\"w-full\"\n >\n {cancelText}\n </Button>\n </DialogResponsiveClose>\n </>\n ) : (\n <>\n <DialogResponsiveClose asChild>\n <Button\n variant={cancelVariant}\n onClick={onCancel}\n disabled={loading}\n >\n {cancelText}\n </Button>\n </DialogResponsiveClose>\n <DialogResponsiveClose asChild>\n <Button\n variant={isDestructive ? \"destructive\" : \"default\"}\n onClick={onConfirm}\n disabled={loading}\n >\n {loading ? \"Loading...\" : confirmText}\n </Button>\n </DialogResponsiveClose>\n </>\n )}\n </DialogResponsiveFooter>\n </DialogResponsiveContent>\n );\n};\n\nconst Confirm = ({\n trigger,\n open,\n onOpenChange,\n ...contentProps\n}: ConfirmProps) => {\n return (\n <DialogResponsive open={open} onOpenChange={onOpenChange}>\n {trigger && (\n <DialogResponsiveTrigger asChild>{trigger}</DialogResponsiveTrigger>\n )}\n <ConfirmContent {...contentProps} />\n </DialogResponsive>\n );\n};\n\nConfirm.displayName = \"Confirm\";\n\nexport { Confirm };\n"],
|
|
5
|
+
"mappings": "mNA8EU,OAoBA,YAAAA,EApBA,OAAAC,EAIF,QAAAC,MAJE,oBA/BV,IAAMC,EAAiB,CAAC,CACtB,MAAAC,EACA,SAAAC,EACA,YAAAC,EAAc,UACd,WAAAC,EAAa,SACb,QAAAC,EAAU,UACV,cAAAC,EAAgB,UAChB,KAAAC,EACA,UAAAC,EACA,SAAAC,EACA,UAAAC,EACA,QAAAC,CACF,IAA+D,CAC7D,GAAM,CAAE,QAAAC,CAAQ,EAAIC,EAAoB,EAClCC,EAAgBT,IAAY,cAElC,OACEN,EAACgB,EAAA,CACC,UAAWC,EACT,oBACA,CAACJ,GAAW,WACZF,CACF,EAEA,UAAAX,EAACkB,EAAA,CACC,UAAWD,EACT,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,EAAA,CAAwB,QAAO,GAAE,SAAAN,EAAQ,EAE5C3B,EAACE,EAAAgC,EAAA,GAAmBJ,EAAc,GACpC,CAEJ,EAEAN,EAAQ,YAAc",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "ConfirmContent", "title", "children", "confirmText", "cancelText", "variant", "cancelVariant", "icon", "onConfirm", "onCancel", "className", "loading", "isTouch", "useDialogResponsive", "isDestructive", "DialogResponsiveContent", "cn", "DialogResponsiveHeader", "DialogResponsiveTitle", "DialogResponsiveFooter", "DialogResponsiveClose", "Button", "Confirm", "_a", "_b", "trigger", "open", "onOpenChange", "contentProps", "__objRest", "DialogResponsive", "DialogResponsiveTrigger", "__spreadValues"]
|
|
7
|
+
}
|
package/dist/chunk-5AXWISGI.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f}from"./chunk-PRAYE34P.js";import{a as d}from"./chunk-WIFBPNRH.js";import{a as p,b as l,c as s}from"./chunk-WHECA25N.js";import*as i from"react";import{ToggleGroup as v}from"radix-ui";import{Check as z}from"lucide-react";import{jsx as u,jsxs as P}from"react/jsx-runtime";var h=i.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal",showCheckIcon:!1});function R(C){var m=C,{className:n,variant:r,size:o,spacing:t=2,orientation:e="horizontal",showCheckIcon:c=!1,children:g}=m,a=s(m,["className","variant","size","spacing","orientation","showCheckIcon","children"]);return u(v.Root,l(p({"data-slot":"toggle-group","data-variant":r,"data-size":o,"data-spacing":t,"data-orientation":e,style:{"--gap":`${t*.25}rem`},className:d("group/toggle-group data-vertical:flex-col data-vertical:items-stretch flex w-fit flex-row items-center gap-[var(--gap)] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)]",n)},a),{children:u(h.Provider,{value:{variant:r,size:o,spacing:t,orientation:e,showCheckIcon:c},children:g})}))}function I(c){var g=c,{className:n,children:r,variant:o="default",size:t="default"}=g,e=s(g,["className","children","variant","size"]);let a=i.useContext(h);return P(v.Item,l(p({"data-slot":"toggle-group-item","data-variant":a.variant||o,"data-size":a.size||t,"data-spacing":a.spacing,className:d("group/item group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t shrink-0 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2",f({variant:a.variant||o,size:a.size||t}),n)},e),{children:[a.showCheckIcon&&u(z,{className:"hidden size-4 group-data-[state=on]/item:block"}),r]}))}export{R as a,I as b};
|
|
2
|
-
//# sourceMappingURL=chunk-5AXWISGI.js.map
|
|
1
|
+
import{a as f}from"./chunk-PRAYE34P.js";import{a as d}from"./chunk-WIFBPNRH.js";import{a as p,b as l,c as s}from"./chunk-WHECA25N.js";import*as i from"react";import{ToggleGroup as v}from"radix-ui";import{Check as z}from"lucide-react";import{jsx as u,jsxs as P}from"react/jsx-runtime";var h=i.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal",showCheckIcon:!1});function R(C){var m=C,{className:n,variant:r,size:o,spacing:t=2,orientation:e="horizontal",showCheckIcon:c=!1,children:g}=m,a=s(m,["className","variant","size","spacing","orientation","showCheckIcon","children"]);return u(v.Root,l(p({"data-slot":"toggle-group","data-variant":r,"data-size":o,"data-spacing":t,"data-orientation":e,style:{"--gap":`${t*.25}rem`},className:d("group/toggle-group data-vertical:flex-col data-vertical:items-stretch flex w-fit flex-row items-center gap-[var(--gap)] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)]",n)},a),{children:u(h.Provider,{value:{variant:r,size:o,spacing:t,orientation:e,showCheckIcon:c},children:g})}))}function I(c){var g=c,{className:n,children:r,variant:o="default",size:t="default"}=g,e=s(g,["className","children","variant","size"]);let a=i.useContext(h);return P(v.Item,l(p({"data-slot":"toggle-group-item","data-variant":a.variant||o,"data-size":a.size||t,"data-spacing":a.spacing,className:d("group/item group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t shrink-0 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2",f({variant:a.variant||o,size:a.size||t}),n)},e),{children:[a.showCheckIcon&&u(z,{className:"hidden size-4 group-data-[state=on]/item:block"}),r]}))}export{R as a,I as b};
|
|
2
|
+
//# sourceMappingURL=chunk-5AXWISGI.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/toggle-group/index.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { ToggleGroup as ToggleGroupPrimitive } from \"radix-ui\";\n\nimport { cn } from \"@/lib/utils\";\nimport { toggleVariants } from \"@/components/toggle\";\n\nimport { Check } from \"lucide-react\";\n\nconst ToggleGroupContext = React.createContext<\n VariantProps<typeof toggleVariants> & {\n spacing?: number;\n orientation?: \"horizontal\" | \"vertical\";\n showCheckIcon?: boolean;\n }\n>({\n size: \"default\",\n variant: \"default\",\n spacing: 2,\n orientation: \"horizontal\",\n showCheckIcon: false,\n});\n\nfunction ToggleGroup({\n className,\n variant,\n size,\n spacing = 2,\n orientation = \"horizontal\",\n showCheckIcon = false,\n children,\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants> & {\n spacing?: number;\n orientation?: \"horizontal\" | \"vertical\";\n showCheckIcon?: boolean;\n }) {\n return (\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n data-variant={variant}\n data-size={size}\n data-spacing={spacing}\n data-orientation={orientation}\n style={{ \"--gap\": `${spacing * 0.25}rem` } as React.CSSProperties}\n className={cn(\n \"group/toggle-group data-vertical:flex-col data-vertical:items-stretch flex w-fit flex-row items-center gap-[var(--gap)] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)]\",\n className,\n )}\n {...props}\n >\n <ToggleGroupContext.Provider\n value={{ variant, size, spacing, orientation, showCheckIcon }}\n >\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n );\n}\n\nfunction ToggleGroupItem({\n className,\n children,\n variant = \"default\",\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>) {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n data-variant={context.variant || variant}\n data-size={context.size || size}\n data-spacing={context.spacing}\n className={cn(\n \"group/item group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t shrink-0 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2\",\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className,\n )}\n {...props}\n >\n {context.showCheckIcon && (\n <Check className=\"hidden size-4 group-data-[state=on]/item:block\" />\n )}\n {children}\n </ToggleGroupPrimitive.Item>\n );\n}\n\nexport { ToggleGroup, ToggleGroupItem };\n"],
|
|
5
|
-
"mappings": "sIAEA,UAAYA,MAAW,QAEvB,OAAS,eAAeC,MAA4B,WAKpD,OAAS,SAAAC,MAAa,eA6ChB,cAAAC,EAoBF,QAAAC,MApBE,oBA3CN,IAAMC,EAA2B,gBAM/B,CACA,KAAM,UACN,QAAS,UACT,QAAS,EACT,YAAa,aACb,cAAe,EACjB,CAAC,EAED,SAASC,EAAYC,EAchB,CAdgB,IAAAC,EAAAD,EACnB,WAAAE,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,EACV,YAAAC,EAAc,aACd,cAAAC,EAAgB,GAChB,SAAAC,CAhCF,EAyBqBP,EAQhBQ,EAAAC,EARgBT,EAQhB,CAPH,YACA,UACA,OACA,UACA,cACA,gBACA,aAQA,OACEL,EAACe,EAAqB,KAArBC,EAAAC,EAAA,CACC,YAAU,eACV,eAAcV,EACd,YAAWC,EACX,eAAcC,EACd,mBAAkBC,EAClB,MAAO,CAAE,QAAS,GAAGD,EAAU,GAAI,KAAM,EACzC,UAAWS,EACT,yLACAZ,CACF,GACIO,GAXL,CAaC,SAAAb,EAACE,EAAmB,SAAnB,CACC,MAAO,CAAE,QAAAK,EAAS,KAAAC,EAAM,QAAAC,EAAS,YAAAC,EAAa,cAAAC,CAAc,EAE3D,SAAAC,EACH,GACF,CAEJ,CAEA,SAASO,EAAgBf,EAOc,CAPd,IAAAC,EAAAD,EACvB,WAAAE,EACA,SAAAM,EACA,QAAAL,EAAU,UACV,KAAAC,EAAO,SAnET,EA+DyBH,EAKpBQ,EAAAC,EALoBT,EAKpB,CAJH,YACA,WACA,UACA,SAIA,IAAMe,EAAgB,aAAWlB,CAAkB,EAEnD,OACED,EAACc,EAAqB,KAArBC,EAAAC,EAAA,CACC,YAAU,oBACV,eAAcG,EAAQ,SAAWb,EACjC,YAAWa,EAAQ,MAAQZ,EAC3B,eAAcY,EAAQ,QACtB,UAAWF,EACT,84BACAG,EAAe,CACb,QAASD,EAAQ,SAAWb,EAC5B,KAAMa,EAAQ,MAAQZ,CACxB,CAAC,EACDF,CACF,GACIO,GAbL,CAeE,UAAAO,EAAQ,eACPpB,EAACsB,EAAA,CAAM,UAAU,iDAAiD,EAEnEV,IACH,CAEJ",
|
|
6
|
-
"names": ["React", "ToggleGroupPrimitive", "Check", "jsx", "jsxs", "ToggleGroupContext", "ToggleGroup", "_a", "_b", "className", "variant", "size", "spacing", "orientation", "showCheckIcon", "children", "props", "__objRest", "ToggleGroupPrimitive", "__spreadProps", "__spreadValues", "cn", "ToggleGroupItem", "context", "toggleVariants", "Check"]
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/toggle-group/index.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { ToggleGroup as ToggleGroupPrimitive } from \"radix-ui\";\n\nimport { cn } from \"@/lib/utils\";\nimport { toggleVariants } from \"@/components/toggle\";\n\nimport { Check } from \"lucide-react\";\n\nconst ToggleGroupContext = React.createContext<\n VariantProps<typeof toggleVariants> & {\n spacing?: number;\n orientation?: \"horizontal\" | \"vertical\";\n showCheckIcon?: boolean;\n }\n>({\n size: \"default\",\n variant: \"default\",\n spacing: 2,\n orientation: \"horizontal\",\n showCheckIcon: false,\n});\n\nfunction ToggleGroup({\n className,\n variant,\n size,\n spacing = 2,\n orientation = \"horizontal\",\n showCheckIcon = false,\n children,\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants> & {\n spacing?: number;\n orientation?: \"horizontal\" | \"vertical\";\n showCheckIcon?: boolean;\n }) {\n return (\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n data-variant={variant}\n data-size={size}\n data-spacing={spacing}\n data-orientation={orientation}\n style={{ \"--gap\": `${spacing * 0.25}rem` } as React.CSSProperties}\n className={cn(\n \"group/toggle-group data-vertical:flex-col data-vertical:items-stretch flex w-fit flex-row items-center gap-[var(--gap)] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)]\",\n className,\n )}\n {...props}\n >\n <ToggleGroupContext.Provider\n value={{ variant, size, spacing, orientation, showCheckIcon }}\n >\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n );\n}\n\nfunction ToggleGroupItem({\n className,\n children,\n variant = \"default\",\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>) {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n data-variant={context.variant || variant}\n data-size={context.size || size}\n data-spacing={context.spacing}\n className={cn(\n \"group/item group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t shrink-0 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2\",\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className,\n )}\n {...props}\n >\n {context.showCheckIcon && (\n <Check className=\"hidden size-4 group-data-[state=on]/item:block\" />\n )}\n {children}\n </ToggleGroupPrimitive.Item>\n );\n}\n\nexport { ToggleGroup, ToggleGroupItem };\n"],
|
|
5
|
+
"mappings": "sIAEA,UAAYA,MAAW,QAEvB,OAAS,eAAeC,MAA4B,WAKpD,OAAS,SAAAC,MAAa,eA6ChB,cAAAC,EAoBF,QAAAC,MApBE,oBA3CN,IAAMC,EAA2B,gBAM/B,CACA,KAAM,UACN,QAAS,UACT,QAAS,EACT,YAAa,aACb,cAAe,EACjB,CAAC,EAED,SAASC,EAAYC,EAchB,CAdgB,IAAAC,EAAAD,EACnB,WAAAE,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,EACV,YAAAC,EAAc,aACd,cAAAC,EAAgB,GAChB,SAAAC,CAhCF,EAyBqBP,EAQhBQ,EAAAC,EARgBT,EAQhB,CAPH,YACA,UACA,OACA,UACA,cACA,gBACA,aAQA,OACEL,EAACe,EAAqB,KAArBC,EAAAC,EAAA,CACC,YAAU,eACV,eAAcV,EACd,YAAWC,EACX,eAAcC,EACd,mBAAkBC,EAClB,MAAO,CAAE,QAAS,GAAGD,EAAU,GAAI,KAAM,EACzC,UAAWS,EACT,yLACAZ,CACF,GACIO,GAXL,CAaC,SAAAb,EAACE,EAAmB,SAAnB,CACC,MAAO,CAAE,QAAAK,EAAS,KAAAC,EAAM,QAAAC,EAAS,YAAAC,EAAa,cAAAC,CAAc,EAE3D,SAAAC,EACH,GACF,CAEJ,CAEA,SAASO,EAAgBf,EAOc,CAPd,IAAAC,EAAAD,EACvB,WAAAE,EACA,SAAAM,EACA,QAAAL,EAAU,UACV,KAAAC,EAAO,SAnET,EA+DyBH,EAKpBQ,EAAAC,EALoBT,EAKpB,CAJH,YACA,WACA,UACA,SAIA,IAAMe,EAAgB,aAAWlB,CAAkB,EAEnD,OACED,EAACc,EAAqB,KAArBC,EAAAC,EAAA,CACC,YAAU,oBACV,eAAcG,EAAQ,SAAWb,EACjC,YAAWa,EAAQ,MAAQZ,EAC3B,eAAcY,EAAQ,QACtB,UAAWF,EACT,84BACAG,EAAe,CACb,QAASD,EAAQ,SAAWb,EAC5B,KAAMa,EAAQ,MAAQZ,CACxB,CAAC,EACDF,CACF,GACIO,GAbL,CAeE,UAAAO,EAAQ,eACPpB,EAACsB,EAAA,CAAM,UAAU,iDAAiD,EAEnEV,IACH,CAEJ",
|
|
6
|
+
"names": ["React", "ToggleGroupPrimitive", "Check", "jsx", "jsxs", "ToggleGroupContext", "ToggleGroup", "_a", "_b", "className", "variant", "size", "spacing", "orientation", "showCheckIcon", "children", "props", "__objRest", "ToggleGroupPrimitive", "__spreadProps", "__spreadValues", "cn", "ToggleGroupItem", "context", "toggleVariants", "Check"]
|
|
7
|
+
}
|
package/dist/chunk-62LTWWXS.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y,b as k}from"./chunk-BF3VTYEM.js";import{a as e}from"./chunk-WIFBPNRH.js";import{a as r,b as v,c as u}from"./chunk-WHECA25N.js";import*as p from"react";import{ChevronDownIcon as D,ChevronLeftIcon as N,ChevronRightIcon as R}from"lucide-react";import{DayPicker as B,getDefaultClassNames as C}from"react-day-picker";import{jsx as o}from"react/jsx-runtime";function q(b){var _=b,{className:f,classNames:h,showOutsideDays:a=!0,captionLayout:c="label",buttonVariant:w="ghost",formatters:i,components:x}=_,g=u(_,["className","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components"]);let t=C();return o(B,r({showOutsideDays:a,className:e("bg-background group/calendar p-3 [--cell-width:auto] [--cell-height:36px] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,f),captionLayout:c,formatters:r({formatMonthDropdown:n=>n.toLocaleString("default",{month:"short"})},i),classNames:r({root:e("w-fit",t.root),months:e("relative flex flex-col gap-4 md:flex-row",t.months),month:e("flex w-full flex-col gap-4",t.month),nav:e("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",t.nav),button_previous:e(y({variant:w}),"h-[--cell-height] w-[--cell-width] select-none p-0 aria-disabled:opacity-50",t.button_previous),button_next:e(y({variant:w}),"h-[--cell-height] w-[--cell-width] select-none p-0 aria-disabled:opacity-50",t.button_next),month_caption:e("flex h-[--cell-height] w-full items-center justify-center px-[--cell-width]",t.month_caption),dropdowns:e("flex h-[--cell-height] w-full items-center justify-center gap-1.5 text-sm font-medium",t.dropdowns),dropdown_root:e("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",t.dropdown_root),dropdown:e("absolute inset-0 opacity-0",t.dropdown),caption_label:e("select-none font-medium",c==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",t.caption_label),table:"w-full border-collapse",weekdays:e("flex",t.weekdays),weekday:e("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",t.weekday),week:e("mt-2 flex w-full h-[--cell-height]",t.week),week_number_header:e("w-[--cell-width] select-none",t.week_number_header),week_number:e("text-muted-foreground select-none text-[0.8rem]",t.week_number),day:e("group/day relative aspect-square h-[--cell-height] w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",t.day),range_start:e("bg-accent rounded-l-md",t.range_start),range_middle:e("rounded-none",t.range_middle),range_end:e("bg-accent rounded-r-md",t.range_end),today:e("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",t.today),outside:e("text-muted-foreground aria-selected:text-muted-foreground",t.outside),disabled:e("text-muted-foreground opacity-50",t.disabled),hidden:e("invisible",t.hidden)},h),components:r({Root:m=>{var s=m,{className:n,rootRef:d}=s,l=u(s,["className","rootRef"]);return o("div",r({"data-slot":"calendar",ref:d,className:e(n)},l))},Chevron:m=>{var s=m,{className:n,orientation:d}=s,l=u(s,["className","orientation"]);return d==="left"?o(N,r({className:e("size-4",n)},l)):d==="right"?o(R,r({className:e("size-4",n)},l)):o(D,r({className:e("size-4",n)},l))},DayButton:z,WeekNumber:l=>{var m=l,{children:n}=m,d=u(m,["children"]);return o("td",v(r({},d),{children:o("div",{className:"flex w-[--cell-width] h-[--cell-height] items-center justify-center text-center",children:n})}))}},x)},g))}function z(w){var i=w,{className:f,day:h,modifiers:a}=i,c=u(i,["className","day","modifiers"]);let x=C(),g=p.useRef(null);return p.useEffect(()=>{var b;a.focused&&((b=g.current)==null||b.focus())},[a.focused]),o(k,r({ref:g,variant:"ghost",size:"icon","data-day":h.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:e("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-primary data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-[--cell-height] w-full min-w-[--cell-width] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",x.day,f)},c))}export{q as a,z as b};
|
|
2
|
-
//# sourceMappingURL=chunk-62LTWWXS.js.map
|
|
1
|
+
import{a as y,b as k}from"./chunk-BF3VTYEM.js";import{a as e}from"./chunk-WIFBPNRH.js";import{a as r,b as v,c as u}from"./chunk-WHECA25N.js";import*as p from"react";import{ChevronDownIcon as D,ChevronLeftIcon as N,ChevronRightIcon as R}from"lucide-react";import{DayPicker as B,getDefaultClassNames as C}from"react-day-picker";import{jsx as o}from"react/jsx-runtime";function q(b){var _=b,{className:f,classNames:h,showOutsideDays:a=!0,captionLayout:c="label",buttonVariant:w="ghost",formatters:i,components:x}=_,g=u(_,["className","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components"]);let t=C();return o(B,r({showOutsideDays:a,className:e("bg-background group/calendar p-3 [--cell-width:auto] [--cell-height:36px] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,f),captionLayout:c,formatters:r({formatMonthDropdown:n=>n.toLocaleString("default",{month:"short"})},i),classNames:r({root:e("w-fit",t.root),months:e("relative flex flex-col gap-4 md:flex-row",t.months),month:e("flex w-full flex-col gap-4",t.month),nav:e("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",t.nav),button_previous:e(y({variant:w}),"h-[--cell-height] w-[--cell-width] select-none p-0 aria-disabled:opacity-50",t.button_previous),button_next:e(y({variant:w}),"h-[--cell-height] w-[--cell-width] select-none p-0 aria-disabled:opacity-50",t.button_next),month_caption:e("flex h-[--cell-height] w-full items-center justify-center px-[--cell-width]",t.month_caption),dropdowns:e("flex h-[--cell-height] w-full items-center justify-center gap-1.5 text-sm font-medium",t.dropdowns),dropdown_root:e("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",t.dropdown_root),dropdown:e("absolute inset-0 opacity-0",t.dropdown),caption_label:e("select-none font-medium",c==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",t.caption_label),table:"w-full border-collapse",weekdays:e("flex",t.weekdays),weekday:e("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",t.weekday),week:e("mt-2 flex w-full h-[--cell-height]",t.week),week_number_header:e("w-[--cell-width] select-none",t.week_number_header),week_number:e("text-muted-foreground select-none text-[0.8rem]",t.week_number),day:e("group/day relative aspect-square h-[--cell-height] w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",t.day),range_start:e("bg-accent rounded-l-md",t.range_start),range_middle:e("rounded-none",t.range_middle),range_end:e("bg-accent rounded-r-md",t.range_end),today:e("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",t.today),outside:e("text-muted-foreground aria-selected:text-muted-foreground",t.outside),disabled:e("text-muted-foreground opacity-50",t.disabled),hidden:e("invisible",t.hidden)},h),components:r({Root:m=>{var s=m,{className:n,rootRef:d}=s,l=u(s,["className","rootRef"]);return o("div",r({"data-slot":"calendar",ref:d,className:e(n)},l))},Chevron:m=>{var s=m,{className:n,orientation:d}=s,l=u(s,["className","orientation"]);return d==="left"?o(N,r({className:e("size-4",n)},l)):d==="right"?o(R,r({className:e("size-4",n)},l)):o(D,r({className:e("size-4",n)},l))},DayButton:z,WeekNumber:l=>{var m=l,{children:n}=m,d=u(m,["children"]);return o("td",v(r({},d),{children:o("div",{className:"flex w-[--cell-width] h-[--cell-height] items-center justify-center text-center",children:n})}))}},x)},g))}function z(w){var i=w,{className:f,day:h,modifiers:a}=i,c=u(i,["className","day","modifiers"]);let x=C(),g=p.useRef(null);return p.useEffect(()=>{var b;a.focused&&((b=g.current)==null||b.focus())},[a.focused]),o(k,r({ref:g,variant:"ghost",size:"icon","data-day":h.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:e("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-primary data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-[--cell-height] w-full min-w-[--cell-width] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",x.day,f)},c))}export{q as a,z as b};
|
|
2
|
+
//# sourceMappingURL=chunk-62LTWWXS.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/calendar/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react'\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react'\nimport { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker'\n\nimport { cn } from '@/lib/utils'\nimport { Button, buttonVariants } from '@/components/button'\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant']\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n 'bg-background group/calendar p-3 [--cell-width:auto] [--cell-height:36px] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),\n ...formatters,\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn(\n 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'h-[--cell-height] w-[--cell-width] select-none p-0 aria-disabled:opacity-50',\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'h-[--cell-height] w-[--cell-width] select-none p-0 aria-disabled:opacity-50',\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n 'flex h-[--cell-height] w-full items-center justify-center px-[--cell-width]',\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n 'flex h-[--cell-height] w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n 'has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border',\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn('absolute inset-0 opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'select-none font-medium',\n captionLayout === 'label'\n ? 'text-sm'\n : '[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5',\n defaultClassNames.caption_label,\n ),\n table: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal',\n defaultClassNames.weekday,\n ),\n week: cn('mt-2 flex w-full h-[--cell-height]', defaultClassNames.week),\n week_number_header: cn(\n 'w-[--cell-width] select-none',\n defaultClassNames.week_number_header,\n ),\n week_number: cn(\n 'text-muted-foreground select-none text-[0.8rem]',\n defaultClassNames.week_number,\n ),\n day: cn(\n 'group/day relative aspect-square h-[--cell-height] w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md',\n defaultClassNames.day,\n ),\n range_start: cn('bg-accent rounded-l-md', defaultClassNames.range_start),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn('bg-accent rounded-r-md', defaultClassNames.range_end),\n today: cn(\n 'bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none',\n defaultClassNames.today,\n ),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside,\n ),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return <div data-slot=\"calendar\" ref={rootRef} className={cn(className)} {...props} />\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === 'left') {\n return <ChevronLeftIcon className={cn('size-4', className)} {...props} />\n }\n\n if (orientation === 'right') {\n return <ChevronRightIcon className={cn('size-4', className)} {...props} />\n }\n\n return <ChevronDownIcon className={cn('size-4', className)} {...props} />\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex w-[--cell-width] h-[--cell-height] items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-primary data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-[--cell-height] w-full min-w-[--cell-width] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n"],
|
|
5
|
-
"mappings": "6IAAA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,EAAiB,mBAAAC,EAAiB,oBAAAC,MAAwB,eACnE,OAAoB,aAAAC,EAAW,wBAAAC,MAA4B,mBA2G1C,cAAAC,MAAA,oBAtGjB,SAASC,EAASC,EAWf,CAXe,IAAAC,EAAAD,EAChB,WAAAE,EACA,WAAAC,EACA,gBAAAC,EAAkB,GAClB,cAAAC,EAAgB,QAChB,cAAAC,EAAgB,QAChB,WAAAC,EACA,WAAAC,CAdF,EAOkBP,EAQbQ,EAAAC,EARaT,EAQb,CAPH,YACA,aACA,kBACA,gBACA,gBACA,aACA,eAKA,IAAMU,EAAoBC,EAAqB,EAE/C,OACEd,EAACe,EAAAC,EAAA,CACC,gBAA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AS/B,EAAAgC,EAAI,UAAJ,MAAAhC,EAAa,QACtC,EAAG,CAAC+B,EAAU,OAAO,CAAC,EAGpBjC,EAACmC,EAAAnB,EAAA,CACC,IAAKkB,EACL,QAAQ,QACR,KAAK,OACL,WAAUF,EAAI,KAAK,mBAAmB,EACtC,uBACEC,EAAU,UACV,CAACA,EAAU,aACX,CAACA,EAAU,WACX,CAACA,EAAU,aAEb,mBAAkBA,EAAU,YAC5B,iBAAgBA,EAAU,UAC1B,oBAAmBA,EAAU,aAC7B,UAAWhB,EACT,wwBACAJ,EAAkB,IAClBT,CACF,GACIO,EACN,CAEJ",
|
|
6
|
-
"names": ["React", "ChevronDownIcon", "ChevronLeftIcon", "ChevronRightIcon", "DayPicker", "getDefaultClassNames", "jsx", "Calendar", "_a", "_b", "className", "classNames", "showOutsideDays", "captionLayout", "buttonVariant", "formatters", "components", "props", "__objRest", "defaultClassNames", "getDefaultClassNames", "DayPicker", "__spreadValues", "cn", "date", "buttonVariants", "rootRef", "_c", "_d", "orientation", "ChevronLeftIcon", "ChevronRightIcon", "ChevronDownIcon", "CalendarDayButton", "_e", "_f", "children", "__spreadProps", "day", "modifiers", "ref", "Button"]
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/calendar/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react'\nimport { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker'\n\nimport { cn } from '@/lib/utils'\nimport { Button, buttonVariants } from '@/components/button'\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant']\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n 'bg-background group/calendar p-3 [--cell-width:auto] [--cell-height:36px] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),\n ...formatters,\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn(\n 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'h-[--cell-height] w-[--cell-width] select-none p-0 aria-disabled:opacity-50',\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'h-[--cell-height] w-[--cell-width] select-none p-0 aria-disabled:opacity-50',\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n 'flex h-[--cell-height] w-full items-center justify-center px-[--cell-width]',\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n 'flex h-[--cell-height] w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n 'has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border',\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn('absolute inset-0 opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'select-none font-medium',\n captionLayout === 'label'\n ? 'text-sm'\n : '[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5',\n defaultClassNames.caption_label,\n ),\n table: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal',\n defaultClassNames.weekday,\n ),\n week: cn('mt-2 flex w-full h-[--cell-height]', defaultClassNames.week),\n week_number_header: cn(\n 'w-[--cell-width] select-none',\n defaultClassNames.week_number_header,\n ),\n week_number: cn(\n 'text-muted-foreground select-none text-[0.8rem]',\n defaultClassNames.week_number,\n ),\n day: cn(\n 'group/day relative aspect-square h-[--cell-height] w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md',\n defaultClassNames.day,\n ),\n range_start: cn('bg-accent rounded-l-md', defaultClassNames.range_start),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn('bg-accent rounded-r-md', defaultClassNames.range_end),\n today: cn(\n 'bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none',\n defaultClassNames.today,\n ),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside,\n ),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return <div data-slot=\"calendar\" ref={rootRef} className={cn(className)} {...props} />\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === 'left') {\n return <ChevronLeftIcon className={cn('size-4', className)} {...props} />\n }\n\n if (orientation === 'right') {\n return <ChevronRightIcon className={cn('size-4', className)} {...props} />\n }\n\n return <ChevronDownIcon className={cn('size-4', className)} {...props} />\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex w-[--cell-width] h-[--cell-height] items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-primary data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-[--cell-height] w-full min-w-[--cell-width] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n"],
|
|
5
|
+
"mappings": "6IAAA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,EAAiB,mBAAAC,EAAiB,oBAAAC,MAAwB,eACnE,OAAoB,aAAAC,EAAW,wBAAAC,MAA4B,mBA2G1C,cAAAC,MAAA,oBAtGjB,SAASC,EAASC,EAWf,CAXe,IAAAC,EAAAD,EAChB,WAAAE,EACA,WAAAC,EACA,gBAAAC,EAAkB,GAClB,cAAAC,EAAgB,QAChB,cAAAC,EAAgB,QAChB,WAAAC,EACA,WAAAC,CAdF,EAOkBP,EAQbQ,EAAAC,EARaT,EAQb,CAPH,YACA,aACA,kBACA,gBACA,gBACA,aACA,eAKA,IAAMU,EAAoBC,EAAqB,EAE/C,OACEd,EAACe,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hC,EAqJQ+B,EAAU,WAAS/B,EAAAgC,EAAI,UAAJ,MAAAhC,EAAa,QACtC,EAAG,CAAC+B,EAAU,OAAO,CAAC,EAGpBjC,EAACmC,EAAAnB,EAAA,CACC,IAAKkB,EACL,QAAQ,QACR,KAAK,OACL,WAAUF,EAAI,KAAK,mBAAmB,EACtC,uBACEC,EAAU,UACV,CAACA,EAAU,aACX,CAACA,EAAU,WACX,CAACA,EAAU,aAEb,mBAAkBA,EAAU,YAC5B,iBAAgBA,EAAU,UAC1B,oBAAmBA,EAAU,aAC7B,UAAWhB,EACT,wwBACAJ,EAAkB,IAClBT,CACF,GACIO,EACN,CAEJ",
|
|
6
|
+
"names": ["React", "ChevronDownIcon", "ChevronLeftIcon", "ChevronRightIcon", "DayPicker", "getDefaultClassNames", "jsx", "Calendar", "_a", "_b", "className", "classNames", "showOutsideDays", "captionLayout", "buttonVariant", "formatters", "components", "props", "__objRest", "defaultClassNames", "getDefaultClassNames", "DayPicker", "__spreadValues", "cn", "date", "buttonVariants", "rootRef", "_c", "_d", "orientation", "ChevronLeftIcon", "ChevronRightIcon", "ChevronDownIcon", "CalendarDayButton", "_e", "_f", "children", "__spreadProps", "day", "modifiers", "ref", "Button"]
|
|
7
|
+
}
|
package/dist/chunk-63IVPQSD.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h,b as y,c as N,e as C,f as P}from"./chunk-S2I5LIDP.js";import{a as k}from"./chunk-46MFR2CI.js";import{a as n}from"./chunk-WIFBPNRH.js";import*as r from"react";import{Dialog as l}from"radix-ui";import{XIcon as R}from"lucide-react";import{jsx as e,jsxs as o}from"react/jsx-runtime";var f="rounded-full border-0 bg-primary-dark text-inverted-primary shadow-[0_1px_3px_rgba(0,0,0,0.3)] hover:bg-primary-dark/80 hover:text-inverted-primary disabled:opacity-40";function $(t,m){let u=r.useCallback(a=>t?(t.on("reInit",a),t.on("select",a),()=>{t.off("reInit",a),t.off("select",a)}):()=>{},[t]);return r.useSyncExternalStore(u,()=>{var a;return(a=t==null?void 0:t.selectedScrollSnap())!=null?a:m},()=>m)}function S({photos:t,open:m,onOpenChange:u,initialIndex:a=0,title:v="Photos",trigger:p}){let w=k(),[c,z]=r.useState(),g=r.useRef(null),d=$(c,a),x=`${d+1} of ${t.length}`;return o(l.Root,{open:m,onOpenChange:u,children:[p&&e(l.Trigger,{asChild:!0,children:p}),o(l.Portal,{children:[e(l.Overlay,{className:"fixed inset-0 z-50 bg-black/[0.92] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 max-sm:bg-black/95"}),o(l.Content,{"data-slot":"photo-lightbox","aria-describedby":void 0,onOpenAutoFocus:()=>{g.current=document.activeElement},onCloseAutoFocus:i=>{var s;p||(i.preventDefault(),(s=g.current)==null||s.focus())},className:"fixed inset-0 z-50 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",children:[e(l.Title,{className:"sr-only",children:v}),o(h,{setApi:z,opts:{startIndex:a},className:"flex h-full flex-col items-center gap-6 p-6 sm:gap-0 sm:px-6 sm:pb-8 sm:pt-6",children:[o("div",{className:"relative flex h-10 w-full shrink-0 items-center justify-center",children:[o(l.Close,{className:n(f,"absolute flex items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-inverted-primary/60","left-0 size-8 sm:left-auto sm:right-0 sm:size-10"),children:[e(R,{className:"size-4 sm:size-5"}),e("span",{className:"sr-only",children:"Close"})]}),e("p",{className:"text-sm font-medium text-inverted-primary/60 sm:hidden",children:x}),e("p",{className:"hidden text-[11px] tracking-[0.015em] text-inverted-primary sm:block",children:w?"Swipe to navigate":"Use arrow keys to navigate \xB7 ESC to close"})]}),o("div",{className:"relative flex min-h-0 w-full flex-1 items-center justify-center sm:px-20 sm:py-8",children:[e("div",{className:"w-full",children:e(y,{className:"ml-0",children:t.map((i,s)=>{var b;return e(N,{className:"flex items-center justify-center pl-0",children:e("img",{src:i.src,alt:(b=i.alt)!=null?b:`${v} ${s+1}`,className:"max-h-[calc(100dvh-16rem)] max-w-full rounded-md object-contain shadow-[0_6px_24px_rgba(0,0,0,0.35)] sm:max-h-[calc(100dvh-14rem)] sm:max-w-[min(900px,100%)] sm:rounded-lg"})},`${i.src}-${s}`)})})}),e(C,{placement:"inline",className:n(f,"absolute left-1.5 top-1/2 size-10 -translate-y-1/2 sm:left-0 sm:size-12")}),e(P,{placement:"inline",className:n(f,"absolute right-1.5 top-1/2 size-10 -translate-y-1/2 sm:right-0 sm:size-12")})]}),t.length>1&&o("div",{className:"flex shrink-0 flex-col items-center gap-6 sm:gap-2.5",children:[e("div",{className:"flex max-w-full gap-1.5 overflow-x-auto sm:gap-2",children:t.map((i,s)=>e("button",{type:"button",onClick:()=>c==null?void 0:c.scrollTo(s),"aria-label":`Show photo ${s+1}`,"aria-current":s===d,className:n("h-9 w-12 shrink-0 overflow-hidden rounded-[5px] opacity-40 outline-none transition-opacity hover:opacity-70 focus-visible:ring-2 focus-visible:ring-inverted-primary/60 sm:h-12 sm:w-16 sm:rounded-[6px] sm:opacity-45",s===d&&"border-2 border-inverted-primary opacity-100 sm:opacity-100"),children:e("img",{src:i.src,alt:"",className:"size-full object-cover"})},`${i.src}-${s}`))}),e("div",{className:"flex gap-2.5 sm:gap-1.5","aria-hidden":"true",children:t.map((i,s)=>e("span",{className:n("size-1.5 rounded-full bg-inverted-primary/40 sm:size-2",s===d&&"bg-inverted-primary")},`${i.src}-${s}`))}),e("p",{className:"hidden text-[13px] font-medium tracking-[0.005em] text-inverted-primary/50 sm:block",children:x}),e("p",{className:"text-[11px] tracking-[0.015em] text-inverted-primary/60 sm:hidden",children:"Swipe to navigate"})]})]})]})]})]})}export{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-63IVPQSD.js.map
|
|
1
|
+
import{a as h,b as y,c as N,e as C,f as P}from"./chunk-S2I5LIDP.js";import{a as k}from"./chunk-46MFR2CI.js";import{a as n}from"./chunk-WIFBPNRH.js";import*as r from"react";import{Dialog as l}from"radix-ui";import{XIcon as R}from"lucide-react";import{jsx as e,jsxs as o}from"react/jsx-runtime";var f="rounded-full border-0 bg-primary-dark text-inverted-primary shadow-[0_1px_3px_rgba(0,0,0,0.3)] hover:bg-primary-dark/80 hover:text-inverted-primary disabled:opacity-40";function $(t,m){let u=r.useCallback(a=>t?(t.on("reInit",a),t.on("select",a),()=>{t.off("reInit",a),t.off("select",a)}):()=>{},[t]);return r.useSyncExternalStore(u,()=>{var a;return(a=t==null?void 0:t.selectedScrollSnap())!=null?a:m},()=>m)}function S({photos:t,open:m,onOpenChange:u,initialIndex:a=0,title:v="Photos",trigger:p}){let w=k(),[c,z]=r.useState(),g=r.useRef(null),d=$(c,a),x=`${d+1} of ${t.length}`;return o(l.Root,{open:m,onOpenChange:u,children:[p&&e(l.Trigger,{asChild:!0,children:p}),o(l.Portal,{children:[e(l.Overlay,{className:"fixed inset-0 z-50 bg-black/[0.92] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 max-sm:bg-black/95"}),o(l.Content,{"data-slot":"photo-lightbox","aria-describedby":void 0,onOpenAutoFocus:()=>{g.current=document.activeElement},onCloseAutoFocus:i=>{var s;p||(i.preventDefault(),(s=g.current)==null||s.focus())},className:"fixed inset-0 z-50 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",children:[e(l.Title,{className:"sr-only",children:v}),o(h,{setApi:z,opts:{startIndex:a},className:"flex h-full flex-col items-center gap-6 p-6 sm:gap-0 sm:px-6 sm:pb-8 sm:pt-6",children:[o("div",{className:"relative flex h-10 w-full shrink-0 items-center justify-center",children:[o(l.Close,{className:n(f,"absolute flex items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-inverted-primary/60","left-0 size-8 sm:left-auto sm:right-0 sm:size-10"),children:[e(R,{className:"size-4 sm:size-5"}),e("span",{className:"sr-only",children:"Close"})]}),e("p",{className:"text-sm font-medium text-inverted-primary/60 sm:hidden",children:x}),e("p",{className:"hidden text-[11px] tracking-[0.015em] text-inverted-primary sm:block",children:w?"Swipe to navigate":"Use arrow keys to navigate \xB7 ESC to close"})]}),o("div",{className:"relative flex min-h-0 w-full flex-1 items-center justify-center sm:px-20 sm:py-8",children:[e("div",{className:"w-full",children:e(y,{className:"ml-0",children:t.map((i,s)=>{var b;return e(N,{className:"flex items-center justify-center pl-0",children:e("img",{src:i.src,alt:(b=i.alt)!=null?b:`${v} ${s+1}`,className:"max-h-[calc(100dvh-16rem)] max-w-full rounded-md object-contain shadow-[0_6px_24px_rgba(0,0,0,0.35)] sm:max-h-[calc(100dvh-14rem)] sm:max-w-[min(900px,100%)] sm:rounded-lg"})},`${i.src}-${s}`)})})}),e(C,{placement:"inline",className:n(f,"absolute left-1.5 top-1/2 size-10 -translate-y-1/2 sm:left-0 sm:size-12")}),e(P,{placement:"inline",className:n(f,"absolute right-1.5 top-1/2 size-10 -translate-y-1/2 sm:right-0 sm:size-12")})]}),t.length>1&&o("div",{className:"flex shrink-0 flex-col items-center gap-6 sm:gap-2.5",children:[e("div",{className:"flex max-w-full gap-1.5 overflow-x-auto sm:gap-2",children:t.map((i,s)=>e("button",{type:"button",onClick:()=>c==null?void 0:c.scrollTo(s),"aria-label":`Show photo ${s+1}`,"aria-current":s===d,className:n("h-9 w-12 shrink-0 overflow-hidden rounded-[5px] opacity-40 outline-none transition-opacity hover:opacity-70 focus-visible:ring-2 focus-visible:ring-inverted-primary/60 sm:h-12 sm:w-16 sm:rounded-[6px] sm:opacity-45",s===d&&"border-2 border-inverted-primary opacity-100 sm:opacity-100"),children:e("img",{src:i.src,alt:"",className:"size-full object-cover"})},`${i.src}-${s}`))}),e("div",{className:"flex gap-2.5 sm:gap-1.5","aria-hidden":"true",children:t.map((i,s)=>e("span",{className:n("size-1.5 rounded-full bg-inverted-primary/40 sm:size-2",s===d&&"bg-inverted-primary")},`${i.src}-${s}`))}),e("p",{className:"hidden text-[13px] font-medium tracking-[0.005em] text-inverted-primary/50 sm:block",children:x}),e("p",{className:"text-[11px] tracking-[0.015em] text-inverted-primary/60 sm:hidden",children:"Swipe to navigate"})]})]})]})]})]})}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-63IVPQSD.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/photo-lightbox/index.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n type CarouselApi,\n} from \"@/components/carousel\";\nimport { useIsTouchDevice } from \"@/hooks/use-is-touch-device\";\n\nexport type PhotoLightboxPhoto = {\n src: string;\n alt?: string;\n};\n\nexport type PhotoLightboxProps = {\n photos: PhotoLightboxPhoto[];\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n initialIndex?: number;\n title?: string;\n trigger?: React.ReactNode;\n};\n\nconst iconButtonClassName =\n \"rounded-full border-0 bg-primary-dark text-inverted-primary shadow-[0_1px_3px_rgba(0,0,0,0.3)] hover:bg-primary-dark/80 hover:text-inverted-primary disabled:opacity-40\";\n\nfunction useSelectedIndex(api: CarouselApi, fallback: number) {\n const subscribe = React.useCallback(\n (onStoreChange: () => void) => {\n if (!api) return () => undefined;\n api.on(\"reInit\", onStoreChange);\n api.on(\"select\", onStoreChange);\n return () => {\n api.off(\"reInit\", onStoreChange);\n api.off(\"select\", onStoreChange);\n };\n },\n [api],\n );\n\n return React.useSyncExternalStore(\n subscribe,\n () => api?.selectedScrollSnap() ?? fallback,\n () => fallback,\n );\n}\n\n/**\n * Full-screen photo viewer with arrows, thumbnails and dots; swipe-first on touch devices.\n * @param props.photos - photos to browse\n * @param props.initialIndex - photo shown when the viewer opens\n * @param props.trigger - optional element that opens the viewer\n */\nfunction PhotoLightbox({\n photos,\n open,\n onOpenChange,\n initialIndex = 0,\n title = \"Photos\",\n trigger,\n}: PhotoLightboxProps) {\n const isTouch = useIsTouchDevice();\n const [api, setApi] = React.useState<CarouselApi>();\n const openerRef = React.useRef<HTMLElement | null>(null);\n const selected = useSelectedIndex(api, initialIndex);\n const counter = `${selected + 1} of ${photos.length}`;\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n {trigger && (\n <DialogPrimitive.Trigger asChild>{trigger}</DialogPrimitive.Trigger>\n )}\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/[0.92] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 max-sm:bg-black/95\" />\n <DialogPrimitive.Content\n data-slot=\"photo-lightbox\"\n aria-describedby={undefined}\n onOpenAutoFocus={() => {\n openerRef.current = document.activeElement as HTMLElement | null;\n }}\n onCloseAutoFocus={(event) => {\n // Radix only restores focus to its own Trigger\n if (trigger) return;\n event.preventDefault();\n openerRef.current?.focus();\n }}\n className=\"fixed inset-0 z-50 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\"\n >\n <DialogPrimitive.Title className=\"sr-only\">\n {title}\n </DialogPrimitive.Title>\n <Carousel\n setApi={setApi}\n opts={{ startIndex: initialIndex }}\n className=\"flex h-full flex-col items-center gap-6 p-6 sm:gap-0 sm:px-6 sm:pb-8 sm:pt-6\"\n >\n <div className=\"relative flex h-10 w-full shrink-0 items-center justify-center\">\n <DialogPrimitive.Close\n className={cn(\n iconButtonClassName,\n \"absolute flex items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-inverted-primary/60\",\n \"left-0 size-8 sm:left-auto sm:right-0 sm:size-10\",\n )}\n >\n <XIcon className=\"size-4 sm:size-5\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n <p className=\"text-sm font-medium text-inverted-primary/60 sm:hidden\">\n {counter}\n </p>\n <p className=\"hidden text-[11px] tracking-[0.015em] text-inverted-primary sm:block\">\n {isTouch\n ? \"Swipe to navigate\"\n : \"Use arrow keys to navigate \u00B7 ESC to close\"}\n </p>\n </div>\n\n <div className=\"relative flex min-h-0 w-full flex-1 items-center justify-center sm:px-20 sm:py-8\">\n <div className=\"w-full\">\n <CarouselContent className=\"ml-0\">\n {photos.map((photo, index) => (\n <CarouselItem\n key={`${photo.src}-${index}`}\n className=\"flex items-center justify-center pl-0\"\n >\n <img\n src={photo.src}\n alt={photo.alt ?? `${title} ${index + 1}`}\n className=\"max-h-[calc(100dvh-16rem)] max-w-full rounded-md object-contain shadow-[0_6px_24px_rgba(0,0,0,0.35)] sm:max-h-[calc(100dvh-14rem)] sm:max-w-[min(900px,100%)] sm:rounded-lg\"\n />\n </CarouselItem>\n ))}\n </CarouselContent>\n </div>\n <CarouselPrevious\n placement=\"inline\"\n className={cn(\n iconButtonClassName,\n \"absolute left-1.5 top-1/2 size-10 -translate-y-1/2 sm:left-0 sm:size-12\",\n )}\n />\n <CarouselNext\n placement=\"inline\"\n className={cn(\n iconButtonClassName,\n \"absolute right-1.5 top-1/2 size-10 -translate-y-1/2 sm:right-0 sm:size-12\",\n )}\n />\n </div>\n\n {photos.length > 1 && (\n <div className=\"flex shrink-0 flex-col items-center gap-6 sm:gap-2.5\">\n <div className=\"flex max-w-full gap-1.5 overflow-x-auto sm:gap-2\">\n {photos.map((photo, index) => (\n <button\n key={`${photo.src}-${index}`}\n type=\"button\"\n onClick={() => api?.scrollTo(index)}\n aria-label={`Show photo ${index + 1}`}\n aria-current={index === selected}\n className={cn(\n \"h-9 w-12 shrink-0 overflow-hidden rounded-[5px] opacity-40 outline-none transition-opacity hover:opacity-70 focus-visible:ring-2 focus-visible:ring-inverted-primary/60 sm:h-12 sm:w-16 sm:rounded-[6px] sm:opacity-45\",\n index === selected &&\n \"border-2 border-inverted-primary opacity-100 sm:opacity-100\",\n )}\n >\n <img\n src={photo.src}\n alt=\"\"\n className=\"size-full object-cover\"\n />\n </button>\n ))}\n </div>\n <div className=\"flex gap-2.5 sm:gap-1.5\" aria-hidden=\"true\">\n {photos.map((photo, index) => (\n <span\n key={`${photo.src}-${index}`}\n className={cn(\n \"size-1.5 rounded-full bg-inverted-primary/40 sm:size-2\",\n index === selected && \"bg-inverted-primary\",\n )}\n />\n ))}\n </div>\n <p className=\"hidden text-[13px] font-medium tracking-[0.005em] text-inverted-primary/50 sm:block\">\n {counter}\n </p>\n <p className=\"text-[11px] tracking-[0.015em] text-inverted-primary/60 sm:hidden\">\n Swipe to navigate\n </p>\n </div>\n )}\n </Carousel>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n}\n\nexport { PhotoLightbox };\n"],
|
|
5
|
-
"mappings": "oJAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,WAC1C,OAAS,SAAAC,MAAa,eA0Ed,cAAAC,EA2BM,QAAAC,MA3BN,oBA/CR,IAAMC,EACJ,0KAEF,SAASC,EAAiBC,EAAkBC,EAAkB,CAC5D,IAAMC,EAAkB,cACrBC,GACMH,GACLA,EAAI,GAAG,SAAUG,CAAa,EAC9BH,EAAI,GAAG,SAAUG,CAAa,EACvB,IAAM,CACXH,EAAI,IAAI,SAAUG,CAAa,EAC/BH,EAAI,IAAI,SAAUG,CAAa,CACjC,GANiB,IAAG,GAQtB,CAACH,CAAG,CACN,EAEA,OAAa,uBACXE,EACA,IAAG,CAlDP,IAAAE,EAkDU,OAAAA,EAAAJ,GAAA,YAAAA,EAAK,uBAAL,KAAAI,EAA6BH,GACnC,IAAMA,CACR,CACF,CAQA,SAASI,EAAc,CACrB,OAAAC,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,EACf,MAAAC,EAAQ,SACR,QAAAC,CACF,EAAuB,CACrB,IAAMC,EAAUC,EAA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AAAR,EAAC8B,EAAA,CAEC,UAAU,wCAEV,SAAA9B,EAAC,OACC,IAAK4B,EAAM,IACX,KAAKpB,EAAAoB,EAAM,MAAN,KAAApB,EAAa,GAAGM,CAAK,IAAIe,EAAQ,CAAC,GACvC,UAAU,8KACZ,GAPK,GAAGD,EAAM,GAAG,IAAIC,CAAK,EAQ5B,EACD,EACH,EACF,EACA7B,EAAC+B,EAAA,CACC,UAAU,SACV,UAAWN,EACTvB,EACA,yEACF,EACF,EACAF,EAACgC,EAAA,CACC,UAAU,SACV,UAAWP,EACTvB,EACA,2EACF,EACF,GACF,EAECQ,EAAO,OAAS,GACfT,EAAC,OAAI,UAAU,uDACb,UAAAD,EAAC,OAAI,UAAU,mDACZ,SAAAU,EAAO,IAAI,CAACkB,EAAOC,IAClB7B,EAAC,UAEC,KAAK,SACL,QAAS,IAAMI,GAAA,YAAAA,EAAK,SAASyB,GAC7B,aAAY,cAAcA,EAAQ,CAAC,GACnC,eAAcA,IAAUT,EACxB,UAAWK,EACT,yNACAI,IAAUT,GACR,6DACJ,EAEA,SAAApB,EAAC,OACC,IAAK4B,EAAM,IACX,IAAI,GACJ,UAAU,yBACZ,GAfK,GAAGA,EAAM,GAAG,IAAIC,CAAK,EAgB5B,CACD,EACH,EACA7B,EAAC,OAAI,UAAU,0BAA0B,cAAY,OAClD,SAAAU,EAAO,IAAI,CAACkB,EAAOC,IAClB7B,EAAC,QAEC,UAAWyB,EACT,yDACAI,IAAUT,GAAY,qBACxB,GAJK,GAAGQ,EAAM,GAAG,IAAIC,CAAK,EAK5B,CACD,EACH,EACA7B,EAAC,KAAE,UAAU,sFACV,SAAAqB,EACH,EACArB,EAAC,KAAE,UAAU,oEAAoE,6BAEjF,GACF,GAEJ,GACF,GACF,GACF,CAEJ",
|
|
6
|
-
"names": ["React", "DialogPrimitive", "XIcon", "jsx", "jsxs", "iconButtonClassName", "useSelectedIndex", "api", "fallback", "subscribe", "onStoreChange", "_a", "PhotoLightbox", "photos", "open", "onOpenChange", "initialIndex", "title", "trigger", "isTouch", "useIsTouchDevice", "setApi", "openerRef", "selected", "counter", "DialogPrimitive", "event", "Carousel", "cn", "XIcon", "CarouselContent", "photo", "index", "CarouselItem", "CarouselPrevious", "CarouselNext"]
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/photo-lightbox/index.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n type CarouselApi,\n} from \"@/components/carousel\";\nimport { useIsTouchDevice } from \"@/hooks/use-is-touch-device\";\n\nexport type PhotoLightboxPhoto = {\n src: string;\n alt?: string;\n};\n\nexport type PhotoLightboxProps = {\n photos: PhotoLightboxPhoto[];\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n initialIndex?: number;\n title?: string;\n trigger?: React.ReactNode;\n};\n\nconst iconButtonClassName =\n \"rounded-full border-0 bg-primary-dark text-inverted-primary shadow-[0_1px_3px_rgba(0,0,0,0.3)] hover:bg-primary-dark/80 hover:text-inverted-primary disabled:opacity-40\";\n\nfunction useSelectedIndex(api: CarouselApi, fallback: number) {\n const subscribe = React.useCallback(\n (onStoreChange: () => void) => {\n if (!api) return () => undefined;\n api.on(\"reInit\", onStoreChange);\n api.on(\"select\", onStoreChange);\n return () => {\n api.off(\"reInit\", onStoreChange);\n api.off(\"select\", onStoreChange);\n };\n },\n [api],\n );\n\n return React.useSyncExternalStore(\n subscribe,\n () => api?.selectedScrollSnap() ?? fallback,\n () => fallback,\n );\n}\n\n/**\n * Full-screen photo viewer with arrows, thumbnails and dots; swipe-first on touch devices.\n * @param props.photos - photos to browse\n * @param props.initialIndex - photo shown when the viewer opens\n * @param props.trigger - optional element that opens the viewer\n */\nfunction PhotoLightbox({\n photos,\n open,\n onOpenChange,\n initialIndex = 0,\n title = \"Photos\",\n trigger,\n}: PhotoLightboxProps) {\n const isTouch = useIsTouchDevice();\n const [api, setApi] = React.useState<CarouselApi>();\n const openerRef = React.useRef<HTMLElement | null>(null);\n const selected = useSelectedIndex(api, initialIndex);\n const counter = `${selected + 1} of ${photos.length}`;\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n {trigger && (\n <DialogPrimitive.Trigger asChild>{trigger}</DialogPrimitive.Trigger>\n )}\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/[0.92] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 max-sm:bg-black/95\" />\n <DialogPrimitive.Content\n data-slot=\"photo-lightbox\"\n aria-describedby={undefined}\n onOpenAutoFocus={() => {\n openerRef.current = document.activeElement as HTMLElement | null;\n }}\n onCloseAutoFocus={(event) => {\n // Radix only restores focus to its own Trigger\n if (trigger) return;\n event.preventDefault();\n openerRef.current?.focus();\n }}\n className=\"fixed inset-0 z-50 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\"\n >\n <DialogPrimitive.Title className=\"sr-only\">\n {title}\n </DialogPrimitive.Title>\n <Carousel\n setApi={setApi}\n opts={{ startIndex: initialIndex }}\n className=\"flex h-full flex-col items-center gap-6 p-6 sm:gap-0 sm:px-6 sm:pb-8 sm:pt-6\"\n >\n <div className=\"relative flex h-10 w-full shrink-0 items-center justify-center\">\n <DialogPrimitive.Close\n className={cn(\n iconButtonClassName,\n \"absolute flex items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-inverted-primary/60\",\n \"left-0 size-8 sm:left-auto sm:right-0 sm:size-10\",\n )}\n >\n <XIcon className=\"size-4 sm:size-5\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n <p className=\"text-sm font-medium text-inverted-primary/60 sm:hidden\">\n {counter}\n </p>\n <p className=\"hidden text-[11px] tracking-[0.015em] text-inverted-primary sm:block\">\n {isTouch\n ? \"Swipe to navigate\"\n : \"Use arrow keys to navigate \u00B7 ESC to close\"}\n </p>\n </div>\n\n <div className=\"relative flex min-h-0 w-full flex-1 items-center justify-center sm:px-20 sm:py-8\">\n <div className=\"w-full\">\n <CarouselContent className=\"ml-0\">\n {photos.map((photo, index) => (\n <CarouselItem\n key={`${photo.src}-${index}`}\n className=\"flex items-center justify-center pl-0\"\n >\n <img\n src={photo.src}\n alt={photo.alt ?? `${title} ${index + 1}`}\n className=\"max-h-[calc(100dvh-16rem)] max-w-full rounded-md object-contain shadow-[0_6px_24px_rgba(0,0,0,0.35)] sm:max-h-[calc(100dvh-14rem)] sm:max-w-[min(900px,100%)] sm:rounded-lg\"\n />\n </CarouselItem>\n ))}\n </CarouselContent>\n </div>\n <CarouselPrevious\n placement=\"inline\"\n className={cn(\n iconButtonClassName,\n \"absolute left-1.5 top-1/2 size-10 -translate-y-1/2 sm:left-0 sm:size-12\",\n )}\n />\n <CarouselNext\n placement=\"inline\"\n className={cn(\n iconButtonClassName,\n \"absolute right-1.5 top-1/2 size-10 -translate-y-1/2 sm:right-0 sm:size-12\",\n )}\n />\n </div>\n\n {photos.length > 1 && (\n <div className=\"flex shrink-0 flex-col items-center gap-6 sm:gap-2.5\">\n <div className=\"flex max-w-full gap-1.5 overflow-x-auto sm:gap-2\">\n {photos.map((photo, index) => (\n <button\n key={`${photo.src}-${index}`}\n type=\"button\"\n onClick={() => api?.scrollTo(index)}\n aria-label={`Show photo ${index + 1}`}\n aria-current={index === selected}\n className={cn(\n \"h-9 w-12 shrink-0 overflow-hidden rounded-[5px] opacity-40 outline-none transition-opacity hover:opacity-70 focus-visible:ring-2 focus-visible:ring-inverted-primary/60 sm:h-12 sm:w-16 sm:rounded-[6px] sm:opacity-45\",\n index === selected &&\n \"border-2 border-inverted-primary opacity-100 sm:opacity-100\",\n )}\n >\n <img\n src={photo.src}\n alt=\"\"\n className=\"size-full object-cover\"\n />\n </button>\n ))}\n </div>\n <div className=\"flex gap-2.5 sm:gap-1.5\" aria-hidden=\"true\">\n {photos.map((photo, index) => (\n <span\n key={`${photo.src}-${index}`}\n className={cn(\n \"size-1.5 rounded-full bg-inverted-primary/40 sm:size-2\",\n index === selected && \"bg-inverted-primary\",\n )}\n />\n ))}\n </div>\n <p className=\"hidden text-[13px] font-medium tracking-[0.005em] text-inverted-primary/50 sm:block\">\n {counter}\n </p>\n <p className=\"text-[11px] tracking-[0.015em] text-inverted-primary/60 sm:hidden\">\n Swipe to navigate\n </p>\n </div>\n )}\n </Carousel>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n}\n\nexport { PhotoLightbox };\n"],
|
|
5
|
+
"mappings": "oJAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,WAC1C,OAAS,SAAAC,MAAa,eA0Ed,cAAAC,EA2BM,QAAAC,MA3BN,oBA/CR,IAAMC,EACJ,0KAEF,SAASC,EAAiBC,EAAkBC,EAAkB,CAC5D,IAAMC,EAAkB,cACrBC,GACMH,GACLA,EAAI,GAAG,SAAUG,CAAa,EAC9BH,EAAI,GAAG,SAAUG,CAAa,EACvB,IAAM,CACXH,EAAI,IAAI,SAAUG,CAAa,EAC/BH,EAAI,IAAI,SAAUG,CAAa,CACjC,GANiB,IAAG,GAQtB,CAACH,CAAG,CACN,EAEA,OAAa,uBACXE,EACA,IAAG,CAlDP,IAAAE,EAkDU,OAAAA,EAAAJ,GAAA,YAAAA,EAAK,uBAAL,KAAAI,EAA6BH,GACnC,IAAMA,CACR,CACF,CAQA,SAASI,EAAc,CACrB,OAAAC,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,EACf,MAAAC,EAAQ,SACR,QAAAC,CACF,EAAuB,CACrB,IAAMC,EAAUC,EAAiB,EAC3B,CAACb,EAAKc,CAAM,EAAU,WAAsB,EAC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,EAAC,OACC,IAAK4B,EAAM,IACX,KAAKpB,EAAAoB,EAAM,MAAN,KAAApB,EAAa,GAAGM,CAAK,IAAIe,EAAQ,CAAC,GACvC,UAAU,8KACZ,GAPK,GAAGD,EAAM,GAAG,IAAIC,CAAK,EAQ5B,EACD,EACH,EACF,EACA7B,EAAC+B,EAAA,CACC,UAAU,SACV,UAAWN,EACTvB,EACA,yEACF,EACF,EACAF,EAACgC,EAAA,CACC,UAAU,SACV,UAAWP,EACTvB,EACA,2EACF,EACF,GACF,EAECQ,EAAO,OAAS,GACfT,EAAC,OAAI,UAAU,uDACb,UAAAD,EAAC,OAAI,UAAU,mDACZ,SAAAU,EAAO,IAAI,CAACkB,EAAOC,IAClB7B,EAAC,UAEC,KAAK,SACL,QAAS,IAAMI,GAAA,YAAAA,EAAK,SAASyB,GAC7B,aAAY,cAAcA,EAAQ,CAAC,GACnC,eAAcA,IAAUT,EACxB,UAAWK,EACT,yNACAI,IAAUT,GACR,6DACJ,EAEA,SAAApB,EAAC,OACC,IAAK4B,EAAM,IACX,IAAI,GACJ,UAAU,yBACZ,GAfK,GAAGA,EAAM,GAAG,IAAIC,CAAK,EAgB5B,CACD,EACH,EACA7B,EAAC,OAAI,UAAU,0BAA0B,cAAY,OAClD,SAAAU,EAAO,IAAI,CAACkB,EAAOC,IAClB7B,EAAC,QAEC,UAAWyB,EACT,yDACAI,IAAUT,GAAY,qBACxB,GAJK,GAAGQ,EAAM,GAAG,IAAIC,CAAK,EAK5B,CACD,EACH,EACA7B,EAAC,KAAE,UAAU,sFACV,SAAAqB,EACH,EACArB,EAAC,KAAE,UAAU,oEAAoE,6BAEjF,GACF,GAEJ,GACF,GACF,GACF,CAEJ",
|
|
6
|
+
"names": ["React", "DialogPrimitive", "XIcon", "jsx", "jsxs", "iconButtonClassName", "useSelectedIndex", "api", "fallback", "subscribe", "onStoreChange", "_a", "PhotoLightbox", "photos", "open", "onOpenChange", "initialIndex", "title", "trigger", "isTouch", "useIsTouchDevice", "setApi", "openerRef", "selected", "counter", "DialogPrimitive", "event", "Carousel", "cn", "XIcon", "CarouselContent", "photo", "index", "CarouselItem", "CarouselPrevious", "CarouselNext"]
|
|
7
|
+
}
|
package/dist/chunk-7H74R7P4.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y,b as N,d as x,g as H,h as P,i as b,j as E,k as M,l as F}from"./chunk-7EVFMYIH.js";import{a as u,b as C,d as f,f as v,g as d,h as T,i as w,j as h}from"./chunk-2R5NZUY2.js";import{a as L}from"./chunk-46MFR2CI.js";import{a as g}from"./chunk-WIFBPNRH.js";import{a as p,b as m,c}from"./chunk-WHECA25N.js";import*as n from"react";import{jsx as r}from"react/jsx-runtime";var D=n.createContext({isTouch:!1}),l=()=>n.useContext(D),Q=({children:o,open:t,onOpenChange:s})=>{let a=L(),e=n.useMemo(()=>({isTouch:a}),[a]);return a?r(D.Provider,{value:e,children:r(y,{open:t,onOpenChange:s,children:r(F,{children:o})})},"touch"):r(D.Provider,{value:e,children:r(u,{open:t,onOpenChange:s,children:o})},"desktop")},A=n.forwardRef((a,s)=>{var e=a,{className:o}=e,t=c(e,["className"]);let{isTouch:i}=l();return r(i?N:C,p({ref:s,className:o},t))});A.displayName="DialogResponsiveTrigger";var W=n.forwardRef((a,s)=>{var e=a,{className:o}=e,t=c(e,["className"]);let{isTouch:i}=l();return r(i?x:f,p({ref:s,className:o},t))});W.displayName="DialogResponsiveClose";var k=n.forwardRef((e,a)=>{var i=e,{className:o,children:t}=i,s=c(i,["className","children"]);let{isTouch:R}=l();return r(R?H:v,m(p({ref:a,className:o},s),{children:t}))});k.displayName="DialogResponsiveContent";var V=s=>{var a=s,{className:o}=a,t=c(a,["className"]);let{isTouch:e}=l();return r(e?P:d,p({className:o},t))};V.displayName="DialogResponsiveHeader";var B=s=>{var a=s,{className:o}=a,t=c(a,["className"]);let{isTouch:e}=l();return r(e?b:T,p({className:g("grid grid-cols-1 gap-2 px-4 pb-safe pt-1",o)},t))};B.displayName="DialogResponsiveFooter";var K=n.forwardRef((a,s)=>{var e=a,{className:o}=e,t=c(e,["className"]);let{isTouch:i}=l();return r(i?E:w,p({ref:s,className:o},t))});K.displayName="DialogResponsiveTitle";var O=n.forwardRef((a,s)=>{var e=a,{className:o}=e,t=c(e,["className"]);let{isTouch:i}=l();return r(i?M:h,p({ref:s,className:o},t))});O.displayName="DialogResponsiveDescription";export{l as a,Q as b,A as c,W as d,k as e,V as f,B as g,K as h,O as i};
|
|
2
|
-
//# sourceMappingURL=chunk-7H74R7P4.js.map
|
|
1
|
+
import{a as y,b as N,d as x,g as H,h as P,i as b,j as E,k as M,l as F}from"./chunk-7EVFMYIH.js";import{a as u,b as C,d as f,f as v,g as d,h as T,i as w,j as h}from"./chunk-2R5NZUY2.js";import{a as L}from"./chunk-46MFR2CI.js";import{a as g}from"./chunk-WIFBPNRH.js";import{a as p,b as m,c}from"./chunk-WHECA25N.js";import*as n from"react";import{jsx as r}from"react/jsx-runtime";var D=n.createContext({isTouch:!1}),l=()=>n.useContext(D),Q=({children:o,open:t,onOpenChange:s})=>{let a=L(),e=n.useMemo(()=>({isTouch:a}),[a]);return a?r(D.Provider,{value:e,children:r(y,{open:t,onOpenChange:s,children:r(F,{children:o})})},"touch"):r(D.Provider,{value:e,children:r(u,{open:t,onOpenChange:s,children:o})},"desktop")},A=n.forwardRef((a,s)=>{var e=a,{className:o}=e,t=c(e,["className"]);let{isTouch:i}=l();return r(i?N:C,p({ref:s,className:o},t))});A.displayName="DialogResponsiveTrigger";var W=n.forwardRef((a,s)=>{var e=a,{className:o}=e,t=c(e,["className"]);let{isTouch:i}=l();return r(i?x:f,p({ref:s,className:o},t))});W.displayName="DialogResponsiveClose";var k=n.forwardRef((e,a)=>{var i=e,{className:o,children:t}=i,s=c(i,["className","children"]);let{isTouch:R}=l();return r(R?H:v,m(p({ref:a,className:o},s),{children:t}))});k.displayName="DialogResponsiveContent";var V=s=>{var a=s,{className:o}=a,t=c(a,["className"]);let{isTouch:e}=l();return r(e?P:d,p({className:o},t))};V.displayName="DialogResponsiveHeader";var B=s=>{var a=s,{className:o}=a,t=c(a,["className"]);let{isTouch:e}=l();return r(e?b:T,p({className:g("grid grid-cols-1 gap-2 px-4 pb-safe pt-1",o)},t))};B.displayName="DialogResponsiveFooter";var K=n.forwardRef((a,s)=>{var e=a,{className:o}=e,t=c(e,["className"]);let{isTouch:i}=l();return r(i?E:w,p({ref:s,className:o},t))});K.displayName="DialogResponsiveTitle";var O=n.forwardRef((a,s)=>{var e=a,{className:o}=e,t=c(e,["className"]);let{isTouch:i}=l();return r(i?M:h,p({ref:s,className:o},t))});O.displayName="DialogResponsiveDescription";export{l as a,Q as b,A as c,W as d,k as e,V as f,B as g,K as h,O as i};
|
|
2
|
+
//# sourceMappingURL=chunk-7H74R7P4.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/dialog-responsive/index.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/components/dialog\";\nimport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n DrawerTrigger,\n DrawerVirtualKeyboardProvider,\n} from \"@/components/drawer\";\nimport { useIsTouchDevice } from \"@/hooks/use-is-touch-device\";\n\ntype DialogResponsiveContextType = {\n isTouch: boolean;\n};\n\nconst DialogResponsiveContext =\n React.createContext<DialogResponsiveContextType>({\n isTouch: false,\n });\n\nconst useDialogResponsive = () => React.useContext(DialogResponsiveContext);\n\ntype DialogResponsiveProps = {\n children: React.ReactNode;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n};\n\nconst DialogResponsive = ({\n children,\n open,\n onOpenChange,\n}: DialogResponsiveProps) => {\n const isTouch = useIsTouchDevice();\n\n const contextValue = React.useMemo(() => ({ isTouch }), [isTouch]);\n\n if (isTouch) {\n return (\n <DialogResponsiveContext.Provider key=\"touch\" value={contextValue}>\n <Drawer open={open} onOpenChange={onOpenChange}>\n <DrawerVirtualKeyboardProvider>\n {children}\n </DrawerVirtualKeyboardProvider>\n </Drawer>\n </DialogResponsiveContext.Provider>\n );\n }\n\n return (\n <DialogResponsiveContext.Provider key=\"desktop\" value={contextValue}>\n <Dialog open={open} onOpenChange={onOpenChange}>\n {children}\n </Dialog>\n </DialogResponsiveContext.Provider>\n );\n};\n\nconst DialogResponsiveTrigger: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogTrigger> &\n React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef(({ className, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerTrigger : DialogTrigger;\n\n return <Comp ref={ref} className={className} {...props} />;\n});\nDialogResponsiveTrigger.displayName = \"DialogResponsiveTrigger\";\n\nconst DialogResponsiveClose: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogClose> &\n React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef(({ className, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerClose : DialogClose;\n\n return <Comp ref={ref} className={className} {...props} />;\n});\nDialogResponsiveClose.displayName = \"DialogResponsiveClose\";\n\nconst DialogResponsiveContent: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogContent> &\n React.RefAttributes<HTMLDivElement>\n> = React.forwardRef(({ className, children, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerContent : DialogContent;\n\n return (\n <Comp ref={ref} className={className} {...props}>\n {children}\n </Comp>\n );\n});\nDialogResponsiveContent.displayName = \"DialogResponsiveContent\";\n\nconst DialogResponsiveHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerHeader : DialogHeader;\n\n return <Comp className={className} {...props} />;\n};\nDialogResponsiveHeader.displayName = \"DialogResponsiveHeader\";\n\nconst DialogResponsiveFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerFooter : DialogFooter;\n\n return (\n <Comp\n className={cn(\"grid grid-cols-1 gap-2 px-4 pb-safe pt-1\", className)}\n {...props}\n />\n );\n};\nDialogResponsiveFooter.displayName = \"DialogResponsiveFooter\";\n\nconst DialogResponsiveTitle: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogTitle> &\n React.RefAttributes<HTMLHeadingElement>\n> = React.forwardRef(({ className, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerTitle : DialogTitle;\n\n return <Comp ref={ref} className={className} {...props} />;\n});\nDialogResponsiveTitle.displayName = \"DialogResponsiveTitle\";\n\nconst DialogResponsiveDescription: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogDescription> &\n React.RefAttributes<HTMLParagraphElement>\n> = React.forwardRef(({ className, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerDescription : DialogDescription;\n\n return <Comp ref={ref} className={className} {...props} />;\n});\nDialogResponsiveDescription.displayName = \"DialogResponsiveDescription\";\n\nexport {\n DialogResponsive,\n DialogResponsiveTrigger,\n DialogResponsiveClose,\n DialogResponsiveContent,\n DialogResponsiveHeader,\n DialogResponsiveFooter,\n DialogResponsiveTitle,\n DialogResponsiveDescription,\n useDialogResponsive,\n};\n"],
|
|
5
|
-
"mappings": "0TAEA,UAAYA,MAAW,QAuDb,cAAAC,MAAA,oBA1BV,IAAMC,EACE,gBAA2C,CAC/C,QAAS,EACX,CAAC,EAEGC,EAAsB,IAAY,aAAWD,CAAuB,EAQpEE,EAAmB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AAE,QAAAT,CAAQ,EAAIL,EAAoB,EAGxC,OAAOF,EAFMO,EAAUkC,EAAoBC,EAEnCpB,EAAA,CAAK,IAAKP,EAAK,UAAWE,GAAeC,EAAO,CAC1D,CAAC,EACDsB,EAA4B,YAAc",
|
|
6
|
-
"names": ["React", "jsx", "DialogResponsiveContext", "useDialogResponsive", "DialogResponsive", "children", "open", "onOpenChange", "isTouch", "useIsTouchDevice", "contextValue", "Drawer", "DrawerVirtualKeyboardProvider", "Dialog", "DialogResponsiveTrigger", "_a", "ref", "_b", "className", "props", "__objRest", "DrawerTrigger", "DialogTrigger", "__spreadValues", "DialogResponsiveClose", "DrawerClose", "DialogClose", "DialogResponsiveContent", "DrawerContent", "DialogContent", "__spreadProps", "DialogResponsiveHeader", "DrawerHeader", "DialogHeader", "DialogResponsiveFooter", "DrawerFooter", "DialogFooter", "cn", "DialogResponsiveTitle", "DrawerTitle", "DialogTitle", "DialogResponsiveDescription", "DrawerDescription", "DialogDescription"]
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/dialog-responsive/index.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/components/dialog\";\nimport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n DrawerTrigger,\n DrawerVirtualKeyboardProvider,\n} from \"@/components/drawer\";\nimport { useIsTouchDevice } from \"@/hooks/use-is-touch-device\";\n\ntype DialogResponsiveContextType = {\n isTouch: boolean;\n};\n\nconst DialogResponsiveContext =\n React.createContext<DialogResponsiveContextType>({\n isTouch: false,\n });\n\nconst useDialogResponsive = () => React.useContext(DialogResponsiveContext);\n\ntype DialogResponsiveProps = {\n children: React.ReactNode;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n};\n\nconst DialogResponsive = ({\n children,\n open,\n onOpenChange,\n}: DialogResponsiveProps) => {\n const isTouch = useIsTouchDevice();\n\n const contextValue = React.useMemo(() => ({ isTouch }), [isTouch]);\n\n if (isTouch) {\n return (\n <DialogResponsiveContext.Provider key=\"touch\" value={contextValue}>\n <Drawer open={open} onOpenChange={onOpenChange}>\n <DrawerVirtualKeyboardProvider>\n {children}\n </DrawerVirtualKeyboardProvider>\n </Drawer>\n </DialogResponsiveContext.Provider>\n );\n }\n\n return (\n <DialogResponsiveContext.Provider key=\"desktop\" value={contextValue}>\n <Dialog open={open} onOpenChange={onOpenChange}>\n {children}\n </Dialog>\n </DialogResponsiveContext.Provider>\n );\n};\n\nconst DialogResponsiveTrigger: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogTrigger> &\n React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef(({ className, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerTrigger : DialogTrigger;\n\n return <Comp ref={ref} className={className} {...props} />;\n});\nDialogResponsiveTrigger.displayName = \"DialogResponsiveTrigger\";\n\nconst DialogResponsiveClose: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogClose> &\n React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef(({ className, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerClose : DialogClose;\n\n return <Comp ref={ref} className={className} {...props} />;\n});\nDialogResponsiveClose.displayName = \"DialogResponsiveClose\";\n\nconst DialogResponsiveContent: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogContent> &\n React.RefAttributes<HTMLDivElement>\n> = React.forwardRef(({ className, children, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerContent : DialogContent;\n\n return (\n <Comp ref={ref} className={className} {...props}>\n {children}\n </Comp>\n );\n});\nDialogResponsiveContent.displayName = \"DialogResponsiveContent\";\n\nconst DialogResponsiveHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerHeader : DialogHeader;\n\n return <Comp className={className} {...props} />;\n};\nDialogResponsiveHeader.displayName = \"DialogResponsiveHeader\";\n\nconst DialogResponsiveFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerFooter : DialogFooter;\n\n return (\n <Comp\n className={cn(\"grid grid-cols-1 gap-2 px-4 pb-safe pt-1\", className)}\n {...props}\n />\n );\n};\nDialogResponsiveFooter.displayName = \"DialogResponsiveFooter\";\n\nconst DialogResponsiveTitle: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogTitle> &\n React.RefAttributes<HTMLHeadingElement>\n> = React.forwardRef(({ className, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerTitle : DialogTitle;\n\n return <Comp ref={ref} className={className} {...props} />;\n});\nDialogResponsiveTitle.displayName = \"DialogResponsiveTitle\";\n\nconst DialogResponsiveDescription: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof DialogDescription> &\n React.RefAttributes<HTMLParagraphElement>\n> = React.forwardRef(({ className, ...props }, ref) => {\n const { isTouch } = useDialogResponsive();\n const Comp = isTouch ? DrawerDescription : DialogDescription;\n\n return <Comp ref={ref} className={className} {...props} />;\n});\nDialogResponsiveDescription.displayName = \"DialogResponsiveDescription\";\n\nexport {\n DialogResponsive,\n DialogResponsiveTrigger,\n DialogResponsiveClose,\n DialogResponsiveContent,\n DialogResponsiveHeader,\n DialogResponsiveFooter,\n DialogResponsiveTitle,\n DialogResponsiveDescription,\n useDialogResponsive,\n};\n"],
|
|
5
|
+
"mappings": "0TAEA,UAAYA,MAAW,QAuDb,cAAAC,MAAA,oBA1B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IAAAC,EAAAF,EAAE,WAAAG,CAxJxB,EAwJsBD,EAAgBE,EAAAC,EAAhBH,EAAgB,CAAd,cACtB,GAAM,CAAE,QAAAT,CAAQ,EAAIL,EAAoB,EAGxC,OAAOF,EAFMO,EAAUkC,EAAoBC,EAEnCpB,EAAA,CAAK,IAAKP,EAAK,UAAWE,GAAeC,EAAO,CAC1D,CAAC,EACDsB,EAA4B,YAAc",
|
|
6
|
+
"names": ["React", "jsx", "DialogResponsiveContext", "useDialogResponsive", "DialogResponsive", "children", "open", "onOpenChange", "isTouch", "useIsTouchDevice", "contextValue", "Drawer", "DrawerVirtualKeyboardProvider", "Dialog", "DialogResponsiveTrigger", "_a", "ref", "_b", "className", "props", "__objRest", "DrawerTrigger", "DialogTrigger", "__spreadValues", "DialogResponsiveClose", "DrawerClose", "DialogClose", "DialogResponsiveContent", "DrawerContent", "DialogContent", "__spreadProps", "DialogResponsiveHeader", "DrawerHeader", "DialogHeader", "DialogResponsiveFooter", "DrawerFooter", "DialogFooter", "cn", "DialogResponsiveTitle", "DrawerTitle", "DialogTitle", "DialogResponsiveDescription", "DrawerDescription", "DialogDescription"]
|
|
7
|
+
}
|
package/dist/chunk-A4EVMSOO.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as C,b as T,i as y,j as h,m as x,n as g}from"./chunk-VIGX5NKJ.js";import{a as l,b as f,d as D,g as M}from"./chunk-7EVFMYIH.js";import{a as v}from"./chunk-46MFR2CI.js";import{a as R}from"./chunk-WIFBPNRH.js";import{a,b as w,c as i}from"./chunk-WHECA25N.js";import*as p from"react";import{Fragment as S,jsx as n}from"react/jsx-runtime";var m=p.createContext({isTouch:!1}),d=()=>p.useContext(m),b=({children:e,open:o,onOpenChange:s})=>{let t=v(),r=p.useMemo(()=>({isTouch:t}),[t]);return t?n(m.Provider,{value:r,children:n(l,{open:o,onOpenChange:s,children:e})}):n(m.Provider,{value:r,children:n(C,{open:o,onOpenChange:s,children:e})})};b.displayName="DropdownMenuResponsive";var P=p.forwardRef((t,s)=>{var r=t,{className:e}=r,o=i(r,["className"]);let{isTouch:u}=d();return n(u?f:T,a({ref:s,className:e},o))});P.displayName="DropdownMenuResponsiveTrigger";var L=p.forwardRef((r,t)=>{var u=r,{className:e,children:o}=u,s=i(u,["className","children"]);let{isTouch:c}=d();return c?n(M,{ref:t,className:e,children:n("div",{className:"pb-safe flex flex-col",children:o})}):n(y,w(a({ref:t,className:e},s),{children:o}))});L.displayName="DropdownMenuResponsiveContent";var E=p.forwardRef((u,r)=>{var c=u,{className:e,children:o,onClick:s}=c,t=i(c,["className","children","onClick"]);let{isTouch:N}=d();return N?n(D,{asChild:!0,children:n("button",{className:R("flex w-full items-center gap-2 px-4 py-3 text-sm transition-colors hover:bg-accent focus:outline-none",e),onClick:s,children:o})}):n(h,w(a({ref:r,className:e,onClick:s},t),{children:o}))});E.displayName="DropdownMenuResponsiveItem";var H=s=>{var t=s,{className:e}=t,o=i(t,["className"]);let{isTouch:r}=d();return r?n("div",a({className:R("px-4 py-2 text-xs font-semibold text-muted-foreground",e)},o)):n(x,a({className:e},o))};H.displayName="DropdownMenuResponsiveLabel";var I=s=>{var t=s,{className:e}=t,o=i(t,["className"]);let{isTouch:r}=d();return r?n("hr",{className:R("my-1 border-muted",e)}):n(g,a({className:e},o))};I.displayName="DropdownMenuResponsiveSeparator";var W=p.forwardRef((t,s)=>{var r=t,{children:e}=r,o=i(r,["children"]);let{isTouch:u}=d();return u?n(D,w(a({ref:s},o),{children:e})):n(S,{children:e})});W.displayName="DropdownMenuResponsiveClose";export{d as a,b,P as c,L as d,E as e,H as f,I as g,W as h};
|
|
2
|
-
//# sourceMappingURL=chunk-A4EVMSOO.js.map
|
|
1
|
+
import{a as C,b as T,i as y,j as h,m as x,n as g}from"./chunk-VIGX5NKJ.js";import{a as l,b as f,d as D,g as M}from"./chunk-7EVFMYIH.js";import{a as v}from"./chunk-46MFR2CI.js";import{a as R}from"./chunk-WIFBPNRH.js";import{a,b as w,c as i}from"./chunk-WHECA25N.js";import*as p from"react";import{Fragment as S,jsx as n}from"react/jsx-runtime";var m=p.createContext({isTouch:!1}),d=()=>p.useContext(m),b=({children:e,open:o,onOpenChange:s})=>{let t=v(),r=p.useMemo(()=>({isTouch:t}),[t]);return t?n(m.Provider,{value:r,children:n(l,{open:o,onOpenChange:s,children:e})}):n(m.Provider,{value:r,children:n(C,{open:o,onOpenChange:s,children:e})})};b.displayName="DropdownMenuResponsive";var P=p.forwardRef((t,s)=>{var r=t,{className:e}=r,o=i(r,["className"]);let{isTouch:u}=d();return n(u?f:T,a({ref:s,className:e},o))});P.displayName="DropdownMenuResponsiveTrigger";var L=p.forwardRef((r,t)=>{var u=r,{className:e,children:o}=u,s=i(u,["className","children"]);let{isTouch:c}=d();return c?n(M,{ref:t,className:e,children:n("div",{className:"pb-safe flex flex-col",children:o})}):n(y,w(a({ref:t,className:e},s),{children:o}))});L.displayName="DropdownMenuResponsiveContent";var E=p.forwardRef((u,r)=>{var c=u,{className:e,children:o,onClick:s}=c,t=i(c,["className","children","onClick"]);let{isTouch:N}=d();return N?n(D,{asChild:!0,children:n("button",{className:R("flex w-full items-center gap-2 px-4 py-3 text-sm transition-colors hover:bg-accent focus:outline-none",e),onClick:s,children:o})}):n(h,w(a({ref:r,className:e,onClick:s},t),{children:o}))});E.displayName="DropdownMenuResponsiveItem";var H=s=>{var t=s,{className:e}=t,o=i(t,["className"]);let{isTouch:r}=d();return r?n("div",a({className:R("px-4 py-2 text-xs font-semibold text-muted-foreground",e)},o)):n(x,a({className:e},o))};H.displayName="DropdownMenuResponsiveLabel";var I=s=>{var t=s,{className:e}=t,o=i(t,["className"]);let{isTouch:r}=d();return r?n("hr",{className:R("my-1 border-muted",e)}):n(g,a({className:e},o))};I.displayName="DropdownMenuResponsiveSeparator";var W=p.forwardRef((t,s)=>{var r=t,{children:e}=r,o=i(r,["children"]);let{isTouch:u}=d();return u?n(D,w(a({ref:s},o),{children:e})):n(S,{children:e})});W.displayName="DropdownMenuResponsiveClose";export{d as a,b,P as c,L as d,E as e,H as f,I as g,W as h};
|
|
2
|
+
//# sourceMappingURL=chunk-A4EVMSOO.js.map
|