@popgrids/ui 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button.cjs +124 -7
- package/dist/button.cjs.map +1 -1
- package/dist/button.d.cts +8 -6
- package/dist/button.d.ts +8 -6
- package/dist/button.js +124 -7
- package/dist/button.js.map +1 -1
- package/dist/dialog.cjs +11 -11
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.d.cts +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dialog.js.map +1 -1
- package/dist/index.cjs +139 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +125 -121
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/notification-badge.d.cts +1 -1
- package/dist/notification-badge.d.ts +1 -1
- package/package.json +7 -6
package/dist/dialog.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/utils.ts","../src/components/dialog/dialog.tsx"],"names":["twMerge","clsx","jsx","DialogPrimitive","jsxs","XClose"],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACKA,SAAS,WAAW,KAAA,EAA0D;AAC5E,EAAA,uBAAOC,cAAA,CAACC,YAAA,CAAgB,IAAA,EAAhB,EAAsB,GAAG,KAAA,EAAO,CAAA;AAC1C;AAMA,SAAS,aAAa,KAAA,EAA4D;AAChF,EAAA,uBAAOD,cAAA,CAACC,YAAA,CAAgB,MAAA,EAAhB,EAAwB,GAAG,KAAA,EAAO,CAAA;AAC5C;AAMA,SAAS,cAAc,KAAA,EAA6D;AAClF,EAAA,uBAAOD,cAAA,CAACC,YAAA,CAAgB,OAAA,EAAh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,CAAkB;AAAA,EACzB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA6D;AAC3D,EAAA,uBACED,cAAA;AAAA,IAACC,YAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAW,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAgC;AAClF,EAAA,uBACED,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,MACtF,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uFAAA,EACZ,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"dialog.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react\";\nimport { XClose } from \"@untitledui/icons\";\nimport { cn } from \"../../lib/utils\";\n\n/* ---------------------------------------------\n * Root\n * --------------------------------------------- */\n\nfunction DialogRoot(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\n/* ---------------------------------------------\n * Portal\n * --------------------------------------------- */\n\nfunction DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\n/* ---------------------------------------------\n * Trigger\n * --------------------------------------------- */\n\nfunction DialogTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger {...props} />;\n}\n\n/* ---------------------------------------------\n * Close\n * --------------------------------------------- */\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close {...props} />;\n}\n\n/* ---------------------------------------------\n * Overlay (Backdrop)\n * --------------------------------------------- */\n\nfunction DialogBackdrop({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n className={cn(\n \"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70\",\n \"data-closed:opacity-0 data-open:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogViewport({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Viewport>) {\n return (\n <DialogPrimitive.Viewport\n className={cn(\n \"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------------------\n * Content (Popup)\n * --------------------------------------------- */\n\nfunction DialogPopup({\n className,\n children,\n bottom = false,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n bottom?: boolean;\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogBackdrop />\n <DialogPrimitive.Popup className=\"group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\">\n {showCloseButton && (\n <DialogClose\n className=\"pointer-events-auto fixed top-[15px] left-5 z-50\"\n aria-label=\"Close\"\n >\n <span className=\"sr-only\">Close</span>\n <span className=\"before:bg-tint-700-reversed relative block before:absolute before:-inset-1.5 before:rounded-full before:backdrop-blur-sm\">\n <span className=\"bg-primary-foreground text-background relative z-10 flex size-10 items-center justify-center rounded-full\">\n <XClose className=\"size-[18px]\" />\n </span>\n </span>\n </DialogClose>\n )}\n <div\n className={cn(\n \"bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-full max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all\",\n {\n \"group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0\":\n !bottom,\n \"group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-200 group-data-closed/popup:ease-[cubic-bezier(1,0,0.72,0.32)] group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-300 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full\":\n bottom,\n },\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </DialogPrimitive.Popup>\n </DialogPrimitive.Portal>\n );\n}\n\n/* ---------------------------------------------\n * Header / Footer\n * --------------------------------------------- */\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)} {...props} />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex flex-col-reverse gap-2 sm:flex-row\", className)} {...props} />;\n}\n\n/* ---------------------------------------------\n * Title / Description\n * --------------------------------------------- */\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogBody({ className, children, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"flex shrink-0 grow basis-0 flex-col items-start self-stretch\", className)}\n {...props}\n >\n <div className=\"flex shrink-0 grow basis-0 flex-col items-start gap-10 self-stretch overflow-auto p-4\">\n {children}\n </div>\n </div>\n );\n}\n/* ---------------------------------------------\n * Exports (preserve your public API)\n * --------------------------------------------- */\n\nexport {\n DialogRoot as Dialog,\n DialogBackdrop,\n DialogBody,\n DialogClose,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogPopup,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogViewport,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/dialog/dialog.tsx"],"names":["twMerge","clsx","jsx","DialogPrimitive","jsxs","XClose"],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACKA,SAAS,WAAW,KAAA,EAA0D;AAC5E,EAAA,uBAAOC,cAAA,CAACC,aAAA,CAAgB,IAAA,EAAhB,EAAsB,GAAG,KAAA,EAAO,CAAA;AAC1C;AAMA,SAAS,aAAa,KAAA,EAA4D;AAChF,EAAA,uBAAOD,cAAA,CAACC,aAAA,CAAgB,MAAA,EAAhB,EAAwB,GAAG,KAAA,EAAO,CAAA;AAC5C;AAMA,SAAS,cAAc,KAAA,EAA6D;AAClF,EAAA,uBAAOD,cAAA,CAACC,aAAA,CAAgB,OAAA,EAAhB,EAAyB,GAAG,KAAA,EAAO,CAAA;AAC7C;AAMA,SAAS,YAAY,KAAA,EAA2D;AAC9E,EAAA,uBAAOD,cAAA,CAACC,aAAA,CAAgB,KAAA,EAAhB,EAAu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MACC,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAW,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAgC;AAClF,EAAA,uBACED,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,MACtF,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uFAAA,EACZ,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"dialog.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\";\nimport { XClose } from \"@untitledui/icons\";\nimport { cn } from \"../../lib/utils\";\n\n/* ---------------------------------------------\n * Root\n * --------------------------------------------- */\n\nfunction DialogRoot(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\n/* ---------------------------------------------\n * Portal\n * --------------------------------------------- */\n\nfunction DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\n/* ---------------------------------------------\n * Trigger\n * --------------------------------------------- */\n\nfunction DialogTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger {...props} />;\n}\n\n/* ---------------------------------------------\n * Close\n * --------------------------------------------- */\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close {...props} />;\n}\n\n/* ---------------------------------------------\n * Overlay (Backdrop)\n * --------------------------------------------- */\n\nfunction DialogBackdrop({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n className={cn(\n \"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70\",\n \"data-closed:opacity-0 data-open:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogViewport({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Viewport>) {\n return (\n <DialogPrimitive.Viewport\n className={cn(\n \"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------------------\n * Content (Popup)\n * --------------------------------------------- */\n\nfunction DialogPopup({\n className,\n children,\n bottom = false,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n bottom?: boolean;\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogBackdrop />\n <DialogPrimitive.Popup className=\"group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\">\n {showCloseButton && (\n <DialogClose\n className=\"pointer-events-auto fixed top-[15px] left-5 z-50\"\n aria-label=\"Close\"\n >\n <span className=\"sr-only\">Close</span>\n <span className=\"before:bg-tint-700-reversed relative block before:absolute before:-inset-1.5 before:rounded-full before:backdrop-blur-sm\">\n <span className=\"bg-primary-foreground text-background relative z-10 flex size-10 items-center justify-center rounded-full\">\n <XClose className=\"size-[18px]\" />\n </span>\n </span>\n </DialogClose>\n )}\n <div\n className={cn(\n \"bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-full max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all\",\n {\n \"group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0\":\n !bottom,\n \"group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-200 group-data-closed/popup:ease-[cubic-bezier(1,0,0.72,0.32)] group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-300 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full\":\n bottom,\n },\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </DialogPrimitive.Popup>\n </DialogPrimitive.Portal>\n );\n}\n\n/* ---------------------------------------------\n * Header / Footer\n * --------------------------------------------- */\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)} {...props} />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex flex-col-reverse gap-2 sm:flex-row\", className)} {...props} />;\n}\n\n/* ---------------------------------------------\n * Title / Description\n * --------------------------------------------- */\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogBody({ className, children, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"flex shrink-0 grow basis-0 flex-col items-start self-stretch\", className)}\n {...props}\n >\n <div className=\"flex shrink-0 grow basis-0 flex-col items-start gap-10 self-stretch overflow-auto p-4\">\n {children}\n </div>\n </div>\n );\n}\n/* ---------------------------------------------\n * Exports (preserve your public API)\n * --------------------------------------------- */\n\nexport {\n DialogRoot as Dialog,\n DialogBackdrop,\n DialogBody,\n DialogClose,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogPopup,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogViewport\n};\n"]}
|
package/dist/dialog.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Dialog } from '@base-ui/react';
|
|
2
|
+
import { Dialog } from '@base-ui/react/dialog';
|
|
3
3
|
|
|
4
4
|
declare function DialogRoot(props: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare function DialogPortal(props: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime.JSX.Element;
|
package/dist/dialog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Dialog } from '@base-ui/react';
|
|
2
|
+
import { Dialog } from '@base-ui/react/dialog';
|
|
3
3
|
|
|
4
4
|
declare function DialogRoot(props: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare function DialogPortal(props: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime.JSX.Element;
|
package/dist/dialog.js
CHANGED
package/dist/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/utils.ts","../src/components/dialog/dialog.tsx"],"names":["DialogPrimitive"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;A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AW,GAAG,OAAM,EAAgC;AAC1E,EAAA,uBAAO,GAAA,CAAC,SAAI,SAAA,EAAW,EAAA,CAAG,2CAA2C,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAC9F;AAMA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAuD;AAChG,EAAA,uBACE,GAAA;AAAA,IAACA,MAAA,CAAgB,KAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA;AAAA,MAC5D,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,CAAkB;AAAA,EACzB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA6D;AAC3D,EAAA,uBACE,GAAA;AAAA,IAACA,MAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAW,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAgC;AAClF,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,MACtF,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uFAAA,EACZ,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react\";\nimport { XClose } from \"@untitledui/icons\";\nimport { cn } from \"../../lib/utils\";\n\n/* ---------------------------------------------\n * Root\n * --------------------------------------------- */\n\nfunction DialogRoot(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\n/* ---------------------------------------------\n * Portal\n * --------------------------------------------- */\n\nfunction DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\n/* ---------------------------------------------\n * Trigger\n * --------------------------------------------- */\n\nfunction DialogTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger {...props} />;\n}\n\n/* ---------------------------------------------\n * Close\n * --------------------------------------------- */\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close {...props} />;\n}\n\n/* ---------------------------------------------\n * Overlay (Backdrop)\n * --------------------------------------------- */\n\nfunction DialogBackdrop({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n className={cn(\n \"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70\",\n \"data-closed:opacity-0 data-open:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogViewport({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Viewport>) {\n return (\n <DialogPrimitive.Viewport\n className={cn(\n \"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------------------\n * Content (Popup)\n * --------------------------------------------- */\n\nfunction DialogPopup({\n className,\n children,\n bottom = false,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n bottom?: boolean;\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogBackdrop />\n <DialogPrimitive.Popup className=\"group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\">\n {showCloseButton && (\n <DialogClose\n className=\"pointer-events-auto fixed top-[15px] left-5 z-50\"\n aria-label=\"Close\"\n >\n <span className=\"sr-only\">Close</span>\n <span className=\"before:bg-tint-700-reversed relative block before:absolute before:-inset-1.5 before:rounded-full before:backdrop-blur-sm\">\n <span className=\"bg-primary-foreground text-background relative z-10 flex size-10 items-center justify-center rounded-full\">\n <XClose className=\"size-[18px]\" />\n </span>\n </span>\n </DialogClose>\n )}\n <div\n className={cn(\n \"bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-full max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all\",\n {\n \"group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0\":\n !bottom,\n \"group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-200 group-data-closed/popup:ease-[cubic-bezier(1,0,0.72,0.32)] group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-300 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full\":\n bottom,\n },\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </DialogPrimitive.Popup>\n </DialogPrimitive.Portal>\n );\n}\n\n/* ---------------------------------------------\n * Header / Footer\n * --------------------------------------------- */\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)} {...props} />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex flex-col-reverse gap-2 sm:flex-row\", className)} {...props} />;\n}\n\n/* ---------------------------------------------\n * Title / Description\n * --------------------------------------------- */\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogBody({ className, children, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"flex shrink-0 grow basis-0 flex-col items-start self-stretch\", className)}\n {...props}\n >\n <div className=\"flex shrink-0 grow basis-0 flex-col items-start gap-10 self-stretch overflow-auto p-4\">\n {children}\n </div>\n </div>\n );\n}\n/* ---------------------------------------------\n * Exports (preserve your public API)\n * --------------------------------------------- */\n\nexport {\n DialogRoot as Dialog,\n DialogBackdrop,\n DialogBody,\n DialogClose,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogPopup,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogViewport,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/dialog/dialog.tsx"],"names":["DialogPrimitive"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACKA,SAAS,WAAW,KAAA,EAA0D;AAC5E,EAAA,uBAAO,GAAA,CAACA,MAAA,CAAgB,IAAA,EAAhB,EAAsB,GAAG,KAAA,EAAO,CAAA;A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OAAM,EAAuD;AAChG,EAAA,uBACE,GAAA;AAAA,IAACA,MAAA,CAAgB,KAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA;AAAA,MAC5D,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,CAAkB;AAAA,EACzB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA6D;AAC3D,EAAA,uBACE,GAAA;AAAA,IAACA,MAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAW,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAgC;AAClF,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,MACtF,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uFAAA,EACZ,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\";\nimport { XClose } from \"@untitledui/icons\";\nimport { cn } from \"../../lib/utils\";\n\n/* ---------------------------------------------\n * Root\n * --------------------------------------------- */\n\nfunction DialogRoot(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\n/* ---------------------------------------------\n * Portal\n * --------------------------------------------- */\n\nfunction DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\n/* ---------------------------------------------\n * Trigger\n * --------------------------------------------- */\n\nfunction DialogTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger {...props} />;\n}\n\n/* ---------------------------------------------\n * Close\n * --------------------------------------------- */\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close {...props} />;\n}\n\n/* ---------------------------------------------\n * Overlay (Backdrop)\n * --------------------------------------------- */\n\nfunction DialogBackdrop({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n className={cn(\n \"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70\",\n \"data-closed:opacity-0 data-open:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogViewport({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Viewport>) {\n return (\n <DialogPrimitive.Viewport\n className={cn(\n \"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------------------\n * Content (Popup)\n * --------------------------------------------- */\n\nfunction DialogPopup({\n className,\n children,\n bottom = false,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n bottom?: boolean;\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogBackdrop />\n <DialogPrimitive.Popup className=\"group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\">\n {showCloseButton && (\n <DialogClose\n className=\"pointer-events-auto fixed top-[15px] left-5 z-50\"\n aria-label=\"Close\"\n >\n <span className=\"sr-only\">Close</span>\n <span className=\"before:bg-tint-700-reversed relative block before:absolute before:-inset-1.5 before:rounded-full before:backdrop-blur-sm\">\n <span className=\"bg-primary-foreground text-background relative z-10 flex size-10 items-center justify-center rounded-full\">\n <XClose className=\"size-[18px]\" />\n </span>\n </span>\n </DialogClose>\n )}\n <div\n className={cn(\n \"bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-full max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all\",\n {\n \"group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0\":\n !bottom,\n \"group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-200 group-data-closed/popup:ease-[cubic-bezier(1,0,0.72,0.32)] group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-300 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full\":\n bottom,\n },\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </DialogPrimitive.Popup>\n </DialogPrimitive.Portal>\n );\n}\n\n/* ---------------------------------------------\n * Header / Footer\n * --------------------------------------------- */\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)} {...props} />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex flex-col-reverse gap-2 sm:flex-row\", className)} {...props} />;\n}\n\n/* ---------------------------------------------\n * Title / Description\n * --------------------------------------------- */\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogBody({ className, children, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"flex shrink-0 grow basis-0 flex-col items-start self-stretch\", className)}\n {...props}\n >\n <div className=\"flex shrink-0 grow basis-0 flex-col items-start gap-10 self-stretch overflow-auto p-4\">\n {children}\n </div>\n </div>\n );\n}\n/* ---------------------------------------------\n * Exports (preserve your public API)\n * --------------------------------------------- */\n\nexport {\n DialogRoot as Dialog,\n DialogBackdrop,\n DialogBody,\n DialogClose,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogPopup,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogViewport\n};\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -5,19 +5,132 @@ var classVarianceAuthority = require('class-variance-authority');
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var
|
|
8
|
+
var dialog = require('@base-ui/react/dialog');
|
|
9
9
|
var icons = require('@untitledui/icons');
|
|
10
10
|
var menu = require('@base-ui/react/menu');
|
|
11
11
|
var input = require('@base-ui/react/input');
|
|
12
12
|
var mergeProps = require('@base-ui/react/merge-props');
|
|
13
13
|
var useRender = require('@base-ui/react/use-render');
|
|
14
|
-
var react
|
|
14
|
+
var react = require('react');
|
|
15
15
|
var tooltip = require('@base-ui/react/tooltip');
|
|
16
16
|
|
|
17
17
|
// src/components/button/button.tsx
|
|
18
18
|
function cn(...inputs) {
|
|
19
19
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
20
20
|
}
|
|
21
|
+
var loaderVariants = classVarianceAuthority.cva("flex shrink-0 items-center justify-center", {
|
|
22
|
+
variants: {
|
|
23
|
+
theme: {
|
|
24
|
+
default: "[--loader-foreground:var(--foreground)] [--loader-background:var(--foreground)]",
|
|
25
|
+
reversed: "[--loader-foreground:var(--background)] [--loader-background:var(--foreground)]",
|
|
26
|
+
black: "[--loader-foreground:var(--color-brand-midnight-900)] [--loader-background:var(--color-grayscale-300)]",
|
|
27
|
+
white: "[--loader-foreground:var(--color-grayscale-300)] [--loader-background:var(--color-brand-midnight-900)]"
|
|
28
|
+
},
|
|
29
|
+
variant: {
|
|
30
|
+
spinner: "size-5 motion-reduce:animate-none",
|
|
31
|
+
loader: "relative flex h-[13px] w-[23px] motion-reduce:animate-none"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
theme: "default",
|
|
36
|
+
variant: "spinner"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
var spinnerFgVariants = classVarianceAuthority.cva("", {
|
|
40
|
+
variants: {
|
|
41
|
+
theme: {
|
|
42
|
+
default: "fill-foreground opacity-[0.06]",
|
|
43
|
+
reversed: "fill-white opacity-10",
|
|
44
|
+
black: "fill-black opacity-[0.04]",
|
|
45
|
+
white: "fill-white opacity-[0.04]"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
var spinnerBgVariants = classVarianceAuthority.cva("", {
|
|
50
|
+
variants: {
|
|
51
|
+
theme: {
|
|
52
|
+
default: "fill-foreground",
|
|
53
|
+
reversed: "fill-background",
|
|
54
|
+
black: "fill-black opacity-[0.98]",
|
|
55
|
+
white: "fill-white opacity-[0.98]"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
function Loader({
|
|
60
|
+
theme = "default",
|
|
61
|
+
variant = "spinner",
|
|
62
|
+
className,
|
|
63
|
+
style,
|
|
64
|
+
...props
|
|
65
|
+
}) {
|
|
66
|
+
const dotCount = 21;
|
|
67
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
"data-slot": "loader",
|
|
71
|
+
className: cn(
|
|
72
|
+
loaderVariants({ theme, variant }),
|
|
73
|
+
variant === "spinner" && "animate-spin",
|
|
74
|
+
className
|
|
75
|
+
),
|
|
76
|
+
...props,
|
|
77
|
+
children: variant === "spinner" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
78
|
+
"svg",
|
|
79
|
+
{
|
|
80
|
+
width: "20",
|
|
81
|
+
height: "20",
|
|
82
|
+
viewBox: "0 0 20 20",
|
|
83
|
+
fill: "none",
|
|
84
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Loading spinner" }),
|
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { clipPath: "url(#pop_loader_clip_path)", children: [
|
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
89
|
+
"path",
|
|
90
|
+
{
|
|
91
|
+
className: spinnerFgVariants({ theme }),
|
|
92
|
+
d: "M20 10C20 15.5137 15.5137 20 10 20C4.48628 20 6.78126e-07 15.5137 4.37114e-07 10C1.96101e-07 4.48627 4.48627 3.50301e-07 10 1.09288e-07C15.5137 -1.31724e-07 20 4.48627 20 10ZM2.35294 10C2.35294 14.2196 5.78039 17.6471 10 17.6471C14.2196 17.6471 17.6471 14.2196 17.6471 10C17.6471 5.78039 14.2196 2.35294 10 2.35294C5.78039 2.35294 2.35294 5.78039 2.35294 10Z"
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
"path",
|
|
97
|
+
{
|
|
98
|
+
className: spinnerBgVariants({ theme }),
|
|
99
|
+
d: "M20 10L17.6471 10C17.6471 5.78039 14.2196 2.35294 10 2.35294L10 7.10315e-07C15.5137 4.69302e-07 20 4.48627 20 10Z"
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "pop_loader_clip_path", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
+
"rect",
|
|
105
|
+
{
|
|
106
|
+
width: "20",
|
|
107
|
+
height: "20",
|
|
108
|
+
fill: "white",
|
|
109
|
+
transform: "translate(8.74228e-07 20) rotate(-90)"
|
|
110
|
+
}
|
|
111
|
+
) }) })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from({ length: dotCount }, (_, index) => {
|
|
115
|
+
const delaySeconds = index * 0.035;
|
|
116
|
+
return (
|
|
117
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Dots are static and ordered
|
|
118
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
className: "bg-grayscale-200 dark:bg-grayscale-700 animate-loader-wave absolute top-0 size-[3px] rounded-full motion-reduce:animate-none",
|
|
122
|
+
style: {
|
|
123
|
+
left: `${index}px`,
|
|
124
|
+
animationDelay: `${delaySeconds}s`
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
index
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
}) })
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
21
134
|
var buttonVariants = classVarianceAuthority.cva(
|
|
22
135
|
"inline-flex relative items-center gap-1.5 whitespace-nowrap font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 text-foreground bg-background group/button outline-none focus-visible:border-ring-3 focus-visible:ring-ring/60 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
23
136
|
{
|
|
@@ -214,17 +327,19 @@ var tintVariants = classVarianceAuthority.cva(
|
|
|
214
327
|
}
|
|
215
328
|
);
|
|
216
329
|
function Button({
|
|
217
|
-
|
|
330
|
+
align = "center",
|
|
218
331
|
children,
|
|
332
|
+
className,
|
|
219
333
|
collapsed = false,
|
|
220
|
-
|
|
221
|
-
align = "center",
|
|
334
|
+
leading,
|
|
222
335
|
outline = false,
|
|
223
336
|
pill = false,
|
|
337
|
+
loading = false,
|
|
338
|
+
loadingElement,
|
|
224
339
|
size = "default",
|
|
225
340
|
theme = "brand",
|
|
226
|
-
leading,
|
|
227
341
|
trailing,
|
|
342
|
+
variant = "default",
|
|
228
343
|
...props
|
|
229
344
|
}) {
|
|
230
345
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -248,12 +363,14 @@ function Button({
|
|
|
248
363
|
),
|
|
249
364
|
...props,
|
|
250
365
|
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
251
|
-
|
|
252
|
-
|
|
366
|
+
loading && (loadingElement || /* @__PURE__ */ jsxRuntime.jsx(Loader, { className: "absolute inset-0 m-auto", variant: "spinner", theme: "reversed" })),
|
|
367
|
+
leading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("group-aria-busy/button:opacity-0 transition-opacity", { "opacity-0": loading }), children: leading }),
|
|
368
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("min-w-[18px] truncate relative transition-opacity", { "opacity-0": loading }), children }),
|
|
253
369
|
trailing && /* @__PURE__ */ jsxRuntime.jsx(
|
|
254
370
|
"div",
|
|
255
371
|
{
|
|
256
|
-
className: cn("group-aria-busy/button:opacity-0", {
|
|
372
|
+
className: cn("group-aria-busy/button:opacity-0 transition-opacity", {
|
|
373
|
+
"opacity-0": loading,
|
|
257
374
|
"absolute top-1/2 right-0 translate-x-1/2 -translate-y-1/2": collapsed
|
|
258
375
|
}),
|
|
259
376
|
children: trailing
|
|
@@ -276,23 +393,23 @@ function ContentBlock({ className, children, title, subhead, cta }) {
|
|
|
276
393
|
] });
|
|
277
394
|
}
|
|
278
395
|
function DialogRoot(props) {
|
|
279
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
396
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { ...props });
|
|
280
397
|
}
|
|
281
398
|
function DialogPortal(props) {
|
|
282
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
399
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Portal, { ...props });
|
|
283
400
|
}
|
|
284
401
|
function DialogTrigger(props) {
|
|
285
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
402
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Trigger, { ...props });
|
|
286
403
|
}
|
|
287
404
|
function DialogClose(props) {
|
|
288
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
405
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Close, { ...props });
|
|
289
406
|
}
|
|
290
407
|
function DialogBackdrop({
|
|
291
408
|
className,
|
|
292
409
|
...props
|
|
293
410
|
}) {
|
|
294
411
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
295
|
-
|
|
412
|
+
dialog.Dialog.Backdrop,
|
|
296
413
|
{
|
|
297
414
|
className: cn(
|
|
298
415
|
"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70",
|
|
@@ -308,7 +425,7 @@ function DialogViewport({
|
|
|
308
425
|
...props
|
|
309
426
|
}) {
|
|
310
427
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
311
|
-
|
|
428
|
+
dialog.Dialog.Viewport,
|
|
312
429
|
{
|
|
313
430
|
className: cn(
|
|
314
431
|
"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12",
|
|
@@ -325,9 +442,9 @@ function DialogPopup({
|
|
|
325
442
|
showCloseButton = true,
|
|
326
443
|
...props
|
|
327
444
|
}) {
|
|
328
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
445
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { children: [
|
|
329
446
|
/* @__PURE__ */ jsxRuntime.jsx(DialogBackdrop, {}),
|
|
330
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
447
|
+
/* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Popup, { className: "group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0", children: [
|
|
331
448
|
showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
332
449
|
DialogClose,
|
|
333
450
|
{
|
|
@@ -365,7 +482,7 @@ function DialogFooter({ className, ...props }) {
|
|
|
365
482
|
}
|
|
366
483
|
function DialogTitle({ className, ...props }) {
|
|
367
484
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
368
|
-
|
|
485
|
+
dialog.Dialog.Title,
|
|
369
486
|
{
|
|
370
487
|
className: cn("text-lg leading-none font-semibold", className),
|
|
371
488
|
...props
|
|
@@ -377,7 +494,7 @@ function DialogDescription({
|
|
|
377
494
|
...props
|
|
378
495
|
}) {
|
|
379
496
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
380
|
-
|
|
497
|
+
dialog.Dialog.Description,
|
|
381
498
|
{
|
|
382
499
|
className: cn("text-muted-foreground text-sm", className),
|
|
383
500
|
...props
|
|
@@ -806,119 +923,6 @@ function Label({ className, render, ...props }) {
|
|
|
806
923
|
props: mergeProps.mergeProps(defaultProps, props)
|
|
807
924
|
});
|
|
808
925
|
}
|
|
809
|
-
var loaderVariants = classVarianceAuthority.cva("flex shrink-0 items-center justify-center", {
|
|
810
|
-
variants: {
|
|
811
|
-
theme: {
|
|
812
|
-
default: "[--loader-foreground:var(--foreground)] [--loader-background:var(--foreground)]",
|
|
813
|
-
reversed: "[--loader-foreground:var(--background)] [--loader-background:var(--foreground)]",
|
|
814
|
-
black: "[--loader-foreground:var(--color-brand-midnight-900)] [--loader-background:var(--color-grayscale-300)]",
|
|
815
|
-
white: "[--loader-foreground:var(--color-grayscale-300)] [--loader-background:var(--color-brand-midnight-900)]"
|
|
816
|
-
},
|
|
817
|
-
variant: {
|
|
818
|
-
spinner: "size-5 motion-reduce:animate-none",
|
|
819
|
-
loader: "relative flex h-[13px] w-[23px] motion-reduce:animate-none"
|
|
820
|
-
}
|
|
821
|
-
},
|
|
822
|
-
defaultVariants: {
|
|
823
|
-
theme: "default",
|
|
824
|
-
variant: "spinner"
|
|
825
|
-
}
|
|
826
|
-
});
|
|
827
|
-
var spinnerFgVariants = classVarianceAuthority.cva("", {
|
|
828
|
-
variants: {
|
|
829
|
-
theme: {
|
|
830
|
-
default: "fill-foreground opacity-[0.06]",
|
|
831
|
-
reversed: "fill-white opacity-10",
|
|
832
|
-
black: "fill-black opacity-[0.04]",
|
|
833
|
-
white: "fill-white opacity-[0.04]"
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
});
|
|
837
|
-
var spinnerBgVariants = classVarianceAuthority.cva("", {
|
|
838
|
-
variants: {
|
|
839
|
-
theme: {
|
|
840
|
-
default: "fill-foreground",
|
|
841
|
-
reversed: "fill-background",
|
|
842
|
-
black: "fill-black opacity-[0.98]",
|
|
843
|
-
white: "fill-white opacity-[0.98]"
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
});
|
|
847
|
-
function Loader({
|
|
848
|
-
theme = "default",
|
|
849
|
-
variant = "spinner",
|
|
850
|
-
className,
|
|
851
|
-
style,
|
|
852
|
-
...props
|
|
853
|
-
}) {
|
|
854
|
-
const dotCount = 21;
|
|
855
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
856
|
-
"div",
|
|
857
|
-
{
|
|
858
|
-
"data-slot": "loader",
|
|
859
|
-
className: cn(
|
|
860
|
-
loaderVariants({ theme, variant }),
|
|
861
|
-
variant === "spinner" && "animate-spin",
|
|
862
|
-
className
|
|
863
|
-
),
|
|
864
|
-
...props,
|
|
865
|
-
children: variant === "spinner" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
866
|
-
"svg",
|
|
867
|
-
{
|
|
868
|
-
width: "20",
|
|
869
|
-
height: "20",
|
|
870
|
-
viewBox: "0 0 20 20",
|
|
871
|
-
fill: "none",
|
|
872
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
873
|
-
children: [
|
|
874
|
-
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Loading spinner" }),
|
|
875
|
-
/* @__PURE__ */ jsxRuntime.jsxs("g", { clipPath: "url(#pop_loader_clip_path)", children: [
|
|
876
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
877
|
-
"path",
|
|
878
|
-
{
|
|
879
|
-
className: spinnerFgVariants({ theme }),
|
|
880
|
-
d: "M20 10C20 15.5137 15.5137 20 10 20C4.48628 20 6.78126e-07 15.5137 4.37114e-07 10C1.96101e-07 4.48627 4.48627 3.50301e-07 10 1.09288e-07C15.5137 -1.31724e-07 20 4.48627 20 10ZM2.35294 10C2.35294 14.2196 5.78039 17.6471 10 17.6471C14.2196 17.6471 17.6471 14.2196 17.6471 10C17.6471 5.78039 14.2196 2.35294 10 2.35294C5.78039 2.35294 2.35294 5.78039 2.35294 10Z"
|
|
881
|
-
}
|
|
882
|
-
),
|
|
883
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
884
|
-
"path",
|
|
885
|
-
{
|
|
886
|
-
className: spinnerBgVariants({ theme }),
|
|
887
|
-
d: "M20 10L17.6471 10C17.6471 5.78039 14.2196 2.35294 10 2.35294L10 7.10315e-07C15.5137 4.69302e-07 20 4.48627 20 10Z"
|
|
888
|
-
}
|
|
889
|
-
)
|
|
890
|
-
] }),
|
|
891
|
-
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "pop_loader_clip_path", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
892
|
-
"rect",
|
|
893
|
-
{
|
|
894
|
-
width: "20",
|
|
895
|
-
height: "20",
|
|
896
|
-
fill: "white",
|
|
897
|
-
transform: "translate(8.74228e-07 20) rotate(-90)"
|
|
898
|
-
}
|
|
899
|
-
) }) })
|
|
900
|
-
]
|
|
901
|
-
}
|
|
902
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from({ length: dotCount }, (_, index) => {
|
|
903
|
-
const delaySeconds = index * 0.035;
|
|
904
|
-
return (
|
|
905
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: Dots are static and ordered
|
|
906
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
907
|
-
"div",
|
|
908
|
-
{
|
|
909
|
-
className: "bg-grayscale-200 dark:bg-grayscale-700 animate-loader-wave absolute top-0 size-[3px] rounded-full motion-reduce:animate-none",
|
|
910
|
-
style: {
|
|
911
|
-
left: `${index}px`,
|
|
912
|
-
animationDelay: `${delaySeconds}s`
|
|
913
|
-
}
|
|
914
|
-
},
|
|
915
|
-
index
|
|
916
|
-
)
|
|
917
|
-
);
|
|
918
|
-
}) })
|
|
919
|
-
}
|
|
920
|
-
);
|
|
921
|
-
}
|
|
922
926
|
var notificationBadgeVariants = classVarianceAuthority.cva(
|
|
923
927
|
"inline-flex items-center justify-center rounded-full box-border shrink-0 whitespace-nowrap text-xs font-medium leading-[18px] min-w-[18px] h-[18px] px-[5px] py-0 transition-[color,background-color,border-color]",
|
|
924
928
|
{
|
|
@@ -1035,8 +1039,8 @@ function SectionHeader({
|
|
|
1035
1039
|
description = void 0,
|
|
1036
1040
|
numberChecked = 0
|
|
1037
1041
|
}) {
|
|
1038
|
-
const [labelText, setLabelText] = react
|
|
1039
|
-
const updateLabel = react
|
|
1042
|
+
const [labelText, setLabelText] = react.useState("");
|
|
1043
|
+
const updateLabel = react.useCallback(() => {
|
|
1040
1044
|
if (required) {
|
|
1041
1045
|
if (numberChecked === 0) {
|
|
1042
1046
|
setLabelText(`${min}\u2013${max} Required`);
|
|
@@ -1057,7 +1061,7 @@ function SectionHeader({
|
|
|
1057
1061
|
}
|
|
1058
1062
|
}
|
|
1059
1063
|
}, [required, numberChecked, min, max]);
|
|
1060
|
-
react
|
|
1064
|
+
react.useEffect(() => {
|
|
1061
1065
|
updateLabel();
|
|
1062
1066
|
}, [updateLabel]);
|
|
1063
1067
|
return /* @__PURE__ */ jsxRuntime.jsx(
|